target
stringlengths 5
300
| feat_repo_name
stringlengths 6
76
| text
stringlengths 26
1.05M
|
---|---|---|
cm19/ReactJS/your-first-react-app-exercises-master/exercise-11/Friends.js | Brandon-J-Campbell/codemash | import React from 'react';
import Page from './Page';
import FriendProfile from './FriendProfile';
export default function Friends({ friends }) {
return (
<Page>
{friends.map(friend => (
<FriendProfile
key={friend.id}
name={friend.name}
image={friend.image}
/>
))}
</Page>
);
} |
app/containers/RepoListItem/index.js | jasoncyu/always-be-bulking | /**
* RepoListItem
*
* Lists the name and the issue count of a repository
*/
import React from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { selectCurrentUser } from 'containers/App/selectors';
import ListItem from 'components/ListItem';
import IssueIcon from 'components/IssueIcon';
import A from 'components/A';
import styles from './styles.css';
export class RepoListItem extends React.Component { // eslint-disable-line react/prefer-stateless-function
render() {
const item = this.props.item;
let nameprefix = '';
// If the repository is owned by a different person than we got the data for
// it's a fork and we should show the name of the owner
if (item.owner.login !== this.props.currentUser) {
nameprefix = `${item.owner.login}/`;
}
// Put together the content of the repository
const content = (
<div className={styles.linkWrapper}>
<A
className={styles.linkRepo}
href={item.html_url}
target="_blank"
>
{nameprefix + item.name}
</A>
<A
className={styles.linkIssues}
href={`${item.html_url}/issues`}
target="_blank"
>
<IssueIcon className={styles.issueIcon} />
{item.open_issues_count}
</A>
</div>
);
// Render the content into a list item
return (
<ListItem key={`repo-list-item-${item.full_name}`} item={content} />
);
}
}
RepoListItem.propTypes = {
item: React.PropTypes.object,
currentUser: React.PropTypes.string,
};
export default connect(createSelector(
selectCurrentUser(),
(currentUser) => ({ currentUser })
))(RepoListItem);
|
ajax/libs/6to5/1.12.9/browser-polyfill.js | panshuiqing/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("regenerator-6to5/runtime")},{"es6-shim":3,"es6-symbol/implement":4,"regenerator-6to5/runtime":27}],2:[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")}},{}],3:[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 it=o[$iterator$]();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,ln,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}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;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}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}}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;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}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:2}],4:[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":5,"./polyfill":20,"es5-ext/global":7}],5:[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}},{}],6:[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":8,"es5-ext/object/is-callable":11,"es5-ext/object/normalize-options":15,"es5-ext/string/#/contains":17}],7:[function(require,module,exports){"use strict";module.exports=new Function("return this")()},{}],8:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.assign:require("./shim")},{"./is-implemented":9,"./shim":10}],9:[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"}},{}],10:[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":12,"../valid-value":16}],11:[function(require,module,exports){"use strict";module.exports=function(obj){return typeof obj==="function"}},{}],12:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.keys:require("./shim")},{"./is-implemented":13,"./shim":14}],13:[function(require,module,exports){"use strict";module.exports=function(){try{Object.keys("primitive");return true}catch(e){return false}}},{}],14:[function(require,module,exports){"use strict";var keys=Object.keys;module.exports=function(object){return keys(object==null?object:Object(object))}},{}],15:[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":8}],16:[function(require,module,exports){"use strict";module.exports=function(value){if(value==null)throw new TypeError("Cannot use null or undefined");return value}},{}],17:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?String.prototype.contains:require("./shim")},{"./is-implemented":18,"./shim":19}],18:[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}},{}],19:[function(require,module,exports){"use strict";var indexOf=String.prototype.indexOf;module.exports=function(searchString){return indexOf.call(this,searchString,arguments[1])>-1}},{}],20:[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:6}],21:[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":22,"./lib/done.js":23,"./lib/es6-extensions.js":24,"./lib/node-extensions.js":25}],22:[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:26}],23:[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":22,asap:26}],24:[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":22,asap:26}],25:[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":22,asap:26}],26:[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:2}],27:[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:21}]},{},[1]); |
authentication-demo/client/src/components/app.js | alexkovalenko/react-redux-learn | import React from 'react';
import Header from './header';
export default (props) => {
return (
<div>
<Header/>
{props.children}
</div>
)
}
|
shopping-cart-app/src/components/routes/SearchResults/SearchResults.js | JCFlores/shoppingCart | import React, { Component } from 'react';
// import StoreCard from '../../StoreCard';
import ProductCard from '../../ProductCard';
import Wrapper from '../../Wrapper';
import Header from '../../Header';
import StoreLogin from "../../StoreLogin";
import './SearchResults.css';
const AddToCartButton = props => (
<span onClick={() => props.addToCart(props.id)} className="remove">
<div className="add-product-to-cart-button button">Add to cart</div>
</span>
);
class SearchResults extends Component {
constructor(props) {
super(props);
this.state = { results: [], value: ''};
}
componentDidMount() {
fetch('/products/search/' + this.props.match.params.tag, {method: 'GET'})
.then(res => res.json())
.then((results) => {this.setState({ results: results })})
}
handleClick(e) {
console.log('The link was clicked.' + e.target.value)
this.setState({value: e.target.value})
window.location = '/products/search/' + e.state.value
}
addToCart(id){
console.log(id)
const cart = []
cart.push(this.id)
}
render() {
return (
<div>
<Header
handleClick={this.handleClick}
value={this.state.value}
/>
<Wrapper
>
<StoreLogin
id="no id"
userName="Search Results"
userDescription=""
>
{this.state.results.map((product) =>
<ProductCard
id={product._id}
key={product._id}
name={product.name}
img={product.img}
description={product.description}
price={product.price}
>
<AddToCartButton
id={product._id}
addToCart={this.addToCart}
/>
</ProductCard>
)
}
</StoreLogin>
</Wrapper>
</div>
);
}
}
export default SearchResults;
|
actor-apps/app-web/src/app/components/sidebar/RecentSectionItem.react.js | guiquanz/actor-platform | import React from 'react';
import classNames from 'classnames';
import DialogActionCreators from 'actions/DialogActionCreators';
import DialogStore from 'stores/DialogStore';
import AvatarItem from 'components/common/AvatarItem.react';
class RecentSectionItem extends React.Component {
static propTypes = {
dialog: React.PropTypes.object.isRequired
};
constructor(props) {
super(props);
}
onClick = () => {
DialogActionCreators.selectDialogPeer(this.props.dialog.peer.peer);
}
render() {
const dialog = this.props.dialog,
selectedDialogPeer = DialogStore.getSelectedDialogPeer();
let isActive = false,
title;
if (selectedDialogPeer) {
isActive = (dialog.peer.peer.id === selectedDialogPeer.id);
}
if (dialog.counter > 0) {
const counter = <span className="counter">{dialog.counter}</span>;
const name = <span className="col-xs title">{dialog.peer.title}</span>;
title = [name, counter];
} else {
title = <span className="col-xs title">{dialog.peer.title}</span>;
}
let recentClassName = classNames('sidebar__list__item', 'row', {
'sidebar__list__item--active': isActive,
'sidebar__list__item--unread': dialog.counter > 0
});
return (
<li className={recentClassName} onClick={this.onClick}>
<AvatarItem image={dialog.peer.avatar}
placeholder={dialog.peer.placeholder}
size="tiny"
title={dialog.peer.title}/>
{title}
</li>
);
}
}
export default RecentSectionItem;
|
web/src/js/__tests__/components/ContentView/ContentViewSpec.js | zlorb/mitmproxy | import React from 'react'
import renderer from 'react-test-renderer'
import TestUtils from 'react-dom/test-utils'
import { Provider } from 'react-redux'
import { ViewServer, ViewImage, PureViewServer, Edit } from '../../../components/ContentView/ContentViews'
import { TFlow, TStore } from '../../ducks/tutils'
import mockXMLHttpRequest from 'mock-xmlhttprequest'
global.XMLHttpRequest = mockXMLHttpRequest
let tflow = new TFlow()
describe('ViewImage Component', () => {
let viewImage = renderer.create(<ViewImage flow={tflow} message={tflow.response}/>),
tree = viewImage.toJSON()
it('should render correctly', () => {
expect(tree).toMatchSnapshot()
})
})
describe('ViewServer Component', () => {
let store = TStore(),
setContentViewDescFn = jest.fn(),
setContentFn = jest.fn()
it('should render correctly and connect to state', () => {
let provider = renderer.create(
<Provider store={store}>
<ViewServer
setContentViewDescription={setContentViewDescFn}
setContent={setContentFn}
flow={tflow}
message={tflow.response}
/>
</Provider>),
tree = provider.toJSON()
expect(tree).toMatchSnapshot()
let viewServer = renderer.create(
<PureViewServer
showFullContent={true}
maxLines={10}
setContentViewDescription={setContentViewDescFn}
setContent={setContentViewDescFn}
flow={tflow}
message={tflow.response}
content={JSON.stringify({lines: [['k1', 'v1']]})}
/>
)
tree = viewServer.toJSON()
expect(tree).toMatchSnapshot()
})
it('should handle componentWillReceiveProps', () => {
// case of fail to parse content
let viewSever = TestUtils.renderIntoDocument(
<PureViewServer
showFullContent={true}
maxLines={10}
setContentViewDescription={setContentViewDescFn}
setContent={setContentViewDescFn}
flow={tflow}
message={tflow.response}
content={JSON.stringify({lines: [['k1', 'v1']]})}
/>
)
viewSever.componentWillReceiveProps({...viewSever.props, content: '{foo' })
let e = ''
try {JSON.parse('{foo') } catch(err){ e = err.message}
expect(viewSever.data).toEqual({ description: e, lines: [] })
})
})
describe('Edit Component', () => {
it('should render correctly', () => {
let edit = renderer.create(<Edit
content="foo"
onChange={jest.fn}
flow={tflow}
message={tflow.response}
/>),
tree = edit.toJSON()
expect(tree).toMatchSnapshot()
})
})
|
src/svg-icons/notification/enhanced-encryption.js | hwo411/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let NotificationEnhancedEncryption = (props) => (
<SvgIcon {...props}>
<path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9V6zM16 16h-3v3h-2v-3H8v-2h3v-3h2v3h3v2z"/>
</SvgIcon>
);
NotificationEnhancedEncryption = pure(NotificationEnhancedEncryption);
NotificationEnhancedEncryption.displayName = 'NotificationEnhancedEncryption';
NotificationEnhancedEncryption.muiName = 'SvgIcon';
export default NotificationEnhancedEncryption;
|
examples/demo3.js | chinayangzhan913/react-grid-gallery | import PropTypes from 'prop-types';
import React from 'react';
import ReactDOM from 'react-dom';
import Gallery from '../src/Gallery';
class Demo3 extends React.Component {
constructor(props){
super(props);
this.state = {
images: this.props.images
};
}
render () {
return (
<div style={{
display: "block",
minHeight: "1px",
width: "100%",
border: "1px solid #ddd",
overflow: "auto"}}>
<Gallery
images={this.state.images}
enableLightbox={false}
enableImageSelection={false}/>
</div>
);
}
}
Demo3.propTypes = {
images: PropTypes.arrayOf(
PropTypes.shape({
src: PropTypes.string.isRequired,
thumbnail: PropTypes.string.isRequired,
srcset: PropTypes.array,
caption: PropTypes.string,
thumbnailWidth: PropTypes.number.isRequired,
thumbnailHeight: PropTypes.number.isRequired
})
).isRequired
};
Demo3.defaultProps = {
images: shuffleArray([
{
src: "https://c2.staticflickr.com/9/8817/28973449265_07e3aa5d2e_b.jpg",
thumbnail: "https://c2.staticflickr.com/9/8817/28973449265_07e3aa5d2e_n.jpg",
thumbnailWidth: 320,
thumbnailHeight: 174,
caption: "After Rain (Jeshu John - designerspics.com)"
},
{
src: "https://c6.staticflickr.com/9/8890/28897154101_a8f55be225_b.jpg",
thumbnail: "https://c6.staticflickr.com/9/8890/28897154101_a8f55be225_n.jpg",
thumbnailWidth: 320,
thumbnailHeight: 183,
caption: "37H (gratispgraphy.com)"
},
{
src: "https://c7.staticflickr.com/9/8106/28941228886_86d1450016_b.jpg",
thumbnail: "https://c7.staticflickr.com/9/8106/28941228886_86d1450016_n.jpg",
thumbnailWidth: 271,
thumbnailHeight: 320,
caption: "Orange Macro (Tom Eversley - isorepublic.com)"
},
{
src: "https://c6.staticflickr.com/9/8342/28897193381_800db6419e_b.jpg",
thumbnail: "https://c6.staticflickr.com/9/8342/28897193381_800db6419e_n.jpg",
thumbnailWidth: 320,
thumbnailHeight: 213,
caption: "201H (gratisography.com)"
},
{
src: "https://c8.staticflickr.com/9/8104/28973555735_ae7c208970_b.jpg",
thumbnail: "https://c8.staticflickr.com/9/8104/28973555735_ae7c208970_n.jpg",
thumbnailWidth: 320,
thumbnailHeight: 213,
caption: "Flower Interior Macro (Tom Eversley - isorepublic.com)"
},
{
src: "https://c1.staticflickr.com/9/8707/28868704912_cba5c6600e_b.jpg",
thumbnail: "https://c1.staticflickr.com/9/8707/28868704912_cba5c6600e_n.jpg",
thumbnailWidth: 320,
thumbnailHeight: 213,
caption: "Man on BMX (Tom Eversley - isorepublic.com)"
},
{
src: "https://c4.staticflickr.com/9/8578/28357117603_97a8233cf5_b.jpg",
thumbnail: "https://c4.staticflickr.com/9/8578/28357117603_97a8233cf5_n.jpg",
thumbnailWidth: 320,
thumbnailHeight: 213,
caption: "Ropeman - Thailand (Tom Eversley - isorepublic.com)"
},
{
src: "https://c1.staticflickr.com/9/8056/28354485944_148d6a5fc1_b.jpg",
thumbnail: "https://c1.staticflickr.com/9/8056/28354485944_148d6a5fc1_n.jpg",
thumbnailWidth: 257,
thumbnailHeight: 320,
caption: "A photo by 贝莉儿 NG. (unsplash.com)"
}
])
};
ReactDOM.render(<Demo3 />, document.getElementById('demo3'));
|
src/frame/rePCUI/calendar/range-calendar/CalendarPart.js | gejialun8888/shop-react | import React from 'react';
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';
import CalendarHeader from '../calendar/CalendarHeader';
import DateTable from '../date/DateTable';
import DateInput from '../date/DateInput';
import { getTimeConfig } from '../util/index';
const CalendarPart = createReactClass({
propTypes: {
prefixCls: PropTypes.string,
value: PropTypes.any,
hoverValue: PropTypes.any,
selectedValue: PropTypes.any,
direction: PropTypes.any,
locale: PropTypes.any,
showTimePicker: PropTypes.bool,
format: PropTypes.any,
placeholder: PropTypes.any,
disabledDate: PropTypes.any,
timePicker: PropTypes.any,
disabledTime: PropTypes.any,
onInputSelect: PropTypes.func,
timePickerDisabledTime: PropTypes.object,
enableNext: PropTypes.any,
enablePrev: PropTypes.any,
},
render() {
const props = this.props;
const {
prefixCls,
value,
hoverValue,
selectedValue,
mode,
direction,
locale, format, placeholder,
disabledDate, timePicker, disabledTime,
timePickerDisabledTime, showTimePicker,
onInputSelect, enablePrev, enableNext,
} = props;
const shouldShowTimePicker = showTimePicker && timePicker;
const disabledTimeConfig = shouldShowTimePicker && disabledTime ?
getTimeConfig(selectedValue, disabledTime) : null;
const rangeClassName = `${prefixCls}-range`;
const newProps = {
locale,
value,
prefixCls,
showTimePicker,
};
const index = direction === 'left' ? 0 : 1;
const timePickerEle = shouldShowTimePicker &&
React.cloneElement(timePicker, {
showHour: true,
showMinute: true,
showSecond: true,
...timePicker.props,
...disabledTimeConfig,
...timePickerDisabledTime,
onChange: onInputSelect,
defaultOpenValue: value,
value: selectedValue[index],
});
return (
<div className={`${rangeClassName}-part ${rangeClassName}-${direction}`}>
<DateInput
format={format}
locale={locale}
prefixCls={prefixCls}
timePicker={timePicker}
disabledDate={disabledDate}
placeholder={placeholder}
disabledTime={disabledTime}
value={value}
showClear={false}
selectedValue={selectedValue[index]}
onChange={onInputSelect}
/>
<div style={{ outline: 'none' }}>
<CalendarHeader
{...newProps}
mode={mode}
enableNext={enableNext}
enablePrev={enablePrev}
onValueChange={props.onValueChange}
onPanelChange={props.onPanelChange}
disabledMonth={props.disabledMonth}
/>
{showTimePicker ? <div className={`${prefixCls}-time-picker`}>
<div className={`${prefixCls}-time-picker-panel`}>
{timePickerEle}
</div>
</div> : null}
<div className={`${prefixCls}-body`}>
<DateTable
{...newProps}
hoverValue={hoverValue}
selectedValue={selectedValue}
dateRender={props.dateRender}
onSelect={props.onSelect}
onDayHover={props.onDayHover}
disabledDate={disabledDate}
showWeekNumber={props.showWeekNumber}
/>
</div>
</div>
</div>);
},
});
export default CalendarPart;
|
src/views/Statistic/StatisticGroup.js | shengnian/shengnian-ui-react | import cx from 'classnames'
import _ from 'lodash'
import PropTypes from 'prop-types'
import React from 'react'
import {
childrenUtils,
customPropTypes,
getElementType,
getUnhandledProps,
META,
SUI,
useKeyOnly,
useWidthProp,
} from '../../lib'
import Statistic from './Statistic'
/**
* A group of statistics.
*/
function StatisticGroup(props) {
const {
children,
className,
color,
content,
horizontal,
inverted,
items,
size,
widths,
} = props
const classes = cx(
'ui',
color,
size,
useKeyOnly(horizontal, 'horizontal'),
useKeyOnly(inverted, 'inverted'),
useWidthProp(widths),
'statistics',
className,
)
const rest = getUnhandledProps(StatisticGroup, props)
const ElementType = getElementType(StatisticGroup, props)
if (!childrenUtils.isNil(children)) return <ElementType {...rest} className={classes}>{children}</ElementType>
if (!childrenUtils.isNil(content)) return <ElementType {...rest} className={classes}>{content}</ElementType>
return (
<ElementType {...rest} className={classes}>
{_.map(items, item => Statistic.create(item))}
</ElementType>
)
}
StatisticGroup._meta = {
name: 'StatisticGroup',
type: META.TYPES.VIEW,
parent: 'Statistic',
}
StatisticGroup.propTypes = {
/** An element type to render as (string or function). */
as: customPropTypes.as,
/** Primary content. */
children: PropTypes.node,
/** Additional classes. */
className: PropTypes.string,
/** A statistic group can be formatted to be different colors. */
color: PropTypes.oneOf(SUI.COLORS),
/** Shorthand for primary content. */
content: customPropTypes.contentShorthand,
/** A statistic group can present its measurement horizontally. */
horizontal: PropTypes.bool,
/** A statistic group can be formatted to fit on a dark background. */
inverted: PropTypes.bool,
/** Array of props for Statistic. */
items: customPropTypes.collectionShorthand,
/** A statistic group can vary in size. */
size: PropTypes.oneOf(_.without(SUI.SIZES, 'big', 'massive', 'medium')),
/** A statistic group can have its items divided evenly. */
widths: PropTypes.oneOf(SUI.WIDTHS),
}
export default StatisticGroup
|
src/FormGroup.js | lo1tuma/react-bootstrap | import React from 'react';
import classNames from 'classnames';
class FormGroup extends React.Component {
render() {
let classes = {
'form-group': !this.props.standalone,
'form-group-lg': !this.props.standalone && this.props.bsSize === 'large',
'form-group-sm': !this.props.standalone && this.props.bsSize === 'small',
'has-feedback': this.props.hasFeedback,
'has-success': this.props.bsStyle === 'success',
'has-warning': this.props.bsStyle === 'warning',
'has-error': this.props.bsStyle === 'error'
};
return (
<div className={classNames(classes, this.props.groupClassName)}>
{this.props.children}
</div>
);
}
}
FormGroup.defaultProps = {
standalone: false
};
FormGroup.propTypes = {
standalone: React.PropTypes.bool,
hasFeedback: React.PropTypes.bool,
bsSize (props) {
if (props.standalone && props.bsSize !== undefined) {
return new Error('bsSize will not be used when `standalone` is set.');
}
return React.PropTypes.oneOf(['small', 'medium', 'large'])
.apply(null, arguments);
},
bsStyle: React.PropTypes.oneOf(['success', 'warning', 'error']),
groupClassName: React.PropTypes.string
};
export default FormGroup;
|
react-flux-mui/js/material-ui/src/svg-icons/device/signal-wifi-1-bar.js | pbogdan/react-flux-mui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let DeviceSignalWifi1Bar = (props) => (
<SvgIcon {...props}>
<path fillOpacity=".3" d="M12.01 21.49L23.64 7c-.45-.34-4.93-4-11.64-4C5.28 3 .81 6.66.36 7l11.63 14.49.01.01.01-.01z"/><path d="M6.67 14.86L12 21.49v.01l.01-.01 5.33-6.63C17.06 14.65 15.03 13 12 13s-5.06 1.65-5.33 1.86z"/>
</SvgIcon>
);
DeviceSignalWifi1Bar = pure(DeviceSignalWifi1Bar);
DeviceSignalWifi1Bar.displayName = 'DeviceSignalWifi1Bar';
DeviceSignalWifi1Bar.muiName = 'SvgIcon';
export default DeviceSignalWifi1Bar;
|
assets/js/components.js | beergarden/beerserver | /* @flow */
// JSX complication requires a reference to `React` and flow doesn't understand
// `import React, { Component, PropTypes } from 'react';`.
import React from 'react';
var { Component, PropTypes } = React;
import d3 from 'd3';
import { LineChart } from 'react-d3-components';
import { formatDateTime, formatDate, formatTime } from './date-utils';
import { ChannelShape, DatapointShape } from './prop-types';
export class DatapointChart extends Component {
formatTick(d: Date): string {
var hours = d.getHours();
if (hours === 0) {
return formatDate(d);
} else {
return formatTime(d);
}
}
render(): any {
var values = this.props.datapoints.map((d) => {
return { x: d.at, y: d.value };
});
var data = { label: '', values };
var width = 800;
var height = 200;
var margin = { top: 10, bottom: 20, left: 50, right: 20 };
var xs = values.map((v) => v.x);
var minX = Math.min(...xs);
var maxX = Math.max(...xs);
var xScale = d3.time.scale()
.domain([minX, maxX])
.range([0, width - margin.left - margin.right]);
var xAxis = { tickFormat: this.formatTick.bind(this) };
var yAxis = { label: 'Deg C' };
var tooltipHtml = (_, d) => {
var date = formatDateTime(d.x);
return `${d.y} at ${date}`;
};
return (
<LineChart data={data}
width={width}
height={height}
margin={margin}
tooltipHtml={tooltipHtml}
xAxis={xAxis}
yAxis={yAxis}
xScale={xScale} />
);
}
}
// TODO: Use `static get propTypes()` as soon as flow supports static getter.
DatapointChart.propTypes = {
datapoints: PropTypes.arrayOf(DatapointShape)
};
export class Channel extends Component {
render(): any {
var channel = this.props.channel;
var url = `/channels/${channel.id}/datapoints`;
var content;
if (channel.datapoints) {
if (channel.datapoints.length > 0) {
var latest = channel.datapoints[channel.datapoints.length - 1];
var date = formatDateTime(latest.at);
content = (
<div>
<p>
<span className="latest">Latest: {latest.value} at {date}</span>
<span> </span>
<span className="json"><a href={url}>JSON</a></span>
</p>
<DatapointChart datapoints={channel.datapoints} />
</div>
);
} else {
content = <p>No data</p>;
}
} else {
content = <p className="loading">Loading...</p>;
}
return (
<div className="channel">
<h2 className="name">{channel.name}</h2>
{content}
</div>
);
}
}
Channel.propTypes = {
channel: ChannelShape.isRequired
};
export class ChannelList extends Component {
render(): any {
if (!this.props.channels) {
return null;
}
var listItems = this.props.channels.map((channel) => <Channel channel={channel} key={channel.id} />);
return <div className="channel-list">{listItems}</div>;
}
}
ChannelList.propTypes = {
channels: PropTypes.arrayOf(ChannelShape)
};
export class ErrorMessage extends Component {
render(): any {
if (!this.props.error) {
return null;
}
return <p className="error-message">Failed to fetch data: {this.props.error.toString()}</p>;
}
}
ErrorMessage.propTypes = {
error: PropTypes.instanceOf(Error)
};
export class Dashboard extends Component {
render(): any {
return (
<div className="dashboard">
<h1>Beerserver Dashboard</h1>
<ErrorMessage error={this.props.error} />
<ChannelList channels={this.props.channels} />
</div>
);
}
}
Dashboard.propTypes = {
channels: PropTypes.arrayOf(ChannelShape),
error: PropTypes.instanceOf(Error)
};
|
src/containers/Header.js | hui-w/events-vanilla | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { browserHistory } from 'react-router';
import FilterBox from '../components/common/FilterBox';
import { updateFilters } from '../actions/common';
import '../styles/header.css';
class Header extends Component {
constructor(props, context) {
super(props, context);
this.closeFilterBox = this.closeFilterBox.bind(this);
this.state = {
expandFiler: false
};
}
closeFilterBox() {
this.setState({
expandFiler: false
});
}
render() {
return (
<header className="header">
<div className="menu">
{this.props.children}
</div>
<div className="right">
<div
className="svg-btn" title="Set Filter"
onClick={() => this.setState({ expandFiler: !this.state.expandFiler })}
>
<svg viewBox="0 0 512 512" width="28" height="28">
<rect width="512" height="512" stroke="none" fill="#404040" />
<path
d="M510.5,28.9c-2.6-5.4-8-8.9-14-8.9h-481c-6,0-11.5,3.5-14,8.9
c-2.6,5.4-1.8,11.9,2.1,16.5l184.9,224.2v206.8
c0,5.4,2.8,10.4,7.3,13.2c2.5,1.5,5.3,2.3,8.2,2.3
c2.4,0,4.7-0.5,6.9-1.6l103.9-51.5c5.3-2.6,8.6-8,8.6-13.9l0.2-155.3L508.5,45.4
C512.3,40.8,513.1,34.4,510.5,28.9z M296.1,254.2c-2.3,2.8-3.5,6.3-3.5,9.9l-0.2,151.3l-72.9,36.1
V264.1c0-3.6-1.3-7.1-3.5-9.9
L48.4,51.1h415.2L296.1,254.2z" fill="#FFFFFF"
/>
</svg>
</div>
<div className="svg-btn" title="New Event" onClick={() => browserHistory.push('/edit/')}>
<svg viewBox="0 0 512 512" width="28" height="28">
<rect width="512" height="512" stroke="none" fill="#404040" />
<polygon
points="496,240.2 271.8,240.2 271.8,16 240.2,16 240.2,240.2 16,240.2 16,271.8 240.2,271.8
240.2,496 271.8,496 271.8,271.8 496,271.8" fill="#FFFFFF"
/>
</svg>
</div>
</div>
{this.state.expandFiler &&
<FilterBox
filters={this.props.filters}
onChange={(filters) => this.props.dispatch(updateFilters(filters))}
onClose={this.closeFilterBox}
/>
}
</header>
);
}
}
Header.propTypes = {
dispatch: PropTypes.func,
filters: PropTypes.object,
children: PropTypes.array
};
const mapStateToProps = (state) => ({
filters: state.common.filters
});
export default connect(
mapStateToProps
)(Header);
|
tests/routes/Counter/components/Counter.spec.js | Donnzh/TwitterTrends | import React from 'react'
import { bindActionCreators } from 'redux'
import { Counter } from 'routes/Counter/components/Counter'
import { shallow } from 'enzyme'
describe('(Component) Counter', () => {
let _props, _spies, _wrapper
beforeEach(() => {
_spies = {}
_props = {
counter : 5,
...bindActionCreators({
doubleAsync : (_spies.doubleAsync = sinon.spy()),
increment : (_spies.increment = sinon.spy())
}, _spies.dispatch = sinon.spy())
}
_wrapper = shallow(<Counter {..._props} />)
})
it('renders as a <div>.', () => {
expect(_wrapper.is('div')).to.equal(true)
})
it('renders with an <h2> that includes Counter label.', () => {
expect(_wrapper.find('h2').text()).to.match(/Counter:/)
})
it('renders {props.counter} at the end of the sample counter <h2>.', () => {
expect(_wrapper.find('h2').text()).to.match(/5$/)
_wrapper.setProps({ counter: 8 })
expect(_wrapper.find('h2').text()).to.match(/8$/)
})
it('renders exactly two buttons.', () => {
expect(_wrapper.find('button')).to.have.length(2)
})
describe('Increment', () => {
let _button
beforeEach(() => {
_button = _wrapper.find('button').filterWhere(a => a.text() === 'Increment')
})
it('exists', () => {
expect(_button).to.exist()
})
it('is a primary button', () => {
expect(_button.hasClass('btn btn-primary')).to.be.true()
})
it('Calls props.increment when clicked', () => {
_spies.dispatch.should.have.not.been.called()
_button.simulate('click')
_spies.dispatch.should.have.been.called()
_spies.increment.should.have.been.called()
})
})
describe('Double Async Button', () => {
let _button
beforeEach(() => {
_button = _wrapper.find('button').filterWhere(a => a.text() === 'Double (Async)')
})
it('exists', () => {
expect(_button).to.exist()
})
it('is a secondary button', () => {
expect(_button.hasClass('btn btn-secondary')).to.be.true()
})
it('Calls props.doubleAsync when clicked', () => {
_spies.dispatch.should.have.not.been.called()
_button.simulate('click')
_spies.dispatch.should.have.been.called()
_spies.doubleAsync.should.have.been.called()
})
})
})
|
src/svg-icons/editor/publish.js | barakmitz/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let EditorPublish = (props) => (
<SvgIcon {...props}>
<path d="M5 4v2h14V4H5zm0 10h4v6h6v-6h4l-7-7-7 7z"/>
</SvgIcon>
);
EditorPublish = pure(EditorPublish);
EditorPublish.displayName = 'EditorPublish';
EditorPublish.muiName = 'SvgIcon';
export default EditorPublish;
|
ajax/libs/inferno/1.0.0-beta24/inferno-mobx.js | emmy41124/cdnjs | /*!
* inferno-mobx v1.0.0-beta24
* (c) 2016 Ryan Megidov
* Released under the MIT License.
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./inferno-component'), require('./inferno'), require('./inferno-create-class'), require('./inferno-create-element')) :
typeof define === 'function' && define.amd ? define(['inferno-component', 'inferno', 'inferno-create-class', 'inferno-create-element'], factory) :
(global.Inferno = global.Inferno || {}, global.Inferno.Mobx = factory(global.Inferno.Component,global.Inferno,global.Inferno.createClass,global.Inferno.createElement));
}(this, (function (Component,Inferno,createClass,createElement) { 'use strict';
Component = 'default' in Component ? Component['default'] : Component;
Inferno = 'default' in Inferno ? Inferno['default'] : Inferno;
createClass = 'default' in createClass ? createClass['default'] : createClass;
createElement = 'default' in createElement ? createElement['default'] : createElement;
var ERROR_MSG = 'a runtime error occured! Use Inferno in development environment to find the error.';
// this is MUCH faster than .constructor === Array and instanceof Array
// in Node 7 and the later versions of V8, slower in older versions though
function throwError(message) {
if (!message) {
message = ERROR_MSG;
}
throw new Error(("Inferno Error: " + message));
}
function warning(condition, message) {
if (!condition) {
console.error(message);
}
}
var specialKeys = {
children: true,
key: true,
ref: true
};
var Provider = (function (Component$$1) {
function Provider(props, context) {
Component$$1.call(this, props, context);
this.contextTypes = { mobxStores: function mobxStores() { } };
this.childContextTypes = { mobxStores: function mobxStores$1() { } };
this.store = props.store;
}
if ( Component$$1 ) Provider.__proto__ = Component$$1;
Provider.prototype = Object.create( Component$$1 && Component$$1.prototype );
Provider.prototype.constructor = Provider;
Provider.prototype.render = function render () {
return this.props.children;
};
Provider.prototype.getChildContext = function getChildContext () {
var this$1 = this;
var stores = {};
// inherit stores
var baseStores = this.context.mobxStores;
if (baseStores) {
for (var key in baseStores) {
stores[key] = baseStores[key];
}
}
// add own stores
for (var key$1 in this.props) {
if (!specialKeys[key$1]) {
stores[key$1] = this$1.props[key$1];
}
}
return {
mobxStores: stores
};
};
return Provider;
}(Component));
if (process.env.NODE_ENV !== 'production') {
Provider.prototype.componentWillReceiveProps = function (nextProps) {
var this$1 = this;
// Maybe this warning is to aggressive?
warning(Object.keys(nextProps).length === Object.keys(this.props).length, 'MobX Provider: The set of provided stores has changed. ' +
'Please avoid changing stores as the change might not propagate to all children');
for (var key in nextProps) {
warning(specialKeys[key] || this$1.props[key] === nextProps[key], "MobX Provider: Provided store '" + key + "' has changed. " +
"Please avoid replacing stores as the change might not propagate to all children");
}
};
}
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var mobx = createCommonjsModule(function (module, exports) {
"use strict";
var __extends = (commonjsGlobal && commonjsGlobal.__extends) || function (d, b) {
for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } }
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
registerGlobals();
exports.extras = {
allowStateChanges: allowStateChanges,
getAtom: getAtom,
getDebugName: getDebugName,
getDependencyTree: getDependencyTree,
getObserverTree: getObserverTree,
isComputingDerivation: isComputingDerivation,
isSpyEnabled: isSpyEnabled,
resetGlobalState: resetGlobalState,
spyReport: spyReport,
spyReportEnd: spyReportEnd,
spyReportStart: spyReportStart,
trackTransitions: trackTransitions,
setReactionScheduler: setReactionScheduler
};
exports._ = {
getAdministration: getAdministration,
resetGlobalState: resetGlobalState
};
if (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === 'object') {
__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx(module.exports);
}
var actionFieldDecorator = createClassPropertyDecorator(function (target, key, value, args, originalDescriptor) {
var actionName = (args && args.length === 1) ? args[0] : (value.name || key || "<unnamed action>");
var wrappedAction = action(actionName, value);
addHiddenProp(target, key, wrappedAction);
}, function (key) {
return this[key];
}, function () {
invariant(false, "It is not allowed to assign new values to @action fields");
}, false, true);
function action(arg1, arg2, arg3, arg4) {
if (arguments.length === 1 && typeof arg1 === "function")
{ return createAction(arg1.name || "<unnamed action>", arg1); }
if (arguments.length === 2 && typeof arg2 === "function")
{ return createAction(arg1, arg2); }
if (arguments.length === 1 && typeof arg1 === "string")
{ return namedActionDecorator(arg1); }
return namedActionDecorator(arg2).apply(null, arguments);
}
exports.action = action;
function namedActionDecorator(name) {
return function (target, prop, descriptor) {
if (descriptor && typeof descriptor.value === "function") {
descriptor.value = createAction(name, descriptor.value);
descriptor.enumerable = false;
descriptor.configurable = true;
return descriptor;
}
return actionFieldDecorator(name).apply(this, arguments);
};
}
function runInAction(arg1, arg2, arg3) {
var actionName = typeof arg1 === "string" ? arg1 : arg1.name || "<unnamed action>";
var fn = typeof arg1 === "function" ? arg1 : arg2;
var scope = typeof arg1 === "function" ? arg2 : arg3;
invariant(typeof fn === "function", "`runInAction` expects a function");
invariant(fn.length === 0, "`runInAction` expects a function without arguments");
invariant(typeof actionName === "string" && actionName.length > 0, "actions should have valid names, got: '" + actionName + "'");
return executeAction(actionName, fn, scope, undefined);
}
exports.runInAction = runInAction;
function isAction(thing) {
return typeof thing === "function" && thing.isMobxAction === true;
}
exports.isAction = isAction;
function autorun(arg1, arg2, arg3) {
var name, view, scope;
if (typeof arg1 === "string") {
name = arg1;
view = arg2;
scope = arg3;
}
else if (typeof arg1 === "function") {
name = arg1.name || ("Autorun@" + getNextId());
view = arg1;
scope = arg2;
}
assertUnwrapped(view, "autorun methods cannot have modifiers");
invariant(typeof view === "function", "autorun expects a function");
invariant(isAction(view) === false, "Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.");
if (scope)
{ view = view.bind(scope); }
var reaction = new Reaction(name, function () {
this.track(reactionRunner);
});
function reactionRunner() {
view(reaction);
}
reaction.schedule();
return reaction.getDisposer();
}
exports.autorun = autorun;
function when(arg1, arg2, arg3, arg4) {
var name, predicate, effect, scope;
if (typeof arg1 === "string") {
name = arg1;
predicate = arg2;
effect = arg3;
scope = arg4;
}
else if (typeof arg1 === "function") {
name = ("When@" + getNextId());
predicate = arg1;
effect = arg2;
scope = arg3;
}
var disposer = autorun(name, function (r) {
if (predicate.call(scope)) {
r.dispose();
var prevUntracked = untrackedStart();
effect.call(scope);
untrackedEnd(prevUntracked);
}
});
return disposer;
}
exports.when = when;
function autorunUntil(predicate, effect, scope) {
deprecated("`autorunUntil` is deprecated, please use `when`.");
return when.apply(null, arguments);
}
exports.autorunUntil = autorunUntil;
function autorunAsync(arg1, arg2, arg3, arg4) {
var name, func, delay, scope;
if (typeof arg1 === "string") {
name = arg1;
func = arg2;
delay = arg3;
scope = arg4;
}
else if (typeof arg1 === "function") {
name = arg1.name || ("AutorunAsync@" + getNextId());
func = arg1;
delay = arg2;
scope = arg3;
}
invariant(isAction(func) === false, "Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.");
if (delay === void 0)
{ delay = 1; }
if (scope)
{ func = func.bind(scope); }
var isScheduled = false;
var r = new Reaction(name, function () {
if (!isScheduled) {
isScheduled = true;
setTimeout(function () {
isScheduled = false;
if (!r.isDisposed)
{ r.track(reactionRunner); }
}, delay);
}
});
function reactionRunner() { func(r); }
r.schedule();
return r.getDisposer();
}
exports.autorunAsync = autorunAsync;
function reaction(arg1, arg2, arg3, arg4, arg5, arg6) {
var name, expression, effect, fireImmediately, delay, scope;
if (typeof arg1 === "string") {
name = arg1;
expression = arg2;
effect = arg3;
fireImmediately = arg4;
delay = arg5;
scope = arg6;
}
else {
name = arg1.name || arg2.name || ("Reaction@" + getNextId());
expression = arg1;
effect = arg2;
fireImmediately = arg3;
delay = arg4;
scope = arg5;
}
if (fireImmediately === void 0)
{ fireImmediately = false; }
if (delay === void 0)
{ delay = 0; }
var _a = getValueModeFromValue(expression, ValueMode.Reference), valueMode = _a[0], unwrappedExpression = _a[1];
var compareStructural = valueMode === ValueMode.Structure;
if (scope) {
unwrappedExpression = unwrappedExpression.bind(scope);
effect = action(name, effect.bind(scope));
}
var firstTime = true;
var isScheduled = false;
var nextValue = undefined;
var r = new Reaction(name, function () {
if (delay < 1) {
reactionRunner();
}
else if (!isScheduled) {
isScheduled = true;
setTimeout(function () {
isScheduled = false;
reactionRunner();
}, delay);
}
});
function reactionRunner() {
if (r.isDisposed)
{ return; }
var changed = false;
r.track(function () {
var v = unwrappedExpression(r);
changed = valueDidChange(compareStructural, nextValue, v);
nextValue = v;
});
if (firstTime && fireImmediately)
{ effect(nextValue, r); }
if (!firstTime && changed === true)
{ effect(nextValue, r); }
if (firstTime)
{ firstTime = false; }
}
r.schedule();
return r.getDisposer();
}
exports.reaction = reaction;
var computedDecorator = createClassPropertyDecorator(function (target, name, _, decoratorArgs, originalDescriptor) {
invariant(typeof originalDescriptor !== "undefined", "@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.");
var baseValue = originalDescriptor.get;
var setter = originalDescriptor.set;
invariant(typeof baseValue === "function", "@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'");
var compareStructural = false;
if (decoratorArgs && decoratorArgs.length === 1 && decoratorArgs[0].asStructure === true)
{ compareStructural = true; }
var adm = asObservableObject(target, undefined, ValueMode.Recursive);
defineObservableProperty(adm, name, compareStructural ? asStructure(baseValue) : baseValue, false, setter);
}, function (name) {
var observable = this.$mobx.values[name];
if (observable === undefined)
{ return undefined; }
return observable.get();
}, function (name, value) {
this.$mobx.values[name].set(value);
}, false, true);
function computed(targetOrExpr, keyOrScopeOrSetter, baseDescriptor, options) {
if ((typeof targetOrExpr === "function" || isModifierWrapper(targetOrExpr)) && arguments.length < 3) {
if (typeof keyOrScopeOrSetter === "function")
{ return computedExpr(targetOrExpr, keyOrScopeOrSetter, undefined); }
else
{ return computedExpr(targetOrExpr, undefined, keyOrScopeOrSetter); }
}
return computedDecorator.apply(null, arguments);
}
exports.computed = computed;
function computedExpr(expr, setter, scope) {
var _a = getValueModeFromValue(expr, ValueMode.Recursive), mode = _a[0], value = _a[1];
return new ComputedValue(value, scope, mode === ValueMode.Structure, value.name, setter);
}
function createTransformer(transformer, onCleanup) {
invariant(typeof transformer === "function" && transformer.length === 1, "createTransformer expects a function that accepts one argument");
var objectCache = {};
var resetId = globalState.resetId;
var Transformer = (function (_super) {
__extends(Transformer, _super);
function Transformer(sourceIdentifier, sourceObject) {
_super.call(this, function () { return transformer(sourceObject); }, null, false, "Transformer-" + transformer.name + "-" + sourceIdentifier, undefined);
this.sourceIdentifier = sourceIdentifier;
this.sourceObject = sourceObject;
}
Transformer.prototype.onBecomeUnobserved = function () {
var lastValue = this.value;
_super.prototype.onBecomeUnobserved.call(this);
delete objectCache[this.sourceIdentifier];
if (onCleanup)
{ onCleanup(lastValue, this.sourceObject); }
};
return Transformer;
}(ComputedValue));
return function (object) {
if (resetId !== globalState.resetId) {
objectCache = {};
resetId = globalState.resetId;
}
var identifier = getMemoizationId(object);
var reactiveTransformer = objectCache[identifier];
if (reactiveTransformer)
{ return reactiveTransformer.get(); }
reactiveTransformer = objectCache[identifier] = new Transformer(identifier, object);
return reactiveTransformer.get();
};
}
exports.createTransformer = createTransformer;
function getMemoizationId(object) {
if (object === null || typeof object !== "object")
{ throw new Error("[mobx] transform expected some kind of object, got: " + object); }
var tid = object.$transformId;
if (tid === undefined) {
tid = getNextId();
addHiddenProp(object, "$transformId", tid);
}
return tid;
}
function expr(expr, scope) {
if (!isComputingDerivation())
{ console.warn("[mobx.expr] 'expr' should only be used inside other reactive functions."); }
return computed(expr, scope).get();
}
exports.expr = expr;
function extendObservable(target) {
var arguments$1 = arguments;
var properties = [];
for (var _i = 1; _i < arguments.length; _i++) {
properties[_i - 1] = arguments$1[_i];
}
invariant(arguments.length >= 2, "extendObservable expected 2 or more arguments");
invariant(typeof target === "object", "extendObservable expects an object as first argument");
invariant(!(isObservableMap(target)), "extendObservable should not be used on maps, use map.merge instead");
properties.forEach(function (propSet) {
invariant(typeof propSet === "object", "all arguments of extendObservable should be objects");
invariant(!isObservable(propSet), "extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540");
extendObservableHelper(target, propSet, ValueMode.Recursive, null);
});
return target;
}
exports.extendObservable = extendObservable;
function extendObservableHelper(target, properties, mode, name) {
var adm = asObservableObject(target, name, mode);
for (var key in properties)
{ if (hasOwnProperty(properties, key)) {
if (target === properties && !isPropertyConfigurable(target, key))
{ continue; }
var descriptor = Object.getOwnPropertyDescriptor(properties, key);
setObservableObjectInstanceProperty(adm, key, descriptor);
} }
return target;
}
function getDependencyTree(thing, property) {
return nodeToDependencyTree(getAtom(thing, property));
}
function nodeToDependencyTree(node) {
var result = {
name: node.name
};
if (node.observing && node.observing.length > 0)
{ result.dependencies = unique(node.observing).map(nodeToDependencyTree); }
return result;
}
function getObserverTree(thing, property) {
return nodeToObserverTree(getAtom(thing, property));
}
function nodeToObserverTree(node) {
var result = {
name: node.name
};
if (hasObservers(node))
{ result.observers = getObservers(node).map(nodeToObserverTree); }
return result;
}
function intercept(thing, propOrHandler, handler) {
if (typeof handler === "function")
{ return interceptProperty(thing, propOrHandler, handler); }
else
{ return interceptInterceptable(thing, propOrHandler); }
}
exports.intercept = intercept;
function interceptInterceptable(thing, handler) {
if (isPlainObject(thing) && !isObservableObject(thing)) {
deprecated("Passing plain objects to intercept / observe is deprecated and will be removed in 3.0");
return getAdministration(observable(thing)).intercept(handler);
}
return getAdministration(thing).intercept(handler);
}
function interceptProperty(thing, property, handler) {
if (isPlainObject(thing) && !isObservableObject(thing)) {
deprecated("Passing plain objects to intercept / observe is deprecated and will be removed in 3.0");
extendObservable(thing, {
property: thing[property]
});
return interceptProperty(thing, property, handler);
}
return getAdministration(thing, property).intercept(handler);
}
function isComputed(value, property) {
if (value === null || value === undefined)
{ return false; }
if (property !== undefined) {
if (isObservableObject(value) === false)
{ return false; }
var atom = getAtom(value, property);
return isComputedValue(atom);
}
return isComputedValue(value);
}
exports.isComputed = isComputed;
function isObservable(value, property) {
if (value === null || value === undefined)
{ return false; }
if (property !== undefined) {
if (isObservableArray(value) || isObservableMap(value))
{ throw new Error("[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."); }
else if (isObservableObject(value)) {
var o = value.$mobx;
return o.values && !!o.values[property];
}
return false;
}
return !!value.$mobx || isAtom(value) || isReaction(value) || isComputedValue(value);
}
exports.isObservable = isObservable;
var decoratorImpl = createClassPropertyDecorator(function (target, name, baseValue) {
var prevA = allowStateChangesStart(true);
if (typeof baseValue === "function")
{ baseValue = asReference(baseValue); }
var adm = asObservableObject(target, undefined, ValueMode.Recursive);
defineObservableProperty(adm, name, baseValue, true, undefined);
allowStateChangesEnd(prevA);
}, function (name) {
var observable = this.$mobx.values[name];
if (observable === undefined)
{ return undefined; }
return observable.get();
}, function (name, value) {
setPropertyValue(this, name, value);
}, true, false);
function observableDecorator(target, key, baseDescriptor) {
invariant(arguments.length >= 2 && arguments.length <= 3, "Illegal decorator config", key);
assertPropertyConfigurable(target, key);
invariant(!baseDescriptor || !baseDescriptor.get, "@observable can not be used on getters, use @computed instead");
return decoratorImpl.apply(null, arguments);
}
function observable(v, keyOrScope) {
if (v === void 0) { v = undefined; }
if (typeof arguments[1] === "string")
{ return observableDecorator.apply(null, arguments); }
invariant(arguments.length < 3, "observable expects zero, one or two arguments");
if (isObservable(v))
{ return v; }
var _a = getValueModeFromValue(v, ValueMode.Recursive), mode = _a[0], value = _a[1];
var sourceType = mode === ValueMode.Reference ? ValueType.Reference : getTypeOfValue(value);
switch (sourceType) {
case ValueType.Array:
case ValueType.PlainObject:
return makeChildObservable(value, mode);
case ValueType.Reference:
case ValueType.ComplexObject:
return new ObservableValue(value, mode);
case ValueType.ComplexFunction:
throw new Error("[mobx.observable] To be able to make a function reactive it should not have arguments. If you need an observable reference to a function, use `observable(asReference(f))`");
case ValueType.ViewFunction:
deprecated("Use `computed(expr)` instead of `observable(expr)`");
return computed(v, keyOrScope);
}
invariant(false, "Illegal State");
}
exports.observable = observable;
var ValueType;
(function (ValueType) {
ValueType[ValueType["Reference"] = 0] = "Reference";
ValueType[ValueType["PlainObject"] = 1] = "PlainObject";
ValueType[ValueType["ComplexObject"] = 2] = "ComplexObject";
ValueType[ValueType["Array"] = 3] = "Array";
ValueType[ValueType["ViewFunction"] = 4] = "ViewFunction";
ValueType[ValueType["ComplexFunction"] = 5] = "ComplexFunction";
})(ValueType || (ValueType = {}));
function getTypeOfValue(value) {
if (value === null || value === undefined)
{ return ValueType.Reference; }
if (typeof value === "function")
{ return value.length ? ValueType.ComplexFunction : ValueType.ViewFunction; }
if (isArrayLike(value))
{ return ValueType.Array; }
if (typeof value === "object")
{ return isPlainObject(value) ? ValueType.PlainObject : ValueType.ComplexObject; }
return ValueType.Reference;
}
function observe(thing, propOrCb, cbOrFire, fireImmediately) {
if (typeof cbOrFire === "function")
{ return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately); }
else
{ return observeObservable(thing, propOrCb, cbOrFire); }
}
exports.observe = observe;
function observeObservable(thing, listener, fireImmediately) {
if (isPlainObject(thing) && !isObservableObject(thing)) {
deprecated("Passing plain objects to intercept / observe is deprecated and will be removed in 3.0");
return getAdministration(observable(thing)).observe(listener, fireImmediately);
}
return getAdministration(thing).observe(listener, fireImmediately);
}
function observeObservableProperty(thing, property, listener, fireImmediately) {
if (isPlainObject(thing) && !isObservableObject(thing)) {
deprecated("Passing plain objects to intercept / observe is deprecated and will be removed in 3.0");
extendObservable(thing, {
property: thing[property]
});
return observeObservableProperty(thing, property, listener, fireImmediately);
}
return getAdministration(thing, property).observe(listener, fireImmediately);
}
function toJS(source, detectCycles, __alreadySeen) {
if (detectCycles === void 0) { detectCycles = true; }
if (__alreadySeen === void 0) { __alreadySeen = null; }
function cache(value) {
if (detectCycles)
{ __alreadySeen.push([source, value]); }
return value;
}
if (isObservable(source)) {
if (detectCycles && __alreadySeen === null)
{ __alreadySeen = []; }
if (detectCycles && source !== null && typeof source === "object") {
for (var i = 0, l = __alreadySeen.length; i < l; i++)
{ if (__alreadySeen[i][0] === source)
{ return __alreadySeen[i][1]; } }
}
if (isObservableArray(source)) {
var res = cache([]);
var toAdd = source.map(function (value) { return toJS(value, detectCycles, __alreadySeen); });
res.length = toAdd.length;
for (var i = 0, l = toAdd.length; i < l; i++)
{ res[i] = toAdd[i]; }
return res;
}
if (isObservableObject(source)) {
var res = cache({});
for (var key in source)
{ res[key] = toJS(source[key], detectCycles, __alreadySeen); }
return res;
}
if (isObservableMap(source)) {
var res_1 = cache({});
source.forEach(function (value, key) { return res_1[key] = toJS(value, detectCycles, __alreadySeen); });
return res_1;
}
if (isObservableValue(source))
{ return toJS(source.get(), detectCycles, __alreadySeen); }
}
return source;
}
exports.toJS = toJS;
function toJSlegacy(source, detectCycles, __alreadySeen) {
if (detectCycles === void 0) { detectCycles = true; }
if (__alreadySeen === void 0) { __alreadySeen = null; }
deprecated("toJSlegacy is deprecated and will be removed in the next major. Use `toJS` instead. See #566");
function cache(value) {
if (detectCycles)
{ __alreadySeen.push([source, value]); }
return value;
}
if (source instanceof Date || source instanceof RegExp)
{ return source; }
if (detectCycles && __alreadySeen === null)
{ __alreadySeen = []; }
if (detectCycles && source !== null && typeof source === "object") {
for (var i = 0, l = __alreadySeen.length; i < l; i++)
{ if (__alreadySeen[i][0] === source)
{ return __alreadySeen[i][1]; } }
}
if (!source)
{ return source; }
if (isArrayLike(source)) {
var res = cache([]);
var toAdd = source.map(function (value) { return toJSlegacy(value, detectCycles, __alreadySeen); });
res.length = toAdd.length;
for (var i = 0, l = toAdd.length; i < l; i++)
{ res[i] = toAdd[i]; }
return res;
}
if (isObservableMap(source)) {
var res_2 = cache({});
source.forEach(function (value, key) { return res_2[key] = toJSlegacy(value, detectCycles, __alreadySeen); });
return res_2;
}
if (isObservableValue(source))
{ return toJSlegacy(source.get(), detectCycles, __alreadySeen); }
if (typeof source === "object") {
var res = cache({});
for (var key in source)
{ res[key] = toJSlegacy(source[key], detectCycles, __alreadySeen); }
return res;
}
return source;
}
exports.toJSlegacy = toJSlegacy;
function toJSON(source, detectCycles, __alreadySeen) {
if (detectCycles === void 0) { detectCycles = true; }
if (__alreadySeen === void 0) { __alreadySeen = null; }
deprecated("toJSON is deprecated. Use toJS instead");
return toJSlegacy.apply(null, arguments);
}
exports.toJSON = toJSON;
function log(msg) {
console.log(msg);
return msg;
}
function whyRun(thing, prop) {
switch (arguments.length) {
case 0:
thing = globalState.trackingDerivation;
if (!thing)
{ return log("whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested it's value."); }
break;
case 2:
thing = getAtom(thing, prop);
break;
}
thing = getAtom(thing);
if (isComputedValue(thing))
{ return log(thing.whyRun()); }
else if (isReaction(thing))
{ return log(thing.whyRun()); }
else
{ invariant(false, "whyRun can only be used on reactions and computed values"); }
}
exports.whyRun = whyRun;
function createAction(actionName, fn) {
invariant(typeof fn === "function", "`action` can only be invoked on functions");
invariant(typeof actionName === "string" && actionName.length > 0, "actions should have valid names, got: '" + actionName + "'");
var res = function () {
return executeAction(actionName, fn, this, arguments);
};
res.isMobxAction = true;
return res;
}
function executeAction(actionName, fn, scope, args) {
invariant(!isComputedValue(globalState.trackingDerivation), "Computed values or transformers should not invoke actions or trigger other side effects");
var notifySpy = isSpyEnabled();
var startTime;
if (notifySpy) {
startTime = Date.now();
var l = (args && args.length) || 0;
var flattendArgs = new Array(l);
if (l > 0)
{ for (var i = 0; i < l; i++)
{ flattendArgs[i] = args[i]; } }
spyReportStart({
type: "action",
name: actionName,
fn: fn,
target: scope,
arguments: flattendArgs
});
}
var prevUntracked = untrackedStart();
transactionStart(actionName, scope, false);
var prevAllowStateChanges = allowStateChangesStart(true);
try {
return fn.apply(scope, args);
}
finally {
allowStateChangesEnd(prevAllowStateChanges);
transactionEnd(false);
untrackedEnd(prevUntracked);
if (notifySpy)
{ spyReportEnd({ time: Date.now() - startTime }); }
}
}
function useStrict(strict) {
if (arguments.length === 0) {
deprecated("`useStrict` without arguments is deprecated, use `isStrictModeEnabled()` instead");
return globalState.strictMode;
}
else {
invariant(globalState.trackingDerivation === null, "It is not allowed to set `useStrict` when a derivation is running");
globalState.strictMode = strict;
globalState.allowStateChanges = !strict;
}
}
exports.useStrict = useStrict;
function isStrictModeEnabled() {
return globalState.strictMode;
}
exports.isStrictModeEnabled = isStrictModeEnabled;
function allowStateChanges(allowStateChanges, func) {
var prev = allowStateChangesStart(allowStateChanges);
var res = func();
allowStateChangesEnd(prev);
return res;
}
function allowStateChangesStart(allowStateChanges) {
var prev = globalState.allowStateChanges;
globalState.allowStateChanges = allowStateChanges;
return prev;
}
function allowStateChangesEnd(prev) {
globalState.allowStateChanges = prev;
}
var BaseAtom = (function () {
function BaseAtom(name) {
if (name === void 0) { name = "Atom@" + getNextId(); }
this.name = name;
this.isPendingUnobservation = true;
this.observers = [];
this.observersIndexes = {};
this.diffValue = 0;
this.lastAccessedBy = 0;
this.lowestObserverState = IDerivationState.NOT_TRACKING;
}
BaseAtom.prototype.onBecomeUnobserved = function () {
};
BaseAtom.prototype.reportObserved = function () {
reportObserved(this);
};
BaseAtom.prototype.reportChanged = function () {
transactionStart("propagatingAtomChange", null, false);
propagateChanged(this);
transactionEnd(false);
};
BaseAtom.prototype.toString = function () {
return this.name;
};
return BaseAtom;
}());
exports.BaseAtom = BaseAtom;
var Atom = (function (_super) {
__extends(Atom, _super);
function Atom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {
if (name === void 0) { name = "Atom@" + getNextId(); }
if (onBecomeObservedHandler === void 0) { onBecomeObservedHandler = noop; }
if (onBecomeUnobservedHandler === void 0) { onBecomeUnobservedHandler = noop; }
_super.call(this, name);
this.name = name;
this.onBecomeObservedHandler = onBecomeObservedHandler;
this.onBecomeUnobservedHandler = onBecomeUnobservedHandler;
this.isPendingUnobservation = false;
this.isBeingTracked = false;
}
Atom.prototype.reportObserved = function () {
startBatch();
_super.prototype.reportObserved.call(this);
if (!this.isBeingTracked) {
this.isBeingTracked = true;
this.onBecomeObservedHandler();
}
endBatch();
return !!globalState.trackingDerivation;
};
Atom.prototype.onBecomeUnobserved = function () {
this.isBeingTracked = false;
this.onBecomeUnobservedHandler();
};
return Atom;
}(BaseAtom));
exports.Atom = Atom;
var isAtom = createInstanceofPredicate("Atom", BaseAtom);
var ComputedValue = (function () {
function ComputedValue(derivation, scope, compareStructural, name, setter) {
this.derivation = derivation;
this.scope = scope;
this.compareStructural = compareStructural;
this.dependenciesState = IDerivationState.NOT_TRACKING;
this.observing = [];
this.newObserving = null;
this.isPendingUnobservation = false;
this.observers = [];
this.observersIndexes = {};
this.diffValue = 0;
this.runId = 0;
this.lastAccessedBy = 0;
this.lowestObserverState = IDerivationState.UP_TO_DATE;
this.unboundDepsCount = 0;
this.__mapid = "#" + getNextId();
this.value = undefined;
this.isComputing = false;
this.isRunningSetter = false;
this.name = name || "ComputedValue@" + getNextId();
if (setter)
{ this.setter = createAction(name + "-setter", setter); }
}
ComputedValue.prototype.peek = function () {
this.isComputing = true;
var prevAllowStateChanges = allowStateChangesStart(false);
var res = this.derivation.call(this.scope);
allowStateChangesEnd(prevAllowStateChanges);
this.isComputing = false;
return res;
};
ComputedValue.prototype.peekUntracked = function () {
var hasError = true;
try {
var res = this.peek();
hasError = false;
return res;
}
finally {
if (hasError)
{ handleExceptionInDerivation(this); }
}
};
ComputedValue.prototype.onBecomeStale = function () {
propagateMaybeChanged(this);
};
ComputedValue.prototype.onBecomeUnobserved = function () {
invariant(this.dependenciesState !== IDerivationState.NOT_TRACKING, "INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row");
clearObserving(this);
this.value = undefined;
};
ComputedValue.prototype.get = function () {
invariant(!this.isComputing, "Cycle detected in computation " + this.name, this.derivation);
startBatch();
if (globalState.inBatch === 1) {
if (shouldCompute(this))
{ this.value = this.peekUntracked(); }
}
else {
reportObserved(this);
if (shouldCompute(this))
{ if (this.trackAndCompute())
{ propagateChangeConfirmed(this); } }
}
var result = this.value;
endBatch();
return result;
};
ComputedValue.prototype.recoverFromError = function () {
this.isComputing = false;
};
ComputedValue.prototype.set = function (value) {
if (this.setter) {
invariant(!this.isRunningSetter, "The setter of computed value '" + this.name + "' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?");
this.isRunningSetter = true;
try {
this.setter.call(this.scope, value);
}
finally {
this.isRunningSetter = false;
}
}
else
{ invariant(false, "[ComputedValue '" + this.name + "'] It is not possible to assign a new value to a computed value."); }
};
ComputedValue.prototype.trackAndCompute = function () {
if (isSpyEnabled()) {
spyReport({
object: this,
type: "compute",
fn: this.derivation,
target: this.scope
});
}
var oldValue = this.value;
var newValue = this.value = trackDerivedFunction(this, this.peek);
return valueDidChange(this.compareStructural, newValue, oldValue);
};
ComputedValue.prototype.observe = function (listener, fireImmediately) {
var _this = this;
var firstTime = true;
var prevValue = undefined;
return autorun(function () {
var newValue = _this.get();
if (!firstTime || fireImmediately) {
var prevU = untrackedStart();
listener(newValue, prevValue);
untrackedEnd(prevU);
}
firstTime = false;
prevValue = newValue;
});
};
ComputedValue.prototype.toJSON = function () {
return this.get();
};
ComputedValue.prototype.toString = function () {
return this.name + "[" + this.derivation.toString() + "]";
};
ComputedValue.prototype.whyRun = function () {
var isTracking = Boolean(globalState.trackingDerivation);
var observing = unique(this.isComputing ? this.newObserving : this.observing).map(function (dep) { return dep.name; });
var observers = unique(getObservers(this).map(function (dep) { return dep.name; }));
return (("\nWhyRun? computation '" + this.name + "':\n * Running because: " + (isTracking ? "[active] the value of this computation is needed by a reaction" : this.isComputing ? "[get] The value of this computed was requested outside a reaction" : "[idle] not running at the moment") + "\n") +
(this.dependenciesState === IDerivationState.NOT_TRACKING
?
" * This computation is suspended (not in use by any reaction) and won't run automatically.\n\tDidn't expect this computation to be suspended at this point?\n\t 1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n\t 2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).\n"
:
" * This computation will re-run if any of the following observables changes:\n " + joinStrings(observing) + "\n " + ((this.isComputing && isTracking) ? " (... or any observable accessed during the remainder of the current run)" : "") + "\n\tMissing items in this list?\n\t 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n\t 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n * If the outcome of this computation changes, the following observers will be re-run:\n " + joinStrings(observers) + "\n"));
};
return ComputedValue;
}());
var isComputedValue = createInstanceofPredicate("ComputedValue", ComputedValue);
var IDerivationState;
(function (IDerivationState) {
IDerivationState[IDerivationState["NOT_TRACKING"] = -1] = "NOT_TRACKING";
IDerivationState[IDerivationState["UP_TO_DATE"] = 0] = "UP_TO_DATE";
IDerivationState[IDerivationState["POSSIBLY_STALE"] = 1] = "POSSIBLY_STALE";
IDerivationState[IDerivationState["STALE"] = 2] = "STALE";
})(IDerivationState || (IDerivationState = {}));
exports.IDerivationState = IDerivationState;
function shouldCompute(derivation) {
switch (derivation.dependenciesState) {
case IDerivationState.UP_TO_DATE: return false;
case IDerivationState.NOT_TRACKING:
case IDerivationState.STALE: return true;
case IDerivationState.POSSIBLY_STALE: {
var hasError = true;
var prevUntracked = untrackedStart();
try {
var obs = derivation.observing, l = obs.length;
for (var i = 0; i < l; i++) {
var obj = obs[i];
if (isComputedValue(obj)) {
obj.get();
if (derivation.dependenciesState === IDerivationState.STALE) {
hasError = false;
untrackedEnd(prevUntracked);
return true;
}
}
}
hasError = false;
changeDependenciesStateTo0(derivation);
untrackedEnd(prevUntracked);
return false;
}
finally {
if (hasError) {
changeDependenciesStateTo0(derivation);
}
}
}
}
}
function isComputingDerivation() {
return globalState.trackingDerivation !== null;
}
function checkIfStateModificationsAreAllowed() {
if (!globalState.allowStateChanges) {
invariant(false, globalState.strictMode
? "It is not allowed to create or change state outside an `action` when MobX is in strict mode. Wrap the current method in `action` if this state change is intended"
: "It is not allowed to change the state when a computed value or transformer is being evaluated. Use 'autorun' to create reactive functions with side-effects.");
}
}
function trackDerivedFunction(derivation, f) {
changeDependenciesStateTo0(derivation);
derivation.newObserving = new Array(derivation.observing.length + 100);
derivation.unboundDepsCount = 0;
derivation.runId = ++globalState.runId;
var prevTracking = globalState.trackingDerivation;
globalState.trackingDerivation = derivation;
var hasException = true;
var result;
try {
result = f.call(derivation);
hasException = false;
}
finally {
if (hasException) {
handleExceptionInDerivation(derivation);
}
else {
globalState.trackingDerivation = prevTracking;
bindDependencies(derivation);
}
}
return result;
}
function handleExceptionInDerivation(derivation) {
var message = ("[mobx] An uncaught exception occurred while calculating your computed value, autorun or transformer. Or inside the render() method of an observer based React component. " +
"These functions should never throw exceptions as MobX will not always be able to recover from them. " +
("Please fix the error reported after this message or enable 'Pause on (caught) exceptions' in your debugger to find the root cause. In: '" + derivation.name + "'. ") +
"For more details see https://github.com/mobxjs/mobx/issues/462");
if (isSpyEnabled()) {
spyReport({
type: "error",
message: message
});
}
console.warn(message);
changeDependenciesStateTo0(derivation);
derivation.newObserving = null;
derivation.unboundDepsCount = 0;
derivation.recoverFromError();
endBatch();
resetGlobalState();
}
function bindDependencies(derivation) {
var prevObserving = derivation.observing;
var observing = derivation.observing = derivation.newObserving;
derivation.newObserving = null;
var i0 = 0, l = derivation.unboundDepsCount;
for (var i = 0; i < l; i++) {
var dep = observing[i];
if (dep.diffValue === 0) {
dep.diffValue = 1;
if (i0 !== i)
{ observing[i0] = dep; }
i0++;
}
}
observing.length = i0;
l = prevObserving.length;
while (l--) {
var dep = prevObserving[l];
if (dep.diffValue === 0) {
removeObserver(dep, derivation);
}
dep.diffValue = 0;
}
while (i0--) {
var dep = observing[i0];
if (dep.diffValue === 1) {
dep.diffValue = 0;
addObserver(dep, derivation);
}
}
}
function clearObserving(derivation) {
var obs = derivation.observing;
var i = obs.length;
while (i--)
{ removeObserver(obs[i], derivation); }
derivation.dependenciesState = IDerivationState.NOT_TRACKING;
obs.length = 0;
}
function untracked(action) {
var prev = untrackedStart();
var res = action();
untrackedEnd(prev);
return res;
}
exports.untracked = untracked;
function untrackedStart() {
var prev = globalState.trackingDerivation;
globalState.trackingDerivation = null;
return prev;
}
function untrackedEnd(prev) {
globalState.trackingDerivation = prev;
}
function changeDependenciesStateTo0(derivation) {
if (derivation.dependenciesState === IDerivationState.UP_TO_DATE)
{ return; }
derivation.dependenciesState = IDerivationState.UP_TO_DATE;
var obs = derivation.observing;
var i = obs.length;
while (i--)
{ obs[i].lowestObserverState = IDerivationState.UP_TO_DATE; }
}
var persistentKeys = ["mobxGuid", "resetId", "spyListeners", "strictMode", "runId"];
var MobXGlobals = (function () {
function MobXGlobals() {
this.version = 4;
this.trackingDerivation = null;
this.runId = 0;
this.mobxGuid = 0;
this.inTransaction = 0;
this.isRunningReactions = false;
this.inBatch = 0;
this.pendingUnobservations = [];
this.pendingReactions = [];
this.allowStateChanges = true;
this.strictMode = false;
this.resetId = 0;
this.spyListeners = [];
}
return MobXGlobals;
}());
var globalState = (function () {
var res = new MobXGlobals();
if (commonjsGlobal.__mobservableTrackingStack || commonjsGlobal.__mobservableViewStack)
{ throw new Error("[mobx] An incompatible version of mobservable is already loaded."); }
if (commonjsGlobal.__mobxGlobal && commonjsGlobal.__mobxGlobal.version !== res.version)
{ throw new Error("[mobx] An incompatible version of mobx is already loaded."); }
if (commonjsGlobal.__mobxGlobal)
{ return commonjsGlobal.__mobxGlobal; }
return commonjsGlobal.__mobxGlobal = res;
})();
function registerGlobals() {
}
function resetGlobalState() {
globalState.resetId++;
var defaultGlobals = new MobXGlobals();
for (var key in defaultGlobals)
{ if (persistentKeys.indexOf(key) === -1)
{ globalState[key] = defaultGlobals[key]; } }
globalState.allowStateChanges = !globalState.strictMode;
}
function hasObservers(observable) {
return observable.observers && observable.observers.length > 0;
}
function getObservers(observable) {
return observable.observers;
}
function invariantObservers(observable) {
var list = observable.observers;
var map = observable.observersIndexes;
var l = list.length;
for (var i = 0; i < l; i++) {
var id = list[i].__mapid;
if (i) {
invariant(map[id] === i, "INTERNAL ERROR maps derivation.__mapid to index in list");
}
else {
invariant(!(id in map), "INTERNAL ERROR observer on index 0 shouldnt be held in map.");
}
}
invariant(list.length === 0 || Object.keys(map).length === list.length - 1, "INTERNAL ERROR there is no junk in map");
}
function addObserver(observable, node) {
var l = observable.observers.length;
if (l) {
observable.observersIndexes[node.__mapid] = l;
}
observable.observers[l] = node;
if (observable.lowestObserverState > node.dependenciesState)
{ observable.lowestObserverState = node.dependenciesState; }
}
function removeObserver(observable, node) {
if (observable.observers.length === 1) {
observable.observers.length = 0;
queueForUnobservation(observable);
}
else {
var list = observable.observers;
var map_1 = observable.observersIndexes;
var filler = list.pop();
if (filler !== node) {
var index = map_1[node.__mapid] || 0;
if (index) {
map_1[filler.__mapid] = index;
}
else {
delete map_1[filler.__mapid];
}
list[index] = filler;
}
delete map_1[node.__mapid];
}
}
function queueForUnobservation(observable) {
if (!observable.isPendingUnobservation) {
observable.isPendingUnobservation = true;
globalState.pendingUnobservations.push(observable);
}
}
function startBatch() {
globalState.inBatch++;
}
function endBatch() {
if (globalState.inBatch === 1) {
var list = globalState.pendingUnobservations;
for (var i = 0; i < list.length; i++) {
var observable_1 = list[i];
observable_1.isPendingUnobservation = false;
if (observable_1.observers.length === 0) {
observable_1.onBecomeUnobserved();
}
}
globalState.pendingUnobservations = [];
}
globalState.inBatch--;
}
function reportObserved(observable) {
var derivation = globalState.trackingDerivation;
if (derivation !== null) {
if (derivation.runId !== observable.lastAccessedBy) {
observable.lastAccessedBy = derivation.runId;
derivation.newObserving[derivation.unboundDepsCount++] = observable;
}
}
else if (observable.observers.length === 0) {
queueForUnobservation(observable);
}
}
function invariantLOS(observable, msg) {
var min = getObservers(observable).reduce(function (a, b) { return Math.min(a, b.dependenciesState); }, 2);
if (min >= observable.lowestObserverState)
{ return; }
throw new Error("lowestObserverState is wrong for " + msg + " because " + min + " < " + observable.lowestObserverState);
}
function propagateChanged(observable) {
if (observable.lowestObserverState === IDerivationState.STALE)
{ return; }
observable.lowestObserverState = IDerivationState.STALE;
var observers = observable.observers;
var i = observers.length;
while (i--) {
var d = observers[i];
if (d.dependenciesState === IDerivationState.UP_TO_DATE)
{ d.onBecomeStale(); }
d.dependenciesState = IDerivationState.STALE;
}
}
function propagateChangeConfirmed(observable) {
if (observable.lowestObserverState === IDerivationState.STALE)
{ return; }
observable.lowestObserverState = IDerivationState.STALE;
var observers = observable.observers;
var i = observers.length;
while (i--) {
var d = observers[i];
if (d.dependenciesState === IDerivationState.POSSIBLY_STALE)
{ d.dependenciesState = IDerivationState.STALE; }
else if (d.dependenciesState === IDerivationState.UP_TO_DATE)
{ observable.lowestObserverState = IDerivationState.UP_TO_DATE; }
}
}
function propagateMaybeChanged(observable) {
if (observable.lowestObserverState !== IDerivationState.UP_TO_DATE)
{ return; }
observable.lowestObserverState = IDerivationState.POSSIBLY_STALE;
var observers = observable.observers;
var i = observers.length;
while (i--) {
var d = observers[i];
if (d.dependenciesState === IDerivationState.UP_TO_DATE) {
d.dependenciesState = IDerivationState.POSSIBLY_STALE;
d.onBecomeStale();
}
}
}
var Reaction = (function () {
function Reaction(name, onInvalidate) {
if (name === void 0) { name = "Reaction@" + getNextId(); }
this.name = name;
this.onInvalidate = onInvalidate;
this.observing = [];
this.newObserving = [];
this.dependenciesState = IDerivationState.NOT_TRACKING;
this.diffValue = 0;
this.runId = 0;
this.unboundDepsCount = 0;
this.__mapid = "#" + getNextId();
this.isDisposed = false;
this._isScheduled = false;
this._isTrackPending = false;
this._isRunning = false;
}
Reaction.prototype.onBecomeStale = function () {
this.schedule();
};
Reaction.prototype.schedule = function () {
if (!this._isScheduled) {
this._isScheduled = true;
globalState.pendingReactions.push(this);
startBatch();
runReactions();
endBatch();
}
};
Reaction.prototype.isScheduled = function () {
return this._isScheduled;
};
Reaction.prototype.runReaction = function () {
if (!this.isDisposed) {
this._isScheduled = false;
if (shouldCompute(this)) {
this._isTrackPending = true;
this.onInvalidate();
if (this._isTrackPending && isSpyEnabled()) {
spyReport({
object: this,
type: "scheduled-reaction"
});
}
}
}
};
Reaction.prototype.track = function (fn) {
startBatch();
var notify = isSpyEnabled();
var startTime;
if (notify) {
startTime = Date.now();
spyReportStart({
object: this,
type: "reaction",
fn: fn
});
}
this._isRunning = true;
trackDerivedFunction(this, fn);
this._isRunning = false;
this._isTrackPending = false;
if (this.isDisposed) {
clearObserving(this);
}
if (notify) {
spyReportEnd({
time: Date.now() - startTime
});
}
endBatch();
};
Reaction.prototype.recoverFromError = function () {
this._isRunning = false;
this._isTrackPending = false;
};
Reaction.prototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
if (!this._isRunning) {
startBatch();
clearObserving(this);
endBatch();
}
}
};
Reaction.prototype.getDisposer = function () {
var r = this.dispose.bind(this);
r.$mobx = this;
return r;
};
Reaction.prototype.toString = function () {
return "Reaction[" + this.name + "]";
};
Reaction.prototype.whyRun = function () {
var observing = unique(this._isRunning ? this.newObserving : this.observing).map(function (dep) { return dep.name; });
return ("\nWhyRun? reaction '" + this.name + "':\n * Status: [" + (this.isDisposed ? "stopped" : this._isRunning ? "running" : this.isScheduled() ? "scheduled" : "idle") + "]\n * This reaction will re-run if any of the following observables changes:\n " + joinStrings(observing) + "\n " + ((this._isRunning) ? " (... or any observable accessed during the remainder of the current run)" : "") + "\n\tMissing items in this list?\n\t 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n\t 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n");
};
return Reaction;
}());
exports.Reaction = Reaction;
var MAX_REACTION_ITERATIONS = 100;
var reactionScheduler = function (f) { return f(); };
function runReactions() {
if (globalState.isRunningReactions === true || globalState.inTransaction > 0)
{ return; }
reactionScheduler(runReactionsHelper);
}
function runReactionsHelper() {
globalState.isRunningReactions = true;
var allReactions = globalState.pendingReactions;
var iterations = 0;
while (allReactions.length > 0) {
if (++iterations === MAX_REACTION_ITERATIONS) {
resetGlobalState();
throw new Error(("Reaction doesn't converge to a stable state after " + MAX_REACTION_ITERATIONS + " iterations.")
+ (" Probably there is a cycle in the reactive function: " + allReactions[0]));
}
var remainingReactions = allReactions.splice(0);
for (var i = 0, l = remainingReactions.length; i < l; i++)
{ remainingReactions[i].runReaction(); }
}
globalState.isRunningReactions = false;
}
var isReaction = createInstanceofPredicate("Reaction", Reaction);
function setReactionScheduler(fn) {
var baseScheduler = reactionScheduler;
reactionScheduler = function (f) { return fn(function () { return baseScheduler(f); }); };
}
function isSpyEnabled() {
return !!globalState.spyListeners.length;
}
function spyReport(event) {
if (!globalState.spyListeners.length)
{ return false; }
var listeners = globalState.spyListeners;
for (var i = 0, l = listeners.length; i < l; i++)
{ listeners[i](event); }
}
function spyReportStart(event) {
var change = objectAssign({}, event, { spyReportStart: true });
spyReport(change);
}
var END_EVENT = { spyReportEnd: true };
function spyReportEnd(change) {
if (change)
{ spyReport(objectAssign({}, change, END_EVENT)); }
else
{ spyReport(END_EVENT); }
}
function spy(listener) {
globalState.spyListeners.push(listener);
return once(function () {
var idx = globalState.spyListeners.indexOf(listener);
if (idx !== -1)
{ globalState.spyListeners.splice(idx, 1); }
});
}
exports.spy = spy;
function trackTransitions(onReport) {
deprecated("trackTransitions is deprecated. Use mobx.spy instead");
if (typeof onReport === "boolean") {
deprecated("trackTransitions only takes a single callback function. If you are using the mobx-react-devtools, please update them first");
onReport = arguments[1];
}
if (!onReport) {
deprecated("trackTransitions without callback has been deprecated and is a no-op now. If you are using the mobx-react-devtools, please update them first");
return function () { };
}
return spy(onReport);
}
function transaction(action, thisArg, report) {
if (thisArg === void 0) { thisArg = undefined; }
if (report === void 0) { report = true; }
transactionStart((action.name) || "anonymous transaction", thisArg, report);
try {
return action.call(thisArg);
}
finally {
transactionEnd(report);
}
}
exports.transaction = transaction;
function transactionStart(name, thisArg, report) {
if (thisArg === void 0) { thisArg = undefined; }
if (report === void 0) { report = true; }
startBatch();
globalState.inTransaction += 1;
if (report && isSpyEnabled()) {
spyReportStart({
type: "transaction",
target: thisArg,
name: name
});
}
}
function transactionEnd(report) {
if (report === void 0) { report = true; }
if (--globalState.inTransaction === 0) {
runReactions();
}
if (report && isSpyEnabled())
{ spyReportEnd(); }
endBatch();
}
function hasInterceptors(interceptable) {
return (interceptable.interceptors && interceptable.interceptors.length > 0);
}
function registerInterceptor(interceptable, handler) {
var interceptors = interceptable.interceptors || (interceptable.interceptors = []);
interceptors.push(handler);
return once(function () {
var idx = interceptors.indexOf(handler);
if (idx !== -1)
{ interceptors.splice(idx, 1); }
});
}
function interceptChange(interceptable, change) {
var prevU = untrackedStart();
try {
var interceptors = interceptable.interceptors;
for (var i = 0, l = interceptors.length; i < l; i++) {
change = interceptors[i](change);
invariant(!change || change.type, "Intercept handlers should return nothing or a change object");
if (!change)
{ break; }
}
return change;
}
finally {
untrackedEnd(prevU);
}
}
function hasListeners(listenable) {
return listenable.changeListeners && listenable.changeListeners.length > 0;
}
function registerListener(listenable, handler) {
var listeners = listenable.changeListeners || (listenable.changeListeners = []);
listeners.push(handler);
return once(function () {
var idx = listeners.indexOf(handler);
if (idx !== -1)
{ listeners.splice(idx, 1); }
});
}
function notifyListeners(listenable, change) {
var prevU = untrackedStart();
var listeners = listenable.changeListeners;
if (!listeners)
{ return; }
listeners = listeners.slice();
for (var i = 0, l = listeners.length; i < l; i++) {
if (Array.isArray(change)) {
listeners[i].apply(null, change);
}
else {
listeners[i](change);
}
}
untrackedEnd(prevU);
}
var ValueMode;
(function (ValueMode) {
ValueMode[ValueMode["Recursive"] = 0] = "Recursive";
ValueMode[ValueMode["Reference"] = 1] = "Reference";
ValueMode[ValueMode["Structure"] = 2] = "Structure";
ValueMode[ValueMode["Flat"] = 3] = "Flat";
})(ValueMode || (ValueMode = {}));
exports.ValueMode = ValueMode;
function withModifier(modifier, value) {
assertUnwrapped(value, "Modifiers are not allowed to be nested");
return {
mobxModifier: modifier,
value: value
};
}
function getModifier(value) {
if (value) {
return value.mobxModifier || null;
}
return null;
}
function asReference(value) {
return withModifier(ValueMode.Reference, value);
}
exports.asReference = asReference;
asReference.mobxModifier = ValueMode.Reference;
function asStructure(value) {
return withModifier(ValueMode.Structure, value);
}
exports.asStructure = asStructure;
asStructure.mobxModifier = ValueMode.Structure;
function asFlat(value) {
return withModifier(ValueMode.Flat, value);
}
exports.asFlat = asFlat;
asFlat.mobxModifier = ValueMode.Flat;
function asMap(data, modifierFunc) {
return map(data, modifierFunc);
}
exports.asMap = asMap;
function getValueModeFromValue(value, defaultMode) {
var mode = getModifier(value);
if (mode)
{ return [mode, value.value]; }
return [defaultMode, value];
}
function getValueModeFromModifierFunc(func) {
if (func === undefined)
{ return ValueMode.Recursive; }
var mod = getModifier(func);
invariant(mod !== null, "Cannot determine value mode from function. Please pass in one of these: mobx.asReference, mobx.asStructure or mobx.asFlat, got: " + func);
return mod;
}
function isModifierWrapper(value) {
return value.mobxModifier !== undefined;
}
function makeChildObservable(value, parentMode, name) {
var childMode;
if (isObservable(value))
{ return value; }
switch (parentMode) {
case ValueMode.Reference:
return value;
case ValueMode.Flat:
assertUnwrapped(value, "Items inside 'asFlat' cannot have modifiers");
childMode = ValueMode.Reference;
break;
case ValueMode.Structure:
assertUnwrapped(value, "Items inside 'asStructure' cannot have modifiers");
childMode = ValueMode.Structure;
break;
case ValueMode.Recursive:
_a = getValueModeFromValue(value, ValueMode.Recursive), childMode = _a[0], value = _a[1];
break;
default:
invariant(false, "Illegal State");
}
if (Array.isArray(value))
{ return createObservableArray(value, childMode, name); }
if (isPlainObject(value) && Object.isExtensible(value))
{ return extendObservableHelper(value, value, childMode, name); }
return value;
var _a;
}
function assertUnwrapped(value, message) {
if (getModifier(value) !== null)
{ throw new Error("[mobx] asStructure / asReference / asFlat cannot be used here. " + message); }
}
var safariPrototypeSetterInheritanceBug = (function () {
var v = false;
var p = {};
Object.defineProperty(p, "0", { set: function () { v = true; } });
Object.create(p)["0"] = 1;
return v === false;
})();
var OBSERVABLE_ARRAY_BUFFER_SIZE = 0;
var StubArray = (function () {
function StubArray() {
}
return StubArray;
}());
StubArray.prototype = [];
var ObservableArrayAdministration = (function () {
function ObservableArrayAdministration(name, mode, array, owned) {
this.mode = mode;
this.array = array;
this.owned = owned;
this.lastKnownLength = 0;
this.interceptors = null;
this.changeListeners = null;
this.atom = new BaseAtom(name || ("ObservableArray@" + getNextId()));
}
ObservableArrayAdministration.prototype.makeReactiveArrayItem = function (value) {
assertUnwrapped(value, "Array values cannot have modifiers");
if (this.mode === ValueMode.Flat || this.mode === ValueMode.Reference)
{ return value; }
return makeChildObservable(value, this.mode, this.atom.name + "[..]");
};
ObservableArrayAdministration.prototype.intercept = function (handler) {
return registerInterceptor(this, handler);
};
ObservableArrayAdministration.prototype.observe = function (listener, fireImmediately) {
if (fireImmediately === void 0) { fireImmediately = false; }
if (fireImmediately) {
listener({
object: this.array,
type: "splice",
index: 0,
added: this.values.slice(),
addedCount: this.values.length,
removed: [],
removedCount: 0
});
}
return registerListener(this, listener);
};
ObservableArrayAdministration.prototype.getArrayLength = function () {
this.atom.reportObserved();
return this.values.length;
};
ObservableArrayAdministration.prototype.setArrayLength = function (newLength) {
if (typeof newLength !== "number" || newLength < 0)
{ throw new Error("[mobx.array] Out of range: " + newLength); }
var currentLength = this.values.length;
if (newLength === currentLength)
{ return; }
else if (newLength > currentLength)
{ this.spliceWithArray(currentLength, 0, new Array(newLength - currentLength)); }
else
{ this.spliceWithArray(newLength, currentLength - newLength); }
};
ObservableArrayAdministration.prototype.updateArrayLength = function (oldLength, delta) {
if (oldLength !== this.lastKnownLength)
{ throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?"); }
this.lastKnownLength += delta;
if (delta > 0 && oldLength + delta + 1 > OBSERVABLE_ARRAY_BUFFER_SIZE)
{ reserveArrayBuffer(oldLength + delta + 1); }
};
ObservableArrayAdministration.prototype.spliceWithArray = function (index, deleteCount, newItems) {
checkIfStateModificationsAreAllowed();
var length = this.values.length;
if (index === undefined)
{ index = 0; }
else if (index > length)
{ index = length; }
else if (index < 0)
{ index = Math.max(0, length + index); }
if (arguments.length === 1)
{ deleteCount = length - index; }
else if (deleteCount === undefined || deleteCount === null)
{ deleteCount = 0; }
else
{ deleteCount = Math.max(0, Math.min(deleteCount, length - index)); }
if (newItems === undefined)
{ newItems = []; }
if (hasInterceptors(this)) {
var change = interceptChange(this, {
object: this.array,
type: "splice",
index: index,
removedCount: deleteCount,
added: newItems
});
if (!change)
{ return EMPTY_ARRAY; }
deleteCount = change.removedCount;
newItems = change.added;
}
newItems = newItems.map(this.makeReactiveArrayItem, this);
var lengthDelta = newItems.length - deleteCount;
this.updateArrayLength(length, lengthDelta);
var res = (_a = this.values).splice.apply(_a, [index, deleteCount].concat(newItems));
if (deleteCount !== 0 || newItems.length !== 0)
{ this.notifyArraySplice(index, newItems, res); }
return res;
var _a;
};
ObservableArrayAdministration.prototype.notifyArrayChildUpdate = function (index, newValue, oldValue) {
var notifySpy = !this.owned && isSpyEnabled();
var notify = hasListeners(this);
var change = notify || notifySpy ? {
object: this.array,
type: "update",
index: index, newValue: newValue, oldValue: oldValue
} : null;
if (notifySpy)
{ spyReportStart(change); }
this.atom.reportChanged();
if (notify)
{ notifyListeners(this, change); }
if (notifySpy)
{ spyReportEnd(); }
};
ObservableArrayAdministration.prototype.notifyArraySplice = function (index, added, removed) {
var notifySpy = !this.owned && isSpyEnabled();
var notify = hasListeners(this);
var change = notify || notifySpy ? {
object: this.array,
type: "splice",
index: index, removed: removed, added: added,
removedCount: removed.length,
addedCount: added.length
} : null;
if (notifySpy)
{ spyReportStart(change); }
this.atom.reportChanged();
if (notify)
{ notifyListeners(this, change); }
if (notifySpy)
{ spyReportEnd(); }
};
return ObservableArrayAdministration;
}());
var ObservableArray = (function (_super) {
__extends(ObservableArray, _super);
function ObservableArray(initialValues, mode, name, owned) {
if (owned === void 0) { owned = false; }
_super.call(this);
var adm = new ObservableArrayAdministration(name, mode, this, owned);
addHiddenFinalProp(this, "$mobx", adm);
if (initialValues && initialValues.length) {
adm.updateArrayLength(0, initialValues.length);
adm.values = initialValues.map(adm.makeReactiveArrayItem, adm);
adm.notifyArraySplice(0, adm.values.slice(), EMPTY_ARRAY);
}
else {
adm.values = [];
}
if (safariPrototypeSetterInheritanceBug) {
Object.defineProperty(adm.array, "0", ENTRY_0);
}
}
ObservableArray.prototype.intercept = function (handler) {
return this.$mobx.intercept(handler);
};
ObservableArray.prototype.observe = function (listener, fireImmediately) {
if (fireImmediately === void 0) { fireImmediately = false; }
return this.$mobx.observe(listener, fireImmediately);
};
ObservableArray.prototype.clear = function () {
return this.splice(0);
};
ObservableArray.prototype.concat = function () {
var arguments$1 = arguments;
var arrays = [];
for (var _i = 0; _i < arguments.length; _i++) {
arrays[_i - 0] = arguments$1[_i];
}
this.$mobx.atom.reportObserved();
return Array.prototype.concat.apply(this.slice(), arrays.map(function (a) { return isObservableArray(a) ? a.slice() : a; }));
};
ObservableArray.prototype.replace = function (newItems) {
return this.$mobx.spliceWithArray(0, this.$mobx.values.length, newItems);
};
ObservableArray.prototype.toJS = function () {
return this.slice();
};
ObservableArray.prototype.toJSON = function () {
return this.toJS();
};
ObservableArray.prototype.peek = function () {
return this.$mobx.values;
};
ObservableArray.prototype.find = function (predicate, thisArg, fromIndex) {
var this$1 = this;
if (fromIndex === void 0) { fromIndex = 0; }
this.$mobx.atom.reportObserved();
var items = this.$mobx.values, l = items.length;
for (var i = fromIndex; i < l; i++)
{ if (predicate.call(thisArg, items[i], i, this$1))
{ return items[i]; } }
return undefined;
};
ObservableArray.prototype.splice = function (index, deleteCount) {
var arguments$1 = arguments;
var newItems = [];
for (var _i = 2; _i < arguments.length; _i++) {
newItems[_i - 2] = arguments$1[_i];
}
switch (arguments.length) {
case 0:
return [];
case 1:
return this.$mobx.spliceWithArray(index);
case 2:
return this.$mobx.spliceWithArray(index, deleteCount);
}
return this.$mobx.spliceWithArray(index, deleteCount, newItems);
};
ObservableArray.prototype.push = function () {
var arguments$1 = arguments;
var items = [];
for (var _i = 0; _i < arguments.length; _i++) {
items[_i - 0] = arguments$1[_i];
}
var adm = this.$mobx;
adm.spliceWithArray(adm.values.length, 0, items);
return adm.values.length;
};
ObservableArray.prototype.pop = function () {
return this.splice(Math.max(this.$mobx.values.length - 1, 0), 1)[0];
};
ObservableArray.prototype.shift = function () {
return this.splice(0, 1)[0];
};
ObservableArray.prototype.unshift = function () {
var arguments$1 = arguments;
var items = [];
for (var _i = 0; _i < arguments.length; _i++) {
items[_i - 0] = arguments$1[_i];
}
var adm = this.$mobx;
adm.spliceWithArray(0, 0, items);
return adm.values.length;
};
ObservableArray.prototype.reverse = function () {
this.$mobx.atom.reportObserved();
var clone = this.slice();
return clone.reverse.apply(clone, arguments);
};
ObservableArray.prototype.sort = function (compareFn) {
this.$mobx.atom.reportObserved();
var clone = this.slice();
return clone.sort.apply(clone, arguments);
};
ObservableArray.prototype.remove = function (value) {
var idx = this.$mobx.values.indexOf(value);
if (idx > -1) {
this.splice(idx, 1);
return true;
}
return false;
};
ObservableArray.prototype.toString = function () {
return "[mobx.array] " + Array.prototype.toString.apply(this.$mobx.values, arguments);
};
ObservableArray.prototype.toLocaleString = function () {
return "[mobx.array] " + Array.prototype.toLocaleString.apply(this.$mobx.values, arguments);
};
return ObservableArray;
}(StubArray));
declareIterator(ObservableArray.prototype, function () {
return arrayAsIterator(this.slice());
});
makeNonEnumerable(ObservableArray.prototype, [
"constructor",
"intercept",
"observe",
"clear",
"concat",
"replace",
"toJS",
"toJSON",
"peek",
"find",
"splice",
"push",
"pop",
"shift",
"unshift",
"reverse",
"sort",
"remove",
"toString",
"toLocaleString"
]);
Object.defineProperty(ObservableArray.prototype, "length", {
enumerable: false,
configurable: true,
get: function () {
return this.$mobx.getArrayLength();
},
set: function (newLength) {
this.$mobx.setArrayLength(newLength);
}
});
[
"every",
"filter",
"forEach",
"indexOf",
"join",
"lastIndexOf",
"map",
"reduce",
"reduceRight",
"slice",
"some"
].forEach(function (funcName) {
var baseFunc = Array.prototype[funcName];
invariant(typeof baseFunc === "function", "Base function not defined on Array prototype: '" + funcName + "'");
addHiddenProp(ObservableArray.prototype, funcName, function () {
this.$mobx.atom.reportObserved();
return baseFunc.apply(this.$mobx.values, arguments);
});
});
var ENTRY_0 = {
configurable: true,
enumerable: false,
set: createArraySetter(0),
get: createArrayGetter(0)
};
function createArrayBufferItem(index) {
var set = createArraySetter(index);
var get = createArrayGetter(index);
Object.defineProperty(ObservableArray.prototype, "" + index, {
enumerable: false,
configurable: true,
set: set, get: get
});
}
function createArraySetter(index) {
return function (newValue) {
var adm = this.$mobx;
var values = adm.values;
assertUnwrapped(newValue, "Modifiers cannot be used on array values. For non-reactive array values use makeReactive(asFlat(array)).");
if (index < values.length) {
checkIfStateModificationsAreAllowed();
var oldValue = values[index];
if (hasInterceptors(adm)) {
var change = interceptChange(adm, {
type: "update",
object: adm.array,
index: index, newValue: newValue
});
if (!change)
{ return; }
newValue = change.newValue;
}
newValue = adm.makeReactiveArrayItem(newValue);
var changed = (adm.mode === ValueMode.Structure) ? !deepEquals(oldValue, newValue) : oldValue !== newValue;
if (changed) {
values[index] = newValue;
adm.notifyArrayChildUpdate(index, newValue, oldValue);
}
}
else if (index === values.length) {
adm.spliceWithArray(index, 0, [newValue]);
}
else
{ throw new Error("[mobx.array] Index out of bounds, " + index + " is larger than " + values.length); }
};
}
function createArrayGetter(index) {
return function () {
var impl = this.$mobx;
if (impl && index < impl.values.length) {
impl.atom.reportObserved();
return impl.values[index];
}
console.warn("[mobx.array] Attempt to read an array index (" + index + ") that is out of bounds (" + impl.values.length + "). Please check length first. Out of bound indices will not be tracked by MobX");
return undefined;
};
}
function reserveArrayBuffer(max) {
for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max; index++)
{ createArrayBufferItem(index); }
OBSERVABLE_ARRAY_BUFFER_SIZE = max;
}
reserveArrayBuffer(1000);
function createObservableArray(initialValues, mode, name) {
return new ObservableArray(initialValues, mode, name);
}
function fastArray(initialValues) {
deprecated("fastArray is deprecated. Please use `observable(asFlat([]))`");
return createObservableArray(initialValues, ValueMode.Flat, null);
}
exports.fastArray = fastArray;
var isObservableArrayAdministration = createInstanceofPredicate("ObservableArrayAdministration", ObservableArrayAdministration);
function isObservableArray(thing) {
return isObject(thing) && isObservableArrayAdministration(thing.$mobx);
}
exports.isObservableArray = isObservableArray;
var ObservableMapMarker = {};
var ObservableMap = (function () {
function ObservableMap(initialData, valueModeFunc) {
var _this = this;
this.$mobx = ObservableMapMarker;
this._data = {};
this._hasMap = {};
this.name = "ObservableMap@" + getNextId();
this._keys = new ObservableArray(null, ValueMode.Reference, this.name + ".keys()", true);
this.interceptors = null;
this.changeListeners = null;
this._valueMode = getValueModeFromModifierFunc(valueModeFunc);
if (this._valueMode === ValueMode.Flat)
{ this._valueMode = ValueMode.Reference; }
allowStateChanges(true, function () {
if (isPlainObject(initialData))
{ _this.merge(initialData); }
else if (Array.isArray(initialData))
{ initialData.forEach(function (_a) {
var key = _a[0], value = _a[1];
return _this.set(key, value);
}); }
});
}
ObservableMap.prototype._has = function (key) {
return typeof this._data[key] !== "undefined";
};
ObservableMap.prototype.has = function (key) {
if (!this.isValidKey(key))
{ return false; }
key = "" + key;
if (this._hasMap[key])
{ return this._hasMap[key].get(); }
return this._updateHasMapEntry(key, false).get();
};
ObservableMap.prototype.set = function (key, value) {
this.assertValidKey(key);
key = "" + key;
var hasKey = this._has(key);
assertUnwrapped(value, "[mobx.map.set] Expected unwrapped value to be inserted to key '" + key + "'. If you need to use modifiers pass them as second argument to the constructor");
if (hasInterceptors(this)) {
var change = interceptChange(this, {
type: hasKey ? "update" : "add",
object: this,
newValue: value,
name: key
});
if (!change)
{ return; }
value = change.newValue;
}
if (hasKey) {
this._updateValue(key, value);
}
else {
this._addValue(key, value);
}
};
ObservableMap.prototype.delete = function (key) {
var _this = this;
this.assertValidKey(key);
key = "" + key;
if (hasInterceptors(this)) {
var change = interceptChange(this, {
type: "delete",
object: this,
name: key
});
if (!change)
{ return false; }
}
if (this._has(key)) {
var notifySpy = isSpyEnabled();
var notify = hasListeners(this);
var change = notify || notifySpy ? {
type: "delete",
object: this,
oldValue: this._data[key].value,
name: key
} : null;
if (notifySpy)
{ spyReportStart(change); }
transaction(function () {
_this._keys.remove(key);
_this._updateHasMapEntry(key, false);
var observable = _this._data[key];
observable.setNewValue(undefined);
_this._data[key] = undefined;
}, undefined, false);
if (notify)
{ notifyListeners(this, change); }
if (notifySpy)
{ spyReportEnd(); }
return true;
}
return false;
};
ObservableMap.prototype._updateHasMapEntry = function (key, value) {
var entry = this._hasMap[key];
if (entry) {
entry.setNewValue(value);
}
else {
entry = this._hasMap[key] = new ObservableValue(value, ValueMode.Reference, this.name + "." + key + "?", false);
}
return entry;
};
ObservableMap.prototype._updateValue = function (name, newValue) {
var observable = this._data[name];
newValue = observable.prepareNewValue(newValue);
if (newValue !== UNCHANGED) {
var notifySpy = isSpyEnabled();
var notify = hasListeners(this);
var change = notify || notifySpy ? {
type: "update",
object: this,
oldValue: observable.value,
name: name, newValue: newValue
} : null;
if (notifySpy)
{ spyReportStart(change); }
observable.setNewValue(newValue);
if (notify)
{ notifyListeners(this, change); }
if (notifySpy)
{ spyReportEnd(); }
}
};
ObservableMap.prototype._addValue = function (name, newValue) {
var _this = this;
transaction(function () {
var observable = _this._data[name] = new ObservableValue(newValue, _this._valueMode, _this.name + "." + name, false);
newValue = observable.value;
_this._updateHasMapEntry(name, true);
_this._keys.push(name);
}, undefined, false);
var notifySpy = isSpyEnabled();
var notify = hasListeners(this);
var change = notify || notifySpy ? {
type: "add",
object: this,
name: name, newValue: newValue
} : null;
if (notifySpy)
{ spyReportStart(change); }
if (notify)
{ notifyListeners(this, change); }
if (notifySpy)
{ spyReportEnd(); }
};
ObservableMap.prototype.get = function (key) {
key = "" + key;
if (this.has(key))
{ return this._data[key].get(); }
return undefined;
};
ObservableMap.prototype.keys = function () {
return arrayAsIterator(this._keys.slice());
};
ObservableMap.prototype.values = function () {
return arrayAsIterator(this._keys.map(this.get, this));
};
ObservableMap.prototype.entries = function () {
var _this = this;
return arrayAsIterator(this._keys.map(function (key) { return [key, _this.get(key)]; }));
};
ObservableMap.prototype.forEach = function (callback, thisArg) {
var _this = this;
this.keys().forEach(function (key) { return callback.call(thisArg, _this.get(key), key); });
};
ObservableMap.prototype.merge = function (other) {
var _this = this;
transaction(function () {
if (isObservableMap(other))
{ other.keys().forEach(function (key) { return _this.set(key, other.get(key)); }); }
else
{ Object.keys(other).forEach(function (key) { return _this.set(key, other[key]); }); }
}, undefined, false);
return this;
};
ObservableMap.prototype.clear = function () {
var _this = this;
transaction(function () {
untracked(function () {
_this.keys().forEach(_this.delete, _this);
});
}, undefined, false);
};
Object.defineProperty(ObservableMap.prototype, "size", {
get: function () {
return this._keys.length;
},
enumerable: true,
configurable: true
});
ObservableMap.prototype.toJS = function () {
var _this = this;
var res = {};
this.keys().forEach(function (key) { return res[key] = _this.get(key); });
return res;
};
ObservableMap.prototype.toJs = function () {
deprecated("toJs is deprecated, use toJS instead");
return this.toJS();
};
ObservableMap.prototype.toJSON = function () {
return this.toJS();
};
ObservableMap.prototype.isValidKey = function (key) {
if (key === null || key === undefined)
{ return false; }
if (typeof key !== "string" && typeof key !== "number" && typeof key !== "boolean")
{ return false; }
return true;
};
ObservableMap.prototype.assertValidKey = function (key) {
if (!this.isValidKey(key))
{ throw new Error("[mobx.map] Invalid key: '" + key + "'"); }
};
ObservableMap.prototype.toString = function () {
var _this = this;
return this.name + "[{ " + this.keys().map(function (key) { return (key + ": " + ("" + _this.get(key))); }).join(", ") + " }]";
};
ObservableMap.prototype.observe = function (listener, fireImmediately) {
invariant(fireImmediately !== true, "`observe` doesn't support the fire immediately property for observable maps.");
return registerListener(this, listener);
};
ObservableMap.prototype.intercept = function (handler) {
return registerInterceptor(this, handler);
};
return ObservableMap;
}());
exports.ObservableMap = ObservableMap;
declareIterator(ObservableMap.prototype, function () {
return this.entries();
});
function map(initialValues, valueModifier) {
return new ObservableMap(initialValues, valueModifier);
}
exports.map = map;
var isObservableMap = createInstanceofPredicate("ObservableMap", ObservableMap);
exports.isObservableMap = isObservableMap;
var ObservableObjectAdministration = (function () {
function ObservableObjectAdministration(target, name, mode) {
this.target = target;
this.name = name;
this.mode = mode;
this.values = {};
this.changeListeners = null;
this.interceptors = null;
}
ObservableObjectAdministration.prototype.observe = function (callback, fireImmediately) {
invariant(fireImmediately !== true, "`observe` doesn't support the fire immediately property for observable objects.");
return registerListener(this, callback);
};
ObservableObjectAdministration.prototype.intercept = function (handler) {
return registerInterceptor(this, handler);
};
return ObservableObjectAdministration;
}());
function asObservableObject(target, name, mode) {
if (mode === void 0) { mode = ValueMode.Recursive; }
if (isObservableObject(target))
{ return target.$mobx; }
if (!isPlainObject(target))
{ name = target.constructor.name + "@" + getNextId(); }
if (!name)
{ name = "ObservableObject@" + getNextId(); }
var adm = new ObservableObjectAdministration(target, name, mode);
addHiddenFinalProp(target, "$mobx", adm);
return adm;
}
function setObservableObjectInstanceProperty(adm, propName, descriptor) {
if (adm.values[propName]) {
invariant("value" in descriptor, "cannot redefine property " + propName);
adm.target[propName] = descriptor.value;
}
else {
if ("value" in descriptor)
{ defineObservableProperty(adm, propName, descriptor.value, true, undefined); }
else
{ defineObservableProperty(adm, propName, descriptor.get, true, descriptor.set); }
}
}
function defineObservableProperty(adm, propName, newValue, asInstanceProperty, setter) {
if (asInstanceProperty)
{ assertPropertyConfigurable(adm.target, propName); }
var observable;
var name = adm.name + "." + propName;
var isComputed = true;
if (isComputedValue(newValue)) {
observable = newValue;
newValue.name = name;
if (!newValue.scope)
{ newValue.scope = adm.target; }
}
else if (typeof newValue === "function" && newValue.length === 0 && !isAction(newValue)) {
observable = new ComputedValue(newValue, adm.target, false, name, setter);
}
else if (getModifier(newValue) === ValueMode.Structure && typeof newValue.value === "function" && newValue.value.length === 0) {
observable = new ComputedValue(newValue.value, adm.target, true, name, setter);
}
else {
isComputed = false;
if (hasInterceptors(adm)) {
var change = interceptChange(adm, {
object: adm.target,
name: propName,
type: "add",
newValue: newValue
});
if (!change)
{ return; }
newValue = change.newValue;
}
observable = new ObservableValue(newValue, adm.mode, name, false);
newValue = observable.value;
}
adm.values[propName] = observable;
if (asInstanceProperty) {
Object.defineProperty(adm.target, propName, isComputed ? generateComputedPropConfig(propName) : generateObservablePropConfig(propName));
}
if (!isComputed)
{ notifyPropertyAddition(adm, adm.target, propName, newValue); }
}
var observablePropertyConfigs = {};
var computedPropertyConfigs = {};
function generateObservablePropConfig(propName) {
var config = observablePropertyConfigs[propName];
if (config)
{ return config; }
return observablePropertyConfigs[propName] = {
configurable: true,
enumerable: true,
get: function () {
return this.$mobx.values[propName].get();
},
set: function (v) {
setPropertyValue(this, propName, v);
}
};
}
function generateComputedPropConfig(propName) {
var config = computedPropertyConfigs[propName];
if (config)
{ return config; }
return computedPropertyConfigs[propName] = {
configurable: true,
enumerable: false,
get: function () {
return this.$mobx.values[propName].get();
},
set: function (v) {
return this.$mobx.values[propName].set(v);
}
};
}
function setPropertyValue(instance, name, newValue) {
var adm = instance.$mobx;
var observable = adm.values[name];
if (hasInterceptors(adm)) {
var change = interceptChange(adm, {
type: "update",
object: instance,
name: name, newValue: newValue
});
if (!change)
{ return; }
newValue = change.newValue;
}
newValue = observable.prepareNewValue(newValue);
if (newValue !== UNCHANGED) {
var notify = hasListeners(adm);
var notifySpy = isSpyEnabled();
var change = notify || notifySpy ? {
type: "update",
object: instance,
oldValue: observable.value,
name: name, newValue: newValue
} : null;
if (notifySpy)
{ spyReportStart(change); }
observable.setNewValue(newValue);
if (notify)
{ notifyListeners(adm, change); }
if (notifySpy)
{ spyReportEnd(); }
}
}
function notifyPropertyAddition(adm, object, name, newValue) {
var notify = hasListeners(adm);
var notifySpy = isSpyEnabled();
var change = notify || notifySpy ? {
type: "add",
object: object, name: name, newValue: newValue
} : null;
if (notifySpy)
{ spyReportStart(change); }
if (notify)
{ notifyListeners(adm, change); }
if (notifySpy)
{ spyReportEnd(); }
}
var isObservableObjectAdministration = createInstanceofPredicate("ObservableObjectAdministration", ObservableObjectAdministration);
function isObservableObject(thing) {
if (isObject(thing)) {
runLazyInitializers(thing);
return isObservableObjectAdministration(thing.$mobx);
}
return false;
}
exports.isObservableObject = isObservableObject;
var UNCHANGED = {};
var ObservableValue = (function (_super) {
__extends(ObservableValue, _super);
function ObservableValue(value, mode, name, notifySpy) {
if (name === void 0) { name = "ObservableValue@" + getNextId(); }
if (notifySpy === void 0) { notifySpy = true; }
_super.call(this, name);
this.mode = mode;
this.hasUnreportedChange = false;
this.value = undefined;
var _a = getValueModeFromValue(value, ValueMode.Recursive), childmode = _a[0], unwrappedValue = _a[1];
if (this.mode === ValueMode.Recursive)
{ this.mode = childmode; }
this.value = makeChildObservable(unwrappedValue, this.mode, this.name);
if (notifySpy && isSpyEnabled()) {
spyReport({ type: "create", object: this, newValue: this.value });
}
}
ObservableValue.prototype.set = function (newValue) {
var oldValue = this.value;
newValue = this.prepareNewValue(newValue);
if (newValue !== UNCHANGED) {
var notifySpy = isSpyEnabled();
if (notifySpy) {
spyReportStart({
type: "update",
object: this,
newValue: newValue, oldValue: oldValue
});
}
this.setNewValue(newValue);
if (notifySpy)
{ spyReportEnd(); }
}
};
ObservableValue.prototype.prepareNewValue = function (newValue) {
assertUnwrapped(newValue, "Modifiers cannot be used on non-initial values.");
checkIfStateModificationsAreAllowed();
if (hasInterceptors(this)) {
var change = interceptChange(this, { object: this, type: "update", newValue: newValue });
if (!change)
{ return UNCHANGED; }
newValue = change.newValue;
}
var changed = valueDidChange(this.mode === ValueMode.Structure, this.value, newValue);
if (changed)
{ return makeChildObservable(newValue, this.mode, this.name); }
return UNCHANGED;
};
ObservableValue.prototype.setNewValue = function (newValue) {
var oldValue = this.value;
this.value = newValue;
this.reportChanged();
if (hasListeners(this))
{ notifyListeners(this, [newValue, oldValue]); }
};
ObservableValue.prototype.get = function () {
this.reportObserved();
return this.value;
};
ObservableValue.prototype.intercept = function (handler) {
return registerInterceptor(this, handler);
};
ObservableValue.prototype.observe = function (listener, fireImmediately) {
if (fireImmediately)
{ listener(this.value, undefined); }
return registerListener(this, listener);
};
ObservableValue.prototype.toJSON = function () {
return this.get();
};
ObservableValue.prototype.toString = function () {
return this.name + "[" + this.value + "]";
};
return ObservableValue;
}(BaseAtom));
var isObservableValue = createInstanceofPredicate("ObservableValue", ObservableValue);
function getAtom(thing, property) {
if (typeof thing === "object" && thing !== null) {
if (isObservableArray(thing)) {
invariant(property === undefined, "It is not possible to get index atoms from arrays");
return thing.$mobx.atom;
}
if (isObservableMap(thing)) {
if (property === undefined)
{ return getAtom(thing._keys); }
var observable_2 = thing._data[property] || thing._hasMap[property];
invariant(!!observable_2, "the entry '" + property + "' does not exist in the observable map '" + getDebugName(thing) + "'");
return observable_2;
}
runLazyInitializers(thing);
if (isObservableObject(thing)) {
invariant(!!property, "please specify a property");
var observable_3 = thing.$mobx.values[property];
invariant(!!observable_3, "no observable property '" + property + "' found on the observable object '" + getDebugName(thing) + "'");
return observable_3;
}
if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {
return thing;
}
}
else if (typeof thing === "function") {
if (isReaction(thing.$mobx)) {
return thing.$mobx;
}
}
invariant(false, "Cannot obtain atom from " + thing);
}
function getAdministration(thing, property) {
invariant(thing, "Expecting some object");
if (property !== undefined)
{ return getAdministration(getAtom(thing, property)); }
if (isAtom(thing) || isComputedValue(thing) || isReaction(thing))
{ return thing; }
if (isObservableMap(thing))
{ return thing; }
runLazyInitializers(thing);
if (thing.$mobx)
{ return thing.$mobx; }
invariant(false, "Cannot obtain administration from " + thing);
}
function getDebugName(thing, property) {
var named;
if (property !== undefined)
{ named = getAtom(thing, property); }
else if (isObservableObject(thing) || isObservableMap(thing))
{ named = getAdministration(thing); }
else
{ named = getAtom(thing); }
return named.name;
}
function createClassPropertyDecorator(onInitialize, get, set, enumerable, allowCustomArguments) {
function classPropertyDecorator(target, key, descriptor, customArgs, argLen) {
invariant(allowCustomArguments || quacksLikeADecorator(arguments), "This function is a decorator, but it wasn't invoked like a decorator");
if (!descriptor) {
var newDescriptor = {
enumerable: enumerable,
configurable: true,
get: function () {
if (!this.__mobxInitializedProps || this.__mobxInitializedProps[key] !== true)
{ typescriptInitializeProperty(this, key, undefined, onInitialize, customArgs, descriptor); }
return get.call(this, key);
},
set: function (v) {
if (!this.__mobxInitializedProps || this.__mobxInitializedProps[key] !== true) {
typescriptInitializeProperty(this, key, v, onInitialize, customArgs, descriptor);
}
else {
set.call(this, key, v);
}
}
};
if (arguments.length < 3 || arguments.length === 5 && argLen < 3) {
Object.defineProperty(target, key, newDescriptor);
}
return newDescriptor;
}
else {
if (!hasOwnProperty(target, "__mobxLazyInitializers")) {
addHiddenProp(target, "__mobxLazyInitializers", (target.__mobxLazyInitializers && target.__mobxLazyInitializers.slice()) || []);
}
var value_1 = descriptor.value, initializer_1 = descriptor.initializer;
target.__mobxLazyInitializers.push(function (instance) {
onInitialize(instance, key, (initializer_1 ? initializer_1.call(instance) : value_1), customArgs, descriptor);
});
return {
enumerable: enumerable, configurable: true,
get: function () {
if (this.__mobxDidRunLazyInitializers !== true)
{ runLazyInitializers(this); }
return get.call(this, key);
},
set: function (v) {
if (this.__mobxDidRunLazyInitializers !== true)
{ runLazyInitializers(this); }
set.call(this, key, v);
}
};
}
}
if (allowCustomArguments) {
return function () {
if (quacksLikeADecorator(arguments))
{ return classPropertyDecorator.apply(null, arguments); }
var outerArgs = arguments;
var argLen = arguments.length;
return function (target, key, descriptor) { return classPropertyDecorator(target, key, descriptor, outerArgs, argLen); };
};
}
return classPropertyDecorator;
}
function typescriptInitializeProperty(instance, key, v, onInitialize, customArgs, baseDescriptor) {
if (!hasOwnProperty(instance, "__mobxInitializedProps"))
{ addHiddenProp(instance, "__mobxInitializedProps", {}); }
instance.__mobxInitializedProps[key] = true;
onInitialize(instance, key, v, customArgs, baseDescriptor);
}
function runLazyInitializers(instance) {
if (instance.__mobxDidRunLazyInitializers === true)
{ return; }
if (instance.__mobxLazyInitializers) {
addHiddenProp(instance, "__mobxDidRunLazyInitializers", true);
instance.__mobxDidRunLazyInitializers && instance.__mobxLazyInitializers.forEach(function (initializer) { return initializer(instance); });
}
}
function quacksLikeADecorator(args) {
return (args.length === 2 || args.length === 3) && typeof args[1] === "string";
}
function iteratorSymbol() {
return (typeof Symbol === "function" && Symbol.iterator) || "@@iterator";
}
var IS_ITERATING_MARKER = "__$$iterating";
function arrayAsIterator(array) {
invariant(array[IS_ITERATING_MARKER] !== true, "Illegal state: cannot recycle array as iterator");
addHiddenFinalProp(array, IS_ITERATING_MARKER, true);
var idx = -1;
addHiddenFinalProp(array, "next", function next() {
idx++;
return {
done: idx >= this.length,
value: idx < this.length ? this[idx] : undefined
};
});
return array;
}
function declareIterator(prototType, iteratorFactory) {
addHiddenFinalProp(prototType, iteratorSymbol(), iteratorFactory);
}
var SimpleEventEmitter = (function () {
function SimpleEventEmitter() {
this.listeners = [];
deprecated("extras.SimpleEventEmitter is deprecated and will be removed in the next major release");
}
SimpleEventEmitter.prototype.emit = function () {
var arguments$1 = arguments;
var listeners = this.listeners.slice();
for (var i = 0, l = listeners.length; i < l; i++)
{ listeners[i].apply(null, arguments$1); }
};
SimpleEventEmitter.prototype.on = function (listener) {
var _this = this;
this.listeners.push(listener);
return once(function () {
var idx = _this.listeners.indexOf(listener);
if (idx !== -1)
{ _this.listeners.splice(idx, 1); }
});
};
SimpleEventEmitter.prototype.once = function (listener) {
var subscription = this.on(function () {
subscription();
listener.apply(this, arguments);
});
return subscription;
};
return SimpleEventEmitter;
}());
exports.SimpleEventEmitter = SimpleEventEmitter;
var EMPTY_ARRAY = [];
Object.freeze(EMPTY_ARRAY);
function getNextId() {
return ++globalState.mobxGuid;
}
function invariant(check, message, thing) {
if (!check)
{ throw new Error("[mobx] Invariant failed: " + message + (thing ? " in '" + thing + "'" : "")); }
}
var deprecatedMessages = [];
function deprecated(msg) {
if (deprecatedMessages.indexOf(msg) !== -1)
{ return; }
deprecatedMessages.push(msg);
console.error("[mobx] Deprecated: " + msg);
}
function once(func) {
var invoked = false;
return function () {
if (invoked)
{ return; }
invoked = true;
return func.apply(this, arguments);
};
}
var noop = function () { };
function unique(list) {
var res = [];
list.forEach(function (item) {
if (res.indexOf(item) === -1)
{ res.push(item); }
});
return res;
}
function joinStrings(things, limit, separator) {
if (limit === void 0) { limit = 100; }
if (separator === void 0) { separator = " - "; }
if (!things)
{ return ""; }
var sliced = things.slice(0, limit);
return "" + sliced.join(separator) + (things.length > limit ? " (... and " + (things.length - limit) + "more)" : "");
}
function isObject(value) {
return value !== null && typeof value === "object";
}
function isPlainObject(value) {
if (value === null || typeof value !== "object")
{ return false; }
var proto = Object.getPrototypeOf(value);
return proto === Object.prototype || proto === null;
}
function objectAssign() {
var arguments$1 = arguments;
var res = arguments[0];
for (var i = 1, l = arguments.length; i < l; i++) {
var source = arguments$1[i];
for (var key in source)
{ if (hasOwnProperty(source, key)) {
res[key] = source[key];
} }
}
return res;
}
function valueDidChange(compareStructural, oldValue, newValue) {
return compareStructural
? !deepEquals(oldValue, newValue)
: oldValue !== newValue;
}
var prototypeHasOwnProperty = Object.prototype.hasOwnProperty;
function hasOwnProperty(object, propName) {
return prototypeHasOwnProperty.call(object, propName);
}
function makeNonEnumerable(object, propNames) {
for (var i = 0; i < propNames.length; i++) {
addHiddenProp(object, propNames[i], object[propNames[i]]);
}
}
function addHiddenProp(object, propName, value) {
Object.defineProperty(object, propName, {
enumerable: false,
writable: true,
configurable: true,
value: value
});
}
function addHiddenFinalProp(object, propName, value) {
Object.defineProperty(object, propName, {
enumerable: false,
writable: false,
configurable: true,
value: value
});
}
function isPropertyConfigurable(object, prop) {
var descriptor = Object.getOwnPropertyDescriptor(object, prop);
return !descriptor || (descriptor.configurable !== false && descriptor.writable !== false);
}
function assertPropertyConfigurable(object, prop) {
invariant(isPropertyConfigurable(object, prop), "Cannot make property '" + prop + "' observable, it is not configurable and writable in the target object");
}
function getEnumerableKeys(obj) {
var res = [];
for (var key in obj)
{ res.push(key); }
return res;
}
function deepEquals(a, b) {
if (a === null && b === null)
{ return true; }
if (a === undefined && b === undefined)
{ return true; }
var aIsArray = isArrayLike(a);
if (aIsArray !== isArrayLike(b)) {
return false;
}
else if (aIsArray) {
if (a.length !== b.length)
{ return false; }
for (var i = a.length - 1; i >= 0; i--)
{ if (!deepEquals(a[i], b[i]))
{ return false; } }
return true;
}
else if (typeof a === "object" && typeof b === "object") {
if (a === null || b === null)
{ return false; }
if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)
{ return false; }
for (var prop in a) {
if (!(prop in b))
{ return false; }
if (!deepEquals(a[prop], b[prop]))
{ return false; }
}
return true;
}
return a === b;
}
function createInstanceofPredicate(name, clazz) {
var propName = "isMobX" + name;
clazz.prototype[propName] = true;
return function (x) {
return isObject(x) && x[propName] === true;
};
}
function isArrayLike(x) {
return Array.isArray(x) || isObservableArray(x);
}
exports.isArrayLike = isArrayLike;
});
var Reaction = mobx.Reaction;
var isObservable = mobx.isObservable;
var extras = mobx.extras;
var EventEmitter = function EventEmitter() {
this.listeners = [];
};
EventEmitter.prototype.on = function on (cb) {
var this$1 = this;
this.listeners.push(cb);
return function () {
var index = this$1.listeners.indexOf(cb);
if (index !== -1) {
this$1.listeners.splice(index, 1);
}
};
};
EventEmitter.prototype.emit = function emit (data) {
this.listeners.forEach(function (fn) { return fn(data); });
};
EventEmitter.prototype.getTotalListeners = function getTotalListeners () {
return this.listeners.length;
};
EventEmitter.prototype.clearListeners = function clearListeners () {
this.listeners = [];
};
var findDOMNode = Inferno.findDOMNode;
/**
* Dev tools support
*/
var isDevtoolsEnabled = false;
var componentByNodeRegistery = new WeakMap();
var renderReporter = new EventEmitter();
function reportRendering(component) {
var node = findDOMNode(component);
if (node && componentByNodeRegistery) {
componentByNodeRegistery.set(node, component);
}
renderReporter.emit({
event: 'render',
renderTime: component.__$mobRenderEnd - component.__$mobRenderStart,
totalTime: Date.now() - component.__$mobRenderStart,
component: component,
node: node
});
}
function trackComponents() {
if (typeof WeakMap === 'undefined') {
throwError('[inferno-mobx] tracking components is not supported in this browser.');
}
if (!isDevtoolsEnabled) {
isDevtoolsEnabled = true;
}
}
function makeReactive(componentClass) {
var target = componentClass.prototype || componentClass;
var baseDidMount = target.componentDidMount;
var baseWillMount = target.componentWillMount;
var baseUnmount = target.componentWillUnmount;
target.componentWillMount = function () {
var this$1 = this;
// Call original
baseWillMount && baseWillMount.call(this);
var reaction$$1;
var isRenderingPending = false;
var initialName = this.displayName || this.name || (this.constructor && (this.constructor.displayName || this.constructor.name)) || '<component>';
var baseRender = this.render.bind(this);
var initialRender = function (nextProps, nextContext) {
reaction$$1 = new Reaction((initialName + ".render()"), function () {
if (!isRenderingPending) {
isRenderingPending = true;
if (this$1.__$mobxIsUnmounted !== true) {
var hasError = true;
try {
Component.prototype.forceUpdate.call(this$1);
hasError = false;
}
finally {
if (hasError) {
reaction$$1.dispose();
}
}
}
}
});
reactiveRender.$mobx = reaction$$1;
this$1.render = reactiveRender;
return reactiveRender(nextProps, nextContext);
};
var reactiveRender = function (nextProps, nextContext) {
isRenderingPending = false;
var rendering = undefined;
reaction$$1.track(function () {
if (isDevtoolsEnabled) {
this$1.__$mobRenderStart = Date.now();
}
rendering = extras.allowStateChanges(false, baseRender.bind(this$1, nextProps, nextContext));
if (isDevtoolsEnabled) {
this$1.__$mobRenderEnd = Date.now();
}
});
return rendering;
};
this.render = initialRender;
};
target.componentDidMount = function () {
isDevtoolsEnabled && reportRendering(this);
// Call original
baseDidMount && baseDidMount.call(this);
};
target.componentWillUnmount = function () {
// Call original
baseUnmount && baseUnmount.call(this);
// Dispose observables
this.render.$mobx && this.render.$mobx.dispose();
this.__$mobxIsUnmounted = true;
if (isDevtoolsEnabled) {
var node = findDOMNode(this);
if (node && componentByNodeRegistery) {
componentByNodeRegistery.delete(node);
}
renderReporter.emit({
event: 'destroy',
component: this,
node: node
});
}
};
target.shouldComponentUpdate = function (nextProps, nextState) {
var this$1 = this;
// Update on any state changes (as is the default)
if (this.state !== nextState) {
return true;
}
// Update if props are shallowly not equal, inspired by PureRenderMixin
var keys = Object.keys(this.props);
if (keys.length !== Object.keys(nextProps).length) {
return true;
}
for (var i = keys.length - 1; i >= 0; i--) {
var key = keys[i];
var newValue = nextProps[key];
if (newValue !== this$1.props[key]) {
return true;
}
else if (newValue && typeof newValue === 'object' && !isObservable(newValue)) {
// If the newValue is still the same object, but that object is not observable,
// fallback to the default behavior: update, because the object *might* have changed.
return true;
}
}
return true;
};
return componentClass;
}
var index$1 = createCommonjsModule(function (module) {
'use strict';
var INFERNO_STATICS = {
childContextTypes: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
arguments: true,
arity: true
};
var isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function';
function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
var keys = Object.getOwnPropertyNames(sourceComponent);
/* istanbul ignore else */
if (isGetOwnPropertySymbolsAvailable) {
keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent));
}
for (var i = 0; i < keys.length; ++i) {
if (!INFERNO_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {
try {
targetComponent[keys[i]] = sourceComponent[keys[i]];
} catch (error) {
}
}
}
}
return targetComponent;
}
module.exports = hoistNonReactStatics;
module.exports.default = module.exports;
});
/**
* Store Injection
*/
function createStoreInjector(grabStoresFn, component) {
var Injector = createClass({
displayName: component.name,
render: function render() {
var this$1 = this;
var newProps = {};
for (var key in this.props) {
if (this$1.props.hasOwnProperty(key)) {
newProps[key] = this$1.props[key];
}
}
var additionalProps = grabStoresFn(this.context.mobxStores || {}, newProps, this.context) || {};
for (var key$1 in additionalProps) {
newProps[key$1] = additionalProps[key$1];
}
newProps.ref = function (instance) {
this$1.wrappedInstance = instance;
};
return createElement(component, newProps);
}
});
Injector.contextTypes = { mobxStores: function mobxStores() { } };
index$1(Injector, component);
return Injector;
}
var grabStoresByName = function (storeNames) { return function (baseStores, nextProps) {
storeNames.forEach(function (storeName) {
// Prefer props over stores
if (storeName in nextProps) {
return;
}
if (!(storeName in baseStores)) {
throw new Error("MobX observer: Store \"" + storeName + "\" is not available! " +
"Make sure it is provided by some Provider");
}
nextProps[storeName] = baseStores[storeName];
});
return nextProps;
}; };
/**
* Higher order component that injects stores to a child.
* takes either a varargs list of strings, which are stores read from the context,
* or a function that manually maps the available stores from the context to props:
* storesToProps(mobxStores, props, context) => newProps
*/
function inject(grabStoresFn) {
var arguments$1 = arguments;
if (typeof grabStoresFn !== 'function') {
var storesNames = [];
for (var i = 0; i < arguments.length; i++) {
storesNames[i] = arguments$1[i];
}
grabStoresFn = grabStoresByName(storesNames);
}
return function (componentClass) { return createStoreInjector(grabStoresFn, componentClass); };
}
/**
* Wraps a component and provides stores as props
*/
function connect(arg1, arg2) {
if ( arg2 === void 0 ) arg2 = null;
if (typeof arg1 === 'string') {
throwError('Store names should be provided as array');
}
if (Array.isArray(arg1)) {
// component needs stores
if (!arg2) {
// invoked as decorator
return function (componentClass) { return connect(arg1, componentClass); };
}
else {
// TODO: deprecate this invocation style
return inject.apply(null, arg1)(connect(arg2));
}
}
var componentClass = arg1;
// Stateless function component:
// If it is function but doesn't seem to be a Inferno class constructor,
// wrap it to a Inferno class automatically
if (typeof componentClass === 'function'
&& (!componentClass.prototype || !componentClass.prototype.render)
&& !componentClass.isReactClass
&& !Component.isPrototypeOf(componentClass)) {
var newClass = createClass({
displayName: componentClass.displayName || componentClass.name,
propTypes: componentClass.propTypes,
contextTypes: componentClass.contextTypes,
getDefaultProps: function () { return componentClass.defaultProps; },
render: function render() {
return componentClass.call(this, this.props, this.context);
}
});
return connect(newClass);
}
if (!componentClass) {
throwError('Please pass a valid component to "observer"');
}
componentClass.isMobXReactObserver = true;
return makeReactive(componentClass);
}
var index = {
Provider: Provider,
inject: inject,
connect: connect,
observer: connect,
trackComponents: trackComponents,
renderReporter: renderReporter,
componentByNodeRegistery: componentByNodeRegistery
};
return index;
})));
|
ajax/libs/react-data-grid/0.12.22/react-data-grid.min.js | honestree/cdnjs | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactDataGrid=t(require("react")):e.ReactDataGrid=t(e.React)}(this,function(e){return function(e){function t(o){if(r[o])return r[o].exports;var s=r[o]={exports:{},id:o,loaded:!1};return e[o].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";var o=r(43),s=r(11),i=r(22);e.exports=o,e.exports.Row=s,e.exports.Cell=i},function(t,r){t.exports=e},function(e,t,r){"use strict";var o=(r(17)["default"],r(1)),s={name:o.PropTypes.string.isRequired,key:o.PropTypes.string.isRequired,width:o.PropTypes.number.isRequired};e.exports=s},function(e,t,r){"use strict";var o=r(14)["default"];t["default"]=o||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},t.__esModule=!0},function(e,t,r){function o(){for(var e,t="",r=0;r<arguments.length;r++)if(e=arguments[r])if("string"==typeof e||"number"==typeof e)t+=" "+e;else if("[object Array]"===Object.prototype.toString.call(e))t+=" "+o.apply(null,e);else if("object"==typeof e)for(var s in e)e.hasOwnProperty(s)&&e[s]&&(t+=" "+s);return t.substr(1)}var s,i;"undefined"!=typeof e&&e.exports&&(e.exports=o),s=[],i=function(){return o}.apply(t,s),!(void 0!==i&&(e.exports=i))},function(e,t,r){(function(t){"use strict";function o(e,r){"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?l(!e.ref,"You are calling cloneWithProps() on a child with a ref. This is dangerous because you're creating a new child which will not be added as a ref to its parent."):null);var o=i.mergeProps(r,e.props);return!o.hasOwnProperty(a)&&e.props.hasOwnProperty(a)&&(o.children=e.props.children),s.createElement(e.type,o)}var s=r(60),i=r(61),n=r(64),l=r(15),a=n({children:null});e.exports=o}).call(t,r(8))},function(e,t){"use strict";e.exports={getColumn:function(e,t){return Array.isArray(e)?e[t]:"undefined"!=typeof Immutable?e.get(t):void 0},spliceColumn:function(e,t,r){return Array.isArray(e.columns)?e.columns.splice(t,1,r):"undefined"!=typeof Immutable&&(e.columns=e.columns.splice(t,1,r)),e},getSize:function(e){return Array.isArray(e)?e.length:"undefined"!=typeof Immutable?e.size:void 0}}},function(e,t){function r(e){return function(){return e}}function o(){}o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t){function r(){c=!1,n.length?a=n.concat(a):p=-1,a.length&&o()}function o(){if(!c){var e=setTimeout(r);c=!0;for(var t=a.length;t;){for(n=a,a=[];++p<t;)n&&n[p].run();p=-1,t=a.length}n=null,c=!1,clearTimeout(e)}}function s(e,t){this.fun=e,this.array=t}function i(){}var n,l=e.exports={},a=[],c=!1,p=-1;l.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];a.push(new s(e,t)),1!==a.length||c||setTimeout(o,0)},s.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=i,l.addListener=i,l.once=i,l.off=i,l.removeListener=i,l.removeAllListeners=i,l.emit=i,l.binding=function(e){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(e){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},function(e,t,r){"use strict";var o=r(1),s=r(7),i=r(13),n={metricsComputator:o.PropTypes.object},l={childContextTypes:n,getChildContext:function(){return{metricsComputator:this}},getMetricImpl:function(e){return this._DOMMetrics.metrics[e].value},registerMetricsImpl:function(e,t){var r={},o=this._DOMMetrics;for(var s in t){if(void 0!==o.metrics[s])throw new Error("DOM metric "+s+" is already defined");o.metrics[s]={component:e,computator:t[s].bind(e)},r[s]=this.getMetricImpl.bind(null,s)}return-1===o.components.indexOf(e)&&o.components.push(e),r},unregisterMetricsFor:function(e){var t=this._DOMMetrics,r=t.components.indexOf(e);if(r>-1){t.components.splice(r,1);var o,s={};for(o in t.metrics)t.metrics[o].component===e&&(s[o]=!0);for(o in s)delete t.metrics[o]}},updateMetrics:function(){var e=this._DOMMetrics,t=!1;for(var r in e.metrics){var o=e.metrics[r].computator();o!==e.metrics[r].value&&(t=!0),e.metrics[r].value=o}if(t)for(var s=0,i=e.components.length;i>s;s++)e.components[s].metricsUpdated&&e.components[s].metricsUpdated()},componentWillMount:function(){this._DOMMetrics={metrics:{},components:[]}},componentDidMount:function(){window.addEventListener?window.addEventListener("resize",this.updateMetrics):window.attachEvent("resize",this.updateMetrics),this.updateMetrics()},componentWillUnmount:function(){window.removeEventListener("resize",this.updateMetrics)}},a={contextTypes:n,componentWillMount:function(){if(this.DOMMetrics){this._DOMMetricsDefs=i(this.DOMMetrics),this.DOMMetrics={};for(var e in this._DOMMetricsDefs)this.DOMMetrics[e]=s}},componentDidMount:function(){this.DOMMetrics&&(this.DOMMetrics=this.registerMetrics(this._DOMMetricsDefs))},componentWillUnmount:function(){return this.registerMetricsImpl?void(this.hasOwnProperty("DOMMetrics")&&delete this.DOMMetrics):this.context.metricsComputator.unregisterMetricsFor(this)},registerMetrics:function(e){return this.registerMetricsImpl?this.registerMetricsImpl(this,e):this.context.metricsComputator.registerMetricsImpl(this,e)},getMetric:function(e){return this.getMetricImpl?this.getMetricImpl(e):this.context.metricsComputator.getMetricImpl(e)}};e.exports={MetricsComputatorMixin:l,MetricsMixin:a}},function(e,t,r){"use strict";var o=(r(1),{onKeyDown:function(e){if(this.isCtrlKeyHeldDown(e))this.checkAndCall("onPressKeyWithCtrl",e);else if(this.isKeyExplicitlyHandled(e.key)){var t="onPress"+e.key;this.checkAndCall(t,e)}else this.isKeyPrintable(e.keyCode)&&this.checkAndCall("onPressChar",e)},isKeyPrintable:function(e){var t=e>47&&58>e||32==e||13==e||e>64&&91>e||e>95&&112>e||e>185&&193>e||e>218&&223>e;return t},isKeyExplicitlyHandled:function(e){return"function"==typeof this["onPress"+e]},isCtrlKeyHeldDown:function(e){return e.ctrlKey===!0&&"Control"!==e.key},checkAndCall:function(e,t){"function"==typeof this[e]&&this[e](t)}});e.exports=o},function(e,t,r){"use strict";var o=r(3)["default"],s=r(1),i=r(4),n=r(22),l=(r(5),r(12)),a=r(6),c=s.createClass({displayName:"Row",propTypes:{height:s.PropTypes.number.isRequired,columns:s.PropTypes.oneOfType([s.PropTypes.object,s.PropTypes.array]).isRequired,row:s.PropTypes.object.isRequired,cellRenderer:s.PropTypes.func,isSelected:s.PropTypes.bool,idx:s.PropTypes.number.isRequired,expandedRows:s.PropTypes.arrayOf(s.PropTypes.object)},mixins:[a],render:function(){var e=i("react-grid-Row","react-grid-Row--${this.props.idx % 2 === 0 ? 'even' : 'odd'}"),t={height:this.getRowHeight(this.props),overflow:"hidden"},r=this.getCells();return s.createElement("div",o({},this.props,{className:e,style:t,onDragEnter:this.handleDragEnter}),s.isValidElement(this.props.row)?this.props.row:r)},getCells:function(){var e=this,t=[],r=[],o=this.getSelectedColumn();return this.props.columns.forEach(function(i,n){var l=e.props.cellRenderer,a=s.createElement(l,{ref:n,key:n,idx:n,rowIdx:e.props.idx,value:e.getCellValue(i.key||n),column:i,height:e.getRowHeight(),formatter:i.formatter,cellMetaData:e.props.cellMetaData,rowData:e.props.row,selectedColumn:o,isRowSelected:e.props.isSelected});i.locked?r.push(a):t.push(a)}),t.concat(r)},getRowHeight:function(){var e=this.props.expandedRows||null;if(e&&this.props.key){var t=e[this.props.key]||null;if(t)return t.height}return this.props.height},getCellValue:function(e){var t;return"select-row"===e?this.props.isSelected:t="function"==typeof this.props.row.get?this.props.row.get(e):this.props.row[e]},getRowData:function(){return this.props.row.toJSON?this.props.row.toJSON():this.props.row},getDefaultProps:function(){return{cellRenderer:n,isSelected:!1,height:35}},setScrollLeft:function(e){var t=this;this.props.columns.forEach(function(r,o){if(r.locked){if(!t.refs[o])return;t.refs[o].setScrollLeft(e)}})},doesRowContainSelectedCell:function(e){var t=e.cellMetaData.selected;return t&&t.rowIdx===e.idx?!0:!1},willRowBeDraggedOver:function(e){var t=e.cellMetaData.dragged;return null!=t&&(t.rowIdx>=0||t.complete===!0)},hasRowBeenCopied:function(){var e=this.props.cellMetaData.copied;return null!=e&&e.rowIdx===this.props.idx},shouldComponentUpdate:function(e,t){return!l.sameColumns(this.props.columns,e.columns,l.sameColumn)||this.doesRowContainSelectedCell(this.props)||this.doesRowContainSelectedCell(e)||this.willRowBeDraggedOver(e)||e.row!==this.props.row||this.hasRowBeenCopied()||this.props.isSelected!==e.isSelected||e.height!==this.props.height},handleDragEnter:function(){var e=this.props.cellMetaData.handleDragEnterRow;e&&e(this.props.idx)},getSelectedColumn:function(){var e=this.props.cellMetaData.selected;return e&&e.idx?this.getColumn(this.props.columns,e.idx):void 0}});e.exports=c},function(e,t,r){"use strict";function o(e){var t=i(e.columns,e.totalWidth),r=t.filter(function(e){return e.width}).reduce(function(e,t){return e-t.width},e.totalWidth),o=t.filter(function(e){return e.width}).reduce(function(e,t){return e+t.width},0);return t=n(t,r,e.minColumnWidth),t=s(t),{columns:t,width:o,totalWidth:e.totalWidth,minColumnWidth:e.minColumnWidth}}function s(e){var t=0;return e.map(function(e){return e.left=t,t+=e.width,e})}function i(e,t){return e.map(function(e){var r=u({},e);return e.width&&/^([0-9]+)%$/.exec(e.width.toString())&&(r.width=Math.floor(e.width/100*t)),r})}function n(e,t,r){var o=e.filter(function(e){return!e.width});return e.map(function(e,s,i){return e.width||(0>=t?e.width=r:e.width=Math.floor(t/f.getSize(o))),e})}function l(e,t,r){var s=f.getColumn(e.columns,t);e=h(e),e.columns=e.columns.slice(0);var i=h(s);return i.width=Math.max(r,e.minColumnWidth),e=f.spliceColumn(e,t,i),o(e)}function a(e,t){return"undefined"!=typeof Immutable&&e instanceof Immutable.List&&t instanceof Immutable.List}function c(e,t,r){var o,s,i,n={},l={};if(f.getSize(e)!==f.getSize(t))return!1;for(o=0,s=f.getSize(e);s>o;o++)i=e[o],n[i.key]=i;for(o=0,s=f.getSize(t);s>o;o++){i=t[o],l[i.key]=i;var a=n[i.key];if(void 0===a||!r(a,i))return!1}for(o=0,s=f.getSize(e);s>o;o++){i=e[o];var c=l[i.key];if(void 0===c)return!1}return!0}function p(e,t,r){return a(e,t)?e===t:c(e,t,r)}var u=r(14)["default"],h=r(13),d=(r(1).isValidElement,r(26)),f=r(6);e.exports={recalculate:o,resizeColumn:l,sameColumn:d,sameColumns:p}},function(e,t){"use strict";function r(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}e.exports=r},function(e,t,r){e.exports={"default":r(46),__esModule:!0}},function(e,t,r){(function(t){"use strict";var o=r(7),s=o;"production"!==t.env.NODE_ENV&&(s=function(e,t){for(var r=[],o=2,s=arguments.length;s>o;o++)r.push(arguments[o]);if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(!e){var i=0;console.warn("Warning: "+t.replace(/%s/g,function(){return r[i++]}))}}),e.exports=s}).call(t,r(8))},function(e,t){"use strict";var r=function(e){var t={};return e&&"[object Function]"===t.toString.call(e)};e.exports=r},function(e,t){"use strict";t["default"]=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t.__esModule=!0},function(e,t){var r=e.exports={};"number"==typeof __e&&(__e=r)},function(e,t){"use strict";function r(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var o,s,i=r(e),n=1;n<arguments.length;n++){o=arguments[n],s=Object.keys(Object(o));for(var l=0;l<s.length;l++)i[s[l]]=o[s[l]]}return i}},function(e,t){function r(e,t){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var r=Object(e),o=Object.prototype.hasOwnProperty,s=1;s<arguments.length;s++){var i=arguments[s];if(null!=i){var n=Object(i);for(var l in n)o.call(n,l)&&(r[l]=n[l])}}return r}e.exports=r},function(e,t){"use strict";function r(e,t){if(e===t)return!0;var r;for(r in e)if(e.hasOwnProperty(r)&&(!t.hasOwnProperty(r)||e[r]!==t[r]))return!1;for(r in t)if(t.hasOwnProperty(r)&&!e.hasOwnProperty(r))return!1;return!0}e.exports=r},function(e,t,r){"use strict";var o=r(3)["default"],s=r(1),i=r(4),n=r(5),l=r(42),a=r(2),c=r(16),p=r(34),u=s.createClass({displayName:"Cell",propTypes:{rowIdx:s.PropTypes.number.isRequired,idx:s.PropTypes.number.isRequired,selected:s.PropTypes.shape({idx:s.PropTypes.number.isRequired}),tabIndex:s.PropTypes.number,ref:s.PropTypes.string,column:s.PropTypes.shape(a).isRequired,value:s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.number,s.PropTypes.object,s.PropTypes.bool]).isRequired,isExpanded:s.PropTypes.bool,cellMetaData:s.PropTypes.shape(p).isRequired,handleDragStart:s.PropTypes.func,className:s.PropTypes.string,rowData:s.PropTypes.object.isRequired},getDefaultProps:function(){return{tabIndex:-1,ref:"cell",isExpanded:!1}},getInitialState:function(){return{isRowChanging:!1,isCellValueChanging:!1}},componentDidMount:function(){this.checkFocus()},componentDidUpdate:function(e,t){this.checkFocus();var r=this.props.cellMetaData.dragged;r&&r.complete===!0&&this.props.cellMetaData.handleTerminateDrag(),this.state.isRowChanging&&null!=this.props.selectedColumn&&this.applyUpdateClass()},componentWillReceiveProps:function(e){this.setState({isRowChanging:this.props.rowData!==e.rowData,isCellValueChanging:this.props.value!==e.value})},shouldComponentUpdate:function(e,t){return this.props.column.width!==e.column.width||this.props.column.left!==e.column.left||this.props.rowData!==e.rowData||this.props.height!==e.height||this.props.rowIdx!==e.rowIdx||this.isCellSelectionChanging(e)||this.isDraggedCellChanging(e)||this.isCopyCellChanging(e)||this.props.isRowSelected!==e.isRowSelected||this.isSelected()},getStyle:function(){var e={position:"absolute",width:this.props.column.width,height:this.props.height,left:this.props.column.left};return e},render:function(){var e=this.getStyle(),t=this.getCellClass(),r=this.renderCellContent({value:this.props.value,column:this.props.column,rowIdx:this.props.rowIdx,isExpanded:this.props.isExpanded});return s.createElement("div",o({},this.props,{className:t,style:e,onClick:this.onCellClick,onDoubleClick:this.onCellDoubleClick}),r,s.createElement("div",{className:"drag-handle",draggable:"true"}))},renderCellContent:function(e){var t,r=this.getFormatter();return s.isValidElement(r)?(e.dependentValues=this.getFormatterDependencies(),t=n(r,e)):t=c(r)?s.createElement(r,{value:this.props.value,dependentValues:this.getFormatterDependencies()}):s.createElement(h,{value:this.props.value}),s.createElement("div",{ref:"cell",className:"react-grid-Cell__value"},t," ",this.props.cellControls)},isColumnSelected:function(){var e=this.props.cellMetaData;return null==e||null==e.selected?!1:e.selected&&e.selected.idx===this.props.idx},isSelected:function(){var e=this.props.cellMetaData;return null==e||null==e.selected?!1:e.selected&&e.selected.rowIdx===this.props.rowIdx&&e.selected.idx===this.props.idx},isActive:function(){var e=this.props.cellMetaData;return null==e||null==e.selected?!1:this.isSelected()&&e.selected.active===!0},isCellSelectionChanging:function(e){var t=this.props.cellMetaData;if(null==t||null==t.selected)return!1;var r=e.cellMetaData.selected;return t.selected&&r?this.props.idx===r.idx||this.props.idx===t.selected.idx:!0},getFormatter:function(){var e=this.props.column;return this.isActive()?s.createElement(l,{rowData:this.getRowData(),rowIdx:this.props.rowIdx,idx:this.props.idx,cellMetaData:this.props.cellMetaData,column:e,height:this.props.height}):this.props.column.formatter},getRowData:function(){return this.props.rowData.toJSON?this.props.rowData.toJSON():this.props.rowData},getFormatterDependencies:function(){this.props.column.ItemId;return"function"==typeof this.props.column.getRowMetaData?this.props.column.getRowMetaData(this.getRowData(),this.props.column):void 0},onCellClick:function(e){var t=this.props.cellMetaData;null!=t&&null!=t.onCellClick&&t.onCellClick({rowIdx:this.props.rowIdx,idx:this.props.idx})},onCellDoubleClick:function(e){var t=this.props.cellMetaData;null!=t&&null!=t.onCellDoubleClick&&t.onCellDoubleClick({rowIdx:this.props.rowIdx,idx:this.props.idx})},checkFocus:function(){this.isSelected()&&!this.isActive()&&this.getDOMNode().focus()},getCellClass:function(){var e=i(this.props.column.cellClass,"react-grid-Cell",this.props.className,this.props.column.locked?"react-grid-Cell--locked":null),t=i({selected:this.isSelected()&&!this.isActive(),editing:this.isActive(),copied:this.isCopied(),"active-drag-cell":this.isSelected()||this.isDraggedOver(),"is-dragged-over-up":this.isDraggedOverUpwards(),"is-dragged-over-down":this.isDraggedOverDownwards(),"was-dragged-over":this.wasDraggedOver()});return i(e,t)},getUpdateCellClass:function(){return this.props.column.getUpdateCellClass?this.props.column.getUpdateCellClass(this.props.selectedColumn,this.props.column,this.state.isCellValueChanging):""},applyUpdateClass:function(){var e=this.getUpdateCellClass();if(null!=e&&""!=e){var t=this.getDOMNode();t.classList?(t.classList.remove(e),t.classList.add(e)):-1===t.className.indexOf(e)&&(t.className=t.className+" "+e)}},setScrollLeft:function(e){var t=this;if(t.isMounted()){var r=this.getDOMNode(),o="translate3d("+e+"px, 0px, 0px)";r.style.webkitTransform=o,r.style.transform=o}},isCopied:function(){var e=this.props.cellMetaData.copied;return e&&e.rowIdx===this.props.rowIdx&&e.idx===this.props.idx},isDraggedOver:function(){var e=this.props.cellMetaData.dragged;return e&&e.overRowIdx===this.props.rowIdx&&e.idx===this.props.idx},wasDraggedOver:function(){var e=this.props.cellMetaData.dragged;return e&&(e.overRowIdx<this.props.rowIdx&&this.props.rowIdx<e.rowIdx||e.overRowIdx>this.props.rowIdx&&this.props.rowIdx>e.rowIdx)&&e.idx===this.props.idx},isDraggedCellChanging:function(e){var t,r=this.props.cellMetaData.dragged,o=e.cellMetaData.dragged;return r?t=o&&this.props.idx===o.idx||r&&this.props.idx===r.idx:!1},isCopyCellChanging:function(e){var t,r=this.props.cellMetaData.copied,o=e.cellMetaData.copied;return r?t=o&&this.props.idx===o.idx||r&&this.props.idx===r.idx:!1},isDraggedOverUpwards:function(){var e=this.props.cellMetaData.dragged;return!this.isSelected()&&this.isDraggedOver()&&this.props.rowIdx<e.rowIdx},isDraggedOverDownwards:function(){var e=this.props.cellMetaData.dragged;return!this.isSelected()&&this.isDraggedOver()&&this.props.rowIdx>e.rowIdx}}),h=s.createClass({displayName:"SimpleCellFormatter",propTypes:{value:s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.number,s.PropTypes.object,s.PropTypes.bool]).isRequired},render:function(){return s.createElement("span",null,this.props.value)},shouldComponentUpdate:function(e,t){return e.value!==this.props.value}});e.exports=u},function(e,t,r){"use strict";var o=r(1),s=o.createClass({displayName:"CheckboxEditor",PropTypes:{value:o.PropTypes.bool.isRequired,rowIdx:o.PropTypes.number.isRequired,column:o.PropTypes.shape({key:o.PropTypes.string.isRequired,onCellChange:o.PropTypes.func.isRequired}).isRequired},render:function(){var e=null!=this.props.value?this.props.value:!1;return o.createElement("input",{className:"react-grid-CheckBox",type:"checkbox",checked:e,onClick:this.handleChange})},handleChange:function(e){this.props.column.onCellChange(this.props.rowIdx,this.props.column.key,e)}});e.exports=s},function(e,t,r){"use strict";var o=r(1),s=(r(10),r(2)),i=o.createClass({displayName:"SimpleTextEditor",propTypes:{value:o.PropTypes.any.isRequired,onBlur:o.PropTypes.func,column:o.PropTypes.shape(s).isRequired},getValue:function(){var e={};return e[this.props.column.key]=this.refs.input.getDOMNode().value,e},getInputNode:function(){return this.getDOMNode()},render:function(){return o.createElement("input",{ref:"input",type:"text",onBlur:this.props.onBlur,className:"form-control",defaultValue:this.props.value})}});e.exports=i},function(e,t,r){"use strict";var o=r(1),s=r(4),i=o.PropTypes,n=r(5),l=r(21),a=r(7),c=r(37),p=r(11),u=(r(2),o.createClass({displayName:"Canvas",mixins:[c],propTypes:{rowRenderer:i.oneOfType([i.func,i.element]),rowHeight:i.number.isRequired,height:i.number.isRequired,displayStart:i.number.isRequired,displayEnd:i.number.isRequired,rowsCount:i.number.isRequired,rowGetter:i.oneOfType([i.func.isRequired,i.array.isRequired]),onRows:i.func,columns:i.oneOfType([i.object,i.array]).isRequired},render:function(){var e=this,t=this.state.displayStart,r=this.state.displayEnd,i=this.props.rowHeight,n=this.props.rowsCount,l=this.getRows(t,r).map(function(r,o){return e.renderRow({key:t+o,ref:o,idx:t+o,row:r,height:i,columns:e.props.columns,isSelected:e.isRowSelected(t+o),expandedRows:e.props.expandedRows,cellMetaData:e.props.cellMetaData})});this._currentRowsLength=l.length,t>0&&l.unshift(this.renderPlaceholder("top",t*i)),n-r>0&&l.push(this.renderPlaceholder("bottom",(n-r)*i));var a=0;if(this.isMounted()){var c=this.getDOMNode();a=c.offsetWidth-c.clientWidth}var p={position:"absolute",top:0,left:0,overflowX:"auto",overflowY:"scroll",width:this.props.totalWidth+a,height:this.props.height,transform:"translate3d(0, 0, 0)"};return o.createElement("div",{style:p,onScroll:this.onScroll,className:s("react-grid-Canvas",this.props.className,{opaque:this.props.cellMetaData.selected&&this.props.cellMetaData.selected.active})},o.createElement("div",{style:{width:this.props.width,overflow:"hidden"}},l))},renderRow:function(e){var t=this.props.rowRenderer;return"function"==typeof t?o.createElement(t,e):o.isValidElement(this.props.rowRenderer)?n(this.props.rowRenderer,e):void 0},renderPlaceholder:function(e,t){return o.createElement("div",{key:e,style:{height:t}},this.props.columns.map(function(e,t){return o.createElement("div",{style:{width:e.width},key:t})}))},getDefaultProps:function(){return{rowRenderer:p,onRows:a}},isRowSelected:function(e){return this.props.selectedRows&&this.props.selectedRows[e]===!0},_currentRowsLength:0,_currentRowsRange:{start:0,end:0},_scroll:{scrollTop:0,scrollLeft:0},getInitialState:function(){return{shouldUpdate:!0,displayStart:this.props.displayStart,displayEnd:this.props.displayEnd}},componentWillMount:function(){this._currentRowsLength=0,this._currentRowsRange={start:0,end:0},this._scroll={scrollTop:0,scrollLeft:0}},componentDidMount:function(){this.onRows()},componentDidUpdate:function(e){this._scroll!=={start:0,end:0}&&this.setScrollLeft(this._scroll.scrollLeft),this.onRows()},componentWillUnmount:function(){this._currentRowsLength=0,this._currentRowsRange={start:0,end:0},this._scroll={scrollTop:0,scrollLeft:0}},componentWillReceiveProps:function(e){e.rowsCount>this.props.rowsCount&&(this.getDOMNode().scrollTop=e.rowsCount*this.props.rowHeight);var t=!(e.visibleStart>this.state.displayStart&&e.visibleEnd<this.state.displayEnd&&e.rowsCount===this.props.rowsCount&&e.rowHeight===this.props.rowHeight&&e.columns===this.props.columns&&e.width===this.props.width&&e.cellMetaData===this.props.cellMetaData&&l(e.style,this.props.style));t?this.setState({shouldUpdate:!0,displayStart:e.displayStart,displayEnd:e.displayEnd}):this.setState({shouldUpdate:!1})},shouldComponentUpdate:function(e,t){return!t||t.shouldUpdate},onRows:function(){this._currentRowsRange!=={start:0,end:0}&&(this.props.onRows(this._currentRowsRange),this._currentRowsRange={start:0,end:0})},getRows:function(e,t){if(this._currentRowsRange={start:e,end:t},Array.isArray(this.props.rowGetter))return this.props.rowGetter.slice(e,t);for(var r=[],o=e;t>o;o++)r.push(this.props.rowGetter(o));return r},setScrollLeft:function(e){if(0!==this._currentRowsLength){if(!this.refs)return;for(var t=0,r=this._currentRowsLength;r>t;t++)this.refs[t]&&this.refs[t].setScrollLeft&&this.refs[t].setScrollLeft(e)}},getScroll:function(){var e=this.getDOMNode(),t=e.scrollTop,r=e.scrollLeft;return{scrollTop:t,scrollLeft:r}},onScroll:function(e){this.appendScrollShim();var t=e.target,r=t.scrollTop,o=t.scrollLeft,s={scrollTop:r,scrollLeft:o};this._scroll=s,this.props.onScroll(s)}}));e.exports=u},function(e,t,r){"use strict";var o=r(1).isValidElement;e.exports=function(e,t){var r;for(r in e)if(e.hasOwnProperty(r)){if("function"==typeof e[r]&&"function"==typeof t[r]||o(e[r])&&o(t[r]))continue;if(!t.hasOwnProperty(r)||e[r]!==t[r])return!1}for(r in t)if(t.hasOwnProperty(r)&&!e.hasOwnProperty(r))return!1;return!0}},function(e,t,r){"use strict";var o=r(17)["default"],s=r(12),i=r(9);Object.assign=r(19);var n=r(1).PropTypes,l=r(6),a=function c(){o(this,c)};e.exports={mixins:[i.MetricsMixin],propTypes:{columns:n.arrayOf(a),minColumnWidth:n.number,columnEquality:n.func},DOMMetrics:{gridWidth:function(){return this.getDOMNode().offsetWidth-2}},getDefaultProps:function(){return{minColumnWidth:80,columnEquality:s.sameColumn}},componentWillReceiveProps:function(e){if(e.columns&&!s.sameColumns(this.props.columns,e.columns,this.props.columnEquality)){var t=this.createColumnMetrics();this.setState({columnMetrics:t})}},getTotalWidth:function(){var e=0;return e=this.isMounted()?this.DOMMetrics.gridWidth():l.getSize(this.props.columns)*this.props.minColumnWidth},getColumnMetricsType:function(e){var t=this.getTotalWidth(),r={columns:e.columns,totalWidth:t,minColumnWidth:e.minColumnWidth},o=s.recalculate(r);return o},getColumn:function(e,t){return Array.isArray(e)?e[t]:"undefined"!=typeof Immutable?e.get(t):void 0},getSize:function(){var e=this.state.columnMetrics.columns;return Array.isArray(e)?e.length:"undefined"!=typeof Immutable?e.size:void 0},metricsUpdated:function(){var e=this.createColumnMetrics();this.setState({columnMetrics:e})},createColumnMetrics:function(e){var t=this.setupGridColumns();return this.getColumnMetricsType({columns:t,minColumnWidth:this.props.minColumnWidth},e)},onColumnResize:function(e,t){var r=s.resizeColumn(this.state.columnMetrics,e,t);this.setState({columnMetrics:r})}}},function(e,t,r){"use strict";var o=r(3)["default"],s=r(1),i=s.PropTypes,n=r(7),l=s.createClass({displayName:"Draggable",propTypes:{onDragStart:i.func,onDragEnd:i.func,onDrag:i.func,component:i.oneOfType([i.func,i.constructor])},render:function(){this.props.component;return s.createElement("div",o({},this.props,{onMouseDown:this.onMouseDown,className:"react-grid-HeaderCell__draggable"}))},getDefaultProps:function(){return{onDragStart:n.thatReturnsTrue,onDragEnd:n,onDrag:n}},getInitialState:function(){return{drag:null}},onMouseDown:function(e){var t=this.props.onDragStart(e);(null!==t||0===e.button)&&(window.addEventListener("mouseup",this.onMouseUp),window.addEventListener("mousemove",this.onMouseMove),this.setState({drag:t}))},onMouseMove:function(e){null!==this.state.drag&&(e.preventDefault&&e.preventDefault(),this.props.onDrag(e))},onMouseUp:function(e){this.cleanUp(),this.props.onDragEnd(e,this.state.drag),this.setState({drag:null})},componentWillUnmount:function(){this.cleanUp()},cleanUp:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove)}});e.exports=l},function(e,t,r){"use strict";var o=r(3)["default"],s=r(1),i=s.PropTypes,n=r(31),l=r(38),a=(r(2),r(30)),c=r(9),p=s.createClass({displayName:"Grid",propTypes:{rowGetter:i.oneOfType([i.array,i.func]).isRequired,columns:i.oneOfType([i.array,i.object]),minHeight:i.number,headerRows:i.oneOfType([i.array,i.func]),rowHeight:i.number,rowRenderer:i.func,expandedRows:i.oneOfType([i.array,i.func]),selectedRows:i.oneOfType([i.array,i.func]),rowsCount:i.number,onRows:i.func,sortColumn:s.PropTypes.string,sortDirection:s.PropTypes.oneOf(["ASC","DESC","NONE"]),rowOffsetHeight:i.number.isRequired,onViewportKeydown:i.func.isRequired,onViewportDragStart:i.func.isRequired,onViewportDragEnd:i.func.isRequired,onViewportDoubleClick:i.func.isRequired},mixins:[a,c.MetricsComputatorMixin],getStyle:function(){return{overflow:"hidden",outline:0,position:"relative",minHeight:this.props.minHeight}},render:function(){var e=this.props.headerRows||[{ref:"row"}];return s.createElement("div",o({},this.props,{style:this.getStyle(),className:"react-grid-Grid"}),s.createElement(n,{ref:"header",columnMetrics:this.props.columnMetrics,onColumnResize:this.props.onColumnResize,height:this.props.rowHeight,totalWidth:this.props.totalWidth,headerRows:e,sortColumn:this.props.sortColumn,sortDirection:this.props.sortDirection,onSort:this.props.onSort}),s.createElement("div",{ref:"viewPortContainer",onKeyDown:this.props.onViewportKeydown,onDoubleClick:this.props.onViewportDoubleClick,onDragStart:this.props.onViewportDragStart,onDragEnd:this.props.onViewportDragEnd},s.createElement(l,{ref:"viewport",width:this.props.columnMetrics.width,rowHeight:this.props.rowHeight,rowRenderer:this.props.rowRenderer,rowGetter:this.props.rowGetter,rowsCount:this.props.rowsCount,selectedRows:this.props.selectedRows,expandedRows:this.props.expandedRows,columnMetrics:this.props.columnMetrics,totalWidth:this.props.totalWidth,onScroll:this.onScroll,onRows:this.props.onRows,cellMetaData:this.props.cellMetaData,rowOffsetHeight:this.props.rowOffsetHeight||this.props.rowHeight*e.length,minHeight:this.props.minHeight})))},getDefaultProps:function(){return{rowHeight:35,minHeight:350}}});e.exports=p},function(e,t){"use strict";e.exports={componentDidMount:function(){this._scrollLeft=this.refs.viewport.getScroll().scrollLeft,this._onScroll()},componentDidUpdate:function(){this._onScroll()},componentWillMount:function(){this._scrollLeft=void 0},componentWillUnmount:function(){this._scrollLeft=void 0},onScroll:function(e){this._scrollLeft!==e.scrollLeft&&(this._scrollLeft=e.scrollLeft,this._onScroll())},_onScroll:function(){void 0!==this._scrollLeft&&(this.refs.header.setScrollLeft(this._scrollLeft),this.refs.viewport.setScrollLeft(this._scrollLeft))}}},function(e,t,r){"use strict";var o=r(3)["default"],s=r(1),i=r(4),n=r(13),l=r(12),a=r(6),c=r(33),p=s.createClass({displayName:"Header",propTypes:{columnMetrics:s.PropTypes.shape({width:s.PropTypes.number.isRequired}).isRequired,totalWidth:s.PropTypes.number,height:s.PropTypes.number.isRequired,headerRows:s.PropTypes.array.isRequired},render:function(){var e=(this.state.resizing||this.props,i({"react-grid-Header":!0,"react-grid-Header--resizing":!!this.state.resizing})),t=this.getHeaderRows();return s.createElement("div",o({},this.props,{style:this.getStyle(),className:e}),t)},shouldComponentUpdate:function(e,t){var r=!l.sameColumns(this.props.columnMetrics.columns,e.columnMetrics.columns,l.sameColumn)||this.props.totalWidth!=e.totalWidth||this.props.headerRows.length!=e.headerRows.length||this.state.resizing!=t.resizing||this.props.sortColumn!=e.sortColumn||this.props.sortDirection!=e.sortDirection;return r},getHeaderRows:function(){var e,t=this.getColumnMetrics();this.state.resizing&&(e=this.state.resizing.column);var r=[];return this.props.headerRows.forEach(function(o,i){var n={position:"absolute",top:this.props.height*i,left:0,width:this.props.totalWidth,overflow:"hidden"};r.push(s.createElement(c,{key:o.ref,ref:o.ref,style:n,onColumnResize:this.onColumnResize,onColumnResizeEnd:this.onColumnResizeEnd,width:t.width,height:o.height||this.props.height,columns:t.columns,resizing:e,headerCellRenderer:o.headerCellRenderer,sortColumn:this.props.sortColumn,sortDirection:this.props.sortDirection,onSort:this.props.onSort}))}.bind(this)),r},getInitialState:function(){return{resizing:null}},componentWillReceiveProps:function(e){this.setState({resizing:null})},onColumnResize:function(e,t){var r=this.state.resizing||this.props,o=this.getColumnPosition(e);if(null!=o){var s={columnMetrics:n(r.columnMetrics)};s.columnMetrics=l.resizeColumn(s.columnMetrics,o,t),s.columnMetrics.totalWidth<r.columnMetrics.totalWidth&&(s.columnMetrics.totalWidth=r.columnMetrics.totalWidth),s.column=a.getColumn(s.columnMetrics.columns,o),
this.setState({resizing:s})}},getColumnMetrics:function(){var e;return e=this.state.resizing?this.state.resizing.columnMetrics:this.props.columnMetrics},getColumnPosition:function(e){var t=this.getColumnMetrics(),r=-1;return t.columns.forEach(function(t,o){t.key===e.key&&(r=o)}),-1===r?null:r},onColumnResizeEnd:function(e,t){var r=this.getColumnPosition(e);null!==r&&this.props.onColumnResize&&this.props.onColumnResize(r,t||e.width)},setScrollLeft:function(e){var t=this.refs.row.getDOMNode();t.scrollLeft=e,this.refs.row.setScrollLeft(e)},getStyle:function(){return{position:"relative",height:this.props.height*this.props.headerRows.length,overflow:"hidden"}}});e.exports=p},function(e,t,r){"use strict";function o(e){return s.createElement("div",{className:"widget-HeaderCell__value"},e.column.name)}var s=r(1),i=r(4),n=r(5),l=s.PropTypes,a=r(2),c=r(35),p=s.createClass({displayName:"HeaderCell",propTypes:{renderer:l.oneOfType([l.func,l.element]).isRequired,column:l.shape(a).isRequired,onResize:l.func.isRequired,height:l.number.isRequired,onResizeEnd:l.func.isRequired},render:function(){var e;this.props.column.resizable&&(e=s.createElement(c,{onDrag:this.onDrag,onDragStart:this.onDragStart,onDragEnd:this.onDragEnd}));var t=i({"react-grid-HeaderCell":!0,"react-grid-HeaderCell--resizing":this.state.resizing,"react-grid-HeaderCell--locked":this.props.column.locked});t=i(t,this.props.className);var r=this.getCell();return s.createElement("div",{className:t,style:this.getStyle()},r,{resizeHandle:e})},getCell:function(){return s.isValidElement(this.props.renderer)?n(this.props.renderer,{column:this.props.column}):this.props.renderer({column:this.props.column})},getDefaultProps:function(){return{renderer:o}},getInitialState:function(){return{resizing:!1}},setScrollLeft:function(e){var t=this.getDOMNode();t.style.webkitTransform="translate3d("+e+"px, 0px, 0px)",t.style.transform="translate3d("+e+"px, 0px, 0px)"},getStyle:function(){return{width:this.props.column.width,left:this.props.column.left,display:"inline-block",position:"absolute",overflow:"hidden",height:this.props.height,margin:0,textOverflow:"ellipsis",whiteSpace:"nowrap"}},onDragStart:function(e){this.setState({resizing:!0}),e&&e.dataTransfer&&e.dataTransfer.setData&&e.dataTransfer.setData("text/plain","dummy")},onDrag:function(e){var t=this.props.onResize||null;if(t){var r=this.getWidthFromMouseEvent(e);r>0&&t(this.props.column,r)}},onDragEnd:function(e){var t=this.getWidthFromMouseEvent(e);this.props.onResizeEnd(this.props.column,t),this.setState({resizing:!1})},getWidthFromMouseEvent:function(e){var t=e.pageX,r=this.getDOMNode().getBoundingClientRect().left;return t-r}});e.exports=p},function(e,t,r){"use strict";var o=r(3)["default"],s=r(1),i=s.PropTypes,n=r(21),l=r(32),a=r(44),c=(r(2),r(6)),p=r(41),u={overflow:s.PropTypes.string,width:i.oneOfType([i.number,i.string]),height:s.PropTypes.number,position:s.PropTypes.string},h={ASC:"ASC",DESC:"DESC",NONE:"NONE"},d=s.createClass({displayName:"HeaderRow",propTypes:{width:i.oneOfType([i.number,i.string]),height:i.number.isRequired,columns:i.oneOfType([i.array,i.object]),onColumnResize:i.func,onSort:i.func.isRequired,style:i.shape(u)},mixins:[c],render:function(){var e={width:this.props.width?this.props.width+a():"100%",height:this.props.height,whiteSpace:"nowrap",overflowX:"hidden",overflowY:"hidden"},t=this.getCells();return s.createElement("div",o({},this.props,{className:"react-grid-HeaderRow"}),s.createElement("div",{style:e},t))},getHeaderRenderer:function(e){if(e.sortable){var t=this.props.sortColumn===e.key?this.props.sortDirection:h.NONE;return s.createElement(p,{columnKey:e.key,onSort:this.props.onSort,sortDirection:t})}return this.props.headerCellRenderer||e.headerRenderer||this.props.cellRenderer},getCells:function(){for(var e=[],t=[],r=0,o=this.getSize(this.props.columns);o>r;r++){var i=this.getColumn(this.props.columns,r),n=s.createElement(l,{ref:r,key:r,height:this.props.height,column:i,renderer:this.getHeaderRenderer(i),resizing:this.props.resizing===i,onResize:this.props.onColumnResize,onResizeEnd:this.props.onColumnResizeEnd});i.locked?t.push(n):e.push(n)}return e.concat(t)},setScrollLeft:function(e){var t=this;this.props.columns.forEach(function(r,o){r.locked&&t.refs[o].setScrollLeft(e)})},shouldComponentUpdate:function(e){return e.width!==this.props.width||e.height!==this.props.height||e.columns!==this.props.columns||!n(e.style,this.props.style)||this.props.sortColumn!=e.sortColumn||this.props.sortDirection!=e.sortDirection},getStyle:function(){return{overflow:"hidden",width:"100%",height:this.props.height,position:"absolute"}}});e.exports=d},function(e,t,r){"use strict";var o=r(1).PropTypes;e.exports={selected:o.object.isRequired,copied:o.object,dragged:o.object,onCellClick:o.func.isRequired}},function(e,t,r){"use strict";var o=r(3)["default"],s=r(1),i=(r(4),r(28)),n=(r(5),s.PropTypes,s.createClass({displayName:"ResizeHandle",style:{position:"absolute",top:0,right:0,width:6,height:"100%"},render:function(){return s.createElement(i,o({},this.props,{className:"react-grid-HeaderCell__resizeHandle",style:this.style}))}}));e.exports=n},function(e,t){"use strict";var r={get:function(e,t){return"function"==typeof e.get?e.get(t):e[t]}};e.exports=r},function(e,t){"use strict";var r={appendScrollShim:function(){if(!this._scrollShim){var e=this._scrollShimSize(),t=document.createElement("div");t.classList?t.classList.add("react-grid-ScrollShim"):t.className+=" react-grid-ScrollShim",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.width=e.width+"px",t.style.height=e.height+"px",this.getDOMNode().appendChild(t),this._scrollShim=t}this._scheduleRemoveScrollShim()},_scrollShimSize:function(){return{width:this.props.width,height:this.props.length*this.props.rowHeight}},_scheduleRemoveScrollShim:function(){this._scheduleRemoveScrollShimTimer&&clearTimeout(this._scheduleRemoveScrollShimTimer),this._scheduleRemoveScrollShimTimer=setTimeout(this._removeScrollShim,200)},_removeScrollShim:function(){this._scrollShim&&(this._scrollShim.parentNode.removeChild(this._scrollShim),this._scrollShim=void 0)}};e.exports=r},function(e,t,r){"use strict";var o=r(1),s=r(25),i=o.PropTypes,n=r(39),l=o.createClass({displayName:"Viewport",mixins:[n],propTypes:{rowOffsetHeight:i.number.isRequired,totalWidth:i.number.isRequired,columnMetrics:i.object.isRequired,rowGetter:i.oneOfType([i.array,i.func]).isRequired,selectedRows:i.array,expandedRows:i.array,rowRenderer:i.func,rowsCount:i.number.isRequired,rowHeight:i.number.isRequired,onRows:i.func,onScroll:i.func,minHeight:i.number},render:function(){var e={padding:0,bottom:0,left:0,right:0,overflow:"hidden",position:"absolute",top:this.props.rowOffsetHeight};return o.createElement("div",{className:"react-grid-Viewport",style:e},o.createElement(s,{ref:"canvas",totalWidth:this.props.totalWidth,width:this.props.columnMetrics.width,rowGetter:this.props.rowGetter,rowsCount:this.props.rowsCount,selectedRows:this.props.selectedRows,expandedRows:this.props.expandedRows,columns:this.props.columnMetrics.columns,rowRenderer:this.props.rowRenderer,visibleStart:this.state.visibleStart,visibleEnd:this.state.visibleEnd,displayStart:this.state.displayStart,displayEnd:this.state.displayEnd,cellMetaData:this.props.cellMetaData,height:this.state.height,rowHeight:this.props.rowHeight,onScroll:this.onScroll,onRows:this.props.onRows}))},getScroll:function(){return this.refs.canvas.getScroll()},onScroll:function(e){this.updateScroll(e.scrollTop,e.scrollLeft,this.state.height,this.props.rowHeight,this.props.rowsCount),this.props.onScroll&&this.props.onScroll({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft})},setScrollLeft:function(e){this.refs.canvas.setScrollLeft(e)}});e.exports=l},function(e,t,r){"use strict";var o=r(1),s=r(9),i=(r(45),o.PropTypes,Math.min),n=Math.max,l=Math.floor,a=Math.ceil;e.exports={mixins:[s.MetricsMixin],DOMMetrics:{viewportHeight:function(){return this.getDOMNode().offsetHeight}},propTypes:{rowHeight:o.PropTypes.number,rowsCount:o.PropTypes.number.isRequired},getDefaultProps:function(){return{rowHeight:30}},getInitialState:function(){return this.getGridState(this.props)},getGridState:function(e){var t=a((e.minHeight-e.rowHeight)/e.rowHeight),r=i(2*t,e.rowsCount);return{displayStart:0,displayEnd:r,height:e.minHeight,scrollTop:0,scrollLeft:0}},updateScroll:function(e,t,r,o,s){var c=a(r/o),p=l(e/o),u=i(p+c,s),h=n(0,p-2*c),d=i(p+2*c,s),f={visibleStart:p,visibleEnd:u,displayStart:h,displayEnd:d,height:r,scrollTop:e,scrollLeft:t};this.setState(f)},metricsUpdated:function(){var e=this.DOMMetrics.viewportHeight();e&&this.updateScroll(this.state.scrollTop,this.state.scrollLeft,e,this.props.rowHeight,this.props.rowsCount)},componentWillReceiveProps:function(e){this.props.rowHeight!==e.rowHeight?this.setState(this.getGridState(e)):this.props.rowsCount!==e.rowsCount&&this.updateScroll(this.state.scrollTop,this.state.scrollLeft,this.state.height,e.rowHeight,e.rowsCount)}}},function(e,t,r){"use strict";var o=r(1),s=r(2),i=o.createClass({displayName:"FilterableHeaderCell",propTypes:{onChange:o.PropTypes.func.isRequired,column:o.PropTypes.shape(s).isRequired},getInitialState:function(){return{filterTerm:""}},handleChange:function(e){var t=e.target.value;this.setState({filterTerm:t}),this.props.onChange({filterTerm:t,columnKey:this.props.column.key})},componentDidUpdate:function(e){var t=this.getDOMNode();t&&t.focus()},render:function(){return o.createElement("div",null,o.createElement("div",{className:"form-group"},o.createElement(this.renderInput,null)))},renderInput:function(){return this.props.column.filterable===!1?o.createElement("span",null):o.createElement("input",{type:"text",className:"form-control input-sm",placeholder:"Search",value:this.state.filterTerm,onChange:this.handleChange})}});e.exports=i},function(e,t,r){"use strict";var o=r(1),s=(r(4),r(2),{ASC:"ASC",DESC:"DESC",NONE:"NONE"}),i=o.createClass({displayName:"SortableHeaderCell",propTypes:{columnKey:o.PropTypes.string.isRequired,onSort:o.PropTypes.func.isRequired,sortDirection:o.PropTypes.oneOf(["ASC","DESC","NONE"])},onClick:function(){var e;switch(this.props.sortDirection){case null:case void 0:case s.NONE:e=s.ASC;break;case s.ASC:e=s.DESC;break;case s.DESC:e=s.NONE}this.props.onSort(this.props.columnKey,e)},getSortByText:function(){var e={ASC:"9650",DESC:"9660",NONE:""};return String.fromCharCode(e[this.props.sortDirection])},render:function(){return o.createElement("div",{onClick:this.onClick,style:{cursor:"pointer"}},this.props.column.name,o.createElement("span",{className:"pull-right"},this.getSortByText()))}});e.exports=i},function(e,t,r){"use strict";var o=r(1),s=r(4),i=r(10),n=r(24),l=r(16),a=(r(5),o.createClass({displayName:"EditorContainer",mixins:[i],propTypes:{rowData:o.PropTypes.object.isRequired,value:o.PropTypes.oneOfType([o.PropTypes.string,o.PropTypes.number,o.PropTypes.object,o.PropTypes.bool]).isRequired,cellMetaData:o.PropTypes.shape({selected:o.PropTypes.object.isRequired,copied:o.PropTypes.object,dragged:o.PropTypes.object,onCellClick:o.PropTypes.func,onCellDoubleClick:o.PropTypes.func}).isRequired,column:o.PropTypes.object.isRequired,height:o.PropTypes.number.isRequired},changeCommitted:!1,getInitialState:function(){return{isInvalid:!1}},componentDidMount:function(){var e=this.getInputNode();void 0!==e&&(this.setTextInputFocus(),this.getEditor().disableContainerStyles||(e.className+=" editor-main",e.style.height=this.props.height-1+"px"))},createEditor:function(){var e={ref:"editor",name:"editor",column:this.props.column,value:this.getInitialValue(),onCommit:this.commit,rowMetaData:this.getRowMetaData(),height:this.props.height,onBlur:this.commit,onOverrideKeyDown:this.onKeyDown},t=this.props.column.editor;return t&&o.isValidElement(t)?o.addons.cloneWithProps(t,e):o.createElement(n,{ref:"editor",column:this.props.column,value:this.getInitialValue(),rowMetaData:this.getRowMetaData()})},getRowMetaData:function(){this.props.column.ItemId;return"function"==typeof this.props.column.getRowMetaData?this.props.column.getRowMetaData(this.props.rowData,this.props.column):void 0},onPressEnter:function(e){this.commit({key:"Enter"})},onPressTab:function(e){this.commit({key:"Tab"})},onPressEscape:function(e){this.editorIsSelectOpen()?e.stopPropagation():this.props.cellMetaData.onCommitCancel()},onPressArrowDown:function(e){this.editorHasResults()?e.stopPropagation():this.commit(e)},onPressArrowUp:function(e){this.editorHasResults()?e.stopPropagation():this.commit(e)},onPressArrowLeft:function(e){this.isCaretAtBeginningOfInput()?this.commit(e):e.stopPropagation()},onPressArrowRight:function(e){this.isCaretAtEndOfInput()?this.commit(e):e.stopPropagation()},editorHasResults:function(){return"SELECT"===this.getEditor().getInputNode().tagName?!0:l(this.getEditor().hasResults)?this.getEditor().hasResults():!1},editorIsSelectOpen:function(){return l(this.getEditor().isSelectOpen)?this.getEditor().isSelectOpen():!1},getEditor:function(){return this.refs.editor},commit:function(e){var t=e||{},r=this.getEditor().getValue();if(this.isNewValueValid(r)){var o=this.props.column.key;this.props.cellMetaData.onCommit({cellKey:o,rowIdx:this.props.rowIdx,updated:r,key:t.key})}this.changeCommitted=!0},isNewValueValid:function(e){if(l(this.getEditor().validate)){var t=this.getEditor().validate(e);return this.setState({isInvalid:!t}),t}return!0},getInputNode:function(){return this.getEditor().getInputNode()},getInitialValue:function(){var e=this.props.cellMetaData.selected,t=e.initialKeyCode;if("Delete"===t||"Backspace"===t)return"";if("Enter"===t)return this.props.value;var r=t?String.fromCharCode(t):this.props.value;return r},getContainerClass:function(){return s({"has-error":this.state.isInvalid===!0})},setCaretAtEndOfInput:function(){var e=this.getInputNode(),t=e.value.length;if(e.setSelectionRange)e.setSelectionRange(t,t);else if(e.createTextRange){var r=e.createTextRange();r.moveStart("character",t),r.collapse(),r.select()}},isCaretAtBeginningOfInput:function(){var e=this.getInputNode();return e.selectionStart===e.selectionEnd&&0===e.selectionStart},isCaretAtEndOfInput:function(){var e=this.getInputNode();return e.selectionStart===e.value.length},setTextInputFocus:function(){var e=this.props.cellMetaData.selected,t=e.initialKeyCode,r=this.getInputNode();r.focus(),"INPUT"===r.tagName&&(this.isKeyPrintable(t)?r.select():(r.focus(),r.select()))},componentWillUnmount:function(){this.changeCommitted||this.hasEscapeBeenPressed()||this.commit({key:"Enter"})},renderStatusIcon:function(){return this.state.isInvalid===!0?o.createElement("span",{className:"glyphicon glyphicon-remove form-control-feedback"}):void 0},hasEscapeBeenPressed:function(){var e=!1,t=27;return window.event&&(window.event.keyCode===t?e=!0:window.event.which===t&&(e=!0)),e},render:function(){return o.createElement("div",{className:this.getContainerClass(),onKeyDown:this.onKeyDown},this.createEditor(),this.renderStatusIcon())}}));e.exports=a},function(e,t,r){"use strict";var o=r(3)["default"],s=r(14)["default"],i=r(1),n=(i.PropTypes,r(29)),l=(r(11),r(2),r(10)),a=r(23),c=r(40),p=r(5),u=r(9),h=r(27),d=r(36),f=r(6);s||(Object.assign=r(19));var m=i.createClass({displayName:"ReactDataGrid",propTypes:{rowHeight:i.PropTypes.number.isRequired,minHeight:i.PropTypes.number.isRequired,enableRowSelect:i.PropTypes.bool,onRowUpdated:i.PropTypes.func,rowGetter:i.PropTypes.func.isRequired,rowsCount:i.PropTypes.number.isRequired,toolbar:i.PropTypes.element,enableCellSelect:i.PropTypes.bool,columns:i.PropTypes.oneOfType([i.PropTypes.object,i.PropTypes.array]).isRequired,onFilter:i.PropTypes.func,onCellCopyPaste:i.PropTypes.func,onCellsDragged:i.PropTypes.func,onAddFilter:i.PropTypes.func},mixins:[h,u.MetricsComputatorMixin,l],getDefaultProps:function(){return{enableCellSelect:!1,tabIndex:-1,rowHeight:35,enableRowSelect:!1,minHeight:350}},getInitialState:function(){var e=this.createColumnMetrics(!0),t={columnMetrics:e,selectedRows:this.getInitialSelectedRows(),copied:null,expandedRows:[],canFilter:!1,columnFilters:{},sortDirection:null,sortColumn:null,dragged:null,scrollOffset:0};return this.props.enableCellSelect?t.selected={rowIdx:0,idx:0}:t.selected={rowIdx:-1,idx:-1},t},getInitialSelectedRows:function(){for(var e=[],t=0;t<this.props.rowsCount;t++)e.push(!1);return e},componentWillReceiveProps:function(e){e.rowsCount===this.props.rowsCount+1&&this.onAfterAddRow(e.rowsCount+1)},componentDidMount:function(){var e=0,t=this.getDOMNode().querySelector(".react-grid-Canvas");null!=t&&(e=t.offsetWidth-t.clientWidth),this.setState({scrollOffset:e})},render:function(){var e={selected:this.state.selected,dragged:this.state.dragged,onCellClick:this.onCellClick,onCellDoubleClick:this.onCellDoubleClick,onCommit:this.onCellCommit,onCommitCancel:this.setInactive,copied:this.state.copied,handleDragEnterRow:this.handleDragEnter,handleTerminateDrag:this.handleTerminateDrag},t=this.renderToolbar(),r=this.DOMMetrics.gridWidth(),s=r+this.state.scrollOffset;return i.createElement("div",{className:"react-grid-Container",style:{width:s}},t,i.createElement("div",{className:"react-grid-Main"},i.createElement(n,o({ref:"base"},this.props,{headerRows:this.getHeaderRows(),columnMetrics:this.state.columnMetrics,rowGetter:this.props.rowGetter,rowsCount:this.props.rowsCount,rowHeight:this.props.rowHeight,cellMetaData:e,selectedRows:this.state.selectedRows,expandedRows:this.state.expandedRows,rowOffsetHeight:this.getRowOffsetHeight(),sortColumn:this.state.sortColumn,sortDirection:this.state.sortDirection,onSort:this.handleSort,minHeight:this.props.minHeight,totalWidth:r,onViewportKeydown:this.onKeyDown,onViewportDragStart:this.onDragStart,onViewportDragEnd:this.handleDragEnd,onViewportDoubleClick:this.onViewportDoubleClick,onColumnResize:this.onColumnResize}))))},renderToolbar:function(){var e=this.props.toolbar;return i.isValidElement(e)?p(e,{onToggleFilter:this.onToggleFilter,numberOfRows:this.props.rowsCount}):void 0},onSelect:function(e){if(this.props.enableCellSelect)if(this.state.selected.rowIdx===e.rowIdx&&this.state.selected.idx===e.idx&&this.state.selected.active===!0);else{var t=e.idx,r=e.rowIdx;t>=0&&r>=0&&t<f.getSize(this.state.columnMetrics.columns)&&r<this.props.rowsCount&&this.setState({selected:e})}},onCellClick:function(e){this.onSelect({rowIdx:e.rowIdx,idx:e.idx})},onCellDoubleClick:function(e){this.onSelect({rowIdx:e.rowIdx,idx:e.idx}),this.setActive("Enter")},onViewportDoubleClick:function(e){this.setActive()},onPressArrowUp:function(e){this.moveSelectedCell(e,-1,0)},onPressArrowDown:function(e){this.moveSelectedCell(e,1,0)},onPressArrowLeft:function(e){this.moveSelectedCell(e,0,-1)},onPressArrowRight:function(e){this.moveSelectedCell(e,0,1)},onPressTab:function(e){this.moveSelectedCell(e,0,e.shiftKey?-1:1)},onPressEnter:function(e){this.setActive(e.key)},onPressDelete:function(e){this.setActive(e.key)},onPressEscape:function(e){this.setInactive(e.key)},onPressBackspace:function(e){this.setActive(e.key)},onPressChar:function(e){this.isKeyPrintable(e.keyCode)&&this.setActive(e.keyCode)},onPressKeyWithCtrl:function(e){var t={KeyCode_c:99,KeyCode_C:67,KeyCode_V:86,KeyCode_v:118},r=this.state.selected.idx;if(this.canEdit(r))if(e.keyCode==t.KeyCode_c||e.keyCode==t.KeyCode_C){var o=this.getSelectedValue();this.handleCopy({value:o})}else(e.keyCode==t.KeyCode_v||e.keyCode==t.KeyCode_V)&&this.handlePaste()},onDragStart:function(e){var t=this.getSelectedValue();this.handleDragStart({idx:this.state.selected.idx,rowIdx:this.state.selected.rowIdx,value:t}),e&&e.dataTransfer&&e.dataTransfer.setData&&e.dataTransfer.setData("text/plain","dummy")},moveSelectedCell:function(e,t,r){e.preventDefault();var o=this.state.selected.rowIdx+t,s=this.state.selected.idx+r;this.onSelect({idx:s,rowIdx:o})},getSelectedValue:function(){var e=this.state.selected.rowIdx,t=this.state.selected.idx,r=this.getColumn(this.props.columns,t).key,o=this.props.rowGetter(e);return d.get(o,r)},setActive:function(e){var t=this.state.selected.rowIdx,r=this.state.selected.idx;if(this.canEdit(r)&&!this.isActive()){var o=s(this.state.selected,{idx:r,rowIdx:t,active:!0,initialKeyCode:e});this.setState({selected:o})}},setInactive:function(){var e=this.state.selected.rowIdx,t=this.state.selected.idx;if(this.canEdit(t)&&this.isActive()){var r=s(this.state.selected,{idx:t,rowIdx:e,active:!1});this.setState({selected:r})}},canEdit:function(e){var t=this.getColumn(this.props.columns,e);return this.props.enableCellSelect===!0&&(null!=t.editor||t.editable)},isActive:function(){return this.state.selected.active===!0},onCellCommit:function(e){var t=s({},this.state.selected);t.active=!1,"Tab"===e.key&&(t.idx+=1);var r=this.state.expandedRows;this.setState({selected:t,expandedRows:r}),this.props.onRowUpdated(e)},setupGridColumns:function(){var e=this.props.columns.slice(0);if(this.props.enableRowSelect){var t={key:"select-row",name:"",formatter:i.createElement(a,null),onCellChange:this.handleRowSelect,filterable:!1,headerRenderer:i.createElement("input",{type:"checkbox",onChange:this.handleCheckboxChange}),width:60,locked:!0},r=e.unshift(t);e=r>0?e:r}return e},handleCheckboxChange:function(e){var t;t=e.currentTarget instanceof HTMLInputElement&&e.currentTarget.checked===!0?!0:!1;for(var r=[],o=0;o<this.props.rowsCount;o++)r.push(t);this.setState({selectedRows:r})},handleRowSelect:function(e,t,r){if(r.stopPropagation(),null!=this.state.selectedRows&&this.state.selectedRows.length>0){var o=this.state.selectedRows.slice();null==o[e]||0==o[e]?o[e]=!0:o[e]=!1,this.setState({selectedRows:o})}},onAfterAddRow:function(e){this.setState({selected:{idx:1,rowIdx:e-2}})},onToggleFilter:function(){this.setState({canFilter:!this.state.canFilter})},getHeaderRows:function(){var e=[{ref:"row",height:this.props.rowHeight}];return this.state.canFilter===!0&&e.push({ref:"filterRow",headerCellRenderer:i.createElement(c,{onChange:this.props.onAddFilter,column:this.props.column}),height:45}),e},getRowOffsetHeight:function(){var e=0;return this.getHeaderRows().forEach(function(t){return e+=parseFloat(t.height,10)}),e},handleSort:function(e,t){this.setState({sortDirection:t,sortColumn:e},function(){this.props.onGridSort(e,t)})},copyPasteEnabled:function(){return null!==this.props.onCellCopyPaste},handleCopy:function(e){if(this.copyPasteEnabled()){var t=e.value,r=this.state.selected,o={idx:r.idx,rowIdx:r.rowIdx};this.setState({textToCopy:t,copied:o})}},handlePaste:function(){if(this.copyPasteEnabled()){var e=this.state.selected,t=this.getColumn(this.state.columnMetrics.columns,this.state.selected.idx).key;this.props.onCellCopyPaste&&this.props.onCellCopyPaste({cellKey:t,rowIdx:e.rowIdx,value:this.state.textToCopy,fromRow:this.state.copied.rowIdx,toRow:e.rowIdx}),this.setState({copied:null})}},dragEnabled:function(){return null!==this.props.onCellsDragged},handleDragStart:function(e){if(this.dragEnabled()){var t=e.idx,r=e.rowIdx;t>=0&&r>=0&&t<this.getSize()&&r<this.props.rowsCount&&this.setState({dragged:e})}},handleDragEnter:function(e){if(this.dragEnabled()){var t=(this.state.selected,this.state.dragged);t.overRowIdx=e,this.setState({dragged:t})}},handleDragEnd:function(){if(this.dragEnabled()){var e,t,r=this.state.selected,o=this.state.dragged,s=this.getColumn(this.state.columnMetrics.columns,this.state.selected.idx).key;e=r.rowIdx<o.overRowIdx?r.rowIdx:o.overRowIdx,t=r.rowIdx>o.overRowIdx?r.rowIdx:o.overRowIdx,this.props.onCellsDragged&&this.props.onCellsDragged({cellKey:s,fromRow:e,toRow:t,value:o.value}),this.setState({dragged:{complete:!0}})}},handleTerminateDrag:function(){this.dragEnabled()&&this.setState({dragged:null})}});e.exports=m},function(e,t){"use strict";function r(){if(void 0===o){var e=document.createElement("div");e.style.width="50px",e.style.height="50px",e.style.overflowY="scroll",e.style.position="absolute",e.style.top="-200px",e.style.left="-200px";var t=document.createElement("div");t.style.height="100px",t.style.width="100%",e.appendChild(t),document.body.appendChild(e);var r=e.clientWidth,s=t.clientWidth;document.body.removeChild(e),o=r-s}return o}var o;e.exports=r},function(e,t){"use strict";function r(){var e=window.innerWidth,t=window.innerHeight;return e&&t||(e=document.documentElement.clientWidth,t=document.documentElement.clientHeight),e&&t||(e=document.body.clientWidth,t=document.body.clientHeight),{width:e,height:t}}e.exports=r},function(e,t,r){r(57),e.exports=r(18).Object.assign},function(e,t,r){var o=r(56),s=r(54),i=r(51);e.exports=r(52)(function(){return Symbol()in Object.assign({})})?function(e,t){for(var r=o(e),n=arguments.length,l=1;n>l;)for(var a,c=s(arguments[l++]),p=i(c),u=p.length,h=0;u>h;)r[a=p[h++]]=c[a];return r}:Object.assign},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var o=r(53),s=r(18),i="prototype",n=function(e,t){return function(){return e.apply(t,arguments)}},l=function(e,t,r){var a,c,p,u,h=e&l.G,d=e&l.P,f=h?o:e&l.S?o[t]:(o[t]||{})[i],m=h?s:s[t]||(s[t]={});h&&(r=t);for(a in r)c=!(e&l.F)&&f&&a in f,c&&a in m||(p=c?f[a]:r[a],h&&"function"!=typeof f[a]?u=r[a]:e&l.B&&c?u=n(p,o):e&l.W&&f[a]==p?!function(e){u=function(t){return this instanceof e?new e(t):e(t)},u[i]=e[i]}(p):u=d&&"function"==typeof p?n(Function.call,p):p,m[a]=u,d&&((m[i]||(m[i]={}))[a]=p))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,e.exports=l},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var o=r(55);e.exports=function(e){var t=o.getKeys(e),r=o.getSymbols;if(r)for(var s,i=r(e),n=o.isEnum,l=0;i.length>l;)n.call(e,s=i[l++])&&t.push(s);return t}},function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t){var r="undefined",o=e.exports=typeof window!=r&&window.Math==Math?window:typeof self!=r&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=o)},function(e,t,r){var o=r(48);e.exports=0 in Object("z")?Object:function(e){return"String"==o(e)?e.split(""):Object(e)}},function(e,t){var r=Object;e.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},function(e,t,r){var o=r(50);e.exports=function(e){return Object(o(e))}},function(e,t,r){var o=r(49);o(o.S+o.F,"Object",{assign:r(47)})},function(e,t,r){"use strict";var o=r(20),s={current:{},withContext:function(e,t){var r,i=s.current;s.current=o({},i,e);try{r=t()}finally{s.current=i}return r}};e.exports=s},function(e,t){"use strict";var r={current:null};e.exports=r},function(e,t,r){(function(t){"use strict";function o(e,r){Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:function(){return this._store?this._store[r]:null},set:function(e){"production"!==t.env.NODE_ENV?l(!1,"Don't set the "+r+" property of the component. Mutate the existing props object instead."):null,this._store[r]=e}})}function s(e){try{var t={props:!0};for(var r in t)o(e,r);c=!0}catch(s){}}var i=r(58),n=r(59),l=r(15),a={key:!0,ref:!0},c=!1,p=function(e,r,o,s,i,n){return this.type=e,this.key=r,this.ref=o,this._owner=s,this._context=i,"production"!==t.env.NODE_ENV&&(this._store={validated:!1,props:n},c)?void Object.freeze(this):void(this.props=n)};p.prototype={_isReactElement:!0},"production"!==t.env.NODE_ENV&&s(p.prototype),p.createElement=function(e,r,o){var s,c={},u=null,h=null;if(null!=r){h=void 0===r.ref?null:r.ref,"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?l(null!==r.key,"createElement(...): Encountered component with a `key` of null. In a future version, this will be treated as equivalent to the string 'null'; instead, provide an explicit key or use undefined."):null),u=null==r.key?null:""+r.key;for(s in r)r.hasOwnProperty(s)&&!a.hasOwnProperty(s)&&(c[s]=r[s])}var d=arguments.length-2;if(1===d)c.children=o;else if(d>1){for(var f=Array(d),m=0;d>m;m++)f[m]=arguments[m+2];c.children=f}if(e&&e.defaultProps){var g=e.defaultProps;for(s in g)"undefined"==typeof c[s]&&(c[s]=g[s])}return new p(e,u,h,n.current,i.current,c)},p.createFactory=function(e){var t=p.createElement.bind(null,e);return t.type=e,t},p.cloneAndReplaceProps=function(e,r){var o=new p(e.type,e.key,e.ref,e._owner,e._context,r);return"production"!==t.env.NODE_ENV&&(o._store.validated=e._store.validated),o},p.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},e.exports=p}).call(t,r(8))},function(e,t,r){(function(t){"use strict";function o(e){return function(t,r,o){t.hasOwnProperty(r)?t[r]=e(t[r],o):t[r]=o}}function s(e,t){for(var r in t)if(t.hasOwnProperty(r)){var o=h[r];o&&h.hasOwnProperty(r)?o(e,r,t[r]):e.hasOwnProperty(r)||(e[r]=t[r])}return e}var i=r(20),n=r(7),l=r(62),a=r(63),c=r(15),p=!1,u=o(function(e,t){return i({},t,e)}),h={children:n,className:o(a),style:u},d={TransferStrategies:h,mergeProps:function(e,t){return s(i({},e),t)},Mixin:{transferPropsTo:function(e){return"production"!==t.env.NODE_ENV?l(e._owner===this,"%s: You can't call transferPropsTo() on a component that you don't own, %s. This usually means you are calling transferPropsTo() on a component passed in as props or children.",this.constructor.displayName,"string"==typeof e.type?e.type:e.type.displayName):l(e._owner===this),"production"!==t.env.NODE_ENV&&(p||(p=!0,"production"!==t.env.NODE_ENV?c(!1,"transferPropsTo is deprecated. See http://fb.me/react-transferpropsto for more information."):null)),s(e.props,this.props),e}}};e.exports=d}).call(t,r(8))},function(e,t,r){(function(t){"use strict";var r=function(e,r,o,s,i,n,l,a){if("production"!==t.env.NODE_ENV&&void 0===r)throw new Error("invariant requires an error message argument");if(!e){var c;if(void 0===r)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var p=[o,s,i,n,l,a],u=0;c=new Error("Invariant Violation: "+r.replace(/%s/g,function(){return p[u++]}))}throw c.framesToPop=1,c}};e.exports=r}).call(t,r(8))},function(e,t){"use strict";function r(e){e||(e="");var t,r=arguments.length;if(r>1)for(var o=1;r>o;o++)t=arguments[o],t&&(e=(e?e+" ":"")+t);return e}e.exports=r},function(e,t){var r=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=r}])}); |
src/media/js/site/components/header.js | mozilla/marketplace-content-tools | import classNames from 'classnames';
import React from 'react';
import {ReverseLink} from 'react-router-reverse';
import {LoginButton} from './login';
export default class Header extends React.Component {
static propTypes = {
authUrl: React.PropTypes.string,
email: React.PropTypes.string,
loginBeginHandler: React.PropTypes.func.isRequired,
loginHandler: React.PropTypes.func.isRequired,
logoutHandler: React.PropTypes.func.isRequired,
hasSignedTOS: React.PropTypes.bool,
isLoggedIn: React.PropTypes.bool.isRequired,
};
static contextTypes = {
routes: React.PropTypes.any
};
render() {
const userOk = this.props.isLoggedIn && this.props.hasSignedTOS;
return (
<header className="header" data-header-user-ok={userOk}>
<h1>
<a className="header-wordmark" href="/">Firefox Marketplace</a>
<ReverseLink to="root" className="header-title">
Content Tools
</ReverseLink>
</h1>
{userOk &&
<nav className="header-nav">
<ul>
<li>
<ReverseLink to="addon" activeClassName="active">
Firefox OS Add-ons
</ReverseLink>
</li>
<li>
<ReverseLink to="dev-agreement" activeClassName="active">
Developer Agreement
</ReverseLink>
</li>
<li>
<a href="https://developer.mozilla.org/docs/Mozilla/Firefox_OS/Add-ons/Review_critera"
target="_blank">
Review Criteria
</a>
</li>
<HeaderLogoutMobile {...this.props}/>
</ul>
</nav>
}
<HeaderUser {...this.props}/>
{!userOk &&
<HeaderLoginMobile {...this.props}/>
}
</header>
);
}
}
class HeaderUser extends React.Component {
static propTypes = {
authUrl: React.PropTypes.string,
email: React.PropTypes.string,
loginBeginHandler: React.PropTypes.func.isRequired,
loginHandler: React.PropTypes.func.isRequired,
logoutHandler: React.PropTypes.func.isRequired,
isLoggedIn: React.PropTypes.bool.isRequired,
}
state = {
isShowingDropdown: false
}
toggleUserDropdown() {
this.setState({isShowingDropdown: !this.state.isShowingDropdown});
}
handleLogoutClick(evt) {
this.toggleUserDropdown();
this.props.logoutHandler(evt);
}
renderAnonNav() {
return (
<div className="header-user">
<ul>
<li><LoginButton isSignup={true} {...this.props}/></li>
<li><LoginButton {...this.props}/></li>
</ul>
</div>
);
}
renderUserNav() {
let dropdownClasses = classNames({
'header-user': true,
'header-user--is-showing-dropdown': this.state.isShowingDropdown
});
let toggleUserDropdown = this.toggleUserDropdown.bind(this);
return (
<div className={dropdownClasses}>
<button className="header-user-dropdown-toggle"
onClick={toggleUserDropdown}>
User
</button>
<section className="header-user-dropdown">
<p>{this.props.email}</p>
<ul>
<li>
<button onClick={this.handleLogoutClick.bind(this)}>
Logout
</button>
</li>
</ul>
</section>
</div>
);
}
render() {
return this.props.isLoggedIn ? this.renderUserNav() : this.renderAnonNav();
}
}
class HeaderLoginMobile extends React.Component {
render() {
return (
<div className="header-login--mobile">
<LoginButton isSignup={true} {...this.props}/>
<LoginButton {...this.props}/>
</div>
);
}
}
class HeaderLogoutMobile extends HeaderUser {
render() {
return (
<li className="header-logout--mobile"
onClick={this.handleLogoutClick.bind(this)}>
<a href="#">Logout from {this.props.email}</a>
</li>
);
}
}
|
ajax/libs/angular.js/0.10.6/angular-scenario.js | crccheck/cdnjs | /** @license
* jQuery JavaScript Library v1.7
* 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: Thu Nov 3 16:18:21 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.7",
// 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.add( 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.fireWith( document, [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger( "ready" ).unbind( "ready" );
}
}
},
bindReady: function() {
if ( readyList ) {
return;
}
readyList = jQuery.Callbacks( "once memory" );
// 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;
},
isNumeric: 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, i ) {
var len;
if ( array ) {
if ( indexOf ) {
return indexOf.call( array, elem, i );
}
len = array.length;
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
for ( ; i < len; i++ ) {
// Skip accessing in sparse arrays
if ( i in array && 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();
}
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
// in a page that all might call define(). The loader will indicate
// they have special allowances for multiple jQuery versions by
// specifying define.amd.jQuery = true. Register as a named module,
// since jQuery can be concatenated with other files that may use define,
// but not use a proper concatenation script that understands anonymous
// AMD modules. A named AMD is safest and most robust way to register.
// Lowercase jquery is used because AMD module names are derived from
// file names, and jQuery is normally delivered in a lowercase file name.
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
define( "jquery", [], function () { return jQuery; } );
}
return jQuery;
})();
// String to Object flags format cache
var flagsCache = {};
// Convert String-formatted flags into Object-formatted ones and store in cache
function createFlags( flags ) {
var object = flagsCache[ flags ] = {},
i, length;
flags = flags.split( /\s+/ );
for ( i = 0, length = flags.length; i < length; i++ ) {
object[ flags[i] ] = true;
}
return object;
}
/*
* Create a callback list using the following parameters:
*
* flags: an optional list of space-separated flags that will change how
* the callback list behaves
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
* Possible flags:
*
* once: will ensure the callback list can only be fired once (like a Deferred)
*
* memory: will keep track of previous values and will call any callback added
* after the list has been fired right away with the latest "memorized"
* values (like a Deferred)
*
* unique: will ensure a callback can only be added once (no duplicate in the list)
*
* stopOnFalse: interrupt callings when a callback returns false
*
*/
jQuery.Callbacks = function( flags ) {
// Convert flags from String-formatted to Object-formatted
// (we check in cache first)
flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
var // Actual callback list
list = [],
// Stack of fire calls for repeatable lists
stack = [],
// Last fire value (for non-forgettable lists)
memory,
// Flag to know if list is currently firing
firing,
// First callback to fire (used internally by add and fireWith)
firingStart,
// End of the loop when firing
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
// Add one or several callbacks to the list
add = function( args ) {
var i,
length,
elem,
type,
actual;
for ( i = 0, length = args.length; i < length; i++ ) {
elem = args[ i ];
type = jQuery.type( elem );
if ( type === "array" ) {
// Inspect recursively
add( elem );
} else if ( type === "function" ) {
// Add if not in unique mode and callback is not in
if ( !flags.unique || !self.has( elem ) ) {
list.push( elem );
}
}
}
},
// Fire callbacks
fire = function( context, args ) {
args = args || [];
memory = !flags.memory || [ context, args ];
firing = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
memory = true; // Mark as halted
break;
}
}
firing = false;
if ( list ) {
if ( !flags.once ) {
if ( stack && stack.length ) {
memory = stack.shift();
self.fireWith( memory[ 0 ], memory[ 1 ] );
}
} else if ( memory === true ) {
self.disable();
} else {
list = [];
}
}
},
// Actual Callbacks object
self = {
// Add a callback or a collection of callbacks to the list
add: function() {
if ( list ) {
var length = list.length;
add( arguments );
// Do we need to add the callbacks to the
// current firing batch?
if ( firing ) {
firingLength = list.length;
// With memory, if we're not firing then
// we should call right away, unless previous
// firing was halted (stopOnFalse)
} else if ( memory && memory !== true ) {
firingStart = length;
fire( memory[ 0 ], memory[ 1 ] );
}
}
return this;
},
// Remove a callback from the list
remove: function() {
if ( list ) {
var args = arguments,
argIndex = 0,
argLength = args.length;
for ( ; argIndex < argLength ; argIndex++ ) {
for ( var i = 0; i < list.length; i++ ) {
if ( args[ argIndex ] === list[ i ] ) {
// Handle firingIndex and firingLength
if ( firing ) {
if ( i <= firingLength ) {
firingLength--;
if ( i <= firingIndex ) {
firingIndex--;
}
}
}
// Remove the element
list.splice( i--, 1 );
// If we have some unicity property then
// we only need to do this once
if ( flags.unique ) {
break;
}
}
}
}
}
return this;
},
// Control if a given callback is in the list
has: function( fn ) {
if ( list ) {
var i = 0,
length = list.length;
for ( ; i < length; i++ ) {
if ( fn === list[ i ] ) {
return true;
}
}
}
return false;
},
// Remove all callbacks from the list
empty: function() {
list = [];
return this;
},
// Have the list do nothing anymore
disable: function() {
list = stack = memory = undefined;
return this;
},
// Is it disabled?
disabled: function() {
return !list;
},
// Lock the list in its current state
lock: function() {
stack = undefined;
if ( !memory || memory === true ) {
self.disable();
}
return this;
},
// Is it locked?
locked: function() {
return !stack;
},
// Call all callbacks with the given context and arguments
fireWith: function( context, args ) {
if ( stack ) {
if ( firing ) {
if ( !flags.once ) {
stack.push( [ context, args ] );
}
} else if ( !( flags.once && memory ) ) {
fire( context, args );
}
}
return this;
},
// Call all the callbacks with the given arguments
fire: function() {
self.fireWith( this, arguments );
return this;
},
// To know if the callbacks have already been called at least once
fired: function() {
return !!memory;
}
};
return self;
};
var // Static reference to slice
sliceDeferred = [].slice;
jQuery.extend({
Deferred: function( func ) {
var doneList = jQuery.Callbacks( "once memory" ),
failList = jQuery.Callbacks( "once memory" ),
progressList = jQuery.Callbacks( "memory" ),
state = "pending",
lists = {
resolve: doneList,
reject: failList,
notify: progressList
},
promise = {
done: doneList.add,
fail: failList.add,
progress: progressList.add,
state: function() {
return state;
},
// Deprecated
isResolved: doneList.fired,
isRejected: failList.fired,
then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
return this;
},
always: function() {
return deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
},
pipe: function( fnDone, fnFail, fnProgress ) {
return jQuery.Deferred(function( newDefer ) {
jQuery.each( {
done: [ fnDone, "resolve" ],
fail: [ fnFail, "reject" ],
progress: [ fnProgress, "notify" ]
}, 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, newDefer.notify );
} 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 ) {
obj = promise;
} else {
for ( var key in promise ) {
obj[ key ] = promise[ key ];
}
}
return obj;
}
},
deferred = promise.promise({}),
key;
for ( key in lists ) {
deferred[ key ] = lists[ key ].fire;
deferred[ key + "With" ] = lists[ key ].fireWith;
}
// Handle state
deferred.done( function() {
state = "resolved";
}, failList.disable, progressList.lock ).fail( function() {
state = "rejected";
}, doneList.disable, progressList.lock );
// Call given func if any
if ( func ) {
func.call( deferred, deferred );
}
// All done!
return deferred;
},
// Deferred helper
when: function( firstParam ) {
var args = sliceDeferred.call( arguments, 0 ),
i = 0,
length = args.length,
pValues = new Array( length ),
count = length,
pCount = length,
deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
firstParam :
jQuery.Deferred(),
promise = deferred.promise();
function resolveFunc( i ) {
return function( value ) {
args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
if ( !( --count ) ) {
deferred.resolveWith( deferred, args );
}
};
}
function progressFunc( i ) {
return function( value ) {
pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
deferred.notifyWith( promise, pValues );
};
}
if ( length > 1 ) {
for ( ; i < length; i++ ) {
if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
} else {
--count;
}
}
if ( !count ) {
deferred.resolveWith( deferred, args );
}
} else if ( deferred !== firstParam ) {
deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
}
return 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'/><nav></nav>";
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 unknown elements (like HTML5 elems) are handled appropriately
unknownElems: !!div.getElementsByTagName( "nav" ).length,
// 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",
// Tests for enctype support on a form(#6743)
enctype: !!document.createElement("form").enctype,
// 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 its 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.lastChild );
// 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";
// We don't want to do body-related feature tests on frameset
// documents, which lack a body. So we use
// document.getElementsByTagName("body")[0], which is undefined in
// frameset documents, while document.body isn’t. (7398)
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: "-999px",
top: "-999px"
});
}
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;
}
// Technique from Juriy Zaytsev
// http://perfectionkills.com/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;
}
}
// Run fixed position tests at doc ready to avoid a crash
// related to the invisible body in IE8
jQuery(function() {
var container, outer, inner, table, td, offsetSupport,
conMarginTop = 1,
ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",
vb = "visibility:hidden;border:0;",
style = "style='" + ptlm + "border:5px solid #000;padding:0;'",
html = "<div " + style + "><div></div></div>" +
"<table " + style + " cellpadding='0' cellspacing='0'>" +
"<tr><td></td></tr></table>";
// Reconstruct a container
body = document.getElementsByTagName("body")[0];
if ( !body ) {
// Return for frameset docs that don't have a body
// These tests cannot be done
return;
}
container = document.createElement("div");
container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
body.insertBefore( container, body.firstChild );
// Construct a test element
testElement = document.createElement("div");
testElement.style.cssText = ptlm + vb;
testElement.innerHTML = html;
container.appendChild( testElement );
outer = testElement.firstChild;
inner = outer.firstChild;
td = outer.nextSibling.firstChild.firstChild;
offsetSupport = {
doesNotAddBorder: ( inner.offsetTop !== 5 ),
doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
};
inner.style.position = "fixed";
inner.style.top = "20px";
// safari subtracts parent border width here which is 5px
offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
inner.style.position = inner.style.top = "";
outer.style.overflow = "hidden";
outer.style.position = "relative";
offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
body.removeChild( container );
testElement = container = null;
jQuery.extend( support, offsetSupport );
});
testElement.innerHTML = "";
testElementParent.removeChild( testElement );
// 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])/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 privateCache, 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,
isEvents = name === "events";
// 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 || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && 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 ] = {};
// 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 ] = jQuery.extend( cache[ id ], name );
} else {
cache[ id ].data = jQuery.extend( cache[ id ].data, name );
}
}
privateCache = thisCache = cache[ id ];
// jQuery data() is stored in a separate object inside the object's internal data
// cache in order to avoid key collisions between internal data and user-defined
// data.
if ( !pvt ) {
if ( !thisCache.data ) {
thisCache.data = {};
}
thisCache = thisCache.data;
}
if ( data !== undefined ) {
thisCache[ jQuery.camelCase( name ) ] = data;
}
// Users should not attempt to inspect the internal events object using jQuery.data,
// it is undocumented and subject to change. But does anyone listen? No.
if ( isEvents && !thisCache[ name ] ) {
return privateCache.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, i, l,
// 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 ] : cache[ id ].data;
if ( thisCache ) {
// Support space separated names
if ( jQuery.isArray( name ) ) {
name = name;
} else if ( name in thisCache ) {
name = [ name ];
} else {
// split the camel cased version by spaces
name = jQuery.camelCase( name );
if ( name in thisCache ) {
name = [ name ];
} else {
name = name.split( " " );
}
}
for ( i = 0, l = name.length; i < l; i++ ) {
delete thisCache[ name[i] ];
}
// If there is no data left in the cache, we want to continue
// and let the cache object itself get destroyed
if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
return;
}
}
}
// See jQuery.data for more information
if ( !pvt ) {
delete cache[ id ].data;
// Don't destroy the parent cache unless the internal data object
// had been the only thing left in it
if ( !isEmptyDataObject(cache[ id ]) ) {
return;
}
}
// 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 cache and need to eliminate the expando on the node to avoid
// false lookups in the cache for entries that no longer exist
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 parts, attr, name,
data = null;
if ( typeof key === "undefined" ) {
if ( this.length ) {
data = jQuery.data( this[0] );
if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) {
attr = this[0].attributes;
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 ] );
}
}
jQuery._data( this[0], "parsedAttrs", true );
}
}
return data;
} else if ( typeof key === "object" ) {
return this.each(function() {
jQuery.data( this, key );
});
}
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" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "string" ) {
try {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
jQuery.isNumeric( 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;
}
// checks a cache object for emptiness
function isEmptyDataObject( obj ) {
for ( var name in obj ) {
// if the public data object is empty, the private is still empty
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
continue;
}
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 );
if ( defer &&
( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
// 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 ) &&
!jQuery._data( elem, markDataKey ) ) {
jQuery.removeData( elem, deferDataKey, true );
defer.fire();
}
}, 0 );
}
}
jQuery.extend({
_mark: function( elem, type ) {
if ( elem ) {
type = ( type || "fx" ) + "mark";
jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
}
},
_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 ) || 1) - 1 );
if ( count ) {
jQuery._data( elem, key, count );
} else {
jQuery.removeData( elem, key, true );
handleQueueMarkDefer( elem, type, "mark" );
}
}
},
queue: function( elem, type, data ) {
var q;
if ( elem ) {
type = ( type || "fx" ) + "queue";
q = jQuery._data( elem, type );
// 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) );
} else {
q.push( data );
}
}
return q || [];
}
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
fn = queue.shift(),
hooks = {};
// 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" );
}
jQuery._data( elem, type + ".run", hooks );
fn.call( elem, function() {
jQuery.dequeue( elem, type );
}, hooks );
}
if ( !queue.length ) {
jQuery.removeData( elem, type + "queue " + type + ".run", 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( next, hooks ) {
var timeout = setTimeout( next, time );
hooks.stop = function() {
clearTimeout( timeout );
};
});
},
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.Callbacks( "once memory" ), true ) )) {
count++;
tmp.add( 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,
getSetAttribute = jQuery.support.getSetAttribute,
nodeHook, boolHook, fixSpecified;
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 + " ",
i = 0,
l = this.length;
for ( ; 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, isFunction,
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;
}
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, i, max, option,
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
i = one ? index : 0;
max = one ? index + 1 : options.length;
for ( ; i < max; i++ ) {
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
},
attr: function( elem, name, value, pass ) {
var ret, hooks, notxml,
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 );
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
// All attributes are lowercase
// Grab necessary hook if one is defined
if ( notxml ) {
name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : 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, value ) {
var propName, attrNames, name, l,
i = 0;
if ( elem.nodeType === 1 ) {
attrNames = ( value || "" ).split( rspace );
l = attrNames.length;
for ( ; i < l; i++ ) {
name = attrNames[ i ].toLowerCase();
propName = jQuery.propFix[ name ] || name;
// See #9699 for explanation of this approach (setting first, then removal)
jQuery.attr( elem, name, "" );
elem.removeAttribute( getSetAttribute ? name : propName );
// Set corresponding property to false for boolean attributes
if ( rboolean.test( name ) && propName 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 ret, hooks, notxml,
nType = elem.nodeType;
// don't get/set properties on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return undefined;
}
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 (different case is intentional)
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,
property = jQuery.prop( elem, name );
return property === true || typeof property !== "boolean" && ( 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 ( !getSetAttribute ) {
fixSpecified = {
name: true,
id: true
};
// 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 ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
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 + "" );
}
};
// Apply the nodeHook to tabindex
jQuery.attrHooks.tabindex.set = nodeHook.set;
// 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;
}
}
});
});
// Set contenteditable to false on removals(#10429)
// Setting to empty string throws an error as an invalid value
jQuery.attrHooks.contenteditable = {
get: nodeHook.get,
set: function( elem, value, name ) {
if ( value === "" ) {
value = "false";
}
nodeHook.set( elem, value, name );
}
};
}
// 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;
}
});
}
// IE6/7 call enctype encoding
if ( !jQuery.support.enctype ) {
jQuery.propFix.enctype = "encoding";
}
// 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,
rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
rhoverHack = /\bhover(\.\S+)?/,
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
quickParse = function( selector ) {
var quick = rquickIs.exec( selector );
if ( quick ) {
// 0 1 2 3
// [ _, tag, id, class ]
quick[1] = ( quick[1] || "" ).toLowerCase();
quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
}
return quick;
},
quickIs = function( elem, m ) {
return (
(!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
(!m[2] || elem.id === m[2]) &&
(!m[3] || m[3].test( elem.className ))
);
},
hoverHack = function( events ) {
return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
};
/*
* Helper functions for managing events -- not part of the public interface.
* Props to Dean Edwards' addEvent library for many of the ideas.
*/
jQuery.event = {
add: function( elem, types, handler, data, selector ) {
var elemData, eventHandle, events,
t, tns, type, namespaces, handleObj,
handleObjIn, quick, handlers, special;
// Don't attach events to noData or text/comment nodes (allow plain objects tho)
if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
return;
}
// Caller can pass in an object of custom data in lieu of the handler
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
}
// Make sure that the handler has a unique ID, used to find/remove it later
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure and main handler, if this is the first
events = elemData.events;
if ( !events ) {
elemData.events = events = {};
}
eventHandle = elemData.handle;
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.dispatch.apply( eventHandle.elem, arguments ) :
undefined;
};
// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
eventHandle.elem = elem;
}
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
types = hoverHack(types).split( " " );
for ( t = 0; t < types.length; t++ ) {
tns = rtypenamespace.exec( types[t] ) || [];
type = tns[1];
namespaces = ( tns[2] || "" ).split( "." ).sort();
// If event changes its type, use the special event handlers for the changed type
special = jQuery.event.special[ type ] || {};
// If selector defined, determine special event api type, otherwise given type
type = ( selector ? special.delegateType : special.bindType ) || type;
// Update special based on newly reset type
special = jQuery.event.special[ type ] || {};
// handleObj is passed to all event handlers
handleObj = jQuery.extend({
type: type,
origType: tns[1],
data: data,
handler: handler,
guid: handler.guid,
selector: selector,
namespace: namespaces.join(".")
}, handleObjIn );
// Delegated event; pre-analyze selector so it's processed quickly on event dispatch
if ( selector ) {
handleObj.quick = quickParse( selector );
if ( !handleObj.quick && jQuery.expr.match.POS.test( selector ) ) {
handleObj.isPositional = true;
}
}
// Init the event handler queue if we're the first
handlers = events[ type ];
if ( !handlers ) {
handlers = events[ type ] = [];
handlers.delegateCount = 0;
// 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 to the element's handler list, delegates in front
if ( selector ) {
handlers.splice( handlers.delegateCount++, 0, handleObj );
} else {
handlers.push( handleObj );
}
// Keep track of which events have ever 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, selector ) {
var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
t, tns, type, namespaces, origCount,
j, events, special, handle, eventType, handleObj;
if ( !elemData || !(events = elemData.events) ) {
return;
}
// Once for each type.namespace in types; type may be omitted
types = hoverHack( types || "" ).split(" ");
for ( t = 0; t < types.length; t++ ) {
tns = rtypenamespace.exec( types[t] ) || [];
type = tns[1];
namespaces = tns[2];
// Unbind all events (on this namespace, if provided) for the element
if ( !type ) {
namespaces = namespaces? "." + namespaces : "";
for ( j in events ) {
jQuery.event.remove( elem, j + namespaces, handler, selector );
}
return;
}
special = jQuery.event.special[ type ] || {};
type = ( selector? special.delegateType : special.bindType ) || type;
eventType = events[ type ] || [];
origCount = eventType.length;
namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
// Only need to loop for special events or selective removal
if ( handler || namespaces || selector || special.remove ) {
for ( j = 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( !handler || handler.guid === handleObj.guid ) {
if ( !namespaces || namespaces.test( handleObj.namespace ) ) {
if ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) {
eventType.splice( j--, 1 );
if ( handleObj.selector ) {
eventType.delegateCount--;
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
}
}
}
} else {
// Removing all events
eventType.length = 0;
}
// Remove generic event handler if we removed something and no more handlers exist
// (avoids potential for endless recursion during removal of special event handlers)
if ( eventType.length === 0 && origCount !== eventType.length ) {
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
delete events[ type ];
}
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
handle = elemData.handle;
if ( handle ) {
handle.elem = null;
}
// removeData also checks for emptiness and clears the expando if empty
// so use it instead of delete
jQuery.removeData( elem, [ "events", "handle" ], 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 ) {
// Don't do events on text and comment nodes
if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
return;
}
// Event object or event type
var type = event.type || event,
namespaces = [],
cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
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.isTrigger = true;
event.exclusive = exclusive;
event.namespace = namespaces.join( "." );
event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
// triggerHandler() and global events don't bubble or run the default action
if ( onlyHandlers || !elem ) {
event.preventDefault();
}
// Handle a global trigger
if ( !elem ) {
// TODO: Stop taunting the data cache; remove global events and always attach to document
cache = jQuery.cache;
for ( i in cache ) {
if ( cache[ i ].events && cache[ i ].events[ type ] ) {
jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
}
}
return;
}
// Clean up the event in case it is being reused
event.result = undefined;
if ( !event.target ) {
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 );
// Allow special events to draw outside the lines
special = jQuery.event.special[ type ] || {};
if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
return;
}
// Determine event propagation path in advance, per W3C events spec (#9951)
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
eventPath = [[ elem, special.bindType || type ]];
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
bubbleType = special.delegateType || type;
old = null;
for ( cur = elem.parentNode; cur; cur = cur.parentNode ) {
eventPath.push([ cur, bubbleType ]);
old = cur;
}
// Only add window if we got to document (e.g., not plain obj or detached DOM)
if ( old && old === elem.ownerDocument ) {
eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
}
}
// Fire handlers on the event path
for ( i = 0; i < eventPath.length; i++ ) {
cur = eventPath[i][0];
event.type = eventPath[i][1];
handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
if ( handle ) {
handle.apply( cur, data );
}
handle = ontype && cur[ ontype ];
if ( handle && jQuery.acceptData( cur ) ) {
handle.apply( cur, data );
}
if ( event.isPropagationStopped() ) {
break;
}
}
event.type = type;
// If nobody prevented the default action, do it now
if ( !event.isDefaultPrevented() ) {
if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === 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.
// Don't do default actions on window, that's where global variables be (#6170)
// IE<9 dies on focus/blur to hidden element (#1486)
if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
// Don't re-trigger an onFOO event when we call its FOO() method
old = elem[ ontype ];
if ( old ) {
elem[ ontype ] = null;
}
// Prevent re-triggering of the same event, since we already bubbled it above
jQuery.event.triggered = type;
elem[ type ]();
jQuery.event.triggered = undefined;
if ( old ) {
elem[ ontype ] = old;
}
}
}
}
return event.result;
},
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event || window.event );
var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
delegateCount = handlers.delegateCount,
args = [].slice.call( arguments, 0 ),
run_all = !event.exclusive && !event.namespace,
specialHandle = ( jQuery.event.special[ event.type ] || {} ).handle,
handlerQueue = [],
i, j, cur, ret, selMatch, matched, matches, handleObj, sel, hit, related;
// Use the fix-ed jQuery.Event rather than the (read-only) native event
args[0] = event;
event.delegateTarget = this;
// Determine handlers that should run if there are delegated events
// Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861)
if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {
for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
selMatch = {};
matches = [];
for ( i = 0; i < delegateCount; i++ ) {
handleObj = handlers[ i ];
sel = handleObj.selector;
hit = selMatch[ sel ];
if ( handleObj.isPositional ) {
// Since .is() does not work for positionals; see http://jsfiddle.net/eJ4yd/3/
hit = ( hit || (selMatch[ sel ] = jQuery( sel )) ).index( cur ) >= 0;
} else if ( hit === undefined ) {
hit = selMatch[ sel ] = ( handleObj.quick ? quickIs( cur, handleObj.quick ) : jQuery( cur ).is( sel ) );
}
if ( hit ) {
matches.push( handleObj );
}
}
if ( matches.length ) {
handlerQueue.push({ elem: cur, matches: matches });
}
}
}
// Add the remaining (directly-bound) handlers
if ( handlers.length > delegateCount ) {
handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
}
// Run delegates first; they may want to stop propagation beneath us
for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
matched = handlerQueue[ i ];
event.currentTarget = matched.elem;
for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
handleObj = matched.matches[ j ];
// Triggered event must either 1) be non-exclusive and have no namespace, or
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
event.data = handleObj.data;
event.handleObj = handleObj;
ret = ( specialHandle || handleObj.handler ).apply( matched.elem, args );
if ( ret !== undefined ) {
event.result = ret;
if ( ret === false ) {
event.preventDefault();
event.stopPropagation();
}
}
}
}
}
return event.result;
},
// Includes some event props shared by KeyEvent and MouseEvent
// *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {},
keyHooks: {
props: "char charCode key keyCode".split(" "),
filter: function( event, original ) {
// Add which for key events
if ( event.which == null ) {
event.which = original.charCode != null ? original.charCode : original.keyCode;
}
return event;
}
},
mouseHooks: {
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement wheelDelta".split(" "),
filter: function( event, original ) {
var eventDoc, doc, body,
button = original.button,
fromElement = original.fromElement;
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && original.clientX != null ) {
eventDoc = event.target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
}
// Add relatedTarget, if necessary
if ( !event.relatedTarget && fromElement ) {
event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
}
// Add which for click: 1 === left; 2 === middle; 3 === right
// Note: button is not normalized, so don't use it
if ( !event.which && button !== undefined ) {
event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
}
return event;
}
},
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
// Create a writable copy of the event object and normalize some properties
var i, prop,
originalEvent = event,
fixHook = jQuery.event.fixHooks[ event.type ] || {},
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
event = jQuery.Event( originalEvent );
for ( i = copy.length; i; ) {
prop = copy[ --i ];
event[ prop ] = originalEvent[ prop ];
}
// Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
if ( !event.target ) {
event.target = originalEvent.srcElement || document;
}
// Target should not be a text node (#504, Safari)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}
// For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
if ( event.metaKey === undefined ) {
event.metaKey = event.ctrlKey;
}
return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
},
special: {
ready: {
// Make sure the ready event is setup
setup: jQuery.bindReady
},
focus: {
delegateType: "focusin",
noBubble: true
},
blur: {
delegateType: "focusout",
noBubble: true
},
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;
}
}
}
},
simulate: function( type, elem, event, bubble ) {
// 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.
var e = jQuery.extend(
new jQuery.Event(),
event,
{ type: type,
isSimulated: true,
originalEvent: {}
}
);
if ( bubble ) {
jQuery.event.trigger( e, null, elem );
} else {
jQuery.event.dispatch.call( elem, e );
}
if ( e.isDefaultPrevented() ) {
event.preventDefault();
}
}
};
// Some plugins are using, but it's undocumented/deprecated and will be removed.
// The 1.7 special event interface should provide all the hooks needed now.
jQuery.event.handle = jQuery.event.dispatch;
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 instanceof jQuery.Event) ) {
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 );
}
// Create a timestamp if incoming event doesn't have one
this.timeStamp = src && src.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
};
// Create mouseenter/leave events using mouseover/out and event-time checks
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = jQuery.event.special[ fix ] = {
delegateType: fix,
bindType: fix,
handle: function( event ) {
var target = this,
related = event.relatedTarget,
handleObj = event.handleObj,
selector = handleObj.selector,
oldType, ret;
// For a real mouseover/out, always call the handler; for
// mousenter/leave call the handler if related is outside the target.
// NB: No relatedTarget if the mouse left/entered the browser window
if ( !related || handleObj.origType === event.type || (related !== target && !jQuery.contains( target, related )) ) {
oldType = event.type;
event.type = handleObj.origType;
ret = handleObj.handler.apply( this, arguments );
event.type = oldType;
}
return ret;
}
};
});
// IE submit delegation
if ( !jQuery.support.submitBubbles ) {
jQuery.event.special.submit = {
setup: function() {
// Only need this for delegated form submit events
if ( jQuery.nodeName( this, "form" ) ) {
return false;
}
// Lazy-add a submit handler when a descendant form may potentially be submitted
jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
// Node name check avoids a VML-related crash in IE (#9807)
var elem = e.target,
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
if ( form && !form._submit_attached ) {
jQuery.event.add( form, "submit._submit", function( event ) {
// Form was submitted, bubble the event up the tree
if ( this.parentNode ) {
jQuery.event.simulate( "submit", this.parentNode, event, true );
}
});
form._submit_attached = true;
}
});
// return undefined since we don't need an event listener
},
teardown: function() {
// Only need this for delegated form submit events
if ( jQuery.nodeName( this, "form" ) ) {
return false;
}
// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
jQuery.event.remove( this, "._submit" );
}
};
}
// IE change delegation and checkbox/radio fix
if ( !jQuery.support.changeBubbles ) {
jQuery.event.special.change = {
setup: function() {
if ( rformElems.test( this.nodeName ) ) {
// IE doesn't fire change on a check/radio until blur; trigger it on click
// after a propertychange. Eat the blur-change in special.change.handle.
// This still fires onchange a second time for check/radio after blur.
if ( this.type === "checkbox" || this.type === "radio" ) {
jQuery.event.add( this, "propertychange._change", function( event ) {
if ( event.originalEvent.propertyName === "checked" ) {
this._just_changed = true;
}
});
jQuery.event.add( this, "click._change", function( event ) {
if ( this._just_changed ) {
this._just_changed = false;
jQuery.event.simulate( "change", this, event, true );
}
});
}
return false;
}
// Delegated event; lazy-add a change handler on descendant inputs
jQuery.event.add( this, "beforeactivate._change", function( e ) {
var elem = e.target;
if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
jQuery.event.add( elem, "change._change", function( event ) {
if ( this.parentNode && !event.isSimulated ) {
jQuery.event.simulate( "change", this.parentNode, event, true );
}
});
elem._change_attached = true;
}
});
},
handle: function( event ) {
var elem = event.target;
// Swallow native change events from checkbox/radio, we already triggered them above
if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
return event.handleObj.handler.apply( this, arguments );
}
},
teardown: function() {
jQuery.event.remove( this, "._change" );
return rformElems.test( this.nodeName );
}
};
}
// 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,
handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
};
jQuery.event.special[ fix ] = {
setup: function() {
if ( attaches++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
if ( --attaches === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
});
}
jQuery.fn.extend({
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
var origFn, type;
// Types can be a map of types/handlers
if ( typeof types === "object" ) {
// ( types-Object, selector, data )
if ( typeof selector !== "string" ) {
// ( types-Object, data )
data = selector;
selector = undefined;
}
for ( type in types ) {
this.on( type, selector, data, types[ type ], one );
}
return this;
}
if ( data == null && fn == null ) {
// ( types, fn )
fn = selector;
data = selector = undefined;
} else if ( fn == null ) {
if ( typeof selector === "string" ) {
// ( types, selector, fn )
fn = data;
data = undefined;
} else {
// ( types, data, fn )
fn = data;
data = selector;
selector = undefined;
}
}
if ( fn === false ) {
fn = returnFalse;
} else if ( !fn ) {
return this;
}
if ( one === 1 ) {
origFn = fn;
fn = function( event ) {
// Can use an empty set, since event contains the info
jQuery().off( event );
return origFn.apply( this, arguments );
};
// Use same guid so caller can remove using origFn
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
}
return this.each( function() {
jQuery.event.add( this, types, fn, data, selector );
});
},
one: function( types, selector, data, fn ) {
return this.on.call( this, types, selector, data, fn, 1 );
},
off: function( types, selector, fn ) {
if ( types && types.preventDefault && types.handleObj ) {
// ( event ) dispatched jQuery.Event
var handleObj = types.handleObj;
jQuery( types.delegateTarget ).off(
handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type,
handleObj.selector,
handleObj.handler
);
return this;
}
if ( typeof types === "object" ) {
// ( types-object [, selector] )
for ( var type in types ) {
this.off( type, selector, types[ type ] );
}
return this;
}
if ( selector === false || typeof selector === "function" ) {
// ( types [, fn] )
fn = selector;
selector = undefined;
}
if ( fn === false ) {
fn = returnFalse;
}
return this.each(function() {
jQuery.event.remove( this, types, fn, selector );
});
},
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
live: function( types, data, fn ) {
jQuery( this.context ).on( types, this.selector, data, fn );
return this;
},
die: function( types, fn ) {
jQuery( this.context ).off( types, this.selector || "**", fn );
return this;
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
},
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 );
}
});
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 contextmenu").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;
}
if ( rkeyEvent.test( name ) ) {
jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
}
if ( rmouseEvent.test( name ) ) {
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
}
});
/*!
* 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,
expando = "sizcache" + (Math.random() + '').replace('.', ''),
done = 0,
toString = Object.prototype.toString,
hasDuplicate = false,
baseHasDuplicate = true,
rBackslash = /\\/g,
rReturn = /\r\n/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, seed );
} 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, seed );
}
}
} 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, i, len, match, type, left;
if ( !expr ) {
return [];
}
for ( i = 0, len = Expr.order.length; i < len; i++ ) {
type = Expr.order[i];
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
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,
type, found, item, filter, left,
i, pass,
old = expr,
result = [],
curLoop = set,
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
while ( expr && set.length ) {
for ( type in Expr.filter ) {
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
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 ( i = 0; (item = curLoop[i]) != null; i++ ) {
if ( item ) {
found = filter( item, match, i, curLoop );
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;
};
/**
* Utility function for retreiving the text value of an array of DOM nodes
* @param {Array|Element} elem
*/
var getText = Sizzle.getText = function( elem ) {
var i, node,
nodeType = elem.nodeType,
ret = "";
if ( nodeType ) {
if ( nodeType === 1 ) {
// Use textContent || innerText for elements
if ( typeof elem.textContent === 'string' ) {
return elem.textContent;
} else if ( typeof elem.innerText === 'string' ) {
// Replace IE's carriage returns
return elem.innerText.replace( rReturn, '' );
} else {
// Traverse it's children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
ret += getText( elem );
}
}
} else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}
} else {
// If no nodeType, this is expected to be an array
for ( i = 0; (node = elem[i]); i++ ) {
// Do not traverse comment nodes
if ( node.nodeType !== 8 ) {
ret += getText( node );
}
}
}
return ret;
};
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 || 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 first, last,
doneName, parent, cache,
count, diff,
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":
first = match[2];
last = match[3];
if ( first === 1 && last === 0 ) {
return true;
}
doneName = match[0];
parent = elem.parentNode;
if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
count = 0;
for ( node = parent.firstChild; node; node = node.nextSibling ) {
if ( node.nodeType === 1 ) {
node.nodeIndex = ++count;
}
}
parent[ expando ] = doneName;
}
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 && 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 = Sizzle.attr ?
Sizzle.attr( elem, name ) :
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 && Sizzle.attr ?
result != null :
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;
};
}
// 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[ expando ] === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 && !isXML ){
elem[ expando ] = 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[ expando ] === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 ) {
if ( !isXML ) {
elem[ expando ] = 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, seed ) {
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, seed );
}
return Sizzle.filter( later, tmpSet );
};
// EXPOSE
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
Sizzle.selectors.attrMap = {};
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" ?
// If this is a positional selector, check membership in the returned set
// so $("p:first").is("p:last") won't return true for a doc with two "p".
POS.test( selector ) ?
jQuery( selector, this.context ).index( this[0] ) >= 0 :
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
var ret = [], i, l, cur = this[0];
// Array (deprecated as of jQuery 1.7)
if ( jQuery.isArray( selectors ) ) {
var level = 1;
while ( cur && cur.ownerDocument && cur !== context ) {
for ( i = 0; i < selectors.length; i++ ) {
if ( jQuery( cur ).is( selectors[ i ] ) ) {
ret.push({ selector: selectors[ i ], 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;
});
}
function createSafeFragment( document ) {
var list = nodeNames.split( " " ),
safeFrag = document.createDocumentFragment();
if ( safeFrag.createElement ) {
while ( list.length ) {
safeFrag.createElement(
list.pop()
);
}
}
return safeFrag;
}
var nodeNames = "abbr article aside audio canvas datalist details figcaption figure footer " +
"header hgroup mark meter nav output progress section summary time video",
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+;/,
rnoInnerhtml = /<(?:script|style)/i,
rnocache = /<(?:script|object|embed|option|style)/i,
rnoshimcache = new RegExp("<(?:" + nodeNames.replace(" ", "|") + ")", "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, "", "" ]
},
safeFragment = createSafeFragment( document );
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" && !rnoInnerhtml.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 type, i, l,
oldData = jQuery._data( src ),
curData = jQuery._data( dest, oldData ),
events = oldData.events;
if ( events ) {
delete curData.handle;
curData.events = {};
for ( type in events ) {
for ( 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 );
}
}
}
// make the cloned public data object a copy from the original
if ( curData.data ) {
curData.data = jQuery.extend( {}, curData.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,
first = args[ 0 ];
// 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
// Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
first.charAt(0) === "<" && !rnocache.test( first ) &&
(jQuery.support.checkClone || !rchecked.test( first )) &&
(!jQuery.support.unknownElems && rnoshimcache.test( first )) ) {
cacheable = true;
cacheresults = jQuery.fragments[ first ];
if ( cacheresults && cacheresults !== 1 ) {
fragment = cacheresults;
}
}
if ( !fragment ) {
fragment = doc.createDocumentFragment();
jQuery.clean( args, doc, fragment, scripts );
}
if ( cacheable ) {
jQuery.fragments[ first ] = 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 ( typeof elem.getElementsByTagName !== "undefined" ) {
return elem.getElementsByTagName( "*" );
} else if ( typeof elem.querySelectorAll !== "undefined" ) {
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 ) {
var nodeName = ( elem.nodeName || "" ).toLowerCase();
if ( nodeName === "input" ) {
fixDefaultChecked( elem );
// Skip scripts, get other children
} else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
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");
// Append wrapper element to unknown element safe doc fragment
if ( context === document ) {
// Use the fragment we've already created for this document
safeFragment.appendChild( div );
} else {
// Use a fragment created with the owner document
createSafeFragment( context ).appendChild( 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,
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 ];
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.isNumeric( 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, rsLeft, uncomputed,
ret = elem.currentStyle && elem.currentStyle[ name ],
style = elem.style;
// Avoid setting ret to empty string here
// so we don't default to auto
if ( ret === null && style && (uncomputed = style[ name ]) ) {
ret = uncomputed;
}
// 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;
rsLeft = elem.runtimeStyle && elem.runtimeStyle.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 && 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.Callbacks( "once memory" ),
// 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.fireWith( 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.add;
// 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 {
var elem, display,
i = 0,
j = this.length;
for ( ; i < j; i++ ) {
elem = this[i];
if ( elem.style ) {
display = jQuery.css( elem, "display" );
if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
jQuery._data( elem, "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 );
function doAnimation() {
// 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, e,
parts, start, end, unit,
method;
// 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" ) {
// inline-level elements accept inline-block;
// block-level elements need to be inline with layout
if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
this.style.display = "inline-block";
} else {
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 ) ) {
// Tracks whether to show or hide based on private
// data attached to the element
method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
if ( method ) {
jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
e[ method ]();
} else {
e[ 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;
}
return optall.queue === false ?
this.each( doAnimation ) :
this.queue( optall.queue, doAnimation );
},
stop: function( type, clearQueue, gotoEnd ) {
if ( typeof type !== "string" ) {
gotoEnd = clearQueue;
clearQueue = type;
type = undefined;
}
if ( clearQueue && type !== false ) {
this.queue( type || "fx", [] );
}
return this.each(function() {
var i,
hadTimers = false,
timers = jQuery.timers,
data = jQuery._data( this );
// clear marker counters if we know they won't be
if ( !gotoEnd ) {
jQuery._unmark( true, this );
}
function stopQueue( elem, data, i ) {
var hooks = data[ i ];
jQuery.removeData( elem, i, true );
hooks.stop( gotoEnd );
}
if ( type == null ) {
for ( i in data ) {
if ( data[ i ].stop && i.indexOf(".run") === i.length - 4 ) {
stopQueue( this, data, i );
}
}
} else if ( data[ i = type + ".run" ] && data[ i ].stop ){
stopQueue( this, data, i );
}
for ( i = timers.length; i--; ) {
if ( timers[ i ].elem === this && (type == null || timers[ i ].queue === type) ) {
if ( gotoEnd ) {
// force the next step to be the last
timers[ i ]( true );
} else {
timers[ i ].saveState();
}
hadTimers = true;
timers.splice( i, 1 );
}
}
// start the next in the queue if the last step wasn't forced
// timers currently will call their complete callbacks, which will dequeue
// but only if they were gotoEnd
if ( !( gotoEnd && hadTimers ) ) {
jQuery.dequeue( this, type );
}
});
}
});
// 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;
// normalize opt.queue - true/undefined/null -> "fx"
if ( opt.queue == null || opt.queue === true ) {
opt.queue = "fx";
}
// Queueing
opt.old = opt.complete;
opt.complete = function( noUnmark ) {
if ( jQuery.isFunction( opt.old ) ) {
opt.old.call( this );
}
if ( opt.queue ) {
jQuery.dequeue( this, opt.queue );
} 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.end = to;
this.now = this.start = from;
this.pos = this.state = 0;
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
function t( gotoEnd ) {
return self.step( gotoEnd );
}
t.queue = this.options.queue;
t.elem = this.elem;
t.saveState = function() {
if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
jQuery._data( self.elem, "fxshow" + self.prop, self.start );
}
};
if ( t() && jQuery.timers.push(t) && !timerId ) {
timerId = setInterval( fx.tick, fx.interval );
}
},
// Simple 'show' function
show: function() {
var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
// Remember where we started, so that we can go back to it later
this.options.orig[ this.prop ] = dataShow || 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
if ( dataShow !== undefined ) {
// This show is picking up where a previous hide or show left off
this.custom( this.cur(), dataShow );
} else {
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._data( this.elem, "fxshow" + 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 p, n, complete,
t = fxNow || createFxNow(),
done = true,
elem = this.elem,
options = this.options;
if ( gotoEnd || t >= options.duration + this.startTime ) {
this.now = this.end;
this.pos = this.state = 1;
this.update();
options.animatedProperties[ this.prop ] = true;
for ( p in options.animatedProperties ) {
if ( options.animatedProperties[ p ] !== 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 ( p in options.animatedProperties ) {
jQuery.style( elem, p, options.orig[ p ] );
jQuery.removeData( elem, "fxshow" + p, true );
// Toggle data is no longer needed
jQuery.removeData( elem, "toggle" + p, true );
}
}
// Execute the complete function
// in the event that the complete function throws an exception
// we must ensure it won't be called twice. #5684
complete = options.complete;
if ( complete ) {
options.complete = false;
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() {
var timer,
timers = jQuery.timers,
i = 0;
for ( ; i < timers.length; i++ ) {
timer = timers[ i ];
// Checks the timer has not already been removed
if ( !timer() && timers[ i ] === timer ) {
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.now + fx.unit;
} else {
fx.elem[ fx.prop ] = fx.now;
}
}
}
});
// Adds width/height step functions
// Do not set anything below 0
jQuery.each([ "width", "height" ], function( i, prop ) {
jQuery.fx.step[ prop ] = function( fx ) {
jQuery.style( fx.elem, prop, Math.max(0, 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 );
}
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.support.fixedPosition && 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.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
prevOffsetParent = offsetParent;
offsetParent = elem.offsetParent;
}
if ( jQuery.support.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.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
top += Math.max( docElem.scrollTop, body.scrollTop );
left += Math.max( docElem.scrollLeft, body.scrollLeft );
}
return { top: top, left: left };
};
}
jQuery.offset = {
bodyOffset: function( body ) {
var top = body.offsetTop,
left = body.offsetLeft;
if ( jQuery.support.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" ) ) :
this[ type ]() :
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" ) ) :
this[ type ]() :
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.isNumeric( ret ) ? ret : orig;
// 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 );/**
* @license AngularJS v0.10.6
* (c) 2010-2011 AngularJS http://angularjs.org
* License: MIT
*/
(function(window, document){
var _jQuery = window.jQuery.noConflict(true);
'use strict';
////////////////////////////////////
if (typeof document.getAttribute == $undefined)
document.getAttribute = function() {};
/**
* @ngdoc function
* @name angular.lowercase
* @function
*
* @description Converts the specified string to lowercase.
* @param {string} string String to be converted to lowercase.
* @returns {string} Lowercased string.
*/
var lowercase = function(string){return isString(string) ? string.toLowerCase() : string;};
/**
* @ngdoc function
* @name angular.uppercase
* @function
*
* @description Converts the specified string to uppercase.
* @param {string} string String to be converted to uppercase.
* @returns {string} Uppercased string.
*/
var uppercase = function(string){return isString(string) ? string.toUpperCase() : string;};
var manualLowercase = function(s) {
return isString(s)
? s.replace(/[A-Z]/g, function(ch) {return fromCharCode(ch.charCodeAt(0) | 32);})
: s;
};
var manualUppercase = function(s) {
return isString(s)
? s.replace(/[a-z]/g, function(ch) {return fromCharCode(ch.charCodeAt(0) & ~32);})
: s;
};
// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish
// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods
// with correct but slower alternatives.
if ('i' !== 'I'.toLowerCase()) {
lowercase = manualLowercase;
uppercase = manualUppercase;
}
function fromCharCode(code) {return String.fromCharCode(code);}
/**
* Creates the element for IE8 and below to allow styling of widgets
* (http://ejohn.org/blog/html5-shiv/). This hack works only if angular is
* included synchronously at the top of the document before IE sees any
* unknown elements. See regression/issue-584.html.
*
* @param {string} elementName Name of the widget.
* @returns {string} Lowercased string.
*/
function shivForIE(elementName) {
elementName = lowercase(elementName);
if (msie < 9 && elementName.charAt(0) != '@') { // ignore attr-widgets
document.createElement(elementName);
}
return elementName;
}
var $$scope = '$scope',
$boolean = 'boolean',
$console = 'console',
$length = 'length',
$name = 'name',
$object = 'object',
$string = 'string',
$undefined = 'undefined',
Error = window.Error,
/** holds major version number for IE or NaN for real browsers */
msie = parseInt((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1], 10),
jqLite, // delay binding since jQuery could be loaded after us.
jQuery, // delay binding
slice = [].slice,
push = [].push,
toString = Object.prototype.toString,
error = window[$console]
? bind(window[$console], window[$console]['error'] || noop)
: noop,
/** @name angular */
angular = window.angular || (window.angular = {}),
angularModule = null,
/** @name angular.markup */
angularTextMarkup = extensionMap(angular, 'markup'),
/** @name angular.attrMarkup */
angularAttrMarkup = extensionMap(angular, 'attrMarkup'),
/** @name angular.directive */
angularDirective = extensionMap(angular, 'directive', lowercase),
/** @name angular.widget */
angularWidget = extensionMap(angular, 'widget', shivForIE),
/** @name angular.module.ng */
angularInputType = extensionMap(angular, 'inputType', lowercase),
nodeName_,
uid = ['0', '0', '0'],
DATE_ISOSTRING_LN = 24;
/**
* @ngdoc function
* @name angular.forEach
* @function
*
* @description
* Invokes the `iterator` function once for each item in `obj` collection, which can be either an
* object or an array. The `iterator` function is invoked with `iterator(value, key)`, where `value`
* is the value of an object property or an array element and `key` is the object property key or
* array element index. Specifying a `context` for the function is optional.
*
* Note: this function was previously known as `angular.foreach`.
*
<pre>
var values = {name: 'misko', gender: 'male'};
var log = [];
angular.forEach(values, function(value, key){
this.push(key + ': ' + value);
}, log);
expect(log).toEqual(['name: misko', 'gender:male']);
</pre>
*
* @param {Object|Array} obj Object to iterate over.
* @param {Function} iterator Iterator function.
* @param {Object=} context Object to become context (`this`) for the iterator function.
* @returns {Object|Array} Reference to `obj`.
*/
function forEach(obj, iterator, context) {
var key;
if (obj) {
if (isFunction(obj)){
for (key in obj) {
if (key != 'prototype' && key != $length && key != $name && obj.hasOwnProperty(key)) {
iterator.call(context, obj[key], key);
}
}
} else if (obj.forEach && obj.forEach !== forEach) {
obj.forEach(iterator, context);
} else if (isObject(obj) && isNumber(obj.length)) {
for (key = 0; key < obj.length; key++)
iterator.call(context, obj[key], key);
} else {
for (key in obj)
iterator.call(context, obj[key], key);
}
}
return obj;
}
function sortedKeys(obj) {
var keys = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
keys.push(key);
}
}
return keys.sort();
}
function forEachSorted(obj, iterator, context) {
var keys = sortedKeys(obj)
for ( var i = 0; i < keys.length; i++) {
iterator.call(context, obj[keys[i]], keys[i]);
}
return keys;
}
/**
* when using forEach the params are value, key, but it is often useful to have key, value.
* @param {function(string, *)} iteratorFn
* @returns {function(*, string)}
*/
function reverseParams(iteratorFn) {
return function(value, key) { iteratorFn(key, value) };
}
/**
* A consistent way of creating unique IDs in angular. The ID is a sequence of alpha numeric
* characters such as '012ABC'. The reason why we are not using simply a number counter is that
* the number string gets longer over time, and it can also overflow, where as the the nextId
* will grow much slower, it is a string, and it will never overflow.
*
* @returns an unique alpha-numeric string
*/
function nextUid() {
var index = uid.length;
var digit;
while(index) {
index--;
digit = uid[index].charCodeAt(0);
if (digit == 57 /*'9'*/) {
uid[index] = 'A';
return uid.join('');
}
if (digit == 90 /*'Z'*/) {
uid[index] = '0';
} else {
uid[index] = String.fromCharCode(digit + 1);
return uid.join('');
}
}
uid.unshift('0');
return uid.join('');
}
/**
* @ngdoc function
* @name angular.extend
* @function
*
* @description
* Extends the destination object `dst` by copying all of the properties from the `src` object(s)
* to `dst`. You can specify multiple `src` objects.
*
* @param {Object} dst Destination object.
* @param {...Object} src Source object(s).
*/
function extend(dst) {
forEach(arguments, function(obj){
if (obj !== dst) {
forEach(obj, function(value, key){
dst[key] = value;
});
}
});
return dst;
}
function inherit(parent, extra) {
return extend(new (extend(function() {}, {prototype:parent}))(), extra);
}
/**
* @ngdoc function
* @name angular.noop
* @function
*
* @description
* A function that performs no operations. This function can be useful when writing code in the
* functional style.
<pre>
function foo(callback) {
var result = calculateResult();
(callback || angular.noop)(result);
}
</pre>
*/
function noop() {}
noop.$inject = [];
/**
* @ngdoc function
* @name angular.identity
* @function
*
* @description
* A function that returns its first argument. This function is useful when writing code in the
* functional style.
*
<pre>
function transformer(transformationFn, value) {
return (transformationFn || identity)(value);
};
</pre>
*/
function identity($) {return $;}
identity.$inject = [];
function valueFn(value) {return function() {return value;};}
function extensionMap(angular, name, transform) {
var extPoint;
return angular[name] || (extPoint = angular[name] = function(name, fn, prop){
name = (transform || identity)(name);
if (isDefined(fn)) {
extPoint[name] = extend(fn, prop || {});
}
return extPoint[name];
});
}
/**
* @ngdoc function
* @name angular.isUndefined
* @function
*
* @description
* Determines if a reference is undefined.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is undefined.
*/
function isUndefined(value){return typeof value == $undefined;}
/**
* @ngdoc function
* @name angular.isDefined
* @function
*
* @description
* Determines if a reference is defined.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is defined.
*/
function isDefined(value){return typeof value != $undefined;}
/**
* @ngdoc function
* @name angular.isObject
* @function
*
* @description
* Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not
* considered to be objects.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is an `Object` but not `null`.
*/
function isObject(value){return value!=null && typeof value == $object;}
/**
* @ngdoc function
* @name angular.isString
* @function
*
* @description
* Determines if a reference is a `String`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `String`.
*/
function isString(value){return typeof value == $string;}
/**
* @ngdoc function
* @name angular.isNumber
* @function
*
* @description
* Determines if a reference is a `Number`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `Number`.
*/
function isNumber(value){return typeof value == 'number';}
/**
* @ngdoc function
* @name angular.isDate
* @function
*
* @description
* Determines if a value is a date.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `Date`.
*/
function isDate(value){
return toString.apply(value) == '[object Date]';
}
/**
* @ngdoc function
* @name angular.isArray
* @function
*
* @description
* Determines if a reference is an `Array`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is an `Array`.
*/
function isArray(value) {
return toString.apply(value) == '[object Array]';
}
/**
* @ngdoc function
* @name angular.isFunction
* @function
*
* @description
* Determines if a reference is a `Function`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `Function`.
*/
function isFunction(value){return typeof value == 'function';}
/**
* Checks if `obj` is a window object.
*
* @private
* @param {*} obj Object to check
* @returns {boolean} True if `obj` is a window obj.
*/
function isWindow(obj) {
return obj && obj.document && obj.location && obj.alert && obj.setInterval;
}
function isScope(obj) {
return obj && obj.$evalAsync && obj.$watch;
}
function isBoolean(value) {return typeof value == $boolean;}
function isTextNode(node) {return nodeName_(node) == '#text';}
function trim(value) {
return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value;
}
/**
* @ngdoc function
* @name angular.isElement
* @function
*
* @description
* Determines if a reference is a DOM element (or wrapped jQuery element).
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).
*/
function isElement(node) {
return node &&
(node.nodeName // we are a direct element
|| (node.bind && node.find)); // we have a bind and find method part of jQuery API
}
/**
* @param str 'key1,key2,...'
* @returns {object} in the form of {key1:true, key2:true, ...}
*/
function makeMap(str){
var obj = {}, items = str.split(","), i;
for ( i = 0; i < items.length; i++ )
obj[ items[i] ] = true;
return obj;
}
/**
* HTML class which is the only class which can be used in ng:bind to inline HTML for security
* reasons.
*
* @constructor
* @param html raw (unsafe) html
* @param {string=} option If set to 'usafe', get method will return raw (unsafe/unsanitized) html
*/
function HTML(html, option) {
this.html = html;
this.get = lowercase(option) == 'unsafe'
? valueFn(html)
: function htmlSanitize() {
var buf = [];
htmlParser(html, htmlSanitizeWriter(buf));
return buf.join('');
};
}
if (msie < 9) {
nodeName_ = function(element) {
element = element.nodeName ? element : element[0];
return (element.scopeName && element.scopeName != 'HTML')
? uppercase(element.scopeName + ':' + element.nodeName) : element.nodeName;
};
} else {
nodeName_ = function(element) {
return element.nodeName ? element.nodeName : element[0].nodeName;
};
}
function isVisible(element) {
var rect = element[0].getBoundingClientRect(),
width = (rect.width || (rect.right||0 - rect.left||0)),
height = (rect.height || (rect.bottom||0 - rect.top||0));
return width>0 && height>0;
}
function map(obj, iterator, context) {
var results = [];
forEach(obj, function(value, index, list) {
results.push(iterator.call(context, value, index, list));
});
return results;
}
/**
* @description
* Determines the number of elements in an array, the number of properties an object has, or
* the length of a string.
*
* Note: This function is used to augment the Object type in Angular expressions. See
* {@link angular.Object} for more information about Angular arrays.
*
* @param {Object|Array|string} obj Object, array, or string to inspect.
* @param {boolean} [ownPropsOnly=false] Count only "own" properties in an object
* @returns {number} The size of `obj` or `0` if `obj` is neither an object nor an array.
*/
function size(obj, ownPropsOnly) {
var size = 0, key;
if (isArray(obj) || isString(obj)) {
return obj.length;
} else if (isObject(obj)){
for (key in obj)
if (!ownPropsOnly || obj.hasOwnProperty(key))
size++;
}
return size;
}
function includes(array, obj) {
for ( var i = 0; i < array.length; i++) {
if (obj === array[i]) return true;
}
return false;
}
function indexOf(array, obj) {
for ( var i = 0; i < array.length; i++) {
if (obj === array[i]) return i;
}
return -1;
}
function arrayRemove(array, value) {
var index = indexOf(array, value);
if (index >=0)
array.splice(index, 1);
return value;
}
function isLeafNode (node) {
if (node) {
switch (node.nodeName) {
case "OPTION":
case "PRE":
case "TITLE":
return true;
}
}
return false;
}
/**
* @ngdoc function
* @name angular.copy
* @function
*
* @description
* Creates a deep copy of `source`, which should be an object or an array.
*
* * If no destination is supplied, a copy of the object or array is created.
* * If a destination is provided, all of its elements (for array) or properties (for objects)
* are deleted and then all elements/properties from the source are copied to it.
* * If `source` is not an object or array, `source` is returned.
*
* Note: this function is used to augment the Object type in Angular expressions. See
* {@link angular.module.ng.$filter} for more information about Angular arrays.
*
* @param {*} source The source that will be used to make a copy.
* Can be any type, including primitives, `null`, and `undefined`.
* @param {(Object|Array)=} destination Destination into which the source is copied. If
* provided, must be of the same type as `source`.
* @returns {*} The copy or updated `destination`, if `destination` was specified.
*/
function copy(source, destination){
if (isWindow(source) || isScope(source)) throw Error("Can't copy Window or Scope");
if (!destination) {
destination = source;
if (source) {
if (isArray(source)) {
destination = copy(source, []);
} else if (isDate(source)) {
destination = new Date(source.getTime());
} else if (isObject(source)) {
destination = copy(source, {});
}
}
} else {
if (source === destination) throw Error("Can't copy equivalent objects or arrays");
if (isArray(source)) {
while(destination.length) {
destination.pop();
}
for ( var i = 0; i < source.length; i++) {
destination.push(copy(source[i]));
}
} else {
forEach(destination, function(value, key){
delete destination[key];
});
for ( var key in source) {
destination[key] = copy(source[key]);
}
}
}
return destination;
}
/**
* @ngdoc function
* @name angular.equals
* @function
*
* @description
* Determines if two objects or two values are equivalent. Supports value types, arrays and
* objects.
*
* Two objects or values are considered equivalent if at least one of the following is true:
*
* * Both objects or values pass `===` comparison.
* * Both objects or values are of the same type and all of their properties pass `===` comparison.
* * Both values are NaN. (In JavasScript, NaN == NaN => false. But we consider two NaN as equal)
*
* During a property comparision, properties of `function` type and properties with names
* that begin with `$` are ignored.
*
* Scope and DOMWindow objects are being compared only be identify (`===`).
*
* @param {*} o1 Object or value to compare.
* @param {*} o2 Object or value to compare.
* @returns {boolean} True if arguments are equal.
*/
function equals(o1, o2) {
if (o1 === o2) return true;
if (o1 === null || o2 === null) return false;
if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
if (t1 == t2 && t1 == 'object') {
if (isArray(o1)) {
if ((length = o1.length) == o2.length) {
for(key=0; key<length; key++) {
if (!equals(o1[key], o2[key])) return false;
}
return true;
}
} else {
if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2)) return false;
keySet = {};
for(key in o1) {
if (key.charAt(0) !== '$' && !isFunction(o1[key]) && !equals(o1[key], o2[key])) {
return false;
}
keySet[key] = true;
}
for(key in o2) {
if (!keySet[key] && key.charAt(0) !== '$' && !isFunction(o2[key])) return false;
}
return true;
}
}
return false;
}
function setHtml(node, html) {
if (isLeafNode(node)) {
if (msie) {
node.innerText = html;
} else {
node.textContent = html;
}
} else {
node.innerHTML = html;
}
}
function concat(array1, array2, index) {
return array1.concat(slice.call(array2, index));
}
function sliceArgs(args, startIndex) {
return slice.call(args, startIndex || 0);
}
/**
* @ngdoc function
* @name angular.bind
* @function
*
* @description
* Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
* `fn`). You can supply optional `args` that are are prebound to the function. This feature is also
* known as [function currying](http://en.wikipedia.org/wiki/Currying).
*
* @param {Object} self Context which `fn` should be evaluated in.
* @param {function()} fn Function to be bound.
* @param {...*} args Optional arguments to be prebound to the `fn` function call.
* @returns {function()} Function that wraps the `fn` with all the specified bindings.
*/
function bind(self, fn) {
var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
if (isFunction(fn) && !(fn instanceof RegExp)) {
return curryArgs.length
? function() {
return arguments.length
? fn.apply(self, curryArgs.concat(slice.call(arguments, 0)))
: fn.apply(self, curryArgs);
}
: function() {
return arguments.length
? fn.apply(self, arguments)
: fn.call(self);
};
} else {
// in IE, native methods are not functions so they cannot be bound (note: they don't need to be)
return fn;
}
}
function toBoolean(value) {
if (value && value.length !== 0) {
var v = lowercase("" + value);
value = !(v == 'f' || v == '0' || v == 'false' || v == 'no' || v == 'n' || v == '[]');
} else {
value = false;
}
return value;
}
/////////////////////////////////////////////////
/**
* Parses an escaped url query string into key-value pairs.
* @returns Object.<(string|boolean)>
*/
function parseKeyValue(/**string*/keyValue) {
var obj = {}, key_value, key;
forEach((keyValue || "").split('&'), function(keyValue){
if (keyValue) {
key_value = keyValue.split('=');
key = decodeURIComponent(key_value[0]);
obj[key] = isDefined(key_value[1]) ? decodeURIComponent(key_value[1]) : true;
}
});
return obj;
}
function toKeyValue(obj) {
var parts = [];
forEach(obj, function(value, key) {
parts.push(encodeUriQuery(key, true) + (value === true ? '' : '=' + encodeUriQuery(value, true)));
});
return parts.length ? parts.join('&') : '';
}
/**
* We need our custom mehtod because encodeURIComponent is too agressive and doesn't follow
* http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
* segments:
* segment = *pchar
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
* pct-encoded = "%" HEXDIG HEXDIG
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
* / "*" / "+" / "," / ";" / "="
*/
function encodeUriSegment(val) {
return encodeUriQuery(val, true).
replace(/%26/gi, '&').
replace(/%3D/gi, '=').
replace(/%2B/gi, '+');
}
/**
* This method is intended for encoding *key* or *value* parts of query component. We need a custom
* method becuase encodeURIComponent is too agressive and encodes stuff that doesn't have to be
* encoded per http://tools.ietf.org/html/rfc3986:
* query = *( pchar / "/" / "?" )
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
* pct-encoded = "%" HEXDIG HEXDIG
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
* / "*" / "+" / "," / ";" / "="
*/
function encodeUriQuery(val, pctEncodeSpaces) {
return encodeURIComponent(val).
replace(/%40/gi, '@').
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace((pctEncodeSpaces ? null : /%20/g), '+');
}
/**
* @ngdoc directive
* @name angular.directive.ng:app
*
* @element ANY
* @param {angular.Module} module on optional application
* {@link angular.module module} name to load.
*
* @description
*
* Use this directive to auto-bootstrap on application. Only
* one directive can be used per HTML document. The directive
* designates the root of the application and is typically placed
* ot the root of the page.
*
* In the example below if the `ng:app` directive would not be placed
* on the `html` element then the document would not be compiled
* and the `{{ 1+2 }}` would not be resolved to `3`.
*
* `ng:app` is the easiest way to bootstrap an application.
*
<doc:example>
<doc:source>
I can add: 1 + 2 = {{ 1+2 }}
</doc:source>
</doc:example>
*
*/
function angularInit(element, bootstrap) {
var elements = [element],
appElement,
module,
names = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'],
NG_APP_CLASS_REGEXP = /\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;
function append(element) {
element && elements.push(element);
}
forEach(names, function(name) {
names[name] = true;
append(document.getElementById(name));
name = name.replace(':', '\\:');
if (element.querySelectorAll) {
forEach(element.querySelectorAll('.' + name), append);
forEach(element.querySelectorAll('.' + name + '\\:'), append);
forEach(element.querySelectorAll('[' + name + ']'), append);
};
});
forEach(elements, function(element) {
if (!appElement) {
var className = ' ' + element.className + ' ';
var match = NG_APP_CLASS_REGEXP.exec(className);
if (match) {
appElement = element;
module = (match[2] || '').replace(/\s+/g, ',');
} else {
forEach(element.attributes, function(attr) {
if (!appElement && names[attr.name]) {
appElement = element;
module = attr.value;
}
});
}
}
});
if (appElement) {
bootstrap(appElement, module ? [module] : []);
}
}
/**
* @ngdoc function
* @name angular.bootstrap
* @description
* Use this function to manually start up angular application.
*
* See: {@link guide/dev_guide.bootstrap.manual_bootstrap Bootstrap}
*
* @param {Element} element DOM element which is the root of angular application.
* @param {Array<String,function>=} modules an array of module declarations. See: {@link angular.module modules}
* @param {angular.module.auta.$injector} the injector;
*/
function bootstrap(element, modules) {
element = jqLite(element);
modules = modules || [];
modules.unshift('ng');
var injector = createInjector(modules);
injector.invoke(
['$rootScope', '$compile', '$injector', function(scope, compile, injector){
scope.$apply(function() {
element.data('$injector', injector);
compile(element)(scope);
});
}]
);
return injector;
}
function bindJQuery() {
// bind to jQuery if present;
jQuery = window.jQuery;
// reset to jQuery or default to us.
if (jQuery) {
jqLite = jQuery;
extend(jQuery.fn, {
scope: JQLitePrototype.scope,
injector: JQLitePrototype.injector,
inheritedData: JQLitePrototype.inheritedData
});
JQLitePatchJQueryRemove('remove', true);
JQLitePatchJQueryRemove('empty');
JQLitePatchJQueryRemove('html');
} else {
jqLite = jqLiteWrap;
}
angular.element = jqLite;
}
/**
* throw error of the argument is falsy.
*/
function assertArg(arg, name, reason) {
if (!arg) {
var error = new Error("Argument '" + (name||'?') + "' is " +
(reason || "required"));
throw error;
}
return arg;
}
function assertArgFn(arg, name) {
assertArg(isFunction(arg), name, 'not a function, got ' +
(typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg));
return arg;
}
'use strict';
/**
* @ngdoc interface
* @name angular.Module
* @description
*
* Interface for configuring angular {@link angular.module modules}.
*/
function setupModuleLoader(window) {
function ensure(obj, name, factory) {
return obj[name] || (obj[name] = factory());
}
return ensure(ensure(window, 'angular', Object), 'module', function() {
/** @type {Object.<string, angular.Module>} */
var modules = {};
/**
* @ngdoc function
* @name angular.module
* @description
*
* The `angular.module` is a global place for creating and registering Angular modules. All
* modules (angular core or 3rd party) that should be available to an application must be
* registered using this mechanism.
*
*
* # Module
*
* A module is a collocation of services, directives, filters, and configure information. Module
* is used to configure the {@link angular.module.AUTO.$injector $injector}.
*
* <pre>
* // Create a new module
* var myModule = angular.module('myModule', []);
*
* // register a new service
* myModule.value('appName', 'MyCoolApp');
*
* // configure existing services inside initialization blocks.
* myModule.config(function($locationProvider) {
* // Configure existing providers
* $locationProvider.hashPrefix('!');
* });
* </pre>
*
* Then you can create an injector and load your modules like this:
*
* <pre>
* var injector = angular.injector(['ng', 'MyModule'])
* </pre>
*
* However it's more likely that you'll just use {@link angular.directive.ng:app ng:app} or
* {@link angular.bootstrap} to simplify this process for you.
*
* @param {!string} name The name of the module to create or retrieve.
* @param {Array.<string>=} requires If specified then new module is being created. If unspecified then the
* the module is being retrieved for further configuration.
* @param {Function} configFn Option configuration function for the module. Same as
* {@link angular.Module#config Module#config()}.
* @returns {module} new module with the {@link angular.Module} api.
*/
return function module(name, requires, configFn) {
if (requires && modules.hasOwnProperty(name)) {
modules[name] = null;
}
return ensure(modules, name, function() {
if (!requires) {
throw Error('No module: ' + name);
}
/** @type {!Array.<Array.<*>>} */
var invokeQueue = [];
/** @type {!Array.<Function>} */
var runBlocks = [];
var config = invokeLater('$injector', 'invoke');
/** @type {angular.Module} */
var moduleInstance = {
// Private state
_invokeQueue: invokeQueue,
_runBlocks: runBlocks,
/**
* @ngdoc property
* @name angular.Module#requires
* @propertyOf angular.Module
* @returns {Array.<string>} List of module names which must be loaded before this module.
* @description
* Holds the list of modules which the injector will load before the current module is loaded.
*/
requires: requires,
/**
* @ngdoc property
* @name angular.Module#name
* @propertyOf angular.Module
* @returns {string} Name of the module.
* @description
*/
name: name,
/**
* @ngdoc method
* @name angular.Module#service
* @methodOf angular.Module
* @param {string} name service name
* @param {Function} providerType Construction function for creating new instance of the service.
* @description
* See {@link angular.module.AUTO.$provide#service $provide.service()}.
*/
service: invokeLater('$provide', 'service'),
/**
* @ngdoc method
* @name angular.Module#factory
* @methodOf angular.Module
* @param {string} name service name
* @param {Function} providerFunction Function for creating new instance of the service.
* @description
* See {@link angular.module.AUTO.$provide#service $provide.factory()}.
*/
factory: invokeLater('$provide', 'factory'),
/**
* @ngdoc method
* @name angular.Module#value
* @methodOf angular.Module
* @param {string} name service name
* @param {*} object Service instance object.
* @description
* See {@link angular.module.AUTO.$provide#value $provide.value()}.
*/
value: invokeLater('$provide', 'value'),
/**
* @ngdoc method
* @name angular.Module#filter
* @methodOf angular.Module
* @param {string} name filterr name
* @param {Function} filterFactory Factory function for creating new instance of filter.
* @description
* See {@link angular.module.ng.$filterProvider#register $filterProvider.register()}.
*/
filter: invokeLater('$filterProvider', 'register'),
/**
* @ngdoc method
* @name angular.Module#config
* @methodOf angular.Module
* @param {Function} configFn Execute this function on module load. Useful for service
* configuration.
* @description
* Use this method to register work which needs to be performed on module loading.
*/
config: config,
/**
* @ngdoc method
* @name angular.Module#run
* @methodOf angular.Module
* @param {Function} initializationFn Execute this function after injector creation.
* Useful for application initialization.
* @description
* Use this method to register work which needs to be performed when the injector with
* with the current module is finished loading.
*/
run: function(block) {
runBlocks.push(block);
return this;
}
};
if (configFn) {
config(configFn);
}
return moduleInstance;
/**
* @param {string} provider
* @param {string} method
* @returns {angular.Module}
*/
function invokeLater(provider, method) {
return function() {
invokeQueue.push([provider, method, arguments]);
return moduleInstance;
}
}
});
};
});
}
'use strict';
/**
* @ngdoc property
* @name angular.version
* @description
* An object that contains information about the current AngularJS version. This object has the
* following properties:
*
* - `full` – `{string}` – Full version string, such as "0.9.18".
* - `major` – `{number}` – Major version number, such as "0".
* - `minor` – `{number}` – Minor version number, such as "9".
* - `dot` – `{number}` – Dot version number, such as "18".
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
*/
var version = {
full: '0.10.6', // all of these placeholder strings will be replaced by rake's
major: "NG_VERSION_MAJOR", // compile task
minor: "NG_VERSION_MINOR",
dot: "NG_VERSION_DOT",
codeName: '"NG_VERSION_CODENAME"'
};
function publishExternalAPI(angular){
extend(angular, {
'bootstrap': bootstrap,
'copy': copy,
'extend': extend,
'equals': equals,
'element': jqLite,
'forEach': forEach,
'injector': createInjector,
'noop':noop,
'bind':bind,
'toJson': toJson,
'fromJson': fromJson,
'identity':identity,
'isUndefined': isUndefined,
'isDefined': isDefined,
'isString': isString,
'isFunction': isFunction,
'isObject': isObject,
'isNumber': isNumber,
'isElement': isElement,
'isArray': isArray,
'version': version,
'isDate': isDate,
'lowercase': lowercase,
'uppercase': uppercase,
'callbacks': {counter: 0}
});
angularModule = setupModuleLoader(window);
try {
angularModule('ngLocale');
} catch (e) {
angularModule('ngLocale', []).service('$locale', $LocaleProvider);
}
angularModule('ng', ['ngLocale'], ['$provide',
function ngModule($provide) {
// TODO(misko): temporary services to get the compiler working;
$provide.value('$textMarkup', angularTextMarkup);
$provide.value('$attrMarkup', angularAttrMarkup);
$provide.value('$directive', angularDirective);
$provide.value('$widget', angularWidget);
$provide.service('$anchorScroll', $AnchorScrollProvider);
$provide.service('$browser', $BrowserProvider);
$provide.service('$cacheFactory', $CacheFactoryProvider);
$provide.service('$compile', $CompileProvider);
$provide.service('$cookies', $CookiesProvider);
$provide.service('$cookieStore', $CookieStoreProvider);
$provide.service('$defer', $DeferProvider);
$provide.service('$document', $DocumentProvider);
$provide.service('$exceptionHandler', $ExceptionHandlerProvider);
$provide.service('$filter', $FilterProvider);
$provide.service('$interpolate', $InterpolateProvider);
$provide.service('$formFactory', $FormFactoryProvider);
$provide.service('$http', $HttpProvider);
$provide.service('$httpBackend', $HttpBackendProvider);
$provide.service('$location', $LocationProvider);
$provide.service('$log', $LogProvider);
$provide.service('$parse', $ParseProvider);
$provide.service('$resource', $ResourceProvider);
$provide.service('$route', $RouteProvider);
$provide.service('$routeParams', $RouteParamsProvider);
$provide.service('$rootScope', $RootScopeProvider);
$provide.service('$q', $QProvider);
$provide.service('$sniffer', $SnifferProvider);
$provide.service('$templateCache', $TemplateCacheProvider);
$provide.service('$window', $WindowProvider);
}]);
}
'use strict';
var array = [].constructor;
/**
* @ngdoc function
* @name angular.toJson
* @function
*
* @description
* Serializes input into a JSON-formatted string.
*
* @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.
* @param {boolean=} pretty If set to true, the JSON output will contain newlines and whitespace.
* @returns {string} Jsonified string representing `obj`.
*/
function toJson(obj, pretty) {
var buf = [];
toJsonArray(buf, obj, pretty ? "\n " : null, []);
return buf.join('');
}
/**
* @ngdoc function
* @name angular.fromJson
* @function
*
* @description
* Deserializes a JSON string.
*
* @param {string} json JSON string to deserialize.
* @param {boolean} [useNative=false] Use native JSON parser, if available.
* @returns {Object|Array|Date|string|number} Deserialized thingy.
*/
function fromJson(json, useNative) {
if (!isString(json)) return json;
var obj;
try {
if (useNative && window.JSON && window.JSON.parse) {
obj = JSON.parse(json);
} else {
obj = parseJson(json, true)();
}
return transformDates(obj);
} catch (e) {
error("fromJson error: ", json, e);
throw e;
}
// TODO make forEach optionally recursive and remove this function
// TODO(misko): remove this once the $http service is checked in.
function transformDates(obj) {
if (isString(obj) && obj.length === DATE_ISOSTRING_LN) {
return jsonStringToDate(obj);
} else if (isArray(obj) || isObject(obj)) {
forEach(obj, function(val, name) {
obj[name] = transformDates(val);
});
}
return obj;
}
}
var R_ISO8061_STR = /^(\d{4})-(\d\d)-(\d\d)(?:T(\d\d)(?:\:(\d\d)(?:\:(\d\d)(?:\.(\d{3}))?)?)?Z)?$/;
function jsonStringToDate(string){
var match;
if (isString(string) && (match = string.match(R_ISO8061_STR))){
var date = new Date(0);
date.setUTCFullYear(match[1], match[2] - 1, match[3]);
date.setUTCHours(match[4]||0, match[5]||0, match[6]||0, match[7]||0);
return date;
}
return string;
}
function jsonDateToString(date){
if (!date) return date;
var isoString = date.toISOString ? date.toISOString() : '';
return (isoString.length==24)
? isoString
: padNumber(date.getUTCFullYear(), 4) + '-' +
padNumber(date.getUTCMonth() + 1, 2) + '-' +
padNumber(date.getUTCDate(), 2) + 'T' +
padNumber(date.getUTCHours(), 2) + ':' +
padNumber(date.getUTCMinutes(), 2) + ':' +
padNumber(date.getUTCSeconds(), 2) + '.' +
padNumber(date.getUTCMilliseconds(), 3) + 'Z';
}
function quoteUnicode(string) {
var chars = ['"'];
for ( var i = 0; i < string.length; i++) {
var code = string.charCodeAt(i);
var ch = string.charAt(i);
switch(ch) {
case '"': chars.push('\\"'); break;
case '\\': chars.push('\\\\'); break;
case '\n': chars.push('\\n'); break;
case '\f': chars.push('\\f'); break;
case '\r': chars.push(ch = '\\r'); break;
case '\t': chars.push(ch = '\\t'); break;
default:
if (32 <= code && code <= 126) {
chars.push(ch);
} else {
var encode = "000" + code.toString(16);
chars.push("\\u" + encode.substring(encode.length - 4));
}
}
}
chars.push('"');
return chars.join('');
}
function toJsonArray(buf, obj, pretty, stack) {
if (isObject(obj)) {
if (obj === window) {
buf.push('WINDOW');
return;
}
if (obj === document) {
buf.push('DOCUMENT');
return;
}
if (includes(stack, obj)) {
buf.push('RECURSION');
return;
}
stack.push(obj);
}
if (obj === null) {
buf.push('null');
} else if (obj instanceof RegExp) {
buf.push(quoteUnicode(obj.toString()));
} else if (isFunction(obj)) {
return;
} else if (isBoolean(obj)) {
buf.push('' + obj);
} else if (isNumber(obj)) {
if (isNaN(obj)) {
buf.push('null');
} else {
buf.push('' + obj);
}
} else if (isString(obj)) {
return buf.push(quoteUnicode(obj));
} else if (isObject(obj)) {
if (isArray(obj)) {
buf.push("[");
var len = obj.length;
var sep = false;
for(var i=0; i<len; i++) {
var item = obj[i];
if (sep) buf.push(",");
if (!(item instanceof RegExp) && (isFunction(item) || isUndefined(item))) {
buf.push('null');
} else {
toJsonArray(buf, item, pretty, stack);
}
sep = true;
}
buf.push("]");
} else if (isElement(obj)) {
// TODO(misko): maybe in dev mode have a better error reporting?
buf.push('DOM_ELEMENT');
} else if (isDate(obj)) {
buf.push(quoteUnicode(jsonDateToString(obj)));
} else {
buf.push("{");
if (pretty) buf.push(pretty);
var comma = false;
var childPretty = pretty ? pretty + " " : false;
var keys = [];
for(var k in obj) {
if (k!='this' && k!='$parent' && k.substring(0,2) != '$$' && obj.hasOwnProperty(k) && obj[k] !== undefined) {
keys.push(k);
}
}
keys.sort();
for ( var keyIndex = 0; keyIndex < keys.length; keyIndex++) {
var key = keys[keyIndex];
var value = obj[key];
if (!isFunction(value)) {
if (comma) {
buf.push(",");
if (pretty) buf.push(pretty);
}
buf.push(quoteUnicode(key));
buf.push(":");
toJsonArray(buf, value, childPretty, stack);
comma = true;
}
}
buf.push("}");
}
}
if (isObject(obj)) {
stack.pop();
}
}
'use strict';
/**
* @ngdoc function
* @name angular.injector
* @function
*
* @description
* Creates an injector function that can be used for retrieving services as well as for
* dependency injection (see {@link guide/dev_guide.di dependency injection}).
*
* @param {Array.<string|Function>} modules A list of module functions or their aliases. See
* {@link angular.module}. The `ng` module must be explicitly added.
* @returns {function()} Injector function. See {@link angular.module.AUTO.$injector $injector}.
*
* @example
* Typical usage
* <pre>
* // create an injector
* var $injector = angular.injector(['ng']);
*
* // use the injector to kick of your application
* // use the type inference to auto inject arguments, or use implicit injection
* $injector.invoke(function($rootScope, $compile, $document){
* $compile($document)($rootScope);
* $rootScope.$digest();
* });
* </pre>
*/
/**
* @ngdoc overview
* @name angular.module.AUTO
* @description
*
* Implicit module which gets automatically added to each {@link angular.module.AUTO.$injector $injector}.
*/
var FN_ARGS = /^function\s*[^\(]*\(([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /^\s*(.+?)\s*$/;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
function inferInjectionArgs(fn) {
assertArgFn(fn);
if (!fn.$inject) {
var args = fn.$inject = [];
var fnText = fn.toString().replace(STRIP_COMMENTS, '');
var argDecl = fnText.match(FN_ARGS);
forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg){
arg.replace(FN_ARG, function(all, name){
args.push(name);
});
});
}
return fn.$inject;
}
///////////////////////////////////////
/**
* @ngdoc object
* @name angular.module.AUTO.$injector
* @function
*
* @description
*
* `$injector` is used to retrieve object instances as defined by
* {@link angular.module.AUTO.$provide provider}, instantiate types, invoke methods,
* and load modules.
*
* The following always holds true:
*
* <pre>
* var $injector = angular.injector();
* expect($injector.get('$injector')).toBe($injector);
* expect($injector.invoke(function($injector){
* return $injector;
* }).toBe($injector);
* </pre>
*
* # Injection Function Annotation
*
* JavaScript does not have annotations, and annotations are needed for dependency injection. The
* following ways are all valid way of annotating function with injection arguments and are equivalent.
*
* <pre>
* // inferred (only works if code not minified/obfuscated)
* $inject.invoke(function(serviceA){});
*
* // annotated
* function explicit(serviceA) {};
* explicit.$inject = ['serviceA'];
* $inject.invoke(explicit);
*
* // inline
* $inject.invoke(['serviceA', function(serviceA){}]);
* </pre>
*
* ## Inference
*
* In JavaScript calling `toString()` on a function returns the function definition. The definition can then be
* parsed and the function arguments can be extracted. *NOTE:* This does not work with minfication, and obfuscation
* tools since these tools change the argument names.
*
* ## `$inject` Annotation
* By adding a `$inject` property onto a function the injection parameters can be specified.
*
* ## Inline
* As an array of injection names, where the last item in the array is the function to call.
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$injector#get
* @methodOf angular.module.AUTO.$injector
*
* @description
* Return an instance of the service.
*
* @param {string} name The name of the instance to retrieve.
* @return {*} The instance.
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$injector#invoke
* @methodOf angular.module.AUTO.$injector
*
* @description
* Invoke the method and supply the method arguments from the `$injector`.
*
* @param {!function} fn The function to invoke. The function arguments come form the function annotation.
* @param {Object=} self The `this` for the invoked method.
* @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before
* the `$injector` is consulted.
* @return the value returned by the invoked `fn` function.
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$injector#instantiate
* @methodOf angular.module.AUTO.$injector
* @description
* Create a new instance of JS type. The method takes a constructor function invokes the new operator and supplies
* all of the arguments to the constructor function as specified by the constructor annotation.
*
* @param {function} Type Annotated constructor function.
* @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before
* the `$injector` is consulted.
* @return new instance of `Type`.
*/
/**
* @ngdoc object
* @name angular.module.AUTO.$provide
*
* @description
*
* Use `$provide` to register new providers with the `$injector`. The providers are the factories for the instance.
* The providers share the same name as the instance they create with the `Provide` suffixed to them.
*
* A provider is an object with a `$get()` method. The injector calls the `$get` method to create a new instance of
* a service. The Provider can have additional methods which would allow for configuration of the provider.
*
* <pre>
* function GreetProvider() {
* var salutation = 'Hello';
*
* this.salutation = function(text) {
* salutation = text;
* };
*
* this.$get = function() {
* return function (name) {
* return salutation + ' ' + name + '!';
* };
* };
* }
*
* describe('Greeter', function(){
*
* beforeEach(module(function($provide) {
* $provide.service('greet', GreetProvider);
* });
*
* it('should greet', inject(function(greet) {
* expect(greet('angular')).toEqual('Hello angular!');
* }));
*
* it('should allow configuration of salutation', function() {
* module(function(greetProvider) {
* greetProvider.salutation('Ahoj');
* });
* inject(function(greet) {
* expect(greet('angular')).toEqual('Ahoj angular!');
* });
* )};
*
* });
* </pre>
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#service
* @methodOf angular.module.AUTO.$provide
* @description
*
* Register a provider for a service. The providers can be retrieved and can have additional configuration methods.
*
* @param {string} name The name of the instance. NOTE: the provider will be available under `name + 'Provide'` key.
* @param {(Object|function())} provider If the provider is:
*
* - `Object`: then it should have a `$get` method. The `$get` method will be invoked using
* {@link angular.module.AUTO.$injector#invoke $injector.invoke()} when an instance needs to be created.
* - `Constructor`: a new instance of the provider will be created using
* {@link angular.module.AUTO.$injector#instantiate $injector.instantiate()}, then treated as `object`.
*
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#factory
* @methodOf angular.module.AUTO.$provide
* @description
*
* A short hand for configuring services if only `$get` method is required.
*
* @param {string} name The name of the instance. NOTE: the provider will be available under `name + 'Provide'` key.
* @param {function()} $getFn The $getFn for the instance creation. Internally this is a short hand for
* `$provide.service(name, {$get:$getFn})`.
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#value
* @methodOf angular.module.AUTO.$provide
* @description
*
* A short hand for configuring services if the `$get` method is a constant.
*
* @param {string} name The name of the instance. NOTE: the provider will be available under `name + 'Provide'` key.
* @param {function()} value The $getFn for the instance creation. Internally this is a short hand for
* `$provide.service(name, {$get:function(){ return value; }})`.
*/
function createInjector(modulesToLoad) {
var providerSuffix = 'Provider',
path = [],
loadedModules = new HashMap(),
providerCache = {
$provide: {
service: supportObject(service),
factory: supportObject(factory),
value: supportObject(value),
decorator: decorator
}
},
providerInjector = createInternalInjector(providerCache, function() {
throw Error("Unknown provider: " + path.join(' <- '));
}),
instanceCache = {},
instanceInjector = (instanceCache.$injector =
createInternalInjector(instanceCache, function(servicename) {
var provider = providerInjector.get(servicename + providerSuffix);
return instanceInjector.invoke(provider.$get, provider);
}));
forEach(loadModules(modulesToLoad), function(fn) { instanceInjector.invoke(fn || noop); });
return instanceInjector;
////////////////////////////////////
// $provider
////////////////////////////////////
function supportObject(delegate) {
return function(key, value) {
if (isObject(key)) {
forEach(key, reverseParams(delegate));
} else {
delegate(key, value);
}
}
}
function service(name, provider) {
if (isFunction(provider)){
provider = providerInjector.instantiate(provider);
}
if (!provider.$get) {
throw Error('Provider ' + name + ' must define $get factory method.');
}
providerCache[name + providerSuffix] = provider;
}
function factory(name, factoryFn) { service(name, { $get:factoryFn }); }
function value(name, value) { factory(name, valueFn(value)); }
function decorator(serviceName, decorFn) {
var origProvider = providerInjector.get(serviceName + providerSuffix),
orig$get = origProvider.$get;
origProvider.$get = function() {
var origInstance = instanceInjector.invoke(orig$get, origProvider);
return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});
};
}
////////////////////////////////////
// Module Loading
////////////////////////////////////
function loadModules(modulesToLoad){
var runBlocks = [];
forEach(modulesToLoad, function(module) {
if (loadedModules.get(module)) return;
loadedModules.put(module, true);
if (isString(module)) {
var moduleFn = angularModule(module);
runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);
try {
for(var invokeQueue = moduleFn._invokeQueue, i = 0, ii = invokeQueue.length; i < ii; i++) {
var invokeArgs = invokeQueue[i],
provider = invokeArgs[0] == '$injector'
? providerInjector
: providerInjector.get(invokeArgs[0]);
provider[invokeArgs[1]].apply(provider, invokeArgs[2]);
}
} catch (e) {
if (e.message) e.message += ' from ' + module;
throw e;
}
} else if (isFunction(module)) {
try {
runBlocks.push(providerInjector.invoke(module));
} catch (e) {
if (e.message) e.message += ' from ' + module;
throw e;
}
} else if (isArray(module)) {
try {
runBlocks.push(providerInjector.invoke(module));
} catch (e) {
if (e.message) e.message += ' from ' + String(module[module.length - 1]);
throw e;
}
} else {
assertArgFn(module, 'module');
}
});
return runBlocks;
}
////////////////////////////////////
// internal Injector
////////////////////////////////////
function createInternalInjector(cache, factory) {
function getService(serviceName) {
if (typeof serviceName !== 'string') {
throw Error('Service name expected');
}
if (cache.hasOwnProperty(serviceName)) {
return cache[serviceName];
} else {
try {
path.unshift(serviceName);
return cache[serviceName] = factory(serviceName);
} finally {
path.shift();
}
}
}
function invoke(fn, self, locals){
var args = [],
$injectAnnotation,
$injectAnnotationIndex,
key;
if (typeof fn == 'function') {
$injectAnnotation = inferInjectionArgs(fn);
$injectAnnotationIndex = $injectAnnotation.length;
} else {
if (isArray(fn)) {
$injectAnnotation = fn;
$injectAnnotationIndex = $injectAnnotation.length;
fn = $injectAnnotation[--$injectAnnotationIndex];
}
assertArgFn(fn, 'fn');
}
while($injectAnnotationIndex--) {
key = $injectAnnotation[$injectAnnotationIndex];
args.unshift(locals && locals.hasOwnProperty(key) ? locals[key] : getService(key));
}
// Performance optimization: http://jsperf.com/apply-vs-call-vs-invoke
switch (self ? -1 : args.length) {
case 0: return fn();
case 1: return fn(args[0]);
case 2: return fn(args[0], args[1]);
case 3: return fn(args[0], args[1], args[2]);
case 4: return fn(args[0], args[1], args[2], args[3]);
case 5: return fn(args[0], args[1], args[2], args[3], args[4]);
case 6: return fn(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
case 8: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
case 9: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
case 10: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
default: return fn.apply(self, args);
}
}
function instantiate(Type, locals){
var Constructor = function(){},
instance;
Constructor.prototype = Type.prototype;
instance = new Constructor();
return invoke(Type, instance, locals) || instance;
}
return {
invoke: invoke,
instantiate: instantiate,
get: getService
};
}
}
'use strict';
function Route(template, defaults) {
this.template = template = template + '#';
this.defaults = defaults || {};
var urlParams = this.urlParams = {};
forEach(template.split(/\W/), function(param){
if (param && template.match(new RegExp(":" + param + "\\W"))) {
urlParams[param] = true;
}
});
}
Route.prototype = {
url: function(params) {
var self = this,
url = this.template,
encodedVal;
params = params || {};
forEach(this.urlParams, function(_, urlParam){
encodedVal = encodeUriSegment(params[urlParam] || self.defaults[urlParam] || "");
url = url.replace(new RegExp(":" + urlParam + "(\\W)"), encodedVal + "$1");
});
url = url.replace(/\/?#$/, '');
var query = [];
forEachSorted(params, function(value, key){
if (!self.urlParams[key]) {
query.push(encodeUriQuery(key) + '=' + encodeUriQuery(value));
}
});
url = url.replace(/\/*$/, '');
return url + (query.length ? '?' + query.join('&') : '');
}
};
function ResourceFactory($http) {
this.$http = $http;
}
ResourceFactory.DEFAULT_ACTIONS = {
'get': {method:'GET'},
'save': {method:'POST'},
'query': {method:'GET', isArray:true},
'remove': {method:'DELETE'},
'delete': {method:'DELETE'}
};
ResourceFactory.prototype = {
route: function(url, paramDefaults, actions){
var self = this;
var route = new Route(url);
actions = extend({}, ResourceFactory.DEFAULT_ACTIONS, actions);
function extractParams(data){
var ids = {};
forEach(paramDefaults || {}, function(value, key){
ids[key] = value.charAt && value.charAt(0) == '@' ? getter(data, value.substr(1)) : value;
});
return ids;
}
function Resource(value){
copy(value || {}, this);
}
forEach(actions, function(action, name){
var isPostOrPut = action.method == 'POST' || action.method == 'PUT';
Resource[name] = function(a1, a2, a3, a4) {
var params = {};
var data;
var success = noop;
var error = null;
switch(arguments.length) {
case 4:
error = a4;
success = a3;
//fallthrough
case 3:
case 2:
if (isFunction(a2)) {
if (isFunction(a1)) {
success = a1;
error = a2;
break;
}
success = a2;
error = a3;
//fallthrough
} else {
params = a1;
data = a2;
success = a3;
break;
}
case 1:
if (isFunction(a1)) success = a1;
else if (isPostOrPut) data = a1;
else params = a1;
break;
case 0: break;
default:
throw "Expected between 0-4 arguments [params, data, success, error], got " +
arguments.length + " arguments.";
}
var value = this instanceof Resource ? this : (action.isArray ? [] : new Resource(data));
self.$http({
method: action.method,
url: route.url(extend({}, extractParams(data), action.params || {}, params)),
data: data
}).then(function(response) {
var data = response.data;
if (data) {
if (action.isArray) {
value.length = 0;
forEach(data, function(item) {
value.push(new Resource(item));
});
} else {
copy(data, value);
}
}
(success||noop)(value, response.headers);
}, error);
return value;
};
Resource.bind = function(additionalParamDefaults){
return self.route(url, extend({}, paramDefaults, additionalParamDefaults), actions);
};
Resource.prototype['$' + name] = function(a1, a2, a3) {
var params = extractParams(this),
success = noop,
error;
switch(arguments.length) {
case 3: params = a1; success = a2; error = a3; break;
case 2:
case 1:
if (isFunction(a1)) {
success = a1;
error = a2;
} else {
params = a1;
success = a2 || noop;
}
case 0: break;
default:
throw "Expected between 1-3 arguments [params, success, error], got " +
arguments.length + " arguments.";
}
var data = isPostOrPut ? this : undefined;
Resource[name].call(this, params, data, success, error);
};
});
return Resource;
}
};
'use strict';
/*
* HTML Parser By Misko Hevery ([email protected])
* based on: HTML Parser By John Resig (ejohn.org)
* Original code by Erik Arvidsson, Mozilla Public License
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
*
* // Use like so:
* htmlParser(htmlString, {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* });
*
*/
// Regular Expressions for parsing tags and attributes
var START_TAG_REGEXP = /^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,
END_TAG_REGEXP = /^<\s*\/\s*([\w:-]+)[^>]*>/,
ATTR_REGEXP = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,
BEGIN_TAG_REGEXP = /^</,
BEGING_END_TAGE_REGEXP = /^<\s*\//,
COMMENT_REGEXP = /<!--(.*?)-->/g,
CDATA_REGEXP = /<!\[CDATA\[(.*?)]]>/g,
URI_REGEXP = /^((ftp|https?):\/\/|mailto:|#)/,
NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g; // Match everything outside of normal chars and " (quote character)
// Good source of info about elements and attributes
// http://dev.w3.org/html5/spec/Overview.html#semantics
// http://simon.html5.org/html-elements
// Safe Void Elements - HTML5
// http://dev.w3.org/html5/spec/Overview.html#void-elements
var voidElements = makeMap("area,br,col,hr,img,wbr");
// Elements that you can, intentionally, leave open (and which close themselves)
// http://dev.w3.org/html5/spec/Overview.html#optional-tags
var optionalEndTagBlockElements = makeMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),
optionalEndTagInlineElements = makeMap("rp,rt"),
optionalEndTagElements = extend({}, optionalEndTagInlineElements, optionalEndTagBlockElements);
// Safe Block Elements - HTML5
var blockElements = extend({}, optionalEndTagBlockElements, makeMap("address,article,aside," +
"blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6," +
"header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul"));
// Inline Elements - HTML5
var inlineElements = extend({}, optionalEndTagInlineElements, makeMap("a,abbr,acronym,b,bdi,bdo," +
"big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small," +
"span,strike,strong,sub,sup,time,tt,u,var"));
// Special Elements (can contain anything)
var specialElements = makeMap("script,style");
var validElements = extend({}, voidElements, blockElements, inlineElements, optionalEndTagElements);
//Attributes that have href and hence need to be sanitized
var uriAttrs = makeMap("background,cite,href,longdesc,src,usemap");
var validAttrs = extend({}, uriAttrs, makeMap(
'abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,'+
'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,'+
'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,'+
'scope,scrolling,shape,span,start,summary,target,title,type,'+
'valign,value,vspace,width'));
/**
* @example
* htmlParser(htmlString, {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* });
*
* @param {string} html string
* @param {object} handler
*/
function htmlParser( html, handler ) {
var index, chars, match, stack = [], last = html;
stack.last = function() { return stack[ stack.length - 1 ]; };
while ( html ) {
chars = true;
// Make sure we're not in a script or style element
if ( !stack.last() || !specialElements[ stack.last() ] ) {
// Comment
if ( html.indexOf("<!--") === 0 ) {
index = html.indexOf("-->");
if ( index >= 0 ) {
if (handler.comment) handler.comment( html.substring( 4, index ) );
html = html.substring( index + 3 );
chars = false;
}
// end tag
} else if ( BEGING_END_TAGE_REGEXP.test(html) ) {
match = html.match( END_TAG_REGEXP );
if ( match ) {
html = html.substring( match[0].length );
match[0].replace( END_TAG_REGEXP, parseEndTag );
chars = false;
}
// start tag
} else if ( BEGIN_TAG_REGEXP.test(html) ) {
match = html.match( START_TAG_REGEXP );
if ( match ) {
html = html.substring( match[0].length );
match[0].replace( START_TAG_REGEXP, parseStartTag );
chars = false;
}
}
if ( chars ) {
index = html.indexOf("<");
var text = index < 0 ? html : html.substring( 0, index );
html = index < 0 ? "" : html.substring( index );
if (handler.chars) handler.chars( decodeEntities(text) );
}
} else {
html = html.replace(new RegExp("(.*)<\\s*\\/\\s*" + stack.last() + "[^>]*>", 'i'), function(all, text){
text = text.
replace(COMMENT_REGEXP, "$1").
replace(CDATA_REGEXP, "$1");
if (handler.chars) handler.chars( decodeEntities(text) );
return "";
});
parseEndTag( "", stack.last() );
}
if ( html == last ) {
throw "Parse Error: " + html;
}
last = html;
}
// Clean up any remaining tags
parseEndTag();
function parseStartTag( tag, tagName, rest, unary ) {
tagName = lowercase(tagName);
if ( blockElements[ tagName ] ) {
while ( stack.last() && inlineElements[ stack.last() ] ) {
parseEndTag( "", stack.last() );
}
}
if ( optionalEndTagElements[ tagName ] && stack.last() == tagName ) {
parseEndTag( "", tagName );
}
unary = voidElements[ tagName ] || !!unary;
if ( !unary )
stack.push( tagName );
var attrs = {};
rest.replace(ATTR_REGEXP, function(match, name, doubleQuotedValue, singleQoutedValue, unqoutedValue) {
var value = doubleQuotedValue
|| singleQoutedValue
|| unqoutedValue
|| '';
attrs[name] = decodeEntities(value);
});
if (handler.start) handler.start( tagName, attrs, unary );
}
function parseEndTag( tag, tagName ) {
var pos = 0, i;
tagName = lowercase(tagName);
if ( tagName )
// Find the closest opened tag of the same type
for ( pos = stack.length - 1; pos >= 0; pos-- )
if ( stack[ pos ] == tagName )
break;
if ( pos >= 0 ) {
// Close all the open elements, up the stack
for ( i = stack.length - 1; i >= pos; i-- )
if (handler.end) handler.end( stack[ i ] );
// Remove the open elements from the stack
stack.length = pos;
}
}
}
/**
* decodes all entities into regular string
* @param value
* @returns {string} A string with decoded entities.
*/
var hiddenPre=document.createElement("pre");
function decodeEntities(value) {
hiddenPre.innerHTML=value.replace(/</g,"<");
return hiddenPre.innerText || hiddenPre.textContent || '';
}
/**
* Escapes all potentially dangerous characters, so that the
* resulting string can be safely inserted into attribute or
* element text.
* @param value
* @returns escaped text
*/
function encodeEntities(value) {
return value.
replace(/&/g, '&').
replace(NON_ALPHANUMERIC_REGEXP, function(value){
return '&#' + value.charCodeAt(0) + ';';
}).
replace(/</g, '<').
replace(/>/g, '>');
}
/**
* create an HTML/XML writer which writes to buffer
* @param {Array} buf use buf.jain('') to get out sanitized html string
* @returns {object} in the form of {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* }
*/
function htmlSanitizeWriter(buf){
var ignore = false;
var out = bind(buf, buf.push);
return {
start: function(tag, attrs, unary){
tag = lowercase(tag);
if (!ignore && specialElements[tag]) {
ignore = tag;
}
if (!ignore && validElements[tag] == true) {
out('<');
out(tag);
forEach(attrs, function(value, key){
var lkey=lowercase(key);
if (validAttrs[lkey]==true && (uriAttrs[lkey]!==true || value.match(URI_REGEXP))) {
out(' ');
out(key);
out('="');
out(encodeEntities(value));
out('"');
}
});
out(unary ? '/>' : '>');
}
},
end: function(tag){
tag = lowercase(tag);
if (!ignore && validElements[tag] == true) {
out('</');
out(tag);
out('>');
}
if (tag == ignore) {
ignore = false;
}
},
chars: function(chars){
if (!ignore) {
out(encodeEntities(chars));
}
}
};
}
'use strict';
//////////////////////////////////
//JQLite
//////////////////////////////////
/**
* @ngdoc function
* @name angular.element
* @function
*
* @description
* Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.
* `angular.element` can be either an alias for [jQuery](http://api.jquery.com/jQuery/) function, if
* jQuery is available, or a function that wraps the element or string in Angular's jQuery lite
* implementation (commonly referred to as jqLite).
*
* Real jQuery always takes precedence over jqLite, provided it was loaded before `DOMContentLoaded`
* event fired.
*
* jqLite is a tiny, API-compatible subset of jQuery that allows
* Angular to manipulate the DOM. jqLite implements only the most commonly needed functionality
* within a very small footprint, so only a subset of the jQuery API - methods, arguments and
* invocation styles - are supported.
*
* Note: All element references in Angular are always wrapped with jQuery or jqLite; they are never
* raw DOM references.
*
* ## Angular's jQuery lite provides the following methods:
*
* - [addClass()](http://api.jquery.com/addClass/)
* - [after()](http://api.jquery.com/after/)
* - [append()](http://api.jquery.com/append/)
* - [attr()](http://api.jquery.com/attr/)
* - [bind()](http://api.jquery.com/bind/)
* - [children()](http://api.jquery.com/children/)
* - [clone()](http://api.jquery.com/clone/)
* - [css()](http://api.jquery.com/css/)
* - [data()](http://api.jquery.com/data/)
* - [eq()](http://api.jquery.com/eq/)
* - [find()](http://api.jquery.com/find/) - Limited to lookups by tag name.
* - [hasClass()](http://api.jquery.com/hasClass/)
* - [html()](http://api.jquery.com/html/)
* - [next()](http://api.jquery.com/next/)
* - [parent()](http://api.jquery.com/parent/)
* - [prepend()](http://api.jquery.com/prepend/)
* - [prop()](http://api.jquery.com/prop/)
* - [ready()](http://api.jquery.com/ready/)
* - [remove()](http://api.jquery.com/remove/)
* - [removeAttr()](http://api.jquery.com/removeAttr/)
* - [removeClass()](http://api.jquery.com/removeClass/)
* - [removeData()](http://api.jquery.com/removeData/)
* - [replaceWith()](http://api.jquery.com/replaceWith/)
* - [text()](http://api.jquery.com/text/)
* - [toggleClass()](http://api.jquery.com/toggleClass/)
* - [unbind()](http://api.jquery.com/unbind/)
* - [val()](http://api.jquery.com/val/)
*
* ## In addtion to the above, Angular privides an additional method to both jQuery and jQuery lite:
*
* - `scope()` - retrieves the current Angular scope of the element.
* - `injector()` - retrieves the Angular injector associated with application that the element is
* part of.
* - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top
* parent element is reached.
*
* @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.
* @returns {Object} jQuery object.
*/
var jqCache = {},
jqName = 'ng-' + new Date().getTime(),
jqId = 1,
addEventListenerFn = (window.document.addEventListener
? function(element, type, fn) {element.addEventListener(type, fn, false);}
: function(element, type, fn) {element.attachEvent('on' + type, fn);}),
removeEventListenerFn = (window.document.removeEventListener
? function(element, type, fn) {element.removeEventListener(type, fn, false); }
: function(element, type, fn) {element.detachEvent('on' + type, fn); });
function jqNextId() { return (jqId++); }
function getStyle(element) {
var current = {}, style = element[0].style, value, name, i;
if (typeof style.length == 'number') {
for(i = 0; i < style.length; i++) {
name = style[i];
current[name] = style[name];
}
} else {
for (name in style) {
value = style[name];
if (1*name != name && name != 'cssText' && value && typeof value == 'string' && value !='false')
current[name] = value;
}
}
return current;
}
/**
* Converts dash-separated names to camelCase. Useful for dealing with css properties.
*/
function camelCase(name) {
return name.replace(/\-(\w)/g, function(all, letter, offset){
return (offset == 0 && letter == 'w') ? 'w' : letter.toUpperCase();
});
}
/////////////////////////////////////////////
// jQuery mutation patch
//
// In conjunction with bindJQuery intercepts all jQuery's DOM destruction apis and fires a
// $destroy event on all DOM nodes being removed.
//
/////////////////////////////////////////////
function JQLitePatchJQueryRemove(name, dispatchThis) {
var originalJqFn = jQuery.fn[name];
originalJqFn = originalJqFn.$original || originalJqFn;
removePatch.$original = originalJqFn;
jQuery.fn[name] = removePatch;
function removePatch() {
var list = [this],
fireEvent = dispatchThis,
set, setIndex, setLength,
element, childIndex, childLength, children,
fns, data;
while(list.length) {
set = list.shift();
for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {
element = jqLite(set[setIndex]);
if (fireEvent) {
data = element.data('events');
if ( (fns = data && data.$destroy) ) {
forEach(fns, function(fn){
fn.handler();
});
}
} else {
fireEvent = !fireEvent;
}
for(childIndex = 0, childLength = (children = element.children()).length;
childIndex < childLength;
childIndex++) {
list.push(jQuery(children[childIndex]));
}
}
}
return originalJqFn.apply(this, arguments);
}
}
/////////////////////////////////////////////
function jqLiteWrap(element) {
if (isString(element) && element.charAt(0) != '<') {
throw new Error('selectors not implemented');
}
return new JQLite(element);
}
function JQLite(element) {
if (element instanceof JQLite) {
return element;
} else if (isString(element)) {
var div = document.createElement('div');
// Read about the NoScope elements here:
// http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx
div.innerHTML = '<div> </div>' + element; // IE insanity to make NoScope elements work!
div.removeChild(div.firstChild); // remove the superfluous div
JQLiteAddNodes(this, div.childNodes);
this.remove(); // detach the elements from the temporary DOM div.
} else {
JQLiteAddNodes(this, element);
}
}
function JQLiteClone(element) {
return element.cloneNode(true);
}
function JQLiteDealoc(element){
JQLiteRemoveData(element);
for ( var i = 0, children = element.childNodes || []; i < children.length; i++) {
JQLiteDealoc(children[i]);
}
}
function JQLiteRemoveData(element) {
var cacheId = element[jqName],
cache = jqCache[cacheId];
if (cache) {
if (cache.bind) {
forEach(cache.bind, function(fn, type){
if (type == '$destroy') {
fn({});
} else {
removeEventListenerFn(element, type, fn);
}
});
}
delete jqCache[cacheId];
element[jqName] = undefined; // ie does not allow deletion of attributes on elements.
}
}
function JQLiteData(element, key, value) {
var cacheId = element[jqName],
cache = jqCache[cacheId || -1];
if (isDefined(value)) {
if (!cache) {
element[jqName] = cacheId = jqNextId();
cache = jqCache[cacheId] = {};
}
cache[key] = value;
} else {
return cache ? cache[key] : null;
}
}
function JQLiteHasClass(element, selector) {
return ((" " + element.className + " ").replace(/[\n\t]/g, " ").
indexOf( " " + selector + " " ) > -1);
}
function JQLiteRemoveClass(element, selector) {
if (selector) {
forEach(selector.split(' '), function(cssClass) {
element.className = trim(
(" " + element.className + " ")
.replace(/[\n\t]/g, " ")
.replace(" " + trim(cssClass) + " ", " ")
);
});
}
}
function JQLiteAddClass(element, selector) {
if (selector) {
forEach(selector.split(' '), function(cssClass) {
if (!JQLiteHasClass(element, cssClass)) {
element.className = trim(element.className + ' ' + trim(cssClass));
}
});
}
}
function JQLiteAddNodes(root, elements) {
if (elements) {
elements = (!elements.nodeName && isDefined(elements.length) && !isWindow(elements))
? elements
: [ elements ];
for(var i=0; i < elements.length; i++) {
root.push(elements[i]);
}
}
}
//////////////////////////////////////////
// Functions which are declared directly.
//////////////////////////////////////////
var JQLitePrototype = JQLite.prototype = {
ready: function(fn) {
var fired = false;
function trigger() {
if (fired) return;
fired = true;
fn();
}
this.bind('DOMContentLoaded', trigger); // works for modern browsers and IE9
// we can not use jqLite since we are not done loading and jQuery could be loaded later.
jqLiteWrap(window).bind('load', trigger); // fallback to window.onload for others
},
toString: function() {
var value = [];
forEach(this, function(e){ value.push('' + e);});
return '[' + value.join(', ') + ']';
},
eq: function(index) {
return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);
},
length: 0,
push: push,
sort: [].sort,
splice: [].splice
};
//////////////////////////////////////////
// Functions iterating getter/setters.
// these functions return self on setter and
// value on get.
//////////////////////////////////////////
var BOOLEAN_ATTR = {};
forEach('multiple,selected,checked,disabled,readOnly,required'.split(','), function(value) {
BOOLEAN_ATTR[lowercase(value)] = value;
});
forEach({
data: JQLiteData,
inheritedData: function(element, name, value) {
element = jqLite(element);
while (element.length) {
if (value = element.data(name)) return value;
element = element.parent();
}
},
scope: function(element) {
return jqLite(element).inheritedData($$scope);
},
injector: function(element) {
return jqLite(element).inheritedData('$injector');
},
removeAttr: function(element,name) {
element.removeAttribute(name);
},
hasClass: JQLiteHasClass,
css: function(element, name, value) {
name = camelCase(name);
if (isDefined(value)) {
element.style[name] = value;
} else {
var val;
if (msie <= 8) {
// this is some IE specific weirdness that jQuery 1.6.4 does not sure why
val = element.currentStyle && element.currentStyle[name];
if (val === '') val = 'auto';
}
val = val || element.style[name];
if (msie <= 8) {
// jquery weirdness :-/
val = (val === '') ? undefined : val;
}
return val;
}
},
attr: function(element, name, value){
var lowercasedName = lowercase(name);
if (BOOLEAN_ATTR[lowercasedName]) {
if (isDefined(value)) {
if (!!value) {
element[name] = true;
element.setAttribute(name, lowercasedName);
} else {
element[name] = false;
element.removeAttribute(lowercasedName);
}
} else {
return (element[name] ||
element.getAttribute(name) !== null &&
(msie < 9 ? element.getAttribute(name) !== '' : true))
? lowercasedName
: undefined;
}
} else if (isDefined(value)) {
element.setAttribute(name, value);
} else if (element.getAttribute) {
// the extra argument "2" is to get the right thing for a.href in IE, see jQuery code
// some elements (e.g. Document) don't have get attribute, so return undefined
var ret = element.getAttribute(name, 2);
// normalize non-existing attributes to undefined (as jQuery)
return ret === null ? undefined : ret;
}
},
prop: function(element, name, value) {
if (isDefined(value)) {
element[name] = value;
} else {
return element[name];
}
},
text: extend((msie < 9)
? function(element, value) {
// NodeType == 3 is text node
if (element.nodeType == 3) {
if (isUndefined(value))
return element.nodeValue;
element.nodeValue = value;
} else {
if (isUndefined(value))
return element.innerText;
element.innerText = value;
}
}
: function(element, value) {
if (isUndefined(value)) {
return element.textContent;
}
element.textContent = value;
}, {$dv:''}),
val: function(element, value) {
if (isUndefined(value)) {
return element.value;
}
element.value = value;
},
html: function(element, value) {
if (isUndefined(value)) {
return element.innerHTML;
}
for (var i = 0, childNodes = element.childNodes; i < childNodes.length; i++) {
JQLiteDealoc(childNodes[i]);
}
element.innerHTML = value;
}
}, function(fn, name){
/**
* Properties: writes return selection, reads return first value
*/
JQLite.prototype[name] = function(arg1, arg2) {
var i, key;
// JQLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it
// in a way that survives minification.
if (((fn.length == 2 && fn !== JQLiteHasClass) ? arg1 : arg2) === undefined) {
if (isObject(arg1)) {
// we are a write, but the object properties are the key/values
for(i=0; i < this.length; i++) {
for (key in arg1) {
fn(this[i], key, arg1[key]);
}
}
// return self for chaining
return this;
} else {
// we are a read, so read the first child.
if (this.length)
return fn(this[0], arg1, arg2);
}
} else {
// we are a write, so apply to all children
for(i=0; i < this.length; i++) {
fn(this[i], arg1, arg2);
}
// return self for chaining
return this;
}
return fn.$dv;
};
});
//////////////////////////////////////////
// Functions iterating traversal.
// These functions chain results into a single
// selector.
//////////////////////////////////////////
forEach({
removeData: JQLiteRemoveData,
dealoc: JQLiteDealoc,
bind: function(element, type, fn){
var bind = JQLiteData(element, 'bind');
if (!bind) JQLiteData(element, 'bind', bind = {});
forEach(type.split(' '), function(type){
var eventHandler = bind[type];
if (!eventHandler) {
bind[type] = eventHandler = function(event) {
if (!event.preventDefault) {
event.preventDefault = function() {
event.returnValue = false; //ie
};
}
if (!event.stopPropagation) {
event.stopPropagation = function() {
event.cancelBubble = true; //ie
};
}
if (!event.target) {
event.target = event.srcElement || document;
}
if (isUndefined(event.defaultPrevented)) {
var prevent = event.preventDefault;
event.preventDefault = function() {
event.defaultPrevented = true;
prevent.call(event);
};
event.defaultPrevented = false;
}
event.isDefaultPrevented = function() {
return event.defaultPrevented;
};
forEach(eventHandler.fns, function(fn){
fn.call(element, event);
});
};
eventHandler.fns = [];
addEventListenerFn(element, type, eventHandler);
}
eventHandler.fns.push(fn);
});
},
unbind: function(element, type, fn) {
var bind = JQLiteData(element, 'bind');
if (!bind) return; //no listeners registered
if (isUndefined(type)) {
forEach(bind, function(eventHandler, type) {
removeEventListenerFn(element, type, eventHandler);
delete bind[type];
});
} else {
if (isUndefined(fn)) {
removeEventListenerFn(element, type, bind[type]);
delete bind[type];
} else {
arrayRemove(bind[type].fns, fn);
}
}
},
replaceWith: function(element, replaceNode) {
var index, parent = element.parentNode;
JQLiteDealoc(element);
forEach(new JQLite(replaceNode), function(node){
if (index) {
parent.insertBefore(node, index.nextSibling);
} else {
parent.replaceChild(node, element);
}
index = node;
});
},
children: function(element) {
var children = [];
forEach(element.childNodes, function(element){
if (element.nodeName != '#text')
children.push(element);
});
return children;
},
append: function(element, node) {
forEach(new JQLite(node), function(child){
if (element.nodeType === 1)
element.appendChild(child);
});
},
prepend: function(element, node) {
if (element.nodeType === 1) {
var index = element.firstChild;
forEach(new JQLite(node), function(child){
if (index) {
element.insertBefore(child, index);
} else {
element.appendChild(child);
index = child;
}
});
}
},
remove: function(element) {
JQLiteDealoc(element);
var parent = element.parentNode;
if (parent) parent.removeChild(element);
},
after: function(element, newElement) {
var index = element, parent = element.parentNode;
forEach(new JQLite(newElement), function(node){
parent.insertBefore(node, index.nextSibling);
index = node;
});
},
addClass: JQLiteAddClass,
removeClass: JQLiteRemoveClass,
toggleClass: function(element, selector, condition) {
if (isUndefined(condition)) {
condition = !JQLiteHasClass(element, selector);
}
(condition ? JQLiteAddClass : JQLiteRemoveClass)(element, selector);
},
parent: function(element) {
var parent = element.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
next: function(element) {
return element.nextSibling;
},
find: function(element, selector) {
return element.getElementsByTagName(selector);
},
clone: JQLiteClone
}, function(fn, name){
/**
* chaining functions
*/
JQLite.prototype[name] = function(arg1, arg2) {
var value;
for(var i=0; i < this.length; i++) {
if (value == undefined) {
value = fn(this[i], arg1, arg2);
if (value !== undefined) {
// any function which returns a value needs to be wrapped
value = jqLite(value);
}
} else {
JQLiteAddNodes(value, fn(this[i], arg1, arg2));
}
}
return value == undefined ? this : value;
};
});
'use strict';
/**
* Computes a hash of an 'obj'.
* Hash of a:
* string is string
* number is number as string
* object is either result of calling $$hashKey function on the object or uniquely generated id,
* that is also assigned to the $$hashKey property of the object.
*
* @param obj
* @returns {string} hash string such that the same input will have the same hash string.
* The resulting string key is in 'type:hashKey' format.
*/
function hashKey(obj) {
var objType = typeof obj,
key;
if (objType == 'object' && obj !== null) {
if (typeof (key = obj.$$hashKey) == 'function') {
// must invoke on object to keep the right this
key = obj.$$hashKey();
} else if (key === undefined) {
key = obj.$$hashKey = nextUid();
}
} else {
key = obj;
}
return objType + ':' + key;
}
/**
* HashMap which can use objects as keys
*/
function HashMap(array){
forEach(array, this.put, this);
}
HashMap.prototype = {
/**
* Store key value pair
* @param key key to store can be any type
* @param value value to store can be any type
*/
put: function(key, value) {
this[hashKey(key)] = value;
},
/**
* @param key
* @returns the value for the key
*/
get: function(key) {
return this[hashKey(key)];
},
/**
* Remove the key/value pair
* @param key
*/
remove: function(key) {
var value = this[key = hashKey(key)];
delete this[key];
return value;
}
};
/**
* A map where multiple values can be added to the same key such that they form a queue.
* @returns {HashQueueMap}
*/
function HashQueueMap() {}
HashQueueMap.prototype = {
/**
* Same as array push, but using an array as the value for the hash
*/
push: function(key, value) {
var array = this[key = hashKey(key)];
if (!array) {
this[key] = [value];
} else {
array.push(value);
}
},
/**
* Same as array shift, but using an array as the value for the hash
*/
shift: function(key) {
var array = this[key = hashKey(key)];
if (array) {
if (array.length == 1) {
delete this[key];
return array[0];
} else {
return array.shift();
}
}
}
};
/**
* @ngdoc function
* @name angular.module.ng.$anchorScroll
* @requires $window
* @requires $location
* @requires $rootScope
*
* @description
* When called, it checks current value of `$location.hash()` and scroll to related element,
* according to rules specified in
* {@link http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document Html5 spec}.
*
* It also watches the `$location.hash()` and scroll whenever it changes to match any anchor.
* This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`.
*/
function $AnchorScrollProvider() {
var autoScrollingEnabled = true;
this.disableAutoScrolling = function() {
autoScrollingEnabled = false;
};
this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {
var document = $window.document;
// helper function to get first anchor from a NodeList
// can't use filter.filter, as it accepts only instances of Array
// and IE can't convert NodeList to an array using [].slice
// TODO(vojta): use filter if we change it to accept lists as well
function getFirstAnchor(list) {
var result = null;
forEach(list, function(element) {
if (!result && lowercase(element.nodeName) === 'a') result = element;
});
return result;
}
function scroll() {
var hash = $location.hash(), elm;
// empty hash, scroll to the top of the page
if (!hash) $window.scrollTo(0, 0);
// element with given id
else if ((elm = document.getElementById(hash))) elm.scrollIntoView();
// first anchor with given name :-D
else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) elm.scrollIntoView();
// no element and hash == 'top', scroll to the top of the page
else if (hash === 'top') $window.scrollTo(0, 0);
}
// does not scroll when user clicks on anchor link that is currently on
// (no url change, no $locaiton.hash() change), browser native does scroll
if (autoScrollingEnabled) {
$rootScope.$watch(function() {return $location.hash();}, function() {
$rootScope.$evalAsync(scroll);
});
}
return scroll;
}];
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$browser
* @requires $log
* @description
* This object has two goals:
*
* - hide all the global state in the browser caused by the window object
* - abstract away all the browser specific features and inconsistencies
*
* For tests we provide {@link angular.module.ngMock.$browser mock implementation} of the `$browser`
* service, which can be used for convenient testing of the application without the interaction with
* the real browser apis.
*/
/**
* @param {object} window The global window object.
* @param {object} document jQuery wrapped document.
* @param {object} body jQuery wrapped document.body.
* @param {function()} XHR XMLHttpRequest constructor.
* @param {object} $log console.log or an object with the same interface.
* @param {object} $sniffer $sniffer service
*/
function Browser(window, document, body, $log, $sniffer) {
var self = this,
rawDocument = document[0],
location = window.location,
history = window.history,
setTimeout = window.setTimeout,
clearTimeout = window.clearTimeout,
pendingDeferIds = {};
self.isMock = false;
var outstandingRequestCount = 0;
var outstandingRequestCallbacks = [];
// TODO(vojta): remove this temporary api
self.$$completeOutstandingRequest = completeOutstandingRequest;
self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };
/**
* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`
* counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
*/
function completeOutstandingRequest(fn) {
try {
fn.apply(null, sliceArgs(arguments, 1));
} finally {
outstandingRequestCount--;
if (outstandingRequestCount === 0) {
while(outstandingRequestCallbacks.length) {
try {
outstandingRequestCallbacks.pop()();
} catch (e) {
$log.error(e);
}
}
}
}
}
/**
* @private
* Note: this method is used only by scenario runner
* TODO(vojta): prefix this method with $$ ?
* @param {function()} callback Function that will be called when no outstanding request
*/
self.notifyWhenNoOutstandingRequests = function(callback) {
// force browser to execute all pollFns - this is needed so that cookies and other pollers fire
// at some deterministic time in respect to the test runner's actions. Leaving things up to the
// regular poller would result in flaky tests.
forEach(pollFns, function(pollFn){ pollFn(); });
if (outstandingRequestCount === 0) {
callback();
} else {
outstandingRequestCallbacks.push(callback);
}
};
//////////////////////////////////////////////////////////////
// Poll Watcher API
//////////////////////////////////////////////////////////////
var pollFns = [],
pollTimeout;
/**
* @ngdoc method
* @name angular.module.ng.$browser#addPollFn
* @methodOf angular.module.ng.$browser
*
* @param {function()} fn Poll function to add
*
* @description
* Adds a function to the list of functions that poller periodically executes,
* and starts polling if not started yet.
*
* @returns {function()} the added function
*/
self.addPollFn = function(fn) {
if (isUndefined(pollTimeout)) startPoller(100, setTimeout);
pollFns.push(fn);
return fn;
};
/**
* @param {number} interval How often should browser call poll functions (ms)
* @param {function()} setTimeout Reference to a real or fake `setTimeout` function.
*
* @description
* Configures the poller to run in the specified intervals, using the specified
* setTimeout fn and kicks it off.
*/
function startPoller(interval, setTimeout) {
(function check() {
forEach(pollFns, function(pollFn){ pollFn(); });
pollTimeout = setTimeout(check, interval);
})();
}
//////////////////////////////////////////////////////////////
// URL API
//////////////////////////////////////////////////////////////
var lastBrowserUrl = location.href;
/**
* @ngdoc method
* @name angular.module.ng.$browser#url
* @methodOf angular.module.ng.$browser
*
* @description
* GETTER:
* Without any argument, this method just returns current value of location.href.
*
* SETTER:
* With at least one argument, this method sets url to new value.
* If html5 history api supported, pushState/replaceState is used, otherwise
* location.href/location.replace is used.
* Returns its own instance to allow chaining
*
* NOTE: this api is intended for use only by the $location service. Please use the
* {@link angular.module.ng.$location $location service} to change url.
*
* @param {string} url New url (when used as setter)
* @param {boolean=} replace Should new url replace current history record ?
*/
self.url = function(url, replace) {
// setter
if (url) {
lastBrowserUrl = url;
if ($sniffer.history) {
if (replace) history.replaceState(null, '', url);
else history.pushState(null, '', url);
} else {
if (replace) location.replace(url);
else location.href = url;
}
return self;
// getter
} else {
return location.href;
}
};
var urlChangeListeners = [],
urlChangeInit = false;
function fireUrlChange() {
if (lastBrowserUrl == self.url()) return;
lastBrowserUrl = self.url();
forEach(urlChangeListeners, function(listener) {
listener(self.url());
});
}
/**
* @ngdoc method
* @name angular.module.ng.$browser#onUrlChange
* @methodOf angular.module.ng.$browser
* @TODO(vojta): refactor to use node's syntax for events
*
* @description
* Register callback function that will be called, when url changes.
*
* It's only called when the url is changed by outside of angular:
* - user types different url into address bar
* - user clicks on history (forward/back) button
* - user clicks on a link
*
* It's not called when url is changed by $browser.url() method
*
* The listener gets called with new url as parameter.
*
* NOTE: this api is intended for use only by the $location service. Please use the
* {@link angular.module.ng.$location $location service} to monitor url changes in angular apps.
*
* @param {function(string)} listener Listener function to be called when url changes.
* @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.
*/
self.onUrlChange = function(callback) {
if (!urlChangeInit) {
// We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)
// don't fire popstate when user change the address bar and don't fire hashchange when url
// changed by push/replaceState
// html5 history api - popstate event
if ($sniffer.history) jqLite(window).bind('popstate', fireUrlChange);
// hashchange event
if ($sniffer.hashchange) jqLite(window).bind('hashchange', fireUrlChange);
// polling
else self.addPollFn(fireUrlChange);
urlChangeInit = true;
}
urlChangeListeners.push(callback);
return callback;
};
//////////////////////////////////////////////////////////////
// Cookies API
//////////////////////////////////////////////////////////////
var lastCookies = {};
var lastCookieString = '';
/**
* @ngdoc method
* @name angular.module.ng.$browser#cookies
* @methodOf angular.module.ng.$browser
*
* @param {string=} name Cookie name
* @param {string=} value Cokkie value
*
* @description
* The cookies method provides a 'private' low level access to browser cookies.
* It is not meant to be used directly, use the $cookie service instead.
*
* The return values vary depending on the arguments that the method was called with as follows:
* <ul>
* <li>cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify it</li>
* <li>cookies(name, value) -> set name to value, if value is undefined delete the cookie</li>
* <li>cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that way)</li>
* </ul>
*
* @returns {Object} Hash of all cookies (if called without any parameter)
*/
self.cookies = function(name, value) {
var cookieLength, cookieArray, cookie, i, keyValue, index;
if (name) {
if (value === undefined) {
rawDocument.cookie = escape(name) + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
} else {
if (isString(value)) {
rawDocument.cookie = escape(name) + '=' + escape(value);
cookieLength = name.length + value.length + 1;
if (cookieLength > 4096) {
$log.warn("Cookie '"+ name +"' possibly not set or overflowed because it was too large ("+
cookieLength + " > 4096 bytes)!");
}
if (lastCookies.length > 20) {
$log.warn("Cookie '"+ name +"' possibly not set or overflowed because too many cookies " +
"were already set (" + lastCookies.length + " > 20 )");
}
}
}
} else {
if (rawDocument.cookie !== lastCookieString) {
lastCookieString = rawDocument.cookie;
cookieArray = lastCookieString.split("; ");
lastCookies = {};
for (i = 0; i < cookieArray.length; i++) {
cookie = cookieArray[i];
index = cookie.indexOf('=');
if (index > 0) { //ignore nameless cookies
lastCookies[unescape(cookie.substring(0, index))] = unescape(cookie.substring(index + 1));
}
}
}
return lastCookies;
}
};
/**
* @ngdoc method
* @name angular.module.ng.$browser#defer
* @methodOf angular.module.ng.$browser
* @param {function()} fn A function, who's execution should be defered.
* @param {number=} [delay=0] of milliseconds to defer the function execution.
* @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.
*
* @description
* Executes a fn asynchroniously via `setTimeout(fn, delay)`.
*
* Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using
* `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed
* via `$browser.defer.flush()`.
*
*/
self.defer = function(fn, delay) {
var timeoutId;
outstandingRequestCount++;
timeoutId = setTimeout(function() {
delete pendingDeferIds[timeoutId];
completeOutstandingRequest(fn);
}, delay || 0);
pendingDeferIds[timeoutId] = true;
return timeoutId;
};
/**
* THIS DOC IS NOT VISIBLE because ngdocs can't process docs for foo#method.method
*
* @name angular.module.ng.$browser#defer.cancel
* @methodOf angular.module.ng.$browser.defer
*
* @description
* Cancels a defered task identified with `deferId`.
*
* @param {*} deferId Token returned by the `$browser.defer` function.
* @returns {boolean} Returns `true` if the task hasn't executed yet and was successfuly canceled.
*/
self.defer.cancel = function(deferId) {
if (pendingDeferIds[deferId]) {
delete pendingDeferIds[deferId];
clearTimeout(deferId);
completeOutstandingRequest(noop);
return true;
}
return false;
};
//////////////////////////////////////////////////////////////
// Misc API
//////////////////////////////////////////////////////////////
/**
* @ngdoc method
* @name angular.module.ng.$browser#addCss
* @methodOf angular.module.ng.$browser
*
* @param {string} url Url to css file
* @description
* Adds a stylesheet tag to the head.
*/
self.addCss = function(url) {
var link = jqLite(rawDocument.createElement('link'));
link.attr('rel', 'stylesheet');
link.attr('type', 'text/css');
link.attr('href', url);
body.append(link);
};
/**
* @ngdoc method
* @name angular.module.ng.$browser#addJs
* @methodOf angular.module.ng.$browser
*
* @param {string} url Url to js file
*
* @description
* Adds a script tag to the head.
*/
self.addJs = function(url, done) {
// we can't use jQuery/jqLite here because jQuery does crazy shit with script elements, e.g.:
// - fetches local scripts via XHR and evals them
// - adds and immediately removes script elements from the document
var script = rawDocument.createElement('script');
script.type = 'text/javascript';
script.src = url;
if (msie) {
script.onreadystatechange = function() {
/loaded|complete/.test(script.readyState) && done && done();
};
} else {
if (done) script.onload = script.onerror = done;
}
body[0].appendChild(script);
return script;
};
/**
* Returns current <base href>
* (always relative - without domain)
*
* @returns {string=}
*/
self.baseHref = function() {
var href = document.find('base').attr('href');
return href ? href.replace(/^https?\:\/\/[^\/]*/, '') : href;
};
}
function $BrowserProvider(){
this.$get = ['$window', '$log', '$sniffer', '$document',
function( $window, $log, $sniffer, $document){
return new Browser($window, $document, $document.find('body'), $log, $sniffer);
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$cacheFactory
*
* @description
* Factory that constructs cache objects.
*
*
* @param {string} cacheId Name or id of the newly created cache.
* @param {object=} options Options object that specifies the cache behavior. Properties:
*
* - `{number=}` `capacity` — turns the cache into LRU cache.
*
* @returns {object} Newly created cache object with the following set of methods:
*
* - `{string}` `id()` — Returns id or name of the cache.
* - `{number}` `size()` — Returns number of items currently in the cache
* - `{void}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache
* - `{(*}} `get({string} key) — Returns cached value for `key` or undefined for cache miss.
* - `{void}` `remove{string} key) — Removes a key-value pair from the cache.
* - `{void}` `removeAll() — Removes all cached values.
*
*/
function $CacheFactoryProvider() {
this.$get = function() {
var caches = {};
function cacheFactory(cacheId, options) {
if (cacheId in caches) {
throw Error('cacheId ' + cacheId + ' taken');
}
var size = 0,
stats = extend({}, options, {id: cacheId}),
data = {},
capacity = (options && options.capacity) || Number.MAX_VALUE,
lruHash = {},
freshEnd = null,
staleEnd = null;
return caches[cacheId] = {
put: function(key, value) {
var lruEntry = lruHash[key] || (lruHash[key] = {key: key});
refresh(lruEntry);
if (isUndefined(value)) return;
if (!(key in data)) size++;
data[key] = value;
if (size > capacity) {
this.remove(staleEnd.key);
}
},
get: function(key) {
var lruEntry = lruHash[key];
if (!lruEntry) return;
refresh(lruEntry);
return data[key];
},
remove: function(key) {
var lruEntry = lruHash[key];
if (lruEntry == freshEnd) freshEnd = lruEntry.p;
if (lruEntry == staleEnd) staleEnd = lruEntry.n;
link(lruEntry.n,lruEntry.p);
delete lruHash[key];
delete data[key];
size--;
},
removeAll: function() {
data = {};
size = 0;
lruHash = {};
freshEnd = staleEnd = null;
},
destroy: function() {
data = null;
stats = null;
lruHash = null;
delete caches[cacheId];
},
info: function() {
return extend({}, stats, {size: size});
}
};
/**
* makes the `entry` the freshEnd of the LRU linked list
*/
function refresh(entry) {
if (entry != freshEnd) {
if (!staleEnd) {
staleEnd = entry;
} else if (staleEnd == entry) {
staleEnd = entry.n;
}
link(entry.n, entry.p);
link(entry, freshEnd);
freshEnd = entry;
freshEnd.n = null;
}
}
/**
* bidirectionally links two entries of the LRU linked list
*/
function link(nextEntry, prevEntry) {
if (nextEntry != prevEntry) {
if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify
if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify
}
}
}
cacheFactory.info = function() {
var info = {};
forEach(caches, function(cache, cacheId) {
info[cacheId] = cache.info();
});
return info;
};
cacheFactory.get = function(cacheId) {
return caches[cacheId];
};
return cacheFactory;
};
}
function $TemplateCacheProvider() {
this.$get = ['$cacheFactory', function($cacheFactory) {
return $cacheFactory('templates');
}];
}
'use strict';
function $CompileProvider(){
this.$get = ['$injector', '$exceptionHandler', '$textMarkup', '$attrMarkup', '$directive', '$widget',
function( $injector, $exceptionHandler, $textMarkup, $attrMarkup, $directive, $widget){
/**
* Template provides directions an how to bind to a given element.
* It contains a list of init functions which need to be called to
* bind to a new instance of elements. It also provides a list
* of child paths which contain child templates
*/
function Template() {
this.paths = [];
this.children = [];
this.linkFns = [];
this.newScope = false;
}
Template.prototype = {
link: function(element, scope) {
var childScope = scope,
locals = {$element: element};
if (this.newScope) {
childScope = isFunction(this.newScope) ? scope.$new(this.newScope(scope)) : scope.$new();
element.data($$scope, childScope);
}
forEach(this.linkFns, function(fn) {
try {
if (isArray(fn) || fn.$inject) {
$injector.invoke(fn, childScope, locals);
} else {
fn.call(childScope, element);
}
} catch (e) {
$exceptionHandler(e);
}
});
var i,
childNodes = element[0].childNodes,
children = this.children,
paths = this.paths,
length = paths.length;
for (i = 0; i < length; i++) {
// sometimes `element` can be modified by one of the linker functions in `this.linkFns`
// and childNodes may be added or removed
// TODO: element structure needs to be re-evaluated if new children added
// if the childNode still exists
if (childNodes[paths[i]])
children[i].link(jqLite(childNodes[paths[i]]), childScope);
else
delete paths[i]; // if child no longer available, delete path
}
},
addLinkFn:function(linkingFn) {
if (linkingFn) {
this.linkFns.push(linkingFn);
}
},
addChild: function(index, template) {
if (template) {
this.paths.push(index);
this.children.push(template);
}
},
empty: function() {
return this.linkFns.length === 0 && this.paths.length === 0;
}
};
///////////////////////////////////
//Compiler
//////////////////////////////////
/**
* @ngdoc function
* @name angular.module.ng.$compile
* @function
*
* @description
* Compiles a piece of HTML string or DOM into a template and produces a template function, which
* can then be used to link {@link angular.module.ng.$rootScope.Scope scope} and the template together.
*
* The compilation is a process of walking the DOM tree and trying to match DOM elements to
* {@link angular.markup markup}, {@link angular.attrMarkup attrMarkup},
* {@link angular.widget widgets}, and {@link angular.directive directives}. For each match it
* executes corresponding markup, attrMarkup, widget or directive template function and collects the
* instance functions into a single template function which is then returned.
*
* The template function can then be used once to produce the view or as it is the case with
* {@link angular.widget.@ng:repeat repeater} many-times, in which case each call results in a view
* that is a DOM clone of the original template.
*
<pre>
angular.injector(['ng']).invoke(function($rootScope, $compile) {
// Chose one:
// A: compile the entire window.document.
var element = $compile(window.document)($rootScope);
// B: compile a piece of html
var element = $compile('<div ng:click="clicked = true">click me</div>')($rootScope);
// C: compile a piece of html and retain reference to both the dom and scope
var element = $compile('<div ng:click="clicked = true">click me</div>')(scope);
// at this point template was transformed into a view
});
</pre>
*
*
* @param {string|DOMElement} element Element or HTML to compile into a template function.
* @returns {function(scope[, cloneAttachFn])} a template function which is used to bind template
* (a DOM element/tree) to a scope. Where:
*
* * `scope` - A {@link angular.module.ng.$rootScope.Scope Scope} to bind to.
* * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the
* `template` and call the `cloneAttachFn` function allowing the caller to attach the
* cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is
* called as: <br/> `cloneAttachFn(clonedElement, scope)` where:
*
* * `clonedElement` - is a clone of the original `element` passed into the compiler.
* * `scope` - is the current scope with which the linking function is working with.
*
* Calling the template function returns the element of the template. It is either the original element
* passed in, or the clone of the element if the `cloneAttachFn` is provided.
*
* It is important to understand that the returned scope is "linked" to the view DOM, but no linking
* (instance) functions registered by {@link angular.directive directives} or
* {@link angular.widget widgets} found in the template have been executed yet. This means that the
* view is likely empty and doesn't contain any values that result from evaluation on the scope. To
* bring the view to life, the scope needs to run through a $digest phase which typically is done by
* Angular automatically, except for the case when an application is being
* {@link guide/dev_guide.bootstrap.manual_bootstrap} manually bootstrapped, in which case the
* $digest phase must be invoked by calling {@link angular.module.ng.$rootScope.Scope#$apply}.
*
* If you need access to the bound view, there are two ways to do it:
*
* - If you are not asking the linking function to clone the template, create the DOM element(s)
* before you send them to the compiler and keep this reference around.
* <pre>
* var $injector = angular.injector(['ng']);
* var scope = $injector.invoke(function($rootScope, $compile){
* var element = $compile('<p>{{total}}</p>')($rootScope);
* });
* </pre>
*
* - if on the other hand, you need the element to be cloned, the view reference from the original
* example would not point to the clone, but rather to the original template that was cloned. In
* this case, you can access the clone via the cloneAttachFn:
* <pre>
* var original = angular.element('<p>{{total}}</p>'),
* scope = someParentScope.$new(),
* clone;
*
* $compile(original)(scope, function(clonedElement, scope) {
* clone = clonedElement;
* //attach the clone to DOM document at the right place
* });
*
* //now we have reference to the cloned DOM via `clone`
* </pre>
*
*
* Compiler Methods For Widgets and Directives:
*
* The following methods are available for use when you write your own widgets, directives,
* and markup. (Recall that the compile function's this is a reference to the compiler.)
*
* `compile(element)` - returns linker -
* Invoke a new instance of the compiler to compile a DOM element and return a linker function.
* You can apply the linker function to the original element or a clone of the original element.
* The linker function returns a scope.
*
* * `comment(commentText)` - returns element - Create a comment element.
*
* * `element(elementName)` - returns element - Create an element by name.
*
* * `text(text)` - returns element - Create a text element.
*
* * `descend([set])` - returns descend state (true or false). Get or set the current descend
* state. If true the compiler will descend to children elements.
*
* * `directives([set])` - returns directive state (true or false). Get or set the current
* directives processing state. The compiler will process directives only when directives set to
* true.
*
* For information on how the compiler works, see the
* {@link guide/dev_guide.compiler Angular HTML Compiler} section of the Developer Guide.
*/
function Compiler(markup, attrMarkup, directives, widgets){
this.markup = markup;
this.attrMarkup = attrMarkup;
this.directives = directives;
this.widgets = widgets;
}
Compiler.prototype = {
compile: function(templateElement) {
templateElement = jqLite(templateElement);
var index = 0,
template,
parent = templateElement.parent();
if (templateElement.length > 1) {
// https://github.com/angular/angular.js/issues/338
throw Error("Cannot compile multiple element roots: " +
jqLite('<div>').append(templateElement.clone()).html());
}
if (parent && parent[0]) {
parent = parent[0];
for(var i = 0; i < parent.childNodes.length; i++) {
if (parent.childNodes[i] == templateElement[0]) {
index = i;
}
}
}
template = this.templatize(templateElement, index) || new Template();
return function(scope, cloneConnectFn){
assertArg(scope, 'scope');
// important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart
// and sometimes changes the structure of the DOM.
var element = cloneConnectFn
? JQLitePrototype.clone.call(templateElement) // IMPORTANT!!!
: templateElement;
element.data($$scope, scope);
scope.$element = element;
(cloneConnectFn||noop)(element, scope);
template.link(element, scope);
return element;
};
},
templatize: function(element, elementIndex){
var self = this,
widget,
fn,
directiveFns = self.directives,
descend = true,
directives = true,
elementName = nodeName_(element),
elementNamespace = elementName.indexOf(':') > 0 ? lowercase(elementName).replace(':', '-') : '',
template,
locals = {$element: element},
selfApi = {
compile: bind(self, self.compile),
descend: function(value){ if(isDefined(value)) descend = value; return descend;},
directives: function(value){ if(isDefined(value)) directives = value; return directives;},
scope: function(value){ if(isDefined(value)) template.newScope = template.newScope || value; return template.newScope;}
};
element.addClass(elementNamespace);
template = new Template();
eachAttribute(element, function(value, name){
if (!widget) {
if ((widget = self.widgets('@' + name))) {
element.addClass('ng-attr-widget');
if (isFunction(widget) && !widget.$inject) {
widget.$inject = ['$value', '$element'];
}
locals.$value = value;
}
}
});
if (!widget) {
if ((widget = self.widgets(elementName))) {
if (elementNamespace)
element.addClass('ng-widget');
if (isFunction(widget) && !widget.$inject) {
widget.$inject = ['$element'];
}
}
}
if (widget) {
descend = false;
directives = false;
var parent = element.parent();
template.addLinkFn($injector.invoke(widget, selfApi, locals));
if (parent && parent[0]) {
element = jqLite(parent[0].childNodes[elementIndex]);
}
}
if (descend){
// process markup for text nodes only
for(var i=0, child=element[0].childNodes;
i<child.length; i++) {
if (isTextNode(child[i])) {
forEach(self.markup, function(markup){
if (i<child.length) {
var textNode = jqLite(child[i]);
markup.call(selfApi, textNode.text(), textNode, element);
}
});
}
}
}
if (directives) {
// Process attributes/directives
eachAttribute(element, function(value, name){
forEach(self.attrMarkup, function(markup){
markup.call(selfApi, value, name, element);
});
});
eachAttribute(element, function(value, name){
name = lowercase(name);
fn = directiveFns[name];
if (fn) {
element.addClass('ng-directive');
template.addLinkFn((isArray(fn) || fn.$inject)
? $injector.invoke(fn, selfApi, {$value:value, $element: element})
: fn.call(selfApi, value, element));
}
});
}
// Process non text child nodes
if (descend) {
eachNode(element, function(child, i){
template.addChild(i, self.templatize(child, i));
});
}
return template.empty() ? null : template;
}
};
/////////////////////////////////////////////////////////////////////
var compiler = new Compiler($textMarkup, $attrMarkup, $directive, $widget);
return bind(compiler, compiler.compile);
}];
};
function eachNode(element, fn){
var i, chldNodes = element[0].childNodes || [], chld;
for (i = 0; i < chldNodes.length; i++) {
if(!isTextNode(chld = chldNodes[i])) {
fn(jqLite(chld), i);
}
}
}
function eachAttribute(element, fn){
var i, attrs = element[0].attributes || [], chld, attr, name, value, attrValue = {};
for (i = 0; i < attrs.length; i++) {
attr = attrs[i];
name = attr.name;
value = attr.value;
if (msie && name == 'href') {
value = decodeURIComponent(element[0].getAttribute(name, 2));
}
attrValue[name] = value;
}
forEachSorted(attrValue, fn);
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$cookieStore
* @requires $cookies
*
* @description
* Provides a key-value (string-object) storage, that is backed by session cookies.
* Objects put or retrieved from this storage are automatically serialized or
* deserialized by angular's toJson/fromJson.
* @example
*/
function $CookieStoreProvider(){
this.$get = ['$cookies', function($cookies) {
return {
/**
* @ngdoc method
* @name angular.module.ng.$cookieStore#get
* @methodOf angular.module.ng.$cookieStore
*
* @description
* Returns the value of given cookie key
*
* @param {string} key Id to use for lookup.
* @returns {Object} Deserialized cookie value.
*/
get: function(key) {
return fromJson($cookies[key]);
},
/**
* @ngdoc method
* @name angular.module.ng.$cookieStore#put
* @methodOf angular.module.ng.$cookieStore
*
* @description
* Sets a value for given cookie key
*
* @param {string} key Id for the `value`.
* @param {Object} value Value to be stored.
*/
put: function(key, value) {
$cookies[key] = toJson(value);
},
/**
* @ngdoc method
* @name angular.module.ng.$cookieStore#remove
* @methodOf angular.module.ng.$cookieStore
*
* @description
* Remove given cookie
*
* @param {string} key Id of the key-value pair to delete.
*/
remove: function(key) {
delete $cookies[key];
}
};
}];
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$cookies
* @requires $browser
*
* @description
* Provides read/write access to browser's cookies.
*
* Only a simple Object is exposed and by adding or removing properties to/from
* this object, new cookies are created/deleted at the end of current $eval.
*
* @example
*/
function $CookiesProvider() {
this.$get = ['$rootScope', '$browser', function ($rootScope, $browser) {
var cookies = {},
lastCookies = {},
lastBrowserCookies,
runEval = false;
//creates a poller fn that copies all cookies from the $browser to service & inits the service
$browser.addPollFn(function() {
var currentCookies = $browser.cookies();
if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl
lastBrowserCookies = currentCookies;
copy(currentCookies, lastCookies);
copy(currentCookies, cookies);
if (runEval) $rootScope.$apply();
}
})();
runEval = true;
//at the end of each eval, push cookies
//TODO: this should happen before the "delayed" watches fire, because if some cookies are not
// strings or browser refuses to store some cookies, we update the model in the push fn.
$rootScope.$watch(push);
return cookies;
/**
* Pushes all the cookies from the service to the browser and verifies if all cookies were stored.
*/
function push() {
var name,
value,
browserCookies,
updated;
//delete any cookies deleted in $cookies
for (name in lastCookies) {
if (isUndefined(cookies[name])) {
$browser.cookies(name, undefined);
}
}
//update all cookies updated in $cookies
for(name in cookies) {
value = cookies[name];
if (!isString(value)) {
if (isDefined(lastCookies[name])) {
cookies[name] = lastCookies[name];
} else {
delete cookies[name];
}
} else if (value !== lastCookies[name]) {
$browser.cookies(name, value);
updated = true;
}
}
//verify what was actually stored
if (updated){
updated = false;
browserCookies = $browser.cookies();
for (name in cookies) {
if (cookies[name] !== browserCookies[name]) {
//delete or reset all cookies that the browser dropped from $cookies
if (isUndefined(browserCookies[name])) {
delete cookies[name];
} else {
cookies[name] = browserCookies[name];
}
updated = true;
}
}
}
}
}];
}
'use strict';
/**
* @ngdoc function
* @name angular.module.ng.$defer
* @requires $browser
*
* @description
* Delegates to {@link angular.module.ng.$browser#defer $browser.defer}, but wraps the `fn` function
* into a try/catch block and delegates any exceptions to
* {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
*
* In tests you can use `$browser.defer.flush()` to flush the queue of deferred functions.
*
* @param {function()} fn A function, who's execution should be deferred.
* @param {number=} [delay=0] of milliseconds to defer the function execution.
* @returns {*} DeferId that can be used to cancel the task via `$defer.cancel()`.
*/
/**
* @ngdoc function
* @name angular.module.ng.$defer#cancel
* @methodOf angular.module.ng.$defer
*
* @description
* Cancels a defered task identified with `deferId`.
*
* @param {*} deferId Token returned by the `$defer` function.
* @returns {boolean} Returns `true` if the task hasn't executed yet and was successfuly canceled.
*/
function $DeferProvider(){
this.$get = ['$rootScope', '$browser', function($rootScope, $browser) {
function defer(fn, delay) {
return $browser.defer(function() {
$rootScope.$apply(fn);
}, delay);
}
defer.cancel = function(deferId) {
return $browser.defer.cancel(deferId);
};
return defer;
}];
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$document
* @requires $window
*
* @description
* A {@link angular.element jQuery (lite)}-wrapped reference to the browser's `window.document`
* element.
*/
function $DocumentProvider(){
this.$get = ['$window', function(window){
return jqLite(window.document);
}];
}
'use strict';
/**
* @ngdoc function
* @name angular.module.ng.$exceptionHandler
* @requires $log
*
* @description
* Any uncaught exception in angular expressions is delegated to this service.
* The default implementation simply delegates to `$log.error` which logs it into
* the browser console.
*
* In unit tests, if `angular-mocks.js` is loaded, this service is overriden by
* {@link angular.module.ngMock.$exceptionHandler mock $exceptionHandler}
*/
function $ExceptionHandlerProvider(){
this.$get = ['$log', function($log){
return function(e) {
$log.error(e);
};
}];
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$filterProvider
* @description
*
* Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To
* achieve this a filter definition consists of a factory function which is annotated with dependencies and is
* responsible for creating a the filter function.
*
* <pre>
* // Filter registration
* function MyModule($provide, $filterProvider) {
* // create a service to demonstrate injection (not always needed)
* $provide.value('greet', function(name){
* return 'Hello ' + name + '!':
* });
*
* // register a filter factory which uses the
* // greet service to demonstrate DI.
* $filterProvider.register('greet', function(greet){
* // return the filter function which uses the greet service
* // to generate salutation
* return function(text) {
* // filters need to be forgiving so check input validity
* return text && greet(text) || text;
* };
* };
* }
* </pre>
*
* The filter function is registered with the `$injector` under the filter name suffixe with `Filter`.
* <pre>
* it('should be the same instance', inject(
* function($filterProvider) {
* $filterProvider.register('reverse', function(){
* return ...;
* });
* },
* function($filter, reverseFilter) {
* expect($filter('reverse')).toBe(reverseFilter);
* });
* </pre>
*
*
* For more information about how angular filters work, and how to create your own filters, see
* {@link guide/dev_guide.templates.filters Understanding Angular Filters} in the angular Developer
* Guide.
*/
/**
* @ngdoc method
* @name angular.module.ng.$filterProvider#register
* @methodOf angular.module.ng.$filterProvider
* @description
* Register filter factory function.
*
* @param {String} name Name of the filter.
* @param {function} fn The filter factory function which is injectable.
*/
/**
* @ngdoc function
* @name angular.module.ng.$filter
* @function
* @description
* Filters are used for formatting data displayed to the user.
*
* The general syntax in templates is as follows:
*
* {{ expression | [ filter_name ] }}
*
* @param {String} name Name of the filter function to retrieve
* @return {Function} the filter function
*/
$FilterProvider.$inject = ['$provide'];
function $FilterProvider($provide) {
var suffix = 'Filter';
function register(name, factory) {
return $provide.factory(name + suffix, factory);
}
this.register = register;
this.$get = ['$injector', function($injector) {
return function(name) {
return $injector.get(name + suffix);
}
}];
////////////////////////////////////////
register('currency', currencyFilter);
register('date', dateFilter);
register('filter', filterFilter);
register('html', htmlFilter);
register('json', jsonFilter);
register('limitTo', limitToFilter);
register('linky', linkyFilter);
register('lowercase', lowercaseFilter);
register('number', numberFilter);
register('orderBy', orderByFilter);
register('uppercase', uppercaseFilter);
}
'use strict';
/**
* @ngdoc filter
* @name angular.module.ng.$filter.filter
* @function
*
* @description
* Selects a subset of items from `array` and returns it as a new array.
*
* Note: This function is used to augment the `Array` type in Angular expressions. See
* {@link angular.module.ng.$filter} for more information about Angular arrays.
*
* @param {Array} array The source array.
* @param {string|Object|function()} expression The predicate to be used for selecting items from
* `array`.
*
* Can be one of:
*
* - `string`: Predicate that results in a substring match using the value of `expression`
* string. All strings or objects with string properties in `array` that contain this string
* will be returned. The predicate can be negated by prefixing the string with `!`.
*
* - `Object`: A pattern object can be used to filter specific properties on objects contained
* by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items
* which have property `name` containing "M" and property `phone` containing "1". A special
* property name `$` can be used (as in `{$:"text"}`) to accept a match against any
* property of the object. That's equivalent to the simple substring match with a `string`
* as described above.
*
* - `function`: A predicate function can be used to write arbitrary filters. The function is
* called for each element of `array`. The final result is an array of those elements that
* the predicate returned true for.
*
* @example
<doc:example>
<doc:source>
<div ng:init="friends = [{name:'John', phone:'555-1276'},
{name:'Mary', phone:'800-BIG-MARY'},
{name:'Mike', phone:'555-4321'},
{name:'Adam', phone:'555-5678'},
{name:'Julie', phone:'555-8765'}]"></div>
Search: <input ng:model="searchText"/>
<table id="searchTextResults">
<tr><th>Name</th><th>Phone</th><tr>
<tr ng:repeat="friend in friends | filter:searchText">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
<tr>
</table>
<hr>
Any: <input ng:model="search.$"/> <br>
Name only <input ng:model="search.name"/><br>
Phone only <input ng:model="search.phone"/><br>
<table id="searchObjResults">
<tr><th>Name</th><th>Phone</th><tr>
<tr ng:repeat="friend in friends | filter:search">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
<tr>
</table>
</doc:source>
<doc:scenario>
it('should search across all fields when filtering with a string', function() {
input('searchText').enter('m');
expect(repeater('#searchTextResults tr', 'friend in friends').column('name')).
toEqual(['Mary', 'Mike', 'Adam']);
input('searchText').enter('76');
expect(repeater('#searchTextResults tr', 'friend in friends').column('name')).
toEqual(['John', 'Julie']);
});
it('should search in specific fields when filtering with a predicate object', function() {
input('search.$').enter('i');
expect(repeater('#searchObjResults tr', 'friend in friends').column('name')).
toEqual(['Mary', 'Mike', 'Julie']);
});
</doc:scenario>
</doc:example>
*/
function filterFilter() {
return function(array, expression) {
if (!(array instanceof Array)) return array;
var predicates = [];
predicates.check = function(value) {
for (var j = 0; j < predicates.length; j++) {
if(!predicates[j](value)) {
return false;
}
}
return true;
};
var search = function(obj, text){
if (text.charAt(0) === '!') {
return !search(obj, text.substr(1));
}
switch (typeof obj) {
case "boolean":
case "number":
case "string":
return ('' + obj).toLowerCase().indexOf(text) > -1;
case "object":
for ( var objKey in obj) {
if (objKey.charAt(0) !== '$' && search(obj[objKey], text)) {
return true;
}
}
return false;
case "array":
for ( var i = 0; i < obj.length; i++) {
if (search(obj[i], text)) {
return true;
}
}
return false;
default:
return false;
}
};
switch (typeof expression) {
case "boolean":
case "number":
case "string":
expression = {$:expression};
case "object":
for (var key in expression) {
if (key == '$') {
(function() {
var text = (''+expression[key]).toLowerCase();
if (!text) return;
predicates.push(function(value) {
return search(value, text);
});
})();
} else {
(function() {
var path = key;
var text = (''+expression[key]).toLowerCase();
if (!text) return;
predicates.push(function(value) {
return search(getter(value, path), text);
});
})();
}
}
break;
case 'function':
predicates.push(expression);
break;
default:
return array;
}
var filtered = [];
for ( var j = 0; j < array.length; j++) {
var value = array[j];
if (predicates.check(value)) {
filtered.push(value);
}
}
return filtered;
}
}
'use strict';
/**
* @ngdoc filter
* @name angular.module.ng.$filter.currency
* @function
*
* @description
* Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default
* symbol for current locale is used.
*
* @param {number} amount Input to filter.
* @param {string=} symbol Currency symbol or identifier to be displayed.
* @returns {string} Formatted number.
*
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.amount = 1234.56;
}
</script>
<div ng:controller="Ctrl">
<input type="number" ng:model="amount"/> <br/>
default currency symbol ($): {{amount | currency}}<br/>
custom currency identifier (USD$): {{amount | currency:"USD$"}}
</div>
</doc:source>
<doc:scenario>
it('should init with 1234.56', function() {
expect(binding('amount | currency')).toBe('$1,234.56');
expect(binding('amount | currency:"USD$"')).toBe('USD$1,234.56');
});
it('should update', function() {
input('amount').enter('-1234');
expect(binding('amount | currency')).toBe('($1,234.00)');
expect(binding('amount | currency:"USD$"')).toBe('(USD$1,234.00)');
});
</doc:scenario>
</doc:example>
*/
currencyFilter.$inject = ['$locale'];
function currencyFilter($locale) {
var formats = $locale.NUMBER_FORMATS;
return function(amount, currencySymbol){
if (isUndefined(currencySymbol)) currencySymbol = formats.CURRENCY_SYM;
return formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, 2).
replace(/\u00A4/g, currencySymbol);
};
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.number
* @function
*
* @description
* Formats a number as text.
*
* If the input is not a number an empty string is returned.
*
* @param {number|string} number Number to format.
* @param {(number|string)=} [fractionSize=2] Number of decimal places to round the number to.
* @returns {string} Number rounded to decimalPlaces and places a “,” after each third digit.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.val = 1234.56789;
}
</script>
<div ng:controller="Ctrl">
Enter number: <input ng:model='val'><br/>
Default formatting: {{val | number}}<br/>
No fractions: {{val | number:0}}<br/>
Negative number: {{-val | number:4}}
</div>
</doc:source>
<doc:scenario>
it('should format numbers', function() {
expect(binding('val | number')).toBe('1,234.568');
expect(binding('val | number:0')).toBe('1,235');
expect(binding('-val | number:4')).toBe('-1,234.5679');
});
it('should update', function() {
input('val').enter('3374.333');
expect(binding('val | number')).toBe('3,374.333');
expect(binding('val | number:0')).toBe('3,374');
expect(binding('-val | number:4')).toBe('-3,374.3330');
});
</doc:scenario>
</doc:example>
*/
numberFilter.$inject = ['$locale'];
function numberFilter($locale) {
var formats = $locale.NUMBER_FORMATS;
return function(number, fractionSize) {
return formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,
fractionSize);
};
}
var DECIMAL_SEP = '.';
function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
if (isNaN(number) || !isFinite(number)) return '';
var isNegative = number < 0;
number = Math.abs(number);
var numStr = number + '',
formatedText = '',
parts = [];
if (numStr.indexOf('e') !== -1) {
formatedText = numStr;
} else {
var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length;
// determine fractionSize if it is not specified
if (isUndefined(fractionSize)) {
fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac);
}
var pow = Math.pow(10, fractionSize);
number = Math.round(number * pow) / pow;
var fraction = ('' + number).split(DECIMAL_SEP);
var whole = fraction[0];
fraction = fraction[1] || '';
var pos = 0,
lgroup = pattern.lgSize,
group = pattern.gSize;
if (whole.length >= (lgroup + group)) {
pos = whole.length - lgroup;
for (var i = 0; i < pos; i++) {
if ((pos - i)%group === 0 && i !== 0) {
formatedText += groupSep;
}
formatedText += whole.charAt(i);
}
}
for (i = pos; i < whole.length; i++) {
if ((whole.length - i)%lgroup === 0 && i !== 0) {
formatedText += groupSep;
}
formatedText += whole.charAt(i);
}
// format fraction part.
while(fraction.length < fractionSize) {
fraction += '0';
}
if (fractionSize) formatedText += decimalSep + fraction.substr(0, fractionSize);
}
parts.push(isNegative ? pattern.negPre : pattern.posPre);
parts.push(formatedText);
parts.push(isNegative ? pattern.negSuf : pattern.posSuf);
return parts.join('');
}
function padNumber(num, digits, trim) {
var neg = '';
if (num < 0) {
neg = '-';
num = -num;
}
num = '' + num;
while(num.length < digits) num = '0' + num;
if (trim)
num = num.substr(num.length - digits);
return neg + num;
}
function dateGetter(name, size, offset, trim) {
return function(date) {
var value = date['get' + name]();
if (offset > 0 || value > -offset)
value += offset;
if (value === 0 && offset == -12 ) value = 12;
return padNumber(value, size, trim);
};
}
function dateStrGetter(name, shortForm) {
return function(date, formats) {
var value = date['get' + name]();
var get = uppercase(shortForm ? ('SHORT' + name) : name);
return formats[get][value];
};
}
function timeZoneGetter(date) {
var offset = date.getTimezoneOffset();
return padNumber(offset / 60, 2) + padNumber(Math.abs(offset % 60), 2);
}
function ampmGetter(date, formats) {
return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];
}
var DATE_FORMATS = {
yyyy: dateGetter('FullYear', 4),
yy: dateGetter('FullYear', 2, 0, true),
y: dateGetter('FullYear', 1),
MMMM: dateStrGetter('Month'),
MMM: dateStrGetter('Month', true),
MM: dateGetter('Month', 2, 1),
M: dateGetter('Month', 1, 1),
dd: dateGetter('Date', 2),
d: dateGetter('Date', 1),
HH: dateGetter('Hours', 2),
H: dateGetter('Hours', 1),
hh: dateGetter('Hours', 2, -12),
h: dateGetter('Hours', 1, -12),
mm: dateGetter('Minutes', 2),
m: dateGetter('Minutes', 1),
ss: dateGetter('Seconds', 2),
s: dateGetter('Seconds', 1),
EEEE: dateStrGetter('Day'),
EEE: dateStrGetter('Day', true),
a: ampmGetter,
Z: timeZoneGetter
};
var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,
NUMBER_STRING = /^\d+$/;
/**
* @ngdoc filter
* @name angular.module.ng.$filter.date
* @function
*
* @description
* Formats `date` to a string based on the requested `format`.
*
* `format` string can be composed of the following elements:
*
* * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)
* * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
* * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)
* * `'MMMM'`: Month in year (January-December)
* * `'MMM'`: Month in year (Jan-Dec)
* * `'MM'`: Month in year, padded (01-12)
* * `'M'`: Month in year (1-12)
* * `'dd'`: Day in month, padded (01-31)
* * `'d'`: Day in month (1-31)
* * `'EEEE'`: Day in Week,(Sunday-Saturday)
* * `'EEE'`: Day in Week, (Sun-Sat)
* * `'HH'`: Hour in day, padded (00-23)
* * `'H'`: Hour in day (0-23)
* * `'hh'`: Hour in am/pm, padded (01-12)
* * `'h'`: Hour in am/pm, (1-12)
* * `'mm'`: Minute in hour, padded (00-59)
* * `'m'`: Minute in hour (0-59)
* * `'ss'`: Second in minute, padded (00-59)
* * `'s'`: Second in minute (0-59)
* * `'a'`: am/pm marker
* * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-1200)
*
* `format` string can also be one of the following predefined
* {@link guide/dev_guide.i18n localizable formats}:
*
* * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale
* (e.g. Sep 3, 2010 12:05:08 pm)
* * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 pm)
* * `'fullDate'`: equivalent to `'EEEE, MMMM d,y'` for en_US locale
* (e.g. Friday, September 3, 2010)
* * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010
* * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010)
* * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)
* * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 pm)
* * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 pm)
*
* `format` string can contain literal values. These need to be quoted with single quotes (e.g.
* `"h 'in the morning'"`). In order to output single quote, use two single quotes in a sequence
* (e.g. `"h o''clock"`).
*
* @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or
* number) or ISO 8601 extended datetime string (yyyy-MM-ddTHH:mm:ss.SSSZ).
* @param {string=} format Formatting rules (see Description). If not specified,
* `mediumDate` is used.
* @returns {string} Formatted string or the input if input is not recognized as date/millis.
*
* @example
<doc:example>
<doc:source>
<span ng:non-bindable>{{1288323623006 | date:'medium'}}</span>:
{{1288323623006 | date:'medium'}}<br/>
<span ng:non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:
{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}<br/>
<span ng:non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:
{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}<br/>
</doc:source>
<doc:scenario>
it('should format date', function() {
expect(binding("1288323623006 | date:'medium'")).
toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/);
expect(binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).
toMatch(/2010\-10\-2\d \d{2}:\d{2}:\d{2} \-?\d{4}/);
expect(binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).
toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/);
});
</doc:scenario>
</doc:example>
*/
dateFilter.$inject = ['$locale'];
function dateFilter($locale) {
return function(date, format) {
var text = '',
parts = [],
fn, match;
format = format || 'mediumDate'
format = $locale.DATETIME_FORMATS[format] || format;
if (isString(date)) {
if (NUMBER_STRING.test(date)) {
date = parseInt(date, 10);
} else {
date = jsonStringToDate(date);
}
}
if (isNumber(date)) {
date = new Date(date);
}
if (!isDate(date)) {
return date;
}
while(format) {
match = DATE_FORMATS_SPLIT.exec(format);
if (match) {
parts = concat(parts, match, 1);
format = parts.pop();
} else {
parts.push(format);
format = null;
}
}
forEach(parts, function(value){
fn = DATE_FORMATS[value];
text += fn ? fn(date, $locale.DATETIME_FORMATS)
: value.replace(/(^'|'$)/g, '').replace(/''/g, "'");
});
return text;
};
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.json
* @function
*
* @description
* Allows you to convert a JavaScript object into JSON string.
*
* This filter is mostly useful for debugging. When using the double curly {{value}} notation
* the binding is automatically converted to JSON.
*
* @param {*} object Any JavaScript object (including arrays and primitive types) to filter.
* @returns {string} JSON string.
*
* @css ng-monospace Always applied to the encapsulating element.
*
* @example:
<doc:example>
<doc:source>
<pre>{{ {'name':'value'} | json }}</pre>
</doc:source>
<doc:scenario>
it('should jsonify filtered objects', function() {
expect(binding('| json')).toBe('{\n "name":"value"}');
});
</doc:scenario>
</doc:example>
*
*/
function jsonFilter() {
return function(object) {
return toJson(object, true);
};
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.lowercase
* @function
* @description
* Converts string to lowercase.
* @see angular.lowercase
*/
var lowercaseFilter = valueFn(lowercase);
/**
* @ngdoc filter
* @name angular.module.ng.$filter.uppercase
* @function
* @description
* Converts string to uppercase.
* @see angular.uppercase
*/
var uppercaseFilter = valueFn(uppercase);
/**
* @ngdoc filter
* @name angular.module.ng.$filter.html
* @function
*
* @description
* Prevents the input from getting escaped by angular. By default the input is sanitized and
* inserted into the DOM as is.
*
* The input is sanitized by parsing the html into tokens. All safe tokens (from a whitelist) are
* then serialized back to properly escaped html string. This means that no unsafe input can make
* it into the returned string, however, since our parser is more strict than a typical browser
* parser, it's possible that some obscure input, which would be recognized as valid HTML by a
* browser, won't make it through the sanitizer.
*
* If you hate your users, you may call the filter with optional 'unsafe' argument, which bypasses
* the html sanitizer, but makes your application vulnerable to XSS and other attacks. Using this
* option is strongly discouraged and should be used only if you absolutely trust the input being
* filtered and you can't get the content through the sanitizer.
*
* @param {string} html Html input.
* @param {string=} option If 'unsafe' then do not sanitize the HTML input.
* @returns {string} Sanitized or raw html.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.snippet =
'<p style="color:blue">an html\n' +
'<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' +
'snippet</p>';
}
</script>
<div ng:controller="Ctrl">
Snippet: <textarea ng:model="snippet" cols="60" rows="3"></textarea>
<table>
<tr>
<td>Filter</td>
<td>Source</td>
<td>Rendered</td>
</tr>
<tr id="html-filter">
<td>html filter</td>
<td>
<pre><div ng:bind="snippet | html"><br/></div></pre>
</td>
<td>
<div ng:bind="snippet | html"></div>
</td>
</tr>
<tr id="escaped-html">
<td>no filter</td>
<td><pre><div ng:bind="snippet"><br/></div></pre></td>
<td><div ng:bind="snippet"></div></td>
</tr>
<tr id="html-unsafe-filter">
<td>unsafe html filter</td>
<td><pre><div ng:bind="snippet | html:'unsafe'"><br/></div></pre></td>
<td><div ng:bind="snippet | html:'unsafe'"></div></td>
</tr>
</table>
</div>
</doc:source>
<doc:scenario>
it('should sanitize the html snippet ', function() {
expect(using('#html-filter').binding('snippet | html')).
toBe('<p>an html\n<em>click here</em>\nsnippet</p>');
});
it('should escape snippet without any filter', function() {
expect(using('#escaped-html').binding('snippet')).
toBe("<p style=\"color:blue\">an html\n" +
"<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
"snippet</p>");
});
it('should inline raw snippet if filtered as unsafe', function() {
expect(using('#html-unsafe-filter').binding("snippet | html:'unsafe'")).
toBe("<p style=\"color:blue\">an html\n" +
"<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
"snippet</p>");
});
it('should update', function() {
input('snippet').enter('new <b>text</b>');
expect(using('#html-filter').binding('snippet | html')).toBe('new <b>text</b>');
expect(using('#escaped-html').binding('snippet')).toBe("new <b>text</b>");
expect(using('#html-unsafe-filter').binding("snippet | html:'unsafe'")).toBe('new <b>text</b>');
});
</doc:scenario>
</doc:example>
*/
//TODO(misko): turn sensitization into injectable service
function htmlFilter() {
return function(html, option){
return new HTML(html, option);
};
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.linky
* @function
*
* @description
* Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and
* plain email address links.
*
* @param {string} text Input text.
* @returns {string} Html-linkified text.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.snippet =
'Pretty text with some links:\n'+
'http://angularjs.org/,\n'+
'mailto:[email protected],\n'+
'[email protected],\n'+
'and one more: ftp://127.0.0.1/.';
}
</script>
<div ng:controller="Ctrl">
Snippet: <textarea ng:model="snippet" cols="60" rows="3"></textarea>
<table>
<tr>
<td>Filter</td>
<td>Source</td>
<td>Rendered</td>
</tr>
<tr id="linky-filter">
<td>linky filter</td>
<td>
<pre><div ng:bind="snippet | linky"><br/></div></pre>
</td>
<td>
<div ng:bind="snippet | linky"></div>
</td>
</tr>
<tr id="escaped-html">
<td>no filter</td>
<td><pre><div ng:bind="snippet"><br/></div></pre></td>
<td><div ng:bind="snippet"></div></td>
</tr>
</table>
</doc:source>
<doc:scenario>
it('should linkify the snippet with urls', function() {
expect(using('#linky-filter').binding('snippet | linky')).
toBe('Pretty text with some links:\n' +
'<a href="http://angularjs.org/">http://angularjs.org/</a>,\n' +
'<a href="mailto:[email protected]">[email protected]</a>,\n' +
'<a href="mailto:[email protected]">[email protected]</a>,\n' +
'and one more: <a href="ftp://127.0.0.1/">ftp://127.0.0.1/</a>.');
});
it ('should not linkify snippet without the linky filter', function() {
expect(using('#escaped-html').binding('snippet')).
toBe("Pretty text with some links:\n" +
"http://angularjs.org/,\n" +
"mailto:[email protected],\n" +
"[email protected],\n" +
"and one more: ftp://127.0.0.1/.");
});
it('should update', function() {
input('snippet').enter('new http://link.');
expect(using('#linky-filter').binding('snippet | linky')).
toBe('new <a href="http://link">http://link</a>.');
expect(using('#escaped-html').binding('snippet')).toBe('new http://link.');
});
</doc:scenario>
</doc:example>
*/
function linkyFilter() {
var LINKY_URL_REGEXP = /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s\.\;\,\(\)\{\}\<\>]/,
MAILTO_REGEXP = /^mailto:/;
return function(text) {
if (!text) return text;
var match;
var raw = text;
var html = [];
var writer = htmlSanitizeWriter(html);
var url;
var i;
while ((match = raw.match(LINKY_URL_REGEXP))) {
// We can not end in these as they are sometimes found at the end of the sentence
url = match[0];
// if we did not match ftp/http/mailto then assume mailto
if (match[2] == match[3]) url = 'mailto:' + url;
i = match.index;
writer.chars(raw.substr(0, i));
writer.start('a', {href:url});
writer.chars(match[0].replace(MAILTO_REGEXP, ''));
writer.end('a');
raw = raw.substring(i + match[0].length);
}
writer.chars(raw);
return new HTML(html.join(''));
};
};
'use strict';
/**
* @ngdoc function
* @name angular.module.ng.$filter.limitTo
* @function
*
* @description
* Creates a new array containing only a specified number of elements in an array. The elements
* are taken from either the beginning or the end of the source array, as specified by the
* value and sign (positive or negative) of `limit`.
*
* Note: This function is used to augment the `Array` type in Angular expressions. See
* {@link angular.module.ng.$filter} for more information about Angular arrays.
*
* @param {Array} array Source array to be limited.
* @param {string|Number} limit The length of the returned array. If the `limit` number is
* positive, `limit` number of items from the beginning of the source array are copied.
* If the number is negative, `limit` number of items from the end of the source array are
* copied. The `limit` will be trimmed if it exceeds `array.length`
* @returns {Array} A new sub-array of length `limit` or less if input array had less than `limit`
* elements.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.numbers = [1,2,3,4,5,6,7,8,9];
this.limit = 3;
}
</script>
<div ng:controller="Ctrl">
Limit {{numbers}} to: <input type="integer" ng:model="limit"/>
<p>Output: {{ numbers | limitTo:limit | json }}</p>
</div>
</doc:source>
<doc:scenario>
it('should limit the numer array to first three items', function() {
expect(element('.doc-example-live input[ng\\:model=limit]').val()).toBe('3');
expect(binding('numbers | limitTo:limit | json')).toEqual('[1,2,3]');
});
it('should update the output when -3 is entered', function() {
input('limit').enter(-3);
expect(binding('numbers | limitTo:limit | json')).toEqual('[7,8,9]');
});
it('should not exceed the maximum size of input array', function() {
input('limit').enter(100);
expect(binding('numbers | limitTo:limit | json')).toEqual('[1,2,3,4,5,6,7,8,9]');
});
</doc:scenario>
</doc:example>
*/
function limitToFilter(){
return function(array, limit) {
if (!(array instanceof Array)) return array;
limit = parseInt(limit, 10);
var out = [],
i, n;
// check that array is iterable
if (!array || !(array instanceof Array))
return out;
// if abs(limit) exceeds maximum length, trim it
if (limit > array.length)
limit = array.length;
else if (limit < -array.length)
limit = -array.length;
if (limit > 0) {
i = 0;
n = limit;
} else {
i = array.length + limit;
n = array.length;
}
for (; i<n; i++) {
out.push(array[i]);
}
return out;
}
}
'use strict';
/**
* @ngdoc function
* @name angular.module.ng.$filter.orderBy
* @function
*
* @description
* Orders a specified `array` by the `expression` predicate.
*
* Note: this function is used to augment the `Array` type in Angular expressions. See
* {@link angular.module.ng.$filter} for more informaton about Angular arrays.
*
* @param {Array} array The array to sort.
* @param {function(*)|string|Array.<(function(*)|string)>} expression A predicate to be
* used by the comparator to determine the order of elements.
*
* Can be one of:
*
* - `function`: Getter function. The result of this function will be sorted using the
* `<`, `=`, `>` operator.
* - `string`: An Angular expression which evaluates to an object to order by, such as 'name'
* to sort by a property called 'name'. Optionally prefixed with `+` or `-` to control
* ascending or descending sort order (for example, +name or -name).
* - `Array`: An array of function or string predicates. The first predicate in the array
* is used for sorting, but when two items are equivalent, the next predicate is used.
*
* @param {boolean=} reverse Reverse the order the array.
* @returns {Array} Sorted copy of the source array.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.friends =
[{name:'John', phone:'555-1212', age:10},
{name:'Mary', phone:'555-9876', age:19},
{name:'Mike', phone:'555-4321', age:21},
{name:'Adam', phone:'555-5678', age:35},
{name:'Julie', phone:'555-8765', age:29}]
this.predicate = '-age';
}
</script>
<div ng:controller="Ctrl">
<pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>
<hr/>
[ <a href="" ng:click="predicate=''">unsorted</a> ]
<table class="friend">
<tr>
<th><a href="" ng:click="predicate = 'name'; reverse=false">Name</a>
(<a href ng:click="predicate = '-name'; reverse=false">^</a>)</th>
<th><a href="" ng:click="predicate = 'phone'; reverse=!reverse">Phone Number</a></th>
<th><a href="" ng:click="predicate = 'age'; reverse=!reverse">Age</a></th>
<tr>
<tr ng:repeat="friend in friends | orderBy:predicate:reverse">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
<td>{{friend.age}}</td>
<tr>
</table>
</div>
</doc:source>
<doc:scenario>
it('should be reverse ordered by aged', function() {
expect(binding('predicate')).toBe('Sorting predicate = -age; reverse = ');
expect(repeater('table.friend', 'friend in friends').column('friend.age')).
toEqual(['35', '29', '21', '19', '10']);
expect(repeater('table.friend', 'friend in friends').column('friend.name')).
toEqual(['Adam', 'Julie', 'Mike', 'Mary', 'John']);
});
it('should reorder the table when user selects different predicate', function() {
element('.doc-example-live a:contains("Name")').click();
expect(repeater('table.friend', 'friend in friends').column('friend.name')).
toEqual(['Adam', 'John', 'Julie', 'Mary', 'Mike']);
expect(repeater('table.friend', 'friend in friends').column('friend.age')).
toEqual(['35', '10', '29', '19', '21']);
element('.doc-example-live a:contains("Phone")').click();
expect(repeater('table.friend', 'friend in friends').column('friend.phone')).
toEqual(['555-9876', '555-8765', '555-5678', '555-4321', '555-1212']);
expect(repeater('table.friend', 'friend in friends').column('friend.name')).
toEqual(['Mary', 'Julie', 'Adam', 'Mike', 'John']);
});
</doc:scenario>
</doc:example>
*/
orderByFilter.$inject = ['$parse'];
function orderByFilter($parse){
return function(array, sortPredicate, reverseOrder) {
if (!(array instanceof Array)) return array;
if (!sortPredicate) return array;
sortPredicate = isArray(sortPredicate) ? sortPredicate: [sortPredicate];
sortPredicate = map(sortPredicate, function(predicate){
var descending = false, get = predicate || identity;
if (isString(predicate)) {
if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {
descending = predicate.charAt(0) == '-';
predicate = predicate.substring(1);
}
get = $parse(predicate);
}
return reverseComparator(function(a,b){
return compare(get(a),get(b));
}, descending);
});
var arrayCopy = [];
for ( var i = 0; i < array.length; i++) { arrayCopy.push(array[i]); }
return arrayCopy.sort(reverseComparator(comparator, reverseOrder));
function comparator(o1, o2){
for ( var i = 0; i < sortPredicate.length; i++) {
var comp = sortPredicate[i](o1, o2);
if (comp !== 0) return comp;
}
return 0;
}
function reverseComparator(comp, descending) {
return toBoolean(descending)
? function(a,b){return comp(b,a);}
: comp;
}
function compare(v1, v2){
var t1 = typeof v1;
var t2 = typeof v2;
if (t1 == t2) {
if (t1 == "string") v1 = v1.toLowerCase();
if (t1 == "string") v2 = v2.toLowerCase();
if (v1 === v2) return 0;
return v1 < v2 ? -1 : 1;
} else {
return t1 < t2 ? -1 : 1;
}
}
}
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$formFactory
*
* @description
* Use `$formFactory` to create a new instance of a {@link angular.module.ng.$formFactory.Form Form}
* controller or to find the nearest form instance for a given DOM element.
*
* The form instance is a collection of widgets, and is responsible for life cycle and validation
* of widget.
*
* Keep in mind that both form and widget instances are {@link api/angular.module.ng.$rootScope.Scope scopes}.
*
* @param {Form=} parentForm The form which should be the parent form of the new form controller.
* If none specified default to the `rootForm`.
* @returns {Form} A new {@link angular.module.ng.$formFactory.Form Form} instance.
*
* @example
*
* This example shows how one could write a widget which would enable data-binding on
* `contenteditable` feature of HTML.
*
<doc:example>
<doc:source>
<script>
function EditorCntl() {
this.html = '<b>Hello</b> <i>World</i>!';
}
HTMLEditorWidget.$inject = ['$element', 'htmlFilter'];
function HTMLEditorWidget(element, htmlFilter) {
var self = this;
this.$parseModel = function() {
// need to protect for script injection
try {
this.$viewValue = htmlFilter(this.$modelValue || '').get();
if (this.$error.HTML) {
// we were invalid, but now we are OK.
this.$emit('$valid', 'HTML');
}
} catch (e) {
// if HTML not parsable invalidate form.
this.$emit('$invalid', 'HTML');
}
}
this.$render = function() {
element.html(this.$viewValue);
}
element.bind('keyup', function() {
self.$apply(function() {
self.$emit('$viewChange', element.html());
});
});
}
angular.directive('ng:contenteditable', function() {
return ['$formFactory', '$element', function ($formFactory, element) {
var exp = element.attr('ng:contenteditable'),
form = $formFactory.forElement(element),
widget;
element.attr('contentEditable', true);
widget = form.$createWidget({
scope: this,
model: exp,
controller: HTMLEditorWidget,
controllerArgs: {$element: element}});
// if the element is destroyed, then we need to notify the form.
element.bind('$destroy', function() {
widget.$destroy();
});
}];
});
</script>
<form name='editorForm' ng:controller="EditorCntl">
<div ng:contenteditable="html"></div>
<hr/>
HTML: <br/>
<textarea ng:model="html" cols=80></textarea>
<hr/>
<pre>editorForm = {{editorForm}}</pre>
</form>
</doc:source>
<doc:scenario>
it('should enter invalid HTML', function() {
expect(element('form[name=editorForm]').prop('className')).toMatch(/ng-valid/);
input('html').enter('<');
expect(element('form[name=editorForm]').prop('className')).toMatch(/ng-invalid/);
});
</doc:scenario>
</doc:example>
*/
/**
* @ngdoc object
* @name angular.module.ng.$formFactory.Form
* @description
* The `Form` is a controller which keeps track of the validity of the widgets contained within it.
*/
function $FormFactoryProvider() {
var $parse;
this.$get = ['$rootScope', '$parse', function($rootScope, $parse_) {
$parse = $parse_;
/**
* @ngdoc proprety
* @name rootForm
* @propertyOf angular.module.ng.$formFactory
* @description
* Static property on `$formFactory`
*
* Each application ({@link guide/dev_guide.scopes.internals root scope}) gets a root form which
* is the top-level parent of all forms.
*/
formFactory.rootForm = formFactory($rootScope);
/**
* @ngdoc method
* @name forElement
* @methodOf angular.module.ng.$formFactory
* @description
* Static method on `$formFactory` service.
*
* Retrieve the closest form for a given element or defaults to the `root` form. Used by the
* {@link angular.widget.form form} element.
* @param {Element} element The element where the search for form should initiate.
*/
formFactory.forElement = function(element) {
return element.inheritedData('$form') || formFactory.rootForm;
};
return formFactory;
function formFactory(parent) {
return (parent || formFactory.rootForm).$new(FormController);
}
}];
function propertiesUpdate(widget) {
widget.$valid = !(widget.$invalid =
!(widget.$readonly || widget.$disabled || equals(widget.$error, {})));
}
/**
* @ngdoc property
* @name $error
* @propertyOf angular.module.ng.$formFactory.Form
* @description
* Property of the form and widget instance.
*
* Summary of all of the errors on the page. If a widget emits `$invalid` with `REQUIRED` key,
* then the `$error` object will have a `REQUIRED` key with an array of widgets which have
* emitted this key. `form.$error.REQUIRED == [ widget ]`.
*/
/**
* @ngdoc property
* @name $invalid
* @propertyOf angular.module.ng.$formFactory.Form
* @description
* Property of the form and widget instance.
*
* True if any of the widgets of the form are invalid.
*/
/**
* @ngdoc property
* @name $valid
* @propertyOf angular.module.ng.$formFactory.Form
* @description
* Property of the form and widget instance.
*
* True if all of the widgets of the form are valid.
*/
/**
* @ngdoc event
* @name angular.module.ng.$formFactory.Form#$valid
* @eventOf angular.module.ng.$formFactory.Form
* @eventType listen on form
* @description
* Upon receiving the `$valid` event from the widget update the `$error`, `$valid` and `$invalid`
* properties of both the widget as well as the from.
*
* @param {string} validationKey The validation key to be used when updating the `$error` object.
* The validation key is what will allow the template to bind to a specific validation error
* such as `<div ng:show="form.$error.KEY">error for key</div>`.
*/
/**
* @ngdoc event
* @name angular.module.ng.$formFactory.Form#$invalid
* @eventOf angular.module.ng.$formFactory.Form
* @eventType listen on form
* @description
* Upon receiving the `$invalid` event from the widget update the `$error`, `$valid` and `$invalid`
* properties of both the widget as well as the from.
*
* @param {string} validationKey The validation key to be used when updating the `$error` object.
* The validation key is what will allow the template to bind to a specific validation error
* such as `<div ng:show="form.$error.KEY">error for key</div>`.
*/
/**
* @ngdoc event
* @name angular.module.ng.$formFactory.Form#$validate
* @eventOf angular.module.ng.$formFactory.Form
* @eventType emit on widget
* @description
* Emit the `$validate` event on the widget, giving a widget a chance to emit a
* `$valid` / `$invalid` event base on its state. The `$validate` event is triggered when the
* model or the view changes.
*/
/**
* @ngdoc event
* @name angular.module.ng.$formFactory.Form#$viewChange
* @eventOf angular.module.ng.$formFactory.Form
* @eventType listen on widget
* @description
* A widget is responsible for emitting this event whenever the view changes do to user interaction.
* The event takes a `$viewValue` parameter, which is the new value of the view. This
* event triggers a call to `$parseView()` as well as `$validate` event on widget.
*
* @param {*} viewValue The new value for the view which will be assigned to `widget.$viewValue`.
*/
function FormController() {
var form = this,
$error = form.$error = {};
form.$on('$destroy', function(event){
var widget = event.targetScope;
if (widget.$widgetId) {
delete form[widget.$widgetId];
}
forEach($error, removeWidget, widget);
});
form.$on('$valid', function(event, error){
var widget = event.targetScope;
delete widget.$error[error];
propertiesUpdate(widget);
removeWidget($error[error], error, widget);
});
form.$on('$invalid', function(event, error){
var widget = event.targetScope;
addWidget(error, widget);
widget.$error[error] = true;
propertiesUpdate(widget);
});
propertiesUpdate(form);
function removeWidget(queue, errorKey, widget) {
if (queue) {
widget = widget || this; // so that we can be used in forEach;
for (var i = 0, length = queue.length; i < length; i++) {
if (queue[i] === widget) {
queue.splice(i, 1);
if (!queue.length) {
delete $error[errorKey];
}
}
}
propertiesUpdate(form);
}
}
function addWidget(errorKey, widget) {
var queue = $error[errorKey];
if (queue) {
for (var i = 0, length = queue.length; i < length; i++) {
if (queue[i] === widget) {
return;
}
}
} else {
$error[errorKey] = queue = [];
}
queue.push(widget);
propertiesUpdate(form);
}
}
/**
* @ngdoc method
* @name $createWidget
* @methodOf angular.module.ng.$formFactory.Form
* @description
*
* Use form's `$createWidget` instance method to create new widgets. The widgets can be created
* using an alias which makes the accessible from the form and available for data-binding,
* useful for displaying validation error messages.
*
* The creation of a widget sets up:
*
* - `$watch` of `expression` on `model` scope. This code path syncs the model to the view.
* The `$watch` listener will:
*
* - assign the new model value of `expression` to `widget.$modelValue`.
* - call `widget.$parseModel` method if present. The `$parseModel` is responsible for copying
* the `widget.$modelValue` to `widget.$viewValue` and optionally converting the data.
* (For example to convert a number into string)
* - emits `$validate` event on widget giving a widget a chance to emit `$valid` / `$invalid`
* event.
* - call `widget.$render()` method on widget. The `$render` method is responsible for
* reading the `widget.$viewValue` and updating the DOM.
*
* - Listen on `$viewChange` event from the `widget`. This code path syncs the view to the model.
* The `$viewChange` listener will:
*
* - assign the value to `widget.$viewValue`.
* - call `widget.$parseView` method if present. The `$parseView` is responsible for copying
* the `widget.$viewValue` to `widget.$modelValue` and optionally converting the data.
* (For example to convert a string into number)
* - emits `$validate` event on widget giving a widget a chance to emit `$valid` / `$invalid`
* event.
* - Assign the `widget.$modelValue` to the `expression` on the `model` scope.
*
* - Creates these set of properties on the `widget` which are updated as a response to the
* `$valid` / `$invalid` events:
*
* - `$error` - object - validation errors will be published as keys on this object.
* Data-binding to this property is useful for displaying the validation errors.
* - `$valid` - boolean - true if there are no validation errors
* - `$invalid` - boolean - opposite of `$valid`.
* @param {Object} params Named parameters:
*
* - `scope` - `{Scope}` - The scope to which the model for this widget is attached.
* - `model` - `{string}` - The name of the model property on model scope.
* - `controller` - {WidgetController} - The controller constructor function.
* The controller constructor should create these instance methods.
* - `$parseView()`: optional method responsible for copying `$viewVale` to `$modelValue`.
* The method may fire `$valid`/`$invalid` events.
* - `$parseModel()`: optional method responsible for copying `$modelVale` to `$viewValue`.
* The method may fire `$valid`/`$invalid` events.
* - `$render()`: required method which needs to update the DOM of the widget to match the
* `$viewValue`.
*
* - `controllerArgs` - `{Array}` (Optional) - Any extra arguments will be curried to the
* WidgetController constructor.
* - `onChange` - `{(string|function())}` (Optional) - Expression to execute when user changes the
* value.
* - `alias` - `{string}` (Optional) - The name of the form property under which the widget
* instance should be published. The name should be unique for each form.
* @returns {Widget} Instance of a widget scope.
*/
FormController.prototype.$createWidget = function(params) {
var form = this,
modelScope = params.scope,
onChange = params.onChange,
alias = params.alias,
scopeGet = $parse(params.model),
scopeSet = scopeGet.assign,
widget = this.$new(params.controller, params.controllerArgs);
if (!scopeSet) {
throw Error("Expression '" + params.model + "' is not assignable!");
};
widget.$error = {};
// Set the state to something we know will change to get the process going.
widget.$modelValue = Number.NaN;
// watch for scope changes and update the view appropriately
modelScope.$watch(scopeGet, function(scope, value) {
if (!equals(widget.$modelValue, value)) {
widget.$modelValue = value;
widget.$parseModel ? widget.$parseModel() : (widget.$viewValue = value);
widget.$emit('$validate');
widget.$render && widget.$render();
}
});
widget.$on('$viewChange', function(event, viewValue){
if (!equals(widget.$viewValue, viewValue)) {
widget.$viewValue = viewValue;
widget.$parseView ? widget.$parseView() : (widget.$modelValue = widget.$viewValue);
scopeSet(modelScope, widget.$modelValue);
if (onChange) modelScope.$eval(onChange);
widget.$emit('$validate');
}
});
propertiesUpdate(widget);
// assign the widgetModel to the form
if (alias && !form.hasOwnProperty(alias)) {
form[alias] = widget;
widget.$widgetId = alias;
} else {
alias = null;
}
return widget;
};
}
'use strict';
function $InterpolateProvider(){
this.$get = ['$parse', function($parse){
return function(text, templateOnly) {
var bindings = parseBindings(text);
if (hasBindings(bindings) || !templateOnly) {
return compileBindTemplate(text);
}
};
}];
}
var bindTemplateCache = {};
function compileBindTemplate(template){
var fn = bindTemplateCache[template];
if (!fn) {
var bindings = [];
forEach(parseBindings(template), function(text){
var exp = binding(text);
bindings.push(exp
? function(scope, element) { return scope.$eval(exp); }
: function() { return text; });
});
bindTemplateCache[template] = fn = function(scope, element, prettyPrintJson) {
var parts = [],
hadOwnElement = scope.hasOwnProperty('$element'),
oldElement = scope.$element;
// TODO(misko): get rid of $element
scope.$element = element;
try {
for (var i = 0; i < bindings.length; i++) {
var value = bindings[i](scope, element);
if (isElement(value))
value = '';
else if (isObject(value))
value = toJson(value, prettyPrintJson);
parts.push(value);
}
return parts.join('');
} finally {
if (hadOwnElement) {
scope.$element = oldElement;
} else {
delete scope.$element;
}
}
};
}
return fn;
}
function parseBindings(string) {
var results = [];
var lastIndex = 0;
var index;
while((index = string.indexOf('{{', lastIndex)) > -1) {
if (lastIndex < index)
results.push(string.substr(lastIndex, index - lastIndex));
lastIndex = index;
index = string.indexOf('}}', index);
index = index < 0 ? string.length : index + 2;
results.push(string.substr(lastIndex, index - lastIndex));
lastIndex = index;
}
if (lastIndex != string.length)
results.push(string.substr(lastIndex, string.length - lastIndex));
return results.length === 0 ? [ string ] : results;
}
function binding(string) {
var binding = string.replace(/\n/gm, ' ').match(/^\{\{(.*)\}\}$/);
return binding ? binding[1] : null;
}
function hasBindings(bindings) {
return bindings.length > 1 || binding(bindings[0]) !== null;
}
'use strict';
var URL_MATCH = /^(file|ftp|http|https):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,
PATH_MATCH = /^([^\?#]*)?(\?([^#]*))?(#(.*))?$/,
HASH_MATCH = PATH_MATCH,
DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};
/**
* Encode path using encodeUriSegment, ignoring forward slashes
*
* @param {string} path Path to encode
* @returns {string}
*/
function encodePath(path) {
var segments = path.split('/'),
i = segments.length;
while (i--) {
segments[i] = encodeUriSegment(segments[i]);
}
return segments.join('/');
}
function matchUrl(url, obj) {
var match = URL_MATCH.exec(url);
match = {
protocol: match[1],
host: match[3],
port: parseInt(match[5], 10) || DEFAULT_PORTS[match[1]] || null,
path: match[6] || '/',
search: match[8],
hash: match[10]
};
if (obj) {
obj.$$protocol = match.protocol;
obj.$$host = match.host;
obj.$$port = match.port;
}
return match;
}
function composeProtocolHostPort(protocol, host, port) {
return protocol + '://' + host + (port == DEFAULT_PORTS[protocol] ? '' : ':' + port);
}
function pathPrefixFromBase(basePath) {
return basePath.substr(0, basePath.lastIndexOf('/'));
}
function convertToHtml5Url(url, basePath, hashPrefix) {
var match = matchUrl(url);
// already html5 url
if (decodeURIComponent(match.path) != basePath || isUndefined(match.hash) ||
match.hash.indexOf(hashPrefix) !== 0) {
return url;
// convert hashbang url -> html5 url
} else {
return composeProtocolHostPort(match.protocol, match.host, match.port) +
pathPrefixFromBase(basePath) + match.hash.substr(hashPrefix.length);
}
}
function convertToHashbangUrl(url, basePath, hashPrefix) {
var match = matchUrl(url);
// already hashbang url
if (decodeURIComponent(match.path) == basePath) {
return url;
// convert html5 url -> hashbang url
} else {
var search = match.search && '?' + match.search || '',
hash = match.hash && '#' + match.hash || '',
pathPrefix = pathPrefixFromBase(basePath),
path = match.path.substr(pathPrefix.length);
if (match.path.indexOf(pathPrefix) !== 0) {
throw 'Invalid url "' + url + '", missing path prefix "' + pathPrefix + '" !';
}
return composeProtocolHostPort(match.protocol, match.host, match.port) + basePath +
'#' + hashPrefix + path + search + hash;
}
}
/**
* LocationUrl represents an url
* This object is exposed as $location service when HTML5 mode is enabled and supported
*
* @constructor
* @param {string} url HTML5 url
* @param {string} pathPrefix
*/
function LocationUrl(url, pathPrefix) {
pathPrefix = pathPrefix || '';
/**
* Parse given html5 (regular) url string into properties
* @param {string} url HTML5 url
* @private
*/
this.$$parse = function(url) {
var match = matchUrl(url, this);
if (match.path.indexOf(pathPrefix) !== 0) {
throw 'Invalid url "' + url + '", missing path prefix "' + pathPrefix + '" !';
}
this.$$path = decodeURIComponent(match.path.substr(pathPrefix.length));
this.$$search = parseKeyValue(match.search);
this.$$hash = match.hash && decodeURIComponent(match.hash) || '';
this.$$compose();
};
/**
* Compose url and update `absUrl` property
* @private
*/
this.$$compose = function() {
var search = toKeyValue(this.$$search),
hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
this.$$absUrl = composeProtocolHostPort(this.$$protocol, this.$$host, this.$$port) +
pathPrefix + this.$$url;
};
this.$$parse(url);
}
/**
* LocationHashbangUrl represents url
* This object is exposed as $location service when html5 history api is disabled or not supported
*
* @constructor
* @param {string} url Legacy url
* @param {string} hashPrefix Prefix for hash part (containing path and search)
*/
function LocationHashbangUrl(url, hashPrefix) {
var basePath;
/**
* Parse given hashbang url into properties
* @param {string} url Hashbang url
* @private
*/
this.$$parse = function(url) {
var match = matchUrl(url, this);
if (match.hash && match.hash.indexOf(hashPrefix) !== 0) {
throw 'Invalid url "' + url + '", missing hash prefix "' + hashPrefix + '" !';
}
basePath = match.path + (match.search ? '?' + match.search : '');
match = HASH_MATCH.exec((match.hash || '').substr(hashPrefix.length));
if (match[1]) {
this.$$path = (match[1].charAt(0) == '/' ? '' : '/') + decodeURIComponent(match[1]);
} else {
this.$$path = '';
}
this.$$search = parseKeyValue(match[3]);
this.$$hash = match[5] && decodeURIComponent(match[5]) || '';
this.$$compose();
};
/**
* Compose hashbang url and update `absUrl` property
* @private
*/
this.$$compose = function() {
var search = toKeyValue(this.$$search),
hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
this.$$absUrl = composeProtocolHostPort(this.$$protocol, this.$$host, this.$$port) +
basePath + (this.$$url ? '#' + hashPrefix + this.$$url : '');
};
this.$$parse(url);
}
LocationUrl.prototype = {
/**
* Has any change been replacing ?
* @private
*/
$$replace: false,
/**
* @ngdoc method
* @name angular.module.ng.$location#absUrl
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter only.
*
* Return full url representation with all segments encoded according to rules specified in
* {@link http://www.ietf.org/rfc/rfc3986.txt RFC 3986}.
*
* @return {string}
*/
absUrl: locationGetter('$$absUrl'),
/**
* @ngdoc method
* @name angular.module.ng.$location#url
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter / setter.
*
* Return url (e.g. `/path?a=b#hash`) when called without any parameter.
*
* Change path, search and hash, when called with parameter and return `$location`.
*
* @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)
* @return {string}
*/
url: function(url, replace) {
if (isUndefined(url))
return this.$$url;
var match = PATH_MATCH.exec(url);
if (match[1]) this.path(decodeURIComponent(match[1]));
if (match[2] || match[1]) this.search(match[3] || '');
this.hash(match[5] || '', replace);
return this;
},
/**
* @ngdoc method
* @name angular.module.ng.$location#protocol
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter only.
*
* Return protocol of current url.
*
* @return {string}
*/
protocol: locationGetter('$$protocol'),
/**
* @ngdoc method
* @name angular.module.ng.$location#host
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter only.
*
* Return host of current url.
*
* @return {string}
*/
host: locationGetter('$$host'),
/**
* @ngdoc method
* @name angular.module.ng.$location#port
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter only.
*
* Return port of current url.
*
* @return {Number}
*/
port: locationGetter('$$port'),
/**
* @ngdoc method
* @name angular.module.ng.$location#path
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter / setter.
*
* Return path of current url when called without any parameter.
*
* Change path when called with parameter and return `$location`.
*
* Note: Path should always begin with forward slash (/), this method will add the forward slash
* if it is missing.
*
* @param {string=} path New path
* @return {string}
*/
path: locationGetterSetter('$$path', function(path) {
return path.charAt(0) == '/' ? path : '/' + path;
}),
/**
* @ngdoc method
* @name angular.module.ng.$location#search
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter / setter.
*
* Return search part (as object) of current url when called without any parameter.
*
* Change search part when called with parameter and return `$location`.
*
* @param {string|object<string,string>=} search New search params - string or hash object
* @param {string=} paramValue If `search` is a string, then `paramValue` will override only a
* single search parameter. If the value is `null`, the parameter will be deleted.
*
* @return {string}
*/
search: function(search, paramValue) {
if (isUndefined(search))
return this.$$search;
if (isDefined(paramValue)) {
if (paramValue === null) {
delete this.$$search[search];
} else {
this.$$search[search] = encodeUriQuery(paramValue);
}
} else {
this.$$search = isString(search) ? parseKeyValue(search) : search;
}
this.$$compose();
return this;
},
/**
* @ngdoc method
* @name angular.module.ng.$location#hash
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter / setter.
*
* Return hash fragment when called without any parameter.
*
* Change hash fragment when called with parameter and return `$location`.
*
* @param {string=} hash New hash fragment
* @return {string}
*/
hash: locationGetterSetter('$$hash', identity),
/**
* @ngdoc method
* @name angular.module.ng.$location#replace
* @methodOf angular.module.ng.$location
*
* @description
* If called, all changes to $location during current `$digest` will be replacing current history
* record, instead of adding new one.
*/
replace: function() {
this.$$replace = true;
return this;
}
};
LocationHashbangUrl.prototype = inherit(LocationUrl.prototype);
function locationGetter(property) {
return function() {
return this[property];
};
}
function locationGetterSetter(property, preprocess) {
return function(value) {
if (isUndefined(value))
return this[property];
this[property] = preprocess(value);
this.$$compose();
return this;
};
}
/**
* @ngdoc object
* @name angular.module.ng.$location
*
* @requires $browser
* @requires $sniffer
* @requires $document
*
* @description
* The $location service parses the URL in the browser address bar (based on the {@link https://developer.mozilla.org/en/window.location window.location}) and makes the URL available to your application. Changes to the URL in the address bar are reflected into $location service and changes to $location are reflected into the browser address bar.
*
* **The $location service:**
*
* - Exposes the current URL in the browser address bar, so you can
* - Watch and observe the URL.
* - Change the URL.
* - Synchronizes the URL with the browser when the user
* - Changes the address bar.
* - Clicks the back or forward button (or clicks a History link).
* - Clicks on a link.
* - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).
*
* For more information see {@link guide/dev_guide.services.$location Developer Guide: Angular Services: Using $location}
*/
/**
* @ngdoc object
* @name angular.module.ng.$locationProvider
* @description
* Use the `$locationProvider` to configure how the application deep linking paths are stored.
*/
function $LocationProvider(){
var hashPrefix = '',
html5Mode = false;
/**
* @ngdoc property
* @name angular.module.ng.$locationProvider#hashPrefix
* @methodOf angular.module.ng.$locationProvider
* @description
* @param {string=} prefix Prefix for hash part (containing path and search)
* @returns {*} current value if used as getter or itself (chaining) if used as setter
*/
this.hashPrefix = function(prefix) {
if (isDefined(prefix)) {
hashPrefix = prefix;
return this;
} else {
return hashPrefix;
}
}
/**
* @ngdoc property
* @name angular.module.ng.$locationProvider#html5Mode
* @methodOf angular.module.ng.$locationProvider
* @description
* @param {string=} mode Use HTML5 strategy if available.
* @returns {*} current value if used as getter or itself (chaining) if used as setter
*/
this.html5Mode = function(mode) {
if (isDefined(mode)) {
html5Mode = mode;
return this;
} else {
return html5Mode;
}
};
this.$get = ['$rootScope', '$browser', '$sniffer', '$document',
function( $rootScope, $browser, $sniffer, $document) {
var currentUrl,
basePath = $browser.baseHref() || '/',
pathPrefix = pathPrefixFromBase(basePath),
initUrl = $browser.url();
if (html5Mode) {
if ($sniffer.history) {
currentUrl = new LocationUrl(convertToHtml5Url(initUrl, basePath, hashPrefix), pathPrefix);
} else {
currentUrl = new LocationHashbangUrl(convertToHashbangUrl(initUrl, basePath, hashPrefix),
hashPrefix);
}
// link rewriting
var u = currentUrl,
absUrlPrefix = composeProtocolHostPort(u.protocol(), u.host(), u.port()) + pathPrefix;
$document.bind('click', function(event) {
// TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)
// currently we open nice url link and redirect then
if (event.ctrlKey || event.metaKey || event.which == 2) return;
var elm = jqLite(event.target);
// traverse the DOM up to find first A tag
while (elm.length && lowercase(elm[0].nodeName) !== 'a') {
elm = elm.parent();
}
var href = elm.attr('href');
if (!href || isDefined(elm.attr('ng:ext-link')) || elm.attr('target')) return;
// remove same domain from full url links (IE7 always returns full hrefs)
href = href.replace(absUrlPrefix, '');
// link to different domain (or base path)
if (href.substr(0, 4) == 'http') return;
// remove pathPrefix from absolute links
href = href.indexOf(pathPrefix) === 0 ? href.substr(pathPrefix.length) : href;
currentUrl.url(href);
$rootScope.$apply();
event.preventDefault();
// hack to work around FF6 bug 684208 when scenario runner clicks on links
window.angular['ff-684208-preventDefault'] = true;
});
} else {
currentUrl = new LocationHashbangUrl(initUrl, hashPrefix);
}
// rewrite hashbang url <> html5 url
if (currentUrl.absUrl() != initUrl) {
$browser.url(currentUrl.absUrl(), true);
}
// update $location when $browser url changes
$browser.onUrlChange(function(newUrl) {
if (currentUrl.absUrl() != newUrl) {
$rootScope.$evalAsync(function() {
currentUrl.$$parse(newUrl);
});
if (!$rootScope.$$phase) $rootScope.$digest();
}
});
// update browser
var changeCounter = 0;
$rootScope.$watch(function $locationWatch() {
if ($browser.url() != currentUrl.absUrl()) {
changeCounter++;
$rootScope.$evalAsync(function() {
$browser.url(currentUrl.absUrl(), currentUrl.$$replace);
currentUrl.$$replace = false;
});
}
return changeCounter;
});
return currentUrl;
}];
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$log
* @requires $window
*
* @description
* Simple service for logging. Default implementation writes the message
* into the browser's console (if present).
*
* The main purpose of this service is to simplify debugging and troubleshooting.
*
* @example
<doc:example>
<doc:source>
<script>
function LogCtrl($log) {
this.$log = $log;
this.message = 'Hello World!';
}
</script>
<div ng:controller="LogCtrl">
<p>Reload this page with open console, enter text and hit the log button...</p>
Message:
<input type="text" ng:model="message"/>
<button ng:click="$log.log(message)">log</button>
<button ng:click="$log.warn(message)">warn</button>
<button ng:click="$log.info(message)">info</button>
<button ng:click="$log.error(message)">error</button>
</div>
</doc:source>
<doc:scenario>
</doc:scenario>
</doc:example>
*/
function $LogProvider(){
this.$get = ['$window', function($window){
return {
/**
* @ngdoc method
* @name angular.module.ng.$log#log
* @methodOf angular.module.ng.$log
*
* @description
* Write a log message
*/
log: consoleLog('log'),
/**
* @ngdoc method
* @name angular.module.ng.$log#warn
* @methodOf angular.module.ng.$log
*
* @description
* Write a warning message
*/
warn: consoleLog('warn'),
/**
* @ngdoc method
* @name angular.module.ng.$log#info
* @methodOf angular.module.ng.$log
*
* @description
* Write an information message
*/
info: consoleLog('info'),
/**
* @ngdoc method
* @name angular.module.ng.$log#error
* @methodOf angular.module.ng.$log
*
* @description
* Write an error message
*/
error: consoleLog('error')
};
function formatError(arg) {
if (arg instanceof Error) {
if (arg.stack) {
arg = (arg.message && arg.stack.indexOf(arg.message) === -1) ?
'Error: ' + arg.message + '\n' + arg.stack : arg.stack;
} else if (arg.sourceURL) {
arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line;
}
}
return arg;
}
function consoleLog(type) {
var console = $window.console || {};
var logFn = console[type] || console.log || noop;
if (logFn.apply) {
return function() {
var args = [];
forEach(arguments, function(arg){
args.push(formatError(arg));
});
return logFn.apply(console, args);
};
} else {
// we are IE, in which case there is nothing we can do
return logFn;
}
}
}];
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$resource
* @requires $http
*
* @description
* A factory which creates a resource object that lets you interact with
* [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources.
*
* The returned resource object has action methods which provide high-level behaviors without
* the need to interact with the low level {@link angular.module.ng.$http $http} service.
*
* @param {string} url A parameterized URL template with parameters prefixed by `:` as in
* `/user/:username`.
*
* @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
* `actions` methods.
*
* Each key value in the parameter object is first bound to url template if present and then any
* excess keys are appended to the url search query after the `?`.
*
* Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in
* URL `/path/greet?salutation=Hello`.
*
* If the parameter value is prefixed with `@` then the value of that parameter is extracted from
* the data object (useful for non-GET operations).
*
* @param {Object.<Object>=} actions Hash with declaration of custom action that should extend the
* default set of resource actions. The declaration should be created in the following format:
*
* {action1: {method:?, params:?, isArray:?},
* action2: {method:?, params:?, isArray:?},
* ...}
*
* Where:
*
* - `action` – {string} – The name of action. This name becomes the name of the method on your
* resource object.
* - `method` – {string} – HTTP request method. Valid methods are: `GET`, `POST`, `PUT`, `DELETE`,
* and `JSONP`
* - `params` – {object=} – Optional set of pre-bound parameters for this action.
* - isArray – {boolean=} – If true then the returned object for this action is an array, see
* `returns` section.
*
* @returns {Object} A resource "class" object with methods for the default set of resource actions
* optionally extended with custom `actions`. The default set contains these actions:
*
* { 'get': {method:'GET'},
* 'save': {method:'POST'},
* 'query': {method:'GET', isArray:true},
* 'remove': {method:'DELETE'},
* 'delete': {method:'DELETE'} };
*
* Calling these methods invoke an {@link angular.module.ng.$http} with the specified http method,
* destination and parameters. When the data is returned from the server then the object is an
* instance of the resource class `save`, `remove` and `delete` actions are available on it as
* methods with the `$` prefix. This allows you to easily perform CRUD operations (create, read,
* update, delete) on server-side data like this:
* <pre>
var User = $resource('/user/:userId', {userId:'@id'});
var user = User.get({userId:123}, function() {
user.abc = true;
user.$save();
});
</pre>
*
* It is important to realize that invoking a $resource object method immediately returns an
* empty reference (object or array depending on `isArray`). Once the data is returned from the
* server the existing reference is populated with the actual data. This is a useful trick since
* usually the resource is assigned to a model which is then rendered by the view. Having an empty
* object results in no rendering, once the data arrives from the server then the object is
* populated with the data and the view automatically re-renders itself showing the new data. This
* means that in most case one never has to write a callback function for the action methods.
*
* The action methods on the class object or instance object can be invoked with the following
* parameters:
*
* - HTTP GET "class" actions: `Resource.action([parameters], [success], [error])`
* - non-GET "class" actions: `Resource.action([parameters], postData, [success], [error])`
* - non-GET instance actions: `instance.$action([parameters], [success], [error])`
*
*
* @example
*
* # Credit card resource
*
* <pre>
// Define CreditCard class
var CreditCard = $resource('/user/:userId/card/:cardId',
{userId:123, cardId:'@id'}, {
charge: {method:'POST', params:{charge:true}}
});
// We can retrieve a collection from the server
var cards = CreditCard.query();
// GET: /user/123/card
// server returns: [ {id:456, number:'1234', name:'Smith'} ];
var card = cards[0];
// each item is an instance of CreditCard
expect(card instanceof CreditCard).toEqual(true);
card.name = "J. Smith";
// non GET methods are mapped onto the instances
card.$save();
// POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'}
// server returns: {id:456, number:'1234', name: 'J. Smith'};
// our custom method is mapped as well.
card.$charge({amount:9.99});
// POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'}
// server returns: {id:456, number:'1234', name: 'J. Smith'};
// we can create an instance as well
var newCard = new CreditCard({number:'0123'});
newCard.name = "Mike Smith";
newCard.$save();
// POST: /user/123/card {number:'0123', name:'Mike Smith'}
// server returns: {id:789, number:'01234', name: 'Mike Smith'};
expect(newCard.id).toEqual(789);
* </pre>
*
* The object returned from this function execution is a resource "class" which has "static" method
* for each action in the definition.
*
* Calling these methods invoke `$http` on the `url` template with the given `method` and `params`.
* When the data is returned from the server then the object is an instance of the resource type and
* all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD
* operations (create, read, update, delete) on server-side data.
<pre>
var User = $resource('/user/:userId', {userId:'@id'});
var user = User.get({userId:123}, function() {
user.abc = true;
user.$save();
});
</pre>
*
* It's worth noting that the success callback for `get`, `query` and other method gets passed
* in the response that came from the server as well as $http header getter function, so one
* could rewrite the above example and get access to http headers as:
*
<pre>
var User = $resource('/user/:userId', {userId:'@id'});
User.get({userId:123}, function(u, getResponseHeaders){
u.abc = true;
u.$save(function(u, putResponseHeaders) {
//u => saved user object
//putResponseHeaders => $http header getter
});
});
</pre>
* # Buzz client
Let's look at what a buzz client created with the `$resource` service looks like:
<doc:example>
<doc:source jsfiddle="false">
<script>
function BuzzController($resource) {
this.userId = 'googlebuzz';
this.Activity = $resource(
'https://www.googleapis.com/buzz/v1/activities/:userId/:visibility/:activityId/:comments',
{alt:'json', callback:'JSON_CALLBACK'},
{get:{method:'JSONP', params:{visibility:'@self'}}, replies: {method:'JSONP', params:{visibility:'@self', comments:'@comments'}}}
);
}
BuzzController.prototype = {
fetch: function() {
this.activities = this.Activity.get({userId:this.userId});
},
expandReplies: function(activity) {
activity.replies = this.Activity.replies({userId:this.userId, activityId:activity.id});
}
};
BuzzController.$inject = ['$resource'];
</script>
<div ng:controller="BuzzController">
<input ng:model="userId"/>
<button ng:click="fetch()">fetch</button>
<hr/>
<div ng:repeat="item in activities.data.items">
<h1 style="font-size: 15px;">
<img src="{{item.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
<a href="{{item.actor.profileUrl}}">{{item.actor.name}}</a>
<a href ng:click="expandReplies(item)" style="float: right;">Expand replies: {{item.links.replies[0].count}}</a>
</h1>
{{item.object.content | html}}
<div ng:repeat="reply in item.replies.data.items" style="margin-left: 20px;">
<img src="{{reply.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
<a href="{{reply.actor.profileUrl}}">{{reply.actor.name}}</a>: {{reply.content | html}}
</div>
</div>
</div>
</doc:source>
<doc:scenario>
</doc:scenario>
</doc:example>
*/
function $ResourceProvider() {
this.$get = ['$http', function($http) {
var resource = new ResourceFactory($http);
return bind(resource, resource.route);
}];
}
'use strict';
var OPERATORS = {
'null':function(self){return null;},
'true':function(self){return true;},
'false':function(self){return false;},
$undefined:noop,
'+':function(self, a,b){a=a(self); b=b(self); return (isDefined(a)?a:0)+(isDefined(b)?b:0);},
'-':function(self, a,b){a=a(self); b=b(self); return (isDefined(a)?a:0)-(isDefined(b)?b:0);},
'*':function(self, a,b){return a(self)*b(self);},
'/':function(self, a,b){return a(self)/b(self);},
'%':function(self, a,b){return a(self)%b(self);},
'^':function(self, a,b){return a(self)^b(self);},
'=':noop,
'==':function(self, a,b){return a(self)==b(self);},
'!=':function(self, a,b){return a(self)!=b(self);},
'<':function(self, a,b){return a(self)<b(self);},
'>':function(self, a,b){return a(self)>b(self);},
'<=':function(self, a,b){return a(self)<=b(self);},
'>=':function(self, a,b){return a(self)>=b(self);},
'&&':function(self, a,b){return a(self)&&b(self);},
'||':function(self, a,b){return a(self)||b(self);},
'&':function(self, a,b){return a(self)&b(self);},
// '|':function(self, a,b){return a|b;},
'|':function(self, a,b){return b(self)(self, a(self));},
'!':function(self, a){return !a(self);}
};
var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'};
function lex(text){
var tokens = [],
token,
index = 0,
json = [],
ch,
lastCh = ':'; // can start regexp
while (index < text.length) {
ch = text.charAt(index);
if (is('"\'')) {
readString(ch);
} else if (isNumber(ch) || is('.') && isNumber(peek())) {
readNumber();
} else if (isIdent(ch)) {
readIdent();
// identifiers can only be if the preceding char was a { or ,
if (was('{,') && json[0]=='{' &&
(token=tokens[tokens.length-1])) {
token.json = token.text.indexOf('.') == -1;
}
} else if (is('(){}[].,;:')) {
tokens.push({
index:index,
text:ch,
json:(was(':[,') && is('{[')) || is('}]:,')
});
if (is('{[')) json.unshift(ch);
if (is('}]')) json.shift();
index++;
} else if (isWhitespace(ch)) {
index++;
continue;
} else {
var ch2 = ch + peek(),
fn = OPERATORS[ch],
fn2 = OPERATORS[ch2];
if (fn2) {
tokens.push({index:index, text:ch2, fn:fn2});
index += 2;
} else if (fn) {
tokens.push({index:index, text:ch, fn:fn, json: was('[,:') && is('+-')});
index += 1;
} else {
throwError("Unexpected next character ", index, index+1);
}
}
lastCh = ch;
}
return tokens;
function is(chars) {
return chars.indexOf(ch) != -1;
}
function was(chars) {
return chars.indexOf(lastCh) != -1;
}
function peek() {
return index + 1 < text.length ? text.charAt(index + 1) : false;
}
function isNumber(ch) {
return '0' <= ch && ch <= '9';
}
function isWhitespace(ch) {
return ch == ' ' || ch == '\r' || ch == '\t' ||
ch == '\n' || ch == '\v' || ch == '\u00A0'; // IE treats non-breaking space as \u00A0
}
function isIdent(ch) {
return 'a' <= ch && ch <= 'z' ||
'A' <= ch && ch <= 'Z' ||
'_' == ch || ch == '$';
}
function isExpOperator(ch) {
return ch == '-' || ch == '+' || isNumber(ch);
}
function throwError(error, start, end) {
end = end || index;
throw Error("Lexer Error: " + error + " at column" +
(isDefined(start)
? "s " + start + "-" + index + " [" + text.substring(start, end) + "]"
: " " + end) +
" in expression [" + text + "].");
}
function readNumber() {
var number = "";
var start = index;
while (index < text.length) {
var ch = lowercase(text.charAt(index));
if (ch == '.' || isNumber(ch)) {
number += ch;
} else {
var peekCh = peek();
if (ch == 'e' && isExpOperator(peekCh)) {
number += ch;
} else if (isExpOperator(ch) &&
peekCh && isNumber(peekCh) &&
number.charAt(number.length - 1) == 'e') {
number += ch;
} else if (isExpOperator(ch) &&
(!peekCh || !isNumber(peekCh)) &&
number.charAt(number.length - 1) == 'e') {
throwError('Invalid exponent');
} else {
break;
}
}
index++;
}
number = 1 * number;
tokens.push({index:start, text:number, json:true,
fn:function() {return number;}});
}
function readIdent() {
var ident = "";
var start = index;
var fn;
while (index < text.length) {
var ch = text.charAt(index);
if (ch == '.' || isIdent(ch) || isNumber(ch)) {
ident += ch;
} else {
break;
}
index++;
}
fn = OPERATORS[ident];
tokens.push({
index:start,
text:ident,
json: fn,
fn:fn||extend(getterFn(ident), {
assign:function(self, value){
return setter(self, ident, value);
}
})
});
}
function readString(quote) {
var start = index;
index++;
var string = "";
var rawString = quote;
var escape = false;
while (index < text.length) {
var ch = text.charAt(index);
rawString += ch;
if (escape) {
if (ch == 'u') {
var hex = text.substring(index + 1, index + 5);
if (!hex.match(/[\da-f]{4}/i))
throwError( "Invalid unicode escape [\\u" + hex + "]");
index += 4;
string += String.fromCharCode(parseInt(hex, 16));
} else {
var rep = ESCAPE[ch];
if (rep) {
string += rep;
} else {
string += ch;
}
}
escape = false;
} else if (ch == '\\') {
escape = true;
} else if (ch == quote) {
index++;
tokens.push({
index:start,
text:rawString,
string:string,
json:true,
fn:function() { return string; }
});
return;
} else {
string += ch;
}
index++;
}
throwError("Unterminated quote", start);
}
}
/////////////////////////////////////////
function parser(text, json, $filter){
var ZERO = valueFn(0),
value,
tokens = lex(text),
assignment = _assignment,
assignable = logicalOR,
functionCall = _functionCall,
fieldAccess = _fieldAccess,
objectIndex = _objectIndex,
filterChain = _filterChain,
functionIdent = _functionIdent;
if(json){
// The extra level of aliasing is here, just in case the lexer misses something, so that
// we prevent any accidental execution in JSON.
assignment = logicalOR;
functionCall =
fieldAccess =
objectIndex =
assignable =
filterChain =
functionIdent =
function() { throwError("is not valid json", {text:text, index:0}); };
value = primary();
} else {
value = statements();
}
if (tokens.length !== 0) {
throwError("is an unexpected token", tokens[0]);
}
return value;
///////////////////////////////////
function throwError(msg, token) {
throw Error("Syntax Error: Token '" + token.text +
"' " + msg + " at column " +
(token.index + 1) + " of the expression [" +
text + "] starting at [" + text.substring(token.index) + "].");
}
function peekToken() {
if (tokens.length === 0)
throw Error("Unexpected end of expression: " + text);
return tokens[0];
}
function peek(e1, e2, e3, e4) {
if (tokens.length > 0) {
var token = tokens[0];
var t = token.text;
if (t==e1 || t==e2 || t==e3 || t==e4 ||
(!e1 && !e2 && !e3 && !e4)) {
return token;
}
}
return false;
}
function expect(e1, e2, e3, e4){
var token = peek(e1, e2, e3, e4);
if (token) {
if (json && !token.json) {
throwError("is not valid json", token);
}
tokens.shift();
return token;
}
return false;
}
function consume(e1){
if (!expect(e1)) {
throwError("is unexpected, expecting [" + e1 + "]", peek());
}
}
function unaryFn(fn, right) {
return function(self) {
return fn(self, right);
};
}
function binaryFn(left, fn, right) {
return function(self) {
return fn(self, left, right);
};
}
function hasTokens () {
return tokens.length > 0;
}
function statements() {
var statements = [];
while(true) {
if (tokens.length > 0 && !peek('}', ')', ';', ']'))
statements.push(filterChain());
if (!expect(';')) {
// optimize for the common case where there is only one statement.
// TODO(size): maybe we should not support multiple statements?
return statements.length == 1
? statements[0]
: function(self){
var value;
for ( var i = 0; i < statements.length; i++) {
var statement = statements[i];
if (statement)
value = statement(self);
}
return value;
};
}
}
}
function _filterChain() {
var left = expression();
var token;
while(true) {
if ((token = expect('|'))) {
left = binaryFn(left, token.fn, filter());
} else {
return left;
}
}
}
function filter() {
var token = expect();
var fn = $filter(token.text);
var argsFn = [];
while(true) {
if ((token = expect(':'))) {
argsFn.push(expression());
} else {
var fnInvoke = function(self, input){
var args = [input];
for ( var i = 0; i < argsFn.length; i++) {
args.push(argsFn[i](self));
}
return fn.apply(self, args);
};
return function() {
return fnInvoke;
};
}
}
}
function expression() {
return assignment();
}
function _assignment() {
var left = logicalOR();
var right;
var token;
if ((token = expect('='))) {
if (!left.assign) {
throwError("implies assignment but [" +
text.substring(0, token.index) + "] can not be assigned to", token);
}
right = logicalOR();
return function(self){
return left.assign(self, right(self));
};
} else {
return left;
}
}
function logicalOR() {
var left = logicalAND();
var token;
while(true) {
if ((token = expect('||'))) {
left = binaryFn(left, token.fn, logicalAND());
} else {
return left;
}
}
}
function logicalAND() {
var left = equality();
var token;
if ((token = expect('&&'))) {
left = binaryFn(left, token.fn, logicalAND());
}
return left;
}
function equality() {
var left = relational();
var token;
if ((token = expect('==','!='))) {
left = binaryFn(left, token.fn, equality());
}
return left;
}
function relational() {
var left = additive();
var token;
if ((token = expect('<', '>', '<=', '>='))) {
left = binaryFn(left, token.fn, relational());
}
return left;
}
function additive() {
var left = multiplicative();
var token;
while ((token = expect('+','-'))) {
left = binaryFn(left, token.fn, multiplicative());
}
return left;
}
function multiplicative() {
var left = unary();
var token;
while ((token = expect('*','/','%'))) {
left = binaryFn(left, token.fn, unary());
}
return left;
}
function unary() {
var token;
if (expect('+')) {
return primary();
} else if ((token = expect('-'))) {
return binaryFn(ZERO, token.fn, unary());
} else if ((token = expect('!'))) {
return unaryFn(token.fn, unary());
} else {
return primary();
}
}
function _functionIdent(fnScope) {
var token = expect();
var element = token.text.split('.');
var instance = fnScope;
var key;
for ( var i = 0; i < element.length; i++) {
key = element[i];
if (instance)
instance = instance[key];
}
if (!isFunction(instance)) {
throwError("should be a function", token);
}
return instance;
}
function primary() {
var primary;
if (expect('(')) {
var expression = filterChain();
consume(')');
primary = expression;
} else if (expect('[')) {
primary = arrayDeclaration();
} else if (expect('{')) {
primary = object();
} else {
var token = expect();
primary = token.fn;
if (!primary) {
throwError("not a primary expression", token);
}
}
var next;
while ((next = expect('(', '[', '.'))) {
if (next.text === '(') {
primary = functionCall(primary);
} else if (next.text === '[') {
primary = objectIndex(primary);
} else if (next.text === '.') {
primary = fieldAccess(primary);
} else {
throwError("IMPOSSIBLE");
}
}
return primary;
}
function _fieldAccess(object) {
var field = expect().text;
var getter = getterFn(field);
return extend(function(self){
return getter(object(self));
}, {
assign:function(self, value){
return setter(object(self), field, value);
}
});
}
function _objectIndex(obj) {
var indexFn = expression();
consume(']');
return extend(
function(self){
var o = obj(self),
i = indexFn(self),
v, p;
if (!o) return undefined;
v = o[i];
if (v && v.then) {
p = v;
if (!('$$v' in v)) {
p.$$v = undefined;
p.then(function(val) { p.$$v = val; });
}
v = v.$$v;
}
return v;
}, {
assign:function(self, value){
return obj(self)[indexFn(self)] = value;
}
});
}
function _functionCall(fn) {
var argsFn = [];
if (peekToken().text != ')') {
do {
argsFn.push(expression());
} while (expect(','));
}
consume(')');
return function(self){
var args = [];
for ( var i = 0; i < argsFn.length; i++) {
args.push(argsFn[i](self));
}
var fnPtr = fn(self) || noop;
// IE stupidity!
return fnPtr.apply
? fnPtr.apply(self, args)
: fnPtr(args[0], args[1], args[2], args[3], args[4]);
};
}
// This is used with json array declaration
function arrayDeclaration () {
var elementFns = [];
if (peekToken().text != ']') {
do {
elementFns.push(expression());
} while (expect(','));
}
consume(']');
return function(self){
var array = [];
for ( var i = 0; i < elementFns.length; i++) {
array.push(elementFns[i](self));
}
return array;
};
}
function object () {
var keyValues = [];
if (peekToken().text != '}') {
do {
var token = expect(),
key = token.string || token.text;
consume(":");
var value = expression();
keyValues.push({key:key, value:value});
} while (expect(','));
}
consume('}');
return function(self){
var object = {};
for ( var i = 0; i < keyValues.length; i++) {
var keyValue = keyValues[i];
var value = keyValue.value(self);
object[keyValue.key] = value;
}
return object;
};
}
function watchDecl () {
var anchorName = expect().text;
consume(":");
var expressionFn;
if (peekToken().text == '{') {
consume("{");
expressionFn = statements();
consume("}");
} else {
expressionFn = expression();
}
return function(self) {
return {name:anchorName, fn:expressionFn};
};
}
}
//////////////////////////////////////////////////
// Parser helper functions
//////////////////////////////////////////////////
function setter(obj, path, setValue) {
var element = path.split('.');
for (var i = 0; element.length > 1; i++) {
var key = element.shift();
var propertyObj = obj[key];
if (!propertyObj) {
propertyObj = {};
obj[key] = propertyObj;
}
obj = propertyObj;
}
obj[element.shift()] = setValue;
return setValue;
}
/**
* Return the value accesible from the object by path. Any undefined traversals are ignored
* @param {Object} obj starting object
* @param {string} path path to traverse
* @param {boolean=true} bindFnToScope
* @returns value as accesbile by path
*/
//TODO(misko): this function needs to be removed
function getter(obj, path, bindFnToScope) {
if (!path) return obj;
var keys = path.split('.');
var key;
var lastInstance = obj;
var len = keys.length;
for (var i = 0; i < len; i++) {
key = keys[i];
if (obj) {
obj = (lastInstance = obj)[key];
}
}
if (!bindFnToScope && isFunction(obj)) {
return bind(lastInstance, obj);
}
return obj;
}
var getterFnCache = {},
JS_KEYWORDS = {};
forEach(
("abstract,boolean,break,byte,case,catch,char,class,const,continue,debugger,default," +
"delete,do,double,else,enum,export,extends,false,final,finally,float,for,function,goto," +
"if,implements,import,ininstanceof,intinterface,long,native,new,null,package,private," +
"protected,public,return,short,static,super,switch,synchronized,this,throw,throws," +
"transient,true,try,typeof,var,volatile,void,undefined,while,with").split(/,/),
function(key){ JS_KEYWORDS[key] = true;}
);
function getterFn(path) {
var fn = getterFnCache[path];
if (fn) return fn;
var code = 'var l, fn, p;\n';
forEach(path.split('.'), function(key) {
key = (JS_KEYWORDS[key]) ? '["' + key + '"]' : '.' + key;
code += 'if(!s) return s;\n' +
'l=s;\n' +
's=s' + key + ';\n' +
'if(typeof s=="function" && !(s instanceof RegExp)) {\n' +
' fn=function(){ return l' + key + '.apply(l, arguments); };\n' +
' fn.$unboundFn=s;\n' +
' s=fn;\n' +
'} else if (s && s.then) {\n' +
' if (!("$$v" in s)) {\n' +
' p=s;\n' +
' p.$$v = undefined;\n' +
' p.then(function(v) {p.$$v=v;});\n' +
'}\n' +
' s=s.$$v\n' +
'}\n';
});
code += 'return s;';
fn = Function('s', code);
fn.toString = function() { return code; };
return getterFnCache[path] = fn;
}
///////////////////////////////////
function $ParseProvider() {
var cache = {};
this.$get = ['$filter', function($filter) {
return function(exp) {
switch(typeof exp) {
case 'string':
return cache.hasOwnProperty(exp)
? cache[exp]
: cache[exp] = parser(exp, false, $filter);
case 'function':
return exp;
default:
return noop;
}
};
}];
}
// This is a special access for JSON parser which bypasses the injector
var parseJson = function(json) {
return parser(json, true);
};
'use strict';
/**
* @ngdoc service
* @name angular.module.ng.$q
* @requires $rootScope
*
* @description
* A promise/deferred implementation inspired by [Kris Kowal's Q](https://github.com/kriskowal/q).
*
* [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an
* interface for interacting with an object that represents the result of an action that is
* performed asynchronously, and may or may not be finished at any given point in time.
*
* From the perspective of dealing with error handling, deferred and promise apis are to
* asynchronous programing what `try`, `catch` and `throw` keywords are to synchronous programing.
*
* <pre>
* // for the purpose of this example let's assume that variables `$q` and `scope` are
* // available in the current lexical scope (they could have been injected or passed in).
*
* function asyncGreet(name) {
* var deferred = $q.defer();
*
* setTimeout(function() {
* // since this fn executes async in a future turn of the event loop, we need to wrap
* // our code into an $apply call so that the model changes are properly observed.
* scope.$apply(function() {
* if (okToGreet(name)) {
* deferred.resolve('Hello, ' + name + '!');
* } else {
* deferred.reject('Greeting ' + name + ' is not allowed.');
* }
* });
* }, 1000);
*
* return deferred.promise;
* }
*
* var promise = asyncGreet('Robin Hood');
* promise.then(function(greeting) {
* alert('Success: ' + greeting);
* }, function(reason) {
* alert('Failed: ' + reason);
* );
* </pre>
*
* At first it might not be obvious why this extra complexity is worth the trouble. The payoff
* comes in the way of
* [guarantees that promise and deferred apis make](https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md).
*
* Additionally the promise api allows for composition that is very hard to do with the
* traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.
* For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the
* section on serial or parallel joining of promises.
*
*
* # The Deferred API
*
* A new instance of deferred is constructed by calling `$q.defer()`.
*
* The purpose of the deferred object is to expose the associated Promise instance as well as apis
* that can be used for signaling the successful or unsuccessful completion of the task.
*
* **Methods**
*
* - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection
* constructed via `$q.reject`, the promise will be rejected instead.
* - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to
* resolving it with a rejection constructed via `$q.reject`.
*
* **Properties**
*
* - promise – `{Promise}` – promise object associated with this deferred.
*
*
* # The Promise API
*
* A new promise instance is created when a deferred instance is created and can be retrieved by
* calling `deferred.promise`.
*
* The purpose of the promise object is to allow for interested parties to get access to the result
* of the deferred task when it completes.
*
* **Methods**
*
* - `then(successCallback, errorCallback)` – regardless of when the promise was or will be resolved
* or rejected calls one of the success or error callbacks asynchronously as soon as the result
* is available. The callbacks are called with a single argument the result or rejection reason.
*
* This method *returns a new promise* which is resolved or rejected via the return value of the
* `successCallback` or `errorCallback`.
*
*
* # Chaining promises
*
* Because calling `then` api of a promise returns a new derived promise, it is easily possible
* to create a chain of promises:
*
* <pre>
* promiseB = promiseA.then(function(result) {
* return result + 1;
* });
*
* // promiseB will be resolved immediately after promiseA is resolved and it's value will be
* // the result of promiseA incremented by 1
* </pre>
*
* It is possible to create chains of any length and since a promise can be resolved with another
* promise (which will defer its resolution further), it is possible to pause/defer resolution of
* the promises at any point in the chain. This makes it possible to implement powerful apis like
* $http's response interceptors.
*
*
* # Differences between Kris Kowal's Q and $q
*
* There are three main differences:
*
* - $q is integrated with the {@link angular.module.ng.$rootScope.Scope} Scope model observation
* mechanism in angular, which means faster propagation of resolution or rejection into your
* models and avoiding unnecessary browser repaints, which would result in flickering UI.
* - $q promises are recognized by the templating engine in angular, which means that in templates
* you can treat promises attached to a scope as if they were the resulting values.
* - Q has many more features that $q, but that comes at a cost of bytes. $q is tiny, but contains
* all the important functionality needed for common async tasks.
*/
function $QProvider() {
this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {
return qFactory(function(callback) {
$rootScope.$evalAsync(callback);
}, $exceptionHandler);
}];
}
/**
* Constructs a promise manager.
*
* @param {function(function)} nextTick Function for executing functions in the next turn.
* @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for
* debugging purposes.
* @returns {object} Promise manager.
*/
function qFactory(nextTick, exceptionHandler) {
/**
* @ngdoc
* @name angular.module.ng.$q#defer
* @methodOf angular.module.ng.$q
* @description
* Creates a `Deferred` object which represents a task which will finish in the future.
*
* @returns {Deferred} Returns a new instance of deferred.
*/
var defer = function() {
var pending = [],
value, deferred;
deferred = {
resolve: function(val) {
if (pending) {
var callbacks = pending;
pending = undefined;
value = ref(val);
if (callbacks.length) {
nextTick(function() {
var callback;
for (var i = 0, ii = callbacks.length; i < ii; i++) {
callback = callbacks[i];
value.then(callback[0], callback[1]);
}
});
}
}
},
reject: function(reason) {
deferred.resolve(reject(reason));
},
promise: {
then: function(callback, errback) {
var result = defer();
var wrappedCallback = function(value) {
try {
result.resolve((callback || defaultCallback)(value));
} catch(e) {
exceptionHandler(e);
result.reject(e);
}
};
var wrappedErrback = function(reason) {
try {
result.resolve((errback || defaultErrback)(reason));
} catch(e) {
exceptionHandler(e);
result.reject(e);
}
};
if (pending) {
pending.push([wrappedCallback, wrappedErrback]);
} else {
value.then(wrappedCallback, wrappedErrback);
}
return result.promise;
}
}
};
return deferred;
};
var ref = function(value) {
if (value && value.then) return value;
return {
then: function(callback) {
var result = defer();
nextTick(function() {
result.resolve(callback(value));
});
return result.promise;
}
};
};
/**
* @ngdoc
* @name angular.module.ng.$q#reject
* @methodOf angular.module.ng.$q
* @description
* Creates a promise that is resolved as rejected with the specified `reason`. This api should be
* used to forward rejection in a chain of promises. If you are dealing with the last promise in
* a promise chain, you don't need to worry about it.
*
* When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of
* `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via
* a promise error callback and you want to forward the error to the promise derived from the
* current promise, you have to "rethrow" the error by returning a rejection constructed via
* `reject`.
*
* <pre>
* promiseB = promiseA.then(function(result) {
* // success: do something and resolve promiseB
* // with the old or a new result
* return result;
* }, function(reason) {
* // error: handle the error if possible and
* // resolve promiseB with newPromiseOrValue,
* // otherwise forward the rejection to promiseB
* if (canHandle(reason)) {
* // handle the error and recover
* return newPromiseOrValue;
* }
* return $q.reject(reason);
* });
* </pre>
*
* @param {*} reason Constant, message, exception or an object representing the rejection reason.
* @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.
*/
var reject = function(reason) {
return {
then: function(callback, errback) {
var result = defer();
nextTick(function() {
result.resolve(errback(reason));
});
return result.promise;
}
};
};
/**
* @ngdoc
* @name angular.module.ng.$q#when
* @methodOf angular.module.ng.$q
* @description
* Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.
* This is useful when you are dealing with on object that might or might not be a promise, or if
* the promise comes from a source that can't be trusted.
*
* @param {*} value Value or a promise
* @returns {Promise} Returns a single promise that will be resolved with an array of values,
* each value coresponding to the promise at the same index in the `promises` array. If any of
* the promises is resolved with a rejection, this resulting promise will be resolved with the
* same rejection.
*/
var when = function(value, callback, errback) {
var result = defer(),
done;
var wrappedCallback = function(value) {
try {
return (callback || defaultCallback)(value);
} catch (e) {
exceptionHandler(e);
return reject(e);
}
};
var wrappedErrback = function(reason) {
try {
return (errback || defaultErrback)(reason);
} catch (e) {
exceptionHandler(e);
return reject(e);
}
};
nextTick(function() {
ref(value).then(function(value) {
if (done) return;
done = true;
result.resolve(ref(value).then(wrappedCallback, wrappedErrback));
}, function(reason) {
if (done) return;
done = true;
result.resolve(wrappedErrback(reason));
});
});
return result.promise;
};
function defaultCallback(value) {
return value;
}
function defaultErrback(reason) {
return reject(reason);
}
/**
* @ngdoc
* @name angular.module.ng.$q#all
* @methodOf angular.module.ng.$q
* @description
* Combines multiple promises into a single promise that is resolved when all of the input
* promises are resolved.
*
* @param {Array.<Promise>} promises An array of promises.
* @returns {Promise} Returns a single promise that will be resolved with an array of values,
* each value coresponding to the promise at the same index in the `promises` array. If any of
* the promises is resolved with a rejection, this resulting promise will be resolved with the
* same rejection.
*/
function all(promises) {
var deferred = defer(),
counter = promises.length,
results = [];
forEach(promises, function(promise, index) {
promise.then(function(value) {
if (index in results) return;
results[index] = value;
if (!(--counter)) deferred.resolve(results);
}, function(reason) {
if (index in results) return;
deferred.reject(reason);
});
});
return deferred.promise;
}
return {
defer: defer,
reject: reject,
when: when,
all: all
};
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$route
* @requires $location
* @requires $routeParams
*
* @property {Object} current Reference to the current route definition.
* @property {Array.<Object>} routes Array of all configured routes.
*
* @description
* Watches `$location.url()` and tries to map the path to an existing route
* definition. It is used for deep-linking URLs to controllers and views (HTML partials).
*
* The `$route` service is typically used in conjunction with {@link angular.widget.ng:view ng:view}
* widget and the {@link angular.module.ng.$routeParams $routeParams} service.
*
* @example
This example shows how changing the URL hash causes the <tt>$route</tt>
to match a route against the URL, and the <tt>[[ng:include]]</tt> pulls in the partial.
<doc:example>
<doc:source jsfiddle="false">
<script>
function MainCntl($route, $routeParams, $location) {
this.$route = $route;
this.$location = $location;
this.$routeParams = $routeParams;
$route.when('/Book/:bookId', {template: 'examples/book.html', controller: BookCntl});
$route.when('/Book/:bookId/ch/:chapterId', {template: 'examples/chapter.html', controller: ChapterCntl});
}
function BookCntl($routeParams) {
this.name = "BookCntl";
this.params = $routeParams;
}
function ChapterCntl($routeParams) {
this.name = "ChapterCntl";
this.params = $routeParams;
}
</script>
<div ng:controller="MainCntl">
Choose:
<a href="#/Book/Moby">Moby</a> |
<a href="#/Book/Moby/ch/1">Moby: Ch1</a> |
<a href="#/Book/Gatsby">Gatsby</a> |
<a href="#/Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a><br/>
<pre>$location.path() = {{$location.path()}}</pre>
<pre>$route.current.template = {{$route.current.template}}</pre>
<pre>$route.current.params = {{$route.current.params}}</pre>
<pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
<pre>$routeParams = {{$routeParams}}</pre>
<hr />
<ng:view></ng:view>
</div>
</doc:source>
<doc:scenario>
</doc:scenario>
</doc:example>
*/
function $RouteProvider(){
this.$get = ['$rootScope', '$location', '$routeParams',
function( $rootScope, $location, $routeParams) {
/**
* @ngdoc event
* @name angular.module.ng.$route#$beforeRouteChange
* @eventOf angular.module.ng.$route
* @eventType broadcast on root scope
* @description
* Broadcasted before a route change.
*
* @param {Route} next Future route information.
* @param {Route} current Current route information.
*
* The `Route` object extends the route definition with the following properties.
*
* * `scope` - The instance of the route controller.
* * `params` - The current {@link angular.module.ng.$routeParams params}.
*
*/
/**
* @ngdoc event
* @name angular.module.ng.$route#$afterRouteChange
* @eventOf angular.module.ng.$route
* @eventType broadcast on root scope
* @description
* Broadcasted after a route change.
*
* @param {Route} current Current route information.
* @param {Route} previous Previous route information.
*
* The `Route` object extends the route definition with the following properties.
*
* * `scope` - The instance of the route controller.
* * `params` - The current {@link angular.module.ng.$routeParams params}.
*
*/
/**
* @ngdoc event
* @name angular.module.ng.$route#$routeUpdate
* @eventOf angular.module.ng.$route
* @eventType emit on the current route scope
* @description
*
* The `reloadOnSearch` property has been set to false, and we are reusing the same
* instance of the Controller.
*/
var routes = {},
matcher = switchRouteMatcher,
parentScope = $rootScope,
dirty = 0,
forceReload = false,
$route = {
routes: routes,
/**
* @ngdoc method
* @name angular.module.ng.$route#parent
* @methodOf angular.module.ng.$route
*
* @param {Scope} [scope=rootScope] Scope to be used as parent for newly created
* `$route.current.scope` scopes.
*
* @description
* Sets a scope to be used as the parent scope for scopes created on route change. If not
* set, defaults to the root scope.
*/
parent: function(scope) {
if (scope) parentScope = scope;
},
/**
* @ngdoc method
* @name angular.module.ng.$route#when
* @methodOf angular.module.ng.$route
*
* @param {string} path Route path (matched against `$location.hash`)
* @param {Object} route Mapping information to be assigned to `$route.current` on route
* match.
*
* Object properties:
*
* - `controller` – `{function()=}` – Controller fn that should be associated with newly
* created scope.
* - `template` – `{string=}` – path to an html template that should be used by
* {@link angular.widget.ng:view ng:view} or
* {@link angular.widget.ng:include ng:include} widgets.
* - `redirectTo` – {(string|function())=} – value to update
* {@link angular.module.ng.$location $location} path with and trigger route redirection.
*
* If `redirectTo` is a function, it will be called with the following parameters:
*
* - `{Object.<string>}` - route parameters extracted from the current
* `$location.path()` by applying the current route template.
* - `{string}` - current `$location.path()`
* - `{Object}` - current `$location.search()`
*
* The custom `redirectTo` function is expected to return a string which will be used
* to update `$location.path()` and `$location.search()`.
*
* - `[reloadOnSearch=true]` - {boolean=} - reload route when only $location.search()
* changes.
*
* If the option is set to false and url in the browser changes, then
* $routeUpdate event is emited on the current route scope. You can use this event to
* react to {@link angular.module.ng.$routeParams} changes:
*
* function MyCtrl($route, $routeParams) {
* this.$on('$routeUpdate', function() {
* // do stuff with $routeParams
* });
* }
*
* @returns {Object} route object
*
* @description
* Adds a new route definition to the `$route` service.
*/
when: function(path, route) {
var routeDef = routes[path];
if (!routeDef) routeDef = routes[path] = {reloadOnSearch: true};
if (route) extend(routeDef, route); // TODO(im): what the heck? merge two route definitions?
dirty++;
return routeDef;
},
/**
* @ngdoc method
* @name angular.module.ng.$route#otherwise
* @methodOf angular.module.ng.$route
*
* @description
* Sets route definition that will be used on route change when no other route definition
* is matched.
*
* @param {Object} params Mapping information to be assigned to `$route.current`.
*/
otherwise: function(params) {
$route.when(null, params);
},
/**
* @ngdoc method
* @name angular.module.ng.$route#reload
* @methodOf angular.module.ng.$route
*
* @description
* Causes `$route` service to reload (and recreate the `$route.current` scope) upon the next
* eval even if {@link angular.module.ng.$location $location} hasn't changed.
*/
reload: function() {
dirty++;
forceReload = true;
}
};
$rootScope.$watch(function() { return dirty + $location.url(); }, updateRoute);
return $route;
/////////////////////////////////////////////////////
function switchRouteMatcher(on, when) {
// TODO(i): this code is convoluted and inefficient, we should construct the route matching
// regex only once and then reuse it
var regex = '^' + when.replace(/([\.\\\(\)\^\$])/g, "\\$1") + '$',
params = [],
dst = {};
forEach(when.split(/\W/), function(param) {
if (param) {
var paramRegExp = new RegExp(":" + param + "([\\W])");
if (regex.match(paramRegExp)) {
regex = regex.replace(paramRegExp, "([^\\/]*)$1");
params.push(param);
}
}
});
var match = on.match(new RegExp(regex));
if (match) {
forEach(params, function(name, index) {
dst[name] = match[index + 1];
});
}
return match ? dst : null;
}
function updateRoute() {
var next = parseRoute(),
last = $route.current,
Controller;
if (next && last && next.$route === last.$route
&& equals(next.pathParams, last.pathParams) && !next.reloadOnSearch && !forceReload) {
next.scope = last.scope;
$route.current = next;
copy(next.params, $routeParams);
last.scope && last.scope.$emit('$routeUpdate');
} else {
forceReload = false;
$rootScope.$broadcast('$beforeRouteChange', next, last);
last && last.scope && last.scope.$destroy();
$route.current = next;
if (next) {
if (next.redirectTo) {
if (isString(next.redirectTo)) {
$location.path(interpolate(next.redirectTo, next.params)).search(next.params)
.replace();
} else {
$location.url(next.redirectTo(next.pathParams, $location.path(), $location.search()))
.replace();
}
} else {
copy(next.params, $routeParams);
(Controller = next.controller) && inferInjectionArgs(Controller);
next.scope = parentScope.$new(Controller);
}
}
$rootScope.$broadcast('$afterRouteChange', next, last);
}
}
/**
* @returns the current active route, by matching it against the URL
*/
function parseRoute() {
// Match a route
var params, match;
forEach(routes, function(route, path) {
if (!match && (params = matcher($location.path(), path))) {
match = inherit(route, {
params: extend({}, $location.search(), params),
pathParams: params});
match.$route = route;
}
});
// No route matched; fallback to "otherwise" route
return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});
}
/**
* @returns interpolation of the redirect path with the parametrs
*/
function interpolate(string, params) {
var result = [];
forEach((string||'').split(':'), function(segment, i) {
if (i == 0) {
result.push(segment);
} else {
var segmentMatch = segment.match(/(\w+)(.*)/);
var key = segmentMatch[1];
result.push(params[key]);
result.push(segmentMatch[2] || '');
delete params[key];
}
});
return result.join('');
}
}];
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$routeParams
* @requires $route
*
* @description
* Current set of route parameters. The route parameters are a combination of the
* {@link angular.module.ng.$location $location} `search()`, and `path()`. The `path` parameters
* are extracted when the {@link angular.module.ng.$route $route} path is matched.
*
* In case of parameter name collision, `path` params take precedence over `search` params.
*
* The service guarantees that the identity of the `$routeParams` object will remain unchanged
* (but its properties will likely change) even when a route change occurs.
*
* @example
* <pre>
* // Given:
* // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
* // Route: /Chapter/:chapterId/Section/:sectionId
* //
* // Then
* $routeParams ==> {chapterId:1, sectionId:2, search:'moby'}
* </pre>
*/
function $RouteParamsProvider() {
this.$get = valueFn({});
}
'use strict';
/**
* DESIGN NOTES
*
* The design decisions behind the scope ware heavily favored for speed and memory consumption.
*
* The typical use of scope is to watch the expressions, which most of the time return the same
* value as last time so we optimize the operation.
*
* Closures construction is expensive from speed as well as memory:
* - no closures, instead ups prototypical inheritance for API
* - Internal state needs to be stored on scope directly, which means that private state is
* exposed as $$____ properties
*
* Loop operations are optimized by using while(count--) { ... }
* - this means that in order to keep the same order of execution as addition we have to add
* items to the array at the begging (shift) instead of at the end (push)
*
* Child scopes are created and removed often
* - Using array would be slow since inserts in meddle are expensive so we use linked list
*
* There are few watches then a lot of observers. This is why you don't want the observer to be
* implemented in the same way as watch. Watch requires return of initialization function which
* are expensive to construct.
*/
/**
* @ngdoc object
* @name angular.module.ng.$rootScope
* @description
*
* Every application has a single root {@link angular.module.ng.$rootScope.Scope scope}.
* All other scopes are child scopes of the root scope. Scopes provide mechanism for watching the model and provide
* event processing life-cycle. See {@link guide/dev_guide.scopes developer guide on scopes}.
*/
function $RootScopeProvider(){
this.$get = ['$injector', '$exceptionHandler', '$parse',
function( $injector, $exceptionHandler, $parse) {
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope
*
* @description
* A root scope can be retrieved using the {@link angular.module.ng.$rootScope $rootScope} key from the
* {@link angular.module.AUTO.$injector $injector}. Child scopes are created using the
* {@link angular.module.ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when
* compiled HTML template is executed.)
*
* Here is a simple scope snippet to show how you can interact with the scope.
* <pre>
angular.injector(['ng']).invoke(function($rootScope) {
var scope = $rootScope.$new();
scope.salutation = 'Hello';
scope.name = 'World';
expect(scope.greeting).toEqual(undefined);
scope.$watch('name', function() {
this.greeting = this.salutation + ' ' + this.name + '!';
}); // initialize the watch
expect(scope.greeting).toEqual(undefined);
scope.name = 'Misko';
// still old value, since watches have not been called yet
expect(scope.greeting).toEqual(undefined);
scope.$digest(); // fire all the watches
expect(scope.greeting).toEqual('Hello Misko!');
});
* </pre>
*
* # Inheritance
* A scope can inherit from a parent scope, as in this example:
* <pre>
var parent = $rootScope;
var child = parent.$new();
parent.salutation = "Hello";
child.name = "World";
expect(child.salutation).toEqual('Hello');
child.salutation = "Welcome";
expect(child.salutation).toEqual('Welcome');
expect(parent.salutation).toEqual('Hello');
* </pre>
*
* # Dependency Injection
* See {@link guide/dev_guide.di dependency injection}.
*
*
* @param {Object.<string, function()>=} providers Map of service factory which need to be provided
* for the current scope. Defaults to {@link angular.module.ng}.
* @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should
* append/override services provided by `providers`. This is handy when unit-testing and having
* the need to override a default service.
* @returns {Object} Newly created scope.
*
*/
function Scope() {
this.$id = nextUid();
this.$$phase = this.$parent = this.$$watchers =
this.$$nextSibling = this.$$prevSibling =
this.$$childHead = this.$$childTail = null;
this.$destructor = noop;
this['this'] = this.$root = this;
this.$$asyncQueue = [];
this.$$listeners = {};
}
/**
* @ngdoc property
* @name angular.module.ng.$rootScope.Scope#$id
* @propertyOf angular.module.ng.$rootScope.Scope
* @returns {number} Unique scope ID (monotonically increasing alphanumeric sequence) useful for
* debugging.
*/
Scope.prototype = {
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$new
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Creates a new child {@link angular.module.ng.$rootScope.Scope scope}. The new scope can optionally behave as a
* controller. The parent scope will propagate the {@link angular.module.ng.$rootScope.Scope#$digest $digest()} and
* {@link angular.module.ng.$rootScope.Scope#$digest $digest()} events. The scope can be removed from the scope
* hierarchy using {@link angular.module.ng.$rootScope.Scope#$destroy $destroy()}.
*
* {@link angular.module.ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is desired for
* the scope and its child scopes to be permanently detached from the parent and thus stop
* participating in model change detection and listener notification by invoking.
*
* @param {function()=} Class Constructor function which the scope should be applied to the scope.
* @param {...*} curryArguments Any additional arguments which are curried into the constructor.
* See {@link guide/dev_guide.di dependency injection}.
* @returns {Object} The newly created child scope.
*
*/
$new: function(Class, curryArguments) {
var Child = function() {}; // should be anonymous; This is so that when the minifier munges
// the name it does not become random set of chars. These will then show up as class
// name in the debugger.
var child;
Child.prototype = this;
child = new Child();
child['this'] = child;
child.$$listeners = {};
child.$parent = this;
child.$id = nextUid();
child.$$asyncQueue = [];
child.$$watchers = child.$$nextSibling = child.$$childHead = child.$$childTail = null;
child.$$prevSibling = this.$$childTail;
if (this.$$childHead) {
this.$$childTail.$$nextSibling = child;
this.$$childTail = child;
} else {
this.$$childHead = this.$$childTail = child;
}
// short circuit if we have no class
if (Class) {
// can't use forEach, we need speed!
var ClassPrototype = Class.prototype;
for(var key in ClassPrototype) {
child[key] = bind(child, ClassPrototype[key]);
}
$injector.invoke(Class, child, curryArguments);
}
return child;
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$watch
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Registers a `listener` callback to be executed whenever the `watchExpression` changes.
*
* - The `watchExpression` is called on every call to {@link angular.module.ng.$rootScope.Scope#$digest $digest()} and
* should return the value which will be watched. (Since {@link angular.module.ng.$rootScope.Scope#$digest $digest()}
* reruns when it detects changes the `watchExpression` can execute multiple times per
* {@link angular.module.ng.$rootScope.Scope#$digest $digest()} and should be idempotent.)
* - The `listener` is called only when the value from the current `watchExpression` and the
* previous call to `watchExpression' are not equal (with the exception of the initial run
* see below). The inequality is determined according to
* {@link angular.equals} function. To save the value of the object for later comparison
* {@link angular.copy} function is used. It also means that watching complex options will
* have adverse memory and performance implications.
* - The watch `listener` may change the model, which may trigger other `listener`s to fire. This
* is achieved by rerunning the watchers until no changes are detected. The rerun iteration
* limit is 100 to prevent infinity loop deadlock.
*
*
* If you want to be notified whenever {@link angular.module.ng.$rootScope.Scope#$digest $digest} is called,
* you can register an `watchExpression` function with no `listener`. (Since `watchExpression`,
* can execute multiple times per {@link angular.module.ng.$rootScope.Scope#$digest $digest} cycle when a change is
* detected, be prepared for multiple calls to your listener.)
*
* After a watcher is registered with the scope, the `listener` fn is called asynchronously
* (via {@link angular.module.ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the
* watcher. In rare cases, this is undesirable because the listener is called when the result
* of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you
* can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the
* listener was called due to initialization.
*
*
* # Example
<pre>
// let's assume that scope was dependency injected as the $rootScope
var scope = $rootScope;
scope.name = 'misko';
scope.counter = 0;
expect(scope.counter).toEqual(0);
scope.$watch('name', function(scope, newValue, oldValue) { counter = counter + 1; });
expect(scope.counter).toEqual(0);
scope.$digest();
// no variable change
expect(scope.counter).toEqual(0);
scope.name = 'adam';
scope.$digest();
expect(scope.counter).toEqual(1);
</pre>
*
*
*
* @param {(function()|string)} watchExpression Expression that is evaluated on each
* {@link angular.module.ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers a
* call to the `listener`.
*
* - `string`: Evaluated as {@link guide/dev_guide.expressions expression}
* - `function(scope)`: called with current `scope` as a parameter.
* @param {(function()|string)=} listener Callback called whenever the return value of
* the `watchExpression` changes.
*
* - `string`: Evaluated as {@link guide/dev_guide.expressions expression}
* - `function(scope, newValue, oldValue)`: called with current `scope` an previous and
* current values as parameters.
* @returns {function()} Returns a deregistration function for this listener.
*/
$watch: function(watchExp, listener) {
var scope = this,
get = compileToFn(watchExp, 'watch'),
listenFn = compileToFn(listener || noop, 'listener'),
array = scope.$$watchers,
watcher = {
fn: listenFn,
last: initWatchVal,
get: get,
exp: watchExp
};
if (!array) {
array = scope.$$watchers = [];
}
// we use unshift since we use a while loop in $digest for speed.
// the while loop reads in reverse order.
array.unshift(watcher);
return function() {
arrayRemove(array, watcher);
};
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$digest
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Process all of the {@link angular.module.ng.$rootScope.Scope#$watch watchers} of the current scope and its children.
* Because a {@link angular.module.ng.$rootScope.Scope#$watch watcher}'s listener can change the model, the
* `$digest()` keeps calling the {@link angular.module.ng.$rootScope.Scope#$watch watchers} until no more listeners are
* firing. This means that it is possible to get into an infinite loop. This function will throw
* `'Maximum iteration limit exceeded.'` if the number of iterations exceeds 100.
*
* Usually you don't call `$digest()` directly in
* {@link angular.directive.ng:controller controllers} or in {@link angular.directive directives}.
* Instead a call to {@link angular.module.ng.$rootScope.Scope#$apply $apply()} (typically from within a
* {@link angular.directive directive}) will force a `$digest()`.
*
* If you want to be notified whenever `$digest()` is called,
* you can register a `watchExpression` function with {@link angular.module.ng.$rootScope.Scope#$watch $watch()}
* with no `listener`.
*
* You may have a need to call `$digest()` from within unit-tests, to simulate the scope
* life-cycle.
*
* # Example
<pre>
var scope = ...;
scope.name = 'misko';
scope.counter = 0;
expect(scope.counter).toEqual(0);
scope.$watch('name', function(scope, newValue, oldValue) {
counter = counter + 1;
});
expect(scope.counter).toEqual(0);
scope.$digest();
// no variable change
expect(scope.counter).toEqual(0);
scope.name = 'adam';
scope.$digest();
expect(scope.counter).toEqual(1);
</pre>
*
*/
$digest: function() {
var watch, value, last,
watchers,
asyncQueue,
length,
dirty, ttl = 100,
next, current, target = this,
watchLog = [],
logIdx, logMsg;
flagPhase(target, '$digest');
do {
dirty = false;
current = target;
do {
asyncQueue = current.$$asyncQueue;
while(asyncQueue.length) {
try {
current.$eval(asyncQueue.shift());
} catch (e) {
$exceptionHandler(e);
}
}
if ((watchers = current.$$watchers)) {
// process our watches
length = watchers.length;
while (length--) {
try {
watch = watchers[length];
// Most common watches are on primitives, in which case we can short
// circuit it with === operator, only when === fails do we use .equals
if ((value = watch.get(current)) !== (last = watch.last) && !equals(value, last)) {
dirty = true;
watch.last = copy(value);
watch.fn(current, value, ((last === initWatchVal) ? value : last));
if (ttl < 5) {
logIdx = 4 - ttl;
if (!watchLog[logIdx]) watchLog[logIdx] = [];
logMsg = (isFunction(watch.exp))
? 'fn: ' + (watch.exp.name || watch.exp.toString())
: watch.exp;
logMsg += '; newVal: ' + toJson(value) + '; oldVal: ' + toJson(last);
watchLog[logIdx].push(logMsg);
}
}
} catch (e) {
$exceptionHandler(e);
}
}
}
// Insanity Warning: scope depth-first traversal
// yes, this code is a bit crazy, but it works and we have tests to prove it!
// this piece should be kept in sync with the traversal in $broadcast
if (!(next = (current.$$childHead || (current !== target && current.$$nextSibling)))) {
while(current !== target && !(next = current.$$nextSibling)) {
current = current.$parent;
}
}
} while ((current = next));
if(dirty && !(ttl--)) {
throw Error('100 $digest() iterations reached. Aborting!\n' +
'Watchers fired in the last 5 iterations: ' + toJson(watchLog));
}
} while (dirty || asyncQueue.length);
this.$root.$$phase = null;
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$destroy
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Remove the current scope (and all of its children) from the parent scope. Removal implies
* that calls to {@link angular.module.ng.$rootScope.Scope#$digest $digest()} will no longer propagate to the current
* scope and its children. Removal also implies that the current scope is eligible for garbage
* collection.
*
* The destructing scope emits an `$destroy` {@link angular.module.ng.$rootScope.Scope#$emit event}.
*
* The `$destroy()` is usually used by directives such as
* {@link angular.widget.@ng:repeat ng:repeat} for managing the unrolling of the loop.
*
*/
$destroy: function() {
if (this.$root == this) return; // we can't remove the root node;
this.$emit('$destroy');
var parent = this.$parent;
if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;
if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;
if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;
if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$eval
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Executes the `expression` on the current scope returning the result. Any exceptions in the
* expression are propagated (uncaught). This is useful when evaluating engular expressions.
*
* # Example
<pre>
var scope = angular.module.ng.$rootScope.Scope();
scope.a = 1;
scope.b = 2;
expect(scope.$eval('a+b')).toEqual(3);
expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);
</pre>
*
* @param {(string|function())=} expression An angular expression to be executed.
*
* - `string`: execute using the rules as defined in {@link guide/dev_guide.expressions expression}.
* - `function(scope)`: execute the function with the current `scope` parameter.
*
* @returns {*} The result of evaluating the expression.
*/
$eval: function(expr) {
return $parse(expr)(this);
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$evalAsync
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Executes the expression on the current scope at a later point in time.
*
* The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only that:
*
* - it will execute in the current script execution context (before any DOM rendering).
* - at least one {@link angular.module.ng.$rootScope.Scope#$digest $digest cycle} will be performed after
* `expression` execution.
*
* Any exceptions from the execution of the expression are forwarded to the
* {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
*
* @param {(string|function())=} expression An angular expression to be executed.
*
* - `string`: execute using the rules as defined in {@link guide/dev_guide.expressions expression}.
* - `function(scope)`: execute the function with the current `scope` parameter.
*
*/
$evalAsync: function(expr) {
this.$$asyncQueue.push(expr);
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$apply
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* `$apply()` is used to execute an expression in angular from outside of the angular framework.
* (For example from browser DOM events, setTimeout, XHR or third party libraries).
* Because we are calling into the angular framework we need to perform proper scope life-cycle
* of {@link angular.module.ng.$exceptionHandler exception handling},
* {@link angular.module.ng.$rootScope.Scope#$digest executing watches}.
*
* ## Life cycle
*
* # Pseudo-Code of `$apply()`
function $apply(expr) {
try {
return $eval(expr);
} catch (e) {
$exceptionHandler(e);
} finally {
$root.$digest();
}
}
*
*
* Scope's `$apply()` method transitions through the following stages:
*
* 1. The {@link guide/dev_guide.expressions expression} is executed using the
* {@link angular.module.ng.$rootScope.Scope#$eval $eval()} method.
* 2. Any exceptions from the execution of the expression are forwarded to the
* {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
* 3. The {@link angular.module.ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the expression
* was executed using the {@link angular.module.ng.$rootScope.Scope#$digest $digest()} method.
*
*
* @param {(string|function())=} exp An angular expression to be executed.
*
* - `string`: execute using the rules as defined in {@link guide/dev_guide.expressions expression}.
* - `function(scope)`: execute the function with current `scope` parameter.
*
* @returns {*} The result of evaluating the expression.
*/
$apply: function(expr) {
try {
flagPhase(this, '$apply');
return this.$eval(expr);
} catch (e) {
$exceptionHandler(e);
} finally {
this.$root.$$phase = null;
this.$root.$digest();
}
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$on
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Listen on events of a given type. See {@link angular.module.ng.$rootScope.Scope#$emit $emit} for discussion of
* event life cycle.
*
* @param {string} name Event name to listen on.
* @param {function(event)} listener Function to call when the event is emitted.
* @returns {function()} Returns a deregistration function for this listener.
*
* The event listener function format is: `function(event)`. The `event` object passed into the
* listener has the following attributes
* - `targetScope` - {Scope}: the scope on which the event was `$emit`-ed or `$broadcast`-ed.
* - `currentScope` - {Scope}: the current scope which is handling the event.
* - `name` - {string}: Name of the event.
* - `cancel` - {function=}: calling `cancel` function will cancel further event propagation
* (available only for events that were `$emit`-ed).
*/
$on: function(name, listener) {
var namedListeners = this.$$listeners[name];
if (!namedListeners) {
this.$$listeners[name] = namedListeners = [];
}
namedListeners.push(listener);
return function() {
arrayRemove(namedListeners, listener);
};
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$emit
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Dispatches an event `name` upwards through the scope hierarchy notifying the
* registered {@link angular.module.ng.$rootScope.Scope#$on} listeners.
*
* The event life cycle starts at the scope on which `$emit` was called. All
* {@link angular.module.ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get notified.
* Afterwards, the event traverses upwards toward the root scope and calls all registered
* listeners along the way. The event will stop propagating if one of the listeners cancels it.
*
* Any exception emmited from the {@link angular.module.ng.$rootScope.Scope#$on listeners} will be passed
* onto the {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
*
* @param {string} name Event name to emit.
* @param {...*} args Optional set of arguments which will be passed onto the event listeners.
*/
$emit: function(name, args) {
var empty = [],
namedListeners,
canceled = false,
scope = this,
event = {
name: name,
targetScope: scope,
cancel: function() {canceled = true;}
},
listenerArgs = concat([event], arguments, 1),
i, length;
do {
namedListeners = scope.$$listeners[name] || empty;
event.currentScope = scope;
for (i=0, length=namedListeners.length; i<length; i++) {
try {
namedListeners[i].apply(null, listenerArgs);
if (canceled) return;
} catch (e) {
$exceptionHandler(e);
}
}
//traverse upwards
scope = scope.$parent;
} while (scope);
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$broadcast
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Dispatches an event `name` downwards to all child scopes (and their children) notifying the
* registered {@link angular.module.ng.$rootScope.Scope#$on} listeners.
*
* The event life cycle starts at the scope on which `$broadcast` was called. All
* {@link angular.module.ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get notified.
* Afterwards, the event propagates to all direct and indirect scopes of the current scope and
* calls all registered listeners along the way. The event cannot be canceled.
*
* Any exception emmited from the {@link angular.module.ng.$rootScope.Scope#$on listeners} will be passed
* onto the {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
*
* @param {string} name Event name to emit.
* @param {...*} args Optional set of arguments which will be passed onto the event listeners.
*/
$broadcast: function(name, args) {
var target = this,
current = target,
next = target,
event = { name: name,
targetScope: target },
listenerArgs = concat([event], arguments, 1);
//down while you can, then up and next sibling or up and next sibling until back at root
do {
current = next;
event.currentScope = current;
forEach(current.$$listeners[name], function(listener) {
try {
listener.apply(null, listenerArgs);
} catch(e) {
$exceptionHandler(e);
}
});
// Insanity Warning: scope depth-first traversal
// yes, this code is a bit crazy, but it works and we have tests to prove it!
// this piece should be kept in sync with the traversal in $digest
if (!(next = (current.$$childHead || (current !== target && current.$$nextSibling)))) {
while(current !== target && !(next = current.$$nextSibling)) {
current = current.$parent;
}
}
} while ((current = next));
}
};
function flagPhase(scope, phase) {
var root = scope.$root;
if (root.$$phase) {
throw Error(root.$$phase + ' already in progress');
}
root.$$phase = phase;
}
return new Scope();
function compileToFn(exp, name) {
var fn = $parse(exp);
assertArgFn(fn, name);
return fn;
}
/**
* function used as an initial value for watchers.
* because it's uniqueue we can easily tell it apart from other values
*/
function initWatchVal() {}
}];
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$sniffer
* @requires $window
*
* @property {boolean} history Does the browser support html5 history api ?
* @property {boolean} hashchange Does the browser support hashchange event ?
*
* @description
* This is very simple implementation of testing browser's features.
*/
function $SnifferProvider(){
this.$get = ['$window', function($window){
if ($window.Modernizr) return $window.Modernizr;
return {
history: !!($window.history && $window.history.pushState),
hashchange: 'onhashchange' in $window &&
// IE8 compatible mode lies
(!$window.document.documentMode || $window.document.documentMode > 7)
};
}];
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$window
*
* @description
* A reference to the browser's `window` object. While `window`
* is globally available in JavaScript, it causes testability problems, because
* it is a global variable. In angular we always refer to it through the
* `$window` service, so it may be overriden, removed or mocked for testing.
*
* All expressions are evaluated with respect to current scope so they don't
* suffer from window globality.
*
* @example
<doc:example>
<doc:source>
<input ng:init="$window = $service('$window'); greeting='Hello World!'" type="text" ng:model="greeting" />
<button ng:click="$window.alert(greeting)">ALERT</button>
</doc:source>
<doc:scenario>
</doc:scenario>
</doc:example>
*/
function $WindowProvider(){
this.$get = valueFn(window);
}
'use strict';
/**
* Parse headers into key value object
*
* @param {string} headers Raw headers as a string
* @returns {Object} Parsed headers as key value object
*/
function parseHeaders(headers) {
var parsed = {}, key, val, i;
if (!headers) return parsed;
forEach(headers.split('\n'), function(line) {
i = line.indexOf(':');
key = lowercase(trim(line.substr(0, i)));
val = trim(line.substr(i + 1));
if (key) {
if (parsed[key]) {
parsed[key] += ', ' + val;
} else {
parsed[key] = val;
}
}
});
return parsed;
}
/**
* Returns a function that provides access to parsed headers.
*
* Headers are lazy parsed when first requested.
* @see parseHeaders
*
* @param {(string|Object)} headers Headers to provide access to.
* @returns {function(string=)} Returns a getter function which if called with:
*
* - if called with single an argument returns a single header value or null
* - if called with no arguments returns an object containing all headers.
*/
function headersGetter(headers) {
var headersObj = isObject(headers) ? headers : undefined;
return function(name) {
if (!headersObj) headersObj = parseHeaders(headers);
if (name) {
return headersObj[lowercase(name)] || null;
}
return headersObj;
};
}
/**
* Chain all given functions
*
* This function is used for both request and response transforming
*
* @param {*} data Data to transform.
* @param {function(string=)} headers Http headers getter fn.
* @param {(function|Array.<function>)} fns Function or an array of functions.
* @returns {*} Transformed data.
*/
function transformData(data, headers, fns) {
if (isFunction(fns))
return fns(data, headers);
forEach(fns, function(fn) {
data = fn(data, headers);
});
return data;
}
function isSuccess(status) {
return 200 <= status && status < 300;
}
function $HttpProvider() {
var JSON_START = /^\s*(\[|\{[^\{])/,
JSON_END = /[\}\]]\s*$/,
PROTECTION_PREFIX = /^\)\]\}',?\n/;
var $config = this.defaults = {
// transform incoming response data
transformResponse: function(data) {
if (isString(data)) {
// strip json vulnerability protection prefix
data = data.replace(PROTECTION_PREFIX, '');
if (JSON_START.test(data) && JSON_END.test(data))
data = fromJson(data, true);
}
return data;
},
// transform outgoing request data
transformRequest: function(d) {
return isObject(d) ? toJson(d) : d;
},
// default headers
headers: {
common: {
'Accept': 'application/json, text/plain, */*',
'X-Requested-With': 'XMLHttpRequest'
},
post: {'Content-Type': 'application/json'},
put: {'Content-Type': 'application/json'}
}
};
var providerResponseInterceptors = this.responseInterceptors = [];
this.$get = ['$httpBackend', '$browser', '$cacheFactory', '$rootScope', '$q', '$injector',
function($httpBackend, $browser, $cacheFactory, $rootScope, $q, $injector) {
var defaultCache = $cacheFactory('$http'),
responseInterceptors = [];
forEach(providerResponseInterceptors, function(interceptor) {
responseInterceptors.push(
isString(interceptor)
? $injector.get(interceptor)
: $injector.invoke(interceptor)
);
});
/**
* @ngdoc function
* @name angular.module.ng.$http
* @requires $httpBacked
* @requires $browser
* @requires $cacheFactory
* @requires $rootScope
* @requires $q
* @requires $injector
*
* @description
* The `$http` service is a core Angular service that is responsible for communication with the
* remote HTTP servers via browser's {@link https://developer.mozilla.org/en/xmlhttprequest
* XMLHttpRequest} object or via {@link http://en.wikipedia.org/wiki/JSONP JSONP}.
*
* For unit testing applications that use `$http` service, see
* {@link angular.module.ngMock.$httpBackend $httpBackend mock}.
*
* For a higher level of abstraction, please check out the {@link angular.module.ng.$resource
* $resource} service.
*
*
* # General usage
* The `$http` service is a function which takes a single argument — a configuration object —
* that is used to generate an http request and returns a {@link angular.module.ng.$q promise}
* with two $http specific methods: `success` and `error`.
*
* <pre>
* $http({method: 'GET', url: '/someUrl'}).
* success(function(data, status, headers, config) {
* // this callback will be called asynchronously
* // when the response is available
* }).
* error(function(data, status, headers, config) {
* // called asynchronously if an error occurs
* // or server returns response with status
* // code outside of the <200, 400) range
* });
* </pre>
*
* Since the returned value is a Promise object, you can also use the `then` method to register
* callbacks, and these callbacks will receive a single argument – an object representing the
* response. See the api signature and type info below for more details.
*
*
* # Shortcut methods
*
* Since all invocation of the $http service require definition of the http method and url and
* POST and PUT requests require response body/data to be provided as well, shortcut methods
* were created to simplify using the api:
*
* <pre>
* $http.get('/someUrl').success(successCallback);
* $http.post('/someUrl', data).success(successCallback);
* </pre>
*
* Complete list of shortcut methods:
*
* - {@link angular.module.ng.$http#get $http.get}
* - {@link angular.module.ng.$http#head $http.head}
* - {@link angular.module.ng.$http#post $http.post}
* - {@link angular.module.ng.$http#put $http.put}
* - {@link angular.module.ng.$http#delete $http.delete}
* - {@link angular.module.ng.$http#jsonp $http.jsonp}
*
*
* # HTTP Headers
*
* The $http service will automatically add certain http headers to all requests. These defaults
* can be fully configured by accessing the `$httpProvider.defaults.headers` configuration
* object, which currently contains this default configuration:
*
* - `$httpProvider.defaults.headers.common` (headers that are common for all requests):
* - `Accept: application/json, text/plain, * / *`
* - `X-Requested-With: XMLHttpRequest`
* - `$httpProvider.defaults.headers.post: (header defaults for HTTP POST requests)
* - `Content-Type: application/json`
* - `$httpProvider.defaults.headers.put` (header defaults for HTTP PUT requests)
* - `Content-Type: application/json`
*
* To add or overwrite these defaults, simply add or remove a property from this configuration
* objects. To add headers for an HTTP method other than POST or PUT, simply add a new object
* with name equal to the lower-cased http method name, e.g.
* `$httpProvider.defaults.headers.get['My-Header']='value'`.
*
*
* # Request / Response transformations
*
* Both requests and responses can be transformed using transform functions. By default, Angular
* applies these transformations:
*
* Request transformations:
*
* - if the `data` property of the request config object contains an object, serialize it into
* JSON format.
*
* Response transformations:
*
* - if XSRF prefix is detected, strip it (see Security Considerations section below)
* - if json response is detected, deserialize it using a JSON parser
*
* These transformations can be overridden locally by specifying transform functions as
* `transformRequest` and/or `transformResponse` properties of the config object. To globally
* override the default transforms, override the `$httpProvider.defaults.transformRequest` and
* `$httpProvider.defaults.transformResponse` properties of the `$httpProvider`.
*
*
* # Caching
*
* You can enable caching by setting the configuration property `cache` to `true`. When the
* cache is enabled, `$http` stores the response from the server in local cache. Next time the
* response is served from the cache without sending a request to the server.
*
* Note that even if the response is served from cache, delivery of the data is asynchronous in
* the same way that real requests are.
*
* If there are multiple GET requests for the same url that should be cached using the same
* cache, but the cache is not populated yet, only one request to the server will be made and
* the remaining requests will be fulfilled using the response for the first request.
*
*
* # Response interceptors
*
* For purposes of global error handling, authentication or any kind of synchronous or
* asynchronous preprocessing of received responses, it is desirable to be able to intercept
* responses for http requests before they are handed over to the application code that
* initiated these requests. The response interceptors leverage the {@link angular.module.ng.$q
* promise apis} to fulfil this need for both synchronous and asynchronous preprocessing.
*
* The interceptors are service factories that are registered with the $httpProvider by
* adding them to the `$httpProvider.responseInterceptors` array. The factory is called and
* injected with dependencies (if specified) and returns the interceptor — a function that
* takes a {@link angular.module.ng.$q promise} and returns the original or a new promise.
*
* Before you start creating interceptors, be sure to understand the
* {@link angular.module.ng.$q $q and deferred/promise APIs}.
*
* <pre>
* // register the interceptor as a service
* $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {
* return function(promise) {
* return promise.then(function(response) {
* // do something on success
* }, function(response) {
* // do something on error
* if (canRecover(response)) {
* return responseOrNewPromise
* }
* return $q.reject(response);
* });
* }
* });
*
* $httpProvider.responseInterceptors.push('myHttpInterceptor');
*
*
* // register the interceptor via an anonymous factory
* $httpProvider.responseInterceptors.push(function($q, dependency1, dependency2) {
* return function(promise) {
* // same as above
* }
* });
* </pre>
*
*
* # Security Considerations
*
* When designing web applications your design needs to consider security threats from
* {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
* JSON Vulnerability} and {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF}.
* Both server and the client must cooperate in order to eliminate these threats. Angular comes
* pre-configured with strategies that address these issues, but for this to work backend server
* cooperation is required.
*
* ## JSON Vulnerability Protection
*
* A {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
* JSON Vulnerability} allows third party web-site to turn your JSON resource URL into
* {@link http://en.wikipedia.org/wiki/JSON#JSONP JSONP} request under some conditions. To
* counter this your server can prefix all JSON requests with following string `")]}',\n"`.
* Angular will automatically strip the prefix before processing it as JSON.
*
* For example if your server needs to return:
* <pre>
* ['one','two']
* </pre>
*
* which is vulnerable to attack, your server can return:
* <pre>
* )]}',
* ['one','two']
* </pre>
*
* Angular will strip the prefix, before processing the JSON.
*
*
* ## Cross Site Request Forgery (XSRF) Protection
*
* {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF} is a technique by which
* an unauthorized site can gain your user's private data. Angular provides following mechanism
* to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie
* called `XSRF-TOKEN` and sets it as the HTTP header `X-XSRF-TOKEN`. Since only JavaScript that
* runs on your domain could read the cookie, your server can be assured that the XHR came from
* JavaScript running on your domain.
*
* To take advantage of this, your server needs to set a token in a JavaScript readable session
* cookie called `XSRF-TOKEN` on first HTTP GET request. On subsequent non-GET requests the
* server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure
* that only JavaScript running on your domain could have read the token. The token must be
* unique for each user and must be verifiable by the server (to prevent the JavaScript making
* up its own tokens). We recommend that the token is a digest of your site's authentication
* cookie with {@link http://en.wikipedia.org/wiki/Rainbow_table salt for added security}.
*
*
* @param {object} config Object describing the request to be made and how it should be
* processed. The object has following properties:
*
* - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)
* - **url** – `{string}` – Absolute or relative URL of the resource that is being requested.
* - **data** – `{string|Object}` – Data to be sent as the request message data.
* - **headers** – `{Object}` – Map of strings representing HTTP headers to send to the server.
* - **transformRequest** – `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
* transform function or an array of such functions. The transform function takes the http
* request body and headers and returns its transformed (typically serialized) version.
* - **transformResponse** – `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
* transform function or an array of such functions. The transform function takes the http
* response body and headers and returns its transformed (typically deserialized) version.
* - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
* GET request, otherwise if a cache instance built with
* {@link angular.module.ng.$cacheFactory $cacheFactory}, this cache will be used for
* caching.
* - **timeout** – `{number}` – timeout in milliseconds.
*
* @returns {HttpPromise} Returns a {@link angular.module.ng.$q promise} object with the
* standard `then` method and two http specific methods: `success` and `error`. The `then`
* method takes two arguments a success and an error callback which will be called with a
* response object. The `success` and `error` methods take a single argument - a function that
* will be called when the request succeeds or fails respectively. The arguments passed into
* these functions are destructured representation of the response object passed into the
* `then` method. The response object has these properties:
*
* - **data** – `{string|Object}` – The response body transformed with the transform functions.
* - **status** – `{number}` – HTTP status code of the response.
* - **headers** – `{function([headerName])}` – Header getter function.
* - **config** – `{Object}` – The configuration object that was used to generate the request.
*
* @property {Array.<Object>} pendingRequests Array of config objects for currently pending
* requests. This is primarily meant to be used for debugging purposes.
*
*
* @example
<doc:example>
<doc:source jsfiddle="false">
<script>
function FetchCtrl($http) {
var self = this;
this.method = 'GET';
this.url = 'examples/http-hello.html';
this.fetch = function() {
self.code = null;
self.response = null;
$http({method: self.method, url: self.url}).
success(function(data, status) {
self.status = status;
self.data = data;
}).
error(function(data, status) {
self.data = data || "Request failed";
self.status = status;
});
};
this.updateModel = function(method, url) {
self.method = method;
self.url = url;
};
}
</script>
<div ng:controller="FetchCtrl">
<select ng:model="method">
<option>GET</option>
<option>JSONP</option>
</select>
<input type="text" ng:model="url" size="80"/>
<button ng:click="fetch()">fetch</button><br>
<button ng:click="updateModel('GET', 'examples/http-hello.html')">Sample GET</button>
<button ng:click="updateModel('JSONP', 'http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')">Sample JSONP</button>
<button ng:click="updateModel('JSONP', 'http://angularjs.org/doesntexist&callback=JSON_CALLBACK')">Invalid JSONP</button>
<pre>http status code: {{status}}</pre>
<pre>http response data: {{data}}</pre>
</div>
</doc:source>
<doc:scenario>
it('should make an xhr GET request', function() {
element(':button:contains("Sample GET")').click();
element(':button:contains("fetch")').click();
expect(binding('status')).toBe('http status code: 200');
expect(binding('data')).toBe('http response data: Hello, $http!\n');
});
it('should make a JSONP request to angularjs.org', function() {
element(':button:contains("Sample JSONP")').click();
element(':button:contains("fetch")').click();
expect(binding('status')).toBe('http status code: 200');
expect(binding('data')).toMatch(/Super Hero!/);
});
it('should make JSONP request to invalid URL and invoke the error handler',
function() {
element(':button:contains("Invalid JSONP")').click();
element(':button:contains("fetch")').click();
expect(binding('status')).toBe('http status code: 0');
expect(binding('data')).toBe('http response data: Request failed');
});
</doc:scenario>
</doc:example>
*/
function $http(config) {
config.method = uppercase(config.method);
var reqTransformFn = config.transformRequest || $config.transformRequest,
respTransformFn = config.transformResponse || $config.transformResponse,
defHeaders = $config.headers,
reqHeaders = extend({'X-XSRF-TOKEN': $browser.cookies()['XSRF-TOKEN']},
defHeaders.common, defHeaders[lowercase(config.method)], config.headers),
reqData = transformData(config.data, headersGetter(reqHeaders), reqTransformFn),
promise;
// send request
promise = sendReq(config, reqData, reqHeaders);
// transform future response
promise = promise.then(transformResponse, transformResponse);
// apply interceptors
forEach(responseInterceptors, function(interceptor) {
promise = interceptor(promise);
});
promise.success = function(fn) {
promise.then(function(response) {
fn(response.data, response.status, response.headers, config);
});
return promise;
};
promise.error = function(fn) {
promise.then(null, function(response) {
fn(response.data, response.status, response.headers, config);
});
return promise;
};
return promise;
function transformResponse(response) {
// make a copy since the response must be cacheable
var resp = extend({}, response, {
data: transformData(response.data, response.headers, respTransformFn)
});
return (isSuccess(response.status))
? resp
: $q.reject(resp);
}
}
$http.pendingRequests = [];
/**
* @ngdoc method
* @name angular.module.ng.$http#get
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `GET` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {Object=} config Optional configuration object
* @returns {HttpPromise} Future object
*/
/**
* @ngdoc method
* @name angular.module.ng.$http#delete
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `DELETE` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {Object=} config Optional configuration object
* @returns {HttpPromise} Future object
*/
/**
* @ngdoc method
* @name angular.module.ng.$http#head
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `HEAD` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {Object=} config Optional configuration object
* @returns {XhrFuture} Future object
*/
/**
* @ngdoc method
* @name angular.module.ng.$http#jsonp
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `JSONP` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request.
* Should contain `JSON_CALLBACK` string.
* @param {Object=} config Optional configuration object
* @returns {XhrFuture} Future object
*/
createShortMethods('get', 'delete', 'head', 'jsonp');
/**
* @ngdoc method
* @name angular.module.ng.$http#post
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `POST` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {*} data Request content
* @param {Object=} config Optional configuration object
* @returns {HttpPromise} Future object
*/
/**
* @ngdoc method
* @name angular.module.ng.$http#put
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `PUT` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {*} data Request content
* @param {Object=} config Optional configuration object
* @returns {XhrFuture} Future object
*/
createShortMethodsWithData('post', 'put');
return $http;
function createShortMethods(names) {
forEach(arguments, function(name) {
$http[name] = function(url, config) {
return $http(extend(config || {}, {
method: name,
url: url
}));
};
});
}
function createShortMethodsWithData(name) {
forEach(arguments, function(name) {
$http[name] = function(url, data, config) {
return $http(extend(config || {}, {
method: name,
url: url,
data: data
}));
};
});
}
/**
* Makes the request
*
* !!! ACCESSES CLOSURE VARS:
* $httpBackend, $config, $log, $rootScope, defaultCache, $http.pendingRequests
*/
function sendReq(config, reqData, reqHeaders) {
var deferred = $q.defer(),
promise = deferred.promise,
cache,
cachedResp;
$http.pendingRequests.push(config);
promise.then(removePendingReq, removePendingReq);
if (config.cache && config.method == 'GET') {
cache = isObject(config.cache) ? config.cache : defaultCache;
}
if (cache) {
cachedResp = cache.get(config.url);
if (cachedResp) {
if (cachedResp.then) {
// cached request has already been sent, but there is no response yet
cachedResp.then(removePendingReq, removePendingReq);
return cachedResp;
} else {
// serving from cache
if (isArray(cachedResp)) {
resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));
} else {
resolvePromise(cachedResp, 200, {});
}
}
} else {
// put the promise for the non-transformed response into cache as a placeholder
cache.put(config.url, promise);
}
}
// if we won't have the response in cache, send the request to the backend
if (!cachedResp) {
$httpBackend(config.method, config.url, reqData, done, reqHeaders, config.timeout);
}
return promise;
/**
* Callback registered to $httpBackend():
* - caches the response if desired
* - resolves the raw $http promise
* - calls $apply
*/
function done(status, response, headersString) {
if (cache) {
if (isSuccess(status)) {
cache.put(config.url, [status, response, parseHeaders(headersString)]);
} else {
// remove promise from the cache
cache.remove(config.url);
}
}
resolvePromise(response, status, headersString);
$rootScope.$apply();
}
/**
* Resolves the raw $http promise.
*/
function resolvePromise(response, status, headers) {
// normalize internal statuses to 0
status = Math.max(status, 0);
(isSuccess(status) ? deferred.resolve : deferred.reject)({
data: response,
status: status,
headers: headersGetter(headers),
config: config
});
}
function removePendingReq() {
var idx = indexOf($http.pendingRequests, config);
if (idx !== -1) $http.pendingRequests.splice(idx, 1);
}
}
}];
}
var XHR = window.XMLHttpRequest || function() {
try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {}
try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {}
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {}
throw new Error("This browser does not support XMLHttpRequest.");
};
/**
* @ngdoc object
* @name angular.module.ng.$httpBackend
* @requires $browser
* @requires $window
* @requires $document
*
* @description
* HTTP backend used by the {@link angular.module.ng.$http service} that delegates to
* XMLHttpRequest object or JSONP and deals with browser incompatibilities.
*
* You should never need to use this service directly, instead use the higher-level abstractions:
* {@link angular.module.ng.$http $http} or {@link angular.module.ng.$resource $resource}.
*
* During testing this implementation is swapped with {@link angular.module.ngMock.$httpBackend mock
* $httpBackend} which can be trained with responses.
*/
function $HttpBackendProvider() {
this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) {
return createHttpBackend($browser, XHR, $browser.defer, $window.angular.callbacks,
$document[0].body, $window.location.protocol.replace(':', ''));
}];
}
function createHttpBackend($browser, XHR, $browserDefer, callbacks, body, locationProtocol) {
// TODO(vojta): fix the signature
return function(method, url, post, callback, headers, timeout) {
$browser.$$incOutstandingRequestCount();
if (lowercase(method) == 'jsonp') {
var callbackId = '_' + (callbacks.counter++).toString(36);
callbacks[callbackId] = function(data) {
callbacks[callbackId].data = data;
};
var script = $browser.addJs(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId),
function() {
if (callbacks[callbackId].data) {
completeRequest(callback, 200, callbacks[callbackId].data);
} else {
completeRequest(callback, -2);
}
delete callbacks[callbackId];
body.removeChild(script);
});
} else {
var xhr = new XHR();
xhr.open(method, url, true);
forEach(headers, function(value, key) {
if (value) xhr.setRequestHeader(key, value);
});
var status;
// In IE6 and 7, this might be called synchronously when xhr.send below is called and the
// response is in the cache. the promise api will ensure that to the app code the api is
// always async
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
completeRequest(
callback, status || xhr.status, xhr.responseText, xhr.getAllResponseHeaders());
}
};
xhr.send(post || '');
if (timeout > 0) {
$browserDefer(function() {
status = -1;
xhr.abort();
}, timeout);
}
}
function completeRequest(callback, status, response, headersString) {
// URL_MATCH is defined in src/service/location.js
var protocol = (url.match(URL_MATCH) || ['', locationProtocol])[1];
// fix status code for file protocol (it's always 0)
status = (protocol == 'file') ? (response ? 200 : 404) : status;
// normalize IE bug (http://bugs.jquery.com/ticket/1450)
status = status == 1223 ? 204 : status;
callback(status, response, headersString);
$browser.$$completeOutstandingRequest(noop);
}
};
}
'use strict';
/**
* @ngdoc object
* @name angular.module.ng.$locale
*
* @description
* $locale service provides localization rules for various Angular components. As of right now the
* only public api is:
*
* * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)
*/
function $LocaleProvider(){
this.$get = function() {
return {
id: 'en-us',
NUMBER_FORMATS: {
DECIMAL_SEP: '.',
GROUP_SEP: ',',
PATTERNS: [
{ // Decimal Pattern
minInt: 1,
minFrac: 0,
maxFrac: 3,
posPre: '',
posSuf: '',
negPre: '-',
negSuf: '',
gSize: 3,
lgSize: 3
},{ //Currency Pattern
minInt: 1,
minFrac: 2,
maxFrac: 2,
posPre: '\u00A4',
posSuf: '',
negPre: '(\u00A4',
negSuf: ')',
gSize: 3,
lgSize: 3
}
],
CURRENCY_SYM: '$'
},
DATETIME_FORMATS: {
MONTH: 'January,February,March,April,May,June,July,August,September,October,November,December'
.split(','),
SHORTMONTH: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),
DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),
SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','),
AMPMS: ['AM','PM'],
medium: 'MMM d, y h:mm:ss a',
short: 'M/d/yy h:mm a',
fullDate: 'EEEE, MMMM d, y',
longDate: 'MMMM d, y',
mediumDate: 'MMM d, y',
shortDate: 'M/d/yy',
mediumTime: 'h:mm:ss a',
shortTime: 'h:mm a'
},
pluralCat: function(num) {
if (num === 1) {
return 'one';
}
return 'other';
}
};
};
}
'use strict';
/**
* @ngdoc function
* @name angular.directive
* @description
*
* Angular directives create custom attributes for DOM elements. A directive can modify the
* behavior of the element in which it is specified. Do not use directives to add elements to the
* DOM; instead, use {@link angular.widget widgets} to add DOM elements.
*
* For more information about how Angular directives work, and to learn how to create your own
* directives, see {@link guide/dev_guide.compiler.directives Understanding Angular Directives} in
* the Angular Developer Guide.
*
* @param {string} name Directive identifier (case insensitive).
* @param {function(string, Element)} compileFn Also called "template function" is a function called
* during compilation of the template when the compiler comes across the directive being
* registered. The string value of the element attribute representing the directive and
* jQuery/jqLite wrapped DOM element are passed as arguments to this function.
*
* The `compileFn` function may return a linking function also called an instance function.
* This function is called during the linking phase when a Scope is being associated with the
* template or template clone (see repeater notes below). The signature of the linking function
* is: `function(Element)` where Element is jQuery/jqLite wrapped DOM Element that is being
* linked.
*
* The biggest differenciator between the compile and linking functions is how they are being called
* when a directive is present within an {@link angular.widget.@ng:repeat ng:repeat}. In this case,
* the compile function gets called once per occurence of the directive in the template. On the
* other hand the linking function gets called once for each repeated clone of the template (times
* number of occurences of the directive in the repeated template).
*/
/**
* @ngdoc directive
* @name angular.directive.ng:init
*
* @description
* The `ng:init` attribute specifies initialization tasks to be executed
* before the template enters execution mode during bootstrap.
*
* @element ANY
* @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval.
*
* @example
<doc:example>
<doc:source>
<div ng:init="greeting='Hello'; person='World'">
{{greeting}} {{person}}!
</div>
</doc:source>
<doc:scenario>
it('should check greeting', function() {
expect(binding('greeting')).toBe('Hello');
expect(binding('person')).toBe('World');
});
</doc:scenario>
</doc:example>
*/
angularDirective("ng:init", function(expression){
return function(element){
this.$eval(expression);
};
});
/**
* @ngdoc directive
* @name angular.directive.ng:controller
*
* @description
* The `ng:controller` directive assigns behavior to a scope. This is a key aspect of how angular
* supports the principles behind the Model-View-Controller design pattern.
*
* MVC components in angular:
*
* * Model — The Model is data in scope properties; scopes are attached to the DOM.
* * View — The template (HTML with data bindings) is rendered into the View.
* * Controller — The `ng:controller` directive specifies a Controller class; the class has
* methods that typically express the business logic behind the application.
*
* Note that an alternative way to define controllers is via the `{@link angular.module.ng.$route}`
* service.
*
* @element ANY
* @param {expression} expression Name of a globally accessible constructor function or an
* {@link guide/dev_guide.expressions expression} that on the current scope evaluates to a
* constructor function.
*
* @example
* Here is a simple form for editing user contact information. Adding, removing, clearing, and
* greeting are methods declared on the controller (see source tab). These methods can
* easily be called from the angular markup. Notice that the scope becomes the `this` for the
* controller's instance. This allows for easy access to the view data from the controller. Also
* notice that any changes to the data are automatically reflected in the View without the need
* for a manual update.
<doc:example>
<doc:source>
<script type="text/javascript">
function SettingsController() {
this.name = "John Smith";
this.contacts = [
{type:'phone', value:'408 555 1212'},
{type:'email', value:'[email protected]'} ];
}
SettingsController.prototype = {
greet: function() {
alert(this.name);
},
addContact: function() {
this.contacts.push({type:'email', value:'[email protected]'});
},
removeContact: function(contactToRemove) {
var index = this.contacts.indexOf(contactToRemove);
this.contacts.splice(index, 1);
},
clearContact: function(contact) {
contact.type = 'phone';
contact.value = '';
}
};
</script>
<div ng:controller="SettingsController">
Name: <input type="text" ng:model="name"/>
[ <a href="" ng:click="greet()">greet</a> ]<br/>
Contact:
<ul>
<li ng:repeat="contact in contacts">
<select ng:model="contact.type">
<option>phone</option>
<option>email</option>
</select>
<input type="text" ng:model="contact.value"/>
[ <a href="" ng:click="clearContact(contact)">clear</a>
| <a href="" ng:click="removeContact(contact)">X</a> ]
</li>
<li>[ <a href="" ng:click="addContact()">add</a> ]</li>
</ul>
</div>
</doc:source>
<doc:scenario>
it('should check controller', function() {
expect(element('.doc-example-live div>:input').val()).toBe('John Smith');
expect(element('.doc-example-live li:nth-child(1) input').val())
.toBe('408 555 1212');
expect(element('.doc-example-live li:nth-child(2) input').val())
.toBe('[email protected]');
element('.doc-example-live li:first a:contains("clear")').click();
expect(element('.doc-example-live li:first input').val()).toBe('');
element('.doc-example-live li:last a:contains("add")').click();
expect(element('.doc-example-live li:nth-child(3) input').val())
.toBe('[email protected]');
});
</doc:scenario>
</doc:example>
*/
angularDirective("ng:controller", function(expression){
this.scope(function(scope){
var Controller =
getter(scope, expression, true) ||
getter(window, expression, true);
assertArgFn(Controller, expression);
inferInjectionArgs(Controller);
return Controller;
});
return noop;
});
/**
* @ngdoc directive
* @name angular.directive.ng:bind
*
* @description
* The `ng:bind` attribute tells Angular to replace the text content of the specified HTML element
* with the value of a given expression, and to update the text content when the value of that
* expression changes.
*
* Typically, you don't use `ng:bind` directly, but instead you use the double curly markup like
* `{{ expression }}` and let the Angular compiler transform it to
* `<span ng:bind="expression"></span>` when the template is compiled.
*
* @element ANY
* @param {expression} expression {@link guide/dev_guide.expressions Expression} to evaluate.
*
* @example
* Enter a name in the Live Preview text box; the greeting below the text box changes instantly.
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.name = 'Whirled';
}
</script>
<div ng:controller="Ctrl">
Enter name: <input type="text" ng:model="name"> <br/>
Hello <span ng:bind="name"></span>!
</div>
</doc:source>
<doc:scenario>
it('should check ng:bind', function() {
expect(using('.doc-example-live').binding('name')).toBe('Whirled');
using('.doc-example-live').input('name').enter('world');
expect(using('.doc-example-live').binding('name')).toBe('world');
});
</doc:scenario>
</doc:example>
*/
angularDirective("ng:bind", function(expression, element){
element.addClass('ng-binding');
return ['$exceptionHandler', '$parse', '$element', function($exceptionHandler, $parse, element) {
var exprFn = $parse(expression),
lastValue = Number.NaN;
this.$watch(function(scope) {
// TODO(misko): remove error handling https://github.com/angular/angular.js/issues/347
var value, html, isHtml, isDomElement,
hadOwnElement = scope.hasOwnProperty('$element'),
oldElement = scope.$element;
// TODO(misko): get rid of $element https://github.com/angular/angular.js/issues/348
scope.$element = element;
try {
value = exprFn(scope);
// If we are HTML than save the raw HTML data so that we don't recompute sanitization since
// it is expensive.
// TODO(misko): turn this into a more generic way to compute this
if ((isHtml = (value instanceof HTML)))
value = (html = value).html;
if (lastValue === value) return;
isDomElement = isElement(value);
if (!isHtml && !isDomElement && isObject(value)) {
value = toJson(value, true);
}
if (value != lastValue) {
lastValue = value;
if (isHtml) {
element.html(html.get());
} else if (isDomElement) {
element.html('');
element.append(value);
} else {
element.text(value == undefined ? '' : value);
}
}
} catch (e) {
$exceptionHandler(e);
} finally {
if (hadOwnElement) {
scope.$element = oldElement;
} else {
delete scope.$element;
}
}
});
}];
});
/**
* @ngdoc directive
* @name angular.directive.ng:bind-template
*
* @description
* The `ng:bind-template` attribute specifies that the element
* text should be replaced with the template in ng:bind-template.
* Unlike ng:bind the ng:bind-template can contain multiple `{{` `}}`
* expressions. (This is required since some HTML elements
* can not have SPAN elements such as TITLE, or OPTION to name a few.)
*
* @element ANY
* @param {string} template of form
* <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval.
*
* @example
* Try it here: enter text in text box and watch the greeting change.
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.salutation = 'Hello';
this.name = 'World';
}
</script>
<div ng:controller="Ctrl">
Salutation: <input type="text" ng:model="salutation"><br/>
Name: <input type="text" ng:model="name"><br/>
<pre ng:bind-template="{{salutation}} {{name}}!"></pre>
</div>
</doc:source>
<doc:scenario>
it('should check ng:bind', function() {
expect(using('.doc-example-live').binding('{{salutation}} {{name}}')).
toBe('Hello World!');
using('.doc-example-live').input('salutation').enter('Greetings');
using('.doc-example-live').input('name').enter('user');
expect(using('.doc-example-live').binding('{{salutation}} {{name}}')).
toBe('Greetings user!');
});
</doc:scenario>
</doc:example>
*/
angularDirective("ng:bind-template", function(expression, element){
element.addClass('ng-binding');
var templateFn = compileBindTemplate(expression);
return function(element) {
var lastValue;
this.$watch(function(scope) {
var value = templateFn(scope, element, true);
if (value != lastValue) {
element.text(value);
lastValue = value;
}
});
};
});
/**
* @ngdoc directive
* @name angular.directive.ng:bind-attr
*
* @description
* The `ng:bind-attr` attribute specifies that a
* {@link guide/dev_guide.templates.databinding databinding} should be created between a particular
* element attribute and a given expression. Unlike `ng:bind`, the `ng:bind-attr` contains one or
* more JSON key value pairs; each pair specifies an attribute and the
* {@link guide/dev_guide.expressions expression} to which it will be mapped.
*
* Instead of writing `ng:bind-attr` statements in your HTML, you can use double-curly markup to
* specify an <tt ng:non-bindable>{{expression}}</tt> for the value of an attribute.
* At compile time, the attribute is translated into an
* `<span ng:bind-attr="{attr:expression}"></span>`.
*
* The following HTML snippet shows how to specify `ng:bind-attr`:
* <pre>
* <a ng:bind-attr='{"href":"http://www.google.com/search?q={{query}}"}'>Google</a>
* </pre>
*
* This is cumbersome, so as we mentioned using double-curly markup is a prefered way of creating
* this binding:
* <pre>
* <a href="http://www.google.com/search?q={{query}}">Google</a>
* </pre>
*
* During compilation, the template with attribute markup gets translated to the ng:bind-attr form
* mentioned above.
*
* _Note_: You might want to consider using {@link angular.directive.ng:href ng:href} instead of
* `href` if the binding is present in the main application template (`index.html`) and you want to
* make sure that a user is not capable of clicking on raw/uncompiled link.
*
*
* @element ANY
* @param {string} attribute_json one or more JSON key-value pairs representing
* the attributes to replace with expressions. Each key matches an attribute
* which needs to be replaced. Each value is a text template of
* the attribute with the embedded
* <tt ng:non-bindable>{{expression}}</tt>s. Any number of
* key-value pairs can be specified.
*
* @example
* Enter a search string in the Live Preview text box and then click "Google". The search executes instantly.
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.query = 'AngularJS';
}
</script>
<div ng:controller="Ctrl">
Google for:
<input type="text" ng:model="query"/>
<a ng:bind-attr='{"href":"http://www.google.com/search?q={{query}}"}'>
Google
</a> (ng:bind-attr) |
<a href="http://www.google.com/search?q={{query}}">Google</a>
(curly binding in attribute val)
</div>
</doc:source>
<doc:scenario>
it('should check ng:bind-attr', function() {
expect(using('.doc-example-live').element('a').attr('href')).
toBe('http://www.google.com/search?q=AngularJS');
using('.doc-example-live').input('query').enter('google');
expect(using('.doc-example-live').element('a').attr('href')).
toBe('http://www.google.com/search?q=google');
});
</doc:scenario>
</doc:example>
*/
angularDirective("ng:bind-attr", function(expression){
return function(element){
var lastValue = {};
this.$watch(function(scope){
var values = scope.$eval(expression);
for(var key in values) {
var value = compileBindTemplate(values[key])(scope, element);
if (lastValue[key] !== value) {
lastValue[key] = value;
element.attr(key, BOOLEAN_ATTR[lowercase(key)] ? toBoolean(value) : value);
}
}
});
};
});
/**
* @ngdoc directive
* @name angular.directive.ng:click
*
* @description
* The ng:click allows you to specify custom behavior when
* element is clicked.
*
* @element ANY
* @param {expression} expression {@link guide/dev_guide.expressions Expression} to evaluate upon
* click.
*
* @example
<doc:example>
<doc:source>
<button ng:click="count = count + 1" ng:init="count=0">
Increment
</button>
count: {{count}}
</doc:source>
<doc:scenario>
it('should check ng:click', function() {
expect(binding('count')).toBe('0');
element('.doc-example-live :button').click();
expect(binding('count')).toBe('1');
});
</doc:scenario>
</doc:example>
*/
/*
* A directive that allows creation of custom onclick handlers that are defined as angular
* expressions and are compiled and executed within the current scope.
*
* Events that are handled via these handler are always configured not to propagate further.
*
* TODO: maybe we should consider allowing users to control event propagation in the future.
*/
angularDirective("ng:click", function(expression, element){
return function(element){
var self = this;
element.bind('click', function(event){
self.$apply(expression);
event.stopPropagation();
});
};
});
/**
* @ngdoc directive
* @name angular.directive.ng:submit
*
* @description
* Enables binding angular expressions to onsubmit events.
*
* Additionally it prevents the default action (which for form means sending the request to the
* server and reloading the current page).
*
* @element form
* @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.list = [];
this.text = 'hello';
this.submit = function() {
if (this.text) {
this.list.push(this.text);
this.text = '';
}
};
}
</script>
<form ng:submit="submit()" ng:controller="Ctrl">
Enter text and hit enter:
<input type="text" ng:model="text" name="text" />
<input type="submit" id="submit" value="Submit" />
<pre>list={{list}}</pre>
</form>
</doc:source>
<doc:scenario>
it('should check ng:submit', function() {
expect(binding('list')).toBe('list=[]');
element('.doc-example-live #submit').click();
expect(binding('list')).toBe('list=["hello"]');
expect(input('text').val()).toBe('');
});
it('should ignore empty strings', function() {
expect(binding('list')).toBe('list=[]');
element('.doc-example-live #submit').click();
element('.doc-example-live #submit').click();
expect(binding('list')).toBe('list=["hello"]');
});
</doc:scenario>
</doc:example>
*/
angularDirective("ng:submit", function(expression, element) {
return function(element) {
var self = this;
element.bind('submit', function() {
self.$apply(expression);
});
};
});
function ngClass(selector) {
return function(expression, element) {
return function(element) {
this.$watch(expression, function(scope, newVal, oldVal) {
if (selector(scope.$index)) {
if (oldVal && (newVal !== oldVal)) {
element.removeClass(isArray(oldVal) ? oldVal.join(' ') : oldVal);
}
if (newVal) element.addClass(isArray(newVal) ? newVal.join(' ') : newVal);
}
});
};
};
}
/**
* @ngdoc directive
* @name angular.directive.ng:class
*
* @description
* The `ng:class` allows you to set CSS class on HTML element dynamically by databinding an
* expression that represents all classes to be added.
*
* The directive won't add duplicate classes if a particular class was already set.
*
* When the expression changes, the previously added classes are removed and only then the classes
* new classes are added.
*
* @element ANY
* @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval. The result
* of the evaluation can be a string representing space delimited class names or an array.
*
* @example
<doc:example>
<doc:source>
<input type="button" value="set" ng:click="myVar='ng-input-indicator-wait'">
<input type="button" value="clear" ng:click="myVar=''">
<br>
<span ng:class="myVar">Sample Text </span>
</doc:source>
<doc:scenario>
it('should check ng:class', function() {
expect(element('.doc-example-live span').prop('className')).not().
toMatch(/ng-input-indicator-wait/);
using('.doc-example-live').element(':button:first').click();
expect(element('.doc-example-live span').prop('className')).
toMatch(/ng-input-indicator-wait/);
using('.doc-example-live').element(':button:last').click();
expect(element('.doc-example-live span').prop('className')).not().
toMatch(/ng-input-indicator-wait/);
});
</doc:scenario>
</doc:example>
*/
angularDirective("ng:class", ngClass(function() {return true;}));
/**
* @ngdoc directive
* @name angular.directive.ng:class-odd
*
* @description
* The `ng:class-odd` and `ng:class-even` works exactly as
* {@link angular.directive.ng:class ng:class}, except it works in conjunction with `ng:repeat` and
* takes affect only on odd (even) rows.
*
* This directive can be applied only within a scope of an
* {@link angular.widget.@ng:repeat ng:repeat}.
*
* @element ANY
* @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval. The result
* of the evaluation can be a string representing space delimited class names or an array.
*
* @example
<doc:example>
<doc:source>
<ol ng:init="names=['John', 'Mary', 'Cate', 'Suz']">
<li ng:repeat="name in names">
<span ng:class-odd="'ng-format-negative'"
ng:class-even="'ng-input-indicator-wait'">
{{name}}
</span>
</li>
</ol>
</doc:source>
<doc:scenario>
it('should check ng:class-odd and ng:class-even', function() {
expect(element('.doc-example-live li:first span').prop('className')).
toMatch(/ng-format-negative/);
expect(element('.doc-example-live li:last span').prop('className')).
toMatch(/ng-input-indicator-wait/);
});
</doc:scenario>
</doc:example>
*/
angularDirective("ng:class-odd", ngClass(function(i){return i % 2 === 0;}));
/**
* @ngdoc directive
* @name angular.directive.ng:class-even
*
* @description
* The `ng:class-odd` and `ng:class-even` works exactly as
* {@link angular.directive.ng:class ng:class}, except it works in conjunction with `ng:repeat` and
* takes affect only on odd (even) rows.
*
* This directive can be applied only within a scope of an
* {@link angular.widget.@ng:repeat ng:repeat}.
*
* @element ANY
* @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval. The result
* of the evaluation can be a string representing space delimited class names or an array.
*
* @example
<doc:example>
<doc:source>
<ol ng:init="names=['John', 'Mary', 'Cate', 'Suz']">
<li ng:repeat="name in names">
<span ng:class-odd="'odd'" ng:class-even="'even'">
{{name}}
</span>
</li>
</ol>
</doc:source>
<doc:scenario>
it('should check ng:class-odd and ng:class-even', function() {
expect(element('.doc-example-live li:first span').prop('className')).
toMatch(/odd/);
expect(element('.doc-example-live li:last span').prop('className')).
toMatch(/even/);
});
</doc:scenario>
</doc:example>
*/
angularDirective("ng:class-even", ngClass(function(i){return i % 2 === 1;}));
/**
* @ngdoc directive
* @name angular.directive.ng:show
*
* @description
* The `ng:show` and `ng:hide` directives show or hide a portion of the DOM tree (HTML)
* conditionally.
*
* @element ANY
* @param {expression} expression If the {@link guide/dev_guide.expressions expression} is truthy
* then the element is shown or hidden respectively.
*
* @example
<doc:example>
<doc:source>
Click me: <input type="checkbox" ng:model="checked"><br/>
Show: <span ng:show="checked">I show up when your checkbox is checked.</span> <br/>
Hide: <span ng:hide="checked">I hide when your checkbox is checked.</span>
</doc:source>
<doc:scenario>
it('should check ng:show / ng:hide', function() {
expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);
expect(element('.doc-example-live span:last:visible').count()).toEqual(1);
input('checked').check();
expect(element('.doc-example-live span:first:visible').count()).toEqual(1);
expect(element('.doc-example-live span:last:hidden').count()).toEqual(1);
});
</doc:scenario>
</doc:example>
*/
angularDirective("ng:show", function(expression, element){
return function(element){
this.$watch(expression, function(scope, value){
element.css('display', toBoolean(value) ? '' : 'none');
});
};
});
/**
* @ngdoc directive
* @name angular.directive.ng:hide
*
* @description
* The `ng:hide` and `ng:show` directives hide or show a portion
* of the HTML conditionally.
*
* @element ANY
* @param {expression} expression If the {@link guide/dev_guide.expressions expression} truthy then
* the element is shown or hidden respectively.
*
* @example
<doc:example>
<doc:source>
Click me: <input type="checkbox" ng:model="checked"><br/>
Show: <span ng:show="checked">I show up when you checkbox is checked?</span> <br/>
Hide: <span ng:hide="checked">I hide when you checkbox is checked?</span>
</doc:source>
<doc:scenario>
it('should check ng:show / ng:hide', function() {
expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);
expect(element('.doc-example-live span:last:visible').count()).toEqual(1);
input('checked').check();
expect(element('.doc-example-live span:first:visible').count()).toEqual(1);
expect(element('.doc-example-live span:last:hidden').count()).toEqual(1);
});
</doc:scenario>
</doc:example>
*/
angularDirective("ng:hide", function(expression, element){
return function(element){
this.$watch(expression, function(scope, value){
element.css('display', toBoolean(value) ? 'none' : '');
});
};
});
/**
* @ngdoc directive
* @name angular.directive.ng:style
*
* @description
* The ng:style allows you to set CSS style on an HTML element conditionally.
*
* @element ANY
* @param {expression} expression {@link guide/dev_guide.expressions Expression} which evals to an
* object whose keys are CSS style names and values are corresponding values for those CSS
* keys.
*
* @example
<doc:example>
<doc:source>
<input type="button" value="set" ng:click="myStyle={color:'red'}">
<input type="button" value="clear" ng:click="myStyle={}">
<br/>
<span ng:style="myStyle">Sample Text</span>
<pre>myStyle={{myStyle}}</pre>
</doc:source>
<doc:scenario>
it('should check ng:style', function() {
expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)');
element('.doc-example-live :button[value=set]').click();
expect(element('.doc-example-live span').css('color')).toBe('rgb(255, 0, 0)');
element('.doc-example-live :button[value=clear]').click();
expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)');
});
</doc:scenario>
</doc:example>
*/
angularDirective("ng:style", function(expression, element) {
return function(element) {
this.$watch(expression, function(scope, newStyles, oldStyles) {
if (oldStyles && (newStyles !== oldStyles)) {
forEach(oldStyles, function(val, style) { element.css(style, '');});
}
if (newStyles) element.css(newStyles);
});
};
});
/**
* @ngdoc directive
* @name angular.directive.ng:cloak
*
* @description
* The `ng:cloak` directive is used to prevent the Angular html template from being briefly
* displayed by the browser in its raw (uncompiled) form while your application is loading. Use this
* directive to avoid the undesirable flicker effect caused by the html template display.
*
* The directive can be applied to the `<body>` element, but typically a fine-grained application is
* prefered in order to benefit from progressive rendering of the browser view.
*
* `ng:cloak` works in cooperation with a css rule that is embedded within `angular.js` and
* `angular.min.js` files. Following is the css rule:
*
* <pre>
* [ng\:cloak], .ng-cloak {
* display: none;
* }
* </pre>
*
* When this css rule is loaded by the browser, all html elements (including their children) that
* are tagged with the `ng:cloak` directive are hidden. When Angular comes across this directive
* during the compilation of the template it deletes the `ng:cloak` element attribute, which
* makes the compiled element visible.
*
* For the best result, `angular.js` script must be loaded in the head section of the html file;
* alternatively, the css rule (above) must be included in the external stylesheet of the
* application.
*
* Legacy browsers, like IE7, do not provide attribute selector support (added in CSS 2.1) so they
* cannot match the `[ng\:cloak]` selector. To work around this limitation, you must add the css
* class `ng-cloak` in addition to `ng:cloak` directive as shown in the example below.
*
* @element ANY
*
* @example
<doc:example>
<doc:source>
<div id="template1" ng:cloak>{{ 'hello' }}</div>
<div id="template2" ng:cloak class="ng-cloak">{{ 'hello IE7' }}</div>
</doc:source>
<doc:scenario>
it('should remove the template directive and css class', function() {
expect(element('.doc-example-live #template1').attr('ng:cloak')).
not().toBeDefined();
expect(element('.doc-example-live #template2').attr('ng:cloak')).
not().toBeDefined();
});
</doc:scenario>
</doc:example>
*
*/
angularDirective("ng:cloak", function(expression, element) {
element.removeAttr('ng:cloak');
element.removeClass('ng-cloak');
});
'use strict';
/**
* @ngdoc overview
* @name angular.markup
* @description
*
* Angular markup transforms the content of DOM elements or portions of the content into other
* text or DOM elements for further compilation.
*
* Markup extensions do not themselves produce linking functions. Think of markup as a way to
* produce shorthand for a {@link angular.widget widget} or a {@link angular.directive directive}.
*
* The most prominent example of a markup in Angular is the built-in, double curly markup
* `{{expression}}`, which is shorthand for `<span ng:bind="expression"></span>`.
*
* Create custom markup like this:
*
* <pre>
* angular.markup('newMarkup', function(text, textNode, parentElement){
* //tranformation code
* });
* </pre>
*
* For more information, see {@link guide/dev_guide.compiler.markup Understanding Angular Markup}
* in the Angular Developer Guide.
*/
/**
* @ngdoc overview
* @name angular.attrMarkup
* @description
*
* Attribute markup allows you to modify the state of an attribute's text.
*
* Attribute markup extends the Angular complier in a way similar to {@link angular.markup},
* which allows you to modify the content of a node.
*
* The most prominent example of an attribute markup in Angular is the built-in double curly markup
* which is a shorthand for {@link angular.directive.ng:bind-attr ng:bind-attr}.
*
* ## Example
*
* <pre>
* angular.attrMarkup('newAttrMarkup', function(attrValue, attrName, element){
* //tranformation code
* });
* </pre>
*
* For more information about Angular attribute markup, see {@link guide/dev_guide.compiler.markup
* Understanding Angular Markup} in the Angular Developer Guide.
*/
angularTextMarkup('{{}}', function(text, textNode, parentElement) {
var bindings = parseBindings(text),
self = this;
if (hasBindings(bindings)) {
if (isLeafNode(parentElement[0])) {
parentElement.attr('ng:bind-template', text);
} else {
var cursor = textNode, newElement;
forEach(parseBindings(text), function(text){
var exp = binding(text);
if (exp) {
newElement = jqLite('<span>');
newElement.attr('ng:bind', exp);
} else {
newElement = jqLite(document.createTextNode(text));
}
if (msie && text.charAt(0) == ' ') {
newElement = jqLite('<span> </span>');
var nbsp = newElement.html();
newElement.text(text.substr(1));
newElement.html(nbsp + newElement.html());
}
cursor.after(newElement);
cursor = newElement;
});
textNode.remove();
}
}
});
/**
* This tries to normalize the behavior of value attribute across browsers. If value attribute is
* not specified, then specify it to be that of the text.
*/
angularTextMarkup('option', function(text, textNode, parentElement){
if (lowercase(nodeName_(parentElement)) == 'option') {
if (msie <= 7) {
// In IE7 The issue is that there is no way to see if the value was specified hence
// we have to resort to parsing HTML;
htmlParser(parentElement[0].outerHTML, {
start: function(tag, attrs) {
if (isUndefined(attrs.value)) {
parentElement.attr('value', text);
}
}
});
} else if (parentElement[0].getAttribute('value') == null) {
// jQuery does normalization on 'value' so we have to bypass it.
parentElement.attr('value', text);
}
}
});
/**
* @ngdoc directive
* @name angular.directive.ng:href
*
* @description
* Using <angular/> markup like {{hash}} in an href attribute makes
* the page open to a wrong URL, if the user clicks that link before
* angular has a chance to replace the {{hash}} with actual URL, the
* link will be broken and will most likely return a 404 error.
* The `ng:href` solves this problem by placing the `href` in the
* `ng:` namespace.
*
* The buggy way to write it:
* <pre>
* <a href="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre>
*
* The correct way to write it:
* <pre>
* <a ng:href="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre>
*
* @element ANY
* @param {template} template any string which can contain `{{}}` markup.
*
* @example
* This example uses `link` variable inside `href` attribute:
<doc:example>
<doc:source>
<input ng:model="value" /><br />
<a id="link-1" href ng:click="value = 1">link 1</a> (link, don't reload)<br />
<a id="link-2" href="" ng:click="value = 2">link 2</a> (link, don't reload)<br />
<a id="link-3" ng:href="/{{'123'}}" ng:ext-link>link 3</a> (link, reload!)<br />
<a id="link-4" href="" name="xx" ng:click="value = 4">anchor</a> (link, don't reload)<br />
<a id="link-5" name="xxx" ng:click="value = 5">anchor</a> (no link)<br />
<a id="link-6" ng:href="/{{value}}" ng:ext-link>link</a> (link, change hash)
</doc:source>
<doc:scenario>
it('should execute ng:click but not reload when href without value', function() {
element('#link-1').click();
expect(input('value').val()).toEqual('1');
expect(element('#link-1').attr('href')).toBe("");
});
it('should execute ng:click but not reload when href empty string', function() {
element('#link-2').click();
expect(input('value').val()).toEqual('2');
expect(element('#link-2').attr('href')).toBe("");
});
it('should execute ng:click and change url when ng:href specified', function() {
expect(element('#link-3').attr('href')).toBe("/123");
element('#link-3').click();
expect(browser().window().path()).toEqual('/123');
});
it('should execute ng:click but not reload when href empty string and name specified', function() {
element('#link-4').click();
expect(input('value').val()).toEqual('4');
expect(element('#link-4').attr('href')).toBe("");
});
it('should execute ng:click but not reload when no href but name specified', function() {
element('#link-5').click();
expect(input('value').val()).toEqual('5');
expect(element('#link-5').attr('href')).toBe(undefined);
});
it('should only change url when only ng:href', function() {
input('value').enter('6');
expect(element('#link-6').attr('href')).toBe("/6");
element('#link-6').click();
expect(browser().window().path()).toEqual('/6');
});
</doc:scenario>
</doc:example>
*/
/**
* @ngdoc directive
* @name angular.directive.ng:src
*
* @description
* Using <angular/> markup like `{{hash}}` in a `src` attribute doesn't
* work right: The browser will fetch from the URL with the literal
* text `{{hash}}` until <angular/> replaces the expression inside
* `{{hash}}`. The `ng:src` attribute solves this problem by placing
* the `src` attribute in the `ng:` namespace.
*
* The buggy way to write it:
* <pre>
* <img src="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre>
*
* The correct way to write it:
* <pre>
* <img ng:src="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre>
*
* @element ANY
* @param {template} template any string which can contain `{{}}` markup.
*/
/**
* @ngdoc directive
* @name angular.directive.ng:disabled
*
* @description
*
* The following markup will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:
* <pre>
* <div ng:init="scope = { isDisabled: false }">
* <button disabled="{{scope.isDisabled}}">Disabled</button>
* </div>
* </pre>
*
* The HTML specs do not require browsers to preserve the special attributes such as disabled.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce ng:disabled.
*
* @example
<doc:example>
<doc:source>
Click me to toggle: <input type="checkbox" ng:model="checked"><br/>
<button ng:model="button" ng:disabled="{{checked}}">Button</button>
</doc:source>
<doc:scenario>
it('should toggle button', function() {
expect(element('.doc-example-live :button').prop('disabled')).toBeFalsy();
input('checked').check();
expect(element('.doc-example-live :button').prop('disabled')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element ANY
* @param {template} template any string which can contain '{{}}' markup.
*/
/**
* @ngdoc directive
* @name angular.directive.ng:checked
*
* @description
* The HTML specs do not require browsers to preserve the special attributes such as checked.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce ng:checked.
* @example
<doc:example>
<doc:source>
Check me to check both: <input type="checkbox" ng:model="master"><br/>
<input id="checkSlave" type="checkbox" ng:checked="{{master}}">
</doc:source>
<doc:scenario>
it('should check both checkBoxes', function() {
expect(element('.doc-example-live #checkSlave').prop('checked')).toBeFalsy();
input('master').check();
expect(element('.doc-example-live #checkSlave').prop('checked')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element ANY
* @param {template} template any string which can contain '{{}}' markup.
*/
/**
* @ngdoc directive
* @name angular.directive.ng:multiple
*
* @description
* The HTML specs do not require browsers to preserve the special attributes such as multiple.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce ng:multiple.
*
* @example
<doc:example>
<doc:source>
Check me check multiple: <input type="checkbox" ng:model="checked"><br/>
<select id="select" ng:multiple="{{checked}}">
<option>Misko</option>
<option>Igor</option>
<option>Vojta</option>
<option>Di</option>
</select>
</doc:source>
<doc:scenario>
it('should toggle multiple', function() {
expect(element('.doc-example-live #select').prop('multiple')).toBeFalsy();
input('checked').check();
expect(element('.doc-example-live #select').prop('multiple')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element ANY
* @param {template} template any string which can contain '{{}}' markup.
*/
/**
* @ngdoc directive
* @name angular.directive.ng:readonly
*
* @description
* The HTML specs do not require browsers to preserve the special attributes such as readonly.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce ng:readonly.
* @example
<doc:example>
<doc:source>
Check me to make text readonly: <input type="checkbox" ng:model="checked"><br/>
<input type="text" ng:readonly="{{checked}}" value="I'm Angular"/>
</doc:source>
<doc:scenario>
it('should toggle readonly attr', function() {
expect(element('.doc-example-live :text').prop('readonly')).toBeFalsy();
input('checked').check();
expect(element('.doc-example-live :text').prop('readonly')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element ANY
* @param {template} template any string which can contain '{{}}' markup.
*/
/**
* @ngdoc directive
* @name angular.directive.ng:selected
*
* @description
* The HTML specs do not require browsers to preserve the special attributes such as selected.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce ng:selected.
* @example
<doc:example>
<doc:source>
Check me to select: <input type="checkbox" ng:model="checked"><br/>
<select>
<option>Hello!</option>
<option id="greet" ng:selected="{{checked}}">Greetings!</option>
</select>
</doc:source>
<doc:scenario>
it('should select Greetings!', function() {
expect(element('.doc-example-live #greet').prop('selected')).toBeFalsy();
input('checked').check();
expect(element('.doc-example-live #greet').prop('selected')).toBeTruthy();
});
</doc:scenario>
</doc:example>
* @element ANY
* @param {template} template any string which can contain '{{}}' markup.
*/
var NG_BIND_ATTR = 'ng:bind-attr';
var SIDE_EFFECT_ATTRS = {};
forEach('src,href,multiple,selected,checked,disabled,readonly,required'.split(','), function(name) {
SIDE_EFFECT_ATTRS['ng:' + name] = name;
});
angularAttrMarkup('{{}}', function(value, name, element){
// don't process existing attribute markup
if (angularDirective(name) || angularDirective("@" + name)) return;
if (msie && name == 'src')
value = decodeURI(value);
var bindings = parseBindings(value),
bindAttr;
if (hasBindings(bindings) || SIDE_EFFECT_ATTRS[name]) {
element.removeAttr(name);
bindAttr = fromJson(element.attr(NG_BIND_ATTR) || "{}");
bindAttr[SIDE_EFFECT_ATTRS[name] || name] = value;
element.attr(NG_BIND_ATTR, toJson(bindAttr));
}
});
'use strict';
/**
* @ngdoc overview
* @name angular.widget
* @description
*
* An angular widget can be either a custom attribute that modifies an existing DOM element or an
* entirely new DOM element.
*
* During html compilation, widgets are processed after {@link angular.markup markup}, but before
* {@link angular.directive directives}.
*
* Following is the list of built-in angular widgets:
*
* * {@link angular.widget.@ng:non-bindable ng:non-bindable} - Blocks angular from processing an
* HTML element.
* * {@link angular.widget.@ng:repeat ng:repeat} - Creates and manages a collection of cloned HTML
* elements.
* * {@link angular.inputType HTML input elements} - Standard HTML input elements data-bound by
* angular.
* * {@link angular.widget.ng:view ng:view} - Works with $route to "include" partial templates
* * {@link angular.widget.ng:switch ng:switch} - Conditionally changes DOM structure
* * {@link angular.widget.ng:include ng:include} - Includes an external HTML fragment
*
* For more information about angular widgets, see {@link guide/dev_guide.compiler.widgets
* Understanding Angular Widgets} in the angular Developer Guide.
*/
/**
* @ngdoc widget
* @name angular.widget.ng:include
*
* @description
* Fetches, compiles and includes an external HTML fragment.
*
* Keep in mind that Same Origin Policy applies to included resources
* (e.g. ng:include won't work for file:// access).
*
* @param {string} src angular expression evaluating to URL. If the source is a string constant,
* make sure you wrap it in quotes, e.g. `src="'myPartialTemplate.html'"`.
* @param {Scope=} [scope=new_child_scope] optional expression which evaluates to an
* instance of angular.module.ng.$rootScope.Scope to set the HTML fragment to.
* @param {string=} onload Expression to evaluate when a new partial is loaded.
*
* @param {string=} autoscroll Whether `ng:include` should call {@link angular.module.ng.$anchorScroll
* $anchorScroll} to scroll the viewport after the content is loaded.
*
* - If the attribute is not set, disable scrolling.
* - If the attribute is set without value, enable scrolling.
* - Otherwise enable scrolling only if the expression evaluates to truthy value.
*
* @example
<doc:example>
<doc:source jsfiddle="false">
<script>
function Ctrl() {
this.templates =
[ { name: 'template1.html', url: 'examples/ng-include/template1.html'}
, { name: 'template2.html', url: 'examples/ng-include/template2.html'} ];
this.template = this.templates[0];
}
</script>
<div ng:controller="Ctrl">
<select ng:model="template" ng:options="t.name for t in templates">
<option value="">(blank)</option>
</select>
url of the template: <tt><a href="{{template.url}}">{{template.url}}</a></tt>
<hr/>
<ng:include src="template.url"></ng:include>
</div>
</doc:source>
<doc:scenario>
it('should load template1.html', function() {
expect(element('.doc-example-live .ng-include').text()).
toBe('Content of template1.html\n');
});
it('should load template2.html', function() {
select('template').option('1');
expect(element('.doc-example-live .ng-include').text()).
toBe('Content of template2.html\n');
});
it('should change to blank', function() {
select('template').option('');
expect(element('.doc-example-live .ng-include').text()).toEqual('');
});
</doc:scenario>
</doc:example>
*/
angularWidget('ng:include', function(element){
var compiler = this,
srcExp = element.attr("src"),
scopeExp = element.attr("scope") || '',
onloadExp = element[0].getAttribute('onload') || '', //workaround for jquery bug #7537
autoScrollExp = element.attr('autoscroll');
if (element[0]['ng:compiled']) {
this.descend(true);
this.directives(true);
} else {
element[0]['ng:compiled'] = true;
return ['$http', '$templateCache', '$anchorScroll', '$element',
function($http, $templateCache, $anchorScroll, element) {
var scope = this,
changeCounter = 0,
childScope;
function incrementChange() { changeCounter++;}
this.$watch(srcExp, incrementChange);
this.$watch(function() {
var includeScope = scope.$eval(scopeExp);
if (includeScope) return includeScope.$id;
}, incrementChange);
this.$watch(function() {return changeCounter;}, function(scope, newChangeCounter) {
var src = scope.$eval(srcExp),
useScope = scope.$eval(scopeExp);
function clearContent() {
// if this callback is still desired
if (newChangeCounter === changeCounter) {
if (childScope) childScope.$destroy();
childScope = null;
element.html('');
}
}
if (src) {
$http.get(src, {cache: $templateCache}).success(function(response) {
// if this callback is still desired
if (newChangeCounter === changeCounter) {
element.html(response);
if (childScope) childScope.$destroy();
childScope = useScope ? useScope : scope.$new();
compiler.compile(element)(childScope);
if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {
$anchorScroll();
}
scope.$eval(onloadExp);
}
}).error(clearContent);
} else {
clearContent();
}
});
}];
}
});
/**
* @ngdoc widget
* @name angular.widget.ng:switch
*
* @description
* Conditionally change the DOM structure.
*
* @usageContent
* <any ng:switch-when="matchValue1">...</any>
* <any ng:switch-when="matchValue2">...</any>
* ...
* <any ng:switch-default>...</any>
*
* @param {*} on expression to match against <tt>ng:switch-when</tt>.
* @paramDescription
* On child elments add:
*
* * `ng:switch-when`: the case statement to match against. If match then this
* case will be displayed.
* * `ng:switch-default`: the default case when no other casses match.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.items = ['settings', 'home', 'other'];
this.selection = this.items[0];
}
</script>
<div ng:controller="Ctrl">
<select ng:model="selection" ng:options="item for item in items">
</select>
<tt>selection={{selection}}</tt>
<hr/>
<ng:switch on="selection" >
<div ng:switch-when="settings">Settings Div</div>
<span ng:switch-when="home">Home Span</span>
<span ng:switch-default>default</span>
</ng:switch>
</div>
</doc:source>
<doc:scenario>
it('should start in settings', function() {
expect(element('.doc-example-live ng\\:switch').text()).toEqual('Settings Div');
});
it('should change to home', function() {
select('selection').option('home');
expect(element('.doc-example-live ng\\:switch').text()).toEqual('Home Span');
});
it('should select deafault', function() {
select('selection').option('other');
expect(element('.doc-example-live ng\\:switch').text()).toEqual('default');
});
</doc:scenario>
</doc:example>
*/
angularWidget('ng:switch', function(element) {
var compiler = this,
watchExpr = element.attr("on"),
changeExpr = element.attr('change'),
casesTemplate = {},
defaultCaseTemplate,
children = element.children(),
length = children.length,
child,
when;
if (!watchExpr) throw new Error("Missing 'on' attribute.");
while(length--) {
child = jqLite(children[length]);
// this needs to be here for IE
child.remove();
when = child.attr('ng:switch-when');
if (isString(when)) {
casesTemplate[when] = compiler.compile(child);
} else if (isString(child.attr('ng:switch-default'))) {
defaultCaseTemplate = compiler.compile(child);
}
}
children = null; // release memory;
element.html('');
return function(element){
var changeCounter = 0;
var childScope;
var selectedTemplate;
this.$watch(watchExpr, function(scope, value) {
element.html('');
if ((selectedTemplate = casesTemplate[value] || defaultCaseTemplate)) {
changeCounter++;
if (childScope) childScope.$destroy();
childScope = scope.$new();
childScope.$eval(changeExpr);
}
});
this.$watch(function() {return changeCounter;}, function() {
element.html('');
if (selectedTemplate) {
selectedTemplate(childScope, function(caseElement) {
element.append(caseElement);
});
}
});
};
});
/*
* Modifies the default behavior of html A tag, so that the default action is prevented when href
* attribute is empty.
*
* The reasoning for this change is to allow easy creation of action links with ng:click without
* changing the location or causing page reloads, e.g.:
* <a href="" ng:click="model.$save()">Save</a>
*/
angularWidget('a', function() {
this.descend(true);
this.directives(true);
return function(element) {
var hasNgHref = ((element.attr('ng:bind-attr') || '').indexOf('"href":') !== -1);
// turn <a href ng:click="..">link</a> into a link in IE
// but only if it doesn't have name attribute, in which case it's an anchor
if (!hasNgHref && !element.attr('name') && !element.attr('href')) {
element.attr('href', '');
}
if (element.attr('href') === '' && !hasNgHref) {
element.bind('click', function(event){
event.preventDefault();
});
}
};
});
/**
* @ngdoc widget
* @name angular.widget.@ng:repeat
*
* @description
* The `ng:repeat` widget instantiates a template once per item from a collection. Each template
* instance gets its own scope, where the given loop variable is set to the current collection item,
* and `$index` is set to the item index or key.
*
* Special properties are exposed on the local scope of each template instance, including:
*
* * `$index` – `{number}` – iterator offset of the repeated element (0..length-1)
* * `$position` – `{string}` – position of the repeated element in the iterator. One of:
* * `'first'`,
* * `'middle'`
* * `'last'`
*
* Note: Although `ng:repeat` looks like a directive, it is actually an attribute widget.
*
* @element ANY
* @param {string} repeat_expression The expression indicating how to enumerate a collection. Two
* formats are currently supported:
*
* * `variable in expression` – where variable is the user defined loop variable and `expression`
* is a scope expression giving the collection to enumerate.
*
* For example: `track in cd.tracks`.
*
* * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers,
* and `expression` is the scope expression giving the collection to enumerate.
*
* For example: `(name, age) in {'adam':10, 'amalie':12}`.
*
* @example
* This example initializes the scope to a list of names and
* then uses `ng:repeat` to display every person:
<doc:example>
<doc:source>
<div ng:init="friends = [{name:'John', age:25}, {name:'Mary', age:28}]">
I have {{friends.length}} friends. They are:
<ul>
<li ng:repeat="friend in friends">
[{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.
</li>
</ul>
</div>
</doc:source>
<doc:scenario>
it('should check ng:repeat', function() {
var r = using('.doc-example-live').repeater('ul li');
expect(r.count()).toBe(2);
expect(r.row(0)).toEqual(["1","John","25"]);
expect(r.row(1)).toEqual(["2","Mary","28"]);
});
</doc:scenario>
</doc:example>
*/
angularWidget('@ng:repeat', function(expression, element){
element.removeAttr('ng:repeat');
element.replaceWith(jqLite('<!-- ng:repeat: ' + expression + ' -->'));
var linker = this.compile(element);
return function(iterStartElement){
var match = expression.match(/^\s*(.+)\s+in\s+(.*)\s*$/),
lhs, rhs, valueIdent, keyIdent;
if (! match) {
throw Error("Expected ng:repeat in form of '_item_ in _collection_' but got '" +
expression + "'.");
}
lhs = match[1];
rhs = match[2];
match = lhs.match(/^([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\)$/);
if (!match) {
throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '" +
keyValue + "'.");
}
valueIdent = match[3] || match[1];
keyIdent = match[2];
var parentScope = this;
// Store a list of elements from previous run. This is a hash where key is the item from the
// iterator, and the value is an array of objects with following properties.
// - scope: bound scope
// - element: previous element.
// - index: position
// We need an array of these objects since the same object can be returned from the iterator.
// We expect this to be a rare case.
var lastOrder = new HashQueueMap();
this.$watch(function(scope){
var index, length,
collection = scope.$eval(rhs),
collectionLength = size(collection, true),
childScope,
// Same as lastOrder but it has the current state. It will become the
// lastOrder on the next iteration.
nextOrder = new HashQueueMap(),
key, value, // key/value of iteration
array, last, // last object information {scope, element, index}
cursor = iterStartElement; // current position of the node
if (!isArray(collection)) {
// if object, extract keys, sort them and use to determine order of iteration over obj props
array = [];
for(key in collection) {
if (collection.hasOwnProperty(key) && key.charAt(0) != '$') {
array.push(key);
}
}
array.sort();
} else {
array = collection || [];
}
// we are not using forEach for perf reasons (trying to avoid #call)
for (index = 0, length = array.length; index < length; index++) {
key = (collection === array) ? index : array[index];
value = collection[key];
last = lastOrder.shift(value);
if (last) {
// if we have already seen this object, then we need to reuse the
// associated scope/element
childScope = last.scope;
nextOrder.push(value, last);
if (index === last.index) {
// do nothing
cursor = last.element;
} else {
// existing item which got moved
last.index = index;
// This may be a noop, if the element is next, but I don't know of a good way to
// figure this out, since it would require extra DOM access, so let's just hope that
// the browsers realizes that it is noop, and treats it as such.
cursor.after(last.element);
cursor = last.element;
}
} else {
// new item which we don't know about
childScope = parentScope.$new();
}
childScope[valueIdent] = value;
if (keyIdent) childScope[keyIdent] = key;
childScope.$index = index;
childScope.$position = index === 0 ?
'first' :
(index == collectionLength - 1 ? 'last' : 'middle');
if (!last) {
linker(childScope, function(clone){
cursor.after(clone);
last = {
scope: childScope,
element: (cursor = clone),
index: index
};
nextOrder.push(value, last);
});
}
}
//shrink children
for (key in lastOrder) {
if (lastOrder.hasOwnProperty(key)) {
array = lastOrder[key];
while(array.length) {
value = array.pop();
value.element.remove();
value.scope.$destroy();
}
}
}
lastOrder = nextOrder;
});
};
});
/**
* @ngdoc widget
* @name angular.widget.@ng:non-bindable
*
* @description
* Sometimes it is necessary to write code which looks like bindings but which should be left alone
* by angular. Use `ng:non-bindable` to make angular ignore a chunk of HTML.
*
* Note: `ng:non-bindable` looks like a directive, but is actually an attribute widget.
*
* @element ANY
*
* @example
* In this example there are two location where a simple binding (`{{}}`) is present, but the one
* wrapped in `ng:non-bindable` is left alone.
*
* @example
<doc:example>
<doc:source>
<div>Normal: {{1 + 2}}</div>
<div ng:non-bindable>Ignored: {{1 + 2}}</div>
</doc:source>
<doc:scenario>
it('should check ng:non-bindable', function() {
expect(using('.doc-example-live').binding('1 + 2')).toBe('3');
expect(using('.doc-example-live').element('div:last').text()).
toMatch(/1 \+ 2/);
});
</doc:scenario>
</doc:example>
*/
angularWidget("@ng:non-bindable", noop);
/**
* @ngdoc widget
* @name angular.widget.ng:view
*
* @description
* # Overview
* `ng:view` is a widget that complements the {@link angular.module.ng.$route $route} service by
* including the rendered template of the current route into the main layout (`index.html`) file.
* Every time the current route changes, the included view changes with it according to the
* configuration of the `$route` service.
*
* This widget provides functionality similar to {@link angular.widget.ng:include ng:include} when
* used like this:
*
* <ng:include src="$route.current.template" scope="$route.current.scope"></ng:include>
*
*
* # Advantages
* Compared to `ng:include`, `ng:view` offers these advantages:
*
* - shorter syntax
* - more efficient execution
* - doesn't require `$route` service to be available on the root scope
*
*
* @example
<doc:example>
<doc:source jsfiddle="false">
<script>
function MyCtrl($route) {
$route.when('/overview',
{ controller: OverviewCtrl,
template: 'partials/guide/dev_guide.overview.html'});
$route.when('/bootstrap',
{ controller: BootstrapCtrl,
template: 'partials/guide/dev_guide.bootstrap.auto_bootstrap.html'});
};
MyCtrl.$inject = ['$route'];
function BootstrapCtrl() {}
function OverviewCtrl() {}
</script>
<div ng:controller="MyCtrl">
<a href="overview">overview</a> |
<a href="bootstrap">bootstrap</a> |
<a href="undefined">undefined</a>
<br/>
The view is included below:
<hr/>
<ng:view></ng:view>
</div>
</doc:source>
<doc:scenario>
it('should load templates', function() {
element('.doc-example-live a:contains(overview)').click();
expect(element('.doc-example-live ng\\:view').text()).toMatch(/Developer Guide: Overview/);
element('.doc-example-live a:contains(bootstrap)').click();
expect(element('.doc-example-live ng\\:view').text()).toMatch(/Developer Guide: Initializing Angular: Automatic Initialization/);
});
</doc:scenario>
</doc:example>
*/
angularWidget('ng:view', function(element) {
var compiler = this;
if (!element[0]['ng:compiled']) {
element[0]['ng:compiled'] = true;
return ['$http', '$templateCache', '$route', '$anchorScroll', '$element',
function($http, $templateCache, $route, $anchorScroll, element) {
var template;
var changeCounter = 0;
this.$on('$afterRouteChange', function() {
changeCounter++;
});
this.$watch(function() {return changeCounter;}, function(scope, newChangeCounter) {
var template = $route.current && $route.current.template;
function clearContent() {
// ignore callback if another route change occured since
if (newChangeCounter == changeCounter) {
element.html('');
}
}
if (template) {
$http.get(template, {cache: $templateCache}).success(function(response) {
// ignore callback if another route change occured since
if (newChangeCounter == changeCounter) {
element.html(response);
compiler.compile(element)($route.current.scope);
$anchorScroll();
}
}).error(clearContent);
} else {
clearContent();
}
});
}];
} else {
compiler.descend(true);
compiler.directives(true);
}
});
/**
* @ngdoc widget
* @name angular.widget.ng:pluralize
*
* @description
* # Overview
* ng:pluralize is a widget that displays messages according to en-US localization rules.
* These rules are bundled with angular.js and the rules can be overridden
* (see {@link guide/dev_guide.i18n Angular i18n} dev guide). You configure ng:pluralize by
* specifying the mappings between
* {@link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
* plural categories} and the strings to be displayed.
*
* # Plural categories and explicit number rules
* There are two
* {@link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
* plural categories} in Angular's default en-US locale: "one" and "other".
*
* While a pural category may match many numbers (for example, in en-US locale, "other" can match
* any number that is not 1), an explicit number rule can only match one number. For example, the
* explicit number rule for "3" matches the number 3. You will see the use of plural categories
* and explicit number rules throughout later parts of this documentation.
*
* # Configuring ng:pluralize
* You configure ng:pluralize by providing 2 attributes: `count` and `when`.
* You can also provide an optional attribute, `offset`.
*
* The value of the `count` attribute can be either a string or an {@link guide/dev_guide.expressions
* Angular expression}; these are evaluated on the current scope for its binded value.
*
* The `when` attribute specifies the mappings between plural categories and the actual
* string to be displayed. The value of the attribute should be a JSON object so that Angular
* can interpret it correctly.
*
* The following example shows how to configure ng:pluralize:
*
* <pre>
* <ng:pluralize count="personCount"
when="{'0': 'Nobody is viewing.',
* 'one': '1 person is viewing.',
* 'other': '{} people are viewing.'}">
* </ng:pluralize>
*</pre>
*
* In the example, `"0: Nobody is viewing."` is an explicit number rule. If you did not
* specify this rule, 0 would be matched to the "other" category and "0 people are viewing"
* would be shown instead of "Nobody is viewing". You can specify an explicit number rule for
* other numbers, for example 12, so that instead of showing "12 people are viewing", you can
* show "a dozen people are viewing".
*
* You can use a set of closed braces(`{}`) as a placeholder for the number that you want substituted
* into pluralized strings. In the previous example, Angular will replace `{}` with
* <span ng:non-bindable>`{{personCount}}`</span>. The closed braces `{}` is a placeholder
* for <span ng:non-bindable>{{numberExpression}}</span>.
*
* # Configuring ng:pluralize with offset
* The `offset` attribute allows further customization of pluralized text, which can result in
* a better user experience. For example, instead of the message "4 people are viewing this document",
* you might display "John, Kate and 2 others are viewing this document".
* The offset attribute allows you to offset a number by any desired value.
* Let's take a look at an example:
*
* <pre>
* <ng:pluralize count="personCount" offset=2
* when="{'0': 'Nobody is viewing.',
* '1': '{{person1}} is viewing.',
* '2': '{{person1}} and {{person2}} are viewing.',
* 'one': '{{person1}}, {{person2}} and one other person are viewing.',
* 'other': '{{person1}}, {{person2}} and {} other people are viewing.'}">
* </ng:pluralize>
* </pre>
*
* Notice that we are still using two plural categories(one, other), but we added
* three explicit number rules 0, 1 and 2.
* When one person, perhaps John, views the document, "John is viewing" will be shown.
* When three people view the document, no explicit number rule is found, so
* an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category.
* In this case, plural category 'one' is matched and "John, Marry and one other person are viewing"
* is shown.
*
* Note that when you specify offsets, you must provide explicit number rules for
* numbers from 0 up to and including the offset. If you use an offset of 3, for example,
* you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for
* plural categories "one" and "other".
*
* @param {string|expression} count The variable to be bounded to.
* @param {string} when The mapping between plural category to its correspoding strings.
* @param {number=} offset Offset to deduct from the total number.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.person1 = 'Igor';
this.person2 = 'Misko';
this.personCount = 1;
}
</script>
<div ng:controller="Ctrl">
Person 1:<input type="text" ng:model="person1" value="Igor" /><br/>
Person 2:<input type="text" ng:model="person2" value="Misko" /><br/>
Number of People:<input type="text" ng:model="personCount" value="1" /><br/>
<!--- Example with simple pluralization rules for en locale --->
Without Offset:
<ng:pluralize count="personCount"
when="{'0': 'Nobody is viewing.',
'one': '1 person is viewing.',
'other': '{} people are viewing.'}">
</ng:pluralize><br>
<!--- Example with offset --->
With Offset(2):
<ng:pluralize count="personCount" offset=2
when="{'0': 'Nobody is viewing.',
'1': '{{person1}} is viewing.',
'2': '{{person1}} and {{person2}} are viewing.',
'one': '{{person1}}, {{person2}} and one other person are viewing.',
'other': '{{person1}}, {{person2}} and {} other people are viewing.'}">
</ng:pluralize>
</div>
</doc:source>
<doc:scenario>
it('should show correct pluralized string', function() {
expect(element('.doc-example-live .ng-pluralize:first').text()).
toBe('1 person is viewing.');
expect(element('.doc-example-live .ng-pluralize:last').text()).
toBe('Igor is viewing.');
using('.doc-example-live').input('personCount').enter('0');
expect(element('.doc-example-live .ng-pluralize:first').text()).
toBe('Nobody is viewing.');
expect(element('.doc-example-live .ng-pluralize:last').text()).
toBe('Nobody is viewing.');
using('.doc-example-live').input('personCount').enter('2');
expect(element('.doc-example-live .ng-pluralize:first').text()).
toBe('2 people are viewing.');
expect(element('.doc-example-live .ng-pluralize:last').text()).
toBe('Igor and Misko are viewing.');
using('.doc-example-live').input('personCount').enter('3');
expect(element('.doc-example-live .ng-pluralize:first').text()).
toBe('3 people are viewing.');
expect(element('.doc-example-live .ng-pluralize:last').text()).
toBe('Igor, Misko and one other person are viewing.');
using('.doc-example-live').input('personCount').enter('4');
expect(element('.doc-example-live .ng-pluralize:first').text()).
toBe('4 people are viewing.');
expect(element('.doc-example-live .ng-pluralize:last').text()).
toBe('Igor, Misko and 2 other people are viewing.');
});
it('should show data-binded names', function() {
using('.doc-example-live').input('personCount').enter('4');
expect(element('.doc-example-live .ng-pluralize:last').text()).
toBe('Igor, Misko and 2 other people are viewing.');
using('.doc-example-live').input('person1').enter('Di');
using('.doc-example-live').input('person2').enter('Vojta');
expect(element('.doc-example-live .ng-pluralize:last').text()).
toBe('Di, Vojta and 2 other people are viewing.');
});
</doc:scenario>
</doc:example>
*/
angularWidget('ng:pluralize', function(element) {
var numberExp = element.attr('count'),
whenExp = element.attr('when'),
offset = element.attr('offset') || 0;
return ['$locale', '$element', function($locale, element) {
var scope = this,
whens = scope.$eval(whenExp),
whensExpFns = {};
forEach(whens, function(expression, key) {
whensExpFns[key] = compileBindTemplate(expression.replace(/{}/g,
'{{' + numberExp + '-' + offset + '}}'));
});
scope.$watch(function() {
var value = parseFloat(scope.$eval(numberExp));
if (!isNaN(value)) {
//if explicit number rule such as 1, 2, 3... is defined, just use it. Otherwise,
//check it against pluralization rules in $locale service
if (!whens[value]) value = $locale.pluralCat(value - offset);
return whensExpFns[value](scope, element, true);
} else {
return '';
}
}, function(scope, newVal) {
element.text(newVal);
});
}];
});
'use strict';
/**
* @ngdoc widget
* @name angular.widget.form
*
* @description
* Angular widget that creates a form scope using the
* {@link angular.module.ng.$formFactory $formFactory} API. The resulting form scope instance is
* attached to the DOM element using the jQuery `.data()` method under the `$form` key.
* See {@link guide/dev_guide.forms forms} on detailed discussion of forms and widgets.
*
*
* # Alias: `ng:form`
*
* In angular forms can be nested. This means that the outer form is valid when all of the child
* forms are valid as well. However browsers do not allow nesting of `<form>` elements, for this
* reason angular provides `<ng:form>` alias which behaves identical to `<form>` but allows
* element nesting.
*
*
* # Submitting a form and preventing default action
*
* Since the role of forms in client-side Angular applications is different than in old-school
* roundtrip apps, it is desirable for the browser not to translate the form submission into a full
* page reload that sends the data to the server. Instead some javascript logic should be triggered
* to handle the form submission in application specific way.
*
* For this reason, Angular prevents the default action (form submission to the server) unless the
* `<form>` element has an `action` attribute specified.
*
* You can use one of the following two ways to specify what javascript method should be called when
* a form is submitted:
*
* - ng:submit on the form element (add link to ng:submit)
* - ng:click on the first button or input field of type submit (input[type=submit])
*
* To prevent double execution of the handler, use only one of ng:submit or ng:click. This is
* because of the following form submission rules coming from the html spec:
*
* - If a form has only one input field then hitting enter in this field triggers form submit
* (`ng:submit`)
* - if a form has has 2+ input fields and no buttons or input[type=submit] then hitting enter
* doesn't trigger submit
* - if a form has one or more input fields and one or more buttons or input[type=submit] then
* hitting enter in any of the input fields will trigger the click handler on the *first* button or
* input[type=submit] (`ng:click`) *and* a submit handler on the enclosing form (`ng:submit`)
*
* @param {string=} name Name of the form.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.text = 'guest';
}
</script>
<div ng:controller="Ctrl">
<form name="myForm">
text: <input type="text" name="input" ng:model="text" required>
<span class="error" ng:show="myForm.text.$error.REQUIRED">Required!</span>
</form>
<tt>text = {{text}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br/>
</div>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('text')).toEqual('guest');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('text').enter('');
expect(binding('text')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
angularWidget('form', function(form){
this.descend(true);
this.directives(true);
return ['$formFactory', '$element', function($formFactory, formElement) {
var name = formElement.attr('name'),
parentForm = $formFactory.forElement(formElement),
form = $formFactory(parentForm);
formElement.data('$form', form);
formElement.bind('submit', function(event) {
if (!formElement.attr('action')) event.preventDefault();
});
if (name) {
this[name] = form;
}
watch('valid');
watch('invalid');
function watch(name) {
form.$watch('$' + name, function(scope, value) {
formElement[value ? 'addClass' : 'removeClass']('ng-' + name);
});
}
}];
});
angularWidget('ng:form', angularWidget('form'));
'use strict';
var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;
var EMAIL_REGEXP = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/;
var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/;
var INTEGER_REGEXP = /^\s*(\-|\+)?\d+\s*$/;
/**
* @ngdoc inputType
* @name angular.inputType.text
*
* @description
* Standard HTML text input with angular data binding.
*
* @param {string} ng:model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the widgets is published.
* @param {string=} required Sets `REQUIRED` validation error key if the value is not entered.
* @param {number=} ng:minlength Sets `MINLENGTH` validation error key if the value is shorter than
* minlength.
* @param {number=} ng:maxlength Sets `MAXLENGTH` validation error key if the value is longer than
* maxlength.
* @param {string=} ng:pattern Sets `PATTERN` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ng:change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.text = 'guest';
this.word = /^\w*$/;
}
</script>
<div ng:controller="Ctrl">
<form name="myForm">
Single word: <input type="text" name="input" ng:model="text"
ng:pattern="word" required>
<span class="error" ng:show="myForm.input.$error.REQUIRED">
Required!</span>
<span class="error" ng:show="myForm.input.$error.PATTERN">
Single word only!</span>
</form>
<tt>text = {{text}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br/>
</div>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('text')).toEqual('guest');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('text').enter('');
expect(binding('text')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if multi word', function() {
input('text').enter('hello world');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
/**
* @ngdoc inputType
* @name angular.inputType.email
*
* @description
* Text input with email validation. Sets the `EMAIL` validation error key if not a valid email
* address.
*
* @param {string} ng:model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the widgets is published.
* @param {string=} required Sets `REQUIRED` validation error key if the value is not entered.
* @param {number=} ng:minlength Sets `MINLENGTH` validation error key if the value is shorter than
* minlength.
* @param {number=} ng:maxlength Sets `MAXLENGTH` validation error key if the value is longer than
* maxlength.
* @param {string=} ng:pattern Sets `PATTERN` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.text = '[email protected]';
}
</script>
<div ng:controller="Ctrl">
<form name="myForm">
Email: <input type="email" name="input" ng:model="text" required>
<span class="error" ng:show="myForm.input.$error.REQUIRED">
Required!</span>
<span class="error" ng:show="myForm.input.$error.EMAIL">
Not valid email!</span>
</form>
<tt>text = {{text}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br/>
<tt>myForm.$error.EMAIL = {{!!myForm.$error.EMAIL}}</tt><br/>
</div>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('text')).toEqual('[email protected]');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('text').enter('');
expect(binding('text')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if not email', function() {
input('text').enter('xxx');
expect(binding('text')).toEqual('xxx');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
angularInputType('email', function() {
var widget = this;
this.$on('$validate', function(event){
var value = widget.$viewValue;
widget.$emit(!value || value.match(EMAIL_REGEXP) ? "$valid" : "$invalid", "EMAIL");
});
});
/**
* @ngdoc inputType
* @name angular.inputType.url
*
* @description
* Text input with URL validation. Sets the `URL` validation error key if the content is not a
* valid URL.
*
* @param {string} ng:model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the widgets is published.
* @param {string=} required Sets `REQUIRED` validation error key if the value is not entered.
* @param {number=} ng:minlength Sets `MINLENGTH` validation error key if the value is shorter than
* minlength.
* @param {number=} ng:maxlength Sets `MAXLENGTH` validation error key if the value is longer than
* maxlength.
* @param {string=} ng:pattern Sets `PATTERN` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ng:change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.text = 'http://google.com';
}
</script>
<div ng:controller="Ctrl">
<form name="myForm">
URL: <input type="url" name="input" ng:model="text" required>
<span class="error" ng:show="myForm.input.$error.REQUIRED">
Required!</span>
<span class="error" ng:show="myForm.input.$error.url">
Not valid url!</span>
</form>
<tt>text = {{text}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br/>
<tt>myForm.$error.url = {{!!myForm.$error.url}}</tt><br/>
</div>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('text')).toEqual('http://google.com');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('text').enter('');
expect(binding('text')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if not url', function() {
input('text').enter('xxx');
expect(binding('text')).toEqual('xxx');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
angularInputType('url', function() {
var widget = this;
this.$on('$validate', function(event){
var value = widget.$viewValue;
widget.$emit(!value || value.match(URL_REGEXP) ? "$valid" : "$invalid", "URL");
});
});
/**
* @ngdoc inputType
* @name angular.inputType.list
*
* @description
* Text input that converts between comma-seperated string into an array of strings.
*
* @param {string} ng:model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the widgets is published.
* @param {string=} required Sets `REQUIRED` validation error key if the value is not entered.
* @param {string=} ng:pattern Sets `PATTERN` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ng:change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.names = ['igor', 'misko', 'vojta'];
}
</script>
<div ng:controller="Ctrl">
<form name="myForm">
List: <input type="list" name="input" ng:model="names" required>
<span class="error" ng:show="myForm.list.$error.REQUIRED">
Required!</span>
</form>
<tt>names = {{names}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br/>
</div>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('names')).toEqual('["igor","misko","vojta"]');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('names').enter('');
expect(binding('names')).toEqual('[]');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
angularInputType('list', function() {
function parse(viewValue) {
var list = [];
forEach(viewValue.split(/\s*,\s*/), function(value){
if (value) list.push(trim(value));
});
return list;
}
this.$parseView = function() {
isString(this.$viewValue) && (this.$modelValue = parse(this.$viewValue));
};
this.$parseModel = function() {
var modelValue = this.$modelValue;
if (isArray(modelValue)
&& (!isString(this.$viewValue) || !equals(parse(this.$viewValue), modelValue))) {
this.$viewValue = modelValue.join(', ');
}
};
});
/**
* @ngdoc inputType
* @name angular.inputType.number
*
* @description
* Text input with number validation and transformation. Sets the `NUMBER` validation
* error if not a valid number.
*
* @param {string} ng:model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the widgets is published.
* @param {string=} min Sets the `MIN` validation error key if the value entered is less then `min`.
* @param {string=} max Sets the `MAX` validation error key if the value entered is greater then `min`.
* @param {string=} required Sets `REQUIRED` validation error key if the value is not entered.
* @param {number=} ng:minlength Sets `MINLENGTH` validation error key if the value is shorter than
* minlength.
* @param {number=} ng:maxlength Sets `MAXLENGTH` validation error key if the value is longer than
* maxlength.
* @param {string=} ng:pattern Sets `PATTERN` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ng:change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.value = 12;
}
</script>
<div ng:controller="Ctrl">
<form name="myForm">
Number: <input type="number" name="input" ng:model="value"
min="0" max="99" required>
<span class="error" ng:show="myForm.list.$error.REQUIRED">
Required!</span>
<span class="error" ng:show="myForm.list.$error.NUMBER">
Not valid number!</span>
</form>
<tt>value = {{value}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br/>
</div>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('value')).toEqual('12');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('value').enter('');
expect(binding('value')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if over max', function() {
input('value').enter('123');
expect(binding('value')).toEqual('123');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
angularInputType('number', numericRegexpInputType(NUMBER_REGEXP, 'NUMBER'));
/**
* @ngdoc inputType
* @name angular.inputType.integer
*
* @description
* Text input with integer validation and transformation. Sets the `INTEGER`
* validation error key if not a valid integer.
*
* @param {string} ng:model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the widgets is published.
* @param {string=} min Sets the `MIN` validation error key if the value entered is less then `min`.
* @param {string=} max Sets the `MAX` validation error key if the value entered is greater then `min`.
* @param {string=} required Sets `REQUIRED` validation error key if the value is not entered.
* @param {number=} ng:minlength Sets `MINLENGTH` validation error key if the value is shorter than
* minlength.
* @param {number=} ng:maxlength Sets `MAXLENGTH` validation error key if the value is longer than
* maxlength.
* @param {string=} ng:pattern Sets `PATTERN` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ng:change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.value = 12;
}
</script>
<div ng:controller="Ctrl">
<form name="myForm">
Integer: <input type="integer" name="input" ng:model="value"
min="0" max="99" required>
<span class="error" ng:show="myForm.list.$error.REQUIRED">
Required!</span>
<span class="error" ng:show="myForm.list.$error.INTEGER">
Not valid integer!</span>
</form>
<tt>value = {{value}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br/>
</div>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('value')).toEqual('12');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('value').enter('1.2');
expect(binding('value')).toEqual('12');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if over max', function() {
input('value').enter('123');
expect(binding('value')).toEqual('123');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
angularInputType('integer', numericRegexpInputType(INTEGER_REGEXP, 'INTEGER'));
/**
* @ngdoc inputType
* @name angular.inputType.checkbox
*
* @description
* HTML checkbox.
*
* @param {string} ng:model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the widgets is published.
* @param {string=} ng:true-value The value to which the expression should be set when selected.
* @param {string=} ng:false-value The value to which the expression should be set when not selected.
* @param {string=} ng:change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.value1 = true;
this.value2 = 'YES'
}
</script>
<div ng:controller="Ctrl">
<form name="myForm">
Value1: <input type="checkbox" ng:model="value1"> <br/>
Value2: <input type="checkbox" ng:model="value2"
ng:true-value="YES" ng:false-value="NO"> <br/>
</form>
<tt>value1 = {{value1}}</tt><br/>
<tt>value2 = {{value2}}</tt><br/>
</div>
</doc:source>
<doc:scenario>
it('should change state', function() {
expect(binding('value1')).toEqual('true');
expect(binding('value2')).toEqual('YES');
input('value1').check();
input('value2').check();
expect(binding('value1')).toEqual('false');
expect(binding('value2')).toEqual('NO');
});
</doc:scenario>
</doc:example>
*/
angularInputType('checkbox', function(inputElement) {
var widget = this,
trueValue = inputElement.attr('ng:true-value'),
falseValue = inputElement.attr('ng:false-value');
if (!isString(trueValue)) trueValue = true;
if (!isString(falseValue)) falseValue = false;
inputElement.bind('click', function() {
widget.$apply(function() {
widget.$emit('$viewChange', inputElement[0].checked);
});
});
widget.$render = function() {
inputElement[0].checked = widget.$viewValue;
};
widget.$parseModel = function() {
widget.$viewValue = this.$modelValue === trueValue;
};
widget.$parseView = function() {
widget.$modelValue = widget.$viewValue ? trueValue : falseValue;
};
});
/**
* @ngdoc inputType
* @name angular.inputType.radio
*
* @description
* HTML radio button.
*
* @param {string} ng:model Assignable angular expression to data-bind to.
* @param {string} value The value to which the expression should be set when selected.
* @param {string=} name Property name of the form under which the widgets is published.
* @param {string=} ng:change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.color = 'blue';
}
</script>
<div ng:controller="Ctrl">
<form name="myForm">
<input type="radio" ng:model="color" value="red"> Red <br/>
<input type="radio" ng:model="color" value="green"> Green <br/>
<input type="radio" ng:model="color" value="blue"> Blue <br/>
</form>
<tt>color = {{color}}</tt><br/>
</div>
</doc:source>
<doc:scenario>
it('should change state', function() {
expect(binding('color')).toEqual('blue');
input('color').select('red');
expect(binding('color')).toEqual('red');
});
</doc:scenario>
</doc:example>
*/
angularInputType('radio', function(inputElement) {
var widget = this;
//correct the name
inputElement.attr('name', widget.$id + '@' + inputElement.attr('name'));
inputElement.bind('click', function() {
widget.$apply(function() {
if (inputElement[0].checked) {
widget.$emit('$viewChange', widget.$value);
}
});
});
widget.$render = function() {
inputElement[0].checked = isDefined(widget.$value) && (widget.$value == widget.$viewValue);
};
if (inputElement[0].checked) {
widget.$viewValue = widget.$value;
}
});
function numericRegexpInputType(regexp, error) {
return ['$element', function(inputElement) {
var widget = this,
min = 1 * (inputElement.attr('min') || Number.MIN_VALUE),
max = 1 * (inputElement.attr('max') || Number.MAX_VALUE);
widget.$on('$validate', function(event){
var value = widget.$viewValue,
filled = value && trim(value) != '',
valid = isString(value) && value.match(regexp);
widget.$emit(!filled || valid ? "$valid" : "$invalid", error);
filled && (value = 1 * value);
widget.$emit(valid && value < min ? "$invalid" : "$valid", "MIN");
widget.$emit(valid && value > max ? "$invalid" : "$valid", "MAX");
});
widget.$parseView = function() {
if (widget.$viewValue.match(regexp)) {
widget.$modelValue = 1 * widget.$viewValue;
} else if (widget.$viewValue == '') {
widget.$modelValue = null;
}
};
widget.$parseModel = function() {
widget.$viewValue = isNumber(widget.$modelValue)
? '' + widget.$modelValue
: '';
};
}];
}
var HTML5_INPUTS_TYPES = makeMap(
"search,tel,url,email,datetime,date,month,week,time,datetime-local,number,range,color," +
"radio,checkbox,text,button,submit,reset,hidden,password");
/**
* @ngdoc widget
* @name angular.widget.input
*
* @description
* HTML input element widget with angular data-binding. Input widget follows HTML5 input types
* and polyfills the HTML5 validation behavior for older browsers.
*
* The {@link angular.inputType custom angular.inputType}s provide a shorthand for declaring new
* inputs. This is a sharthand for text-box based inputs, and there is no need to go through the
* full {@link angular.module.ng.$formFactory $formFactory} widget lifecycle.
*
*
* @param {string} type Widget types as defined by {@link angular.inputType}. If the
* type is in the format of `@ScopeType` then `ScopeType` is loaded from the
* current scope, allowing quick definition of type.
* @param {string} ng:model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the widgets is published.
* @param {string=} required Sets `REQUIRED` validation error key if the value is not entered.
* @param {number=} ng:minlength Sets `MINLENGTH` validation error key if the value is shorter than
* minlength.
* @param {number=} ng:maxlength Sets `MAXLENGTH` validation error key if the value is longer than
* maxlength.
* @param {string=} ng:pattern Sets `PATTERN` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ng:change Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl() {
this.user = {name: 'guest', last: 'visitor'};
}
</script>
<div ng:controller="Ctrl">
<form name="myForm">
User name: <input type="text" name="userName" ng:model="user.name" required>
<span class="error" ng:show="myForm.userName.$error.REQUIRED">
Required!</span><br>
Last name: <input type="text" name="lastName" ng:model="user.last"
ng:minlength="3" ng:maxlength="10">
<span class="error" ng:show="myForm.lastName.$error.MINLENGTH">
Too short!</span>
<span class="error" ng:show="myForm.lastName.$error.MAXLENGTH">
Too long!</span><br>
</form>
<hr>
<tt>user = {{user}}</tt><br/>
<tt>myForm.userName.$valid = {{myForm.userName.$valid}}</tt><br>
<tt>myForm.userName.$error = {{myForm.userName.$error}}</tt><br>
<tt>myForm.lastName.$valid = {{myForm.lastName.$valid}}</tt><br>
<tt>myForm.userName.$error = {{myForm.lastName.$error}}</tt><br>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br>
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br>
<tt>myForm.$error.MINLENGTH = {{!!myForm.$error.MINLENGTH}}</tt><br>
<tt>myForm.$error.MAXLENGTH = {{!!myForm.$error.MAXLENGTH}}</tt><br>
</div>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('user')).toEqual('{\n \"last\":\"visitor",\n \"name\":\"guest\"}');
expect(binding('myForm.userName.$valid')).toEqual('true');
expect(binding('myForm.$valid')).toEqual('true');
});
it('should be invalid if empty when required', function() {
input('user.name').enter('');
expect(binding('user')).toEqual('{\n \"last\":\"visitor",\n \"name\":\"\"}');
expect(binding('myForm.userName.$valid')).toEqual('false');
expect(binding('myForm.$valid')).toEqual('false');
});
it('should be valid if empty when min length is set', function() {
input('user.last').enter('');
expect(binding('user')).toEqual('{\n \"last\":\"",\n \"name\":\"guest\"}');
expect(binding('myForm.lastName.$valid')).toEqual('true');
expect(binding('myForm.$valid')).toEqual('true');
});
it('should be invalid if less than required min length', function() {
input('user.last').enter('xx');
expect(binding('user')).toEqual('{\n \"last\":\"xx",\n \"name\":\"guest\"}');
expect(binding('myForm.lastName.$valid')).toEqual('false');
expect(binding('myForm.lastName.$error')).toMatch(/MINLENGTH/);
expect(binding('myForm.$valid')).toEqual('false');
});
it('should be valid if longer than max length', function() {
input('user.last').enter('some ridiculously long name');
expect(binding('user'))
.toEqual('{\n \"last\":\"some ridiculously long name",\n \"name\":\"guest\"}');
expect(binding('myForm.lastName.$valid')).toEqual('false');
expect(binding('myForm.lastName.$error')).toMatch(/MAXLENGTH/);
expect(binding('myForm.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
angularWidget('input', function(inputElement){
this.directives(true);
this.descend(true);
var modelExp = inputElement.attr('ng:model');
return modelExp &&
['$defer', '$formFactory', '$element', function($defer, $formFactory, inputElement){
var form = $formFactory.forElement(inputElement),
// We have to use .getAttribute, since jQuery tries to be smart and use the
// type property. Trouble is some browser change unknown to text.
type = inputElement[0].getAttribute('type') || 'text',
TypeController,
modelScope = this,
patternMatch, widget,
pattern = trim(inputElement.attr('ng:pattern')),
minlength = parseInt(inputElement.attr('ng:minlength'), 10),
maxlength = parseInt(inputElement.attr('ng:maxlength'), 10),
loadFromScope = type.match(/^\s*\@\s*(.*)/);
if (!pattern) {
patternMatch = valueFn(true);
} else {
if (pattern.match(/^\/(.*)\/$/)) {
pattern = new RegExp(pattern.substr(1, pattern.length - 2));
patternMatch = function(value) {
return pattern.test(value);
};
} else {
patternMatch = function(value) {
var patternObj = modelScope.$eval(pattern);
if (!patternObj || !patternObj.test) {
throw new Error('Expected ' + pattern + ' to be a RegExp but was ' + patternObj);
}
return patternObj.test(value);
};
}
}
type = lowercase(type);
TypeController = (loadFromScope
? (assertArgFn(this.$eval(loadFromScope[1]), loadFromScope[1])).$unboundFn
: angularInputType(type)) || noop;
if (!HTML5_INPUTS_TYPES[type]) {
try {
// jquery will not let you so we have to go to bare metal
inputElement[0].setAttribute('type', 'text');
} catch(e){
// also turns out that ie8 will not allow changing of types, but since it is not
// html5 anyway we can ignore the error.
}
}
//TODO(misko): setting $inject is a hack
!TypeController.$inject && (TypeController.$inject = ['$element']);
widget = form.$createWidget({
scope: modelScope,
model: modelExp,
onChange: inputElement.attr('ng:change'),
alias: inputElement.attr('name'),
controller: TypeController,
controllerArgs: {$element: inputElement}
});
watchElementProperty(this, widget, 'value', inputElement);
watchElementProperty(this, widget, 'required', inputElement);
watchElementProperty(this, widget, 'readonly', inputElement);
watchElementProperty(this, widget, 'disabled', inputElement);
widget.$pristine = !(widget.$dirty = false);
widget.$on('$validate', function() {
var $viewValue = trim(widget.$viewValue),
inValid = widget.$required && !$viewValue,
tooLong = maxlength && $viewValue && $viewValue.length > maxlength,
tooShort = minlength && $viewValue && $viewValue.length < minlength,
missMatch = $viewValue && !patternMatch($viewValue);
if (widget.$error.REQUIRED != inValid){
widget.$emit(inValid ? '$invalid' : '$valid', 'REQUIRED');
}
if (widget.$error.PATTERN != missMatch){
widget.$emit(missMatch ? '$invalid' : '$valid', 'PATTERN');
}
if (widget.$error.MINLENGTH != tooShort){
widget.$emit(tooShort ? '$invalid' : '$valid', 'MINLENGTH');
}
if (widget.$error.MAXLENGTH != tooLong){
widget.$emit(tooLong ? '$invalid' : '$valid', 'MAXLENGTH');
}
});
forEach(['valid', 'invalid', 'pristine', 'dirty'], function(name) {
widget.$watch('$' + name, function(scope, value) {
inputElement[value ? 'addClass' : 'removeClass']('ng-' + name);
});
});
inputElement.bind('$destroy', function() {
widget.$destroy();
});
if (type != 'checkbox' && type != 'radio') {
// TODO (misko): checkbox / radio does not really belong here, but until we can do
// widget registration with CSS, we are hacking it this way.
widget.$render = function() {
inputElement.val(widget.$viewValue || '');
};
inputElement.bind('keydown change input', function(event) {
var key = event.keyCode;
if (/*command*/ key != 91 &&
/*modifiers*/ !(15 < key && key < 19) &&
/*arrow*/ !(37 < key && key < 40)) {
$defer(function() {
widget.$dirty = !(widget.$pristine = false);
var value = trim(inputElement.val());
if (widget.$viewValue !== value ) {
widget.$emit('$viewChange', value);
}
});
}
});
}
}];
});
/**
* @ngdoc widget
* @name angular.widget.textarea
*
* @description
* HTML textarea element widget with angular data-binding. The data-binding and validation
* properties of this element are exactly the same as those of the
* {@link angular.widget.input input element}.
*
* @param {string} type Widget types as defined by {@link angular.inputType}. If the
* type is in the format of `@ScopeType` then `ScopeType` is loaded from the
* current scope, allowing quick definition of type.
* @param {string} ng:model Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the widgets is published.
* @param {string=} required Sets `REQUIRED` validation error key if the value is not entered.
* @param {number=} ng:minlength Sets `MINLENGTH` validation error key if the value is shorter than
* minlength.
* @param {number=} ng:maxlength Sets `MAXLENGTH` validation error key if the value is longer than
* maxlength.
* @param {string=} ng:pattern Sets `PATTERN` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ng:change Angular expression to be executed when input changes due to user
* interaction with the input element.
*/
angularWidget('textarea', angularWidget('input'));
function watchElementProperty(modelScope, widget, name, element) {
var bindAttr = fromJson(element.attr('ng:bind-attr') || '{}'),
match = /\s*{{(.*)}}\s*/.exec(bindAttr[name]),
isBoolean = BOOLEAN_ATTR[name];
widget['$' + name] = isBoolean
? ( // some browsers return true some '' when required is set without value.
isString(element.prop(name)) || !!element.prop(name) ||
// this is needed for ie9, since it will treat boolean attributes as false
!!element[0].attributes[name])
: element.attr(name);
if (bindAttr[name] && match) {
modelScope.$watch(match[1], function(scope, value){
widget['$' + name] = isBoolean ? !!value : value;
widget.$emit('$validate');
widget.$render && widget.$render();
});
}
}
'use strict';
/**
* @ngdoc widget
* @name angular.widget.select
*
* @description
* HTML `SELECT` element with angular data-binding.
*
* # `ng:options`
*
* Optionally `ng:options` attribute can be used to dynamically generate a list of `<option>`
* elements for a `<select>` element using an array or an object obtained by evaluating the
* `ng:options` expression.
*
* When an item in the select menu is select, the value of array element or object property
* represented by the selected option will be bound to the model identified by the `ng:model` attribute
* of the parent select element.
*
* Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can
* be nested into the `<select>` element. This element will then represent `null` or "not selected"
* option. See example below for demonstration.
*
* Note: `ng:options` provides iterator facility for `<option>` element which must be used instead
* of {@link angular.widget.@ng:repeat ng:repeat}. `ng:repeat` is not suitable for use with
* `<option>` element because of the following reasons:
*
* * value attribute of the option element that we need to bind to requires a string, but the
* source of data for the iteration might be in a form of array containing objects instead of
* strings
* * {@link angular.widget.@ng:repeat ng:repeat} unrolls after the select binds causing
* incorect rendering on most browsers.
* * binding to a value not in list confuses most browsers.
*
* @param {string} name assignable expression to data-bind to.
* @param {string=} required The widget is considered valid only if value is entered.
* @param {comprehension_expression=} ng:options in one of the following forms:
*
* * for array data sources:
* * `label` **`for`** `value` **`in`** `array`
* * `select` **`as`** `label` **`for`** `value` **`in`** `array`
* * `label` **`group by`** `group` **`for`** `value` **`in`** `array`
* * `select` **`as`** `label` **`group by`** `group` **`for`** `value` **`in`** `array`
* * for object data sources:
* * `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
* * `select` **`as`** `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
* * `label` **`group by`** `group` **`for (`**`key`**`,`** `value`**`) in`** `object`
* * `select` **`as`** `label` **`group by`** `group`
* **`for` `(`**`key`**`,`** `value`**`) in`** `object`
*
* Where:
*
* * `array` / `object`: an expression which evaluates to an array / object to iterate over.
* * `value`: local variable which will refer to each item in the `array` or each property value
* of `object` during iteration.
* * `key`: local variable which will refer to a property name in `object` during iteration.
* * `label`: The result of this expression will be the label for `<option>` element. The
* `expression` will most likely refer to the `value` variable (e.g. `value.propertyName`).
* * `select`: The result of this expression will be bound to the model of the parent `<select>`
* element. If not specified, `select` expression will default to `value`.
* * `group`: The result of this expression will be used to group options using the `<optgroup>`
* DOM element.
*
* @example
<doc:example>
<doc:source>
<script>
function MyCntrl() {
this.colors = [
{name:'black', shade:'dark'},
{name:'white', shade:'light'},
{name:'red', shade:'dark'},
{name:'blue', shade:'dark'},
{name:'yellow', shade:'light'}
];
this.color = this.colors[2]; // red
}
</script>
<div ng:controller="MyCntrl">
<ul>
<li ng:repeat="color in colors">
Name: <input ng:model="color.name">
[<a href ng:click="colors.$remove(color)">X</a>]
</li>
<li>
[<a href ng:click="colors.push({})">add</a>]
</li>
</ul>
<hr/>
Color (null not allowed):
<select ng:model="color" ng:options="c.name for c in colors"></select><br>
Color (null allowed):
<div class="nullable">
<select ng:model="color" ng:options="c.name for c in colors">
<option value="">-- chose color --</option>
</select>
</div><br/>
Color grouped by shade:
<select ng:model="color" ng:options="c.name group by c.shade for c in colors">
</select><br/>
Select <a href ng:click="color={name:'not in list'}">bogus</a>.<br>
<hr/>
Currently selected: {{ {selected_color:color} }}
<div style="border:solid 1px black; height:20px"
ng:style="{'background-color':color.name}">
</div>
</div>
</doc:source>
<doc:scenario>
it('should check ng:options', function() {
expect(binding('color')).toMatch('red');
select('color').option('0');
expect(binding('color')).toMatch('black');
using('.nullable').select('color').option('');
expect(binding('color')).toMatch('null');
});
</doc:scenario>
</doc:example>
*/
//00001111100000000000222200000000000000000000003333000000000000044444444444444444000000000555555555555555550000000666666666666666660000000000000007777
var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/;
angularWidget('select', function(element){
this.directives(true);
this.descend(true);
return element.attr('ng:model') &&
['$formFactory', '$compile', '$parse', '$element',
function($formFactory, $compile, $parse, selectElement){
var modelScope = this,
match,
form = $formFactory.forElement(selectElement),
multiple = selectElement.attr('multiple'),
optionsExp = selectElement.attr('ng:options'),
modelExp = selectElement.attr('ng:model'),
widget = form.$createWidget({
scope: this,
model: modelExp,
onChange: selectElement.attr('ng:change'),
alias: selectElement.attr('name'),
controller: optionsExp ? Options : (multiple ? Multiple : Single)});
selectElement.bind('$destroy', function() { widget.$destroy(); });
widget.$pristine = !(widget.$dirty = false);
watchElementProperty(modelScope, widget, 'required', selectElement);
watchElementProperty(modelScope, widget, 'readonly', selectElement);
watchElementProperty(modelScope, widget, 'disabled', selectElement);
widget.$on('$validate', function() {
var valid = !widget.$required || !!widget.$modelValue;
if (valid && multiple && widget.$required) valid = !!widget.$modelValue.length;
if (valid !== !widget.$error.REQUIRED) {
widget.$emit(valid ? '$valid' : '$invalid', 'REQUIRED');
}
});
widget.$on('$viewChange', function() {
widget.$pristine = !(widget.$dirty = true);
});
forEach(['valid', 'invalid', 'pristine', 'dirty'], function(name) {
widget.$watch('$' + name, function(scope, value) {
selectElement[value ? 'addClass' : 'removeClass']('ng-' + name);
});
});
////////////////////////////
function Multiple() {
var widget = this;
this.$render = function() {
var items = new HashMap(this.$viewValue);
forEach(selectElement.children(), function(option){
option.selected = isDefined(items.get(option.value));
});
};
selectElement.bind('change', function() {
widget.$apply(function() {
var array = [];
forEach(selectElement.children(), function(option){
if (option.selected) {
array.push(option.value);
}
});
widget.$emit('$viewChange', array);
});
});
}
function Single() {
var widget = this;
widget.$render = function() {
selectElement.val(widget.$viewValue);
};
selectElement.bind('change', function() {
widget.$apply(function() {
widget.$emit('$viewChange', selectElement.val());
});
});
widget.$viewValue = selectElement.val();
}
function Options() {
var widget = this,
match;
if (! (match = optionsExp.match(NG_OPTIONS_REGEXP))) {
throw Error(
"Expected ng:options in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_'" +
" but got '" + optionsExp + "'.");
}
var widgetScope = this,
displayFn = $parse(match[2] || match[1]),
valueName = match[4] || match[6],
keyName = match[5],
groupByFn = $parse(match[3] || ''),
valueFn = $parse(match[2] ? match[1] : valueName),
valuesFn = $parse(match[7]),
// we can't just jqLite('<option>') since jqLite is not smart enough
// to create it in <select> and IE barfs otherwise.
optionTemplate = jqLite(document.createElement('option')),
optGroupTemplate = jqLite(document.createElement('optgroup')),
nullOption = false, // if false then user will not be able to select it
// This is an array of array of existing option groups in DOM. We try to reuse these if possible
// optionGroupsCache[0] is the options with no option group
// optionGroupsCache[?][0] is the parent: either the SELECT or OPTGROUP element
optionGroupsCache = [[{element: selectElement, label:''}]];
// find existing special options
forEach(selectElement.children(), function(option) {
if (option.value == '') {
// developer declared null option, so user should be able to select it
nullOption = jqLite(option).remove();
// compile the element since there might be bindings in it
$compile(nullOption)(modelScope);
}
});
selectElement.html(''); // clear contents
selectElement.bind('change', function() {
widgetScope.$apply(function() {
var optionGroup,
collection = valuesFn(modelScope) || [],
key = selectElement.val(),
tempScope = inherit(modelScope),
value, optionElement, index, groupIndex, length, groupLength;
if (multiple) {
value = [];
for (groupIndex = 0, groupLength = optionGroupsCache.length;
groupIndex < groupLength;
groupIndex++) {
// list of options for that group. (first item has the parent)
optionGroup = optionGroupsCache[groupIndex];
for(index = 1, length = optionGroup.length; index < length; index++) {
if ((optionElement = optionGroup[index].element)[0].selected) {
if (keyName) tempScope[keyName] = key;
tempScope[valueName] = collection[optionElement.val()];
value.push(valueFn(tempScope));
}
}
}
} else {
if (key == '?') {
value = undefined;
} else if (key == ''){
value = null;
} else {
tempScope[valueName] = collection[key];
if (keyName) tempScope[keyName] = key;
value = valueFn(tempScope);
}
}
if (isDefined(value) && modelScope.$viewVal !== value) {
widgetScope.$emit('$viewChange', value);
}
});
});
widgetScope.$watch(render);
widgetScope.$render = render;
function render() {
var optionGroups = {'':[]}, // Temporary location for the option groups before we render them
optionGroupNames = [''],
optionGroupName,
optionGroup,
option,
existingParent, existingOptions, existingOption,
modelValue = widget.$modelValue,
values = valuesFn(modelScope) || [],
keys = keyName ? sortedKeys(values) : values,
groupLength, length,
groupIndex, index,
optionScope = inherit(modelScope),
selected,
selectedSet = false, // nothing is selected yet
lastElement,
element;
if (multiple) {
selectedSet = new HashMap(modelValue);
} else if (modelValue === null || nullOption) {
// if we are not multiselect, and we are null then we have to add the nullOption
optionGroups[''].push({selected:modelValue === null, id:'', label:''});
selectedSet = true;
}
// We now build up the list of options we need (we merge later)
for (index = 0; length = keys.length, index < length; index++) {
optionScope[valueName] = values[keyName ? optionScope[keyName]=keys[index]:index];
optionGroupName = groupByFn(optionScope) || '';
if (!(optionGroup = optionGroups[optionGroupName])) {
optionGroup = optionGroups[optionGroupName] = [];
optionGroupNames.push(optionGroupName);
}
if (multiple) {
selected = selectedSet.remove(valueFn(optionScope)) != undefined;
} else {
selected = modelValue === valueFn(optionScope);
selectedSet = selectedSet || selected; // see if at least one item is selected
}
optionGroup.push({
id: keyName ? keys[index] : index, // either the index into array or key from object
label: displayFn(optionScope) || '', // what will be seen by the user
selected: selected // determine if we should be selected
});
}
if (!multiple && !selectedSet) {
// nothing was selected, we have to insert the undefined item
optionGroups[''].unshift({id:'?', label:'', selected:true});
}
// Now we need to update the list of DOM nodes to match the optionGroups we computed above
for (groupIndex = 0, groupLength = optionGroupNames.length;
groupIndex < groupLength;
groupIndex++) {
// current option group name or '' if no group
optionGroupName = optionGroupNames[groupIndex];
// list of options for that group. (first item has the parent)
optionGroup = optionGroups[optionGroupName];
if (optionGroupsCache.length <= groupIndex) {
// we need to grow the optionGroups
existingParent = {
element: optGroupTemplate.clone().attr('label', optionGroupName),
label: optionGroup.label
};
existingOptions = [existingParent];
optionGroupsCache.push(existingOptions);
selectElement.append(existingParent.element);
} else {
existingOptions = optionGroupsCache[groupIndex];
existingParent = existingOptions[0]; // either SELECT (no group) or OPTGROUP element
// update the OPTGROUP label if not the same.
if (existingParent.label != optionGroupName) {
existingParent.element.attr('label', existingParent.label = optionGroupName);
}
}
lastElement = null; // start at the begining
for(index = 0, length = optionGroup.length; index < length; index++) {
option = optionGroup[index];
if ((existingOption = existingOptions[index+1])) {
// reuse elements
lastElement = existingOption.element;
if (existingOption.label !== option.label) {
lastElement.text(existingOption.label = option.label);
}
if (existingOption.id !== option.id) {
lastElement.val(existingOption.id = option.id);
}
if (existingOption.element.selected !== option.selected) {
lastElement.prop('selected', (existingOption.selected = option.selected));
}
} else {
// grow elements
// if it's a null option
if (option.id === '' && nullOption) {
// put back the pre-compiled element
element = nullOption;
} else {
// jQuery(v1.4.2) Bug: We should be able to chain the method calls, but
// in this version of jQuery on some browser the .text() returns a string
// rather then the element.
(element = optionTemplate.clone())
.val(option.id)
.attr('selected', option.selected)
.text(option.label);
}
existingOptions.push(existingOption = {
element: element,
label: option.label,
id: option.id,
selected: option.selected
});
if (lastElement) {
lastElement.after(element);
} else {
existingParent.element.append(element);
}
lastElement = element;
}
}
// remove any excessive OPTIONs in a group
index++; // increment since the existingOptions[0] is parent element not OPTION
while(existingOptions.length > index) {
existingOptions.pop().element.remove();
}
}
// remove any excessive OPTGROUPs from select
while(optionGroupsCache.length > groupIndex) {
optionGroupsCache.pop()[0].element.remove();
}
};
}
}];
});
'use strict';
/**
* Setup file for the Scenario.
* Must be first in the compilation/bootstrap list.
*/
// Public namespace
angular.scenario = angular.scenario || {};
/**
* Defines a new output format.
*
* @param {string} name the name of the new output format
* @param {function()} fn function(context, runner) that generates the output
*/
angular.scenario.output = angular.scenario.output || function(name, fn) {
angular.scenario.output[name] = fn;
};
/**
* Defines a new DSL statement. If your factory function returns a Future
* it's returned, otherwise the result is assumed to be a map of functions
* for chaining. Chained functions are subject to the same rules.
*
* Note: All functions on the chain are bound to the chain scope so values
* set on "this" in your statement function are available in the chained
* functions.
*
* @param {string} name The name of the statement
* @param {function()} fn Factory function(), return a function for
* the statement.
*/
angular.scenario.dsl = angular.scenario.dsl || function(name, fn) {
angular.scenario.dsl[name] = function() {
function executeStatement(statement, args) {
var result = statement.apply(this, args);
if (angular.isFunction(result) || result instanceof angular.scenario.Future)
return result;
var self = this;
var chain = angular.extend({}, result);
angular.forEach(chain, function(value, name) {
if (angular.isFunction(value)) {
chain[name] = function() {
return executeStatement.call(self, value, arguments);
};
} else {
chain[name] = value;
}
});
return chain;
}
var statement = fn.apply(this, arguments);
return function() {
return executeStatement.call(this, statement, arguments);
};
};
};
/**
* Defines a new matcher for use with the expects() statement. The value
* this.actual (like in Jasmine) is available in your matcher to compare
* against. Your function should return a boolean. The future is automatically
* created for you.
*
* @param {string} name The name of the matcher
* @param {function()} fn The matching function(expected).
*/
angular.scenario.matcher = angular.scenario.matcher || function(name, fn) {
angular.scenario.matcher[name] = function(expected) {
var prefix = 'expect ' + this.future.name + ' ';
if (this.inverse) {
prefix += 'not ';
}
var self = this;
this.addFuture(prefix + name + ' ' + angular.toJson(expected),
function(done) {
var error;
self.actual = self.future.value;
if ((self.inverse && fn.call(self, expected)) ||
(!self.inverse && !fn.call(self, expected))) {
error = 'expected ' + angular.toJson(expected) +
' but was ' + angular.toJson(self.actual);
}
done(error);
});
};
};
/**
* Initialize the scenario runner and run !
*
* Access global window and document object
* Access $runner through closure
*
* @param {Object=} config Config options
*/
angular.scenario.setUpAndRun = function(config) {
var href = window.location.href;
var body = _jQuery(document.body);
var output = [];
var objModel = new angular.scenario.ObjectModel($runner);
if (config && config.scenario_output) {
output = config.scenario_output.split(',');
}
angular.forEach(angular.scenario.output, function(fn, name) {
if (!output.length || indexOf(output,name) != -1) {
var context = body.append('<div></div>').find('div:last');
context.attr('id', name);
fn.call({}, context, $runner, objModel);
}
});
if (!/^http/.test(href) && !/^https/.test(href)) {
body.append('<p id="system-error"></p>');
body.find('#system-error').text(
'Scenario runner must be run using http or https. The protocol ' +
href.split(':')[0] + ':// is not supported.'
);
return;
}
var appFrame = body.append('<div id="application"></div>').find('#application');
var application = new angular.scenario.Application(appFrame);
$runner.on('RunnerEnd', function() {
appFrame.css('display', 'none');
appFrame.find('iframe').attr('src', 'about:blank');
});
$runner.on('RunnerError', function(error) {
if (window.console) {
console.log(formatException(error));
} else {
// Do something for IE
alert(error);
}
});
$runner.run(application);
};
/**
* Iterates through list with iterator function that must call the
* continueFunction to continute iterating.
*
* @param {Array} list list to iterate over
* @param {function()} iterator Callback function(value, continueFunction)
* @param {function()} done Callback function(error, result) called when
* iteration finishes or an error occurs.
*/
function asyncForEach(list, iterator, done) {
var i = 0;
function loop(error, index) {
if (index && index > i) {
i = index;
}
if (error || i >= list.length) {
done(error);
} else {
try {
iterator(list[i++], loop);
} catch (e) {
done(e);
}
}
}
loop();
}
/**
* Formats an exception into a string with the stack trace, but limits
* to a specific line length.
*
* @param {Object} error The exception to format, can be anything throwable
* @param {Number} maxStackLines Optional. max lines of the stack trace to include
* default is 5.
*/
function formatException(error, maxStackLines) {
maxStackLines = maxStackLines || 5;
var message = error.toString();
if (error.stack) {
var stack = error.stack.split('\n');
if (stack[0].indexOf(message) === -1) {
maxStackLines++;
stack.unshift(error.message);
}
message = stack.slice(0, maxStackLines).join('\n');
}
return message;
}
/**
* Returns a function that gets the file name and line number from a
* location in the stack if available based on the call site.
*
* Note: this returns another function because accessing .stack is very
* expensive in Chrome.
*
* @param {Number} offset Number of stack lines to skip
*/
function callerFile(offset) {
var error = new Error();
return function() {
var line = (error.stack || '').split('\n')[offset];
// Clean up the stack trace line
if (line) {
if (line.indexOf('@') !== -1) {
// Firefox
line = line.substring(line.indexOf('@')+1);
} else {
// Chrome
line = line.substring(line.indexOf('(')+1).replace(')', '');
}
}
return line || '';
};
}
/**
* Triggers a browser event. Attempts to choose the right event if one is
* not specified.
*
* @param {Object} element Either a wrapped jQuery/jqLite node or a DOMElement
* @param {string} type Optional event type.
* @param {Array.<string>=} keys Optional list of pressed keys
* (valid values: 'alt', 'meta', 'shift', 'ctrl')
*/
function browserTrigger(element, type, keys) {
if (element && !element.nodeName) element = element[0];
if (!element) return;
if (!type) {
type = {
'text': 'change',
'textarea': 'change',
'hidden': 'change',
'password': 'change',
'button': 'click',
'submit': 'click',
'reset': 'click',
'image': 'click',
'checkbox': 'click',
'radio': 'click',
'select-one': 'change',
'select-multiple': 'change'
}[lowercase(element.type)] || 'click';
}
if (lowercase(nodeName_(element)) == 'option') {
element.parentNode.value = element.value;
element = element.parentNode;
type = 'change';
}
keys = keys || [];
function pressed(key) {
return indexOf(keys, key) !== -1;
}
if (msie < 9) {
switch(element.type) {
case 'radio':
case 'checkbox':
element.checked = !element.checked;
break;
}
// WTF!!! Error: Unspecified error.
// Don't know why, but some elements when detached seem to be in inconsistent state and
// calling .fireEvent() on them will result in very unhelpful error (Error: Unspecified error)
// forcing the browser to compute the element position (by reading its CSS)
// puts the element in consistent state.
element.style.posLeft;
// TODO(vojta): create event objects with pressed keys to get it working on IE<9
var ret = element.fireEvent('on' + type);
if (lowercase(element.type) == 'submit') {
while(element) {
if (lowercase(element.nodeName) == 'form') {
element.fireEvent('onsubmit');
break;
}
element = element.parentNode;
}
}
return ret;
} else {
var evnt = document.createEvent('MouseEvents'),
originalPreventDefault = evnt.preventDefault,
iframe = _jQuery('#application iframe')[0],
appWindow = iframe ? iframe.contentWindow : window,
fakeProcessDefault = true,
finalProcessDefault;
// igor: temporary fix for https://bugzilla.mozilla.org/show_bug.cgi?id=684208
appWindow.angular['ff-684208-preventDefault'] = false;
evnt.preventDefault = function() {
fakeProcessDefault = false;
return originalPreventDefault.apply(evnt, arguments);
};
evnt.initMouseEvent(type, true, true, window, 0, 0, 0, 0, 0, pressed('ctrl'), pressed('alt'),
pressed('shift'), pressed('meta'), 0, element);
element.dispatchEvent(evnt);
finalProcessDefault = !(appWindow.angular['ff-684208-preventDefault'] || !fakeProcessDefault)
delete appWindow.angular['ff-684208-preventDefault'];
return finalProcessDefault;
}
}
/**
* Don't use the jQuery trigger method since it works incorrectly.
*
* jQuery notifies listeners and then changes the state of a checkbox and
* does not create a real browser event. A real click changes the state of
* the checkbox and then notifies listeners.
*
* To work around this we instead use our own handler that fires a real event.
*/
(function(fn){
var parentTrigger = fn.trigger;
fn.trigger = function(type) {
if (/(click|change|keydown)/.test(type)) {
var processDefaults = [];
this.each(function(index, node) {
processDefaults.push(browserTrigger(node, type));
});
// this is not compatible with jQuery - we return an array of returned values,
// so that scenario runner know whether JS code has preventDefault() of the event or not...
return processDefaults;
}
return parentTrigger.apply(this, arguments);
};
})(_jQuery.fn);
/**
* Finds all bindings with the substring match of name and returns an
* array of their values.
*
* @param {string} name The name to match
* @return {Array.<string>} String of binding values
*/
_jQuery.fn.bindings = function(name) {
function contains(text, value) {
return value instanceof RegExp
? value.test(text)
: text && text.indexOf(value) >= 0;
}
var result = [];
this.find('.ng-binding:visible').each(function() {
var element = new _jQuery(this);
if (!angular.isDefined(name) ||
contains(element.attr('ng:bind'), name) ||
contains(element.attr('ng:bind-template'), name)) {
if (element.is('input, textarea')) {
result.push(element.val());
} else {
result.push(element.html());
}
}
});
return result;
};
'use strict';
/**
* Represents the application currently being tested and abstracts usage
* of iframes or separate windows.
*
* @param {Object} context jQuery wrapper around HTML context.
*/
angular.scenario.Application = function(context) {
this.context = context;
context.append(
'<h2>Current URL: <a href="about:blank">None</a></h2>' +
'<div id="test-frames"></div>'
);
};
/**
* Gets the jQuery collection of frames. Don't use this directly because
* frames may go stale.
*
* @private
* @return {Object} jQuery collection
*/
angular.scenario.Application.prototype.getFrame_ = function() {
return this.context.find('#test-frames iframe:last');
};
/**
* Gets the window of the test runner frame. Always favor executeAction()
* instead of this method since it prevents you from getting a stale window.
*
* @private
* @return {Object} the window of the frame
*/
angular.scenario.Application.prototype.getWindow_ = function() {
var contentWindow = this.getFrame_().prop('contentWindow');
if (!contentWindow)
throw 'Frame window is not accessible.';
return contentWindow;
};
/**
* Changes the location of the frame.
*
* @param {string} url The URL. If it begins with a # then only the
* hash of the page is changed.
* @param {function()} loadFn function($window, $document) Called when frame loads.
* @param {function()} errorFn function(error) Called if any error when loading.
*/
angular.scenario.Application.prototype.navigateTo = function(url, loadFn, errorFn) {
var self = this;
var frame = this.getFrame_();
//TODO(esprehn): Refactor to use rethrow()
errorFn = errorFn || function(e) { throw e; };
if (url === 'about:blank') {
errorFn('Sandbox Error: Navigating to about:blank is not allowed.');
} else if (url.charAt(0) === '#') {
url = frame.attr('src').split('#')[0] + url;
frame.attr('src', url);
this.executeAction(loadFn);
} else {
frame.remove();
this.context.find('#test-frames').append('<iframe>');
frame = this.getFrame_();
frame.load(function() {
frame.unbind();
try {
self.executeAction(loadFn);
} catch (e) {
errorFn(e);
}
}).attr('src', url);
}
this.context.find('> h2 a').attr('href', url).text(url);
};
/**
* Executes a function in the context of the tested application. Will wait
* for all pending angular xhr requests before executing.
*
* @param {function()} action The callback to execute. function($window, $document)
* $document is a jQuery wrapped document.
*/
angular.scenario.Application.prototype.executeAction = function(action) {
var self = this;
var $window = this.getWindow_();
if (!$window.document) {
throw 'Sandbox Error: Application document not accessible.';
}
if (!$window.angular) {
return action.call(this, $window, _jQuery($window.document));
}
angularInit($window.document, function(element) {
element = $window.angular.element(element);
var $injector = element.inheritedData('$injector');
$injector.invoke(function($browser){
$browser.notifyWhenNoOutstandingRequests(function() {
action.call(self, $window, _jQuery($window.document));
});
});
});
};
'use strict';
/**
* The representation of define blocks. Don't used directly, instead use
* define() in your tests.
*
* @param {string} descName Name of the block
* @param {Object} parent describe or undefined if the root.
*/
angular.scenario.Describe = function(descName, parent) {
this.only = parent && parent.only;
this.beforeEachFns = [];
this.afterEachFns = [];
this.its = [];
this.children = [];
this.name = descName;
this.parent = parent;
this.id = angular.scenario.Describe.id++;
/**
* Calls all before functions.
*/
var beforeEachFns = this.beforeEachFns;
this.setupBefore = function() {
if (parent) parent.setupBefore.call(this);
angular.forEach(beforeEachFns, function(fn) { fn.call(this); }, this);
};
/**
* Calls all after functions.
*/
var afterEachFns = this.afterEachFns;
this.setupAfter = function() {
angular.forEach(afterEachFns, function(fn) { fn.call(this); }, this);
if (parent) parent.setupAfter.call(this);
};
};
// Shared Unique ID generator for every describe block
angular.scenario.Describe.id = 0;
// Shared Unique ID generator for every it (spec)
angular.scenario.Describe.specId = 0;
/**
* Defines a block to execute before each it or nested describe.
*
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.beforeEach = function(body) {
this.beforeEachFns.push(body);
};
/**
* Defines a block to execute after each it or nested describe.
*
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.afterEach = function(body) {
this.afterEachFns.push(body);
};
/**
* Creates a new describe block that's a child of this one.
*
* @param {string} name Name of the block. Appended to the parent block's name.
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.describe = function(name, body) {
var child = new angular.scenario.Describe(name, this);
this.children.push(child);
body.call(child);
};
/**
* Same as describe() but makes ddescribe blocks the only to run.
*
* @param {string} name Name of the test.
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.ddescribe = function(name, body) {
var child = new angular.scenario.Describe(name, this);
child.only = true;
this.children.push(child);
body.call(child);
};
/**
* Use to disable a describe block.
*/
angular.scenario.Describe.prototype.xdescribe = angular.noop;
/**
* Defines a test.
*
* @param {string} name Name of the test.
* @param {function()} vody Body of the block.
*/
angular.scenario.Describe.prototype.it = function(name, body) {
this.its.push({
id: angular.scenario.Describe.specId++,
definition: this,
only: this.only,
name: name,
before: this.setupBefore,
body: body,
after: this.setupAfter
});
};
/**
* Same as it() but makes iit tests the only test to run.
*
* @param {string} name Name of the test.
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.iit = function(name, body) {
this.it.apply(this, arguments);
this.its[this.its.length-1].only = true;
};
/**
* Use to disable a test block.
*/
angular.scenario.Describe.prototype.xit = angular.noop;
/**
* Gets an array of functions representing all the tests (recursively).
* that can be executed with SpecRunner's.
*
* @return {Array<Object>} Array of it blocks {
* definition : Object // parent Describe
* only: boolean
* name: string
* before: Function
* body: Function
* after: Function
* }
*/
angular.scenario.Describe.prototype.getSpecs = function() {
var specs = arguments[0] || [];
angular.forEach(this.children, function(child) {
child.getSpecs(specs);
});
angular.forEach(this.its, function(it) {
specs.push(it);
});
var only = [];
angular.forEach(specs, function(it) {
if (it.only) {
only.push(it);
}
});
return (only.length && only) || specs;
};
'use strict';
/**
* A future action in a spec.
*
* @param {string} name of the future action
* @param {function()} future callback(error, result)
* @param {function()} Optional. function that returns the file/line number.
*/
angular.scenario.Future = function(name, behavior, line) {
this.name = name;
this.behavior = behavior;
this.fulfilled = false;
this.value = undefined;
this.parser = angular.identity;
this.line = line || function() { return ''; };
};
/**
* Executes the behavior of the closure.
*
* @param {function()} doneFn Callback function(error, result)
*/
angular.scenario.Future.prototype.execute = function(doneFn) {
var self = this;
this.behavior(function(error, result) {
self.fulfilled = true;
if (result) {
try {
result = self.parser(result);
} catch(e) {
error = e;
}
}
self.value = error || result;
doneFn(error, result);
});
};
/**
* Configures the future to convert it's final with a function fn(value)
*
* @param {function()} fn function(value) that returns the parsed value
*/
angular.scenario.Future.prototype.parsedWith = function(fn) {
this.parser = fn;
return this;
};
/**
* Configures the future to parse it's final value from JSON
* into objects.
*/
angular.scenario.Future.prototype.fromJson = function() {
return this.parsedWith(angular.fromJson);
};
/**
* Configures the future to convert it's final value from objects
* into JSON.
*/
angular.scenario.Future.prototype.toJson = function() {
return this.parsedWith(angular.toJson);
};
'use strict';
/**
* Maintains an object tree from the runner events.
*
* @param {Object} runner The scenario Runner instance to connect to.
*
* TODO(esprehn): Every output type creates one of these, but we probably
* want one global shared instance. Need to handle events better too
* so the HTML output doesn't need to do spec model.getSpec(spec.id)
* silliness.
*
* TODO(vojta) refactor on, emit methods (from all objects) - use inheritance
*/
angular.scenario.ObjectModel = function(runner) {
var self = this;
this.specMap = {};
this.listeners = [];
this.value = {
name: '',
children: {}
};
runner.on('SpecBegin', function(spec) {
var block = self.value,
definitions = [];
angular.forEach(self.getDefinitionPath(spec), function(def) {
if (!block.children[def.name]) {
block.children[def.name] = {
id: def.id,
name: def.name,
children: {},
specs: {}
};
}
block = block.children[def.name];
definitions.push(def.name);
});
var it = self.specMap[spec.id] =
block.specs[spec.name] =
new angular.scenario.ObjectModel.Spec(spec.id, spec.name, definitions);
// forward the event
self.emit('SpecBegin', it);
});
runner.on('SpecError', function(spec, error) {
var it = self.getSpec(spec.id);
it.status = 'error';
it.error = error;
// forward the event
self.emit('SpecError', it, error);
});
runner.on('SpecEnd', function(spec) {
var it = self.getSpec(spec.id);
complete(it);
// forward the event
self.emit('SpecEnd', it);
});
runner.on('StepBegin', function(spec, step) {
var it = self.getSpec(spec.id);
var step = new angular.scenario.ObjectModel.Step(step.name);
it.steps.push(step);
// forward the event
self.emit('StepBegin', it, step);
});
runner.on('StepEnd', function(spec, step) {
var it = self.getSpec(spec.id);
var step = it.getLastStep();
if (step.name !== step.name)
throw 'Events fired in the wrong order. Step names don\'t match.';
complete(step);
// forward the event
self.emit('StepEnd', it, step);
});
runner.on('StepFailure', function(spec, step, error) {
var it = self.getSpec(spec.id),
modelStep = it.getLastStep();
modelStep.setErrorStatus('failure', error, step.line());
it.setStatusFromStep(modelStep);
// forward the event
self.emit('StepFailure', it, modelStep, error);
});
runner.on('StepError', function(spec, step, error) {
var it = self.getSpec(spec.id),
modelStep = it.getLastStep();
modelStep.setErrorStatus('error', error, step.line());
it.setStatusFromStep(modelStep);
// forward the event
self.emit('StepError', it, modelStep, error);
});
runner.on('RunnerEnd', function() {
self.emit('RunnerEnd');
});
function complete(item) {
item.endTime = new Date().getTime();
item.duration = item.endTime - item.startTime;
item.status = item.status || 'success';
}
};
/**
* Adds a listener for an event.
*
* @param {string} eventName Name of the event to add a handler for
* @param {function()} listener Function that will be called when event is fired
*/
angular.scenario.ObjectModel.prototype.on = function(eventName, listener) {
eventName = eventName.toLowerCase();
this.listeners[eventName] = this.listeners[eventName] || [];
this.listeners[eventName].push(listener);
};
/**
* Emits an event which notifies listeners and passes extra
* arguments.
*
* @param {string} eventName Name of the event to fire.
*/
angular.scenario.ObjectModel.prototype.emit = function(eventName) {
var self = this,
args = Array.prototype.slice.call(arguments, 1),
eventName = eventName.toLowerCase();
if (this.listeners[eventName]) {
angular.forEach(this.listeners[eventName], function(listener) {
listener.apply(self, args);
});
}
};
/**
* Computes the path of definition describe blocks that wrap around
* this spec.
*
* @param spec Spec to compute the path for.
* @return {Array<Describe>} The describe block path
*/
angular.scenario.ObjectModel.prototype.getDefinitionPath = function(spec) {
var path = [];
var currentDefinition = spec.definition;
while (currentDefinition && currentDefinition.name) {
path.unshift(currentDefinition);
currentDefinition = currentDefinition.parent;
}
return path;
};
/**
* Gets a spec by id.
*
* @param {string} The id of the spec to get the object for.
* @return {Object} the Spec instance
*/
angular.scenario.ObjectModel.prototype.getSpec = function(id) {
return this.specMap[id];
};
/**
* A single it block.
*
* @param {string} id Id of the spec
* @param {string} name Name of the spec
* @param {Array<string>=} definitionNames List of all describe block names that wrap this spec
*/
angular.scenario.ObjectModel.Spec = function(id, name, definitionNames) {
this.id = id;
this.name = name;
this.startTime = new Date().getTime();
this.steps = [];
this.fullDefinitionName = (definitionNames || []).join(' ');
};
/**
* Adds a new step to the Spec.
*
* @param {string} step Name of the step (really name of the future)
* @return {Object} the added step
*/
angular.scenario.ObjectModel.Spec.prototype.addStep = function(name) {
var step = new angular.scenario.ObjectModel.Step(name);
this.steps.push(step);
return step;
};
/**
* Gets the most recent step.
*
* @return {Object} the step
*/
angular.scenario.ObjectModel.Spec.prototype.getLastStep = function() {
return this.steps[this.steps.length-1];
};
/**
* Set status of the Spec from given Step
*
* @param {angular.scenario.ObjectModel.Step} step
*/
angular.scenario.ObjectModel.Spec.prototype.setStatusFromStep = function(step) {
if (!this.status || step.status == 'error') {
this.status = step.status;
this.error = step.error;
this.line = step.line;
}
};
/**
* A single step inside a Spec.
*
* @param {string} step Name of the step
*/
angular.scenario.ObjectModel.Step = function(name) {
this.name = name;
this.startTime = new Date().getTime();
};
/**
* Helper method for setting all error status related properties
*
* @param {string} status
* @param {string} error
* @param {string} line
*/
angular.scenario.ObjectModel.Step.prototype.setErrorStatus = function(status, error, line) {
this.status = status;
this.error = error;
this.line = line;
};
'use strict';
/**
* The representation of define blocks. Don't used directly, instead use
* define() in your tests.
*
* @param {string} descName Name of the block
* @param {Object} parent describe or undefined if the root.
*/
angular.scenario.Describe = function(descName, parent) {
this.only = parent && parent.only;
this.beforeEachFns = [];
this.afterEachFns = [];
this.its = [];
this.children = [];
this.name = descName;
this.parent = parent;
this.id = angular.scenario.Describe.id++;
/**
* Calls all before functions.
*/
var beforeEachFns = this.beforeEachFns;
this.setupBefore = function() {
if (parent) parent.setupBefore.call(this);
angular.forEach(beforeEachFns, function(fn) { fn.call(this); }, this);
};
/**
* Calls all after functions.
*/
var afterEachFns = this.afterEachFns;
this.setupAfter = function() {
angular.forEach(afterEachFns, function(fn) { fn.call(this); }, this);
if (parent) parent.setupAfter.call(this);
};
};
// Shared Unique ID generator for every describe block
angular.scenario.Describe.id = 0;
// Shared Unique ID generator for every it (spec)
angular.scenario.Describe.specId = 0;
/**
* Defines a block to execute before each it or nested describe.
*
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.beforeEach = function(body) {
this.beforeEachFns.push(body);
};
/**
* Defines a block to execute after each it or nested describe.
*
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.afterEach = function(body) {
this.afterEachFns.push(body);
};
/**
* Creates a new describe block that's a child of this one.
*
* @param {string} name Name of the block. Appended to the parent block's name.
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.describe = function(name, body) {
var child = new angular.scenario.Describe(name, this);
this.children.push(child);
body.call(child);
};
/**
* Same as describe() but makes ddescribe blocks the only to run.
*
* @param {string} name Name of the test.
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.ddescribe = function(name, body) {
var child = new angular.scenario.Describe(name, this);
child.only = true;
this.children.push(child);
body.call(child);
};
/**
* Use to disable a describe block.
*/
angular.scenario.Describe.prototype.xdescribe = angular.noop;
/**
* Defines a test.
*
* @param {string} name Name of the test.
* @param {function()} vody Body of the block.
*/
angular.scenario.Describe.prototype.it = function(name, body) {
this.its.push({
id: angular.scenario.Describe.specId++,
definition: this,
only: this.only,
name: name,
before: this.setupBefore,
body: body,
after: this.setupAfter
});
};
/**
* Same as it() but makes iit tests the only test to run.
*
* @param {string} name Name of the test.
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.iit = function(name, body) {
this.it.apply(this, arguments);
this.its[this.its.length-1].only = true;
};
/**
* Use to disable a test block.
*/
angular.scenario.Describe.prototype.xit = angular.noop;
/**
* Gets an array of functions representing all the tests (recursively).
* that can be executed with SpecRunner's.
*
* @return {Array<Object>} Array of it blocks {
* definition : Object // parent Describe
* only: boolean
* name: string
* before: Function
* body: Function
* after: Function
* }
*/
angular.scenario.Describe.prototype.getSpecs = function() {
var specs = arguments[0] || [];
angular.forEach(this.children, function(child) {
child.getSpecs(specs);
});
angular.forEach(this.its, function(it) {
specs.push(it);
});
var only = [];
angular.forEach(specs, function(it) {
if (it.only) {
only.push(it);
}
});
return (only.length && only) || specs;
};
'use strict';
/**
* Runner for scenarios
*
* Has to be initialized before any test is loaded,
* because it publishes the API into window (global space).
*/
angular.scenario.Runner = function($window) {
this.listeners = [];
this.$window = $window;
this.rootDescribe = new angular.scenario.Describe();
this.currentDescribe = this.rootDescribe;
this.api = {
it: this.it,
iit: this.iit,
xit: angular.noop,
describe: this.describe,
ddescribe: this.ddescribe,
xdescribe: angular.noop,
beforeEach: this.beforeEach,
afterEach: this.afterEach
};
angular.forEach(this.api, angular.bind(this, function(fn, key) {
this.$window[key] = angular.bind(this, fn);
}));
};
/**
* Emits an event which notifies listeners and passes extra
* arguments.
*
* @param {string} eventName Name of the event to fire.
*/
angular.scenario.Runner.prototype.emit = function(eventName) {
var self = this;
var args = Array.prototype.slice.call(arguments, 1);
eventName = eventName.toLowerCase();
if (!this.listeners[eventName])
return;
angular.forEach(this.listeners[eventName], function(listener) {
listener.apply(self, args);
});
};
/**
* Adds a listener for an event.
*
* @param {string} eventName The name of the event to add a handler for
* @param {string} listener The fn(...) that takes the extra arguments from emit()
*/
angular.scenario.Runner.prototype.on = function(eventName, listener) {
eventName = eventName.toLowerCase();
this.listeners[eventName] = this.listeners[eventName] || [];
this.listeners[eventName].push(listener);
};
/**
* Defines a describe block of a spec.
*
* @see Describe.js
*
* @param {string} name Name of the block
* @param {function()} body Body of the block
*/
angular.scenario.Runner.prototype.describe = function(name, body) {
var self = this;
this.currentDescribe.describe(name, function() {
var parentDescribe = self.currentDescribe;
self.currentDescribe = this;
try {
body.call(this);
} finally {
self.currentDescribe = parentDescribe;
}
});
};
/**
* Same as describe, but makes ddescribe the only blocks to run.
*
* @see Describe.js
*
* @param {string} name Name of the block
* @param {function()} body Body of the block
*/
angular.scenario.Runner.prototype.ddescribe = function(name, body) {
var self = this;
this.currentDescribe.ddescribe(name, function() {
var parentDescribe = self.currentDescribe;
self.currentDescribe = this;
try {
body.call(this);
} finally {
self.currentDescribe = parentDescribe;
}
});
};
/**
* Defines a test in a describe block of a spec.
*
* @see Describe.js
*
* @param {string} name Name of the block
* @param {function()} body Body of the block
*/
angular.scenario.Runner.prototype.it = function(name, body) {
this.currentDescribe.it(name, body);
};
/**
* Same as it, but makes iit tests the only tests to run.
*
* @see Describe.js
*
* @param {string} name Name of the block
* @param {function()} body Body of the block
*/
angular.scenario.Runner.prototype.iit = function(name, body) {
this.currentDescribe.iit(name, body);
};
/**
* Defines a function to be called before each it block in the describe
* (and before all nested describes).
*
* @see Describe.js
*
* @param {function()} Callback to execute
*/
angular.scenario.Runner.prototype.beforeEach = function(body) {
this.currentDescribe.beforeEach(body);
};
/**
* Defines a function to be called after each it block in the describe
* (and before all nested describes).
*
* @see Describe.js
*
* @param {function()} Callback to execute
*/
angular.scenario.Runner.prototype.afterEach = function(body) {
this.currentDescribe.afterEach(body);
};
/**
* Creates a new spec runner.
*
* @private
* @param {Object} scope parent scope
*/
angular.scenario.Runner.prototype.createSpecRunner_ = function(scope) {
return scope.$new(angular.scenario.SpecRunner);
};
/**
* Runs all the loaded tests with the specified runner class on the
* provided application.
*
* @param {angular.scenario.Application} application App to remote control.
*/
angular.scenario.Runner.prototype.run = function(application) {
var self = this;
var $root = angular.injector(['ng']).get('$rootScope');
angular.extend($root, this);
angular.forEach(angular.scenario.Runner.prototype, function(fn, name) {
$root[name] = angular.bind(self, fn);
});
$root.application = application;
$root.emit('RunnerBegin');
asyncForEach(this.rootDescribe.getSpecs(), function(spec, specDone) {
var dslCache = {};
var runner = self.createSpecRunner_($root);
angular.forEach(angular.scenario.dsl, function(fn, key) {
dslCache[key] = fn.call($root);
});
angular.forEach(angular.scenario.dsl, function(fn, key) {
self.$window[key] = function() {
var line = callerFile(3);
var scope = runner.$new();
// Make the dsl accessible on the current chain
scope.dsl = {};
angular.forEach(dslCache, function(fn, key) {
scope.dsl[key] = function() {
return dslCache[key].apply(scope, arguments);
};
});
// Make these methods work on the current chain
scope.addFuture = function() {
Array.prototype.push.call(arguments, line);
return angular.scenario.SpecRunner.
prototype.addFuture.apply(scope, arguments);
};
scope.addFutureAction = function() {
Array.prototype.push.call(arguments, line);
return angular.scenario.SpecRunner.
prototype.addFutureAction.apply(scope, arguments);
};
return scope.dsl[key].apply(scope, arguments);
};
});
runner.run(spec, function() {
runner.$destroy();
specDone.apply(this, arguments);
});
},
function(error) {
if (error) {
self.emit('RunnerError', error);
}
self.emit('RunnerEnd');
});
};
'use strict';
/**
* This class is the "this" of the it/beforeEach/afterEach method.
* Responsibilities:
* - "this" for it/beforeEach/afterEach
* - keep state for single it/beforeEach/afterEach execution
* - keep track of all of the futures to execute
* - run single spec (execute each future)
*/
angular.scenario.SpecRunner = function() {
this.futures = [];
this.afterIndex = 0;
};
/**
* Executes a spec which is an it block with associated before/after functions
* based on the describe nesting.
*
* @param {Object} spec A spec object
* @param {function()} specDone function that is called when the spec finshes. Function(error, index)
*/
angular.scenario.SpecRunner.prototype.run = function(spec, specDone) {
var self = this;
this.spec = spec;
this.emit('SpecBegin', spec);
try {
spec.before.call(this);
spec.body.call(this);
this.afterIndex = this.futures.length;
spec.after.call(this);
} catch (e) {
this.emit('SpecError', spec, e);
this.emit('SpecEnd', spec);
specDone();
return;
}
var handleError = function(error, done) {
if (self.error) {
return done();
}
self.error = true;
done(null, self.afterIndex);
};
asyncForEach(
this.futures,
function(future, futureDone) {
self.step = future;
self.emit('StepBegin', spec, future);
try {
future.execute(function(error) {
if (error) {
self.emit('StepFailure', spec, future, error);
self.emit('StepEnd', spec, future);
return handleError(error, futureDone);
}
self.emit('StepEnd', spec, future);
self.$window.setTimeout(function() { futureDone(); }, 0);
});
} catch (e) {
self.emit('StepError', spec, future, e);
self.emit('StepEnd', spec, future);
handleError(e, futureDone);
}
},
function(e) {
if (e) {
self.emit('SpecError', spec, e);
}
self.emit('SpecEnd', spec);
// Call done in a timeout so exceptions don't recursively
// call this function
self.$window.setTimeout(function() { specDone(); }, 0);
}
);
};
/**
* Adds a new future action.
*
* Note: Do not pass line manually. It happens automatically.
*
* @param {string} name Name of the future
* @param {function()} behavior Behavior of the future
* @param {function()} line fn() that returns file/line number
*/
angular.scenario.SpecRunner.prototype.addFuture = function(name, behavior, line) {
var future = new angular.scenario.Future(name, angular.bind(this, behavior), line);
this.futures.push(future);
return future;
};
/**
* Adds a new future action to be executed on the application window.
*
* Note: Do not pass line manually. It happens automatically.
*
* @param {string} name Name of the future
* @param {function()} behavior Behavior of the future
* @param {function()} line fn() that returns file/line number
*/
angular.scenario.SpecRunner.prototype.addFutureAction = function(name, behavior, line) {
var self = this;
return this.addFuture(name, function(done) {
this.application.executeAction(function($window, $document) {
//TODO(esprehn): Refactor this so it doesn't need to be in here.
$document.elements = function(selector) {
var args = Array.prototype.slice.call(arguments, 1);
selector = (self.selector || '') + ' ' + (selector || '');
selector = _jQuery.trim(selector) || '*';
angular.forEach(args, function(value, index) {
selector = selector.replace('$' + (index + 1), value);
});
var result = $document.find(selector);
if (!result.length) {
throw {
type: 'selector',
message: 'Selector ' + selector + ' did not match any elements.'
};
}
return result;
};
try {
behavior.call(self, $window, $document, done);
} catch(e) {
if (e.type && e.type === 'selector') {
done(e.message);
} else {
throw e;
}
}
});
}, line);
};
'use strict';
/**
* Shared DSL statements that are useful to all scenarios.
*/
/**
* Usage:
* pause() pauses until you call resume() in the console
*/
angular.scenario.dsl('pause', function() {
return function() {
return this.addFuture('pausing for you to resume', function(done) {
this.emit('InteractivePause', this.spec, this.step);
this.$window.resume = function() { done(); };
});
};
});
/**
* Usage:
* sleep(seconds) pauses the test for specified number of seconds
*/
angular.scenario.dsl('sleep', function() {
return function(time) {
return this.addFuture('sleep for ' + time + ' seconds', function(done) {
this.$window.setTimeout(function() { done(null, time * 1000); }, time * 1000);
});
};
});
/**
* Usage:
* browser().navigateTo(url) Loads the url into the frame
* browser().navigateTo(url, fn) where fn(url) is called and returns the URL to navigate to
* browser().reload() refresh the page (reload the same URL)
* browser().window.href() window.location.href
* browser().window.path() window.location.pathname
* browser().window.search() window.location.search
* browser().window.hash() window.location.hash without # prefix
* browser().location().url() see angular.module.ng.$location#url
* browser().location().path() see angular.module.ng.$location#path
* browser().location().search() see angular.module.ng.$location#search
* browser().location().hash() see angular.module.ng.$location#hash
*/
angular.scenario.dsl('browser', function() {
var chain = {};
chain.navigateTo = function(url, delegate) {
var application = this.application;
return this.addFuture("browser navigate to '" + url + "'", function(done) {
if (delegate) {
url = delegate.call(this, url);
}
application.navigateTo(url, function() {
done(null, url);
}, done);
});
};
chain.reload = function() {
var application = this.application;
return this.addFutureAction('browser reload', function($window, $document, done) {
var href = $window.location.href;
application.navigateTo(href, function() {
done(null, href);
}, done);
});
};
chain.window = function() {
var api = {};
api.href = function() {
return this.addFutureAction('window.location.href', function($window, $document, done) {
done(null, $window.location.href);
});
};
api.path = function() {
return this.addFutureAction('window.location.path', function($window, $document, done) {
done(null, $window.location.pathname);
});
};
api.search = function() {
return this.addFutureAction('window.location.search', function($window, $document, done) {
done(null, $window.location.search);
});
};
api.hash = function() {
return this.addFutureAction('window.location.hash', function($window, $document, done) {
done(null, $window.location.hash.replace('#', ''));
});
};
return api;
};
chain.location = function() {
var api = {};
api.url = function() {
return this.addFutureAction('$location.url()', function($window, $document, done) {
done(null, $window.angular.injector(['ng']).get('$location').url());
});
};
api.path = function() {
return this.addFutureAction('$location.path()', function($window, $document, done) {
done(null, $window.angular.injector(['ng']).get('$location').path());
});
};
api.search = function() {
return this.addFutureAction('$location.search()', function($window, $document, done) {
done(null, $window.angular.injector(['ng']).get('$location').search());
});
};
api.hash = function() {
return this.addFutureAction('$location.hash()', function($window, $document, done) {
done(null, $window.angular.injector(['ng']).get('$location').hash());
});
};
return api;
};
return function(time) {
return chain;
};
});
/**
* Usage:
* expect(future).{matcher} where matcher is one of the matchers defined
* with angular.scenario.matcher
*
* ex. expect(binding("name")).toEqual("Elliott")
*/
angular.scenario.dsl('expect', function() {
var chain = angular.extend({}, angular.scenario.matcher);
chain.not = function() {
this.inverse = true;
return chain;
};
return function(future) {
this.future = future;
return chain;
};
});
/**
* Usage:
* using(selector, label) scopes the next DSL element selection
*
* ex.
* using('#foo', "'Foo' text field").input('bar')
*/
angular.scenario.dsl('using', function() {
return function(selector, label) {
this.selector = _jQuery.trim((this.selector||'') + ' ' + selector);
if (angular.isString(label) && label.length) {
this.label = label + ' ( ' + this.selector + ' )';
} else {
this.label = this.selector;
}
return this.dsl;
};
});
/**
* Usage:
* binding(name) returns the value of the first matching binding
*/
angular.scenario.dsl('binding', function() {
return function(name) {
return this.addFutureAction("select binding '" + name + "'", function($window, $document, done) {
var values = $document.elements().bindings(name);
if (!values.length) {
return done("Binding selector '" + name + "' did not match.");
}
done(null, values[0]);
});
};
});
/**
* Usage:
* input(name).enter(value) enters value in input with specified name
* input(name).check() checks checkbox
* input(name).select(value) selects the radio button with specified name/value
* input(name).val() returns the value of the input.
*/
angular.scenario.dsl('input', function() {
var chain = {};
chain.enter = function(value) {
return this.addFutureAction("input '" + this.name + "' enter '" + value + "'", function($window, $document, done) {
var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':input');
input.val(value);
input.trigger('keydown');
done();
});
};
chain.check = function() {
return this.addFutureAction("checkbox '" + this.name + "' toggle", function($window, $document, done) {
var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':checkbox');
input.trigger('click');
done();
});
};
chain.select = function(value) {
return this.addFutureAction("radio button '" + this.name + "' toggle '" + value + "'", function($window, $document, done) {
var input = $document.
elements('[ng\\:model="$1"][value="$2"]', this.name, value).filter(':radio');
input.trigger('click');
done();
});
};
chain.val = function() {
return this.addFutureAction("return input val", function($window, $document, done) {
var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':input');
done(null,input.val());
});
};
return function(name) {
this.name = name;
return chain;
};
});
/**
* Usage:
* repeater('#products table', 'Product List').count() number of rows
* repeater('#products table', 'Product List').row(1) all bindings in row as an array
* repeater('#products table', 'Product List').column('product.name') all values across all rows in an array
*/
angular.scenario.dsl('repeater', function() {
var chain = {};
chain.count = function() {
return this.addFutureAction("repeater '" + this.label + "' count", function($window, $document, done) {
try {
done(null, $document.elements().length);
} catch (e) {
done(null, 0);
}
});
};
chain.column = function(binding) {
return this.addFutureAction("repeater '" + this.label + "' column '" + binding + "'", function($window, $document, done) {
done(null, $document.elements().bindings(binding));
});
};
chain.row = function(index) {
return this.addFutureAction("repeater '" + this.label + "' row '" + index + "'", function($window, $document, done) {
var matches = $document.elements().slice(index, index + 1);
if (!matches.length)
return done('row ' + index + ' out of bounds');
done(null, matches.bindings());
});
};
return function(selector, label) {
this.dsl.using(selector, label);
return chain;
};
});
/**
* Usage:
* select(name).option('value') select one option
* select(name).options('value1', 'value2', ...) select options from a multi select
*/
angular.scenario.dsl('select', function() {
var chain = {};
chain.option = function(value) {
return this.addFutureAction("select '" + this.name + "' option '" + value + "'", function($window, $document, done) {
var select = $document.elements('select[ng\\:model="$1"]', this.name);
var option = select.find('option[value="' + value + '"]');
if (option.length) {
select.val(value);
} else {
option = select.find('option:contains("' + value + '")');
if (option.length) {
select.val(option.val());
}
}
select.trigger('change');
done();
});
};
chain.options = function() {
var values = arguments;
return this.addFutureAction("select '" + this.name + "' options '" + values + "'", function($window, $document, done) {
var select = $document.elements('select[multiple][ng\\:model="$1"]', this.name);
select.val(values);
select.trigger('change');
done();
});
};
return function(name) {
this.name = name;
return chain;
};
});
/**
* Usage:
* element(selector, label).count() get the number of elements that match selector
* element(selector, label).click() clicks an element
* element(selector, label).query(fn) executes fn(selectedElements, done)
* element(selector, label).{method}() gets the value (as defined by jQuery, ex. val)
* element(selector, label).{method}(value) sets the value (as defined by jQuery, ex. val)
* element(selector, label).{method}(key) gets the value (as defined by jQuery, ex. attr)
* element(selector, label).{method}(key, value) sets the value (as defined by jQuery, ex. attr)
*/
angular.scenario.dsl('element', function() {
var KEY_VALUE_METHODS = ['attr', 'css', 'prop'];
var VALUE_METHODS = [
'val', 'text', 'html', 'height', 'innerHeight', 'outerHeight', 'width',
'innerWidth', 'outerWidth', 'position', 'scrollLeft', 'scrollTop', 'offset'
];
var chain = {};
chain.count = function() {
return this.addFutureAction("element '" + this.label + "' count", function($window, $document, done) {
try {
done(null, $document.elements().length);
} catch (e) {
done(null, 0);
}
});
};
chain.click = function() {
return this.addFutureAction("element '" + this.label + "' click", function($window, $document, done) {
var elements = $document.elements();
var href = elements.attr('href');
var eventProcessDefault = elements.trigger('click')[0];
if (href && elements[0].nodeName.toUpperCase() === 'A' && eventProcessDefault) {
this.application.navigateTo(href, function() {
done();
}, done);
} else {
done();
}
});
};
chain.query = function(fn) {
return this.addFutureAction('element ' + this.label + ' custom query', function($window, $document, done) {
fn.call(this, $document.elements(), done);
});
};
angular.forEach(KEY_VALUE_METHODS, function(methodName) {
chain[methodName] = function(name, value) {
var args = arguments,
futureName = (args.length == 1)
? "element '" + this.label + "' get " + methodName + " '" + name + "'"
: "element '" + this.label + "' set " + methodName + " '" + name + "' to " + "'" + value + "'";
return this.addFutureAction(futureName, function($window, $document, done) {
var element = $document.elements();
done(null, element[methodName].apply(element, args));
});
};
});
angular.forEach(VALUE_METHODS, function(methodName) {
chain[methodName] = function(value) {
var args = arguments,
futureName = (args.length == 0)
? "element '" + this.label + "' " + methodName
: futureName = "element '" + this.label + "' set " + methodName + " to '" + value + "'";
return this.addFutureAction(futureName, function($window, $document, done) {
var element = $document.elements();
done(null, element[methodName].apply(element, args));
});
};
});
return function(selector, label) {
this.dsl.using(selector, label);
return chain;
};
});
'use strict';
/**
* Matchers for implementing specs. Follows the Jasmine spec conventions.
*/
angular.scenario.matcher('toEqual', function(expected) {
return angular.equals(this.actual, expected);
});
angular.scenario.matcher('toBe', function(expected) {
return this.actual === expected;
});
angular.scenario.matcher('toBeDefined', function() {
return angular.isDefined(this.actual);
});
angular.scenario.matcher('toBeTruthy', function() {
return this.actual;
});
angular.scenario.matcher('toBeFalsy', function() {
return !this.actual;
});
angular.scenario.matcher('toMatch', function(expected) {
return new RegExp(expected).test(this.actual);
});
angular.scenario.matcher('toBeNull', function() {
return this.actual === null;
});
angular.scenario.matcher('toContain', function(expected) {
return includes(this.actual, expected);
});
angular.scenario.matcher('toBeLessThan', function(expected) {
return this.actual < expected;
});
angular.scenario.matcher('toBeGreaterThan', function(expected) {
return this.actual > expected;
});
'use strict';
/**
* User Interface for the Scenario Runner.
*
* TODO(esprehn): This should be refactored now that ObjectModel exists
* to use angular bindings for the UI.
*/
angular.scenario.output('html', function(context, runner, model) {
var specUiMap = {},
lastStepUiMap = {};
context.append(
'<div id="header">' +
' <h1><span class="angular">AngularJS</span>: Scenario Test Runner</h1>' +
' <ul id="status-legend" class="status-display">' +
' <li class="status-error">0 Errors</li>' +
' <li class="status-failure">0 Failures</li>' +
' <li class="status-success">0 Passed</li>' +
' </ul>' +
'</div>' +
'<div id="specs">' +
' <div class="test-children"></div>' +
'</div>'
);
runner.on('InteractivePause', function(spec, step) {
var ui = lastStepUiMap[spec.id];
ui.find('.test-title').
html('paused... <a href="javascript:resume()">resume</a> when ready.');
});
runner.on('SpecBegin', function(spec) {
var ui = findContext(spec);
ui.find('> .tests').append(
'<li class="status-pending test-it"></li>'
);
ui = ui.find('> .tests li:last');
ui.append(
'<div class="test-info">' +
' <p class="test-title">' +
' <span class="timer-result"></span>' +
' <span class="test-name"></span>' +
' </p>' +
'</div>' +
'<div class="scrollpane">' +
' <ol class="test-actions"></ol>' +
'</div>'
);
ui.find('> .test-info .test-name').text(spec.name);
ui.find('> .test-info').click(function() {
var scrollpane = ui.find('> .scrollpane');
var actions = scrollpane.find('> .test-actions');
var name = context.find('> .test-info .test-name');
if (actions.find(':visible').length) {
actions.hide();
name.removeClass('open').addClass('closed');
} else {
actions.show();
scrollpane.attr('scrollTop', scrollpane.attr('scrollHeight'));
name.removeClass('closed').addClass('open');
}
});
specUiMap[spec.id] = ui;
});
runner.on('SpecError', function(spec, error) {
var ui = specUiMap[spec.id];
ui.append('<pre></pre>');
ui.find('> pre').text(formatException(error));
});
runner.on('SpecEnd', function(spec) {
var ui = specUiMap[spec.id];
spec = model.getSpec(spec.id);
ui.removeClass('status-pending');
ui.addClass('status-' + spec.status);
ui.find("> .test-info .timer-result").text(spec.duration + "ms");
if (spec.status === 'success') {
ui.find('> .test-info .test-name').addClass('closed');
ui.find('> .scrollpane .test-actions').hide();
}
updateTotals(spec.status);
});
runner.on('StepBegin', function(spec, step) {
var ui = specUiMap[spec.id];
spec = model.getSpec(spec.id);
step = spec.getLastStep();
ui.find('> .scrollpane .test-actions').append('<li class="status-pending"></li>');
var stepUi = lastStepUiMap[spec.id] = ui.find('> .scrollpane .test-actions li:last');
stepUi.append(
'<div class="timer-result"></div>' +
'<div class="test-title"></div>'
);
stepUi.find('> .test-title').text(step.name);
var scrollpane = stepUi.parents('.scrollpane');
scrollpane.attr('scrollTop', scrollpane.attr('scrollHeight'));
});
runner.on('StepFailure', function(spec, step, error) {
var ui = lastStepUiMap[spec.id];
addError(ui, step.line, error);
});
runner.on('StepError', function(spec, step, error) {
var ui = lastStepUiMap[spec.id];
addError(ui, step.line, error);
});
runner.on('StepEnd', function(spec, step) {
var stepUi = lastStepUiMap[spec.id];
spec = model.getSpec(spec.id);
step = spec.getLastStep();
stepUi.find('.timer-result').text(step.duration + 'ms');
stepUi.removeClass('status-pending');
stepUi.addClass('status-' + step.status);
var scrollpane = specUiMap[spec.id].find('> .scrollpane');
scrollpane.attr('scrollTop', scrollpane.attr('scrollHeight'));
});
/**
* Finds the context of a spec block defined by the passed definition.
*
* @param {Object} The definition created by the Describe object.
*/
function findContext(spec) {
var currentContext = context.find('#specs');
angular.forEach(model.getDefinitionPath(spec), function(defn) {
var id = 'describe-' + defn.id;
if (!context.find('#' + id).length) {
currentContext.find('> .test-children').append(
'<div class="test-describe" id="' + id + '">' +
' <h2></h2>' +
' <div class="test-children"></div>' +
' <ul class="tests"></ul>' +
'</div>'
);
context.find('#' + id).find('> h2').text('describe: ' + defn.name);
}
currentContext = context.find('#' + id);
});
return context.find('#describe-' + spec.definition.id);
}
/**
* Updates the test counter for the status.
*
* @param {string} the status.
*/
function updateTotals(status) {
var legend = context.find('#status-legend .status-' + status);
var parts = legend.text().split(' ');
var value = (parts[0] * 1) + 1;
legend.text(value + ' ' + parts[1]);
}
/**
* Add an error to a step.
*
* @param {Object} The JQuery wrapped context
* @param {function()} fn() that should return the file/line number of the error
* @param {Object} the error.
*/
function addError(context, line, error) {
context.find('.test-title').append('<pre></pre>');
var message = _jQuery.trim(line() + '\n\n' + formatException(error));
context.find('.test-title pre:last').text(message);
}
});
'use strict';
/**
* Generates JSON output into a context.
*/
angular.scenario.output('json', function(context, runner, model) {
model.on('RunnerEnd', function() {
context.text(angular.toJson(model.value));
});
});
'use strict';
/**
* Generates XML output into a context.
*/
angular.scenario.output('xml', function(context, runner, model) {
var $ = function(args) {return new context.init(args);};
model.on('RunnerEnd', function() {
var scenario = $('<scenario></scenario>');
context.append(scenario);
serializeXml(scenario, model.value);
});
/**
* Convert the tree into XML.
*
* @param {Object} context jQuery context to add the XML to.
* @param {Object} tree node to serialize
*/
function serializeXml(context, tree) {
angular.forEach(tree.children, function(child) {
var describeContext = $('<describe></describe>');
describeContext.attr('id', child.id);
describeContext.attr('name', child.name);
context.append(describeContext);
serializeXml(describeContext, child);
});
var its = $('<its></its>');
context.append(its);
angular.forEach(tree.specs, function(spec) {
var it = $('<it></it>');
it.attr('id', spec.id);
it.attr('name', spec.name);
it.attr('duration', spec.duration);
it.attr('status', spec.status);
its.append(it);
angular.forEach(spec.steps, function(step) {
var stepContext = $('<step></step>');
stepContext.attr('name', step.name);
stepContext.attr('duration', step.duration);
stepContext.attr('status', step.status);
it.append(stepContext);
if (step.error) {
var error = $('<error></error');
stepContext.append(error);
error.text(formatException(stepContext.error));
}
});
});
}
});
'use strict';
/**
* Creates a global value $result with the result of the runner.
*/
angular.scenario.output('object', function(context, runner, model) {
runner.$window.$result = model.value;
});
bindJQuery();
publishExternalAPI(angular);
var $runner = new angular.scenario.Runner(window),
scripts = document.getElementsByTagName('script'),
script = scripts[scripts.length - 1],
config = {};
angular.forEach(script.attributes, function(attr) {
var match = attr.name.match(/ng[:\-](.*)/);
if (match) {
config[match[1]] = attr.value || true;
}
});
if (config.autotest) {
jqLiteWrap(document).ready(function() {
angular.scenario.setUpAndRun(config);
});
}
})(window, document);
angular.element(document).find('head').append('<style type="text/css">@charset "UTF-8";\n\n[ng\\:cloak], .ng-cloak {\n display: none;\n}\n\nng\\:form {\n display: block;\n}\n</style>');
angular.element(document).find('head').append('<style type="text/css">@charset "UTF-8";\n/* CSS Document */\n\n/** Structure */\nbody {\n font-family: Arial, sans-serif;\n margin: 0;\n font-size: 14px;\n}\n\n#system-error {\n font-size: 1.5em;\n text-align: center;\n}\n\n#json, #xml {\n display: none;\n}\n\n#header {\n position: fixed;\n width: 100%;\n}\n\n#specs {\n padding-top: 50px;\n}\n\n#header .angular {\n font-family: Courier New, monospace;\n font-weight: bold;\n}\n\n#header h1 {\n font-weight: normal;\n float: left;\n font-size: 30px;\n line-height: 30px;\n margin: 0;\n padding: 10px 10px;\n height: 30px;\n}\n\n#application h2,\n#specs h2 {\n margin: 0;\n padding: 0.5em;\n font-size: 1.1em;\n}\n\n#status-legend {\n margin-top: 10px;\n margin-right: 10px;\n}\n\n#header,\n#application,\n.test-info,\n.test-actions li {\n overflow: hidden;\n}\n\n#application {\n margin: 10px;\n}\n\n#application iframe {\n width: 100%;\n height: 758px;\n}\n\n#application .popout {\n float: right;\n}\n\n#application iframe {\n border: none;\n}\n\n.tests li,\n.test-actions li,\n.test-it li,\n.test-it ol,\n.status-display {\n list-style-type: none;\n}\n\n.tests,\n.test-it ol,\n.status-display {\n margin: 0;\n padding: 0;\n}\n\n.test-info {\n margin-left: 1em;\n margin-top: 0.5em;\n border-radius: 8px 0 0 8px;\n -webkit-border-radius: 8px 0 0 8px;\n -moz-border-radius: 8px 0 0 8px;\n cursor: pointer;\n}\n\n.test-info:hover .test-name {\n text-decoration: underline;\n}\n\n.test-info .closed:before {\n content: \'\\25b8\\00A0\';\n}\n\n.test-info .open:before {\n content: \'\\25be\\00A0\';\n font-weight: bold;\n}\n\n.test-it ol {\n margin-left: 2.5em;\n}\n\n.status-display,\n.status-display li {\n float: right;\n}\n\n.status-display li {\n padding: 5px 10px;\n}\n\n.timer-result,\n.test-title {\n display: inline-block;\n margin: 0;\n padding: 4px;\n}\n\n.test-actions .test-title,\n.test-actions .test-result {\n display: table-cell;\n padding-left: 0.5em;\n padding-right: 0.5em;\n}\n\n.test-actions {\n display: table;\n}\n\n.test-actions li {\n display: table-row;\n}\n\n.timer-result {\n width: 4em;\n padding: 0 10px;\n text-align: right;\n font-family: monospace;\n}\n\n.test-it pre,\n.test-actions pre {\n clear: left;\n color: black;\n margin-left: 6em;\n}\n\n.test-describe {\n padding-bottom: 0.5em;\n}\n\n.test-describe .test-describe {\n margin: 5px 5px 10px 2em;\n}\n\n.test-actions .status-pending .test-title:before {\n content: \'\\00bb\\00A0\';\n}\n\n.scrollpane {\n max-height: 20em;\n overflow: auto;\n}\n\n/** Colors */\n\n#header {\n background-color: #F2C200;\n}\n\n#specs h2 {\n border-top: 2px solid #BABAD1;\n}\n\n#specs h2,\n#application h2 {\n background-color: #efefef;\n}\n\n#application {\n border: 1px solid #BABAD1;\n}\n\n.test-describe .test-describe {\n border-left: 1px solid #BABAD1;\n border-right: 1px solid #BABAD1;\n border-bottom: 1px solid #BABAD1;\n}\n\n.status-display {\n border: 1px solid #777;\n}\n\n.status-display .status-pending,\n.status-pending .test-info {\n background-color: #F9EEBC;\n}\n\n.status-display .status-success,\n.status-success .test-info {\n background-color: #B1D7A1;\n}\n\n.status-display .status-failure,\n.status-failure .test-info {\n background-color: #FF8286;\n}\n\n.status-display .status-error,\n.status-error .test-info {\n background-color: black;\n color: white;\n}\n\n.test-actions .status-success .test-title {\n color: #30B30A;\n}\n\n.test-actions .status-failure .test-title {\n color: #DF0000;\n}\n\n.test-actions .status-error .test-title {\n color: black;\n}\n\n.test-actions .timer-result {\n color: #888;\n}\n</style>'); |
src/components/common/Button.js | amir5000/react-native-manager-app | import React from 'react';
import { Text, TouchableOpacity } from 'react-native';
const Button = ({ onPress, children }) => {
const { buttonStyle, buttonTextStyle } = styles;
return (
<TouchableOpacity onPress={onPress} style={buttonStyle}>
<Text style={buttonTextStyle}>{children}</Text>
</TouchableOpacity>
);
};
const styles = {
buttonStyle: {
flex: 1,
alignSelf: 'stretch',
backgroundColor: '#FFF',
borderRadius: 5,
borderWidth: 1,
borderColor: '#007AFF',
marginLeft: 5,
marginRight: 5
},
buttonTextStyle: {
alignSelf: 'center',
color: '#007AFF',
fontWeight: '600',
paddingTop: 10,
paddingBottom: 10
}
};
export { Button };
|
src/components/AboutPage.js | polinazolotukhina/redux-movieDB | import React from 'react';
import {Link} from 'react-router';
import '../styles/about-page.css';
// Since this component is simple and static, there's no parent container for it.
const AboutPage = () => {
return (
<div>
<h2 className="alt-header">About</h2>
<p>
This example app is part of the <a href="https://github.com/coryhouse/react-slingshot">React-Slingshot
starter kit</a>.
</p>
<p>
<Link to="/badlink">Click this bad link</Link> to see the 404 page.
</p>
</div>
);
};
export default AboutPage;
|
public/docs/api/latest/@stdlib/math/base/special/erfcinv/benchmark_bundle.js | stdlib-js/www | // modules are defined as an array
// [ module function, map of requireuires ]
//
// map of requireuires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the requireuire for previous bundles
(function outer (modules, cache, entry) {
// Save the require from previous bundle to this closure if any
var previousRequire = typeof require == "function" && require;
function findProxyquireifyName() {
var deps = Object.keys(modules)
.map(function (k) { return modules[k][1]; });
for (var i = 0; i < deps.length; i++) {
var pq = deps[i]['proxyquireify'];
if (pq) return pq;
}
}
var proxyquireifyName = findProxyquireifyName();
function newRequire(name, jumped){
// Find the proxyquireify module, if present
var pqify = (proxyquireifyName != null) && cache[proxyquireifyName];
// Proxyquireify provides a separate cache that is used when inside
// a proxyquire call, and is set to null outside a proxyquire call.
// This allows the regular caching semantics to work correctly both
// inside and outside proxyquire calls while keeping the cached
// modules isolated.
// When switching from one proxyquire call to another, it clears
// the cache to prevent contamination between different sets
// of stubs.
var currentCache = (pqify && pqify.exports._cache) || cache;
if(!currentCache[name]) {
if(!modules[name]) {
// if we cannot find the the module within our internal map or
// cache jump to the current global require ie. the last bundle
// that was added to the page.
var currentRequire = typeof require == "function" && require;
if (!jumped && currentRequire) return currentRequire(name, true);
// If there are other bundles on this page the require from the
// previous one is saved to 'previousRequire'. Repeat this as
// many times as there are bundles until the module is found or
// we exhaust the require chain.
if (previousRequire) return previousRequire(name, true);
var err = new Error('Cannot find module \'' + name + '\'');
err.code = 'MODULE_NOT_FOUND';
throw err;
}
var m = currentCache[name] = {exports:{}};
// The normal browserify require function
var req = function(x){
var id = modules[name][1][x];
return newRequire(id ? id : x);
};
// The require function substituted for proxyquireify
var moduleRequire = function(x){
var pqify = (proxyquireifyName != null) && cache[proxyquireifyName];
// Only try to use the proxyquireify version if it has been `require`d
if (pqify && pqify.exports._proxy) {
return pqify.exports._proxy(req, x);
} else {
return req(x);
}
};
modules[name][0].call(m.exports,moduleRequire,m,m.exports,outer,modules,currentCache,entry);
}
return currentCache[name].exports;
}
for(var i=0;i<entry.length;i++) newRequire(entry[i]);
// Override the current require with this new one
return newRequire;
})
({1:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var ctor = ( typeof Float32Array === 'function' ) ? Float32Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],2:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order.
*
* @module @stdlib/array/float32
*
* @example
* var ctor = require( '@stdlib/array/float32' );
*
* var arr = new ctor( 10 );
* // returns <Float32Array>
*/
// MODULES //
var hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' );
var builtin = require( './float32array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasFloat32ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./float32array.js":1,"./polyfill.js":3,"@stdlib/assert/has-float32array-support":33}],3:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of single-precision floating-point numbers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],4:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var ctor = ( typeof Float64Array === 'function' ) ? Float64Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],5:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.
*
* @module @stdlib/array/float64
*
* @example
* var ctor = require( '@stdlib/array/float64' );
*
* var arr = new ctor( 10 );
* // returns <Float64Array>
*/
// MODULES //
var hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' );
var builtin = require( './float64array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasFloat64ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./float64array.js":4,"./polyfill.js":6,"@stdlib/assert/has-float64array-support":36}],6:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of double-precision floating-point numbers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],7:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of twos-complement 16-bit signed integers in the platform byte order.
*
* @module @stdlib/array/int16
*
* @example
* var ctor = require( '@stdlib/array/int16' );
*
* var arr = new ctor( 10 );
* // returns <Int16Array>
*/
// MODULES //
var hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' );
var builtin = require( './int16array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasInt16ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./int16array.js":8,"./polyfill.js":9,"@stdlib/assert/has-int16array-support":41}],8:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var ctor = ( typeof Int16Array === 'function' ) ? Int16Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],9:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of twos-complement 16-bit signed integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],10:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of twos-complement 32-bit signed integers in the platform byte order.
*
* @module @stdlib/array/int32
*
* @example
* var ctor = require( '@stdlib/array/int32' );
*
* var arr = new ctor( 10 );
* // returns <Int32Array>
*/
// MODULES //
var hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' );
var builtin = require( './int32array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasInt32ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./int32array.js":11,"./polyfill.js":12,"@stdlib/assert/has-int32array-support":44}],11:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var ctor = ( typeof Int32Array === 'function' ) ? Int32Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],12:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of twos-complement 32-bit signed integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],13:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order.
*
* @module @stdlib/array/int8
*
* @example
* var ctor = require( '@stdlib/array/int8' );
*
* var arr = new ctor( 10 );
* // returns <Int8Array>
*/
// MODULES //
var hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' );
var builtin = require( './int8array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasInt8ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./int8array.js":14,"./polyfill.js":15,"@stdlib/assert/has-int8array-support":47}],14:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var ctor = ( typeof Int8Array === 'function' ) ? Int8Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],15:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of twos-complement 8-bit signed integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],16:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var Int8Array = require( '@stdlib/array/int8' );
var Uint8Array = require( '@stdlib/array/uint8' );
var Uint8ClampedArray = require( '@stdlib/array/uint8c' );
var Int16Array = require( '@stdlib/array/int16' );
var Uint16Array = require( '@stdlib/array/uint16' );
var Int32Array = require( '@stdlib/array/int32' );
var Uint32Array = require( '@stdlib/array/uint32' );
var Float32Array = require( '@stdlib/array/float32' );
var Float64Array = require( '@stdlib/array/float64' );
// MAIN //
var CTORS = [
[ Float64Array, 'Float64Array' ],
[ Float32Array, 'Float32Array' ],
[ Int32Array, 'Int32Array' ],
[ Uint32Array, 'Uint32Array' ],
[ Int16Array, 'Int16Array' ],
[ Uint16Array, 'Uint16Array' ],
[ Int8Array, 'Int8Array' ],
[ Uint8Array, 'Uint8Array' ],
[ Uint8ClampedArray, 'Uint8ClampedArray' ]
];
// EXPORTS //
module.exports = CTORS;
},{"@stdlib/array/float32":2,"@stdlib/array/float64":5,"@stdlib/array/int16":7,"@stdlib/array/int32":10,"@stdlib/array/int8":13,"@stdlib/array/uint16":20,"@stdlib/array/uint32":23,"@stdlib/array/uint8":26,"@stdlib/array/uint8c":29}],17:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return a JSON representation of a typed array.
*
* @module @stdlib/array/to-json
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var toJSON = require( '@stdlib/array/to-json' );
*
* var arr = new Float64Array( [ 5.0, 3.0 ] );
* var json = toJSON( arr );
* // returns { 'type': 'Float64Array', 'data': [ 5.0, 3.0 ] }
*/
// MODULES //
var toJSON = require( './to_json.js' );
// EXPORTS //
module.exports = toJSON;
},{"./to_json.js":18}],18:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isTypedArray = require( '@stdlib/assert/is-typed-array' );
var typeName = require( './type.js' );
// MAIN //
/**
* Returns a JSON representation of a typed array.
*
* ## Notes
*
* - We build a JSON object representing a typed array similar to how Node.js `Buffer` objects are represented. See [Buffer][1].
*
* [1]: https://nodejs.org/api/buffer.html#buffer_buf_tojson
*
* @param {TypedArray} arr - typed array to serialize
* @throws {TypeError} first argument must be a typed array
* @returns {Object} JSON representation
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var arr = new Float64Array( [ 5.0, 3.0 ] );
* var json = toJSON( arr );
* // returns { 'type': 'Float64Array', 'data': [ 5.0, 3.0 ] }
*/
function toJSON( arr ) {
var out;
var i;
if ( !isTypedArray( arr ) ) {
throw new TypeError( 'invalid argument. Must provide a typed array. Value: `' + arr + '`.' );
}
out = {};
out.type = typeName( arr );
out.data = [];
for ( i = 0; i < arr.length; i++ ) {
out.data.push( arr[ i ] );
}
return out;
}
// EXPORTS //
module.exports = toJSON;
},{"./type.js":19,"@stdlib/assert/is-typed-array":165}],19:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var instanceOf = require( '@stdlib/assert/instance-of' );
var ctorName = require( '@stdlib/utils/constructor-name' );
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var CTORS = require( './ctors.js' );
// MAIN //
/**
* Returns the typed array type.
*
* @private
* @param {TypedArray} arr - typed array
* @returns {(string|void)} typed array type
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var arr = new Float64Array( 5 );
* var str = typeName( arr );
* // returns 'Float64Array'
*/
function typeName( arr ) {
var v;
var i;
// Check for typed array objects from the same realm (same Node.js `vm` or same `Window` object)...
for ( i = 0; i < CTORS.length; i++ ) {
if ( instanceOf( arr, CTORS[ i ][ 0 ] ) ) {
return CTORS[ i ][ 1 ];
}
}
// Walk the prototype tree until we find an object having a desired native class...
while ( arr ) {
v = ctorName( arr );
for ( i = 0; i < CTORS.length; i++ ) {
if ( v === CTORS[ i ][ 1 ] ) {
return CTORS[ i ][ 1 ];
}
}
arr = getPrototypeOf( arr );
}
}
// EXPORTS //
module.exports = typeName;
},{"./ctors.js":16,"@stdlib/assert/instance-of":71,"@stdlib/utils/constructor-name":351,"@stdlib/utils/get-prototype-of":374}],20:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.
*
* @module @stdlib/array/uint16
*
* @example
* var ctor = require( '@stdlib/array/uint16' );
*
* var arr = new ctor( 10 );
* // returns <Uint16Array>
*/
// MODULES //
var hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' );
var builtin = require( './uint16array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasUint16ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./polyfill.js":21,"./uint16array.js":22,"@stdlib/assert/has-uint16array-support":59}],21:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of 16-bit unsigned integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],22:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var ctor = ( typeof Uint16Array === 'function' ) ? Uint16Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],23:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.
*
* @module @stdlib/array/uint32
*
* @example
* var ctor = require( '@stdlib/array/uint32' );
*
* var arr = new ctor( 10 );
* // returns <Uint32Array>
*/
// MODULES //
var hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' );
var builtin = require( './uint32array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasUint32ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./polyfill.js":24,"./uint32array.js":25,"@stdlib/assert/has-uint32array-support":62}],24:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of 32-bit unsigned integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],25:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var ctor = ( typeof Uint32Array === 'function' ) ? Uint32Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],26:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order.
*
* @module @stdlib/array/uint8
*
* @example
* var ctor = require( '@stdlib/array/uint8' );
*
* var arr = new ctor( 10 );
* // returns <Uint8Array>
*/
// MODULES //
var hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' );
var builtin = require( './uint8array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasUint8ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./polyfill.js":27,"./uint8array.js":28,"@stdlib/assert/has-uint8array-support":65}],27:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of 8-bit unsigned integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],28:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var ctor = ( typeof Uint8Array === 'function' ) ? Uint8Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],29:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.
*
* @module @stdlib/array/uint8c
*
* @example
* var ctor = require( '@stdlib/array/uint8c' );
*
* var arr = new ctor( 10 );
* // returns <Uint8ClampedArray>
*/
// MODULES //
var hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' ); // eslint-disable-line id-length
var builtin = require( './uint8clampedarray.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasUint8ClampedArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./polyfill.js":30,"./uint8clampedarray.js":31,"@stdlib/assert/has-uint8clampedarray-support":68}],30:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],31:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var ctor = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],32:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var main = ( typeof Float32Array === 'function' ) ? Float32Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],33:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native `Float32Array` support.
*
* @module @stdlib/assert/has-float32array-support
*
* @example
* var hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' );
*
* var bool = hasFloat32ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasFloat32ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasFloat32ArraySupport;
},{"./main.js":34}],34:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isFloat32Array = require( '@stdlib/assert/is-float32array' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var GlobalFloat32Array = require( './float32array.js' );
// MAIN //
/**
* Tests for native `Float32Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Float32Array` support
*
* @example
* var bool = hasFloat32ArraySupport();
* // returns <boolean>
*/
function hasFloat32ArraySupport() {
var bool;
var arr;
if ( typeof GlobalFloat32Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalFloat32Array( [ 1.0, 3.14, -3.14, 5.0e40 ] );
bool = (
isFloat32Array( arr ) &&
arr[ 0 ] === 1.0 &&
arr[ 1 ] === 3.140000104904175 &&
arr[ 2 ] === -3.140000104904175 &&
arr[ 3 ] === PINF
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasFloat32ArraySupport;
},{"./float32array.js":32,"@stdlib/assert/is-float32array":98,"@stdlib/constants/float64/pinf":242}],35:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var main = ( typeof Float64Array === 'function' ) ? Float64Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],36:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native `Float64Array` support.
*
* @module @stdlib/assert/has-float64array-support
*
* @example
* var hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' );
*
* var bool = hasFloat64ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasFloat64ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasFloat64ArraySupport;
},{"./main.js":37}],37:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isFloat64Array = require( '@stdlib/assert/is-float64array' );
var GlobalFloat64Array = require( './float64array.js' );
// MAIN //
/**
* Tests for native `Float64Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Float64Array` support
*
* @example
* var bool = hasFloat64ArraySupport();
* // returns <boolean>
*/
function hasFloat64ArraySupport() {
var bool;
var arr;
if ( typeof GlobalFloat64Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalFloat64Array( [ 1.0, 3.14, -3.14, NaN ] );
bool = (
isFloat64Array( arr ) &&
arr[ 0 ] === 1.0 &&
arr[ 1 ] === 3.14 &&
arr[ 2 ] === -3.14 &&
arr[ 3 ] !== arr[ 3 ]
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasFloat64ArraySupport;
},{"./float64array.js":35,"@stdlib/assert/is-float64array":100}],38:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Dummy function.
*
* @private
*/
function foo() {
// No-op...
}
// EXPORTS //
module.exports = foo;
},{}],39:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native function `name` support.
*
* @module @stdlib/assert/has-function-name-support
*
* @example
* var hasFunctionNameSupport = require( '@stdlib/assert/has-function-name-support' );
*
* var bool = hasFunctionNameSupport();
* // returns <boolean>
*/
// MODULES //
var hasFunctionNameSupport = require( './main.js' );
// EXPORTS //
module.exports = hasFunctionNameSupport;
},{"./main.js":40}],40:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var foo = require( './foo.js' );
// MAIN //
/**
* Tests for native function `name` support.
*
* @returns {boolean} boolean indicating if an environment has function `name` support
*
* @example
* var bool = hasFunctionNameSupport();
* // returns <boolean>
*/
function hasFunctionNameSupport() {
return ( foo.name === 'foo' );
}
// EXPORTS //
module.exports = hasFunctionNameSupport;
},{"./foo.js":38}],41:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native `Int16Array` support.
*
* @module @stdlib/assert/has-int16array-support
*
* @example
* var hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' );
*
* var bool = hasInt16ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasInt16ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasInt16ArraySupport;
},{"./main.js":43}],42:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var main = ( typeof Int16Array === 'function' ) ? Int16Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],43:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isInt16Array = require( '@stdlib/assert/is-int16array' );
var INT16_MAX = require( '@stdlib/constants/int16/max' );
var INT16_MIN = require( '@stdlib/constants/int16/min' );
var GlobalInt16Array = require( './int16array.js' );
// MAIN //
/**
* Tests for native `Int16Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Int16Array` support
*
* @example
* var bool = hasInt16ArraySupport();
* // returns <boolean>
*/
function hasInt16ArraySupport() {
var bool;
var arr;
if ( typeof GlobalInt16Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalInt16Array( [ 1, 3.14, -3.14, INT16_MAX+1 ] );
bool = (
isInt16Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === -3 && // truncation
arr[ 3 ] === INT16_MIN // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasInt16ArraySupport;
},{"./int16array.js":42,"@stdlib/assert/is-int16array":104,"@stdlib/constants/int16/max":243,"@stdlib/constants/int16/min":244}],44:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native `Int32Array` support.
*
* @module @stdlib/assert/has-int32array-support
*
* @example
* var hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' );
*
* var bool = hasInt32ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasInt32ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasInt32ArraySupport;
},{"./main.js":46}],45:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var main = ( typeof Int32Array === 'function' ) ? Int32Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],46:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isInt32Array = require( '@stdlib/assert/is-int32array' );
var INT32_MAX = require( '@stdlib/constants/int32/max' );
var INT32_MIN = require( '@stdlib/constants/int32/min' );
var GlobalInt32Array = require( './int32array.js' );
// MAIN //
/**
* Tests for native `Int32Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Int32Array` support
*
* @example
* var bool = hasInt32ArraySupport();
* // returns <boolean>
*/
function hasInt32ArraySupport() {
var bool;
var arr;
if ( typeof GlobalInt32Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalInt32Array( [ 1, 3.14, -3.14, INT32_MAX+1 ] );
bool = (
isInt32Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === -3 && // truncation
arr[ 3 ] === INT32_MIN // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasInt32ArraySupport;
},{"./int32array.js":45,"@stdlib/assert/is-int32array":106,"@stdlib/constants/int32/max":245,"@stdlib/constants/int32/min":246}],47:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native `Int8Array` support.
*
* @module @stdlib/assert/has-int8array-support
*
* @example
* var hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' );
*
* var bool = hasInt8ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasInt8ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasInt8ArraySupport;
},{"./main.js":49}],48:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var main = ( typeof Int8Array === 'function' ) ? Int8Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],49:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isInt8Array = require( '@stdlib/assert/is-int8array' );
var INT8_MAX = require( '@stdlib/constants/int8/max' );
var INT8_MIN = require( '@stdlib/constants/int8/min' );
var GlobalInt8Array = require( './int8array.js' );
// MAIN //
/**
* Tests for native `Int8Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Int8Array` support
*
* @example
* var bool = hasInt8ArraySupport();
* // returns <boolean>
*/
function hasInt8ArraySupport() {
var bool;
var arr;
if ( typeof GlobalInt8Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalInt8Array( [ 1, 3.14, -3.14, INT8_MAX+1 ] );
bool = (
isInt8Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === -3 && // truncation
arr[ 3 ] === INT8_MIN // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasInt8ArraySupport;
},{"./int8array.js":48,"@stdlib/assert/is-int8array":108,"@stdlib/constants/int8/max":247,"@stdlib/constants/int8/min":248}],50:[function(require,module,exports){
(function (Buffer){(function (){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var main = ( typeof Buffer === 'function' ) ? Buffer : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
}).call(this)}).call(this,require("buffer").Buffer)
},{"buffer":441}],51:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native `Buffer` support.
*
* @module @stdlib/assert/has-node-buffer-support
*
* @example
* var hasNodeBufferSupport = require( '@stdlib/assert/has-node-buffer-support' );
*
* var bool = hasNodeBufferSupport();
* // returns <boolean>
*/
// MODULES //
var hasNodeBufferSupport = require( './main.js' );
// EXPORTS //
module.exports = hasNodeBufferSupport;
},{"./main.js":52}],52:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isBuffer = require( '@stdlib/assert/is-buffer' );
var GlobalBuffer = require( './buffer.js' );
// MAIN //
/**
* Tests for native `Buffer` support.
*
* @returns {boolean} boolean indicating if an environment has `Buffer` support
*
* @example
* var bool = hasNodeBufferSupport();
* // returns <boolean>
*/
function hasNodeBufferSupport() {
var bool;
var b;
if ( typeof GlobalBuffer !== 'function' ) {
return false;
}
// Test basic support...
try {
if ( typeof GlobalBuffer.from === 'function' ) {
b = GlobalBuffer.from( [ 1, 2, 3, 4 ] );
} else {
b = new GlobalBuffer( [ 1, 2, 3, 4 ] ); // Note: this is deprecated behavior starting in Node v6 (see https://nodejs.org/api/buffer.html#buffer_new_buffer_array)
}
bool = (
isBuffer( b ) &&
b[ 0 ] === 1 &&
b[ 1 ] === 2 &&
b[ 2 ] === 3 &&
b[ 3 ] === 4
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasNodeBufferSupport;
},{"./buffer.js":50,"@stdlib/assert/is-buffer":88}],53:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test whether an object has a specified property.
*
* @module @stdlib/assert/has-own-property
*
* @example
* var hasOwnProp = require( '@stdlib/assert/has-own-property' );
*
* var beep = {
* 'boop': true
* };
*
* var bool = hasOwnProp( beep, 'boop' );
* // returns true
*
* bool = hasOwnProp( beep, 'bop' );
* // returns false
*/
// MODULES //
var hasOwnProp = require( './main.js' );
// EXPORTS //
module.exports = hasOwnProp;
},{"./main.js":54}],54:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// FUNCTIONS //
var has = Object.prototype.hasOwnProperty;
// MAIN //
/**
* Tests if an object has a specified property.
*
* @param {*} value - value to test
* @param {*} property - property to test
* @returns {boolean} boolean indicating if an object has a specified property
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = hasOwnProp( beep, 'boop' );
* // returns true
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = hasOwnProp( beep, 'bap' );
* // returns false
*/
function hasOwnProp( value, property ) {
if (
value === void 0 ||
value === null
) {
return false;
}
return has.call( value, property );
}
// EXPORTS //
module.exports = hasOwnProp;
},{}],55:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native `Symbol` support.
*
* @module @stdlib/assert/has-symbol-support
*
* @example
* var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' );
*
* var bool = hasSymbolSupport();
* // returns <boolean>
*/
// MODULES //
var hasSymbolSupport = require( './main.js' );
// EXPORTS //
module.exports = hasSymbolSupport;
},{"./main.js":56}],56:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Tests for native `Symbol` support.
*
* @returns {boolean} boolean indicating if an environment has `Symbol` support
*
* @example
* var bool = hasSymbolSupport();
* // returns <boolean>
*/
function hasSymbolSupport() {
return (
typeof Symbol === 'function' &&
typeof Symbol( 'foo' ) === 'symbol'
);
}
// EXPORTS //
module.exports = hasSymbolSupport;
},{}],57:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native `toStringTag` support.
*
* @module @stdlib/assert/has-tostringtag-support
*
* @example
* var hasToStringTagSupport = require( '@stdlib/assert/has-tostringtag-support' );
*
* var bool = hasToStringTagSupport();
* // returns <boolean>
*/
// MODULES //
var hasToStringTagSupport = require( './main.js' );
// EXPORTS //
module.exports = hasToStringTagSupport;
},{"./main.js":58}],58:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasSymbols = require( '@stdlib/assert/has-symbol-support' );
// VARIABLES //
var FLG = hasSymbols();
// MAIN //
/**
* Tests for native `toStringTag` support.
*
* @returns {boolean} boolean indicating if an environment has `toStringTag` support
*
* @example
* var bool = hasToStringTagSupport();
* // returns <boolean>
*/
function hasToStringTagSupport() {
return ( FLG && typeof Symbol.toStringTag === 'symbol' );
}
// EXPORTS //
module.exports = hasToStringTagSupport;
},{"@stdlib/assert/has-symbol-support":55}],59:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native `Uint16Array` support.
*
* @module @stdlib/assert/has-uint16array-support
*
* @example
* var hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' );
*
* var bool = hasUint16ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasUint16ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasUint16ArraySupport;
},{"./main.js":60}],60:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isUint16Array = require( '@stdlib/assert/is-uint16array' );
var UINT16_MAX = require( '@stdlib/constants/uint16/max' );
var GlobalUint16Array = require( './uint16array.js' );
// MAIN //
/**
* Tests for native `Uint16Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Uint16Array` support
*
* @example
* var bool = hasUint16ArraySupport();
* // returns <boolean>
*/
function hasUint16ArraySupport() {
var bool;
var arr;
if ( typeof GlobalUint16Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = [ 1, 3.14, -3.14, UINT16_MAX+1, UINT16_MAX+2 ];
arr = new GlobalUint16Array( arr );
bool = (
isUint16Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === UINT16_MAX-2 && // truncation and wrap around
arr[ 3 ] === 0 && // wrap around
arr[ 4 ] === 1 // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasUint16ArraySupport;
},{"./uint16array.js":61,"@stdlib/assert/is-uint16array":168,"@stdlib/constants/uint16/max":249}],61:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var main = ( typeof Uint16Array === 'function' ) ? Uint16Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],62:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native `Uint32Array` support.
*
* @module @stdlib/assert/has-uint32array-support
*
* @example
* var hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' );
*
* var bool = hasUint32ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasUint32ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasUint32ArraySupport;
},{"./main.js":63}],63:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isUint32Array = require( '@stdlib/assert/is-uint32array' );
var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
var GlobalUint32Array = require( './uint32array.js' );
// MAIN //
/**
* Tests for native `Uint32Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Uint32Array` support
*
* @example
* var bool = hasUint32ArraySupport();
* // returns <boolean>
*/
function hasUint32ArraySupport() {
var bool;
var arr;
if ( typeof GlobalUint32Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = [ 1, 3.14, -3.14, UINT32_MAX+1, UINT32_MAX+2 ];
arr = new GlobalUint32Array( arr );
bool = (
isUint32Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === UINT32_MAX-2 && // truncation and wrap around
arr[ 3 ] === 0 && // wrap around
arr[ 4 ] === 1 // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasUint32ArraySupport;
},{"./uint32array.js":64,"@stdlib/assert/is-uint32array":170,"@stdlib/constants/uint32/max":250}],64:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var main = ( typeof Uint32Array === 'function' ) ? Uint32Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],65:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native `Uint8Array` support.
*
* @module @stdlib/assert/has-uint8array-support
*
* @example
* var hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' );
*
* var bool = hasUint8ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasUint8ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasUint8ArraySupport;
},{"./main.js":66}],66:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isUint8Array = require( '@stdlib/assert/is-uint8array' );
var UINT8_MAX = require( '@stdlib/constants/uint8/max' );
var GlobalUint8Array = require( './uint8array.js' );
// MAIN //
/**
* Tests for native `Uint8Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Uint8Array` support
*
* @example
* var bool = hasUint8ArraySupport();
* // returns <boolean>
*/
function hasUint8ArraySupport() {
var bool;
var arr;
if ( typeof GlobalUint8Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = [ 1, 3.14, -3.14, UINT8_MAX+1, UINT8_MAX+2 ];
arr = new GlobalUint8Array( arr );
bool = (
isUint8Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === UINT8_MAX-2 && // truncation and wrap around
arr[ 3 ] === 0 && // wrap around
arr[ 4 ] === 1 // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasUint8ArraySupport;
},{"./uint8array.js":67,"@stdlib/assert/is-uint8array":172,"@stdlib/constants/uint8/max":251}],67:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var main = ( typeof Uint8Array === 'function' ) ? Uint8Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],68:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test for native `Uint8ClampedArray` support.
*
* @module @stdlib/assert/has-uint8clampedarray-support
*
* @example
* var hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' );
*
* var bool = hasUint8ClampedArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasUint8ClampedArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasUint8ClampedArraySupport;
},{"./main.js":69}],69:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' );
var GlobalUint8ClampedArray = require( './uint8clampedarray.js' );
// MAIN //
/**
* Tests for native `Uint8ClampedArray` support.
*
* @returns {boolean} boolean indicating if an environment has `Uint8ClampedArray` support
*
* @example
* var bool = hasUint8ClampedArraySupport();
* // returns <boolean>
*/
function hasUint8ClampedArraySupport() { // eslint-disable-line id-length
var bool;
var arr;
if ( typeof GlobalUint8ClampedArray !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalUint8ClampedArray( [ -1, 0, 1, 3.14, 4.99, 255, 256 ] );
bool = (
isUint8ClampedArray( arr ) &&
arr[ 0 ] === 0 && // clamped
arr[ 1 ] === 0 &&
arr[ 2 ] === 1 &&
arr[ 3 ] === 3 && // round to nearest
arr[ 4 ] === 5 && // round to nearest
arr[ 5 ] === 255 &&
arr[ 6 ] === 255 // clamped
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasUint8ClampedArraySupport;
},{"./uint8clampedarray.js":70,"@stdlib/assert/is-uint8clampedarray":174}],70:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var main = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],71:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test whether a value has in its prototype chain a specified constructor as a prototype property.
*
* @module @stdlib/assert/instance-of
*
* @example
* var instanceOf = require( '@stdlib/assert/instance-of' );
*
* var bool = instanceOf( [], Array );
* // returns true
*
* bool = instanceOf( {}, Object ); // exception
* // returns true
*
* bool = instanceOf( 'beep', String );
* // returns false
*
* bool = instanceOf( null, Object );
* // returns false
*
* bool = instanceOf( 5, Object );
* // returns false
*/
// MODULES //
var instanceOf = require( './main.js' );
// EXPORTS //
module.exports = instanceOf;
},{"./main.js":72}],72:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Tests whether a value has in its prototype chain a specified constructor as a prototype property.
*
* @param {*} value - value to test
* @param {Function} constructor - constructor to test against
* @throws {TypeError} constructor must be callable
* @returns {boolean} boolean indicating whether a value is an instance of a provided constructor
*
* @example
* var bool = instanceOf( [], Array );
* // returns true
*
* @example
* var bool = instanceOf( {}, Object ); // exception
* // returns true
*
* @example
* var bool = instanceOf( 'beep', String );
* // returns false
*
* @example
* var bool = instanceOf( null, Object );
* // returns false
*
* @example
* var bool = instanceOf( 5, Object );
* // returns false
*/
function instanceOf( value, constructor ) {
// TODO: replace with `isCallable` check
if ( typeof constructor !== 'function' ) {
throw new TypeError( 'invalid argument. `constructor` argument must be callable. Value: `'+constructor+'`.' );
}
return ( value instanceof constructor );
}
// EXPORTS //
module.exports = instanceOf;
},{}],73:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isArguments = require( './main.js' );
// VARIABLES //
var bool;
// FUNCTIONS //
/**
* Detects whether an environment returns the expected internal class of the `arguments` object.
*
* @private
* @returns {boolean} boolean indicating whether an environment behaves as expected
*
* @example
* var bool = detect();
* // returns <boolean>
*/
function detect() {
return isArguments( arguments );
}
// MAIN //
bool = detect();
// EXPORTS //
module.exports = bool;
},{"./main.js":75}],74:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is an `arguments` object.
*
* @module @stdlib/assert/is-arguments
*
* @example
* var isArguments = require( '@stdlib/assert/is-arguments' );
*
* function foo() {
* return arguments;
* }
*
* var bool = isArguments( foo() );
* // returns true
*
* bool = isArguments( [] );
* // returns false
*/
// MODULES //
var hasArgumentsClass = require( './detect.js' );
var main = require( './main.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var isArguments;
if ( hasArgumentsClass ) {
isArguments = main;
} else {
isArguments = polyfill;
}
// EXPORTS //
module.exports = isArguments;
},{"./detect.js":73,"./main.js":75,"./polyfill.js":76}],75:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// MAIN //
/**
* Tests whether a value is an `arguments` object.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an `arguments` object
*
* @example
* function foo() {
* return arguments;
* }
*
* var bool = isArguments( foo() );
* // returns true
*
* @example
* var bool = isArguments( [] );
* // returns false
*/
function isArguments( value ) {
return ( nativeClass( value ) === '[object Arguments]' );
}
// EXPORTS //
module.exports = isArguments;
},{"@stdlib/utils/native-class":408}],76:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );
var isArray = require( '@stdlib/assert/is-array' );
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var MAX_LENGTH = require( '@stdlib/constants/uint32/max' );
// MAIN //
/**
* Tests whether a value is an `arguments` object.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an `arguments` object
*
* @example
* function foo() {
* return arguments;
* }
*
* var bool = isArguments( foo() );
* // returns true
*
* @example
* var bool = isArguments( [] );
* // returns false
*/
function isArguments( value ) {
return (
value !== null &&
typeof value === 'object' &&
!isArray( value ) &&
typeof value.length === 'number' &&
isInteger( value.length ) &&
value.length >= 0 &&
value.length <= MAX_LENGTH &&
hasOwnProp( value, 'callee' ) &&
!isEnumerableProperty( value, 'callee' )
);
}
// EXPORTS //
module.exports = isArguments;
},{"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-array":79,"@stdlib/assert/is-enumerable-property":93,"@stdlib/constants/uint32/max":250,"@stdlib/math/base/assert/is-integer":254}],77:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is array-like.
*
* @module @stdlib/assert/is-array-like
*
* @example
* var isArrayLike = require( '@stdlib/assert/is-array-like' );
*
* var bool = isArrayLike( [] );
* // returns true
*
* bool = isArrayLike( { 'length': 10 } );
* // returns true
*
* bool = isArrayLike( 'beep' );
* // returns true
*/
// MODULES //
var isArrayLike = require( './main.js' );
// EXPORTS //
module.exports = isArrayLike;
},{"./main.js":78}],78:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var MAX_LENGTH = require( '@stdlib/constants/array/max-array-length' );
// MAIN //
/**
* Tests if a value is array-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is array-like
*
* @example
* var bool = isArrayLike( [] );
* // returns true
*
* @example
* var bool = isArrayLike( {'length':10} );
* // returns true
*/
function isArrayLike( value ) {
return (
value !== void 0 &&
value !== null &&
typeof value !== 'function' &&
typeof value.length === 'number' &&
isInteger( value.length ) &&
value.length >= 0 &&
value.length <= MAX_LENGTH
);
}
// EXPORTS //
module.exports = isArrayLike;
},{"@stdlib/constants/array/max-array-length":235,"@stdlib/math/base/assert/is-integer":254}],79:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is an array.
*
* @module @stdlib/assert/is-array
*
* @example
* var isArray = require( '@stdlib/assert/is-array' );
*
* var bool = isArray( [] );
* // returns true
*
* bool = isArray( {} );
* // returns false
*/
// MODULES //
var isArray = require( './main.js' );
// EXPORTS //
module.exports = isArray;
},{"./main.js":80}],80:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var f;
// FUNCTIONS //
/**
* Tests if a value is an array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an array
*
* @example
* var bool = isArray( [] );
* // returns true
*
* @example
* var bool = isArray( {} );
* // returns false
*/
function isArray( value ) {
return ( nativeClass( value ) === '[object Array]' );
}
// MAIN //
if ( Array.isArray ) {
f = Array.isArray;
} else {
f = isArray;
}
// EXPORTS //
module.exports = f;
},{"@stdlib/utils/native-class":408}],81:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a boolean.
*
* @module @stdlib/assert/is-boolean
*
* @example
* var isBoolean = require( '@stdlib/assert/is-boolean' );
*
* var bool = isBoolean( false );
* // returns true
*
* bool = isBoolean( new Boolean( false ) );
* // returns true
*
* @example
* // Use interface to check for boolean primitives...
* var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
*
* var bool = isBoolean( false );
* // returns true
*
* bool = isBoolean( new Boolean( true ) );
* // returns false
*
* @example
* // Use interface to check for boolean objects...
* var isBoolean = require( '@stdlib/assert/is-boolean' ).isObject;
*
* var bool = isBoolean( true );
* // returns false
*
* bool = isBoolean( new Boolean( false ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isBoolean = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isBoolean, 'isPrimitive', isPrimitive );
setReadOnly( isBoolean, 'isObject', isObject );
// EXPORTS //
module.exports = isBoolean;
},{"./main.js":82,"./object.js":83,"./primitive.js":84,"@stdlib/utils/define-nonenumerable-read-only-property":359}],82:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a boolean.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a boolean
*
* @example
* var bool = isBoolean( false );
* // returns true
*
* @example
* var bool = isBoolean( true );
* // returns true
*
* @example
* var bool = isBoolean( new Boolean( false ) );
* // returns true
*
* @example
* var bool = isBoolean( new Boolean( true ) );
* // returns true
*/
function isBoolean( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isBoolean;
},{"./object.js":83,"./primitive.js":84}],83:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var nativeClass = require( '@stdlib/utils/native-class' );
var test = require( './try2serialize.js' );
// VARIABLES //
var FLG = hasToStringTag();
// MAIN //
/**
* Tests if a value is a boolean object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a boolean object
*
* @example
* var bool = isBoolean( true );
* // returns false
*
* @example
* var bool = isBoolean( new Boolean( false ) );
* // returns true
*/
function isBoolean( value ) {
if ( typeof value === 'object' ) {
if ( value instanceof Boolean ) {
return true;
}
if ( FLG ) {
return test( value );
}
return ( nativeClass( value ) === '[object Boolean]' );
}
return false;
}
// EXPORTS //
module.exports = isBoolean;
},{"./try2serialize.js":86,"@stdlib/assert/has-tostringtag-support":57,"@stdlib/utils/native-class":408}],84:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Tests if a value is a boolean primitive.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a boolean primitive
*
* @example
* var bool = isBoolean( true );
* // returns true
*
* @example
* var bool = isBoolean( false );
* // returns true
*
* @example
* var bool = isBoolean( new Boolean( true ) );
* // returns false
*/
function isBoolean( value ) {
return ( typeof value === 'boolean' );
}
// EXPORTS //
module.exports = isBoolean;
},{}],85:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// eslint-disable-next-line stdlib/no-redeclare
var toString = Boolean.prototype.toString; // non-generic
// EXPORTS //
module.exports = toString;
},{}],86:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var toString = require( './tostring.js' ); // eslint-disable-line stdlib/no-redeclare
// MAIN //
/**
* Attempts to serialize a value to a string.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value can be serialized
*/
function test( value ) {
try {
toString.call( value );
return true;
} catch ( err ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = test;
},{"./tostring.js":85}],87:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// EXPORTS //
module.exports = true;
},{}],88:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a Buffer instance.
*
* @module @stdlib/assert/is-buffer
*
* @example
* var isBuffer = require( '@stdlib/assert/is-buffer' );
*
* var v = isBuffer( new Buffer( 'beep' ) );
* // returns true
*
* v = isBuffer( {} );
* // returns false
*/
// MODULES //
var isBuffer = require( './main.js' );
// EXPORTS //
module.exports = isBuffer;
},{"./main.js":89}],89:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isObjectLike = require( '@stdlib/assert/is-object-like' );
// MAIN //
/**
* Tests if a value is a Buffer instance.
*
* @param {*} value - value to validate
* @returns {boolean} boolean indicating if a value is a Buffer instance
*
* @example
* var v = isBuffer( new Buffer( 'beep' ) );
* // returns true
*
* @example
* var v = isBuffer( new Buffer( [1,2,3,4] ) );
* // returns true
*
* @example
* var v = isBuffer( {} );
* // returns false
*
* @example
* var v = isBuffer( [] );
* // returns false
*/
function isBuffer( value ) {
return (
isObjectLike( value ) &&
(
// eslint-disable-next-line no-underscore-dangle
value._isBuffer || // for envs missing Object.prototype.constructor (e.g., Safari 5-7)
(
value.constructor &&
// WARNING: `typeof` is not a foolproof check, as certain envs consider RegExp and NodeList instances to be functions
typeof value.constructor.isBuffer === 'function' &&
value.constructor.isBuffer( value )
)
)
);
}
// EXPORTS //
module.exports = isBuffer;
},{"@stdlib/assert/is-object-like":143}],90:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a collection.
*
* @module @stdlib/assert/is-collection
*
* @example
* var isCollection = require( '@stdlib/assert/is-collection' );
*
* var bool = isCollection( [] );
* // returns true
*
* bool = isCollection( {} );
* // returns false
*/
// MODULES //
var isCollection = require( './main.js' );
// EXPORTS //
module.exports = isCollection;
},{"./main.js":91}],91:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var MAX_LENGTH = require( '@stdlib/constants/array/max-typed-array-length' );
// MAIN //
/**
* Tests if a value is a collection.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is a collection
*
* @example
* var bool = isCollection( [] );
* // returns true
*
* @example
* var bool = isCollection( {} );
* // returns false
*/
function isCollection( value ) {
return (
typeof value === 'object' &&
value !== null &&
typeof value.length === 'number' &&
isInteger( value.length ) &&
value.length >= 0 &&
value.length <= MAX_LENGTH
);
}
// EXPORTS //
module.exports = isCollection;
},{"@stdlib/constants/array/max-typed-array-length":236,"@stdlib/math/base/assert/is-integer":254}],92:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isEnum = require( './native.js' );
// VARIABLES //
var bool;
// FUNCTIONS //
/**
* Detects whether an environment has a bug where String indices are not detected as "enumerable" properties. Observed in Node v0.10.
*
* @private
* @returns {boolean} boolean indicating whether an environment has the bug
*/
function detect() {
return !isEnum.call( 'beep', '0' );
}
// MAIN //
bool = detect();
// EXPORTS //
module.exports = bool;
},{"./native.js":95}],93:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test whether an object's own property is enumerable.
*
* @module @stdlib/assert/is-enumerable-property
*
* @example
* var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );
*
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'boop' );
* // returns true
*
* bool = isEnumerableProperty( beep, 'hasOwnProperty' );
* // returns false
*/
// MODULES //
var isEnumerableProperty = require( './main.js' );
// EXPORTS //
module.exports = isEnumerableProperty;
},{"./main.js":94}],94:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' );
var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive;
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
var isEnum = require( './native.js' );
var hasStringEnumBug = require( './has_string_enumerability_bug.js' );
// MAIN //
/**
* Tests if an object's own property is enumerable.
*
* @param {*} value - value to test
* @param {*} property - property to test
* @returns {boolean} boolean indicating if an object property is enumerable
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'boop' );
* // returns true
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'hasOwnProperty' );
* // returns false
*/
function isEnumerableProperty( value, property ) {
var bool;
if (
value === void 0 ||
value === null
) {
return false;
}
bool = isEnum.call( value, property );
if ( !bool && hasStringEnumBug && isString( value ) ) {
// Note: we only check for indices, as properties attached to a `String` object are properly detected as enumerable above.
property = +property;
return (
!isnan( property ) &&
isInteger( property ) &&
property >= 0 &&
property < value.length
);
}
return bool;
}
// EXPORTS //
module.exports = isEnumerableProperty;
},{"./has_string_enumerability_bug.js":92,"./native.js":95,"@stdlib/assert/is-integer":110,"@stdlib/assert/is-nan":118,"@stdlib/assert/is-string":158}],95:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Tests if an object's own property is enumerable.
*
* @private
* @name isEnumerableProperty
* @type {Function}
* @param {*} value - value to test
* @param {*} property - property to test
* @returns {boolean} boolean indicating if an object property is enumerable
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'boop' );
* // returns true
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'hasOwnProperty' );
* // returns false
*/
var isEnumerableProperty = Object.prototype.propertyIsEnumerable;
// EXPORTS //
module.exports = isEnumerableProperty;
},{}],96:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is an `Error` object.
*
* @module @stdlib/assert/is-error
*
* @example
* var isError = require( '@stdlib/assert/is-error' );
*
* var bool = isError( new Error( 'beep' ) );
* // returns true
*
* bool = isError( {} );
* // returns false
*/
// MODULES //
var isError = require( './main.js' );
// EXPORTS //
module.exports = isError;
},{"./main.js":97}],97:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var nativeClass = require( '@stdlib/utils/native-class' );
// MAIN //
/**
* Tests if a value is an `Error` object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an `Error` object
*
* @example
* var bool = isError( new Error( 'beep' ) );
* // returns true
*
* @example
* var bool = isError( {} );
* // returns false
*/
function isError( value ) {
if ( typeof value !== 'object' || value === null ) {
return false;
}
// Check for `Error` objects from the same realm (same Node.js `vm` or same `Window` object)...
if ( value instanceof Error ) {
return true;
}
// Walk the prototype tree until we find an object having the desired native class...
while ( value ) {
if ( nativeClass( value ) === '[object Error]' ) {
return true;
}
value = getPrototypeOf( value );
}
return false;
}
// EXPORTS //
module.exports = isError;
},{"@stdlib/utils/get-prototype-of":374,"@stdlib/utils/native-class":408}],98:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a Float32Array.
*
* @module @stdlib/assert/is-float32array
*
* @example
* var isFloat32Array = require( '@stdlib/assert/is-float32array' );
*
* var bool = isFloat32Array( new Float32Array( 10 ) );
* // returns true
*
* bool = isFloat32Array( [] );
* // returns false
*/
// MODULES //
var isFloat32Array = require( './main.js' );
// EXPORTS //
module.exports = isFloat32Array;
},{"./main.js":99}],99:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasFloat32Array = ( typeof Float32Array === 'function' );// eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Float32Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Float32Array
*
* @example
* var bool = isFloat32Array( new Float32Array( 10 ) );
* // returns true
*
* @example
* var bool = isFloat32Array( [] );
* // returns false
*/
function isFloat32Array( value ) {
return (
( hasFloat32Array && value instanceof Float32Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Float32Array]'
);
}
// EXPORTS //
module.exports = isFloat32Array;
},{"@stdlib/utils/native-class":408}],100:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a Float64Array.
*
* @module @stdlib/assert/is-float64array
*
* @example
* var isFloat64Array = require( '@stdlib/assert/is-float64array' );
*
* var bool = isFloat64Array( new Float64Array( 10 ) );
* // returns true
*
* bool = isFloat64Array( [] );
* // returns false
*/
// MODULES //
var isFloat64Array = require( './main.js' );
// EXPORTS //
module.exports = isFloat64Array;
},{"./main.js":101}],101:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasFloat64Array = ( typeof Float64Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Float64Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Float64Array
*
* @example
* var bool = isFloat64Array( new Float64Array( 10 ) );
* // returns true
*
* @example
* var bool = isFloat64Array( [] );
* // returns false
*/
function isFloat64Array( value ) {
return (
( hasFloat64Array && value instanceof Float64Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Float64Array]'
);
}
// EXPORTS //
module.exports = isFloat64Array;
},{"@stdlib/utils/native-class":408}],102:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a function.
*
* @module @stdlib/assert/is-function
*
* @example
* var isFunction = require( '@stdlib/assert/is-function' );
*
* function beep() {
* return 'beep';
* }
*
* var bool = isFunction( beep );
* // returns true
*/
// MODULES //
var isFunction = require( './main.js' );
// EXPORTS //
module.exports = isFunction;
},{"./main.js":103}],103:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var typeOf = require( '@stdlib/utils/type-of' );
// MAIN //
/**
* Tests if a value is a function.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a function
*
* @example
* function beep() {
* return 'beep';
* }
*
* var bool = isFunction( beep );
* // returns true
*/
function isFunction( value ) {
// Note: cannot use `typeof` directly, as various browser engines incorrectly return `'function'` when operating on non-function objects, such as regular expressions and NodeLists.
return ( typeOf( value ) === 'function' );
}
// EXPORTS //
module.exports = isFunction;
},{"@stdlib/utils/type-of":435}],104:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is an Int16Array.
*
* @module @stdlib/assert/is-int16array
*
* @example
* var isInt16Array = require( '@stdlib/assert/is-int16array' );
*
* var bool = isInt16Array( new Int16Array( 10 ) );
* // returns true
*
* bool = isInt16Array( [] );
* // returns false
*/
// MODULES //
var isInt16Array = require( './main.js' );
// EXPORTS //
module.exports = isInt16Array;
},{"./main.js":105}],105:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasInt16Array = ( typeof Int16Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is an Int16Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an Int16Array
*
* @example
* var bool = isInt16Array( new Int16Array( 10 ) );
* // returns true
*
* @example
* var bool = isInt16Array( [] );
* // returns false
*/
function isInt16Array( value ) {
return (
( hasInt16Array && value instanceof Int16Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Int16Array]'
);
}
// EXPORTS //
module.exports = isInt16Array;
},{"@stdlib/utils/native-class":408}],106:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is an Int32Array.
*
* @module @stdlib/assert/is-int32array
*
* @example
* var isInt32Array = require( '@stdlib/assert/is-int32array' );
*
* var bool = isInt32Array( new Int32Array( 10 ) );
* // returns true
*
* bool = isInt32Array( [] );
* // returns false
*/
// MODULES //
var isInt32Array = require( './main.js' );
// EXPORTS //
module.exports = isInt32Array;
},{"./main.js":107}],107:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasInt32Array = ( typeof Int32Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is an Int32Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an Int32Array
*
* @example
* var bool = isInt32Array( new Int32Array( 10 ) );
* // returns true
*
* @example
* var bool = isInt32Array( [] );
* // returns false
*/
function isInt32Array( value ) {
return (
( hasInt32Array && value instanceof Int32Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Int32Array]'
);
}
// EXPORTS //
module.exports = isInt32Array;
},{"@stdlib/utils/native-class":408}],108:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is an Int8Array.
*
* @module @stdlib/assert/is-int8array
*
* @example
* var isInt8Array = require( '@stdlib/assert/is-int8array' );
*
* var bool = isInt8Array( new Int8Array( 10 ) );
* // returns true
*
* bool = isInt8Array( [] );
* // returns false
*/
// MODULES //
var isInt8Array = require( './main.js' );
// EXPORTS //
module.exports = isInt8Array;
},{"./main.js":109}],109:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasInt8Array = ( typeof Int8Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is an Int8Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an Int8Array
*
* @example
* var bool = isInt8Array( new Int8Array( 10 ) );
* // returns true
*
* @example
* var bool = isInt8Array( [] );
* // returns false
*/
function isInt8Array( value ) {
return (
( hasInt8Array && value instanceof Int8Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Int8Array]'
);
}
// EXPORTS //
module.exports = isInt8Array;
},{"@stdlib/utils/native-class":408}],110:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is an integer.
*
* @module @stdlib/assert/is-integer
*
* @example
* var isInteger = require( '@stdlib/assert/is-integer' );
*
* var bool = isInteger( 5.0 );
* // returns true
*
* bool = isInteger( new Number( 5.0 ) );
* // returns true
*
* bool = isInteger( -3.14 );
* // returns false
*
* bool = isInteger( null );
* // returns false
*
* @example
* // Use interface to check for integer primitives...
* var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
*
* var bool = isInteger( -3.0 );
* // returns true
*
* bool = isInteger( new Number( -3.0 ) );
* // returns false
*
* @example
* // Use interface to check for integer objects...
* var isInteger = require( '@stdlib/assert/is-integer' ).isObject;
*
* var bool = isInteger( 3.0 );
* // returns false
*
* bool = isInteger( new Number( 3.0 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isInteger = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isInteger, 'isPrimitive', isPrimitive );
setReadOnly( isInteger, 'isObject', isObject );
// EXPORTS //
module.exports = isInteger;
},{"./main.js":112,"./object.js":113,"./primitive.js":114,"@stdlib/utils/define-nonenumerable-read-only-property":359}],111:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var isInt = require( '@stdlib/math/base/assert/is-integer' );
// MAIN //
/**
* Tests if a number primitive is an integer value.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a number primitive is an integer value
*/
function isInteger( value ) {
return (
value < PINF &&
value > NINF &&
isInt( value )
);
}
// EXPORTS //
module.exports = isInteger;
},{"@stdlib/constants/float64/ninf":241,"@stdlib/constants/float64/pinf":242,"@stdlib/math/base/assert/is-integer":254}],112:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is an integer.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an integer
*
* @example
* var bool = isInteger( 5.0 );
* // returns true
*
* @example
* var bool = isInteger( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isInteger( -3.14 );
* // returns false
*
* @example
* var bool = isInteger( null );
* // returns false
*/
function isInteger( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isInteger;
},{"./object.js":113,"./primitive.js":114}],113:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isObject;
var isInt = require( './integer.js' );
// MAIN //
/**
* Tests if a value is a number object having an integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having an integer value
*
* @example
* var bool = isInteger( 3.0 );
* // returns false
*
* @example
* var bool = isInteger( new Number( 3.0 ) );
* // returns true
*/
function isInteger( value ) {
return (
isNumber( value ) &&
isInt( value.valueOf() )
);
}
// EXPORTS //
module.exports = isInteger;
},{"./integer.js":111,"@stdlib/assert/is-number":137}],114:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
var isInt = require( './integer.js' );
// MAIN //
/**
* Tests if a value is a number primitive having an integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having an integer value
*
* @example
* var bool = isInteger( -3.0 );
* // returns true
*
* @example
* var bool = isInteger( new Number( -3.0 ) );
* // returns false
*/
function isInteger( value ) {
return (
isNumber( value ) &&
isInt( value )
);
}
// EXPORTS //
module.exports = isInteger;
},{"./integer.js":111,"@stdlib/assert/is-number":137}],115:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var Uint8Array = require( '@stdlib/array/uint8' );
var Uint16Array = require( '@stdlib/array/uint16' );
// MAIN //
var ctors = {
'uint16': Uint16Array,
'uint8': Uint8Array
};
// EXPORTS //
module.exports = ctors;
},{"@stdlib/array/uint16":20,"@stdlib/array/uint8":26}],116:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return a boolean indicating if an environment is little endian.
*
* @module @stdlib/assert/is-little-endian
*
* @example
* var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' );
*
* var bool = IS_LITTLE_ENDIAN;
* // returns <boolean>
*/
// MODULES //
var IS_LITTLE_ENDIAN = require( './main.js' );
// EXPORTS //
module.exports = IS_LITTLE_ENDIAN;
},{"./main.js":117}],117:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var ctors = require( './ctors.js' );
// VARIABLES //
var bool;
// FUNCTIONS //
/**
* Returns a boolean indicating if an environment is little endian.
*
* @private
* @returns {boolean} boolean indicating if an environment is little endian
*
* @example
* var bool = isLittleEndian();
* // returns <boolean>
*/
function isLittleEndian() {
var uint16view;
var uint8view;
uint16view = new ctors[ 'uint16' ]( 1 );
/*
* Set the uint16 view to a value having distinguishable lower and higher order words.
*
* 4660 => 0x1234 => 0x12 0x34 => '00010010 00110100' => (0x12,0x34) == (18,52)
*/
uint16view[ 0 ] = 0x1234;
// Create a uint8 view on top of the uint16 buffer:
uint8view = new ctors[ 'uint8' ]( uint16view.buffer );
// If little endian, the least significant byte will be first...
return ( uint8view[ 0 ] === 0x34 );
}
// MAIN //
bool = isLittleEndian();
// EXPORTS //
module.exports = bool;
},{"./ctors.js":115}],118:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is `NaN`.
*
* @module @stdlib/assert/is-nan
*
* @example
* var isnan = require( '@stdlib/assert/is-nan' );
*
* var bool = isnan( NaN );
* // returns true
*
* bool = isnan( new Number( NaN ) );
* // returns true
*
* bool = isnan( 3.14 );
* // returns false
*
* bool = isnan( null );
* // returns false
*
* @example
* var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive;
*
* var bool = isnan( NaN );
* // returns true
*
* bool = isnan( 3.14 );
* // returns false
*
* bool = isnan( new Number( NaN ) );
* // returns false
*
* @example
* var isnan = require( '@stdlib/assert/is-nan' ).isObject;
*
* var bool = isnan( NaN );
* // returns false
*
* bool = isnan( new Number( NaN ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isnan = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isnan, 'isPrimitive', isPrimitive );
setReadOnly( isnan, 'isObject', isObject );
// EXPORTS //
module.exports = isnan;
},{"./main.js":119,"./object.js":120,"./primitive.js":121,"@stdlib/utils/define-nonenumerable-read-only-property":359}],119:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is `NaN`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is `NaN`
*
* @example
* var bool = isnan( NaN );
* // returns true
*
* @example
* var bool = isnan( new Number( NaN ) );
* // returns true
*
* @example
* var bool = isnan( 3.14 );
* // returns false
*
* @example
* var bool = isnan( null );
* // returns false
*/
function isnan( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isnan;
},{"./object.js":120,"./primitive.js":121}],120:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isObject;
var isNan = require( '@stdlib/math/base/assert/is-nan' );
// MAIN //
/**
* Tests if a value is a number object having a value of `NaN`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a value of `NaN`
*
* @example
* var bool = isnan( NaN );
* // returns false
*
* @example
* var bool = isnan( new Number( NaN ) );
* // returns true
*/
function isnan( value ) {
return (
isNumber( value ) &&
isNan( value.valueOf() )
);
}
// EXPORTS //
module.exports = isnan;
},{"@stdlib/assert/is-number":137,"@stdlib/math/base/assert/is-nan":256}],121:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
var isNan = require( '@stdlib/math/base/assert/is-nan' );
// MAIN //
/**
* Tests if a value is a `NaN` number primitive.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a `NaN` number primitive
*
* @example
* var bool = isnan( NaN );
* // returns true
*
* @example
* var bool = isnan( 3.14 );
* // returns false
*
* @example
* var bool = isnan( new Number( NaN ) );
* // returns false
*/
function isnan( value ) {
return (
isNumber( value ) &&
isNan( value )
);
}
// EXPORTS //
module.exports = isnan;
},{"@stdlib/assert/is-number":137,"@stdlib/math/base/assert/is-nan":256}],122:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is Node stream-like.
*
* @module @stdlib/assert/is-node-stream-like
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
* var isNodeStreamLike = require( '@stdlib/assert/is-node-stream-like' );
*
* var stream = transformStream();
*
* var bool = isNodeStreamLike( stream );
* // returns true
*
* bool = isNodeStreamLike( {} );
* // returns false
*/
// MODULES //
var isNodeStreamLike = require( './main.js' );
// EXPORTS //
module.exports = isNodeStreamLike;
},{"./main.js":123}],123:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Tests if a value is Node stream-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is Node stream-like
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* var stream = transformStream();
*
* var bool = isNodeStreamLike( stream );
* // returns true
*
* bool = isNodeStreamLike( {} );
* // returns false
*/
function isNodeStreamLike( value ) {
return (
// Must be an object:
value !== null &&
typeof value === 'object' &&
// Should be an event emitter:
typeof value.on === 'function' &&
typeof value.once === 'function' &&
typeof value.emit === 'function' &&
typeof value.addListener === 'function' &&
typeof value.removeListener === 'function' &&
typeof value.removeAllListeners === 'function' &&
// Should have a `pipe` method (Node streams inherit from `Stream`, including writable streams):
typeof value.pipe === 'function'
);
}
// EXPORTS //
module.exports = isNodeStreamLike;
},{}],124:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is Node writable stream-like.
*
* @module @stdlib/assert/is-node-writable-stream-like
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
* var isNodeWritableStreamLike = require( '@stdlib/assert/is-node-writable-stream-like' );
*
* var stream = transformStream();
*
* var bool = isNodeWritableStreamLike( stream );
* // returns true
*
* bool = isNodeWritableStreamLike( {} );
* // returns false
*/
// MODULES //
var isNodeWritableStreamLike = require( './main.js' );
// EXPORTS //
module.exports = isNodeWritableStreamLike;
},{"./main.js":125}],125:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
/* eslint-disable no-underscore-dangle */
'use strict';
// MODULES //
var isNodeStreamLike = require( '@stdlib/assert/is-node-stream-like' );
// MAIN //
/**
* Tests if a value is Node writable stream-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is Node writable stream-like
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* var stream = transformStream();
*
* var bool = isNodeWritableStreamLike( stream );
* // returns true
*
* bool = isNodeWritableStreamLike( {} );
* // returns false
*/
function isNodeWritableStreamLike( value ) {
return (
// Must be stream-like:
isNodeStreamLike( value ) &&
// Should have writable stream methods:
typeof value._write === 'function' &&
// Should have writable stream state:
typeof value._writableState === 'object'
);
}
// EXPORTS //
module.exports = isNodeWritableStreamLike;
},{"@stdlib/assert/is-node-stream-like":122}],126:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is an array-like object containing only nonnegative integers.
*
* @module @stdlib/assert/is-nonnegative-integer-array
*
* @example
* var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' );
*
* var bool = isNonNegativeIntegerArray( [ 3.0, new Number(3.0) ] );
* // returns true
*
* bool = isNonNegativeIntegerArray( [ 3.0, '3.0' ] );
* // returns false
*
* @example
* var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).primitives;
*
* var bool = isNonNegativeIntegerArray( [ 1.0, 0.0, 10.0 ] );
* // returns true
*
* bool = isNonNegativeIntegerArray( [ 3.0, new Number(1.0) ] );
* // returns false
*
* @example
* var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).objects;
*
* var bool = isNonNegativeIntegerArray( [ new Number(3.0), new Number(1.0) ] );
* // returns true
*
* bool = isNonNegativeIntegerArray( [ 1.0, 0.0, 10.0 ] );
* // returns false
*/
// MODULES //
var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var arrayfun = require( '@stdlib/assert/tools/array-like-function' );
// MAIN //
var isNonNegativeIntegerArray = arrayfun( isNonNegativeInteger );
setReadOnly( isNonNegativeIntegerArray, 'primitives', arrayfun( isNonNegativeInteger.isPrimitive ) );
setReadOnly( isNonNegativeIntegerArray, 'objects', arrayfun( isNonNegativeInteger.isObject ) );
// EXPORTS //
module.exports = isNonNegativeIntegerArray;
},{"@stdlib/assert/is-nonnegative-integer":127,"@stdlib/assert/tools/array-like-function":179,"@stdlib/utils/define-nonenumerable-read-only-property":359}],127:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a nonnegative integer.
*
* @module @stdlib/assert/is-nonnegative-integer
*
* @example
* var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );
*
* var bool = isNonNegativeInteger( 5.0 );
* // returns true
*
* bool = isNonNegativeInteger( new Number( 5.0 ) );
* // returns true
*
* bool = isNonNegativeInteger( -5.0 );
* // returns false
*
* bool = isNonNegativeInteger( 3.14 );
* // returns false
*
* bool = isNonNegativeInteger( null );
* // returns false
*
* @example
* var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
*
* var bool = isNonNegativeInteger( 3.0 );
* // returns true
*
* bool = isNonNegativeInteger( new Number( 3.0 ) );
* // returns false
*
* @example
* var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isObject;
*
* var bool = isNonNegativeInteger( 3.0 );
* // returns false
*
* bool = isNonNegativeInteger( new Number( 3.0 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isNonNegativeInteger = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isNonNegativeInteger, 'isPrimitive', isPrimitive );
setReadOnly( isNonNegativeInteger, 'isObject', isObject );
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"./main.js":128,"./object.js":129,"./primitive.js":130,"@stdlib/utils/define-nonenumerable-read-only-property":359}],128:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a nonnegative integer.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a nonnegative integer
*
* @example
* var bool = isNonNegativeInteger( 5.0 );
* // returns true
*
* @example
* var bool = isNonNegativeInteger( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isNonNegativeInteger( -5.0 );
* // returns false
*
* @example
* var bool = isNonNegativeInteger( 3.14 );
* // returns false
*
* @example
* var bool = isNonNegativeInteger( null );
* // returns false
*/
function isNonNegativeInteger( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"./object.js":129,"./primitive.js":130}],129:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/assert/is-integer' ).isObject;
// MAIN //
/**
* Tests if a value is a number object having a nonnegative integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a nonnegative integer value
*
* @example
* var bool = isNonNegativeInteger( 3.0 );
* // returns false
*
* @example
* var bool = isNonNegativeInteger( new Number( 3.0 ) );
* // returns true
*/
function isNonNegativeInteger( value ) {
return (
isInteger( value ) &&
value.valueOf() >= 0
);
}
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"@stdlib/assert/is-integer":110}],130:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
// MAIN //
/**
* Tests if a value is a number primitive having a nonnegative integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative integer value
*
* @example
* var bool = isNonNegativeInteger( 3.0 );
* // returns true
*
* @example
* var bool = isNonNegativeInteger( new Number( 3.0 ) );
* // returns false
*/
function isNonNegativeInteger( value ) {
return (
isInteger( value ) &&
value >= 0
);
}
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"@stdlib/assert/is-integer":110}],131:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a nonnegative number.
*
* @module @stdlib/assert/is-nonnegative-number
*
* @example
* var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' );
*
* var bool = isNonNegativeNumber( 5.0 );
* // returns true
*
* bool = isNonNegativeNumber( new Number( 5.0 ) );
* // returns true
*
* bool = isNonNegativeNumber( 3.14 );
* // returns true
*
* bool = isNonNegativeNumber( -5.0 );
* // returns false
*
* bool = isNonNegativeNumber( null );
* // returns false
*
* @example
* var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;
*
* var bool = isNonNegativeNumber( 3.0 );
* // returns true
*
* bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns false
*
* @example
* var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isObject;
*
* var bool = isNonNegativeNumber( 3.0 );
* // returns false
*
* bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isNonNegativeNumber = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isNonNegativeNumber, 'isPrimitive', isPrimitive );
setReadOnly( isNonNegativeNumber, 'isObject', isObject );
// EXPORTS //
module.exports = isNonNegativeNumber;
},{"./main.js":132,"./object.js":133,"./primitive.js":134,"@stdlib/utils/define-nonenumerable-read-only-property":359}],132:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a nonnegative number.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a nonnegative number
*
* @example
* var bool = isNonNegativeNumber( 5.0 );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( 3.14 );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( -5.0 );
* // returns false
*
* @example
* var bool = isNonNegativeNumber( null );
* // returns false
*/
function isNonNegativeNumber( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isNonNegativeNumber;
},{"./object.js":133,"./primitive.js":134}],133:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isObject;
// MAIN //
/**
* Tests if a value is a number object having a nonnegative value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a nonnegative number value
*
* @example
* var bool = isNonNegativeNumber( 3.0 );
* // returns false
*
* @example
* var bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns true
*/
function isNonNegativeNumber( value ) {
return (
isNumber( value ) &&
value.valueOf() >= 0.0
);
}
// EXPORTS //
module.exports = isNonNegativeNumber;
},{"@stdlib/assert/is-number":137}],134:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
// MAIN //
/**
* Tests if a value is a number primitive having a nonnegative value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative number value
*
* @example
* var bool = isNonNegativeNumber( 3.0 );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns false
*/
function isNonNegativeNumber( value ) {
return (
isNumber( value ) &&
value >= 0.0
);
}
// EXPORTS //
module.exports = isNonNegativeNumber;
},{"@stdlib/assert/is-number":137}],135:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is `null`.
*
* @module @stdlib/assert/is-null
*
* @example
* var isNull = require( '@stdlib/assert/is-null' );
*
* var value = null;
*
* var bool = isNull( value );
* // returns true
*/
// MODULES //
var isNull = require( './main.js' );
// EXPORTS //
module.exports = isNull;
},{"./main.js":136}],136:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Tests if a value is `null`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is null
*
* @example
* var bool = isNull( null );
* // returns true
*
* bool = isNull( true );
* // returns false
*/
function isNull( value ) {
return value === null;
}
// EXPORTS //
module.exports = isNull;
},{}],137:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a number.
*
* @module @stdlib/assert/is-number
*
* @example
* var isNumber = require( '@stdlib/assert/is-number' );
*
* var bool = isNumber( 3.14 );
* // returns true
*
* bool = isNumber( new Number( 3.14 ) );
* // returns true
*
* bool = isNumber( NaN );
* // returns true
*
* bool = isNumber( null );
* // returns false
*
* @example
* var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
*
* var bool = isNumber( 3.14 );
* // returns true
*
* bool = isNumber( NaN );
* // returns true
*
* bool = isNumber( new Number( 3.14 ) );
* // returns false
*
* @example
* var isNumber = require( '@stdlib/assert/is-number' ).isObject;
*
* var bool = isNumber( 3.14 );
* // returns false
*
* bool = isNumber( new Number( 3.14 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isNumber = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isNumber, 'isPrimitive', isPrimitive );
setReadOnly( isNumber, 'isObject', isObject );
// EXPORTS //
module.exports = isNumber;
},{"./main.js":138,"./object.js":139,"./primitive.js":140,"@stdlib/utils/define-nonenumerable-read-only-property":359}],138:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a number.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a number
*
* @example
* var bool = isNumber( 3.14 );
* // returns true
*
* @example
* var bool = isNumber( new Number( 3.14 ) );
* // returns true
*
* @example
* var bool = isNumber( NaN );
* // returns true
*
* @example
* var bool = isNumber( null );
* // returns false
*/
function isNumber( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isNumber;
},{"./object.js":139,"./primitive.js":140}],139:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var nativeClass = require( '@stdlib/utils/native-class' );
var Number = require( '@stdlib/number/ctor' );
var test = require( './try2serialize.js' );
// VARIABLES //
var FLG = hasToStringTag();
// MAIN //
/**
* Tests if a value is a number object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object
*
* @example
* var bool = isNumber( 3.14 );
* // returns false
*
* @example
* var bool = isNumber( new Number( 3.14 ) );
* // returns true
*/
function isNumber( value ) {
if ( typeof value === 'object' ) {
if ( value instanceof Number ) {
return true;
}
if ( FLG ) {
return test( value );
}
return ( nativeClass( value ) === '[object Number]' );
}
return false;
}
// EXPORTS //
module.exports = isNumber;
},{"./try2serialize.js":142,"@stdlib/assert/has-tostringtag-support":57,"@stdlib/number/ctor":286,"@stdlib/utils/native-class":408}],140:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Tests if a value is a number primitive.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive
*
* @example
* var bool = isNumber( 3.14 );
* // returns true
*
* @example
* var bool = isNumber( NaN );
* // returns true
*
* @example
* var bool = isNumber( new Number( 3.14 ) );
* // returns false
*/
function isNumber( value ) {
return ( typeof value === 'number' );
}
// EXPORTS //
module.exports = isNumber;
},{}],141:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var Number = require( '@stdlib/number/ctor' );
// MAIN //
// eslint-disable-next-line stdlib/no-redeclare
var toString = Number.prototype.toString; // non-generic
// EXPORTS //
module.exports = toString;
},{"@stdlib/number/ctor":286}],142:[function(require,module,exports){
arguments[4][86][0].apply(exports,arguments)
},{"./tostring.js":141,"dup":86}],143:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is object-like.
*
* @module @stdlib/assert/is-object-like
*
* @example
* var isObjectLike = require( '@stdlib/assert/is-object-like' );
*
* var bool = isObjectLike( {} );
* // returns true
*
* bool = isObjectLike( [] );
* // returns true
*
* bool = isObjectLike( null );
* // returns false
*
* @example
* var isObjectLike = require( '@stdlib/assert/is-object-like' ).isObjectLikeArray;
*
* var bool = isObjectLike( [ {}, [] ] );
* // returns true
*
* bool = isObjectLike( [ {}, '3.0' ] );
* // returns false
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var arrayfun = require( '@stdlib/assert/tools/array-function' );
var isObjectLike = require( './main.js' );
// MAIN //
setReadOnly( isObjectLike, 'isObjectLikeArray', arrayfun( isObjectLike ) );
// EXPORTS //
module.exports = isObjectLike;
},{"./main.js":144,"@stdlib/assert/tools/array-function":177,"@stdlib/utils/define-nonenumerable-read-only-property":359}],144:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Tests if a value is object-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is object-like
*
* @example
* var bool = isObjectLike( {} );
* // returns true
*
* @example
* var bool = isObjectLike( [] );
* // returns true
*
* @example
* var bool = isObjectLike( null );
* // returns false
*/
function isObjectLike( value ) {
return (
value !== null &&
typeof value === 'object'
);
}
// EXPORTS //
module.exports = isObjectLike;
},{}],145:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is an object.
*
* @module @stdlib/assert/is-object
*
* @example
* var isObject = require( '@stdlib/assert/is-object' );
*
* var bool = isObject( {} );
* // returns true
*
* bool = isObject( true );
* // returns false
*/
// MODULES //
var isObject = require( './main.js' );
// EXPORTS //
module.exports = isObject;
},{"./main.js":146}],146:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isArray = require( '@stdlib/assert/is-array' );
// MAIN //
/**
* Tests if a value is an object; e.g., `{}`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an object
*
* @example
* var bool = isObject( {} );
* // returns true
*
* @example
* var bool = isObject( null );
* // returns false
*/
function isObject( value ) {
return (
typeof value === 'object' &&
value !== null &&
!isArray( value )
);
}
// EXPORTS //
module.exports = isObject;
},{"@stdlib/assert/is-array":79}],147:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a plain object.
*
* @module @stdlib/assert/is-plain-object
*
* @example
* var isPlainObject = require( '@stdlib/assert/is-plain-object' );
*
* var bool = isPlainObject( {} );
* // returns true
*
* bool = isPlainObject( null );
* // returns false
*/
// MODULES //
var isPlainObject = require( './main.js' );
// EXPORTS //
module.exports = isPlainObject;
},{"./main.js":148}],148:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-object' );
var isFunction = require( '@stdlib/assert/is-function' );
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var objectPrototype = Object.prototype;
// FUNCTIONS //
/**
* Tests that an object only has own properties.
*
* @private
* @param {Object} obj - value to test
* @returns {boolean} boolean indicating if an object only has own properties
*/
function ownProps( obj ) {
var key;
// NOTE: possibility of perf boost if key enumeration order is known (see http://stackoverflow.com/questions/18531624/isplainobject-thing).
for ( key in obj ) {
if ( !hasOwnProp( obj, key ) ) {
return false;
}
}
return true;
}
// MAIN //
/**
* Tests if a value is a plain object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a plain object
*
* @example
* var bool = isPlainObject( {} );
* // returns true
*
* @example
* var bool = isPlainObject( null );
* // returns false
*/
function isPlainObject( value ) {
var proto;
// Screen for obvious non-objects...
if ( !isObject( value ) ) {
return false;
}
// Objects with no prototype (e.g., `Object.create( null )`) are plain...
proto = getPrototypeOf( value );
if ( !proto ) {
return true;
}
// Objects having a prototype are plain if and only if they are constructed with a global `Object` function and the prototype points to the prototype of a plain object...
return (
// Cannot have own `constructor` property:
!hasOwnProp( value, 'constructor' ) &&
// Prototype `constructor` property must be a function (see also https://bugs.jquery.com/ticket/9897 and http://stackoverflow.com/questions/18531624/isplainobject-thing):
hasOwnProp( proto, 'constructor' ) &&
isFunction( proto.constructor ) &&
nativeClass( proto.constructor ) === '[object Function]' &&
// Test for object-specific method:
hasOwnProp( proto, 'isPrototypeOf' ) &&
isFunction( proto.isPrototypeOf ) &&
(
// Test if the prototype matches the global `Object` prototype (same realm):
proto === objectPrototype ||
// Test that all properties are own properties (cross-realm; *most* likely a plain object):
ownProps( value )
)
);
}
// EXPORTS //
module.exports = isPlainObject;
},{"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-function":102,"@stdlib/assert/is-object":145,"@stdlib/utils/get-prototype-of":374,"@stdlib/utils/native-class":408}],149:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a positive integer.
*
* @module @stdlib/assert/is-positive-integer
*
* @example
* var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' );
*
* var bool = isPositiveInteger( 5.0 );
* // returns true
*
* bool = isPositiveInteger( new Number( 5.0 ) );
* // returns true
*
* bool = isPositiveInteger( -5.0 );
* // returns false
*
* bool = isPositiveInteger( 3.14 );
* // returns false
*
* bool = isPositiveInteger( null );
* // returns false
*
* @example
* var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
*
* var bool = isPositiveInteger( 3.0 );
* // returns true
*
* bool = isPositiveInteger( new Number( 3.0 ) );
* // returns false
*
* @example
* var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isObject;
*
* var bool = isPositiveInteger( 3.0 );
* // returns false
*
* bool = isPositiveInteger( new Number( 3.0 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isPositiveInteger = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isPositiveInteger, 'isPrimitive', isPrimitive );
setReadOnly( isPositiveInteger, 'isObject', isObject );
// EXPORTS //
module.exports = isPositiveInteger;
},{"./main.js":150,"./object.js":151,"./primitive.js":152,"@stdlib/utils/define-nonenumerable-read-only-property":359}],150:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a positive integer.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a positive integer
*
* @example
* var bool = isPositiveInteger( 5.0 );
* // returns true
*
* @example
* var bool = isPositiveInteger( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isPositiveInteger( 0.0 );
* // returns false
*
* @example
* var bool = isPositiveInteger( -5.0 );
* // returns false
*
* @example
* var bool = isPositiveInteger( 3.14 );
* // returns false
*
* @example
* var bool = isPositiveInteger( null );
* // returns false
*/
function isPositiveInteger( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isPositiveInteger;
},{"./object.js":151,"./primitive.js":152}],151:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/assert/is-integer' ).isObject;
// MAIN //
/**
* Tests if a value is a number object having a positive integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a positive integer value
*
* @example
* var bool = isPositiveInteger( 3.0 );
* // returns false
*
* @example
* var bool = isPositiveInteger( new Number( 3.0 ) );
* // returns true
*/
function isPositiveInteger( value ) {
return (
isInteger( value ) &&
value.valueOf() > 0.0
);
}
// EXPORTS //
module.exports = isPositiveInteger;
},{"@stdlib/assert/is-integer":110}],152:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
// MAIN //
/**
* Tests if a value is a number primitive having a positive integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a positive integer value
*
* @example
* var bool = isPositiveInteger( 3.0 );
* // returns true
*
* @example
* var bool = isPositiveInteger( new Number( 3.0 ) );
* // returns false
*/
function isPositiveInteger( value ) {
return (
isInteger( value ) &&
value > 0.0
);
}
// EXPORTS //
module.exports = isPositiveInteger;
},{"@stdlib/assert/is-integer":110}],153:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
var exec = RegExp.prototype.exec; // non-generic
// EXPORTS //
module.exports = exec;
},{}],154:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a regular expression.
*
* @module @stdlib/assert/is-regexp
*
* @example
* var isRegExp = require( '@stdlib/assert/is-regexp' );
*
* var bool = isRegExp( /\.+/ );
* // returns true
*
* bool = isRegExp( {} );
* // returns false
*/
// MODULES //
var isRegExp = require( './main.js' );
// EXPORTS //
module.exports = isRegExp;
},{"./main.js":155}],155:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var nativeClass = require( '@stdlib/utils/native-class' );
var test = require( './try2exec.js' );
// VARIABLES //
var FLG = hasToStringTag();
// MAIN //
/**
* Tests if a value is a regular expression.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a regular expression
*
* @example
* var bool = isRegExp( /\.+/ );
* // returns true
*
* @example
* var bool = isRegExp( {} );
* // returns false
*/
function isRegExp( value ) {
if ( typeof value === 'object' ) {
if ( value instanceof RegExp ) {
return true;
}
if ( FLG ) {
return test( value );
}
return ( nativeClass( value ) === '[object RegExp]' );
}
return false;
}
// EXPORTS //
module.exports = isRegExp;
},{"./try2exec.js":156,"@stdlib/assert/has-tostringtag-support":57,"@stdlib/utils/native-class":408}],156:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var exec = require( './exec.js' );
// MAIN //
/**
* Attempts to call a `RegExp` method.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if able to call a `RegExp` method
*/
function test( value ) {
try {
exec.call( value );
return true;
} catch ( err ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = test;
},{"./exec.js":153}],157:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is an array of strings.
*
* @module @stdlib/assert/is-string-array
*
* @example
* var isStringArray = require( '@stdlib/assert/is-string-array' );
*
* var bool = isStringArray( [ 'abc', 'def' ] );
* // returns true
*
* bool = isStringArray( [ 'abc', 123 ] );
* // returns false
*
* @example
* var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
*
* var bool = isStringArray( [ 'abc', 'def' ] );
* // returns true
*
* bool = isStringArray( [ 'abc', new String( 'def' ) ] );
* // returns false
*
* @example
* var isStringArray = require( '@stdlib/assert/is-string-array' ).objects;
*
* var bool = isStringArray( [ new String( 'abc' ), new String( 'def' ) ] );
* // returns true
*
* bool = isStringArray( [ new String( 'abc' ), 'def' ] );
* // returns false
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var arrayfun = require( '@stdlib/assert/tools/array-function' );
var isString = require( '@stdlib/assert/is-string' );
// MAIN //
var isStringArray = arrayfun( isString );
setReadOnly( isStringArray, 'primitives', arrayfun( isString.isPrimitive ) );
setReadOnly( isStringArray, 'objects', arrayfun( isString.isObject ) );
// EXPORTS //
module.exports = isStringArray;
},{"@stdlib/assert/is-string":158,"@stdlib/assert/tools/array-function":177,"@stdlib/utils/define-nonenumerable-read-only-property":359}],158:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a string.
*
* @module @stdlib/assert/is-string
*
* @example
* var isString = require( '@stdlib/assert/is-string' );
*
* var bool = isString( 'beep' );
* // returns true
*
* bool = isString( new String( 'beep' ) );
* // returns true
*
* bool = isString( 5 );
* // returns false
*
* @example
* var isString = require( '@stdlib/assert/is-string' ).isObject;
*
* var bool = isString( new String( 'beep' ) );
* // returns true
*
* bool = isString( 'beep' );
* // returns false
*
* @example
* var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
*
* var bool = isString( 'beep' );
* // returns true
*
* bool = isString( new String( 'beep' ) );
* // returns false
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isString = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isString, 'isPrimitive', isPrimitive );
setReadOnly( isString, 'isObject', isObject );
// EXPORTS //
module.exports = isString;
},{"./main.js":159,"./object.js":160,"./primitive.js":161,"@stdlib/utils/define-nonenumerable-read-only-property":359}],159:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a string.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a string
*
* @example
* var bool = isString( new String( 'beep' ) );
* // returns true
*
* @example
* var bool = isString( 'beep' );
* // returns true
*/
function isString( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isString;
},{"./object.js":160,"./primitive.js":161}],160:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var nativeClass = require( '@stdlib/utils/native-class' );
var test = require( './try2valueof.js' );
// VARIABLES //
var FLG = hasToStringTag();
// MAIN //
/**
* Tests if a value is a string object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a string object
*
* @example
* var bool = isString( new String( 'beep' ) );
* // returns true
*
* @example
* var bool = isString( 'beep' );
* // returns false
*/
function isString( value ) {
if ( typeof value === 'object' ) {
if ( value instanceof String ) {
return true;
}
if ( FLG ) {
return test( value );
}
return ( nativeClass( value ) === '[object String]' );
}
return false;
}
// EXPORTS //
module.exports = isString;
},{"./try2valueof.js":162,"@stdlib/assert/has-tostringtag-support":57,"@stdlib/utils/native-class":408}],161:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Tests if a value is a string primitive.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a string primitive
*
* @example
* var bool = isString( 'beep' );
* // returns true
*
* @example
* var bool = isString( new String( 'beep' ) );
* // returns false
*/
function isString( value ) {
return ( typeof value === 'string' );
}
// EXPORTS //
module.exports = isString;
},{}],162:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var valueOf = require( './valueof.js' ); // eslint-disable-line stdlib/no-redeclare
// MAIN //
/**
* Attempts to extract a string value.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a string can be extracted
*/
function test( value ) {
try {
valueOf.call( value );
return true;
} catch ( err ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = test;
},{"./valueof.js":163}],163:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// eslint-disable-next-line stdlib/no-redeclare
var valueOf = String.prototype.valueOf; // non-generic
// EXPORTS //
module.exports = valueOf;
},{}],164:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var Int8Array = require( '@stdlib/array/int8' );
var Uint8Array = require( '@stdlib/array/uint8' );
var Uint8ClampedArray = require( '@stdlib/array/uint8c' );
var Int16Array = require( '@stdlib/array/int16' );
var Uint16Array = require( '@stdlib/array/uint16' );
var Int32Array = require( '@stdlib/array/int32' );
var Uint32Array = require( '@stdlib/array/uint32' );
var Float32Array = require( '@stdlib/array/float32' );
var Float64Array = require( '@stdlib/array/float64' );
// MAIN //
var CTORS = [
Float64Array,
Float32Array,
Int32Array,
Uint32Array,
Int16Array,
Uint16Array,
Int8Array,
Uint8Array,
Uint8ClampedArray
];
// EXPORTS //
module.exports = CTORS;
},{"@stdlib/array/float32":2,"@stdlib/array/float64":5,"@stdlib/array/int16":7,"@stdlib/array/int32":10,"@stdlib/array/int8":13,"@stdlib/array/uint16":20,"@stdlib/array/uint32":23,"@stdlib/array/uint8":26,"@stdlib/array/uint8c":29}],165:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a typed array.
*
* @module @stdlib/assert/is-typed-array
*
* @example
* var Int8Array = require( '@stdlib/array/int8' );
* var isTypedArray = require( '@stdlib/assert/is-typed-array' );
*
* var bool = isTypedArray( new Int8Array( 10 ) );
* // returns true
*/
// MODULES //
var isTypedArray = require( './main.js' );
// EXPORTS //
module.exports = isTypedArray;
},{"./main.js":166}],166:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var ctorName = require( '@stdlib/utils/constructor-name' );
var fcnName = require( '@stdlib/utils/function-name' );
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' );
var Float64Array = require( '@stdlib/array/float64' );
var CTORS = require( './ctors.js' );
var NAMES = require( './names.json' );
// VARIABLES //
// Abstract `TypedArray` class:
var TypedArray = ( hasFloat64ArraySupport() ) ? getPrototypeOf( Float64Array ) : Dummy; // eslint-disable-line max-len
// Ensure abstract typed array class has expected name:
TypedArray = ( fcnName( TypedArray ) === 'TypedArray' ) ? TypedArray : Dummy;
// FUNCTIONS //
/**
* Dummy constructor.
*
* @private
*/
function Dummy() {} // eslint-disable-line no-empty-function
// MAIN //
/**
* Tests if a value is a typed array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a typed array
*
* @example
* var Int8Array = require( '@stdlib/array/int8' );
*
* var bool = isTypedArray( new Int8Array( 10 ) );
* // returns true
*/
function isTypedArray( value ) {
var v;
var i;
if ( typeof value !== 'object' || value === null ) {
return false;
}
// Check for the abstract class...
if ( value instanceof TypedArray ) {
return true;
}
// Check for typed array objects from the same realm (same Node.js `vm` or same `Window` object)...
for ( i = 0; i < CTORS.length; i++ ) {
if ( value instanceof CTORS[ i ] ) {
return true;
}
}
// Walk the prototype tree until we find an object having a desired class...
while ( value ) {
v = ctorName( value );
for ( i = 0; i < NAMES.length; i++ ) {
if ( NAMES[ i ] === v ) {
return true;
}
}
value = getPrototypeOf( value );
}
return false;
}
// EXPORTS //
module.exports = isTypedArray;
},{"./ctors.js":164,"./names.json":167,"@stdlib/array/float64":5,"@stdlib/assert/has-float64array-support":36,"@stdlib/utils/constructor-name":351,"@stdlib/utils/function-name":371,"@stdlib/utils/get-prototype-of":374}],167:[function(require,module,exports){
module.exports=[
"Int8Array",
"Uint8Array",
"Uint8ClampedArray",
"Int16Array",
"Uint16Array",
"Int32Array",
"Uint32Array",
"Float32Array",
"Float64Array"
]
},{}],168:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a Uint16Array.
*
* @module @stdlib/assert/is-uint16array
*
* @example
* var isUint16Array = require( '@stdlib/assert/is-uint16array' );
*
* var bool = isUint16Array( new Uint16Array( 10 ) );
* // returns true
*
* bool = isUint16Array( [] );
* // returns false
*/
// MODULES //
var isUint16Array = require( './main.js' );
// EXPORTS //
module.exports = isUint16Array;
},{"./main.js":169}],169:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasUint16Array = ( typeof Uint16Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Uint16Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Uint16Array
*
* @example
* var bool = isUint16Array( new Uint16Array( 10 ) );
* // returns true
*
* @example
* var bool = isUint16Array( [] );
* // returns false
*/
function isUint16Array( value ) {
return (
( hasUint16Array && value instanceof Uint16Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Uint16Array]'
);
}
// EXPORTS //
module.exports = isUint16Array;
},{"@stdlib/utils/native-class":408}],170:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a Uint32Array.
*
* @module @stdlib/assert/is-uint32array
*
* @example
* var isUint32Array = require( '@stdlib/assert/is-uint32array' );
*
* var bool = isUint32Array( new Uint32Array( 10 ) );
* // returns true
*
* bool = isUint32Array( [] );
* // returns false
*/
// MODULES //
var isUint32Array = require( './main.js' );
// EXPORTS //
module.exports = isUint32Array;
},{"./main.js":171}],171:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasUint32Array = ( typeof Uint32Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Uint32Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Uint32Array
*
* @example
* var bool = isUint32Array( new Uint32Array( 10 ) );
* // returns true
*
* @example
* var bool = isUint32Array( [] );
* // returns false
*/
function isUint32Array( value ) {
return (
( hasUint32Array && value instanceof Uint32Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Uint32Array]'
);
}
// EXPORTS //
module.exports = isUint32Array;
},{"@stdlib/utils/native-class":408}],172:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a Uint8Array.
*
* @module @stdlib/assert/is-uint8array
*
* @example
* var isUint8Array = require( '@stdlib/assert/is-uint8array' );
*
* var bool = isUint8Array( new Uint8Array( 10 ) );
* // returns true
*
* bool = isUint8Array( [] );
* // returns false
*/
// MODULES //
var isUint8Array = require( './main.js' );
// EXPORTS //
module.exports = isUint8Array;
},{"./main.js":173}],173:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasUint8Array = ( typeof Uint8Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Uint8Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Uint8Array
*
* @example
* var bool = isUint8Array( new Uint8Array( 10 ) );
* // returns true
*
* @example
* var bool = isUint8Array( [] );
* // returns false
*/
function isUint8Array( value ) {
return (
( hasUint8Array && value instanceof Uint8Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Uint8Array]'
);
}
// EXPORTS //
module.exports = isUint8Array;
},{"@stdlib/utils/native-class":408}],174:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a value is a Uint8ClampedArray.
*
* @module @stdlib/assert/is-uint8clampedarray
*
* @example
* var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' );
*
* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );
* // returns true
*
* bool = isUint8ClampedArray( [] );
* // returns false
*/
// MODULES //
var isUint8ClampedArray = require( './main.js' );
// EXPORTS //
module.exports = isUint8ClampedArray;
},{"./main.js":175}],175:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasUint8ClampedArray = ( typeof Uint8ClampedArray === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Uint8ClampedArray.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Uint8ClampedArray
*
* @example
* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );
* // returns true
*
* @example
* var bool = isUint8ClampedArray( [] );
* // returns false
*/
function isUint8ClampedArray( value ) {
return (
( hasUint8ClampedArray && value instanceof Uint8ClampedArray ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Uint8ClampedArray]'
);
}
// EXPORTS //
module.exports = isUint8ClampedArray;
},{"@stdlib/utils/native-class":408}],176:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isArray = require( '@stdlib/assert/is-array' );
// MAIN //
/**
* Returns a function which tests if every element in an array passes a test condition.
*
* @param {Function} predicate - function to apply
* @throws {TypeError} must provide a function
* @returns {Function} an array function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arrayfcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/
function arrayfcn( predicate ) {
if ( typeof predicate !== 'function' ) {
throw new TypeError( 'invalid argument. Must provide a function. Value: `' + predicate + '`.' );
}
return every;
/**
* Tests if every element in an array passes a test condition.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an array for which all elements pass a test condition
*/
function every( value ) {
var len;
var i;
if ( !isArray( value ) ) {
return false;
}
len = value.length;
if ( len === 0 ) {
return false;
}
for ( i = 0; i < len; i++ ) {
if ( predicate( value[ i ] ) === false ) {
return false;
}
}
return true;
}
}
// EXPORTS //
module.exports = arrayfcn;
},{"@stdlib/assert/is-array":79}],177:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return a function which tests if every element in an array passes a test condition.
*
* @module @stdlib/assert/tools/array-function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
* var arrayfcn = require( '@stdlib/assert/tools/array-function' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arrayfcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/
// MODULES //
var arrayfcn = require( './arrayfcn.js' );
// EXPORTS //
module.exports = arrayfcn;
},{"./arrayfcn.js":176}],178:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isArrayLike = require( '@stdlib/assert/is-array-like' );
// MAIN //
/**
* Returns a function which tests if every element in an array-like object passes a test condition.
*
* @param {Function} predicate - function to apply
* @throws {TypeError} must provide a function
* @returns {Function} an array-like object function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arraylikefcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/
function arraylikefcn( predicate ) {
if ( typeof predicate !== 'function' ) {
throw new TypeError( 'invalid argument. Must provide a function. Value: `' + predicate + '`.' );
}
return every;
/**
* Tests if every element in an array-like object passes a test condition.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an array-like object for which all elements pass a test condition
*/
function every( value ) {
var len;
var i;
if ( !isArrayLike( value ) ) {
return false;
}
len = value.length;
if ( len === 0 ) {
return false;
}
for ( i = 0; i < len; i++ ) {
if ( predicate( value[ i ] ) === false ) {
return false;
}
}
return true;
}
}
// EXPORTS //
module.exports = arraylikefcn;
},{"@stdlib/assert/is-array-like":77}],179:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return a function which tests if every element in an array-like object passes a test condition.
*
* @module @stdlib/assert/tools/array-like-function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
* var arraylikefcn = require( '@stdlib/assert/tools/array-like-function' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arraylikefcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/
// MODULES //
var arraylikefcn = require( './arraylikefcn.js' );
// EXPORTS //
module.exports = arraylikefcn;
},{"./arraylikefcn.js":178}],180:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var TransformStream = require( '@stdlib/streams/node/transform' );
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isFunction = require( '@stdlib/assert/is-function' );
var createHarness = require( './harness' );
var harness = require( './get_harness.js' );
// VARIABLES //
var listeners = [];
// FUNCTIONS //
/**
* Callback invoked when a harness finishes running all benchmarks.
*
* @private
*/
function done() {
var len;
var f;
var i;
len = listeners.length;
// Inform all the listeners that the harness has finished...
for ( i = 0; i < len; i++ ) {
f = listeners.shift();
f();
}
}
/**
* Creates a results stream.
*
* @private
* @param {Options} [options] - stream options
* @throws {Error} must provide valid stream options
* @returns {TransformStream} results stream
*/
function createStream( options ) {
var stream;
var bench;
var opts;
if ( arguments.length ) {
opts = options;
} else {
opts = {};
}
// If we have already created a harness, calling this function simply creates another results stream...
if ( harness.cached ) {
bench = harness();
return bench.createStream( opts );
}
stream = new TransformStream( opts );
opts.stream = stream;
// Create a harness which uses the created output stream:
harness( opts, done );
return stream;
}
/**
* Adds a listener for when a harness finishes running all benchmarks.
*
* @private
* @param {Callback} clbk - listener
* @throws {TypeError} must provide a function
* @throws {Error} must provide a listener only once
* @returns {void}
*/
function onFinish( clbk ) {
var i;
if ( !isFunction( clbk ) ) {
throw new TypeError( 'invalid argument. Must provide a function. Value: `'+clbk+'`.' );
}
// Allow adding a listener only once...
for ( i = 0; i < listeners.length; i++ ) {
if ( clbk === listeners[ i ] ) {
throw new Error( 'invalid argument. Attempted to add duplicate listener.' );
}
}
listeners.push( clbk );
}
// MAIN //
/**
* Runs a benchmark.
*
* @param {string} name - benchmark name
* @param {Options} [options] - benchmark options
* @param {boolean} [options.skip=false] - boolean indicating whether to skip a benchmark
* @param {(PositiveInteger|null)} [options.iterations=null] - number of iterations
* @param {PositiveInteger} [options.repeats=3] - number of repeats
* @param {PositiveInteger} [options.timeout=300000] - number of milliseconds before a benchmark automatically fails
* @param {Function} [benchmark] - function containing benchmark code
* @throws {TypeError} first argument must be a string
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} benchmark argument must a function
* @returns {Benchmark} benchmark harness
*
* @example
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*/
function bench( name, options, benchmark ) {
var h = harness( done );
if ( arguments.length < 2 ) {
h( name );
} else if ( arguments.length === 2 ) {
h( name, options );
} else {
h( name, options, benchmark );
}
return bench;
}
/**
* Creates a benchmark harness.
*
* @name createHarness
* @memberof bench
* @type {Function}
* @param {Options} [options] - harness options
* @param {Callback} [clbk] - callback to invoke when a harness finishes running all benchmarks
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} callback argument must be a function
* @returns {Function} benchmark harness
*/
setReadOnly( bench, 'createHarness', createHarness );
/**
* Creates a results stream.
*
* @name createStream
* @memberof bench
* @type {Function}
* @param {Options} [options] - stream options
* @throws {Error} must provide valid stream options
* @returns {TransformStream} results stream
*/
setReadOnly( bench, 'createStream', createStream );
/**
* Adds a listener for when a harness finishes running all benchmarks.
*
* @name onFinish
* @memberof bench
* @type {Function}
* @param {Callback} clbk - listener
* @throws {TypeError} must provide a function
* @throws {Error} must provide a listener only once
* @returns {void}
*/
setReadOnly( bench, 'onFinish', onFinish );
// EXPORTS //
module.exports = bench;
},{"./get_harness.js":202,"./harness":203,"@stdlib/assert/is-function":102,"@stdlib/streams/node/transform":335,"@stdlib/utils/define-nonenumerable-read-only-property":359}],181:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
// MAIN //
/**
* Generates an assertion.
*
* @private
* @param {boolean} ok - assertion outcome
* @param {Options} opts - options
*/
function assert( ok, opts ) {
/* eslint-disable no-invalid-this, no-unused-vars */ // TODO: remove no-unused-vars once `err` is used
var result;
var err;
result = {
'id': this._count,
'ok': ok,
'skip': opts.skip,
'todo': opts.todo,
'name': opts.message || '(unnamed assert)',
'operator': opts.operator
};
if ( hasOwnProp( opts, 'actual' ) ) {
result.actual = opts.actual;
}
if ( hasOwnProp( opts, 'expected' ) ) {
result.expected = opts.expected;
}
if ( !ok ) {
result.error = opts.error || new Error( this.name );
err = new Error( 'exception' );
// TODO: generate an exception in order to locate the calling function (https://github.com/substack/tape/blob/master/lib/test.js#L215)
}
this._count += 1;
this.emit( 'result', result );
}
// EXPORTS //
module.exports = assert;
},{"@stdlib/assert/has-own-property":53}],182:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// EXPORTS //
module.exports = clearTimeout;
},{}],183:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var trim = require( '@stdlib/string/trim' );
var replace = require( '@stdlib/string/replace' );
var EOL = require( '@stdlib/regexp/eol' ).REGEXP;
// VARIABLES //
var RE_COMMENT = /^#\s*/;
// MAIN //
/**
* Writes a comment.
*
* @private
* @param {string} msg - comment message
*/
function comment( msg ) {
/* eslint-disable no-invalid-this */
var lines;
var i;
msg = trim( msg );
lines = msg.split( EOL );
for ( i = 0; i < lines.length; i++ ) {
msg = trim( lines[ i ] );
msg = replace( msg, RE_COMMENT, '' );
this.emit( 'result', msg );
}
}
// EXPORTS //
module.exports = comment;
},{"@stdlib/regexp/eol":319,"@stdlib/string/replace":341,"@stdlib/string/trim":343}],184:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Asserts that `actual` is deeply equal to `expected`.
*
* @private
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] message
*/
function deepEqual( actual, expected, msg ) {
/* eslint-disable no-invalid-this */
this.comment( 'actual: '+actual+'. expected: '+expected+'. msg: '+msg+'.' );
// TODO: implement
}
// EXPORTS //
module.exports = deepEqual;
},{}],185:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nextTick = require( './../utils/next_tick.js' );
// MAIN //
/**
* Ends a benchmark.
*
* @private
*/
function end() {
/* eslint-disable no-invalid-this */
var self = this;
if ( this._ended ) {
this.fail( '.end() called more than once' );
} else {
// Prevents releasing the zalgo when running synchronous benchmarks.
nextTick( onTick );
}
this._ended = true;
this._running = false;
/**
* Callback invoked upon a subsequent tick of the event loop.
*
* @private
*/
function onTick() {
self.emit( 'end' );
}
}
// EXPORTS //
module.exports = end;
},{"./../utils/next_tick.js":222}],186:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Returns a `boolean` indicating if a benchmark has ended.
*
* @private
* @returns {boolean} boolean indicating if a benchmark has ended
*/
function ended() {
/* eslint-disable no-invalid-this */
return this._ended;
}
// EXPORTS //
module.exports = ended;
},{}],187:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Asserts that `actual` is strictly equal to `expected`.
*
* @private
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] - message
*/
function equal( actual, expected, msg ) {
/* eslint-disable no-invalid-this */
this._assert( actual === expected, {
'message': msg || 'should be equal',
'operator': 'equal',
'expected': expected,
'actual': actual
});
}
// EXPORTS //
module.exports = equal;
},{}],188:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Forcefully ends a benchmark.
*
* @private
* @returns {void}
*/
function exit() {
/* eslint-disable no-invalid-this */
if ( this._exited ) {
// If we have already "exited", do not create more failing assertions when one should suffice...
return;
}
// Only "exit" when a benchmark has either not yet been run or is currently running. If a benchmark has already ended, no need to generate a failing assertion.
if ( !this._ended ) {
this._exited = true;
this.fail( 'benchmark exited without ending' );
// Allow running benchmarks to call `end` on their own...
if ( !this._running ) {
this.end();
}
}
}
// EXPORTS //
module.exports = exit;
},{}],189:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Generates a failing assertion.
*
* @private
* @param {string} msg - message
*/
function fail( msg ) {
/* eslint-disable no-invalid-this */
this._assert( false, {
'message': msg,
'operator': 'fail'
});
}
// EXPORTS //
module.exports = fail;
},{}],190:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var EventEmitter = require( 'events' ).EventEmitter;
var inherit = require( '@stdlib/utils/inherit' );
var defineProperty = require( '@stdlib/utils/define-property' );
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var tic = require( '@stdlib/time/tic' );
var toc = require( '@stdlib/time/toc' );
var run = require( './run.js' );
var exit = require( './exit.js' );
var ended = require( './ended.js' );
var assert = require( './assert.js' );
var comment = require( './comment.js' );
var skip = require( './skip.js' );
var todo = require( './todo.js' );
var fail = require( './fail.js' );
var pass = require( './pass.js' );
var ok = require( './ok.js' );
var notOk = require( './not_ok.js' );
var equal = require( './equal.js' );
var notEqual = require( './not_equal.js' );
var deepEqual = require( './deep_equal.js' );
var notDeepEqual = require( './not_deep_equal.js' );
var end = require( './end.js' );
// MAIN //
/**
* Benchmark constructor.
*
* @constructor
* @param {string} name - benchmark name
* @param {Options} opts - benchmark options
* @param {boolean} opts.skip - boolean indicating whether to skip a benchmark
* @param {PositiveInteger} opts.iterations - number of iterations
* @param {PositiveInteger} opts.timeout - number of milliseconds before a benchmark automatically fails
* @param {Function} [benchmark] - function containing benchmark code
* @returns {Benchmark} Benchmark instance
*
* @example
* var bench = new Benchmark( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.comment( 'Running benchmarks...' );
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.comment( 'Finished running benchmarks.' );
* b.end();
* });
*/
function Benchmark( name, opts, benchmark ) {
var hasTicked;
var hasTocked;
var self;
var time;
if ( !( this instanceof Benchmark ) ) {
return new Benchmark( name, opts, benchmark );
}
self = this;
hasTicked = false;
hasTocked = false;
EventEmitter.call( this );
// Private properties:
setReadOnly( this, '_benchmark', benchmark );
setReadOnly( this, '_skip', opts.skip );
defineProperty( this, '_ended', {
'configurable': false,
'enumerable': false,
'writable': true,
'value': false
});
defineProperty( this, '_running', {
'configurable': false,
'enumerable': false,
'writable': true,
'value': false
});
defineProperty( this, '_exited', {
'configurable': false,
'enumerable': false,
'writable': true,
'value': false
});
defineProperty( this, '_count', {
'configurable': false,
'enumerable': false,
'writable': true,
'value': 0
});
// Read-only:
setReadOnly( this, 'name', name );
setReadOnly( this, 'tic', start );
setReadOnly( this, 'toc', stop );
setReadOnly( this, 'iterations', opts.iterations );
setReadOnly( this, 'timeout', opts.timeout );
return this;
/**
* Starts a benchmark timer.
*
* ## Notes
*
* - Using a scoped variable prevents nefarious mutation by bad actors hoping to manipulate benchmark results.
* - The one attack vector which remains is manipulation of the `require` cache for `tic` and `toc`.
* - One way to combat cache manipulation is by comparing the checksum of `Function#toString()` against known values.
*
* @private
*/
function start() {
if ( hasTicked ) {
self.fail( '.tic() called more than once' );
} else {
self.emit( 'tic' );
hasTicked = true;
time = tic();
}
}
/**
* Stops a benchmark timer.
*
* @private
* @returns {void}
*/
function stop() {
var elapsed;
var secs;
var rate;
var out;
if ( hasTicked === false ) {
return self.fail( '.toc() called before .tic()' );
}
elapsed = toc( time );
if ( hasTocked ) {
return self.fail( '.toc() called more than once' );
}
hasTocked = true;
self.emit( 'toc' );
secs = elapsed[ 0 ] + ( elapsed[ 1 ]/1e9 );
rate = self.iterations / secs;
out = {
'ok': true,
'operator': 'result',
'iterations': self.iterations,
'elapsed': secs,
'rate': rate
};
self.emit( 'result', out );
}
}
/*
* Inherit from the `EventEmitter` prototype.
*/
inherit( Benchmark, EventEmitter );
/**
* Runs a benchmark.
*
* @private
* @name run
* @memberof Benchmark.prototype
* @type {Function}
*/
setReadOnly( Benchmark.prototype, 'run', run );
/**
* Forcefully ends a benchmark.
*
* @private
* @name exit
* @memberof Benchmark.prototype
* @type {Function}
*/
setReadOnly( Benchmark.prototype, 'exit', exit );
/**
* Returns a `boolean` indicating if a benchmark has ended.
*
* @private
* @name ended
* @memberof Benchmark.prototype
* @type {Function}
* @returns {boolean} boolean indicating if a benchmark has ended
*/
setReadOnly( Benchmark.prototype, 'ended', ended );
/**
* Generates an assertion.
*
* @private
* @name _assert
* @memberof Benchmark.prototype
* @type {Function}
* @param {boolean} ok - assertion outcome
* @param {Options} opts - options
*/
setReadOnly( Benchmark.prototype, '_assert', assert );
/**
* Writes a comment.
*
* @name comment
* @memberof Benchmark.prototype
* @type {Function}
* @param {string} msg - comment message
*/
setReadOnly( Benchmark.prototype, 'comment', comment );
/**
* Generates an assertion which will be skipped.
*
* @name skip
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} value - value
* @param {string} msg - message
*/
setReadOnly( Benchmark.prototype, 'skip', skip );
/**
* Generates an assertion which should be implemented.
*
* @name todo
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} value - value
* @param {string} msg - message
*/
setReadOnly( Benchmark.prototype, 'todo', todo );
/**
* Generates a failing assertion.
*
* @name fail
* @memberof Benchmark.prototype
* @type {Function}
* @param {string} msg - message
*/
setReadOnly( Benchmark.prototype, 'fail', fail );
/**
* Generates a passing assertion.
*
* @name pass
* @memberof Benchmark.prototype
* @type {Function}
* @param {string} msg - message
*/
setReadOnly( Benchmark.prototype, 'pass', pass );
/**
* Asserts that a `value` is truthy.
*
* @name ok
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} value - value
* @param {string} [msg] - message
*/
setReadOnly( Benchmark.prototype, 'ok', ok );
/**
* Asserts that a `value` is falsy.
*
* @name notOk
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} value - value
* @param {string} [msg] - message
*/
setReadOnly( Benchmark.prototype, 'notOk', notOk );
/**
* Asserts that `actual` is strictly equal to `expected`.
*
* @name equal
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] - message
*/
setReadOnly( Benchmark.prototype, 'equal', equal );
/**
* Asserts that `actual` is not strictly equal to `expected`.
*
* @name notEqual
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] - message
*/
setReadOnly( Benchmark.prototype, 'notEqual', notEqual );
/**
* Asserts that `actual` is deeply equal to `expected`.
*
* @name deepEqual
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] message
*/
setReadOnly( Benchmark.prototype, 'deepEqual', deepEqual );
/**
* Asserts that `actual` is not deeply equal to `expected`.
*
* @name notDeepEqual
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] message
*/
setReadOnly( Benchmark.prototype, 'notDeepEqual', notDeepEqual );
/**
* Ends a benchmark.
*
* @name end
* @memberof Benchmark.prototype
* @type {Function}
*/
setReadOnly( Benchmark.prototype, 'end', end );
// EXPORTS //
module.exports = Benchmark;
},{"./assert.js":181,"./comment.js":183,"./deep_equal.js":184,"./end.js":185,"./ended.js":186,"./equal.js":187,"./exit.js":188,"./fail.js":189,"./not_deep_equal.js":191,"./not_equal.js":192,"./not_ok.js":193,"./ok.js":194,"./pass.js":195,"./run.js":196,"./skip.js":198,"./todo.js":199,"@stdlib/time/tic":345,"@stdlib/time/toc":349,"@stdlib/utils/define-nonenumerable-read-only-property":359,"@stdlib/utils/define-property":366,"@stdlib/utils/inherit":387,"events":440}],191:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Asserts that `actual` is not deeply equal to `expected`.
*
* @private
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] message
*/
function notDeepEqual( actual, expected, msg ) {
/* eslint-disable no-invalid-this */
this.comment( 'actual: '+actual+'. expected: '+expected+'. msg: '+msg+'.' );
// TODO: implement
}
// EXPORTS //
module.exports = notDeepEqual;
},{}],192:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Asserts that `actual` is not strictly equal to `expected`.
*
* @private
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] - message
*/
function notEqual( actual, expected, msg ) {
/* eslint-disable no-invalid-this */
this._assert( actual !== expected, {
'message': msg || 'should not be equal',
'operator': 'notEqual',
'expected': expected,
'actual': actual
});
}
// EXPORTS //
module.exports = notEqual;
},{}],193:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Asserts that a `value` is falsy.
*
* @private
* @param {*} value - value
* @param {string} [msg] - message
*/
function notOk( value, msg ) {
/* eslint-disable no-invalid-this */
this._assert( !value, {
'message': msg || 'should be falsy',
'operator': 'notOk',
'expected': false,
'actual': value
});
}
// EXPORTS //
module.exports = notOk;
},{}],194:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Asserts that a `value` is truthy.
*
* @private
* @param {*} value - value
* @param {string} [msg] - message
*/
function ok( value, msg ) {
/* eslint-disable no-invalid-this */
this._assert( !!value, {
'message': msg || 'should be truthy',
'operator': 'ok',
'expected': true,
'actual': value
});
}
// EXPORTS //
module.exports = ok;
},{}],195:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Generates a passing assertion.
*
* @private
* @param {string} msg - message
*/
function pass( msg ) {
/* eslint-disable no-invalid-this */
this._assert( true, {
'message': msg,
'operator': 'pass'
});
}
// EXPORTS //
module.exports = pass;
},{}],196:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var timeout = require( './set_timeout.js' );
var clear = require( './clear_timeout.js' );
// MAIN //
/**
* Runs a benchmark.
*
* @private
* @returns {void}
*/
function run() {
/* eslint-disable no-invalid-this */
var self;
var id;
if ( this._skip ) {
this.comment( 'SKIP '+this.name );
return this.end();
}
if ( !this._benchmark ) {
this.comment( 'TODO '+this.name );
return this.end();
}
self = this;
this._running = true;
id = timeout( onTimeout, this.timeout );
this.once( 'end', endTimeout );
this.emit( 'prerun' );
this._benchmark( this );
this.emit( 'run' );
/**
* Callback invoked once a timeout ends.
*
* @private
*/
function onTimeout() {
self.fail( 'benchmark timed out after '+self.timeout+'ms' );
}
/**
* Clears a timeout.
*
* @private
*/
function endTimeout() {
clear( id );
}
}
// EXPORTS //
module.exports = run;
},{"./clear_timeout.js":182,"./set_timeout.js":197}],197:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// EXPORTS //
module.exports = setTimeout;
},{}],198:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Generates an assertion which will be skipped.
*
* @private
* @param {*} value - value
* @param {string} msg - message
*/
function skip( value, msg ) {
/* eslint-disable no-invalid-this */
this._assert( true, {
'message': msg,
'operator': 'skip',
'skip': true
});
}
// EXPORTS //
module.exports = skip;
},{}],199:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Generates an assertion which should be implemented.
*
* @private
* @param {*} value - value
* @param {string} msg - message
*/
function todo( value, msg ) {
/* eslint-disable no-invalid-this */
this._assert( !!value, {
'message': msg,
'operator': 'todo',
'todo': true
});
}
// EXPORTS //
module.exports = todo;
},{}],200:[function(require,module,exports){
module.exports={
"skip": false,
"iterations": null,
"repeats": 3,
"timeout": 300000
}
},{}],201:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isObject = require( '@stdlib/assert/is-plain-object' );
var isNodeWritableStreamLike = require( '@stdlib/assert/is-node-writable-stream-like' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var pick = require( '@stdlib/utils/pick' );
var omit = require( '@stdlib/utils/omit' );
var noop = require( '@stdlib/utils/noop' );
var createHarness = require( './harness' );
var logStream = require( './log' );
var canEmitExit = require( './utils/can_emit_exit.js' );
var proc = require( './utils/process.js' );
// MAIN //
/**
* Creates a benchmark harness which supports closing when a process exits.
*
* @private
* @param {Options} [options] - function options
* @param {boolean} [options.autoclose] - boolean indicating whether to automatically close a harness after a harness finishes running all benchmarks
* @param {Stream} [options.stream] - output writable stream
* @param {Callback} [clbk] - callback to invoke when a harness finishes running all benchmarks
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} callback argument must be a function
* @returns {Function} benchmark harness
*
* @example
* var proc = require( 'process' );
* var bench = createExitHarness( onFinish );
*
* function onFinish() {
* bench.close();
* }
*
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* var stream = createExitHarness().createStream();
* stream.pipe( stdout );
*/
function createExitHarness() {
var exitCode;
var pipeline;
var harness;
var options;
var stream;
var topts;
var opts;
var clbk;
if ( arguments.length === 0 ) {
options = {};
clbk = noop;
} else if ( arguments.length === 1 ) {
if ( isFunction( arguments[ 0 ] ) ) {
options = {};
clbk = arguments[ 0 ];
} else if ( isObject( arguments[ 0 ] ) ) {
options = arguments[ 0 ];
clbk = noop;
} else {
throw new TypeError( 'invalid argument. Must provide either an options object or a callback function. Value: `'+arguments[ 0 ]+'`.' );
}
} else {
options = arguments[ 0 ];
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `'+options+'`.' );
}
clbk = arguments[ 1 ];
if ( !isFunction( clbk ) ) {
throw new TypeError( 'invalid argument. Second argument must be a function. Value: `'+clbk+'`.' );
}
}
opts = {};
if ( hasOwnProp( options, 'autoclose' ) ) {
opts.autoclose = options.autoclose;
if ( !isBoolean( opts.autoclose ) ) {
throw new TypeError( 'invalid option. `autoclose` option must be a boolean primitive. Option: `'+opts.autoclose+'`.' );
}
}
if ( hasOwnProp( options, 'stream' ) ) {
opts.stream = options.stream;
if ( !isNodeWritableStreamLike( opts.stream ) ) {
throw new TypeError( 'invalid option. `stream` option must be a writable stream. Option: `'+opts.stream+'`.' );
}
}
exitCode = 0;
// Create a new harness:
topts = pick( opts, [ 'autoclose' ] );
harness = createHarness( topts, done );
// Create a results stream:
topts = omit( options, [ 'autoclose', 'stream' ] );
stream = harness.createStream( topts );
// Pipe results to an output stream:
pipeline = stream.pipe( opts.stream || logStream() );
// If a process can emit an 'exit' event, capture errors in order to set the exit code...
if ( canEmitExit ) {
pipeline.on( 'error', onError );
proc.on( 'exit', onExit );
}
return harness;
/**
* Callback invoked when a harness finishes.
*
* @private
* @returns {void}
*/
function done() {
return clbk();
}
/**
* Callback invoked upon a stream `error` event.
*
* @private
* @param {Error} error - error object
*/
function onError() {
exitCode = 1;
}
/**
* Callback invoked upon an `exit` event.
*
* @private
* @param {integer} code - exit code
*/
function onExit( code ) {
if ( code !== 0 ) {
// Allow the process to exit...
return;
}
harness.close();
proc.exit( exitCode || harness.exitCode );
}
}
// EXPORTS //
module.exports = createExitHarness;
},{"./harness":203,"./log":209,"./utils/can_emit_exit.js":220,"./utils/process.js":223,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-function":102,"@stdlib/assert/is-node-writable-stream-like":124,"@stdlib/assert/is-plain-object":147,"@stdlib/utils/noop":415,"@stdlib/utils/omit":417,"@stdlib/utils/pick":419}],202:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var canEmitExit = require( './utils/can_emit_exit.js' );
var createExitHarness = require( './exit_harness.js' );
// VARIABLES //
var harness;
// MAIN //
/**
* Returns a benchmark harness. If a harness has already been created, returns the cached harness.
*
* @private
* @param {Options} [options] - harness options
* @param {Callback} [clbk] - callback to invoke when a harness finishes running all benchmarks
* @returns {Function} benchmark harness
*/
function getHarness( options, clbk ) {
var opts;
var cb;
if ( harness ) {
return harness;
}
if ( arguments.length > 1 ) {
opts = options;
cb = clbk;
} else {
opts = {};
cb = options;
}
opts.autoclose = !canEmitExit;
harness = createExitHarness( opts, cb );
// Update state:
getHarness.cached = true;
return harness;
}
// EXPORTS //
module.exports = getHarness;
},{"./exit_harness.js":201,"./utils/can_emit_exit.js":220}],203:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isFunction = require( '@stdlib/assert/is-function' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var copy = require( '@stdlib/utils/copy' );
var Benchmark = require( './../benchmark-class' );
var Runner = require( './../runner' );
var nextTick = require( './../utils/next_tick.js' );
var DEFAULTS = require( './../defaults.json' );
var validate = require( './validate.js' );
var init = require( './init.js' );
// MAIN //
/**
* Creates a benchmark harness.
*
* @param {Options} [options] - function options
* @param {boolean} [options.autoclose] - boolean indicating whether to automatically close a harness after a harness finishes running all benchmarks
* @param {Callback} [clbk] - callback to invoke when a harness finishes running all benchmarks
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} callback argument must be a function
* @returns {Function} benchmark harness
*
* @example
* var bench = createHarness( onFinish );
*
* function onFinish() {
* bench.close();
* console.log( 'Exit code: %d', bench.exitCode );
* }
*
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* var stream = createHarness().createStream();
* stream.pipe( stdout );
*/
function createHarness( options, clbk ) {
var exitCode;
var runner;
var queue;
var opts;
var cb;
opts = {};
if ( arguments.length === 1 ) {
if ( isFunction( options ) ) {
cb = options;
} else if ( isObject( options ) ) {
opts = options;
} else {
throw new TypeError( 'invalid argument. Must provide either an options object or a callback function. Value: `'+options+'`.' );
}
} else if ( arguments.length > 1 ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `'+options+'`.' );
}
if ( hasOwnProp( options, 'autoclose' ) ) {
opts.autoclose = options.autoclose;
if ( !isBoolean( opts.autoclose ) ) {
throw new TypeError( 'invalid option. `autoclose` option must be a boolean primitive. Option: `'+opts.autoclose+'`.' );
}
}
cb = clbk;
if ( !isFunction( cb ) ) {
throw new TypeError( 'invalid argument. Second argument must be a function. Value: `'+cb+'`.' );
}
}
runner = new Runner();
if ( opts.autoclose ) {
runner.once( 'done', close );
}
if ( cb ) {
runner.once( 'done', cb );
}
exitCode = 0;
queue = [];
/**
* Benchmark harness.
*
* @private
* @param {string} name - benchmark name
* @param {Options} [options] - benchmark options
* @param {boolean} [options.skip=false] - boolean indicating whether to skip a benchmark
* @param {(PositiveInteger|null)} [options.iterations=null] - number of iterations
* @param {PositiveInteger} [options.repeats=3] - number of repeats
* @param {PositiveInteger} [options.timeout=300000] - number of milliseconds before a benchmark automatically fails
* @param {Function} [benchmark] - function containing benchmark code
* @throws {TypeError} first argument must be a string
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} benchmark argument must a function
* @throws {Error} benchmark error
* @returns {Function} benchmark harness
*/
function harness( name, options, benchmark ) {
var opts;
var err;
var b;
if ( !isString( name ) ) {
throw new TypeError( 'invalid argument. First argument must be a string. Value: `'+name+'`.' );
}
opts = copy( DEFAULTS );
if ( arguments.length === 2 ) {
if ( isFunction( options ) ) {
b = options;
} else {
err = validate( opts, options );
if ( err ) {
throw err;
}
}
} else if ( arguments.length > 2 ) {
err = validate( opts, options );
if ( err ) {
throw err;
}
b = benchmark;
if ( !isFunction( b ) ) {
throw new TypeError( 'invalid argument. Third argument must be a function. Value: `'+b+'`.' );
}
}
// Add the benchmark to the initialization queue:
queue.push( [ name, opts, b ] );
// Perform initialization on the next turn of the event loop (note: this allows all benchmarks to be "registered" within the same turn of the loop; otherwise, we run the risk of registration-execution race conditions (i.e., a benchmark registers and executes before other benchmarks can register, depleting the benchmark queue and leading the harness to close)):
if ( queue.length === 1 ) {
nextTick( initialize );
}
return harness;
}
/**
* Initializes each benchmark.
*
* @private
* @returns {void}
*/
function initialize() {
var idx = -1;
return next();
/**
* Initialize the next benchmark.
*
* @private
* @returns {void}
*/
function next() {
var args;
idx += 1;
// If all benchmarks have been initialized, begin running the benchmarks:
if ( idx === queue.length ) {
queue.length = 0;
return runner.run();
}
// Initialize the next benchmark:
args = queue[ idx ];
init( args[ 0 ], args[ 1 ], args[ 2 ], onInit );
}
/**
* Callback invoked after performing initialization tasks.
*
* @private
* @param {string} name - benchmark name
* @param {Options} opts - benchmark options
* @param {(Function|undefined)} benchmark - function containing benchmark code
* @returns {void}
*/
function onInit( name, opts, benchmark ) {
var b;
var i;
// Create a `Benchmark` instance for each repeat to ensure each benchmark has its own state...
for ( i = 0; i < opts.repeats; i++ ) {
b = new Benchmark( name, opts, benchmark );
b.on( 'result', onResult );
runner.push( b );
}
return next();
}
}
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(string|Object)} result - result
*/
function onResult( result ) {
if (
!isString( result ) &&
!result.ok &&
!result.todo
) {
exitCode = 1;
}
}
/**
* Returns a results stream.
*
* @private
* @param {Object} [options] - options
* @returns {TransformStream} transform stream
*/
function createStream( options ) {
if ( arguments.length ) {
return runner.createStream( options );
}
return runner.createStream();
}
/**
* Closes a benchmark harness.
*
* @private
*/
function close() {
runner.close();
}
/**
* Forcefully exits a benchmark harness.
*
* @private
*/
function exit() {
runner.exit();
}
/**
* Returns the harness exit code.
*
* @private
* @returns {NonNegativeInteger} exit code
*/
function getExitCode() {
return exitCode;
}
setReadOnly( harness, 'createStream', createStream );
setReadOnly( harness, 'close', close );
setReadOnly( harness, 'exit', exit );
setReadOnlyAccessor( harness, 'exitCode', getExitCode );
return harness;
}
// EXPORTS //
module.exports = createHarness;
},{"./../benchmark-class":190,"./../defaults.json":200,"./../runner":217,"./../utils/next_tick.js":222,"./init.js":204,"./validate.js":207,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-function":102,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-string":158,"@stdlib/utils/copy":355,"@stdlib/utils/define-nonenumerable-read-only-accessor":357,"@stdlib/utils/define-nonenumerable-read-only-property":359}],204:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var pretest = require( './pretest.js' );
var iterations = require( './iterations.js' );
// MAIN //
/**
* Performs benchmark initialization tasks.
*
* @private
* @param {string} name - benchmark name
* @param {Options} opts - benchmark options
* @param {(Function|undefined)} benchmark - function containing benchmark code
* @param {Callback} clbk - callback to invoke after completing initialization tasks
* @returns {void}
*/
function init( name, opts, benchmark, clbk ) {
// If no benchmark function, then the benchmark is considered a "todo", so no need to repeat multiple times...
if ( !benchmark ) {
opts.repeats = 1;
return clbk( name, opts, benchmark );
}
// If the `skip` option to `true`, no need to initialize or repeat multiple times as will not be running the benchmark:
if ( opts.skip ) {
opts.repeats = 1;
return clbk( name, opts, benchmark );
}
// Perform pretests:
pretest( name, opts, benchmark, onPreTest );
/**
* Callback invoked upon completing pretests.
*
* @private
* @param {Error} [error] - error object
* @returns {void}
*/
function onPreTest( error ) {
// If the pretests failed, don't run the benchmark multiple times...
if ( error ) {
opts.repeats = 1;
opts.iterations = 1;
return clbk( name, opts, benchmark );
}
// If a user specified an iteration number, we can begin running benchmarks...
if ( opts.iterations ) {
return clbk( name, opts, benchmark );
}
// Determine iteration number:
iterations( name, opts, benchmark, onIterations );
}
/**
* Callback invoked upon determining an iteration number.
*
* @private
* @param {(Error|null)} error - error object
* @param {PositiveInteger} iter - number of iterations
* @returns {void}
*/
function onIterations( error, iter ) {
// If provided an error, then a benchmark failed, and, similar to pretests, don't run the benchmark multiple times...
if ( error ) {
opts.repeats = 1;
opts.iterations = 1;
return clbk( name, opts, benchmark );
}
opts.iterations = iter;
return clbk( name, opts, benchmark );
}
}
// EXPORTS //
module.exports = init;
},{"./iterations.js":205,"./pretest.js":206}],205:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var copy = require( '@stdlib/utils/copy' );
var Benchmark = require( './../benchmark-class' );
// VARIABLES //
var MIN_TIME = 0.1; // seconds
var ITERATIONS = 10; // 10^1
var MAX_ITERATIONS = 10000000000; // 10^10
// MAIN //
/**
* Determines the number of iterations.
*
* @private
* @param {string} name - benchmark name
* @param {Options} options - benchmark options
* @param {(Function|undefined)} benchmark - function containing benchmark code
* @param {Callback} clbk - callback to invoke after determining number of iterations
* @returns {void}
*/
function iterations( name, options, benchmark, clbk ) {
var opts;
var time;
// Elapsed time (in seconds):
time = 0;
// Create a local copy:
opts = copy( options );
opts.iterations = ITERATIONS;
// Begin running benchmarks:
return next();
/**
* Run a new benchmark.
*
* @private
*/
function next() {
var b = new Benchmark( name, opts, benchmark );
b.on( 'result', onResult );
b.once( 'end', onEnd );
b.run();
}
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(string|Object)} result - result
*/
function onResult( result ) {
if ( !isString( result ) && result.operator === 'result' ) {
time = result.elapsed;
}
}
/**
* Callback invoked upon an `end` event.
*
* @private
* @returns {void}
*/
function onEnd() {
if (
time < MIN_TIME &&
opts.iterations < MAX_ITERATIONS
) {
opts.iterations *= 10;
return next();
}
clbk( null, opts.iterations );
}
}
// EXPORTS //
module.exports = iterations;
},{"./../benchmark-class":190,"@stdlib/assert/is-string":158,"@stdlib/utils/copy":355}],206:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var copy = require( '@stdlib/utils/copy' );
var Benchmark = require( './../benchmark-class' );
// MAIN //
/**
* Runs pretests to sanity check and/or catch failures.
*
* @private
* @param {string} name - benchmark name
* @param {Options} options - benchmark options
* @param {(Function|undefined)} benchmark - function containing benchmark code
* @param {Callback} clbk - callback to invoke after completing pretests
*/
function pretest( name, options, benchmark, clbk ) {
var fail;
var opts;
var tic;
var toc;
var b;
// Counters to determine the number of `tic` and `toc` events:
tic = 0;
toc = 0;
// Local copy:
opts = copy( options );
opts.iterations = 1;
// Pretest to check for minimum requirements and/or errors...
b = new Benchmark( name, opts, benchmark );
b.on( 'result', onResult );
b.on( 'tic', onTic );
b.on( 'toc', onToc );
b.once( 'end', onEnd );
b.run();
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(string|Object)} result - result
*/
function onResult( result ) {
if (
!isString( result ) &&
!result.ok &&
!result.todo
) {
fail = true;
}
}
/**
* Callback invoked upon a `tic` event.
*
* @private
*/
function onTic() {
tic += 1;
}
/**
* Callback invoked upon a `toc` event.
*
* @private
*/
function onToc() {
toc += 1;
}
/**
* Callback invoked upon an `end` event.
*
* @private
* @returns {void}
*/
function onEnd() {
var err;
if ( fail ) {
// Possibility that failure is intermittent, but we will assume that the usual case is that the failure would persist across all repeats and no sense failing multiple times when once suffices.
err = new Error( 'benchmark failed' );
} else if ( tic !== 1 || toc !== 1 ) {
// Unable to do anything definitive with timing information (e.g., a tic with no toc or vice versa, or benchmark function calls neither tic nor toc).
err = new Error( 'invalid benchmark' );
}
if ( err ) {
return clbk( err );
}
return clbk();
}
}
// EXPORTS //
module.exports = pretest;
},{"./../benchmark-class":190,"@stdlib/assert/is-string":158,"@stdlib/utils/copy":355}],207:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isNull = require( '@stdlib/assert/is-null' );
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
// MAIN //
/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {boolean} [options.skip] - boolean indicating whether to skip a benchmark
* @param {(PositiveInteger|null)} [options.iterations] - number of iterations
* @param {PositiveInteger} [options.repeats] - number of repeats
* @param {PositiveInteger} [options.timeout] - number of milliseconds before a benchmark automatically fails
* @returns {(Error|null)} error object or null
*
* @example
* var opts = {};
* var options = {
* 'skip': false,
* 'iterations': 1e6,
* 'repeats': 3,
* 'timeout': 10000
* };
*
* var err = validate( opts, options );
* if ( err ) {
* throw err;
* }
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'skip' ) ) {
opts.skip = options.skip;
if ( !isBoolean( opts.skip ) ) {
return new TypeError( 'invalid option. `skip` option must be a boolean primitive. Option: `' + opts.skip + '`.' );
}
}
if ( hasOwnProp( options, 'iterations' ) ) {
opts.iterations = options.iterations;
if (
!isPositiveInteger( opts.iterations ) &&
!isNull( opts.iterations )
) {
return new TypeError( 'invalid option. `iterations` option must be either a positive integer or `null`. Option: `' + opts.iterations + '`.' );
}
}
if ( hasOwnProp( options, 'repeats' ) ) {
opts.repeats = options.repeats;
if ( !isPositiveInteger( opts.repeats ) ) {
return new TypeError( 'invalid option. `repeats` option must be a positive integer. Option: `' + opts.repeats + '`.' );
}
}
if ( hasOwnProp( options, 'timeout' ) ) {
opts.timeout = options.timeout;
if ( !isPositiveInteger( opts.timeout ) ) {
return new TypeError( 'invalid option. `timeout` option must be a positive integer. Option: `' + opts.timeout + '`.' );
}
}
return null;
}
// EXPORTS //
module.exports = validate;
},{"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-null":135,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-positive-integer":149}],208:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Benchmark harness.
*
* @module @stdlib/bench/harness
*
* @example
* var bench = require( '@stdlib/bench/harness' );
*
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*/
// MODULES //
var bench = require( './bench.js' );
// EXPORTS //
module.exports = bench;
},{"./bench.js":180}],209:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var TransformStream = require( '@stdlib/streams/node/transform' );
var fromCodePoint = require( '@stdlib/string/from-code-point' );
var log = require( './log.js' );
// MAIN //
/**
* Returns a Transform stream for logging to the console.
*
* @private
* @returns {TransformStream} transform stream
*/
function createStream() {
var stream;
var line;
stream = new TransformStream({
'transform': transform,
'flush': flush
});
line = '';
return stream;
/**
* Callback invoked upon receiving a new chunk.
*
* @private
* @param {(Buffer|string)} chunk - chunk
* @param {string} enc - Buffer encoding
* @param {Callback} clbk - callback to invoke after transforming the streamed chunk
*/
function transform( chunk, enc, clbk ) {
var c;
var i;
for ( i = 0; i < chunk.length; i++ ) {
c = fromCodePoint( chunk[ i ] );
if ( c === '\n' ) {
flush();
} else {
line += c;
}
}
clbk();
}
/**
* Callback to flush data to `stdout`.
*
* @private
* @param {Callback} [clbk] - callback to invoke after processing data
* @returns {void}
*/
function flush( clbk ) {
try {
log( line );
} catch ( err ) {
stream.emit( 'error', err );
}
line = '';
if ( clbk ) {
return clbk();
}
}
}
// EXPORTS //
module.exports = createStream;
},{"./log.js":210,"@stdlib/streams/node/transform":335,"@stdlib/string/from-code-point":339}],210:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Writes a string to the console.
*
* @private
* @param {string} str - string to write
*/
function log( str ) {
console.log( str ); // eslint-disable-line no-console
}
// EXPORTS //
module.exports = log;
},{}],211:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Removes any pending benchmarks.
*
* @private
*/
function clear() {
/* eslint-disable no-invalid-this */
this._benchmarks.length = 0;
}
// EXPORTS //
module.exports = clear;
},{}],212:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Closes a benchmark runner.
*
* @private
* @returns {void}
*/
function closeRunner() {
/* eslint-disable no-invalid-this */
var self = this;
if ( this._closed ) {
return;
}
this._closed = true;
if ( this._benchmarks.length ) {
this.clear();
this._stream.write( '# WARNING: harness closed before completion.\n' );
} else {
this._stream.write( '#\n' );
this._stream.write( '1..'+this.total+'\n' );
this._stream.write( '# total '+this.total+'\n' );
this._stream.write( '# pass '+this.pass+'\n' );
if ( this.fail ) {
this._stream.write( '# fail '+this.fail+'\n' );
}
if ( this.skip ) {
this._stream.write( '# skip '+this.skip+'\n' );
}
if ( this.todo ) {
this._stream.write( '# todo '+this.todo+'\n' );
}
if ( !this.fail ) {
this._stream.write( '#\n# ok\n' );
}
}
this._stream.once( 'close', onClose );
this._stream.destroy();
/**
* Callback invoked upon a `close` event.
*
* @private
*/
function onClose() {
self.emit( 'close' );
}
}
// EXPORTS //
module.exports = closeRunner;
},{}],213:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
/* eslint-disable no-underscore-dangle */
'use strict';
// MODULES //
var TransformStream = require( '@stdlib/streams/node/transform' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var nextTick = require( './../utils/next_tick.js' );
// VARIABLES //
var TAP_HEADER = 'TAP version 13';
// MAIN //
/**
* Creates a results stream.
*
* @private
* @param {Options} [options] - stream options
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {TransformStream} transform stream
*/
function createStream( options ) {
/* eslint-disable no-invalid-this */
var stream;
var opts;
var self;
var id;
self = this;
if ( arguments.length ) {
opts = options;
} else {
opts = {};
}
stream = new TransformStream( opts );
if ( opts.objectMode ) {
id = 0;
this.on( '_push', onPush );
this.on( 'done', onDone );
} else {
stream.write( TAP_HEADER+'\n' );
this._stream.pipe( stream );
}
this.on( '_run', onRun );
return stream;
/**
* Runs the next benchmark.
*
* @private
*/
function next() {
nextTick( onTick );
}
/**
* Callback invoked upon the next tick.
*
* @private
* @returns {void}
*/
function onTick() {
var b = self._benchmarks.shift();
if ( b ) {
b.run();
if ( !b.ended() ) {
return b.once( 'end', next );
}
return next();
}
self._running = false;
self.emit( 'done' );
}
/**
* Callback invoked upon a run event.
*
* @private
* @returns {void}
*/
function onRun() {
if ( !self._running ) {
self._running = true;
return next();
}
}
/**
* Callback invoked upon a push event.
*
* @private
* @param {Benchmark} b - benchmark
*/
function onPush( b ) {
var bid = id;
id += 1;
b.once( 'prerun', onPreRun );
b.on( 'result', onResult );
b.on( 'end', onEnd );
/**
* Callback invoked upon a `prerun` event.
*
* @private
*/
function onPreRun() {
var row = {
'type': 'benchmark',
'name': b.name,
'id': bid
};
stream.write( row );
}
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(Object|string)} res - result
*/
function onResult( res ) {
if ( isString( res ) ) {
res = {
'benchmark': bid,
'type': 'comment',
'name': res
};
} else if ( res.operator === 'result' ) {
res.benchmark = bid;
res.type = 'result';
} else {
res.benchmark = bid;
res.type = 'assert';
}
stream.write( res );
}
/**
* Callback invoked upon an `end` event.
*
* @private
*/
function onEnd() {
stream.write({
'benchmark': bid,
'type': 'end'
});
}
}
/**
* Callback invoked upon a `done` event.
*
* @private
*/
function onDone() {
stream.destroy();
}
}
// EXPORTS //
module.exports = createStream;
},{"./../utils/next_tick.js":222,"@stdlib/assert/is-string":158,"@stdlib/streams/node/transform":335}],214:[function(require,module,exports){
/* eslint-disable stdlib/jsdoc-require-throws-tags */
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var replace = require( '@stdlib/string/replace' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var reEOL = require( '@stdlib/regexp/eol' );
// VARIABLES //
var RE_WHITESPACE = /\s+/g;
// MAIN //
/**
* Encodes an assertion.
*
* @private
* @param {Object} result - result
* @param {PositiveInteger} count - result count
* @returns {string} encoded assertion
*/
function encodeAssertion( result, count ) {
var actualStack;
var errorStack;
var expected;
var actual;
var indent;
var stack;
var lines;
var out;
var i;
out = '';
if ( !result.ok ) {
out += 'not ';
}
// Add result count:
out += 'ok ' + count;
// Add description:
if ( result.name ) {
out += ' ' + replace( result.name.toString(), RE_WHITESPACE, ' ' );
}
// Append directives:
if ( result.skip ) {
out += ' # SKIP';
} else if ( result.todo ) {
out += ' # TODO';
}
out += '\n';
if ( result.ok ) {
return out;
}
// Format diagnostics as YAML...
indent = ' ';
out += indent + '---\n';
out += indent + 'operator: ' + result.operator + '\n';
if (
hasOwnProp( result, 'actual' ) ||
hasOwnProp( result, 'expected' )
) {
// TODO: inspect object logic (https://github.com/substack/tape/blob/master/lib/results.js#L145)
expected = result.expected;
actual = result.actual;
if ( actual !== actual && expected !== expected ) {
throw new Error( 'TODO: remove me' );
}
}
if ( result.at ) {
out += indent + 'at: ' + result.at + '\n';
}
if ( result.actual ) {
actualStack = result.actual.stack;
}
if ( result.error ) {
errorStack = result.error.stack;
}
if ( actualStack ) {
stack = actualStack;
} else {
stack = errorStack;
}
if ( stack ) {
lines = stack.toString().split( reEOL.REGEXP );
out += indent + 'stack: |-\n';
for ( i = 0; i < lines.length; i++ ) {
out += indent + ' ' + lines[ i ] + '\n';
}
}
out += indent + '...\n';
return out;
}
// EXPORTS //
module.exports = encodeAssertion;
},{"@stdlib/assert/has-own-property":53,"@stdlib/regexp/eol":319,"@stdlib/string/replace":341}],215:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// VARIABLES //
var YAML_INDENT = ' ';
var YAML_BEGIN = YAML_INDENT + '---\n';
var YAML_END = YAML_INDENT + '...\n';
// MAIN //
/**
* Encodes a result as a YAML block.
*
* @private
* @param {Object} result - result
* @returns {string} encoded result
*/
function encodeResult( result ) {
var out = YAML_BEGIN;
out += YAML_INDENT + 'iterations: '+result.iterations+'\n';
out += YAML_INDENT + 'elapsed: '+result.elapsed+'\n';
out += YAML_INDENT + 'rate: '+result.rate+'\n';
out += YAML_END;
return out;
}
// EXPORTS //
module.exports = encodeResult;
},{}],216:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Forcefully exits a benchmark runner.
*
* @private
*/
function exit() {
/* eslint-disable no-invalid-this */
var self;
var i;
for ( i = 0; i < this._benchmarks.length; i++ ) {
this._benchmarks[ i ].exit();
}
self = this;
this.clear();
this._stream.once( 'close', onClose );
this._stream.destroy();
/**
* Callback invoked upon a `close` event.
*
* @private
*/
function onClose() {
self.emit( 'close' );
}
}
// EXPORTS //
module.exports = exit;
},{}],217:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var EventEmitter = require( 'events' ).EventEmitter;
var inherit = require( '@stdlib/utils/inherit' );
var defineProperty = require( '@stdlib/utils/define-property' );
var TransformStream = require( '@stdlib/streams/node/transform' );
var push = require( './push.js' );
var createStream = require( './create_stream.js' );
var run = require( './run.js' );
var clear = require( './clear.js' );
var close = require( './close.js' ); // eslint-disable-line stdlib/no-redeclare
var exit = require( './exit.js' );
// MAIN //
/**
* Benchmark runner.
*
* @private
* @constructor
* @returns {Runner} Runner instance
*
* @example
* var runner = new Runner();
*/
function Runner() {
if ( !( this instanceof Runner ) ) {
return new Runner();
}
EventEmitter.call( this );
// Private properties:
defineProperty( this, '_benchmarks', {
'value': [],
'configurable': false,
'writable': false,
'enumerable': false
});
defineProperty( this, '_stream', {
'value': new TransformStream(),
'configurable': false,
'writable': false,
'enumerable': false
});
defineProperty( this, '_closed', {
'value': false,
'configurable': false,
'writable': true,
'enumerable': false
});
defineProperty( this, '_running', {
'value': false,
'configurable': false,
'writable': true,
'enumerable': false
});
// Public properties:
defineProperty( this, 'total', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
defineProperty( this, 'fail', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
defineProperty( this, 'pass', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
defineProperty( this, 'skip', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
defineProperty( this, 'todo', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
return this;
}
/*
* Inherit from the `EventEmitter` prototype.
*/
inherit( Runner, EventEmitter );
/**
* Adds a new benchmark.
*
* @private
* @memberof Runner.prototype
* @function push
* @param {Benchmark} b - benchmark
*/
defineProperty( Runner.prototype, 'push', {
'value': push,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Creates a results stream.
*
* @private
* @memberof Runner.prototype
* @function createStream
* @param {Options} [options] - stream options
* @returns {TransformStream} transform stream
*/
defineProperty( Runner.prototype, 'createStream', {
'value': createStream,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Runs pending benchmarks.
*
* @private
* @memberof Runner.prototype
* @function run
*/
defineProperty( Runner.prototype, 'run', {
'value': run,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Removes any pending benchmarks.
*
* @private
* @memberof Runner.prototype
* @function clear
*/
defineProperty( Runner.prototype, 'clear', {
'value': clear,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Closes a benchmark runner.
*
* @private
* @memberof Runner.prototype
* @function close
*/
defineProperty( Runner.prototype, 'close', {
'value': close,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Forcefully exits a benchmark runner.
*
* @private
* @memberof Runner.prototype
* @function exit
*/
defineProperty( Runner.prototype, 'exit', {
'value': exit,
'configurable': false,
'writable': false,
'enumerable': false
});
// EXPORTS //
module.exports = Runner;
},{"./clear.js":211,"./close.js":212,"./create_stream.js":213,"./exit.js":216,"./push.js":218,"./run.js":219,"@stdlib/streams/node/transform":335,"@stdlib/utils/define-property":366,"@stdlib/utils/inherit":387,"events":440}],218:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
/* eslint-disable no-underscore-dangle */
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var encodeAssertion = require( './encode_assertion.js' );
var encodeResult = require( './encode_result.js' );
// MAIN //
/**
* Adds a new benchmark.
*
* @private
* @param {Benchmark} b - benchmark
*/
function push( b ) {
/* eslint-disable no-invalid-this */
var self = this;
this._benchmarks.push( b );
b.once( 'prerun', onPreRun );
b.on( 'result', onResult );
this.emit( '_push', b );
/**
* Callback invoked upon a `prerun` event.
*
* @private
*/
function onPreRun() {
self._stream.write( '# '+b.name+'\n' );
}
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(Object|string)} res - result
* @returns {void}
*/
function onResult( res ) {
// Check for a comment...
if ( isString( res ) ) {
return self._stream.write( '# '+res+'\n' );
}
if ( res.operator === 'result' ) {
res = encodeResult( res );
return self._stream.write( res );
}
self.total += 1;
if ( res.ok ) {
if ( res.skip ) {
self.skip += 1;
} else if ( res.todo ) {
self.todo += 1;
}
self.pass += 1;
}
// According to the TAP spec, todos pass even if not "ok"...
else if ( res.todo ) {
self.pass += 1;
self.todo += 1;
}
// Everything else is a failure...
else {
self.fail += 1;
}
res = encodeAssertion( res, self.total );
self._stream.write( res );
}
}
// EXPORTS //
module.exports = push;
},{"./encode_assertion.js":214,"./encode_result.js":215,"@stdlib/assert/is-string":158}],219:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Runs pending benchmarks.
*
* @private
*/
function run() {
/* eslint-disable no-invalid-this */
this.emit( '_run' );
}
// EXPORTS //
module.exports = run;
},{}],220:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var IS_BROWSER = require( '@stdlib/assert/is-browser' );
var canExit = require( './can_exit.js' );
// MAIN //
var bool = ( !IS_BROWSER && canExit );
// EXPORTS //
module.exports = bool;
},{"./can_exit.js":221,"@stdlib/assert/is-browser":87}],221:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var proc = require( './process.js' );
// MAIN //
var bool = ( proc && typeof proc.exit === 'function' );
// EXPORTS //
module.exports = bool;
},{"./process.js":223}],222:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Runs a function on a subsequent turn of the event loop.
*
* ## Notes
*
* - `process.nextTick` is only Node.js.
* - `setImmediate` is non-standard.
* - Everything else is browser based (e.g., mutation observer, requestAnimationFrame, etc).
* - Only API which is universal is `setTimeout`.
* - Note that `0` is not actually `0ms`. Browser environments commonly have a minimum delay of `4ms`. This is acceptable. Here, the main intent of this function is to give the runtime a chance to run garbage collection, clear state, and tend to any other pending tasks before returning control to benchmark tasks. The larger aim (attainable or not) is to provide each benchmark run with as much of a fresh state as possible.
*
*
* @private
* @param {Function} fcn - function to run upon a subsequent turn of the event loop
*/
function nextTick( fcn ) {
setTimeout( fcn, 0 );
}
// EXPORTS //
module.exports = nextTick;
},{}],223:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var proc = require( 'process' );
// EXPORTS //
module.exports = proc;
},{"process":451}],224:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Benchmark harness.
*
* @module @stdlib/bench
*
* @example
* var bench = require( '@stdlib/bench' );
*
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*/
// MODULES //
var bench = require( '@stdlib/bench/harness' );
// EXPORTS //
module.exports = bench;
},{"@stdlib/bench/harness":208}],225:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* BLAS level 1 routine to copy values from `x` into `y`.
*
* @module @stdlib/blas/base/gcopy
*
* @example
* var gcopy = require( '@stdlib/blas/base/gcopy' );
*
* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];
*
* gcopy( x.length, x, 1, y, 1 );
* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
*
* @example
* var gcopy = require( '@stdlib/blas/base/gcopy' );
*
* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];
*
* gcopy.ndarray( x.length, x, 1, 0, y, 1, 0 );
* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var gcopy = require( './main.js' );
var ndarray = require( './ndarray.js' );
// MAIN //
setReadOnly( gcopy, 'ndarray', ndarray );
// EXPORTS //
module.exports = gcopy;
},{"./main.js":226,"./ndarray.js":227,"@stdlib/utils/define-nonenumerable-read-only-property":359}],226:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// VARIABLES //
var M = 8;
// MAIN //
/**
* Copies values from `x` into `y`.
*
* @param {PositiveInteger} N - number of values to copy
* @param {NumericArray} x - input array
* @param {integer} strideX - `x` stride length
* @param {NumericArray} y - destination array
* @param {integer} strideY - `y` stride length
* @returns {NumericArray} `y`
*
* @example
* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];
*
* gcopy( x.length, x, 1, y, 1 );
* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
*/
function gcopy( N, x, strideX, y, strideY ) {
var ix;
var iy;
var m;
var i;
if ( N <= 0 ) {
return y;
}
// Use unrolled loops if both strides are equal to `1`...
if ( strideX === 1 && strideY === 1 ) {
m = N % M;
// If we have a remainder, run a clean-up loop...
if ( m > 0 ) {
for ( i = 0; i < m; i++ ) {
y[ i ] = x[ i ];
}
}
if ( N < M ) {
return y;
}
for ( i = m; i < N; i += M ) {
y[ i ] = x[ i ];
y[ i+1 ] = x[ i+1 ];
y[ i+2 ] = x[ i+2 ];
y[ i+3 ] = x[ i+3 ];
y[ i+4 ] = x[ i+4 ];
y[ i+5 ] = x[ i+5 ];
y[ i+6 ] = x[ i+6 ];
y[ i+7 ] = x[ i+7 ];
}
return y;
}
if ( strideX < 0 ) {
ix = (1-N) * strideX;
} else {
ix = 0;
}
if ( strideY < 0 ) {
iy = (1-N) * strideY;
} else {
iy = 0;
}
for ( i = 0; i < N; i++ ) {
y[ iy ] = x[ ix ];
ix += strideX;
iy += strideY;
}
return y;
}
// EXPORTS //
module.exports = gcopy;
},{}],227:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// VARIABLES //
var M = 8;
// MAIN //
/**
* Copies values from `x` into `y`.
*
* @param {PositiveInteger} N - number of values to copy
* @param {NumericArray} x - input array
* @param {integer} strideX - `x` stride length
* @param {NonNegativeInteger} offsetX - starting `x` index
* @param {NumericArray} y - destination array
* @param {integer} strideY - `y` stride length
* @param {NonNegativeInteger} offsetY - starting `y` index
* @returns {NumericArray} `y`
*
* @example
* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];
*
* gcopy( x.length, x, 1, 0, y, 1, 0 );
* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
*/
function gcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {
var ix;
var iy;
var m;
var i;
if ( N <= 0 ) {
return y;
}
ix = offsetX;
iy = offsetY;
// Use unrolled loops if both strides are equal to `1`...
if ( strideX === 1 && strideY === 1 ) {
m = N % M;
// If we have a remainder, run a clean-up loop...
if ( m > 0 ) {
for ( i = 0; i < m; i++ ) {
y[ iy ] = x[ ix ];
ix += strideX;
iy += strideY;
}
}
if ( N < M ) {
return y;
}
for ( i = m; i < N; i += M ) {
y[ iy ] = x[ ix ];
y[ iy+1 ] = x[ ix+1 ];
y[ iy+2 ] = x[ ix+2 ];
y[ iy+3 ] = x[ ix+3 ];
y[ iy+4 ] = x[ ix+4 ];
y[ iy+5 ] = x[ ix+5 ];
y[ iy+6 ] = x[ ix+6 ];
y[ iy+7 ] = x[ ix+7 ];
ix += M;
iy += M;
}
return y;
}
for ( i = 0; i < N; i++ ) {
y[ iy ] = x[ ix ];
ix += strideX;
iy += strideY;
}
return y;
}
// EXPORTS //
module.exports = gcopy;
},{}],228:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var ctor = require( 'buffer' ).Buffer; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{"buffer":441}],229:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Buffer constructor.
*
* @module @stdlib/buffer/ctor
*
* @example
* var ctor = require( '@stdlib/buffer/ctor' );
*
* var b = new ctor( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*/
// MODULES //
var hasNodeBufferSupport = require( '@stdlib/assert/has-node-buffer-support' );
var main = require( './buffer.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasNodeBufferSupport() ) {
ctor = main;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./buffer.js":228,"./polyfill.js":230,"@stdlib/assert/has-node-buffer-support":51}],230:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: write (browser) polyfill
// MAIN //
/**
* Buffer constructor.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],231:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
var Buffer = require( '@stdlib/buffer/ctor' );
// MAIN //
var bool = isFunction( Buffer.from );
// EXPORTS //
module.exports = bool;
},{"@stdlib/assert/is-function":102,"@stdlib/buffer/ctor":229}],232:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Copy buffer data to a new `Buffer` instance.
*
* @module @stdlib/buffer/from-buffer
*
* @example
* var fromArray = require( '@stdlib/buffer/from-array' );
* var copyBuffer = require( '@stdlib/buffer/from-buffer' );
*
* var b1 = fromArray( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*
* var b2 = copyBuffer( b1 );
* // returns <Buffer>
*/
// MODULES //
var hasFrom = require( './has_from.js' );
var main = require( './main.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var copyBuffer;
if ( hasFrom ) {
copyBuffer = main;
} else {
copyBuffer = polyfill;
}
// EXPORTS //
module.exports = copyBuffer;
},{"./has_from.js":231,"./main.js":233,"./polyfill.js":234}],233:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isBuffer = require( '@stdlib/assert/is-buffer' );
var Buffer = require( '@stdlib/buffer/ctor' );
// MAIN //
/**
* Copies buffer data to a new `Buffer` instance.
*
* @param {Buffer} buffer - buffer from which to copy
* @throws {TypeError} must provide a `Buffer` instance
* @returns {Buffer} new `Buffer` instance
*
* @example
* var fromArray = require( '@stdlib/buffer/from-array' );
*
* var b1 = fromArray( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*
* var b2 = fromBuffer( b1 );
* // returns <Buffer>
*/
function fromBuffer( buffer ) {
if ( !isBuffer( buffer ) ) {
throw new TypeError( 'invalid argument. Must provide a Buffer. Value: `' + buffer + '`' );
}
return Buffer.from( buffer );
}
// EXPORTS //
module.exports = fromBuffer;
},{"@stdlib/assert/is-buffer":88,"@stdlib/buffer/ctor":229}],234:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isBuffer = require( '@stdlib/assert/is-buffer' );
var Buffer = require( '@stdlib/buffer/ctor' );
// MAIN //
/**
* Copies buffer data to a new `Buffer` instance.
*
* @param {Buffer} buffer - buffer from which to copy
* @throws {TypeError} must provide a `Buffer` instance
* @returns {Buffer} new `Buffer` instance
*
* @example
* var fromArray = require( '@stdlib/buffer/from-array' );
*
* var b1 = fromArray( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*
* var b2 = fromBuffer( b1 );
* // returns <Buffer>
*/
function fromBuffer( buffer ) {
if ( !isBuffer( buffer ) ) {
throw new TypeError( 'invalid argument. Must provide a Buffer. Value: `' + buffer + '`' );
}
return new Buffer( buffer ); // eslint-disable-line no-buffer-constructor
}
// EXPORTS //
module.exports = fromBuffer;
},{"@stdlib/assert/is-buffer":88,"@stdlib/buffer/ctor":229}],235:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Maximum length of a generic array.
*
* @module @stdlib/constants/array/max-array-length
*
* @example
* var MAX_ARRAY_LENGTH = require( '@stdlib/constants/array/max-array-length' );
* // returns 4294967295
*/
// MAIN //
/**
* Maximum length of a generic array.
*
* ```tex
* 2^{32} - 1
* ```
*
* @constant
* @type {uinteger32}
* @default 4294967295
*/
var MAX_ARRAY_LENGTH = 4294967295>>>0; // asm type annotation
// EXPORTS //
module.exports = MAX_ARRAY_LENGTH;
},{}],236:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Maximum length of a typed array.
*
* @module @stdlib/constants/array/max-typed-array-length
*
* @example
* var MAX_TYPED_ARRAY_LENGTH = require( '@stdlib/constants/array/max-typed-array-length' );
* // returns 9007199254740991
*/
// MAIN //
/**
* Maximum length of a typed array.
*
* ```tex
* 2^{53} - 1
* ```
*
* @constant
* @type {number}
* @default 9007199254740991
*/
var MAX_TYPED_ARRAY_LENGTH = 9007199254740991;
// EXPORTS //
module.exports = MAX_TYPED_ARRAY_LENGTH;
},{}],237:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* The bias of a double-precision floating-point number's exponent.
*
* @module @stdlib/constants/float64/exponent-bias
* @type {integer32}
*
* @example
* var FLOAT64_EXPONENT_BIAS = require( '@stdlib/constants/float64/exponent-bias' );
* // returns 1023
*/
// MAIN //
/**
* Bias of a double-precision floating-point number's exponent.
*
* ## Notes
*
* The bias can be computed via
*
* ```tex
* \mathrm{bias} = 2^{k-1} - 1
* ```
*
* where \\(k\\) is the number of bits in the exponent; here, \\(k = 11\\).
*
* @constant
* @type {integer32}
* @default 1023
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_EXPONENT_BIAS = 1023|0; // asm type annotation
// EXPORTS //
module.exports = FLOAT64_EXPONENT_BIAS;
},{}],238:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* High word mask for the exponent of a double-precision floating-point number.
*
* @module @stdlib/constants/float64/high-word-exponent-mask
* @type {uinteger32}
*
* @example
* var FLOAT64_HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' );
* // returns 2146435072
*/
// MAIN //
/**
* High word mask for the exponent of a double-precision floating-point number.
*
* ## Notes
*
* The high word mask for the exponent of a double-precision floating-point number is an unsigned 32-bit integer with the value \\( 2146435072 \\), which corresponds to the bit sequence
*
* ```binarystring
* 0 11111111111 00000000000000000000
* ```
*
* @constant
* @type {uinteger32}
* @default 0x7ff00000
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_HIGH_WORD_EXPONENT_MASK = 0x7ff00000;
// EXPORTS //
module.exports = FLOAT64_HIGH_WORD_EXPONENT_MASK;
},{}],239:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* High word mask for the significand of a double-precision floating-point number.
*
* @module @stdlib/constants/float64/high-word-significand-mask
* @type {uinteger32}
*
* @example
* var FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' );
* // returns 1048575
*/
// MAIN //
/**
* High word mask for the significand of a double-precision floating-point number.
*
* ## Notes
*
* The high word mask for the significand of a double-precision floating-point number is an unsigned 32-bit integer with the value \\( 1048575 \\), which corresponds to the bit sequence
*
* ```binarystring
* 0 00000000000 11111111111111111111
* ```
*
* @constant
* @type {uinteger32}
* @default 0x000fffff
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = 0x000fffff;
// EXPORTS //
module.exports = FLOAT64_HIGH_WORD_SIGNIFICAND_MASK;
},{}],240:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Maximum safe double-precision floating-point integer.
*
* @module @stdlib/constants/float64/max-safe-integer
* @type {number}
*
* @example
* var FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );
* // returns 9007199254740991
*/
// MAIN //
/**
* Maximum safe double-precision floating-point integer.
*
* ## Notes
*
* The integer has the value
*
* ```tex
* 2^{53} - 1
* ```
*
* @constant
* @type {number}
* @default 9007199254740991
* @see [Safe Integers]{@link http://www.2ality.com/2013/10/safe-integers.html}
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_MAX_SAFE_INTEGER = 9007199254740991;
// EXPORTS //
module.exports = FLOAT64_MAX_SAFE_INTEGER;
},{}],241:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Double-precision floating-point negative infinity.
*
* @module @stdlib/constants/float64/ninf
* @type {number}
*
* @example
* var FLOAT64_NINF = require( '@stdlib/constants/float64/ninf' );
* // returns -Infinity
*/
// MODULES //
var Number = require( '@stdlib/number/ctor' );
// MAIN //
/**
* Double-precision floating-point negative infinity.
*
* ## Notes
*
* Double-precision floating-point negative infinity has the bit sequence
*
* ```binarystring
* 1 11111111111 00000000000000000000 00000000000000000000000000000000
* ```
*
* @constant
* @type {number}
* @default Number.NEGATIVE_INFINITY
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_NINF = Number.NEGATIVE_INFINITY;
// EXPORTS //
module.exports = FLOAT64_NINF;
},{"@stdlib/number/ctor":286}],242:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Double-precision floating-point positive infinity.
*
* @module @stdlib/constants/float64/pinf
* @type {number}
*
* @example
* var FLOAT64_PINF = require( '@stdlib/constants/float64/pinf' );
* // returns Infinity
*/
// MAIN //
/**
* Double-precision floating-point positive infinity.
*
* ## Notes
*
* Double-precision floating-point positive infinity has the bit sequence
*
* ```binarystring
* 0 11111111111 00000000000000000000 00000000000000000000000000000000
* ```
*
* @constant
* @type {number}
* @default Number.POSITIVE_INFINITY
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_PINF = Number.POSITIVE_INFINITY; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = FLOAT64_PINF;
},{}],243:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Maximum signed 16-bit integer.
*
* @module @stdlib/constants/int16/max
* @type {integer32}
*
* @example
* var INT16_MAX = require( '@stdlib/constants/int16/max' );
* // returns 32767
*/
// MAIN //
/**
* Maximum signed 16-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{15} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 0111111111111111
* ```
*
* @constant
* @type {integer32}
* @default 32767
*/
var INT16_MAX = 32767|0; // asm type annotation
// EXPORTS //
module.exports = INT16_MAX;
},{}],244:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Minimum signed 16-bit integer.
*
* @module @stdlib/constants/int16/min
* @type {integer32}
*
* @example
* var INT16_MIN = require( '@stdlib/constants/int16/min' );
* // returns -32768
*/
// MAIN //
/**
* Minimum signed 16-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* -(2^{15})
* ```
*
* which corresponds to the two's complement bit sequence
*
* ```binarystring
* 1000000000000000
* ```
*
* @constant
* @type {integer32}
* @default -32768
*/
var INT16_MIN = -32768|0; // asm type annotation
// EXPORTS //
module.exports = INT16_MIN;
},{}],245:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Maximum signed 32-bit integer.
*
* @module @stdlib/constants/int32/max
* @type {integer32}
*
* @example
* var INT32_MAX = require( '@stdlib/constants/int32/max' );
* // returns 2147483647
*/
// MAIN //
/**
* Maximum signed 32-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{31} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 01111111111111111111111111111111
* ```
*
* @constant
* @type {integer32}
* @default 2147483647
*/
var INT32_MAX = 2147483647|0; // asm type annotation
// EXPORTS //
module.exports = INT32_MAX;
},{}],246:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Minimum signed 32-bit integer.
*
* @module @stdlib/constants/int32/min
* @type {integer32}
*
* @example
* var INT32_MIN = require( '@stdlib/constants/int32/min' );
* // returns -2147483648
*/
// MAIN //
/**
* Minimum signed 32-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* -(2^{31})
* ```
*
* which corresponds to the two's complement bit sequence
*
* ```binarystring
* 10000000000000000000000000000000
* ```
*
* @constant
* @type {integer32}
* @default -2147483648
*/
var INT32_MIN = -2147483648|0; // asm type annotation
// EXPORTS //
module.exports = INT32_MIN;
},{}],247:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Maximum signed 8-bit integer.
*
* @module @stdlib/constants/int8/max
* @type {integer32}
*
* @example
* var INT8_MAX = require( '@stdlib/constants/int8/max' );
* // returns 127
*/
// MAIN //
/**
* Maximum signed 8-bit integer.
*
* ## Notes
*
* The number is given by
*
* ```tex
* 2^{7} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 01111111
* ```
*
* @constant
* @type {integer32}
* @default 127
*/
var INT8_MAX = 127|0; // asm type annotation
// EXPORTS //
module.exports = INT8_MAX;
},{}],248:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Minimum signed 8-bit integer.
*
* @module @stdlib/constants/int8/min
* @type {integer32}
*
* @example
* var INT8_MIN = require( '@stdlib/constants/int8/min' );
* // returns -128
*/
// MAIN //
/**
* Minimum signed 8-bit integer.
*
* ## Notes
*
* The number is given by
*
* ```tex
* -(2^{7})
* ```
*
* which corresponds to the two's complement bit sequence
*
* ```binarystring
* 10000000
* ```
*
* @constant
* @type {integer32}
* @default -128
*/
var INT8_MIN = -128|0; // asm type annotation
// EXPORTS //
module.exports = INT8_MIN;
},{}],249:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Maximum unsigned 16-bit integer.
*
* @module @stdlib/constants/uint16/max
* @type {integer32}
*
* @example
* var UINT16_MAX = require( '@stdlib/constants/uint16/max' );
* // returns 65535
*/
// MAIN //
/**
* Maximum unsigned 16-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{16} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 1111111111111111
* ```
*
* @constant
* @type {integer32}
* @default 65535
*/
var UINT16_MAX = 65535|0; // asm type annotation
// EXPORTS //
module.exports = UINT16_MAX;
},{}],250:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Maximum unsigned 32-bit integer.
*
* @module @stdlib/constants/uint32/max
* @type {uinteger32}
*
* @example
* var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
* // returns 4294967295
*/
// MAIN //
/**
* Maximum unsigned 32-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{32} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 11111111111111111111111111111111
* ```
*
* @constant
* @type {uinteger32}
* @default 4294967295
*/
var UINT32_MAX = 4294967295;
// EXPORTS //
module.exports = UINT32_MAX;
},{}],251:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Maximum unsigned 8-bit integer.
*
* @module @stdlib/constants/uint8/max
* @type {integer32}
*
* @example
* var UINT8_MAX = require( '@stdlib/constants/uint8/max' );
* // returns 255
*/
// MAIN //
/**
* Maximum unsigned 8-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{8} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 11111111
* ```
*
* @constant
* @type {integer32}
* @default 255
*/
var UINT8_MAX = 255|0; // asm type annotation
// EXPORTS //
module.exports = UINT8_MAX;
},{}],252:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Maximum Unicode code point in the Basic Multilingual Plane (BMP).
*
* @module @stdlib/constants/unicode/max-bmp
* @type {integer32}
*
* @example
* var UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' );
* // returns 65535
*/
// MAIN //
/**
* Maximum Unicode code point in the Basic Multilingual Plane (BMP).
*
* @constant
* @type {integer32}
* @default 65535
* @see [Unicode]{@link https://en.wikipedia.org/wiki/Unicode}
*/
var UNICODE_MAX_BMP = 0xFFFF|0; // asm type annotation
// EXPORTS //
module.exports = UNICODE_MAX_BMP;
},{}],253:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Maximum Unicode code point.
*
* @module @stdlib/constants/unicode/max
* @type {integer32}
*
* @example
* var UNICODE_MAX = require( '@stdlib/constants/unicode/max' );
* // returns 1114111
*/
// MAIN //
/**
* Maximum Unicode code point.
*
* @constant
* @type {integer32}
* @default 1114111
* @see [Unicode]{@link https://en.wikipedia.org/wiki/Unicode}
*/
var UNICODE_MAX = 0x10FFFF|0; // asm type annotation
// EXPORTS //
module.exports = UNICODE_MAX;
},{}],254:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a finite double-precision floating-point number is an integer.
*
* @module @stdlib/math/base/assert/is-integer
*
* @example
* var isInteger = require( '@stdlib/math/base/assert/is-integer' );
*
* var bool = isInteger( 1.0 );
* // returns true
*
* bool = isInteger( 3.14 );
* // returns false
*/
// MODULES //
var isInteger = require( './is_integer.js' );
// EXPORTS //
module.exports = isInteger;
},{"./is_integer.js":255}],255:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var floor = require( '@stdlib/math/base/special/floor' );
// MAIN //
/**
* Tests if a finite double-precision floating-point number is an integer.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is an integer
*
* @example
* var bool = isInteger( 1.0 );
* // returns true
*
* @example
* var bool = isInteger( 3.14 );
* // returns false
*/
function isInteger( x ) {
return (floor(x) === x);
}
// EXPORTS //
module.exports = isInteger;
},{"@stdlib/math/base/special/floor":269}],256:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a double-precision floating-point numeric value is `NaN`.
*
* @module @stdlib/math/base/assert/is-nan
*
* @example
* var isnan = require( '@stdlib/math/base/assert/is-nan' );
*
* var bool = isnan( NaN );
* // returns true
*
* bool = isnan( 7.0 );
* // returns false
*/
// MODULES //
var isnan = require( './main.js' );
// EXPORTS //
module.exports = isnan;
},{"./main.js":257}],257:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Tests if a double-precision floating-point numeric value is `NaN`.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is `NaN`
*
* @example
* var bool = isnan( NaN );
* // returns true
*
* @example
* var bool = isnan( 7.0 );
* // returns false
*/
function isnan( x ) {
return ( x !== x );
}
// EXPORTS //
module.exports = isnan;
},{}],258:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Test if a double-precision floating-point numeric value is positive zero.
*
* @module @stdlib/math/base/assert/is-positive-zero
*
* @example
* var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
*
* var bool = isPositiveZero( 0.0 );
* // returns true
*
* bool = isPositiveZero( -0.0 );
* // returns false
*/
// MODULES //
var isPositiveZero = require( './main.js' );
// EXPORTS //
module.exports = isPositiveZero;
},{"./main.js":259}],259:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var PINF = require( '@stdlib/constants/float64/pinf' );
// MAIN //
/**
* Tests if a double-precision floating-point numeric value is positive zero.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is positive zero
*
* @example
* var bool = isPositiveZero( 0.0 );
* // returns true
*
* @example
* var bool = isPositiveZero( -0.0 );
* // returns false
*/
function isPositiveZero( x ) {
return (x === 0.0 && 1.0/x === PINF);
}
// EXPORTS //
module.exports = isPositiveZero;
},{"@stdlib/constants/float64/pinf":242}],260:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/random/base/randu' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pkg = require( './../package.json' ).name;
var erfcinv = require( './../lib' );
// MAIN //
bench( pkg, function benchmark( b ) {
var x;
var y;
var i;
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
x = ( randu()*2.0 ) - 0.0;
y = erfcinv( x );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
}
b.toc();
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
b.pass( 'benchmark finished' );
b.end();
});
},{"./../lib":262,"./../package.json":268,"@stdlib/bench":224,"@stdlib/math/base/assert/is-nan":256,"@stdlib/random/base/randu":316}],261:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*
*
* ## Notice
*
* The original C++ code and copyright notice are from the [Boost library]{@link http://www.boost.org/doc/libs/1_48_0/boost/math/special_functions/detail/erf_inv.hpp}. This implementation follows the original, but has been modified for JavaScript.
*
* ```text
* (C) Copyright John Maddock 2006.
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
* ```
*/
'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var sqrt = require( '@stdlib/math/base/special/sqrt' );
var ln = require( '@stdlib/math/base/special/ln' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var rationalFcnR1 = require( './rational_p1q1.js' );
var rationalFcnR2 = require( './rational_p2q2.js' );
var rationalFcnR3 = require( './rational_p3q3.js' );
var rationalFcnR4 = require( './rational_p4q4.js' );
var rationalFcnR5 = require( './rational_p5q5.js' );
// VARIABLES //
var Y1 = 8.91314744949340820313e-2;
var Y2 = 2.249481201171875;
var Y3 = 8.07220458984375e-1;
var Y4 = 9.3995571136474609375e-1;
var Y5 = 9.8362827301025390625e-1;
// MAIN //
/**
* Evaluates the inverse complementary error function.
*
* Note that
*
* ```tex
* \operatorname{erfc^{-1}}(1-z) = \operatorname{erf^{-1}}(z)
* ```
*
* ## Method
*
* 1. For \\(|x| \leq 0.5\\), we evaluate the inverse error function using the rational approximation
*
* ```tex
* \operatorname{erf^{-1}}(x) = x(x+10)(\mathrm{Y} + \operatorname{R}(x))
* ```
*
* where \\(Y\\) is a constant and \\(\operatorname{R}(x)\\) is optimized for a low absolute error compared to \\(|Y|\\).
*
* <!-- <note> -->
*
* Max error \\(2.001849\mbox{e-}18\\). Maximum deviation found (error term at infinite precision) \\(8.030\mbox{e-}21\\).
*
* <!-- </note> -->
*
* 2. For \\(0.5 > 1-|x| \geq 0\\), we evaluate the inverse error function using the rational approximation
*
* ```tex
* \operatorname{erf^{-1}} = \frac{\sqrt{-2 \cdot \ln(1-x)}}{\mathrm{Y} + \operatorname{R}(1-x)}
* ```
*
* where \\(Y\\) is a constant, and \\(\operatorname{R}(q)\\) is optimized for a low absolute error compared to \\(Y\\).
*
* <!-- <note> -->
*
* Max error \\(7.403372\mbox{e-}17\\). Maximum deviation found (error term at infinite precision) \\(4.811\mbox{e-}20\\).
*
* <!-- </note> -->
*
* 3. For \\(1-|x| < 0.25\\), we have a series of rational approximations all of the general form
*
* ```tex
* p = \sqrt{-\ln(1-x)}
* ```
*
* Accordingly, the result is given by
*
* ```tex
* \operatorname{erf^{-1}}(x) = p(\mathrm{Y} + \operatorname{R}(p-B))
* ```
*
* where \\(Y\\) is a constant, \\(B\\) is the lowest value of \\(p\\) for which the approximation is valid, and \\(\operatorname{R}(x-B)\\) is optimized for a low absolute error compared to \\(Y\\).
*
* <!-- <note> -->
*
* Almost all code will only go through the first or maybe second approximation. After that we are dealing with very small input values.
*
* - If \\(p < 3\\), max error \\(1.089051\mbox{e-}20\\).
* - If \\(p < 6\\), max error \\(8.389174\mbox{e-}21\\).
* - If \\(p < 18\\), max error \\(1.481312\mbox{e-}19\\).
* - If \\(p < 44\\), max error \\(5.697761\mbox{e-}20\\).
* - If \\(p \geq 44\\), max error \\(1.279746\mbox{e-}20\\).
*
* <!-- </note> -->
*
* <!-- <note> -->
*
* The Boost library can accommodate \\(80\\) and \\(128\\) bit long doubles. JavaScript only supports a \\(64\\) bit double (IEEE 754). Accordingly, the smallest \\(p\\) (in JavaScript at the time of this writing) is \\(\sqrt{-\ln(\sim5\mbox{e-}324)} = 27.284429111150214\\).
*
* <!-- </note> -->
*
*
* @param {number} x - input value
* @returns {number} function value
*
* @example
* var y = erfcinv( 0.5 );
* // returns ~0.4769
*
* @example
* var y = erfcinv( 0.8 );
* // returns ~0.1791
*
* @example
* var y = erfcinv( 0.0 );
* // returns Infinity
*
* @example
* var y = erfcinv( 2.0 );
* // returns -Infinity
*
* @example
* var y = erfcinv( NaN );
* // returns NaN
*/
function erfcinv( x ) {
var sign;
var qs;
var q;
var g;
var r;
// Special case: NaN
if ( isnan( x ) ) {
return NaN;
}
// Special case: 0
if ( x === 0.0 ) {
return PINF;
}
// Special case: 2
if ( x === 2.0 ) {
return NINF;
}
// Special case: 1
if ( x === 1.0 ) {
return 0.0;
}
if ( x > 2.0 || x < 0.0 ) {
return NaN;
}
// Argument reduction (reduce to interval [0,1]). If `x` is outside [0,1], we can take advantage of the complementary error function reflection formula: `erfc(-z) = 2 - erfc(z)`, by negating the result once finished.
if ( x > 1.0 ) {
sign = -1.0;
q = 2.0 - x;
} else {
sign = 1.0;
q = x;
}
x = 1.0 - q;
// x = 1-q <= 0.5
if ( x <= 0.5 ) {
g = x * ( x + 10.0 );
r = rationalFcnR1( x );
return sign * ( (g*Y1) + (g*r) );
}
// q >= 0.25
if ( q >= 0.25 ) {
g = sqrt( -2.0 * ln(q) );
q -= 0.25;
r = rationalFcnR2( q );
return sign * ( g / (Y2+r) );
}
q = sqrt( -ln( q ) );
// q < 3
if ( q < 3.0 ) {
qs = q - 1.125;
r = rationalFcnR3( qs );
return sign * ( (Y3*q) + (r*q) );
}
// q < 6
if ( q < 6.0 ) {
qs = q - 3.0;
r = rationalFcnR4( qs );
return sign * ( (Y4*q) + (r*q) );
}
// q < 18
qs = q - 6.0;
r = rationalFcnR5( qs );
return sign * ( (Y5*q) + (r*q) );
}
// EXPORTS //
module.exports = erfcinv;
},{"./rational_p1q1.js":263,"./rational_p2q2.js":264,"./rational_p3q3.js":265,"./rational_p4q4.js":266,"./rational_p5q5.js":267,"@stdlib/constants/float64/ninf":241,"@stdlib/constants/float64/pinf":242,"@stdlib/math/base/assert/is-nan":256,"@stdlib/math/base/special/ln":271,"@stdlib/math/base/special/sqrt":282}],262:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Evaluate the inverse complementary error function.
*
* @module @stdlib/math/base/special/erfcinv
*
* @example
* var erfcinv = require( '@stdlib/math/base/special/erfcinv' );
*
* var y = erfcinv( 0.5 );
* // returns ~0.4769
*
* y = erfcinv( 0.8 );
* // returns ~-0.1791
*
* y = erfcinv( 0.0 );
* // returns Infinity
*
* y = erfcinv( 2.0 );
* // returns -Infinity
*
* y = erfcinv( NaN );
* // returns NaN
*/
// MODULES //
var erfcinv = require( './erfcinv.js' );
// EXPORTS //
module.exports = erfcinv;
},{"./erfcinv.js":261}],263:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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 is a generated file. Do not edit directly. */
'use strict';
// MAIN //
/**
* Evaluates a rational function, i.e., the ratio of two polynomials described by the coefficients stored in \\(P\\) and \\(Q\\).
*
* ## Notes
*
* - Coefficients should be sorted in ascending degree.
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @private
* @param {number} x - value at which to evaluate the rational function
* @returns {number} evaluated rational function
*/
function evalrational( x ) {
var ax;
var s1;
var s2;
if ( x === 0.0 ) {
return -0.0005087819496582806;
}
if ( x < 0.0 ) {
ax = -x;
} else {
ax = x;
}
if ( ax <= 1.0 ) {
s1 = -0.0005087819496582806 + (x * (-0.008368748197417368 + (x * (0.03348066254097446 + (x * (-0.012692614766297404 + (x * (-0.03656379714117627 + (x * (0.02198786811111689 + (x * (0.008226878746769157 + (x * (-0.005387729650712429 + (x * (0.0 + (x * 0.0))))))))))))))))); // eslint-disable-line max-len
s2 = 1.0 + (x * (-0.9700050433032906 + (x * (-1.5657455823417585 + (x * (1.5622155839842302 + (x * (0.662328840472003 + (x * (-0.7122890234154284 + (x * (-0.05273963823400997 + (x * (0.07952836873415717 + (x * (-0.0023339375937419 + (x * 0.0008862163904564247))))))))))))))))); // eslint-disable-line max-len
} else {
x = 1.0 / x;
s1 = 0.0 + (x * (0.0 + (x * (-0.005387729650712429 + (x * (0.008226878746769157 + (x * (0.02198786811111689 + (x * (-0.03656379714117627 + (x * (-0.012692614766297404 + (x * (0.03348066254097446 + (x * (-0.008368748197417368 + (x * -0.0005087819496582806))))))))))))))))); // eslint-disable-line max-len
s2 = 0.0008862163904564247 + (x * (-0.0023339375937419 + (x * (0.07952836873415717 + (x * (-0.05273963823400997 + (x * (-0.7122890234154284 + (x * (0.662328840472003 + (x * (1.5622155839842302 + (x * (-1.5657455823417585 + (x * (-0.9700050433032906 + (x * 1.0))))))))))))))))); // eslint-disable-line max-len
}
return s1 / s2;
}
// EXPORTS //
module.exports = evalrational;
},{}],264:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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 is a generated file. Do not edit directly. */
'use strict';
// MAIN //
/**
* Evaluates a rational function, i.e., the ratio of two polynomials described by the coefficients stored in \\(P\\) and \\(Q\\).
*
* ## Notes
*
* - Coefficients should be sorted in ascending degree.
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @private
* @param {number} x - value at which to evaluate the rational function
* @returns {number} evaluated rational function
*/
function evalrational( x ) {
var ax;
var s1;
var s2;
if ( x === 0.0 ) {
return -0.20243350835593876;
}
if ( x < 0.0 ) {
ax = -x;
} else {
ax = x;
}
if ( ax <= 1.0 ) {
s1 = -0.20243350835593876 + (x * (0.10526468069939171 + (x * (8.3705032834312 + (x * (17.644729840837403 + (x * (-18.851064805871424 + (x * (-44.6382324441787 + (x * (17.445385985570866 + (x * (21.12946554483405 + (x * -3.6719225470772936))))))))))))))); // eslint-disable-line max-len
s2 = 1.0 + (x * (6.242641248542475 + (x * (3.971343795334387 + (x * (-28.66081804998 + (x * (-20.14326346804852 + (x * (48.560921310873994 + (x * (10.826866735546016 + (x * (-22.643693341313973 + (x * 1.7211476576120028))))))))))))))); // eslint-disable-line max-len
} else {
x = 1.0 / x;
s1 = -3.6719225470772936 + (x * (21.12946554483405 + (x * (17.445385985570866 + (x * (-44.6382324441787 + (x * (-18.851064805871424 + (x * (17.644729840837403 + (x * (8.3705032834312 + (x * (0.10526468069939171 + (x * -0.20243350835593876))))))))))))))); // eslint-disable-line max-len
s2 = 1.7211476576120028 + (x * (-22.643693341313973 + (x * (10.826866735546016 + (x * (48.560921310873994 + (x * (-20.14326346804852 + (x * (-28.66081804998 + (x * (3.971343795334387 + (x * (6.242641248542475 + (x * 1.0))))))))))))))); // eslint-disable-line max-len
}
return s1 / s2;
}
// EXPORTS //
module.exports = evalrational;
},{}],265:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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 is a generated file. Do not edit directly. */
'use strict';
// MAIN //
/**
* Evaluates a rational function, i.e., the ratio of two polynomials described by the coefficients stored in \\(P\\) and \\(Q\\).
*
* ## Notes
*
* - Coefficients should be sorted in ascending degree.
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @private
* @param {number} x - value at which to evaluate the rational function
* @returns {number} evaluated rational function
*/
function evalrational( x ) {
var ax;
var s1;
var s2;
if ( x === 0.0 ) {
return -0.1311027816799519;
}
if ( x < 0.0 ) {
ax = -x;
} else {
ax = x;
}
if ( ax <= 1.0 ) {
s1 = -0.1311027816799519 + (x * (-0.16379404719331705 + (x * (0.11703015634199525 + (x * (0.38707973897260434 + (x * (0.3377855389120359 + (x * (0.14286953440815717 + (x * (0.029015791000532906 + (x * (0.0021455899538880526 + (x * (-6.794655751811263e-7 + (x * (2.8522533178221704e-8 + (x * -6.81149956853777e-10))))))))))))))))))); // eslint-disable-line max-len
s2 = 1.0 + (x * (3.4662540724256723 + (x * (5.381683457070069 + (x * (4.778465929458438 + (x * (2.5930192162362027 + (x * (0.848854343457902 + (x * (0.15226433829533179 + (x * (0.011059242293464892 + (x * (0.0 + (x * (0.0 + (x * 0.0))))))))))))))))))); // eslint-disable-line max-len
} else {
x = 1.0 / x;
s1 = -6.81149956853777e-10 + (x * (2.8522533178221704e-8 + (x * (-6.794655751811263e-7 + (x * (0.0021455899538880526 + (x * (0.029015791000532906 + (x * (0.14286953440815717 + (x * (0.3377855389120359 + (x * (0.38707973897260434 + (x * (0.11703015634199525 + (x * (-0.16379404719331705 + (x * -0.1311027816799519))))))))))))))))))); // eslint-disable-line max-len
s2 = 0.0 + (x * (0.0 + (x * (0.0 + (x * (0.011059242293464892 + (x * (0.15226433829533179 + (x * (0.848854343457902 + (x * (2.5930192162362027 + (x * (4.778465929458438 + (x * (5.381683457070069 + (x * (3.4662540724256723 + (x * 1.0))))))))))))))))))); // eslint-disable-line max-len
}
return s1 / s2;
}
// EXPORTS //
module.exports = evalrational;
},{}],266:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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 is a generated file. Do not edit directly. */
'use strict';
// MAIN //
/**
* Evaluates a rational function, i.e., the ratio of two polynomials described by the coefficients stored in \\(P\\) and \\(Q\\).
*
* ## Notes
*
* - Coefficients should be sorted in ascending degree.
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @private
* @param {number} x - value at which to evaluate the rational function
* @returns {number} evaluated rational function
*/
function evalrational( x ) {
var ax;
var s1;
var s2;
if ( x === 0.0 ) {
return -0.0350353787183178;
}
if ( x < 0.0 ) {
ax = -x;
} else {
ax = x;
}
if ( ax <= 1.0 ) {
s1 = -0.0350353787183178 + (x * (-0.0022242652921344794 + (x * (0.018557330651423107 + (x * (0.009508047013259196 + (x * (0.0018712349281955923 + (x * (0.00015754461742496055 + (x * (0.00000460469890584318 + (x * (-2.304047769118826e-10 + (x * 2.6633922742578204e-12))))))))))))))); // eslint-disable-line max-len
s2 = 1.0 + (x * (1.3653349817554064 + (x * (0.7620591645536234 + (x * (0.22009110576413124 + (x * (0.03415891436709477 + (x * (0.00263861676657016 + (x * (0.00007646752923027944 + (x * (0.0 + (x * 0.0))))))))))))))); // eslint-disable-line max-len
} else {
x = 1.0 / x;
s1 = 2.6633922742578204e-12 + (x * (-2.304047769118826e-10 + (x * (0.00000460469890584318 + (x * (0.00015754461742496055 + (x * (0.0018712349281955923 + (x * (0.009508047013259196 + (x * (0.018557330651423107 + (x * (-0.0022242652921344794 + (x * -0.0350353787183178))))))))))))))); // eslint-disable-line max-len
s2 = 0.0 + (x * (0.0 + (x * (0.00007646752923027944 + (x * (0.00263861676657016 + (x * (0.03415891436709477 + (x * (0.22009110576413124 + (x * (0.7620591645536234 + (x * (1.3653349817554064 + (x * 1.0))))))))))))))); // eslint-disable-line max-len
}
return s1 / s2;
}
// EXPORTS //
module.exports = evalrational;
},{}],267:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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 is a generated file. Do not edit directly. */
'use strict';
// MAIN //
/**
* Evaluates a rational function, i.e., the ratio of two polynomials described by the coefficients stored in \\(P\\) and \\(Q\\).
*
* ## Notes
*
* - Coefficients should be sorted in ascending degree.
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @private
* @param {number} x - value at which to evaluate the rational function
* @returns {number} evaluated rational function
*/
function evalrational( x ) {
var ax;
var s1;
var s2;
if ( x === 0.0 ) {
return -0.016743100507663373;
}
if ( x < 0.0 ) {
ax = -x;
} else {
ax = x;
}
if ( ax <= 1.0 ) {
s1 = -0.016743100507663373 + (x * (-0.0011295143874558028 + (x * (0.001056288621524929 + (x * (0.00020938631748758808 + (x * (0.000014962478375834237 + (x * (4.4969678992770644e-7 + (x * (4.625961635228786e-9 + (x * (-2.811287356288318e-14 + (x * 9.905570997331033e-17))))))))))))))); // eslint-disable-line max-len
s2 = 1.0 + (x * (0.5914293448864175 + (x * (0.1381518657490833 + (x * (0.016074608709367652 + (x * (0.0009640118070051656 + (x * (0.000027533547476472603 + (x * (2.82243172016108e-7 + (x * (0.0 + (x * 0.0))))))))))))))); // eslint-disable-line max-len
} else {
x = 1.0 / x;
s1 = 9.905570997331033e-17 + (x * (-2.811287356288318e-14 + (x * (4.625961635228786e-9 + (x * (4.4969678992770644e-7 + (x * (0.000014962478375834237 + (x * (0.00020938631748758808 + (x * (0.001056288621524929 + (x * (-0.0011295143874558028 + (x * -0.016743100507663373))))))))))))))); // eslint-disable-line max-len
s2 = 0.0 + (x * (0.0 + (x * (2.82243172016108e-7 + (x * (0.000027533547476472603 + (x * (0.0009640118070051656 + (x * (0.016074608709367652 + (x * (0.1381518657490833 + (x * (0.5914293448864175 + (x * 1.0))))))))))))))); // eslint-disable-line max-len
}
return s1 / s2;
}
// EXPORTS //
module.exports = evalrational;
},{}],268:[function(require,module,exports){
module.exports={
"name": "@stdlib/math/base/special/erfcinv",
"version": "0.0.0",
"description": "Inverse complementary error function.",
"license": "Apache-2.0 AND BSL-1.0",
"author": {
"name": "The Stdlib Authors",
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
},
"contributors": [
{
"name": "The Stdlib Authors",
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
}
],
"main": "./lib",
"directories": {
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"lib": "./lib",
"scripts": "./scripts",
"test": "./test"
},
"types": "./docs/types",
"scripts": {},
"homepage": "https://github.com/stdlib-js/stdlib",
"repository": {
"type": "git",
"url": "git://github.com/stdlib-js/stdlib.git"
},
"bugs": {
"url": "https://github.com/stdlib-js/stdlib/issues"
},
"dependencies": {},
"devDependencies": {},
"engines": {
"node": ">=0.10.0",
"npm": ">2.7.0"
},
"os": [
"aix",
"darwin",
"freebsd",
"linux",
"macos",
"openbsd",
"sunos",
"win32",
"windows"
],
"keywords": [
"stdlib",
"stdmath",
"mathematics",
"math",
"erf",
"erfc",
"erfinv",
"erfcinv",
"inverse",
"complementary",
"error",
"function",
"special",
"number"
]
}
},{}],269:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Round a double-precision floating-point number toward negative infinity.
*
* @module @stdlib/math/base/special/floor
*
* @example
* var floor = require( '@stdlib/math/base/special/floor' );
*
* var v = floor( -4.2 );
* // returns -5.0
*
* v = floor( 9.99999 );
* // returns 9.0
*
* v = floor( 0.0 );
* // returns 0.0
*
* v = floor( NaN );
* // returns NaN
*/
// MODULES //
var floor = require( './main.js' );
// EXPORTS //
module.exports = floor;
},{"./main.js":270}],270:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: implementation (?)
/**
* Rounds a double-precision floating-point number toward negative infinity.
*
* @param {number} x - input value
* @returns {number} rounded value
*
* @example
* var v = floor( -4.2 );
* // returns -5.0
*
* @example
* var v = floor( 9.99999 );
* // returns 9.0
*
* @example
* var v = floor( 0.0 );
* // returns 0.0
*
* @example
* var v = floor( NaN );
* // returns NaN
*/
var floor = Math.floor; // eslint-disable-line stdlib/no-builtin-math
// EXPORTS //
module.exports = floor;
},{}],271:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Evaluate the natural logarithm.
*
* @module @stdlib/math/base/special/ln
*
* @example
* var ln = require( '@stdlib/math/base/special/ln' );
*
* var v = ln( 4.0 );
* // returns ~1.386
*
* v = ln( 0.0 );
* // returns -Infinity
*
* v = ln( Infinity );
* // returns Infinity
*
* v = ln( NaN );
* // returns NaN
*
* v = ln( -4.0 );
* // returns NaN
*/
// MODULES //
var ln = require( './ln.js' );
// EXPORTS //
module.exports = ln;
},{"./ln.js":272}],272:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*
*
* ## Notice
*
* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/e_log.c}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ```
*/
'use strict';
// MODULES //
var getHighWord = require( '@stdlib/number/float64/base/get-high-word' );
var setHighWord = require( '@stdlib/number/float64/base/set-high-word' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var BIAS = require( '@stdlib/constants/float64/exponent-bias' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var polyvalP = require( './polyval_p.js' );
var polyvalQ = require( './polyval_q.js' );
// VARIABLES //
var LN2_HI = 6.93147180369123816490e-01; // 3FE62E42 FEE00000
var LN2_LO = 1.90821492927058770002e-10; // 3DEA39EF 35793C76
var TWO54 = 1.80143985094819840000e+16; // 0x43500000, 0x00000000
var ONE_THIRD = 0.33333333333333333;
// 0x000fffff = 1048575 => 0 00000000000 11111111111111111111
var HIGH_SIGNIFICAND_MASK = 0x000fffff|0; // asm type annotation
// 0x7ff00000 = 2146435072 => 0 11111111111 00000000000000000000 => biased exponent: 2047 = 1023+1023 => 2^1023
var HIGH_MAX_NORMAL_EXP = 0x7ff00000|0; // asm type annotation
// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022
var HIGH_MIN_NORMAL_EXP = 0x00100000|0; // asm type annotation
// 0x3ff00000 = 1072693248 => 0 01111111111 00000000000000000000 => biased exponent: 1023 = 0+1023 => 2^0 = 1
var HIGH_BIASED_EXP_0 = 0x3ff00000|0; // asm type annotation
// MAIN //
/**
* Evaluates the natural logarithm.
*
* @param {NonNegativeNumber} x - input value
* @returns {number} function value
*
* @example
* var v = ln( 4.0 );
* // returns ~1.386
*
* @example
* var v = ln( 0.0 );
* // returns -Infinity
*
* @example
* var v = ln( Infinity );
* // returns Infinity
*
* @example
* var v = ln( NaN );
* // returns NaN
*
* @example
* var v = ln( -4.0 );
* // returns NaN
*/
function ln( x ) {
var hfsq;
var hx;
var t2;
var t1;
var k;
var R;
var f;
var i;
var j;
var s;
var w;
var z;
if ( x === 0.0 ) {
return NINF;
}
if ( isnan( x ) || x < 0.0 ) {
return NaN;
}
hx = getHighWord( x );
k = 0|0; // asm type annotation
if ( hx < HIGH_MIN_NORMAL_EXP ) {
// Case: 0 < x < 2**-1022
k -= 54|0; // asm type annotation
// Subnormal number, scale up `x`:
x *= TWO54;
hx = getHighWord( x );
}
if ( hx >= HIGH_MAX_NORMAL_EXP ) {
return x + x;
}
k += ( ( hx>>20 ) - BIAS )|0; // asm type annotation
hx &= HIGH_SIGNIFICAND_MASK;
i = ( (hx+0x95f64) & 0x100000 )|0; // asm type annotation
// Normalize `x` or `x/2`...
x = setHighWord( x, hx|(i^HIGH_BIASED_EXP_0) );
k += ( i>>20 )|0; // asm type annotation
f = x - 1.0;
if ( (HIGH_SIGNIFICAND_MASK&(2+hx)) < 3 ) {
// Case: -2**-20 <= f < 2**-20
if ( f === 0.0 ) {
if ( k === 0 ) {
return 0.0;
}
return (k * LN2_HI) + (k * LN2_LO);
}
R = f * f * ( 0.5 - (ONE_THIRD*f) );
if ( k === 0 ) {
return f - R;
}
return (k * LN2_HI) - ( (R-(k*LN2_LO)) - f );
}
s = f / (2.0 + f);
z = s * s;
i = ( hx - 0x6147a )|0; // asm type annotation
w = z * z;
j = ( 0x6b851 - hx )|0; // asm type annotation
t1 = w * polyvalP( w );
t2 = z * polyvalQ( w );
i |= j;
R = t2 + t1;
if ( i > 0 ) {
hfsq = 0.5 * f * f;
if ( k === 0 ) {
return f - ( hfsq - (s * (hfsq+R)) );
}
return (k * LN2_HI) - ( hfsq - ((s*(hfsq+R))+(k*LN2_LO)) - f );
}
if ( k === 0 ) {
return f - (s*(f-R));
}
return (k * LN2_HI) - ( ( (s*(f-R)) - (k*LN2_LO) ) - f );
}
// EXPORTS //
module.exports = ln;
},{"./polyval_p.js":273,"./polyval_q.js":274,"@stdlib/constants/float64/exponent-bias":237,"@stdlib/constants/float64/ninf":241,"@stdlib/math/base/assert/is-nan":256,"@stdlib/number/float64/base/get-high-word":292,"@stdlib/number/float64/base/set-high-word":295}],273:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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 is a generated file. Do not edit directly. */
'use strict';
// MAIN //
/**
* Evaluates a polynomial.
*
* ## Notes
*
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @private
* @param {number} x - value at which to evaluate the polynomial
* @returns {number} evaluated polynomial
*/
function evalpoly( x ) {
if ( x === 0.0 ) {
return 0.3999999999940942;
}
return 0.3999999999940942 + (x * (0.22222198432149784 + (x * 0.15313837699209373))); // eslint-disable-line max-len
}
// EXPORTS //
module.exports = evalpoly;
},{}],274:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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 is a generated file. Do not edit directly. */
'use strict';
// MAIN //
/**
* Evaluates a polynomial.
*
* ## Notes
*
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @private
* @param {number} x - value at which to evaluate the polynomial
* @returns {number} evaluated polynomial
*/
function evalpoly( x ) {
if ( x === 0.0 ) {
return 0.6666666666666735;
}
return 0.6666666666666735 + (x * (0.2857142874366239 + (x * (0.1818357216161805 + (x * 0.14798198605116586))))); // eslint-disable-line max-len
}
// EXPORTS //
module.exports = evalpoly;
},{}],275:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return the maximum value.
*
* @module @stdlib/math/base/special/max
*
* @example
* var max = require( '@stdlib/math/base/special/max' );
*
* var v = max( 3.14, 4.2 );
* // returns 4.2
*
* v = max( 5.9, 3.14, 4.2 );
* // returns 5.9
*
* v = max( 3.14, NaN );
* // returns NaN
*
* v = max( +0.0, -0.0 );
* // returns +0.0
*/
// MODULES //
var max = require( './max.js' );
// EXPORTS //
module.exports = max;
},{"./max.js":276}],276:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var PINF = require( '@stdlib/constants/float64/pinf' );
// MAIN //
/**
* Returns the maximum value.
*
* @param {number} [x] - first number
* @param {number} [y] - second number
* @param {...number} [args] - numbers
* @returns {number} maximum value
*
* @example
* var v = max( 3.14, 4.2 );
* // returns 4.2
*
* @example
* var v = max( 5.9, 3.14, 4.2 );
* // returns 5.9
*
* @example
* var v = max( 3.14, NaN );
* // returns NaN
*
* @example
* var v = max( +0.0, -0.0 );
* // returns +0.0
*/
function max( x, y ) {
var len;
var m;
var v;
var i;
len = arguments.length;
if ( len === 2 ) {
if ( isnan( x ) || isnan( y ) ) {
return NaN;
}
if ( x === PINF || y === PINF ) {
return PINF;
}
if ( x === y && x === 0.0 ) {
if ( isPositiveZero( x ) ) {
return x;
}
return y;
}
if ( x > y ) {
return x;
}
return y;
}
m = NINF;
for ( i = 0; i < len; i++ ) {
v = arguments[ i ];
if ( isnan( v ) || v === PINF ) {
return v;
}
if ( v > m ) {
m = v;
} else if (
v === m &&
v === 0.0 &&
isPositiveZero( v )
) {
m = v;
}
}
return m;
}
// EXPORTS //
module.exports = max;
},{"@stdlib/constants/float64/ninf":241,"@stdlib/constants/float64/pinf":242,"@stdlib/math/base/assert/is-nan":256,"@stdlib/math/base/assert/is-positive-zero":258}],277:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Decompose a double-precision floating-point number into integral and fractional parts.
*
* @module @stdlib/math/base/special/modf
*
* @example
* var modf = require( '@stdlib/math/base/special/modf' );
*
* var parts = modf( 3.14 );
* // returns [ 3.0, 0.14000000000000012 ]
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var modf = require( '@stdlib/math/base/special/modf' );
*
* var out = new Float64Array( 2 );
*
* var parts = modf( out, 3.14 );
* // returns [ 3.0, 0.14000000000000012 ]
*
* var bool = ( parts === out );
* // returns true
*/
// MODULES //
var modf = require( './main.js' );
// EXPORTS //
module.exports = modf;
},{"./main.js":278}],278:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var fcn = require( './modf.js' );
// MAIN //
/**
* Decomposes a double-precision floating-point number into integral and fractional parts, each having the same type and sign as the input value.
*
* @param {(Array|TypedArray|Object)} [out] - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var parts = modf( 3.14 );
* // returns [ 3.0, 0.14000000000000012 ]
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var out = new Float64Array( 2 );
*
* var parts = modf( out, 3.14 );
* // returns <Float64Array>[ 3.0, 0.14000000000000012 ]
*
* var bool = ( parts === out );
* // returns true
*/
function modf( out, x ) {
if ( arguments.length === 1 ) {
return fcn( [ 0.0, 0.0 ], out );
}
return fcn( out, x );
}
// EXPORTS //
module.exports = modf;
},{"./modf.js":279}],279:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var toWords = require( '@stdlib/number/float64/base/to-words' );
var fromWords = require( '@stdlib/number/float64/base/from-words' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var FLOAT64_EXPONENT_BIAS = require( '@stdlib/constants/float64/exponent-bias' );
var FLOAT64_HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' ); // eslint-disable-line id-length
var FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' ); // eslint-disable-line id-length
// VARIABLES //
// 4294967295 => 0xffffffff => 11111111111111111111111111111111
var ALL_ONES = 4294967295>>>0; // asm type annotation
// High/low words workspace:
var WORDS = [ 0|0, 0|0 ]; // WARNING: not thread safe
// MAIN //
/**
* Decomposes a double-precision floating-point number into integral and fractional parts, each having the same type and sign as the input value.
*
* @private
* @param {(Array|TypedArray|Object)} out - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var parts = modf( [ 0.0, 0.0 ], 3.14 );
* // returns [ 3.0, 0.14000000000000012 ]
*/
function modf( out, x ) {
var high;
var low;
var exp;
var i;
// Special cases...
if ( x < 1.0 ) {
if ( x < 0.0 ) {
modf( out, -x );
out[ 0 ] *= -1.0;
out[ 1 ] *= -1.0;
return out;
}
if ( x === 0.0 ) { // [ +-0, +-0 ]
out[ 0 ] = x;
out[ 1 ] = x;
return out;
}
out[ 0 ] = 0.0;
out[ 1 ] = x;
return out;
}
if ( isnan( x ) ) {
out[ 0 ] = NaN;
out[ 1 ] = NaN;
return out;
}
if ( x === PINF ) {
out[ 0 ] = PINF;
out[ 1 ] = 0.0;
return out;
}
// Decompose |x|...
// Extract the high and low words:
toWords( WORDS, x );
high = WORDS[ 0 ];
low = WORDS[ 1 ];
// Extract the unbiased exponent from the high word:
exp = ((high & FLOAT64_HIGH_WORD_EXPONENT_MASK) >> 20)|0; // asm type annotation
exp -= FLOAT64_EXPONENT_BIAS|0; // asm type annotation
// Handle smaller values (x < 2**20 = 1048576)...
if ( exp < 20 ) {
i = (FLOAT64_HIGH_WORD_SIGNIFICAND_MASK >> exp)|0; // asm type annotation
// Determine if `x` is integral by checking for significand bits which cannot be exponentiated away...
if ( ((high&i)|low) === 0 ) {
out[ 0 ] = x;
out[ 1 ] = 0.0;
return out;
}
// Turn off all the bits which cannot be exponentiated away:
high &= (~i);
// Generate the integral part:
i = fromWords( high, 0 );
// The fractional part is whatever is leftover:
out[ 0 ] = i;
out[ 1 ] = x - i;
return out;
}
// Check if `x` can even have a fractional part...
if ( exp > 51 ) {
// `x` is integral:
out[ 0 ] = x;
out[ 1 ] = 0.0;
return out;
}
i = ALL_ONES >>> (exp-20);
// Determine if `x` is integral by checking for less significant significand bits which cannot be exponentiated away...
if ( (low&i) === 0 ) {
out[ 0 ] = x;
out[ 1 ] = 0.0;
return out;
}
// Turn off all the bits which cannot be exponentiated away:
low &= (~i);
// Generate the integral part:
i = fromWords( high, low );
// The fractional part is whatever is leftover:
out[ 0 ] = i;
out[ 1 ] = x - i;
return out;
}
// EXPORTS //
module.exports = modf;
},{"@stdlib/constants/float64/exponent-bias":237,"@stdlib/constants/float64/high-word-exponent-mask":238,"@stdlib/constants/float64/high-word-significand-mask":239,"@stdlib/constants/float64/pinf":242,"@stdlib/math/base/assert/is-nan":256,"@stdlib/number/float64/base/from-words":288,"@stdlib/number/float64/base/to-words":297}],280:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: implementation
/**
* Round a numeric value to the nearest integer.
*
* @module @stdlib/math/base/special/round
*
* @example
* var round = require( '@stdlib/math/base/special/round' );
*
* var v = round( -4.2 );
* // returns -4.0
*
* v = round( -4.5 );
* // returns -4.0
*
* v = round( -4.6 );
* // returns -5.0
*
* v = round( 9.99999 );
* // returns 10.0
*
* v = round( 9.5 );
* // returns 10.0
*
* v = round( 9.2 );
* // returns 9.0
*
* v = round( 0.0 );
* // returns 0.0
*
* v = round( -0.0 );
* // returns -0.0
*
* v = round( Infinity );
* // returns Infinity
*
* v = round( -Infinity );
* // returns -Infinity
*
* v = round( NaN );
* // returns NaN
*/
// MODULES //
var round = require( './round.js' );
// EXPORTS //
module.exports = round;
},{"./round.js":281}],281:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// TODO: implementation
/**
* Rounds a numeric value to the nearest integer.
*
* @param {number} x - input value
* @returns {number} function value
*
* @example
* var v = round( -4.2 );
* // returns -4.0
*
* @example
* var v = round( -4.5 );
* // returns -4.0
*
* @example
* var v = round( -4.6 );
* // returns -5.0
*
* @example
* var v = round( 9.99999 );
* // returns 10.0
*
* @example
* var v = round( 9.5 );
* // returns 10.0
*
* @example
* var v = round( 9.2 );
* // returns 9.0
*
* @example
* var v = round( 0.0 );
* // returns 0.0
*
* @example
* var v = round( -0.0 );
* // returns -0.0
*
* @example
* var v = round( Infinity );
* // returns Infinity
*
* @example
* var v = round( -Infinity );
* // returns -Infinity
*
* @example
* var v = round( NaN );
* // returns NaN
*/
var round = Math.round; // eslint-disable-line stdlib/no-builtin-math
// EXPORTS //
module.exports = round;
},{}],282:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Compute the principal square root of a double-precision floating-point number.
*
* @module @stdlib/math/base/special/sqrt
*
* @example
* var sqrt = require( '@stdlib/math/base/special/sqrt' );
*
* var v = sqrt( 4.0 );
* // returns 2.0
*
* v = sqrt( 9.0 );
* // returns 3.0
*
* v = sqrt( 0.0 );
* // returns 0.0
*
* v = sqrt( -4.0 );
* // returns NaN
*
* v = sqrt( NaN );
* // returns NaN
*/
// MODULES //
var sqrt = require( './main.js' );
// EXPORTS //
module.exports = sqrt;
},{"./main.js":283}],283:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Compute the principal square root of a double-precision floating-point number.
*
* @type {Function}
* @param {number} x - input value
* @returns {number} principal square root
*
* @example
* var v = sqrt( 4.0 );
* // returns 2.0
*
* v = sqrt( 9.0 );
* // returns 3.0
*
* v = sqrt( 0.0 );
* // returns 0.0
*
* v = sqrt( -4.0 );
* // returns NaN
*
* v = sqrt( NaN );
* // returns NaN
*/
var sqrt = Math.sqrt; // eslint-disable-line stdlib/no-builtin-math
// EXPORTS //
module.exports = sqrt;
},{}],284:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Perform C-like multiplication of two unsigned 32-bit integers.
*
* @module @stdlib/math/base/special/uimul
*
* @example
* var uimul = require( '@stdlib/math/base/special/uimul' );
*
* var v = uimul( 10>>>0, 4>>>0 );
* // returns 40
*/
// MODULES //
var uimul = require( './main.js' );
// EXPORTS //
module.exports = uimul;
},{"./main.js":285}],285:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// VARIABLES //
// Define a mask for the least significant 16 bits (low word): 65535 => 0x0000ffff => 00000000000000001111111111111111
var LOW_WORD_MASK = 0x0000ffff>>>0; // asm type annotation
// MAIN //
/**
* Performs C-like multiplication of two unsigned 32-bit integers.
*
* ## Method
*
* - To emulate C-like multiplication without the aid of 64-bit integers, we recognize that a 32-bit integer can be split into two 16-bit words
*
* ```tex
* a = w_h*2^{16} + w_l
* ```
*
* where \\( w_h \\) is the most significant 16 bits and \\( w_l \\) is the least significant 16 bits. For example, consider the maximum unsigned 32-bit integer \\( 2^{32}-1 \\)
*
* ```binarystring
* 11111111111111111111111111111111
* ```
*
* The 16-bit high word is then
*
* ```binarystring
* 1111111111111111
* ```
*
* and the 16-bit low word
*
* ```binarystring
* 1111111111111111
* ```
*
* If we cast the high word to 32-bit precision and multiply by \\( 2^{16} \\) (equivalent to a 16-bit left shift), then the bit sequence is
*
* ```binarystring
* 11111111111111110000000000000000
* ```
*
* Similarly, upon casting the low word to 32-bit precision, the bit sequence is
*
* ```binarystring
* 00000000000000001111111111111111
* ```
*
* From the rules of binary addition, we recognize that adding the two 32-bit values for the high and low words will return our original value \\( 2^{32}-1 \\).
*
* - Accordingly, the multiplication of two 32-bit integers can be expressed
*
* ```tex
* \begin{align*}
* a \cdot b &= ( a_h \cdot 2^{16} + a_l) \cdot ( b_h \cdot 2^{16} + b_l) \\
* &= a_l \cdot b_l + a_h \cdot b_l \cdot 2^{16} + a_l \cdot b_h \cdot 2^{16} + (a_h \cdot b_h) \cdot 2^{32} \\
* &= a_l \cdot b_l + (a_h \cdot b_l + a_l \cdot b_h) \cdot 2^{16} + (a_h \cdot b_h) \cdot 2^{32}
* \end{align*}
* ```
*
* - We note that multiplying (dividing) an integer by \\( 2^n \\) is equivalent to performing a left (right) shift of \\( n \\) bits.
*
* - Further, as we want to return an integer of the same precision, for a 32-bit integer, the return value will be modulo \\( 2^{32} \\). Stated another way, we only care about the low word of a 64-bit result.
*
* - Accordingly, the last term, being evenly divisible by \\( 2^{32} \\), drops from the equation leaving the remaining two terms as the remainder.
*
* ```tex
* a \cdot b = a_l \cdot b_l + (a_h \cdot b_l + a_l \cdot b_h) << 16
* ```
*
* - Lastly, the second term in the above equation contributes to the middle bits and may cause the product to "overflow". However, we can disregard (`>>>0`) overflow bits due modulo arithmetic, as discussed earlier with regard to the term involving the partial product of high words.
*
*
* @param {uinteger32} a - integer
* @param {uinteger32} b - integer
* @returns {uinteger32} product
*
* @example
* var v = uimul( 10>>>0, 4>>>0 );
* // returns 40
*/
function uimul( a, b ) {
var lbits;
var mbits;
var ha;
var hb;
var la;
var lb;
a >>>= 0; // asm type annotation
b >>>= 0; // asm type annotation
// Isolate the most significant 16-bits:
ha = ( a>>>16 )>>>0; // asm type annotation
hb = ( b>>>16 )>>>0; // asm type annotation
// Isolate the least significant 16-bits:
la = ( a&LOW_WORD_MASK )>>>0; // asm type annotation
lb = ( b&LOW_WORD_MASK )>>>0; // asm type annotation
// Compute partial sums:
lbits = ( la*lb )>>>0; // asm type annotation; no integer overflow possible
mbits = ( ((ha*lb) + (la*hb))<<16 )>>>0; // asm type annotation; possible integer overflow
// The final `>>>0` converts the intermediate sum to an unsigned integer (possible integer overflow during sum):
return ( lbits + mbits )>>>0; // asm type annotation
}
// EXPORTS //
module.exports = uimul;
},{}],286:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Constructor which returns a `Number` object.
*
* @module @stdlib/number/ctor
*
* @example
* var Number = require( '@stdlib/number/ctor' );
*
* var v = new Number( 10.0 );
* // returns <Number>
*/
// MODULES //
var Number = require( './number.js' );
// EXPORTS //
module.exports = Number;
},{"./number.js":287}],287:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// EXPORTS //
module.exports = Number; // eslint-disable-line stdlib/require-globals
},{}],288:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Create a double-precision floating-point number from a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* @module @stdlib/number/float64/base/from-words
*
* @example
* var fromWords = require( '@stdlib/number/float64/base/from-words' );
*
* var v = fromWords( 1774486211, 2479577218 );
* // returns 3.14e201
*
* v = fromWords( 3221823995, 1413754136 );
* // returns -3.141592653589793
*
* v = fromWords( 0, 0 );
* // returns 0.0
*
* v = fromWords( 2147483648, 0 );
* // returns -0.0
*
* v = fromWords( 2146959360, 0 );
* // returns NaN
*
* v = fromWords( 2146435072, 0 );
* // returns Infinity
*
* v = fromWords( 4293918720, 0 );
* // returns -Infinity
*/
// MODULES //
var fromWords = require( './main.js' );
// EXPORTS //
module.exports = fromWords;
},{"./main.js":290}],289:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isLittleEndian = require( '@stdlib/assert/is-little-endian' );
// MAIN //
var indices;
var HIGH;
var LOW;
if ( isLittleEndian === true ) {
HIGH = 1; // second index
LOW = 0; // first index
} else {
HIGH = 0; // first index
LOW = 1; // second index
}
indices = {
'HIGH': HIGH,
'LOW': LOW
};
// EXPORTS //
module.exports = indices;
},{"@stdlib/assert/is-little-endian":116}],290:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var Uint32Array = require( '@stdlib/array/uint32' );
var Float64Array = require( '@stdlib/array/float64' );
var indices = require( './indices.js' );
// VARIABLES //
var FLOAT64_VIEW = new Float64Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );
var HIGH = indices.HIGH;
var LOW = indices.LOW;
// MAIN //
/**
* Creates a double-precision floating-point number from a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* ## Notes
*
* ```text
* float64 (64 bits)
* f := fraction (significand/mantissa) (52 bits)
* e := exponent (11 bits)
* s := sign bit (1 bit)
*
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Float64 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Uint32 | Uint32 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* ```
*
* If little endian (more significant bits last):
*
* ```text
* <-- lower higher -->
* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |
* ```
*
* If big endian (more significant bits first):
*
* ```text
* <-- higher lower -->
* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |
* ```
*
*
* In which Uint32 should we place the higher order bits? If little endian, the second; if big endian, the first.
*
*
* ## References
*
* - [Open Group][1]
*
* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm
*
* @param {uinteger32} high - higher order word (unsigned 32-bit integer)
* @param {uinteger32} low - lower order word (unsigned 32-bit integer)
* @returns {number} floating-point number
*
* @example
* var v = fromWords( 1774486211, 2479577218 );
* // returns 3.14e201
*
* @example
* var v = fromWords( 3221823995, 1413754136 );
* // returns -3.141592653589793
*
* @example
* var v = fromWords( 0, 0 );
* // returns 0.0
*
* @example
* var v = fromWords( 2147483648, 0 );
* // returns -0.0
*
* @example
* var v = fromWords( 2146959360, 0 );
* // returns NaN
*
* @example
* var v = fromWords( 2146435072, 0 );
* // returns Infinity
*
* @example
* var v = fromWords( 4293918720, 0 );
* // returns -Infinity
*/
function fromWords( high, low ) {
UINT32_VIEW[ HIGH ] = high;
UINT32_VIEW[ LOW ] = low;
return FLOAT64_VIEW[ 0 ];
}
// EXPORTS //
module.exports = fromWords;
},{"./indices.js":289,"@stdlib/array/float64":5,"@stdlib/array/uint32":23}],291:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isLittleEndian = require( '@stdlib/assert/is-little-endian' );
// MAIN //
var HIGH;
if ( isLittleEndian === true ) {
HIGH = 1; // second index
} else {
HIGH = 0; // first index
}
// EXPORTS //
module.exports = HIGH;
},{"@stdlib/assert/is-little-endian":116}],292:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return an unsigned 32-bit integer corresponding to the more significant 32 bits of a double-precision floating-point number.
*
* @module @stdlib/number/float64/base/get-high-word
*
* @example
* var getHighWord = require( '@stdlib/number/float64/base/get-high-word' );
*
* var w = getHighWord( 3.14e201 ); // => 01101001110001001000001011000011
* // returns 1774486211
*/
// MODULES //
var getHighWord = require( './main.js' );
// EXPORTS //
module.exports = getHighWord;
},{"./main.js":293}],293:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var Uint32Array = require( '@stdlib/array/uint32' );
var Float64Array = require( '@stdlib/array/float64' );
var HIGH = require( './high.js' );
// VARIABLES //
var FLOAT64_VIEW = new Float64Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );
// MAIN //
/**
* Returns an unsigned 32-bit integer corresponding to the more significant 32 bits of a double-precision floating-point number.
*
* ## Notes
*
* ```text
* float64 (64 bits)
* f := fraction (significand/mantissa) (52 bits)
* e := exponent (11 bits)
* s := sign bit (1 bit)
*
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Float64 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Uint32 | Uint32 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* ```
*
* If little endian (more significant bits last):
*
* ```text
* <-- lower higher -->
* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |
* ```
*
* If big endian (more significant bits first):
*
* ```text
* <-- higher lower -->
* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |
* ```
*
* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.
*
*
* ## References
*
* - [Open Group][1]
*
* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm
*
* @param {number} x - input value
* @returns {uinteger32} higher order word
*
* @example
* var w = getHighWord( 3.14e201 ); // => 01101001110001001000001011000011
* // returns 1774486211
*/
function getHighWord( x ) {
FLOAT64_VIEW[ 0 ] = x;
return UINT32_VIEW[ HIGH ];
}
// EXPORTS //
module.exports = getHighWord;
},{"./high.js":291,"@stdlib/array/float64":5,"@stdlib/array/uint32":23}],294:[function(require,module,exports){
arguments[4][291][0].apply(exports,arguments)
},{"@stdlib/assert/is-little-endian":116,"dup":291}],295:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Set the more significant 32 bits of a double-precision floating-point number.
*
* @module @stdlib/number/float64/base/set-high-word
*
* @example
* var setHighWord = require( '@stdlib/number/float64/base/set-high-word' );
*
* var high = 5 >>> 0; // => 0 00000000000 00000000000000000101
*
* var y = setHighWord( 3.14e201, high ); // => 0 00000000000 0000000000000000010110010011110010110101100010000010
* // returns 1.18350528745e-313
*
* @example
* var setHighWord = require( '@stdlib/number/float64/base/set-high-word' );
* var PINF = require( '@stdlib/constants/float64/pinf' ); // => 0 11111111111 00000000000000000000 00000000000000000000000000000000
*
* var high = 1072693248 >>> 0; // => 0 01111111111 00000000000000000000
*
* // Set the higher order bits of `+infinity` to return `1`:
* var y = setHighWord( PINF, high ); => 0 01111111111 0000000000000000000000000000000000000000000000000000
* // returns 1.0
*/
// MODULES //
var setHighWord = require( './main.js' );
// EXPORTS //
module.exports = setHighWord;
},{"./main.js":296}],296:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var Uint32Array = require( '@stdlib/array/uint32' );
var Float64Array = require( '@stdlib/array/float64' );
var HIGH = require( './high.js' );
// VARIABLES //
var FLOAT64_VIEW = new Float64Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );
// MAIN //
/**
* Sets the more significant 32 bits of a double-precision floating-point number.
*
* ## Notes
*
* ```text
* float64 (64 bits)
* f := fraction (significand/mantissa) (52 bits)
* e := exponent (11 bits)
* s := sign bit (1 bit)
*
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Float64 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Uint32 | Uint32 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* ```
*
* If little endian (more significant bits last):
*
* ```text
* <-- lower higher -->
* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |
* ```
*
* If big endian (more significant bits first):
*
* ```text
* <-- higher lower -->
* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |
* ```
*
* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.
*
*
* ## References
*
* - [Open Group][1]
*
* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm
*
* @param {number} x - double
* @param {uinteger32} high - unsigned 32-bit integer to replace the higher order word of `x`
* @returns {number} double having the same lower order word as `x`
*
* @example
* var high = 5 >>> 0; // => 0 00000000000 00000000000000000101
*
* var y = setHighWord( 3.14e201, high ); // => 0 00000000000 0000000000000000010110010011110010110101100010000010
* // returns 1.18350528745e-313
*
* @example
* var PINF = require( '@stdlib/constants/float64/pinf' ); // => 0 11111111111 00000000000000000000 00000000000000000000000000000000
*
* var high = 1072693248 >>> 0; // => 0 01111111111 00000000000000000000
*
* // Set the higher order bits of `+infinity` to return `1`:
* var y = setHighWord( PINF, high ); // => 0 01111111111 0000000000000000000000000000000000000000000000000000
* // returns 1.0
*/
function setHighWord( x, high ) {
FLOAT64_VIEW[ 0 ] = x;
UINT32_VIEW[ HIGH ] = ( high >>> 0 ); // identity bit shift to ensure integer
return FLOAT64_VIEW[ 0 ];
}
// EXPORTS //
module.exports = setHighWord;
},{"./high.js":294,"@stdlib/array/float64":5,"@stdlib/array/uint32":23}],297:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Split a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* @module @stdlib/number/float64/base/to-words
*
* @example
* var toWords = require( '@stdlib/number/float64/base/to-words' );
*
* var w = toWords( 3.14e201 );
* // returns [ 1774486211, 2479577218 ]
*
* @example
* var Uint32Array = require( '@stdlib/array/uint32' );
* var toWords = require( '@stdlib/number/float64/base/to-words' );
*
* var out = new Uint32Array( 2 );
*
* var w = toWords( out, 3.14e201 );
* // returns <Uint32Array>[ 1774486211, 2479577218 ]
*
* var bool = ( w === out );
* // returns true
*/
// MODULES //
var toWords = require( './main.js' );
// EXPORTS //
module.exports = toWords;
},{"./main.js":299}],298:[function(require,module,exports){
arguments[4][289][0].apply(exports,arguments)
},{"@stdlib/assert/is-little-endian":116,"dup":289}],299:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var fcn = require( './to_words.js' );
// MAIN //
/**
* Splits a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* @param {(Array|TypedArray|Object)} [out] - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var w = toWords( 3.14e201 );
* // returns [ 1774486211, 2479577218 ]
*
* @example
* var Uint32Array = require( '@stdlib/array/uint32' );
*
* var out = new Uint32Array( 2 );
*
* var w = toWords( out, 3.14e201 );
* // returns <Uint32Array>[ 1774486211, 2479577218 ]
*
* var bool = ( w === out );
* // returns true
*/
function toWords( out, x ) {
if ( arguments.length === 1 ) {
return fcn( [ 0, 0 ], out );
}
return fcn( out, x );
}
// EXPORTS //
module.exports = toWords;
},{"./to_words.js":300}],300:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var Uint32Array = require( '@stdlib/array/uint32' );
var Float64Array = require( '@stdlib/array/float64' );
var indices = require( './indices.js' );
// VARIABLES //
var FLOAT64_VIEW = new Float64Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );
var HIGH = indices.HIGH;
var LOW = indices.LOW;
// MAIN //
/**
* Splits a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* ## Notes
*
* ```text
* float64 (64 bits)
* f := fraction (significand/mantissa) (52 bits)
* e := exponent (11 bits)
* s := sign bit (1 bit)
*
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Float64 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Uint32 | Uint32 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* ```
*
* If little endian (more significant bits last):
*
* ```text
* <-- lower higher -->
* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |
* ```
*
* If big endian (more significant bits first):
*
* ```text
* <-- higher lower -->
* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |
* ```
*
* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.
*
*
* ## References
*
* - [Open Group][1]
*
* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm
*
*
* @private
* @param {(Array|TypedArray|Object)} out - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var Uint32Array = require( '@stdlib/array/uint32' );
*
* var out = new Uint32Array( 2 );
*
* var w = toWords( out, 3.14e201 );
* // returns <Uint32Array>[ 1774486211, 2479577218 ]
*
* var bool = ( w === out );
* // returns true
*/
function toWords( out, x ) {
FLOAT64_VIEW[ 0 ] = x;
out[ 0 ] = UINT32_VIEW[ HIGH ];
out[ 1 ] = UINT32_VIEW[ LOW ];
return out;
}
// EXPORTS //
module.exports = toWords;
},{"./indices.js":298,"@stdlib/array/float64":5,"@stdlib/array/uint32":23}],301:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/assert/is-nan' );
// VARIABLES //
var NUM_WARMUPS = 8;
// MAIN //
/**
* Initializes a shuffle table.
*
* @private
* @param {PRNG} rand - pseudorandom number generator
* @param {Int32Array} table - table
* @param {PositiveInteger} N - table size
* @throws {Error} PRNG returned `NaN`
* @returns {NumberArray} shuffle table
*/
function createTable( rand, table, N ) {
var v;
var i;
// "warm-up" the PRNG...
for ( i = 0; i < NUM_WARMUPS; i++ ) {
v = rand();
// Prevent the above loop from being discarded by the compiler...
if ( isnan( v ) ) {
throw new Error( 'unexpected error. PRNG returned `NaN`.' );
}
}
// Initialize the shuffle table...
for ( i = N-1; i >= 0; i-- ) {
table[ i ] = rand();
}
return table;
}
// EXPORTS //
module.exports = createTable;
},{"@stdlib/math/base/assert/is-nan":256}],302:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
/* eslint-disable max-len */
'use strict';
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isObject = require( '@stdlib/assert/is-plain-object' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isCollection = require( '@stdlib/assert/is-collection' );
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var isInt32Array = require( '@stdlib/assert/is-int32array' );
var gcopy = require( '@stdlib/blas/base/gcopy' );
var floor = require( '@stdlib/math/base/special/floor' );
var Int32Array = require( '@stdlib/array/int32' );
var INT32_MAX = require( '@stdlib/constants/int32/max' );
var typedarray2json = require( '@stdlib/array/to-json' );
var createTable = require( './create_table.js' );
var randint32 = require( './rand_int32.js' );
// VARIABLES //
var NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation
var MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation
var A = 16807|0; // asm type annotation
// Define the number of elements in the shuffle table:
var TABLE_LENGTH = 32;
// Define the state array schema version:
var STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!
// Define the number of sections in the state array:
var NUM_STATE_SECTIONS = 3; // table, other, seed
// Define the index offset of the "table" section in the state array:
var TABLE_SECTION_OFFSET = 2; // | version | num_sections | table_length | ...table | other_length | shuffle_state | prng_state | seed_length | ...seed |
// Define the index offset of the "state" section in the state array:
var STATE_SECTION_OFFSET = TABLE_LENGTH + 3; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |
// Define the index offset of the seed section in the state array:
var SEED_SECTION_OFFSET = TABLE_LENGTH + 6; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |
// Define the length of the "fixed" length portion of the state array:
var STATE_FIXED_LENGTH = TABLE_LENGTH + 7; // 1 (version) + 1 (num_sections) + 1 (table_length) + TABLE_LENGTH (table) + 1 (state_length) + 1 (shuffle_state) + 1 (prng_state) + 1 (seed_length)
// Define the indices for the shuffle table and PRNG states:
var SHUFFLE_STATE = STATE_SECTION_OFFSET + 1;
var PRNG_STATE = STATE_SECTION_OFFSET + 2;
// FUNCTIONS //
/**
* Verifies state array integrity.
*
* @private
* @param {Int32Array} state - state array
* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)
* @returns {(Error|null)} an error or `null`
*/
function verifyState( state, FLG ) {
var s1;
if ( FLG ) {
s1 = 'option';
} else {
s1 = 'argument';
}
// The state array must have a minimum length...
if ( state.length < STATE_FIXED_LENGTH+1 ) {
return new RangeError( 'invalid '+s1+'. `state` array has insufficient length.' );
}
// The first element of the state array must equal the supported state array schema version...
if ( state[ 0 ] !== STATE_ARRAY_VERSION ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible schema version. Expected: '+STATE_ARRAY_VERSION+'. Actual: '+state[ 0 ]+'.' );
}
// The second element of the state array must contain the number of sections...
if ( state[ 1 ] !== NUM_STATE_SECTIONS ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible number of sections. Expected: '+NUM_STATE_SECTIONS+'. Actual: '+state[ 1 ]+'.' );
}
// The length of the "table" section must equal `TABLE_LENGTH`...
if ( state[ TABLE_SECTION_OFFSET ] !== TABLE_LENGTH ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible table length. Expected: '+TABLE_LENGTH+'. Actual: '+state[ TABLE_SECTION_OFFSET ]+'.' );
}
// The length of the "state" section must equal `2`...
if ( state[ STATE_SECTION_OFFSET ] !== 2 ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible state length. Expected: '+(2).toString()+'. Actual: '+state[ STATE_SECTION_OFFSET ]+'.' );
}
// The length of the "seed" section much match the empirical length...
if ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {
return new RangeError( 'invalid '+s1+'. `state` array length is incompatible with seed section length. Expected: '+(state.length-STATE_FIXED_LENGTH)+'. Actual: '+state[ SEED_SECTION_OFFSET ]+'.' );
}
return null;
}
// MAIN //
/**
* Returns a linear congruential pseudorandom number generator (LCG) whose output is shuffled.
*
* @param {Options} [options] - options
* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed
* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state
* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
* @throws {TypeError} options argument must be an object
* @throws {TypeError} a seed must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer
* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer
* @throws {TypeError} state must be an `Int32Array`
* @throws {Error} must provide a valid state
* @throws {TypeError} `copy` option must be a boolean
* @returns {PRNG} shuffled LCG PRNG
*
* @example
* var minstd = factory();
*
* var v = minstd();
* // returns <number>
*
* @example
* // Return a seeded LCG:
* var minstd = factory({
* 'seed': 1234
* });
*
* var v = minstd();
* // returns 1421600654
*/
function factory( options ) {
var STATE;
var state;
var opts;
var seed;
var slen;
var err;
opts = {};
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'copy' ) ) {
opts.copy = options.copy;
if ( !isBoolean( options.copy ) ) {
throw new TypeError( 'invalid option. `copy` option must be a boolean. Option: `' + options.copy + '`.' );
}
}
if ( hasOwnProp( options, 'state' ) ) {
state = options.state;
opts.state = true;
if ( !isInt32Array( state ) ) {
throw new TypeError( 'invalid option. `state` option must be an Int32Array. Option: `' + state + '`.' );
}
err = verifyState( state, true );
if ( err ) {
throw err;
}
if ( opts.copy === false ) {
STATE = state;
} else {
STATE = new Int32Array( state.length );
gcopy( state.length, state, 1, STATE, 1 );
}
// Create a state (table) "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );
// Create a seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );
}
// If provided a PRNG state, we ignore the `seed` option...
if ( seed === void 0 ) {
if ( hasOwnProp( options, 'seed' ) ) {
seed = options.seed;
opts.seed = true;
if ( isPositiveInteger( seed ) ) {
if ( seed > MAX_SEED ) {
throw new RangeError( 'invalid option. `seed` option must be a positive integer less than the maximum signed 32-bit integer. Option: `' + seed + '`.' );
}
seed |= 0; // asm type annotation
} else if ( isCollection( seed ) && seed.length > 0 ) {
slen = seed.length;
STATE = new Int32Array( STATE_FIXED_LENGTH+slen );
// Initialize sections:
STATE[ 0 ] = STATE_ARRAY_VERSION;
STATE[ 1 ] = NUM_STATE_SECTIONS;
STATE[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;
STATE[ STATE_SECTION_OFFSET ] = 2;
STATE[ PRNG_STATE ] = seed[ 0 ];
STATE[ SEED_SECTION_OFFSET ] = slen;
// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:
gcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );
// Create a state (table) "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );
// Create a seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );
// Initialize the internal PRNG state:
state = createTable( minstd, state, TABLE_LENGTH );
STATE[ SHUFFLE_STATE ] = state[ 0 ];
} else {
throw new TypeError( 'invalid option. `seed` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `' + seed + '`.' );
}
} else {
seed = randint32()|0; // asm type annotation
}
}
} else {
seed = randint32()|0; // asm type annotation
}
if ( state === void 0 ) {
STATE = new Int32Array( STATE_FIXED_LENGTH+1 );
// Initialize sections:
STATE[ 0 ] = STATE_ARRAY_VERSION;
STATE[ 1 ] = NUM_STATE_SECTIONS;
STATE[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;
STATE[ STATE_SECTION_OFFSET ] = 2;
STATE[ PRNG_STATE ] = seed;
STATE[ SEED_SECTION_OFFSET ] = 1;
STATE[ SEED_SECTION_OFFSET+1 ] = seed;
// Create a state (table) "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );
// Create a seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Initialize the internal PRNG state:
state = createTable( minstd, state, TABLE_LENGTH );
STATE[ SHUFFLE_STATE ] = state[ 0 ];
}
setReadOnly( minstdShuffle, 'NAME', 'minstd-shuffle' );
setReadOnlyAccessor( minstdShuffle, 'seed', getSeed );
setReadOnlyAccessor( minstdShuffle, 'seedLength', getSeedLength );
setReadWriteAccessor( minstdShuffle, 'state', getState, setState );
setReadOnlyAccessor( minstdShuffle, 'stateLength', getStateLength );
setReadOnlyAccessor( minstdShuffle, 'byteLength', getStateSize );
setReadOnly( minstdShuffle, 'toJSON', toJSON );
setReadOnly( minstdShuffle, 'MIN', 1 );
setReadOnly( minstdShuffle, 'MAX', INT32_MAX-1 );
setReadOnly( minstdShuffle, 'normalized', normalized );
setReadOnly( normalized, 'NAME', minstdShuffle.NAME );
setReadOnlyAccessor( normalized, 'seed', getSeed );
setReadOnlyAccessor( normalized, 'seedLength', getSeedLength );
setReadWriteAccessor( normalized, 'state', getState, setState );
setReadOnlyAccessor( normalized, 'stateLength', getStateLength );
setReadOnlyAccessor( normalized, 'byteLength', getStateSize );
setReadOnly( normalized, 'toJSON', toJSON );
setReadOnly( normalized, 'MIN', (minstdShuffle.MIN-1.0) / NORMALIZATION_CONSTANT );
setReadOnly( normalized, 'MAX', (minstdShuffle.MAX-1.0) / NORMALIZATION_CONSTANT );
return minstdShuffle;
/**
* Returns the PRNG seed.
*
* @private
* @returns {PRNGSeedMINSTD} seed
*/
function getSeed() {
var len = STATE[ SEED_SECTION_OFFSET ];
return gcopy( len, seed, 1, new Int32Array( len ), 1 );
}
/**
* Returns the PRNG seed length.
*
* @private
* @returns {PositiveInteger} seed length
*/
function getSeedLength() {
return STATE[ SEED_SECTION_OFFSET ];
}
/**
* Returns the PRNG state length.
*
* @private
* @returns {PositiveInteger} state length
*/
function getStateLength() {
return STATE.length;
}
/**
* Returns the PRNG state size (in bytes).
*
* @private
* @returns {PositiveInteger} state size (in bytes)
*/
function getStateSize() {
return STATE.byteLength;
}
/**
* Returns the current PRNG state.
*
* ## Notes
*
* - The PRNG state array is comprised of a preamble followed by `3` sections:
*
* 0. preamble (version + number of sections)
* 1. shuffle table
* 2. internal PRNG state
* 3. PRNG seed
*
* - The first element of the PRNG state array preamble is the state array schema version.
*
* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).
*
* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.
*
* @private
* @returns {PRNGStateMINSTD} current state
*/
function getState() {
var len = STATE.length;
return gcopy( len, STATE, 1, new Int32Array( len ), 1 );
}
/**
* Sets the PRNG state.
*
* ## Notes
*
* - If PRNG state is "shared" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.
* - If PRNG state is "shared" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).
*
* @private
* @param {PRNGStateMINSTD} s - generator state
* @throws {TypeError} must provide an `Int32Array`
* @throws {Error} must provide a valid state
*/
function setState( s ) {
var err;
if ( !isInt32Array( s ) ) {
throw new TypeError( 'invalid argument. Must provide an Int32Array. Value: `' + s + '`.' );
}
err = verifyState( s, false );
if ( err ) {
throw err;
}
if ( opts.copy === false ) {
if ( opts.state && s.length === STATE.length ) {
gcopy( s.length, s, 1, STATE, 1 ); // update current shared state
} else {
STATE = s; // point to new shared state
opts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation
}
} else {
// Check if we can reuse allocated memory...
if ( s.length !== STATE.length ) {
STATE = new Int32Array( s.length ); // reallocate
}
gcopy( s.length, s, 1, STATE, 1 );
}
// Create a new state (table) "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );
// Create a new seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );
}
/**
* Serializes the pseudorandom number generator as a JSON object.
*
* ## Notes
*
* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.
*
* @private
* @returns {Object} JSON representation
*/
function toJSON() {
var out = {};
out.type = 'PRNG';
out.name = minstdShuffle.NAME;
out.state = typedarray2json( STATE );
out.params = [];
return out;
}
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{31}-1) \\).
*
* @private
* @returns {integer32} pseudorandom integer
*/
function minstd() {
var s = STATE[ PRNG_STATE ]|0; // asm type annotation
s = ( (A*s)%INT32_MAX )|0; // asm type annotation
STATE[ PRNG_STATE ] = s;
return s|0; // asm type annotation
}
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{31}-1) \\).
*
* @private
* @returns {integer32} pseudorandom integer
*
* @example
* var v = minstd();
* // returns <number>
*/
function minstdShuffle() {
var s;
var i;
s = STATE[ SHUFFLE_STATE ];
i = floor( TABLE_LENGTH * (s/INT32_MAX) );
// Pull a state from the table:
s = state[ i ];
// Update the PRNG state:
STATE[ SHUFFLE_STATE ] = s;
// Replace the pulled state:
state[ i ] = minstd();
return s;
}
/**
* Generates a pseudorandom number on the interval \\( [0,1) \\).
*
* @private
* @returns {number} pseudorandom number
*
* @example
* var v = normalized();
* // returns <number>
*/
function normalized() {
return (minstdShuffle()-1) / NORMALIZATION_CONSTANT;
}
}
// EXPORTS //
module.exports = factory;
},{"./create_table.js":301,"./rand_int32.js":305,"@stdlib/array/int32":10,"@stdlib/array/to-json":17,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-collection":90,"@stdlib/assert/is-int32array":106,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-positive-integer":149,"@stdlib/blas/base/gcopy":225,"@stdlib/constants/int32/max":245,"@stdlib/math/base/special/floor":269,"@stdlib/utils/define-nonenumerable-read-only-accessor":357,"@stdlib/utils/define-nonenumerable-read-only-property":359,"@stdlib/utils/define-nonenumerable-read-write-accessor":361}],303:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* A linear congruential pseudorandom number generator (LCG) whose output is shuffled.
*
* @module @stdlib/random/base/minstd-shuffle
*
* @example
* var minstd = require( '@stdlib/random/base/minstd-shuffle' );
*
* var v = minstd();
* // returns <number>
*
* @example
* var factory = require( '@stdlib/random/base/minstd-shuffle' ).factory;
*
* var minstd = factory({
* 'seed': 1234
* });
*
* var v = minstd();
* // returns 1421600654
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var minstd = require( './main.js' );
var factory = require( './factory.js' );
// MAIN //
setReadOnly( minstd, 'factory', factory );
// EXPORTS //
module.exports = minstd;
},{"./factory.js":302,"./main.js":304,"@stdlib/utils/define-nonenumerable-read-only-property":359}],304:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var factory = require( './factory.js' );
var randint32 = require( './rand_int32.js' );
// MAIN //
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{31}-1) \\).
*
* ## Method
*
* Linear congruential generators (LCGs) use the recurrence relation
*
* ```tex
* X_{n+1} = ( a \cdot X_n + c ) \operatorname{mod}(m)
* ```
*
* where the modulus \\( m \\) is a prime number or power of a prime number and \\( a \\) is a primitive root modulo \\( m \\).
*
* <!-- <note> -->
*
* For an LCG to be a Lehmer RNG, the seed \\( X_0 \\) must be coprime to \\( m \\).
*
* <!-- </note> -->
*
* In this implementation, the constants \\( a \\), \\( c \\), and \\( m \\) have the values
*
* ```tex
* \begin{align*}
* a &= 7^5 = 16807 \\
* c &= 0 \\
* m &= 2^{31} - 1 = 2147483647
* \end{align*}
* ```
*
* <!-- <note> -->
*
* The constant \\( m \\) is a Mersenne prime (modulo \\(31\\)).
*
* <!-- </note> -->
*
* <!-- <note> -->
*
* The constant \\( a \\) is a primitive root (modulo \\(31\\)).
*
* <!-- </note> -->
*
* Accordingly, the maximum possible product is
*
* ```tex
* 16807 \cdot (m - 1) \approx 2^{46}
* ```
*
* The values for \\( a \\), \\( c \\), and \\( m \\) are taken from Park and Miller, "Random Number Generators: Good Ones Are Hard To Find". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.
*
* This implementation subsequently shuffles the output of a linear congruential pseudorandom number generator (LCG) using a shuffle table in accordance with the Bays-Durham algorithm.
*
*
* ## Notes
*
* - The generator has a period of approximately \\(2.1\mbox{e}9\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).
*
*
* ## References
*
* - Bays, Carter, and S. D. Durham. 1976. "Improving a Poor Random Number Generator." _ACM Transactions on Mathematical Software_ 2 (1). New York, NY, USA: ACM: 59–64. doi:[10.1145/355666.355670](http://dx.doi.org/10.1145/355666.355670).
* - Herzog, T.N., and G. Lord. 2002. _Applications of Monte Carlo Methods to Finance and Insurance_. ACTEX Publications. [https://books.google.com/books?id=vC7I\\\_gdX-A0C](https://books.google.com/books?id=vC7I\_gdX-A0C).
* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.
*
*
* @function minstd
* @type {PRNG}
* @returns {PositiveInteger} pseudorandom integer
*
* @example
* var v = minstd();
* // returns <number>
*/
var minstd = factory({
'seed': randint32()
});
// EXPORTS //
module.exports = minstd;
},{"./factory.js":302,"./rand_int32.js":305}],305:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var INT32_MAX = require( '@stdlib/constants/int32/max' );
var floor = require( '@stdlib/math/base/special/floor' );
// VARIABLES //
var MAX = INT32_MAX - 1;
// MAIN //
/**
* Returns a pseudorandom integer on the interval \\([1, 2^{31}-1)\\).
*
* @private
* @returns {PositiveInteger} pseudorandom integer
*
* @example
* var v = randint32();
* // returns <number>
*/
function randint32() {
var v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math
return v|0; // asm type annotation
}
// EXPORTS //
module.exports = randint32;
},{"@stdlib/constants/int32/max":245,"@stdlib/math/base/special/floor":269}],306:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
/* eslint-disable max-len */
'use strict';
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isObject = require( '@stdlib/assert/is-plain-object' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isCollection = require( '@stdlib/assert/is-collection' );
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var isInt32Array = require( '@stdlib/assert/is-int32array' );
var INT32_MAX = require( '@stdlib/constants/int32/max' );
var Int32Array = require( '@stdlib/array/int32' );
var gcopy = require( '@stdlib/blas/base/gcopy' );
var typedarray2json = require( '@stdlib/array/to-json' );
var randint32 = require( './rand_int32.js' );
// VARIABLES //
var NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation
var MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation
var A = 16807|0; // asm type annotation
// Define the state array schema version:
var STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!
// Define the number of sections in the state array:
var NUM_STATE_SECTIONS = 2; // state, seed
// Define the index offset of the "state" section in the state array:
var STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | seed_length | ...seed |
// Define the index offset of the seed section in the state array:
var SEED_SECTION_OFFSET = 4; // | version | num_sections | state_length | ...state | seed_length | ...seed |
// Define the length of the "fixed" length portion of the state array:
var STATE_FIXED_LENGTH = 5; // 1 (version) + 1 (num_sections) + 1 (state_length) + 1 (state) + 1 (seed_length)
// FUNCTIONS //
/**
* Verifies state array integrity.
*
* @private
* @param {Int32Array} state - state array
* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)
* @returns {(Error|null)} an error or `null`
*/
function verifyState( state, FLG ) {
var s1;
if ( FLG ) {
s1 = 'option';
} else {
s1 = 'argument';
}
// The state array must have a minimum length...
if ( state.length < STATE_FIXED_LENGTH+1 ) {
return new RangeError( 'invalid '+s1+'. `state` array has insufficient length.' );
}
// The first element of the state array must equal the supported state array schema version...
if ( state[ 0 ] !== STATE_ARRAY_VERSION ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible schema version. Expected: '+STATE_ARRAY_VERSION+'. Actual: '+state[ 0 ]+'.' );
}
// The second element of the state array must contain the number of sections...
if ( state[ 1 ] !== NUM_STATE_SECTIONS ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible number of sections. Expected: '+NUM_STATE_SECTIONS+'. Actual: '+state[ 1 ]+'.' );
}
// The length of the "state" section must equal `1`...
if ( state[ STATE_SECTION_OFFSET ] !== 1 ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible state length. Expected: '+(1).toString()+'. Actual: '+state[ STATE_SECTION_OFFSET ]+'.' );
}
// The length of the "seed" section much match the empirical length...
if ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {
return new RangeError( 'invalid '+s1+'. `state` array length is incompatible with seed section length. Expected: '+(state.length-STATE_FIXED_LENGTH)+'. Actual: '+state[ SEED_SECTION_OFFSET ]+'.' );
}
return null;
}
// MAIN //
/**
* Returns a linear congruential pseudorandom number generator (LCG) based on Park and Miller.
*
* @param {Options} [options] - options
* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed
* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state
* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
* @throws {TypeError} options argument must be an object
* @throws {TypeError} a seed must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer
* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer
* @throws {TypeError} state must be an `Int32Array`
* @throws {Error} must provide a valid state
* @throws {TypeError} `copy` option must be a boolean
* @returns {PRNG} LCG PRNG
*
* @example
* var minstd = factory();
*
* var v = minstd();
* // returns <number>
*
* @example
* // Return a seeded LCG:
* var minstd = factory({
* 'seed': 1234
* });
*
* var v = minstd();
* // returns 20739838
*/
function factory( options ) {
var STATE;
var state;
var opts;
var seed;
var slen;
var err;
opts = {};
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'copy' ) ) {
opts.copy = options.copy;
if ( !isBoolean( options.copy ) ) {
throw new TypeError( 'invalid option. `copy` option must be a boolean. Option: `' + options.copy + '`.' );
}
}
if ( hasOwnProp( options, 'state' ) ) {
state = options.state;
opts.state = true;
if ( !isInt32Array( state ) ) {
throw new TypeError( 'invalid option. `state` option must be an Int32Array. Option: `' + state + '`.' );
}
err = verifyState( state, true );
if ( err ) {
throw err;
}
if ( opts.copy === false ) {
STATE = state;
} else {
STATE = new Int32Array( state.length );
gcopy( state.length, state, 1, STATE, 1 );
}
// Create a state "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Create a seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );
}
// If provided a PRNG state, we ignore the `seed` option...
if ( seed === void 0 ) {
if ( hasOwnProp( options, 'seed' ) ) {
seed = options.seed;
opts.seed = true;
if ( isPositiveInteger( seed ) ) {
if ( seed > MAX_SEED ) {
throw new RangeError( 'invalid option. `seed` option must be a positive integer less than the maximum signed 32-bit integer. Option: `' + seed + '`.' );
}
seed |= 0; // asm type annotation
} else if ( isCollection( seed ) && seed.length > 0 ) {
slen = seed.length;
STATE = new Int32Array( STATE_FIXED_LENGTH+slen );
// Initialize sections:
STATE[ 0 ] = STATE_ARRAY_VERSION;
STATE[ 1 ] = NUM_STATE_SECTIONS;
STATE[ STATE_SECTION_OFFSET ] = 1;
STATE[ SEED_SECTION_OFFSET ] = slen;
// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:
gcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );
// Create a state "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Create a seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );
// Initialize the internal PRNG state:
state[ 0 ] = seed[ 0 ];
} else {
throw new TypeError( 'invalid option. `seed` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `' + seed + '`.' );
}
} else {
seed = randint32()|0; // asm type annotation
}
}
} else {
seed = randint32()|0; // asm type annotation
}
if ( state === void 0 ) {
STATE = new Int32Array( STATE_FIXED_LENGTH+1 );
// Initialize sections:
STATE[ 0 ] = STATE_ARRAY_VERSION;
STATE[ 1 ] = NUM_STATE_SECTIONS;
STATE[ STATE_SECTION_OFFSET ] = 1;
STATE[ SEED_SECTION_OFFSET ] = 1;
STATE[ SEED_SECTION_OFFSET+1 ] = seed;
// Create a state "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Create a seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Initialize the internal PRNG state:
state[ 0 ] = seed[ 0 ];
}
setReadOnly( minstd, 'NAME', 'minstd' );
setReadOnlyAccessor( minstd, 'seed', getSeed );
setReadOnlyAccessor( minstd, 'seedLength', getSeedLength );
setReadWriteAccessor( minstd, 'state', getState, setState );
setReadOnlyAccessor( minstd, 'stateLength', getStateLength );
setReadOnlyAccessor( minstd, 'byteLength', getStateSize );
setReadOnly( minstd, 'toJSON', toJSON );
setReadOnly( minstd, 'MIN', 1 );
setReadOnly( minstd, 'MAX', INT32_MAX-1 );
setReadOnly( minstd, 'normalized', normalized );
setReadOnly( normalized, 'NAME', minstd.NAME );
setReadOnlyAccessor( normalized, 'seed', getSeed );
setReadOnlyAccessor( normalized, 'seedLength', getSeedLength );
setReadWriteAccessor( normalized, 'state', getState, setState );
setReadOnlyAccessor( normalized, 'stateLength', getStateLength );
setReadOnlyAccessor( normalized, 'byteLength', getStateSize );
setReadOnly( normalized, 'toJSON', toJSON );
setReadOnly( normalized, 'MIN', (minstd.MIN-1.0) / NORMALIZATION_CONSTANT );
setReadOnly( normalized, 'MAX', (minstd.MAX-1.0) / NORMALIZATION_CONSTANT );
return minstd;
/**
* Returns the PRNG seed.
*
* @private
* @returns {PRNGSeedMINSTD} seed
*/
function getSeed() {
var len = STATE[ SEED_SECTION_OFFSET ];
return gcopy( len, seed, 1, new Int32Array( len ), 1 );
}
/**
* Returns the PRNG seed length.
*
* @private
* @returns {PositiveInteger} seed length
*/
function getSeedLength() {
return STATE[ SEED_SECTION_OFFSET ];
}
/**
* Returns the PRNG state length.
*
* @private
* @returns {PositiveInteger} state length
*/
function getStateLength() {
return STATE.length;
}
/**
* Returns the PRNG state size (in bytes).
*
* @private
* @returns {PositiveInteger} state size (in bytes)
*/
function getStateSize() {
return STATE.byteLength;
}
/**
* Returns the current PRNG state.
*
* ## Notes
*
* - The PRNG state array is comprised of a preamble followed by `2` sections:
*
* 0. preamble (version + number of sections)
* 1. internal PRNG state
* 2. PRNG seed
*
* - The first element of the PRNG state array preamble is the state array schema version.
*
* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `2`).
*
* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.
*
* @private
* @returns {PRNGStateMINSTD} current state
*/
function getState() {
var len = STATE.length;
return gcopy( len, STATE, 1, new Int32Array( len ), 1 );
}
/**
* Sets the PRNG state.
*
* ## Notes
*
* - If PRNG state is "shared" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.
* - If PRNG state is "shared" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).
*
* @private
* @param {PRNGStateMINSTD} s - generator state
* @throws {TypeError} must provide an `Int32Array`
* @throws {Error} must provide a valid state
*/
function setState( s ) {
var err;
if ( !isInt32Array( s ) ) {
throw new TypeError( 'invalid argument. Must provide an Int32Array. Value: `' + s + '`.' );
}
err = verifyState( s, false );
if ( err ) {
throw err;
}
if ( opts.copy === false ) {
if ( opts.state && s.length === STATE.length ) {
gcopy( s.length, s, 1, STATE, 1 ); // update current shared state
} else {
STATE = s; // point to new shared state
opts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation
}
} else {
// Check if we can reuse allocated memory...
if ( s.length !== STATE.length ) {
STATE = new Int32Array( s.length ); // reallocate
}
gcopy( s.length, s, 1, STATE, 1 );
}
// Create a new state "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Create a new seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );
}
/**
* Serializes the pseudorandom number generator as a JSON object.
*
* ## Notes
*
* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.
*
* @private
* @returns {Object} JSON representation
*/
function toJSON() {
var out = {};
out.type = 'PRNG';
out.name = minstd.NAME;
out.state = typedarray2json( STATE );
out.params = [];
return out;
}
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{31}-1) \\).
*
* @private
* @returns {integer32} pseudorandom integer
*/
function minstd() {
var s = state[ 0 ]|0; // asm type annotation
s = ( (A*s)%INT32_MAX )|0; // asm type annotation
state[ 0 ] = s;
return s|0; // asm type annotation
}
/**
* Generates a pseudorandom number on the interval \\( [0,1) \\).
*
* @private
* @returns {number} pseudorandom number
*/
function normalized() {
return (minstd()-1) / NORMALIZATION_CONSTANT;
}
}
// EXPORTS //
module.exports = factory;
},{"./rand_int32.js":309,"@stdlib/array/int32":10,"@stdlib/array/to-json":17,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-collection":90,"@stdlib/assert/is-int32array":106,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-positive-integer":149,"@stdlib/blas/base/gcopy":225,"@stdlib/constants/int32/max":245,"@stdlib/utils/define-nonenumerable-read-only-accessor":357,"@stdlib/utils/define-nonenumerable-read-only-property":359,"@stdlib/utils/define-nonenumerable-read-write-accessor":361}],307:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* A linear congruential pseudorandom number generator (LCG) based on Park and Miller.
*
* @module @stdlib/random/base/minstd
*
* @example
* var minstd = require( '@stdlib/random/base/minstd' );
*
* var v = minstd();
* // returns <number>
*
* @example
* var factory = require( '@stdlib/random/base/minstd' ).factory;
*
* var minstd = factory({
* 'seed': 1234
* });
*
* var v = minstd();
* // returns 20739838
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var minstd = require( './main.js' );
var factory = require( './factory.js' );
// MAIN //
setReadOnly( minstd, 'factory', factory );
// EXPORTS //
module.exports = minstd;
},{"./factory.js":306,"./main.js":308,"@stdlib/utils/define-nonenumerable-read-only-property":359}],308:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var factory = require( './factory.js' );
var randint32 = require( './rand_int32.js' );
// MAIN //
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{31}-1) \\).
*
* ## Method
*
* Linear congruential generators (LCGs) use the recurrence relation
*
* ```tex
* X_{n+1} = ( a \cdot X_n + c ) \operatorname{mod}(m)
* ```
*
* where the modulus \\( m \\) is a prime number or power of a prime number and \\( a \\) is a primitive root modulo \\( m \\).
*
* <!-- <note> -->
*
* For an LCG to be a Lehmer RNG, the seed \\( X_0 \\) must be coprime to \\( m \\).
*
* <!-- </note> -->
*
* In this implementation, the constants \\( a \\), \\( c \\), and \\( m \\) have the values
*
* ```tex
* \begin{align*}
* a &= 7^5 = 16807 \\
* c &= 0 \\
* m &= 2^{31} - 1 = 2147483647
* \end{align*}
* ```
*
* <!-- <note> -->
*
* The constant \\( m \\) is a Mersenne prime (modulo \\(31\\)).
*
* <!-- </note> -->
*
* <!-- <note> -->
*
* The constant \\( a \\) is a primitive root (modulo \\(31\\)).
*
* <!-- </note> -->
*
* Accordingly, the maximum possible product is
*
* ```tex
* 16807 \cdot (m - 1) \approx 2^{46}
* ```
*
* The values for \\( a \\), \\( c \\), and \\( m \\) are taken from Park and Miller, "Random Number Generators: Good Ones Are Hard To Find". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.
*
*
* ## Notes
*
* - The generator has a period of approximately \\(2.1\mbox{e}9\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).
*
*
* ## References
*
* - Park, S. K., and K. W. Miller. 1988. "Random Number Generators: Good Ones Are Hard to Find." _Communications of the ACM_ 31 (10). New York, NY, USA: ACM: 1192–1201. doi:[10.1145/63039.63042](http://dx.doi.org/10.1145/63039.63042).
* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.
*
*
* @function minstd
* @type {PRNG}
* @returns {PositiveInteger} pseudorandom integer
*
* @example
* var v = minstd();
* // returns <number>
*/
var minstd = factory({
'seed': randint32()
});
// EXPORTS //
module.exports = minstd;
},{"./factory.js":306,"./rand_int32.js":309}],309:[function(require,module,exports){
arguments[4][305][0].apply(exports,arguments)
},{"@stdlib/constants/int32/max":245,"@stdlib/math/base/special/floor":269,"dup":305}],310:[function(require,module,exports){
/* eslint-disable max-lines, max-len */
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*
*
* ## Notice
*
* The original C code and copyright notice are from the [source implementation]{@link http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c}. The implementation has been modified for JavaScript.
*
* ```text
* Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. The names of its contributors may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ```
*/
'use strict';
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isObject = require( '@stdlib/assert/is-plain-object' );
var isCollection = require( '@stdlib/assert/is-collection' );
var isUint32Array = require( '@stdlib/assert/is-uint32array' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );
var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
var Uint32Array = require( '@stdlib/array/uint32' );
var max = require( '@stdlib/math/base/special/max' );
var uimul = require( '@stdlib/math/base/special/uimul' );
var gcopy = require( '@stdlib/blas/base/gcopy' );
var typedarray2json = require( '@stdlib/array/to-json' );
var randuint32 = require( './rand_uint32.js' );
// VARIABLES //
// Define the size of the state array (see refs):
var N = 624;
// Define a (magic) constant used for indexing into the state array:
var M = 397;
// Define the maximum seed: 11111111111111111111111111111111
var MAX_SEED = UINT32_MAX >>> 0; // asm type annotation
// For seed arrays, define an initial state (magic) constant: 19650218 => 00000001001010111101011010101010
var SEED_ARRAY_INIT_STATE = 19650218 >>> 0; // asm type annotation
// Define a mask for the most significant `w-r` bits, where `w` is the word size (32 bits) and `r` is the separation point of one word (see refs): 2147483648 => 0x80000000 => 10000000000000000000000000000000
var UPPER_MASK = 0x80000000 >>> 0; // asm type annotation
// Define a mask for the least significant `r` bits (see refs): 2147483647 => 0x7fffffff => 01111111111111111111111111111111
var LOWER_MASK = 0x7fffffff >>> 0; // asm type annotation
// Define a multiplier (see Knuth TAOCP Vol2. 3rd Ed. P.106): 1812433253 => 01101100000001111000100101100101
var KNUTH_MULTIPLIER = 1812433253 >>> 0; // asm type annotation
// Define a (magic) multiplier: 1664525 => 00000000000110010110011000001101
var MAGIC_MULTIPLIER_1 = 1664525 >>> 0; // asm type annotation
// Define a (magic) multiplier: 1566083941 => 01011101010110001000101101100101
var MAGIC_MULTIPLIER_2 = 1566083941 >>> 0; // asm type annotation
// Define a tempering coefficient: 2636928640 => 0x9d2c5680 => 10011101001011000101011010000000
var TEMPERING_COEFFICIENT_1 = 0x9d2c5680 >>> 0; // asm type annotation
// Define a tempering coefficient: 4022730752 => 0xefc60000 => 11101111110001100000000000000000
var TEMPERING_COEFFICIENT_2 = 0xefc60000 >>> 0; // asm type annotation
// Define a constant vector `a` (see refs): 2567483615 => 0x9908b0df => 10011001000010001011000011011111
var MATRIX_A = 0x9908b0df >>> 0; // asm type annotation
// MAG01[x] = x * MATRIX_A; for x = {0,1}
var MAG01 = [ 0x0 >>> 0, MATRIX_A >>> 0 ]; // asm type annotation
// Define a normalization constant when generating double-precision floating-point numbers: 2^53 => 9007199254740992
var FLOAT64_NORMALIZATION_CONSTANT = 1.0 / ( FLOAT64_MAX_SAFE_INTEGER+1.0 ); // eslint-disable-line id-length
// 2^26: 67108864
var TWO_26 = 67108864 >>> 0; // asm type annotation
// 2^32: 2147483648 => 0x80000000 => 10000000000000000000000000000000
var TWO_32 = 0x80000000 >>> 0; // asm type annotation
// 1 (as a 32-bit unsigned integer): 1 => 0x1 => 00000000000000000000000000000001
var ONE = 0x1 >>> 0; // asm type annotation
// Define the maximum normalized pseudorandom double-precision floating-point number: ( (((2^32-1)>>>5)*2^26)+( (2^32-1)>>>6) ) / 2^53
var MAX_NORMALIZED = FLOAT64_MAX_SAFE_INTEGER * FLOAT64_NORMALIZATION_CONSTANT;
// Define the state array schema version:
var STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!
// Define the number of sections in the state array:
var NUM_STATE_SECTIONS = 3; // state, other, seed
// Define the index offset of the "state" section in the state array:
var STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |
// Define the index offset of the "other" section in the state array:
var OTHER_SECTION_OFFSET = N + 3; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |
// Define the index offset of the seed section in the state array:
var SEED_SECTION_OFFSET = N + 5; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |
// Define the length of the "fixed" length portion of the state array:
var STATE_FIXED_LENGTH = N + 6; // 1 (version) + 1 (num_sections) + 1 (state_length) + N (state) + 1 (other_length) + 1 (state_index) + 1 (seed_length)
// FUNCTIONS //
/**
* Verifies state array integrity.
*
* @private
* @param {Uint32Array} state - state array
* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)
* @returns {(Error|null)} an error or `null`
*/
function verifyState( state, FLG ) {
var s1;
if ( FLG ) {
s1 = 'option';
} else {
s1 = 'argument';
}
// The state array must have a minimum length...
if ( state.length < STATE_FIXED_LENGTH+1 ) {
return new RangeError( 'invalid '+s1+'. `state` array has insufficient length.' );
}
// The first element of the state array must equal the supported state array schema version...
if ( state[ 0 ] !== STATE_ARRAY_VERSION ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible schema version. Expected: '+STATE_ARRAY_VERSION+'. Actual: '+state[ 0 ]+'.' );
}
// The second element of the state array must contain the number of sections...
if ( state[ 1 ] !== NUM_STATE_SECTIONS ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible number of sections. Expected: '+NUM_STATE_SECTIONS+'. Actual: '+state[ 1 ]+'.' );
}
// The length of the "state" section must equal `N`...
if ( state[ STATE_SECTION_OFFSET ] !== N ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible state length. Expected: '+N+'. Actual: '+state[ STATE_SECTION_OFFSET ]+'.' );
}
// The length of the "other" section must equal `1`...
if ( state[ OTHER_SECTION_OFFSET ] !== 1 ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible section length. Expected: '+(1).toString()+'. Actual: '+state[ OTHER_SECTION_OFFSET ]+'.' );
}
// The length of the "seed" section much match the empirical length...
if ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {
return new RangeError( 'invalid '+s1+'. `state` array length is incompatible with seed section length. Expected: '+(state.length-STATE_FIXED_LENGTH)+'. Actual: '+state[ SEED_SECTION_OFFSET ]+'.' );
}
return null;
}
/**
* Returns an initial PRNG state.
*
* @private
* @param {Uint32Array} state - state array
* @param {PositiveInteger} N - state size
* @param {uinteger32} s - seed
* @returns {Uint32Array} state array
*/
function createState( state, N, s ) {
var i;
// Set the first element of the state array to the provided seed:
state[ 0 ] = s >>> 0; // equivalent to `s & 0xffffffffUL` in original C implementation
// Initialize the remaining state array elements:
for ( i = 1; i < N; i++ ) {
/*
* In the original C implementation (see `init_genrand()`),
*
* ```c
* mt[i] = (KNUTH_MULTIPLIER * (mt[i-1] ^ (mt[i-1] >> 30)) + i)
* ```
*
* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.
*/
s = state[ i-1 ]>>>0; // asm type annotation
s = ( s^(s>>>30) )>>>0; // asm type annotation
state[ i ] = ( uimul( s, KNUTH_MULTIPLIER ) + i )>>>0; // asm type annotation
}
return state;
}
/**
* Initializes a PRNG state array according to a seed array.
*
* @private
* @param {Uint32Array} state - state array
* @param {NonNegativeInteger} N - state array length
* @param {Collection} seed - seed array
* @param {NonNegativeInteger} M - seed array length
* @returns {Uint32Array} state array
*/
function initState( state, N, seed, M ) {
var s;
var i;
var j;
var k;
i = 1;
j = 0;
for ( k = max( N, M ); k > 0; k-- ) {
/*
* In the original C implementation (see `init_by_array()`),
*
* ```c
* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1664525UL)) + seed[j] + j;
* ```
*
* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.
*/
s = state[ i-1 ]>>>0; // asm type annotation
s = ( s^(s>>>30) )>>>0; // asm type annotation
s = ( uimul( s, MAGIC_MULTIPLIER_1 ) )>>>0; // asm type annotation
state[ i ] = ( ((state[i]>>>0)^s) + seed[j] + j )>>>0; /* non-linear */ // asm type annotation
i += 1;
j += 1;
if ( i >= N ) {
state[ 0 ] = state[ N-1 ];
i = 1;
}
if ( j >= M ) {
j = 0;
}
}
for ( k = N-1; k > 0; k-- ) {
/*
* In the original C implementation (see `init_by_array()`),
*
* ```c
* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1566083941UL)) - i;
* ```
*
* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.
*/
s = state[ i-1 ]>>>0; // asm type annotation
s = ( s^(s>>>30) )>>>0; // asm type annotation
s = ( uimul( s, MAGIC_MULTIPLIER_2 ) )>>>0; // asm type annotation
state[ i ] = ( ((state[i]>>>0)^s) - i )>>>0; /* non-linear */ // asm type annotation
i += 1;
if ( i >= N ) {
state[ 0 ] = state[ N-1 ];
i = 1;
}
}
// Ensure a non-zero initial state array:
state[ 0 ] = TWO_32; // MSB (most significant bit) is 1
return state;
}
/**
* Updates a PRNG's internal state by generating the next `N` words.
*
* @private
* @param {Uint32Array} state - state array
* @returns {Uint32Array} state array
*/
function twist( state ) {
var w;
var i;
var j;
var k;
k = N - M;
for ( i = 0; i < k; i++ ) {
w = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );
state[ i ] = state[ i+M ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];
}
j = N - 1;
for ( ; i < j; i++ ) {
w = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );
state[ i ] = state[ i-k ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];
}
w = ( state[j]&UPPER_MASK ) | ( state[0]&LOWER_MASK );
state[ j ] = state[ M-1 ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];
return state;
}
// MAIN //
/**
* Returns a 32-bit Mersenne Twister pseudorandom number generator.
*
* ## Notes
*
* - In contrast to the original C implementation, array seeds of length `1` are considered integer seeds. This ensures that the seed `[ 1234 ]` generates the same output as the seed `1234`. In the original C implementation, the two seeds would yield different output, which is **not** obvious from a user perspective.
*
* @param {Options} [options] - options
* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed
* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state
* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
* @throws {TypeError} options argument must be an object
* @throws {TypeError} a seed must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integers less than or equal to the maximum unsigned 32-bit integer
* @throws {RangeError} a numeric seed must be a positive integer less than or equal to the maximum unsigned 32-bit integer
* @throws {TypeError} state must be a `Uint32Array`
* @throws {Error} must provide a valid state
* @throws {TypeError} `copy` option must be a boolean
* @returns {PRNG} Mersenne Twister PRNG
*
* @example
* var mt19937 = factory();
*
* var v = mt19937();
* // returns <number>
*
* @example
* // Return a seeded Mersenne Twister PRNG:
* var mt19937 = factory({
* 'seed': 1234
* });
*
* var v = mt19937();
* // returns 822569775
*/
function factory( options ) {
var STATE;
var state;
var opts;
var seed;
var slen;
var err;
opts = {};
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'copy' ) ) {
opts.copy = options.copy;
if ( !isBoolean( options.copy ) ) {
throw new TypeError( 'invalid option. `copy` option must be a boolean. Option: `' + options.copy + '`.' );
}
}
if ( hasOwnProp( options, 'state' ) ) {
state = options.state;
opts.state = true;
if ( !isUint32Array( state ) ) {
throw new TypeError( 'invalid option. `state` option must be a Uint32Array. Option: `' + state + '`.' );
}
err = verifyState( state, true );
if ( err ) {
throw err;
}
if ( opts.copy === false ) {
STATE = state;
} else {
STATE = new Uint32Array( state.length );
gcopy( state.length, state, 1, STATE, 1 );
}
// Create a state "view":
state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
// Create a seed "view":
seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );
}
// If provided a PRNG state, we ignore the `seed` option...
if ( seed === void 0 ) {
if ( hasOwnProp( options, 'seed' ) ) {
seed = options.seed;
opts.seed = true;
if ( isPositiveInteger( seed ) ) {
if ( seed > MAX_SEED ) {
throw new RangeError( 'invalid option. `seed` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `' + seed + '`.' );
}
seed >>>= 0; // asm type annotation
} else if ( isCollection( seed ) === false || seed.length < 1 ) {
throw new TypeError( 'invalid option. `seed` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `' + seed + '`.' );
} else if ( seed.length === 1 ) {
seed = seed[ 0 ];
if ( !isPositiveInteger( seed ) ) {
throw new TypeError( 'invalid option. `seed` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `' + seed + '`.' );
}
if ( seed > MAX_SEED ) {
throw new RangeError( 'invalid option. `seed` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `' + seed + '`.' );
}
seed >>>= 0; // asm type annotation
} else {
slen = seed.length;
STATE = new Uint32Array( STATE_FIXED_LENGTH+slen );
// Initialize sections:
STATE[ 0 ] = STATE_ARRAY_VERSION;
STATE[ 1 ] = NUM_STATE_SECTIONS;
STATE[ STATE_SECTION_OFFSET ] = N;
STATE[ OTHER_SECTION_OFFSET ] = 1;
STATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index
STATE[ SEED_SECTION_OFFSET ] = slen;
// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:
gcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );
// Create a state "view":
state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
// Create a seed "view":
seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );
// Initialize the internal PRNG state:
state = createState( state, N, SEED_ARRAY_INIT_STATE );
state = initState( state, N, seed, slen );
}
} else {
seed = randuint32() >>> 0; // asm type annotation
}
}
} else {
seed = randuint32() >>> 0; // asm type annotation
}
if ( state === void 0 ) {
STATE = new Uint32Array( STATE_FIXED_LENGTH+1 );
// Initialize sections:
STATE[ 0 ] = STATE_ARRAY_VERSION;
STATE[ 1 ] = NUM_STATE_SECTIONS;
STATE[ STATE_SECTION_OFFSET ] = N;
STATE[ OTHER_SECTION_OFFSET ] = 1;
STATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index
STATE[ SEED_SECTION_OFFSET ] = 1;
STATE[ SEED_SECTION_OFFSET+1 ] = seed;
// Create a state "view":
state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
// Create a seed "view":
seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Initialize the internal PRNG state:
state = createState( state, N, seed );
}
// Note: property order matters in order to maintain consistency of PRNG "shape" (hidden classes).
setReadOnly( mt19937, 'NAME', 'mt19937' );
setReadOnlyAccessor( mt19937, 'seed', getSeed );
setReadOnlyAccessor( mt19937, 'seedLength', getSeedLength );
setReadWriteAccessor( mt19937, 'state', getState, setState );
setReadOnlyAccessor( mt19937, 'stateLength', getStateLength );
setReadOnlyAccessor( mt19937, 'byteLength', getStateSize );
setReadOnly( mt19937, 'toJSON', toJSON );
setReadOnly( mt19937, 'MIN', 1 );
setReadOnly( mt19937, 'MAX', UINT32_MAX );
setReadOnly( mt19937, 'normalized', normalized );
setReadOnly( normalized, 'NAME', mt19937.NAME );
setReadOnlyAccessor( normalized, 'seed', getSeed );
setReadOnlyAccessor( normalized, 'seedLength', getSeedLength );
setReadWriteAccessor( normalized, 'state', getState, setState );
setReadOnlyAccessor( normalized, 'stateLength', getStateLength );
setReadOnlyAccessor( normalized, 'byteLength', getStateSize );
setReadOnly( normalized, 'toJSON', toJSON );
setReadOnly( normalized, 'MIN', 0.0 );
setReadOnly( normalized, 'MAX', MAX_NORMALIZED );
return mt19937;
/**
* Returns the PRNG seed.
*
* @private
* @returns {PRNGSeedMT19937} seed
*/
function getSeed() {
var len = STATE[ SEED_SECTION_OFFSET ];
return gcopy( len, seed, 1, new Uint32Array( len ), 1 );
}
/**
* Returns the PRNG seed length.
*
* @private
* @returns {PositiveInteger} seed length
*/
function getSeedLength() {
return STATE[ SEED_SECTION_OFFSET ];
}
/**
* Returns the PRNG state length.
*
* @private
* @returns {PositiveInteger} state length
*/
function getStateLength() {
return STATE.length;
}
/**
* Returns the PRNG state size (in bytes).
*
* @private
* @returns {PositiveInteger} state size (in bytes)
*/
function getStateSize() {
return STATE.byteLength;
}
/**
* Returns the current PRNG state.
*
* ## Notes
*
* - The PRNG state array is comprised of a preamble followed by `3` sections:
*
* 0. preamble (version + number of sections)
* 1. internal PRNG state
* 2. auxiliary state information
* 3. PRNG seed
*
* - The first element of the PRNG state array preamble is the state array schema version.
*
* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).
*
* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.
*
* @private
* @returns {PRNGStateMT19937} current state
*/
function getState() {
var len = STATE.length;
return gcopy( len, STATE, 1, new Uint32Array( len ), 1 );
}
/**
* Sets the PRNG state.
*
* ## Notes
*
* - If PRNG state is "shared" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.
* - If PRNG state is "shared" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).
*
* @private
* @param {PRNGStateMT19937} s - generator state
* @throws {TypeError} must provide a `Uint32Array`
* @throws {Error} must provide a valid state
*/
function setState( s ) {
var err;
if ( !isUint32Array( s ) ) {
throw new TypeError( 'invalid argument. Must provide a Uint32Array. Value: `' + s + '`.' );
}
err = verifyState( s, false );
if ( err ) {
throw err;
}
if ( opts.copy === false ) {
if ( opts.state && s.length === STATE.length ) {
gcopy( s.length, s, 1, STATE, 1 ); // update current shared state
} else {
STATE = s; // point to new shared state
opts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation
}
} else {
// Check if we can reuse allocated memory...
if ( s.length !== STATE.length ) {
STATE = new Uint32Array( s.length ); // reallocate
}
gcopy( s.length, s, 1, STATE, 1 );
}
// Create a new state "view":
state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
// Create a new seed "view":
seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );
}
/**
* Serializes the pseudorandom number generator as a JSON object.
*
* ## Notes
*
* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.
*
* @private
* @returns {Object} JSON representation
*/
function toJSON() {
var out = {};
out.type = 'PRNG';
out.name = mt19937.NAME;
out.state = typedarray2json( STATE );
out.params = [];
return out;
}
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{32}-1) \\).
*
* @private
* @returns {uinteger32} pseudorandom integer
*
* @example
* var r = mt19937();
* // returns <number>
*/
function mt19937() {
var r;
var i;
// Retrieve the current state index:
i = STATE[ OTHER_SECTION_OFFSET+1 ];
// Determine whether we need to update the PRNG state:
if ( i >= N ) {
state = twist( state );
i = 0;
}
// Get the next word of "raw"/untempered state:
r = state[ i ];
// Update the state index:
STATE[ OTHER_SECTION_OFFSET+1 ] = i + 1;
// Tempering transform to compensate for the reduced dimensionality of equidistribution:
r ^= r >>> 11;
r ^= ( r << 7 ) & TEMPERING_COEFFICIENT_1;
r ^= ( r << 15 ) & TEMPERING_COEFFICIENT_2;
r ^= r >>> 18;
return r >>> 0;
}
/**
* Generates a pseudorandom number on the interval \\( [0,1) \\).
*
* ## Notes
*
* - The original C implementation credits Isaku Wada for this algorithm (2002/01/09).
*
* @private
* @returns {number} pseudorandom number
*
* @example
* var r = normalized();
* // returns <number>
*/
function normalized() {
var x = mt19937() >>> 5;
var y = mt19937() >>> 6;
return ( (x*TWO_26)+y ) * FLOAT64_NORMALIZATION_CONSTANT;
}
}
// EXPORTS //
module.exports = factory;
},{"./rand_uint32.js":313,"@stdlib/array/to-json":17,"@stdlib/array/uint32":23,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-collection":90,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-positive-integer":149,"@stdlib/assert/is-uint32array":170,"@stdlib/blas/base/gcopy":225,"@stdlib/constants/float64/max-safe-integer":240,"@stdlib/constants/uint32/max":250,"@stdlib/math/base/special/max":275,"@stdlib/math/base/special/uimul":284,"@stdlib/utils/define-nonenumerable-read-only-accessor":357,"@stdlib/utils/define-nonenumerable-read-only-property":359,"@stdlib/utils/define-nonenumerable-read-write-accessor":361}],311:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* A 32-bit Mersenne Twister pseudorandom number generator.
*
* @module @stdlib/random/base/mt19937
*
* @example
* var mt19937 = require( '@stdlib/random/base/mt19937' );
*
* var v = mt19937();
* // returns <number>
*
* @example
* var factory = require( '@stdlib/random/base/mt19937' ).factory;
*
* var mt19937 = factory({
* 'seed': 1234
* });
*
* var v = mt19937();
* // returns 822569775
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var mt19937 = require( './main.js' );
var factory = require( './factory.js' );
// MAIN //
setReadOnly( mt19937, 'factory', factory );
// EXPORTS //
module.exports = mt19937;
},{"./factory.js":310,"./main.js":312,"@stdlib/utils/define-nonenumerable-read-only-property":359}],312:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var factory = require( './factory.js' );
var randuint32 = require( './rand_uint32.js' );
// MAIN //
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{32}-1) \\).
*
* ## Method
*
* - When generating normalized double-precision floating-point numbers, we first generate two pseudorandom integers \\( x \\) and \\( y \\) on the interval \\( [1,2^{32}-1) \\) for a combined \\( 64 \\) random bits.
*
* - We would like \\( 53 \\) random bits to generate a 53-bit precision integer and, thus, want to discard \\( 11 \\) of the generated bits.
*
* - We do so by discarding \\( 5 \\) bits from \\( x \\) and \\( 6 \\) bits from \\( y \\).
*
* - Accordingly, \\( x \\) contains \\( 27 \\) random bits, which are subsequently shifted left \\( 26 \\) bits (multiplied by \\( 2^{26} \\), and \\( y \\) contains \\( 26 \\) random bits to fill in the lower \\( 26 \\) bits. When summed, they combine to comprise \\( 53 \\) random bits of a double-precision floating-point integer.
*
* - As an example, suppose, for the sake of argument, the 32-bit PRNG generates the maximum unsigned 32-bit integer \\( 2^{32}-1 \\) twice in a row. Then,
*
* ```javascript
* x = 4294967295 >>> 5; // 00000111111111111111111111111111
* y = 4294967295 >>> 6; // 00000011111111111111111111111111
* ```
*
* Multiplying \\( x \\) by \\( 2^{26} \\) returns \\( 9007199187632128 \\), which, in binary, is
*
* ```binarystring
* 0 10000110011 11111111111111111111 11111100000000000000000000000000
* ```
*
* Adding \\( y \\) yields \\( 9007199254740991 \\) (the maximum "safe" double-precision floating-point integer value), which, in binary, is
*
* ```binarystring
* 0 10000110011 11111111111111111111 11111111111111111111111111111111
* ```
*
* - Similarly, suppose the 32-bit PRNG generates the following values
*
* ```javascript
* x = 1 >>> 5; // 0 => 00000000000000000000000000000000
* y = 64 >>> 6; // 1 => 00000000000000000000000000000001
* ```
*
* Multiplying \\( x \\) by \\( 2^{26} \\) returns \\( 0 \\), which, in binary, is
*
* ```binarystring
* 0 00000000000 00000000000000000000 00000000000000000000000000000000
* ```
*
* Adding \\( y \\) yields \\( 1 \\), which, in binary, is
*
* ```binarystring
* 0 01111111111 00000000000000000000 00000000000000000000000000000000
* ```
*
* - As different combinations of \\( x \\) and \\( y \\) are generated, different combinations of double-precision floating-point exponent and significand bits will be toggled, thus generating pseudorandom double-precision floating-point numbers.
*
*
* ## References
*
* - Matsumoto, Makoto, and Takuji Nishimura. 1998. "Mersenne Twister: A 623-dimensionally Equidistributed Uniform Pseudo-random Number Generator." _ACM Transactions on Modeling and Computer Simulation_ 8 (1). New York, NY, USA: ACM: 3–30. doi:[10.1145/272991.272995][@matsumoto:1998a].
* - Harase, Shin. 2017. "Conversion of Mersenne Twister to double-precision floating-point numbers." _ArXiv_ abs/1708.06018 (September). <https://arxiv.org/abs/1708.06018>.
*
* [@matsumoto:1998a]: https://doi.org/10.1145/272991.272995
*
*
* @function mt19937
* @type {PRNG}
* @returns {PositiveInteger} pseudorandom integer
*
* @example
* var v = mt19937();
* // returns <number>
*/
var mt19937 = factory({
'seed': randuint32()
});
// EXPORTS //
module.exports = mt19937;
},{"./factory.js":310,"./rand_uint32.js":313}],313:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
var floor = require( '@stdlib/math/base/special/floor' );
// VARIABLES //
var MAX = UINT32_MAX - 1;
// MAIN //
/**
* Returns a pseudorandom integer on the interval \\([1, 2^{32}-1)\\).
*
* @private
* @returns {PositiveInteger} pseudorandom integer
*
* @example
* var v = randuint32();
* // returns <number>
*/
function randuint32() {
var v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math
return v >>> 0; // asm type annotation
}
// EXPORTS //
module.exports = randuint32;
},{"@stdlib/constants/uint32/max":250,"@stdlib/math/base/special/floor":269}],314:[function(require,module,exports){
module.exports={
"name": "mt19937",
"copy": true
}
},{}],315:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );
var isObject = require( '@stdlib/assert/is-plain-object' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var typedarray2json = require( '@stdlib/array/to-json' );
var defaults = require( './defaults.json' );
var PRNGS = require( './prngs.js' );
// MAIN //
/**
* Returns a pseudorandom number generator for generating uniformly distributed random numbers on the interval \\( [0,1) \\).
*
* @param {Options} [options] - function options
* @param {string} [options.name='mt19937'] - name of pseudorandom number generator
* @param {*} [options.seed] - pseudorandom number generator seed
* @param {*} [options.state] - pseudorandom number generator state
* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
* @throws {TypeError} must provide an object
* @throws {TypeError} must provide valid options
* @throws {Error} must provide the name of a supported pseudorandom number generator
* @returns {PRNG} pseudorandom number generator
*
* @example
* var uniform = factory();
* var v = uniform();
* // returns <number>
*
* @example
* var uniform = factory({
* 'name': 'minstd'
* });
* var v = uniform();
* // returns <number>
*
* @example
* var uniform = factory({
* 'seed': 12345
* });
* var v = uniform();
* // returns <number>
*
* @example
* var uniform = factory({
* 'name': 'minstd',
* 'seed': 12345
* });
* var v = uniform();
* // returns <number>
*/
function factory( options ) {
var opts;
var rand;
var prng;
opts = {
'name': defaults.name,
'copy': defaults.copy
};
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Must provide an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'name' ) ) {
opts.name = options.name;
}
if ( hasOwnProp( options, 'state' ) ) {
opts.state = options.state;
if ( opts.state === void 0 ) {
throw new TypeError( 'invalid option. `state` option cannot be undefined. Option: `' + opts.state + '`.' );
}
} else if ( hasOwnProp( options, 'seed' ) ) {
opts.seed = options.seed;
if ( opts.seed === void 0 ) {
throw new TypeError( 'invalid option. `seed` option cannot be undefined. Option: `' + opts.seed + '`.' );
}
}
if ( hasOwnProp( options, 'copy' ) ) {
opts.copy = options.copy;
if ( !isBoolean( opts.copy ) ) {
throw new TypeError( 'invalid option. `copy` option must be a boolean. Option: `' + opts.copy + '`.' );
}
}
}
prng = PRNGS[ opts.name ];
if ( prng === void 0 ) {
throw new Error( 'invalid option. Unrecognized/unsupported PRNG. Option: `' + opts.name + '`.' );
}
if ( opts.state === void 0 ) {
if ( opts.seed === void 0 ) {
rand = prng.factory();
} else {
rand = prng.factory({
'seed': opts.seed
});
}
} else {
rand = prng.factory({
'state': opts.state,
'copy': opts.copy
});
}
setReadOnly( uniform, 'NAME', 'randu' );
setReadOnlyAccessor( uniform, 'seed', getSeed );
setReadOnlyAccessor( uniform, 'seedLength', getSeedLength );
setReadWriteAccessor( uniform, 'state', getState, setState );
setReadOnlyAccessor( uniform, 'stateLength', getStateLength );
setReadOnlyAccessor( uniform, 'byteLength', getStateSize );
setReadOnly( uniform, 'toJSON', toJSON );
setReadOnly( uniform, 'PRNG', rand );
setReadOnly( uniform, 'MIN', rand.normalized.MIN );
setReadOnly( uniform, 'MAX', rand.normalized.MAX );
return uniform;
/**
* Returns the PRNG seed.
*
* @private
* @returns {*} seed
*/
function getSeed() {
return rand.seed;
}
/**
* Returns the PRNG seed length.
*
* @private
* @returns {PositiveInteger} seed length
*/
function getSeedLength() {
return rand.seedLength;
}
/**
* Returns the PRNG state length.
*
* @private
* @returns {PositiveInteger} state length
*/
function getStateLength() {
return rand.stateLength;
}
/**
* Returns the PRNG state size (in bytes).
*
* @private
* @returns {PositiveInteger} state size (in bytes)
*/
function getStateSize() {
return rand.byteLength;
}
/**
* Returns the current pseudorandom number generator state.
*
* @private
* @returns {*} current state
*/
function getState() {
return rand.state;
}
/**
* Sets the pseudorandom number generator state.
*
* @private
* @param {*} s - generator state
* @throws {Error} must provide a valid state
*/
function setState( s ) {
rand.state = s;
}
/**
* Serializes the pseudorandom number generator as a JSON object.
*
* ## Notes
*
* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.
*
* @private
* @returns {Object} JSON representation
*/
function toJSON() {
var out = {};
out.type = 'PRNG';
out.name = uniform.NAME + '-' + rand.NAME;
out.state = typedarray2json( rand.state );
out.params = [];
return out;
}
/**
* Returns a uniformly distributed pseudorandom number on the interval \\( [0,1) \\).
*
* @private
* @returns {number} pseudorandom number
*
* @example
* var v = uniform();
* // returns <number>
*/
function uniform() {
return rand.normalized();
}
}
// EXPORTS //
module.exports = factory;
},{"./defaults.json":314,"./prngs.js":318,"@stdlib/array/to-json":17,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-plain-object":147,"@stdlib/utils/define-nonenumerable-read-only-accessor":357,"@stdlib/utils/define-nonenumerable-read-only-property":359,"@stdlib/utils/define-nonenumerable-read-write-accessor":361}],316:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Uniformly distributed pseudorandom numbers on the interval \\( [0,1) \\).
*
* @module @stdlib/random/base/randu
*
* @example
* var randu = require( '@stdlib/random/base/randu' );
*
* var v = randu();
* // returns <number>
*
* @example
* var factory = require( '@stdlib/random/base/randu' ).factory;
*
* var randu = factory({
* 'name': 'minstd',
* 'seed': 12345
* });
*
* var v = randu();
* // returns <number>
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var randu = require( './main.js' );
var factory = require( './factory.js' );
// MAIN //
setReadOnly( randu, 'factory', factory );
// EXPORTS //
module.exports = randu;
},{"./factory.js":315,"./main.js":317,"@stdlib/utils/define-nonenumerable-read-only-property":359}],317:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var factory = require( './factory.js' );
// MAIN //
/**
* Returns a uniformly distributed random number on the interval \\( [0,1) \\).
*
* @name randu
* @type {PRNG}
* @returns {number} pseudorandom number
*
* @example
* var v = randu();
* // returns <number>
*/
var randu = factory();
// EXPORTS //
module.exports = randu;
},{"./factory.js":315}],318:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var prngs = {};
prngs[ 'minstd' ] = require( '@stdlib/random/base/minstd' );
prngs[ 'minstd-shuffle' ] = require( '@stdlib/random/base/minstd-shuffle' );
prngs[ 'mt19937' ] = require( '@stdlib/random/base/mt19937' );
// EXPORTS //
module.exports = prngs;
},{"@stdlib/random/base/minstd":307,"@stdlib/random/base/minstd-shuffle":303,"@stdlib/random/base/mt19937":311}],319:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Regular expression to match a newline character sequence.
*
* @module @stdlib/regexp/eol
*
* @example
* var reEOL = require( '@stdlib/regexp/eol' );
* var RE_EOL = reEOL();
*
* var bool = RE_EOL.test( '\n' );
* // returns true
*
* bool = RE_EOL.test( '\\r\\n' );
* // returns false
*
* @example
* var reEOL = require( '@stdlib/regexp/eol' );
* var replace = require( '@stdlib/string/replace' );
*
* var RE_EOL = reEOL({
* 'flags': 'g'
* });
* var str = '1\n2\n3';
* var out = replace( str, RE_EOL, '' );
*
* @example
* var reEOL = require( '@stdlib/regexp/eol' );
* var bool = reEOL.REGEXP.test( '\r\n' );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var reEOL = require( './main.js' );
var REGEXP_CAPTURE = require( './regexp_capture.js' );
var REGEXP = require( './regexp.js' );
// MAIN //
setReadOnly( reEOL, 'REGEXP', REGEXP );
setReadOnly( reEOL, 'REGEXP_CAPTURE', REGEXP_CAPTURE );
// EXPORTS //
module.exports = reEOL;
},{"./main.js":320,"./regexp.js":321,"./regexp_capture.js":322,"@stdlib/utils/define-nonenumerable-read-only-property":359}],320:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib 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.
*/
'use strict';
// MODULES //
var validate = require( './validate.js' );
// VARIABLES //
var REGEXP_STRING = '\\r?\\n';
// MAIN //
/**
* Returns a regular expression to match a newline character sequence.
*
* @param {Options} [options] - function options
* @param {string} [options.flags=''] - regular expression flags
* @param {boolean} [options.capture=false] - boolean indicating whether to create a capture group for the match
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {RegExp} regular expression
*
* @example
* var RE_EOL = reEOL();
* var bool = RE_EOL.test( '\r\n' );
* // returns true
*
* @example
* var replace = require( '@stdlib/string/replace' );
*
* var RE_EOL = reEOL({
* 'flags': 'g'
* });
* var str = '1\n2\n3';
* var out = replace( str, RE_EOL, '' );
*/
function reEOL( options ) {
var opts;
var err;
if ( arguments.length > 0 ) {
opts = {};
err = validate( opts, options );
if ( err ) {
throw err;
}
if ( opts.capture ) {
return new RegExp( '('+REGEXP_STRING+')', opts.flags );
}
return new RegExp( REGEXP_STRING, opts.flags );
}
return /\r?\n/;
}
// EXPORTS //
module.exports = reEOL;
},{"./validate.js":323}],321:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib 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.
*/
'use strict';
// MODULES //
var reEOL = require( './main.js' );
// MAIN //
/**
* Matches a newline character sequence.
*
* Regular expression: `/\r?\n/`
*
* - `\r?`
* - match a carriage return character (optional)
*
* - `\n`
* - match a line feed character
*
* @constant
* @type {RegExp}
* @default /\r?\n/
*/
var REGEXP = reEOL();
// EXPORTS //
module.exports = REGEXP;
},{"./main.js":320}],322:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib 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.
*/
'use strict';
// MODULES //
var reEOL = require( './main.js' );
// MAIN //
/**
* Captures a newline character sequence.
*
* Regular expression: `/\r?\n/`
*
* - `()`
* - capture
*
* - `\r?`
* - match a carriage return character (optional)
*
* - `\n`
* - match a line feed character
*
* @constant
* @type {RegExp}
* @default /(\r?\n)/
*/
var REGEXP_CAPTURE = reEOL({
'capture': true
});
// EXPORTS //
module.exports = REGEXP_CAPTURE;
},{"./main.js":320}],323:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib 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.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
// MAIN //
/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {string} [options.flags] - regular expression flags
* @param {boolean} [options.capture] - boolean indicating whether to wrap a regular expression matching a decimal number with a capture group
* @returns {(Error|null)} null or an error object
*
* @example
* var opts = {};
* var options = {
* 'flags': 'gm'
* };
* var err = validate( opts, options );
* if ( err ) {
* throw err;
* }
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'flags' ) ) {
opts.flags = options.flags;
if ( !isString( opts.flags ) ) {
return new TypeError( 'invalid option. `flags` option must be a string primitive. Option: `' + opts.flags + '`.' );
}
}
if ( hasOwnProp( options, 'capture' ) ) {
opts.capture = options.capture;
if ( !isBoolean( opts.capture ) ) {
return new TypeError( 'invalid option. `capture` option must be a boolean primitive. Option: `' + opts.capture + '`.' );
}
}
return null;
}
// EXPORTS //
module.exports = validate;
},{"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-string":158}],324:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib 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.
*/
'use strict';
/**
* Regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.
*
* @module @stdlib/regexp/function-name
*
* @example
* var reFunctionName = require( '@stdlib/regexp/function-name' );
* var RE_FUNCTION_NAME = reFunctionName();
*
* function fname( fcn ) {
* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];
* }
*
* var fn = fname( Math.sqrt );
* // returns 'sqrt'
*
* fn = fname( Int8Array );
* // returns 'Int8Array'
*
* fn = fname( Object.prototype.toString );
* // returns 'toString'
*
* fn = fname( function(){} );
* // returns ''
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var reFunctionName = require( './main.js' );
var REGEXP = require( './regexp.js' );
// MAIN //
setReadOnly( reFunctionName, 'REGEXP', REGEXP );
// EXPORTS //
module.exports = reFunctionName;
},{"./main.js":325,"./regexp.js":326,"@stdlib/utils/define-nonenumerable-read-only-property":359}],325:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Returns a regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.
*
* @returns {RegExp} regular expression
*
* @example
* var RE_FUNCTION_NAME = reFunctionName();
*
* function fname( fcn ) {
* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];
* }
*
* var fn = fname( Math.sqrt );
* // returns 'sqrt'
*
* fn = fname( Int8Array );
* // returns 'Int8Array'
*
* fn = fname( Object.prototype.toString );
* // returns 'toString'
*
* fn = fname( function(){} );
* // returns ''
*/
function reFunctionName() {
return /^\s*function\s*([^(]*)/i;
}
// EXPORTS //
module.exports = reFunctionName;
},{}],326:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var reFunctionName = require( './main.js' );
// MAIN //
/**
* Captures everything that is not a space immediately after the `function` keyword and before the first left parenthesis.
*
* Regular expression: `/^\s*function\s*([^(]*)/i`
*
* - `/^\s*`
* - Match zero or more spaces at beginning
*
* - `function`
* - Match the word `function`
*
* - `\s*`
* - Match zero or more spaces after the word `function`
*
* - `()`
* - Capture
*
* - `[^(]*`
* - Match anything except a left parenthesis `(` zero or more times
*
* - `/i`
* - ignore case
*
* @constant
* @type {RegExp}
* @default /^\s*function\s*([^(]*)/i
*/
var RE_FUNCTION_NAME = reFunctionName();
// EXPORTS //
module.exports = RE_FUNCTION_NAME;
},{"./main.js":325}],327:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return a regular expression to parse a regular expression string.
*
* @module @stdlib/regexp/regexp
*
* @example
* var reRegExp = require( '@stdlib/regexp/regexp' );
*
* var RE_REGEXP = reRegExp();
*
* var bool = RE_REGEXP.test( '/^beep$/' );
* // returns true
*
* bool = RE_REGEXP.test( '' );
* // returns false
*
* @example
* var reRegExp = require( '@stdlib/regexp/regexp' );
*
* var RE_REGEXP = reRegExp();
*
* var parts = RE_REGEXP.exec( '/^.*$/ig' );
* // returns [ '/^.*$/ig', '^.*$', 'ig', 'index': 0, 'input': '/^.*$/ig' ]
*/
// MAIN //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var reRegExp = require( './main.js' );
var REGEXP = require( './regexp.js' );
// MAIN //
setReadOnly( reRegExp, 'REGEXP', REGEXP );
// EXPORTS //
module.exports = reRegExp;
// EXPORTS //
module.exports = reRegExp;
},{"./main.js":328,"./regexp.js":329,"@stdlib/utils/define-nonenumerable-read-only-property":359}],328:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Returns a regular expression to parse a regular expression string.
*
* @returns {RegExp} regular expression
*
* @example
* var RE_REGEXP = reRegExp();
*
* var bool = RE_REGEXP.test( '/^beep$/' );
* // returns true
*
* bool = RE_REGEXP.test( '' );
* // returns false
*/
function reRegExp() {
return /^\/((?:\\\/|[^\/])+)\/([imgy]*)$/; // eslint-disable-line no-useless-escape
}
// EXPORTS //
module.exports = reRegExp;
},{}],329:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var reRegExp = require( './main.js' );
// MAIN //
/**
* Matches parts of a regular expression string.
*
* Regular expression: `/^\/((?:\\\/|[^\/])+)\/([imgy]*)$/`
*
* - `/^\/`
* - match a string that begins with a `/`
*
* - `()`
* - capture
*
* - `(?:)+`
* - capture, but do not remember, a group of characters which occur one or more times
*
* - `\\\/`
* - match the literal `\/`
*
* - `|`
* - OR
*
* - `[^\/]`
* - anything which is not the literal `\/`
*
* - `\/`
* - match the literal `/`
*
* - `([imgy]*)`
* - capture any characters matching `imgy` occurring zero or more times
*
* - `$/`
* - string end
*
*
* @constant
* @type {RegExp}
* @default /^\/((?:\\\/|[^\/])+)\/([imgy]*)$/
*/
var RE_REGEXP = reRegExp();
// EXPORTS //
module.exports = RE_REGEXP;
},{"./main.js":328}],330:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
// VARIABLES //
var debug = logger( 'transform-stream:transform' );
// MAIN //
/**
* Implements the `_transform` method as a pass through.
*
* @private
* @param {(Uint8Array|Buffer|string)} chunk - streamed chunk
* @param {string} encoding - Buffer encoding
* @param {Callback} clbk - callback to invoke after transforming the streamed chunk
*/
function transform( chunk, encoding, clbk ) {
debug( 'Received a new chunk. Chunk: %s. Encoding: %s.', chunk.toString(), encoding );
clbk( null, chunk );
}
// EXPORTS //
module.exports = transform;
},{"debug":443}],331:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
var Transform = require( 'readable-stream' ).Transform;
var inherit = require( '@stdlib/utils/inherit' );
var copy = require( '@stdlib/utils/copy' );
var DEFAULTS = require( './defaults.json' );
var validate = require( './validate.js' );
var destroy = require( './destroy.js' );
var _transform = require( './_transform.js' ); // eslint-disable-line no-underscore-dangle
// VARIABLES //
var debug = logger( 'transform-stream:ctor' );
// MAIN //
/**
* Transform stream constructor factory.
*
* @param {Options} [options] - stream options
* @param {Function} [options.transform] - callback to invoke upon receiving a new chunk
* @param {Function} [options.flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {Function} Transform stream constructor
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'transform': transform
* };
*
* var TransformStream = ctor( opts );
*
* var stream = new TransformStream();
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
*
* // prints: '1\n2\n3\n'
*/
function ctor( options ) {
var transform;
var copts;
var err;
copts = copy( DEFAULTS );
if ( arguments.length ) {
err = validate( copts, options );
if ( err ) {
throw err;
}
}
if ( copts.transform ) {
transform = copts.transform;
} else {
transform = _transform;
}
/**
* Transform stream constructor.
*
* @private
* @constructor
* @param {Options} [options] - stream options
* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {TransformStream} transform stream
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* var stream = new TransformStream();
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
*
* // prints: '1\n2\n3\n'
*/
function TransformStream( options ) {
var opts;
var err;
if ( !( this instanceof TransformStream ) ) {
if ( arguments.length ) {
return new TransformStream( options );
}
return new TransformStream();
}
opts = copy( copts );
if ( arguments.length ) {
err = validate( opts, options );
if ( err ) {
throw err;
}
}
debug( 'Creating a transform stream configured with the following options: %s.', JSON.stringify( opts ) );
Transform.call( this, opts );
this._destroyed = false;
return this;
}
/**
* Inherit from the `Transform` prototype.
*/
inherit( TransformStream, Transform );
/**
* Implements the `_transform` method.
*
* @private
* @name _transform
* @memberof TransformStream.prototype
* @type {Function}
* @param {(Buffer|string)} chunk - streamed chunk
* @param {string} encoding - Buffer encoding
* @param {Callback} clbk - callback to invoke after transforming the streamed chunk
*/
TransformStream.prototype._transform = transform; // eslint-disable-line no-underscore-dangle
if ( copts.flush ) {
/**
* Implements the `_flush` method.
*
* @private
* @name _flush
* @memberof TransformStream.prototype
* @type {Function}
* @param {Callback} callback to invoke after performing flush tasks
*/
TransformStream.prototype._flush = copts.flush; // eslint-disable-line no-underscore-dangle
}
/**
* Gracefully destroys a stream, providing backward compatibility.
*
* @private
* @name destroy
* @memberof TransformStream.prototype
* @type {Function}
* @param {Object} [error] - optional error message
* @returns {TransformStream} stream instance
*/
TransformStream.prototype.destroy = destroy;
return TransformStream;
}
// EXPORTS //
module.exports = ctor;
},{"./_transform.js":330,"./defaults.json":332,"./destroy.js":333,"./validate.js":338,"@stdlib/utils/copy":355,"@stdlib/utils/inherit":387,"debug":443,"readable-stream":460}],332:[function(require,module,exports){
module.exports={
"objectMode": false,
"encoding": null,
"allowHalfOpen": false,
"decodeStrings": true
}
},{}],333:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
var nextTick = require( '@stdlib/utils/next-tick' );
// VARIABLES //
var debug = logger( 'transform-stream:destroy' );
// MAIN //
/**
* Gracefully destroys a stream, providing backward compatibility.
*
* @private
* @param {Object} [error] - optional error message
* @returns {Stream} stream instance
*/
function destroy( error ) {
/* eslint-disable no-invalid-this */
var self;
if ( this._destroyed ) {
debug( 'Attempted to destroy an already destroyed stream.' );
return this;
}
self = this;
this._destroyed = true;
nextTick( close );
return this;
/**
* Closes a stream.
*
* @private
*/
function close() {
if ( error ) {
debug( 'Stream was destroyed due to an error. Error: %s.', JSON.stringify( error ) );
self.emit( 'error', error );
}
debug( 'Closing the stream...' );
self.emit( 'close' );
}
}
// EXPORTS //
module.exports = destroy;
},{"@stdlib/utils/next-tick":413,"debug":443}],334:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var copy = require( '@stdlib/utils/copy' );
var Stream = require( './main.js' );
// MAIN //
/**
* Creates a reusable transform stream factory.
*
* @param {Options} [options] - stream options
* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} options argument must be an object
* @returns {Function} transform stream factory
*
* @example
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'objectMode': true,
* 'encoding': 'utf8',
* 'highWaterMark': 64,
* 'decodeStrings': false
* };
*
* var factory = streamFactory( opts );
*
* // Create 10 identically configured streams...
* var streams = [];
* var i;
* for ( i = 0; i < 10; i++ ) {
* streams.push( factory( transform ) );
* }
*/
function streamFactory( options ) {
var opts;
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
opts = copy( options );
} else {
opts = {};
}
return createStream;
/**
* Creates a transform stream.
*
* @private
* @param {Function} transform - callback to invoke upon receiving a new chunk
* @param {Function} [flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @throws {TypeError} must provide valid options
* @throws {TypeError} transform callback must be a function
* @throws {TypeError} flush callback must be a function
* @returns {TransformStream} transform stream
*/
function createStream( transform, flush ) {
opts.transform = transform;
if ( arguments.length > 1 ) {
opts.flush = flush;
} else {
delete opts.flush; // clear any previous `flush`
}
return new Stream( opts );
}
}
// EXPORTS //
module.exports = streamFactory;
},{"./main.js":336,"@stdlib/assert/is-plain-object":147,"@stdlib/utils/copy":355}],335:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Transform stream.
*
* @module @stdlib/streams/node/transform
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'transform': transform
* };
* var stream = transformStream( opts );
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
* // => '1\n2\n3\n'
*
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'objectMode': true,
* 'encoding': 'utf8',
* 'highWaterMark': 64,
* 'decodeStrings': false
* };
*
* var factory = transformStream.factory( opts );
*
* // Create 10 identically configured streams...
* var streams = [];
* var i;
* for ( i = 0; i < 10; i++ ) {
* streams.push( factory( transform ) );
* }
*
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* function stringify( chunk, enc, clbk ) {
* clbk( null, JSON.stringify( chunk ) );
* }
*
* function newline( chunk, enc, clbk ) {
* clbk( null, chunk+'\n' );
* }
*
* var s1 = transformStream.objectMode({
* 'transform': stringify
* });
*
* var s2 = transformStream.objectMode({
* 'transform': newline
* });
*
* s1.pipe( s2 ).pipe( stdout );
*
* s1.write( {'value': 'a'} );
* s1.write( {'value': 'b'} );
* s1.write( {'value': 'c'} );
*
* s1.end();
* // => '{"value":"a"}\n{"value":"b"}\n{"value":"c"}\n'
*
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'transform': transform
* };
*
* var Stream = transformStream.ctor( opts );
*
* var stream = new Stream();
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
* // => '1\n2\n3\n'
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var transform = require( './main.js' );
var objectMode = require( './object_mode.js' );
var factory = require( './factory.js' );
var ctor = require( './ctor.js' );
// MAIN //
setReadOnly( transform, 'objectMode', objectMode );
setReadOnly( transform, 'factory', factory );
setReadOnly( transform, 'ctor', ctor );
// EXPORTS //
module.exports = transform;
},{"./ctor.js":331,"./factory.js":334,"./main.js":336,"./object_mode.js":337,"@stdlib/utils/define-nonenumerable-read-only-property":359}],336:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
var Transform = require( 'readable-stream' ).Transform;
var inherit = require( '@stdlib/utils/inherit' );
var copy = require( '@stdlib/utils/copy' );
var DEFAULTS = require( './defaults.json' );
var validate = require( './validate.js' );
var destroy = require( './destroy.js' );
var _transform = require( './_transform.js' ); // eslint-disable-line no-underscore-dangle
// VARIABLES //
var debug = logger( 'transform-stream:main' );
// MAIN //
/**
* Transform stream constructor.
*
* @constructor
* @param {Options} [options] - stream options
* @param {Function} [options.transform] - callback to invoke upon receiving a new chunk
* @param {Function} [options.flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @param {boolean} [options.objectMode=false] - specifies whether stream should operate in object mode
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} must provide valid options
* @returns {TransformStream} transform stream
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'transform': transform
* };
* var stream = new TransformStream( opts );
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
*
* // prints: '1\n2\n3\n'
*/
function TransformStream( options ) {
var opts;
var err;
if ( !( this instanceof TransformStream ) ) {
if ( arguments.length ) {
return new TransformStream( options );
}
return new TransformStream();
}
opts = copy( DEFAULTS );
if ( arguments.length ) {
err = validate( opts, options );
if ( err ) {
throw err;
}
}
debug( 'Creating a transform stream configured with the following options: %s.', JSON.stringify( opts ) );
Transform.call( this, opts );
this._destroyed = false;
if ( opts.transform ) {
this._transform = opts.transform;
} else {
this._transform = _transform;
}
if ( opts.flush ) {
this._flush = opts.flush;
}
return this;
}
/*
* Inherit from the `Transform` prototype.
*/
inherit( TransformStream, Transform );
/**
* Gracefully destroys a stream, providing backward compatibility.
*
* @name destroy
* @memberof TransformStream.prototype
* @type {Function}
* @param {Object} [error] - optional error message
* @returns {TransformStream} stream instance
*/
TransformStream.prototype.destroy = destroy;
// EXPORTS //
module.exports = TransformStream;
},{"./_transform.js":330,"./defaults.json":332,"./destroy.js":333,"./validate.js":338,"@stdlib/utils/copy":355,"@stdlib/utils/inherit":387,"debug":443,"readable-stream":460}],337:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var copy = require( '@stdlib/utils/copy' );
var Stream = require( './main.js' );
// MAIN //
/**
* Returns a transform stream with `objectMode` set to `true`.
*
* @param {Options} [options] - stream options
* @param {Function} [options.transform] - callback to invoke upon receiving a new chunk
* @param {Function} [options.flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {TransformStream} transform stream
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* function stringify( chunk, enc, clbk ) {
* clbk( null, JSON.stringify( chunk ) );
* }
*
* function newline( chunk, enc, clbk ) {
* clbk( null, chunk+'\n' );
* }
*
* var s1 = objectMode({
* 'transform': stringify
* });
*
* var s2 = objectMode({
* 'transform': newline
* });
*
* s1.pipe( s2 ).pipe( stdout );
*
* s1.write( {'value': 'a'} );
* s1.write( {'value': 'b'} );
* s1.write( {'value': 'c'} );
*
* s1.end();
*
* // prints: '{"value":"a"}\n{"value":"b"}\n{"value":"c"}\n'
*/
function objectMode( options ) {
var opts;
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
opts = copy( options );
} else {
opts = {};
}
opts.objectMode = true;
return new Stream( opts );
}
// EXPORTS //
module.exports = objectMode;
},{"./main.js":336,"@stdlib/assert/is-plain-object":147,"@stdlib/utils/copy":355}],338:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isFunction = require( '@stdlib/assert/is-function' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
// MAIN //
/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {Function} [options.transform] - callback to invoke upon receiving a new chunk
* @param {Function} [options.flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode
* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings] - specifies whether to decode `strings` into `Buffer` objects when writing
* @returns {(Error|null)} null or an error object
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'transform' ) ) {
opts.transform = options.transform;
if ( !isFunction( opts.transform ) ) {
return new TypeError( 'invalid option. `transform` option must be a function. Option: `' + opts.transform + '`.' );
}
}
if ( hasOwnProp( options, 'flush' ) ) {
opts.flush = options.flush;
if ( !isFunction( opts.flush ) ) {
return new TypeError( 'invalid option. `flush` option must be a function. Option: `' + opts.flush + '`.' );
}
}
if ( hasOwnProp( options, 'objectMode' ) ) {
opts.objectMode = options.objectMode;
if ( !isBoolean( opts.objectMode ) ) {
return new TypeError( 'invalid option. `objectMode` option must be a primitive boolean. Option: `' + opts.objectMode + '`.' );
}
}
if ( hasOwnProp( options, 'encoding' ) ) {
opts.encoding = options.encoding;
if ( !isString( opts.encoding ) ) {
return new TypeError( 'invalid option. `encoding` option must be a primitive string. Option: `' + opts.encoding + '`.' );
}
}
if ( hasOwnProp( options, 'allowHalfOpen' ) ) {
opts.allowHalfOpen = options.allowHalfOpen;
if ( !isBoolean( opts.allowHalfOpen ) ) {
return new TypeError( 'invalid option. `allowHalfOpen` option must be a primitive boolean. Option: `' + opts.allowHalfOpen + '`.' );
}
}
if ( hasOwnProp( options, 'highWaterMark' ) ) {
opts.highWaterMark = options.highWaterMark;
if ( !isNonNegative( opts.highWaterMark ) ) {
return new TypeError( 'invalid option. `highWaterMark` option must be a nonnegative number. Option: `' + opts.highWaterMark + '`.' );
}
}
if ( hasOwnProp( options, 'decodeStrings' ) ) {
opts.decodeStrings = options.decodeStrings;
if ( !isBoolean( opts.decodeStrings ) ) {
return new TypeError( 'invalid option. `decodeStrings` option must be a primitive boolean. Option: `' + opts.decodeStrings + '`.' );
}
}
return null;
}
// EXPORTS //
module.exports = validate;
},{"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-function":102,"@stdlib/assert/is-nonnegative-number":131,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-string":158}],339:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Create a string from a sequence of Unicode code points.
*
* @module @stdlib/string/from-code-point
*
* @example
* var fromCodePoint = require( '@stdlib/string/from-code-point' );
*
* var str = fromCodePoint( 9731 );
* // returns '☃'
*/
// MODULES //
var fromCodePoint = require( './main.js' );
// EXPORTS //
module.exports = fromCodePoint;
},{"./main.js":340}],340:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
var isCollection = require( '@stdlib/assert/is-collection' );
var UNICODE_MAX = require( '@stdlib/constants/unicode/max' );
var UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' );
// VARIABLES //
var fromCharCode = String.fromCharCode;
// Factor to rescale a code point from a supplementary plane:
var Ox10000 = 0x10000|0; // 65536
// Factor added to obtain a high surrogate:
var OxD800 = 0xD800|0; // 55296
// Factor added to obtain a low surrogate:
var OxDC00 = 0xDC00|0; // 56320
// 10-bit mask: 2^10-1 = 1023 => 0x3ff => 00000000 00000000 00000011 11111111
var Ox3FF = 1023|0;
// MAIN //
/**
* Creates a string from a sequence of Unicode code points.
*
* ## Notes
*
* - UTF-16 encoding uses one 16-bit unit for non-surrogates (U+0000 to U+D7FF and U+E000 to U+FFFF).
* - UTF-16 encoding uses two 16-bit units (surrogate pairs) for U+10000 to U+10FFFF and encodes U+10000-U+10FFFF by subtracting 0x10000 from the code point, expressing the result as a 20-bit binary, and splitting the 20 bits of 0x0-0xFFFFF as upper and lower 10-bits. The respective 10-bits are stored in two 16-bit words: a high and a low surrogate.
*
*
* @param {...NonNegativeInteger} args - sequence of code points
* @throws {Error} must provide either an array-like object of code points or one or more code points as separate arguments
* @throws {TypeError} a code point must be a nonnegative integer
* @throws {RangeError} must provide a valid Unicode code point
* @returns {string} created string
*
* @example
* var str = fromCodePoint( 9731 );
* // returns '☃'
*/
function fromCodePoint( args ) {
var len;
var str;
var arr;
var low;
var hi;
var pt;
var i;
len = arguments.length;
if ( len === 1 && isCollection( args ) ) {
arr = arguments[ 0 ];
len = arr.length;
} else {
arr = [];
for ( i = 0; i < len; i++ ) {
arr.push( arguments[ i ] );
}
}
if ( len === 0 ) {
throw new Error( 'insufficient input arguments. Must provide either an array of code points or one or more code points as separate arguments.' );
}
str = '';
for ( i = 0; i < len; i++ ) {
pt = arr[ i ];
if ( !isNonNegativeInteger( pt ) ) {
throw new TypeError( 'invalid argument. Must provide valid code points (nonnegative integers). Value: `'+pt+'`.' );
}
if ( pt > UNICODE_MAX ) {
throw new RangeError( 'invalid argument. Must provide a valid code point (cannot exceed max). Value: `'+pt+'`.' );
}
if ( pt <= UNICODE_MAX_BMP ) {
str += fromCharCode( pt );
} else {
// Code point from a supplementary plane. Split into two 16-bit code units (surrogate pair).
pt -= Ox10000;
hi = (pt >> 10) + OxD800;
low = (pt & Ox3FF) + OxDC00;
str += fromCharCode( hi, low );
}
}
return str;
}
// EXPORTS //
module.exports = fromCodePoint;
},{"@stdlib/assert/is-collection":90,"@stdlib/assert/is-nonnegative-integer":127,"@stdlib/constants/unicode/max":253,"@stdlib/constants/unicode/max-bmp":252}],341:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Replace search occurrences with a replacement string.
*
* @module @stdlib/string/replace
*
* @example
* var replace = require( '@stdlib/string/replace' );
*
* var str = 'beep';
* var out = replace( str, 'e', 'o' );
* // returns 'boop'
*
* str = 'Hello World';
* out = replace( str, /world/i, 'Mr. President' );
* // returns 'Hello Mr. President'
*/
// MODULES //
var replace = require( './replace.js' );
// EXPORTS //
module.exports = replace;
},{"./replace.js":342}],342:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var rescape = require( '@stdlib/utils/escape-regexp-string' );
var isFunction = require( '@stdlib/assert/is-function' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isRegExp = require( '@stdlib/assert/is-regexp' );
// MAIN //
/**
* Replace search occurrences with a replacement string.
*
* @param {string} str - input string
* @param {(string|RegExp)} search - search expression
* @param {(string|Function)} newval - replacement value or function
* @throws {TypeError} first argument must be a string primitive
* @throws {TypeError} second argument argument must be a string primitive or regular expression
* @throws {TypeError} third argument must be a string primitive or function
* @returns {string} new string containing replacement(s)
*
* @example
* var str = 'beep';
* var out = replace( str, 'e', 'o' );
* // returns 'boop'
*
* @example
* var str = 'Hello World';
* var out = replace( str, /world/i, 'Mr. President' );
* // returns 'Hello Mr. President'
*
* @example
* var capitalize = require( '@stdlib/string/capitalize' );
*
* var str = 'Oranges and lemons say the bells of St. Clement\'s';
*
* function replacer( match, p1 ) {
* return capitalize( p1 );
* }
*
* var out = replace( str, /([^\s]*)/gi, replacer);
* // returns 'Oranges And Lemons Say The Bells Of St. Clement\'s'
*/
function replace( str, search, newval ) {
if ( !isString( str ) ) {
throw new TypeError( 'invalid argument. First argument must be a string primitive. Value: `' + str + '`.' );
}
if ( isString( search ) ) {
search = rescape( search );
search = new RegExp( search, 'g' );
}
else if ( !isRegExp( search ) ) {
throw new TypeError( 'invalid argument. Second argument must be a string primitive or regular expression. Value: `' + search + '`.' );
}
if ( !isString( newval ) && !isFunction( newval ) ) {
throw new TypeError( 'invalid argument. Third argument must be a string primitive or replacement function. Value: `' + newval + '`.' );
}
return str.replace( search, newval );
}
// EXPORTS //
module.exports = replace;
},{"@stdlib/assert/is-function":102,"@stdlib/assert/is-regexp":154,"@stdlib/assert/is-string":158,"@stdlib/utils/escape-regexp-string":368}],343:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Trim whitespace characters from the beginning and end of a string.
*
* @module @stdlib/string/trim
*
* @example
* var trim = require( '@stdlib/string/trim' );
*
* var out = trim( ' Whitespace ' );
* // returns 'Whitespace'
*
* out = trim( '\t\t\tTabs\t\t\t' );
* // returns 'Tabs'
*
* out = trim( '\n\n\nNew Lines\n\n\n' );
* // returns 'New Lines'
*/
// MODULES //
var trim = require( './trim.js' );
// EXPORTS //
module.exports = trim;
},{"./trim.js":344}],344:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var replace = require( '@stdlib/string/replace' );
// VARIABLES //
// The following regular expression should suffice to polyfill (most?) all environments.
var RE = /^[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*([\S\s]*?)[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*$/;
// MAIN //
/**
* Trim whitespace characters from beginning and end of a string.
*
* @param {string} str - input string
* @throws {TypeError} must provide a string primitive
* @returns {string} trimmed string
*
* @example
* var out = trim( ' Whitespace ' );
* // returns 'Whitespace'
*
* @example
* var out = trim( '\t\t\tTabs\t\t\t' );
* // returns 'Tabs'
*
* @example
* var out = trim( '\n\n\nNew Lines\n\n\n' );
* // returns 'New Lines'
*/
function trim( str ) {
if ( !isString( str ) ) {
throw new TypeError( 'invalid argument. Must provide a string primitive. Value: `' + str + '`.' );
}
return replace( str, RE, '$1' );
}
// EXPORTS //
module.exports = trim;
},{"@stdlib/assert/is-string":158,"@stdlib/string/replace":341}],345:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var getGlobal = require( '@stdlib/utils/global' );
var isObject = require( '@stdlib/assert/is-object' );
var modf = require( '@stdlib/math/base/special/modf' );
var round = require( '@stdlib/math/base/special/round' );
var now = require( './now.js' );
// VARIABLES //
var Global = getGlobal();
var ts;
var ns;
if ( isObject( Global.performance ) ) {
ns = Global.performance;
} else {
ns = {};
}
if ( ns.now ) {
ts = ns.now.bind( ns );
} else if ( ns.mozNow ) {
ts = ns.mozNow.bind( ns );
} else if ( ns.msNow ) {
ts = ns.msNow.bind( ns );
} else if ( ns.oNow ) {
ts = ns.oNow.bind( ns );
} else if ( ns.webkitNow ) {
ts = ns.webkitNow.bind( ns );
} else {
ts = now;
}
// MAIN //
/**
* Returns a high-resolution time.
*
* ## Notes
*
* - Output format: `[seconds, nanoseconds]`.
*
*
* @private
* @returns {NumberArray} high-resolution time
*
* @example
* var t = tic();
* // returns [<number>,<number>]
*/
function tic() {
var parts;
var t;
// Get a millisecond timestamp and convert to seconds:
t = ts() / 1000;
// Decompose the timestamp into integer (seconds) and fractional parts:
parts = modf( t );
// Convert the fractional part to nanoseconds:
parts[ 1 ] = round( parts[1] * 1.0e9 );
// Return the high-resolution time:
return parts;
}
// EXPORTS //
module.exports = tic;
},{"./now.js":347,"@stdlib/assert/is-object":145,"@stdlib/math/base/special/modf":277,"@stdlib/math/base/special/round":280,"@stdlib/utils/global":380}],346:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
// MAIN //
var bool = isFunction( Date.now );
// EXPORTS //
module.exports = bool;
},{"@stdlib/assert/is-function":102}],347:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var bool = require( './detect.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var now;
if ( bool ) {
now = Date.now;
} else {
now = polyfill;
}
// EXPORTS //
module.exports = now;
},{"./detect.js":346,"./polyfill.js":348}],348:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Returns the time in milliseconds since the epoch.
*
* @private
* @returns {number} time
*
* @example
* var ts = now();
* // returns <number>
*/
function now() {
var d = new Date();
return d.getTime();
}
// EXPORTS //
module.exports = now;
},{}],349:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return a high-resolution time difference.
*
* @module @stdlib/time/toc
*
* @example
* var tic = require( '@stdlib/time/tic' );
* var toc = require( '@stdlib/time/toc' );
*
* var start = tic();
* var delta = toc( start );
* // returns [<number>,<number>]
*/
// MODULES //
var toc = require( './toc.js' );
// EXPORTS //
module.exports = toc;
},{"./toc.js":350}],350:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).primitives;
var tic = require( '@stdlib/time/tic' );
// MAIN //
/**
* Returns a high-resolution time difference.
*
* ## Notes
*
* - Output format: `[seconds, nanoseconds]`.
*
*
* @param {NonNegativeIntegerArray} time - high-resolution time
* @throws {TypeError} must provide a nonnegative integer array
* @throws {RangeError} input array must have length `2`
* @returns {NumberArray} high resolution time difference
*
* @example
* var tic = require( '@stdlib/time/tic' );
*
* var start = tic();
* var delta = toc( start );
* // returns [<number>,<number>]
*/
function toc( time ) {
var now = tic();
var sec;
var ns;
if ( !isNonNegativeIntegerArray( time ) ) {
throw new TypeError( 'invalid argument. Must provide an array of nonnegative integers. Value: `' + time + '`.' );
}
if ( time.length !== 2 ) {
throw new RangeError( 'invalid argument. Input array must have length `2`.' );
}
sec = now[ 0 ] - time[ 0 ];
ns = now[ 1 ] - time[ 1 ];
if ( sec > 0 && ns < 0 ) {
sec -= 1;
ns += 1e9;
}
else if ( sec < 0 && ns > 0 ) {
sec += 1;
ns -= 1e9;
}
return [ sec, ns ];
}
// EXPORTS //
module.exports = toc;
},{"@stdlib/assert/is-nonnegative-integer-array":126,"@stdlib/time/tic":345}],351:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Determine the name of a value's constructor.
*
* @module @stdlib/utils/constructor-name
*
* @example
* var constructorName = require( '@stdlib/utils/constructor-name' );
*
* var v = constructorName( 'a' );
* // returns 'String'
*
* v = constructorName( {} );
* // returns 'Object'
*
* v = constructorName( true );
* // returns 'Boolean'
*/
// MODULES //
var constructorName = require( './main.js' );
// EXPORTS //
module.exports = constructorName;
},{"./main.js":352}],352:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
var RE = require( '@stdlib/regexp/function-name' ).REGEXP;
var isBuffer = require( '@stdlib/assert/is-buffer' );
// MAIN //
/**
* Determines the name of a value's constructor.
*
* @param {*} v - input value
* @returns {string} name of a value's constructor
*
* @example
* var v = constructorName( 'a' );
* // returns 'String'
*
* @example
* var v = constructorName( 5 );
* // returns 'Number'
*
* @example
* var v = constructorName( null );
* // returns 'Null'
*
* @example
* var v = constructorName( undefined );
* // returns 'Undefined'
*
* @example
* var v = constructorName( function noop() {} );
* // returns 'Function'
*/
function constructorName( v ) {
var match;
var name;
var ctor;
name = nativeClass( v ).slice( 8, -1 );
if ( (name === 'Object' || name === 'Error') && v.constructor ) {
ctor = v.constructor;
if ( typeof ctor.name === 'string' ) {
return ctor.name;
}
match = RE.exec( ctor.toString() );
if ( match ) {
return match[ 1 ];
}
}
if ( isBuffer( v ) ) {
return 'Buffer';
}
return name;
}
// EXPORTS //
module.exports = constructorName;
},{"@stdlib/assert/is-buffer":88,"@stdlib/regexp/function-name":324,"@stdlib/utils/native-class":408}],353:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isArray = require( '@stdlib/assert/is-array' );
var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
var PINF = require( '@stdlib/constants/float64/pinf' );
var deepCopy = require( './deep_copy.js' );
// MAIN //
/**
* Copies or deep clones a value to an arbitrary depth.
*
* @param {*} value - value to copy
* @param {NonNegativeInteger} [level=+infinity] - copy depth
* @throws {TypeError} `level` must be a nonnegative integer
* @returns {*} value copy
*
* @example
* var out = copy( 'beep' );
* // returns 'beep'
*
* @example
* var value = [
* {
* 'a': 1,
* 'b': true,
* 'c': [ 1, 2, 3 ]
* }
* ];
* var out = copy( value );
* // returns [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]
*
* var bool = ( value[0].c === out[0].c );
* // returns false
*/
function copy( value, level ) {
var out;
if ( arguments.length > 1 ) {
if ( !isNonNegativeInteger( level ) ) {
throw new TypeError( 'invalid argument. `level` must be a nonnegative integer. Value: `' + level + '`.' );
}
if ( level === 0 ) {
return value;
}
} else {
level = PINF;
}
out = ( isArray( value ) ) ? new Array( value.length ) : {};
return deepCopy( value, out, [value], [out], level );
}
// EXPORTS //
module.exports = copy;
},{"./deep_copy.js":354,"@stdlib/assert/is-array":79,"@stdlib/assert/is-nonnegative-integer":127,"@stdlib/constants/float64/pinf":242}],354:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isArray = require( '@stdlib/assert/is-array' );
var isBuffer = require( '@stdlib/assert/is-buffer' );
var isError = require( '@stdlib/assert/is-error' );
var typeOf = require( '@stdlib/utils/type-of' );
var regexp = require( '@stdlib/utils/regexp-from-string' );
var indexOf = require( '@stdlib/utils/index-of' );
var objectKeys = require( '@stdlib/utils/keys' );
var propertyNames = require( '@stdlib/utils/property-names' );
var propertyDescriptor = require( '@stdlib/utils/property-descriptor' );
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var defineProperty = require( '@stdlib/utils/define-property' );
var copyBuffer = require( '@stdlib/buffer/from-buffer' );
var typedArrays = require( './typed_arrays.js' );
// FUNCTIONS //
/**
* Clones a class instance.
*
* ## Notes
*
* - This should **only** be used for simple cases. Any instances with privileged access to variables (e.g., within closures) cannot be cloned. This approach should be considered **fragile**.
* - The function is greedy, disregarding the notion of a `level`. Instead, the function deep copies all properties, as we assume the concept of `level` applies only to the class instance reference but not to its internal state. This prevents, in theory, two instances from sharing state.
*
*
* @private
* @param {Object} val - class instance
* @returns {Object} new instance
*/
function cloneInstance( val ) {
var cache;
var names;
var name;
var refs;
var desc;
var tmp;
var ref;
var i;
cache = [];
refs = [];
ref = Object.create( getPrototypeOf( val ) );
cache.push( val );
refs.push( ref );
names = propertyNames( val );
for ( i = 0; i < names.length; i++ ) {
name = names[ i ];
desc = propertyDescriptor( val, name );
if ( hasOwnProp( desc, 'value' ) ) {
tmp = ( isArray( val[name] ) ) ? [] : {};
desc.value = deepCopy( val[name], tmp, cache, refs, -1 );
}
defineProperty( ref, name, desc );
}
if ( !Object.isExtensible( val ) ) {
Object.preventExtensions( ref );
}
if ( Object.isSealed( val ) ) {
Object.seal( ref );
}
if ( Object.isFrozen( val ) ) {
Object.freeze( ref );
}
return ref;
}
/**
* Copies an error object.
*
* @private
* @param {(Error|TypeError|SyntaxError|URIError|ReferenceError|RangeError|EvalError)} error - error to copy
* @returns {(Error|TypeError|SyntaxError|URIError|ReferenceError|RangeError|EvalError)} error copy
*
* @example
* var err1 = new TypeError( 'beep' );
*
* var err2 = copyError( err1 );
* // returns <TypeError>
*/
function copyError( error ) {
var cache = [];
var refs = [];
var keys;
var desc;
var tmp;
var key;
var err;
var i;
// Create a new error...
err = new error.constructor( error.message );
cache.push( error );
refs.push( err );
// If a `stack` property is present, copy it over...
if ( error.stack ) {
err.stack = error.stack;
}
// Node.js specific (system errors)...
if ( error.code ) {
err.code = error.code;
}
if ( error.errno ) {
err.errno = error.errno;
}
if ( error.syscall ) {
err.syscall = error.syscall;
}
// Any enumerable properties...
keys = objectKeys( error );
for ( i = 0; i < keys.length; i++ ) {
key = keys[ i ];
desc = propertyDescriptor( error, key );
if ( hasOwnProp( desc, 'value' ) ) {
tmp = ( isArray( error[ key ] ) ) ? [] : {};
desc.value = deepCopy( error[ key ], tmp, cache, refs, -1 );
}
defineProperty( err, key, desc );
}
return err;
}
// MAIN //
/**
* Recursively performs a deep copy of an input object.
*
* @private
* @param {*} val - value to copy
* @param {(Array|Object)} copy - copy
* @param {Array} cache - an array of visited objects
* @param {Array} refs - an array of object references
* @param {NonNegativeInteger} level - copy depth
* @returns {*} deep copy
*/
function deepCopy( val, copy, cache, refs, level ) {
var parent;
var keys;
var name;
var desc;
var ctor;
var key;
var ref;
var x;
var i;
var j;
level -= 1;
// Primitives and functions...
if (
typeof val !== 'object' ||
val === null
) {
return val;
}
if ( isBuffer( val ) ) {
return copyBuffer( val );
}
if ( isError( val ) ) {
return copyError( val );
}
// Objects...
name = typeOf( val );
if ( name === 'date' ) {
return new Date( +val );
}
if ( name === 'regexp' ) {
return regexp( val.toString() );
}
if ( name === 'set' ) {
return new Set( val );
}
if ( name === 'map' ) {
return new Map( val );
}
if (
name === 'string' ||
name === 'boolean' ||
name === 'number'
) {
// If provided an `Object`, return an equivalent primitive!
return val.valueOf();
}
ctor = typedArrays[ name ];
if ( ctor ) {
return ctor( val );
}
// Class instances...
if (
name !== 'array' &&
name !== 'object'
) {
// Cloning requires ES5 or higher...
if ( typeof Object.freeze === 'function' ) {
return cloneInstance( val );
}
return {};
}
// Arrays and plain objects...
keys = objectKeys( val );
if ( level > 0 ) {
parent = name;
for ( j = 0; j < keys.length; j++ ) {
key = keys[ j ];
x = val[ key ];
// Primitive, Buffer, special class instance...
name = typeOf( x );
if (
typeof x !== 'object' ||
x === null ||
(
name !== 'array' &&
name !== 'object'
) ||
isBuffer( x )
) {
if ( parent === 'object' ) {
desc = propertyDescriptor( val, key );
if ( hasOwnProp( desc, 'value' ) ) {
desc.value = deepCopy( x );
}
defineProperty( copy, key, desc );
} else {
copy[ key ] = deepCopy( x );
}
continue;
}
// Circular reference...
i = indexOf( cache, x );
if ( i !== -1 ) {
copy[ key ] = refs[ i ];
continue;
}
// Plain array or object...
ref = ( isArray( x ) ) ? new Array( x.length ) : {};
cache.push( x );
refs.push( ref );
if ( parent === 'array' ) {
copy[ key ] = deepCopy( x, ref, cache, refs, level );
} else {
desc = propertyDescriptor( val, key );
if ( hasOwnProp( desc, 'value' ) ) {
desc.value = deepCopy( x, ref, cache, refs, level );
}
defineProperty( copy, key, desc );
}
}
} else if ( name === 'array' ) {
for ( j = 0; j < keys.length; j++ ) {
key = keys[ j ];
copy[ key ] = val[ key ];
}
} else {
for ( j = 0; j < keys.length; j++ ) {
key = keys[ j ];
desc = propertyDescriptor( val, key );
defineProperty( copy, key, desc );
}
}
if ( !Object.isExtensible( val ) ) {
Object.preventExtensions( copy );
}
if ( Object.isSealed( val ) ) {
Object.seal( copy );
}
if ( Object.isFrozen( val ) ) {
Object.freeze( copy );
}
return copy;
}
// EXPORTS //
module.exports = deepCopy;
},{"./typed_arrays.js":356,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-array":79,"@stdlib/assert/is-buffer":88,"@stdlib/assert/is-error":96,"@stdlib/buffer/from-buffer":232,"@stdlib/utils/define-property":366,"@stdlib/utils/get-prototype-of":374,"@stdlib/utils/index-of":384,"@stdlib/utils/keys":401,"@stdlib/utils/property-descriptor":423,"@stdlib/utils/property-names":427,"@stdlib/utils/regexp-from-string":430,"@stdlib/utils/type-of":435}],355:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Copy or deep clone a value to an arbitrary depth.
*
* @module @stdlib/utils/copy
*
* @example
* var copy = require( '@stdlib/utils/copy' );
*
* var out = copy( 'beep' );
* // returns 'beep'
*
* @example
* var copy = require( '@stdlib/utils/copy' );
*
* var value = [
* {
* 'a': 1,
* 'b': true,
* 'c': [ 1, 2, 3 ]
* }
* ];
* var out = copy( value );
* // returns [ {'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]
*
* var bool = ( value[0].c === out[0].c );
* // returns false
*/
// MODULES //
var copy = require( './copy.js' );
// EXPORTS //
module.exports = copy;
},{"./copy.js":353}],356:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var Int8Array = require( '@stdlib/array/int8' );
var Uint8Array = require( '@stdlib/array/uint8' );
var Uint8ClampedArray = require( '@stdlib/array/uint8c' );
var Int16Array = require( '@stdlib/array/int16' );
var Uint16Array = require( '@stdlib/array/uint16' );
var Int32Array = require( '@stdlib/array/int32' );
var Uint32Array = require( '@stdlib/array/uint32' );
var Float32Array = require( '@stdlib/array/float32' );
var Float64Array = require( '@stdlib/array/float64' );
// VARIABLES //
var hash;
// FUNCTIONS //
/**
* Copies an `Int8Array`.
*
* @private
* @param {Int8Array} arr - array to copy
* @returns {Int8Array} new array
*/
function int8array( arr ) {
return new Int8Array( arr );
}
/**
* Copies a `Uint8Array`.
*
* @private
* @param {Uint8Array} arr - array to copy
* @returns {Uint8Array} new array
*/
function uint8array( arr ) {
return new Uint8Array( arr );
}
/**
* Copies a `Uint8ClampedArray`.
*
* @private
* @param {Uint8ClampedArray} arr - array to copy
* @returns {Uint8ClampedArray} new array
*/
function uint8clampedarray( arr ) {
return new Uint8ClampedArray( arr );
}
/**
* Copies an `Int16Array`.
*
* @private
* @param {Int16Array} arr - array to copy
* @returns {Int16Array} new array
*/
function int16array( arr ) {
return new Int16Array( arr );
}
/**
* Copies a `Uint16Array`.
*
* @private
* @param {Uint16Array} arr - array to copy
* @returns {Uint16Array} new array
*/
function uint16array( arr ) {
return new Uint16Array( arr );
}
/**
* Copies an `Int32Array`.
*
* @private
* @param {Int32Array} arr - array to copy
* @returns {Int32Array} new array
*/
function int32array( arr ) {
return new Int32Array( arr );
}
/**
* Copies a `Uint32Array`.
*
* @private
* @param {Uint32Array} arr - array to copy
* @returns {Uint32Array} new array
*/
function uint32array( arr ) {
return new Uint32Array( arr );
}
/**
* Copies a `Float32Array`.
*
* @private
* @param {Float32Array} arr - array to copy
* @returns {Float32Array} new array
*/
function float32array( arr ) {
return new Float32Array( arr );
}
/**
* Copies a `Float64Array`.
*
* @private
* @param {Float64Array} arr - array to copy
* @returns {Float64Array} new array
*/
function float64array( arr ) {
return new Float64Array( arr );
}
/**
* Returns a hash of functions for copying typed arrays.
*
* @private
* @returns {Object} function hash
*/
function typedarrays() {
var out = {
'int8array': int8array,
'uint8array': uint8array,
'uint8clampedarray': uint8clampedarray,
'int16array': int16array,
'uint16array': uint16array,
'int32array': int32array,
'uint32array': uint32array,
'float32array': float32array,
'float64array': float64array
};
return out;
}
// MAIN //
hash = typedarrays();
// EXPORTS //
module.exports = hash;
},{"@stdlib/array/float32":2,"@stdlib/array/float64":5,"@stdlib/array/int16":7,"@stdlib/array/int32":10,"@stdlib/array/int8":13,"@stdlib/array/uint16":20,"@stdlib/array/uint32":23,"@stdlib/array/uint8":26,"@stdlib/array/uint8c":29}],357:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Define a non-enumerable read-only accessor.
*
* @module @stdlib/utils/define-nonenumerable-read-only-accessor
*
* @example
* var setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
*
* function getter() {
* return 'bar';
* }
*
* var obj = {};
*
* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );
*
* try {
* obj.foo = 'boop';
* } catch ( err ) {
* console.error( err.message );
* }
*/
// MODULES //
var setNonEnumerableReadOnlyAccessor = require( './main.js' ); // eslint-disable-line id-length
// EXPORTS //
module.exports = setNonEnumerableReadOnlyAccessor;
},{"./main.js":358}],358:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var defineProperty = require( '@stdlib/utils/define-property' );
// MAIN //
/**
* Defines a non-enumerable read-only accessor.
*
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {Function} getter - accessor
*
* @example
* function getter() {
* return 'bar';
* }
*
* var obj = {};
*
* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );
*
* try {
* obj.foo = 'boop';
* } catch ( err ) {
* console.error( err.message );
* }
*/
function setNonEnumerableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length
defineProperty( obj, prop, {
'configurable': false,
'enumerable': false,
'get': getter
});
}
// EXPORTS //
module.exports = setNonEnumerableReadOnlyAccessor;
},{"@stdlib/utils/define-property":366}],359:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Define a non-enumerable read-only property.
*
* @module @stdlib/utils/define-nonenumerable-read-only-property
*
* @example
* var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
*
* var obj = {};
*
* setNonEnumerableReadOnly( obj, 'foo', 'bar' );
*
* try {
* obj.foo = 'boop';
* } catch ( err ) {
* console.error( err.message );
* }
*/
// MODULES //
var setNonEnumerableReadOnly = require( './main.js' );
// EXPORTS //
module.exports = setNonEnumerableReadOnly;
},{"./main.js":360}],360:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var defineProperty = require( '@stdlib/utils/define-property' );
// MAIN //
/**
* Defines a non-enumerable read-only property.
*
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {*} value - value to set
*
* @example
* var obj = {};
*
* setNonEnumerableReadOnly( obj, 'foo', 'bar' );
*
* try {
* obj.foo = 'boop';
* } catch ( err ) {
* console.error( err.message );
* }
*/
function setNonEnumerableReadOnly( obj, prop, value ) {
defineProperty( obj, prop, {
'configurable': false,
'enumerable': false,
'writable': false,
'value': value
});
}
// EXPORTS //
module.exports = setNonEnumerableReadOnly;
},{"@stdlib/utils/define-property":366}],361:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Define a non-enumerable read-write accessor.
*
* @module @stdlib/utils/define-nonenumerable-read-write-accessor
*
* @example
* var setNonEnumerableReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );
*
* function getter() {
* return name + ' foo';
* }
*
* function setter( v ) {
* name = v;
* }
*
* var name = 'bar';
* var obj = {};
*
* setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );
*
* var v = obj.foo;
* // returns 'bar foo'
*
* obj.foo = 'beep';
*
* v = obj.foo;
* // returns 'beep foo'
*/
// MODULES //
var setNonEnumerableReadWriteAccessor = require( './main.js' );
// EXPORTS //
module.exports = setNonEnumerableReadWriteAccessor;
},{"./main.js":362}],362:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var defineProperty = require( '@stdlib/utils/define-property' );
// MAIN //
/**
* Defines a non-enumerable read-write accessor.
*
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {Function} getter - get accessor
* @param {Function} setter - set accessor
*
* @example
* function getter() {
* return name + ' foo';
* }
*
* function setter( v ) {
* name = v;
* }
*
* var name = 'bar';
* var obj = {};
*
* setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );
*
* var v = obj.foo;
* // returns 'bar foo'
*
* obj.foo = 'beep';
*
* v = obj.foo;
* // returns 'beep foo'
*/
function setNonEnumerableReadWriteAccessor( obj, prop, getter, setter ) { // eslint-disable-line id-length
defineProperty( obj, prop, {
'configurable': false,
'enumerable': false,
'get': getter,
'set': setter
});
}
// EXPORTS //
module.exports = setNonEnumerableReadWriteAccessor;
},{"@stdlib/utils/define-property":366}],363:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Defines (or modifies) an object property.
*
* ## Notes
*
* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.
*
* @name defineProperty
* @type {Function}
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {Object} descriptor - property descriptor
* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object
* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties
* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator
* @param {*} [descriptor.value] - property value
* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.
* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.
* @throws {TypeError} first argument must be an object
* @throws {TypeError} third argument must be an object
* @throws {Error} property descriptor cannot have both a value and a setter and/or getter
* @returns {Object} object with added property
*
* @example
* var obj = {};
*
* defineProperty( obj, 'foo', {
* 'value': 'bar'
* });
*
* var str = obj.foo;
* // returns 'bar'
*/
var defineProperty = Object.defineProperty;
// EXPORTS //
module.exports = defineProperty;
},{}],364:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib 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.
*/
'use strict';
// MAIN //
var main = ( typeof Object.defineProperty === 'function' ) ? Object.defineProperty : null;
// EXPORTS //
module.exports = main;
},{}],365:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib 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.
*/
'use strict';
// MODULES //
var defineProperty = require( './define_property.js' );
// MAIN //
/**
* Tests for `Object.defineProperty` support.
*
* @private
* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support
*
* @example
* var bool = hasDefinePropertySupport();
* // returns <boolean>
*/
function hasDefinePropertySupport() {
// Test basic support...
try {
defineProperty( {}, 'x', {} );
return true;
} catch ( err ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = hasDefinePropertySupport;
},{"./define_property.js":364}],366:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Define (or modify) an object property.
*
* @module @stdlib/utils/define-property
*
* @example
* var defineProperty = require( '@stdlib/utils/define-property' );
*
* var obj = {};
* defineProperty( obj, 'foo', {
* 'value': 'bar',
* 'writable': false,
* 'configurable': false,
* 'enumerable': false
* });
* obj.foo = 'boop'; // => throws
*/
// MODULES //
var hasDefinePropertySupport = require( './has_define_property_support.js' );
var builtin = require( './builtin.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var defineProperty;
if ( hasDefinePropertySupport() ) {
defineProperty = builtin;
} else {
defineProperty = polyfill;
}
// EXPORTS //
module.exports = defineProperty;
},{"./builtin.js":363,"./has_define_property_support.js":365,"./polyfill.js":367}],367:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
/* eslint-disable no-underscore-dangle, no-proto */
'use strict';
// VARIABLES //
var objectProtoype = Object.prototype;
var toStr = objectProtoype.toString;
var defineGetter = objectProtoype.__defineGetter__;
var defineSetter = objectProtoype.__defineSetter__;
var lookupGetter = objectProtoype.__lookupGetter__;
var lookupSetter = objectProtoype.__lookupSetter__;
// MAIN //
/**
* Defines (or modifies) an object property.
*
* ## Notes
*
* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.
*
* @param {Object} obj - object on which to define the property
* @param {string} prop - property name
* @param {Object} descriptor - property descriptor
* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object
* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties
* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator
* @param {*} [descriptor.value] - property value
* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.
* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.
* @throws {TypeError} first argument must be an object
* @throws {TypeError} third argument must be an object
* @throws {Error} property descriptor cannot have both a value and a setter and/or getter
* @returns {Object} object with added property
*
* @example
* var obj = {};
*
* defineProperty( obj, 'foo', {
* 'value': 'bar'
* });
*
* var str = obj.foo;
* // returns 'bar'
*/
function defineProperty( obj, prop, descriptor ) {
var prototype;
var hasValue;
var hasGet;
var hasSet;
if ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `' + obj + '`.' );
}
if ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {
throw new TypeError( 'invalid argument. Property descriptor must be an object. Value: `' + descriptor + '`.' );
}
hasValue = ( 'value' in descriptor );
if ( hasValue ) {
if (
lookupGetter.call( obj, prop ) ||
lookupSetter.call( obj, prop )
) {
// Override `__proto__` to avoid touching inherited accessors:
prototype = obj.__proto__;
obj.__proto__ = objectProtoype;
// Delete property as existing getters/setters prevent assigning value to specified property:
delete obj[ prop ];
obj[ prop ] = descriptor.value;
// Restore original prototype:
obj.__proto__ = prototype;
} else {
obj[ prop ] = descriptor.value;
}
}
hasGet = ( 'get' in descriptor );
hasSet = ( 'set' in descriptor );
if ( hasValue && ( hasGet || hasSet ) ) {
throw new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );
}
if ( hasGet && defineGetter ) {
defineGetter.call( obj, prop, descriptor.get );
}
if ( hasSet && defineSetter ) {
defineSetter.call( obj, prop, descriptor.set );
}
return obj;
}
// EXPORTS //
module.exports = defineProperty;
},{}],368:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Escape a regular expression string or pattern.
*
* @module @stdlib/utils/escape-regexp-string
*
* @example
* var rescape = require( '@stdlib/utils/escape-regexp-string' );
*
* var str = rescape( '[A-Z]*' );
* // returns '\\[A\\-Z\\]\\*'
*/
// MODULES //
var rescape = require( './main.js' );
// EXPORTS //
module.exports = rescape;
},{"./main.js":369}],369:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
// VARIABLES //
var RE_CHARS = /[-\/\\^$*+?.()|[\]{}]/g; // eslint-disable-line no-useless-escape
// MAIN //
/**
* Escapes a regular expression string.
*
* @param {string} str - regular expression string
* @throws {TypeError} first argument must be a string primitive
* @returns {string} escaped string
*
* @example
* var str = rescape( '[A-Z]*' );
* // returns '\\[A\\-Z\\]\\*'
*/
function rescape( str ) {
var len;
var s;
var i;
if ( !isString( str ) ) {
throw new TypeError( 'invalid argument. Must provide a regular expression string. Value: `' + str + '`.' );
}
// Check if the string starts with a forward slash...
if ( str[ 0 ] === '/' ) {
// Find the last forward slash...
len = str.length;
for ( i = len-1; i >= 0; i-- ) {
if ( str[ i ] === '/' ) {
break;
}
}
}
// If we searched the string to no avail or if the first letter is not `/`, assume that the string is not of the form `/[...]/[guimy]`:
if ( i === void 0 || i <= 0 ) {
return str.replace( RE_CHARS, '\\$&' );
}
// We need to de-construct the string...
s = str.substring( 1, i );
// Only escape the characters between the `/`:
s = s.replace( RE_CHARS, '\\$&' );
// Reassemble:
str = str[ 0 ] + s + str.substring( i );
return str;
}
// EXPORTS //
module.exports = rescape;
},{"@stdlib/assert/is-string":158}],370:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
var hasFunctionNameSupport = require( '@stdlib/assert/has-function-name-support' );
var RE = require( '@stdlib/regexp/function-name' ).REGEXP;
// VARIABLES //
var isFunctionNameSupported = hasFunctionNameSupport();
// MAIN //
/**
* Returns the name of a function.
*
* @param {Function} fcn - input function
* @throws {TypeError} must provide a function
* @returns {string} function name
*
* @example
* var v = functionName( Math.sqrt );
* // returns 'sqrt'
*
* @example
* var v = functionName( function foo(){} );
* // returns 'foo'
*
* @example
* var v = functionName( function(){} );
* // returns '' || 'anonymous'
*
* @example
* var v = functionName( String );
* // returns 'String'
*/
function functionName( fcn ) {
// TODO: add support for generator functions?
if ( isFunction( fcn ) === false ) {
throw new TypeError( 'invalid argument. Must provide a function. Value: `' + fcn + '`.' );
}
if ( isFunctionNameSupported ) {
return fcn.name;
}
return RE.exec( fcn.toString() )[ 1 ];
}
// EXPORTS //
module.exports = functionName;
},{"@stdlib/assert/has-function-name-support":39,"@stdlib/assert/is-function":102,"@stdlib/regexp/function-name":324}],371:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return the name of a function.
*
* @module @stdlib/utils/function-name
*
* @example
* var functionName = require( '@stdlib/utils/function-name' );
*
* var v = functionName( String );
* // returns 'String'
*
* v = functionName( function foo(){} );
* // returns 'foo'
*
* v = functionName( function(){} );
* // returns '' || 'anonymous'
*/
// MODULES //
var functionName = require( './function_name.js' );
// EXPORTS //
module.exports = functionName;
},{"./function_name.js":370}],372:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
var builtin = require( './native.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var getProto;
if ( isFunction( Object.getPrototypeOf ) ) {
getProto = builtin;
} else {
getProto = polyfill;
}
// EXPORTS //
module.exports = getProto;
},{"./native.js":375,"./polyfill.js":376,"@stdlib/assert/is-function":102}],373:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var getProto = require( './detect.js' );
// MAIN //
/**
* Returns the prototype of a provided object.
*
* @param {*} value - input value
* @returns {(Object|null)} prototype
*
* @example
* var proto = getPrototypeOf( {} );
* // returns {}
*/
function getPrototypeOf( value ) {
if (
value === null ||
value === void 0
) {
return null;
}
// In order to ensure consistent ES5/ES6 behavior, cast input value to an object (strings, numbers, booleans); ES5 `Object.getPrototypeOf` throws when provided primitives and ES6 `Object.getPrototypeOf` casts:
value = Object( value );
return getProto( value );
}
// EXPORTS //
module.exports = getPrototypeOf;
},{"./detect.js":372}],374:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return the prototype of a provided object.
*
* @module @stdlib/utils/get-prototype-of
*
* @example
* var getPrototype = require( '@stdlib/utils/get-prototype-of' );
*
* var proto = getPrototype( {} );
* // returns {}
*/
// MODULES //
var getPrototype = require( './get_prototype_of.js' );
// EXPORTS //
module.exports = getPrototype;
},{"./get_prototype_of.js":373}],375:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var getProto = Object.getPrototypeOf;
// EXPORTS //
module.exports = getProto;
},{}],376:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
var getProto = require( './proto.js' );
// MAIN //
/**
* Returns the prototype of a provided object.
*
* @private
* @param {Object} obj - input object
* @returns {(Object|null)} prototype
*/
function getPrototypeOf( obj ) {
var proto = getProto( obj );
if ( proto || proto === null ) {
return proto;
}
if ( nativeClass( obj.constructor ) === '[object Function]' ) {
// May break if the constructor has been tampered with...
return obj.constructor.prototype;
}
if ( obj instanceof Object ) {
return Object.prototype;
}
// Return `null` for objects created via `Object.create( null )`. Also return `null` for cross-realm objects on browsers that lack `__proto__` support, such as IE < 11.
return null;
}
// EXPORTS //
module.exports = getPrototypeOf;
},{"./proto.js":377,"@stdlib/utils/native-class":408}],377:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Returns the value of the `__proto__` property.
*
* @private
* @param {Object} obj - input object
* @returns {*} value of `__proto__` property
*/
function getProto( obj ) {
// eslint-disable-next-line no-proto
return obj.__proto__;
}
// EXPORTS //
module.exports = getProto;
},{}],378:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Returns the global object using code generation.
*
* @private
* @returns {Object} global object
*/
function getGlobal() {
return new Function( 'return this;' )(); // eslint-disable-line no-new-func
}
// EXPORTS //
module.exports = getGlobal;
},{}],379:[function(require,module,exports){
(function (global){(function (){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var obj = ( typeof global === 'object' ) ? global : null;
// EXPORTS //
module.exports = obj;
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],380:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return the global object.
*
* @module @stdlib/utils/global
*
* @example
* var getGlobal = require( '@stdlib/utils/global' );
*
* var g = getGlobal();
* // returns {...}
*/
// MODULES //
var getGlobal = require( './main.js' );
// EXPORTS //
module.exports = getGlobal;
},{"./main.js":381}],381:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var getThis = require( './codegen.js' );
var Self = require( './self.js' );
var Win = require( './window.js' );
var Global = require( './global.js' );
// MAIN //
/**
* Returns the global object.
*
* ## Notes
*
* - Using code generation is the **most** reliable way to resolve the global object; however, doing so is likely to violate content security policies (CSPs) in, e.g., Chrome Apps and elsewhere.
*
* @param {boolean} [codegen=false] - boolean indicating whether to use code generation to resolve the global object
* @throws {TypeError} must provide a boolean
* @throws {Error} unable to resolve global object
* @returns {Object} global object
*
* @example
* var g = getGlobal();
* // returns {...}
*/
function getGlobal( codegen ) {
if ( arguments.length ) {
if ( !isBoolean( codegen ) ) {
throw new TypeError( 'invalid argument. Must provide a boolean primitive. Value: `'+codegen+'`.' );
}
if ( codegen ) {
return getThis();
}
// Fall through...
}
// Case: browsers and web workers
if ( Self ) {
return Self;
}
// Case: browsers
if ( Win ) {
return Win;
}
// Case: Node.js
if ( Global ) {
return Global;
}
// Case: unknown
throw new Error( 'unexpected error. Unable to resolve global object.' );
}
// EXPORTS //
module.exports = getGlobal;
},{"./codegen.js":378,"./global.js":379,"./self.js":382,"./window.js":383,"@stdlib/assert/is-boolean":81}],382:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var obj = ( typeof self === 'object' ) ? self : null;
// EXPORTS //
module.exports = obj;
},{}],383:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var obj = ( typeof window === 'object' ) ? window : null;
// EXPORTS //
module.exports = obj;
},{}],384:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return the first index at which a given element can be found.
*
* @module @stdlib/utils/index-of
*
* @example
* var indexOf = require( '@stdlib/utils/index-of' );
*
* var arr = [ 4, 3, 2, 1 ];
* var idx = indexOf( arr, 3 );
* // returns 1
*
* arr = [ 4, 3, 2, 1 ];
* idx = indexOf( arr, 5 );
* // returns -1
*
* // Using a `fromIndex`:
* arr = [ 1, 2, 3, 4, 5, 2, 6 ];
* idx = indexOf( arr, 2, 3 );
* // returns 5
*
* // `fromIndex` which exceeds `array` length:
* arr = [ 1, 2, 3, 4, 2, 5 ];
* idx = indexOf( arr, 2, 10 );
* // returns -1
*
* // Negative `fromIndex`:
* arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];
* idx = indexOf( arr, 2, -4 );
* // returns 5
*
* idx = indexOf( arr, 2, -1 );
* // returns 7
*
* // Negative `fromIndex` exceeding input `array` length:
* arr = [ 1, 2, 3, 4, 5, 2, 6 ];
* idx = indexOf( arr, 2, -10 );
* // returns 1
*
* // Array-like objects:
* var str = 'bebop';
* idx = indexOf( str, 'o' );
* // returns 3
*/
// MODULES //
var indexOf = require( './index_of.js' );
// EXPORTS //
module.exports = indexOf;
},{"./index_of.js":385}],385:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isnan = require( '@stdlib/assert/is-nan' );
var isCollection = require( '@stdlib/assert/is-collection' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
// MAIN //
/**
* Returns the first index at which a given element can be found.
*
* @param {ArrayLike} arr - array-like object
* @param {*} searchElement - element to find
* @param {integer} [fromIndex] - starting index (if negative, the start index is determined relative to last element)
* @throws {TypeError} must provide an array-like object
* @throws {TypeError} `fromIndex` must be an integer
* @returns {integer} index or -1
*
* @example
* var arr = [ 4, 3, 2, 1 ];
* var idx = indexOf( arr, 3 );
* // returns 1
*
* @example
* var arr = [ 4, 3, 2, 1 ];
* var idx = indexOf( arr, 5 );
* // returns -1
*
* @example
* // Using a `fromIndex`:
* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];
* var idx = indexOf( arr, 2, 3 );
* // returns 5
*
* @example
* // `fromIndex` which exceeds `array` length:
* var arr = [ 1, 2, 3, 4, 2, 5 ];
* var idx = indexOf( arr, 2, 10 );
* // returns -1
*
* @example
* // Negative `fromIndex`:
* var arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];
* var idx = indexOf( arr, 2, -4 );
* // returns 5
*
* idx = indexOf( arr, 2, -1 );
* // returns 7
*
* @example
* // Negative `fromIndex` exceeding input `array` length:
* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];
* var idx = indexOf( arr, 2, -10 );
* // returns 1
*
* @example
* // Array-like objects:
* var str = 'bebop';
* var idx = indexOf( str, 'o' );
* // returns 3
*/
function indexOf( arr, searchElement, fromIndex ) {
var len;
var i;
if ( !isCollection( arr ) && !isString( arr ) ) {
throw new TypeError( 'invalid argument. First argument must be an array-like object. Value: `' + arr + '`.' );
}
len = arr.length;
if ( len === 0 ) {
return -1;
}
if ( arguments.length === 3 ) {
if ( !isInteger( fromIndex ) ) {
throw new TypeError( 'invalid argument. `fromIndex` must be an integer. Value: `' + fromIndex + '`.' );
}
if ( fromIndex >= 0 ) {
if ( fromIndex >= len ) {
return -1;
}
i = fromIndex;
} else {
i = len + fromIndex;
if ( i < 0 ) {
i = 0;
}
}
} else {
i = 0;
}
// Check for `NaN`...
if ( isnan( searchElement ) ) {
for ( ; i < len; i++ ) {
if ( isnan( arr[i] ) ) {
return i;
}
}
} else {
for ( ; i < len; i++ ) {
if ( arr[ i ] === searchElement ) {
return i;
}
}
}
return -1;
}
// EXPORTS //
module.exports = indexOf;
},{"@stdlib/assert/is-collection":90,"@stdlib/assert/is-integer":110,"@stdlib/assert/is-nan":118,"@stdlib/assert/is-string":158}],386:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var builtin = require( './native.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var createObject;
if ( typeof builtin === 'function' ) {
createObject = builtin;
} else {
createObject = polyfill;
}
// EXPORTS //
module.exports = createObject;
},{"./native.js":389,"./polyfill.js":390}],387:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Implement prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.
*
* @module @stdlib/utils/inherit
*
* @example
* var inherit = require( '@stdlib/utils/inherit' );
*
* function Foo() {
* return this;
* }
* Foo.prototype.beep = function beep() {
* return 'boop';
* };
*
* function Bar() {
* Foo.call( this );
* return this;
* }
* inherit( Bar, Foo );
*
* var bar = new Bar();
* var v = bar.beep();
* // returns 'boop'
*/
// MODULES //
var inherit = require( './inherit.js' );
// EXPORTS //
module.exports = inherit;
},{"./inherit.js":388}],388:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var defineProperty = require( '@stdlib/utils/define-property' );
var validate = require( './validate.js' );
var createObject = require( './detect.js' );
// MAIN //
/**
* Implements prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.
*
* ## Notes
*
* - This implementation is not designed to work with ES2015/ES6 classes. For ES2015/ES6 classes, use `class` with `extends`.
* - For reference, see [node#3455](https://github.com/nodejs/node/pull/3455), [node#4179](https://github.com/nodejs/node/issues/4179), [node#3452](https://github.com/nodejs/node/issues/3452), and [node commit](https://github.com/nodejs/node/commit/29da8cf8d7ab8f66b9091ab22664067d4468461e#diff-3deb3f32958bb937ae05c6f3e4abbdf5).
*
*
* @param {(Object|Function)} ctor - constructor which will inherit
* @param {(Object|Function)} superCtor - super (parent) constructor
* @throws {TypeError} first argument must be either an object or a function which can inherit
* @throws {TypeError} second argument must be either an object or a function from which a constructor can inherit
* @throws {TypeError} second argument must have an inheritable prototype
* @returns {(Object|Function)} child constructor
*
* @example
* function Foo() {
* return this;
* }
* Foo.prototype.beep = function beep() {
* return 'boop';
* };
*
* function Bar() {
* Foo.call( this );
* return this;
* }
* inherit( Bar, Foo );
*
* var bar = new Bar();
* var v = bar.beep();
* // returns 'boop'
*/
function inherit( ctor, superCtor ) {
var err = validate( ctor );
if ( err ) {
throw err;
}
err = validate( superCtor );
if ( err ) {
throw err;
}
if ( typeof superCtor.prototype === 'undefined' ) {
throw new TypeError( 'invalid argument. Second argument must have a prototype from which another object can inherit. Value: `'+superCtor.prototype+'`.' );
}
// Create a prototype which inherits from the parent prototype:
ctor.prototype = createObject( superCtor.prototype );
// Set the constructor to refer to the child constructor:
defineProperty( ctor.prototype, 'constructor', {
'configurable': true,
'enumerable': false,
'writable': true,
'value': ctor
});
return ctor;
}
// EXPORTS //
module.exports = inherit;
},{"./detect.js":386,"./validate.js":391,"@stdlib/utils/define-property":366}],389:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// EXPORTS //
module.exports = Object.create;
},{}],390:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// FUNCTIONS //
/**
* Dummy constructor.
*
* @private
*/
function Ctor() {
// Empty...
}
// MAIN //
/**
* An `Object.create` shim for older JavaScript engines.
*
* @private
* @param {Object} proto - prototype
* @returns {Object} created object
*
* @example
* var obj = createObject( Object.prototype );
* // returns {}
*/
function createObject( proto ) {
Ctor.prototype = proto;
return new Ctor();
}
// EXPORTS //
module.exports = createObject;
},{}],391:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Tests that a value is a valid constructor.
*
* @private
* @param {*} value - value to test
* @returns {(Error|null)} error object or null
*
* @example
* var ctor = function ctor() {};
*
* var err = validate( ctor );
* // returns null
*
* err = validate( null );
* // returns <TypeError>
*/
function validate( value ) {
var type = typeof value;
if (
value === null ||
(type !== 'object' && type !== 'function')
) {
return new TypeError( 'invalid argument. A provided constructor must be either an object (except null) or a function. Value: `'+value+'`.' );
}
return null;
}
// EXPORTS //
module.exports = validate;
},{}],392:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Returns an array of an object's own enumerable property names.
*
* ## Notes
*
* - In contrast to the built-in `Object.keys()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own enumerable property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function keys( value ) {
return Object.keys( Object( value ) );
}
// EXPORTS //
module.exports = keys;
},{}],393:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isArguments = require( '@stdlib/assert/is-arguments' );
var builtin = require( './builtin.js' );
// VARIABLES //
var slice = Array.prototype.slice;
// MAIN //
/**
* Returns an array of an object's own enumerable property names.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own enumerable property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function keys( value ) {
if ( isArguments( value ) ) {
return builtin( slice.call( value ) );
}
return builtin( value );
}
// EXPORTS //
module.exports = keys;
},{"./builtin.js":392,"@stdlib/assert/is-arguments":74}],394:[function(require,module,exports){
module.exports=[
"console",
"external",
"frame",
"frameElement",
"frames",
"innerHeight",
"innerWidth",
"outerHeight",
"outerWidth",
"pageXOffset",
"pageYOffset",
"parent",
"scrollLeft",
"scrollTop",
"scrollX",
"scrollY",
"self",
"webkitIndexedDB",
"webkitStorageInfo",
"window"
]
},{}],395:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var keys = require( './builtin.js' );
// FUNCTIONS //
/**
* Tests the built-in `Object.keys()` implementation when provided `arguments`.
*
* @private
* @returns {boolean} boolean indicating whether the built-in implementation returns the expected number of keys
*/
function test() {
return ( keys( arguments ) || '' ).length !== 2;
}
// MAIN //
/**
* Tests whether the built-in `Object.keys()` implementation supports providing `arguments` as an input value.
*
* ## Notes
*
* - Safari 5.0 does **not** support `arguments` as an input value.
*
* @private
* @returns {boolean} boolean indicating whether a built-in implementation supports `arguments`
*/
function check() {
return test( 1, 2 );
}
// EXPORTS //
module.exports = check;
},{"./builtin.js":392}],396:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var indexOf = require( '@stdlib/utils/index-of' );
var typeOf = require( '@stdlib/utils/type-of' );
var isConstructorPrototype = require( './is_constructor_prototype.js' );
var EXCLUDED_KEYS = require( './excluded_keys.json' );
var win = require( './window.js' );
// VARIABLES //
var bool;
// FUNCTIONS //
/**
* Determines whether an environment throws when comparing to the prototype of a value's constructor (e.g., [IE9][1]).
*
* [1]: https://stackoverflow.com/questions/7688070/why-is-comparing-the-constructor-property-of-two-windows-unreliable
*
* @private
* @returns {boolean} boolean indicating whether an environment is buggy
*/
function check() {
var k;
if ( typeOf( win ) === 'undefined' ) {
return false;
}
for ( k in win ) { // eslint-disable-line guard-for-in
try {
if (
indexOf( EXCLUDED_KEYS, k ) === -1 &&
hasOwnProp( win, k ) &&
win[ k ] !== null &&
typeOf( win[ k ] ) === 'object'
) {
isConstructorPrototype( win[ k ] );
}
} catch ( err ) { // eslint-disable-line no-unused-vars
return true;
}
}
return false;
}
// MAIN //
bool = check();
// EXPORTS //
module.exports = bool;
},{"./excluded_keys.json":394,"./is_constructor_prototype.js":402,"./window.js":407,"@stdlib/assert/has-own-property":53,"@stdlib/utils/index-of":384,"@stdlib/utils/type-of":435}],397:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var bool = ( typeof Object.keys !== 'undefined' );
// EXPORTS //
module.exports = bool;
},{}],398:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );
var noop = require( '@stdlib/utils/noop' );
// MAIN //
// Note: certain environments treat an object's prototype as enumerable, which, as a matter of convention, it shouldn't be...
var bool = isEnumerableProperty( noop, 'prototype' );
// EXPORTS //
module.exports = bool;
},{"@stdlib/assert/is-enumerable-property":93,"@stdlib/utils/noop":415}],399:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );
// VARIABLES //
var obj = {
'toString': null
};
// MAIN //
// Note: certain environments don't allow enumeration of overwritten properties which are considered non-enumerable...
var bool = !isEnumerableProperty( obj, 'toString' );
// EXPORTS //
module.exports = bool;
},{"@stdlib/assert/is-enumerable-property":93}],400:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var bool = ( typeof window !== 'undefined' );
// EXPORTS //
module.exports = bool;
},{}],401:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return an array of an object's own enumerable property names.
*
* @module @stdlib/utils/keys
*
* @example
* var keys = require( '@stdlib/utils/keys' );
*
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
// MODULES //
var keys = require( './main.js' );
// EXPORTS //
module.exports = keys;
},{"./main.js":404}],402:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
/**
* Tests whether a value equals the prototype of its constructor.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor
*/
function isConstructorPrototype( value ) {
return ( value.constructor && value.constructor.prototype === value );
}
// EXPORTS //
module.exports = isConstructorPrototype;
},{}],403:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasAutomationEqualityBug = require( './has_automation_equality_bug.js' );
var isConstructorPrototype = require( './is_constructor_prototype.js' );
var HAS_WINDOW = require( './has_window.js' );
// MAIN //
/**
* Wraps the test for constructor prototype equality to accommodate buggy environments (e.g., environments which throw when testing equality).
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor
*/
function wrapper( value ) {
if ( HAS_WINDOW === false && !hasAutomationEqualityBug ) {
return isConstructorPrototype( value );
}
try {
return isConstructorPrototype( value );
} catch ( error ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = wrapper;
},{"./has_automation_equality_bug.js":396,"./has_window.js":400,"./is_constructor_prototype.js":402}],404:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasArgumentsBug = require( './has_arguments_bug.js' );
var HAS_BUILTIN = require( './has_builtin.js' );
var builtin = require( './builtin.js' );
var wrapper = require( './builtin_wrapper.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
/**
* Returns an array of an object's own enumerable property names.
*
* @name keys
* @type {Function}
* @param {*} value - input object
* @returns {Array} a list of own enumerable property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
var keys;
if ( HAS_BUILTIN ) {
if ( hasArgumentsBug() ) {
keys = wrapper;
} else {
keys = builtin;
}
} else {
keys = polyfill;
}
// EXPORTS //
module.exports = keys;
},{"./builtin.js":392,"./builtin_wrapper.js":393,"./has_arguments_bug.js":395,"./has_builtin.js":397,"./polyfill.js":406}],405:[function(require,module,exports){
module.exports=[
"toString",
"toLocaleString",
"valueOf",
"hasOwnProperty",
"isPrototypeOf",
"propertyIsEnumerable",
"constructor"
]
},{}],406:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isObjectLike = require( '@stdlib/assert/is-object-like' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isArguments = require( '@stdlib/assert/is-arguments' );
var HAS_ENUM_PROTO_BUG = require( './has_enumerable_prototype_bug.js' );
var HAS_NON_ENUM_PROPS_BUG = require( './has_non_enumerable_properties_bug.js' );
var isConstructorPrototype = require( './is_constructor_prototype_wrapper.js' );
var NON_ENUMERABLE = require( './non_enumerable.json' );
// MAIN //
/**
* Returns an array of an object's own enumerable property names.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own enumerable property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function keys( value ) {
var skipConstructor;
var skipPrototype;
var isFcn;
var out;
var k;
var p;
var i;
out = [];
if ( isArguments( value ) ) {
// Account for environments which treat `arguments` differently...
for ( i = 0; i < value.length; i++ ) {
out.push( i.toString() );
}
// Note: yes, we are precluding the `arguments` array-like object from having other enumerable properties; however, this should (1) be very rare and (2) not be encouraged (e.g., doing something like `arguments.a = 'b'`; in certain engines directly manipulating the `arguments` value results in automatic de-optimization).
return out;
}
if ( typeof value === 'string' ) {
// Account for environments which do not treat string character indices as "own" properties...
if ( value.length > 0 && !hasOwnProp( value, '0' ) ) {
for ( i = 0; i < value.length; i++ ) {
out.push( i.toString() );
}
}
} else {
isFcn = ( typeof value === 'function' );
if ( isFcn === false && !isObjectLike( value ) ) {
return out;
}
skipPrototype = ( HAS_ENUM_PROTO_BUG && isFcn );
}
for ( k in value ) {
if ( !( skipPrototype && k === 'prototype' ) && hasOwnProp( value, k ) ) {
out.push( String( k ) );
}
}
if ( HAS_NON_ENUM_PROPS_BUG ) {
skipConstructor = isConstructorPrototype( value );
for ( i = 0; i < NON_ENUMERABLE.length; i++ ) {
p = NON_ENUMERABLE[ i ];
if ( !( skipConstructor && p === 'constructor' ) && hasOwnProp( value, p ) ) {
out.push( String( p ) );
}
}
}
return out;
}
// EXPORTS //
module.exports = keys;
},{"./has_enumerable_prototype_bug.js":398,"./has_non_enumerable_properties_bug.js":399,"./is_constructor_prototype_wrapper.js":403,"./non_enumerable.json":405,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-arguments":74,"@stdlib/assert/is-object-like":143}],407:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var w = ( typeof window === 'undefined' ) ? void 0 : window;
// EXPORTS //
module.exports = w;
},{}],408:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return a string value indicating a specification defined classification of an object.
*
* @module @stdlib/utils/native-class
*
* @example
* var nativeClass = require( '@stdlib/utils/native-class' );
*
* var str = nativeClass( 'a' );
* // returns '[object String]'
*
* str = nativeClass( 5 );
* // returns '[object Number]'
*
* function Beep() {
* return this;
* }
* str = nativeClass( new Beep() );
* // returns '[object Object]'
*/
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var builtin = require( './native_class.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var nativeClass;
if ( hasToStringTag() ) {
nativeClass = polyfill;
} else {
nativeClass = builtin;
}
// EXPORTS //
module.exports = nativeClass;
},{"./native_class.js":409,"./polyfill.js":410,"@stdlib/assert/has-tostringtag-support":57}],409:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var toStr = require( './tostring.js' );
// MAIN //
/**
* Returns a string value indicating a specification defined classification (via the internal property `[[Class]]`) of an object.
*
* @param {*} v - input value
* @returns {string} string value indicating a specification defined classification of the input value
*
* @example
* var str = nativeClass( 'a' );
* // returns '[object String]'
*
* @example
* var str = nativeClass( 5 );
* // returns '[object Number]'
*
* @example
* function Beep() {
* return this;
* }
* var str = nativeClass( new Beep() );
* // returns '[object Object]'
*/
function nativeClass( v ) {
return toStr.call( v );
}
// EXPORTS //
module.exports = nativeClass;
},{"./tostring.js":411}],410:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var toStringTag = require( './tostringtag.js' );
var toStr = require( './tostring.js' );
// MAIN //
/**
* Returns a string value indicating a specification defined classification of an object in environments supporting `Symbol.toStringTag`.
*
* @param {*} v - input value
* @returns {string} string value indicating a specification defined classification of the input value
*
* @example
* var str = nativeClass( 'a' );
* // returns '[object String]'
*
* @example
* var str = nativeClass( 5 );
* // returns '[object Number]'
*
* @example
* function Beep() {
* return this;
* }
* var str = nativeClass( new Beep() );
* // returns '[object Object]'
*/
function nativeClass( v ) {
var isOwn;
var tag;
var out;
if ( v === null || v === void 0 ) {
return toStr.call( v );
}
tag = v[ toStringTag ];
isOwn = hasOwnProp( v, toStringTag );
// Attempt to override the `toStringTag` property. For built-ins having a `Symbol.toStringTag` property (e.g., `JSON`, `Math`, etc), the `Symbol.toStringTag` property is read-only (e.g., , so we need to wrap in a `try/catch`.
try {
v[ toStringTag ] = void 0;
} catch ( err ) { // eslint-disable-line no-unused-vars
return toStr.call( v );
}
out = toStr.call( v );
if ( isOwn ) {
v[ toStringTag ] = tag;
} else {
delete v[ toStringTag ];
}
return out;
}
// EXPORTS //
module.exports = nativeClass;
},{"./tostring.js":411,"./tostringtag.js":412,"@stdlib/assert/has-own-property":53}],411:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var toStr = Object.prototype.toString;
// EXPORTS //
module.exports = toStr;
},{}],412:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var toStrTag = ( typeof Symbol === 'function' ) ? Symbol.toStringTag : '';
// EXPORTS //
module.exports = toStrTag;
},{}],413:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib 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.
*/
'use strict';
/**
* Add a callback to the "next tick queue".
*
* @module @stdlib/utils/next-tick
*
* @example
* var nextTick = require( '@stdlib/utils/next-tick' );
*
* function beep() {
* console.log( 'boop' );
* }
*
* nextTick( beep );
*/
// MODULES //
var nextTick = require( './main.js' );
// EXPORTS //
module.exports = nextTick;
},{"./main.js":414}],414:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib 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.
*/
'use strict';
// MODULES //
var proc = require( 'process' );
// MAIN //
/**
* Adds a callback to the "next tick queue".
*
* ## Notes
*
* - The queue is fully drained after the current operation on the JavaScript stack runs to completion and before the event loop is allowed to continue.
*
* @param {Callback} clbk - callback
* @param {...*} [args] - arguments to provide to the callback upon invocation
*
* @example
* function beep() {
* console.log( 'boop' );
* }
*
* nextTick( beep );
*/
function nextTick( clbk ) {
var args;
var i;
args = [];
for ( i = 1; i < arguments.length; i++ ) {
args.push( arguments[ i ] );
}
proc.nextTick( wrapper );
/**
* Callback wrapper.
*
* ## Notes
*
* - The ability to provide additional arguments was added in Node.js v1.8.1. The wrapper provides support for earlier Node.js versions.
*
* @private
*/
function wrapper() {
clbk.apply( null, args );
}
}
// EXPORTS //
module.exports = nextTick;
},{"process":451}],415:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* No operation.
*
* @module @stdlib/utils/noop
*
* @example
* var noop = require( '@stdlib/utils/noop' );
*
* noop();
* // ...does nothing.
*/
// MODULES //
var noop = require( './noop.js' );
// EXPORTS //
module.exports = noop;
},{"./noop.js":416}],416:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* No operation.
*
* @example
* noop();
* // ...does nothing.
*/
function noop() {
// Empty function...
}
// EXPORTS //
module.exports = noop;
},{}],417:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return a partial object copy excluding specified keys.
*
* @module @stdlib/utils/omit
*
* @example
* var omit = require( '@stdlib/utils/omit' );
*
* var obj1 = {
* 'a': 1,
* 'b': 2
* };
*
* var obj2 = omit( obj1, 'b' );
* // returns { 'a': 1 }
*/
// MODULES //
var omit = require( './omit.js' );
// EXPORTS //
module.exports = omit;
},{"./omit.js":418}],418:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var objectKeys = require( '@stdlib/utils/keys' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
var indexOf = require( '@stdlib/utils/index-of' );
// MAIN //
/**
* Returns a partial object copy excluding specified keys.
*
* @param {Object} obj - source object
* @param {(string|StringArray)} keys - keys to exclude
* @throws {TypeError} first argument must be an object
* @throws {TypeError} second argument must be either a string or an array of strings
* @returns {Object} new object
*
* @example
* var obj1 = {
* 'a': 1,
* 'b': 2
* };
*
* var obj2 = omit( obj1, 'b' );
* // returns { 'a': 1 }
*/
function omit( obj, keys ) {
var ownKeys;
var out;
var key;
var i;
if ( typeof obj !== 'object' || obj === null ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `'+obj+'`.' );
}
ownKeys = objectKeys( obj );
out = {};
if ( isString( keys ) ) {
for ( i = 0; i < ownKeys.length; i++ ) {
key = ownKeys[ i ];
if ( key !== keys ) {
out[ key ] = obj[ key ];
}
}
return out;
}
if ( isStringArray( keys ) ) {
for ( i = 0; i < ownKeys.length; i++ ) {
key = ownKeys[ i ];
if ( indexOf( keys, key ) === -1 ) {
out[ key ] = obj[ key ];
}
}
return out;
}
throw new TypeError( 'invalid argument. Second argument must be either a string primitive or an array of string primitives. Value: `'+keys+'`.' );
}
// EXPORTS //
module.exports = omit;
},{"@stdlib/assert/is-string":158,"@stdlib/assert/is-string-array":157,"@stdlib/utils/index-of":384,"@stdlib/utils/keys":401}],419:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return a partial object copy containing only specified keys.
*
* @module @stdlib/utils/pick
*
* @example
* var pick = require( '@stdlib/utils/pick' );
*
* var obj1 = {
* 'a': 1,
* 'b': 2
* };
*
* var obj2 = pick( obj1, 'b' );
* // returns { 'b': 2 }
*/
// MODULES //
var pick = require( './pick.js' );
// EXPORTS //
module.exports = pick;
},{"./pick.js":420}],420:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
// MAIN //
/**
* Returns a partial object copy containing only specified keys. If a key does not exist as an own property in a source object, the key is ignored.
*
* @param {Object} obj - source object
* @param {(string|StringArray)} keys - keys to copy
* @throws {TypeError} first argument must be an object
* @throws {TypeError} second argument must be either a string or an array of strings
* @returns {Object} new object
*
* @example
* var obj1 = {
* 'a': 1,
* 'b': 2
* };
*
* var obj2 = pick( obj1, 'b' );
* // returns { 'b': 2 }
*/
function pick( obj, keys ) {
var out;
var key;
var i;
if ( typeof obj !== 'object' || obj === null ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `'+obj+'`.' );
}
out = {};
if ( isString( keys ) ) {
if ( hasOwnProp( obj, keys ) ) {
out[ keys ] = obj[ keys ];
}
return out;
}
if ( isStringArray( keys ) ) {
for ( i = 0; i < keys.length; i++ ) {
key = keys[ i ];
if ( hasOwnProp( obj, key ) ) {
out[ key ] = obj[ key ];
}
}
return out;
}
throw new TypeError( 'invalid argument. Second argument must be either a string primitive or an array of string primitives. Value: `'+keys+'`.' );
}
// EXPORTS //
module.exports = pick;
},{"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-string":158,"@stdlib/assert/is-string-array":157}],421:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// VARIABLES //
var propertyDescriptor = Object.getOwnPropertyDescriptor;
// MAIN //
/**
* Returns a property descriptor for an object's own property.
*
* ## Notes
*
* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.
* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.
*
* @private
* @param {*} value - input object
* @param {(string|symbol)} property - property
* @returns {(Object|null)} property descriptor or null
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var desc = getOwnPropertyDescriptor( obj, 'foo' );
* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}
*/
function getOwnPropertyDescriptor( value, property ) {
var desc;
if ( value === null || value === void 0 ) {
return null;
}
desc = propertyDescriptor( value, property );
return ( desc === void 0 ) ? null : desc;
}
// EXPORTS //
module.exports = getOwnPropertyDescriptor;
},{}],422:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var bool = ( typeof Object.getOwnPropertyDescriptor !== 'undefined' );
// EXPORTS //
module.exports = bool;
},{}],423:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return a property descriptor for an object's own property.
*
* @module @stdlib/utils/property-descriptor
*
* @example
* var getOwnPropertyDescriptor = require( '@stdlib/utils/property-descriptor' );
*
* var obj = {
* 'foo': 'bar',
* 'beep': 'boop'
* };
*
* var keys = getOwnPropertyDescriptor( obj, 'foo' );
* // returns {'configurable':true,'enumerable':true,'writable':true,'value':'bar'}
*/
// MODULES //
var HAS_BUILTIN = require( './has_builtin.js' );
var builtin = require( './builtin.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var main;
if ( HAS_BUILTIN ) {
main = builtin;
} else {
main = polyfill;
}
// EXPORTS //
module.exports = main;
},{"./builtin.js":421,"./has_builtin.js":422,"./polyfill.js":424}],424:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
// MAIN //
/**
* Returns a property descriptor for an object's own property.
*
* ## Notes
*
* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.
* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.
* - In environments lacking `Object.getOwnPropertyDescriptor()` support, property descriptors do not exist. In non-supporting environment, if an object has a provided property, this function returns a descriptor object equivalent to that returned in a supporting environment; otherwise, the function returns `null`.
*
* @private
* @param {*} value - input object
* @param {(string|symbol)} property - property
* @returns {(Object|null)} property descriptor or null
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var desc = getOwnPropertyDescriptor( obj, 'foo' );
* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}
*/
function getOwnPropertyDescriptor( value, property ) {
if ( hasOwnProp( value, property ) ) {
return {
'configurable': true,
'enumerable': true,
'writable': true,
'value': value[ property ]
};
}
return null;
}
// EXPORTS //
module.exports = getOwnPropertyDescriptor;
},{"@stdlib/assert/has-own-property":53}],425:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// VARIABLES //
var propertyNames = Object.getOwnPropertyNames;
// MAIN //
/**
* Returns an array of an object's own enumerable and non-enumerable property names.
*
* ## Notes
*
* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var keys = getOwnPropertyNames( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function getOwnPropertyNames( value ) {
return propertyNames( Object( value ) );
}
// EXPORTS //
module.exports = getOwnPropertyNames;
},{}],426:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MAIN //
var bool = ( typeof Object.getOwnPropertyNames !== 'undefined' );
// EXPORTS //
module.exports = bool;
},{}],427:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Return an array of an object's own enumerable and non-enumerable property names.
*
* @module @stdlib/utils/property-names
*
* @example
* var getOwnPropertyNames = require( '@stdlib/utils/property-names' );
*
* var keys = getOwnPropertyNames({
* 'foo': 'bar',
* 'beep': 'boop'
* });
* // e.g., returns [ 'foo', 'beep' ]
*/
// MODULES //
var HAS_BUILTIN = require( './has_builtin.js' );
var builtin = require( './builtin.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var main;
if ( HAS_BUILTIN ) {
main = builtin;
} else {
main = polyfill;
}
// EXPORTS //
module.exports = main;
},{"./builtin.js":425,"./has_builtin.js":426,"./polyfill.js":428}],428:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var keys = require( '@stdlib/utils/keys' );
// MAIN //
/**
* Returns an array of an object's own enumerable and non-enumerable property names.
*
* ## Notes
*
* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.
* - In environments lacking support for `Object.getOwnPropertyNames()`, property descriptors are unavailable, and thus all properties can be safely assumed to be enumerable. Hence, we can defer to calling `Object.keys`, which retrieves all own enumerable property names.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var keys = getOwnPropertyNames( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function getOwnPropertyNames( value ) {
return keys( Object( value ) );
}
// EXPORTS //
module.exports = getOwnPropertyNames;
},{"@stdlib/utils/keys":401}],429:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var reRegExp = require( '@stdlib/regexp/regexp' );
// MAIN //
/**
* Parses a regular expression string and returns a new regular expression.
*
* @param {string} str - regular expression string
* @throws {TypeError} must provide a regular expression string
* @returns {(RegExp|null)} regular expression or null
*
* @example
* var re = reFromString( '/beep/' );
* // returns /beep/
*/
function reFromString( str ) {
if ( !isString( str ) ) {
throw new TypeError( 'invalid argument. Must provide a regular expression string. Value: `' + str + '`.' );
}
// Capture the regular expression pattern and any flags:
str = reRegExp().exec( str );
// Create a new regular expression:
return ( str ) ? new RegExp( str[1], str[2] ) : null;
}
// EXPORTS //
module.exports = reFromString;
},{"@stdlib/assert/is-string":158,"@stdlib/regexp/regexp":327}],430:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Create a regular expression from a regular expression string.
*
* @module @stdlib/utils/regexp-from-string
*
* @example
* var reFromString = require( '@stdlib/utils/regexp-from-string' );
*
* var re = reFromString( '/beep/' );
* // returns /beep/
*/
// MODULES //
var reFromString = require( './from_string.js' );
// EXPORTS //
module.exports = reFromString;
},{"./from_string.js":429}],431:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var RE = require( './fixtures/re.js' );
var nodeList = require( './fixtures/nodelist.js' );
var typedarray = require( './fixtures/typedarray.js' );
// MAIN //
/**
* Checks whether a polyfill is needed when using the `typeof` operator.
*
* @private
* @returns {boolean} boolean indicating whether a polyfill is needed
*/
function check() {
if (
// Chrome 1-12 returns 'function' for regular expression instances (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof):
typeof RE === 'function' ||
// Safari 8 returns 'object' for typed array and weak map constructors (underscore #1929):
typeof typedarray === 'object' ||
// PhantomJS 1.9 returns 'function' for `NodeList` instances (underscore #2236):
typeof nodeList === 'function'
) {
return true;
}
return false;
}
// EXPORTS //
module.exports = check;
},{"./fixtures/nodelist.js":432,"./fixtures/re.js":433,"./fixtures/typedarray.js":434}],432:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var getGlobal = require( '@stdlib/utils/global' );
// MAIN //
var root = getGlobal();
var nodeList = root.document && root.document.childNodes;
// EXPORTS //
module.exports = nodeList;
},{"@stdlib/utils/global":380}],433:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
var RE = /./;
// EXPORTS //
module.exports = RE;
},{}],434:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
var typedarray = Int8Array; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = typedarray;
},{}],435:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
/**
* Determine a value's type.
*
* @module @stdlib/utils/type-of
*
* @example
* var typeOf = require( '@stdlib/utils/type-of' );
*
* var str = typeOf( 'a' );
* // returns 'string'
*
* str = typeOf( 5 );
* // returns 'number'
*/
// MODULES //
var usePolyfill = require( './check.js' );
var typeOf = require( './typeof.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var main = ( usePolyfill() ) ? polyfill : typeOf;
// EXPORTS //
module.exports = main;
},{"./check.js":431,"./polyfill.js":436,"./typeof.js":437}],436:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var ctorName = require( '@stdlib/utils/constructor-name' );
// MAIN //
/**
* Determines a value's type.
*
* @param {*} v - input value
* @returns {string} string indicating the value's type
*/
function typeOf( v ) {
return ctorName( v ).toLowerCase();
}
// EXPORTS //
module.exports = typeOf;
},{"@stdlib/utils/constructor-name":351}],437:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.
*/
'use strict';
// MODULES //
var ctorName = require( '@stdlib/utils/constructor-name' );
// NOTES //
/*
* Built-in `typeof` operator behavior:
*
* ```text
* typeof null => 'object'
* typeof undefined => 'undefined'
* typeof 'a' => 'string'
* typeof 5 => 'number'
* typeof NaN => 'number'
* typeof true => 'boolean'
* typeof false => 'boolean'
* typeof {} => 'object'
* typeof [] => 'object'
* typeof function foo(){} => 'function'
* typeof function* foo(){} => 'object'
* typeof Symbol() => 'symbol'
* ```
*
*/
// MAIN //
/**
* Determines a value's type.
*
* @param {*} v - input value
* @returns {string} string indicating the value's type
*/
function typeOf( v ) {
var type;
// Address `typeof null` => `object` (see http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null):
if ( v === null ) {
return 'null';
}
type = typeof v;
// If the `typeof` operator returned something other than `object`, we are done. Otherwise, we need to check for an internal class name or search for a constructor.
if ( type === 'object' ) {
return ctorName( v ).toLowerCase();
}
return type;
}
// EXPORTS //
module.exports = typeOf;
},{"@stdlib/utils/constructor-name":351}],438:[function(require,module,exports){
'use strict'
exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray
var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i]
revLookup[code.charCodeAt(i)] = i
}
// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63
function getLens (b64) {
var len = b64.length
if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// Trim off extra bytes after placeholder bytes are found
// See: https://github.com/beatgammit/base64-js/issues/42
var validLen = b64.indexOf('=')
if (validLen === -1) validLen = len
var placeHoldersLen = validLen === len
? 0
: 4 - (validLen % 4)
return [validLen, placeHoldersLen]
}
// base64 is 4/3 + up to two characters of the original data
function byteLength (b64) {
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function _byteLength (b64, validLen, placeHoldersLen) {
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function toByteArray (b64) {
var tmp
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
var curByte = 0
// if there are placeholders, only get up to the last complete 4 chars
var len = placeHoldersLen > 0
? validLen - 4
: validLen
var i
for (i = 0; i < len; i += 4) {
tmp =
(revLookup[b64.charCodeAt(i)] << 18) |
(revLookup[b64.charCodeAt(i + 1)] << 12) |
(revLookup[b64.charCodeAt(i + 2)] << 6) |
revLookup[b64.charCodeAt(i + 3)]
arr[curByte++] = (tmp >> 16) & 0xFF
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 2) {
tmp =
(revLookup[b64.charCodeAt(i)] << 2) |
(revLookup[b64.charCodeAt(i + 1)] >> 4)
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 1) {
tmp =
(revLookup[b64.charCodeAt(i)] << 10) |
(revLookup[b64.charCodeAt(i + 1)] << 4) |
(revLookup[b64.charCodeAt(i + 2)] >> 2)
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
return arr
}
function tripletToBase64 (num) {
return lookup[num >> 18 & 0x3F] +
lookup[num >> 12 & 0x3F] +
lookup[num >> 6 & 0x3F] +
lookup[num & 0x3F]
}
function encodeChunk (uint8, start, end) {
var tmp
var output = []
for (var i = start; i < end; i += 3) {
tmp =
((uint8[i] << 16) & 0xFF0000) +
((uint8[i + 1] << 8) & 0xFF00) +
(uint8[i + 2] & 0xFF)
output.push(tripletToBase64(tmp))
}
return output.join('')
}
function fromByteArray (uint8) {
var tmp
var len = uint8.length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var parts = []
var maxChunkLength = 16383 // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1]
parts.push(
lookup[tmp >> 2] +
lookup[(tmp << 4) & 0x3F] +
'=='
)
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
parts.push(
lookup[tmp >> 10] +
lookup[(tmp >> 4) & 0x3F] +
lookup[(tmp << 2) & 0x3F] +
'='
)
}
return parts.join('')
}
},{}],439:[function(require,module,exports){
},{}],440:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
var R = typeof Reflect === 'object' ? Reflect : null
var ReflectApply = R && typeof R.apply === 'function'
? R.apply
: function ReflectApply(target, receiver, args) {
return Function.prototype.apply.call(target, receiver, args);
}
var ReflectOwnKeys
if (R && typeof R.ownKeys === 'function') {
ReflectOwnKeys = R.ownKeys
} else if (Object.getOwnPropertySymbols) {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target)
.concat(Object.getOwnPropertySymbols(target));
};
} else {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target);
};
}
function ProcessEmitWarning(warning) {
if (console && console.warn) console.warn(warning);
}
var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
return value !== value;
}
function EventEmitter() {
EventEmitter.init.call(this);
}
module.exports = EventEmitter;
module.exports.once = once;
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;
EventEmitter.prototype._events = undefined;
EventEmitter.prototype._eventsCount = 0;
EventEmitter.prototype._maxListeners = undefined;
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
var defaultMaxListeners = 10;
function checkListener(listener) {
if (typeof listener !== 'function') {
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
}
}
Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
enumerable: true,
get: function() {
return defaultMaxListeners;
},
set: function(arg) {
if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
}
defaultMaxListeners = arg;
}
});
EventEmitter.init = function() {
if (this._events === undefined ||
this._events === Object.getPrototypeOf(this)._events) {
this._events = Object.create(null);
this._eventsCount = 0;
}
this._maxListeners = this._maxListeners || undefined;
};
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
}
this._maxListeners = n;
return this;
};
function _getMaxListeners(that) {
if (that._maxListeners === undefined)
return EventEmitter.defaultMaxListeners;
return that._maxListeners;
}
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
return _getMaxListeners(this);
};
EventEmitter.prototype.emit = function emit(type) {
var args = [];
for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
var doError = (type === 'error');
var events = this._events;
if (events !== undefined)
doError = (doError && events.error === undefined);
else if (!doError)
return false;
// If there is no 'error' event listener then throw.
if (doError) {
var er;
if (args.length > 0)
er = args[0];
if (er instanceof Error) {
// Note: The comments on the `throw` lines are intentional, they show
// up in Node's output if this results in an unhandled exception.
throw er; // Unhandled 'error' event
}
// At least give some kind of context to the user
var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
err.context = er;
throw err; // Unhandled 'error' event
}
var handler = events[type];
if (handler === undefined)
return false;
if (typeof handler === 'function') {
ReflectApply(handler, this, args);
} else {
var len = handler.length;
var listeners = arrayClone(handler, len);
for (var i = 0; i < len; ++i)
ReflectApply(listeners[i], this, args);
}
return true;
};
function _addListener(target, type, listener, prepend) {
var m;
var events;
var existing;
checkListener(listener);
events = target._events;
if (events === undefined) {
events = target._events = Object.create(null);
target._eventsCount = 0;
} else {
// To avoid recursion in the case that type === "newListener"! Before
// adding it to the listeners, first emit "newListener".
if (events.newListener !== undefined) {
target.emit('newListener', type,
listener.listener ? listener.listener : listener);
// Re-assign `events` because a newListener handler could have caused the
// this._events to be assigned to a new object
events = target._events;
}
existing = events[type];
}
if (existing === undefined) {
// Optimize the case of one listener. Don't need the extra array object.
existing = events[type] = listener;
++target._eventsCount;
} else {
if (typeof existing === 'function') {
// Adding the second element, need to change to array.
existing = events[type] =
prepend ? [listener, existing] : [existing, listener];
// If we've already got an array, just append.
} else if (prepend) {
existing.unshift(listener);
} else {
existing.push(listener);
}
// Check for listener leak
m = _getMaxListeners(target);
if (m > 0 && existing.length > m && !existing.warned) {
existing.warned = true;
// No error code for this since it is a Warning
// eslint-disable-next-line no-restricted-syntax
var w = new Error('Possible EventEmitter memory leak detected. ' +
existing.length + ' ' + String(type) + ' listeners ' +
'added. Use emitter.setMaxListeners() to ' +
'increase limit');
w.name = 'MaxListenersExceededWarning';
w.emitter = target;
w.type = type;
w.count = existing.length;
ProcessEmitWarning(w);
}
}
return target;
}
EventEmitter.prototype.addListener = function addListener(type, listener) {
return _addListener(this, type, listener, false);
};
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
EventEmitter.prototype.prependListener =
function prependListener(type, listener) {
return _addListener(this, type, listener, true);
};
function onceWrapper() {
if (!this.fired) {
this.target.removeListener(this.type, this.wrapFn);
this.fired = true;
if (arguments.length === 0)
return this.listener.call(this.target);
return this.listener.apply(this.target, arguments);
}
}
function _onceWrap(target, type, listener) {
var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
var wrapped = onceWrapper.bind(state);
wrapped.listener = listener;
state.wrapFn = wrapped;
return wrapped;
}
EventEmitter.prototype.once = function once(type, listener) {
checkListener(listener);
this.on(type, _onceWrap(this, type, listener));
return this;
};
EventEmitter.prototype.prependOnceListener =
function prependOnceListener(type, listener) {
checkListener(listener);
this.prependListener(type, _onceWrap(this, type, listener));
return this;
};
// Emits a 'removeListener' event if and only if the listener was removed.
EventEmitter.prototype.removeListener =
function removeListener(type, listener) {
var list, events, position, i, originalListener;
checkListener(listener);
events = this._events;
if (events === undefined)
return this;
list = events[type];
if (list === undefined)
return this;
if (list === listener || list.listener === listener) {
if (--this._eventsCount === 0)
this._events = Object.create(null);
else {
delete events[type];
if (events.removeListener)
this.emit('removeListener', type, list.listener || listener);
}
} else if (typeof list !== 'function') {
position = -1;
for (i = list.length - 1; i >= 0; i--) {
if (list[i] === listener || list[i].listener === listener) {
originalListener = list[i].listener;
position = i;
break;
}
}
if (position < 0)
return this;
if (position === 0)
list.shift();
else {
spliceOne(list, position);
}
if (list.length === 1)
events[type] = list[0];
if (events.removeListener !== undefined)
this.emit('removeListener', type, originalListener || listener);
}
return this;
};
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
EventEmitter.prototype.removeAllListeners =
function removeAllListeners(type) {
var listeners, events, i;
events = this._events;
if (events === undefined)
return this;
// not listening for removeListener, no need to emit
if (events.removeListener === undefined) {
if (arguments.length === 0) {
this._events = Object.create(null);
this._eventsCount = 0;
} else if (events[type] !== undefined) {
if (--this._eventsCount === 0)
this._events = Object.create(null);
else
delete events[type];
}
return this;
}
// emit removeListener for all listeners on all events
if (arguments.length === 0) {
var keys = Object.keys(events);
var key;
for (i = 0; i < keys.length; ++i) {
key = keys[i];
if (key === 'removeListener') continue;
this.removeAllListeners(key);
}
this.removeAllListeners('removeListener');
this._events = Object.create(null);
this._eventsCount = 0;
return this;
}
listeners = events[type];
if (typeof listeners === 'function') {
this.removeListener(type, listeners);
} else if (listeners !== undefined) {
// LIFO order
for (i = listeners.length - 1; i >= 0; i--) {
this.removeListener(type, listeners[i]);
}
}
return this;
};
function _listeners(target, type, unwrap) {
var events = target._events;
if (events === undefined)
return [];
var evlistener = events[type];
if (evlistener === undefined)
return [];
if (typeof evlistener === 'function')
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
return unwrap ?
unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
}
EventEmitter.prototype.listeners = function listeners(type) {
return _listeners(this, type, true);
};
EventEmitter.prototype.rawListeners = function rawListeners(type) {
return _listeners(this, type, false);
};
EventEmitter.listenerCount = function(emitter, type) {
if (typeof emitter.listenerCount === 'function') {
return emitter.listenerCount(type);
} else {
return listenerCount.call(emitter, type);
}
};
EventEmitter.prototype.listenerCount = listenerCount;
function listenerCount(type) {
var events = this._events;
if (events !== undefined) {
var evlistener = events[type];
if (typeof evlistener === 'function') {
return 1;
} else if (evlistener !== undefined) {
return evlistener.length;
}
}
return 0;
}
EventEmitter.prototype.eventNames = function eventNames() {
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
};
function arrayClone(arr, n) {
var copy = new Array(n);
for (var i = 0; i < n; ++i)
copy[i] = arr[i];
return copy;
}
function spliceOne(list, index) {
for (; index + 1 < list.length; index++)
list[index] = list[index + 1];
list.pop();
}
function unwrapListeners(arr) {
var ret = new Array(arr.length);
for (var i = 0; i < ret.length; ++i) {
ret[i] = arr[i].listener || arr[i];
}
return ret;
}
function once(emitter, name) {
return new Promise(function (resolve, reject) {
function errorListener(err) {
emitter.removeListener(name, resolver);
reject(err);
}
function resolver() {
if (typeof emitter.removeListener === 'function') {
emitter.removeListener('error', errorListener);
}
resolve([].slice.call(arguments));
};
eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
if (name !== 'error') {
addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
}
});
}
function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
if (typeof emitter.on === 'function') {
eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
}
}
function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
if (typeof emitter.on === 'function') {
if (flags.once) {
emitter.once(name, listener);
} else {
emitter.on(name, listener);
}
} else if (typeof emitter.addEventListener === 'function') {
// EventTarget does not have `error` event semantics like Node
// EventEmitters, we do not listen for `error` events here.
emitter.addEventListener(name, function wrapListener(arg) {
// IE does not have builtin `{ once: true }` support so we
// have to do it manually.
if (flags.once) {
emitter.removeEventListener(name, wrapListener);
}
listener(arg);
});
} else {
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
}
}
},{}],441:[function(require,module,exports){
(function (Buffer){(function (){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
/* eslint-disable no-proto */
'use strict'
var base64 = require('base64-js')
var ieee754 = require('ieee754')
exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50
var K_MAX_LENGTH = 0x7fffffff
exports.kMaxLength = K_MAX_LENGTH
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Print warning and recommend using `buffer` v4.x which has an Object
* implementation (most compatible, even IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* We report that the browser does not support typed arrays if the are not subclassable
* using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
* (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
* for __proto__ and has a buggy typed array implementation.
*/
Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
typeof console.error === 'function') {
console.error(
'This browser lacks typed array (Uint8Array) support which is required by ' +
'`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
)
}
function typedArraySupport () {
// Can typed array instances can be augmented?
try {
var arr = new Uint8Array(1)
arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }
return arr.foo() === 42
} catch (e) {
return false
}
}
Object.defineProperty(Buffer.prototype, 'parent', {
enumerable: true,
get: function () {
if (!Buffer.isBuffer(this)) return undefined
return this.buffer
}
})
Object.defineProperty(Buffer.prototype, 'offset', {
enumerable: true,
get: function () {
if (!Buffer.isBuffer(this)) return undefined
return this.byteOffset
}
})
function createBuffer (length) {
if (length > K_MAX_LENGTH) {
throw new RangeError('The value "' + length + '" is invalid for option "size"')
}
// Return an augmented `Uint8Array` instance
var buf = new Uint8Array(length)
buf.__proto__ = Buffer.prototype
return buf
}
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
function Buffer (arg, encodingOrOffset, length) {
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new TypeError(
'The "string" argument must be of type string. Received type number'
)
}
return allocUnsafe(arg)
}
return from(arg, encodingOrOffset, length)
}
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
if (typeof Symbol !== 'undefined' && Symbol.species != null &&
Buffer[Symbol.species] === Buffer) {
Object.defineProperty(Buffer, Symbol.species, {
value: null,
configurable: true,
enumerable: false,
writable: false
})
}
Buffer.poolSize = 8192 // not used by this implementation
function from (value, encodingOrOffset, length) {
if (typeof value === 'string') {
return fromString(value, encodingOrOffset)
}
if (ArrayBuffer.isView(value)) {
return fromArrayLike(value)
}
if (value == null) {
throw TypeError(
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
'or Array-like Object. Received type ' + (typeof value)
)
}
if (isInstance(value, ArrayBuffer) ||
(value && isInstance(value.buffer, ArrayBuffer))) {
return fromArrayBuffer(value, encodingOrOffset, length)
}
if (typeof value === 'number') {
throw new TypeError(
'The "value" argument must not be of type number. Received type number'
)
}
var valueOf = value.valueOf && value.valueOf()
if (valueOf != null && valueOf !== value) {
return Buffer.from(valueOf, encodingOrOffset, length)
}
var b = fromObject(value)
if (b) return b
if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
typeof value[Symbol.toPrimitive] === 'function') {
return Buffer.from(
value[Symbol.toPrimitive]('string'), encodingOrOffset, length
)
}
throw new TypeError(
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
'or Array-like Object. Received type ' + (typeof value)
)
}
/**
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
* if value is a number.
* Buffer.from(str[, encoding])
* Buffer.from(array)
* Buffer.from(buffer)
* Buffer.from(arrayBuffer[, byteOffset[, length]])
**/
Buffer.from = function (value, encodingOrOffset, length) {
return from(value, encodingOrOffset, length)
}
// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
// https://github.com/feross/buffer/pull/148
Buffer.prototype.__proto__ = Uint8Array.prototype
Buffer.__proto__ = Uint8Array
function assertSize (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be of type number')
} else if (size < 0) {
throw new RangeError('The value "' + size + '" is invalid for option "size"')
}
}
function alloc (size, fill, encoding) {
assertSize(size)
if (size <= 0) {
return createBuffer(size)
}
if (fill !== undefined) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpretted as a start offset.
return typeof encoding === 'string'
? createBuffer(size).fill(fill, encoding)
: createBuffer(size).fill(fill)
}
return createBuffer(size)
}
/**
* Creates a new filled Buffer instance.
* alloc(size[, fill[, encoding]])
**/
Buffer.alloc = function (size, fill, encoding) {
return alloc(size, fill, encoding)
}
function allocUnsafe (size) {
assertSize(size)
return createBuffer(size < 0 ? 0 : checked(size) | 0)
}
/**
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
* */
Buffer.allocUnsafe = function (size) {
return allocUnsafe(size)
}
/**
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
*/
Buffer.allocUnsafeSlow = function (size) {
return allocUnsafe(size)
}
function fromString (string, encoding) {
if (typeof encoding !== 'string' || encoding === '') {
encoding = 'utf8'
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
var length = byteLength(string, encoding) | 0
var buf = createBuffer(length)
var actual = buf.write(string, encoding)
if (actual !== length) {
// Writing a hex string, for example, that contains invalid characters will
// cause everything after the first invalid character to be ignored. (e.g.
// 'abxxcd' will be treated as 'ab')
buf = buf.slice(0, actual)
}
return buf
}
function fromArrayLike (array) {
var length = array.length < 0 ? 0 : checked(array.length) | 0
var buf = createBuffer(length)
for (var i = 0; i < length; i += 1) {
buf[i] = array[i] & 255
}
return buf
}
function fromArrayBuffer (array, byteOffset, length) {
if (byteOffset < 0 || array.byteLength < byteOffset) {
throw new RangeError('"offset" is outside of buffer bounds')
}
if (array.byteLength < byteOffset + (length || 0)) {
throw new RangeError('"length" is outside of buffer bounds')
}
var buf
if (byteOffset === undefined && length === undefined) {
buf = new Uint8Array(array)
} else if (length === undefined) {
buf = new Uint8Array(array, byteOffset)
} else {
buf = new Uint8Array(array, byteOffset, length)
}
// Return an augmented `Uint8Array` instance
buf.__proto__ = Buffer.prototype
return buf
}
function fromObject (obj) {
if (Buffer.isBuffer(obj)) {
var len = checked(obj.length) | 0
var buf = createBuffer(len)
if (buf.length === 0) {
return buf
}
obj.copy(buf, 0, 0, len)
return buf
}
if (obj.length !== undefined) {
if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
return createBuffer(0)
}
return fromArrayLike(obj)
}
if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
return fromArrayLike(obj.data)
}
}
function checked (length) {
// Note: cannot use `length < K_MAX_LENGTH` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if (length >= K_MAX_LENGTH) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
}
return length | 0
}
function SlowBuffer (length) {
if (+length != length) { // eslint-disable-line eqeqeq
length = 0
}
return Buffer.alloc(+length)
}
Buffer.isBuffer = function isBuffer (b) {
return b != null && b._isBuffer === true &&
b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
}
Buffer.compare = function compare (a, b) {
if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
throw new TypeError(
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
)
}
if (a === b) return 0
var x = a.length
var y = b.length
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
if (a[i] !== b[i]) {
x = a[i]
y = b[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
Buffer.isEncoding = function isEncoding (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'latin1':
case 'binary':
case 'base64':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true
default:
return false
}
}
Buffer.concat = function concat (list, length) {
if (!Array.isArray(list)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
if (list.length === 0) {
return Buffer.alloc(0)
}
var i
if (length === undefined) {
length = 0
for (i = 0; i < list.length; ++i) {
length += list[i].length
}
}
var buffer = Buffer.allocUnsafe(length)
var pos = 0
for (i = 0; i < list.length; ++i) {
var buf = list[i]
if (isInstance(buf, Uint8Array)) {
buf = Buffer.from(buf)
}
if (!Buffer.isBuffer(buf)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
buf.copy(buffer, pos)
pos += buf.length
}
return buffer
}
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
return string.byteLength
}
if (typeof string !== 'string') {
throw new TypeError(
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
'Received type ' + typeof string
)
}
var len = string.length
var mustMatch = (arguments.length > 2 && arguments[2] === true)
if (!mustMatch && len === 0) return 0
// Use a for loop to avoid recursion
var loweredCase = false
for (;;) {
switch (encoding) {
case 'ascii':
case 'latin1':
case 'binary':
return len
case 'utf8':
case 'utf-8':
return utf8ToBytes(string).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return len * 2
case 'hex':
return len >>> 1
case 'base64':
return base64ToBytes(string).length
default:
if (loweredCase) {
return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
}
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.byteLength = byteLength
function slowToString (encoding, start, end) {
var loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
// This behaves neither like String nor Uint8Array in that we set start/end
// to their upper/lower bounds if the value passed is out of range.
// undefined is handled specially as per ECMA-262 6th Edition,
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
if (start === undefined || start < 0) {
start = 0
}
// Return early if start > this.length. Done here to prevent potential uint32
// coercion fail below.
if (start > this.length) {
return ''
}
if (end === undefined || end > this.length) {
end = this.length
}
if (end <= 0) {
return ''
}
// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
end >>>= 0
start >>>= 0
if (end <= start) {
return ''
}
if (!encoding) encoding = 'utf8'
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 'latin1':
case 'binary':
return latin1Slice(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
}
}
}
// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
// reliably in a browserify context because there could be multiple different
// copies of the 'buffer' package in use. This method works even for Buffer
// instances that were created from another copy of the `buffer` package.
// See: https://github.com/feross/buffer/issues/154
Buffer.prototype._isBuffer = true
function swap (b, n, m) {
var i = b[n]
b[n] = b[m]
b[m] = i
}
Buffer.prototype.swap16 = function swap16 () {
var len = this.length
if (len % 2 !== 0) {
throw new RangeError('Buffer size must be a multiple of 16-bits')
}
for (var i = 0; i < len; i += 2) {
swap(this, i, i + 1)
}
return this
}
Buffer.prototype.swap32 = function swap32 () {
var len = this.length
if (len % 4 !== 0) {
throw new RangeError('Buffer size must be a multiple of 32-bits')
}
for (var i = 0; i < len; i += 4) {
swap(this, i, i + 3)
swap(this, i + 1, i + 2)
}
return this
}
Buffer.prototype.swap64 = function swap64 () {
var len = this.length
if (len % 8 !== 0) {
throw new RangeError('Buffer size must be a multiple of 64-bits')
}
for (var i = 0; i < len; i += 8) {
swap(this, i, i + 7)
swap(this, i + 1, i + 6)
swap(this, i + 2, i + 5)
swap(this, i + 3, i + 4)
}
return this
}
Buffer.prototype.toString = function toString () {
var length = this.length
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
}
Buffer.prototype.toLocaleString = Buffer.prototype.toString
Buffer.prototype.equals = function equals (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true
return Buffer.compare(this, b) === 0
}
Buffer.prototype.inspect = function inspect () {
var str = ''
var max = exports.INSPECT_MAX_BYTES
str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
if (this.length > max) str += ' ... '
return '<Buffer ' + str + '>'
}
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (isInstance(target, Uint8Array)) {
target = Buffer.from(target, target.offset, target.byteLength)
}
if (!Buffer.isBuffer(target)) {
throw new TypeError(
'The "target" argument must be one of type Buffer or Uint8Array. ' +
'Received type ' + (typeof target)
)
}
if (start === undefined) {
start = 0
}
if (end === undefined) {
end = target ? target.length : 0
}
if (thisStart === undefined) {
thisStart = 0
}
if (thisEnd === undefined) {
thisEnd = this.length
}
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
throw new RangeError('out of range index')
}
if (thisStart >= thisEnd && start >= end) {
return 0
}
if (thisStart >= thisEnd) {
return -1
}
if (start >= end) {
return 1
}
start >>>= 0
end >>>= 0
thisStart >>>= 0
thisEnd >>>= 0
if (this === target) return 0
var x = thisEnd - thisStart
var y = end - start
var len = Math.min(x, y)
var thisCopy = this.slice(thisStart, thisEnd)
var targetCopy = target.slice(start, end)
for (var i = 0; i < len; ++i) {
if (thisCopy[i] !== targetCopy[i]) {
x = thisCopy[i]
y = targetCopy[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1
// Normalize byteOffset
if (typeof byteOffset === 'string') {
encoding = byteOffset
byteOffset = 0
} else if (byteOffset > 0x7fffffff) {
byteOffset = 0x7fffffff
} else if (byteOffset < -0x80000000) {
byteOffset = -0x80000000
}
byteOffset = +byteOffset // Coerce to Number.
if (numberIsNaN(byteOffset)) {
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
byteOffset = dir ? 0 : (buffer.length - 1)
}
// Normalize byteOffset: negative offsets start from the end of the buffer
if (byteOffset < 0) byteOffset = buffer.length + byteOffset
if (byteOffset >= buffer.length) {
if (dir) return -1
else byteOffset = buffer.length - 1
} else if (byteOffset < 0) {
if (dir) byteOffset = 0
else return -1
}
// Normalize val
if (typeof val === 'string') {
val = Buffer.from(val, encoding)
}
// Finally, search either indexOf (if dir is true) or lastIndexOf
if (Buffer.isBuffer(val)) {
// Special case: looking for empty string/buffer always fails
if (val.length === 0) {
return -1
}
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
} else if (typeof val === 'number') {
val = val & 0xFF // Search for a byte value [0-255]
if (typeof Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
} else {
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
}
}
return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
}
throw new TypeError('val must be string, number or Buffer')
}
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
var indexSize = 1
var arrLength = arr.length
var valLength = val.length
if (encoding !== undefined) {
encoding = String(encoding).toLowerCase()
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
encoding === 'utf16le' || encoding === 'utf-16le') {
if (arr.length < 2 || val.length < 2) {
return -1
}
indexSize = 2
arrLength /= 2
valLength /= 2
byteOffset /= 2
}
}
function read (buf, i) {
if (indexSize === 1) {
return buf[i]
} else {
return buf.readUInt16BE(i * indexSize)
}
}
var i
if (dir) {
var foundIndex = -1
for (i = byteOffset; i < arrLength; i++) {
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
if (foundIndex === -1) foundIndex = i
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
} else {
if (foundIndex !== -1) i -= i - foundIndex
foundIndex = -1
}
}
} else {
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
for (i = byteOffset; i >= 0; i--) {
var found = true
for (var j = 0; j < valLength; j++) {
if (read(arr, i + j) !== read(val, j)) {
found = false
break
}
}
if (found) return i
}
}
return -1
}
Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
return this.indexOf(val, byteOffset, encoding) !== -1
}
Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}
Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}
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 (length > strLen / 2) {
length = strLen / 2
}
for (var i = 0; i < length; ++i) {
var parsed = parseInt(string.substr(i * 2, 2), 16)
if (numberIsNaN(parsed)) return i
buf[offset + i] = parsed
}
return i
}
function utf8Write (buf, string, offset, length) {
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}
function asciiWrite (buf, string, offset, length) {
return blitBuffer(asciiToBytes(string), buf, offset, length)
}
function latin1Write (buf, string, offset, length) {
return asciiWrite(buf, string, offset, length)
}
function base64Write (buf, string, offset, length) {
return blitBuffer(base64ToBytes(string), buf, offset, length)
}
function ucs2Write (buf, string, offset, length) {
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}
Buffer.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8'
length = this.length
offset = 0
// Buffer#write(string, encoding)
} else if (length === undefined && typeof offset === 'string') {
encoding = offset
length = this.length
offset = 0
// Buffer#write(string, offset[, length][, encoding])
} else if (isFinite(offset)) {
offset = offset >>> 0
if (isFinite(length)) {
length = length >>> 0
if (encoding === undefined) encoding = 'utf8'
} else {
encoding = length
length = undefined
}
} else {
throw new Error(
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
}
var remaining = this.length - offset
if (length === undefined || length > remaining) length = remaining
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
throw new RangeError('Attempt to write outside buffer bounds')
}
if (!encoding) encoding = 'utf8'
var loweredCase = false
for (;;) {
switch (encoding) {
case 'hex':
return hexWrite(this, string, offset, length)
case 'utf8':
case 'utf-8':
return utf8Write(this, string, offset, length)
case 'ascii':
return asciiWrite(this, string, offset, length)
case 'latin1':
case 'binary':
return latin1Write(this, string, offset, length)
case 'base64':
// Warning: maxLength not taken into account in base64Write
return base64Write(this, string, offset, length)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return ucs2Write(this, string, offset, length)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.prototype.toJSON = function toJSON () {
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) {
end = Math.min(buf.length, end)
var res = []
var i = start
while (i < end) {
var firstByte = buf[i]
var codePoint = null
var bytesPerSequence = (firstByte > 0xEF) ? 4
: (firstByte > 0xDF) ? 3
: (firstByte > 0xBF) ? 2
: 1
if (i + bytesPerSequence <= end) {
var secondByte, thirdByte, fourthByte, tempCodePoint
switch (bytesPerSequence) {
case 1:
if (firstByte < 0x80) {
codePoint = firstByte
}
break
case 2:
secondByte = buf[i + 1]
if ((secondByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
if (tempCodePoint > 0x7F) {
codePoint = tempCodePoint
}
}
break
case 3:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
codePoint = tempCodePoint
}
}
break
case 4:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
fourthByte = buf[i + 3]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
codePoint = tempCodePoint
}
}
}
}
if (codePoint === null) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if (codePoint > 0xFFFF) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res.push(codePoint >>> 10 & 0x3FF | 0xD800)
codePoint = 0xDC00 | codePoint & 0x3FF
}
res.push(codePoint)
i += bytesPerSequence
}
return decodeCodePointsArray(res)
}
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000
function decodeCodePointsArray (codePoints) {
var len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while (i < len) {
res += String.fromCharCode.apply(
String,
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
)
}
return res
}
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] & 0x7F)
}
return ret
}
function latin1Slice (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 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 slice (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
var newBuf = this.subarray(start, end)
// Return an augmented `Uint8Array` instance
newBuf.__proto__ = Buffer.prototype
return newBuf
}
/*
* Need to make sure that buffer isn't trying to write out of bounds.
*/
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.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
return val
}
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) {
checkOffset(offset, byteLength, this.length)
}
var val = this[offset + --byteLength]
var mul = 1
while (byteLength > 0 && (mul *= 0x100)) {
val += this[offset + --byteLength] * mul
}
return val
}
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 1, this.length)
return this[offset]
}
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
return this[offset] | (this[offset + 1] << 8)
}
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
return (this[offset] << 8) | this[offset + 1]
}
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return ((this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16)) +
(this[offset + 3] * 0x1000000)
}
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3])
}
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var i = byteLength
var mul = 1
var val = this[offset + --i]
while (i > 0 && (mul *= 0x100)) {
val += this[offset + --i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 1, this.length)
if (!(this[offset] & 0x80)) return (this[offset])
return ((0xff - this[offset] + 1) * -1)
}
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset] | (this[offset + 1] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset + 1] | (this[offset] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
offset = offset >>> 0
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 readInt32BE (offset, noAssert) {
offset = offset >>> 0
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 readFloatLE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, true, 23, 4)
}
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, false, 23, 4)
}
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, true, 52, 8)
}
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
offset = offset >>> 0
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" argument must be a Buffer instance')
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
if (offset + ext > buf.length) throw new RangeError('Index out of range')
}
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var mul = 1
var i = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var i = byteLength - 1
var mul = 1
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
return offset + 2
}
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
return offset + 2
}
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
this[offset + 3] = (value >>> 24)
this[offset + 2] = (value >>> 16)
this[offset + 1] = (value >>> 8)
this[offset] = (value & 0xff)
return offset + 4
}
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
return offset + 4
}
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
var limit = Math.pow(2, (8 * byteLength) - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = 0
var mul = 1
var sub = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
var limit = Math.pow(2, (8 * byteLength) - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = byteLength - 1
var mul = 1
var sub = 0
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
if (value < 0) value = 0xff + value + 1
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
return offset + 2
}
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
return offset + 2
}
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
this[offset + 2] = (value >>> 16)
this[offset + 3] = (value >>> 24)
return offset + 4
}
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (value < 0) value = 0xffffffff + value + 1
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
return offset + 4
}
function checkIEEE754 (buf, value, offset, ext, max, min) {
if (offset + ext > buf.length) throw new RangeError('Index out of range')
if (offset < 0) throw new RangeError('Index out of range')
}
function writeFloat (buf, value, offset, littleEndian, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
}
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
return writeFloat(this, value, offset, true, noAssert)
}
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
return writeFloat(this, value, offset, false, noAssert)
}
function writeDouble (buf, value, offset, littleEndian, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
}
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
return writeDouble(this, value, offset, true, noAssert)
}
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
return writeDouble(this, value, offset, false, noAssert)
}
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
if (!start) start = 0
if (!end && end !== 0) end = this.length
if (targetStart >= target.length) targetStart = target.length
if (!targetStart) targetStart = 0
if (end > 0 && end < start) end = start
// Copy 0 bytes; we're done
if (end === start) return 0
if (target.length === 0 || this.length === 0) return 0
// Fatal error conditions
if (targetStart < 0) {
throw new RangeError('targetStart out of bounds')
}
if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
if (end < 0) throw new RangeError('sourceEnd out of bounds')
// Are we oob?
if (end > this.length) end = this.length
if (target.length - targetStart < end - start) {
end = target.length - targetStart + start
}
var len = end - start
if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
// Use built-in when available, missing from IE11
this.copyWithin(targetStart, start, end)
} else if (this === target && start < targetStart && targetStart < end) {
// descending copy from end
for (var i = len - 1; i >= 0; --i) {
target[i + targetStart] = this[i + start]
}
} else {
Uint8Array.prototype.set.call(
target,
this.subarray(start, end),
targetStart
)
}
return len
}
// Usage:
// buffer.fill(number[, offset[, end]])
// buffer.fill(buffer[, offset[, end]])
// buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
encoding = start
start = 0
end = this.length
} else if (typeof end === 'string') {
encoding = end
end = this.length
}
if (encoding !== undefined && typeof encoding !== 'string') {
throw new TypeError('encoding must be a string')
}
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
if (val.length === 1) {
var code = val.charCodeAt(0)
if ((encoding === 'utf8' && code < 128) ||
encoding === 'latin1') {
// Fast path: If `val` fits into a single byte, use that numeric value.
val = code
}
}
} else if (typeof val === 'number') {
val = val & 255
}
// Invalid ranges are not set to a default, so can range check early.
if (start < 0 || this.length < start || this.length < end) {
throw new RangeError('Out of range index')
}
if (end <= start) {
return this
}
start = start >>> 0
end = end === undefined ? this.length : end >>> 0
if (!val) val = 0
var i
if (typeof val === 'number') {
for (i = start; i < end; ++i) {
this[i] = val
}
} else {
var bytes = Buffer.isBuffer(val)
? val
: Buffer.from(val, encoding)
var len = bytes.length
if (len === 0) {
throw new TypeError('The value "' + val +
'" is invalid for argument "value"')
}
for (i = 0; i < end - start; ++i) {
this[i + start] = bytes[i % len]
}
}
return this
}
// HELPER FUNCTIONS
// ================
var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
function base64clean (str) {
// Node takes equal signs as end of the Base64 encoding
str = str.split('=')[0]
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = str.trim().replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
while (str.length % 4 !== 0) {
str = str + '='
}
return str
}
function toHex (n) {
if (n < 16) return '0' + n.toString(16)
return n.toString(16)
}
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
var bytes = []
for (var i = 0; i < length; ++i) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
// last char was a lead
if (!leadSurrogate) {
// no lead yet
if (codePoint > 0xDBFF) {
// unexpected trail
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
} else if (i + 1 === length) {
// unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
}
// valid lead
leadSurrogate = codePoint
continue
}
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
}
// valid surrogate pair
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
} else if (leadSurrogate) {
// valid bmp char, but last char was a lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
}
leadSurrogate = null
// encode utf8
if (codePoint < 0x80) {
if ((units -= 1) < 0) break
bytes.push(codePoint)
} else if (codePoint < 0x800) {
if ((units -= 2) < 0) break
bytes.push(
codePoint >> 0x6 | 0xC0,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x10000) {
if ((units -= 3) < 0) break
bytes.push(
codePoint >> 0xC | 0xE0,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x110000) {
if ((units -= 4) < 0) break
bytes.push(
codePoint >> 0x12 | 0xF0,
codePoint >> 0xC & 0x3F | 0x80,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else {
throw new Error('Invalid code point')
}
}
return bytes
}
function asciiToBytes (str) {
var byteArray = []
for (var i = 0; i < str.length; ++i) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
}
function utf16leToBytes (str, units) {
var c, hi, lo
var byteArray = []
for (var i = 0; i < str.length; ++i) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
}
function base64ToBytes (str) {
return base64.toByteArray(base64clean(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
}
// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
// the `instanceof` check but they should be treated as of that type.
// See: https://github.com/feross/buffer/issues/166
function isInstance (obj, type) {
return obj instanceof type ||
(obj != null && obj.constructor != null && obj.constructor.name != null &&
obj.constructor.name === type.name)
}
function numberIsNaN (obj) {
// For IE11 support
return obj !== obj // eslint-disable-line no-self-compare
}
}).call(this)}).call(this,require("buffer").Buffer)
},{"base64-js":438,"buffer":441,"ieee754":445}],442:[function(require,module,exports){
(function (Buffer){(function (){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(arg) {
if (Array.isArray) {
return Array.isArray(arg);
}
return objectToString(arg) === '[object Array]';
}
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 objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;
function isDate(d) {
return objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
return (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' || // ES6 symbol
typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;
exports.isBuffer = Buffer.isBuffer;
function objectToString(o) {
return Object.prototype.toString.call(o);
}
}).call(this)}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
},{"../../is-buffer/index.js":447}],443:[function(require,module,exports){
(function (process){(function (){
/**
* This is the web browser implementation of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = require('./debug');
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = 'undefined' != typeof chrome
&& 'undefined' != typeof chrome.storage
? chrome.storage.local
: localstorage();
/**
* Colors.
*/
exports.colors = [
'lightseagreen',
'forestgreen',
'goldenrod',
'dodgerblue',
'darkorchid',
'crimson'
];
/**
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
* and the Firebug extension (any Firefox version) are known
* to support "%c" CSS customizations.
*
* TODO: add a `localStorage` variable to explicitly enable/disable colors
*/
function useColors() {
// NB: In an Electron preload script, document will be defined but not fully
// initialized. Since we know we're in Chrome, we'll just detect this case
// explicitly
if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
return true;
}
// is webkit? http://stackoverflow.com/a/16459606/376773
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
// is firebug? http://stackoverflow.com/a/398120/376773
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
// is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
// double check webkit in userAgent just in case we are in a worker
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}
/**
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
*/
exports.formatters.j = function(v) {
try {
return JSON.stringify(v);
} catch (err) {
return '[UnexpectedJSONParseError]: ' + err.message;
}
};
/**
* Colorize log arguments if enabled.
*
* @api public
*/
function formatArgs(args) {
var useColors = this.useColors;
args[0] = (useColors ? '%c' : '')
+ this.namespace
+ (useColors ? ' %c' : ' ')
+ args[0]
+ (useColors ? '%c ' : ' ')
+ '+' + exports.humanize(this.diff);
if (!useColors) return;
var c = 'color: ' + this.color;
args.splice(1, 0, c, 'color: inherit')
// the final "%c" is somewhat tricky, because there could be other
// arguments passed either before or after the %c, so we need to
// figure out the correct index to insert the CSS into
var index = 0;
var lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, function(match) {
if ('%%' === match) return;
index++;
if ('%c' === match) {
// we only are interested in the *last* %c
// (the user may have provided their own)
lastC = index;
}
});
args.splice(lastC, 0, c);
}
/**
* Invokes `console.log()` when available.
* No-op when `console.log` is not a "function".
*
* @api public
*/
function log() {
// this hackery is required for IE8/9, where
// the `console.log` function doesn't have 'apply'
return 'object' === typeof console
&& console.log
&& Function.prototype.apply.call(console.log, console, arguments);
}
/**
* Save `namespaces`.
*
* @param {String} namespaces
* @api private
*/
function save(namespaces) {
try {
if (null == namespaces) {
exports.storage.removeItem('debug');
} else {
exports.storage.debug = namespaces;
}
} catch(e) {}
}
/**
* Load `namespaces`.
*
* @return {String} returns the previously persisted debug modes
* @api private
*/
function load() {
var r;
try {
r = exports.storage.debug;
} catch(e) {}
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
if (!r && typeof process !== 'undefined' && 'env' in process) {
r = process.env.DEBUG;
}
return r;
}
/**
* Enable namespaces listed in `localStorage.debug` initially.
*/
exports.enable(load());
/**
* Localstorage attempts to return the localstorage.
*
* This is necessary because safari throws
* when a user disables cookies/localstorage
* and you attempt to access it.
*
* @return {LocalStorage}
* @api private
*/
function localstorage() {
try {
return window.localStorage;
} catch (e) {}
}
}).call(this)}).call(this,require('_process'))
},{"./debug":444,"_process":451}],444:[function(require,module,exports){
/**
* This is the common logic for both the Node.js and web browser
* implementations of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
exports.coerce = coerce;
exports.disable = disable;
exports.enable = enable;
exports.enabled = enabled;
exports.humanize = require('ms');
/**
* The currently active debug mode names, and names to skip.
*/
exports.names = [];
exports.skips = [];
/**
* Map of special "%n" handling functions, for the debug "format" argument.
*
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
*/
exports.formatters = {};
/**
* Previous log timestamp.
*/
var prevTime;
/**
* Select a color.
* @param {String} namespace
* @return {Number}
* @api private
*/
function selectColor(namespace) {
var hash = 0, i;
for (i in namespace) {
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
hash |= 0; // Convert to 32bit integer
}
return exports.colors[Math.abs(hash) % exports.colors.length];
}
/**
* Create a debugger with the given `namespace`.
*
* @param {String} namespace
* @return {Function}
* @api public
*/
function createDebug(namespace) {
function debug() {
// disabled?
if (!debug.enabled) return;
var self = debug;
// set `diff` timestamp
var curr = +new Date();
var ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
// turn the `arguments` into a proper Array
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i];
}
args[0] = exports.coerce(args[0]);
if ('string' !== typeof args[0]) {
// anything else let's inspect with %O
args.unshift('%O');
}
// apply any `formatters` transformations
var index = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
// if we encounter an escaped % then don't increase the array index
if (match === '%%') return match;
index++;
var formatter = exports.formatters[format];
if ('function' === typeof formatter) {
var val = args[index];
match = formatter.call(self, val);
// now we need to remove `args[index]` since it's inlined in the `format`
args.splice(index, 1);
index--;
}
return match;
});
// apply env-specific formatting (colors, etc.)
exports.formatArgs.call(self, args);
var logFn = debug.log || exports.log || console.log.bind(console);
logFn.apply(self, args);
}
debug.namespace = namespace;
debug.enabled = exports.enabled(namespace);
debug.useColors = exports.useColors();
debug.color = selectColor(namespace);
// env-specific initialization logic for debug instances
if ('function' === typeof exports.init) {
exports.init(debug);
}
return debug;
}
/**
* Enables a debug mode by namespaces. This can include modes
* separated by a colon and wildcards.
*
* @param {String} namespaces
* @api public
*/
function enable(namespaces) {
exports.save(namespaces);
exports.names = [];
exports.skips = [];
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
var len = split.length;
for (var i = 0; i < len; i++) {
if (!split[i]) continue; // ignore empty strings
namespaces = split[i].replace(/\*/g, '.*?');
if (namespaces[0] === '-') {
exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
} else {
exports.names.push(new RegExp('^' + namespaces + '$'));
}
}
}
/**
* Disable debug output.
*
* @api public
*/
function disable() {
exports.enable('');
}
/**
* Returns true if the given mode name is enabled, false otherwise.
*
* @param {String} name
* @return {Boolean}
* @api public
*/
function enabled(name) {
var i, len;
for (i = 0, len = exports.skips.length; i < len; i++) {
if (exports.skips[i].test(name)) {
return false;
}
}
for (i = 0, len = exports.names.length; i < len; i++) {
if (exports.names[i].test(name)) {
return true;
}
}
return false;
}
/**
* Coerce `val`.
*
* @param {Mixed} val
* @return {Mixed}
* @api private
*/
function coerce(val) {
if (val instanceof Error) return val.stack || val.message;
return val;
}
},{"ms":449}],445:[function(require,module,exports){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var nBits = -7
var i = isLE ? (nBytes - 1) : 0
var d = isLE ? -1 : 1
var 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
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
var i = isLE ? 0 : (nBytes - 1)
var d = isLE ? 1 : -1
var 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 & 0xff, i += d, m /= 256, mLen -= 8) {}
e = (e << mLen) | m
eLen += mLen
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
buffer[offset + i - d] |= s * 128
}
},{}],446:[function(require,module,exports){
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
if (superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
})
}
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
if (superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
}
},{}],447:[function(require,module,exports){
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
// The _isBuffer check is for Safari 5-7 support, because it's missing
// Object.prototype.constructor. Remove this eventually
module.exports = function (obj) {
return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
}
function isBuffer (obj) {
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}
// For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) {
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
}
},{}],448:[function(require,module,exports){
var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
},{}],449:[function(require,module,exports){
/**
* Helpers.
*/
var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var y = d * 365.25;
/**
* Parse or format the given `val`.
*
* Options:
*
* - `long` verbose formatting [false]
*
* @param {String|Number} val
* @param {Object} [options]
* @throws {Error} throw an error if val is not a non-empty string or a number
* @return {String|Number}
* @api public
*/
module.exports = function(val, options) {
options = options || {};
var type = typeof val;
if (type === 'string' && val.length > 0) {
return parse(val);
} else if (type === 'number' && isNaN(val) === false) {
return options.long ? fmtLong(val) : fmtShort(val);
}
throw new Error(
'val is not a non-empty string or a valid number. val=' +
JSON.stringify(val)
);
};
/**
* Parse the given `str` and return milliseconds.
*
* @param {String} str
* @return {Number}
* @api private
*/
function parse(str) {
str = String(str);
if (str.length > 100) {
return;
}
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
str
);
if (!match) {
return;
}
var n = parseFloat(match[1]);
var type = (match[2] || 'ms').toLowerCase();
switch (type) {
case 'years':
case 'year':
case 'yrs':
case 'yr':
case 'y':
return n * y;
case 'days':
case 'day':
case 'd':
return n * d;
case 'hours':
case 'hour':
case 'hrs':
case 'hr':
case 'h':
return n * h;
case 'minutes':
case 'minute':
case 'mins':
case 'min':
case 'm':
return n * m;
case 'seconds':
case 'second':
case 'secs':
case 'sec':
case 's':
return n * s;
case 'milliseconds':
case 'millisecond':
case 'msecs':
case 'msec':
case 'ms':
return n;
default:
return undefined;
}
}
/**
* Short format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function fmtShort(ms) {
if (ms >= d) {
return Math.round(ms / d) + 'd';
}
if (ms >= h) {
return Math.round(ms / h) + 'h';
}
if (ms >= m) {
return Math.round(ms / m) + 'm';
}
if (ms >= s) {
return Math.round(ms / s) + 's';
}
return ms + 'ms';
}
/**
* Long format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function fmtLong(ms) {
return plural(ms, d, 'day') ||
plural(ms, h, 'hour') ||
plural(ms, m, 'minute') ||
plural(ms, s, 'second') ||
ms + ' ms';
}
/**
* Pluralization helper.
*/
function plural(ms, n, name) {
if (ms < n) {
return;
}
if (ms < n * 1.5) {
return Math.floor(ms / n) + ' ' + name;
}
return Math.ceil(ms / n) + ' ' + name + 's';
}
},{}],450:[function(require,module,exports){
(function (process){(function (){
'use strict';
if (typeof process === 'undefined' ||
!process.version ||
process.version.indexOf('v0.') === 0 ||
process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
module.exports = { nextTick: nextTick };
} else {
module.exports = process
}
function nextTick(fn, arg1, arg2, arg3) {
if (typeof fn !== 'function') {
throw new TypeError('"callback" argument must be a function');
}
var len = arguments.length;
var args, i;
switch (len) {
case 0:
case 1:
return process.nextTick(fn);
case 2:
return process.nextTick(function afterTickOne() {
fn.call(null, arg1);
});
case 3:
return process.nextTick(function afterTickTwo() {
fn.call(null, arg1, arg2);
});
case 4:
return process.nextTick(function afterTickThree() {
fn.call(null, arg1, arg2, arg3);
});
default:
args = new Array(len - 1);
i = 0;
while (i < args.length) {
args[i++] = arguments[i];
}
return process.nextTick(function afterTick() {
fn.apply(null, args);
});
}
}
}).call(this)}).call(this,require('_process'))
},{"_process":451}],451:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
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');
};
process.umask = function() { return 0; };
},{}],452:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a duplex stream is just a stream that is both readable and writable.
// Since JS doesn't have multiple prototypal inheritance, this class
// prototypally inherits from Readable, and then parasitically from
// Writable.
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
/*<replacement>*/
var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) {
keys.push(key);
}return keys;
};
/*</replacement>*/
module.exports = Duplex;
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
var Readable = require('./_stream_readable');
var Writable = require('./_stream_writable');
util.inherits(Duplex, Readable);
{
// avoid scope creep, the keys array can then be collected
var keys = objectKeys(Writable.prototype);
for (var v = 0; v < keys.length; v++) {
var method = keys[v];
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);
}
Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._writableState.highWaterMark;
}
});
// the no-half-open enforcer
function onend() {
// if we allow half-open state, or if the writable side ended,
// then we're ok.
if (this.allowHalfOpen || this._writableState.ended) return;
// no more data can be written.
// But allow more writes to happen in this tick.
pna.nextTick(onEndNT, this);
}
function onEndNT(self) {
self.end();
}
Object.defineProperty(Duplex.prototype, 'destroyed', {
get: function () {
if (this._readableState === undefined || this._writableState === undefined) {
return false;
}
return this._readableState.destroyed && this._writableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (this._readableState === undefined || this._writableState === undefined) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._readableState.destroyed = value;
this._writableState.destroyed = value;
}
});
Duplex.prototype._destroy = function (err, cb) {
this.push(null);
this.end();
pna.nextTick(cb, err);
};
},{"./_stream_readable":454,"./_stream_writable":456,"core-util-is":442,"inherits":446,"process-nextick-args":450}],453:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a passthrough stream.
// basically just the most minimal sort of Transform stream.
// Every written chunk gets output as-is.
'use strict';
module.exports = PassThrough;
var Transform = require('./_stream_transform');
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
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":455,"core-util-is":442,"inherits":446}],454:[function(require,module,exports){
(function (process,global){(function (){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
module.exports = Readable;
/*<replacement>*/
var isArray = require('isarray');
/*</replacement>*/
/*<replacement>*/
var Duplex;
/*</replacement>*/
Readable.ReadableState = ReadableState;
/*<replacement>*/
var EE = require('events').EventEmitter;
var EElistenerCount = function (emitter, type) {
return emitter.listeners(type).length;
};
/*</replacement>*/
/*<replacement>*/
var Stream = require('./internal/streams/stream');
/*</replacement>*/
/*<replacement>*/
var Buffer = require('safe-buffer').Buffer;
var OurUint8Array = global.Uint8Array || function () {};
function _uint8ArrayToBuffer(chunk) {
return Buffer.from(chunk);
}
function _isUint8Array(obj) {
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
}
/*</replacement>*/
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
/*<replacement>*/
var debugUtil = require('util');
var debug = void 0;
if (debugUtil && debugUtil.debuglog) {
debug = debugUtil.debuglog('stream');
} else {
debug = function () {};
}
/*</replacement>*/
var BufferList = require('./internal/streams/BufferList');
var destroyImpl = require('./internal/streams/destroy');
var StringDecoder;
util.inherits(Readable, Stream);
var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
function prependListener(emitter, event, fn) {
// Sadly this is not cacheable as some libraries bundle their own
// event emitter implementation with them.
if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
// This is a hack to make sure that our error handler is attached before any
// userland ones. NEVER DO THIS. This is here only because this code needs
// to continue to work with older versions of Node.js that do not include
// the prependListener() method. The goal is to eventually remove this hack.
if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
}
function ReadableState(options, stream) {
Duplex = Duplex || require('./_stream_duplex');
options = options || {};
// Duplex streams are both readable and writable, but share
// the same options object.
// However, some cases require setting options to different
// values for the readable and the writable sides of the duplex stream.
// These options can be provided separately as readableXXX and writableXXX.
var isDuplex = stream instanceof Duplex;
// object stream flag. Used to make read(n) ignore n and to
// make all the buffer merging and length checks go away
this.objectMode = !!options.objectMode;
if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
// the point at which it stops calling _read() to fill the buffer
// Note: 0 is a valid value, means "don't call _read preemptively ever"
var hwm = options.highWaterMark;
var readableHwm = options.readableHighWaterMark;
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
// cast to ints.
this.highWaterMark = Math.floor(this.highWaterMark);
// A linked list is used to store data chunks instead of an array because the
// linked list can remove elements from the beginning faster than
// array.shift()
this.buffer = new BufferList();
this.length = 0;
this.pipes = null;
this.pipesCount = 0;
this.flowing = null;
this.ended = false;
this.endEmitted = false;
this.reading = false;
// a flag to be able to tell if the event 'readable'/'data' is emitted
// immediately, or on a later tick. We set this to true at first, because
// any actions that shouldn't happen until "later" should generally also
// not happen before the first read call.
this.sync = true;
// whenever we return null, then we set a flag to say
// that we're awaiting a 'readable' event emission.
this.needReadable = false;
this.emittedReadable = false;
this.readableListening = false;
this.resumeScheduled = false;
// has it been destroyed
this.destroyed = false;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// the number of writers that are awaiting a drain event in .pipe()s
this.awaitDrain = 0;
// if true, a maybeReadMore has been scheduled
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) {
Duplex = Duplex || require('./_stream_duplex');
if (!(this instanceof Readable)) return new Readable(options);
this._readableState = new ReadableState(options, this);
// legacy
this.readable = true;
if (options) {
if (typeof options.read === 'function') this._read = options.read;
if (typeof options.destroy === 'function') this._destroy = options.destroy;
}
Stream.call(this);
}
Object.defineProperty(Readable.prototype, 'destroyed', {
get: function () {
if (this._readableState === undefined) {
return false;
}
return this._readableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (!this._readableState) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._readableState.destroyed = value;
}
});
Readable.prototype.destroy = destroyImpl.destroy;
Readable.prototype._undestroy = destroyImpl.undestroy;
Readable.prototype._destroy = function (err, cb) {
this.push(null);
cb(err);
};
// Manually shove something into the read() buffer.
// This returns true if the highWaterMark has not been hit yet,
// similar to how Writable.write() returns true if you should
// write() some more.
Readable.prototype.push = function (chunk, encoding) {
var state = this._readableState;
var skipChunkCheck;
if (!state.objectMode) {
if (typeof chunk === 'string') {
encoding = encoding || state.defaultEncoding;
if (encoding !== state.encoding) {
chunk = Buffer.from(chunk, encoding);
encoding = '';
}
skipChunkCheck = true;
}
} else {
skipChunkCheck = true;
}
return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
};
// Unshift should *always* be something directly out of read()
Readable.prototype.unshift = function (chunk) {
return readableAddChunk(this, chunk, null, true, false);
};
function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
var state = stream._readableState;
if (chunk === null) {
state.reading = false;
onEofChunk(stream, state);
} else {
var er;
if (!skipChunkCheck) er = chunkInvalid(state, chunk);
if (er) {
stream.emit('error', er);
} else if (state.objectMode || chunk && chunk.length > 0) {
if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
chunk = _uint8ArrayToBuffer(chunk);
}
if (addToFront) {
if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
} else if (state.ended) {
stream.emit('error', new Error('stream.push() after EOF'));
} else {
state.reading = false;
if (state.decoder && !encoding) {
chunk = state.decoder.write(chunk);
if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
} else {
addChunk(stream, state, chunk, false);
}
}
} else if (!addToFront) {
state.reading = false;
}
}
return needMoreData(state);
}
function addChunk(stream, state, chunk, addToFront) {
if (state.flowing && state.length === 0 && !state.sync) {
stream.emit('data', chunk);
stream.read(0);
} else {
// update the buffer info.
state.length += state.objectMode ? 1 : chunk.length;
if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
if (state.needReadable) emitReadable(stream);
}
maybeReadMore(stream, state);
}
function chunkInvalid(state, chunk) {
var er;
if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
er = new TypeError('Invalid non-string/buffer chunk');
}
return er;
}
// if it's past the high water mark, we can push in some more.
// Also, if we have no data yet, we can stand some
// more bytes. This is to work around cases where hwm=0,
// such as the repl. Also, if the push() triggered a
// readable event, and the user called read(largeNumber) such that
// needReadable was set, then we ought to push more, so that another
// 'readable' event will be triggered.
function needMoreData(state) {
return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
}
Readable.prototype.isPaused = function () {
return this._readableState.flowing === false;
};
// backwards compatibility.
Readable.prototype.setEncoding = function (enc) {
if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
this._readableState.decoder = new StringDecoder(enc);
this._readableState.encoding = enc;
return this;
};
// Don't raise the hwm > 8MB
var MAX_HWM = 0x800000;
function computeNewHighWaterMark(n) {
if (n >= MAX_HWM) {
n = MAX_HWM;
} else {
// Get the next highest power of 2 to prevent increasing hwm excessively in
// tiny amounts
n--;
n |= n >>> 1;
n |= n >>> 2;
n |= n >>> 4;
n |= n >>> 8;
n |= n >>> 16;
n++;
}
return n;
}
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function howMuchToRead(n, state) {
if (n <= 0 || state.length === 0 && state.ended) return 0;
if (state.objectMode) return 1;
if (n !== n) {
// Only flow one buffer at a time
if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
}
// If we're asking for more than the current hwm, then raise the hwm.
if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
if (n <= state.length) return n;
// Don't have enough
if (!state.ended) {
state.needReadable = true;
return 0;
}
return state.length;
}
// you can override either this method, or the async _read(n) below.
Readable.prototype.read = function (n) {
debug('read', n);
n = parseInt(n, 10);
var state = this._readableState;
var nOrig = n;
if (n !== 0) state.emittedReadable = false;
// if we're doing read(0) to trigger a readable event, but we
// already have a bunch of data in the buffer, then just trigger
// the 'readable' event and move on.
if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
debug('read: emitReadable', state.length, state.ended);
if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
return null;
}
n = howMuchToRead(n, state);
// if we've ended, and we're now clear, then finish it up.
if (n === 0 && state.ended) {
if (state.length === 0) endReadable(this);
return null;
}
// All the actual chunk generation logic needs to be
// *below* the call to _read. The reason is that in certain
// synthetic stream cases, such as passthrough streams, _read
// may be a completely synchronous operation which may change
// the state of the read buffer, providing enough data when
// before there was *not* enough.
//
// So, the steps are:
// 1. Figure out what the state of things will be after we do
// a read from the buffer.
//
// 2. If that resulting state will trigger a _read, then call _read.
// Note that this may be asynchronous, or synchronous. Yes, it is
// deeply ugly to write APIs this way, but that still doesn't mean
// that the Readable class should behave improperly, as streams are
// designed to be sync/async agnostic.
// Take note if the _read call is sync or async (ie, if the read call
// has returned yet), so that we know whether or not it's safe to emit
// 'readable' etc.
//
// 3. Actually pull the requested chunks out of the buffer and return.
// if we need a readable event, then we need to do some reading.
var doRead = state.needReadable;
debug('need readable', doRead);
// if we currently have less than the highWaterMark, then also read some
if (state.length === 0 || state.length - n < state.highWaterMark) {
doRead = true;
debug('length less than watermark', doRead);
}
// however, if we've ended, then there's no point, and if we're already
// reading, then it's unnecessary.
if (state.ended || state.reading) {
doRead = false;
debug('reading or ended', doRead);
} else if (doRead) {
debug('do read');
state.reading = true;
state.sync = true;
// if the length is currently zero, then we *need* a readable event.
if (state.length === 0) state.needReadable = true;
// call internal read method
this._read(state.highWaterMark);
state.sync = false;
// If _read pushed data synchronously, then `reading` will be false,
// and we need to re-evaluate how much data we can return to the user.
if (!state.reading) n = howMuchToRead(nOrig, state);
}
var ret;
if (n > 0) ret = fromList(n, state);else ret = null;
if (ret === null) {
state.needReadable = true;
n = 0;
} else {
state.length -= n;
}
if (state.length === 0) {
// If we have nothing in the buffer, then we want to know
// as soon as we *do* get something into the buffer.
if (!state.ended) state.needReadable = true;
// If we tried to read() past the EOF, then emit end on the next tick.
if (nOrig !== n && state.ended) endReadable(this);
}
if (ret !== null) this.emit('data', ret);
return ret;
};
function onEofChunk(stream, state) {
if (state.ended) return;
if (state.decoder) {
var chunk = state.decoder.end();
if (chunk && chunk.length) {
state.buffer.push(chunk);
state.length += state.objectMode ? 1 : chunk.length;
}
}
state.ended = true;
// emit 'readable' now to make sure it gets picked up.
emitReadable(stream);
}
// Don't emit readable right away in sync mode, because this can trigger
// another read() call => stack overflow. This way, it might trigger
// a nextTick recursion warning, but that's not so bad.
function emitReadable(stream) {
var state = stream._readableState;
state.needReadable = false;
if (!state.emittedReadable) {
debug('emitReadable', state.flowing);
state.emittedReadable = true;
if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
}
}
function emitReadable_(stream) {
debug('emit readable');
stream.emit('readable');
flow(stream);
}
// at this point, the user has presumably seen the 'readable' event,
// and called read() to consume some data. that may have triggered
// in turn another _read(n) call, in which case reading = true if
// it's in progress.
// However, if we're not ended, or reading, and the length < hwm,
// then go ahead and try to read some more preemptively.
function maybeReadMore(stream, state) {
if (!state.readingMore) {
state.readingMore = true;
pna.nextTick(maybeReadMore_, stream, state);
}
}
function maybeReadMore_(stream, state) {
var len = state.length;
while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
debug('maybeReadMore read 0');
stream.read(0);
if (len === state.length)
// didn't get any data, stop spinning.
break;else len = state.length;
}
state.readingMore = false;
}
// abstract method. to be overridden in specific implementation classes.
// call cb(er, data) where data is <= n in length.
// for virtual (non-string, non-buffer) streams, "length" is somewhat
// arbitrary, and perhaps not very meaningful.
Readable.prototype._read = function (n) {
this.emit('error', new Error('_read() is 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;
debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
var endFn = doEnd ? onend : unpipe;
if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
dest.on('unpipe', onunpipe);
function onunpipe(readable, unpipeInfo) {
debug('onunpipe');
if (readable === src) {
if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
unpipeInfo.hasUnpiped = true;
cleanup();
}
}
}
function onend() {
debug('onend');
dest.end();
}
// when the dest drains, it reduces the awaitDrain counter
// on the source. This would be more elegant with a .once()
// handler in flow(), but adding and removing repeatedly is
// too slow.
var ondrain = pipeOnDrain(src);
dest.on('drain', ondrain);
var cleanedUp = false;
function cleanup() {
debug('cleanup');
// cleanup event handlers once the pipe is broken
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', unpipe);
src.removeListener('data', ondata);
cleanedUp = true;
// if the reader is waiting for a drain event from this
// specific writer, then it would cause it to never start
// flowing again.
// So, if this is awaiting a drain, then we just call it now.
// If we don't know, then assume that we are waiting for one.
if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
}
// If the user pushes more data while we're writing to dest then we'll end up
// in ondata again. However, we only want to increase awaitDrain once because
// dest will only emit one 'drain' event for the multiple writes.
// => Introduce a guard on increasing awaitDrain.
var increasedAwaitDrain = false;
src.on('data', ondata);
function ondata(chunk) {
debug('ondata');
increasedAwaitDrain = false;
var ret = dest.write(chunk);
if (false === ret && !increasedAwaitDrain) {
// If the user unpiped during `dest.write()`, it is possible
// to get stuck in a permanently paused state if that write
// also returned false.
// => Check whether `dest` is still a piping destination.
if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
debug('false write response, pause', src._readableState.awaitDrain);
src._readableState.awaitDrain++;
increasedAwaitDrain = true;
}
src.pause();
}
}
// if the dest has an error, then stop piping into it.
// however, don't suppress the throwing behavior for this.
function onerror(er) {
debug('onerror', er);
unpipe();
dest.removeListener('error', onerror);
if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
}
// Make sure our error handler is attached before userland ones.
prependListener(dest, 'error', onerror);
// Both close and finish should trigger unpipe, but only once.
function onclose() {
dest.removeListener('finish', onfinish);
unpipe();
}
dest.once('close', onclose);
function onfinish() {
debug('onfinish');
dest.removeListener('close', onclose);
unpipe();
}
dest.once('finish', onfinish);
function unpipe() {
debug('unpipe');
src.unpipe(dest);
}
// tell the dest that it's being piped to
dest.emit('pipe', src);
// start the flow if it hasn't been started already.
if (!state.flowing) {
debug('pipe resume');
src.resume();
}
return dest;
};
function pipeOnDrain(src) {
return function () {
var state = src._readableState;
debug('pipeOnDrain', state.awaitDrain);
if (state.awaitDrain) state.awaitDrain--;
if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
state.flowing = true;
flow(src);
}
};
}
Readable.prototype.unpipe = function (dest) {
var state = this._readableState;
var unpipeInfo = { hasUnpiped: false };
// if we're not piping anywhere, then do nothing.
if (state.pipesCount === 0) return this;
// just one destination. most common case.
if (state.pipesCount === 1) {
// passed in one, but it's not the right one.
if (dest && dest !== state.pipes) return this;
if (!dest) dest = state.pipes;
// got a match.
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
if (dest) dest.emit('unpipe', this, unpipeInfo);
return this;
}
// slow case. multiple pipe destinations.
if (!dest) {
// remove all.
var dests = state.pipes;
var len = state.pipesCount;
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
for (var i = 0; i < len; i++) {
dests[i].emit('unpipe', this, unpipeInfo);
}return this;
}
// try to find the right one.
var index = indexOf(state.pipes, dest);
if (index === -1) return this;
state.pipes.splice(index, 1);
state.pipesCount -= 1;
if (state.pipesCount === 1) state.pipes = state.pipes[0];
dest.emit('unpipe', this, unpipeInfo);
return this;
};
// set up data events if they are asked for
// Ensure readable listeners eventually get something
Readable.prototype.on = function (ev, fn) {
var res = Stream.prototype.on.call(this, ev, fn);
if (ev === 'data') {
// Start flowing on next tick if stream isn't explicitly paused
if (this._readableState.flowing !== false) this.resume();
} else if (ev === 'readable') {
var state = this._readableState;
if (!state.endEmitted && !state.readableListening) {
state.readableListening = state.needReadable = true;
state.emittedReadable = false;
if (!state.reading) {
pna.nextTick(nReadingNextTick, this);
} else if (state.length) {
emitReadable(this);
}
}
}
return res;
};
Readable.prototype.addListener = Readable.prototype.on;
function nReadingNextTick(self) {
debug('readable nexttick read 0');
self.read(0);
}
// pause() and resume() are remnants of the legacy readable stream API
// If the user uses them, then switch into old mode.
Readable.prototype.resume = function () {
var state = this._readableState;
if (!state.flowing) {
debug('resume');
state.flowing = true;
resume(this, state);
}
return this;
};
function resume(stream, state) {
if (!state.resumeScheduled) {
state.resumeScheduled = true;
pna.nextTick(resume_, stream, state);
}
}
function resume_(stream, state) {
if (!state.reading) {
debug('resume read 0');
stream.read(0);
}
state.resumeScheduled = false;
state.awaitDrain = 0;
stream.emit('resume');
flow(stream);
if (state.flowing && !state.reading) stream.read(0);
}
Readable.prototype.pause = function () {
debug('call pause flowing=%j', this._readableState.flowing);
if (false !== this._readableState.flowing) {
debug('pause');
this._readableState.flowing = false;
this.emit('pause');
}
return this;
};
function flow(stream) {
var state = stream._readableState;
debug('flow', state.flowing);
while (state.flowing && stream.read() !== null) {}
}
// wrap an old-style stream as the async data source.
// This is *not* part of the readable stream interface.
// It is an ugly unfortunate mess of history.
Readable.prototype.wrap = function (stream) {
var _this = this;
var state = this._readableState;
var paused = false;
stream.on('end', function () {
debug('wrapped end');
if (state.decoder && !state.ended) {
var chunk = state.decoder.end();
if (chunk && chunk.length) _this.push(chunk);
}
_this.push(null);
});
stream.on('data', function (chunk) {
debug('wrapped data');
if (state.decoder) chunk = state.decoder.write(chunk);
// don't skip over falsy values in objectMode
if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
var ret = _this.push(chunk);
if (!ret) {
paused = true;
stream.pause();
}
});
// proxy all the other methods.
// important when wrapping filters and duplexes.
for (var i in stream) {
if (this[i] === undefined && typeof stream[i] === 'function') {
this[i] = function (method) {
return function () {
return stream[method].apply(stream, arguments);
};
}(i);
}
}
// proxy certain important events.
for (var n = 0; n < kProxyEvents.length; n++) {
stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
}
// when we try to consume some more bytes, simply unpause the
// underlying stream.
this._read = function (n) {
debug('wrapped _read', n);
if (paused) {
paused = false;
stream.resume();
}
};
return this;
};
Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._readableState.highWaterMark;
}
});
// exposed for testing purposes only.
Readable._fromList = fromList;
// Pluck off n bytes from an array of buffers.
// Length is the combined lengths of all the buffers in the list.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function fromList(n, state) {
// nothing buffered
if (state.length === 0) return null;
var ret;
if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
// read it all, truncate the list
if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
state.buffer.clear();
} else {
// read part of list
ret = fromListPartial(n, state.buffer, state.decoder);
}
return ret;
}
// Extracts only enough buffered data to satisfy the amount requested.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function fromListPartial(n, list, hasStrings) {
var ret;
if (n < list.head.data.length) {
// slice is the same for buffers and strings
ret = list.head.data.slice(0, n);
list.head.data = list.head.data.slice(n);
} else if (n === list.head.data.length) {
// first chunk is a perfect match
ret = list.shift();
} else {
// result spans more than one buffer
ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
}
return ret;
}
// Copies a specified amount of characters from the list of buffered data
// chunks.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function copyFromBufferString(n, list) {
var p = list.head;
var c = 1;
var ret = p.data;
n -= ret.length;
while (p = p.next) {
var str = p.data;
var nb = n > str.length ? str.length : n;
if (nb === str.length) ret += str;else ret += str.slice(0, n);
n -= nb;
if (n === 0) {
if (nb === str.length) {
++c;
if (p.next) list.head = p.next;else list.head = list.tail = null;
} else {
list.head = p;
p.data = str.slice(nb);
}
break;
}
++c;
}
list.length -= c;
return ret;
}
// Copies a specified amount of bytes from the list of buffered data chunks.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function copyFromBuffer(n, list) {
var ret = Buffer.allocUnsafe(n);
var p = list.head;
var c = 1;
p.data.copy(ret);
n -= p.data.length;
while (p = p.next) {
var buf = p.data;
var nb = n > buf.length ? buf.length : n;
buf.copy(ret, ret.length - n, 0, nb);
n -= nb;
if (n === 0) {
if (nb === buf.length) {
++c;
if (p.next) list.head = p.next;else list.head = list.tail = null;
} else {
list.head = p;
p.data = buf.slice(nb);
}
break;
}
++c;
}
list.length -= c;
return ret;
}
function endReadable(stream) {
var state = stream._readableState;
// If we get here before consuming all the bytes, then that is a
// bug in node. Should never happen.
if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
if (!state.endEmitted) {
state.ended = true;
pna.nextTick(endReadableNT, state, stream);
}
}
function endReadableNT(state, stream) {
// Check that we didn't get one last unshift.
if (!state.endEmitted && state.length === 0) {
state.endEmitted = true;
stream.readable = false;
stream.emit('end');
}
}
function indexOf(xs, x) {
for (var i = 0, l = xs.length; i < l; i++) {
if (xs[i] === x) return i;
}
return -1;
}
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./_stream_duplex":452,"./internal/streams/BufferList":457,"./internal/streams/destroy":458,"./internal/streams/stream":459,"_process":451,"core-util-is":442,"events":440,"inherits":446,"isarray":448,"process-nextick-args":450,"safe-buffer":461,"string_decoder/":462,"util":439}],455:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a transform stream is a readable/writable stream where you do
// something with the data. Sometimes it's called a "filter",
// but that's not a great name for it, since that implies a thing where
// some bits pass through, and others are simply ignored. (That would
// be a valid example of a transform, of course.)
//
// While the output is causally related to the input, it's not a
// necessarily symmetric or synchronous transformation. For example,
// a zlib stream might take multiple plain-text writes(), and then
// emit a single compressed chunk some time in the future.
//
// Here's how this works:
//
// The Transform stream has all the aspects of the readable and writable
// stream classes. When you write(chunk), that calls _write(chunk,cb)
// internally, and returns false if there's a lot of pending writes
// buffered up. When you call read(), that calls _read(n) until
// there's enough pending readable data buffered up.
//
// In a transform stream, the written data is placed in a buffer. When
// _read(n) is called, it transforms the queued up data, calling the
// buffered _write cb's as it consumes chunks. If consuming a single
// written chunk would result in multiple output chunks, then the first
// outputted bit calls the readcb, and subsequent chunks just go into
// the read buffer, and will cause it to emit 'readable' if necessary.
//
// This way, back-pressure is actually determined by the reading side,
// since _read has to be called to start processing a new chunk. However,
// a pathological inflate type of transform can cause excessive buffering
// here. For example, imagine a stream where every byte of input is
// interpreted as an integer from 0-255, and then results in that many
// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
// 1kb of data being output. In this case, you could write a very small
// amount of input, and end up with a very large amount of output. In
// such a pathological inflating mechanism, there'd be no way to tell
// the system to stop doing the transform. A single 4MB write could
// cause the system to run out of memory.
//
// However, even in such a pathological case, only a single written chunk
// would be consumed, and then the rest would wait (un-transformed) until
// the results of the previous transformed chunk were consumed.
'use strict';
module.exports = Transform;
var Duplex = require('./_stream_duplex');
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
util.inherits(Transform, Duplex);
function afterTransform(er, data) {
var ts = this._transformState;
ts.transforming = false;
var cb = ts.writecb;
if (!cb) {
return this.emit('error', new Error('write callback called multiple times'));
}
ts.writechunk = null;
ts.writecb = null;
if (data != null) // single equals check for both `null` and `undefined`
this.push(data);
cb(er);
var rs = this._readableState;
rs.reading = false;
if (rs.needReadable || rs.length < rs.highWaterMark) {
this._read(rs.highWaterMark);
}
}
function Transform(options) {
if (!(this instanceof Transform)) return new Transform(options);
Duplex.call(this, options);
this._transformState = {
afterTransform: afterTransform.bind(this),
needTransform: false,
transforming: false,
writecb: null,
writechunk: null,
writeencoding: null
};
// start out asking for a readable event once data is transformed.
this._readableState.needReadable = true;
// we have implemented the _read method, and done the other things
// that Readable wants before the first _read call, so unset the
// sync guard flag.
this._readableState.sync = false;
if (options) {
if (typeof options.transform === 'function') this._transform = options.transform;
if (typeof options.flush === 'function') this._flush = options.flush;
}
// When the writable side finishes, then flush out anything remaining.
this.on('prefinish', prefinish);
}
function prefinish() {
var _this = this;
if (typeof this._flush === 'function') {
this._flush(function (er, data) {
done(_this, er, data);
});
} else {
done(this, null, null);
}
}
Transform.prototype.push = function (chunk, encoding) {
this._transformState.needTransform = false;
return Duplex.prototype.push.call(this, chunk, encoding);
};
// This is the part where you do stuff!
// override this function in implementation classes.
// 'chunk' is an input chunk.
//
// Call `push(newChunk)` to pass along transformed output
// to the readable side. You may call 'push' zero or more times.
//
// Call `cb(err)` when you are done with this chunk. If you pass
// an error, then that'll put the hurt on the whole operation. If you
// never call cb(), then you'll never get another chunk.
Transform.prototype._transform = function (chunk, encoding, cb) {
throw new Error('_transform() is 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);
}
};
// Doesn't matter what the args are here.
// _transform does all the work.
// That we got here means that the readable side wants more data.
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 {
// mark that we need a transform, so that any data that comes in
// will get processed, now that we've asked for it.
ts.needTransform = true;
}
};
Transform.prototype._destroy = function (err, cb) {
var _this2 = this;
Duplex.prototype._destroy.call(this, err, function (err2) {
cb(err2);
_this2.emit('close');
});
};
function done(stream, er, data) {
if (er) return stream.emit('error', er);
if (data != null) // single equals check for both `null` and `undefined`
stream.push(data);
// if there's nothing in the write buffer, then that means
// that nothing more will ever be provided
if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
return stream.push(null);
}
},{"./_stream_duplex":452,"core-util-is":442,"inherits":446}],456:[function(require,module,exports){
(function (process,global,setImmediate){(function (){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// A bit simpler than readable streams.
// Implement an async ._write(chunk, encoding, cb), and it'll handle all
// the drain event emission and buffering.
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
module.exports = Writable;
/* <replacement> */
function WriteReq(chunk, encoding, cb) {
this.chunk = chunk;
this.encoding = encoding;
this.callback = cb;
this.next = null;
}
// It seems a linked list but it is not
// there will be only 2 of these for each stream
function CorkedRequest(state) {
var _this = this;
this.next = null;
this.entry = null;
this.finish = function () {
onCorkedFinish(_this, state);
};
}
/* </replacement> */
/*<replacement>*/
var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
/*</replacement>*/
/*<replacement>*/
var Duplex;
/*</replacement>*/
Writable.WritableState = WritableState;
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
/*<replacement>*/
var internalUtil = {
deprecate: require('util-deprecate')
};
/*</replacement>*/
/*<replacement>*/
var Stream = require('./internal/streams/stream');
/*</replacement>*/
/*<replacement>*/
var Buffer = require('safe-buffer').Buffer;
var OurUint8Array = global.Uint8Array || function () {};
function _uint8ArrayToBuffer(chunk) {
return Buffer.from(chunk);
}
function _isUint8Array(obj) {
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
}
/*</replacement>*/
var destroyImpl = require('./internal/streams/destroy');
util.inherits(Writable, Stream);
function nop() {}
function WritableState(options, stream) {
Duplex = Duplex || require('./_stream_duplex');
options = options || {};
// Duplex streams are both readable and writable, but share
// the same options object.
// However, some cases require setting options to different
// values for the readable and the writable sides of the duplex stream.
// These options can be provided separately as readableXXX and writableXXX.
var isDuplex = stream instanceof Duplex;
// object stream flag to indicate whether or not this stream
// contains buffers or objects.
this.objectMode = !!options.objectMode;
if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
// the point at which write() starts returning false
// Note: 0 is a valid value, means that we always return false if
// the entire buffer is not flushed immediately on write()
var hwm = options.highWaterMark;
var writableHwm = options.writableHighWaterMark;
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
// cast to ints.
this.highWaterMark = Math.floor(this.highWaterMark);
// if _final has been called
this.finalCalled = false;
// drain event flag.
this.needDrain = false;
// at the start of calling end()
this.ending = false;
// when end() has been called, and returned
this.ended = false;
// when 'finish' is emitted
this.finished = false;
// has it been destroyed
this.destroyed = false;
// should we decode strings into buffers before passing to _write?
// this is here so that some node-core streams can optimize string
// handling at a lower level.
var noDecode = options.decodeStrings === false;
this.decodeStrings = !noDecode;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// not an actual buffer we keep track of, but a measurement
// of how much we're waiting to get pushed to some underlying
// socket or file.
this.length = 0;
// a flag to see when we're in the middle of a write.
this.writing = false;
// when true all writes will be buffered until .uncork() call
this.corked = 0;
// a flag to be able to tell if the onwrite cb is called immediately,
// or on a later tick. We set this to true at first, because any
// actions that shouldn't happen until "later" should generally also
// not happen before the first write call.
this.sync = true;
// a flag to know if we're processing previously buffered items, which
// may call the _write() callback in the same tick, so that we don't
// end up in an overlapped onwrite situation.
this.bufferProcessing = false;
// the callback that's passed to _write(chunk,cb)
this.onwrite = function (er) {
onwrite(stream, er);
};
// the callback that the user supplies to write(chunk,encoding,cb)
this.writecb = null;
// the amount that is being written when _write is called.
this.writelen = 0;
this.bufferedRequest = null;
this.lastBufferedRequest = null;
// number of pending user-supplied write callbacks
// this must be 0 before 'finish' can be emitted
this.pendingcb = 0;
// emit prefinish if the only thing we're waiting for is _write cbs
// This is relevant for synchronous Transform streams
this.prefinished = false;
// True if the error was already emitted and should not be thrown again
this.errorEmitted = false;
// count buffered requests
this.bufferedRequestCount = 0;
// allocate the first CorkedRequest, there is always
// one allocated and free to use, and we maintain at most two
this.corkedRequestsFree = new CorkedRequest(this);
}
WritableState.prototype.getBuffer = function getBuffer() {
var current = this.bufferedRequest;
var out = [];
while (current) {
out.push(current);
current = current.next;
}
return out;
};
(function () {
try {
Object.defineProperty(WritableState.prototype, 'buffer', {
get: internalUtil.deprecate(function () {
return this.getBuffer();
}, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
});
} catch (_) {}
})();
// Test _writableState for inheritance to account for Duplex streams,
// whose prototype chain only points to Readable.
var realHasInstance;
if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
realHasInstance = Function.prototype[Symbol.hasInstance];
Object.defineProperty(Writable, Symbol.hasInstance, {
value: function (object) {
if (realHasInstance.call(this, object)) return true;
if (this !== Writable) return false;
return object && object._writableState instanceof WritableState;
}
});
} else {
realHasInstance = function (object) {
return object instanceof this;
};
}
function Writable(options) {
Duplex = Duplex || require('./_stream_duplex');
// Writable ctor is applied to Duplexes, too.
// `realHasInstance` is necessary because using plain `instanceof`
// would return false, as no `_writableState` property is attached.
// Trying to use the custom `instanceof` for Writable here will also break the
// Node.js LazyTransform implementation, which has a non-trivial getter for
// `_writableState` that would lead to infinite recursion.
if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
return new Writable(options);
}
this._writableState = new WritableState(options, this);
// legacy.
this.writable = true;
if (options) {
if (typeof options.write === 'function') this._write = options.write;
if (typeof options.writev === 'function') this._writev = options.writev;
if (typeof options.destroy === 'function') this._destroy = options.destroy;
if (typeof options.final === 'function') this._final = options.final;
}
Stream.call(this);
}
// Otherwise people can pipe Writable streams, which is just wrong.
Writable.prototype.pipe = function () {
this.emit('error', new Error('Cannot pipe, not readable'));
};
function writeAfterEnd(stream, cb) {
var er = new Error('write after end');
// TODO: defer error events consistently everywhere, not just the cb
stream.emit('error', er);
pna.nextTick(cb, er);
}
// Checks that a user-supplied chunk is valid, especially for the particular
// mode the stream is in. Currently this means that `null` is never accepted
// and undefined/non-string values are only allowed in object mode.
function validChunk(stream, state, chunk, cb) {
var valid = true;
var er = false;
if (chunk === null) {
er = new TypeError('May not write null values to stream');
} else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
er = new TypeError('Invalid non-string/buffer chunk');
}
if (er) {
stream.emit('error', er);
pna.nextTick(cb, er);
valid = false;
}
return valid;
}
Writable.prototype.write = function (chunk, encoding, cb) {
var state = this._writableState;
var ret = false;
var isBuf = !state.objectMode && _isUint8Array(chunk);
if (isBuf && !Buffer.isBuffer(chunk)) {
chunk = _uint8ArrayToBuffer(chunk);
}
if (typeof encoding === 'function') {
cb = encoding;
encoding = null;
}
if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
if (typeof cb !== 'function') cb = nop;
if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
state.pendingcb++;
ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
}
return ret;
};
Writable.prototype.cork = function () {
var state = this._writableState;
state.corked++;
};
Writable.prototype.uncork = function () {
var state = this._writableState;
if (state.corked) {
state.corked--;
if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
}
};
Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
// node::ParseEncoding() requires lower case.
if (typeof encoding === 'string') encoding = encoding.toLowerCase();
if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
this._writableState.defaultEncoding = encoding;
return this;
};
function decodeChunk(state, chunk, encoding) {
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
chunk = Buffer.from(chunk, encoding);
}
return chunk;
}
Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._writableState.highWaterMark;
}
});
// if we're already writing something, then just put this
// in the queue, and wait our turn. Otherwise, call _write
// If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
if (!isBuf) {
var newChunk = decodeChunk(state, chunk, encoding);
if (chunk !== newChunk) {
isBuf = true;
encoding = 'buffer';
chunk = newChunk;
}
}
var len = state.objectMode ? 1 : chunk.length;
state.length += len;
var ret = state.length < state.highWaterMark;
// we must ensure that previous needDrain will not be reset to false.
if (!ret) state.needDrain = true;
if (state.writing || state.corked) {
var last = state.lastBufferedRequest;
state.lastBufferedRequest = {
chunk: chunk,
encoding: encoding,
isBuf: isBuf,
callback: cb,
next: null
};
if (last) {
last.next = state.lastBufferedRequest;
} else {
state.bufferedRequest = state.lastBufferedRequest;
}
state.bufferedRequestCount += 1;
} else {
doWrite(stream, state, false, len, chunk, encoding, cb);
}
return ret;
}
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
state.writelen = len;
state.writecb = cb;
state.writing = true;
state.sync = true;
if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
state.sync = false;
}
function onwriteError(stream, state, sync, er, cb) {
--state.pendingcb;
if (sync) {
// defer the callback if we are being called synchronously
// to avoid piling up things on the stack
pna.nextTick(cb, er);
// this can emit finish, and it will always happen
// after error
pna.nextTick(finishMaybe, stream, state);
stream._writableState.errorEmitted = true;
stream.emit('error', er);
} else {
// the caller expect this to happen before if
// it is async
cb(er);
stream._writableState.errorEmitted = true;
stream.emit('error', er);
// this can emit finish, but finish must
// always follow error
finishMaybe(stream, state);
}
}
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 {
// Check if we're actually ready to finish, but don't emit yet
var finished = needFinish(state);
if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
clearBuffer(stream, state);
}
if (sync) {
/*<replacement>*/
asyncWrite(afterWrite, stream, state, finished, cb);
/*</replacement>*/
} else {
afterWrite(stream, state, finished, cb);
}
}
}
function afterWrite(stream, state, finished, cb) {
if (!finished) onwriteDrain(stream, state);
state.pendingcb--;
cb();
finishMaybe(stream, state);
}
// Must force callback to be called on nextTick, so that we don't
// emit 'drain' before the write() consumer gets the 'false' return
// value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) {
if (state.length === 0 && state.needDrain) {
state.needDrain = false;
stream.emit('drain');
}
}
// if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) {
state.bufferProcessing = true;
var entry = state.bufferedRequest;
if (stream._writev && entry && entry.next) {
// Fast case, write everything using _writev()
var l = state.bufferedRequestCount;
var buffer = new Array(l);
var holder = state.corkedRequestsFree;
holder.entry = entry;
var count = 0;
var allBuffers = true;
while (entry) {
buffer[count] = entry;
if (!entry.isBuf) allBuffers = false;
entry = entry.next;
count += 1;
}
buffer.allBuffers = allBuffers;
doWrite(stream, state, true, state.length, buffer, '', holder.finish);
// doWrite is almost always async, defer these to save a bit of time
// as the hot path ends with doWrite
state.pendingcb++;
state.lastBufferedRequest = null;
if (holder.next) {
state.corkedRequestsFree = holder.next;
holder.next = null;
} else {
state.corkedRequestsFree = new CorkedRequest(state);
}
state.bufferedRequestCount = 0;
} else {
// Slow case, write chunks one-by-one
while (entry) {
var chunk = entry.chunk;
var encoding = entry.encoding;
var cb = entry.callback;
var len = state.objectMode ? 1 : chunk.length;
doWrite(stream, state, false, len, chunk, encoding, cb);
entry = entry.next;
state.bufferedRequestCount--;
// if we didn't call the onwrite immediately, then
// it means that we need to wait until it does.
// also, that means that the chunk and cb are currently
// being processed, so move the buffer counter past them.
if (state.writing) {
break;
}
}
if (entry === null) state.lastBufferedRequest = null;
}
state.bufferedRequest = entry;
state.bufferProcessing = false;
}
Writable.prototype._write = function (chunk, encoding, cb) {
cb(new Error('_write() is not implemented'));
};
Writable.prototype._writev = null;
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 (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
// .end() fully uncorks
if (state.corked) {
state.corked = 1;
this.uncork();
}
// ignore unnecessary end() calls.
if (!state.ending && !state.finished) endWritable(this, state, cb);
};
function needFinish(state) {
return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
}
function callFinal(stream, state) {
stream._final(function (err) {
state.pendingcb--;
if (err) {
stream.emit('error', err);
}
state.prefinished = true;
stream.emit('prefinish');
finishMaybe(stream, state);
});
}
function prefinish(stream, state) {
if (!state.prefinished && !state.finalCalled) {
if (typeof stream._final === 'function') {
state.pendingcb++;
state.finalCalled = true;
pna.nextTick(callFinal, stream, state);
} else {
state.prefinished = true;
stream.emit('prefinish');
}
}
}
function finishMaybe(stream, state) {
var need = needFinish(state);
if (need) {
prefinish(stream, state);
if (state.pendingcb === 0) {
state.finished = true;
stream.emit('finish');
}
}
return need;
}
function endWritable(stream, state, cb) {
state.ending = true;
finishMaybe(stream, state);
if (cb) {
if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
}
state.ended = true;
stream.writable = false;
}
function onCorkedFinish(corkReq, state, err) {
var entry = corkReq.entry;
corkReq.entry = null;
while (entry) {
var cb = entry.callback;
state.pendingcb--;
cb(err);
entry = entry.next;
}
if (state.corkedRequestsFree) {
state.corkedRequestsFree.next = corkReq;
} else {
state.corkedRequestsFree = corkReq;
}
}
Object.defineProperty(Writable.prototype, 'destroyed', {
get: function () {
if (this._writableState === undefined) {
return false;
}
return this._writableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (!this._writableState) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._writableState.destroyed = value;
}
});
Writable.prototype.destroy = destroyImpl.destroy;
Writable.prototype._undestroy = destroyImpl.undestroy;
Writable.prototype._destroy = function (err, cb) {
this.end();
cb(err);
};
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate)
},{"./_stream_duplex":452,"./internal/streams/destroy":458,"./internal/streams/stream":459,"_process":451,"core-util-is":442,"inherits":446,"process-nextick-args":450,"safe-buffer":461,"timers":463,"util-deprecate":464}],457:[function(require,module,exports){
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Buffer = require('safe-buffer').Buffer;
var util = require('util');
function copyBuffer(src, target, offset) {
src.copy(target, offset);
}
module.exports = function () {
function BufferList() {
_classCallCheck(this, BufferList);
this.head = null;
this.tail = null;
this.length = 0;
}
BufferList.prototype.push = function push(v) {
var entry = { data: v, next: null };
if (this.length > 0) this.tail.next = entry;else this.head = entry;
this.tail = entry;
++this.length;
};
BufferList.prototype.unshift = function unshift(v) {
var entry = { data: v, next: this.head };
if (this.length === 0) this.tail = entry;
this.head = entry;
++this.length;
};
BufferList.prototype.shift = function shift() {
if (this.length === 0) return;
var ret = this.head.data;
if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
--this.length;
return ret;
};
BufferList.prototype.clear = function clear() {
this.head = this.tail = null;
this.length = 0;
};
BufferList.prototype.join = function join(s) {
if (this.length === 0) return '';
var p = this.head;
var ret = '' + p.data;
while (p = p.next) {
ret += s + p.data;
}return ret;
};
BufferList.prototype.concat = function concat(n) {
if (this.length === 0) return Buffer.alloc(0);
if (this.length === 1) return this.head.data;
var ret = Buffer.allocUnsafe(n >>> 0);
var p = this.head;
var i = 0;
while (p) {
copyBuffer(p.data, ret, i);
i += p.data.length;
p = p.next;
}
return ret;
};
return BufferList;
}();
if (util && util.inspect && util.inspect.custom) {
module.exports.prototype[util.inspect.custom] = function () {
var obj = util.inspect({ length: this.length });
return this.constructor.name + ' ' + obj;
};
}
},{"safe-buffer":461,"util":439}],458:[function(require,module,exports){
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
// undocumented cb() API, needed for core, not for public API
function destroy(err, cb) {
var _this = this;
var readableDestroyed = this._readableState && this._readableState.destroyed;
var writableDestroyed = this._writableState && this._writableState.destroyed;
if (readableDestroyed || writableDestroyed) {
if (cb) {
cb(err);
} else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
pna.nextTick(emitErrorNT, this, err);
}
return this;
}
// we set destroyed to true before firing error callbacks in order
// to make it re-entrance safe in case destroy() is called within callbacks
if (this._readableState) {
this._readableState.destroyed = true;
}
// if this is a duplex stream mark the writable part as destroyed as well
if (this._writableState) {
this._writableState.destroyed = true;
}
this._destroy(err || null, function (err) {
if (!cb && err) {
pna.nextTick(emitErrorNT, _this, err);
if (_this._writableState) {
_this._writableState.errorEmitted = true;
}
} else if (cb) {
cb(err);
}
});
return this;
}
function undestroy() {
if (this._readableState) {
this._readableState.destroyed = false;
this._readableState.reading = false;
this._readableState.ended = false;
this._readableState.endEmitted = false;
}
if (this._writableState) {
this._writableState.destroyed = false;
this._writableState.ended = false;
this._writableState.ending = false;
this._writableState.finished = false;
this._writableState.errorEmitted = false;
}
}
function emitErrorNT(self, err) {
self.emit('error', err);
}
module.exports = {
destroy: destroy,
undestroy: undestroy
};
},{"process-nextick-args":450}],459:[function(require,module,exports){
module.exports = require('events').EventEmitter;
},{"events":440}],460:[function(require,module,exports){
exports = module.exports = require('./lib/_stream_readable.js');
exports.Stream = exports;
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":452,"./lib/_stream_passthrough.js":453,"./lib/_stream_readable.js":454,"./lib/_stream_transform.js":455,"./lib/_stream_writable.js":456}],461:[function(require,module,exports){
/* eslint-disable node/no-deprecated-api */
var buffer = require('buffer')
var Buffer = buffer.Buffer
// alternative to using Object.keys for old browsers
function copyProps (src, dst) {
for (var key in src) {
dst[key] = src[key]
}
}
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
module.exports = buffer
} else {
// Copy properties from require('buffer')
copyProps(buffer, exports)
exports.Buffer = SafeBuffer
}
function SafeBuffer (arg, encodingOrOffset, length) {
return Buffer(arg, encodingOrOffset, length)
}
// Copy static methods from Buffer
copyProps(Buffer, SafeBuffer)
SafeBuffer.from = function (arg, encodingOrOffset, length) {
if (typeof arg === 'number') {
throw new TypeError('Argument must not be a number')
}
return Buffer(arg, encodingOrOffset, length)
}
SafeBuffer.alloc = function (size, fill, encoding) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
var buf = Buffer(size)
if (fill !== undefined) {
if (typeof encoding === 'string') {
buf.fill(fill, encoding)
} else {
buf.fill(fill)
}
} else {
buf.fill(0)
}
return buf
}
SafeBuffer.allocUnsafe = function (size) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
return Buffer(size)
}
SafeBuffer.allocUnsafeSlow = function (size) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
return buffer.SlowBuffer(size)
}
},{"buffer":441}],462:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
/*<replacement>*/
var Buffer = require('safe-buffer').Buffer;
/*</replacement>*/
var isEncoding = Buffer.isEncoding || function (encoding) {
encoding = '' + 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 _normalizeEncoding(enc) {
if (!enc) return 'utf8';
var retried;
while (true) {
switch (enc) {
case 'utf8':
case 'utf-8':
return 'utf8';
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return 'utf16le';
case 'latin1':
case 'binary':
return 'latin1';
case 'base64':
case 'ascii':
case 'hex':
return enc;
default:
if (retried) return; // undefined
enc = ('' + enc).toLowerCase();
retried = true;
}
}
};
// Do not cache `Buffer.isEncoding` when checking encoding names as some
// modules monkey-patch it to support additional encodings
function normalizeEncoding(enc) {
var nenc = _normalizeEncoding(enc);
if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
return nenc || enc;
}
// StringDecoder provides an interface for efficiently splitting a series of
// buffers into a series of JS strings without breaking apart multi-byte
// characters.
exports.StringDecoder = StringDecoder;
function StringDecoder(encoding) {
this.encoding = normalizeEncoding(encoding);
var nb;
switch (this.encoding) {
case 'utf16le':
this.text = utf16Text;
this.end = utf16End;
nb = 4;
break;
case 'utf8':
this.fillLast = utf8FillLast;
nb = 4;
break;
case 'base64':
this.text = base64Text;
this.end = base64End;
nb = 3;
break;
default:
this.write = simpleWrite;
this.end = simpleEnd;
return;
}
this.lastNeed = 0;
this.lastTotal = 0;
this.lastChar = Buffer.allocUnsafe(nb);
}
StringDecoder.prototype.write = function (buf) {
if (buf.length === 0) return '';
var r;
var i;
if (this.lastNeed) {
r = this.fillLast(buf);
if (r === undefined) return '';
i = this.lastNeed;
this.lastNeed = 0;
} else {
i = 0;
}
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
return r || '';
};
StringDecoder.prototype.end = utf8End;
// Returns only complete characters in a Buffer
StringDecoder.prototype.text = utf8Text;
// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
StringDecoder.prototype.fillLast = function (buf) {
if (this.lastNeed <= buf.length) {
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
}
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
this.lastNeed -= buf.length;
};
// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
// continuation byte. If an invalid byte is detected, -2 is returned.
function utf8CheckByte(byte) {
if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
return byte >> 6 === 0x02 ? -1 : -2;
}
// Checks at most 3 bytes at the end of a Buffer in order to detect an
// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
// needed to complete the UTF-8 character (if applicable) are returned.
function utf8CheckIncomplete(self, buf, i) {
var j = buf.length - 1;
if (j < i) return 0;
var nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) self.lastNeed = nb - 1;
return nb;
}
if (--j < i || nb === -2) return 0;
nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) self.lastNeed = nb - 2;
return nb;
}
if (--j < i || nb === -2) return 0;
nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) {
if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
}
return nb;
}
return 0;
}
// Validates as many continuation bytes for a multi-byte UTF-8 character as
// needed or are available. If we see a non-continuation byte where we expect
// one, we "replace" the validated continuation bytes we've seen so far with
// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
// behavior. The continuation byte check is included three times in the case
// where all of the continuation bytes for a character exist in the same buffer.
// It is also done this way as a slight performance increase instead of using a
// loop.
function utf8CheckExtraBytes(self, buf, p) {
if ((buf[0] & 0xC0) !== 0x80) {
self.lastNeed = 0;
return '\ufffd';
}
if (self.lastNeed > 1 && buf.length > 1) {
if ((buf[1] & 0xC0) !== 0x80) {
self.lastNeed = 1;
return '\ufffd';
}
if (self.lastNeed > 2 && buf.length > 2) {
if ((buf[2] & 0xC0) !== 0x80) {
self.lastNeed = 2;
return '\ufffd';
}
}
}
}
// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
function utf8FillLast(buf) {
var p = this.lastTotal - this.lastNeed;
var r = utf8CheckExtraBytes(this, buf, p);
if (r !== undefined) return r;
if (this.lastNeed <= buf.length) {
buf.copy(this.lastChar, p, 0, this.lastNeed);
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
}
buf.copy(this.lastChar, p, 0, buf.length);
this.lastNeed -= buf.length;
}
// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
// partial character, the character's bytes are buffered until the required
// number of bytes are available.
function utf8Text(buf, i) {
var total = utf8CheckIncomplete(this, buf, i);
if (!this.lastNeed) return buf.toString('utf8', i);
this.lastTotal = total;
var end = buf.length - (total - this.lastNeed);
buf.copy(this.lastChar, 0, end);
return buf.toString('utf8', i, end);
}
// For UTF-8, a replacement character is added when ending on a partial
// character.
function utf8End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) return r + '\ufffd';
return r;
}
// UTF-16LE typically needs two bytes per character, but even if we have an even
// number of bytes available, we need to check if we end on a leading/high
// surrogate. In that case, we need to wait for the next two bytes in order to
// decode the last character properly.
function utf16Text(buf, i) {
if ((buf.length - i) % 2 === 0) {
var r = buf.toString('utf16le', i);
if (r) {
var c = r.charCodeAt(r.length - 1);
if (c >= 0xD800 && c <= 0xDBFF) {
this.lastNeed = 2;
this.lastTotal = 4;
this.lastChar[0] = buf[buf.length - 2];
this.lastChar[1] = buf[buf.length - 1];
return r.slice(0, -1);
}
}
return r;
}
this.lastNeed = 1;
this.lastTotal = 2;
this.lastChar[0] = buf[buf.length - 1];
return buf.toString('utf16le', i, buf.length - 1);
}
// For UTF-16LE we do not explicitly append special replacement characters if we
// end on a partial character, we simply let v8 handle that.
function utf16End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) {
var end = this.lastTotal - this.lastNeed;
return r + this.lastChar.toString('utf16le', 0, end);
}
return r;
}
function base64Text(buf, i) {
var n = (buf.length - i) % 3;
if (n === 0) return buf.toString('base64', i);
this.lastNeed = 3 - n;
this.lastTotal = 3;
if (n === 1) {
this.lastChar[0] = buf[buf.length - 1];
} else {
this.lastChar[0] = buf[buf.length - 2];
this.lastChar[1] = buf[buf.length - 1];
}
return buf.toString('base64', i, buf.length - n);
}
function base64End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
return r;
}
// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
function simpleWrite(buf) {
return buf.toString(this.encoding);
}
function simpleEnd(buf) {
return buf && buf.length ? this.write(buf) : '';
}
},{"safe-buffer":461}],463:[function(require,module,exports){
(function (setImmediate,clearImmediate){(function (){
var nextTick = require('process/browser.js').nextTick;
var apply = Function.prototype.apply;
var slice = Array.prototype.slice;
var immediateIds = {};
var nextImmediateId = 0;
// DOM APIs, for completeness
exports.setTimeout = function() {
return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
};
exports.setInterval = function() {
return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
};
exports.clearTimeout =
exports.clearInterval = function(timeout) { timeout.close(); };
function Timeout(id, clearFn) {
this._id = id;
this._clearFn = clearFn;
}
Timeout.prototype.unref = Timeout.prototype.ref = function() {};
Timeout.prototype.close = function() {
this._clearFn.call(window, this._id);
};
// Does not start the time, just sets up the members needed.
exports.enroll = function(item, msecs) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = msecs;
};
exports.unenroll = function(item) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = -1;
};
exports._unrefActive = exports.active = function(item) {
clearTimeout(item._idleTimeoutId);
var msecs = item._idleTimeout;
if (msecs >= 0) {
item._idleTimeoutId = setTimeout(function onTimeout() {
if (item._onTimeout)
item._onTimeout();
}, msecs);
}
};
// That's not how node.js implements it but the exposed api is the same.
exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) {
var id = nextImmediateId++;
var args = arguments.length < 2 ? false : slice.call(arguments, 1);
immediateIds[id] = true;
nextTick(function onNextTick() {
if (immediateIds[id]) {
// fn.call() is faster so we optimize for the common use-case
// @see http://jsperf.com/call-apply-segu
if (args) {
fn.apply(null, args);
} else {
fn.call(null);
}
// Prevent ids from leaking
exports.clearImmediate(id);
}
});
return id;
};
exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) {
delete immediateIds[id];
};
}).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate)
},{"process/browser.js":451,"timers":463}],464:[function(require,module,exports){
(function (global){(function (){
/**
* Module exports.
*/
module.exports = deprecate;
/**
* Mark that a method should not be used.
* Returns a modified function which warns once by default.
*
* If `localStorage.noDeprecation = true` is set, then it is a no-op.
*
* If `localStorage.throwDeprecation = true` is set, then deprecated functions
* will throw an Error when invoked.
*
* If `localStorage.traceDeprecation = true` is set, then deprecated functions
* will invoke `console.trace()` instead of `console.error()`.
*
* @param {Function} fn - the function to deprecate
* @param {String} msg - the string to print to the console when `fn` is invoked
* @returns {Function} a new "deprecated" version of `fn`
* @api public
*/
function deprecate (fn, msg) {
if (config('noDeprecation')) {
return fn;
}
var warned = false;
function deprecated() {
if (!warned) {
if (config('throwDeprecation')) {
throw new Error(msg);
} else if (config('traceDeprecation')) {
console.trace(msg);
} else {
console.warn(msg);
}
warned = true;
}
return fn.apply(this, arguments);
}
return deprecated;
}
/**
* Checks `localStorage` for boolean values for the given `name`.
*
* @param {String} name
* @returns {Boolean}
* @api private
*/
function config (name) {
// accessing global.localStorage can trigger a DOMException in sandboxed iframes
try {
if (!global.localStorage) return false;
} catch (_) {
return false;
}
var val = global.localStorage[name];
if (null == val) return false;
return String(val).toLowerCase() === 'true';
}
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[260]);
|
packages/cf-component-card/src/CardControl.js | koddsson/cf-ui | import React from 'react';
import PropTypes from 'prop-types';
class CardControl extends React.Component {
render() {
const className =
'cf-card__control' + (this.props.wide ? ' cf-card__control--wide' : '');
return (
<div className={className}>
{this.props.children}
</div>
);
}
}
CardControl.propTypes = {
children: PropTypes.node,
wide: PropTypes.bool
};
export default CardControl;
|
src/pages/About.js | kevoree-modeling/mwg.web.boilerplate | import React, { Component } from 'react';
import Menu from '../components/Menu'
class About extends Component {
render() {
return (
<div>
<span>Tutu</span>
<Menu></Menu>
<span>This is page about</span>
</div>
)
}
}
export default About;
|
node_modules/react-icons/lib/io/cash.js | bengimbel/Solstice-React-Contacts-Project | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: 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 _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactIconBase = require('react-icon-base');
var _reactIconBase2 = _interopRequireDefault(_reactIconBase);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var IoCash = function IoCash(props) {
return _react2.default.createElement(
_reactIconBase2.default,
_extends({ viewBox: '0 0 40 40' }, props),
_react2.default.createElement(
'g',
null,
_react2.default.createElement('path', { d: 'm0 7.5h40v20h-40v-20z m15.1 17.5c-1.6-1.8-2.6-4.5-2.6-7.5s1-5.7 2.6-7.5h-7.6c0 2.7-2.3 5-5 5v6.3c2.1 0 3.8 1.6 3.8 3.7h8.8z m8.2-4.6c0.2-0.3 0.3-0.7 0.3-1.2 0-0.2 0-0.4-0.1-0.6s-0.1-0.5-0.3-0.6-0.3-0.3-0.5-0.5-0.5-0.3-0.8-0.4c-0.1 0-0.3-0.1-0.6-0.1s-0.4 0-0.6-0.1v-2.4c0.2 0 0.4 0.1 0.6 0.2 0.3 0.2 0.4 0.5 0.5 1h1.6c0-0.4-0.2-0.7-0.4-1s-0.3-0.6-0.7-0.9-0.7-0.4-1-0.4c-0.2-0.1-0.4-0.2-0.6-0.2v-0.7h-1.4v0.7c-0.2 0-0.3 0.1-0.5 0.2-0.4 0-0.8 0.1-1.1 0.3s-0.5 0.5-0.7 0.8-0.3 0.7-0.3 1.1c0 0.3 0 0.4 0.1 0.6s0.2 0.4 0.3 0.6 0.4 0.4 0.6 0.5 0.6 0.4 1 0.4c0.2 0.1 0.4 0 0.6 0.1v2.7c-0.2 0-0.5-0.1-0.7-0.3s-0.4-0.3-0.5-0.5-0.1-0.5-0.1-0.7h-1.6c0 0.4 0.2 0.8 0.3 1.2 0.3 0.4 0.5 0.7 0.8 0.9s0.7 0.5 1.2 0.5c0.2 0.1 0.4 0.2 0.6 0.2v0.7h1.4v-0.7c0.2 0 0.5-0.1 0.7-0.2 0.4 0 0.8-0.1 1.1-0.4s0.5-0.5 0.8-0.8z m14.2 0.9v-6.3c-2.7 0-5-2.3-5-5h-7.6c1.6 1.8 2.6 4.5 2.6 7.5s-1 5.7-2.6 7.5h8.9c0-2.1 1.7-3.7 3.7-3.7z m-32.5-3.8c0-1.6 0.9-2.5 2.5-2.5s2.5 0.9 2.5 2.5-0.9 2.5-2.5 2.5-2.5-0.9-2.5-2.5z m25 0c0-1.6 0.9-2.5 2.5-2.5s2.5 0.9 2.5 2.5-0.9 2.5-2.5 2.5-2.5-0.9-2.5-2.5z m-8.7 0.9c0.2 0 0.3 0.1 0.5 0.3s0.2 0.4 0.2 0.7c0 0.1 0 0.3 0 0.4s-0.2 0.4-0.4 0.4-0.3 0.3-0.6 0.3c-0.1 0-0.1 0.1-0.3 0.1v-2.4c0.2 0.1 0.5 0.1 0.6 0.2z m-2.9-3.5c0.1-0.1 0.3-0.2 0.4-0.3s0.3-0.1 0.5-0.1v2c-0.3-0.1-0.5-0.3-0.7-0.4s-0.3-0.3-0.3-0.6c0-0.3 0.1-0.4 0.1-0.6z m-18.4 17.6v-2.5h40v2.5h-40z' })
)
);
};
exports.default = IoCash;
module.exports = exports['default']; |
examples/auth-with-shared-root/components/Dashboard.js | tylermcginnis/react-router | import React from 'react'
import auth from '../utils/auth'
const Dashboard = React.createClass({
render() {
const token = auth.getToken()
return (
<div>
<h1>Dashboard</h1>
<p>You made it!</p>
<p>{token}</p>
{this.props.children}
</div>
)
}
})
module.exports = Dashboard
|
nlyyAPP/component/停止入组/单个中心/MLDshlb.js | a497500306/nlyy_APP |
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
TouchableOpacity,
Navigator,
ListView,
Alert
} from 'react-native';
//时间操作
var moment = require('moment');
moment().format();
var MLNavigatorBar = require('../../MLNavigatorBar/MLNavigatorBar');
var Users = require('../../../entity/Users');
var MLTableCell = require('../../MLTableCell/MLTableCell');
var PatientRM = require('../../受试者随机/MLPatientRM');
var MLActivityIndicatorView = require('../../MLActivityIndicatorView/MLActivityIndicatorView');
var study = require('../../../entity/study');
var Changku = require('../../../entity/Changku');
var settings = require('../../../settings');
var FPZhongxin = require('../../药物管理/仓库/保存数据/FPZhongxin');
var FPChangku = require('../../药物管理/仓库/保存数据/FPChangku');
var DgzxSq = require('./MLDgzxSq');
var DgzxCkjd = require('./MLDgzxCkjd')
var Dshlb = React.createClass({
//初始化设置
getInitialState() {
return {
//ListView设置
dataSource: null,
animating: true,//是否显示菊花
cuowu: false,//是否显示错误
dataType : null
}
},
//耗时操作,网络请求
componentDidMount(){
var UserSite = '';
for (var i = 0 ; i < Users.Users.length ; i++) {
if (Users.Users[i].UserSite != null) {
UserSite = Users.Users[i].UserSite
}
}
//发送登录网络请求
fetch(settings.fwqUrl + "/app/getZXStopItWaitForAudit", {
method: 'POST',
headers: {
'Accept': 'application/json; charset=utf-8',
'Content-Type': 'application/json',
},
body: JSON.stringify({
SiteID : UserSite,
StudyID : Users.Users[0].StudyID
})
})
.then((response) => response.json())
.then((responseJson) => {
console.log(responseJson)
if (responseJson.isSucceed != 400){
//移除等待
this.setState({animating:false});
this.setState({cuowu:true});
}else{
//ListView设置
console.log(responseJson)
var tableData = responseJson.data;
var ds = new ListView.DataSource({rowHasChanged:(r1, r2) => r1 !== r2});
this.setState({
dataSource: ds.cloneWithRows(tableData),
dataType : responseJson.dataType
});
//移除等待
this.setState({animating:false});
this.setState({cuowu:false});
}
})
.catch((error) => {//错误
//移除等待,弹出错误
this.setState({animating:false});
//错误
Alert.alert(
'请检查您的网络',
null,
[
{text: '确定'}
]
)
});
},
// getInitialState() {
// },
render() {
if (this.state.animating == true){
return (
<View style={styles.container}>
<MLNavigatorBar title={'审核列表'} isBack={true} backFunc={() => {
this.props.navigator.pop()
}} leftTitle={'首页'} leftFunc={()=>{
this.props.navigator.popToRoute(this.props.navigator.getCurrentRoutes()[1])
}}/>
{/*设置完了加载的菊花*/}
<MLActivityIndicatorView />
</View>
);
}else if(this.state.cuowu == true){
return (
<View style={styles.container}>
<MLNavigatorBar title={'审核列表'} isBack={true} backFunc={() => {
this.props.navigator.pop()
}} leftTitle={'首页'} leftFunc={()=>{
this.props.navigator.popToRoute(this.props.navigator.getCurrentRoutes()[1])
}}/>
{/*设置完了加载的菊花*/}
<MLActivityIndicatorView />
</View>
);
}else{
return (
<View style={styles.container}>
<MLNavigatorBar title={'审核列表'} isBack={true} backFunc={() => {
this.props.navigator.pop()
}} leftTitle={'首页'} leftFunc={()=>{
this.props.navigator.popToRoute(this.props.navigator.getCurrentRoutes()[1])
}}/>
<ListView
dataSource={this.state.dataSource}//数据源
renderRow={this.renderRow}
/>
</View>
);
}
},
//返回具体的cell
renderRow(rowData, sectionID, rowID, highlightRow){
console.log("返回具体的cell")
console.log(rowData)
var sss = rowData.isStopIt == 1?'是' : '否';
//判断改用户是不是随机化专员
var isSJHZY = false;
for (var i = 0 ; i < Users.Users.length ; i++) {
if (Users.Users[i].UserFun == 'C1') {
isSJHZY = true
}
}
if (isSJHZY == false){
return(
<TouchableOpacity onPress={()=>{
//错误
Alert.alert(
'提示',
'您可选择您的操作',
[
{text: '审批', onPress: () => {
Alert.alert(
'提示',
'您可选择您的操作',
[
{text: '通过', onPress: () => {
//发送网络请求
fetch(settings.fwqUrl + "/app/getZXToExamine", {
method: 'POST',
headers: {
'Accept': 'application/json; charset=utf-8',
'Content-Type': 'application/json',
},
body: JSON.stringify({
id : rowData.id,
StudyID : Users.Users[0].StudyID,
ToExamineUserData : Users.Users[0],
ToExamineType : 1,
ToExamineUsers:Users.Users[0].UserNam,
ToExaminePhone:Users.Users[0].UserMP,
})
})
.then((response) => response.json())
.then((responseJson) => {
Alert.alert(
'提示:',
responseJson.msg,
[
{text: '确定',onPress: () => {this.props.navigator.pop()}}
]
)
})
.catch((error) => {//错误
//移除等待,弹出错误
this.setState({animating:false});
//错误
Alert.alert(
'请检查您的网络',
null,
[
{text: '确定'}
]
)
});
}},
/*{text: '拒绝', onPress: () => {
//发送网络请求
fetch(settings.fwqUrl + "/app/getZXToExamine", {
method: 'POST',
headers: {
'Accept': 'application/json; charset=utf-8',
'Content-Type': 'application/json',
},
body: JSON.stringify({
id : rowData.id,
ToExamineType : 0,
StudyID : Users.Users[0].StudyID,
ToExamineUserData : Users.Users[0],
ToExamineUsers:Users.Users[0].UserNam,
ToExaminePhone:Users.Users[0].UserMP,
})
})
.then((response) => response.json())
.then((responseJson) => {
Alert.alert(
'提示:',
responseJson.msg,
[
{text: '确定',onPress: () => {this.props.navigator.pop()}}
]
)
})
.catch((error) => {//错误
//移除等待,弹出错误
this.setState({animating:false});
//错误
Alert.alert(
'请检查您的网络',
null,
[
{text: '确定'}
]
)
});
}},
*/
{text: '取消'}
]
)
}},
{text: '查看进度', onPress: () => {
// 页面的切换
this.props.navigator.push({
component: DgzxCkjd, // 具体路由的版块
//传递参数
passProps:{
datas : rowData,
},
});
}},
{text: '取消'}
]
)
}}>
<View style={{marginTop: 10 , backgroundColor: 'white',borderBottomColor: '#dddddd', borderBottomWidth: 1,borderTopColor: '#dddddd', borderTopWidth: 1, }}>
<Text style={{marginTop: 5,marginLeft:10}}>{'研究编号:' + rowData.StudyID}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'中心名称:' + rowData.SiteID}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'受试者入组是否中心之间竞争:' + (study.study.AccrualCmpYN == 1 ? '是' : '否')}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'中心平均入组例数:' + this.state.dataType[rowID].PJRZLS}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'中心目前已随机例数:' + this.state.dataType[rowID].YSJLS}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'中心停止入组原因:' + rowData.Reason}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'中心已停止受试者入组:' + sss}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'是否推送短信给全国PI:' + rowData.isMessage}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'是否推送邮件给全国PI:' + rowData.isMail}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'申请人:' + rowData.UserNam}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'申请人手机号:' + rowData.UserMP}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'申请人电子邮箱:' + rowData.UserEmail}</Text>
<Text style={{marginBottom: 5,marginTop: 5,marginLeft:10}}>{'申请日期:' + moment(rowData.Date).format('YYYY-MM-DD HH:mm:ss')}</Text>
</View>
</TouchableOpacity>
)
}else{
return(
<TouchableOpacity onPress={()=>{
//错误
Alert.alert(
'提示',
'您可选择您的操作',
[
{text: '停止中心入组', onPress: () => {
Alert.alert(
'提示',
'您可选择您的操作',
[
{text: '确定停止', onPress: () => {
//发送网络请求
fetch(settings.fwqUrl + "/app/getDetermineZXStopIt", {
method: 'POST',
headers: {
'Accept': 'application/json; charset=utf-8',
'Content-Type': 'application/json',
},
body: JSON.stringify({
id : rowData.id,
StudyID : Users.Users[0].StudyID,
isStopIt : 1,
StopItUsers:Users.Users[0].UserNam,
StopItPhone:Users.Users[0].UserMP,
})
})
.then((response) => response.json())
.then((responseJson) => {
Alert.alert(
'提示:',
responseJson.msg,
[
{text: '确定',onPress: () => {this.props.navigator.pop()}}
]
)
})
.catch((error) => {//错误
//移除等待,弹出错误
this.setState({animating:false});
//错误
Alert.alert(
'提示',
'请检测网络',
[
{text: '确定'}
]
)
});
}},
{text: '拒绝停止', onPress: () => {
//发送网络请求
fetch(settings.fwqUrl + "/app/getDetermineZXStopIt", {
method: 'POST',
headers: {
'Accept': 'application/json; charset=utf-8',
'Content-Type': 'application/json',
},
body: JSON.stringify({
id : rowData.id,
StudyID : Users.Users[0].StudyID,
isStopIt : 2,
StopItUsers:Users.Users[0].UserNam,
StopItPhone:Users.Users[0].UserMP,
})
})
.then((response) => response.json())
.then((responseJson) => {
Alert.alert(
'提示:',
responseJson.msg,
[
{text: '确定',onPress: () => {this.props.navigator.pop()}}
]
)
})
.catch((error) => {//错误
//移除等待,弹出错误
this.setState({animating:false});
//错误
Alert.alert(
'提示',
'请检测网络',
[
{text: '确定'}
]
)
});
}},
{text: '取消'}
]
)
}},
{text: '查看进度', onPress: () => {
// 页面的切换
this.props.navigator.push({
component: DgzxCkjd, // 具体路由的版块
//传递参数
passProps:{
datas : rowData
},
});
}},
{text: '取消'}
]
)
}}>
<View style={{marginTop: 10 , backgroundColor: 'white',borderBottomColor: '#dddddd', borderBottomWidth: 1,borderTopColor: '#dddddd', borderTopWidth: 1, }}>
<Text style={{marginTop: 5,marginLeft:10}}>{'研究编号:' + rowData.StudyID}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'中心名称:' + rowData.SiteID}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'受试者入组是否中心之间竞争:' + (study.study.AccrualCmpYN == 1 ? '是' : '否')}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'中心平均入组例数:' + this.state.dataType[rowID].PJRZLS}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'中心目前已随机例数:' + this.state.dataType[rowID].YSJLS}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'中心停止入组原因:' + rowData.Reason}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'中心已停止受试者入组:' + sss}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'是否推送短信给全国PI:' + rowData.isMessage}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'是否推送邮件给全国PI:' + rowData.isMail}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'申请人:' + rowData.UserNam}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'申请人手机号:' + rowData.UserMP}</Text>
<Text style={{marginTop: 5,marginLeft:10}}>{'申请人电子邮箱:' + rowData.UserEmail}</Text>
<Text style={{marginBottom: 5,marginTop: 5,marginLeft:10}}>{'申请日期:' + moment(rowData.Date).format('YYYY-MM-DD HH:mm:ss')}</Text>
</View>
</TouchableOpacity>
)
}
},
});
const styles = StyleSheet.create({
container: {
flex: 1,
// justifyContent: 'center',
// alignItems: 'center',
backgroundColor: 'rgba(233,234,239,1.0)',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
}
});
// 输出组件类
module.exports = Dshlb;
|
examples/todomvc/containers/Root.js | voidException/redux | import React, { Component } from 'react';
import TodoApp from './TodoApp';
import { createStore, combineReducers } from 'redux';
import { Provider } from 'react-redux';
import rootReducer from '../reducers';
const store = createStore(rootReducer);
export default class Root extends Component {
render() {
return (
<Provider store={store}>
{() => <TodoApp /> }
</Provider>
);
}
}
|
ajax/libs/react-autosuggest/1.17.0/autosuggest.min.js | hare1039/cdnjs | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define(["React"],t):"object"==typeof exports?exports.Autosuggest=t(require("React")):e.Autosuggest=t(e.React)}(this,function(e){return function(e){function t(s){if(n[s])return n[s].exports;var o=n[s]={exports:{},id:s,loaded:!1};return e[s].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var n=[],s=!0,o=!1,u=void 0;try{for(var i,r=e[Symbol.iterator]();!(s=(i=r.next()).done)&&(n.push(i.value),!t||n.length!==t);s=!0);}catch(l){o=!0,u=l}finally{try{!s&&r["return"]&&r["return"]()}finally{if(o)throw u}}return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,n,s){return n&&e(t.prototype,n),s&&e(t,s),t}}(),g=function(e,t,n){for(var s=!0;s;){var o=e,u=t,i=n;r=g=l=void 0,s=!1;var r=Object.getOwnPropertyDescriptor(o,u);if(void 0!==r){if("value"in r)return r.value;var l=r.get;return void 0===l?void 0:l.call(i)}var g=Object.getPrototypeOf(o);if(null===g)return void 0;e=g,t=u,n=i,s=!0}},a=n(1),c=s(a),f=n(2),h=s(f),d=n(4),p=s(d),v=n(5),S=s(v),y=function(e){function t(e){u(this,t),g(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.cache={},this.state={value:e.inputAttributes.value||"",suggestions:null,focusedSectionIndex:null,focusedSuggestionIndex:null,valueBeforeUpDown:null},this.suggestionsFn=h["default"](e.suggestions,100),this.onChange=e.inputAttributes.onChange||function(){},this.onFocus=e.inputAttributes.onFocus||function(){},this.onBlur=e.inputAttributes.onBlur||function(){},this.lastSuggestionsInputValue=null,this.justUnfocused=!1,this.justClickedOnSuggestion=!1,this.onInputChange=this.onInputChange.bind(this),this.onInputKeyDown=this.onInputKeyDown.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onInputBlur=this.onInputBlur.bind(this)}return i(t,e),l(t,[{key:"resetSectionIterator",value:function(e){this.isMultipleSections(e)?S["default"].setData(e.map(function(e){return e.suggestions.length})):S["default"].setData(null===e?[]:e.length)}},{key:"isMultipleSections",value:function(e){return null!==e&&e.length>0&&"undefined"!=typeof e[0].suggestions}},{key:"setSuggestionsState",value:function(e){this.resetSectionIterator(e),this.setState({suggestions:e,focusedSectionIndex:null,focusedSuggestionIndex:null,valueBeforeUpDown:null})}},{key:"suggestionsExist",value:function(e){return this.isMultipleSections(e)?e.some(function(e){return e.suggestions.length>0}):null!==e&&e.length>0}},{key:"showSuggestions",value:function(e){var t=this,n=e.toLowerCase();this.lastSuggestionsInputValue=e,this.props.showWhen(e)?this.cache[n]?this.setSuggestionsState(this.cache[n]):this.suggestionsFn(e,function(s,o){if(t.lastSuggestionsInputValue===e){if(s)throw s;t.suggestionsExist(o)||(o=null),t.cache[n]=o,t.setSuggestionsState(o)}}):this.setSuggestionsState(null)}},{key:"suggestionIsFocused",value:function(){return null!==this.state.focusedSuggestionIndex}},{key:"getSuggestion",value:function(e,t){return this.isMultipleSections(this.state.suggestions)?this.state.suggestions[e].suggestions[t]:this.state.suggestions[t]}},{key:"getFocusedSuggestion",value:function(){return this.suggestionIsFocused()?this.getSuggestion(this.state.focusedSectionIndex,this.state.focusedSuggestionIndex):null}},{key:"getSuggestionValue",value:function(e,t){var n=this.getSuggestion(e,t);if("object"==typeof n){if(this.props.suggestionValue)return this.props.suggestionValue(n);throw new Error("When <suggestion> is an object, you must implement the suggestionValue() function to specify how to set input's value when suggestion selected.")}return n.toString()}},{key:"onSuggestionUnfocused",value:function(){var e=this.getFocusedSuggestion();null===e||this.justUnfocused||(this.props.onSuggestionUnfocused(e),this.justUnfocused=!0)}},{key:"onSuggestionFocused",value:function(e,t){this.onSuggestionUnfocused();var n=this.getSuggestion(e,t);this.props.onSuggestionFocused(n),this.justUnfocused=!1}},{key:"scrollToElement",value:function(e,t,n){if("bottom"===n){var s=t.offsetTop+t.offsetHeight-e.scrollTop-e.offsetHeight;s>0&&(e.scrollTop+=s)}else{var s=e.scrollTop-t.offsetTop;s>0&&(e.scrollTop-=s)}}},{key:"scrollToSuggestion",value:function(e,t,n){var s="down"===e?"bottom":"top";if(null===n){if("down"!==e)return;s="top";var u=S["default"].next([null,null]),i=o(u,2);t=i[0],n=i[1]}else S["default"].isLast([t,n])&&"up"===e&&(s="bottom");var r=a.findDOMNode(this.refs.suggestions),l=this.getSuggestionRef(t,n),g=a.findDOMNode(this.refs[l]);this.scrollToElement(r,g,s)}},{key:"focusOnSuggestionUsingKeyboard",value:function(e,t){var n=o(t,2),s=n[0],u=n[1],i={focusedSectionIndex:s,focusedSuggestionIndex:u,value:null===u?this.state.valueBeforeUpDown:this.getSuggestionValue(s,u)};null===this.state.valueBeforeUpDown&&(i.valueBeforeUpDown=this.state.value),null===u?this.onSuggestionUnfocused():this.onSuggestionFocused(s,u),this.props.scrollBar&&this.scrollToSuggestion(e,s,u),this.onChange(i.value),this.setState(i)}},{key:"onSuggestionSelected",value:function(e){var t=this.getFocusedSuggestion();this.props.onSuggestionUnfocused(t),this.props.onSuggestionSelected(t,e)}},{key:"onInputChange",value:function(e){var t=e.target.value;this.onSuggestionUnfocused(),this.onChange(t),this.setState({value:t,valueBeforeUpDown:null}),this.showSuggestions(t)}},{key:"onInputKeyDown",value:function(e){var t=void 0;switch(e.keyCode){case 13:null!==this.state.valueBeforeUpDown&&this.suggestionIsFocused()&&this.onSuggestionSelected(e),this.setSuggestionsState(null);break;case 27:t={suggestions:null,focusedSectionIndex:null,focusedSuggestionIndex:null,valueBeforeUpDown:null},null!==this.state.valueBeforeUpDown?t.value=this.state.valueBeforeUpDown:null===this.state.suggestions&&(t.value=""),this.onSuggestionUnfocused(),"string"==typeof t.value&&t.value!==this.state.value&&this.onChange(t.value),this.setState(t);break;case 38:null===this.state.suggestions?this.showSuggestions(this.state.value):this.focusOnSuggestionUsingKeyboard("up",S["default"].prev([this.state.focusedSectionIndex,this.state.focusedSuggestionIndex])),e.preventDefault();break;case 40:null===this.state.suggestions?this.showSuggestions(this.state.value):this.focusOnSuggestionUsingKeyboard("down",S["default"].next([this.state.focusedSectionIndex,this.state.focusedSuggestionIndex]))}}},{key:"onInputFocus",value:function(e){this.showSuggestions(this.state.value),this.onFocus(e)}},{key:"onInputBlur",value:function(e){this.onSuggestionUnfocused(),this.justClickedOnSuggestion||this.onBlur(e),this.setSuggestionsState(null)}},{key:"isSuggestionFocused",value:function(e,t){return e===this.state.focusedSectionIndex&&t===this.state.focusedSuggestionIndex}},{key:"onSuggestionMouseEnter",value:function(e,t){this.isSuggestionFocused(e,t)||this.onSuggestionFocused(e,t),this.setState({focusedSectionIndex:e,focusedSuggestionIndex:t})}},{key:"onSuggestionMouseLeave",value:function(e,t){this.isSuggestionFocused(e,t)&&this.onSuggestionUnfocused(),this.setState({focusedSectionIndex:null,focusedSuggestionIndex:null})}},{key:"onSuggestionMouseDown",value:function(e,t,n){var s=this,o=this.getSuggestionValue(e,t);this.justClickedOnSuggestion=!0,this.onSuggestionSelected(n),this.onChange(o),this.setState({value:o,suggestions:null,focusedSectionIndex:null,focusedSuggestionIndex:null,valueBeforeUpDown:null},function(){setTimeout(function(){a.findDOMNode(s.refs.input).focus(),s.justClickedOnSuggestion=!1})})}},{key:"getSuggestionId",value:function(e,t){return null===t?null:"react-autosuggest-"+this.props.id+"-"+this.getSuggestionRef(e,t)}},{key:"getSuggestionRef",value:function(e,t){return"suggestion-"+(null===e?"":e)+"-"+t}},{key:"renderSuggestionContent",value:function(e){if(this.props.suggestionRenderer)return this.props.suggestionRenderer(e,this.state.valueBeforeUpDown||this.state.value);if("object"==typeof e)throw new Error("When <suggestion> is an object, you must implement the suggestionRenderer() function to specify how to render it.");return e.toString()}},{key:"renderSuggestionsList",value:function(e,t){var n=this;return e.map(function(e,s){var o=p["default"]({"react-autosuggest__suggestion":!0,"react-autosuggest__suggestion--focused":t===n.state.focusedSectionIndex&&s===n.state.focusedSuggestionIndex}),u=n.getSuggestionRef(t,s);return c["default"].createElement("li",{id:n.getSuggestionId(t,s),className:o,role:"option",ref:u,key:u,onMouseEnter:function(){return n.onSuggestionMouseEnter(t,s)},onMouseLeave:function(){return n.onSuggestionMouseLeave(t,s)},onMouseDown:function(e){return n.onSuggestionMouseDown(t,s,e)}},n.renderSuggestionContent(e))})}},{key:"renderSuggestions",value:function(){var e=this;return""===this.state.value||null===this.state.suggestions?null:this.isMultipleSections(this.state.suggestions)?c["default"].createElement("div",{id:"react-autosuggest-"+this.props.id,className:"react-autosuggest__suggestions",ref:"suggestions",role:"listbox"},this.state.suggestions.map(function(t,n){var s=t.sectionName?c["default"].createElement("div",{className:"react-autosuggest__suggestions-section-name"},t.sectionName):null;return 0===t.suggestions.length?null:c["default"].createElement("div",{className:"react-autosuggest__suggestions-section",key:"section-"+n},s,c["default"].createElement("ul",{className:"react-autosuggest__suggestions-section-suggestions"},e.renderSuggestionsList(t.suggestions,n)))})):c["default"].createElement("ul",{id:"react-autosuggest-"+this.props.id,className:"react-autosuggest__suggestions",ref:"suggestions",role:"listbox"},this.renderSuggestionsList(this.state.suggestions,null))}},{key:"render",value:function(){var e=this.getSuggestionId(this.state.focusedSectionIndex,this.state.focusedSuggestionIndex);return c["default"].createElement("div",{className:"react-autosuggest"},c["default"].createElement("input",r({},this.props.inputAttributes,{type:this.props.inputAttributes.type||"text",value:this.state.value,autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-owns":"react-autosuggest-"+this.props.id,"aria-expanded":null!==this.state.suggestions,"aria-activedescendant":e,ref:"input",onChange:this.onInputChange,onKeyDown:this.onInputKeyDown,onFocus:this.onInputFocus,onBlur:this.onInputBlur})),this.renderSuggestions())}}],[{key:"propTypes",value:{suggestions:a.PropTypes.func.isRequired,suggestionRenderer:a.PropTypes.func,suggestionValue:a.PropTypes.func,showWhen:a.PropTypes.func,onSuggestionSelected:a.PropTypes.func,onSuggestionFocused:a.PropTypes.func,onSuggestionUnfocused:a.PropTypes.func,inputAttributes:a.PropTypes.object,id:a.PropTypes.string,scrollBar:a.PropTypes.bool},enumerable:!0},{key:"defaultProps",value:{showWhen:function(e){return e.trim().length>0},onSuggestionSelected:function(){},onSuggestionFocused:function(){},onSuggestionUnfocused:function(){},inputAttributes:{},id:"1",scrollBar:!1},enumerable:!0}]),t}(a.Component);t["default"]=y,e.exports=t["default"]},function(t,n){t.exports=e},function(e,t,n){var s=n(3);e.exports=function(e,t,n){function o(){var a=s()-l;t>a&&a>0?u=setTimeout(o,t-a):(u=null,n||(g=e.apply(r,i),u||(r=i=null)))}var u,i,r,l,g;return null==t&&(t=100),function(){r=this,i=arguments,l=s();var a=n&&!u;return u||(u=setTimeout(o,t)),a&&(g=e.apply(r,i),r=i=null),g}}},function(e,t){function n(){return(new Date).getTime()}e.exports=Date.now||n},function(e,t,n){var s;!function(){"use strict";function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];if(n){var s=typeof n;if("string"===s||"number"===s)e+=" "+n;else if(Array.isArray(n))e+=" "+o.apply(null,n);else if("object"===s)for(var u in n)n.hasOwnProperty(u)&&n[u]&&(e+=" "+u)}}return e.substr(1)}s=function(){return o}.call(t,n,t,e),!(void 0!==s&&(e.exports=s))}()},function(e,t){"use strict";function n(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var n=[],s=!0,o=!1,u=void 0;try{for(var i,r=e[Symbol.iterator]();!(s=(i=r.next()).done)&&(n.push(i.value),!t||n.length!==t);s=!0);}catch(l){o=!0,u=l}finally{try{!s&&r["return"]&&r["return"]()}finally{if(o)throw u}}return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")}function s(e){g=e,a="object"==typeof g}function o(e){for(null===e?e=0:e++;e<g.length&&0===g[e];)e++;return e===g.length?null:e}function u(e){for(null===e?e=g.length-1:e--;e>=0&&0===g[e];)e--;return-1===e?null:e}function i(e){var t=n(e,2),s=t[0],u=t[1];return a?null===u||u===g[s]-1?(s=o(s),null===s?[null,null]:[s,0]):[s,u+1]:0===g||u===g-1?[null,null]:null===u?[null,0]:[null,u+1]}function r(e){var t=n(e,2),s=t[0],o=t[1];return a?null===o||0===o?(s=u(s),null===s?[null,null]:[s,g[s]-1]):[s,o-1]:0===g||0===o?[null,null]:null===o?[null,g-1]:[null,o-1]}function l(e){return null===i(e)[1]}Object.defineProperty(t,"__esModule",{value:!0});var g=void 0,a=void 0;t["default"]={setData:s,next:i,prev:r,isLast:l},e.exports=t["default"]}])}); |
ajax/libs/react-bootstrap/0.24.0-alpha.1/react-bootstrap.js | froala/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["ReactBootstrap"] = factory(require("react"));
else
root["ReactBootstrap"] = factory(root["React"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {
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__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _Accordion = __webpack_require__(5);
var _Accordion2 = _interopRequireDefault(_Accordion);
var _Affix = __webpack_require__(11);
var _Affix2 = _interopRequireDefault(_Affix);
var _AffixMixin = __webpack_require__(12);
var _AffixMixin2 = _interopRequireDefault(_AffixMixin);
var _Alert = __webpack_require__(15);
var _Alert2 = _interopRequireDefault(_Alert);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _Badge = __webpack_require__(16);
var _Badge2 = _interopRequireDefault(_Badge);
var _Button = __webpack_require__(17);
var _Button2 = _interopRequireDefault(_Button);
var _ButtonGroup = __webpack_require__(18);
var _ButtonGroup2 = _interopRequireDefault(_ButtonGroup);
var _ButtonInput = __webpack_require__(19);
var _ButtonInput2 = _interopRequireDefault(_ButtonInput);
var _ButtonToolbar = __webpack_require__(23);
var _ButtonToolbar2 = _interopRequireDefault(_ButtonToolbar);
var _CollapsibleNav = __webpack_require__(24);
var _CollapsibleNav2 = _interopRequireDefault(_CollapsibleNav);
var _Carousel = __webpack_require__(28);
var _Carousel2 = _interopRequireDefault(_Carousel);
var _CarouselItem = __webpack_require__(30);
var _CarouselItem2 = _interopRequireDefault(_CarouselItem);
var _Col = __webpack_require__(31);
var _Col2 = _interopRequireDefault(_Col);
var _CollapsibleMixin = __webpack_require__(25);
var _CollapsibleMixin2 = _interopRequireDefault(_CollapsibleMixin);
var _DropdownButton = __webpack_require__(32);
var _DropdownButton2 = _interopRequireDefault(_DropdownButton);
var _DropdownMenu = __webpack_require__(34);
var _DropdownMenu2 = _interopRequireDefault(_DropdownMenu);
var _DropdownStateMixin = __webpack_require__(33);
var _DropdownStateMixin2 = _interopRequireDefault(_DropdownStateMixin);
var _FadeMixin = __webpack_require__(35);
var _FadeMixin2 = _interopRequireDefault(_FadeMixin);
var _FormControls = __webpack_require__(36);
var _FormControls2 = _interopRequireDefault(_FormControls);
var _Glyphicon = __webpack_require__(29);
var _Glyphicon2 = _interopRequireDefault(_Glyphicon);
var _Grid = __webpack_require__(38);
var _Grid2 = _interopRequireDefault(_Grid);
var _Input = __webpack_require__(39);
var _Input2 = _interopRequireDefault(_Input);
var _Interpolate = __webpack_require__(41);
var _Interpolate2 = _interopRequireDefault(_Interpolate);
var _Jumbotron = __webpack_require__(42);
var _Jumbotron2 = _interopRequireDefault(_Jumbotron);
var _Label = __webpack_require__(43);
var _Label2 = _interopRequireDefault(_Label);
var _ListGroup = __webpack_require__(44);
var _ListGroup2 = _interopRequireDefault(_ListGroup);
var _ListGroupItem = __webpack_require__(45);
var _ListGroupItem2 = _interopRequireDefault(_ListGroupItem);
var _MenuItem = __webpack_require__(1);
var _MenuItem2 = _interopRequireDefault(_MenuItem);
var _Modal = __webpack_require__(46);
var _Modal2 = _interopRequireDefault(_Modal);
var _Nav = __webpack_require__(47);
var _Nav2 = _interopRequireDefault(_Nav);
var _Navbar = __webpack_require__(48);
var _Navbar2 = _interopRequireDefault(_Navbar);
var _NavItem = __webpack_require__(49);
var _NavItem2 = _interopRequireDefault(_NavItem);
var _ModalTrigger = __webpack_require__(50);
var _ModalTrigger2 = _interopRequireDefault(_ModalTrigger);
var _OverlayTrigger = __webpack_require__(53);
var _OverlayTrigger2 = _interopRequireDefault(_OverlayTrigger);
var _OverlayMixin = __webpack_require__(51);
var _OverlayMixin2 = _interopRequireDefault(_OverlayMixin);
var _PageHeader = __webpack_require__(55);
var _PageHeader2 = _interopRequireDefault(_PageHeader);
var _Pagination = __webpack_require__(56);
var _Pagination2 = _interopRequireDefault(_Pagination);
var _Panel = __webpack_require__(59);
var _Panel2 = _interopRequireDefault(_Panel);
var _PanelGroup = __webpack_require__(6);
var _PanelGroup2 = _interopRequireDefault(_PanelGroup);
var _PageItem = __webpack_require__(60);
var _PageItem2 = _interopRequireDefault(_PageItem);
var _Pager = __webpack_require__(61);
var _Pager2 = _interopRequireDefault(_Pager);
var _Popover = __webpack_require__(62);
var _Popover2 = _interopRequireDefault(_Popover);
var _ProgressBar = __webpack_require__(63);
var _ProgressBar2 = _interopRequireDefault(_ProgressBar);
var _Row = __webpack_require__(64);
var _Row2 = _interopRequireDefault(_Row);
var _SafeAnchor = __webpack_require__(4);
var _SafeAnchor2 = _interopRequireDefault(_SafeAnchor);
var _SplitButton = __webpack_require__(65);
var _SplitButton2 = _interopRequireDefault(_SplitButton);
var _SubNav = __webpack_require__(66);
var _SubNav2 = _interopRequireDefault(_SubNav);
var _TabbedArea = __webpack_require__(67);
var _TabbedArea2 = _interopRequireDefault(_TabbedArea);
var _Table = __webpack_require__(68);
var _Table2 = _interopRequireDefault(_Table);
var _TabPane = __webpack_require__(69);
var _TabPane2 = _interopRequireDefault(_TabPane);
var _Thumbnail = __webpack_require__(70);
var _Thumbnail2 = _interopRequireDefault(_Thumbnail);
var _Tooltip = __webpack_require__(71);
var _Tooltip2 = _interopRequireDefault(_Tooltip);
var _utils = __webpack_require__(72);
var _utils2 = _interopRequireDefault(_utils);
var _Well = __webpack_require__(73);
var _Well2 = _interopRequireDefault(_Well);
var _styleMaps = __webpack_require__(8);
var _styleMaps2 = _interopRequireDefault(_styleMaps);
exports['default'] = {
Accordion: _Accordion2['default'],
Affix: _Affix2['default'],
AffixMixin: _AffixMixin2['default'],
Alert: _Alert2['default'],
BootstrapMixin: _BootstrapMixin2['default'],
Badge: _Badge2['default'],
Button: _Button2['default'],
ButtonGroup: _ButtonGroup2['default'],
ButtonInput: _ButtonInput2['default'],
ButtonToolbar: _ButtonToolbar2['default'],
CollapsibleNav: _CollapsibleNav2['default'],
Carousel: _Carousel2['default'],
CarouselItem: _CarouselItem2['default'],
Col: _Col2['default'],
CollapsibleMixin: _CollapsibleMixin2['default'],
DropdownButton: _DropdownButton2['default'],
DropdownMenu: _DropdownMenu2['default'],
DropdownStateMixin: _DropdownStateMixin2['default'],
FadeMixin: _FadeMixin2['default'],
FormControls: _FormControls2['default'],
Glyphicon: _Glyphicon2['default'],
Grid: _Grid2['default'],
Input: _Input2['default'],
Interpolate: _Interpolate2['default'],
Jumbotron: _Jumbotron2['default'],
Label: _Label2['default'],
ListGroup: _ListGroup2['default'],
ListGroupItem: _ListGroupItem2['default'],
MenuItem: _MenuItem2['default'],
Modal: _Modal2['default'],
Nav: _Nav2['default'],
Navbar: _Navbar2['default'],
NavItem: _NavItem2['default'],
ModalTrigger: _ModalTrigger2['default'],
OverlayTrigger: _OverlayTrigger2['default'],
OverlayMixin: _OverlayMixin2['default'],
PageHeader: _PageHeader2['default'],
Panel: _Panel2['default'],
PanelGroup: _PanelGroup2['default'],
PageItem: _PageItem2['default'],
Pager: _Pager2['default'],
Pagination: _Pagination2['default'],
Popover: _Popover2['default'],
ProgressBar: _ProgressBar2['default'],
Row: _Row2['default'],
SafeAnchor: _SafeAnchor2['default'],
SplitButton: _SplitButton2['default'],
SubNav: _SubNav2['default'],
TabbedArea: _TabbedArea2['default'],
Table: _Table2['default'],
TabPane: _TabPane2['default'],
Thumbnail: _Thumbnail2['default'],
Tooltip: _Tooltip2['default'],
utils: _utils2['default'],
Well: _Well2['default'],
styleMaps: _styleMaps2['default']
};
module.exports = exports['default'];
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _SafeAnchor = __webpack_require__(4);
var _SafeAnchor2 = _interopRequireDefault(_SafeAnchor);
var MenuItem = _react2['default'].createClass({
displayName: 'MenuItem',
propTypes: {
header: _react2['default'].PropTypes.bool,
divider: _react2['default'].PropTypes.bool,
href: _react2['default'].PropTypes.string,
title: _react2['default'].PropTypes.string,
target: _react2['default'].PropTypes.string,
onSelect: _react2['default'].PropTypes.func,
eventKey: _react2['default'].PropTypes.any,
active: _react2['default'].PropTypes.bool,
disabled: _react2['default'].PropTypes.bool
},
getDefaultProps: function getDefaultProps() {
return {
active: false
};
},
handleClick: function handleClick(e) {
if (this.props.disabled) {
e.preventDefault();
return;
}
if (this.props.onSelect) {
e.preventDefault();
this.props.onSelect(this.props.eventKey, this.props.href, this.props.target);
}
},
renderAnchor: function renderAnchor() {
return _react2['default'].createElement(
_SafeAnchor2['default'],
{ onClick: this.handleClick, href: this.props.href, target: this.props.target, title: this.props.title, tabIndex: '-1' },
this.props.children
);
},
render: function render() {
var classes = {
'dropdown-header': this.props.header,
'divider': this.props.divider,
'active': this.props.active,
'disabled': this.props.disabled
};
var children = null;
if (this.props.header) {
children = this.props.children;
} else if (!this.props.divider) {
children = this.renderAnchor();
}
return _react2['default'].createElement(
'li',
_extends({}, this.props, { role: 'presentation', title: null, href: null,
className: (0, _classnames2['default'])(this.props.className, classes) }),
children
);
}
});
exports['default'] = MenuItem;
module.exports = exports['default'];
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/*!
Copyright (c) 2015 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
(function () {
'use strict';
function classNames () {
var classes = '';
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
var argType = typeof arg;
if ('string' === argType || 'number' === argType) {
classes += ' ' + arg;
} else if (Array.isArray(arg)) {
classes += ' ' + classNames.apply(null, arg);
} else if ('object' === argType) {
for (var key in arg) {
if (arg.hasOwnProperty(key) && arg[key]) {
classes += ' ' + key;
}
}
}
}
return classes.substr(1);
}
if (true) {
// AMD. Register as an anonymous module.
!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {
return classNames;
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = classNames;
} else {
window.classNames = classNames;
}
}());
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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) subClass.__proto__ = superClass; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
/**
* Note: This is intended as a stop-gap for accessibility concerns that the
* Bootstrap CSS does not address as they have styled anchors and not buttons
* in many cases.
*/
var SafeAnchor = (function (_React$Component) {
function SafeAnchor(props) {
_classCallCheck(this, SafeAnchor);
_get(Object.getPrototypeOf(SafeAnchor.prototype), 'constructor', this).call(this, props);
this.handleClick = this.handleClick.bind(this);
}
_inherits(SafeAnchor, _React$Component);
_createClass(SafeAnchor, [{
key: 'handleClick',
value: function handleClick(event) {
if (this.props.href === undefined) {
event.preventDefault();
}
if (this.props.onClick) {
this.props.onClick(event);
}
}
}, {
key: 'render',
value: function render() {
return _react2['default'].createElement('a', _extends({ role: this.props.href ? undefined : 'button'
}, this.props, {
onClick: this.handleClick,
href: this.props.href || '' }));
}
}]);
return SafeAnchor;
})(_react2['default'].Component);
exports['default'] = SafeAnchor;
SafeAnchor.propTypes = {
href: _react2['default'].PropTypes.string,
onClick: _react2['default'].PropTypes.func
};
module.exports = exports['default'];
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _PanelGroup = __webpack_require__(6);
var _PanelGroup2 = _interopRequireDefault(_PanelGroup);
var Accordion = _react2['default'].createClass({
displayName: 'Accordion',
render: function render() {
return _react2['default'].createElement(
_PanelGroup2['default'],
_extends({}, this.props, { accordion: true }),
this.props.children
);
}
});
exports['default'] = Accordion;
module.exports = exports['default'];
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
/* eslint react/prop-types: [1, {ignore: ["children", "className", "bsStyle"]}]*/
/* BootstrapMixin contains `bsStyle` type validation */
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var PanelGroup = _react2['default'].createClass({
displayName: 'PanelGroup',
mixins: [_BootstrapMixin2['default']],
propTypes: {
accordion: _react2['default'].PropTypes.bool,
activeKey: _react2['default'].PropTypes.any,
defaultActiveKey: _react2['default'].PropTypes.any,
onSelect: _react2['default'].PropTypes.func
},
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'panel-group'
};
},
getInitialState: function getInitialState() {
var defaultActiveKey = this.props.defaultActiveKey;
return {
activeKey: defaultActiveKey
};
},
render: function render() {
var classes = this.getBsClassSet();
return _react2['default'].createElement(
'div',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), onSelect: null }),
_utilsValidComponentChildren2['default'].map(this.props.children, this.renderPanel)
);
},
renderPanel: function renderPanel(child, index) {
var activeKey = this.props.activeKey != null ? this.props.activeKey : this.state.activeKey;
var props = {
bsStyle: child.props.bsStyle || this.props.bsStyle,
key: child.key ? child.key : index,
ref: child.ref
};
if (this.props.accordion) {
props.collapsible = true;
props.expanded = child.props.eventKey === activeKey;
props.onSelect = this.handleSelect;
}
return (0, _react.cloneElement)(child, props);
},
shouldComponentUpdate: function shouldComponentUpdate() {
// Defer any updates to this component during the `onSelect` handler.
return !this._isChanging;
},
handleSelect: function handleSelect(e, key) {
e.preventDefault();
if (this.props.onSelect) {
this._isChanging = true;
this.props.onSelect(key);
this._isChanging = false;
}
if (this.state.activeKey === key) {
key = null;
}
this.setState({
activeKey: key
});
}
});
exports['default'] = PanelGroup;
module.exports = exports['default'];
/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _styleMaps = __webpack_require__(8);
var _styleMaps2 = _interopRequireDefault(_styleMaps);
var _utilsCustomPropTypes = __webpack_require__(9);
var _utilsCustomPropTypes2 = _interopRequireDefault(_utilsCustomPropTypes);
var BootstrapMixin = {
propTypes: {
bsClass: _utilsCustomPropTypes2['default'].keyOf(_styleMaps2['default'].CLASSES),
bsStyle: _utilsCustomPropTypes2['default'].keyOf(_styleMaps2['default'].STYLES),
bsSize: _utilsCustomPropTypes2['default'].keyOf(_styleMaps2['default'].SIZES)
},
getBsClassSet: function getBsClassSet() {
var classes = {};
var bsClass = this.props.bsClass && _styleMaps2['default'].CLASSES[this.props.bsClass];
if (bsClass) {
classes[bsClass] = true;
var prefix = bsClass + '-';
var bsSize = this.props.bsSize && _styleMaps2['default'].SIZES[this.props.bsSize];
if (bsSize) {
classes[prefix + bsSize] = true;
}
var bsStyle = this.props.bsStyle && _styleMaps2['default'].STYLES[this.props.bsStyle];
if (this.props.bsStyle) {
classes[prefix + bsStyle] = true;
}
}
return classes;
},
prefixClass: function prefixClass(subClass) {
return _styleMaps2['default'].CLASSES[this.props.bsClass] + '-' + subClass;
}
};
exports['default'] = BootstrapMixin;
module.exports = exports['default'];
/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var styleMaps = {
CLASSES: {
'alert': 'alert',
'button': 'btn',
'button-group': 'btn-group',
'button-toolbar': 'btn-toolbar',
'column': 'col',
'input-group': 'input-group',
'form': 'form',
'glyphicon': 'glyphicon',
'label': 'label',
'thumbnail': 'thumbnail',
'list-group-item': 'list-group-item',
'panel': 'panel',
'panel-group': 'panel-group',
'pagination': 'pagination',
'progress-bar': 'progress-bar',
'nav': 'nav',
'navbar': 'navbar',
'modal': 'modal',
'row': 'row',
'well': 'well'
},
STYLES: {
'default': 'default',
'primary': 'primary',
'success': 'success',
'info': 'info',
'warning': 'warning',
'danger': 'danger',
'link': 'link',
'inline': 'inline',
'tabs': 'tabs',
'pills': 'pills'
},
addStyle: function addStyle(name) {
styleMaps.STYLES[name] = name;
},
SIZES: {
'large': 'lg',
'medium': 'md',
'small': 'sm',
'xsmall': 'xs'
},
GLYPHS: ['asterisk', 'plus', 'euro', 'eur', 'minus', 'cloud', 'envelope', 'pencil', 'glass', 'music', 'search', 'heart', 'star', 'star-empty', 'user', 'film', 'th-large', 'th', 'th-list', 'ok', 'remove', 'zoom-in', 'zoom-out', 'off', 'signal', 'cog', 'trash', 'home', 'file', 'time', 'road', 'download-alt', 'download', 'upload', 'inbox', 'play-circle', 'repeat', 'refresh', 'list-alt', 'lock', 'flag', 'headphones', 'volume-off', 'volume-down', 'volume-up', 'qrcode', 'barcode', 'tag', 'tags', 'book', 'bookmark', 'print', 'camera', 'font', 'bold', 'italic', 'text-height', 'text-width', 'align-left', 'align-center', 'align-right', 'align-justify', 'list', 'indent-left', 'indent-right', 'facetime-video', 'picture', 'map-marker', 'adjust', 'tint', 'edit', 'share', 'check', 'move', 'step-backward', 'fast-backward', 'backward', 'play', 'pause', 'stop', 'forward', 'fast-forward', 'step-forward', 'eject', 'chevron-left', 'chevron-right', 'plus-sign', 'minus-sign', 'remove-sign', 'ok-sign', 'question-sign', 'info-sign', 'screenshot', 'remove-circle', 'ok-circle', 'ban-circle', 'arrow-left', 'arrow-right', 'arrow-up', 'arrow-down', 'share-alt', 'resize-full', 'resize-small', 'exclamation-sign', 'gift', 'leaf', 'fire', 'eye-open', 'eye-close', 'warning-sign', 'plane', 'calendar', 'random', 'comment', 'magnet', 'chevron-up', 'chevron-down', 'retweet', 'shopping-cart', 'folder-close', 'folder-open', 'resize-vertical', 'resize-horizontal', 'hdd', 'bullhorn', 'bell', 'certificate', 'thumbs-up', 'thumbs-down', 'hand-right', 'hand-left', 'hand-up', 'hand-down', 'circle-arrow-right', 'circle-arrow-left', 'circle-arrow-up', 'circle-arrow-down', 'globe', 'wrench', 'tasks', 'filter', 'briefcase', 'fullscreen', 'dashboard', 'paperclip', 'heart-empty', 'link', 'phone', 'pushpin', 'usd', 'gbp', 'sort', 'sort-by-alphabet', 'sort-by-alphabet-alt', 'sort-by-order', 'sort-by-order-alt', 'sort-by-attributes', 'sort-by-attributes-alt', 'unchecked', 'expand', 'collapse-down', 'collapse-up', 'log-in', 'flash', 'log-out', 'new-window', 'record', 'save', 'open', 'saved', 'import', 'export', 'send', 'floppy-disk', 'floppy-saved', 'floppy-remove', 'floppy-save', 'floppy-open', 'credit-card', 'transfer', 'cutlery', 'header', 'compressed', 'earphone', 'phone-alt', 'tower', 'stats', 'sd-video', 'hd-video', 'subtitles', 'sound-stereo', 'sound-dolby', 'sound-5-1', 'sound-6-1', 'sound-7-1', 'copyright-mark', 'registration-mark', 'cloud-download', 'cloud-upload', 'tree-conifer', 'tree-deciduous', 'cd', 'save-file', 'open-file', 'level-up', 'copy', 'paste', 'alert', 'equalizer', 'king', 'queen', 'pawn', 'bishop', 'knight', 'baby-formula', 'tent', 'blackboard', 'bed', 'apple', 'erase', 'hourglass', 'lamp', 'duplicate', 'piggy-bank', 'scissors', 'bitcoin', 'yen', 'ruble', 'scale', 'ice-lolly', 'ice-lolly-tasted', 'education', 'option-horizontal', 'option-vertical', 'menu-hamburger', 'modal-window', 'oil', 'grain', 'sunglasses', 'text-size', 'text-color', 'text-background', 'object-align-top', 'object-align-bottom', 'object-align-horizontal', 'object-align-left', 'object-align-vertical', 'object-align-right', 'triangle-right', 'triangle-left', 'triangle-bottom', 'triangle-top', 'console', 'superscript', 'subscript', 'menu-left', 'menu-right', 'menu-down', 'menu-up']
};
exports['default'] = styleMaps;
module.exports = exports['default'];
/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); }
var ANONYMOUS = '<<anonymous>>';
var CustomPropTypes = {
/**
* Checks whether a prop provides a DOM element
*
* The element can be provided in two forms:
* - Directly passed
* - Or passed an object which has a `getDOMNode` method which will return the required DOM element
*
* @param props
* @param propName
* @param componentName
* @returns {Error|undefined}
*/
mountable: createMountableChecker(),
/**
* Checks whether a prop matches a key of an associated object
*
* @param props
* @param propName
* @param componentName
* @returns {Error|undefined}
*/
keyOf: createKeyOfChecker,
/**
* Checks if only one of the listed properties is in use. An error is given
* if multiple have a value
*
* @param props
* @param propName
* @param componentName
* @returns {Error|undefined}
*/
singlePropFrom: createSinglePropFromChecker,
all: all
};
/**
* Create chain-able isRequired validator
*
* Largely copied directly from:
* https://github.com/facebook/react/blob/0.11-stable/src/core/ReactPropTypes.js#L94
*/
function createChainableTypeChecker(validate) {
function checkType(isRequired, props, propName, componentName) {
componentName = componentName || ANONYMOUS;
if (props[propName] == null) {
if (isRequired) {
return new Error('Required prop `' + propName + '` was not specified in ' + '`' + componentName + '`.');
}
} else {
return validate(props, propName, componentName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createMountableChecker() {
function validate(props, propName, componentName) {
if (typeof props[propName] !== 'object' || typeof props[propName].render !== 'function' && props[propName].nodeType !== 1) {
return new Error('Invalid prop `' + propName + '` supplied to ' + '`' + componentName + '`, expected a DOM element or an object that has a `render` method');
}
}
return createChainableTypeChecker(validate);
}
function createKeyOfChecker(obj) {
function validate(props, propName, componentName) {
var propValue = props[propName];
if (!obj.hasOwnProperty(propValue)) {
var valuesString = JSON.stringify(Object.keys(obj));
return new Error('Invalid prop \'' + propName + '\' of value \'' + propValue + '\' ' + ('supplied to \'' + componentName + '\', expected one of ' + valuesString + '.'));
}
}
return createChainableTypeChecker(validate);
}
function createSinglePropFromChecker(arrOfProps) {
function validate(props, propName, componentName) {
var usedPropCount = arrOfProps.map(function (listedProp) {
return props[listedProp];
}).reduce(function (acc, curr) {
return acc + (curr !== undefined ? 1 : 0);
}, 0);
if (usedPropCount > 1) {
var _arrOfProps = _toArray(arrOfProps);
var first = _arrOfProps[0];
var others = _arrOfProps.slice(1);
var message = '' + others.join(', ') + ' and ' + first;
return new Error('Invalid prop \'' + propName + '\', only one of the following ' + ('may be provided: ' + message));
}
}
return validate;
}
function all(propTypes) {
if (propTypes === undefined) {
throw new Error('No validations provided');
}
if (!(propTypes instanceof Array)) {
throw new Error('Invalid argument must be an array');
}
if (propTypes.length === 0) {
throw new Error('No validations provided');
}
return function (props, propName, componentName) {
for (var i = 0; i < propTypes.length; i++) {
var result = propTypes[i](props, propName, componentName);
if (result !== undefined && result !== null) {
return result;
}
}
};
}
exports['default'] = CustomPropTypes;
module.exports = exports['default'];
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
/**
* Maps children that are typically specified as `props.children`,
* but only iterates over children that are "valid components".
*
* The mapFunction provided index will be normalised to the components mapped,
* so an invalid component would not increase the index.
*
* @param {?*} children Children tree container.
* @param {function(*, int)} mapFunction.
* @param {*} mapContext Context for mapFunction.
* @return {object} Object containing the ordered map of results.
*/
function mapValidComponents(children, func, context) {
var index = 0;
return _react2['default'].Children.map(children, function (child) {
if (_react2['default'].isValidElement(child)) {
var lastIndex = index;
index++;
return func.call(context, child, lastIndex);
}
return child;
});
}
/**
* Iterates through children that are typically specified as `props.children`,
* but only iterates over children that are "valid components".
*
* The provided forEachFunc(child, index) will be called for each
* leaf child with the index reflecting the position relative to "valid components".
*
* @param {?*} children Children tree container.
* @param {function(*, int)} forEachFunc.
* @param {*} forEachContext Context for forEachContext.
*/
function forEachValidComponents(children, func, context) {
var index = 0;
return _react2['default'].Children.forEach(children, function (child) {
if (_react2['default'].isValidElement(child)) {
func.call(context, child, index);
index++;
}
});
}
/**
* Count the number of "valid components" in the Children container.
*
* @param {?*} children Children tree container.
* @returns {number}
*/
function numberOfValidComponents(children) {
var count = 0;
_react2['default'].Children.forEach(children, function (child) {
if (_react2['default'].isValidElement(child)) {
count++;
}
});
return count;
}
/**
* Determine if the Child container has one or more "valid components".
*
* @param {?*} children Children tree container.
* @returns {boolean}
*/
function hasValidComponent(children) {
var hasValid = false;
_react2['default'].Children.forEach(children, function (child) {
if (!hasValid && _react2['default'].isValidElement(child)) {
hasValid = true;
}
});
return hasValid;
}
exports['default'] = {
map: mapValidComponents,
forEach: forEachValidComponents,
numberOf: numberOfValidComponents,
hasValidComponent: hasValidComponent
};
module.exports = exports['default'];
/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _AffixMixin = __webpack_require__(12);
var _AffixMixin2 = _interopRequireDefault(_AffixMixin);
var _utilsDomUtils = __webpack_require__(13);
var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils);
var Affix = _react2['default'].createClass({
displayName: 'Affix',
statics: {
domUtils: _utilsDomUtils2['default']
},
mixins: [_AffixMixin2['default']],
render: function render() {
var holderStyle = { top: this.state.affixPositionTop };
return _react2['default'].createElement(
'div',
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, this.state.affixClass),
style: holderStyle }),
this.props.children
);
}
});
exports['default'] = Affix;
module.exports = exports['default'];
/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _utilsDomUtils = __webpack_require__(13);
var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils);
var _utilsEventListener = __webpack_require__(14);
var _utilsEventListener2 = _interopRequireDefault(_utilsEventListener);
var AffixMixin = {
propTypes: {
offset: _react2['default'].PropTypes.number,
offsetTop: _react2['default'].PropTypes.number,
offsetBottom: _react2['default'].PropTypes.number
},
getInitialState: function getInitialState() {
return {
affixClass: 'affix-top'
};
},
getPinnedOffset: function getPinnedOffset(DOMNode) {
if (this.pinnedOffset) {
return this.pinnedOffset;
}
DOMNode.className = DOMNode.className.replace(/affix-top|affix-bottom|affix/, '');
DOMNode.className += DOMNode.className.length ? ' affix' : 'affix';
this.pinnedOffset = _utilsDomUtils2['default'].getOffset(DOMNode).top - window.pageYOffset;
return this.pinnedOffset;
},
checkPosition: function checkPosition() {
var DOMNode = undefined,
scrollHeight = undefined,
scrollTop = undefined,
position = undefined,
offsetTop = undefined,
offsetBottom = undefined,
affix = undefined,
affixType = undefined,
affixPositionTop = undefined;
// TODO: or not visible
if (!this.isMounted()) {
return;
}
DOMNode = _react2['default'].findDOMNode(this);
scrollHeight = document.documentElement.offsetHeight;
scrollTop = window.pageYOffset;
position = _utilsDomUtils2['default'].getOffset(DOMNode);
if (this.affixed === 'top') {
position.top += scrollTop;
}
offsetTop = this.props.offsetTop != null ? this.props.offsetTop : this.props.offset;
offsetBottom = this.props.offsetBottom != null ? this.props.offsetBottom : this.props.offset;
if (offsetTop == null && offsetBottom == null) {
return;
}
if (offsetTop == null) {
offsetTop = 0;
}
if (offsetBottom == null) {
offsetBottom = 0;
}
if (this.unpin != null && scrollTop + this.unpin <= position.top) {
affix = false;
} else if (offsetBottom != null && position.top + DOMNode.offsetHeight >= scrollHeight - offsetBottom) {
affix = 'bottom';
} else if (offsetTop != null && scrollTop <= offsetTop) {
affix = 'top';
} else {
affix = false;
}
if (this.affixed === affix) {
return;
}
if (this.unpin != null) {
DOMNode.style.top = '';
}
affixType = 'affix' + (affix ? '-' + affix : '');
this.affixed = affix;
this.unpin = affix === 'bottom' ? this.getPinnedOffset(DOMNode) : null;
if (affix === 'bottom') {
DOMNode.className = DOMNode.className.replace(/affix-top|affix-bottom|affix/, 'affix-bottom');
affixPositionTop = scrollHeight - offsetBottom - DOMNode.offsetHeight - _utilsDomUtils2['default'].getOffset(DOMNode).top;
}
this.setState({
affixClass: affixType,
affixPositionTop: affixPositionTop
});
},
checkPositionWithEventLoop: function checkPositionWithEventLoop() {
setTimeout(this.checkPosition, 0);
},
componentDidMount: function componentDidMount() {
this._onWindowScrollListener = _utilsEventListener2['default'].listen(window, 'scroll', this.checkPosition);
this._onDocumentClickListener = _utilsEventListener2['default'].listen(_utilsDomUtils2['default'].ownerDocument(this), 'click', this.checkPositionWithEventLoop);
},
componentWillUnmount: function componentWillUnmount() {
if (this._onWindowScrollListener) {
this._onWindowScrollListener.remove();
}
if (this._onDocumentClickListener) {
this._onDocumentClickListener.remove();
}
},
componentDidUpdate: function componentDidUpdate(prevProps, prevState) {
if (prevState.affixClass === this.state.affixClass) {
this.checkPositionWithEventLoop();
}
}
};
exports['default'] = AffixMixin;
module.exports = exports['default'];
/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
/**
* Get elements owner document
*
* @param {ReactComponent|HTMLElement} componentOrElement
* @returns {HTMLElement}
*/
function ownerDocument(componentOrElement) {
var elem = _react2['default'].findDOMNode(componentOrElement);
return elem && elem.ownerDocument || document;
}
/**
* Shortcut to compute element style
*
* @param {HTMLElement} elem
* @returns {CssStyle}
*/
function getComputedStyles(elem) {
return ownerDocument(elem).defaultView.getComputedStyle(elem, null);
}
/**
* Get elements offset
*
* TODO: REMOVE JQUERY!
*
* @param {HTMLElement} DOMNode
* @returns {{top: number, left: number}}
*/
function getOffset(DOMNode) {
if (window.jQuery) {
return window.jQuery(DOMNode).offset();
}
var docElem = ownerDocument(DOMNode).documentElement;
var box = { top: 0, left: 0 };
// If we don't have gBCR, just use 0,0 rather than error
// BlackBerry 5, iOS 3 (original iPhone)
if (typeof DOMNode.getBoundingClientRect !== 'undefined') {
box = DOMNode.getBoundingClientRect();
}
return {
top: box.top + window.pageYOffset - docElem.clientTop,
left: box.left + window.pageXOffset - docElem.clientLeft
};
}
/**
* Get elements position
*
* TODO: REMOVE JQUERY!
*
* @param {HTMLElement} elem
* @param {HTMLElement?} offsetParent
* @returns {{top: number, left: number}}
*/
function getPosition(elem, offsetParent) {
if (window.jQuery) {
return window.jQuery(elem).position();
}
var offset = undefined,
parentOffset = { top: 0, left: 0 };
// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
if (getComputedStyles(elem).position === 'fixed') {
// We assume that getBoundingClientRect is available when computed position is fixed
offset = elem.getBoundingClientRect();
} else {
if (!offsetParent) {
// Get *real* offsetParent
offsetParent = offsetParentFunc(elem);
}
// Get correct offsets
offset = getOffset(elem);
if (offsetParent.nodeName !== 'HTML') {
parentOffset = getOffset(offsetParent);
}
// Add offsetParent borders
parentOffset.top += parseInt(getComputedStyles(offsetParent).borderTopWidth, 10);
parentOffset.left += parseInt(getComputedStyles(offsetParent).borderLeftWidth, 10);
}
// Subtract parent offsets and element margins
return {
top: offset.top - parentOffset.top - parseInt(getComputedStyles(elem).marginTop, 10),
left: offset.left - parentOffset.left - parseInt(getComputedStyles(elem).marginLeft, 10)
};
}
/**
* Get parent element
*
* @param {HTMLElement?} elem
* @returns {HTMLElement}
*/
function offsetParentFunc(elem) {
var docElem = ownerDocument(elem).documentElement;
var offsetParent = elem.offsetParent || docElem;
while (offsetParent && (offsetParent.nodeName !== 'HTML' && getComputedStyles(offsetParent).position === 'static')) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent || docElem;
}
exports['default'] = {
ownerDocument: ownerDocument,
getComputedStyles: getComputedStyles,
getOffset: getOffset,
getPosition: getPosition,
offsetParent: offsetParentFunc
};
module.exports = exports['default'];
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-2014 Facebook, Inc.
*
* This file contains a modified version of:
* https://github.com/facebook/react/blob/v0.12.0/src/vendor/stubs/EventListener.js
*
* 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.
*
* TODO: remove in favour of solution provided by:
* https://github.com/facebook/react/issues/285
*/
/**
* Does not take into account specific nature of platform.
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var EventListener = {
/**
* Listen to DOM events during the bubble phase.
*
* @param {DOMEventTarget} target DOM element to register listener on.
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
* @param {function} callback Callback function.
* @return {object} Object with a `remove` method.
*/
listen: function listen(target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, false);
return {
remove: function remove() {
target.removeEventListener(eventType, callback, false);
}
};
} else if (target.attachEvent) {
target.attachEvent('on' + eventType, callback);
return {
remove: function remove() {
target.detachEvent('on' + eventType, callback);
}
};
}
}
};
exports['default'] = EventListener;
module.exports = exports['default'];
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var Alert = _react2['default'].createClass({
displayName: 'Alert',
mixins: [_BootstrapMixin2['default']],
propTypes: {
onDismiss: _react2['default'].PropTypes.func,
dismissAfter: _react2['default'].PropTypes.number
},
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'alert',
bsStyle: 'info'
};
},
renderDismissButton: function renderDismissButton() {
return _react2['default'].createElement(
'button',
{
type: 'button',
className: 'close',
onClick: this.props.onDismiss,
'aria-hidden': 'true' },
'×'
);
},
render: function render() {
var classes = this.getBsClassSet();
var isDismissable = !!this.props.onDismiss;
classes['alert-dismissable'] = isDismissable;
return _react2['default'].createElement(
'div',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
isDismissable ? this.renderDismissButton() : null,
this.props.children
);
},
componentDidMount: function componentDidMount() {
if (this.props.dismissAfter && this.props.onDismiss) {
this.dismissTimer = setTimeout(this.props.onDismiss, this.props.dismissAfter);
}
},
componentWillUnmount: function componentWillUnmount() {
clearTimeout(this.dismissTimer);
}
});
exports['default'] = Alert;
module.exports = exports['default'];
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var Badge = _react2['default'].createClass({
displayName: 'Badge',
propTypes: {
pullRight: _react2['default'].PropTypes.bool
},
hasContent: function hasContent() {
return _utilsValidComponentChildren2['default'].hasValidComponent(this.props.children) || _react2['default'].Children.count(this.props.children) > 1 || typeof this.props.children === 'string' || typeof this.props.children === 'number';
},
render: function render() {
var classes = {
'pull-right': this.props.pullRight,
'badge': this.hasContent()
};
return _react2['default'].createElement(
'span',
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.children
);
}
});
exports['default'] = Badge;
module.exports = exports['default'];
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var Button = _react2['default'].createClass({
displayName: 'Button',
mixins: [_BootstrapMixin2['default']],
propTypes: {
active: _react2['default'].PropTypes.bool,
disabled: _react2['default'].PropTypes.bool,
block: _react2['default'].PropTypes.bool,
navItem: _react2['default'].PropTypes.bool,
navDropdown: _react2['default'].PropTypes.bool,
componentClass: _react2['default'].PropTypes.node,
href: _react2['default'].PropTypes.string,
target: _react2['default'].PropTypes.string
},
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'button',
bsStyle: 'default',
type: 'button'
};
},
render: function render() {
var classes = this.props.navDropdown ? {} : this.getBsClassSet();
var renderFuncName = undefined;
classes = _extends({
active: this.props.active,
'btn-block': this.props.block
}, classes);
if (this.props.navItem) {
return this.renderNavItem(classes);
}
renderFuncName = this.props.href || this.props.target || this.props.navDropdown ? 'renderAnchor' : 'renderButton';
return this[renderFuncName](classes);
},
renderAnchor: function renderAnchor(classes) {
var Component = this.props.componentClass || 'a';
var href = this.props.href || '#';
classes.disabled = this.props.disabled;
return _react2['default'].createElement(
Component,
_extends({}, this.props, {
href: href,
className: (0, _classnames2['default'])(this.props.className, classes),
role: 'button' }),
this.props.children
);
},
renderButton: function renderButton(classes) {
var Component = this.props.componentClass || 'button';
return _react2['default'].createElement(
Component,
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.children
);
},
renderNavItem: function renderNavItem(classes) {
var liClasses = {
active: this.props.active
};
return _react2['default'].createElement(
'li',
{ className: (0, _classnames2['default'])(liClasses) },
this.renderAnchor(classes)
);
}
});
exports['default'] = Button;
module.exports = exports['default'];
// eslint-disable-line object-shorthand
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _utilsCustomPropTypes = __webpack_require__(9);
var _utilsCustomPropTypes2 = _interopRequireDefault(_utilsCustomPropTypes);
var ButtonGroup = _react2['default'].createClass({
displayName: 'ButtonGroup',
mixins: [_BootstrapMixin2['default']],
propTypes: {
vertical: _react2['default'].PropTypes.bool,
justified: _react2['default'].PropTypes.bool,
block: _utilsCustomPropTypes2['default'].all([_react2['default'].PropTypes.bool, function (props, propName, componentName) {
if (props.block && !props.vertical) {
return new Error('The block property requires the vertical property to be set to have any effect');
}
}])
},
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'button-group'
};
},
render: function render() {
var classes = this.getBsClassSet();
classes['btn-group'] = !this.props.vertical;
classes['btn-group-vertical'] = this.props.vertical;
classes['btn-group-justified'] = this.props.justified;
classes['btn-block'] = this.props.block;
return _react2['default'].createElement(
'div',
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.children
);
}
});
exports['default'] = ButtonGroup;
module.exports = exports['default'];
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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) subClass.__proto__ = superClass; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _Button = __webpack_require__(17);
var _Button2 = _interopRequireDefault(_Button);
var _FormGroup = __webpack_require__(20);
var _FormGroup2 = _interopRequireDefault(_FormGroup);
var _InputBase2 = __webpack_require__(21);
var _InputBase3 = _interopRequireDefault(_InputBase2);
var _utilsChildrenValueInputValidation = __webpack_require__(22);
var _utilsChildrenValueInputValidation2 = _interopRequireDefault(_utilsChildrenValueInputValidation);
var ButtonInput = (function (_InputBase) {
function ButtonInput() {
_classCallCheck(this, ButtonInput);
if (_InputBase != null) {
_InputBase.apply(this, arguments);
}
}
_inherits(ButtonInput, _InputBase);
_createClass(ButtonInput, [{
key: 'renderFormGroup',
value: function renderFormGroup(children) {
var _props = this.props;
var bsStyle = _props.bsStyle;
var value = _props.value;
var other = _objectWithoutProperties(_props, ['bsStyle', 'value']);
// eslint-disable-line object-shorthand
return _react2['default'].createElement(
_FormGroup2['default'],
other,
children
);
}
}, {
key: 'renderInput',
value: function renderInput() {
var _props2 = this.props;
var children = _props2.children;
var value = _props2.value;
var other = _objectWithoutProperties(_props2, ['children', 'value']);
// eslint-disable-line object-shorthand
var val = children ? children : value;
return _react2['default'].createElement(_Button2['default'], _extends({}, other, { componentClass: 'input', ref: 'input', key: 'input', value: val }));
}
}]);
return ButtonInput;
})(_InputBase3['default']);
ButtonInput.types = ['button', 'reset', 'submit'];
ButtonInput.defaultProps = {
type: 'button'
};
ButtonInput.propTypes = {
type: _react2['default'].PropTypes.oneOf(ButtonInput.types),
bsStyle: function bsStyle(props) {
//defer to Button propTypes of bsStyle
return null;
},
children: _utilsChildrenValueInputValidation2['default'],
value: _utilsChildrenValueInputValidation2['default']
};
exports['default'] = ButtonInput;
module.exports = exports['default'];
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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) subClass.__proto__ = superClass; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var FormGroup = (function (_React$Component) {
function FormGroup() {
_classCallCheck(this, FormGroup);
if (_React$Component != null) {
_React$Component.apply(this, arguments);
}
}
_inherits(FormGroup, _React$Component);
_createClass(FormGroup, [{
key: 'render',
value: function render() {
var classes = {
'form-group': !this.props.standalone,
'form-group-lg': !this.props.standalone && this.props.bsSize === 'large',
'form-group-sm': !this.props.standalone && this.props.bsSize === 'small',
'has-feedback': this.props.hasFeedback,
'has-success': this.props.bsStyle === 'success',
'has-warning': this.props.bsStyle === 'warning',
'has-error': this.props.bsStyle === 'error'
};
return _react2['default'].createElement(
'div',
{ className: (0, _classnames2['default'])(classes, this.props.groupClassName) },
this.props.children
);
}
}]);
return FormGroup;
})(_react2['default'].Component);
FormGroup.defaultProps = {
standalone: false
};
FormGroup.propTypes = {
standalone: _react2['default'].PropTypes.bool,
hasFeedback: _react2['default'].PropTypes.bool,
bsSize: function bsSize(props) {
if (props.standalone && props.bsSize !== undefined) {
return new Error('bsSize will not be used when `standalone` is set.');
}
return _react2['default'].PropTypes.oneOf(['small', 'medium', 'large']).apply(null, arguments);
},
bsStyle: _react2['default'].PropTypes.oneOf(['success', 'warning', 'error']),
groupClassName: _react2['default'].PropTypes.string
};
exports['default'] = FormGroup;
module.exports = exports['default'];
/***/ },
/* 21 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _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) subClass.__proto__ = superClass; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _FormGroup = __webpack_require__(20);
var _FormGroup2 = _interopRequireDefault(_FormGroup);
var InputBase = (function (_React$Component) {
function InputBase() {
_classCallCheck(this, InputBase);
if (_React$Component != null) {
_React$Component.apply(this, arguments);
}
}
_inherits(InputBase, _React$Component);
_createClass(InputBase, [{
key: 'getInputDOMNode',
value: function getInputDOMNode() {
return _react2['default'].findDOMNode(this.refs.input);
}
}, {
key: 'getValue',
value: function getValue() {
if (this.props.type === 'static') {
return this.props.value;
} else if (this.props.type) {
if (this.props.type === 'select' && this.props.multiple) {
return this.getSelectedOptions();
} else {
return this.getInputDOMNode().value;
}
} else {
throw 'Cannot use getValue without specifying input type.';
}
}
}, {
key: 'getChecked',
value: function getChecked() {
return this.getInputDOMNode().checked;
}
}, {
key: 'getSelectedOptions',
value: function getSelectedOptions() {
var values = [];
Array.prototype.forEach.call(this.getInputDOMNode().getElementsByTagName('option'), function (option) {
if (option.selected) {
var value = option.getAttribute('value') || option.innerHtml;
values.push(value);
}
});
return values;
}
}, {
key: 'isCheckboxOrRadio',
value: function isCheckboxOrRadio() {
return this.props.type === 'checkbox' || this.props.type === 'radio';
}
}, {
key: 'isFile',
value: function isFile() {
return this.props.type === 'file';
}
}, {
key: 'renderInputGroup',
value: function renderInputGroup(children) {
var addonBefore = this.props.addonBefore ? _react2['default'].createElement(
'span',
{ className: 'input-group-addon', key: 'addonBefore' },
this.props.addonBefore
) : null;
var addonAfter = this.props.addonAfter ? _react2['default'].createElement(
'span',
{ className: 'input-group-addon', key: 'addonAfter' },
this.props.addonAfter
) : null;
var buttonBefore = this.props.buttonBefore ? _react2['default'].createElement(
'span',
{ className: 'input-group-btn' },
this.props.buttonBefore
) : null;
var buttonAfter = this.props.buttonAfter ? _react2['default'].createElement(
'span',
{ className: 'input-group-btn' },
this.props.buttonAfter
) : null;
var inputGroupClassName = undefined;
switch (this.props.bsSize) {
case 'small':
inputGroupClassName = 'input-group-sm';break;
case 'large':
inputGroupClassName = 'input-group-lg';break;
}
return addonBefore || addonAfter || buttonBefore || buttonAfter ? _react2['default'].createElement(
'div',
{ className: (0, _classnames2['default'])(inputGroupClassName, 'input-group'), key: 'input-group' },
addonBefore,
buttonBefore,
children,
addonAfter,
buttonAfter
) : children;
}
}, {
key: 'renderIcon',
value: function renderIcon() {
var classes = {
'glyphicon': true,
'form-control-feedback': true,
'glyphicon-ok': this.props.bsStyle === 'success',
'glyphicon-warning-sign': this.props.bsStyle === 'warning',
'glyphicon-remove': this.props.bsStyle === 'error'
};
return this.props.hasFeedback ? _react2['default'].createElement('span', { className: (0, _classnames2['default'])(classes), key: 'icon' }) : null;
}
}, {
key: 'renderHelp',
value: function renderHelp() {
return this.props.help ? _react2['default'].createElement(
'span',
{ className: 'help-block', key: 'help' },
this.props.help
) : null;
}
}, {
key: 'renderCheckboxAndRadioWrapper',
value: function renderCheckboxAndRadioWrapper(children) {
var classes = {
'checkbox': this.props.type === 'checkbox',
'radio': this.props.type === 'radio'
};
return _react2['default'].createElement(
'div',
{ className: (0, _classnames2['default'])(classes), key: 'checkboxRadioWrapper' },
children
);
}
}, {
key: 'renderWrapper',
value: function renderWrapper(children) {
return this.props.wrapperClassName ? _react2['default'].createElement(
'div',
{ className: this.props.wrapperClassName, key: 'wrapper' },
children
) : children;
}
}, {
key: 'renderLabel',
value: function renderLabel(children) {
var classes = {
'control-label': !this.isCheckboxOrRadio()
};
classes[this.props.labelClassName] = this.props.labelClassName;
return this.props.label ? _react2['default'].createElement(
'label',
{ htmlFor: this.props.id, className: (0, _classnames2['default'])(classes), key: 'label' },
children,
this.props.label
) : children;
}
}, {
key: 'renderInput',
value: function renderInput() {
if (!this.props.type) {
return this.props.children;
}
switch (this.props.type) {
case 'select':
return _react2['default'].createElement(
'select',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'form-control'), ref: 'input', key: 'input' }),
this.props.children
);
case 'textarea':
return _react2['default'].createElement('textarea', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'form-control'), ref: 'input', key: 'input' }));
case 'static':
return _react2['default'].createElement(
'p',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'form-control-static'), ref: 'input', key: 'input' }),
this.props.value
);
}
var className = this.isCheckboxOrRadio() || this.isFile() ? '' : 'form-control';
return _react2['default'].createElement('input', _extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, className), ref: 'input', key: 'input' }));
}
}, {
key: 'renderFormGroup',
value: function renderFormGroup(children) {
return _react2['default'].createElement(
_FormGroup2['default'],
this.props,
children
);
}
}, {
key: 'renderChildren',
value: function renderChildren() {
return !this.isCheckboxOrRadio() ? [this.renderLabel(), this.renderWrapper([this.renderInputGroup(this.renderInput()), this.renderIcon(), this.renderHelp()])] : this.renderWrapper([this.renderCheckboxAndRadioWrapper(this.renderLabel(this.renderInput())), this.renderHelp()]);
}
}, {
key: 'render',
value: function render() {
var children = this.renderChildren();
return this.renderFormGroup(children);
}
}]);
return InputBase;
})(_react2['default'].Component);
InputBase.propTypes = {
type: _react2['default'].PropTypes.string,
label: _react2['default'].PropTypes.node,
help: _react2['default'].PropTypes.node,
addonBefore: _react2['default'].PropTypes.node,
addonAfter: _react2['default'].PropTypes.node,
buttonBefore: _react2['default'].PropTypes.node,
buttonAfter: _react2['default'].PropTypes.node,
bsSize: _react2['default'].PropTypes.oneOf(['small', 'medium', 'large']),
bsStyle: _react2['default'].PropTypes.oneOf(['success', 'warning', 'error']),
hasFeedback: _react2['default'].PropTypes.bool,
id: _react2['default'].PropTypes.string,
groupClassName: _react2['default'].PropTypes.string,
wrapperClassName: _react2['default'].PropTypes.string,
labelClassName: _react2['default'].PropTypes.string,
multiple: _react2['default'].PropTypes.bool,
disabled: _react2['default'].PropTypes.bool,
value: _react2['default'].PropTypes.any
};
exports['default'] = InputBase;
module.exports = exports['default'];
/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = valueValidation;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _CustomPropTypes = __webpack_require__(9);
var propList = ['children', 'value'];
var typeList = [_react2['default'].PropTypes.number, _react2['default'].PropTypes.string];
function valueValidation(props, propName, componentName) {
var error = (0, _CustomPropTypes.singlePropFrom)(propList)(props, propName, componentName);
if (!error) {
var oneOfType = _react2['default'].PropTypes.oneOfType(typeList);
error = oneOfType(props, propName, componentName);
}
return error;
}
module.exports = exports['default'];
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var ButtonToolbar = _react2['default'].createClass({
displayName: 'ButtonToolbar',
mixins: [_BootstrapMixin2['default']],
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'button-toolbar'
};
},
render: function render() {
var classes = this.getBsClassSet();
return _react2['default'].createElement(
'div',
_extends({}, this.props, {
role: 'toolbar',
className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.children
);
}
});
exports['default'] = ButtonToolbar;
module.exports = exports['default'];
/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _CollapsibleMixin = __webpack_require__(25);
var _CollapsibleMixin2 = _interopRequireDefault(_CollapsibleMixin);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _utilsDomUtils = __webpack_require__(13);
var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var _utilsCreateChainedFunction = __webpack_require__(27);
var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction);
var CollapsibleNav = _react2['default'].createClass({
displayName: 'CollapsibleNav',
mixins: [_BootstrapMixin2['default'], _CollapsibleMixin2['default']],
propTypes: {
onSelect: _react2['default'].PropTypes.func,
activeHref: _react2['default'].PropTypes.string,
activeKey: _react2['default'].PropTypes.any,
collapsible: _react2['default'].PropTypes.bool,
expanded: _react2['default'].PropTypes.bool,
eventKey: _react2['default'].PropTypes.any
},
getCollapsibleDOMNode: function getCollapsibleDOMNode() {
return _react2['default'].findDOMNode(this);
},
getCollapsibleDimensionValue: function getCollapsibleDimensionValue() {
var height = 0;
var nodes = this.refs;
for (var key in nodes) {
if (nodes.hasOwnProperty(key)) {
var n = _react2['default'].findDOMNode(nodes[key]),
h = n.offsetHeight,
computedStyles = _utilsDomUtils2['default'].getComputedStyles(n);
height += h + parseInt(computedStyles.marginTop, 10) + parseInt(computedStyles.marginBottom, 10);
}
}
return height;
},
render: function render() {
/*
* this.props.collapsible is set in NavBar when an eventKey is supplied.
*/
var classes = this.props.collapsible ? this.getCollapsibleClassSet('navbar-collapse') : null;
var renderChildren = this.props.collapsible ? this.renderCollapsibleNavChildren : this.renderChildren;
return _react2['default'].createElement(
'div',
{ eventKey: this.props.eventKey, className: (0, _classnames2['default'])(this.props.className, classes) },
_utilsValidComponentChildren2['default'].map(this.props.children, renderChildren)
);
},
getChildActiveProp: function getChildActiveProp(child) {
if (child.props.active) {
return true;
}
if (this.props.activeKey != null) {
if (child.props.eventKey === this.props.activeKey) {
return true;
}
}
if (this.props.activeHref != null) {
if (child.props.href === this.props.activeHref) {
return true;
}
}
return child.props.active;
},
renderChildren: function renderChildren(child, index) {
var key = child.key ? child.key : index;
return (0, _react.cloneElement)(child, {
activeKey: this.props.activeKey,
activeHref: this.props.activeHref,
ref: 'nocollapse_' + key,
key: key,
navItem: true
});
},
renderCollapsibleNavChildren: function renderCollapsibleNavChildren(child, index) {
var key = child.key ? child.key : index;
return (0, _react.cloneElement)(child, {
active: this.getChildActiveProp(child),
activeKey: this.props.activeKey,
activeHref: this.props.activeHref,
onSelect: (0, _utilsCreateChainedFunction2['default'])(child.props.onSelect, this.props.onSelect),
ref: 'collapsible_' + key,
key: key,
navItem: true
});
}
});
exports['default'] = CollapsibleNav;
module.exports = exports['default'];
/***/ },
/* 25 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _utilsTransitionEvents = __webpack_require__(26);
var _utilsTransitionEvents2 = _interopRequireDefault(_utilsTransitionEvents);
var CollapsibleMixin = {
propTypes: {
defaultExpanded: _react2['default'].PropTypes.bool,
expanded: _react2['default'].PropTypes.bool
},
getInitialState: function getInitialState() {
var defaultExpanded = this.props.defaultExpanded != null ? this.props.defaultExpanded : this.props.expanded != null ? this.props.expanded : false;
return {
expanded: defaultExpanded,
collapsing: false
};
},
componentWillUpdate: function componentWillUpdate(nextProps, nextState) {
var willExpanded = nextProps.expanded != null ? nextProps.expanded : nextState.expanded;
if (willExpanded === this.isExpanded()) {
return;
}
// if the expanded state is being toggled, ensure node has a dimension value
// this is needed for the animation to work and needs to be set before
// the collapsing class is applied (after collapsing is applied the in class
// is removed and the node's dimension will be wrong)
var node = this.getCollapsibleDOMNode();
var dimension = this.dimension();
var value = '0';
if (!willExpanded) {
value = this.getCollapsibleDimensionValue();
}
node.style[dimension] = value + 'px';
this._afterWillUpdate();
},
componentDidUpdate: function componentDidUpdate(prevProps, prevState) {
// check if expanded is being toggled; if so, set collapsing
this._checkToggleCollapsing(prevProps, prevState);
// check if collapsing was turned on; if so, start animation
this._checkStartAnimation();
},
// helps enable test stubs
_afterWillUpdate: function _afterWillUpdate() {},
_checkStartAnimation: function _checkStartAnimation() {
if (!this.state.collapsing) {
return;
}
var node = this.getCollapsibleDOMNode();
var dimension = this.dimension();
var value = this.getCollapsibleDimensionValue();
// setting the dimension here starts the transition animation
var result = undefined;
if (this.isExpanded()) {
result = value + 'px';
} else {
result = '0px';
}
node.style[dimension] = result;
},
_checkToggleCollapsing: function _checkToggleCollapsing(prevProps, prevState) {
var wasExpanded = prevProps.expanded != null ? prevProps.expanded : prevState.expanded;
var isExpanded = this.isExpanded();
if (wasExpanded !== isExpanded) {
if (wasExpanded) {
this._handleCollapse();
} else {
this._handleExpand();
}
}
},
_handleExpand: function _handleExpand() {
var _this = this;
var node = this.getCollapsibleDOMNode();
var dimension = this.dimension();
var complete = function complete() {
_this._removeEndEventListener(node, complete);
// remove dimension value - this ensures the collapsible item can grow
// in dimension after initial display (such as an image loading)
node.style[dimension] = '';
_this.setState({
collapsing: false
});
};
this._addEndEventListener(node, complete);
this.setState({
collapsing: true
});
},
_handleCollapse: function _handleCollapse() {
var _this2 = this;
var node = this.getCollapsibleDOMNode();
var complete = function complete() {
_this2._removeEndEventListener(node, complete);
_this2.setState({
collapsing: false
});
};
this._addEndEventListener(node, complete);
this.setState({
collapsing: true
});
},
// helps enable test stubs
_addEndEventListener: function _addEndEventListener(node, complete) {
_utilsTransitionEvents2['default'].addEndEventListener(node, complete);
},
// helps enable test stubs
_removeEndEventListener: function _removeEndEventListener(node, complete) {
_utilsTransitionEvents2['default'].removeEndEventListener(node, complete);
},
dimension: function dimension() {
return typeof this.getCollapsibleDimension === 'function' ? this.getCollapsibleDimension() : 'height';
},
isExpanded: function isExpanded() {
return this.props.expanded != null ? this.props.expanded : this.state.expanded;
},
getCollapsibleClassSet: function getCollapsibleClassSet(className) {
var classes = {};
if (typeof className === 'string') {
className.split(' ').forEach(function (subClasses) {
if (subClasses) {
classes[subClasses] = true;
}
});
}
classes.collapsing = this.state.collapsing;
classes.collapse = !this.state.collapsing;
classes['in'] = this.isExpanded() && !this.state.collapsing;
return classes;
}
};
exports['default'] = CollapsibleMixin;
module.exports = exports['default'];
/***/ },
/* 26 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-2014, Facebook, Inc.
* All rights reserved.
*
* This file contains a modified version of:
* https://github.com/facebook/react/blob/v0.12.0/src/addons/transitions/ReactTransitionEvents.js
*
* This source code is licensed under the BSD-style license found here:
* https://github.com/facebook/react/blob/v0.12.0/LICENSE
* An additional grant of patent rights can be found here:
* https://github.com/facebook/react/blob/v0.12.0/PATENTS
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
/**
* EVENT_NAME_MAP is used to determine which event fired when a
* transition/animation ends, based on the style property used to
* define that event.
*/
var EVENT_NAME_MAP = {
transitionend: {
'transition': 'transitionend',
'WebkitTransition': 'webkitTransitionEnd',
'MozTransition': 'mozTransitionEnd',
'OTransition': 'oTransitionEnd',
'msTransition': 'MSTransitionEnd'
},
animationend: {
'animation': 'animationend',
'WebkitAnimation': 'webkitAnimationEnd',
'MozAnimation': 'mozAnimationEnd',
'OAnimation': 'oAnimationEnd',
'msAnimation': 'MSAnimationEnd'
}
};
var endEvents = [];
function detectEvents() {
var testEl = document.createElement('div');
var style = testEl.style;
// On some platforms, in particular some releases of Android 4.x,
// the un-prefixed "animation" and "transition" properties are defined on the
// style object but the events that fire will still be prefixed, so we need
// to check if the un-prefixed events are useable, and if not remove them
// from the map
if (!('AnimationEvent' in window)) {
delete EVENT_NAME_MAP.animationend.animation;
}
if (!('TransitionEvent' in window)) {
delete EVENT_NAME_MAP.transitionend.transition;
}
for (var baseEventName in EVENT_NAME_MAP) {
var baseEvents = EVENT_NAME_MAP[baseEventName];
for (var styleName in baseEvents) {
if (styleName in style) {
endEvents.push(baseEvents[styleName]);
break;
}
}
}
}
if (canUseDOM) {
detectEvents();
}
// We use the raw {add|remove}EventListener() call because EventListener
// does not know how to remove event listeners and we really should
// clean up. Also, these events are not triggered in older browsers
// so we should be A-OK here.
function addEventListener(node, eventName, eventListener) {
node.addEventListener(eventName, eventListener, false);
}
function removeEventListener(node, eventName, eventListener) {
node.removeEventListener(eventName, eventListener, false);
}
var ReactTransitionEvents = {
addEndEventListener: function addEndEventListener(node, eventListener) {
if (endEvents.length === 0) {
// If CSS transitions are not supported, trigger an "end animation"
// event immediately.
window.setTimeout(eventListener, 0);
return;
}
endEvents.forEach(function (endEvent) {
addEventListener(node, endEvent, eventListener);
});
},
removeEndEventListener: function removeEndEventListener(node, eventListener) {
if (endEvents.length === 0) {
return;
}
endEvents.forEach(function (endEvent) {
removeEventListener(node, endEvent, eventListener);
});
}
};
exports['default'] = ReactTransitionEvents;
module.exports = exports['default'];
/***/ },
/* 27 */
/***/ function(module, exports, __webpack_require__) {
/**
* Safe chained function
*
* Will only create a new function if needed,
* otherwise will pass back existing functions or null.
*
* @param {function} one
* @param {function} two
* @returns {function|null}
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function createChainedFunction(one, two) {
var hasOne = typeof one === 'function';
var hasTwo = typeof two === 'function';
if (!hasOne && !hasTwo) {
return null;
}
if (!hasOne) {
return two;
}
if (!hasTwo) {
return one;
}
return function chainedFunction() {
one.apply(this, arguments);
two.apply(this, arguments);
};
}
exports['default'] = createChainedFunction;
module.exports = exports['default'];
/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var _Glyphicon = __webpack_require__(29);
var _Glyphicon2 = _interopRequireDefault(_Glyphicon);
var Carousel = _react2['default'].createClass({
displayName: 'Carousel',
mixins: [_BootstrapMixin2['default']],
propTypes: {
slide: _react2['default'].PropTypes.bool,
indicators: _react2['default'].PropTypes.bool,
interval: _react2['default'].PropTypes.number,
controls: _react2['default'].PropTypes.bool,
pauseOnHover: _react2['default'].PropTypes.bool,
wrap: _react2['default'].PropTypes.bool,
onSelect: _react2['default'].PropTypes.func,
onSlideEnd: _react2['default'].PropTypes.func,
activeIndex: _react2['default'].PropTypes.number,
defaultActiveIndex: _react2['default'].PropTypes.number,
direction: _react2['default'].PropTypes.oneOf(['prev', 'next']),
prevIcon: _react2['default'].PropTypes.node,
nextIcon: _react2['default'].PropTypes.node
},
getDefaultProps: function getDefaultProps() {
return {
slide: true,
interval: 5000,
pauseOnHover: true,
wrap: true,
indicators: true,
controls: true,
prevIcon: _react2['default'].createElement(_Glyphicon2['default'], { glyph: 'chevron-left' }),
nextIcon: _react2['default'].createElement(_Glyphicon2['default'], { glyph: 'chevron-right' })
};
},
getInitialState: function getInitialState() {
return {
activeIndex: this.props.defaultActiveIndex == null ? 0 : this.props.defaultActiveIndex,
previousActiveIndex: null,
direction: null
};
},
getDirection: function getDirection(prevIndex, index) {
if (prevIndex === index) {
return null;
}
return prevIndex > index ? 'prev' : 'next';
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
var activeIndex = this.getActiveIndex();
if (nextProps.activeIndex != null && nextProps.activeIndex !== activeIndex) {
clearTimeout(this.timeout);
this.setState({
previousActiveIndex: activeIndex,
direction: nextProps.direction != null ? nextProps.direction : this.getDirection(activeIndex, nextProps.activeIndex)
});
}
},
componentDidMount: function componentDidMount() {
this.waitForNext();
},
componentWillUnmount: function componentWillUnmount() {
clearTimeout(this.timeout);
},
next: function next(e) {
if (e) {
e.preventDefault();
}
var index = this.getActiveIndex() + 1;
var count = _utilsValidComponentChildren2['default'].numberOf(this.props.children);
if (index > count - 1) {
if (!this.props.wrap) {
return;
}
index = 0;
}
this.handleSelect(index, 'next');
},
prev: function prev(e) {
if (e) {
e.preventDefault();
}
var index = this.getActiveIndex() - 1;
if (index < 0) {
if (!this.props.wrap) {
return;
}
index = _utilsValidComponentChildren2['default'].numberOf(this.props.children) - 1;
}
this.handleSelect(index, 'prev');
},
pause: function pause() {
this.isPaused = true;
clearTimeout(this.timeout);
},
play: function play() {
this.isPaused = false;
this.waitForNext();
},
waitForNext: function waitForNext() {
if (!this.isPaused && this.props.slide && this.props.interval && this.props.activeIndex == null) {
this.timeout = setTimeout(this.next, this.props.interval);
}
},
handleMouseOver: function handleMouseOver() {
if (this.props.pauseOnHover) {
this.pause();
}
},
handleMouseOut: function handleMouseOut() {
if (this.isPaused) {
this.play();
}
},
render: function render() {
var classes = {
carousel: true,
slide: this.props.slide
};
return _react2['default'].createElement(
'div',
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, classes),
onMouseOver: this.handleMouseOver,
onMouseOut: this.handleMouseOut }),
this.props.indicators ? this.renderIndicators() : null,
_react2['default'].createElement(
'div',
{ className: 'carousel-inner', ref: 'inner' },
_utilsValidComponentChildren2['default'].map(this.props.children, this.renderItem)
),
this.props.controls ? this.renderControls() : null
);
},
renderPrev: function renderPrev() {
return _react2['default'].createElement(
'a',
{ className: 'left carousel-control', href: '#prev', key: 0, onClick: this.prev },
this.props.prevIcon
);
},
renderNext: function renderNext() {
return _react2['default'].createElement(
'a',
{ className: 'right carousel-control', href: '#next', key: 1, onClick: this.next },
this.props.nextIcon
);
},
renderControls: function renderControls() {
if (!this.props.wrap) {
var activeIndex = this.getActiveIndex();
var count = _utilsValidComponentChildren2['default'].numberOf(this.props.children);
return [activeIndex !== 0 ? this.renderPrev() : null, activeIndex !== count - 1 ? this.renderNext() : null];
}
return [this.renderPrev(), this.renderNext()];
},
renderIndicator: function renderIndicator(child, index) {
var className = index === this.getActiveIndex() ? 'active' : null;
return _react2['default'].createElement('li', {
key: index,
className: className,
onClick: this.handleSelect.bind(this, index, null) });
},
renderIndicators: function renderIndicators() {
var indicators = [];
_utilsValidComponentChildren2['default'].forEach(this.props.children, function (child, index) {
indicators.push(this.renderIndicator(child, index),
// Force whitespace between indicator elements, bootstrap
// requires this for correct spacing of elements.
' ');
}, this);
return _react2['default'].createElement(
'ol',
{ className: 'carousel-indicators' },
indicators
);
},
getActiveIndex: function getActiveIndex() {
return this.props.activeIndex != null ? this.props.activeIndex : this.state.activeIndex;
},
handleItemAnimateOutEnd: function handleItemAnimateOutEnd() {
this.setState({
previousActiveIndex: null,
direction: null
}, function () {
this.waitForNext();
if (this.props.onSlideEnd) {
this.props.onSlideEnd();
}
});
},
renderItem: function renderItem(child, index) {
var activeIndex = this.getActiveIndex();
var isActive = index === activeIndex;
var isPreviousActive = this.state.previousActiveIndex != null && this.state.previousActiveIndex === index && this.props.slide;
return (0, _react.cloneElement)(child, {
active: isActive,
ref: child.ref,
key: child.key ? child.key : index,
index: index,
animateOut: isPreviousActive,
animateIn: isActive && this.state.previousActiveIndex != null && this.props.slide,
direction: this.state.direction,
onAnimateOutEnd: isPreviousActive ? this.handleItemAnimateOutEnd : null
});
},
handleSelect: function handleSelect(index, direction) {
clearTimeout(this.timeout);
var previousActiveIndex = this.getActiveIndex();
direction = direction || this.getDirection(previousActiveIndex, index);
if (this.props.onSelect) {
this.props.onSelect(index, direction);
}
if (this.props.activeIndex == null && index !== previousActiveIndex) {
if (this.state.previousActiveIndex != null) {
// If currently animating don't activate the new index.
// TODO: look into queuing this canceled call and
// animating after the current animation has ended.
return;
}
this.setState({
activeIndex: index,
previousActiveIndex: previousActiveIndex,
direction: direction
});
}
}
});
exports['default'] = Carousel;
module.exports = exports['default'];
/***/ },
/* 29 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _styleMaps = __webpack_require__(8);
var _styleMaps2 = _interopRequireDefault(_styleMaps);
var Glyphicon = _react2['default'].createClass({
displayName: 'Glyphicon',
mixins: [_BootstrapMixin2['default']],
propTypes: {
glyph: _react2['default'].PropTypes.oneOf(_styleMaps2['default'].GLYPHS).isRequired
},
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'glyphicon'
};
},
render: function render() {
var classes = this.getBsClassSet();
classes['glyphicon-' + this.props.glyph] = true;
return _react2['default'].createElement(
'span',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.children
);
}
});
exports['default'] = Glyphicon;
module.exports = exports['default'];
/***/ },
/* 30 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _utilsTransitionEvents = __webpack_require__(26);
var _utilsTransitionEvents2 = _interopRequireDefault(_utilsTransitionEvents);
var CarouselItem = _react2['default'].createClass({
displayName: 'CarouselItem',
propTypes: {
direction: _react2['default'].PropTypes.oneOf(['prev', 'next']),
onAnimateOutEnd: _react2['default'].PropTypes.func,
active: _react2['default'].PropTypes.bool,
animateIn: _react2['default'].PropTypes.bool,
animateOut: _react2['default'].PropTypes.bool,
caption: _react2['default'].PropTypes.node,
index: _react2['default'].PropTypes.number
},
getInitialState: function getInitialState() {
return {
direction: null
};
},
getDefaultProps: function getDefaultProps() {
return {
animation: true
};
},
handleAnimateOutEnd: function handleAnimateOutEnd() {
if (this.props.onAnimateOutEnd && this.isMounted()) {
this.props.onAnimateOutEnd(this.props.index);
}
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
if (this.props.active !== nextProps.active) {
this.setState({
direction: null
});
}
},
componentDidUpdate: function componentDidUpdate(prevProps) {
if (!this.props.active && prevProps.active) {
_utilsTransitionEvents2['default'].addEndEventListener(_react2['default'].findDOMNode(this), this.handleAnimateOutEnd);
}
if (this.props.active !== prevProps.active) {
setTimeout(this.startAnimation, 20);
}
},
startAnimation: function startAnimation() {
if (!this.isMounted()) {
return;
}
this.setState({
direction: this.props.direction === 'prev' ? 'right' : 'left'
});
},
render: function render() {
var classes = {
item: true,
active: this.props.active && !this.props.animateIn || this.props.animateOut,
next: this.props.active && this.props.animateIn && this.props.direction === 'next',
prev: this.props.active && this.props.animateIn && this.props.direction === 'prev'
};
if (this.state.direction && (this.props.animateIn || this.props.animateOut)) {
classes[this.state.direction] = true;
}
return _react2['default'].createElement(
'div',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.children,
this.props.caption ? this.renderCaption() : null
);
},
renderCaption: function renderCaption() {
return _react2['default'].createElement(
'div',
{ className: 'carousel-caption' },
this.props.caption
);
}
});
exports['default'] = CarouselItem;
module.exports = exports['default'];
/***/ },
/* 31 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _styleMaps = __webpack_require__(8);
var _styleMaps2 = _interopRequireDefault(_styleMaps);
var Col = _react2['default'].createClass({
displayName: 'Col',
propTypes: {
xs: _react2['default'].PropTypes.number,
sm: _react2['default'].PropTypes.number,
md: _react2['default'].PropTypes.number,
lg: _react2['default'].PropTypes.number,
xsOffset: _react2['default'].PropTypes.number,
smOffset: _react2['default'].PropTypes.number,
mdOffset: _react2['default'].PropTypes.number,
lgOffset: _react2['default'].PropTypes.number,
xsPush: _react2['default'].PropTypes.number,
smPush: _react2['default'].PropTypes.number,
mdPush: _react2['default'].PropTypes.number,
lgPush: _react2['default'].PropTypes.number,
xsPull: _react2['default'].PropTypes.number,
smPull: _react2['default'].PropTypes.number,
mdPull: _react2['default'].PropTypes.number,
lgPull: _react2['default'].PropTypes.number,
componentClass: _react2['default'].PropTypes.node.isRequired
},
getDefaultProps: function getDefaultProps() {
return {
componentClass: 'div'
};
},
render: function render() {
var ComponentClass = this.props.componentClass;
var classes = {};
Object.keys(_styleMaps2['default'].SIZES).forEach(function (key) {
var size = _styleMaps2['default'].SIZES[key];
var prop = size;
var classPart = size + '-';
if (this.props[prop]) {
classes['col-' + classPart + this.props[prop]] = true;
}
prop = size + 'Offset';
classPart = size + '-offset-';
if (this.props[prop] >= 0) {
classes['col-' + classPart + this.props[prop]] = true;
}
prop = size + 'Push';
classPart = size + '-push-';
if (this.props[prop] >= 0) {
classes['col-' + classPart + this.props[prop]] = true;
}
prop = size + 'Pull';
classPart = size + '-pull-';
if (this.props[prop] >= 0) {
classes['col-' + classPart + this.props[prop]] = true;
}
}, this);
return _react2['default'].createElement(
ComponentClass,
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.children
);
}
});
exports['default'] = Col;
module.exports = exports['default'];
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _utilsCreateChainedFunction = __webpack_require__(27);
var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _DropdownStateMixin = __webpack_require__(33);
var _DropdownStateMixin2 = _interopRequireDefault(_DropdownStateMixin);
var _Button = __webpack_require__(17);
var _Button2 = _interopRequireDefault(_Button);
var _ButtonGroup = __webpack_require__(18);
var _ButtonGroup2 = _interopRequireDefault(_ButtonGroup);
var _DropdownMenu = __webpack_require__(34);
var _DropdownMenu2 = _interopRequireDefault(_DropdownMenu);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var DropdownButton = _react2['default'].createClass({
displayName: 'DropdownButton',
mixins: [_BootstrapMixin2['default'], _DropdownStateMixin2['default']],
propTypes: {
pullRight: _react2['default'].PropTypes.bool,
dropup: _react2['default'].PropTypes.bool,
title: _react2['default'].PropTypes.node,
href: _react2['default'].PropTypes.string,
onClick: _react2['default'].PropTypes.func,
onSelect: _react2['default'].PropTypes.func,
navItem: _react2['default'].PropTypes.bool,
noCaret: _react2['default'].PropTypes.bool,
buttonClassName: _react2['default'].PropTypes.string
},
render: function render() {
var renderMethod = this.props.navItem ? 'renderNavItem' : 'renderButtonGroup';
var caret = this.props.noCaret ? null : _react2['default'].createElement('span', { className: 'caret' });
return this[renderMethod]([_react2['default'].createElement(
_Button2['default'],
_extends({}, this.props, {
ref: 'dropdownButton',
className: (0, _classnames2['default'])('dropdown-toggle', this.props.buttonClassName),
onClick: (0, _utilsCreateChainedFunction2['default'])(this.props.onClick, this.handleDropdownClick),
key: 0,
navDropdown: this.props.navItem,
navItem: null,
title: null,
pullRight: null,
dropup: null }),
this.props.title,
' ',
caret
), _react2['default'].createElement(
_DropdownMenu2['default'],
{
ref: 'menu',
'aria-labelledby': this.props.id,
pullRight: this.props.pullRight,
key: 1 },
_utilsValidComponentChildren2['default'].map(this.props.children, this.renderMenuItem)
)]);
},
renderButtonGroup: function renderButtonGroup(children) {
var groupClasses = {
'open': this.state.open,
'dropup': this.props.dropup
};
return _react2['default'].createElement(
_ButtonGroup2['default'],
{
bsSize: this.props.bsSize,
className: (0, _classnames2['default'])(this.props.className, groupClasses) },
children
);
},
renderNavItem: function renderNavItem(children) {
var classes = {
'dropdown': true,
'open': this.state.open,
'dropup': this.props.dropup
};
return _react2['default'].createElement(
'li',
{ className: (0, _classnames2['default'])(this.props.className, classes) },
children
);
},
renderMenuItem: function renderMenuItem(child, index) {
// Only handle the option selection if an onSelect prop has been set on the
// component or it's child, this allows a user not to pass an onSelect
// handler and have the browser preform the default action.
var handleOptionSelect = this.props.onSelect || child.props.onSelect ? this.handleOptionSelect : null;
return (0, _react.cloneElement)(child, {
// Capture onSelect events
onSelect: (0, _utilsCreateChainedFunction2['default'])(child.props.onSelect, handleOptionSelect),
key: child.key ? child.key : index
});
},
handleDropdownClick: function handleDropdownClick(e) {
e.preventDefault();
this.setDropdownState(!this.state.open);
},
handleOptionSelect: function handleOptionSelect(key) {
if (this.props.onSelect) {
this.props.onSelect(key);
}
this.setDropdownState(false);
}
});
exports['default'] = DropdownButton;
module.exports = exports['default'];
/***/ },
/* 33 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _utilsDomUtils = __webpack_require__(13);
var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils);
var _utilsEventListener = __webpack_require__(14);
var _utilsEventListener2 = _interopRequireDefault(_utilsEventListener);
/**
* Checks whether a node is within
* a root nodes tree
*
* @param {DOMElement} node
* @param {DOMElement} root
* @returns {boolean}
*/
function isNodeInRoot(node, root) {
while (node) {
if (node === root) {
return true;
}
node = node.parentNode;
}
return false;
}
var DropdownStateMixin = {
getInitialState: function getInitialState() {
return {
open: false
};
},
setDropdownState: function setDropdownState(newState, onStateChangeComplete) {
if (newState) {
this.bindRootCloseHandlers();
} else {
this.unbindRootCloseHandlers();
}
this.setState({
open: newState
}, onStateChangeComplete);
},
handleDocumentKeyUp: function handleDocumentKeyUp(e) {
if (e.keyCode === 27) {
this.setDropdownState(false);
}
},
handleDocumentClick: function handleDocumentClick(e) {
// If the click originated from within this component
// don't do anything.
// e.srcElement is required for IE8 as e.target is undefined
var target = e.target || e.srcElement;
if (isNodeInRoot(target, _react2['default'].findDOMNode(this))) {
return;
}
this.setDropdownState(false);
},
bindRootCloseHandlers: function bindRootCloseHandlers() {
var doc = _utilsDomUtils2['default'].ownerDocument(this);
this._onDocumentClickListener = _utilsEventListener2['default'].listen(doc, 'click', this.handleDocumentClick);
this._onDocumentKeyupListener = _utilsEventListener2['default'].listen(doc, 'keyup', this.handleDocumentKeyUp);
},
unbindRootCloseHandlers: function unbindRootCloseHandlers() {
if (this._onDocumentClickListener) {
this._onDocumentClickListener.remove();
}
if (this._onDocumentKeyupListener) {
this._onDocumentKeyupListener.remove();
}
},
componentWillUnmount: function componentWillUnmount() {
this.unbindRootCloseHandlers();
}
};
exports['default'] = DropdownStateMixin;
module.exports = exports['default'];
/***/ },
/* 34 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _utilsCreateChainedFunction = __webpack_require__(27);
var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var DropdownMenu = _react2['default'].createClass({
displayName: 'DropdownMenu',
propTypes: {
pullRight: _react2['default'].PropTypes.bool,
onSelect: _react2['default'].PropTypes.func
},
render: function render() {
var classes = {
'dropdown-menu': true,
'dropdown-menu-right': this.props.pullRight
};
return _react2['default'].createElement(
'ul',
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, classes),
role: 'menu' }),
_utilsValidComponentChildren2['default'].map(this.props.children, this.renderMenuItem)
);
},
renderMenuItem: function renderMenuItem(child, index) {
return (0, _react.cloneElement)(child, {
// Capture onSelect events
onSelect: (0, _utilsCreateChainedFunction2['default'])(child.props.onSelect, this.props.onSelect),
// Force special props to be transferred
key: child.key ? child.key : index
});
}
});
exports['default'] = DropdownMenu;
module.exports = exports['default'];
/***/ },
/* 35 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _utilsDomUtils = __webpack_require__(13);
var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils);
// TODO: listen for onTransitionEnd to remove el
function getElementsAndSelf(root, classes) {
var els = root.querySelectorAll('.' + classes.join('.'));
els = [].map.call(els, function (e) {
return e;
});
for (var i = 0; i < classes.length; i++) {
if (!root.className.match(new RegExp('\\b' + classes[i] + '\\b'))) {
return els;
}
}
els.unshift(root);
return els;
}
exports['default'] = {
_fadeIn: function _fadeIn() {
var els = undefined;
if (this.isMounted()) {
els = getElementsAndSelf(_react2['default'].findDOMNode(this), ['fade']);
if (els.length) {
els.forEach(function (el) {
el.className += ' in';
});
}
}
},
_fadeOut: function _fadeOut() {
var els = getElementsAndSelf(this._fadeOutEl, ['fade', 'in']);
if (els.length) {
els.forEach(function (el) {
el.className = el.className.replace(/\bin\b/, '');
});
}
setTimeout(this._handleFadeOutEnd, 300);
},
_handleFadeOutEnd: function _handleFadeOutEnd() {
if (this._fadeOutEl && this._fadeOutEl.parentNode) {
this._fadeOutEl.parentNode.removeChild(this._fadeOutEl);
}
},
componentDidMount: function componentDidMount() {
if (document.querySelectorAll) {
// Firefox needs delay for transition to be triggered
setTimeout(this._fadeIn, 20);
}
},
componentWillUnmount: function componentWillUnmount() {
var els = getElementsAndSelf(_react2['default'].findDOMNode(this), ['fade']),
container = this.props.container && _react2['default'].findDOMNode(this.props.container) || _utilsDomUtils2['default'].ownerDocument(this).body;
if (els.length) {
this._fadeOutEl = document.createElement('div');
container.appendChild(this._fadeOutEl);
this._fadeOutEl.appendChild(_react2['default'].findDOMNode(this).cloneNode(true));
// Firefox needs delay for transition to be triggered
setTimeout(this._fadeOut, 20);
}
}
};
module.exports = exports['default'];
/***/ },
/* 36 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _Static = __webpack_require__(37);
var _Static2 = _interopRequireDefault(_Static);
exports['default'] = {
Static: _Static2['default']
};
module.exports = exports['default'];
/***/ },
/* 37 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _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) subClass.__proto__ = superClass; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _InputBase2 = __webpack_require__(21);
var _InputBase3 = _interopRequireDefault(_InputBase2);
var _utilsChildrenValueInputValidation = __webpack_require__(22);
var _utilsChildrenValueInputValidation2 = _interopRequireDefault(_utilsChildrenValueInputValidation);
var Static = (function (_InputBase) {
function Static() {
_classCallCheck(this, Static);
if (_InputBase != null) {
_InputBase.apply(this, arguments);
}
}
_inherits(Static, _InputBase);
_createClass(Static, [{
key: 'getValue',
value: function getValue() {
var _props = this.props;
var children = _props.children;
var value = _props.value;
return children ? children : value;
}
}, {
key: 'renderInput',
value: function renderInput() {
return _react2['default'].createElement(
'p',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'form-control-static'), ref: 'input', key: 'input' }),
this.getValue()
);
}
}]);
return Static;
})(_InputBase3['default']);
Static.propTypes = {
value: _utilsChildrenValueInputValidation2['default'],
children: _utilsChildrenValueInputValidation2['default']
};
exports['default'] = Static;
module.exports = exports['default'];
/***/ },
/* 38 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var Grid = _react2['default'].createClass({
displayName: 'Grid',
propTypes: {
fluid: _react2['default'].PropTypes.bool,
componentClass: _react2['default'].PropTypes.node.isRequired
},
getDefaultProps: function getDefaultProps() {
return {
componentClass: 'div'
};
},
render: function render() {
var ComponentClass = this.props.componentClass;
var className = this.props.fluid ? 'container-fluid' : 'container';
return _react2['default'].createElement(
ComponentClass,
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, className) }),
this.props.children
);
}
});
exports['default'] = Grid;
module.exports = exports['default'];
/***/ },
/* 39 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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) subClass.__proto__ = superClass; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _InputBase2 = __webpack_require__(21);
var _InputBase3 = _interopRequireDefault(_InputBase2);
var _FormControls = __webpack_require__(36);
var _FormControls2 = _interopRequireDefault(_FormControls);
var _utilsDeprecationWarning = __webpack_require__(40);
var _utilsDeprecationWarning2 = _interopRequireDefault(_utilsDeprecationWarning);
var Input = (function (_InputBase) {
function Input() {
_classCallCheck(this, Input);
if (_InputBase != null) {
_InputBase.apply(this, arguments);
}
}
_inherits(Input, _InputBase);
_createClass(Input, [{
key: 'render',
value: function render() {
if (this.props.type === 'static') {
(0, _utilsDeprecationWarning2['default'])('Input type=static', 'StaticText');
return _react2['default'].createElement(_FormControls2['default'].Static, this.props);
}
return _get(Object.getPrototypeOf(Input.prototype), 'render', this).call(this);
}
}]);
return Input;
})(_InputBase3['default']);
exports['default'] = Input;
module.exports = exports['default'];
/***/ },
/* 40 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = deprecationWarning;
function deprecationWarning(oldname, newname, link) {
if (true) {
if (typeof console === 'undefined' || typeof console.warn !== 'function') {
return;
}
var message = '' + oldname + ' is deprecated. Use ' + newname + ' instead.';
console.warn(message);
if (link) {
console.warn('You can read more about it here ' + link);
}
}
}
module.exports = exports['default'];
/***/ },
/* 41 */
/***/ function(module, exports, __webpack_require__) {
// https://www.npmjs.org/package/react-interpolate-component
// TODO: Drop this in favor of es6 string interpolation
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var REGEXP = /\%\((.+?)\)s/;
var Interpolate = _react2['default'].createClass({
displayName: 'Interpolate',
propTypes: {
format: _react2['default'].PropTypes.string
},
getDefaultProps: function getDefaultProps() {
return { component: 'span' };
},
render: function render() {
var format = _utilsValidComponentChildren2['default'].hasValidComponent(this.props.children) || typeof this.props.children === 'string' ? this.props.children : this.props.format;
var parent = this.props.component;
var unsafe = this.props.unsafe === true;
var props = _extends({}, this.props);
delete props.children;
delete props.format;
delete props.component;
delete props.unsafe;
if (unsafe) {
var content = format.split(REGEXP).reduce(function (memo, match, index) {
var html = undefined;
if (index % 2 === 0) {
html = match;
} else {
html = props[match];
delete props[match];
}
if (_react2['default'].isValidElement(html)) {
throw new Error('cannot interpolate a React component into unsafe text');
}
memo += html;
return memo;
}, '');
props.dangerouslySetInnerHTML = { __html: content };
return _react2['default'].createElement(parent, props);
} else {
var kids = format.split(REGEXP).reduce(function (memo, match, index) {
var child = undefined;
if (index % 2 === 0) {
if (match.length === 0) {
return memo;
}
child = match;
} else {
child = props[match];
delete props[match];
}
memo.push(child);
return memo;
}, []);
return _react2['default'].createElement(parent, props, kids);
}
}
});
exports['default'] = Interpolate;
module.exports = exports['default'];
/***/ },
/* 42 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var Jumbotron = _react2['default'].createClass({
displayName: 'Jumbotron',
render: function render() {
return _react2['default'].createElement(
'div',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'jumbotron') }),
this.props.children
);
}
});
exports['default'] = Jumbotron;
module.exports = exports['default'];
/***/ },
/* 43 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var Label = _react2['default'].createClass({
displayName: 'Label',
mixins: [_BootstrapMixin2['default']],
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'label',
bsStyle: 'default'
};
},
render: function render() {
var classes = this.getBsClassSet();
return _react2['default'].createElement(
'span',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.children
);
}
});
exports['default'] = Label;
module.exports = exports['default'];
/***/ },
/* 44 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _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) subClass.__proto__ = superClass; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var ListGroup = (function (_React$Component) {
function ListGroup() {
_classCallCheck(this, ListGroup);
if (_React$Component != null) {
_React$Component.apply(this, arguments);
}
}
_inherits(ListGroup, _React$Component);
_createClass(ListGroup, [{
key: 'render',
value: function render() {
var _this = this;
var items = _utilsValidComponentChildren2['default'].map(this.props.children, function (item, index) {
return (0, _react.cloneElement)(item, { key: item.key ? item.key : index });
});
var childrenAnchors = false;
if (!this.props.children) {
return this.renderDiv(items);
} else if (_react2['default'].Children.count(this.props.children) === 1 && !Array.isArray(this.props.children)) {
var child = this.props.children;
childrenAnchors = this.isAnchor(child.props);
} else {
childrenAnchors = Array.prototype.some.call(this.props.children, function (child) {
return !Array.isArray(child) ? _this.isAnchor(child.props) : Array.prototype.some.call(child, function (subChild) {
return _this.isAnchor(subChild.props);
});
});
}
if (childrenAnchors) {
return this.renderDiv(items);
} else {
return this.renderUL(items);
}
}
}, {
key: 'isAnchor',
value: function isAnchor(props) {
return props.href || props.onClick;
}
}, {
key: 'renderUL',
value: function renderUL(items) {
var listItems = _utilsValidComponentChildren2['default'].map(items, function (item, index) {
return (0, _react.cloneElement)(item, { listItem: true });
});
return _react2['default'].createElement(
'ul',
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, 'list-group') }),
listItems
);
}
}, {
key: 'renderDiv',
value: function renderDiv(items) {
return _react2['default'].createElement(
'div',
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, 'list-group') }),
items
);
}
}]);
return ListGroup;
})(_react2['default'].Component);
ListGroup.propTypes = {
className: _react2['default'].PropTypes.string,
id: _react2['default'].PropTypes.string
};
exports['default'] = ListGroup;
module.exports = exports['default'];
/***/ },
/* 45 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _SafeAnchor = __webpack_require__(4);
var _SafeAnchor2 = _interopRequireDefault(_SafeAnchor);
var ListGroupItem = _react2['default'].createClass({
displayName: 'ListGroupItem',
mixins: [_BootstrapMixin2['default']],
propTypes: {
bsStyle: _react2['default'].PropTypes.oneOf(['danger', 'info', 'success', 'warning']),
className: _react2['default'].PropTypes.string,
active: _react2['default'].PropTypes.any,
disabled: _react2['default'].PropTypes.any,
header: _react2['default'].PropTypes.node,
listItem: _react2['default'].PropTypes.bool,
onClick: _react2['default'].PropTypes.func,
eventKey: _react2['default'].PropTypes.any,
href: _react2['default'].PropTypes.string,
target: _react2['default'].PropTypes.string
},
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'list-group-item'
};
},
render: function render() {
var classes = this.getBsClassSet();
classes.active = this.props.active;
classes.disabled = this.props.disabled;
if (this.props.href || this.props.onClick) {
return this.renderAnchor(classes);
} else if (this.props.listItem) {
return this.renderLi(classes);
} else {
return this.renderSpan(classes);
}
},
renderLi: function renderLi(classes) {
return _react2['default'].createElement(
'li',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.header ? this.renderStructuredContent() : this.props.children
);
},
renderAnchor: function renderAnchor(classes) {
return _react2['default'].createElement(
_SafeAnchor2['default'],
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, classes)
}),
this.props.header ? this.renderStructuredContent() : this.props.children
);
},
renderSpan: function renderSpan(classes) {
return _react2['default'].createElement(
'span',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.header ? this.renderStructuredContent() : this.props.children
);
},
renderStructuredContent: function renderStructuredContent() {
var header = undefined;
if (_react2['default'].isValidElement(this.props.header)) {
header = (0, _react.cloneElement)(this.props.header, {
key: 'header',
className: (0, _classnames2['default'])(this.props.header.props.className, 'list-group-item-heading')
});
} else {
header = _react2['default'].createElement(
'h4',
{ key: 'header', className: 'list-group-item-heading' },
this.props.header
);
}
var content = _react2['default'].createElement(
'p',
{ key: 'content', className: 'list-group-item-text' },
this.props.children
);
return [header, content];
}
});
exports['default'] = ListGroupItem;
module.exports = exports['default'];
/***/ },
/* 46 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _FadeMixin = __webpack_require__(35);
var _FadeMixin2 = _interopRequireDefault(_FadeMixin);
var _utilsDomUtils = __webpack_require__(13);
var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils);
var _utilsEventListener = __webpack_require__(14);
var _utilsEventListener2 = _interopRequireDefault(_utilsEventListener);
// TODO:
// - aria-labelledby
// - Add `modal-body` div if only one child passed in that doesn't already have it
// - Tests
var Modal = _react2['default'].createClass({
displayName: 'Modal',
mixins: [_BootstrapMixin2['default'], _FadeMixin2['default']],
propTypes: {
title: _react2['default'].PropTypes.node,
backdrop: _react2['default'].PropTypes.oneOf(['static', true, false]),
keyboard: _react2['default'].PropTypes.bool,
closeButton: _react2['default'].PropTypes.bool,
animation: _react2['default'].PropTypes.bool,
onRequestHide: _react2['default'].PropTypes.func.isRequired,
dialogClassName: _react2['default'].PropTypes.string
},
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'modal',
backdrop: true,
keyboard: true,
animation: true,
closeButton: true
};
},
render: function render() {
var modalStyle = { display: 'block' };
var dialogClasses = this.getBsClassSet();
delete dialogClasses.modal;
dialogClasses['modal-dialog'] = true;
var classes = {
modal: true,
fade: this.props.animation,
'in': !this.props.animation
};
var modal = _react2['default'].createElement(
'div',
_extends({}, this.props, {
title: null,
tabIndex: '-1',
role: 'dialog',
style: modalStyle,
className: (0, _classnames2['default'])(this.props.className, classes),
onClick: this.props.backdrop === true ? this.handleBackdropClick : null,
ref: 'modal' }),
_react2['default'].createElement(
'div',
{ className: (0, _classnames2['default'])(this.props.dialogClassName, dialogClasses) },
_react2['default'].createElement(
'div',
{ className: 'modal-content' },
this.props.title ? this.renderHeader() : null,
this.props.children
)
)
);
return this.props.backdrop ? this.renderBackdrop(modal) : modal;
},
renderBackdrop: function renderBackdrop(modal) {
var classes = {
'modal-backdrop': true,
fade: this.props.animation,
'in': !this.props.animation
};
var onClick = this.props.backdrop === true ? this.handleBackdropClick : null;
return _react2['default'].createElement(
'div',
null,
_react2['default'].createElement('div', { className: (0, _classnames2['default'])(classes), ref: 'backdrop', onClick: onClick }),
modal
);
},
renderHeader: function renderHeader() {
var closeButton = undefined;
if (this.props.closeButton) {
closeButton = _react2['default'].createElement(
'button',
{ type: 'button', className: 'close', 'aria-hidden': 'true', onClick: this.props.onRequestHide },
'×'
);
}
return _react2['default'].createElement(
'div',
{ className: 'modal-header' },
closeButton,
this.renderTitle()
);
},
renderTitle: function renderTitle() {
return _react2['default'].isValidElement(this.props.title) ? this.props.title : _react2['default'].createElement(
'h4',
{ className: 'modal-title' },
this.props.title
);
},
iosClickHack: function iosClickHack() {
// IOS only allows click events to be delegated to the document on elements
// it considers 'clickable' - anchors, buttons, etc. We fake a click handler on the
// DOM nodes themselves. Remove if handled by React: https://github.com/facebook/react/issues/1169
_react2['default'].findDOMNode(this.refs.modal).onclick = function () {};
_react2['default'].findDOMNode(this.refs.backdrop).onclick = function () {};
},
componentDidMount: function componentDidMount() {
this._onDocumentKeyupListener = _utilsEventListener2['default'].listen(_utilsDomUtils2['default'].ownerDocument(this), 'keyup', this.handleDocumentKeyUp);
var container = this.props.container && _react2['default'].findDOMNode(this.props.container) || _utilsDomUtils2['default'].ownerDocument(this).body;
container.className += container.className.length ? ' modal-open' : 'modal-open';
this.focusModalContent();
if (this.props.backdrop) {
this.iosClickHack();
}
},
componentDidUpdate: function componentDidUpdate(prevProps) {
if (this.props.backdrop && this.props.backdrop !== prevProps.backdrop) {
this.iosClickHack();
}
},
componentWillUnmount: function componentWillUnmount() {
this._onDocumentKeyupListener.remove();
var container = this.props.container && _react2['default'].findDOMNode(this.props.container) || _utilsDomUtils2['default'].ownerDocument(this).body;
container.className = container.className.replace(/ ?modal-open/, '');
this.restoreLastFocus();
},
handleBackdropClick: function handleBackdropClick(e) {
if (e.target !== e.currentTarget) {
return;
}
this.props.onRequestHide();
},
handleDocumentKeyUp: function handleDocumentKeyUp(e) {
if (this.props.keyboard && e.keyCode === 27) {
this.props.onRequestHide();
}
},
focusModalContent: function focusModalContent() {
this.lastFocus = _utilsDomUtils2['default'].ownerDocument(this).activeElement;
var modalContent = _react2['default'].findDOMNode(this.refs.modal);
modalContent.focus();
},
restoreLastFocus: function restoreLastFocus() {
if (this.lastFocus) {
this.lastFocus.focus();
this.lastFocus = null;
}
}
});
exports['default'] = Modal;
module.exports = exports['default'];
/***/ },
/* 47 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _CollapsibleMixin = __webpack_require__(25);
var _CollapsibleMixin2 = _interopRequireDefault(_CollapsibleMixin);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _utilsDomUtils = __webpack_require__(13);
var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var _utilsCreateChainedFunction = __webpack_require__(27);
var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction);
var Nav = _react2['default'].createClass({
displayName: 'Nav',
mixins: [_BootstrapMixin2['default'], _CollapsibleMixin2['default']],
propTypes: {
activeHref: _react2['default'].PropTypes.string,
activeKey: _react2['default'].PropTypes.any,
bsStyle: _react2['default'].PropTypes.oneOf(['tabs', 'pills']),
stacked: _react2['default'].PropTypes.bool,
justified: _react2['default'].PropTypes.bool,
onSelect: _react2['default'].PropTypes.func,
collapsible: _react2['default'].PropTypes.bool,
expanded: _react2['default'].PropTypes.bool,
navbar: _react2['default'].PropTypes.bool,
eventKey: _react2['default'].PropTypes.any,
pullRight: _react2['default'].PropTypes.bool,
right: _react2['default'].PropTypes.bool
},
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'nav'
};
},
getCollapsibleDOMNode: function getCollapsibleDOMNode() {
return _react2['default'].findDOMNode(this);
},
getCollapsibleDimensionValue: function getCollapsibleDimensionValue() {
var node = _react2['default'].findDOMNode(this.refs.ul),
height = node.offsetHeight,
computedStyles = _utilsDomUtils2['default'].getComputedStyles(node);
return height + parseInt(computedStyles.marginTop, 10) + parseInt(computedStyles.marginBottom, 10);
},
render: function render() {
var classes = this.props.collapsible ? this.getCollapsibleClassSet('navbar-collapse') : null;
if (this.props.navbar && !this.props.collapsible) {
return this.renderUl();
}
return _react2['default'].createElement(
'nav',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
this.renderUl()
);
},
renderUl: function renderUl() {
var classes = this.getBsClassSet();
classes['nav-stacked'] = this.props.stacked;
classes['nav-justified'] = this.props.justified;
classes['navbar-nav'] = this.props.navbar;
classes['pull-right'] = this.props.pullRight;
classes['navbar-right'] = this.props.right;
return _react2['default'].createElement(
'ul',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), ref: 'ul' }),
_utilsValidComponentChildren2['default'].map(this.props.children, this.renderNavItem)
);
},
getChildActiveProp: function getChildActiveProp(child) {
if (child.props.active) {
return true;
}
if (this.props.activeKey != null) {
if (child.props.eventKey === this.props.activeKey) {
return true;
}
}
if (this.props.activeHref != null) {
if (child.props.href === this.props.activeHref) {
return true;
}
}
return child.props.active;
},
renderNavItem: function renderNavItem(child, index) {
return (0, _react.cloneElement)(child, {
active: this.getChildActiveProp(child),
activeKey: this.props.activeKey,
activeHref: this.props.activeHref,
onSelect: (0, _utilsCreateChainedFunction2['default'])(child.props.onSelect, this.props.onSelect),
key: child.key ? child.key : index,
navItem: true
});
}
});
exports['default'] = Nav;
module.exports = exports['default'];
/***/ },
/* 48 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var _utilsCreateChainedFunction = __webpack_require__(27);
var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction);
var Navbar = _react2['default'].createClass({
displayName: 'Navbar',
mixins: [_BootstrapMixin2['default']],
propTypes: {
fixedTop: _react2['default'].PropTypes.bool,
fixedBottom: _react2['default'].PropTypes.bool,
staticTop: _react2['default'].PropTypes.bool,
inverse: _react2['default'].PropTypes.bool,
fluid: _react2['default'].PropTypes.bool,
role: _react2['default'].PropTypes.string,
componentClass: _react2['default'].PropTypes.node.isRequired,
brand: _react2['default'].PropTypes.node,
toggleButton: _react2['default'].PropTypes.node,
toggleNavKey: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.string, _react2['default'].PropTypes.number]),
onToggle: _react2['default'].PropTypes.func,
navExpanded: _react2['default'].PropTypes.bool,
defaultNavExpanded: _react2['default'].PropTypes.bool
},
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'navbar',
bsStyle: 'default',
role: 'navigation',
componentClass: 'nav'
};
},
getInitialState: function getInitialState() {
return {
navExpanded: this.props.defaultNavExpanded
};
},
shouldComponentUpdate: function shouldComponentUpdate() {
// Defer any updates to this component during the `onSelect` handler.
return !this._isChanging;
},
handleToggle: function handleToggle() {
if (this.props.onToggle) {
this._isChanging = true;
this.props.onToggle();
this._isChanging = false;
}
this.setState({
navExpanded: !this.state.navExpanded
});
},
isNavExpanded: function isNavExpanded() {
return this.props.navExpanded != null ? this.props.navExpanded : this.state.navExpanded;
},
render: function render() {
var classes = this.getBsClassSet();
var ComponentClass = this.props.componentClass;
classes['navbar-fixed-top'] = this.props.fixedTop;
classes['navbar-fixed-bottom'] = this.props.fixedBottom;
classes['navbar-static-top'] = this.props.staticTop;
classes['navbar-inverse'] = this.props.inverse;
return _react2['default'].createElement(
ComponentClass,
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
_react2['default'].createElement(
'div',
{ className: this.props.fluid ? 'container-fluid' : 'container' },
this.props.brand || this.props.toggleButton || this.props.toggleNavKey != null ? this.renderHeader() : null,
_utilsValidComponentChildren2['default'].map(this.props.children, this.renderChild)
)
);
},
renderChild: function renderChild(child, index) {
return (0, _react.cloneElement)(child, {
navbar: true,
collapsible: this.props.toggleNavKey != null && this.props.toggleNavKey === child.props.eventKey,
expanded: this.props.toggleNavKey != null && this.props.toggleNavKey === child.props.eventKey && this.isNavExpanded(),
key: child.key ? child.key : index
});
},
renderHeader: function renderHeader() {
var brand = undefined;
if (this.props.brand) {
if (_react2['default'].isValidElement(this.props.brand)) {
brand = (0, _react.cloneElement)(this.props.brand, {
className: (0, _classnames2['default'])(this.props.brand.props.className, 'navbar-brand')
});
} else {
brand = _react2['default'].createElement(
'span',
{ className: 'navbar-brand' },
this.props.brand
);
}
}
return _react2['default'].createElement(
'div',
{ className: 'navbar-header' },
brand,
this.props.toggleButton || this.props.toggleNavKey != null ? this.renderToggleButton() : null
);
},
renderToggleButton: function renderToggleButton() {
var children = undefined;
if (_react2['default'].isValidElement(this.props.toggleButton)) {
return (0, _react.cloneElement)(this.props.toggleButton, {
className: (0, _classnames2['default'])(this.props.toggleButton.props.className, 'navbar-toggle'),
onClick: (0, _utilsCreateChainedFunction2['default'])(this.handleToggle, this.props.toggleButton.props.onClick)
});
}
children = this.props.toggleButton != null ? this.props.toggleButton : [_react2['default'].createElement(
'span',
{ className: 'sr-only', key: 0 },
'Toggle navigation'
), _react2['default'].createElement('span', { className: 'icon-bar', key: 1 }), _react2['default'].createElement('span', { className: 'icon-bar', key: 2 }), _react2['default'].createElement('span', { className: 'icon-bar', key: 3 })];
return _react2['default'].createElement(
'button',
{ className: 'navbar-toggle', type: 'button', onClick: this.handleToggle },
children
);
}
});
exports['default'] = Navbar;
module.exports = exports['default'];
/***/ },
/* 49 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _SafeAnchor = __webpack_require__(4);
var _SafeAnchor2 = _interopRequireDefault(_SafeAnchor);
var NavItem = _react2['default'].createClass({
displayName: 'NavItem',
mixins: [_BootstrapMixin2['default']],
propTypes: {
onSelect: _react2['default'].PropTypes.func,
active: _react2['default'].PropTypes.bool,
disabled: _react2['default'].PropTypes.bool,
href: _react2['default'].PropTypes.string,
title: _react2['default'].PropTypes.node,
eventKey: _react2['default'].PropTypes.any,
target: _react2['default'].PropTypes.string
},
render: function render() {
var _props = this.props;
var disabled = _props.disabled;
var active = _props.active;
var href = _props.href;
var title = _props.title;
var target = _props.target;
var children = _props.children;
var props = _objectWithoutProperties(_props, ['disabled', 'active', 'href', 'title', 'target', 'children']);
// eslint-disable-line object-shorthand
var classes = {
active: active,
disabled: disabled
};
var linkProps = {
href: href,
title: title,
target: target,
onClick: this.handleClick
};
if (href === '#') {
linkProps.role = 'button';
}
return _react2['default'].createElement(
'li',
_extends({}, props, { className: (0, _classnames2['default'])(props.className, classes) }),
_react2['default'].createElement(
_SafeAnchor2['default'],
linkProps,
children
)
);
},
handleClick: function handleClick(e) {
if (this.props.onSelect) {
e.preventDefault();
if (!this.props.disabled) {
this.props.onSelect(this.props.eventKey, this.props.href, this.props.target);
}
}
}
});
exports['default'] = NavItem;
module.exports = exports['default'];
/***/ },
/* 50 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _OverlayMixin = __webpack_require__(51);
var _OverlayMixin2 = _interopRequireDefault(_OverlayMixin);
var _utilsCreateChainedFunction = __webpack_require__(27);
var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction);
var _utilsCreateContextWrapper = __webpack_require__(52);
var _utilsCreateContextWrapper2 = _interopRequireDefault(_utilsCreateContextWrapper);
var ModalTrigger = _react2['default'].createClass({
displayName: 'ModalTrigger',
mixins: [_OverlayMixin2['default']],
propTypes: {
modal: _react2['default'].PropTypes.node.isRequired
},
getInitialState: function getInitialState() {
return {
isOverlayShown: false
};
},
show: function show() {
this.setState({
isOverlayShown: true
});
},
hide: function hide() {
this.setState({
isOverlayShown: false
});
},
toggle: function toggle() {
this.setState({
isOverlayShown: !this.state.isOverlayShown
});
},
renderOverlay: function renderOverlay() {
if (!this.state.isOverlayShown) {
return _react2['default'].createElement('span', null);
}
return (0, _react.cloneElement)(this.props.modal, {
onRequestHide: this.hide
});
},
render: function render() {
var child = _react2['default'].Children.only(this.props.children);
var props = {};
props.onClick = (0, _utilsCreateChainedFunction2['default'])(child.props.onClick, this.toggle);
props.onMouseOver = (0, _utilsCreateChainedFunction2['default'])(child.props.onMouseOver, this.props.onMouseOver);
props.onMouseOut = (0, _utilsCreateChainedFunction2['default'])(child.props.onMouseOut, this.props.onMouseOut);
props.onFocus = (0, _utilsCreateChainedFunction2['default'])(child.props.onFocus, this.props.onFocus);
props.onBlur = (0, _utilsCreateChainedFunction2['default'])(child.props.onBlur, this.props.onBlur);
return (0, _react.cloneElement)(child, props);
}
});
/**
* Creates a new ModalTrigger class that forwards the relevant context
*
* This static method should only be called at the module level, instead of in
* e.g. a render() method, because it's expensive to create new classes.
*
* For example, you would want to have:
*
* > export default ModalTrigger.withContext({
* > myContextKey: React.PropTypes.object
* > });
*
* and import this when needed.
*/
ModalTrigger.withContext = (0, _utilsCreateContextWrapper2['default'])(ModalTrigger, 'modal');
exports['default'] = ModalTrigger;
module.exports = exports['default'];
/***/ },
/* 51 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _utilsCustomPropTypes = __webpack_require__(9);
var _utilsCustomPropTypes2 = _interopRequireDefault(_utilsCustomPropTypes);
var _utilsDomUtils = __webpack_require__(13);
var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils);
exports['default'] = {
propTypes: {
container: _utilsCustomPropTypes2['default'].mountable
},
componentWillUnmount: function componentWillUnmount() {
this._unrenderOverlay();
if (this._overlayTarget) {
this.getContainerDOMNode().removeChild(this._overlayTarget);
this._overlayTarget = null;
}
},
componentDidUpdate: function componentDidUpdate() {
this._renderOverlay();
},
componentDidMount: function componentDidMount() {
this._renderOverlay();
},
_mountOverlayTarget: function _mountOverlayTarget() {
this._overlayTarget = document.createElement('div');
this.getContainerDOMNode().appendChild(this._overlayTarget);
},
_renderOverlay: function _renderOverlay() {
if (!this._overlayTarget) {
this._mountOverlayTarget();
}
var overlay = this.renderOverlay();
// Save reference to help testing
if (overlay !== null) {
this._overlayInstance = _react2['default'].render(overlay, this._overlayTarget);
} else {
// Unrender if the component is null for transitions to null
this._unrenderOverlay();
}
},
_unrenderOverlay: function _unrenderOverlay() {
_react2['default'].unmountComponentAtNode(this._overlayTarget);
this._overlayInstance = null;
},
getOverlayDOMNode: function getOverlayDOMNode() {
if (!this.isMounted()) {
throw new Error('getOverlayDOMNode(): A component must be mounted to have a DOM node.');
}
if (this._overlayInstance) {
return _react2['default'].findDOMNode(this._overlayInstance);
}
return null;
},
getContainerDOMNode: function getContainerDOMNode() {
return _react2['default'].findDOMNode(this.props.container) || _utilsDomUtils2['default'].ownerDocument(this).body;
}
};
module.exports = exports['default'];
/***/ },
/* 52 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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; }; })();
exports['default'] = createContextWrapper;
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) subClass.__proto__ = superClass; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
/**
* Creates new trigger class that injects context into overlay.
*/
function createContextWrapper(Trigger, propName) {
return function (contextTypes) {
var ContextWrapper = (function (_React$Component) {
function ContextWrapper() {
_classCallCheck(this, ContextWrapper);
if (_React$Component != null) {
_React$Component.apply(this, arguments);
}
}
_inherits(ContextWrapper, _React$Component);
_createClass(ContextWrapper, [{
key: 'getChildContext',
value: function getChildContext() {
return this.props.context;
}
}, {
key: 'render',
value: function render() {
// Strip injected props from below.
var _props = this.props;
var wrapped = _props.wrapped;
var props = _objectWithoutProperties(_props, ['wrapped']);
// eslint-disable-line object-shorthand
delete props.context;
return _react2['default'].cloneElement(wrapped, props);
}
}]);
return ContextWrapper;
})(_react2['default'].Component);
ContextWrapper.childContextTypes = contextTypes;
var TriggerWithContext = (function () {
function TriggerWithContext() {
_classCallCheck(this, TriggerWithContext);
}
_createClass(TriggerWithContext, [{
key: 'render',
value: function render() {
var props = _extends({}, this.props);
props[propName] = this.getWrappedOverlay();
return _react2['default'].createElement(
Trigger,
props,
this.props.children
);
}
}, {
key: 'getWrappedOverlay',
value: function getWrappedOverlay() {
return _react2['default'].createElement(ContextWrapper, {
context: this.context,
wrapped: this.props[propName]
});
}
}]);
return TriggerWithContext;
})();
TriggerWithContext.contextTypes = contextTypes;
return TriggerWithContext;
};
}
module.exports = exports['default'];
/***/ },
/* 53 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _OverlayMixin = __webpack_require__(51);
var _OverlayMixin2 = _interopRequireDefault(_OverlayMixin);
var _RootCloseWrapper = __webpack_require__(54);
var _RootCloseWrapper2 = _interopRequireDefault(_RootCloseWrapper);
var _utilsCreateChainedFunction = __webpack_require__(27);
var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction);
var _utilsCreateContextWrapper = __webpack_require__(52);
var _utilsCreateContextWrapper2 = _interopRequireDefault(_utilsCreateContextWrapper);
var _utilsDomUtils = __webpack_require__(13);
var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils);
/**
* Check if value one is inside or equal to the of value
*
* @param {string} one
* @param {string|array} of
* @returns {boolean}
*/
function isOneOf(one, of) {
if (Array.isArray(of)) {
return of.indexOf(one) >= 0;
}
return one === of;
}
var OverlayTrigger = _react2['default'].createClass({
displayName: 'OverlayTrigger',
mixins: [_OverlayMixin2['default']],
propTypes: {
trigger: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.oneOf(['manual', 'click', 'hover', 'focus']), _react2['default'].PropTypes.arrayOf(_react2['default'].PropTypes.oneOf(['click', 'hover', 'focus']))]),
placement: _react2['default'].PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
delay: _react2['default'].PropTypes.number,
delayShow: _react2['default'].PropTypes.number,
delayHide: _react2['default'].PropTypes.number,
defaultOverlayShown: _react2['default'].PropTypes.bool,
overlay: _react2['default'].PropTypes.node.isRequired,
containerPadding: _react2['default'].PropTypes.number,
rootClose: _react2['default'].PropTypes.bool
},
getDefaultProps: function getDefaultProps() {
return {
placement: 'right',
trigger: ['hover', 'focus'],
containerPadding: 0
};
},
getInitialState: function getInitialState() {
return {
isOverlayShown: this.props.defaultOverlayShown == null ? false : this.props.defaultOverlayShown,
overlayLeft: null,
overlayTop: null,
arrowOffsetLeft: null,
arrowOffsetTop: null
};
},
show: function show() {
this.setState({
isOverlayShown: true
}, function () {
this.updateOverlayPosition();
});
},
hide: function hide() {
this.setState({
isOverlayShown: false
});
},
toggle: function toggle() {
if (this.state.isOverlayShown) {
this.hide();
} else {
this.show();
}
},
renderOverlay: function renderOverlay() {
if (!this.state.isOverlayShown) {
return _react2['default'].createElement('span', null);
}
var overlay = (0, _react.cloneElement)(this.props.overlay, {
onRequestHide: this.hide,
placement: this.props.placement,
positionLeft: this.state.overlayLeft,
positionTop: this.state.overlayTop,
arrowOffsetLeft: this.state.arrowOffsetLeft,
arrowOffsetTop: this.state.arrowOffsetTop
});
if (this.props.rootClose) {
return _react2['default'].createElement(
_RootCloseWrapper2['default'],
{ onRootClose: this.hide },
overlay
);
} else {
return overlay;
}
},
render: function render() {
var child = _react2['default'].Children.only(this.props.children);
if (this.props.trigger === 'manual') {
return child;
}
var props = {};
props.onClick = (0, _utilsCreateChainedFunction2['default'])(child.props.onClick, this.props.onClick);
if (isOneOf('click', this.props.trigger)) {
props.onClick = (0, _utilsCreateChainedFunction2['default'])(this.toggle, props.onClick);
}
if (isOneOf('hover', this.props.trigger)) {
props.onMouseOver = (0, _utilsCreateChainedFunction2['default'])(this.handleDelayedShow, this.props.onMouseOver);
props.onMouseOut = (0, _utilsCreateChainedFunction2['default'])(this.handleDelayedHide, this.props.onMouseOut);
}
if (isOneOf('focus', this.props.trigger)) {
props.onFocus = (0, _utilsCreateChainedFunction2['default'])(this.handleDelayedShow, this.props.onFocus);
props.onBlur = (0, _utilsCreateChainedFunction2['default'])(this.handleDelayedHide, this.props.onBlur);
}
return (0, _react.cloneElement)(child, props);
},
componentWillUnmount: function componentWillUnmount() {
clearTimeout(this._hoverDelay);
},
componentDidMount: function componentDidMount() {
if (this.props.defaultOverlayShown) {
this.updateOverlayPosition();
}
},
handleDelayedShow: function handleDelayedShow() {
if (this._hoverDelay != null) {
clearTimeout(this._hoverDelay);
this._hoverDelay = null;
return;
}
var delay = this.props.delayShow != null ? this.props.delayShow : this.props.delay;
if (!delay) {
this.show();
return;
}
this._hoverDelay = setTimeout((function () {
this._hoverDelay = null;
this.show();
}).bind(this), delay);
},
handleDelayedHide: function handleDelayedHide() {
if (this._hoverDelay != null) {
clearTimeout(this._hoverDelay);
this._hoverDelay = null;
return;
}
var delay = this.props.delayHide != null ? this.props.delayHide : this.props.delay;
if (!delay) {
this.hide();
return;
}
this._hoverDelay = setTimeout((function () {
this._hoverDelay = null;
this.hide();
}).bind(this), delay);
},
updateOverlayPosition: function updateOverlayPosition() {
if (!this.isMounted()) {
return;
}
this.setState(this.calcOverlayPosition());
},
calcOverlayPosition: function calcOverlayPosition() {
var childOffset = this.getPosition();
var overlayNode = this.getOverlayDOMNode();
var overlayHeight = overlayNode.offsetHeight;
var overlayWidth = overlayNode.offsetWidth;
var placement = this.props.placement;
var overlayLeft = undefined,
overlayTop = undefined,
arrowOffsetLeft = undefined,
arrowOffsetTop = undefined;
if (placement === 'left' || placement === 'right') {
overlayTop = childOffset.top + (childOffset.height - overlayHeight) / 2;
if (placement === 'left') {
overlayLeft = childOffset.left - overlayWidth;
} else {
overlayLeft = childOffset.left + childOffset.width;
}
var topDelta = this._getTopDelta(overlayTop, overlayHeight);
overlayTop += topDelta;
arrowOffsetTop = 50 * (1 - 2 * topDelta / overlayHeight) + '%';
arrowOffsetLeft = null;
} else if (placement === 'top' || placement === 'bottom') {
overlayLeft = childOffset.left + (childOffset.width - overlayWidth) / 2;
if (placement === 'top') {
overlayTop = childOffset.top - overlayHeight;
} else {
overlayTop = childOffset.top + childOffset.height;
}
var leftDelta = this._getLeftDelta(overlayLeft, overlayWidth);
overlayLeft += leftDelta;
arrowOffsetLeft = 50 * (1 - 2 * leftDelta / overlayWidth) + '%';
arrowOffsetTop = null;
} else {
throw new Error('calcOverlayPosition(): No such placement of "' + this.props.placement + '" found.');
}
return { overlayLeft: overlayLeft, overlayTop: overlayTop, arrowOffsetLeft: arrowOffsetLeft, arrowOffsetTop: arrowOffsetTop };
},
_getTopDelta: function _getTopDelta(top, overlayHeight) {
var containerDimensions = this._getContainerDimensions();
var containerScroll = containerDimensions.scroll;
var containerHeight = containerDimensions.height;
var padding = this.props.containerPadding;
var topEdgeOffset = top - padding - containerScroll;
var bottomEdgeOffset = top + padding - containerScroll + overlayHeight;
if (topEdgeOffset < 0) {
return -topEdgeOffset;
} else if (bottomEdgeOffset > containerHeight) {
return containerHeight - bottomEdgeOffset;
} else {
return 0;
}
},
_getLeftDelta: function _getLeftDelta(left, overlayWidth) {
var containerDimensions = this._getContainerDimensions();
var containerWidth = containerDimensions.width;
var padding = this.props.containerPadding;
var leftEdgeOffset = left - padding;
var rightEdgeOffset = left + padding + overlayWidth;
if (leftEdgeOffset < 0) {
return -leftEdgeOffset;
} else if (rightEdgeOffset > containerWidth) {
return containerWidth - rightEdgeOffset;
} else {
return 0;
}
},
_getContainerDimensions: function _getContainerDimensions() {
var containerNode = this.getContainerDOMNode();
var width = undefined,
height = undefined,
scroll = undefined;
if (containerNode.tagName === 'BODY') {
width = window.innerWidth;
height = window.innerHeight;
scroll = _utilsDomUtils2['default'].ownerDocument(containerNode).documentElement.scrollTop || containerNode.scrollTop;
} else {
width = containerNode.offsetWidth;
height = containerNode.offsetHeight;
scroll = containerNode.scrollTop;
}
return { width: width, height: height, scroll: scroll };
},
getPosition: function getPosition() {
var node = _react2['default'].findDOMNode(this);
var container = this.getContainerDOMNode();
var offset = container.tagName === 'BODY' ? _utilsDomUtils2['default'].getOffset(node) : _utilsDomUtils2['default'].getPosition(node, container);
return _extends({}, offset, { // eslint-disable-line object-shorthand
height: node.offsetHeight,
width: node.offsetWidth
});
}
});
/**
* Creates a new OverlayTrigger class that forwards the relevant context
*
* This static method should only be called at the module level, instead of in
* e.g. a render() method, because it's expensive to create new classes.
*
* For example, you would want to have:
*
* > export default OverlayTrigger.withContext({
* > myContextKey: React.PropTypes.object
* > });
*
* and import this when needed.
*/
OverlayTrigger.withContext = (0, _utilsCreateContextWrapper2['default'])(OverlayTrigger, 'overlay');
exports['default'] = OverlayTrigger;
module.exports = exports['default'];
/***/ },
/* 54 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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) subClass.__proto__ = superClass; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _utilsDomUtils = __webpack_require__(13);
var _utilsDomUtils2 = _interopRequireDefault(_utilsDomUtils);
var _utilsEventListener = __webpack_require__(14);
var _utilsEventListener2 = _interopRequireDefault(_utilsEventListener);
// TODO: Merge this logic with dropdown logic once #526 is done.
/**
* Checks whether a node is within
* a root nodes tree
*
* @param {DOMElement} node
* @param {DOMElement} root
* @returns {boolean}
*/
function isNodeInRoot(node, root) {
while (node) {
if (node === root) {
return true;
}
node = node.parentNode;
}
return false;
}
var RootCloseWrapper = (function (_React$Component) {
function RootCloseWrapper(props) {
_classCallCheck(this, RootCloseWrapper);
_get(Object.getPrototypeOf(RootCloseWrapper.prototype), 'constructor', this).call(this, props);
this.handleDocumentClick = this.handleDocumentClick.bind(this);
this.handleDocumentKeyUp = this.handleDocumentKeyUp.bind(this);
}
_inherits(RootCloseWrapper, _React$Component);
_createClass(RootCloseWrapper, [{
key: 'bindRootCloseHandlers',
value: function bindRootCloseHandlers() {
var doc = _utilsDomUtils2['default'].ownerDocument(this);
this._onDocumentClickListener = _utilsEventListener2['default'].listen(doc, 'click', this.handleDocumentClick);
this._onDocumentKeyupListener = _utilsEventListener2['default'].listen(doc, 'keyup', this.handleDocumentKeyUp);
}
}, {
key: 'handleDocumentClick',
value: function handleDocumentClick(e) {
// If the click originated from within this component, don't do anything.
// e.srcElement is required for IE8 as e.target is undefined
var target = e.target || e.srcElement;
if (isNodeInRoot(target, _react2['default'].findDOMNode(this))) {
return;
}
this.props.onRootClose();
}
}, {
key: 'handleDocumentKeyUp',
value: function handleDocumentKeyUp(e) {
if (e.keyCode === 27) {
this.props.onRootClose();
}
}
}, {
key: 'unbindRootCloseHandlers',
value: function unbindRootCloseHandlers() {
if (this._onDocumentClickListener) {
this._onDocumentClickListener.remove();
}
if (this._onDocumentKeyupListener) {
this._onDocumentKeyupListener.remove();
}
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
this.bindRootCloseHandlers();
}
}, {
key: 'render',
value: function render() {
return _react2['default'].Children.only(this.props.children);
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.unbindRootCloseHandlers();
}
}]);
return RootCloseWrapper;
})(_react2['default'].Component);
exports['default'] = RootCloseWrapper;
RootCloseWrapper.propTypes = {
onRootClose: _react2['default'].PropTypes.func.isRequired
};
module.exports = exports['default'];
/***/ },
/* 55 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var PageHeader = _react2['default'].createClass({
displayName: 'PageHeader',
render: function render() {
return _react2['default'].createElement(
'div',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'page-header') }),
_react2['default'].createElement(
'h1',
null,
this.props.children
)
);
}
});
exports['default'] = PageHeader;
module.exports = exports['default'];
/***/ },
/* 56 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _PaginationButton = __webpack_require__(57);
var _PaginationButton2 = _interopRequireDefault(_PaginationButton);
var Pagination = _react2['default'].createClass({
displayName: 'Pagination',
mixins: [_BootstrapMixin2['default']],
propTypes: {
activePage: _react2['default'].PropTypes.number,
items: _react2['default'].PropTypes.number,
maxButtons: _react2['default'].PropTypes.number,
ellipsis: _react2['default'].PropTypes.bool,
first: _react2['default'].PropTypes.bool,
last: _react2['default'].PropTypes.bool,
prev: _react2['default'].PropTypes.bool,
next: _react2['default'].PropTypes.bool,
onSelect: _react2['default'].PropTypes.func
},
getDefaultProps: function getDefaultProps() {
return {
activePage: 1,
items: 1,
maxButtons: 0,
first: false,
last: false,
prev: false,
next: false,
ellipsis: true,
bsClass: 'pagination'
};
},
renderPageButtons: function renderPageButtons() {
var pageButtons = [];
var startPage = undefined,
endPage = undefined,
hasHiddenPagesAfter = undefined;
var _props = this.props;
var maxButtons = _props.maxButtons;
var activePage = _props.activePage;
var items = _props.items;
var onSelect = _props.onSelect;
var ellipsis = _props.ellipsis;
if (maxButtons) {
var hiddenPagesBefore = activePage - parseInt(maxButtons / 2);
startPage = hiddenPagesBefore > 1 ? hiddenPagesBefore : 1;
hasHiddenPagesAfter = startPage + maxButtons <= items;
if (!hasHiddenPagesAfter) {
endPage = items;
startPage = items - maxButtons + 1;
} else {
endPage = startPage + maxButtons - 1;
}
} else {
startPage = 1;
endPage = items;
}
for (var pagenumber = startPage; pagenumber <= endPage; pagenumber++) {
pageButtons.push(_react2['default'].createElement(
_PaginationButton2['default'],
{
key: pagenumber,
eventKey: pagenumber,
active: pagenumber === activePage,
onSelect: onSelect },
pagenumber
));
}
if (maxButtons && hasHiddenPagesAfter && ellipsis) {
pageButtons.push(_react2['default'].createElement(
_PaginationButton2['default'],
{
key: 'ellipsis',
disabled: true },
_react2['default'].createElement(
'span',
{ 'aria-label': 'More' },
'...'
)
));
}
return pageButtons;
},
renderPrev: function renderPrev() {
if (!this.props.prev) {
return null;
}
return _react2['default'].createElement(
_PaginationButton2['default'],
{
key: 'prev',
eventKey: this.props.activePage - 1,
disabled: this.props.activePage === 1,
onSelect: this.props.onSelect },
_react2['default'].createElement(
'span',
{ 'aria-label': 'Previous' },
'‹'
)
);
},
renderNext: function renderNext() {
if (!this.props.next) {
return null;
}
return _react2['default'].createElement(
_PaginationButton2['default'],
{
key: 'next',
eventKey: this.props.activePage + 1,
disabled: this.props.activePage === this.props.items,
onSelect: this.props.onSelect },
_react2['default'].createElement(
'span',
{ 'aria-label': 'Next' },
'›'
)
);
},
renderFirst: function renderFirst() {
if (!this.props.first) {
return null;
}
return _react2['default'].createElement(
_PaginationButton2['default'],
{
key: 'first',
eventKey: 1,
disabled: this.props.activePage === 1,
onSelect: this.props.onSelect },
_react2['default'].createElement(
'span',
{ 'aria-label': 'First' },
'«'
)
);
},
renderLast: function renderLast() {
if (!this.props.last) {
return null;
}
return _react2['default'].createElement(
_PaginationButton2['default'],
{
key: 'last',
eventKey: this.props.items,
disabled: this.props.activePage === this.props.items,
onSelect: this.props.onSelect },
_react2['default'].createElement(
'span',
{ 'aria-label': 'Last' },
'»'
)
);
},
render: function render() {
return _react2['default'].createElement(
'ul',
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, this.getBsClassSet()) }),
this.renderFirst(),
this.renderPrev(),
this.renderPageButtons(),
this.renderNext(),
this.renderLast()
);
}
});
exports['default'] = Pagination;
module.exports = exports['default'];
/***/ },
/* 57 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _utilsCreateSelectedEvent = __webpack_require__(58);
var _utilsCreateSelectedEvent2 = _interopRequireDefault(_utilsCreateSelectedEvent);
var PaginationButton = _react2['default'].createClass({
displayName: 'PaginationButton',
mixins: [_BootstrapMixin2['default']],
propTypes: {
className: _react2['default'].PropTypes.string,
eventKey: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.string, _react2['default'].PropTypes.number]),
onSelect: _react2['default'].PropTypes.func,
disabled: _react2['default'].PropTypes.bool,
active: _react2['default'].PropTypes.bool
},
getDefaultProps: function getDefaultProps() {
return {
active: false,
disabled: false
};
},
handleClick: function handleClick(event) {
// This would go away once SafeAnchor is available
event.preventDefault();
if (this.props.onSelect) {
var selectedEvent = (0, _utilsCreateSelectedEvent2['default'])(this.props.eventKey);
this.props.onSelect(event, selectedEvent);
}
},
render: function render() {
var classes = this.getBsClassSet();
classes.active = this.props.active;
classes.disabled = this.props.disabled;
return _react2['default'].createElement(
'li',
{ className: (0, _classnames2['default'])(this.props.className, classes) },
_react2['default'].createElement(
'a',
{ href: '#', onClick: this.handleClick },
this.props.children
)
);
}
});
exports['default'] = PaginationButton;
module.exports = exports['default'];
/***/ },
/* 58 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = createSelectedEvent;
function createSelectedEvent(eventKey) {
var selectionPrevented = false;
return {
eventKey: eventKey,
preventSelection: function preventSelection() {
selectionPrevented = true;
},
isSelectionPrevented: function isSelectionPrevented() {
return selectionPrevented;
}
};
}
module.exports = exports["default"];
/***/ },
/* 59 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _CollapsibleMixin = __webpack_require__(25);
var _CollapsibleMixin2 = _interopRequireDefault(_CollapsibleMixin);
var Panel = _react2['default'].createClass({
displayName: 'Panel',
mixins: [_BootstrapMixin2['default'], _CollapsibleMixin2['default']],
propTypes: {
collapsible: _react2['default'].PropTypes.bool,
onSelect: _react2['default'].PropTypes.func,
header: _react2['default'].PropTypes.node,
id: _react2['default'].PropTypes.string,
footer: _react2['default'].PropTypes.node,
eventKey: _react2['default'].PropTypes.any
},
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'panel',
bsStyle: 'default'
};
},
handleSelect: function handleSelect(e) {
e.selected = true;
if (this.props.onSelect) {
this.props.onSelect(e, this.props.eventKey);
} else {
e.preventDefault();
}
if (e.selected) {
this.handleToggle();
}
},
handleToggle: function handleToggle() {
this.setState({ expanded: !this.state.expanded });
},
getCollapsibleDimensionValue: function getCollapsibleDimensionValue() {
return _react2['default'].findDOMNode(this.refs.panel).scrollHeight;
},
getCollapsibleDOMNode: function getCollapsibleDOMNode() {
if (!this.isMounted() || !this.refs || !this.refs.panel) {
return null;
}
return _react2['default'].findDOMNode(this.refs.panel);
},
render: function render() {
return _react2['default'].createElement(
'div',
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, this.getBsClassSet()),
id: this.props.collapsible ? null : this.props.id, onSelect: null }),
this.renderHeading(),
this.props.collapsible ? this.renderCollapsibleBody() : this.renderBody(),
this.renderFooter()
);
},
renderCollapsibleBody: function renderCollapsibleBody() {
var collapseClass = this.prefixClass('collapse');
return _react2['default'].createElement(
'div',
{
className: (0, _classnames2['default'])(this.getCollapsibleClassSet(collapseClass)),
id: this.props.id,
ref: 'panel',
'aria-expanded': this.isExpanded() ? 'true' : 'false' },
this.renderBody()
);
},
renderBody: function renderBody() {
var allChildren = this.props.children;
var bodyElements = [];
var panelBodyChildren = [];
var bodyClass = this.prefixClass('body');
function getProps() {
return { key: bodyElements.length };
}
function addPanelChild(child) {
bodyElements.push((0, _react.cloneElement)(child, getProps()));
}
function addPanelBody(children) {
bodyElements.push(_react2['default'].createElement(
'div',
_extends({ className: bodyClass }, getProps()),
children
));
}
function maybeRenderPanelBody() {
if (panelBodyChildren.length === 0) {
return;
}
addPanelBody(panelBodyChildren);
panelBodyChildren = [];
}
// Handle edge cases where we should not iterate through children.
if (!Array.isArray(allChildren) || allChildren.length === 0) {
if (this.shouldRenderFill(allChildren)) {
addPanelChild(allChildren);
} else {
addPanelBody(allChildren);
}
} else {
allChildren.forEach((function (child) {
if (this.shouldRenderFill(child)) {
maybeRenderPanelBody();
// Separately add the filled element.
addPanelChild(child);
} else {
panelBodyChildren.push(child);
}
}).bind(this));
maybeRenderPanelBody();
}
return bodyElements;
},
shouldRenderFill: function shouldRenderFill(child) {
return _react2['default'].isValidElement(child) && child.props.fill != null;
},
renderHeading: function renderHeading() {
var header = this.props.header;
if (!header) {
return null;
}
if (!_react2['default'].isValidElement(header) || Array.isArray(header)) {
header = this.props.collapsible ? this.renderCollapsibleTitle(header) : header;
} else {
var className = (0, _classnames2['default'])(this.prefixClass('title'), header.props.className);
if (this.props.collapsible) {
header = (0, _react.cloneElement)(header, {
className: className,
children: this.renderAnchor(header.props.children)
});
} else {
header = (0, _react.cloneElement)(header, { className: className });
}
}
return _react2['default'].createElement(
'div',
{ className: this.prefixClass('heading') },
header
);
},
renderAnchor: function renderAnchor(header) {
return _react2['default'].createElement(
'a',
{
href: '#' + (this.props.id || ''),
className: this.isExpanded() ? null : 'collapsed',
'aria-expanded': this.isExpanded() ? 'true' : 'false',
onClick: this.handleSelect },
header
);
},
renderCollapsibleTitle: function renderCollapsibleTitle(header) {
return _react2['default'].createElement(
'h4',
{ className: this.prefixClass('title') },
this.renderAnchor(header)
);
},
renderFooter: function renderFooter() {
if (!this.props.footer) {
return null;
}
return _react2['default'].createElement(
'div',
{ className: this.prefixClass('footer') },
this.props.footer
);
}
});
exports['default'] = Panel;
module.exports = exports['default'];
/***/ },
/* 60 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _SafeAnchor = __webpack_require__(4);
var _SafeAnchor2 = _interopRequireDefault(_SafeAnchor);
var PageItem = _react2['default'].createClass({
displayName: 'PageItem',
propTypes: {
href: _react2['default'].PropTypes.string,
target: _react2['default'].PropTypes.string,
title: _react2['default'].PropTypes.string,
disabled: _react2['default'].PropTypes.bool,
previous: _react2['default'].PropTypes.bool,
next: _react2['default'].PropTypes.bool,
onSelect: _react2['default'].PropTypes.func,
eventKey: _react2['default'].PropTypes.any
},
render: function render() {
var classes = {
'disabled': this.props.disabled,
'previous': this.props.previous,
'next': this.props.next
};
return _react2['default'].createElement(
'li',
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, classes) }),
_react2['default'].createElement(
_SafeAnchor2['default'],
{
href: this.props.href,
title: this.props.title,
target: this.props.target,
onClick: this.handleSelect },
this.props.children
)
);
},
handleSelect: function handleSelect(e) {
if (this.props.onSelect) {
e.preventDefault();
if (!this.props.disabled) {
this.props.onSelect(this.props.eventKey, this.props.href, this.props.target);
}
}
}
});
exports['default'] = PageItem;
module.exports = exports['default'];
/***/ },
/* 61 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var _utilsCreateChainedFunction = __webpack_require__(27);
var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction);
var Pager = _react2['default'].createClass({
displayName: 'Pager',
propTypes: {
onSelect: _react2['default'].PropTypes.func
},
render: function render() {
return _react2['default'].createElement(
'ul',
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, 'pager') }),
_utilsValidComponentChildren2['default'].map(this.props.children, this.renderPageItem)
);
},
renderPageItem: function renderPageItem(child, index) {
return (0, _react.cloneElement)(child, {
onSelect: (0, _utilsCreateChainedFunction2['default'])(child.props.onSelect, this.props.onSelect),
key: child.key ? child.key : index
});
}
});
exports['default'] = Pager;
module.exports = exports['default'];
/***/ },
/* 62 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _defineProperty(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _FadeMixin = __webpack_require__(35);
var _FadeMixin2 = _interopRequireDefault(_FadeMixin);
var Popover = _react2['default'].createClass({
displayName: 'Popover',
mixins: [_BootstrapMixin2['default'], _FadeMixin2['default']],
propTypes: {
placement: _react2['default'].PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
positionLeft: _react2['default'].PropTypes.number,
positionTop: _react2['default'].PropTypes.number,
arrowOffsetLeft: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.number, _react2['default'].PropTypes.string]),
arrowOffsetTop: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.number, _react2['default'].PropTypes.string]),
title: _react2['default'].PropTypes.node,
animation: _react2['default'].PropTypes.bool
},
getDefaultProps: function getDefaultProps() {
return {
placement: 'right',
animation: true
};
},
render: function render() {
var _classes;
var classes = (_classes = {
'popover': true
}, _defineProperty(_classes, this.props.placement, true), _defineProperty(_classes, 'in', !this.props.animation && (this.props.positionLeft != null || this.props.positionTop != null)), _defineProperty(_classes, 'fade', this.props.animation), _classes);
var style = {
'left': this.props.positionLeft,
'top': this.props.positionTop,
'display': 'block'
};
var arrowStyle = {
'left': this.props.arrowOffsetLeft,
'top': this.props.arrowOffsetTop
};
return _react2['default'].createElement(
'div',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), style: style, title: null }),
_react2['default'].createElement('div', { className: 'arrow', style: arrowStyle }),
this.props.title ? this.renderTitle() : null,
_react2['default'].createElement(
'div',
{ className: 'popover-content' },
this.props.children
)
);
},
renderTitle: function renderTitle() {
return _react2['default'].createElement(
'h3',
{ className: 'popover-title' },
this.props.title
);
}
});
exports['default'] = Popover;
module.exports = exports['default'];
// in class will be added by the FadeMixin when the animation property is true
/***/ },
/* 63 */
/***/ function(module, exports, __webpack_require__) {
/* eslint react/prop-types: [1, {ignore: ["className", "bsStyle"]}]*/
/* BootstrapMixin contains `bsStyle` type validation */
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _Interpolate = __webpack_require__(41);
var _Interpolate2 = _interopRequireDefault(_Interpolate);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var ProgressBar = _react2['default'].createClass({
displayName: 'ProgressBar',
propTypes: {
min: _react.PropTypes.number,
now: _react.PropTypes.number,
max: _react.PropTypes.number,
label: _react.PropTypes.node,
srOnly: _react.PropTypes.bool,
striped: _react.PropTypes.bool,
active: _react.PropTypes.bool,
children: onlyProgressBar,
interpolateClass: _react.PropTypes.node,
isChild: _react.PropTypes.bool
},
mixins: [_BootstrapMixin2['default']],
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'progress-bar',
min: 0,
max: 100
};
},
getPercentage: function getPercentage(now, min, max) {
var roundPrecision = 1000;
return Math.round((now - min) / (max - min) * 100 * roundPrecision) / roundPrecision;
},
render: function render() {
if (this.props.isChild) {
return this.renderProgressBar();
}
var classes = {
active: this.props.active,
progress: true,
'progress-striped': this.props.active || this.props.striped
};
var content = undefined;
if (this.props.children) {
content = _utilsValidComponentChildren2['default'].map(this.props.children, this.renderChildBar);
} else {
content = this.renderProgressBar();
}
return _react2['default'].createElement(
'div',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
content
);
},
renderChildBar: function renderChildBar(child, index) {
return (0, _react.cloneElement)(child, {
isChild: true,
key: child.key ? child.key : index
});
},
renderProgressBar: function renderProgressBar() {
var percentage = this.getPercentage(this.props.now, this.props.min, this.props.max);
var label = undefined;
if (typeof this.props.label === 'string') {
label = this.renderLabel(percentage);
} else {
label = this.props.label;
}
if (this.props.srOnly) {
label = _react2['default'].createElement(
'span',
{ className: 'sr-only' },
label
);
}
return _react2['default'].createElement(
'div',
_extends({}, this.props, {
className: (0, _classnames2['default'])(this.props.className, this.getBsClassSet()),
role: 'progressbar',
style: { width: percentage + '%' },
'aria-valuenow': this.props.now,
'aria-valuemin': this.props.min,
'aria-valuemax': this.props.max }),
label
);
},
renderLabel: function renderLabel(percentage) {
var InterpolateClass = this.props.interpolateClass || _Interpolate2['default'];
return _react2['default'].createElement(
InterpolateClass,
{
now: this.props.now,
min: this.props.min,
max: this.props.max,
percent: percentage,
bsStyle: this.props.bsStyle },
this.props.label
);
}
});
/**
* Custom propTypes checker
*/
function onlyProgressBar(props, propName, componentName) {
if (props[propName]) {
var _ret = (function () {
var error = undefined,
childIdentifier = undefined;
_react2['default'].Children.forEach(props[propName], function (child) {
if (child.type !== ProgressBar) {
childIdentifier = child.type.displayName ? child.type.displayName : child.type;
error = new Error('Children of ' + componentName + ' can contain only ProgressBar components. Found ' + childIdentifier);
}
});
return {
v: error
};
})();
if (typeof _ret === 'object') return _ret.v;
}
}
exports['default'] = ProgressBar;
module.exports = exports['default'];
/***/ },
/* 64 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var Row = _react2['default'].createClass({
displayName: 'Row',
propTypes: {
componentClass: _react2['default'].PropTypes.node.isRequired
},
getDefaultProps: function getDefaultProps() {
return {
componentClass: 'div'
};
},
render: function render() {
var ComponentClass = this.props.componentClass;
return _react2['default'].createElement(
ComponentClass,
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, 'row') }),
this.props.children
);
}
});
exports['default'] = Row;
module.exports = exports['default'];
/***/ },
/* 65 */
/***/ function(module, exports, __webpack_require__) {
/* eslint react/prop-types: [1, {ignore: ["children", "className", "bsSize"]}]*/
/* BootstrapMixin contains `bsSize` type validation */
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _DropdownStateMixin = __webpack_require__(33);
var _DropdownStateMixin2 = _interopRequireDefault(_DropdownStateMixin);
var _Button = __webpack_require__(17);
var _Button2 = _interopRequireDefault(_Button);
var _ButtonGroup = __webpack_require__(18);
var _ButtonGroup2 = _interopRequireDefault(_ButtonGroup);
var _DropdownMenu = __webpack_require__(34);
var _DropdownMenu2 = _interopRequireDefault(_DropdownMenu);
var SplitButton = _react2['default'].createClass({
displayName: 'SplitButton',
mixins: [_BootstrapMixin2['default'], _DropdownStateMixin2['default']],
propTypes: {
pullRight: _react2['default'].PropTypes.bool,
title: _react2['default'].PropTypes.node,
href: _react2['default'].PropTypes.string,
id: _react2['default'].PropTypes.string,
target: _react2['default'].PropTypes.string,
dropdownTitle: _react2['default'].PropTypes.node,
dropup: _react2['default'].PropTypes.bool,
onClick: _react2['default'].PropTypes.func,
onSelect: _react2['default'].PropTypes.func,
disabled: _react2['default'].PropTypes.bool
},
getDefaultProps: function getDefaultProps() {
return {
dropdownTitle: 'Toggle dropdown'
};
},
render: function render() {
var groupClasses = {
'open': this.state.open,
'dropup': this.props.dropup
};
var button = _react2['default'].createElement(
_Button2['default'],
_extends({}, this.props, {
ref: 'button',
onClick: this.handleButtonClick,
title: null,
id: null }),
this.props.title
);
var dropdownButton = _react2['default'].createElement(
_Button2['default'],
_extends({}, this.props, {
ref: 'dropdownButton',
className: (0, _classnames2['default'])(this.props.className, 'dropdown-toggle'),
onClick: this.handleDropdownClick,
title: null,
href: null,
target: null,
id: null }),
_react2['default'].createElement(
'span',
{ className: 'sr-only' },
this.props.dropdownTitle
),
_react2['default'].createElement('span', { className: 'caret' }),
_react2['default'].createElement(
'span',
{ style: { letterSpacing: '-.3em' } },
' '
)
);
return _react2['default'].createElement(
_ButtonGroup2['default'],
{
bsSize: this.props.bsSize,
className: (0, _classnames2['default'])(groupClasses),
id: this.props.id },
button,
dropdownButton,
_react2['default'].createElement(
_DropdownMenu2['default'],
{
ref: 'menu',
onSelect: this.handleOptionSelect,
'aria-labelledby': this.props.id,
pullRight: this.props.pullRight },
this.props.children
)
);
},
handleButtonClick: function handleButtonClick(e) {
if (this.state.open) {
this.setDropdownState(false);
}
if (this.props.onClick) {
this.props.onClick(e, this.props.href, this.props.target);
}
},
handleDropdownClick: function handleDropdownClick(e) {
e.preventDefault();
this.setDropdownState(!this.state.open);
},
handleOptionSelect: function handleOptionSelect(key) {
if (this.props.onSelect) {
this.props.onSelect(key);
}
this.setDropdownState(false);
}
});
exports['default'] = SplitButton;
module.exports = exports['default'];
/***/ },
/* 66 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var _utilsCreateChainedFunction = __webpack_require__(27);
var _utilsCreateChainedFunction2 = _interopRequireDefault(_utilsCreateChainedFunction);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _SafeAnchor = __webpack_require__(4);
var _SafeAnchor2 = _interopRequireDefault(_SafeAnchor);
var SubNav = _react2['default'].createClass({
displayName: 'SubNav',
mixins: [_BootstrapMixin2['default']],
propTypes: {
onSelect: _react2['default'].PropTypes.func,
active: _react2['default'].PropTypes.bool,
activeHref: _react2['default'].PropTypes.string,
activeKey: _react2['default'].PropTypes.any,
disabled: _react2['default'].PropTypes.bool,
eventKey: _react2['default'].PropTypes.any,
href: _react2['default'].PropTypes.string,
title: _react2['default'].PropTypes.string,
text: _react2['default'].PropTypes.node,
target: _react2['default'].PropTypes.string
},
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'nav'
};
},
handleClick: function handleClick(e) {
if (this.props.onSelect) {
e.preventDefault();
if (!this.props.disabled) {
this.props.onSelect(this.props.eventKey, this.props.href, this.props.target);
}
}
},
isActive: function isActive() {
return this.isChildActive(this);
},
isChildActive: function isChildActive(child) {
if (child.props.active) {
return true;
}
if (this.props.activeKey != null && this.props.activeKey === child.props.eventKey) {
return true;
}
if (this.props.activeHref != null && this.props.activeHref === child.props.href) {
return true;
}
if (child.props.children) {
var isActive = false;
_utilsValidComponentChildren2['default'].forEach(child.props.children, function (grandchild) {
if (this.isChildActive(grandchild)) {
isActive = true;
}
}, this);
return isActive;
}
return false;
},
getChildActiveProp: function getChildActiveProp(child) {
if (child.props.active) {
return true;
}
if (this.props.activeKey != null) {
if (child.props.eventKey === this.props.activeKey) {
return true;
}
}
if (this.props.activeHref != null) {
if (child.props.href === this.props.activeHref) {
return true;
}
}
return child.props.active;
},
render: function render() {
var classes = {
'active': this.isActive(),
'disabled': this.props.disabled
};
return _react2['default'].createElement(
'li',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
_react2['default'].createElement(
_SafeAnchor2['default'],
{
href: this.props.href,
title: this.props.title,
target: this.props.target,
onClick: this.handleClick },
this.props.text
),
_react2['default'].createElement(
'ul',
{ className: 'nav' },
_utilsValidComponentChildren2['default'].map(this.props.children, this.renderNavItem)
)
);
},
renderNavItem: function renderNavItem(child, index) {
return (0, _react.cloneElement)(child, {
active: this.getChildActiveProp(child),
onSelect: (0, _utilsCreateChainedFunction2['default'])(child.props.onSelect, this.props.onSelect),
key: child.key ? child.key : index
});
}
});
exports['default'] = SubNav;
module.exports = exports['default'];
/***/ },
/* 67 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _utilsValidComponentChildren = __webpack_require__(10);
var _utilsValidComponentChildren2 = _interopRequireDefault(_utilsValidComponentChildren);
var _Nav = __webpack_require__(47);
var _Nav2 = _interopRequireDefault(_Nav);
var _NavItem = __webpack_require__(49);
var _NavItem2 = _interopRequireDefault(_NavItem);
function getDefaultActiveKeyFromChildren(children) {
var defaultActiveKey = undefined;
_utilsValidComponentChildren2['default'].forEach(children, function (child) {
if (defaultActiveKey == null) {
defaultActiveKey = child.props.eventKey;
}
});
return defaultActiveKey;
}
var TabbedArea = _react2['default'].createClass({
displayName: 'TabbedArea',
mixins: [_BootstrapMixin2['default']],
propTypes: {
activeKey: _react2['default'].PropTypes.any,
defaultActiveKey: _react2['default'].PropTypes.any,
bsStyle: _react2['default'].PropTypes.oneOf(['tabs', 'pills']),
animation: _react2['default'].PropTypes.bool,
id: _react2['default'].PropTypes.string,
onSelect: _react2['default'].PropTypes.func
},
getDefaultProps: function getDefaultProps() {
return {
bsStyle: 'tabs',
animation: true
};
},
getInitialState: function getInitialState() {
var defaultActiveKey = this.props.defaultActiveKey != null ? this.props.defaultActiveKey : getDefaultActiveKeyFromChildren(this.props.children);
return {
activeKey: defaultActiveKey,
previousActiveKey: null
};
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
if (nextProps.activeKey != null && nextProps.activeKey !== this.props.activeKey) {
this.setState({
previousActiveKey: this.props.activeKey
});
}
},
handlePaneAnimateOutEnd: function handlePaneAnimateOutEnd() {
this.setState({
previousActiveKey: null
});
},
render: function render() {
var activeKey = this.props.activeKey != null ? this.props.activeKey : this.state.activeKey;
function renderTabIfSet(child) {
return child.props.tab != null ? this.renderTab(child) : null;
}
var nav = _react2['default'].createElement(
_Nav2['default'],
_extends({}, this.props, { activeKey: activeKey, onSelect: this.handleSelect, ref: 'tabs' }),
_utilsValidComponentChildren2['default'].map(this.props.children, renderTabIfSet, this)
);
return _react2['default'].createElement(
'div',
null,
nav,
_react2['default'].createElement(
'div',
{ id: this.props.id, className: 'tab-content', ref: 'panes' },
_utilsValidComponentChildren2['default'].map(this.props.children, this.renderPane)
)
);
},
getActiveKey: function getActiveKey() {
return this.props.activeKey != null ? this.props.activeKey : this.state.activeKey;
},
renderPane: function renderPane(child, index) {
var activeKey = this.getActiveKey();
return (0, _react.cloneElement)(child, {
active: child.props.eventKey === activeKey && (this.state.previousActiveKey == null || !this.props.animation),
key: child.key ? child.key : index,
animation: this.props.animation,
onAnimateOutEnd: this.state.previousActiveKey != null && child.props.eventKey === this.state.previousActiveKey ? this.handlePaneAnimateOutEnd : null
});
},
renderTab: function renderTab(child) {
var _child$props = child.props;
var eventKey = _child$props.eventKey;
var className = _child$props.className;
var tab = _child$props.tab;
var disabled = _child$props.disabled;
return _react2['default'].createElement(
_NavItem2['default'],
{
ref: 'tab' + eventKey,
eventKey: eventKey,
className: className,
disabled: disabled },
tab
);
},
shouldComponentUpdate: function shouldComponentUpdate() {
// Defer any updates to this component during the `onSelect` handler.
return !this._isChanging;
},
handleSelect: function handleSelect(key) {
if (this.props.onSelect) {
this._isChanging = true;
this.props.onSelect(key);
this._isChanging = false;
} else if (key !== this.getActiveKey()) {
this.setState({
activeKey: key,
previousActiveKey: this.getActiveKey()
});
}
}
});
exports['default'] = TabbedArea;
module.exports = exports['default'];
/***/ },
/* 68 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var Table = _react2['default'].createClass({
displayName: 'Table',
propTypes: {
striped: _react2['default'].PropTypes.bool,
bordered: _react2['default'].PropTypes.bool,
condensed: _react2['default'].PropTypes.bool,
hover: _react2['default'].PropTypes.bool,
responsive: _react2['default'].PropTypes.bool
},
render: function render() {
var classes = {
'table': true,
'table-striped': this.props.striped,
'table-bordered': this.props.bordered,
'table-condensed': this.props.condensed,
'table-hover': this.props.hover
};
var table = _react2['default'].createElement(
'table',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.children
);
return this.props.responsive ? _react2['default'].createElement(
'div',
{ className: 'table-responsive' },
table
) : table;
}
});
exports['default'] = Table;
module.exports = exports['default'];
/***/ },
/* 69 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _utilsTransitionEvents = __webpack_require__(26);
var _utilsTransitionEvents2 = _interopRequireDefault(_utilsTransitionEvents);
var TabPane = _react2['default'].createClass({
displayName: 'TabPane',
propTypes: {
active: _react2['default'].PropTypes.bool,
animation: _react2['default'].PropTypes.bool,
onAnimateOutEnd: _react2['default'].PropTypes.func,
disabled: _react2['default'].PropTypes.bool
},
getDefaultProps: function getDefaultProps() {
return {
animation: true
};
},
getInitialState: function getInitialState() {
return {
animateIn: false,
animateOut: false
};
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
if (this.props.animation) {
if (!this.state.animateIn && nextProps.active && !this.props.active) {
this.setState({
animateIn: true
});
} else if (!this.state.animateOut && !nextProps.active && this.props.active) {
this.setState({
animateOut: true
});
}
}
},
componentDidUpdate: function componentDidUpdate() {
if (this.state.animateIn) {
setTimeout(this.startAnimateIn, 0);
}
if (this.state.animateOut) {
_utilsTransitionEvents2['default'].addEndEventListener(_react2['default'].findDOMNode(this), this.stopAnimateOut);
}
},
startAnimateIn: function startAnimateIn() {
if (this.isMounted()) {
this.setState({
animateIn: false
});
}
},
stopAnimateOut: function stopAnimateOut() {
if (this.isMounted()) {
this.setState({
animateOut: false
});
if (this.props.onAnimateOutEnd) {
this.props.onAnimateOutEnd();
}
}
},
render: function render() {
var classes = {
'tab-pane': true,
'fade': true,
'active': this.props.active || this.state.animateOut,
'in': this.props.active && !this.state.animateIn
};
return _react2['default'].createElement(
'div',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.children
);
}
});
exports['default'] = TabPane;
module.exports = exports['default'];
/***/ },
/* 70 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _SafeAnchor = __webpack_require__(4);
var _SafeAnchor2 = _interopRequireDefault(_SafeAnchor);
var Thumbnail = _react2['default'].createClass({
displayName: 'Thumbnail',
mixins: [_BootstrapMixin2['default']],
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'thumbnail'
};
},
render: function render() {
var classes = this.getBsClassSet();
if (this.props.href) {
return _react2['default'].createElement(
_SafeAnchor2['default'],
_extends({}, this.props, { href: this.props.href, className: (0, _classnames2['default'])(this.props.className, classes) }),
_react2['default'].createElement('img', { src: this.props.src, alt: this.props.alt })
);
} else {
if (this.props.children) {
return _react2['default'].createElement(
'div',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
_react2['default'].createElement('img', { src: this.props.src, alt: this.props.alt }),
_react2['default'].createElement(
'div',
{ className: 'caption' },
this.props.children
)
);
} else {
return _react2['default'].createElement(
'div',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
_react2['default'].createElement('img', { src: this.props.src, alt: this.props.alt })
);
}
}
}
});
exports['default'] = Thumbnail;
module.exports = exports['default'];
/***/ },
/* 71 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _defineProperty(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var _FadeMixin = __webpack_require__(35);
var _FadeMixin2 = _interopRequireDefault(_FadeMixin);
var Tooltip = _react2['default'].createClass({
displayName: 'Tooltip',
mixins: [_BootstrapMixin2['default'], _FadeMixin2['default']],
propTypes: {
placement: _react2['default'].PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
positionLeft: _react2['default'].PropTypes.number,
positionTop: _react2['default'].PropTypes.number,
arrowOffsetLeft: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.number, _react2['default'].PropTypes.string]),
arrowOffsetTop: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.number, _react2['default'].PropTypes.string]),
animation: _react2['default'].PropTypes.bool
},
getDefaultProps: function getDefaultProps() {
return {
placement: 'right',
animation: true
};
},
render: function render() {
var _classes;
var classes = (_classes = {
'tooltip': true
}, _defineProperty(_classes, this.props.placement, true), _defineProperty(_classes, 'in', !this.props.animation && (this.props.positionLeft != null || this.props.positionTop != null)), _defineProperty(_classes, 'fade', this.props.animation), _classes);
var style = {
'left': this.props.positionLeft,
'top': this.props.positionTop
};
var arrowStyle = {
'left': this.props.arrowOffsetLeft,
'top': this.props.arrowOffsetTop
};
return _react2['default'].createElement(
'div',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes), style: style }),
_react2['default'].createElement('div', { className: 'tooltip-arrow', style: arrowStyle }),
_react2['default'].createElement(
'div',
{ className: 'tooltip-inner' },
this.props.children
)
);
}
});
exports['default'] = Tooltip;
module.exports = exports['default'];
// in class will be added by the FadeMixin when the animation property is true
/***/ },
/* 72 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _childrenValueInputValidation = __webpack_require__(22);
var _childrenValueInputValidation2 = _interopRequireDefault(_childrenValueInputValidation);
var _createChainedFunction = __webpack_require__(27);
var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
var _CustomPropTypes = __webpack_require__(9);
var _CustomPropTypes2 = _interopRequireDefault(_CustomPropTypes);
var _domUtils = __webpack_require__(13);
var _domUtils2 = _interopRequireDefault(_domUtils);
var _ValidComponentChildren = __webpack_require__(10);
var _ValidComponentChildren2 = _interopRequireDefault(_ValidComponentChildren);
exports['default'] = {
childrenValueInputValidation: _childrenValueInputValidation2['default'],
createChainedFunction: _createChainedFunction2['default'],
CustomPropTypes: _CustomPropTypes2['default'],
domUtils: _domUtils2['default'],
ValidComponentChildren: _ValidComponentChildren2['default']
};
module.exports = exports['default'];
/***/ },
/* 73 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _BootstrapMixin = __webpack_require__(7);
var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
var Well = _react2['default'].createClass({
displayName: 'Well',
mixins: [_BootstrapMixin2['default']],
getDefaultProps: function getDefaultProps() {
return {
bsClass: 'well'
};
},
render: function render() {
var classes = this.getBsClassSet();
return _react2['default'].createElement(
'div',
_extends({}, this.props, { className: (0, _classnames2['default'])(this.props.className, classes) }),
this.props.children
);
}
});
exports['default'] = Well;
module.exports = exports['default'];
/***/ }
/******/ ])
});
; |
app/assets/scripts/views/map.js | openaq/openaq.github.io | 'use strict';
import React from 'react';
import { connect } from 'react-redux';
import mapboxgl from 'mapbox-gl';
import c from 'classnames';
import _ from 'lodash';
import { Dropdown } from 'openaq-design-system';
import { hashHistory } from 'react-router';
import MapComponent from '../components/map';
import HeaderMessage from '../components/header-message';
import { fetchLatestMeasurements, invalidateAllLocationData } from '../actions/action-creators';
import { generateLegendStops } from '../utils/colors';
import config from '../config';
mapboxgl.accessToken = config.mapbox.token;
var Map = React.createClass({
displayName: 'Map',
propTypes: {
location: React.PropTypes.object,
_invalidateAllLocationData: React.PropTypes.func,
_fetchLatestMeasurements: React.PropTypes.func,
parameters: React.PropTypes.array,
sources: React.PropTypes.array,
latestMeasurements: React.PropTypes.shape({
fetching: React.PropTypes.bool,
fetched: React.PropTypes.bool,
error: React.PropTypes.string,
data: React.PropTypes.object
})
},
// The map element.
map: null,
onFilterSelect: function (parameter, e) {
e.preventDefault();
hashHistory.push(`map?parameter=${parameter}`);
},
getActiveParameterData: function () {
let parameter = this.props.location.query.parameter;
let parameterData = _.find(this.props.parameters, {id: parameter});
return parameterData || _.find(this.props.parameters, {id: 'pm25'});
},
componentDidMount: function () {
this.props._invalidateAllLocationData();
this.props._fetchLatestMeasurements({has_geo: 'true'});
},
renderMapLegend: function () {
let activeParam = this.getActiveParameterData();
let drop = (
<Dropdown
triggerElement='button'
triggerClassName='button button--primary-unbounded drop__toggle--caret'
triggerTitle='Show/hide parameter options'
triggerText={activeParam.name} >
<ul role='menu' className='drop__menu drop__menu--select'>
{this.props.parameters.map(o => (
<li key={o.id}>
<a className={c('drop__menu-item', {'drop__menu-item--active': activeParam.id === o.id})} href='#' title={`Show values for ${o.name}`} data-hook='dropdown:close' onClick={this.onFilterSelect.bind(null, o.id)}><span>{o.name}</span></a>
</li>
))}
</ul>
</Dropdown>
);
const scaleStops = generateLegendStops(activeParam.id);
const colorWidth = 100 / scaleStops.length;
return (
<div>
<p>Showing the most recent values for {drop}</p>
<ul className='color-scale'>
{scaleStops.map(o => (
<li key={o.label} style={{'backgroundColor': o.color, width: `${colorWidth}%`}} className='color-scale__item'><span className='color-scale__value'>{o.label}</span></li>
))}
</ul>
<small className='disclaimer'><a href='https://medium.com/@openaq/where-does-openaq-data-come-from-a5cf9f3a5c85'>Data Disclaimer and More Information</a></small>
</div>
);
},
render: function () {
let {fetched, fetching, error, data} = this.props.latestMeasurements;
if (!fetched && !fetching) {
return null;
}
if (fetching) {
return (
<HeaderMessage>
<h1>Take a deep breath</h1>
<div className='prose prose--responsive'>
<p>Map data is loading...</p>
</div>
</HeaderMessage>
);
}
if (error) {
return (
<HeaderMessage>
<h1>Uhoh, something went wrong</h1>
<div className='prose prose--responsive'>
<p>There was a problem getting the data. If the problem continues, please let us know.</p>
<p><a href='mailto:[email protected]' title='Send us an email'>Send us an Email</a></p>
</div>
</HeaderMessage>
);
}
let activeParam = this.getActiveParameterData();
return (
<section className='inpage'>
<header className='inpage__header'>
<div className='inner'>
<div className='inpage__headline'>
<h1 className='inpage__title'>Map</h1>
</div>
</div>
</header>
<div className='inpage__body'>
<MapComponent
center={[0, 0]}
zoom={1}
measurements={data.results}
sources={this.props.sources}
parameter={activeParam} >
{this.renderMapLegend()}
</MapComponent>
</div>
</section>
);
}
});
// /////////////////////////////////////////////////////////////////// //
// Connect functions
function selector (state) {
return {
sources: state.baseData.data.sources,
parameters: state.baseData.data.parameters,
latestMeasurements: state.latestMeasurements
};
}
function dispatcher (dispatch) {
return {
_fetchLatestMeasurements: (...args) => dispatch(fetchLatestMeasurements(...args)),
_invalidateAllLocationData: (...args) => dispatch(invalidateAllLocationData(...args))
};
}
module.exports = connect(selector, dispatcher)(Map);
|
benim/src/index.js | SentiyWhen/Ben-IM | import React from 'react'
import ReactDom from 'react-dom'
import { createStore, applyMiddleware, compose } from 'redux'
import thunk from 'redux-thunk'
import { Provider } from 'react-redux'
import { BrowserRouter } from 'react-router-dom'
import App from './app'
import reducers from './reducer'
import './config'
import './index.css'
const store = createStore(reducers, compose(
applyMiddleware(thunk),
window.devToolsExtension?window.devToolsExtension():f=>f
))
// boss genius me msg 4个页面
ReactDom.render(
(<Provider store={store}>
<BrowserRouter>
<App></App>
</BrowserRouter>
</Provider>),
document.getElementById('root')
)
|
src/parser/shared/modules/items/bfa/dungeons/HarlansLoadedDice.js | sMteX/WoWAnalyzer | import React from 'react';
import SPELLS from 'common/SPELLS';
import ITEMS from 'common/ITEMS';
import { formatPercentage, formatNumber } from 'common/format';
import { calculateSecondaryStatDefault } from 'common/stats';
import ItemStatistic from 'interface/statistics/ItemStatistic';
import BoringItemValueText from 'interface/statistics/components/BoringItemValueText';
import UptimeIcon from 'interface/icons/Uptime';
import HasteIcon from 'interface/icons/Haste';
import MasteryIcon from 'interface/icons/Mastery';
import CriticalStrikeIcon from 'interface/icons/CriticalStrike';
import Analyzer from 'parser/core/Analyzer';
/**
* Harlan's Loaded Dice
* Your attacks and abilities have a chance to roll the loaded dice, gaining a random combination of Mastery, Haste, and Critical Strike for 15 sec.
*
* Example: /report/ABH7D8W1Qaqv96mt/2-Mythic+Taloc+-+Kill+(4:12)/Feloozie/statistics
*/
class HarlansLoadedDice extends Analyzer {
_item = null;
smallBuffValue = 0;
bigBuffValue = 0;
smallBuffs = [
SPELLS.LOADED_DIE_CRITICAL_STRIKE_SMALL.id,
SPELLS.LOADED_DIE_HASTE_SMALL.id,
SPELLS.LOADED_DIE_MASTERY_SMALL.id,
];
bigBuffs = [
SPELLS.LOADED_DIE_MASTERY_BIG.id,
SPELLS.LOADED_DIE_CRITICAL_STRIKE_BIG.id,
SPELLS.LOADED_DIE_HASTE_BIG.id,
];
constructor(...args) {
super(...args);
this._item = this.selectedCombatant.getTrinket(ITEMS.HARLANS_LOADED_DICE.id);
this.active = !!this._item;
if (this.active) {
this.smallBuffValue = calculateSecondaryStatDefault(355, 169, this.selectedCombatant.getItem(ITEMS.HARLANS_LOADED_DICE.id).itemLevel);
this.bigBuffValue = calculateSecondaryStatDefault(355, 284, this.selectedCombatant.getItem(ITEMS.HARLANS_LOADED_DICE.id).itemLevel);
}
}
get bigBuffUptime() {
return this.bigBuffs.reduce((a, b) => a + this.selectedCombatant.getBuffUptime(b), 0) / 3 / this.owner.fightDuration;
}
get smallBuffUptime() {
return this.smallBuffs.reduce((a, b) => a + this.selectedCombatant.getBuffUptime(b), 0) / 3 / this.owner.fightDuration;
}
get totalBuffUptime() {
return (this.bigBuffUptime + this.smallBuffUptime);
}
getAverageCrit() {
return (this.selectedCombatant.getBuffUptime(SPELLS.LOADED_DIE_CRITICAL_STRIKE_BIG.id) * this.bigBuffValue + this.selectedCombatant.getBuffUptime(SPELLS.LOADED_DIE_CRITICAL_STRIKE_SMALL.id) * this.smallBuffValue) / this.owner.fightDuration;
}
getAverageHaste() {
return (this.selectedCombatant.getBuffUptime(SPELLS.LOADED_DIE_HASTE_BIG.id) * this.bigBuffValue + this.selectedCombatant.getBuffUptime(SPELLS.LOADED_DIE_HASTE_SMALL.id) * this.smallBuffValue) / this.owner.fightDuration;
}
getAverageMastery() {
return (this.selectedCombatant.getBuffUptime(SPELLS.LOADED_DIE_MASTERY_BIG.id) * this.bigBuffValue + this.selectedCombatant.getBuffUptime(SPELLS.LOADED_DIE_MASTERY_SMALL.id) * this.smallBuffValue) / this.owner.fightDuration;
}
buffTriggerCount() { //Either the big buff or the small buff will be applied on a proc, so just counting the mastery gets total amount of procs.
return this.selectedCombatant.getBuffTriggerCount(SPELLS.LOADED_DIE_MASTERY_SMALL.id) + this.selectedCombatant.getBuffTriggerCount(SPELLS.LOADED_DIE_MASTERY_BIG.id);
}
statistic() {
return (
<ItemStatistic
size="flexible"
>
<BoringItemValueText item={ITEMS.HARLANS_LOADED_DICE}>
<UptimeIcon /> {formatPercentage(this.totalBuffUptime, 0)}% <small>uptime</small> <br />
<HasteIcon /> {formatNumber(this.getAverageHaste())} <small>average Haste gained</small> <br />
<CriticalStrikeIcon /> {formatNumber(this.getAverageCrit())} <small>average Crit gained</small> <br />
<MasteryIcon /> {formatNumber(this.getAverageMastery())} <small>average Mastery gained</small>
</BoringItemValueText>
</ItemStatistic>
);
}
}
export default HarlansLoadedDice;
|
react-ui/src/components/HeaderMenu.js | simmco/trading-book-store | import React from 'react'
import { connect } from 'react-redux'
import * as actions from '../actions'
import styled from 'styled-components'
import { Link, withRouter } from 'react-router-dom'
class HeaderMenu extends React.Component {
render() {
return (
<div>
{this.props.authenticated ? (
<Navbar>
<Li><StyledLink to="/allbooks">All Books</StyledLink></Li>
<Li><StyledLink to="/mybooks">My Books</StyledLink></Li>
<Li><StyledLink to="/myprofile">My Profile</StyledLink></Li>
<Li><StyledLink to="/signout" onClick={() => {this.props.signoutUser()}}>Sign out</StyledLink></Li>
</Navbar>
) : (
<Navbar>
<Li><StyledLink to="/allbooks">All Books</StyledLink></Li>
<Li><StyledLink to="/signup">Sign up</StyledLink></Li>
<Li><StyledLink to="/signin">Sign in</StyledLink></Li>
</Navbar>
)}
</div>
)
}
}
function mapStateToProps(state) {
return { authenticated: state.auth.authenticated };
}
export default connect (mapStateToProps, actions)(HeaderMenu)
const Navbar = styled.ul`
list-style-type: none;
text-align: right;
@media (max-width: 800px) {
display: none;
}
`
const Li = styled.li`
display: inline-block;
padding-right: 2rem;
`
const StyledLink = styled(Link)`
color: palevioletred;
margin: 0.5em 0;
text-decoration: none;
&:hover {
text-decoration: underline;
}
`;
const AuthButton = withRouter(({ history }) => (
<p>
<StyledLink to="/signout" onClick={() => {
this.props.signoutUser()(() => history.push('/'))
}}>
Sign out
</StyledLink>
</p>
)
) |
src/svg-icons/action/search.js | ichiohta/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionSearch = (props) => (
<SvgIcon {...props}>
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
</SvgIcon>
);
ActionSearch = pure(ActionSearch);
ActionSearch.displayName = 'ActionSearch';
ActionSearch.muiName = 'SvgIcon';
export default ActionSearch;
|
node_modules/babel-helpers/node_modules/babel-traverse/lib/path/lib/virtual-types.js | rajendrav5/webpack2.0 | "use strict";
exports.__esModule = true;
exports.Flow = exports.Pure = exports.Generated = exports.User = exports.Var = exports.BlockScoped = exports.Referenced = exports.Scope = exports.Expression = exports.Statement = exports.BindingIdentifier = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = undefined;
var _babelTypes = require("babel-types");
var t = _interopRequireWildcard(_babelTypes);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var ReferencedIdentifier = exports.ReferencedIdentifier = {
types: ["Identifier", "JSXIdentifier"],
checkPath: function checkPath(_ref, opts) {
var node = _ref.node,
parent = _ref.parent;
if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) {
if (t.isJSXIdentifier(node, opts)) {
if (_babelTypes.react.isCompatTag(node.name)) return false;
} else {
return false;
}
}
return t.isReferenced(node, parent);
}
};
var ReferencedMemberExpression = exports.ReferencedMemberExpression = {
types: ["MemberExpression"],
checkPath: function checkPath(_ref2) {
var node = _ref2.node,
parent = _ref2.parent;
return t.isMemberExpression(node) && t.isReferenced(node, parent);
}
};
var BindingIdentifier = exports.BindingIdentifier = {
types: ["Identifier"],
checkPath: function checkPath(_ref3) {
var node = _ref3.node,
parent = _ref3.parent;
return t.isIdentifier(node) && t.isBinding(node, parent);
}
};
var Statement = exports.Statement = {
types: ["Statement"],
checkPath: function checkPath(_ref4) {
var node = _ref4.node,
parent = _ref4.parent;
if (t.isStatement(node)) {
if (t.isVariableDeclaration(node)) {
if (t.isForXStatement(parent, { left: node })) return false;
if (t.isForStatement(parent, { init: node })) return false;
}
return true;
} else {
return false;
}
}
};
var Expression = exports.Expression = {
types: ["Expression"],
checkPath: function checkPath(path) {
if (path.isIdentifier()) {
return path.isReferencedIdentifier();
} else {
return t.isExpression(path.node);
}
}
};
var Scope = exports.Scope = {
types: ["Scopable"],
checkPath: function checkPath(path) {
return t.isScope(path.node, path.parent);
}
};
var Referenced = exports.Referenced = {
checkPath: function checkPath(path) {
return t.isReferenced(path.node, path.parent);
}
};
var BlockScoped = exports.BlockScoped = {
checkPath: function checkPath(path) {
return t.isBlockScoped(path.node);
}
};
var Var = exports.Var = {
types: ["VariableDeclaration"],
checkPath: function checkPath(path) {
return t.isVar(path.node);
}
};
var User = exports.User = {
checkPath: function checkPath(path) {
return path.node && !!path.node.loc;
}
};
var Generated = exports.Generated = {
checkPath: function checkPath(path) {
return !path.isUser();
}
};
var Pure = exports.Pure = {
checkPath: function checkPath(path, opts) {
return path.scope.isPure(path.node, opts);
}
};
var Flow = exports.Flow = {
types: ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"],
checkPath: function checkPath(_ref5) {
var node = _ref5.node;
if (t.isFlow(node)) {
return true;
} else if (t.isImportDeclaration(node)) {
return node.importKind === "type" || node.importKind === "typeof";
} else if (t.isExportDeclaration(node)) {
return node.exportKind === "type";
} else if (t.isImportSpecifier(node)) {
return node.importKind === "type" || node.importKind === "typeof";
} else {
return false;
}
}
}; |
app/pages/setPasswordPage.js | shiyunjie/scs | /**
* Created by shiyunjie on 16/12/27.
*/
/**
* Created by shiyunjie on 16/12/6.
*/
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TextInput,
ActivityIndicator,
ActivityIndicatorIOS,
ProgressBarAndroid,
NativeAppEventEmitter,
TouchableOpacity,
Platform,
BackAndroid,
AsyncStorage,
Alert,
} from 'react-native';
import {getDeviceID,getToken} from '../lib/User'
import {hex_md5} from '../lib/md5'
import Button from 'react-native-smart-button';
import constants from '../constants/constant';
import Icon from 'react-native-vector-icons/Ionicons';
import XhrEnhance from '../lib/XhrEnhance' //http
import Toast from 'react-native-smart-toast'
import AppEventListenerEnhance from 'react-native-smart-app-event-listener-enhance'
import LoadingSpinnerOverlay from 'react-native-smart-loading-spinner-overlay'
import navigatorStyle from '../styles/navigatorStyle' //navigationBar样式
import ValidateTextInput from '../components/validateTextInput'
class SetPassword extends Component {
// 构造
constructor(props) {
super(props);
// 初始状态
this.state = {
phone: this.props.phone,
password: '',
confPwd: '',
};
this._newPassword = /^[a-zA-Z0-9]{6,}$/
this._conformPassword = /^[a-zA-Z0-9]{6,}$/
}
componentWillMount() {
NativeAppEventEmitter.emit('setNavigationBar.index', navigationBarRouteMapper)
let currentRoute = this.props.navigator.navigationContext.currentRoute
this.addAppEventListener(
this.props.navigator.navigationContext.addListener('willfocus', (event) => {
//console.log(`orderPage willfocus...`)
//console.log(`currentRoute`, currentRoute)
//console.log(`event.data.route`, event.data.route)
if (event && currentRoute === event.data.route) {
//console.log("orderPage willAppear")
NativeAppEventEmitter.emit('setNavigationBar.index', navigationBarRouteMapper)
} else {
//console.log("orderPage willDisappear, other willAppear")
}
//
})
)
this.addAppEventListener(
BackAndroid.addEventListener('hardwareBackPress', this.onBackAndroid)
)
}
onBackAndroid = () => {
const routers = this.props.navigator.getCurrentRoutes();
if (routers.length > 1) {
Alert.alert('温馨提醒', '确定退出吗?', [
{text: '确定', onPress: ()=>this.props.navigator.popToRoute(routers[1])},
{text: '取消', onPress: ()=> {}},
])
return true;
}
}
render() {
return (
<View style={styles.container}>
<ValidateTextInput
ref={ component => this._input_new_password = component }
style={styles.textInput}
clearButtonMode="while-editing"
placeholder='请输入密码'
maxLength={20}
underlineColorAndroid='transparent'
editable={true}
secureTextEntry={true}
value={this.state.password}
onChangeText={(text) => this.setState({password:text})}
reg={this._newPassword}/>
<ValidateTextInput
ref={ component => this._input_conform_password = component }
style={styles.textInput}
clearButtonMode="while-editing"
placeholder='确认密码'
maxLength={20}
underlineColorAndroid='transparent'
editable={true}
secureTextEntry={true}
value={this.state.confPwd}
onChangeText={(text) => this.setState({confPwd:text})}
reg={this._conformPassword}/>
<Button
ref={ component => this._button_2 = component }
touchableType={Button.constants.touchableTypes.fadeContent}
style={[styles.button,{ marginLeft: constants.MarginLeftRight,
marginRight: constants.MarginLeftRight,
marginTop: 20,}]}
textStyle={{fontSize: 17, color: 'white'}}
loadingComponent={
<View style={{flexDirection: 'row', alignItems: 'center'}}>
{
//this._renderActivityIndicator()
}
<Text style={{fontSize: 17, color: 'white', fontWeight: 'bold', fontFamily: '.HelveticaNeueInterface-MediumP4',}}>
保存中...</Text>
</View>
}
onPress={ () => {
if(!this._input_new_password.validate){
this._input_new_password.setState({
backgroundColor:constants.UIInputErrorColor,
})
this._toast.show({
position: Toast.constants.gravity.center,
duration: 255,
children: '密码格式错误'
})
return
}
if(!this._input_conform_password.validate||this.state.password!=this.state.confPwd){
this._input_conform_password.setState({
backgroundColor:constants.UIInputErrorColor,
iconColor: 'red',
iconName: 'ios-close-circle',
showIcon: true,
})
this._toast.show({
position: Toast.constants.gravity.center,
duration: 255,
children: '两次密码不一致'
})
return
}
if(this._modalLoadingSpinnerOverLay){
this._modalLoadingSpinnerOverLay.show()
}
this._input_new_password.editable=false
this._input_conform_password=false
this._button_2.setState({
loading: true,
//disabled: true,
})
this._fetch_setPassword()
} }>
保存
</Button>
<Toast
ref={ component => this._toast = component }
marginTop={64}>
</Toast>
<LoadingSpinnerOverlay
ref={ component => this._modalLoadingSpinnerOverLay = component }/>
</View>
);
}
async _fetch_setPassword() {
try {
let token = await getToken()
let deviceID = await getDeviceID()
let options = {
method: 'post',
url: constants.api.service,
data: {
iType: constants.iType.SavePwd,
phone: this.state.phone,
pwd: hex_md5(this.state.password),
surePwd: hex_md5(this.state.confPwd),
deviceId: deviceID,
token: token,
}
}
options.data = await this.gZip(options)
//console.log(`_fetch_sendCode options:`, options)
let resultData = await this.fetch(options)
let result = await this.gunZip(resultData)
if (!result) {
this._toast.show({
position: Toast.constants.gravity.center,
duration: 255,
children: '服务器打盹了,稍后再试试吧'
})
return
}
result = JSON.parse(result)
//console.log('gunZip:', result)
if(!result){
this._toast.show({
position: Toast.constants.gravity.center,
duration: 255,
children: '服务器打盹了,稍后再试试吧'
})
return
}
if (result.code && result.code == 10) {
Alert.alert('提示', '修改成功', [
{text:'确定', onPress:() => {
if(this._modalLoadingSpinnerOverLay) {
this._modalLoadingSpinnerOverLay.hide({duration: 0,})
}
let routers = this.props.navigator.getCurrentRoutes();
this.props.navigator.popToRoute(routers[1])
}}])
/*this._toast.show({
position: Toast.constants.gravity.center,
duration: 255,
children: '保存成功'
})*/
/*setTimeout(()=>{
let routers = this.props.navigator.getCurrentRoutes();
this.props.navigator.popToRoute(routers[1])
},1000)*/
} else {
if(this._modalLoadingSpinnerOverLay) {
this._modalLoadingSpinnerOverLay.hide({duration: 0,})
}
this._toast.show({
position: Toast.constants.gravity.center,
duration: 255,
children: result.msg
})
}
}
catch (error) {
if(this._modalLoadingSpinnerOverLay) {
this._modalLoadingSpinnerOverLay.hide({duration: 0,})
}
//console.log(error)
if(this._toast) {
this._toast.show({
position: Toast.constants.gravity.center,
duration: 255,
children: error
})
}
}
finally {
this._button_2.setState({
loading: false,
//disabled: false
})
this._input_new_password.editable=true
this._input_conform_password=true
/* if(this._modalLoadingSpinnerOverLay) {
this._modalLoadingSpinnerOverLay.hide({duration: 0,})
}*/
}
}
_renderActivityIndicator() {
return ActivityIndicator ? (
<ActivityIndicator
style={{margin: 10,}}
animating={true}
color={'#fff'}
size={'small'}/>
) : Platform.OS == 'android' ?
(
<ProgressBarAndroid
style={{margin: 10,}}
color={'#fff'}
styleAttr={'Small'}/>
) : (
<ActivityIndicatorIOS
style={{margin: 10,}}
animating={true}
color={'#fff'}
size={'small'}/>
)
}
}
import {navigationBar} from '../components/NavigationBarRouteMapper'
const navigationBarRouteMapper = {
...navigationBar,
LeftButton: function (route, navigator, index, navState) {
if (index === 0) {
return null;
}
var previousRoute = navState.routeStack[index - 1];
const routers = navigator.getCurrentRoutes();
return (
<TouchableOpacity
onPress={() => Alert.alert('温馨提醒','确定退出吗?',[
{text:'取消',onPress:()=>{}},
{text:'确定',onPress:()=>navigator.popToRoute(routers[1])}
])}
style={navigatorStyle.navBarLeftButton}>
<View style={navigatorStyle.navBarLeftButtonAndroid}>
<Icon
style={[navigatorStyle.navBarText, navigatorStyle.navBarTitleText,{fontSize: 30,}]}
name={'ios-arrow-back'}
size={constants.IconSize}
color={'white'}/>
</View>
</TouchableOpacity>
);
},
};
//const navigationBarRouteMapper = {
//
// LeftButton: function (route, navigator, index, navState) {
// if (index === 0) {
// return null;
// }
//
// var previousRoute = navState.routeStack[index - 1];
// return (
// <TouchableOpacity
// onPress={() => Alert.alert('温馨提醒','确定退出吗?',[
// {text:'取消',onPress:()=>{}},
// {text:'确定',onPress:()=>this.props.navigator.popToRoute(routes[1])}
// ])}
// style={navigatorStyle.navBarLeftButton}>
// <View style={navigatorStyle.navBarLeftButtonAndroid}>
// <Icon
// style={[navigatorStyle.navBarText, navigatorStyle.navBarTitleText,{fontSize: 20,}]}
// name={'ios-arrow-back'}
// size={constants.IconSize}
// color={'white'}/>
// </View>
// </TouchableOpacity>
//
// );
// },
//
// RightButton: function (route, navigator, index, navState) {
//
// },
//
// Title: function (route, navigator, index, navState) {
// return (
// Platform.OS == 'ios' ?
// <Text style={[navigatorStyle.navBarText, navigatorStyle.navBarTitleText]}>
// {route.title}
// </Text> : <View style={navigatorStyle.navBarTitleAndroid}>
// <Text style={[navigatorStyle.navBarText, navigatorStyle.navBarTitleText]}>
// {route.title}
// </Text>
// </View>
// )
// },
//
//}
export default AppEventListenerEnhance(XhrEnhance(SetPassword))
const styles = StyleSheet.create({
container: {
paddingTop: Platform.OS == 'ios' ? 64 + 10 : 56 + 10,
flex: 1,
flexDirection: 'column',
alignItems: 'stretch',
backgroundColor: constants.UIBackgroundColor,
},
textInput: {
backgroundColor: 'white',
height: 40,
borderWidth: StyleSheet.hairlineWidth,
borderColor: constants.UIBackgroundColor,
paddingLeft: 10,
paddingRight: 10,
},
button: {
height: 40,
backgroundColor: constants.UIActiveColor,
borderWidth: StyleSheet.hairlineWidth,
borderColor: constants.UIActiveColor,
justifyContent: 'center',
borderRadius: 30,
},
}); |
src/Tabs/Tabs.js | tleunen/react-mdl | import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Tab from './Tab';
import TabBar from './TabBar';
import mdlUpgrade from '../utils/mdlUpgrade';
const TabPropType = (props, propName, componentName) => {
const prop = props[propName];
return prop.type !== Tab && new Error(`'${componentName}' only accepts 'Tab' as children.`);
};
const propTypes = {
activeTab: PropTypes.number,
children: PropTypes.oneOfType([
TabPropType,
PropTypes.arrayOf(TabPropType)
]),
className: PropTypes.string,
onChange: PropTypes.func,
tabBarProps: PropTypes.object,
ripple: PropTypes.bool,
};
const Tabs = props => {
const { activeTab, className, onChange,
children, tabBarProps, ripple, ...otherProps } = props;
const classes = classNames('mdl-tabs mdl-js-tabs', {
'mdl-js-ripple-effect': ripple
}, className);
return (
<div className={classes} {...otherProps}>
<TabBar cssPrefix="mdl-tabs" activeTab={activeTab} onChange={onChange} {...tabBarProps} >
{children}
</TabBar>
</div>
);
};
Tabs.propTypes = propTypes;
export default mdlUpgrade(Tabs, true);
|
src/svg-icons/communication/contact-mail.js | ngbrown/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let CommunicationContactMail = (props) => (
<SvgIcon {...props}>
<path d="M21 8V7l-3 2-3-2v1l3 2 3-2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2zM8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1zm8-6h-8V6h8v6z"/>
</SvgIcon>
);
CommunicationContactMail = pure(CommunicationContactMail);
CommunicationContactMail.displayName = 'CommunicationContactMail';
CommunicationContactMail.muiName = 'SvgIcon';
export default CommunicationContactMail;
|
node_modules/react-router/es6/Route.js | gurusewak/redux101 | import React from 'react';
import invariant from 'invariant';
import { createRouteFromReactElement } from './RouteUtils';
import { component, components } from './InternalPropTypes';
var _React$PropTypes = React.PropTypes;
var string = _React$PropTypes.string;
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 = React.createClass({
displayName: 'Route',
statics: {
createRouteFromReactElement: createRouteFromReactElement
},
propTypes: {
path: string,
component: component,
components: components,
getComponent: func,
getComponents: func
},
/* istanbul ignore next: sanity check */
render: function render() {
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, '<Route> elements are for router configuration only and should not be rendered') : invariant(false) : void 0;
}
});
export default Route; |
ajax/libs/yui/3.17.2/event-focus/event-focus-min.js | warpech/cdnjs | /*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("event-focus",function(e,t){function u(t,r,u){var a="_"+t+"Notifiers";e.Event.define(t,{_useActivate:o,_attach:function(i,s,o){return e.DOM.isWindow(i)?n._attach([t,function(e){s.fire(e)},i]):n._attach([r,this._proxy,i,this,s,o],{capture:!0})},_proxy:function(t,r,i){var s=t.target,f=t.currentTarget,l=s.getData(a),c=e.stamp(f._node),h=o||s!==f,p;r.currentTarget=i?s:f,r.container=i?f:null,l?h=!0:(l={},s.setData(a,l),h&&(p=n._attach([u,this._notify,s._node]).sub,p.once=!0)),l[c]||(l[c]=[]),l[c].push(r),h||this._notify(t)},_notify:function(t,n){var r=t.currentTarget,i=r.getData(a),o=r.ancestors(),u=r.get("ownerDocument"),f=[],l=i?e.Object.keys(i).length:0,c,h,p,d,v,m,g,y,b,w;r.clearData(a),o.push(r),u&&o.unshift(u),o._nodes.reverse(),l&&(m=l,o.some(function(t){var n=e.stamp(t),r=i[n],s,o;if(r){l--;for(s=0,o=r.length;s<o;++s)r[s].handle.sub.filter&&f.push(r[s])}return!l}),l=m);while(l&&(c=o.shift())){d=e.stamp(c),h=i[d];if(h){for(g=0,y=h.length;g<y;++g){p=h[g],b=p.handle.sub,v=!0,t.currentTarget=c,b.filter&&(v=b.filter.apply(c,[c,t].concat(b.args||[])),f.splice(s(f,p),1)),v&&(t.container=p.container,w=p.fire(t));if(w===!1||t.stopped===2)break}delete h[d],l--}if(t.stopped!==2)for(g=0,y=f.length;g<y;++g){p=f[g],b=p.handle.sub,b.filter.apply(c,[c,t].concat(b.args||[]))&&(t.container=p.container,t.currentTarget=c,w=p.fire(t));if(w===!1||t.stopped===2||t.stopped&&f[g+1]&&f[g+1].container!==p.container)break}if(t.stopped)break}},on:function(e,t,n){t.handle=this._attach(e._node,n)},detach:function(e,t){t.handle.detach()},delegate:function(t,n,r,s){i(s)&&(n.filter=function(n){return e.Selector.test(n._node,s,t===n?null:t._node)}),n.handle=this._attach(t._node,r,!0)},detachDelegate:function(e,t){t.handle.detach()}},!0)}var n=e.Event,r=e.Lang,i=r.isString,s=e.Array.indexOf,o=function(){var t=!1,n=e.config.doc,r;return n&&(r=n.createElement("p"),r.setAttribute("onbeforeactivate",";"),t=r.onbeforeactivate!==undefined),t}();o?(u("focus","beforeactivate","focusin"),u("blur","beforedeactivate","focusout")):(u("focus","focus","focus"),u("blur","blur","blur"))},"3.17.2",{requires:["event-synthetic"]});
|
src/containers/LandingPage/AboutPidc/Body.js | westoncolemanl/tabbr-web | import React from 'react'
import Typography from 'material-ui/Typography'
import withStyles from 'material-ui/styles/withStyles'
const styles = theme => ({
title: {
paddingBottom: theme.spacing.unit * 2
},
subtitle: {
paddingBottom: theme.spacing.unit * 2
},
photo: {
paddingTop: theme.spacing.unit * 2,
paddingBottom: theme.spacing.unit * 1
},
header: {
paddingTop: theme.spacing.unit * 2,
paddingBottom: theme.spacing.unit * 1
},
paragraph: {
paddingTop: theme.spacing.unit * 2,
paddingBottom: theme.spacing.unit * 1
}
})
export default withStyles(styles)(({
classes
}) =>
<div
className={'mw8 center'}
>
<Typography
variant={'display4'}
className={classes.title}
>
{'PIDC'}
</Typography>
<Typography
className={classes.subtitle}
variant={'display2'}
gutterBottom
>
{'Philippine Intercollegiate Debating Championship'}
</Typography>
<div
className={classes.photo}
>
<img
className={'shadow-1 br3'}
alt={'PIDC shot'}
src={require('./headlinePhoto.jpg')}
/>
</div>
<Typography
className={classes.header}
variant={'display1'}
gutterBottom
>
{'About PIDC'}
</Typography>
<Typography
className={classes.paragraph}
variant={'headline'}
gutterBottom
paragraph
>
{'The Philippine Intercollegiate Debating Championship (PIDC) is the largest national debate tournament in Asian Parliamentary format with over 250 participating debaters and adjudicators across Luzon, Visayas, and Mindanao. For 17 years, PIDC is hosted by the UP Debate Society, the premier debate and public speaking organization of the University of the Philippines-Diliman.'}
</Typography>
<Typography
className={classes.header}
variant={'display1'}
gutterBottom
>
{'Vision'}
</Typography>
<Typography
className={classes.paragraph}
variant={'headline'}
gutterBottom
paragraph
>
{'Guided by the tenet of honor and excellence, PIDC envisions to be a platform for the Filipino youth to participate in nation-building through debate and public speaking events.'}
</Typography>
<Typography
className={classes.header}
variant={'display1'}
gutterBottom
>
{'Mission'}
</Typography>
<Typography
className={classes.paragraph}
variant={'headline'}
gutterBottom
paragraph
>
{'Our mission is to gather socially-involved and passionate students to debate about different social, political, and cultural issues and to develop skills in global politics, economic development, nation building, education. In PIDC, we aim to produce individuals who take the lead in critical thinking and quality discourse.'}
</Typography>
</div>
)
|
ajax/libs/recompose/0.20.1/Recompose.js | kiwi89/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["Recompose"] = factory(require("react"));
else
root["Recompose"] = factory(root["React"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {
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__) {
module.exports = __webpack_require__(29);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var createHelper = function createHelper(func, helperName) {
var setDisplayName = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
var noArgs = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
if (false) {
var _ret = function () {
/* eslint-disable global-require */
var wrapDisplayName = require('./wrapDisplayName').default;
/* eslint-enable global-require */
if (noArgs) {
return {
v: function v(BaseComponent) {
var Component = func(BaseComponent);
Component.displayName = wrapDisplayName(BaseComponent, helperName);
return Component;
}
};
}
return {
v: function v() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (args.length > func.length) {
/* eslint-disable */
console.error(
/* eslint-enable */
'Too many arguments passed to ' + helperName + '(). It should called ' + ('like so: ' + helperName + '(...args)(BaseComponent).'));
}
return function (BaseComponent) {
var Component = func.apply(undefined, args)(BaseComponent);
Component.displayName = wrapDisplayName(BaseComponent, helperName);
return Component;
};
}
};
}();
if (typeof _ret === "object") return _ret.v;
}
return func;
};
exports.default = createHelper;
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createEagerElementUtil = __webpack_require__(18);
var _createEagerElementUtil2 = _interopRequireDefault(_createEagerElementUtil);
var _isReferentiallyTransparentFunctionComponent = __webpack_require__(16);
var _isReferentiallyTransparentFunctionComponent2 = _interopRequireDefault(_isReferentiallyTransparentFunctionComponent);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createFactory = function createFactory(type) {
var isReferentiallyTransparent = (0, _isReferentiallyTransparentFunctionComponent2.default)(type);
return function (p, c) {
return (0, _createEagerElementUtil2.default)(false, isReferentiallyTransparent, type, p, c);
};
};
exports.default = createFactory;
/***/ },
/* 3 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mapProps = function mapProps(propsMapper) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
return function (props) {
return factory(propsMapper(props));
};
};
};
exports.default = (0, _createHelper2.default)(mapProps, 'mapProps');
/***/ },
/* 5 */
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
var _config = {
fromESObservable: null,
toESObservable: null
};
var configureObservable = function configureObservable(c) {
_config = c;
};
var config = exports.config = {
fromESObservable: function fromESObservable(observable) {
return typeof _config.fromESObservable === 'function' ? _config.fromESObservable(observable) : observable;
},
toESObservable: function toESObservable(stream) {
return typeof _config.toESObservable === 'function' ? _config.toESObservable(stream) : stream;
}
};
exports.default = configureObservable;
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _shallowEqual = __webpack_require__(49);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _shallowEqual2.default;
/***/ },
/* 7 */
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
var getDisplayName = function getDisplayName(Component) {
if (typeof Component === 'string') {
return Component;
}
if (!Component) {
return undefined;
}
return Component.displayName || Component.name || 'Component';
};
exports.default = getDisplayName;
/***/ },
/* 8 */
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
var isClassComponent = function isClassComponent(Component) {
return Boolean(Component && Component.prototype && typeof Component.prototype.isReactComponent === 'object');
};
exports.default = isClassComponent;
/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var setStatic = function setStatic(key, value) {
return function (BaseComponent) {
/* eslint-disable no-param-reassign */
BaseComponent[key] = value;
/* eslint-enable no-param-reassign */
return BaseComponent;
};
};
exports.default = (0, _createHelper2.default)(setStatic, 'setStatic', false);
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _react = __webpack_require__(3);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 shouldUpdate = function shouldUpdate(test) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
return function (_Component) {
_inherits(_class, _Component);
function _class() {
_classCallCheck(this, _class);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
_class.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return test(this.props, nextProps);
};
_class.prototype.render = function render() {
return factory(this.props);
};
return _class;
}(_react.Component);
};
};
exports.default = (0, _createHelper2.default)(shouldUpdate, 'shouldUpdate');
/***/ },
/* 11 */
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
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 omit = function omit(obj, keys) {
var rest = _objectWithoutProperties(obj, []);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (rest.hasOwnProperty(key)) {
delete rest[key];
}
}
return rest;
};
exports.default = omit;
/***/ },
/* 12 */
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
var pick = function pick(obj, keys) {
var result = {};
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (obj.hasOwnProperty(key)) {
result[key] = obj[key];
}
}
return result;
};
exports.default = pick;
/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/* global window */
'use strict';
module.exports = __webpack_require__(51)(global || window || this);
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.componentFromStreamWithConfig = undefined;
var _react = __webpack_require__(3);
var _changeEmitter = __webpack_require__(19);
var _symbolObservable = __webpack_require__(13);
var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
var _setObservableConfig = __webpack_require__(5);
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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 componentFromStreamWithConfig = exports.componentFromStreamWithConfig = function componentFromStreamWithConfig(config) {
return function (propsToVdom) {
return function (_Component) {
_inherits(ComponentFromStream, _Component);
function ComponentFromStream() {
var _config$fromESObserva;
var _temp, _this, _ret;
_classCallCheck(this, ComponentFromStream);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = { vdom: null }, _this.propsEmitter = (0, _changeEmitter.createChangeEmitter)(), _this.props$ = config.fromESObservable((_config$fromESObserva = {
subscribe: function subscribe(observer) {
var unsubscribe = _this.propsEmitter.listen(function (props) {
return observer.next(props);
});
return { unsubscribe: unsubscribe };
}
}, _config$fromESObserva[_symbolObservable2.default] = function () {
return this;
}, _config$fromESObserva)), _this.vdom$ = config.toESObservable(propsToVdom(_this.props$)), _temp), _possibleConstructorReturn(_this, _ret);
}
// Stream of props
// Stream of vdom
ComponentFromStream.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
// Subscribe to child prop changes so we know when to re-render
this.subscription = this.vdom$.subscribe({
next: function next(vdom) {
_this2.setState({ vdom: vdom });
}
});
this.propsEmitter.emit(this.props);
};
ComponentFromStream.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
// Receive new props from the owner
this.propsEmitter.emit(nextProps);
};
ComponentFromStream.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
return nextState.vdom !== this.state.vdom;
};
ComponentFromStream.prototype.componentWillUnmount = function componentWillUnmount() {
// Clean-up subscription before un-mounting
this.subscription.unsubscribe();
};
ComponentFromStream.prototype.render = function render() {
return this.state.vdom;
};
return ComponentFromStream;
}(_react.Component);
};
};
var componentFromStream = componentFromStreamWithConfig(_setObservableConfig.config);
exports.default = componentFromStream;
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createEagerElementUtil = __webpack_require__(18);
var _createEagerElementUtil2 = _interopRequireDefault(_createEagerElementUtil);
var _isReferentiallyTransparentFunctionComponent = __webpack_require__(16);
var _isReferentiallyTransparentFunctionComponent2 = _interopRequireDefault(_isReferentiallyTransparentFunctionComponent);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createEagerElement = function createEagerElement(type, props, children) {
var isReferentiallyTransparent = (0, _isReferentiallyTransparentFunctionComponent2.default)(type);
/* eslint-disable */
var hasKey = props && props.hasOwnProperty('key');
/* eslint-enable */
return (0, _createEagerElementUtil2.default)(hasKey, isReferentiallyTransparent, type, props, children);
};
exports.default = createEagerElement;
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _isClassComponent = __webpack_require__(8);
var _isClassComponent2 = _interopRequireDefault(_isClassComponent);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var isReferentiallyTransparentFunctionComponent = function isReferentiallyTransparentFunctionComponent(Component) {
return Boolean(typeof Component === 'function' && !(0, _isClassComponent2.default)(Component) && !Component.defaultProps && !Component.contextTypes && !Component.propTypes);
};
exports.default = isReferentiallyTransparentFunctionComponent;
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _shouldUpdate = __webpack_require__(10);
var _shouldUpdate2 = _interopRequireDefault(_shouldUpdate);
var _shallowEqual = __webpack_require__(6);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _pick = __webpack_require__(12);
var _pick2 = _interopRequireDefault(_pick);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var onlyUpdateForKeys = function onlyUpdateForKeys(propKeys) {
return (0, _shouldUpdate2.default)(function (props, nextProps) {
return !(0, _shallowEqual2.default)((0, _pick2.default)(nextProps, propKeys), (0, _pick2.default)(props, propKeys));
});
};
exports.default = (0, _createHelper2.default)(onlyUpdateForKeys, 'onlyUpdateForKeys');
/***/ },
/* 18 */
/***/ 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 _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createEagerElementUtil = function createEagerElementUtil(hasKey, isReferentiallyTransparent, type, props, children) {
if (!hasKey && isReferentiallyTransparent) {
if (children) {
return type(_extends({}, props, { children: children }));
}
return type(props);
}
var Component = type;
if (children) {
return _react2.default.createElement(
Component,
props,
children
);
}
return _react2.default.createElement(Component, props);
};
exports.default = createEagerElementUtil;
/***/ },
/* 19 */
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var createChangeEmitter = exports.createChangeEmitter = function createChangeEmitter() {
var currentListeners = [];
var nextListeners = currentListeners;
function ensureCanMutateNextListeners() {
if (nextListeners === currentListeners) {
nextListeners = currentListeners.slice();
}
}
function listen(listener) {
if (typeof listener !== 'function') {
throw new Error('Expected listener to be a function.');
}
var isSubscribed = true;
ensureCanMutateNextListeners();
nextListeners.push(listener);
return function () {
if (!isSubscribed) {
return;
}
isSubscribed = false;
ensureCanMutateNextListeners();
var index = nextListeners.indexOf(listener);
nextListeners.splice(index, 1);
};
}
function emit() {
currentListeners = nextListeners;
var listeners = currentListeners;
for (var i = 0; i < listeners.length; i++) {
listeners[i].apply(listeners, arguments);
}
}
return {
listen: listen,
emit: emit
};
};
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 branch = function branch(test, left, right) {
return function (BaseComponent) {
return function (_React$Component) {
_inherits(_class2, _React$Component);
function _class2(props, context) {
_classCallCheck(this, _class2);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.LeftComponent = null;
_this.RightComponent = null;
_this.computeChildComponent(_this.props);
return _this;
}
_class2.prototype.computeChildComponent = function computeChildComponent(props) {
if (test(props)) {
this.leftFactory = this.leftFactory || (0, _createEagerFactory2.default)(left(BaseComponent));
this.factory = this.leftFactory;
} else {
this.rightFactory = this.rightFactory || (0, _createEagerFactory2.default)(right(BaseComponent));
this.factory = this.rightFactory;
}
};
_class2.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
this.computeChildComponent(nextProps);
};
_class2.prototype.render = function render() {
return this.factory(this.props);
};
return _class2;
}(_react2.default.Component);
};
};
exports.default = (0, _createHelper2.default)(branch, 'branch');
/***/ },
/* 21 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _omit = __webpack_require__(11);
var _omit2 = _interopRequireDefault(_omit);
var _createEagerElement = __webpack_require__(15);
var _createEagerElement2 = _interopRequireDefault(_createEagerElement);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var componentFromProp = function componentFromProp(propName) {
var Component = function Component(props) {
return (0, _createEagerElement2.default)(props[propName], (0, _omit2.default)(props, [propName]));
};
Component.displayName = 'componentFromProp(' + propName + ')';
return Component;
};
exports.default = componentFromProp;
/***/ },
/* 22 */
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
exports.default = compose;
function compose() {
for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
if (funcs.length === 0) {
return function (arg) {
return arg;
};
}
if (funcs.length === 1) {
return funcs[0];
}
var last = funcs[funcs.length - 1];
return function () {
var result = last.apply(undefined, arguments);
for (var i = funcs.length - 2; i >= 0; i--) {
var f = funcs[i];
result = f(result);
}
return result;
};
}
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.createEventHandlerWithConfig = undefined;
var _symbolObservable = __webpack_require__(13);
var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
var _changeEmitter = __webpack_require__(19);
var _setObservableConfig = __webpack_require__(5);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createEventHandlerWithConfig = exports.createEventHandlerWithConfig = function createEventHandlerWithConfig(config) {
return function () {
var _config$fromESObserva;
var emitter = (0, _changeEmitter.createChangeEmitter)();
var stream = config.fromESObservable((_config$fromESObserva = {
subscribe: function subscribe(observer) {
var unsubscribe = emitter.listen(function (value) {
return observer.next(value);
});
return { unsubscribe: unsubscribe };
}
}, _config$fromESObserva[_symbolObservable2.default] = function () {
return this;
}, _config$fromESObserva));
return {
handler: emitter.emit,
stream: stream
};
};
};
var createEventHandler = createEventHandlerWithConfig(_setObservableConfig.config);
exports.default = createEventHandler;
/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _react = __webpack_require__(3);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 createSink = function createSink(callback) {
return function (_Component) {
_inherits(Sink, _Component);
function Sink() {
_classCallCheck(this, Sink);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Sink.prototype.componentWillMount = function componentWillMount() {
callback(this.props);
};
Sink.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
callback(nextProps);
};
Sink.prototype.render = function render() {
return null;
};
return Sink;
}(_react.Component);
};
exports.default = createSink;
/***/ },
/* 25 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var defaultProps = function defaultProps(props) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
var DefaultProps = function DefaultProps(ownerProps) {
return factory(ownerProps);
};
DefaultProps.defaultProps = props;
return DefaultProps;
};
};
exports.default = (0, _createHelper2.default)(defaultProps, 'defaultProps');
/***/ },
/* 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 _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var flattenProp = function flattenProp(propName) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
return function (props) {
return factory(_extends({}, props, props[propName]));
};
};
};
exports.default = (0, _createHelper2.default)(flattenProp, 'flattenProp');
/***/ },
/* 27 */
/***/ 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 _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var getContext = function getContext(contextTypes) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
var GetContext = function GetContext(ownerProps, context) {
return factory(_extends({}, ownerProps, context));
};
GetContext.contextTypes = contextTypes;
return GetContext;
};
};
exports.default = (0, _createHelper2.default)(getContext, 'getContext');
/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _hoistNonReactStatics = __webpack_require__(50);
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var hoistStatics = function hoistStatics(higherOrderComponent) {
return function (BaseComponent) {
var NewComponent = higherOrderComponent(BaseComponent);
(0, _hoistNonReactStatics2.default)(NewComponent, BaseComponent);
return NewComponent;
};
};
exports.default = hoistStatics;
/***/ },
/* 29 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.setObservableConfig = exports.createEventHandler = exports.mapPropsStream = exports.componentFromStream = exports.hoistStatics = exports.nest = exports.componentFromProp = exports.createSink = exports.createEagerFactory = exports.createEagerElement = exports.isClassComponent = exports.shallowEqual = exports.wrapDisplayName = exports.getDisplayName = exports.compose = exports.setDisplayName = exports.setPropTypes = exports.setStatic = exports.toClass = exports.lifecycle = exports.getContext = exports.withContext = exports.onlyUpdateForPropTypes = exports.onlyUpdateForKeys = exports.pure = exports.shouldUpdate = exports.renderNothing = exports.renderComponent = exports.branch = exports.withReducer = exports.withState = exports.flattenProp = exports.renameProps = exports.renameProp = exports.defaultProps = exports.withHandlers = exports.withPropsOnChange = exports.withProps = exports.mapProps = undefined;
var _mapProps2 = __webpack_require__(4);
var _mapProps3 = _interopRequireDefault(_mapProps2);
var _withProps2 = __webpack_require__(44);
var _withProps3 = _interopRequireDefault(_withProps2);
var _withPropsOnChange2 = __webpack_require__(45);
var _withPropsOnChange3 = _interopRequireDefault(_withPropsOnChange2);
var _withHandlers2 = __webpack_require__(43);
var _withHandlers3 = _interopRequireDefault(_withHandlers2);
var _defaultProps2 = __webpack_require__(25);
var _defaultProps3 = _interopRequireDefault(_defaultProps2);
var _renameProp2 = __webpack_require__(35);
var _renameProp3 = _interopRequireDefault(_renameProp2);
var _renameProps2 = __webpack_require__(36);
var _renameProps3 = _interopRequireDefault(_renameProps2);
var _flattenProp2 = __webpack_require__(26);
var _flattenProp3 = _interopRequireDefault(_flattenProp2);
var _withState2 = __webpack_require__(47);
var _withState3 = _interopRequireDefault(_withState2);
var _withReducer2 = __webpack_require__(46);
var _withReducer3 = _interopRequireDefault(_withReducer2);
var _branch2 = __webpack_require__(20);
var _branch3 = _interopRequireDefault(_branch2);
var _renderComponent2 = __webpack_require__(37);
var _renderComponent3 = _interopRequireDefault(_renderComponent2);
var _renderNothing2 = __webpack_require__(38);
var _renderNothing3 = _interopRequireDefault(_renderNothing2);
var _shouldUpdate2 = __webpack_require__(10);
var _shouldUpdate3 = _interopRequireDefault(_shouldUpdate2);
var _pure2 = __webpack_require__(34);
var _pure3 = _interopRequireDefault(_pure2);
var _onlyUpdateForKeys2 = __webpack_require__(17);
var _onlyUpdateForKeys3 = _interopRequireDefault(_onlyUpdateForKeys2);
var _onlyUpdateForPropTypes2 = __webpack_require__(33);
var _onlyUpdateForPropTypes3 = _interopRequireDefault(_onlyUpdateForPropTypes2);
var _withContext2 = __webpack_require__(42);
var _withContext3 = _interopRequireDefault(_withContext2);
var _getContext2 = __webpack_require__(27);
var _getContext3 = _interopRequireDefault(_getContext2);
var _lifecycle2 = __webpack_require__(30);
var _lifecycle3 = _interopRequireDefault(_lifecycle2);
var _toClass2 = __webpack_require__(41);
var _toClass3 = _interopRequireDefault(_toClass2);
var _setStatic2 = __webpack_require__(9);
var _setStatic3 = _interopRequireDefault(_setStatic2);
var _setPropTypes2 = __webpack_require__(40);
var _setPropTypes3 = _interopRequireDefault(_setPropTypes2);
var _setDisplayName2 = __webpack_require__(39);
var _setDisplayName3 = _interopRequireDefault(_setDisplayName2);
var _compose2 = __webpack_require__(22);
var _compose3 = _interopRequireDefault(_compose2);
var _getDisplayName2 = __webpack_require__(7);
var _getDisplayName3 = _interopRequireDefault(_getDisplayName2);
var _wrapDisplayName2 = __webpack_require__(48);
var _wrapDisplayName3 = _interopRequireDefault(_wrapDisplayName2);
var _shallowEqual2 = __webpack_require__(6);
var _shallowEqual3 = _interopRequireDefault(_shallowEqual2);
var _isClassComponent2 = __webpack_require__(8);
var _isClassComponent3 = _interopRequireDefault(_isClassComponent2);
var _createEagerElement2 = __webpack_require__(15);
var _createEagerElement3 = _interopRequireDefault(_createEagerElement2);
var _createEagerFactory2 = __webpack_require__(2);
var _createEagerFactory3 = _interopRequireDefault(_createEagerFactory2);
var _createSink2 = __webpack_require__(24);
var _createSink3 = _interopRequireDefault(_createSink2);
var _componentFromProp2 = __webpack_require__(21);
var _componentFromProp3 = _interopRequireDefault(_componentFromProp2);
var _nest2 = __webpack_require__(32);
var _nest3 = _interopRequireDefault(_nest2);
var _hoistStatics2 = __webpack_require__(28);
var _hoistStatics3 = _interopRequireDefault(_hoistStatics2);
var _componentFromStream2 = __webpack_require__(14);
var _componentFromStream3 = _interopRequireDefault(_componentFromStream2);
var _mapPropsStream2 = __webpack_require__(31);
var _mapPropsStream3 = _interopRequireDefault(_mapPropsStream2);
var _createEventHandler2 = __webpack_require__(23);
var _createEventHandler3 = _interopRequireDefault(_createEventHandler2);
var _setObservableConfig2 = __webpack_require__(5);
var _setObservableConfig3 = _interopRequireDefault(_setObservableConfig2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.mapProps = _mapProps3.default; // Higher-order component helpers
exports.withProps = _withProps3.default;
exports.withPropsOnChange = _withPropsOnChange3.default;
exports.withHandlers = _withHandlers3.default;
exports.defaultProps = _defaultProps3.default;
exports.renameProp = _renameProp3.default;
exports.renameProps = _renameProps3.default;
exports.flattenProp = _flattenProp3.default;
exports.withState = _withState3.default;
exports.withReducer = _withReducer3.default;
exports.branch = _branch3.default;
exports.renderComponent = _renderComponent3.default;
exports.renderNothing = _renderNothing3.default;
exports.shouldUpdate = _shouldUpdate3.default;
exports.pure = _pure3.default;
exports.onlyUpdateForKeys = _onlyUpdateForKeys3.default;
exports.onlyUpdateForPropTypes = _onlyUpdateForPropTypes3.default;
exports.withContext = _withContext3.default;
exports.getContext = _getContext3.default;
exports.lifecycle = _lifecycle3.default;
exports.toClass = _toClass3.default;
// Static property helpers
exports.setStatic = _setStatic3.default;
exports.setPropTypes = _setPropTypes3.default;
exports.setDisplayName = _setDisplayName3.default;
// Composition function
exports.compose = _compose3.default;
// Other utils
exports.getDisplayName = _getDisplayName3.default;
exports.wrapDisplayName = _wrapDisplayName3.default;
exports.shallowEqual = _shallowEqual3.default;
exports.isClassComponent = _isClassComponent3.default;
exports.createEagerElement = _createEagerElement3.default;
exports.createEagerFactory = _createEagerFactory3.default;
exports.createSink = _createSink3.default;
exports.componentFromProp = _componentFromProp3.default;
exports.nest = _nest3.default;
exports.hoistStatics = _hoistStatics3.default;
// Observable helpers
exports.componentFromStream = _componentFromStream3.default;
exports.mapPropsStream = _mapPropsStream3.default;
exports.createEventHandler = _createEventHandler3.default;
exports.setObservableConfig = _setObservableConfig3.default;
/***/ },
/* 30 */
/***/ 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 _react = __webpack_require__(3);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var lifecycle = function lifecycle(spec) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
if (false) {
console.error('lifecycle() does not support the render method; its behavior is to ' + 'pass all props and state to the base component.');
}
/* eslint-disable react/prefer-es6-class */
return (0, _react.createClass)(_extends({}, spec, {
render: function render() {
return factory(_extends({}, this.props, this.state));
}
}));
/* eslint-enable react/prefer-es6-class */
};
};
exports.default = (0, _createHelper2.default)(lifecycle, 'lifecycle');
/***/ },
/* 31 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.mapPropsStreamWithConfig = undefined;
var _symbolObservable = __webpack_require__(13);
var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _componentFromStream = __webpack_require__(14);
var _setObservableConfig = __webpack_require__(5);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var identity = function identity(t) {
return t;
};
var componentFromStream = (0, _componentFromStream.componentFromStreamWithConfig)({
fromESObservable: identity,
toESObservable: identity
});
var mapPropsStreamWithConfig = exports.mapPropsStreamWithConfig = function mapPropsStreamWithConfig(config) {
return function (transform) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
var fromESObservable = config.fromESObservable;
var toESObservable = config.toESObservable;
return componentFromStream(function (props$) {
var _ref;
return _ref = {
subscribe: function subscribe(observer) {
var subscription = toESObservable(transform(fromESObservable(props$))).subscribe({
next: function next(childProps) {
return observer.next(factory(childProps));
}
});
return {
unsubscribe: function unsubscribe() {
return subscription.unsubscribe();
}
};
}
}, _ref[_symbolObservable2.default] = function () {
return this;
}, _ref;
});
};
};
};
var mapPropsStream = mapPropsStreamWithConfig(_setObservableConfig.config);
exports.default = (0, _createHelper2.default)(mapPropsStream, 'mapPropsStream');
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
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 nest = function nest() {
for (var _len = arguments.length, Components = Array(_len), _key = 0; _key < _len; _key++) {
Components[_key] = arguments[_key];
}
var factories = Components.map(_createEagerFactory2.default);
var Nest = function Nest(_ref) {
var props = _objectWithoutProperties(_ref, []);
var children = _ref.children;
return factories.reduceRight(function (child, factory) {
return factory(props, child);
}, children);
};
if (false) {
/* eslint-disable global-require */
var getDisplayName = require('./getDisplayName').default;
/* eslint-enable global-require */
var displayNames = Components.map(getDisplayName);
Nest.displayName = 'nest(' + displayNames.join(', ') + ')';
}
return Nest;
};
exports.default = nest;
/***/ },
/* 33 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _onlyUpdateForKeys = __webpack_require__(17);
var _onlyUpdateForKeys2 = _interopRequireDefault(_onlyUpdateForKeys);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var onlyUpdateForPropTypes = function onlyUpdateForPropTypes(BaseComponent) {
var propTypes = BaseComponent.propTypes;
if (false) {
/* eslint-disable global-require */
var getDisplayName = require('./getDisplayName').default;
/* eslint-enable global-require */
if (!propTypes) {
/* eslint-disable */
console.error('A component without any `propTypes` was passed to ' + '`onlyUpdateForPropTypes()`. Check the implementation of the ' + ('component with display name "' + getDisplayName(BaseComponent) + '".'));
/* eslint-enable */
}
}
var propKeys = Object.keys(propTypes || {});
var OnlyUpdateForPropTypes = (0, _onlyUpdateForKeys2.default)(propKeys)(BaseComponent);
return OnlyUpdateForPropTypes;
};
exports.default = (0, _createHelper2.default)(onlyUpdateForPropTypes, 'onlyUpdateForPropTypes', true, true);
/***/ },
/* 34 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _shouldUpdate = __webpack_require__(10);
var _shouldUpdate2 = _interopRequireDefault(_shouldUpdate);
var _shallowEqual = __webpack_require__(6);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var pure = (0, _shouldUpdate2.default)(function (props, nextProps) {
return !(0, _shallowEqual2.default)(props, nextProps);
});
exports.default = (0, _createHelper2.default)(pure, 'pure', true, true);
/***/ },
/* 35 */
/***/ 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 _omit = __webpack_require__(11);
var _omit2 = _interopRequireDefault(_omit);
var _mapProps = __webpack_require__(4);
var _mapProps2 = _interopRequireDefault(_mapProps);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var renameProp = function renameProp(oldName, newName) {
return (0, _mapProps2.default)(function (props) {
var _extends2;
return _extends({}, (0, _omit2.default)(props, [oldName]), (_extends2 = {}, _extends2[newName] = props[oldName], _extends2));
});
};
exports.default = (0, _createHelper2.default)(renameProp, 'renameProp');
/***/ },
/* 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; };
var _omit = __webpack_require__(11);
var _omit2 = _interopRequireDefault(_omit);
var _pick = __webpack_require__(12);
var _pick2 = _interopRequireDefault(_pick);
var _mapProps = __webpack_require__(4);
var _mapProps2 = _interopRequireDefault(_mapProps);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var keys = Object.keys;
var mapKeys = function mapKeys(obj, func) {
return keys(obj).reduce(function (result, key) {
var val = obj[key];
/* eslint-disable no-param-reassign */
result[func(val, key)] = val;
/* eslint-enable no-param-reassign */
return result;
}, {});
};
var renameProps = function renameProps(nameMap) {
return (0, _mapProps2.default)(function (props) {
return _extends({}, (0, _omit2.default)(props, keys(nameMap)), mapKeys((0, _pick2.default)(props, keys(nameMap)), function (_, oldName) {
return nameMap[oldName];
}));
});
};
exports.default = (0, _createHelper2.default)(renameProps, 'renameProps');
/***/ },
/* 37 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// import React from 'react'
var renderComponent = function renderComponent(Component) {
return function (_) {
var factory = (0, _createEagerFactory2.default)(Component);
var RenderComponent = function RenderComponent(props) {
return factory(props);
};
// const RenderComponent = props => <Component {...props} />
if (false) {
/* eslint-disable global-require */
var wrapDisplayName = require('./wrapDisplayName').default;
/* eslint-enable global-require */
RenderComponent.displayName = wrapDisplayName(Component, 'renderComponent');
}
return RenderComponent;
};
};
exports.default = (0, _createHelper2.default)(renderComponent, 'renderComponent', false);
/***/ },
/* 38 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var renderNothing = function renderNothing(_) {
var Nothing = function Nothing() {
return null;
};
Nothing.displayName = 'Nothing';
return Nothing;
};
exports.default = (0, _createHelper2.default)(renderNothing, 'renderNothing', false, true);
/***/ },
/* 39 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _setStatic = __webpack_require__(9);
var _setStatic2 = _interopRequireDefault(_setStatic);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var setDisplayName = function setDisplayName(displayName) {
return (0, _setStatic2.default)('displayName', displayName);
};
exports.default = (0, _createHelper2.default)(setDisplayName, 'setDisplayName', false);
/***/ },
/* 40 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _setStatic = __webpack_require__(9);
var _setStatic2 = _interopRequireDefault(_setStatic);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var setPropTypes = function setPropTypes(propTypes) {
return (0, _setStatic2.default)('propTypes', propTypes);
};
exports.default = (0, _createHelper2.default)(setPropTypes, 'setPropTypes', false);
/***/ },
/* 41 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _getDisplayName = __webpack_require__(7);
var _getDisplayName2 = _interopRequireDefault(_getDisplayName);
var _isClassComponent = __webpack_require__(8);
var _isClassComponent2 = _interopRequireDefault(_isClassComponent);
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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 toClass = function toClass(baseComponent) {
if ((0, _isClassComponent2.default)(baseComponent)) {
return baseComponent;
}
var ToClass = function (_Component) {
_inherits(ToClass, _Component);
function ToClass() {
_classCallCheck(this, ToClass);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
ToClass.prototype.render = function render() {
if (typeof baseComponent === 'string') {
return _react2.default.createElement('baseComponent', this.props);
}
return baseComponent(this.props, this.context);
};
return ToClass;
}(_react.Component);
ToClass.displayName = (0, _getDisplayName2.default)(baseComponent);
ToClass.propTypes = baseComponent.propTypes;
ToClass.contextTypes = baseComponent.contextTypes;
ToClass.defaultProps = baseComponent.defaultProps;
return ToClass;
};
exports.default = toClass;
/***/ },
/* 42 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _react = __webpack_require__(3);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 withContext = function withContext(childContextTypes, getChildContext) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
var WithContext = function (_Component) {
_inherits(WithContext, _Component);
function WithContext() {
var _temp, _this, _ret;
_classCallCheck(this, WithContext);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.getChildContext = function () {
return getChildContext(_this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
WithContext.prototype.render = function render() {
return factory(this.props);
};
return WithContext;
}(_react.Component);
WithContext.childContextTypes = childContextTypes;
return WithContext;
};
};
exports.default = (0, _createHelper2.default)(withContext, 'withContext');
/***/ },
/* 43 */
/***/ 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 _react = __webpack_require__(3);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 mapValues = function mapValues(obj, func) {
var result = [];
var i = 0;
/* eslint-disable no-restricted-syntax */
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
i += 1;
result[key] = func(obj[key], key, i);
}
}
/* eslint-enable no-restricted-syntax */
return result;
};
var withHandlers = function withHandlers(handlers) {
return function (BaseComponent) {
var _class, _temp2, _initialiseProps;
var factory = (0, _createEagerFactory2.default)(BaseComponent);
return _temp2 = _class = function (_Component) {
_inherits(_class, _Component);
function _class() {
var _temp, _this, _ret;
_classCallCheck(this, _class);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _initialiseProps.call(_this), _temp), _possibleConstructorReturn(_this, _ret);
}
_class.prototype.componentWillReceiveProps = function componentWillReceiveProps() {
this.cachedHandlers = {};
};
_class.prototype.render = function render() {
return factory(_extends({}, this.props, this.handlers));
};
return _class;
}(_react.Component), _initialiseProps = function _initialiseProps() {
var _this2 = this;
this.cachedHandlers = {};
this.handlers = mapValues(handlers, function (createHandler, handlerName) {
return function () {
var cachedHandler = _this2.cachedHandlers[handlerName];
if (cachedHandler) {
return cachedHandler.apply(undefined, arguments);
}
var handler = createHandler(_this2.props);
_this2.cachedHandlers[handlerName] = handler;
if (false) {
console.error('withHandlers(): Expected a map of higher-order functions. ' + 'Refer to the docs for more info.');
}
return handler.apply(undefined, arguments);
};
});
}, _temp2;
};
};
exports.default = (0, _createHelper2.default)(withHandlers, 'withHandlers');
/***/ },
/* 44 */
/***/ 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 _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _mapProps = __webpack_require__(4);
var _mapProps2 = _interopRequireDefault(_mapProps);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var withProps = function withProps(input) {
return (0, _mapProps2.default)(function (props) {
return _extends({}, props, typeof input === 'function' ? input(props) : input);
});
};
exports.default = (0, _createHelper2.default)(withProps, 'withProps');
/***/ },
/* 45 */
/***/ 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 _react = __webpack_require__(3);
var _pick = __webpack_require__(12);
var _pick2 = _interopRequireDefault(_pick);
var _shallowEqual = __webpack_require__(6);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 withPropsOnChange = function withPropsOnChange(shouldMapOrKeys, propsMapper) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
var shouldMap = typeof shouldMapOrKeys === 'function' ? shouldMapOrKeys : function (props, nextProps) {
return !(0, _shallowEqual2.default)((0, _pick2.default)(props, shouldMapOrKeys), (0, _pick2.default)(nextProps, shouldMapOrKeys));
};
return function (_Component) {
_inherits(_class2, _Component);
function _class2() {
var _temp, _this, _ret;
_classCallCheck(this, _class2);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.computedProps = propsMapper(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
}
_class2.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (shouldMap(this.props, nextProps)) {
this.computedProps = propsMapper(nextProps);
}
};
_class2.prototype.render = function render() {
return factory(_extends({}, this.props, this.computedProps));
};
return _class2;
}(_react.Component);
};
};
exports.default = (0, _createHelper2.default)(withPropsOnChange, 'withPropsOnChange');
/***/ },
/* 46 */
/***/ 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 _react = __webpack_require__(3);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 withReducer = function withReducer(stateName, dispatchName, reducer, initialState) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
return function (_Component) {
_inherits(_class2, _Component);
function _class2() {
var _temp, _this, _ret;
_classCallCheck(this, _class2);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {
stateValue: typeof initialState === 'function' ? initialState(_this.props) : initialState
}, _this.dispatch = function (action) {
return _this.setState(function (_ref) {
var stateValue = _ref.stateValue;
return {
stateValue: reducer(stateValue, action)
};
});
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_class2.prototype.render = function render() {
var _extends2;
return factory(_extends({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[dispatchName] = this.dispatch, _extends2)));
};
return _class2;
}(_react.Component);
};
};
exports.default = (0, _createHelper2.default)(withReducer, 'withReducer');
/***/ },
/* 47 */
/***/ 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 _react = __webpack_require__(3);
var _createHelper = __webpack_require__(1);
var _createHelper2 = _interopRequireDefault(_createHelper);
var _createEagerFactory = __webpack_require__(2);
var _createEagerFactory2 = _interopRequireDefault(_createEagerFactory);
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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 withState = function withState(stateName, stateUpdaterName, initialState) {
return function (BaseComponent) {
var factory = (0, _createEagerFactory2.default)(BaseComponent);
return function (_Component) {
_inherits(_class2, _Component);
function _class2() {
var _temp, _this, _ret;
_classCallCheck(this, _class2);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {
stateValue: typeof initialState === 'function' ? initialState(_this.props) : initialState
}, _this.updateStateValue = function (updateFn, callback) {
return _this.setState(function (_ref) {
var stateValue = _ref.stateValue;
return {
stateValue: typeof updateFn === 'function' ? updateFn(stateValue) : updateFn
};
}, callback);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_class2.prototype.render = function render() {
var _extends2;
return factory(_extends({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[stateUpdaterName] = this.updateStateValue, _extends2)));
};
return _class2;
}(_react.Component);
};
};
exports.default = (0, _createHelper2.default)(withState, 'withState');
/***/ },
/* 48 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _getDisplayName = __webpack_require__(7);
var _getDisplayName2 = _interopRequireDefault(_getDisplayName);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var wrapDisplayName = function wrapDisplayName(BaseComponent, hocName) {
return hocName + '(' + (0, _getDisplayName2.default)(BaseComponent) + ')';
};
exports.default = wrapDisplayName;
/***/ },
/* 49 */
/***/ function(module, exports) {
/**
* 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.
*
* @typechecks
*
*/
/*eslint-disable no-self-compare */
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return x !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/**
* Performs equality by iterating through keys on an object and returning false
* when any key has values which are not strictly equal between the arguments.
* Returns true when the values of all keys are strictly equal.
*/
function shallowEqual(objA, objB) {
if (is(objA, objB)) {
return true;
}
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
for (var i = 0; i < keysA.length; i++) {
if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
module.exports = shallowEqual;
/***/ },
/* 50 */
/***/ function(module, exports) {
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
var REACT_STATICS = {
childContextTypes: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
arguments: true,
arity: true
};
module.exports = function hoistNonReactStatics(targetComponent, sourceComponent) {
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
var keys = Object.getOwnPropertyNames(sourceComponent);
for (var i=0; i<keys.length; ++i) {
if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]]) {
try {
targetComponent[keys[i]] = sourceComponent[keys[i]];
} catch (error) {
}
}
}
}
return targetComponent;
};
/***/ },
/* 51 */
/***/ function(module, exports) {
'use strict';
module.exports = function symbolObservablePonyfill(root) {
var result;
var Symbol = root.Symbol;
if (typeof Symbol === 'function') {
if (Symbol.observable) {
result = Symbol.observable;
} else {
result = Symbol('observable');
Symbol.observable = result;
}
} else {
result = '@@observable';
}
return result;
};
/***/ }
/******/ ])
});
; |
Examples/UIExplorer/ActivityIndicatorIOSExample.js | slongwang/react-native | /**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* 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 NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK 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.
*
* @flow
*/
'use strict';
var React = require('react-native');
var {
ActivityIndicatorIOS,
StyleSheet,
View,
} = React;
var TimerMixin = require('react-timer-mixin');
var ToggleAnimatingActivityIndicator = React.createClass({
mixins: [TimerMixin],
getInitialState: function() {
return {
animating: true,
};
},
setToggleTimeout: function() {
this.setTimeout(
() => {
this.setState({animating: !this.state.animating});
this.setToggleTimeout();
},
1200
);
},
componentDidMount: function() {
this.setToggleTimeout();
},
render: function() {
return (
<ActivityIndicatorIOS
animating={this.state.animating}
style={[styles.centering, {height: 80}]}
size="large"
/>
);
}
});
exports.displayName = (undefined: ?string);
exports.framework = 'React';
exports.title = '<ActivityIndicatorIOS>';
exports.description = 'Animated loading indicators.';
exports.examples = [
{
title: 'Default (small, white)',
render: function() {
return (
<ActivityIndicatorIOS
style={[styles.centering, styles.gray, {height: 40}]}
color="white"
/>
);
}
},
{
title: 'Gray',
render: function() {
return (
<View>
<ActivityIndicatorIOS
style={[styles.centering, {height: 40}]}
/>
<ActivityIndicatorIOS
style={[styles.centering, {backgroundColor: '#eeeeee', height: 40}]}
/>
</View>
);
}
},
{
title: 'Custom colors',
render: function() {
return (
<View style={styles.horizontal}>
<ActivityIndicatorIOS color="#0000ff" />
<ActivityIndicatorIOS color="#aa00aa" />
<ActivityIndicatorIOS color="#aa3300" />
<ActivityIndicatorIOS color="#00aa00" />
</View>
);
}
},
{
title: 'Large',
render: function() {
return (
<ActivityIndicatorIOS
style={[styles.centering, styles.gray, {height: 80}]}
color="white"
size="large"
/>
);
}
},
{
title: 'Large, custom colors',
render: function() {
return (
<View style={styles.horizontal}>
<ActivityIndicatorIOS
size="large"
color="#0000ff"
/>
<ActivityIndicatorIOS
size="large"
color="#aa00aa"
/>
<ActivityIndicatorIOS
size="large"
color="#aa3300"
/>
<ActivityIndicatorIOS
size="large"
color="#00aa00"
/>
</View>
);
}
},
{
title: 'Start/stop',
render: function(): ReactElement {
return <ToggleAnimatingActivityIndicator />;
}
},
];
var styles = StyleSheet.create({
centering: {
alignItems: 'center',
justifyContent: 'center',
},
gray: {
backgroundColor: '#cccccc',
},
horizontal: {
flexDirection: 'row',
justifyContent: 'space-around',
},
});
|
examples/ideaEditor-demo/src/IdeaEditor/ImportTitleDialog/UI.js | homkai/deef | /**
* @file 导入标题弹窗 - UI
*/
import React from 'react';
import {TitleWindow, SearchBox} from 'fcui2'
import _ from 'lodash';
import './style.less';
export default ({onChangeTitle, isOpen, isRequesting, searchQuery, listData, ...callbacks}) => {
const {onInputSearch, onSearch, onClickImport: clickImport, onClose} = callbacks;
const onClickImport = _.partial(clickImport, onChangeTitle);
return <TitleWindow
showCloseButton
title="导入已有标题"
isOpen={isOpen}
onClose={onClose}
>
<div className="idea-editor-import-title-dialog">
<SearchBox
placeholder="请输入标题关键字"
value={searchQuery}
onChange={onInputSearch}
onClick={onSearch}
/>
{
isRequesting
? <div className="list-tip">正在加载...</div>
: (
!listData.length
? <div className="list-tip">
暂无标题,去新建创意吧!
</div>
: <ul className="title-list">
{
listData.map(item => {
const handleClick = _.partial(onClickImport, item.title);
return <li key={item.title} className="title-item">
<div className="title-show">{item.title}</div>
<a href="javascript:;" className="import-btn" onClick={handleClick}>导入</a>
</li>;
})
}
</ul>
)
}
</div>
</TitleWindow>;
}; |
src/components/LoadingIndicator.js | gshackles/react-demo-beerlist | import React from 'react';
const LoadingIndicator = (props) => {
const classes = `load-bar ${props.isLoading ? 'active' : ''}`;
return (
<div className={classes}>
<div className="bar" />
<div className="bar" />
<div className="bar" />
</div>
);
};
LoadingIndicator.propTypes = {
isLoading: React.PropTypes.bool.isRequired
};
export default LoadingIndicator; |
src/components/intake/IntakePage.js | GHImplementationTeam/FrontEnd | import Paper from 'material-ui/Paper';
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
import { bindActionCreators } from 'redux';
import { ACTIONS } from '../../Setup';
import globalStyles from '../../styles';
import IntakeStepper from './IntakeStepper';
class IntakePage extends React.Component {
state = {
saved: true,
intakeId: this.props.params.id
};
componentWillMount() {
if (this.state.intakeId) {
this.props.actions.loadIntake(this.state.intakeId);
}
}
componentDidMount = () => {
// this.props.router.setRouteLeaveHook(this.props.route, () => {
// if (!this.state.saved)
// return 'You may have unsaved information, are you sure you want to leave this page?';
// });
};
saveIntake = intake => {
this.setState({ saved: true });
if (intake.id) {
return this.props.actions
.updateIntake(intake)
.then(this.props.actions.loadIntakes());
}
return this.props.actions
.createIntake(intake)
.then(this.props.actions.loadIntakes());
};
updateSaveIntake = saved => {
this.setState({
saved
});
};
render() {
// console.log(this.props);
const { intakeId } = this.state;
let { intake } = this.props;
if (!intakeId) {
intake = {};
}
return (
<Paper style={globalStyles.paper}>
<IntakeStepper
updateSave={this.updateSaveIntake}
intake={intake}
intakeQuestionnaire={intake.answers}
saveIntake={this.saveIntake}
/>
</Paper>
);
}
}
IntakePage.propTypes = {
intake: PropTypes.object.isRequired,
intakeQuestionnaire: PropTypes.object.isRequired
};
function mapStateToProps(state, ownProps) {
return {
intake: state.intake,
intakeQuestionnaire: state.intakeQuestionnaire
};
}
function mapDispatchToProps(dispatch) {
return { actions: bindActionCreators(ACTIONS, dispatch) };
}
export default withRouter(
connect(mapStateToProps, mapDispatchToProps)(IntakePage)
);
|
ajax/libs/yui/3.9.0/datatable-body/datatable-body.js | alucard001/cdnjs | YUI.add('datatable-body', function (Y, NAME) {
/**
View class responsible for rendering the `<tbody>` section of a table. Used as
the default `bodyView` for `Y.DataTable.Base` and `Y.DataTable` classes.
@module datatable
@submodule datatable-body
@since 3.5.0
**/
var Lang = Y.Lang,
isArray = Lang.isArray,
isNumber = Lang.isNumber,
isString = Lang.isString,
fromTemplate = Lang.sub,
htmlEscape = Y.Escape.html,
toArray = Y.Array,
bind = Y.bind,
YObject = Y.Object,
valueRegExp = /\{value\}/g;
/**
View class responsible for rendering the `<tbody>` section of a table. Used as
the default `bodyView` for `Y.DataTable.Base` and `Y.DataTable` classes.
Translates the provided `modelList` into a rendered `<tbody>` based on the data
in the constituent Models, altered or ammended by any special column
configurations.
The `columns` configuration, passed to the constructor, determines which
columns will be rendered.
The rendering process involves constructing an HTML template for a complete row
of data, built by concatenating a customized copy of the instance's
`CELL_TEMPLATE` into the `ROW_TEMPLATE` once for each column. This template is
then populated with values from each Model in the `modelList`, aggregating a
complete HTML string of all row and column data. A `<tbody>` Node is then created from the markup and any column `nodeFormatter`s are applied.
Supported properties of the column objects include:
* `key` - Used to link a column to an attribute in a Model.
* `name` - Used for columns that don't relate to an attribute in the Model
(`formatter` or `nodeFormatter` only) if the implementer wants a
predictable name to refer to in their CSS.
* `cellTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this
column only.
* `formatter` - Used to customize or override the content value from the
Model. These do not have access to the cell or row Nodes and should
return string (HTML) content.
* `nodeFormatter` - Used to provide content for a cell as well as perform any
custom modifications on the cell or row Node that could not be performed by
`formatter`s. Should be used sparingly for better performance.
* `emptyCellValue` - String (HTML) value to use if the Model data for a
column, or the content generated by a `formatter`, is the empty string,
`null`, or `undefined`.
* `allowHTML` - Set to `true` if a column value, `formatter`, or
`emptyCellValue` can contain HTML. This defaults to `false` to protect
against XSS.
* `className` - Space delimited CSS classes to add to all `<td>`s in a column.
A column `formatter` can be:
* a function, as described below.
* a string which can be:
* the name of a pre-defined formatter function
which can be located in the `Y.DataTable.BodyView.Formatters` hash using the
value of the `formatter` property as the index.
* A template that can use the `{value}` placeholder to include the value
for the current cell or the name of any field in the underlaying model
also enclosed in curly braces. Any number and type of these placeholders
can be used.
Column `formatter`s are passed an object (`o`) with the following properties:
* `value` - The current value of the column's associated attribute, if any.
* `data` - An object map of Model keys to their current values.
* `record` - The Model instance.
* `column` - The column configuration object for the current column.
* `className` - Initially empty string to allow `formatter`s to add CSS
classes to the cell's `<td>`.
* `rowIndex` - The zero-based row number.
* `rowClass` - Initially empty string to allow `formatter`s to add CSS
classes to the cell's containing row `<tr>`.
They may return a value or update `o.value` to assign specific HTML content. A
returned value has higher precedence.
Column `nodeFormatter`s are passed an object (`o`) with the following
properties:
* `value` - The current value of the column's associated attribute, if any.
* `td` - The `<td>` Node instance.
* `cell` - The `<div>` liner Node instance if present, otherwise, the `<td>`.
When adding content to the cell, prefer appending into this property.
* `data` - An object map of Model keys to their current values.
* `record` - The Model instance.
* `column` - The column configuration object for the current column.
* `rowIndex` - The zero-based row number.
They are expected to inject content into the cell's Node directly, including
any "empty" cell content. Each `nodeFormatter` will have access through the
Node API to all cells and rows in the `<tbody>`, but not to the `<table>`, as
it will not be attached yet.
If a `nodeFormatter` returns `false`, the `o.td` and `o.cell` Nodes will be
`destroy()`ed to remove them from the Node cache and free up memory. The DOM
elements will remain as will any content added to them. _It is highly
advisable to always return `false` from your `nodeFormatter`s_.
@class BodyView
@namespace DataTable
@extends View
@since 3.5.0
**/
Y.namespace('DataTable').BodyView = Y.Base.create('tableBody', Y.View, [], {
// -- Instance properties -------------------------------------------------
/**
HTML template used to create table cells.
@property CELL_TEMPLATE
@type {HTML}
@default '<td {headers} class="{className}">{content}</td>'
@since 3.5.0
**/
CELL_TEMPLATE: '<td {headers} class="{className}">{content}</td>',
/**
CSS class applied to even rows. This is assigned at instantiation.
For DataTable, this will be `yui3-datatable-even`.
@property CLASS_EVEN
@type {String}
@default 'yui3-table-even'
@since 3.5.0
**/
//CLASS_EVEN: null
/**
CSS class applied to odd rows. This is assigned at instantiation.
When used by DataTable instances, this will be `yui3-datatable-odd`.
@property CLASS_ODD
@type {String}
@default 'yui3-table-odd'
@since 3.5.0
**/
//CLASS_ODD: null
/**
HTML template used to create table rows.
@property ROW_TEMPLATE
@type {HTML}
@default '<tr id="{rowId}" data-yui3-record="{clientId}" class="{rowClass}">{content}</tr>'
@since 3.5.0
**/
ROW_TEMPLATE : '<tr id="{rowId}" data-yui3-record="{clientId}" class="{rowClass}">{content}</tr>',
/**
The object that serves as the source of truth for column and row data.
This property is assigned at instantiation from the `host` property of
the configuration object passed to the constructor.
@property host
@type {Object}
@default (initially unset)
@since 3.5.0
**/
//TODO: should this be protected?
//host: null,
/**
HTML templates used to create the `<tbody>` containing the table rows.
@property TBODY_TEMPLATE
@type {HTML}
@default '<tbody class="{className}">{content}</tbody>'
@since 3.6.0
**/
TBODY_TEMPLATE: '<tbody class="{className}"></tbody>',
// -- Public methods ------------------------------------------------------
/**
Returns the `<td>` Node from the given row and column index. Alternately,
the `seed` can be a Node. If so, the nearest ancestor cell is returned.
If the `seed` is a cell, it is returned. If there is no cell at the given
coordinates, `null` is returned.
Optionally, include an offset array or string to return a cell near the
cell identified by the `seed`. The offset can be an array containing the
number of rows to shift followed by the number of columns to shift, or one
of "above", "below", "next", or "previous".
<pre><code>// Previous cell in the previous row
var cell = table.getCell(e.target, [-1, -1]);
// Next cell
var cell = table.getCell(e.target, 'next');
var cell = table.getCell(e.taregt, [0, 1];</pre></code>
@method getCell
@param {Number[]|Node} seed Array of row and column indexes, or a Node that
is either the cell itself or a descendant of one.
@param {Number[]|String} [shift] Offset by which to identify the returned
cell Node
@return {Node}
@since 3.5.0
**/
getCell: function (seed, shift) {
var tbody = this.tbodyNode,
row, cell, index, rowIndexOffset;
if (seed && tbody) {
if (isArray(seed)) {
row = tbody.get('children').item(seed[0]);
cell = row && row.get('children').item(seed[1]);
} else if (Y.instanceOf(seed, Y.Node)) {
cell = seed.ancestor('.' + this.getClassName('cell'), true);
}
if (cell && shift) {
rowIndexOffset = tbody.get('firstChild.rowIndex');
if (isString(shift)) {
// TODO this should be a static object map
switch (shift) {
case 'above' : shift = [-1, 0]; break;
case 'below' : shift = [1, 0]; break;
case 'next' : shift = [0, 1]; break;
case 'previous': shift = [0, -1]; break;
}
}
if (isArray(shift)) {
index = cell.get('parentNode.rowIndex') +
shift[0] - rowIndexOffset;
row = tbody.get('children').item(index);
index = cell.get('cellIndex') + shift[1];
cell = row && row.get('children').item(index);
}
}
}
return cell || null;
},
/**
Returns the generated CSS classname based on the input. If the `host`
attribute is configured, it will attempt to relay to its `getClassName`
or use its static `NAME` property as a string base.
If `host` is absent or has neither method nor `NAME`, a CSS classname
will be generated using this class's `NAME`.
@method getClassName
@param {String} token* Any number of token strings to assemble the
classname from.
@return {String}
@protected
@since 3.5.0
**/
getClassName: function () {
var host = this.host,
args;
if (host && host.getClassName) {
return host.getClassName.apply(host, arguments);
} else {
args = toArray(arguments);
args.unshift(this.constructor.NAME);
return Y.ClassNameManager.getClassName
.apply(Y.ClassNameManager, args);
}
},
/**
Returns the Model associated to the row Node or id provided. Passing the
Node or id for a descendant of the row also works.
If no Model can be found, `null` is returned.
@method getRecord
@param {String|Node} seed Row Node or `id`, or one for a descendant of a row
@return {Model}
@since 3.5.0
**/
getRecord: function (seed) {
var modelList = this.get('modelList'),
tbody = this.tbodyNode,
row = null,
record;
if (tbody) {
if (isString(seed)) {
seed = tbody.one('#' + seed);
}
if (Y.instanceOf(seed, Y.Node)) {
row = seed.ancestor(function (node) {
return node.get('parentNode').compareTo(tbody);
}, true);
record = row &&
modelList.getByClientId(row.getData('yui3-record'));
}
}
return record || null;
},
/**
Returns the `<tr>` Node from the given row index, Model, or Model's
`clientId`. If the rows haven't been rendered yet, or if the row can't be
found by the input, `null` is returned.
@method getRow
@param {Number|String|Model} id Row index, Model instance, or clientId
@return {Node}
@since 3.5.0
**/
getRow: function (id) {
var tbody = this.tbodyNode,
row = null;
if (tbody) {
if (id) {
id = this._idMap[id.get ? id.get('clientId') : id] || id;
}
row = isNumber(id) ?
tbody.get('children').item(id) :
tbody.one('#' + id);
}
return row;
},
/**
Creates the table's `<tbody>` content by assembling markup generated by
populating the `ROW\_TEMPLATE`, and `CELL\_TEMPLATE` templates with content
from the `columns` and `modelList` attributes.
The rendering process happens in three stages:
1. A row template is assembled from the `columns` attribute (see
`_createRowTemplate`)
2. An HTML string is built up by concatening the application of the data in
each Model in the `modelList` to the row template. For cells with
`formatter`s, the function is called to generate cell content. Cells
with `nodeFormatter`s are ignored. For all other cells, the data value
from the Model attribute for the given column key is used. The
accumulated row markup is then inserted into the container.
3. If any column is configured with a `nodeFormatter`, the `modelList` is
iterated again to apply the `nodeFormatter`s.
Supported properties of the column objects include:
* `key` - Used to link a column to an attribute in a Model.
* `name` - Used for columns that don't relate to an attribute in the Model
(`formatter` or `nodeFormatter` only) if the implementer wants a
predictable name to refer to in their CSS.
* `cellTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in
this column only.
* `formatter` - Used to customize or override the content value from the
Model. These do not have access to the cell or row Nodes and should
return string (HTML) content.
* `nodeFormatter` - Used to provide content for a cell as well as perform
any custom modifications on the cell or row Node that could not be
performed by `formatter`s. Should be used sparingly for better
performance.
* `emptyCellValue` - String (HTML) value to use if the Model data for a
column, or the content generated by a `formatter`, is the empty string,
`null`, or `undefined`.
* `allowHTML` - Set to `true` if a column value, `formatter`, or
`emptyCellValue` can contain HTML. This defaults to `false` to protect
against XSS.
* `className` - Space delimited CSS classes to add to all `<td>`s in a
column.
Column `formatter`s are passed an object (`o`) with the following
properties:
* `value` - The current value of the column's associated attribute, if
any.
* `data` - An object map of Model keys to their current values.
* `record` - The Model instance.
* `column` - The column configuration object for the current column.
* `className` - Initially empty string to allow `formatter`s to add CSS
classes to the cell's `<td>`.
* `rowIndex` - The zero-based row number.
* `rowClass` - Initially empty string to allow `formatter`s to add CSS
classes to the cell's containing row `<tr>`.
They may return a value or update `o.value` to assign specific HTML
content. A returned value has higher precedence.
Column `nodeFormatter`s are passed an object (`o`) with the following
properties:
* `value` - The current value of the column's associated attribute, if
any.
* `td` - The `<td>` Node instance.
* `cell` - The `<div>` liner Node instance if present, otherwise, the
`<td>`. When adding content to the cell, prefer appending into this
property.
* `data` - An object map of Model keys to their current values.
* `record` - The Model instance.
* `column` - The column configuration object for the current column.
* `rowIndex` - The zero-based row number.
They are expected to inject content into the cell's Node directly, including
any "empty" cell content. Each `nodeFormatter` will have access through the
Node API to all cells and rows in the `<tbody>`, but not to the `<table>`,
as it will not be attached yet.
If a `nodeFormatter` returns `false`, the `o.td` and `o.cell` Nodes will be
`destroy()`ed to remove them from the Node cache and free up memory. The
DOM elements will remain as will any content added to them. _It is highly
advisable to always return `false` from your `nodeFormatter`s_.
@method render
@return {BodyView} The instance
@chainable
@since 3.5.0
**/
render: function () {
var table = this.get('container'),
data = this.get('modelList'),
columns = this.get('columns'),
tbody = this.tbodyNode ||
(this.tbodyNode = this._createTBodyNode());
// Needed for mutation
this._createRowTemplate(columns);
if (data) {
tbody.setHTML(this._createDataHTML(columns));
this._applyNodeFormatters(tbody, columns);
}
if (tbody.get('parentNode') !== table) {
table.appendChild(tbody);
}
this._afterRenderCleanup();
this.bindUI();
return this;
},
// -- Protected and private methods ---------------------------------------
/**
Handles changes in the source's columns attribute. Redraws the table data.
@method _afterColumnsChange
@param {EventFacade} e The `columnsChange` event object
@protected
@since 3.5.0
**/
// TODO: Preserve existing DOM
// This will involve parsing and comparing the old and new column configs
// and reacting to four types of changes:
// 1. formatter, nodeFormatter, emptyCellValue changes
// 2. column deletions
// 3. column additions
// 4. column moves (preserve cells)
_afterColumnsChange: function () {
this.render();
},
/**
Handles modelList changes, including additions, deletions, and updates.
Modifies the existing table DOM accordingly.
@method _afterDataChange
@param {EventFacade} e The `change` event from the ModelList
@protected
@since 3.5.0
**/
_afterDataChange: function () {
//var type = e.type.slice(e.type.lastIndexOf(':') + 1);
// TODO: Isolate changes
this.render();
},
/**
Handles replacement of the modelList.
Rerenders the `<tbody>` contents.
@method _afterModelListChange
@param {EventFacade} e The `modelListChange` event
@protected
@since 3.6.0
**/
_afterModelListChange: function () {
var handles = this._eventHandles;
if (handles.dataChange) {
handles.dataChange.detach();
delete handles.dataChange;
this.bindUI();
}
if (this.tbodyNode) {
this.render();
}
},
/**
Iterates the `modelList`, and calls any `nodeFormatter`s found in the
`columns` param on the appropriate cell Nodes in the `tbody`.
@method _applyNodeFormatters
@param {Node} tbody The `<tbody>` Node whose columns to update
@param {Object[]} columns The column configurations
@protected
@since 3.5.0
**/
_applyNodeFormatters: function (tbody, columns) {
var host = this.host,
data = this.get('modelList'),
formatters = [],
linerQuery = '.' + this.getClassName('liner'),
rows, i, len;
// Only iterate the ModelList again if there are nodeFormatters
for (i = 0, len = columns.length; i < len; ++i) {
if (columns[i].nodeFormatter) {
formatters.push(i);
}
}
if (data && formatters.length) {
rows = tbody.get('childNodes');
data.each(function (record, index) {
var formatterData = {
data : record.toJSON(),
record : record,
rowIndex : index
},
row = rows.item(index),
i, len, col, key, cells, cell, keep;
if (row) {
cells = row.get('childNodes');
for (i = 0, len = formatters.length; i < len; ++i) {
cell = cells.item(formatters[i]);
if (cell) {
col = formatterData.column = columns[formatters[i]];
key = col.key || col.id;
formatterData.value = record.get(key);
formatterData.td = cell;
formatterData.cell = cell.one(linerQuery) || cell;
keep = col.nodeFormatter.call(host,formatterData);
if (keep === false) {
// Remove from the Node cache to reduce
// memory footprint. This also purges events,
// which you shouldn't be scoping to a cell
// anyway. You've been warned. Incidentally,
// you should always return false. Just sayin.
cell.destroy(true);
}
}
}
}
});
}
},
/**
Binds event subscriptions from the UI and the host (if assigned).
@method bindUI
@protected
@since 3.5.0
**/
bindUI: function () {
var handles = this._eventHandles,
modelList = this.get('modelList'),
changeEvent = modelList.model.NAME + ':change';
if (!handles.columnsChange) {
handles.columnsChange = this.after('columnsChange',
bind('_afterColumnsChange', this));
}
if (modelList && !handles.dataChange) {
handles.dataChange = modelList.after(
['add', 'remove', 'reset', changeEvent],
bind('_afterDataChange', this));
}
},
/**
Iterates the `modelList` and applies each Model to the `_rowTemplate`,
allowing any column `formatter` or `emptyCellValue` to override cell
content for the appropriate column. The aggregated HTML string is
returned.
@method _createDataHTML
@param {Object[]} columns The column configurations to customize the
generated cell content or class names
@return {HTML} The markup for all Models in the `modelList`, each applied
to the `_rowTemplate`
@protected
@since 3.5.0
**/
_createDataHTML: function (columns) {
var data = this.get('modelList'),
html = '';
if (data) {
data.each(function (model, index) {
html += this._createRowHTML(model, index, columns);
}, this);
}
return html;
},
/**
Applies the data of a given Model, modified by any column formatters and
supplemented by other template values to the instance's `_rowTemplate` (see
`_createRowTemplate`). The generated string is then returned.
The data from Model's attributes is fetched by `toJSON` and this data
object is appended with other properties to supply values to {placeholders}
in the template. For a template generated from a Model with 'foo' and 'bar'
attributes, the data object would end up with the following properties
before being used to populate the `_rowTemplate`:
* `clientID` - From Model, used the assign the `<tr>`'s 'id' attribute.
* `foo` - The value to populate the 'foo' column cell content. This
value will be the value stored in the Model's `foo` attribute, or the
result of the column's `formatter` if assigned. If the value is '',
`null`, or `undefined`, and the column's `emptyCellValue` is assigned,
that value will be used.
* `bar` - Same for the 'bar' column cell content.
* `foo-className` - String of CSS classes to apply to the `<td>`.
* `bar-className` - Same.
* `rowClass` - String of CSS classes to apply to the `<tr>`. This
will be the odd/even class per the specified index plus any additional
classes assigned by column formatters (via `o.rowClass`).
Because this object is available to formatters, any additional properties
can be added to fill in custom {placeholders} in the `_rowTemplate`.
@method _createRowHTML
@param {Model} model The Model instance to apply to the row template
@param {Number} index The index the row will be appearing
@param {Object[]} columns The column configurations
@return {HTML} The markup for the provided Model, less any `nodeFormatter`s
@protected
@since 3.5.0
**/
_createRowHTML: function (model, index, columns) {
var data = model.toJSON(),
clientId = model.get('clientId'),
values = {
rowId : this._getRowId(clientId),
clientId: clientId,
rowClass: (index % 2) ? this.CLASS_ODD : this.CLASS_EVEN
},
host = this.host || this,
i, len, col, token, value, formatterData;
for (i = 0, len = columns.length; i < len; ++i) {
col = columns[i];
value = data[col.key];
token = col._id || col.key;
values[token + '-className'] = '';
if (col._formatterFn) {
formatterData = {
value : value,
data : data,
column : col,
record : model,
className: '',
rowClass : '',
rowIndex : index
};
// Formatters can either return a value
value = col._formatterFn.call(host, formatterData);
// or update the value property of the data obj passed
if (value === undefined) {
value = formatterData.value;
}
values[token + '-className'] = formatterData.className;
values.rowClass += ' ' + formatterData.rowClass;
}
if (value === undefined || value === null || value === '') {
value = col.emptyCellValue || '';
}
values[token] = col.allowHTML ? value : htmlEscape(value);
values.rowClass = values.rowClass.replace(/\s+/g, ' ');
}
return fromTemplate(this._rowTemplate, values);
},
/**
Creates a custom HTML template string for use in generating the markup for
individual table rows with {placeholder}s to capture data from the Models
in the `modelList` attribute or from column `formatter`s.
Assigns the `_rowTemplate` property.
@method _createRowTemplate
@param {Object[]} columns Array of column configuration objects
@protected
@since 3.5.0
**/
_createRowTemplate: function (columns) {
var html = '',
cellTemplate = this.CELL_TEMPLATE,
F = Y.DataTable.BodyView.Formatters,
i, len, col, key, token, headers, tokenValues, formatter;
for (i = 0, len = columns.length; i < len; ++i) {
col = columns[i];
key = col.key;
token = col._id || key;
formatter = col.formatter;
// Only include headers if there are more than one
headers = (col._headers || []).length > 1 ?
'headers="' + col._headers.join(' ') + '"' : '';
tokenValues = {
content : '{' + token + '}',
headers : headers,
className: this.getClassName('col', token) + ' ' +
(col.className || '') + ' ' +
this.getClassName('cell') +
' {' + token + '-className}'
};
if (formatter) {
if (Lang.isFunction(formatter)) {
col._formatterFn = formatter;
} else if (formatter in F) {
col._formatterFn = F[formatter].call(this.host || this, col);
} else {
tokenValues.content = formatter.replace(valueRegExp, tokenValues.content);
}
}
if (col.nodeFormatter) {
// Defer all node decoration to the formatter
tokenValues.content = '';
}
html += fromTemplate(col.cellTemplate || cellTemplate, tokenValues);
}
this._rowTemplate = fromTemplate(this.ROW_TEMPLATE, {
content: html
});
},
/**
Cleans up temporary values created during rendering.
@method _afterRenderCleanup
@private
*/
_afterRenderCleanup: function () {
var columns = this.get('columns'),
i, len = columns.length;
for (i = 0;i < len; i+=1) {
delete columns[i]._formatterFn;
}
},
/**
Creates the `<tbody>` node that will store the data rows.
@method _createTBodyNode
@return {Node}
@protected
@since 3.6.0
**/
_createTBodyNode: function () {
return Y.Node.create(fromTemplate(this.TBODY_TEMPLATE, {
className: this.getClassName('data')
}));
},
/**
Destroys the instance.
@method destructor
@protected
@since 3.5.0
**/
destructor: function () {
(new Y.EventHandle(YObject.values(this._eventHandles))).detach();
},
/**
Holds the event subscriptions needing to be detached when the instance is
`destroy()`ed.
@property _eventHandles
@type {Object}
@default undefined (initially unset)
@protected
@since 3.5.0
**/
//_eventHandles: null,
/**
Returns the row ID associated with a Model's clientId.
@method _getRowId
@param {String} clientId The Model clientId
@return {String}
@protected
**/
_getRowId: function (clientId) {
return this._idMap[clientId] || (this._idMap[clientId] = Y.guid());
},
/**
Map of Model clientIds to row ids.
@property _idMap
@type {Object}
@protected
**/
//_idMap,
/**
Initializes the instance. Reads the following configuration properties in
addition to the instance attributes:
* `columns` - (REQUIRED) The initial column information
* `host` - The object to serve as source of truth for column info and
for generating class names
@method initializer
@param {Object} config Configuration data
@protected
@since 3.5.0
**/
initializer: function (config) {
this.host = config.host;
this._eventHandles = {
modelListChange: this.after('modelListChange',
bind('_afterModelListChange', this))
};
this._idMap = {};
this.CLASS_ODD = this.getClassName('odd');
this.CLASS_EVEN = this.getClassName('even');
}
/**
The HTML template used to create a full row of markup for a single Model in
the `modelList` plus any customizations defined in the column
configurations.
@property _rowTemplate
@type {HTML}
@default (initially unset)
@protected
@since 3.5.0
**/
//_rowTemplate: null
},{
/**
Hash of formatting functions for cell contents.
This property can be populated with a hash of formatting functions by the developer
or a set of pre-defined functions can be loaded via the `datatable-formatters` module.
See: [DataTable.BodyView.Formatters](./DataTable.BodyView.Formatters.html)
@property Formatters
@type Object
@since 3.8.0
@static
**/
Formatters: {}
});
}, '@VERSION@', {"requires": ["datatable-core", "view", "classnamemanager"]});
|
frontend/src/admin/branchManagement/BranchManagement.js | rabblerouser/core | import React from 'react';
import { connect } from 'react-redux';
import BranchDetails from './branchView';
import AdminsView from './adminsView';
import GroupsView from './groupView';
import MembersView from './memberView';
const BranchManagement = () => (
<section>
<BranchDetails />
<AdminsView />
<section>
<GroupsView />
<MembersView />
</section>
</section>
);
export default connect(() => ({}))(BranchManagement);
|
src/routes/Trips/components/Trips.js | denimar/denibudget | import React from 'react'
import './Trips.scss'
import Trip from '../../Trip/components/Trip'
class Trips extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
}
render() {
return (
<div className="trips-container">
{
this.props.trips.map(trip => {
return (
<Trip key={ trip.id } trip={trip} />
)
})
}
</div>
)
}
}
export default Trips
|
example/components/TableRowSet.js | ekazakov/react-scrollable | import React from 'react';
import {TableRow} from './TableRow';
export class TableRowsSet extends React.Component {
render() {
const {rows, from, to, fixedHeight} = this.props;
return <table>
<tbody>
{rows.slice(from, to).map(row => <TableRow key={row.get('id')} row={row} fixedHeight={fixedHeight}/>)}
</tbody>
</table>;
}
} |
src/components/Demo.js | FaureWu/Resume | require('styles/Demo.css');
import React from 'react';
import Tool from './Tool';
class Demo extends React.Component {
constructor(props) {
super(props);
this.state = {
}
}
render() {
let self = this;
let items = this.props.data;
return (
<div className="demo">
<div className="demo-container">
<p className="demo-title">实践是检验真理的唯一标准</p>
<div className="demo-group">
<div className="demo-item">
<span></span>
<label>GOBANG</label>
</div>
</div>
</div>
</div>
);
}
}
export default Demo;
|
src/js/components/Markdown/stories/Override.js | grommet/grommet | import React from 'react';
import styled from 'styled-components';
import { Box, Markdown } from 'grommet';
const CONTENT = `
# Out of Breath
You know, sometimes in life it seems like there's no way out. Like
a sheep trapped in a maze designed by wolves. See all the
options [here](https://github.com/probablyup/markdown-to-jsx/)
[reference](#)
\`\`\`
import { Grommet } from 'grommet';
\`\`\`
> i carry your heart with me

Markdown | Less | Pretty
--- | --- | ---
*Still* | \`renders\` | **nicely**
1 | 2 | 3
`;
const StyledPre = styled.pre`
background-color: #7d4cdb;
`;
export const ComponentOverrideMarkdown = () => (
// Uncomment <Grommet> lines when using outside of storybook
// <Grommet theme={...}>
<Box align="center" pad="large">
<Markdown components={{ pre: StyledPre }}>{CONTENT}</Markdown>
</Box>
// </Grommet>
);
ComponentOverrideMarkdown.storyName = 'Component override markdown';
export default {
title: 'Type/Markdown/Component override markdown',
};
|
src/components/FuelSavingsForm.js | tsaarni/docker-npm-builder | import React, {PropTypes} from 'react';
import FuelSavingsResults from './FuelSavingsResults';
import FuelSavingsTextInput from './FuelSavingsTextInput';
class FuelSavingsForm extends React.Component {
constructor(props, context) {
super(props, context);
this.save = this.save.bind(this);
this.onTimeframeChange = this.onTimeframeChange.bind(this);
this.fuelSavingsKeypress = this.fuelSavingsKeypress.bind(this);
}
onTimeframeChange(e) {
this.props.calculateFuelSavings(this.props.fuelSavings, 'milesDrivenTimeframe', e.target.value);
}
fuelSavingsKeypress(name, value) {
this.props.calculateFuelSavings(this.props.fuelSavings, name, value);
}
save() {
this.props.saveFuelSavings(this.props.fuelSavings);
}
render() {
const {fuelSavings} = this.props;
return (
<div>
<h2>Fuel Savings Analysis</h2>
<table>
<tbody>
<tr>
<td><label htmlFor="newMpg">New Vehicle MPG</label></td>
<td><FuelSavingsTextInput onChange={this.fuelSavingsKeypress} name="newMpg" value={fuelSavings.newMpg}/>
</td>
</tr>
<tr>
<td><label htmlFor="tradeMpg">Trade-in MPG</label></td>
<td><FuelSavingsTextInput onChange={this.fuelSavingsKeypress} name="tradeMpg" value={fuelSavings.tradeMpg}/>
</td>
</tr>
<tr>
<td><label htmlFor="newPpg">New Vehicle price per gallon</label></td>
<td><FuelSavingsTextInput onChange={this.fuelSavingsKeypress} name="newPpg" value={fuelSavings.newPpg}/>
</td>
</tr>
<tr>
<td><label htmlFor="tradePpg">Trade-in price per gallon</label></td>
<td><FuelSavingsTextInput onChange={this.fuelSavingsKeypress} name="tradePpg" value={fuelSavings.tradePpg}/>
</td>
</tr>
<tr>
<td><label htmlFor="milesDriven">Miles Driven</label></td>
<td>
<FuelSavingsTextInput
onChange={this.fuelSavingsKeypress}
name="milesDriven"
value={fuelSavings.milesDriven}/>
miles per
<select
name="milesDrivenTimeframe"
onChange={this.onTimeframeChange}
value={fuelSavings.milesDrivenTimeframe}>
<option value="week">Week</option>
<option value="month">Month</option>
<option value="year">Year</option>
</select>
</td>
</tr>
<tr>
<td><label>Date Modified</label></td>
<td>{fuelSavings.dateModified}</td>
</tr>
</tbody>
</table>
<hr/>
{fuelSavings.necessaryDataIsProvidedToCalculateSavings && <FuelSavingsResults savings={fuelSavings.savings}/>}
<input type="submit" value="Save" onClick={this.save}/>
</div>
);
}
}
FuelSavingsForm.propTypes = {
saveFuelSavings: PropTypes.func.isRequired,
calculateFuelSavings: PropTypes.func.isRequired,
fuelSavings: PropTypes.object.isRequired
};
export default FuelSavingsForm;
|
webapp/src/routes.js | wfriesen/jerryatric | /**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
import Router from 'react-routing/src/Router';
import App from './components/App';
import NotFoundPage from './components/NotFoundPage';
import ErrorPage from './components/ErrorPage';
import SearchPage from './components/SearchPage';
const router = new Router(on => {
on('*', async (state, next) => {
const component = await next();
return component && <App context={state.context}>{component}</App>;
});
on('/', async () => <SearchPage />);
on('error', (state, error) => state.statusCode === 404 ?
<App context={state.context} error={error}><NotFoundPage /></App> :
<App context={state.context} error={error}><ErrorPage /></App>
);
});
export default router;
|
node_modules/native-base/src/basic/H1.js | tausifmuzaffar/bisApp | import React, { Component } from 'react';
import { Text } from 'react-native';
import { connectStyle } from '@shoutem/theme';
import mapPropsToStyleNames from '../Utils/mapPropsToStyleNames';
class H1 extends Component {
render() {
return (
<Text ref={c => this._root = c} {...this.props} />
);
}
}
const childrenType = function (props, propName, component) {
let error;
const prop = props[propName];
React.Children.forEach(prop, (child) => {
if (typeof child !== 'string') {
error = new Error(`${component} should have only string`);
}
});
return error;
};
H1.propTypes = {
...Text.propTypes,
children: childrenType,
style: React.PropTypes.object,
};
const StyledH1 = connectStyle('NativeBase.H1', {}, mapPropsToStyleNames)(H1);
export {
StyledH1 as H1,
};
|
lib/jquery-bootgrid/lib/jquery-1.10.2.min.js | MLWALK3R/librenms | /*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery-1.10.2.min.map
*/
(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={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:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.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(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
|
ajax/libs/react-select/1.0.0-beta4/react-select.js | sashberd/cdnjs | (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Select = f()}})(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 (global){
'use strict';
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 _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var _react2 = _interopRequireDefault(_react);
var _Select = require('./Select');
var _Select2 = _interopRequireDefault(_Select);
var _utilsStripDiacritics = require('./utils/stripDiacritics');
var _utilsStripDiacritics2 = _interopRequireDefault(_utilsStripDiacritics);
var requestId = 0;
function initCache(cache) {
if (cache && typeof cache !== 'object') {
cache = {};
}
return cache ? cache : null;
}
function updateCache(cache, input, data) {
if (!cache) return;
cache[input] = data;
}
function getFromCache(cache, input) {
if (!cache) return;
for (var i = 0; i <= input.length; i++) {
var cacheKey = input.slice(0, i);
if (cache[cacheKey] && (input === cacheKey || cache[cacheKey].complete)) {
return cache[cacheKey];
}
}
}
function thenPromise(promise, callback) {
if (!promise || typeof promise.then !== 'function') return;
promise.then(function (data) {
callback(null, data);
}, function (err) {
callback(err);
});
}
var Async = _react2['default'].createClass({
displayName: 'Async',
propTypes: {
cache: _react2['default'].PropTypes.any, // object to use to cache results, can be null to disable cache
loadOptions: _react2['default'].PropTypes.func.isRequired, // function to call to load options asynchronously
ignoreAccents: _react2['default'].PropTypes.bool, // whether to strip diacritics when filtering (shared with Select)
ignoreCase: _react2['default'].PropTypes.bool, // whether to perform case-insensitive filtering (shared with Select)
isLoading: _react2['default'].PropTypes.bool, // overrides the isLoading state when set to true
loadingPlaceholder: _react2['default'].PropTypes.string, // replaces the placeholder while options are loading
minimumInput: _react2['default'].PropTypes.number, // the minimum number of characters that trigger loadOptions
noResultsText: _react2['default'].PropTypes.string, // placeholder displayed when there are no matching search results (shared with Select)
placeholder: _react2['default'].PropTypes.string, // field placeholder, displayed when there's no value (shared with Select)
searchingText: _react2['default'].PropTypes.string, // message to display while options are loading
searchPromptText: _react2['default'].PropTypes.string },
// label to prompt for search input
getDefaultProps: function getDefaultProps() {
return {
cache: true,
ignoreAccents: true,
ignoreCase: true,
loadingPlaceholder: 'Loading...',
minimumInput: 0,
searchingText: 'Searching...',
searchPromptText: 'Type to search'
};
},
getInitialState: function getInitialState() {
return {
cache: initCache(this.props.cache),
isLoading: false,
options: []
};
},
componentWillMount: function componentWillMount() {
this._lastInput = '';
},
componentDidMount: function componentDidMount() {
this.loadOptions('');
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
if (nextProps.cache !== this.props.cache) {
this.setState({
cache: initCache(nextProps.cache)
});
}
},
resetState: function resetState() {
this._currentRequestId = -1;
this.setState({
isLoading: false,
options: []
});
},
getResponseHandler: function getResponseHandler(input) {
var _this = this;
var _requestId = this._currentRequestId = requestId++;
return function (err, data) {
if (err) throw err;
if (!_this.isMounted()) return;
updateCache(_this.state.cache, input, data);
if (_requestId !== _this._currentRequestId) return;
_this.setState({
isLoading: false,
options: data && data.options || []
});
};
},
loadOptions: function loadOptions(input) {
if (this.props.ignoreAccents) input = (0, _utilsStripDiacritics2['default'])(input);
if (this.props.ignoreCase) input = input.toLowerCase();
this._lastInput = input;
if (input.length < this.props.minimumInput) {
return this.resetState();
}
var cacheResult = getFromCache(this.state.cache, input);
if (cacheResult) {
return this.setState({
options: cacheResult.options
});
}
this.setState({
isLoading: true
});
var responseHandler = this.getResponseHandler(input);
thenPromise(this.props.loadOptions(input, responseHandler), responseHandler);
},
render: function render() {
var noResultsText = this.props.noResultsText;
var _state = this.state;
var isLoading = _state.isLoading;
var options = _state.options;
if (this.props.isLoading) isLoading = true;
var placeholder = isLoading ? this.props.loadingPlaceholder : this.props.placeholder;
if (!options.length) {
if (this._lastInput.length < this.props.minimumInput) noResultsText = this.props.searchPromptText;
if (isLoading) noResultsText = this.props.searchingText;
}
return _react2['default'].createElement(_Select2['default'], _extends({}, this.props, {
isLoading: isLoading,
noResultsText: noResultsText,
onInputChange: this.loadOptions,
options: options,
placeholder: placeholder
}));
}
});
module.exports = Async;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./Select":3,"./utils/stripDiacritics":5}],2:[function(require,module,exports){
(function (global){
'use strict';
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var _react2 = _interopRequireDefault(_react);
var _classnames = (typeof window !== "undefined" ? window['classNames'] : typeof global !== "undefined" ? global['classNames'] : null);
var _classnames2 = _interopRequireDefault(_classnames);
var Option = _react2['default'].createClass({
displayName: 'Option',
propTypes: {
className: _react2['default'].PropTypes.string, // className (based on mouse position)
isDisabled: _react2['default'].PropTypes.bool, // the option is disabled
isFocused: _react2['default'].PropTypes.bool, // the option is focused
isSelected: _react2['default'].PropTypes.bool, // the option is selected
onSelect: _react2['default'].PropTypes.func, // method to handle click on option element
onFocus: _react2['default'].PropTypes.func, // method to handle mouseEnter on option element
onUnfocus: _react2['default'].PropTypes.func, // method to handle mouseLeave on option element
option: _react2['default'].PropTypes.object.isRequired },
// object that is base for that option
blockEvent: function blockEvent(event) {
event.preventDefault();
event.stopPropagation();
if (event.target.tagName !== 'A' || !('href' in event.target)) {
return;
}
if (event.target.target) {
window.open(event.target.href, event.target.target);
} else {
window.location.href = event.target.href;
}
},
handleMouseDown: function handleMouseDown(event) {
event.preventDefault();
event.stopPropagation();
this.props.onSelect(this.props.option, event);
},
handleMouseEnter: function handleMouseEnter(event) {
this.props.onFocus(this.props.option, event);
},
handleMouseMove: function handleMouseMove(event) {
if (this.props.focused) return;
this.props.onFocus(this.props.option, event);
},
render: function render() {
var option = this.props.option;
var className = (0, _classnames2['default'])(this.props.className, option.className);
return option.disabled ? _react2['default'].createElement(
'div',
{ className: className,
onMouseDown: this.blockEvent,
onClick: this.blockEvent },
this.props.children
) : _react2['default'].createElement(
'div',
{ className: className,
style: option.style,
onMouseDown: this.handleMouseDown,
onMouseEnter: this.handleMouseEnter,
onMouseMove: this.handleMouseMove,
title: option.title },
this.props.children
);
}
});
module.exports = Option;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],3:[function(require,module,exports){
(function (global){
'use strict';
Object.defineProperty(exports, '__esModule', {
value: 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 _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var _react2 = _interopRequireDefault(_react);
var _reactDom = require('react-dom');
var _reactDom2 = _interopRequireDefault(_reactDom);
var _reactInputAutosize = (typeof window !== "undefined" ? window['AutosizeInput'] : typeof global !== "undefined" ? global['AutosizeInput'] : null);
var _reactInputAutosize2 = _interopRequireDefault(_reactInputAutosize);
var _classnames = (typeof window !== "undefined" ? window['classNames'] : typeof global !== "undefined" ? global['classNames'] : null);
var _classnames2 = _interopRequireDefault(_classnames);
var _utilsStripDiacritics = require('./utils/stripDiacritics');
var _utilsStripDiacritics2 = _interopRequireDefault(_utilsStripDiacritics);
var _Async = require('./Async');
var _Async2 = _interopRequireDefault(_Async);
var _Option = require('./Option');
var _Option2 = _interopRequireDefault(_Option);
var _Value = require('./Value');
var _Value2 = _interopRequireDefault(_Value);
var Select = _react2['default'].createClass({
statics: { Async: _Async2['default'] },
displayName: 'Select',
propTypes: {
addLabelText: _react2['default'].PropTypes.string, // placeholder displayed when you want to add a label on a multi-value input
allowCreate: _react2['default'].PropTypes.bool, // whether to allow creation of new entries
autofocus: _react2['default'].PropTypes.bool, // autofocus the component on mount
backspaceRemoves: _react2['default'].PropTypes.bool, // whether backspace removes an item if there is no text input
className: _react2['default'].PropTypes.string, // className for the outer element
clearAllText: _react2['default'].PropTypes.string, // title for the "clear" control when multi: true
clearValueText: _react2['default'].PropTypes.string, // title for the "clear" control
clearable: _react2['default'].PropTypes.bool, // should it be possible to reset value
delimiter: _react2['default'].PropTypes.string, // delimiter to use to join multiple values for the hidden field value
disabled: _react2['default'].PropTypes.bool, // whether the Select is disabled or not
escapeClearsValue: _react2['default'].PropTypes.bool, // whether escape clears the value when the menu is closed
filterOption: _react2['default'].PropTypes.func, // method to filter a single option (option, filterString)
filterOptions: _react2['default'].PropTypes.any, // boolean to enable default filtering or function to filter the options array ([options], filterString, [values])
ignoreAccents: _react2['default'].PropTypes.bool, // whether to strip diacritics when filtering
ignoreCase: _react2['default'].PropTypes.bool, // whether to perform case-insensitive filtering
inputProps: _react2['default'].PropTypes.object, // custom attributes for the Input
isLoading: _react2['default'].PropTypes.bool, // whether the Select is loading externally or not (such as options being loaded)
labelKey: _react2['default'].PropTypes.string, // path of the label value in option objects
matchPos: _react2['default'].PropTypes.string, // (any|start) match the start or entire string when filtering
matchProp: _react2['default'].PropTypes.string, // (any|label|value) which option property to filter on
menuStyle: _react2['default'].PropTypes.object, // optional style to apply to the menu
menuContainerStyle: _react2['default'].PropTypes.object, // optional style to apply to the menu container
multi: _react2['default'].PropTypes.bool, // multi-value input
name: _react2['default'].PropTypes.string, // generates a hidden <input /> tag with this field name for html forms
newOptionCreator: _react2['default'].PropTypes.func, // factory to create new options when allowCreate set
noResultsText: _react2['default'].PropTypes.string, // placeholder displayed when there are no matching search results
onBlur: _react2['default'].PropTypes.func, // onBlur handler: function (event) {}
onChange: _react2['default'].PropTypes.func, // onChange handler: function (newValue) {}
onFocus: _react2['default'].PropTypes.func, // onFocus handler: function (event) {}
onInputChange: _react2['default'].PropTypes.func, // onInputChange handler: function (inputValue) {}
onValueClick: _react2['default'].PropTypes.func, // onClick handler for value labels: function (value, event) {}
onMenuScrollToBottom: _react2['default'].PropTypes.func, // fires when the menu is scrolled to the bottom; can be used to paginate options
optionComponent: _react2['default'].PropTypes.func, // option component to render in dropdown
optionRenderer: _react2['default'].PropTypes.func, // optionRenderer: function (option) {}
options: _react2['default'].PropTypes.array, // array of options
placeholder: _react2['default'].PropTypes.string, // field placeholder, displayed when there's no value
searchable: _react2['default'].PropTypes.bool, // whether to enable searching feature or not
simpleValue: _react2['default'].PropTypes.bool, // pass the value to onChange as a simple value (legacy pre 1.0 mode), defaults to false
style: _react2['default'].PropTypes.object, // optional style to apply to the control
value: _react2['default'].PropTypes.any, // initial field value
valueComponent: _react2['default'].PropTypes.func, // value component to render
valueKey: _react2['default'].PropTypes.string, // path of the label value in option objects
valueRenderer: _react2['default'].PropTypes.func, // valueRenderer: function (option) {}
wrapperStyle: _react2['default'].PropTypes.object },
// optional style to apply to the component wrapper
getDefaultProps: function getDefaultProps() {
return {
addLabelText: 'Add "{label}"?',
allowCreate: false,
backspaceRemoves: true,
clearAllText: 'Clear all',
clearValueText: 'Clear value',
clearable: true,
delimiter: ',',
disabled: false,
escapeClearsValue: true,
filterOptions: true,
ignoreAccents: true,
ignoreCase: true,
inputProps: {},
isLoading: false,
labelKey: 'label',
matchPos: 'any',
matchProp: 'any',
multi: false,
noResultsText: 'No results found',
optionComponent: _Option2['default'],
placeholder: 'Select...',
searchable: true,
simpleValue: false,
valueComponent: _Value2['default'],
valueKey: 'value'
};
},
getInitialState: function getInitialState() {
return {
inputValue: '',
isFocused: false,
isLoading: false,
isOpen: false,
isPseudoFocused: false
};
},
componentDidMount: function componentDidMount() {
if (this.props.autofocus) {
this.focus();
}
},
componentDidUpdate: function componentDidUpdate(prevProps, prevState) {
if (prevState.inputValue !== this.state.inputValue && this.props.onInputChange) {
this.props.onInputChange(this.state.inputValue);
}
if (this._scrollToFocusedOptionOnUpdate && this.refs.focused && this.refs.menu) {
this._scrollToFocusedOptionOnUpdate = false;
var focusedDOM = _reactDom2['default'].findDOMNode(this.refs.focused);
var menuDOM = _reactDom2['default'].findDOMNode(this.refs.menu);
var focusedRect = focusedDOM.getBoundingClientRect();
var menuRect = menuDOM.getBoundingClientRect();
if (focusedRect.bottom > menuRect.bottom || focusedRect.top < menuRect.top) {
menuDOM.scrollTop = focusedDOM.offsetTop + focusedDOM.clientHeight - menuDOM.offsetHeight;
}
}
},
focus: function focus() {
if (!this.refs.input) return;
this.refs.input.focus();
},
handleMouseDown: function handleMouseDown(event) {
// if the event was triggered by a mousedown and not the primary
// button, or if the component is disabled, ignore it.
if (this.props.disabled || event.type === 'mousedown' && event.button !== 0) {
return;
}
// prevent default event handlers
event.stopPropagation();
event.preventDefault();
// for the non-searchable select, toggle the menu
if (!this.props.searchable) {
return this.setState({
isOpen: !this.state.isOpen
});
}
if (this.state.isFocused) {
// if the input is focused, ensure the menu is open
this.setState({
isOpen: true,
isPseudoFocused: false
});
} else {
// otherwise, focus the input and open the menu
this._openAfterFocus = true;
this.focus();
}
},
handleMouseDownOnArrow: function handleMouseDownOnArrow(event) {
// if the event was triggered by a mousedown and not the primary
// button, or if the component is disabled, ignore it.
if (this.props.disabled || event.type === 'mousedown' && event.button !== 0) {
return;
}
// If the menu isn't open, let the event bubble to the main handleMouseDown
if (!this.state.isOpen) {
return;
}
// prevent default event handlers
event.stopPropagation();
event.preventDefault();
// close the menu
this.closeMenu();
},
closeMenu: function closeMenu() {
this.setState({
isOpen: false,
isPseudoFocused: this.state.isFocused && !this.props.multi
});
},
handleInputFocus: function handleInputFocus(event) {
var isOpen = this.state.isOpen || this._openAfterFocus;
if (this.props.onFocus) {
this.props.onFocus(event);
}
this.setState({
isFocused: true,
isOpen: isOpen
});
this._openAfterFocus = false;
},
handleInputBlur: function handleInputBlur(event) {
if (document.activeElement.isEqualNode(this.refs.menu)) {
return;
}
if (this.props.onBlur) {
this.props.onBlur(event);
}
this.setState({
inputValue: '',
isFocused: false,
isOpen: false,
isPseudoFocused: false
});
},
handleInputChange: function handleInputChange(event) {
this.setState({
isOpen: true,
isPseudoFocused: false,
inputValue: event.target.value
});
},
handleKeyDown: function handleKeyDown(event) {
if (this.props.disabled) return;
switch (event.keyCode) {
case 8:
// backspace
if (!this.state.inputValue && this.props.backspaceRemoves) {
event.preventDefault();
this.popValue();
}
return;
case 9:
// tab
if (event.shiftKey || !this.state.isOpen) {
return;
}
this.selectFocusedOption();
break;
case 13:
// enter
if (!this.state.isOpen) return;
this.selectFocusedOption();
break;
case 27:
// escape
if (this.state.isOpen) {
this.closeMenu();
} else if (this.props.clearable && this.props.escapeClearsValue) {
this.clearValue(event);
}
break;
case 38:
// up
this.focusPreviousOption();
break;
case 40:
// down
this.focusNextOption();
break;
// case 188: // ,
// if (this.props.allowCreate && this.props.multi) {
// event.preventDefault();
// event.stopPropagation();
// this.selectFocusedOption();
// } else {
// return;
// }
// break;
default:
return;
}
event.preventDefault();
},
handleValueClick: function handleValueClick(option, event) {
if (!this.props.onValueClick) return;
this.props.onValueClick(option, event);
},
handleMenuScroll: function handleMenuScroll(event) {
if (!this.props.onMenuScrollToBottom) return;
var target = event.target;
if (target.scrollHeight > target.offsetHeight && !(target.scrollHeight - target.offsetHeight - target.scrollTop)) {
this.props.onMenuScrollToBottom();
}
},
getOptionLabel: function getOptionLabel(op) {
return op[this.props.labelKey];
},
getValueArray: function getValueArray() {
var value = this.props.value;
if (this.props.multi) {
if (typeof value === 'string') value = value.split(this.props.delimiter);
if (!Array.isArray(value)) {
if (!value) return [];
value = [value];
}
return value.map(this.expandValue).filter(function (i) {
return i;
});
}
var expandedValue = this.expandValue(value);
return expandedValue ? [expandedValue] : [];
},
expandValue: function expandValue(value) {
if (typeof value !== 'string' && typeof value !== 'number') return value;
var _props = this.props;
var options = _props.options;
var valueKey = _props.valueKey;
if (!options) return;
for (var i = 0; i < options.length; i++) {
if (options[i][valueKey] === value) return options[i];
}
},
setValue: function setValue(value) {
var _this = this;
if (!this.props.onChange) return;
if (this.props.simpleValue && value) {
value = this.props.multi ? value && value.map(function (i) {
return i[_this.props.valueKey];
}).join(this.props.delimiter) : value[this.props.valueKey];
}
this.props.onChange(value);
},
selectValue: function selectValue(value) {
if (this.props.multi) {
this.addValue(value);
this.setState({
inputValue: ''
});
} else {
this.setValue(value);
this.setState({
isOpen: false,
inputValue: '',
isPseudoFocused: this.state.isFocused
});
}
},
addValue: function addValue(value) {
var valueArray = this.getValueArray();
this.setValue(valueArray.concat(value));
},
popValue: function popValue() {
var valueArray = this.getValueArray();
if (!valueArray.length) return;
this.setValue(valueArray.slice(0, valueArray.length - 1));
},
removeValue: function removeValue(value) {
var valueArray = this.getValueArray();
this.setValue(valueArray.filter(function (i) {
return i !== value;
}));
this.focus();
},
clearValue: function clearValue(event) {
// if the event was triggered by a mousedown and not the primary
// button, ignore it.
if (event && event.type === 'mousedown' && event.button !== 0) {
return;
}
event.stopPropagation();
event.preventDefault();
this.setValue(null);
this.setState({
isOpen: false,
inputValue: ''
}, this.focus);
},
focusOption: function focusOption(option) {
this.setState({
focusedOption: option
});
},
focusNextOption: function focusNextOption() {
this.focusAdjacentOption('next');
},
focusPreviousOption: function focusPreviousOption() {
this.focusAdjacentOption('previous');
},
focusAdjacentOption: function focusAdjacentOption(dir) {
var options = this._visibleOptions.filter(function (i) {
return !i.disabled;
});
this._scrollToFocusedOptionOnUpdate = true;
if (!this.state.isOpen) {
this.setState({
isOpen: true,
inputValue: '',
focusedOption: this._focusedOption || options[dir === 'next' ? 0 : options.length - 1]
});
return;
}
if (!options.length) return;
var focusedIndex = -1;
for (var i = 0; i < options.length; i++) {
if (this._focusedOption === options[i]) {
focusedIndex = i;
break;
}
}
var focusedOption = options[0];
if (dir === 'next' && focusedIndex > -1 && focusedIndex < options.length - 1) {
focusedOption = options[focusedIndex + 1];
} else if (dir === 'previous') {
if (focusedIndex > 0) {
focusedOption = options[focusedIndex - 1];
} else {
focusedOption = options[options.length - 1];
}
}
this.setState({
focusedOption: focusedOption
});
},
selectFocusedOption: function selectFocusedOption() {
// if (this.props.allowCreate && !this.state.focusedOption) {
// return this.selectValue(this.state.inputValue);
// }
if (this._focusedOption) {
return this.selectValue(this._focusedOption);
}
},
renderLoading: function renderLoading() {
if (!this.props.isLoading) return;
return _react2['default'].createElement(
'span',
{ className: 'Select-loading-zone', 'aria-hidden': 'true' },
_react2['default'].createElement('span', { className: 'Select-loading' })
);
},
renderValue: function renderValue(valueArray, isOpen) {
var _this2 = this;
var renderLabel = this.props.valueRenderer || this.getOptionLabel;
var ValueComponent = this.props.valueComponent;
if (!valueArray.length) {
return !this.state.inputValue ? _react2['default'].createElement(
'div',
{ className: 'Select-placeholder' },
this.props.placeholder
) : null;
}
var onClick = this.props.onValueClick ? this.handleValueClick : null;
if (this.props.multi) {
return valueArray.map(function (value, i) {
return _react2['default'].createElement(
ValueComponent,
{
disabled: _this2.props.disabled,
key: 'value-' + i + '-' + value[_this2.props.valueKey],
onClick: onClick,
onRemove: _this2.removeValue,
value: value
},
renderLabel(value)
);
});
} else if (!this.state.inputValue) {
if (isOpen) onClick = null;
return _react2['default'].createElement(
ValueComponent,
{
disabled: this.props.disabled,
onClick: onClick,
value: valueArray[0]
},
renderLabel(valueArray[0])
);
}
},
renderInput: function renderInput(valueArray) {
var className = (0, _classnames2['default'])('Select-input', this.props.inputProps.className);
if (this.props.disabled || !this.props.searchable) {
if (this.props.multi && valueArray.length) return;
return _react2['default'].createElement(
'div',
{ className: className },
' '
);
}
return _react2['default'].createElement(_reactInputAutosize2['default'], _extends({}, this.props.inputProps, {
className: className,
tabIndex: this.props.tabIndex,
onBlur: this.handleInputBlur,
onChange: this.handleInputChange,
onFocus: this.handleInputFocus,
minWidth: '5',
ref: 'input',
value: this.state.inputValue
}));
},
renderClear: function renderClear() {
if (!this.props.clearable || !this.props.value || this.props.multi && !this.props.value.length || this.props.disabled || this.props.isLoading) return;
return _react2['default'].createElement(
'span',
{ className: 'Select-clear-zone', title: this.props.multi ? this.props.clearAllText : this.props.clearValueText, 'aria-label': this.props.multi ? this.props.clearAllText : this.props.clearValueText, onMouseDown: this.clearValue, onTouchEnd: this.clearValue },
_react2['default'].createElement('span', { className: 'Select-clear', dangerouslySetInnerHTML: { __html: '×' } })
);
},
renderArrow: function renderArrow() {
return _react2['default'].createElement(
'span',
{ className: 'Select-arrow-zone', onMouseDown: this.handleMouseDownOnArrow },
_react2['default'].createElement('span', { className: 'Select-arrow', onMouseDown: this.handleMouseDownOnArrow })
);
},
filterOptions: function filterOptions(excludeOptions) {
var _this3 = this;
var filterValue = this.state.inputValue;
var options = this.props.options || [];
if (typeof this.props.filterOptions === 'function') {
return this.props.filterOptions.call(this, options, filterValue, excludeOptions);
} else if (this.props.filterOptions) {
if (this.props.ignoreAccents) {
filterValue = (0, _utilsStripDiacritics2['default'])(filterValue);
}
if (this.props.ignoreCase) {
filterValue = filterValue.toLowerCase();
}
if (excludeOptions) excludeOptions = excludeOptions.map(function (i) {
return i[_this3.props.valueKey];
});
return options.filter(function (option) {
if (excludeOptions && excludeOptions.indexOf(option[_this3.props.valueKey]) > -1) return false;
if (_this3.props.filterOption) return _this3.props.filterOption.call(_this3, option, filterValue);
if (!filterValue) return true;
var valueTest = String(option[_this3.props.valueKey]);
var labelTest = String(option[_this3.props.labelKey]);
if (_this3.props.ignoreAccents) {
if (_this3.props.matchProp !== 'label') valueTest = (0, _utilsStripDiacritics2['default'])(valueTest);
if (_this3.props.matchProp !== 'value') labelTest = (0, _utilsStripDiacritics2['default'])(labelTest);
}
if (_this3.props.ignoreCase) {
if (_this3.props.matchProp !== 'label') valueTest = valueTest.toLowerCase();
if (_this3.props.matchProp !== 'value') labelTest = labelTest.toLowerCase();
}
return _this3.props.matchPos === 'start' ? _this3.props.matchProp !== 'label' && valueTest.substr(0, filterValue.length) === filterValue || _this3.props.matchProp !== 'value' && labelTest.substr(0, filterValue.length) === filterValue : _this3.props.matchProp !== 'label' && valueTest.indexOf(filterValue) >= 0 || _this3.props.matchProp !== 'value' && labelTest.indexOf(filterValue) >= 0;
});
} else {
return options;
}
},
renderMenu: function renderMenu(options, valueArray, focusedOption) {
var _this4 = this;
if (options && options.length) {
var _ret = (function () {
var Option = _this4.props.optionComponent;
var renderLabel = _this4.props.optionRenderer || _this4.getOptionLabel;
return {
v: options.map(function (option, i) {
var isSelected = valueArray && valueArray.indexOf(option) > -1;
var isFocused = option === focusedOption;
var optionRef = isFocused ? 'focused' : null;
var optionClass = (0, _classnames2['default'])({
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled
});
return _react2['default'].createElement(
Option,
{
className: optionClass,
isDisabled: option.disabled,
isFocused: isFocused,
key: 'option-' + i + '-' + option[_this4.props.valueKey],
onSelect: _this4.selectValue,
onFocus: _this4.focusOption,
option: option,
isSelected: isSelected,
ref: optionRef
},
renderLabel(option)
);
})
};
})();
if (typeof _ret === 'object') return _ret.v;
} else {
return _react2['default'].createElement(
'div',
{ className: 'Select-noresults' },
this.props.noResultsText
);
}
},
renderHiddenField: function renderHiddenField(valueArray) {
var _this5 = this;
if (!this.props.name) return;
var value = valueArray.map(function (i) {
return JSON.stringify(i[_this5.props.valueKey]);
}).join(this.props.delimiter);
return _react2['default'].createElement('input', { type: 'hidden', ref: 'value', name: this.props.name, value: value, disabled: this.props.disabled });
},
getFocusableOption: function getFocusableOption(selectedOption) {
var options = this._visibleOptions;
if (!options.length) return;
var focusedOption = this.state.focusedOption || selectedOption;
if (focusedOption && options.indexOf(focusedOption) > -1) return focusedOption;
for (var i = 0; i < options.length; i++) {
if (!options[i].disabled) return options[i];
}
},
render: function render() {
var valueArray = this.getValueArray();
var options = this._visibleOptions = this.filterOptions(this.props.multi ? valueArray : null);
var isOpen = this.state.isOpen;
if (this.props.multi && !options.length && valueArray.length && !this.state.inputValue) isOpen = false;
var focusedOption = this._focusedOption = this.getFocusableOption(valueArray[0]);
var className = (0, _classnames2['default'])('Select', this.props.className, {
'Select--multi': this.props.multi,
'is-disabled': this.props.disabled,
'is-focused': this.state.isFocused,
'is-loading': this.props.isLoading,
'is-open': isOpen,
'is-pseudo-focused': this.state.isPseudoFocused,
'is-searchable': this.props.searchable,
'has-value': valueArray.length
});
return _react2['default'].createElement(
'div',
{ ref: 'wrapper', className: className, style: this.props.wrapperStyle },
this.renderHiddenField(valueArray),
_react2['default'].createElement(
'div',
{ ref: 'control', className: 'Select-control', style: this.props.style, onKeyDown: this.handleKeyDown, onMouseDown: this.handleMouseDown, onTouchEnd: this.handleMouseDown },
this.renderValue(valueArray, isOpen),
this.renderInput(valueArray),
this.renderLoading(),
this.renderClear(),
this.renderArrow()
),
isOpen ? _react2['default'].createElement(
'div',
{ ref: 'menuContainer', className: 'Select-menu-outer', style: this.props.menuContainerStyle },
_react2['default'].createElement(
'div',
{ ref: 'menu', className: 'Select-menu', style: this.props.menuStyle, onScroll: this.handleMenuScroll, onMouseDown: this.handleMouseDownOnMenu },
this.renderMenu(options, !this.props.multi ? valueArray : null, focusedOption)
)
) : null
);
}
});
exports['default'] = Select;
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./Async":1,"./Option":2,"./Value":4,"./utils/stripDiacritics":5,"react-dom":undefined}],4:[function(require,module,exports){
(function (global){
'use strict';
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var _react2 = _interopRequireDefault(_react);
var _classnames = (typeof window !== "undefined" ? window['classNames'] : typeof global !== "undefined" ? global['classNames'] : null);
var _classnames2 = _interopRequireDefault(_classnames);
var Value = _react2['default'].createClass({
displayName: 'Value',
propTypes: {
disabled: _react2['default'].PropTypes.bool, // disabled prop passed to ReactSelect
onClick: _react2['default'].PropTypes.func, // method to handle click on value label
onRemove: _react2['default'].PropTypes.func, // method to handle removal of the value
value: _react2['default'].PropTypes.object.isRequired },
// the option object for this value
handleMouseDown: function handleMouseDown(event) {
if (event.type === 'mousedown' && event.button !== 0) {
return;
}
if (this.props.onClick) {
event.stopPropagation();
this.props.onClick(this.props.value, event);
return;
}
if (this.props.value.href) {
event.stopPropagation();
}
},
onRemove: function onRemove(event) {
event.preventDefault();
event.stopPropagation();
this.props.onRemove(this.props.value);
},
renderRemoveIcon: function renderRemoveIcon() {
if (this.props.disabled || !this.props.onRemove) return;
return _react2['default'].createElement(
'span',
{ className: 'Select-value-icon',
onMouseDown: this.onRemove,
onTouchEnd: this.onRemove },
'×'
);
},
renderLabel: function renderLabel() {
var className = 'Select-value-label';
return this.props.onClick || this.props.value.href ? _react2['default'].createElement(
'a',
{ className: className, href: this.props.value.href, target: this.props.value.target, onMouseDown: this.handleMouseDown, onTouchEnd: this.props.handleMouseDown },
this.props.children
) : _react2['default'].createElement(
'span',
{ className: className },
this.props.children
);
},
render: function render() {
return _react2['default'].createElement(
'div',
{ className: (0, _classnames2['default'])('Select-value', this.props.value.className),
style: this.props.value.style,
title: this.props.value.title
},
this.renderRemoveIcon(),
this.renderLabel()
);
}
});
module.exports = Value;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],5:[function(require,module,exports){
'use strict';
var map = [{ 'base': 'A', 'letters': /[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g }, { 'base': 'AA', 'letters': /[\uA732]/g }, { 'base': 'AE', 'letters': /[\u00C6\u01FC\u01E2]/g }, { 'base': 'AO', 'letters': /[\uA734]/g }, { 'base': 'AU', 'letters': /[\uA736]/g }, { 'base': 'AV', 'letters': /[\uA738\uA73A]/g }, { 'base': 'AY', 'letters': /[\uA73C]/g }, { 'base': 'B', 'letters': /[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g }, { 'base': 'C', 'letters': /[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g }, { 'base': 'D', 'letters': /[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g }, { 'base': 'DZ', 'letters': /[\u01F1\u01C4]/g }, { 'base': 'Dz', 'letters': /[\u01F2\u01C5]/g }, { 'base': 'E', 'letters': /[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g }, { 'base': 'F', 'letters': /[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g }, { 'base': 'G', 'letters': /[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g }, { 'base': 'H', 'letters': /[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g }, { 'base': 'I', 'letters': /[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g }, { 'base': 'J', 'letters': /[\u004A\u24BF\uFF2A\u0134\u0248]/g }, { 'base': 'K', 'letters': /[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g }, { 'base': 'L', 'letters': /[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g }, { 'base': 'LJ', 'letters': /[\u01C7]/g }, { 'base': 'Lj', 'letters': /[\u01C8]/g }, { 'base': 'M', 'letters': /[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g }, { 'base': 'N', 'letters': /[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g }, { 'base': 'NJ', 'letters': /[\u01CA]/g }, { 'base': 'Nj', 'letters': /[\u01CB]/g }, { 'base': 'O', 'letters': /[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g }, { 'base': 'OI', 'letters': /[\u01A2]/g }, { 'base': 'OO', 'letters': /[\uA74E]/g }, { 'base': 'OU', 'letters': /[\u0222]/g }, { 'base': 'P', 'letters': /[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g }, { 'base': 'Q', 'letters': /[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g }, { 'base': 'R', 'letters': /[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g }, { 'base': 'S', 'letters': /[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g }, { 'base': 'T', 'letters': /[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g }, { 'base': 'TZ', 'letters': /[\uA728]/g }, { 'base': 'U', 'letters': /[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g }, { 'base': 'V', 'letters': /[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g }, { 'base': 'VY', 'letters': /[\uA760]/g }, { 'base': 'W', 'letters': /[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g }, { 'base': 'X', 'letters': /[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g }, { 'base': 'Y', 'letters': /[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g }, { 'base': 'Z', 'letters': /[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g }, { 'base': 'a', 'letters': /[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g }, { 'base': 'aa', 'letters': /[\uA733]/g }, { 'base': 'ae', 'letters': /[\u00E6\u01FD\u01E3]/g }, { 'base': 'ao', 'letters': /[\uA735]/g }, { 'base': 'au', 'letters': /[\uA737]/g }, { 'base': 'av', 'letters': /[\uA739\uA73B]/g }, { 'base': 'ay', 'letters': /[\uA73D]/g }, { 'base': 'b', 'letters': /[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g }, { 'base': 'c', 'letters': /[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g }, { 'base': 'd', 'letters': /[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g }, { 'base': 'dz', 'letters': /[\u01F3\u01C6]/g }, { 'base': 'e', 'letters': /[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g }, { 'base': 'f', 'letters': /[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g }, { 'base': 'g', 'letters': /[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g }, { 'base': 'h', 'letters': /[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g }, { 'base': 'hv', 'letters': /[\u0195]/g }, { 'base': 'i', 'letters': /[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g }, { 'base': 'j', 'letters': /[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g }, { 'base': 'k', 'letters': /[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g }, { 'base': 'l', 'letters': /[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g }, { 'base': 'lj', 'letters': /[\u01C9]/g }, { 'base': 'm', 'letters': /[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g }, { 'base': 'n', 'letters': /[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g }, { 'base': 'nj', 'letters': /[\u01CC]/g }, { 'base': 'o', 'letters': /[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g }, { 'base': 'oi', 'letters': /[\u01A3]/g }, { 'base': 'ou', 'letters': /[\u0223]/g }, { 'base': 'oo', 'letters': /[\uA74F]/g }, { 'base': 'p', 'letters': /[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g }, { 'base': 'q', 'letters': /[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g }, { 'base': 'r', 'letters': /[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g }, { 'base': 's', 'letters': /[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g }, { 'base': 't', 'letters': /[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g }, { 'base': 'tz', 'letters': /[\uA729]/g }, { 'base': 'u', 'letters': /[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g }, { 'base': 'v', 'letters': /[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g }, { 'base': 'vy', 'letters': /[\uA761]/g }, { 'base': 'w', 'letters': /[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g }, { 'base': 'x', 'letters': /[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g }, { 'base': 'y', 'letters': /[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g }, { 'base': 'z', 'letters': /[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g }];
module.exports = function stripDiacritics(str) {
for (var i = 0; i < map.length; i++) {
str = str.replace(map[i].letters, map[i].base);
}
return str;
};
},{}]},{},[3])(3)
}); |
ajax/libs/jqwidgets/12.0.2/jqwidgets-react-tsx/jqxloader/react_jqxloader.umd.js | cdnjs/cdnjs | require('../../jqwidgets/jqxcore');
require('../../jqwidgets/jqxloader');
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
(factory((global.react_jqxloader = {}),global.React));
}(this, (function (exports,React) { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
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
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var JqxLoader = /** @class */ (function (_super) {
__extends(JqxLoader, _super);
function JqxLoader(props) {
var _this = _super.call(this, props) || this;
/* tslint:disable:variable-name */
_this._jqx = JQXLite;
_this._id = 'JqxLoader' + _this._jqx.generateID();
_this._componentSelector = '#' + _this._id;
_this.state = { lastProps: props };
return _this;
}
JqxLoader.getDerivedStateFromProps = function (props, state) {
if (!Object.is) {
Object.is = function (x, y) {
if (x === y) {
return x !== 0 || 1 / x === 1 / y;
}
else {
return x !== x && y !== y;
}
};
}
var areEqual = Object.is(props, state.lastProps);
if (!areEqual) {
var newState = { lastProps: props };
return newState;
}
return null;
};
JqxLoader.prototype.componentDidMount = function () {
var widgetOptions = this._manageProps();
this._jqx(this._componentSelector).jqxLoader(widgetOptions);
this._wireEvents();
};
JqxLoader.prototype.componentDidUpdate = function () {
var widgetOptions = this._manageProps();
this.setOptions(widgetOptions);
this._wireEvents();
};
JqxLoader.prototype.render = function () {
return (React.createElement("div", { id: this._id, className: this.props.className, style: this.props.style }, this.props.children));
};
JqxLoader.prototype.setOptions = function (options) {
this._jqx(this._componentSelector).jqxLoader(options);
};
JqxLoader.prototype.getOptions = function (option) {
return this._jqx(this._componentSelector).jqxLoader(option);
};
JqxLoader.prototype.close = function () {
this._jqx(this._componentSelector).jqxLoader('close');
};
JqxLoader.prototype.open = function (left, top) {
this._jqx(this._componentSelector).jqxLoader('open', left, top);
};
JqxLoader.prototype._manageProps = function () {
var widgetProps = ['autoOpen', 'height', 'html', 'isModal', 'imagePosition', 'rtl', 'text', 'textPosition', 'theme', 'width'];
var options = {};
for (var prop in this.props) {
if (widgetProps.indexOf(prop) !== -1) {
options[prop] = this.props[prop];
}
}
return options;
};
JqxLoader.prototype._wireEvents = function () {
for (var prop in this.props) {
if (prop.indexOf('on') === 0) {
var originalEventName = prop.slice(2);
originalEventName = originalEventName.charAt(0).toLowerCase() + originalEventName.slice(1);
this._jqx(this._componentSelector).off(originalEventName);
this._jqx(this._componentSelector).on(originalEventName, this.props[prop]);
}
}
};
return JqxLoader;
}(React.PureComponent));
var jqx = window.jqx;
var JQXLite = window.JQXLite;
exports.default = JqxLoader;
exports.jqx = jqx;
exports.JQXLite = JQXLite;
Object.defineProperty(exports, '__esModule', { value: true });
})));
|
user_guide/searchindex.js | DarkMochaTechnologies/IdeaLab | Search.setIndex({envversion:42,terms:{represent:[25,110,13,73],mybackup:69,yellow:[6,124],poorli:86,four:[144,82,49,130,50,120,116,125,119],prefix:[82,89,2,29],oldest:125,hate:126,optimize_databas:69,forget:[46,98],whose:29,accur:[0,29,109,146,37,88],aug:86,emailaddress:46,my_control:[96,105],site_url:[91,75,7,29],illustr:[128,91,144],swap:[37,82,89,105,29],up8:86,under:[137,10,89,73,144,29,92,60,30,31,134,104,27,98,126,100,101],up6:86,lord:86,up4:86,up5:86,up2:86,spec:91,myselect:87,up1:86,merchant:71,pg_escape_str:29,kudo:29,everi:[56,48,131,19,141,49,40,73,144,8,134,135,117,105,98,136,38,101],risk:[98,123,29],"void":[132,82,41,7,85,125,88,91,49,92,51,98,100,101,138,139,107,29,110,75,116,37],internet:[30,91,29],mime_typ:92,del_dir:109,stripslash:[130,29],upstream:29,start_cach:[144,29],applicationconfig:120,set_templ:[138,119],rename_t:[70,29],total_seg:[145,29],ci_db_query_build:144,fopen_write_cr:108,email_attachment_unred:29,preg_match:29,csrf_hash:94,raw_data:73,cmd:45,upload:[87,47,96,50,29],previou:[10,51,30,47,29],sri:86,vector:[73,29],red:[137,140,145,125,6,124,9,46,119],wednesdai:119,enjoy:133,mysqli_driv:32,zlib:29,up35:86,abil:[27,29,120,73,117,101],direct:[81,144,29,50,74,75,9,134],str_repeat:[6,130,30,29],enjoi:[57,50],dowload:16,second:[132,0,2,5,93,41,7,82,87,85,44,86,9,46,11,91,129,130,13,51,131,96,6,98,135,72,138,19,139,102,60,21,103,140,143,104,144,107,141,142,23,69,70,29,109,92,30,75,145,76,147,110,101],aggreg:82,clear_var:[103,29],kaliningrad:86,eldoc:74,even:[82,120,7,9,87,46,127,12,49,92,52,134,88,136,59,105,141,27,29,73,44,145,146],hide:29,date_rss:86,item2:[98,30],neg:[120,5,98,29],get_extens:29,item1:98,calcul:[49,37,82,29],poison:29,yoursit:91,blur:39,num_tag_open:56,"new":[0,81,3,5,120,7,134,123,136,44,86,9,46,126,88,47,90,91,129,49,50,143,94,95,96,97,52,53,98,15,16,17,101,56,19,115,66,60,68,104,105,144,107,65,27,67,23,69,70,29,110,30,31,75,145,32,33,34,114,35,61,149,118,148,142,150],net:[29,60,104,134,54,100],ever:[87,125,134],groupid:120,metadata:84,blog_model:72,med:87,elimin:[110,146,29],kilobyt:123,behavior:[0,29],get_month_nam:19,form_button:[87,29],never:[0,129,29,120,110,30,134,104,105,98],last_row:51,here:[0,1,73,5,120,93,87,123,124,44,45,46,11,91,129,49,13,51,131,143,96,6,98,100,72,56,138,19,136,139,142,21,22,103,62,140,68,134,65,27,23,144,29,109,92,30,74,75,146,116,39,37,101,148,119],met:[25,98,60,73],directory_map:[11,29],smtp_timeout:[23,29],ci_calendar:19,path:[11,69,139,29,109,40,72,41,31,83,82,140,85,124,45,89,141,100,127],up45:86,sess_table_nam:[98,30],interpret:29,get_smiley_link:13,forum:[126,136,133,8],row_start:119,anymor:29,characterss:116,loos:[27,48,138,59,120,6],precis:[37,147,31,29],datetim:[91,86,29],"_output":[0,29],niue:86,permit:[0,2,3,40,41,87,123,124,9,46,10,89,63,92,93,6,53,98,100,101,125,59,102,144,143,104,91,107,23,69,70,71,29,73,31,145,76,36,37,119],"_fetch_from_arrai":29,blog_config:7,heading_title_cel:19,"_cooki":[101,30,134,29],portabl:[87,2,75],http_x_client_ip:[101,29],message_kei:132,myanmar:86,get_cooki:[101,85,30,29],another_mark_start:37,invas:29,unix:[19,29,120,60,86,98,101],cell_start:119,strai:29,mysqli:[29,89,141,82,30,32,64,72],newspac:29,cont:23,txt:[69,139,29,102,135,107,100],unit:[47,111,136,86,29],highli:[48,31,100],set_profiler_sect:[77,92],describ:[5,73,120,41,7,123,9,46,126,146,49,13,14,134,136,21,68,106,26,23,144,72,29,31,77,50,119],would:[132,0,81,39,120,7,9,123,87,117,44,86,68,45,46,88,146,89,12,49,130,50,93,14,6,53,98,127,99,56,138,19,142,103,28,105,25,107,27,131,23,144,29,92,72,75,145,34,110,37,134,119],information_about_someth:120,afterward:[123,73,29],get_filenam:[109,29],dnt:29,program:[73,64],call:[136,31,29],asset:[5,134],typo:[3,29],recommend:[142,23,12,29,120,58,103,73,8,146,123,143,134,136,148,100,64],old_nam:70,protect_braced_quot:20,care:[108,0,143,82,60,73,22,25,9,98,141,101],type:[79,5,1,82,120,40,41,31,43,87,85,117,44,86,9,121,11,12,129,130,13,51,95,97,93,134,16,6,114,137,139,102,89,140,144,25,63,147,65,142,28,69,70,29,109,72,74,42,75,76,113,100,36],until:[56,92,29,30,31,85,98,46,37,136],uniqid:29,set_tempdata:[98,29],error_php:65,unescap:29,harden:[100,29],product_id_rul:125,inflect:29,notif:29,error_messag:132,notic:[39,13,120,41,123,124,9,46,91,129,49,92,98,138,19,21,22,144,71,29,110,73,146,116,37,119],unbuffered_row:[51,29],warn:[49,98,120,53,29],glass:125,start_dai:19,exce:46,stdclass:51,wm_opac:49,up7:86,last_tag_clos:56,hold:[73,136,104,29],wma:29,must:[132,0,80,2,3,39,120,93,41,73,87,123,124,86,9,46,126,89,91,72,129,49,13,51,77,143,96,53,98,54,18,138,125,19,60,103,148,140,81,104,105,25,144,107,141,108,23,69,70,29,109,92,30,74,75,34,50,116,37,136,134],composer_autoload:[40,29],sha256:73,join:[120,98,144,29],some_t:[43,51,44],setup:[25,120,54,136],work:[10,136,29],up3:86,krasnoyarsk:86,form_open:[29,22,125,97,87,46,135],sharp:39,undeliv:23,show_other_dai:19,abridg:86,root:[65,0,89,69,136,109,50,93,21,123,98,127,101],a_filter_uri:29,overrid:[108,0,11,29,105,93,94,77,124,27,141],csv_from_result:[69,29],segment_on:82,create_databas:[70,29],num_row:[106,51,29],give:[29,27,73,144,70,57,120,13,41,75,134,85,6,98,138,46,106,136],send_request:91,greater_than_equal_to:46,smtp:[62,23,29],digit:[120,81,51,29],indic:[137,39,10,49,93,29,41,7,120,123,86,125,46,99,141],captcha:29,somefil:109,encypt:73,caution:[73,29],unavail:29,want:[132,0,2,39,40,41,7,31,124,87,46,88,89,12,129,49,130,131,51,143,93,98,127,135,99,100,72,56,138,136,139,59,103,28,104,144,107,73,23,69,70,29,109,110,30,42,75,35,116,117,37,101,78],array_column:[25,29],fieldset:87,mysql_:2,unsign:[98,140,81,70,116],bag:120,read_fil:[109,29],save_queri:[76,77,29],manipul:[84,47,120,29],quot:[137,1,69,82,120,130,20,29,44,87],up575:86,march:29,how:[136,29],enforc:29,hor:49,disappear:39,show_error:[108,74,81,41,29],answer:[130,31],verifi:[143,29,140,98,46,16],"_escape_identifi":29,config:[0,13,5,40,41,87,85,124,44,86,9,127,47,11,142,12,50,93,14,6,100,136,58,89,105,25,144,141,108,27,69,29,109,72,31,75,146,77,117],updat:[82,29,31,44,76,136],lao:86,recogn:[25,29],tablenam:[144,44],some_field_nam:123,after:[29,0,144,70,58,93,50,51,31,146,77,124,130,87,117],altogeth:30,diagram:124,global_xss_filt:29,wrong:[98,123,134,75,29],mark_as_temp:[98,29],offlin:[33,94,95,96,97,52,53,54,55,17,118,115,65,66,67,68,15,30,16,32,112,34,113,114,35,61,148,149,150],random_str:[130,29],mailpath:23,post_imag:6,dbprefix:[65,89,144,72,82,29,44,141],averag:144,allowed_fil:29,util:[84,144,89,12,29],attempt:[0,29,60,75,105,134,101,135,100,88],third:[5,7,87,46,11,129,130,6,98,72,137,19,139,21,22,103,144,142,23,69,29,109,110,30,74,75,76,116],fewer:[89,144,29],username_cal:46,bootstrap:29,greet:91,imposs:[73,104,29],loader:[39,11,69,70,29,40,60,111,32,33,47,105],greek:29,maintain:[10,80,142,29,49,110,30,59,122,104,9,98,126,107,136],environ:[89,31,29],localdomain:29,reloc:29,enter:[137,138],exclus:[109,29],expected_result:138,order:[82,70,29],dblclick:39,wine:124,oper:[108,27,144,29,31,43,100,136],form_submit:[87,125],feedback:98,chunk:110,shorten:[120,116],offici:[122,98,30,29],assing:70,becaus:[0,30,7,8,87,125,46,12,93,18,98,135,100,101,21,104,25,64,108,144,73,75,116],jpeg:[123,92],field_exist:[43,82],privileg:69,affect:[39,12,29,120,30,93,14,82,76,18,144],highlight_phras:[142,29],japan:86,flexibl:[5,48,68,129,29,30,62],vari:[120,29],myfil:[143,103,129],suffix:29,code_to_run:39,cli:29,img:[6,140,23,29],inflector:[83,29],fwrite:29,add_data:107,not_group_start:144,reduce_multipl:[130,29],inadvert:29,better:[27,29,120,73,117,105,9,126,136],or_group_start:144,persist:[137,89,23,82,29,104,98],comprehens:[46,8],hidden:[39,11,0,120,29,22,125,77,87,135],img_url:140,increment_str:[130,29],them:[132,0,50,82,120,40,73,150,125,123,117,86,68,9,46,88,89,90,12,112,49,131,13,93,77,143,94,95,96,97,52,53,148,98,15,16,17,101,56,108,115,144,66,59,135,116,21,103,118,28,105,25,91,110,65,27,67,23,136,70,29,54,30,31,55,32,33,34,113,114,35,36,81,134,149,61],row_end:119,thei:[39,1,73,0,120,93,7,31,82,9,87,45,46,142,12,72,129,49,130,50,51,14,94,95,97,53,98,18,19,136,20,21,62,81,25,91,27,131,23,144,70,29,110,30,74,42,75,37,101],fragment:[81,129],safe:[142,73,63,29,30,42,75,125,98,87,12,135],compress_output:[52,29],"break":[144,29],sqlite3:[30,64,29],db_name:70,get_mim:[108,100,29],"_remove_invisible_charact":29,request_uri:[101,58,29],drop_tabl:[70,29],choic:[73,130,30,7,6,98],grammat:29,mytabl:[144,106,69,31,119],f4v:29,my_mark_start:37,odbc:[89,30,64,29],bonu:9,timeout:[60,23,91,141,82],each:[132,0,131,3,39,120,40,7,82,125,138,124,86,48,87,46,88,11,12,130,50,51,146,133,98,127,137,57,19,116,21,22,103,89,81,25,91,106,107,141,27,23,144,29,110,73,31,77,36,117,37,119],debug:[41,77,12,44,29],went:21,european:86,oblig:7,side:[56,39,131,91,29,120,30,123,144],mean:[39,73,12,86,82,120,124,30,131,22,62,97,52,7,104,125,98,106,136],monolith:78,list:[82,29],wm_vrt_offset:49,saturdai:[19,119],flock:29,ommit:25,extract:[25,23,103,101],tgz:29,depress:6,network:29,goe:[122,30,73,104,29],open:[0,144,10,29,40,72,45,105,27,9,136,127],dst:86,dsn:[89,23,141,29],rewrit:[34,146,29],sprintf:[46,30],got:29,force_download:[69,139,29],forth:142,"_reindex_seg":29,database2_nam:141,is_:29,linear:104,navig:[45,56,135],smtp_host:23,somesit:121,situat:[89,73,144,31,29],quoted_printable_encod:[25,100,29],standard:29,add_drop:69,element:[79,27,131,69,129,103,29,110,30,21,22,39,87,123,137,25,46,119],"_truncat":29,error_url_miss:132,blog_descript:[81,70],memory_usag:[37,92,77],md5:[73,63,29,130,30,134,46],anchor_class:29,angl:49,isp:98,openssl:[30,73],"001_add_blog":81,filter:[93,29],link_tag:[6,29],att:75,mvc:[57,129,72,59,131,126],pagin:[47,11,31,29],prefetch:[51,29],iphon:88,codeignit:29,confus:[110,29],fmt:86,rand:[144,29],rang:[142,49,73,86,126,107],render:[56,0,131,30,29,92,13,74,14,22,21,76,77,128,124,18,110,39,134,135],fetch_directori:29,accent:[142,29],clariti:[120,52,21,86,29],hellip:142,exit_unknown_method:108,restrict:[71,109,123,100,134,78,53],hook:[105,74,29],instruct:[120,40,47,29],alreadi:[132,39,23,69,70,144,29,92,30,98,73,103,43,138,81,116,46,136,107,110],messag:[69,82,29,44,146,45,12,100,136],wasn:[21,29],daylight_sav:86,agre:10,primari:[89,91,70,144,29,82,21,7,43,140,116,98],hood:[27,73],form_label:[87,29],nomin:95,top:[56,39,11,131,29,49,110,50,41,14,46],reverse_nam:51,result_arrai:[144,29,110,51,21,106],downsid:98,cumul:[144,70],master:[49,86,7,136],too:[89,23,29,120,30,134],similarli:[87,98,85,30,132],my_view:29,gilbert:86,john:[91,49,110,87,45,136,119],ci_rout:30,rempath:143,prep_url:[46,75,29],library_src:39,is_doubl:138,namespac:29,tool:29,notice_area:39,albert:137,took:136,user_ag:[32,34,96,29],alpha_numeric_spac:[46,29],sha1:[130,134,63,29],western:86,somewhat:73,local_tim:19,error_:132,crawl:29,technic:[48,131,74,98,134,46],fileperm:109,target:[39,144,82,49,29,75,116,87,107,136],keyword:[120,6,144,29],consequ:96,provid:[132,39,73,82,120,121,41,7,43,123,124,86,125,46,126,88,10,89,63,14,95,6,98,135,101,19,20,22,28,104,134,25,27,23,144,70,71,29,110,30,74,75,145,35,116,78,119],previous_url:19,uri_to_assoc:[145,29],older:[98,30,142,104,29],tree:107,told:[0,46],returned_valu:109,project:[10,89,122,45,126,78,136],matter:[98,37,58],solomon:86,rfc2616:29,entri:[29,91,72,60,30,93,75,6,116],date_rfc1123:86,minut:[98,60,18,86],beginn:73,explicitli:[109,141,75,29],any_in_arrai:27,week_dai:19,ran:[137,22,119],ram:73,mind:[56,137,73,44,104,134,98],auto_clear:23,raw:[138,23,69,29,49,92,60,73,74,98,116,25,46],seed:[73,144,21,29],rar:29,manner:[29,81,73,120,92,30,2,98,136],increment:[19,29,130,60,73,123,104],super_class:120,seen:[128,126,30,116],seem:[120,137,3,18,29],incompat:29,encode_php_tag:[46,63],translate_uri_dash:[93,29],result_object:51,cal_cell_end_oth:19,is_php:[108,100,29],captal:29,is_nul:138,myusernam:[141,72],latter:[120,22],encode_from_legaci:[96,104,29],common_funct:25,thorough:[116,78,29],week_day_cel:19,point2:37,contact:75,transmit:29,data1:110,moscow:86,simplifi:[76,106,82,31,29],set_rul:[46,22,29],endfor:146,trans_complet:[12,82],though:[39,73,29,49,30,7,120,98],option_nam:125,scripto:39,my_arrai:87,legibl:120,unknowingli:134,next_link:[56,29],mario:137,microsecond:[82,29],letter:[29,0,131,104,72,120,130,30,132,86],herebi:71,svg10:6,mdate:86,"_set_uri_str":29,cap:[140,29],everyth:[137,5,73,91,29,30,22,143,125,98],prematur:52,yourdomain:85,tradit:[84,27,72],cal_cell_end:19,simplic:[48,144,72],don:[80,73,82,120,7,86,46,92,93,131,98,135,136,137,19,59,60,62,104,134,141,27,23,29,30,31,44,116],mailtyp:[23,103],doc:[62,14,29],tempdata:29,clean_file_nam:29,flow:[120,47,124,136],blog_author:70,max_width:123,doe:[136,29],dblib:29,dummi:30,declar:[0,70,29,109,138,7,25,120,6,124,105,9,98],probabl:[98,73,31,22],wildcard:[82,144,44,29],item3:98,detriment:31,left:[56,0,142,69,144,39,49,110,131,21,145,120,148,91,135],sum:[144,29],dot:29,class_nam:[28,51,99],reactor:[122,29],visitor:[29,30,52,134,101,88],whitelist:[135,29],random:[137,73,144,29,130,30,140,123,104,45,135],"__ci_var":98,endwhil:146,radiu:137,use_page_numb:[56,29],advisori:[98,30],radio:[87,46,29],earth:29,form_error:[87,46],autoload:[40,27,72,141,29],fennec:29,involv:[10,19,138,49,123,91,99],absolut:[89,143,29,49,102,73,123,87,98],arcfour:73,layout:[80,69,119],acquir:[109,98,122],libari:29,field2:[144,101],menu:[87,46,129,86,29],explain:[57,19,30,98,103,134,123,91,9,46,136],configur:29,apach:[5,123,14,126,101],errantli:29,secretsmittypass:91,wm_pad:49,theme:39,explic:29,rich:[126,78],iconv_en:108,display_respons:91,folder:[0,13,40,45,11,90,50,52,53,15,16,17,18,66,89,140,65,27,67,68,29,109,74,31,32,33,34,35,118,148,149,150],changedir:143,set_head:[119,92,23,75,29],csrf_verifi:29,nasti:22,enable_profil:[77,92],stop:[29,23,144,82,92,37],compli:23,consecut:20,font_path:140,report:29,my_app_index:103,directory_nam:129,tge:29,bat:[120,74],bar:[56,143,120,93,60,92,74,103,117,18,98,9,46,127],first_url:[56,29],emb:[134,23],ietf:29,baz:120,form_hidden:[87,125,29],patch:[101,93,136,29],twice:[144,29],bad:[29,142,73,91,72,30],local_to_gmt:86,septemb:29,steal:98,"_ci_view_fil":29,mssql_get_last_messag:29,guiana:86,odbc_field_:29,urldecod:46,rollback:[12,29],datatyp:[138,91,70],num:[130,6,93,147],mandatori:73,result:[82,2,31,141,29],auto_incr:[81,70,29,21,140,116],fail:[12,29,49,60,73,44,82,96,91,116,46,135,136],themselv:[62,120,28],"_call_hook":29,best:[10,44],subject:[138,23,71,29,121,136],brazil:86,awar:[74,29],set_userdata:98,get_request_head:[101,30,29],new_path:107,databas:29,wikipedia:45,source_dir:[109,11,29],figur:82,"_error_numb":29,mua:29,invalu:120,drawn:29,awai:49,irc:8,approach:136,attribut:[79,70,29,109,30,51,75,125,6,86,87,100],inabl:120,accord:[46,91],socket_typ:60,extend:[45,0,82,29],var_dump:[120,60],column_to_drop:70,session_dummy_driv:98,boss:144,"_execut":29,extens:[27,89,139,129,29,109,40,82,74,140,25,34,9,100],week_row_end:19,html4:6,html5:[6,30,142,29],recent:134,http_raw_post_data:29,natur:[46,144,29],advertis:29,subfold:29,unaffect:29,form_validation_lang:[132,46,29],unfound:29,cop:[91,129],protect:29,accident:29,easi:[56,5,29,73,103,132,96,98,101],howev:[0,30,120,93,7,125,123,124,9,46,126,127,91,49,130,92,51,52,98,100,136,56,138,60,104,105,107,144,110,73,44,117,134],against:[81,144,29,103,116,63],compile_bind:[82,29],logic:[18,82,144,14,29],mydirectori:11,boldlist:6,login:[93,75],browser:[0,92,85,124,45,88,128,129,49,50,14,52,18,98,135,101,139,103,22,21,134,142,131,29,110,30,75,37],com:[0,131,5,120,6,87,85,45,46,126,91,129,130,13,93,97,121,98,101,56,19,140,143,65,23,29,30,31,75,145,76,34,116,39,136,123],col:[87,13],rehash:25,tough:136,debugg:29,log_path:29,set_checkbox:[87,46,29],standardize_newlin:29,height:[137,39,29,49,75,140,123,6],ascii_to_ent:[142,29],wider:49,guid:[28,29,24,9,141,99,136],assum:[73,82,7,87,46,127,89,12,13,131,52,53,56,19,68,104,65,66,67,23,144,29,30,31,44,32,34],"_parse_query_str":29,user_data:[30,148,29],duplic:[92,130,116,29],reciev:121,welcome_messag:[105,103,29],"_request":134,chrome:29,unwant:120,three:[56,23,91,144,29,49,93,20,41,31,22,87,81,44,98,9,46,130,119,134,109],been:[132,39,82,41,124,86,46,63,129,92,51,94,95,96,97,98,100,101,21,103,104,65,81,144,70,29,30,31,113,114,136,119],legend:[49,87],formsuccess:46,plaintext:23,ar_cach:29,trigger:[39,48,5,74,29,41,134,123,124,102,46,135],interest:78,basic:29,clear_attach:23,mytext:139,openssl_random_pseudo_byt:[25,135],hesit:120,quickli:74,up65:86,life:135,rfc5321:29,html_entity_decod:[135,29],unset_userdata:[98,30,29],eastern:86,suppress:[56,120,7,29],magic_quotes_runtim:29,search:[56,5,144,58,130,30,29,75,145,62,44,25,126,101,65,88],anywher:[27,37,77,92,18],lift:141,child:[62,28],"catch":[120,93],suar:6,blog_control:72,ugli:[120,140],east:86,quantiti:[87,125,29],cache_set_path:82,properti:[39,80,81,29,49,92,20,30,125,103,94,120,117,9,98,101],air:119,aim:[30,73],form_upload:87,weren:29,form_validation_:[30,29],get_compiled_upd:[144,29],publicli:[29,13,73,30,7,98],allow_get_arrai:101,aid:29,vagu:136,anchor:[29,39,27,30,75,123,46],opt:[98,126,30],template1:110,form_clos:87,printabl:29,set_delimit:110,somelibrari:120,tabl:[89,82,106,29],toolkit:[126,78],filename2:132,memcach:29,need:[132,0,2,3,39,120,40,7,8,82,9,85,87,5,44,86,45,46,117,123,126,88,128,48,142,12,129,49,13,93,131,94,95,96,97,18,98,127,135,16,72,56,138,125,136,139,58,59,60,89,21,22,103,140,81,144,104,105,91,107,73,27,23,69,141,29,92,30,74,31,75,145,77,113,116,110,124,37,101,134,78,119],marco:29,cond:144,conf:[3,29],wm_shadow_dist:49,tediou:46,master_dim:[49,29],sever:[57,68,91,70,29,82,51,144,62,138,86,105,125,46,148,127],log_date_format:29,disabl:[89,12,29,82,41,31,14,76,146,124,144,100],harmoni:29,incorrectli:29,perform:29,suggest:[27,30,103,29],make:[10,136,70,141,29],db_result:29,camellia:73,fatal:[120,60,93,29],complex:[144,59,131,6,116,46,78],strip_quot:[130,29],split:[57,142,82],chatroom:8,"__set":[98,29],complet:[138,23,12,144,29,49,30,41,103,8,82,142,6,145,116,98,106,119,88],elli:122,prev_link:[56,29],evid:93,http_x_forwarded_for:[101,29],blue:[46,6,124,143,119],rail:122,cache_overrid:124,hand:[87,0,81,46],fairli:[59,98,123,134],rais:[44,29],upload_lang:29,bia:98,techniqu:[134,73,135],dhaka:29,charlim:142,kept:[39,13,29,110,30,104,121,125,98,136,135,101],undesir:134,scenario:46,java:100,post_dat:86,linkifi:75,flush_cach:[144,29],min:[144,29],taint:134,inherit:[0,80,19],stop_cach:[144,29],client:[29,39,89,23,82,30,123],shortli:46,thi:[10,136,29],endif:[125,146],gzip:[69,52,29],programm:[120,126,8],next_row:[51,29],url_suffix:[56,65,75,29],identifi:[82,136,29],just:[137,1,73,82,40,9,87,45,46,12,49,130,97,98,135,101,56,21,22,103,62,81,134,144,27,23,69,70,29,30,74,75],safe_mod:29,wm_font_siz:49,photo:[49,107,139],ordin:75,array_replac:[25,29],up55:86,via:[144,69,70,44,29],stringenc:120,human:[65,5,29,74,75,86,36,46],yet:[12,30,21,22,116,46,100],languag:[11,29,120,40,83,86,105,45,78],previous:[54,29],shoud:7,group_bi:[144,29],xmlhttprequest:29,greenwich:86,expos:[98,29],explictli:56,declin:136,had:[96,30,29],"_end":37,ci_vers:[108,29],is_float:138,x_axi:49,ak_my_design:142,"0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz":140,date_iso8601:[86,29],swap_pr:[89,29],els:[0,120,121,41,123,46,88,12,134,100,101,22,91,144,29,109,30,74,44,145,146,116],ffffff:49,save:[0,23,144,86,129,29,120,93,60,73,41,31,7,125,123,18,104,45],hat:122,transit:[96,6,29],gave:[116,29,8],sanit:[63,29,21,22,134,46,135,100],applic:[0,80,144,105,29,40,82,41,14,31,45,89,24,18,27,9,124,100,141],csprng:25,get_compiled_select:[144,29],hmac_kei:73,preserv:[49,98,116,135,29],disposit:[23,29],regard:[48,19,144,49,41,103,120,134,46,148],exit_unknown_fil:[108,41],lightbox:6,distanc:49,anchor_popup:[75,29],"_parse_request_uri":29,background:[98,140,30,142,29],field_nam:[82,29,51,31,43,123,46],cape:86,database_nam:[89,69],apart:117,measur:[49,50,53],rewrite_short_tag:[34,29],handpick:122,"_csrf_set_hash":29,specif:[89,82,141,29],"_displai":[92,124,29],insert_id:[76,29],arbitrari:[37,91,89,44,29],manual:[89,31,29],get_client_info:2,multiselect:87,night:6,funcion:29,xlarg:87,underli:[98,89,74,82],www:[23,91,29,13,93,75,6,50,116,98,100],right:[56,39,131,91,10,71,0,49,110,29,21,145,125,124,45,144,37,142,78,136],old:[56,140,73,29,92,30,75,134,143,104,98,46,148,64],deal:[132,27,63,71,29,73,82,46,135],negat:[60,29],interv:86,excerpt:116,user_model:72,dead:29,fetchabl:44,born:107,intern:[132,73,29,120,30,51,75,95,34,134,125,98],printer:6,elaps:[37,77,86,82],interf:29,successfulli:[143,29,121,30,41,22,123,116,125,46],password_needs_rehash:25,transmiss:73,less_than_equal_to:46,thu:[46,134,93,91,29],total:[77,82,51,106,29],ico:6,bottom:[65,39,131,29,49,92,77,86],file_get_cont:[109,92,30,29],subclass:[80,29],not_lik:[144,29],raw_nam:123,pmachin:29,equal:[39,144,138,29,46,100,119],word_length:[140,29],rdfa:6,overcom:93,condit:[29,144,71,82,120,30,22,44,98],foo:[138,1,143,29,120,93,60,92,74,103,87,96,117,18,9,98,127],my_tabl:[76,106,51,144,119],localhost:[39,89,91,72,29,98,141],core:[144,29],plu:[87,138,6,75,7],who:[10,72,120,93,105,134],cal_cell_start_todai:19,passwordconfirm:46,name_of_last_city_us:120,someclass:[9,129],insecur:[30,7,29],pose:14,cellpad:[125,138,19,119],add_dir:107,set_alt_messag:23,scrollabl:29,repositori:[132,74,136],post:[137,0,72,29,93,75,77,87,134],"super":[91,29,120,131,103,117,104,9],shuck:142,unsaf:[98,30],um4:86,um7:86,first_tag_clos:56,um1:86,troubl:[30,136],um3:86,um2:86,get_flash_kei:98,invoice_id:144,is_ajax_request:[101,29],um9:86,um8:86,surround:56,reduce_double_slash:[130,29],distinct:[39,144,29],dinner:130,cipher:104,enable_query_str:[56,5,65,29],algo:25,span:[87,142,116,29],commit:[48,136,12,126,29],ci_db_util:[69,103],my_mark_end:37,produc:[56,138,73,12,70,29,30,51,31,75,103,76,96,6,44,86,87,144,106,145,142],match:[0,125,73,144,29,120,131,30,93,103,87,82,25,138,98,9,46,126,72],set_insert_batch:144,email_filed_smtp_login:29,"float":[142,147],encod:[47,29,120,73,75,134,96,111,104,116,25,46,100,101],active_group:[89,30,118],down:[81,49,51,22,120,28,86,87,134],creativ:[126,78],count_al:[76,82,144,29],captcha_id:140,formerli:[144,63,29],wrap:[142,13,29],make_column:[13,119],set_test_item:[138,29],mysql_escape_str:29,ci_typographi:[42,20],git:[38,136],wai:[132,0,73,7,43,123,117,86,45,46,63,129,51,146,18,98,135,100,101,138,59,21,103,62,104,134,91,141,27,81,144,29,109,30,42,77,37,136],"_prep_quoted_print":29,array1:25,post_get:[101,30,29],transform:[44,75,29],additionali:98,avail:[31,29],width:[39,125,140,29,49,75,120,123,6,87],reli:[48,69,70,29,120,30,98],request_method:[101,29],editor:[0,91,129,120,50,7,123,45,46],db_active_rec:[32,29],add_column:[70,29],wav:29,srednekolymsk:86,get_random_byt:[135,29],fork:136,sess_destroi:[98,29],head:29,medium:[87,119],is_cli:[45,101,30,100,29],form:[5,129,29,74,51,121,140,86,27,134,99,136],offer:[25,46,30,84,73],forc:[89,139,58,109,29,75,123,134,126,78],ucfirst:[120,80,30,131,29],forg:29,fore:42,aren:[46,29],sess_driv:[98,30,103,29],upload_path:123,renam:[89,29],nonexistent_librari:103,stand:134,"true":[27,89,51,12,70,29,40,72,41,144,44,43,77,124,74,25,69,100,82,141],something_els:74,table_open:[19,119],reset:29,absent:[37,21],input:[29,72,82,44,105,25,100],function_us:[108,100,29],validation_lang:29,new_nam:70,exact_length:[46,29],heading_row_end:[19,119],filename_bad_char:29,maximum:[142,48,23,144,49,110,73,43,123,18,104,25,46,126],tell:[132,27,89,81,69,70,144,72,49,103,145,62,138,98],independ:[2,144,82,103,125,12],toggl:[19,29],my_articl:5,field3:144,emit:29,trim:[46,130,30,29],up11:86,e_warn:29,featur:[132,0,30,5,120,40,84,124,9,46,47,49,92,51,53,98,141,136,19,60,68,134,144,64,23,69,29,73,31,145,146,148],p7r:29,delete_cach:[18,29],stronger:73,"abstract":[12,29,120,21,84,64],mirror:143,myotherclass:124,futur:[98,30,73,29],some_data:101,uri:[18,82,31,29],input_stream:[101,30,29],cal_row_start:19,exist:[82,70,136,31,29],p7c:29,"_ci_load":29,p7a:29,request:[0,23,144,29,92,30,51,103,77,5,18,93,134,136,100,101],umark_temp:98,stanleyxu:29,p7m:29,check:[69,29,120,102,41,87,121,45,96,124,36,25,134,76,100,136],assembl:144,site_nam:7,mp4:29,is_load:[108,103,7,29],"7zip":29,higher:[49,93,73,41,25,98],download_help:[32,29],when:[0,89,12,70,29,40,74,51,31,44,82,76,18,25,144,141,100,136],refactor:29,active_record:[118,30,29],"_set_head":29,test:[89,82,136,29],presum:[6,73],uri_protocol:[3,29],roll:[81,12,82],realiti:137,is_http:[108,100,29],relat:[63,70,29,120,30,22,123,6,98,3],intend:[56,0,23,144,86,29,49,57,30,98,82,138,116,50,104,27,125,46,127],phoenix:86,benefici:31,get_output:[92,124],image_properti:6,min_height:[123,29],query_toggle_count:[77,29],insensit:[135,92,93,29],intent:[120,98,30],consid:[0,73,19,141,29,40,30,74,42,44,145,82,144,138,98,87,46,37,119,126,110],sql:[89,69,82,29,144,44,76,12,106,64],iso8601:[91,29],idenitif:92,shortnam:29,outdat:134,bitbucket:29,receiv:[0,23,29,103,98,46],known_str:25,longer:[39,73,29,120,30,51,103,96,18,104,98,46,136],furthermor:[120,30,73],function_nam:100,htdoc:[109,134],pseudo:[138,73,19,29,110,92,37,126],withhold:29,dohash:[96,63,29],vietnam:86,ignor:[56,1,73,69,144,29,59,110,20,30,42,81,98,107],cal_novemb:29,time:[82,40,9,75,86,87,72,130,6,18,134,99,100,136,137,140,105,69,29,30,31,44,77],reply_to:23,backward:[29,39,30,0,121,13,51,96,81,104,125,98,101],stick:[73,136],"_data_seek":29,recipi:[121,23,29],concept:[9,98,21,26,138],session_destroi:98,flac:29,chain:[82,70,29],whoever:136,skip:[69,70,29,109,41,51,144,96,87,98],global:[132,3,40,41,7,124,9,46,48,72,134,135,100,101,89,103,98,141,27,29,30,31],focus:48,invent:134,cyril:29,function_trigg:[65,5],unit_test:138,superglob:[98,30,29],seriou:[134,96],set_valu:[87,46,29],archive_filepath:107,blog_titl:[110,81,70],"_insert_batch":29,insert_entri:72,menubar:29,millisecond:39,form_textarea:[87,29],middl:[49,142,29],depend:[89,82,31,44,29],zone:[86,29],pem:29,decim:[46,37,82,29],readabl:[139,29,109,74,120,86,98,136],worth:[98,73],deject:6,certainli:[30,73],decis:[23,104,29],text:[0,144,70,29,74,41,31,45,27,25,134,100],get_the_file_properties_from_the_fil:120,oversight:29,query_str:[3,29],update_str:[76,82,29],sourc:[10,11,143,29,49,73,6,25,126,141,136],string:[89,82,141,29],wm_font_color:[49,29],unfamiliar:22,revalid:92,lru:60,url_encod:100,octob:29,word:[65,5,89,142,29,120,93,30,51,75,140,36,125,37,141],brows:[125,27,98,88],cool:39,set_messag:[46,29],save_handl:98,level:[11,29,120,30,41,6,98,107],did:[0,144,129,29,49,131,41,22,8,120,116,45,136],die:[120,92],hawaii:86,iter:[120,110,60,130,25,119],item:[65,5,144,129,29,40,82,137,146,87,105,47,53,27,9,124,117,130,100],unsupport:29,public_html:143,team:[122,81,29],cooki:[27,134,29],div:[56,39,19,29,74,21,87,46],exit_databas:108,"15t16":86,round:[137,39,6,91],dir:11,prevent:[29,39,73,91,0,120,93,50,41,144,22,140,81,137,75,134,132,135,100,101],slower:98,secrion:73,user_str:25,"_file_mime_typ":29,sign:[10,29],shuffl:27,first_link:[56,29],product_name_saf:[125,29],last_activity_idx:95,myarchiv:107,afghanistan:86,appear:[65,39,73,19,5,49,20,29,93,42,140,18,86,91,46,142],repli:23,scaffold:[65,66,90,3,29,96,34,53],favour:29,current:[132,39,2,82,121,7,43,86,125,46,11,13,51,97,18,100,101,19,103,148,143,144,64,81,69,70,29,92,74,31,75,77,136,38],sinc:[0,82,9,87,46,126,88,12,49,92,52,18,98,135,101,125,59,103,62,104,25,144,107,108,27,69,70,29,110,30,31,75,145],ampersand:1,screenx:75,boost:31,file_path:123,or_not_group_start:144,if_exist:70,burn:137,deriv:[25,73,22],dropdown:87,compos:[40,29],gener:[144,70,82,29,31,84,136],db_backup:29,unauthor:[92,100],french:[132,86],check_exist:102,satisfi:[25,98],add_field:[81,70,29],slow:39,modif:[10,30,94,95,34,97,98],address:[29,121,14,75,6,87,136],myradio:87,along:[91,29,49,92,74,7,123,46],window_nam:75,userguid:29,latest_stuff:107,wait:91,box:[87,98,73,134],insan:53,error_suffix:[46,29],my_email:[9,30],ini_set:120,shift:[31,29],bot:[75,88],"_version":29,odbc_insert_id:29,newfoundland:86,membership:86,"_trans_depth":29,filename_help:96,valid_url:[46,29],commonli:[132,134,46,126,135,78,88],ourselv:30,some_act:123,semant:[120,42,29],regardless:[0,81,29,49,73,44,142,23,101],iana:23,extra:[56,39,73,0,29,21,22,98,87,46],activ:[5,144,29,30,138,76,96,86,125,98,37,126],modul:49,prefer:[70,144,31,141,29],ellislab:[122,30,29],instad:29,paramat:[23,29],ftp_unable_to_remam:29,default_templ:19,visibl:[39,138,29],marker:[49,98,37,29],instal:[89,74,100,29],mobil:[88,29],eccentr:29,regex:[93,29],newslett:87,serpent:73,memori:[0,69,29,51,77,18],sake:[21,72],pref:[69,19],visit:[0,30,91,129,13,131,8,144,123,104,45,46,88],test_mod:82,perm:[109,143],subvers:29,permitted_uri_char:[30,53,29],live:[98,60,14,44],handler:[98,30,93,139,29],form_reset:[87,29],value2:23,value1:23,criteria:[46,93],msg:[104,116],scope:[41,29],australian:86,checkout:125,prep:[87,134,29],heading_previous_cel:19,um5:86,capit:[0,131,72,120,30,36,9],mcrypt_mode_ecb:[104,29],minim:[48,144,59,146,133,134,87,46,126,78],python:74,peopl:[23,93,116,125,134,126,148,78,141],claus:[120,76,144,70,29],array_item:98,enhanc:29,uniquid:29,visual:[49,29],um6:86,list_fil:143,prototyp:[132,89,91,141,72,93,7,145,140,123,124,86,116,9,46,119,118],omsk:86,postgresql:[89,29,30,44,76,98,64],effort:[30,38,133,116],easiest:120,is_imag:[135,123,63,29],fly:[23,29,34,146,96,107],orwher:[96,144,29],graphic:[128,6],auto_link:[75,29],prepar:[137,123,22],pretend:29,judg:62,uniqu:[130,144,29],image_arrai:13,cat:37,json_pretty_print:92,reappear:39,invalid_select:120,is_count:36,whatev:[137,81,82,120,29,103,44,143,75],purpos:[132,48,73,71,29,49,92,30,41,103,75,109,120,86,110,98,101],misc_kei:132,materi:[73,82],object_nam:103,problemat:[30,29],heart:0,validli:121,explor:[57,29,133,30,8],stream:[73,29],"_applic":[60,30,113,114],slightli:[120,142,144],backslash:93,agent:[29,47,23,111,30,95,123,114,134,101],choke:136,crazi:144,abort:[92,41,29],indefinit:10,uruguai:86,unfortun:[134,73,31,100],occur:[29,120,130,74,103,44,14,7],contribut:[10,29],pink:6,alwai:[0,30,39,120,7,87,45,88,11,9,93,94,98,101,60,134,25,70,29,109,73,74,44,145,37,136],differenti:[134,14,29],multipl:[89,136,29],keep_flashdata:[98,29],filename1:132,charset:[82,29,42,87,6,25],ping:141,write:[69,82,29,31,44,76,144,136],set_item:[39,7],purg:93,foreach:[27,23,69,129,120,110,146,51,21,145,43,123,86,125,144,106,126],pure:[9,110,37,51,146],familiar:[56,138,12,129,73,74,146,116,98],tild:134,xhtml:[6,23,29],tbodi:119,clean_str:29,map:[11,131,91,13,93,103],example_field:44,pg_escape_liter:29,http_refer:29,http_x_requested_with:101,max:[43,116,144,29],sql_mode:29,spot:36,usabl:[30,135,100,73],mac:[45,120,88,29],socket:[60,116,29],mymethod:124,query_string_seg:56,"_ci_class":29,mai:[79,0,73,39,120,41,7,31,125,124,48,87,46,88,10,11,91,129,49,82,93,14,132,96,98,127,135,100,21,103,104,134,144,142,131,81,69,70,29,110,30,42,116,117],end:[30,120,7,124,86,46,89,130,92,51,52,98,135,138,104,107,142,143,144,29,73,31,146,116,37],underscor:[0,29,120,93,75,36,134,136],validation_error:[87,46,22],data:[82,29,31,44,43,76,106,141],grow:126,man:29,statu:[39,92,69,29,150,30,41,144,75,82,76,44,98,100],practic:[27,14,44,72],conscious:122,foo_bar:103,stdin:[101,100,29],"_get_ip":29,inform:[10,89,29,31,141,136],"switch":[29,89,73,82,120,30,46,141],preced:[29,120,20,93,86,107],combin:[0,144,29,120,30,51,6,86,87,134,135,101],block:[29,120,110,74,146,77,98,126,136,119],"_clean_input_data":29,callabl:29,tbody_open:119,purifi:30,remove_invisible_charact:[108,100],pipe:[46,123,29],search_path:29,old_encrypted_str:104,approv:[132,135],show_prev_next:29,upload_form:123,increas:[120,98,130,50,29],nbsp:[119,6,30,19,29],or_where_not_in:[144,29],ttl:[98,60,29],get_magic_quotes_gpc:29,file_permiss:[49,29],still:[89,73,29,120,30,21,8,98,25,46,58],mark_as_flash:98,ttf:[49,140],dynam:[5,29,74,31,18,9],entiti:[142,1,63,29,130,20,30,42,6,116,46,135],smitti:91,conjunct:20,newprefix_tablenam:44,group:[89,82,141,29],thank:[98,29],polici:100,form_multiselect:[87,29],"_backup":29,users_model:46,mybutton:87,platform:[89,2,69,29,82,144,62,76,98,12,100,88],window:[136,29,120,60,75,45,101,135,100,88],new_table_nam:70,unset_tempdata:[98,29],intl:29,javascript_loc:39,mail:[23,29,121,30,75,62,87,98],main:[65,0,11,29,109,50,41,80,108,89,117,87,136,127],countabl:36,getfileproperti:120,explanatori:123,non:[142,30,70,29,120,102,20,92,93,96,6,134,25,98,119,100,101],halt:[98,29],jame:144,displai:[89,29,41,13,74,82,76,77,124,18,86,87,134],thumb_mark:49,initi:[89,82,31,29],alt_path:132,or_not_lik:[144,29],date_rfc822:[30,86],safari:[88,29],disappoint:46,ci_cart:125,now:[45,0,29],discuss:[134,131,28,144,99],nor:[30,144,44,73],havingor:29,pastebin:136,term:[56,27,2,73,103,132,9,98],argentina:86,name:[89,2,144,70,29,82,51,31,44,43,76,106,141],mysql_get_client_info:2,opera:29,cellspac:[125,138,19,119],didn:[137,98,30,29],separ:[144,29,120,130,41,75,36,9,141],is_really_writ:[108,100,29],allman:[120,136],januari:[19,29],hijack:[134,135],pizza:6,compil:[91,82,49,29,44,77,144],failov:[89,29],domain:[98,85,101,74,29],"_get_mod_tim":29,img_path:140,cal_cell_no_content_todai:19,cookie_httponli:[98,29],replac:[69,29,44,43,146,25,144],individu:[69,70,29,60,31,106],um95:86,continu:[91,129,29,120,93,22,104,116,46,37],ensur:[137,89,29,120,60,73,103,104,134],redistribut:10,backport:25,significantli:[126,105],viewpath:[108,29],year:[122,19,86,29],min_width:[123,29],happen:[23,129,29,73,31,30,124,98,37,107,136],set_realpath:[102,29],heading_row_start:[19,119],html_escap:[87,108,30,100,29],slide:39,shown:[56,27,131,73,19,144,29,49,110,30,123,75,146,140,77,125,46,37,132,142,150],accomplish:[91,70],referenc:[110,86,29],"3rd":29,space:[134,29],old_fil:143,storag:[82,29],"_remap":[45,0],trans_commit:[12,29],profil:[24,29],mess:105,get_file_properti:120,danijelb:29,tb_data:116,is_int:138,correct:[29,138,143,144,82,120,73,42,76,123,134,46],image_lib:[32,49,11,29],group_two:141,get_head:[92,29],state:[39,48,23,144,0,29,138,18,86,87,98],migrat:[47,111,148,29],ibas:[64,29],xhtml1:6,tmpf:98,cart:[47,29],"_error_messag":29,ajax:[39,101,135,98,29],ident:[0,2,120,7,31,9,85,86,87,46,49,51,96,6,101,125,20,105,108,27,28,144,70,29,110,42,75,145,37],mime:[139,29,109,53,35,100],set_update_batch:[144,29],org:[6,23,29],"byte":[29,120,73,77,147,135],card:[125,73,104],error_str:[46,81],insert_str:[76,140,82,116],reusabl:48,time_refer:[86,29],suffici:98,befor:[0,144,29,105,93,44,43,124,18,27,141,136],nice_d:[86,29],yup:104,modest:29,british:[122,71],unavoid:96,turn:[56,30,12,129,29,13,31,75,145,76,123,143,144,134,87,98,100,101],place:[0,50,82,120,7,134,123,124,9,46,89,91,49,13,93,14,18,98,136,56,138,19,60,21,103,81,105,107,142,23,144,70,29,92,30,31,77,37,148],cal_days_in_month:[86,29],legacy_mod:104,log_messag:[108,41,12,29],okai:120,row_id:125,principl:[9,57],nicknam:91,think:[73,104,136],lambda:124,ci_benchmark:37,loki97:73,directli:[0,30,82,117,9,10,129,130,50,18,134,101,138,128,21,98,144,28,69,70,29,72],ci_lang:[79,132],onc:[132,39,41,125,123,117,9,88,91,49,29,18,133,98,99,101,138,19,20,21,103,140,104,134,106,107,27,143,69,70,72,110,73,31,116,119],arrai:[89,82,141,29],zab:120,housekeep:31,yourself:[132,0,39,120,125,98,136],tag_open:142,fast:[137,39,60,84,18,98],oppos:[30,73,29],happi:6,fiji:86,ruri_to_assoc:[145,29],"__construct":[0,72,120,29,21,96,117,105,9,98,123],size:[137,140,125,91,29,49,73,145,109,123,6,147,134,87,46,119],truncate_t:29,given:[132,125,19,29,49,30,98,103,109,46,116,86,36,25,12,126,145,107,78],twofish:73,silent:[30,29],convent:29,gif:[49,39,123],w43l:29,associ:[0,125,73,19,70,144,29,30,51,31,75,43,76,85,6,124,100,140,87,69,82],bite:39,malform:29,cubrid_affected_row:29,assort:29,max_length:[43,46,142],utliz:144,circl:6,where_in:[144,29],white:[140,29],conveni:[0,81,39,109,40,135,101],my_foo:60,get_package_path:103,especi:98,programat:44,copi:[73,7,9,90,112,49,130,131,94,95,96,97,52,53,54,55,17,118,115,65,66,67,68,71,29,15,30,16,32,33,34,113,114,35,61,136,148,149,150],specifi:[132,0,92,5,93,7,125,123,124,44,86,87,46,88,89,91,129,49,130,82,51,6,137,53,98,100,72,56,19,142,60,103,140,143,104,25,144,107,141,27,23,69,70,29,109,73,75,76,101,119],oci_execut:29,cfb8:73,xhtml11:6,"short":[136,29],enclos:144,mostli:69,full_tag_open:56,necessarili:98,alnum:130,"_compile_queri":29,png:[49,109,123,75,29],imagecr:29,serv:[0,73,91,58,59,92,29,41,31,120,128,101,72],wide:[77,73,101],ciphertext:73,client_nam:123,instanc:[132,82,120,93,31,123,124,9,46,91,130,92,51,96,56,19,103,104,141,142,23,144,70,29,73,42,117,119],form_item_id:79,sha512:73,posix:29,param2:2,param1:2,were:[29,39,73,91,0,6,134,30,135,94,95,81,52,98,87,97,126,54,78],posit:[142,91,70,29,49,60,82,51,25],get_csrf_hash:[94,135],zsh:29,typographi:[83,29],seri:[108,39,29],pre:[91,29,20,92,42,125,46,101],lowest:[23,41],sai:[132,0,2,29,49,72,93,31,73,120,75,104,98,125,46,127],explode_nam:29,upload_success:123,xml_from_result:[69,29],"_prep_q_encod":29,delim:69,ani:[79,0,2,5,120,150,41,43,87,124,44,86,9,90,12,100,130,13,93,77,52,53,134,15,16,17,18,137,108,136,66,140,68,105,141,65,27,67,28,144,29,109,74,31,75,32,33,34,50,35,117,118,148,149,82],month_typ:19,dash:[1,29,93,75,36,134],db2:141,properli:[0,73,144,29,110,30,74,21,44,134,98,150],suhosin:[100,29],post_model:137,exclud:[107,5,23,92,109],num_field:[51,31],seppo:29,page1:144,"_env":29,caus:[39,23,12,29,120,93,30,41,14,82,87,123,124,102,9,98,107,142],"_create_databas":[96,29],engin:[65,5,70,58,110,30,29,75,146,44,98],squar:[46,6],advic:134,alias:[82,93,29],destroi:[125,101,104,29],"_pi":29,note:[144,70,29,51,44,106,141,136],date_rfc2822:86,ideal:46,jefferson:137,take:[0,1,13,82,120,124,44,86,9,46,145,61,91,112,50,93,94,95,96,97,52,53,133,98,54,16,17,101,137,115,116,103,22,140,104,141,65,66,67,68,70,29,109,15,30,31,75,55,32,33,34,113,114,35,36,118,148,149,150,119],advis:[98,73,44,75,64],interior:120,green:[46,6,143,119],wonder:136,bcrypt:134,noth:[56,132,23,142,21,62,52,98,46],getwher:[96,144,29],error_messages_lang:132,realpath:29,begin:[57,50,144,29,120,130,13,18,46,38],sure:[132,0,5,120,9,123,125,12,92,51,94,52,98,19,60,21,22,143,105,107,23,144,72,116,134],incorpor:[59,132],trace:29,normal:[0,50,39,93,7,9,117,86,45,46,128,49,130,92,51,131,18,101,56,138,59,105,142,23,144,29,145,146],"_update_batch":29,mydata2:107,price:[125,126],group_on:141,compress:[107,69,89,52,29],clearer:136,"_assign_to_config":29,abus:29,sublicens:71,pair:[56,19,29,30,51,82,144,37],henc:30,hotfix:136,get_total_dai:[19,29],fetch_class:29,icon:[6,75],exact:[46,30,142],image_res:49,view_fil:29,synonym:[5,126],textarea:[87,13,22,29],view_fold:[50,29],later:[131,81,144,30,21,22,95,98],option_valu:125,escape_like_str:[82,44,29],rotation_angl:49,runtim:[120,135],pattern:[144,29,59,131,93,8,84,134,106],addit:[79,5,30,39,120,93,41,125,87,46,126,88,91,49,13,51,14,132,95,98,137,19,23,70,29,92,73,50,37],mb_strpo:25,axi:49,salt:[25,73],sess_expir:[98,30],gracefulli:141,shop:47,shot:[125,101],signoff:136,uncondit:29,show:[0,144,29,102,13,41,44,86,87,37,106],german:132,pconnect:[89,72,141,29],hmac:29,crime_is_up:145,concurr:30,shoe:[65,0,145,5],permiss:[143,71,49,123,109,34,18,45,98],hack:[63,29,76,124,135,101],threshold:[34,41,29],pull:[6,136,129,86,29],line:[89,69,29,144,146,12,141,136],fifth:125,help:[39,50,120,41,31,43,44,86,46,88,142,91,13,131,96,6,134,135,136,56,20,59,81,108,27,23,69,70,29,74,42,75,145,77,147],exit_user_input:108,userdata:[98,30,29],onli:[132,0,13,39,120,93,41,7,82,87,85,124,44,86,48,9,46,126,123,88,11,91,49,130,50,51,137,6,52,53,121,98,127,135,100,18,56,138,125,136,20,60,89,21,22,62,140,143,73,104,134,25,144,64,142,23,69,70,141,29,109,92,30,74,31,75,116,110,117,37,101,58,119],snack:124,ratio:49,favor:[137,63,78,29],romanian:29,transact:[84,82,29],ini_get:[120,29],xma:125,next_tag_clos:56,black:140,datestr:86,mydata1:107,filectim:29,first:[132,0,2,5,120,93,41,114,7,82,87,85,117,86,9,46,90,12,72,76,130,125,13,51,77,143,94,95,96,97,52,53,118,136,15,16,17,18,101,19,115,139,58,6,103,140,68,134,25,144,106,66,141,65,27,67,23,69,70,29,54,112,30,31,75,55,32,33,34,113,100,35,61,149,37,81,148,142,150],overwritten:[123,30,29],query2:51,over:[39,19,57,49,29,93,21,75,82,120,6,86,87,91,100],mypic:[49,123],nearli:[49,75,125,105,9,78],variou:[27,19,29,123,35,46,107,88],get:[0,73,82,93,41,84,85,124,125,46,47,50,51,96,52,53,134,72,60,106,23,144,29,30,31,44,77],sst:29,imagecreatetruecolor:29,sss:74,secondari:44,isn:[132,137,69,70,29,93,73,41,144,46,101],ssl:[23,143,100,29],cannot:[108,27,89,29,102,73,98,38,136],mypic_thumb:49,neither:[49,73],requir:[89,12,70,29,76,144,106,141,136],truli:126,reveal:[62,39],item_nam:7,output_compress:29,outperform:98,borrow:122,email:[11,29,76,9,106,99],todo_list:[91,129],twelv:119,euro:86,default_control:[0,93,29],ini:[142,29,120,102,146,123,98],ci_cach:60,ent_compat:135,where:[0,82,120,124,86,9,89,129,51,14,18,99,100,136,142,140,25,141,65,27,28,144,29,72,31,44,76],summari:[9,39],wiki:[133,8],msdownload:29,a_long_link_that_should_not_be_wrap:23,smiley_j:[13,29],marquesa:86,password_get_info:25,send_email:[121,30,29],smiley_t:13,"_display_cach":[124,29],my_input:105,calendar:[47,96,29],another_method:28,element_path:39,concern:[125,98,30,135],infinit:29,detect:[81,3,29,49,92,73,75,82,123,25,135,88],"_base_class":29,controller_trigg:[65,5],review:30,auto_head:29,ubiquit:98,label:[79,46,70,87,29],db_pconnect:[82,29],enough:[137,46,73,134],between:[2,120,9,46,126,89,12,49,130,93,14,18,134,100,59,107,23,144,29,110,36,37],my_app:103,"import":[73,8,146,52,104,134,9,98,126],paramet:[2,136,31,29],across:[30,14,73],dir_read_mod:108,assumpt:48,"_clean_input_kei":29,aleutian:86,august:29,parent:[0,28,72,29,105,9],sku_567zyx:125,cycl:[130,23,18],reorgan:29,set_content_typ:[92,29],blog_nam:[70,116],come:[132,39,131,29,40,60,30,93,14,7,84,134,123,110,98,126,135,101],sess_upd:29,unnecessari:107,repertoir:39,fit:71,rsa:29,file_read_mod:108,controller_info:77,pertain:31,config_item:[108,30,100,29],groupbi:[96,144,29],contract:71,inconsist:29,open_basedir:109,improv:29,log_threshold:29,create_link:[56,29],among:[125,98,88,29],undocu:30,frameset:6,color:[137,140,125,142,29,49,30,145,87,6,9,46,119],colspan:[125,19,119],list_field:[43,82,51,29],period:[91,29,20,123,86,125,134,101],pop:75,photo2:23,photo3:23,exploit:[135,29],up13:86,colon:[125,98,146,134,29],example_t:44,parse_exec_var:[92,29],cancel:[144,91],up14:86,consider:[49,29],returned_email:23,damag:[73,71],needlessli:29,"_remove_url_suffix":29,semicolon:[146,135,29],coupl:[48,91,58,29,105,9,46],dynamic_output:49,west:86,rebuild:29,fopen_read:108,mari:119,mark:[29,142,58,30,44,95,77,87,98,37,100],locpath:143,certifi:[10,136],trig:29,thead:119,ci_sha:29,short_open_tag:120,repons:[100,116],decrypt:[134,104],thousand:29,georgia:86,rubi:122,get_id:116,proven:[134,30,73],"_drop_databas":[96,29],thing:[92,120,8,45,46,131,14,134,135,136,19,60,103,22,21,98,144,70,29,30,74,75],repres:[56,5,29,49,93,30,51,21,59,116,25],former:29,those:[132,5,30,120,7,134,125,46,88,91,49,130,92,93,131,94,98,72,56,20,105,29,73,31,136,119],sound:136,blowfish:73,firstnam:[110,91],amend:29,rtype:74,singleton:103,trick:[98,134,29],cast:[120,73,29],netpbm:[49,62,29],is_robot:[88,29],base64:[46,73,91,134],outcom:144,send_success:116,bufferedtext:120,margin:[87,126],show_next_prev:19,assoc_to_uri:145,glanc:47,advantag:[70,120,8,87,104,133,9,98,100,101],protect_identifi:[82,44,29],cache_item_id:60,up9:86,destin:[49,123,143,93],prev_tag_open:56,or_hav:[144,29],list_databas:[69,29],my_dog_spot:36,eras:98,img_width:140,hash:29,blog_id:[81,70],ascii:[142,143,29,140,116,100],ship:125,subtot:125,par:29,ci_image_lib:[49,29],xml_encod:120,author:[120,125,44,71,29],obfusc:75,alphabet:46,intermediari:59,same:[0,2,144,10,141,29,51,45,27,9,136,70],jsmith:91,binari:[143,29,107,73,25,135],html:[5,11,129,29,74,41,86,87,134,100],pad:[49,73,29],file_4:130,raw_output:25,pai:29,document:29,form_fieldset:[87,29],week:[19,86],php_sapi_nam:29,screenshot:136,utf8:[89,118,70,141,105],nest:[144,72,12,103,29],assist:[79,27,1,142,140,29,109,41,74,11,75,130,85,6,137,121,87,134],driver:[89,2,31,141,29],someon:[23,73,140,53,104,125,46],modify_column:[70,29],companion:142,driven:136,capabl:[5,48,29],cache_query_str:29,mani:[89,12,70,130,31,44,122,6,45,134,136],extern:[120,98,135,29],encrypt:[47,89,63,29,130,50,134],rewriterul:5,disallow:[142,135,53,29],return_object:82,sanitize_filenam:[135,63,29],"_ci":29,appropri:[56,10,131,91,29,120,73,41,144,82,76,147,98],new_entri:91,mcrypt_blowfish:104,markup:[39,123,6],page:[106,141,144,31,29],custom_row_object:51,without:[132,0,2,39,120,41,7,9,123,87,124,44,86,45,46,12,49,92,51,98,54,101,102,60,21,103,140,104,134,27,28,144,70,71,29,73,75,77,116,117,37,136],compression_level:107,titl:[13,123,75,46,91,129,130,131,51,6,135,137,21,22,106,144,29,110,72,74,44,116,119],index_kei:25,model:[29,40,45,24,9,117,136,127],get_content_typ:[92,29],dimension:[89,129,29,110,6,124,125,119],insert_batch:[144,29],keyup:39,execut:[82,70,29],mypassword:[46,141,72],rule3:46,rule2:46,rule1:46,allowed_typ:[123,29],directory_separ:29,gd_load:29,"_post":[29,137,72,120,30,140,77,134],"_get_config":29,kill:29,cambodia:86,aspect:[49,19,29],touch:98,monei:137,less_than:[46,29],speed:[39,18,98,29],filter_var:[121,30,29],product_lookup_by_id:93,versu:120,is_cal:[46,29],fh4kdkkkaoe30njgoe92rkdkkobec333:125,except:[5,120,51,7,9,85,86,87,46,49,130,93,96,98,20,60,105,144,70,29,110,30,42,75,145,32,146,37,78,119],param:[29,0,73,69,39,120,30,74,98,103,124,91,9,46,56,119],desktop:[107,91,69,139],non_existent_fil:102,my_shap:137,blob:[98,30],versa:49,img_id:[140,29],constant:[100,29],mb_convert_encod:29,process_:0,word_censor:[142,29],earli:124,gd2:49,hover:39,around:[29,82,120,60,13,44,87,46],code:[136,141,29],read:[131,82,120,8,46,126,72,129,50,96,133,98,99,100,101,57,139,103,22,143,4,134,106,107,27,28,144,29,109,30,31,44,77,37,148],escape_str:[82,44,29],messsag:23,"_convert_text":120,is_allowed_filetyp:29,grid:[140,29],darn:142,mom:[91,129],world:29,js_insert_smilei:[30,29],"_write_cach":0,blackberri:29,whitespac:29,some_funct:[87,2],changelog:29,preg_replace_ev:29,integ:[138,11,144,70,29,49,51,76,120,98,46],server:[89,69,29,82,41,31,14,146,18,141,100,127],set_status_head:[108,92,100,29],benefit:[28,12,120,144,44,86,87,46],photo1:23,bsd:126,either:[39,73,120,123,2,86,46,87,97,91,49,93,96,6,98,135,72,56,138,20,104,144,141,23,69,29,30,31,75,136],cascad:29,output:[69,70,29,44,45,18,25,76],tower:136,nice:[46,22,142],json_unescaped_slash:92,yyyi:86,what:[89,136,31,44,29],affected_row:[76,106,144,29],method_exist:0,juli:29,blog_label:70,http_header:77,refresh:[18,75,29],word_wrap:[142,29],error_db:[65,82],set_new:22,first_row:51,form_help:32,slice:6,caribbean:86,mood:6,easili:[5,92,144,73,21,96,117,104,126],deliveri:[119,29],kml:29,definit:[70,29,30,74,87,117,9],token:[120,92,135,29],protocol:[23,3,58,130,29,75,62,143,98,101],ac3:29,exit:[81,29,120,92,41,9],inject:[123,29],xtea:73,"_parse_cli_arg":29,apostroph:20,complic:98,kmz:29,exp_pre_email_address:120,refer:29,get_last_ten_entri:72,total_item:[125,29],shadow:49,power:[39,131,22],cal_cell_end_todai:19,garbag:98,inspect:125,max_height:123,broken:[134,23,28,29],apantbyigi1bpvxztjgcsag8gzl8pdwwa84:104,fopen_read_write_cr:108,found:[132,0,81,40,41,7,85,124,86,130,92,93,131,98,100,101,60,103,28,134,25,73,23,69,29,30,145,147,116,136,150],mime_content_typ:29,thailand:86,referr:88,appli:[29,136,82,49,30,120,85,98,46,119,134,101],isset:[120,98,101,14,29],earlier:[131,144,129,116,21,22,98,46],callback_:46,src:[6,140,23,29],central:86,greatli:12,discern:[123,29],island:86,previous_row:51,request_filenam:5,exit__auto_max:[108,41],greater:[1,68,120,86,46,100],mcrypt_dev_urandom:[25,73],is_numer:[134,138,29],degre:[49,110,48],intens:[109,42,31],phpdomain:74,reset_queri:[144,29],table_nam:[69,70,82,30,51,44,43,76,106],slash_rseg:145,luck:137,backup:29,processor:42,routin:[27,48,69,29,31,123,134,46],effici:[88,29],max_siz:123,status_cod:41,coupon:125,lastli:[74,145,3,31,91],image_width:123,date_rang:[86,29],quietli:120,super_class_vers:120,strip:[142,23,63,29,130,22,134,116,46],your:[136,29],clipperton:86,call_user_func_arrai:0,unit_test_lang:32,wm_font_path:49,"_detect_uri":29,area:[49,13,93],met_win_open:75,odbc_num_row:29,"_explode_seg":29,overwrit:[123,7,29],xw82g9q3r495893iajdh473990rikw23:125,ci_unit_test:138,start:[82,29],pre_system:124,interfac:[144,29,49,41,45,98,126,78,101],low:[120,142,30,73,29],mbstring:[25,29],ipv6:[46,101,113,29],submiss:[120,140,86,134,46,135],strictli:109,strict:[89,82,29],filter_uri:29,lang:[79,108,132,29,120,30,103,7,46,88],up10:86,programmat:[27,30,81,29],str_replac:120,bsc:110,conclud:98,bundl:[98,74],designfellow:29,"_session":[98,30,29],mb_strlen:[25,29],procedur:[46,27,124,41,29],encrypt_nam:123,cryptograph:[30,135,104,73],openxml:29,conclus:47,sess_expire_on_clos:[98,30,29],orlik:[96,144,29],notat:[49,109,29],mathml:6,possibl:[73,120,117,125,127,48,49,92,93,131,96,53,133,134,136,56,103,21,104,105,144,28,69,29,110,30,31,50,148],"default":[89,12,70,29,51,144,76,69,141,136],error_prefix:[46,29],delete_fil:[109,143,29],lowercas:[29,72,120,30,75,22,104,101],eschew:78,grasp:74,ci_sessions_id_ip:98,embed:[129,29],deadlock:[98,29],remove_spac:123,up12:86,connect:[89,2,29],cbc:[73,29],creat:[10,136,31,141,29],multibyt:29,certain:[65,0,89,30,144,39,40,29,74,31,5,25,134,136],tahiti:86,site_id:70,valid_usernam:46,mode:[89,82,29],strongli:[30,53,64],undergon:29,print_debugg:[23,29],file:[10,136,29],next_url:19,fill:[46,29],incorrect:[87,120,73,103,29],again:[39,73,131,103,46,98],image_typ:123,googl:[138,29],hex:[49,73,63,29],collector:98,bhutan:86,conn_id:[2,31,29],prepend:[144,29,73,103,44,145,85,46,101],field:[89,82,29],valid:[0,89,12,29,93,25,99],collis:[132,29,60,30,103,7,101],rdbm:29,is_unix:86,vanuatu:86,writabl:[29,109,41,31,140,34,18,123,107,100],you:[0,2,3,4,5,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,25,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,45,46,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,74,75,76,77,78,132,81,82,85,86,87,97,88,89,90,91,92,93,94,95,96,6,98,99,100,101,102,103,104,105,106,107,108,109,110,44,112,113,114,115,116,117,118,119,120,123,124,125,126,127,129,130,131,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150],mcrypt_create_iv:[25,135],architectur:[47,80],poor:62,create_kei:73,sequenc:[89,81,29,73,76,6],symbol:[109,102,29],pear:[78,29],multidimension:[87,46,6],track:[41,81,12,98,29],dropbox:136,rsegment:[30,145,29],localhost1:89,typecast:29,reduc:[130,60,134,42,31],deliber:104,ci_zip:107,segment_two:82,redud:30,cookie_domain:[98,3],wm_use_drop_shadow:29,descript:[89,136],session_id:[98,30,29],smtp_user:23,mimic:20,mass:96,potenti:[134,1,28,64,29],up115:86,escap:[76,106,82,29],w3c:[6,86,29],newli:[46,104],unset:[98,30,134,29],"_remove_evil_attribut":29,disp:23,file_upload:11,all:[10,136,29],db_backup_filenam:69,new_field:30,filename_pi:96,lack:[98,30],dollar:[93,29],month:[120,86,29],new_list:119,atlant:86,correl:[124,18],mp3:29,microtim:140,wm_type:49,follow:[0,1,3,5,7,9,11,12,13,18,20,21,22,23,25,26,27,28,29,30,31,35,36,37,39,40,41,42,43,45,46,48,49,52,53,56,57,60,63,65,66,67,68,69,70,71,72,73,74,75,77,79,81,85,86,87,88,90,91,92,93,95,96,6,98,99,101,102,103,105,106,108,109,44,116,117,118,120,121,123,124,128,129,130,131,132,134,135,137,138,139,140,141,142,144,147],alt:[6,23,29],disk:[49,60,73],children:29,abid:50,library_path:49,content:29,iconv:[25,29],number:[82,120,51,83,85,86,89,93,77,6,18,134,100,137,140,25,28,144,70,29,76,146],get_file_info:[109,29],script_nam:29,sess_regenerate_destroi:98,wmv:29,spirit:29,mistakenli:29,init:[65,66,67,68,3,29,90,53],use_sect:[103,7],spearhead:122,queri:[2,31,29],read_dir:[107,29],max_filename_incr:[123,29],cgi:29,introduc:[57,120,21,8,148,100],adapt:[60,144,82],"case":[132,0,80,73,5,120,93,9,123,117,87,46,89,12,49,50,51,121,98,135,99,100,101,125,144,142,60,103,22,104,105,91,110,27,143,69,70,29,109,92,30,75,36,134,150],liter:[134,138,93,29],straightforward:98,ingredi:73,fals:[27,89,100,12,70,29,51,72,41,144,44,43,77,74,93,25,69,82,141],passconf:46,keydown:39,get_new:21,verb:29,mechan:[138,73,70,29,30,124,104,98],verd:86,failur:[132,82,120,7,123,86,125,46,12,49,51,143,98,135,137,144,60,103,81,25,91,107,23,69,70,29,109,73,74,44,145,116,119],veri:[137,120,84,85,124,44,9,46,126,88,48,12,49,131,143,52,98,56,19,103,62,81,144,65,23,69,110,31,75,37],get_clickable_smilei:13,condition:[49,23,91],subsubsubsubsect:74,mysql_set_charset:29,norfolk:86,"_filter_uri":29,my_array_help:27,tag_clos:142,last_nam:91,e_strict:29,emul:[0,98],small:[57,48,23,29,120,73,76,87,126,78,119],require_onc:65,e_notic:29,dimens:49,trans_strict:[12,82],getimages:29,samoa:86,ten:119,"__get":[98,29],my_blog:91,product_lookup:93,sync:29,past:[73,86],zero:[130,73,41,31,145,34,123,98,125,46,78,101],postgr:[76,89,64,29],db_conn:103,pass:[82,136,141,29],overlin:74,further:[0,48,92,57,29,31,6,116,25,98,141],nba:46,log_file_permiss:29,directory_depth:11,kdb:29,wm_shadow_color:[49,29],server_path:109,sub:[74,31,29],trans_rollback:[12,29],sun:[19,86],section:29,abl:[39,29,120,93,73,51,8,121,77,116,9,46,100],brief:[123,73],ci_encrypt:[73,104],delet:[70,82,29,31,44,76],abbrevi:[49,132,19],db_select:[82,141,29],primary_kei:43,intersect:29,is_bool:138,some_method:[0,28,69,70,74,9],ci_migr:[81,29],method:[82,136,70,141,29],contrast:[126,12],full:[132,0,50,39,120,8,84,123,9,126,88,89,63,49,92,96,6,134,127,100,56,138,144,62,91,106,69,29,109,110,31,75,145,37,119],iran:86,agent_str:88,pacif:86,variat:[51,29],where_not_in:[144,29],misspel:29,decid:[101,73,91,29],behaviour:[23,30,29],coco:86,shouldn:[98,30,7],username_check:46,imap_8bit:29,is_allowed_typ:29,is_object:[138,29],ci_pagin:56,strong:[142,73,29,30,125,134,119],modifi:[10,82,29],preserve_filepath:107,valu:[136,29],leav:[138,23,63,29,49,73,22,75,120,97,124,53,134,46],min_length:46,valid_ip:[46,101,29],ahead:51,get_userdata:[132,98],server_info:29,popen:29,observ:29,prior:[81,29,123,68,124,104],amount:[12,49,92,144,77,18,125,46,37,135,126,78],pick:120,action:[39,125,144,71,0,49,29,74,43,87,123,97,124,45,46,135],another_t:31,narrow:134,diamet:137,hash_algo:63,display_error:[82,29],gost:73,intermedi:8,screeni:75,africa:86,example_librari:9,hash_hmac:73,remap:29,deprec:[63,70,29,109,121,13,75,95,96,6,86,130,87,148,64],href:[19,29,110,21,75,6],famili:73,um45:86,demonstr:[142,23,13,22,123,6,107],decrement:[60,19,29],"_start":37,establish:[141,82],trans_off:[12,82],select:[82,29,31,44,43,76,106],metaweblog:91,test_nam:138,ci_env:[14,29],hexadecim:[25,73],helper:29,internation:29,faint:49,two:[0,73,41,7,31,43,87,125,46,127,12,9,130,93,134,136,140,104,105,141,65,27,23,144,29,30,42,77,37],page_titl:129,fall:[25,60],fopen_read_writ:108,autonom:[48,82],res_datatyp:138,taken:[81,38,29],select_max:[144,29],"_object_to_arrai":29,minor:29,more:[79,0,73,5,120,93,41,114,8,87,124,86,45,46,126,48,12,72,129,49,130,50,51,14,95,96,97,148,121,98,6,31,137,57,125,19,142,59,60,89,22,103,62,91,25,63,141,27,131,23,144,29,92,30,42,75,34,113,100,116,37,134],emoticon:13,flaw:[134,29],desir:[79,132,81,144,141,29,120,20,13,51,14,123,143,134,127,78,119],create_thumb:49,hundr:[88,29],mozilla:88,relative_path:135,photoblog:91,flag:[138,144,70,82,29,134,136],driver_name_subclass_2:80,driver_name_subclass_3:80,broke:[136,29],driver_name_subclass_1:80,known:[144,29,30,134,105,25,98,88],mathml1:6,mathml2:6,trans_statu:[82,12,29],cach:29,fopen_write_create_strict:108,"_stringify_attribut":108,town:70,none:[23,19,29,49,82,134,123,81,98,25,69],endpoint:135,suitabl:[120,30,63],hour:[98,86,140],hous:[91,129],list_tabl:[43,82,29],der:29,outlin:104,dev:[25,120,30,135,73],detect_mim:123,orderbi:[96,144,29],remain:[18,140,31,22,29],paragraph:[46,1,29],nine:119,caveat:98,learn:[12,50,93,103,7,133,98,126,78],group_end:144,male:145,explod:120,typograph:42,subclass_prefix:[9,27,34,105],scan:29,up875:86,challeng:126,server_protocol:101,share:[89,19,29,31,98,3,127],"404_overrid":[93,29],accept:[39,73,82,120,86,46,87,97,88,91,130,131,51,6,98,135,100,101,19,140,134,23,144,70,29,110,30,75,116,136,119],sphere:6,minimum:[56,46,123,144],unreli:[100,29],set_row:51,phrase:142,blog_head:110,ci_upload:[123,29],unlucki:134,cours:[73,30,93,104,98,87,46,126],newlin:[23,69,29,120,130,20,42,6,46,101],first_nam:[46,91],secur:[29,14,44,24,105,124,136,100,64],rather:[132,5,82,9,87,46,126,48,12,129,93,95,136,138,89,103,141,70,29,110,30,44,101],anoth:[0,23,12,70,144,29,30,98,7,103,146,134,123,117,91,69,88,107,73],smtp_port:23,perhap:[9,27,105,98,46],fame:98,narrowli:48,some_cooki:101,url_titl:[75,29],"_unseri":29,reject:48,iso:[23,86],csv:29,simpl:[0,30,5,41,84,87,45,46,126,89,91,129,6,98,56,138,19,142,81,104,27,23,144,29,110,73,74,75,116,39,78],needl:[25,27],css:[39,92,142,30,75,6,86,134],"_thumb":49,convert_accented_charact:[142,29],regener:[98,135,29],plant:91,sandwich:86,resourc:[89,12,82,29,51,31,44,117,144],indian:86,whats_wrong_with_css:75,smiley_view:13,show_404:[108,0,29,41,131,93,21,150],variant:132,invok:[65,5,48,28,124,105,46,37,99,101],reflect:[37,29],catalog:93,buffer:[120,23,52,29],mutat:29,subdriv:29,unlink:29,lanka:86,circumst:92,github:136,product_typ:93,system_path:50,footer:[59,131,21,22,129],onto:92,overnight:119,in_particular:120,callback:29,image_height:123,yyyymmddhhiiss:81,hash_equ:[25,29],media:6,stricton:[89,29],set_hash:29,cal_cell_start_oth:19,checkbox:[87,46,136,29],rotat:[49,62,29],no_result:145,migration_vers:81,azerbaijan:86,file_s:123,cook:86,through:[0,28,19,29,130,57,30,51,21,103,85,98,87,91,126,119,135,100,101],reconnect:29,hierarchi:[74,129],fff:49,helo:29,password_hash:25,orig_path_info:29,style:29,overhead:135,ip_address:[29,30,140,113,116,98,101],border:[138,19,29,140,125,119],end_char:[142,116],dbname:[89,141,29],resort:98,bypass:128,number_lang:147,delici:3,might:[132,0,73,5,93,41,8,85,124,46,89,91,129,49,13,51,131,18,98,100,72,138,136,58,21,22,103,140,106,142,23,69,29,109,30,146,101,148,119],alter:[81,70,29,148,30,95,143,113,105,98,135],wouldn:29,ci_db_result:[144,51,82],"return":[0,80,82,93,41,43,9,117,45,51,100,25,144,106,141,27,69,70,29,72,74,44,76],prev_tag_clos:56,than:[79,0,1,73,5,120,93,41,9,124,44,87,127,89,12,129,51,95,100,136,125,142,104,141,27,144,70,29,30,31,75,78],accept_charset:[88,29],file_5:130,sentenc:20,pollut:29,file_1:130,sess_use_databas:30,slight:30,ff0:[142,30],ssss:74,framework:[9,122,105,29],oci8:[64,29],cer:29,compound:[144,29],timezone_menu:[86,29],custom_result_object:51,bigger:140,"_helper":103,redesign:29,table_data:119,set_mod:104,cubrid:[30,64,29],troubleshoot:47,my_cach:60,userid:91,gmt_to_loc:86,authent:29,micro:140,achiev:[0,30,51,18,98],autoinit:29,innodb:[12,70],sha384:73,is_fals:138,fulli:[11,29,120,50,124,18,53],intervent:[92,104],backtrac:29,errata:29,truncat:[142,144,29],do_upload:[123,29],weight:98,needless:29,korea:86,hard:[49,87,73,98,29],addressbook:126,ci_session_dummy_driv:98,crontab:29,realli:[73,12,29,30,31,75,62,44,134,98,126,100,136],playstat:29,finish:[125,143,103],next_tag_open:56,expect:[57,69,29,120,110,131,41,98,138,8,134,123,97,116,9,91,145,135,136],fist:29,todd:144,attachment_cid:[23,29],http:[0,77,41,100,29],db_forg:29,beyond:[48,144],todo:[146,129],orient:27,some_valu:98,ftp:[120,47,29],vladivostok:86,safeti:98,or_lik:[144,29],miss:[89,29,120,75,140,64],nepal:86,form_fieldset_clos:[87,29],publish:[91,71],thirdparamet:86,send_error:116,health:41,add_kei:[81,70,29],print:[142,23,144,29,102,75,146,6,36,45],dir_write_mod:[108,29],bui:125,subsubsect:74,occurr:130,w3school:75,file_nam:[46,123,103,129,29],textil:74,asp:75,proxi:[91,29],mylibrari:30,advanc:[120,57,30,29],create_captcha:140,samara:86,differ:[132,2,120,7,86,125,46,126,88,10,91,49,93,14,98,127,72,56,138,19,21,22,103,143,107,73,23,144,141,29,30,75,37,148,119],asc:144,quick:136,reason:[56,0,89,73,91,144,29,120,130,30,31,44,103,125,52,116,45,98,134,136],base:[5,2,82,45,124,86,87,10,12,130,50,14,6,136,122,139,30,105,144,106,65,69,70,29,109,72,31,75,147,38],believ:98,sku_123abc:125,ask:[136,29],teach:57,phd:110,basi:[135,18,29],thrown:60,"_blank":75,english:[132,142,3,29,32,46,88],omit:[69,144,29,120,30,98,116,125,19],success:[23,12,70,29,109,74,60,82,51,144,7,44,125,69],caption:[119,29],golli:142,get_config:[108,29],csr:29,threat:135,"_error_handl":[108,29],my_sess:103,undergo:29,file_writ:29,assign:[132,27,131,23,69,70,129,29,72,51,21,7,103,144,123,117,44,9,98,37,73],feed:[6,44,29],major:[49,144,74],notifi:23,obviou:[45,136],row_arrai:[106,51,21],feel:[110,96,133],articl:[5,19,82,21,75,45,98,126],lastnam:[110,91],ci_db:103,mod_mim:123,sometim:[43,46,134,69,91],footprint:[48,78],cell_end:119,done:[132,0,131,30,91,29,92,50,74,21,73,77,128,124,133,27,110,98,136,72],least:[29,73,98,134,46,100],directory_trigg:29,form_open_multipart:[87,123,29],stabl:[38,136],init_unit_test:66,use_t:29,guess:[120,29],error_arrai:[46,29],script:[39,82,120,41,9,124,45,46,63,49,92,51,52,98,135,100,101,138,59,134,81,144,29,109,75,116],column_kei:25,interact:[45,73],gpg:29,yekaterinburg:86,construct:[56,57,29,125,117,9],tradition:12,header2:23,stori:98,underlin:74,order_bi:[144,29],statement:[144,70,82,29,44,146,69],cfg:29,dbdriver:[89,141,72],is_arrai:[120,27,138],scheme:[81,131,29],store:29,schema:[89,116,21,81,29],free:[120,98,51,71],adher:[120,78],error_views_path:29,ctype_digit:[134,29],behind:[49,26],compens:29,php_sapi:100,johndo:[87,46,98],count_all_result:[144,29],php_error:[41,29],apppath:[108,109,29],pars:[120,92,13,75,29],logged_in:[98,75],myclass:[56,79,144,120,124,9],grace:29,fred:[130,143,119],king:70,kind:[98,30,41,71,142],cookie_secur:[98,29],aac:29,abr:19,remot:[143,91,29],orhav:[96,29],remov:[144,70,29,14,18,134,100],migration_en:81,dtd:6,jqueri:29,reus:[98,144,21],pragma:92,str:[1,82,120,87,46,63,130,13,135,100,138,20,36,25,142,23,29,42,75,145,76,116],consumpt:51,stale:96,toward:[49,98],beij:86,"_sanitize_glob":29,fixat:98,randomli:[134,140],cleaner:[126,29],comput:[45,144,91],mpeg3:29,deleg:131,strengthen:29,sssss:74,valid_email:[121,46,30,29],favicon:6,packag:[120,95,50,29],is_support:[60,29],sport:46,expir:[29,92,31,140,85,18,98,101],mod_rewrit:5,reset_valid:[46,29],"null":[144,70,82,29,51,25,100],format_numb:125,query_build:[11,30,89,103],option:[132,0,73,3,5,120,93,41,7,87,123,124,86,9,46,126,88,146,89,12,129,101,49,82,51,14,143,6,18,102,98,135,72,56,138,125,19,144,77,60,103,118,68,104,105,25,91,141,65,142,23,69,70,29,109,92,30,74,75,145,34,147,39,81,148,78,119],sell:71,mountain:86,reset_data:144,nozero:130,"_prep_filenam":29,relationship:93,lib:29,remote_addr:98,replyto:23,self:[108,123,29],violat:29,troublesom:29,port:[89,23,91,29,60,143,98],undeclar:142,also:[132,0,50,39,120,93,41,114,73,82,45,85,87,5,44,86,68,9,46,88,146,89,90,12,129,130,13,51,14,143,136,135,52,53,131,98,15,16,17,101,56,125,115,144,59,77,60,61,21,103,118,28,134,25,91,107,65,66,67,23,69,70,29,109,92,30,74,31,75,145,32,33,34,100,35,116,124,81,38,123,119],useless:[76,77,30,29],elapsed_tim:[37,92,82],brace:[120,110,146,20],signup:46,vnd:29,file_typ:123,distribut:[89,71,29,103,98,38],backtrack_limit:29,victim:134,choos:[39,81,12,144,29,49,73,42,75,104,98,46,141],reach:21,chart:47,font_siz:[140,29],most:[73,3,41,134,123,86,9,46,126,88,142,12,49,51,18,98,141,99,138,19,20,59,60,143,104,105,91,107,64,27,23,29,110,30,44,116,119],plai:62,protect_al:1,whether:[132,39,1,92,82,120,41,7,31,43,125,85,86,87,46,88,10,11,12,49,130,13,14,6,52,98,135,100,101,137,138,19,139,102,60,89,22,103,144,143,104,134,25,63,107,141,131,23,69,71,29,109,110,73,74,42,75,116,123],plan:136,myisam:12,last_act:[95,30,98,29],selector:39,charg:71,tonga:86,x11r6:49,clear:[23,29,49,73,31,103,84,30,98,107,78,119],bdb:12,cover:[10,91,8],ci_db_forg:[70,103],roughli:104,ext:[65,29],part:[132,10,1,23,91,27,49,57,29,144,109,120,104,105,25,98,136,107,142,119],clean:[91,129,29,60,30,63,136,135,101],enctyp:123,latest:[81,136,131,29],awesom:131,s_c_ver:120,attach_cid:23,mcrypt_mode_cfb:104,carefulli:[73,148,31,104],alphanumer:29,phooei:142,top_level_onli:[109,96],row_object:51,appver:29,session:[47,89,29,50,77,117,9,16,118],particularli:[12,29,131,93,42,103,126,135],worri:[73,41,86,136],exit_error:[108,41],font:[49,140,29],fine:[45,75],find:[132,0,40,41,7,123,126,88,12,93,52,98,72,137,58,59,91,27,29,110,73,31,146,116,136,148],impact:[96,73],access:[0,2,5,120,93,7,117,9,89,13,51,94,134,100,72,60,30,104,144,106,28,69,70,29,109,73,31,75,77,50,38,78],pretti:[30,101],url_help:27,myutil:69,unattend:98,ruin:29,less:[142,1,29,120,41,48,75,46],solut:[73,110,30,121,25,98,78],is_referr:[88,29],validate_url:[116,29],"public":[0,73,120,9,123,117,45,46,10,89,91,129,13,131,6,98,72,21,22,105,81,144,29,30,50,136,38],couldn:29,templat:[65,47,82,29,41,146,78],factor:[48,30,144,31],"_server":[98,101,30,14,29],i_respond:91,charcter:73,xss:[100,29],unus:[98,29],albeit:137,amount_paid:144,express:[144,29],ffield_nam:29,blank:[23,69,29,49,124,103,75,120,52,53,46,101],nativ:[89,2,12,82,29,51,44,117,105,25,100],ci_log:29,mainten:29,quotes_to_ent:[130,29],xss_clean:[85,63,96,29],liabl:71,post_controller_constructor:[124,29],restart:29,set_capt:119,callback_foo:46,builder:29,repair_t:69,uri_seg:[56,29],date_cooki:86,crt:29,set_dbprefix:[144,44,29],whenev:[120,30,41,31,29],full_tag_clos:56,rfc:[23,86,73,29],common:[12,29],newest_first:125,greater_than:[46,29],empty_t:[144,29],delete_dir:[143,29],set_error:116,crl:29,arr:120,set:[89,12,70,29,82,51,31,44,76,144,106,141,136],blog_templ:110,php_eol:[45,101],backtrack:29,cookie_prefix:[98,85,3,101],organ:[31,29],vinc:137,utf8_en:[108,29],seg:145,simpler:[124,29],see:[39,73,0,120,93,105,7,31,9,123,5,86,45,46,89,12,129,92,51,14,96,53,133,121,98,54,100,101,19,142,60,21,22,103,140,91,63,106,141,27,131,144,70,29,109,30,74,42,75,34,117,134],sec:74,arg:[130,119],reserv:29,horizont:49,flavor:[3,103],php:29,chose:[98,73,104],legend_text:87,simultan:141,mt_rand:130,inconveni:[13,30],someth:[0,50,125,123,124,86,9,46,88,89,91,129,92,93,14,52,98,135,101,56,103,140,107,65,143,144,110,74,75,116,136],particip:126,debat:29,imagejpeg:29,inner:[144,124,29],won:[23,144,73,92,30,51,31,75,77,117,93,98],migration_t:81,source_imag:49,mismatch:29,experi:[62,98],nope:104,compliment:106,altern:29,stored_procedur:29,prefix_singl:82,latin:[134,29],imagemagick:[49,62,29],numer:[11,81,19,29,109,130,30,93,144,125,147,86,134,25,46,101],all_userdata:29,this_string_is_entirely_too_long_and_might_break_my_design:142,javascript:[47,29,13,74,96,75,85,87,134,100],output_paramet:91,isol:29,call_hook:29,some_par:28,sandal:0,cell_alt_end:119,"_create_t":29,raw_input_stream:[101,29],distinguish:120,slash_item:[30,7],date_lang:86,classnam:[39,34],struct:91,verbos:[120,14],both:[73,84,117,125,91,49,13,98,100,136,104,144,107,69,70,29,30,74,75,145,50,101],last:[29,19,82,92,51,103,44,76,146,101],delimit:[23,69,29,30,93,75,123],is_write_typ:[82,29],hyperlink:75,is_natural_no_zero:46,event:[29,31,75,123,7,87,46,101],pg_exec:44,imageid:140,pdo:[89,29,51,76,141,64],add_suffix:132,context:[98,73],forgotten:134,mb_enabl:[25,108,29],pdf:[23,74,29],author_id:76,set_empti:119,whole:[10,30,51,73,29],wm_y_transp:49,load:[69,70,29,51,74,31,117,106,141],xspf:29,markdown:74,simpli:[132,0,73,39,121,41,7,125,123,124,44,9,46,126,127,12,129,49,130,131,95,98,101,56,138,144,103,143,105,91,107,65,27,23,69,29,110,30,31,75,34,116,117,37,136,119],cast5:73,point:[136,144,31,100,29],instanti:[0,48,91,82,29,51,124,98,117,141],schedul:30,format:[27,80,69,29,74,76,146,25,134,136],arbitrarili:46,header:[0,139,129,29,120,75,77,100],fashion:[57,73],littl:[110,138,148,31,116],total_rseg:145,linux:[45,98,88],mistak:[30,29],db_connect:[82,29],csrf_exclude_uri:[135,29],file_exist:131,backend:[60,3,29],expressionengin:[49,122,30],identif:29,unsuccess:12,user_id:144,devic:[120,88,29],create_t:[81,70,29],empti:[0,120,86,46,87,97,88,51,6,135,56,21,144,107,23,69,70,29,75,116,37,119],implicit:29,whom:71,secret:[134,73,104],comment_textarea_alia:13,wm_hor_align:49,your_lang:[147,86],cell_alt_start:119,devis:29,nonexist:29,invis:39,save_path:98,load_class:[108,29],imag:[47,23,63,29,13,123,7,140,96,6,75,134,46,148,149,150,141],array_replace_recurs:[25,29],restrictor:144,sess_save_path:[98,30,29],gap:81,phpdocument:29,coordin:49,understand:[10,12,53,133,91,98],file_write_mod:[108,29],func:[46,29],demand:[30,12],other_db:[69,70],vulner:[30,29],weekdai:19,include_bas:103,foreign_char:[142,96],ignit:29,look:[43,136,44,29],localhost2:89,bill:130,histor:[130,30,73],cluster:[31,104],"_has_oper":29,"while":[73,120,93,41,125,46,11,91,49,51,14,133,98,101,89,81,141,142,23,144,29,109,30,74,146,38],unifi:29,smart:12,abov:[0,50,5,93,7,87,123,124,44,86,9,46,89,142,91,129,49,130,13,51,146,6,137,18,98,141,72,56,138,125,19,136,20,60,21,22,103,118,73,104,105,144,106,107,64,27,23,69,70,71,29,109,110,30,75,76,77,116,39,117,37,101,119],checksum:29,anonym:46,ci_output:92,loop:[120,51,29],javascript_ajax_img:39,subsect:74,real:[23,91,129,29,74,122,37],pound:142,uri_str:[77,145,75,29],nl2br_except_pr:[42,20],readi:[29,49,13,103,133,106],member_ag:144,"3g2":29,pakistan:86,last_link:[56,29],jpg:[142,23,139,49,92,140,123,6,107],password_default:25,itself:[144,29,120,41,73,51,98,46,126,150,136],rid:96,saferplu:73,recompil:107,row_alt_start:119,form_checkbox:[87,29],shirt:[87,125,93],grant:71,limit_charact:116,msexcel:29,belong:30,myconst:120,up95:86,shorter:[46,30],redisplai:46,decod:[29,73,42,96,104,134,135],onclick:87,octal:[49,109,143],date_rfc1036:86,blogview:129,conflict:[81,7,29],bom:120,parse_templ:19,archiv:[30,107,21,29],imagin:131,optim:[31,29],"3gp":29,defeat:6,piec:[91,60,73,21,104,116,98],moment:[37,12],strength:96,mousedown:39,user:[120,93,41,44,86,9,89,13,51,18,134,99,137,140,105,25,28,69,70,29,109,74,31,75,146],"_exception_handl":[108,29],extrem:[62,96,126],repopul:[46,29],robust:[121,23],wherev:18,transitori:104,cilex:74,recreat:[143,107],subpackag:120,travers:[135,11,63],task:[45,27,126,78,98],unicod:[120,29],discourag:[120,30],eleg:28,somet:76,exit__auto_min:[108,41],parenthes:144,honor:29,person:[10,23,71,135,103,123,107],tb_id:116,gambier:86,elev:107,traffic:[91,129],table_exist:[43,82],result_id:[2,31],anybodi:98,full_path:123,predetermin:46,add_package_path:103,ci_secur:[135,63,42,29],ceo:122,"_file":29,rule:[0,29],obscur:[49,73],vietnames:29,shape:[137,6,91],unix_to_tim:86,mysql:[89,69,70,29,82,144,44,76,86,12,141,148,64],love:[126,6],question:[29,130,58,31,44,8,6,133,136],sidebar:129,failsaf:101,move:[50,51,127,29],cut:[51,29],errand:129,point1:37,restructuredtext:74,theoret:73,m4u:29,mydatabas:[141,72],num_link:[56,29],label_text:87,tweak:29,xml_rpc_respons:91,unlik:[27,91,120,60,30,41,75,125,101],subsequ:[39,128,18,103,29],app:[62,37],myothermethod:124,build:[0,89,50,91,5,49,74,30,41,31,75,59,133,93,144,92,127,135,126,78,109],bin:49,australia:86,varchar:[81,70,140,21,95,113,116,98],transpar:[49,92,29],improperli:29,is_writ:100,file_ext_tolow:[123,29],get_post:29,intuit:62,corner_styl:39,nginx:14,game:137,backtick:[44,29],bit:[29,73,82,30,74,104,98,126,135,136],characterist:73,array_pop:27,intel:88,table2:[144,69],table3:144,table1:[144,69],captcha_tim:140,heading_cell_start:119,post_system:124,userfil:123,alpha_numer:46,resolv:[102,136,29],enable_hook:[124,53],collect:[27,31],"boolean":[73,82,120,43,125,123,44,86,87,46,88,11,91,129,49,93,6,53,98,135,100,72,56,138,19,139,89,103,143,144,107,141,65,23,69,29,109,110,30,75,34,116,101],mycustomclass:87,highlight_str:142,password_verifi:25,popular:[98,60,73,12],smtp_crypto:23,word_limit:[142,29],xmlrpc_client:91,encount:[29,30,41,103,146,135,101],mylist:6,often:[89,2,20,120,73,14,8,30,131,98],mcrypt_rijndael_256:104,sess_match_ip:98,fcpath:108,creation:[49,29],some:[132,0,2,39,120,121,41,73,8,43,87,138,5,86,9,46,117,88,10,89,91,129,49,13,93,14,96,52,133,98,135,100,101,56,57,139,142,60,21,22,103,81,105,25,144,141,108,27,131,23,69,29,109,110,30,74,31,75,124,37,134,82],back:[56,81,12,29,60,73,93,31,22,21,82,69,91,25,46,126,135],if_not_exist:70,sampl:[80,70],get_zip:107,error_gener:[65,41],redi:29,phpredi:[98,60],scale:78,chocol:103,culprit:29,sku_965qr:125,exect:29,exec:[100,29],per:[69,18,29],foreign:[69,29],usernam:[132,89,23,91,72,144,146,143,98,87,46,141],substitut:110,larg:[0,23,69,29,120,30,51,145,62,87,9,91,78,119],slash:[131,29,120,130,30,93,7,145,143,124,134],unsanit:44,reproduc:136,newdata:98,machin:81,id_:93,object:[82,2,31,141,29],run:[84,89,2,144,70,29,82,51,31,44,43,76,106],field_id:13,irkutsk:86,raspberri:29,agreement:[47,126],cal_cell_content_todai:19,step:[27,58,50,31,134,136],form_dropdown:[87,29],news_item:21,db_driver:29,prep_for_form:[46,29],concoct:104,victoria:86,mssql:[82,64,29],cautious:104,reduce_linebreak:42,sess_encrypt_cooki:[30,103,29],constraint:[98,81,134,70,29],row:[76,106,82,144,29],extract_url:116,prove:[120,121],highlight_cod:[142,29],manag:29,rowcount:29,idl:[82,141,29],regular:[82,70,29],add_row:119,product_opt:125,mcrypt:[30,29,73,96,104,54],update_entri:[91,72],uncach:144,cookie_path:[98,3],reduct:29,upload_data:123,primarili:57,init_pagin:29,within:[0,2,70,29,74,117,18],pdostat:29,upgrad:[47,134,29],product_edit:93,ci_except:29,jimmi:130,todai:19,alpha:[29,130,134,125,46,101],contributor:122,announc:122,total_queri:82,pcre:29,websit:[98,30,29],inclus:29,institut:[122,71],bangladesh:86,next_prev_url:[19,29],spam:[75,116],fledg:8,proprietari:29,sock:60,stylesheet:[142,6,75,7],"long":[27,23,19,70,29,120,73,140,134,25,98,127,101],custom:29,optimize_t:[69,29],flashdata:[30,104,29],forward:[81,51,30,93,7,145,135],update_post:91,cur_tag_open:56,etc:[39,2,82,120,43,9,117,45,46,88,11,91,129,92,98,135,136,19,142,102,36,89,62,134,141,27,23,144,70,29,73,74,31,76,116],files:109,zealand:86,doctyp:[6,29],repeatedli:73,great:[126,6,136,29],said:[98,30,73],twenti:56,current_url:[75,29],add_insert:69,perman:[120,98,96,104],link:[27,3,29,120,102,13,74,75,6],translat:[109,93,69,70,29],newer:[25,120,64,136,29],atom:[60,86,29],azor:86,ci_form_valid:46,ci_:[9,27,96,105,29],angri:6,info:[63,29,109,41,93,42,75,100],bevel:39,utf:[23,29,120,6,92,103,97,35,116,87,88],consist:[65,10,142,29,138,132,96,98],cid:23,myfield:87,seven:[91,19,119],mod_mime_fix:[123,29],cal_cell_cont:19,highlight:[142,19,29,120,30,74,119],similar:82,curv:133,ci_input:[63,29,30,85,105,101],enlarg:113,exit_success:108,rowid:125,bind:[82,29],trans_start:[12,82],parser:[47,111,120,29,78,136],hash_pbkdf:134,mouseup:39,doesn:[48,50,144,29,121,30,51,131,73,25,146,87,100,134,9,98,37,107,58],dog:[39,37,36],convert_text:120,incomplet:[116,29],oof:120,guarante:[98,135,38],apache_request_head:101,rewritecond:5,gecko:88,bracket:[124,29],another_mark_end:37,anyth:[89,73,29,30,93,75,125,104,87,134,37,136,127],crypt:25,sequenti:[81,29],form_valid:[99,29],water:91,invalid:[19,91,29,49,120,86,98,46,135],id_123:93,smtp_pass:23,setenv:14,librari:[0,80,144,29,40,74,117,105,141,100,136],trans_begin:[12,29],ellipsi:[142,20],xss_filter:30,particular:[132,82,7,43,124,125,46,127,12,129,130,51,98,88,142,144,91,141,27,69,71,72,31,75,76,116,37],is_mobil:[88,29],ctr:73,draw:140,rijndael:73,drop_column:[70,29],elsewher:[125,98],js_library_driv:39,eval:[146,100,29],curtail:116,cal_cell_no_cont:19,smilei:[83,29],um35:86,index_pag:[6,58,75,29],curl:45,algorithm:[63,29,96,104,25,134],vice:49,svg:6,callback_username_check:46,sftp:143,parse_smilei:13,depth:[119,11,73,29],xmlrpc_server:91,key_prefix:[60,29],image_librari:49,far:[46,91,98,82],fresh:[144,30,94,95,96,97],script_head:39,slash_seg:145,scroll:39,set_output:92,oop:[9,132,29],fopen_read_write_create_destruct:108,basic11:6,partial:[119,29],examin:[125,128,91,144],scratch:[126,78],mysql_to_unix:86,rewriteengin:5,ellips:[142,6,29],last_upd:92,urandom:[25,30,135,73],do_hash:[96,63,29],router:[32,128,105,30,29],compact:120,ci_session_driv:98,privat:29,current_us:31,get_mime_by_extens:[109,29],you_said:91,friendli:[65,5,58,73,74,29,75],send:[137,0,69,139,129,29,109,121,30,75,82,120,85,124,87,134,37,141,136],code_start:37,lower:[89,29,130,73,93,75,123,9,100,101],blaze:98,opposit:[39,86],aris:71,function_exist:100,bcc_batch_siz:23,sent:[0,82,121,41,124,46,128,91,92,52,18,98,136,137,139,103,23,70,29,110,116,37],passiv:143,unzip:50,convert_ascii:116,whichev:144,"_plugin":29,vlc:29,plain_text:73,account:[0,101,86,78,29],blog_id_site_id:70,ofb8:73,spoof:29,syntax:[84,141,144,44,29],smtp_keepal:[23,29],relev:[89,42],tri:[135,53,7,58],db_debug:[89,72,141,29],byte_format:[147,29],magic:[98,29],succeed:82,http_client_ip:[101,29],notabl:[30,51,29],non_existent_directori:102,ci_config:[30,75,7,29],lombardi:137,overli:[120,31,29],"try":[89,144,44,29],last_queri:[76,77,82,29],noninfring:71,mysubmit:87,pleas:[0,50,3,4,39,7,31,87,136,86,9,46,126,146,90,63,112,49,13,77,94,95,96,97,52,53,98,141,15,16,17,72,125,115,66,60,92,103,148,118,68,99,104,105,25,106,73,65,27,67,28,144,29,109,54,134,30,42,75,55,32,33,34,113,114,35,61,149,37,101,38,142,150],malici:[134,135],impli:71,constrain_by_prefix:[82,29],cdr:29,set_radio:[87,46,29],myuser:50,anoym:124,cfb:73,encourag:[73,133,29,93,30,51,7,62,75,53,104,116,9,134,106,148,95],crop:[49,62,29],date_atom:[30,86],cron:[45,144],video:29,ci_db_driv:[82,29],download:[69,29],odd:145,click:[27,39,120,13,75,87],"_is_ascii":29,compat:29,index:[108,0,29,51,41,31,14,124,74,105,45,134,106,127],phpdoc:136,sapi:101,compar:[144,29],use_global_url_suffix:[56,29],page2:144,methodolog:124,"_set_overrid":29,cal_cel_oth:19,xor_encod:29,experiment:[39,30],helper3:27,helper2:27,helper1:27,text_watermark:29,this_string_is_:142,bird:37,can:[0,2,5,7,8,9,11,12,13,14,19,20,21,22,28,25,27,23,29,30,31,34,37,39,40,41,42,43,45,46,49,50,51,52,18,56,57,59,60,65,69,70,72,73,74,75,76,77,132,81,82,85,86,87,88,89,91,92,93,95,6,98,99,100,101,103,104,105,106,107,109,110,44,116,117,119,120,123,124,125,126,127,128,129,130,131,134,135,136,137,138,139,140,141,142,143,144,145,146],ci_sessions_timestamp:98,sybas:[30,29],imagepng:29,preg_quot:29,is_cli_request:29,elips:6,len:130,sqlsrv_cursor_stat:29,closur:[124,29],hkk:29,logout:98,blog_name_blog_label:70,session_write_clos:98,safer:[76,144,44],vertic:49,encryption_kei:104,crypt_blowfish:25,design:[5,73,19,29,110,13,44,62,104,125,134,126,119,72],select_avg:[144,29],ineffect:30,metro:145,artifici:134,larger:[49,96,41],technolog:[122,71],alaska:86,mb_substr:25,migration_typ:[81,29],cert:29,ci_pars:110,another_field:[30,70],heading_cell_end:119,"_fetch_uri_str":29,typic:[56,0,11,91,86,129,27,49,93,72,51,31,44,103,59,104,134,125,98,88],set_ciph:104,wm_hor_offset:49,chanc:[137,98,30],field1:[144,101],firefox:29,danger:[100,29],foreign_key_check:[69,29],new_fil:143,approxim:104,base_url:[56,29,75,97,117,7,9],bad_dat:86,standpoint:48,api:[39,91,29,73,14,135],blog:[27,0,81,144,129,72,110,13,93,31,75,103,143,116],oval:6,apc:29,file_ext:123,day_typ:19,blog_set:7,heading_next_cel:19,sorri:98,tailor:[49,56,23,73],cache_expir:0,zip:[47,111,69,29],commun:[89,91,29,122,98,136],ci_control:[108,0,131,81,91,129,72,13,21,96,117,45,46,123],doubl:[1,69,144,29,120,130,20,93,42,87,91],seamless:104,my_arch:107,"throw":29,implic:105,eleven:[142,119],usr:[49,23],clear_data:107,expiri:[98,136],rick:[122,76,44],sort:[125,98,91,145],comparison:[120,138,144,29],wincach:29,error_lang:132,benchmark:[0,105,124,29],about:[82,136,29],balanc:144,wm_text:49,trail:[143,29,130,30,93,7,145,124],from:[2,82,29,31,106,141,136],listen:[98,91],actual:[56,39,131,73,139,29,93,30,41,110,132,121,140,102,25,98,100,64],getter:98,harvest:[19,75,29],focu:[39,126,74,78,57],firebird:[64,69,29],signific:46,retriev:[106,82,31,29],alia:[30,19,144,29,92,13,51,42,75,103,82,130,85,86,98,87,63,136,100,101],critic:134,cumbersom:12,annoi:6,smart_escape_str:29,obvious:2,collat:[89,70,29],meet:[48,120,73,134,46,136],valid_base64:[46,29],has_userdata:[98,29],aliv:29,control:[136,144,31,29],distrubut:98,sqlite:[89,64,29],weaker:73,tap:[124,29],pre_control:124,chosen:[50,12,73,60,30,95,98],process:[12,29,51,76,18,141],lock:[109,98,30,29],tax:31,high:[142,48,29,73,104,116,98],tag:29,entry_id:116,tab:[69,29,120,74,75,135],epallerol:29,sought:144,onlin:12,serial:[31,29],image_size_str:123,everywher:98,surfac:29,is_str:138,filepath:[124,143,107,103],soon:[30,148],tamper:29,six:119,database_exist:[69,29],xml_convert:1,build_str:120,crlf:[23,29],copyright:[49,71],subdirectori:[28,103,29],instead:[0,1,120,43,45,124,86,87,63,9,130,13,93,6,134,139,105,144,141,27,69,70,29,109,31,146,36,117],reestablish:[82,29],zip_fil:107,convers:[29,14,103,20],stock:[95,34],docblock:[120,29],loui:137,likewis:49,prolif:120,overridden:[0,104,29],singular:[48,36,29],interchang:[73,103],watch:[41,21],table_clos:[19,119],act:[131,91,129,29,30,103,85,135,100,101],sundai:[19,86],pasteur:137,my_cached_item:60,attent:[62,29],discard:103,redund:29,dbutil:[69,103],exit_config:108,trim_slash:[130,29],chown:98,some_var:41,drop:29,"20121031100537_add_blog":81,friendlier:85,light:104,m4a:29,robot:[6,88,29],suppress_debug:143,issu:29,webroot:134,days_in_month:[19,86,29],wordwrap:[23,29],allow:[0,73,120,7,87,123,86,9,46,126,48,12,49,130,13,93,146,53,98,135,101,56,138,125,19,144,60,103,81,105,91,65,68,69,29,109,110,30,31,75,145,76,34,147,116,134,119],append_output:[92,29],fallback:[120,30,136,29],per_pag:56,furnish:71,json_encod:92,y_axi:49,include_path:[109,29],screensend:82,cryptographi:73,sess_regener:98,insight:8,optgroup:[87,29],product_id:145,passion:6,comma:[23,69,29,98,116,46,136],gender:145,is_dir:143,georg:137,bunch:30,get_csrf_token_nam:[94,135],enclosur:69,cubird:70,outer:144,reilli:130,pecl:98,wget:45,adjust_d:19,maxlifetim:98,fetch_:30,form_password:87,button:[87,46,29],apache2:102,therefor:[80,29,30,31,98,125,46],pixel:[49,123],img_height:140,double_encod:29,docx:29,fourth:[87,142,23,69,86],handl:29,auto:[141,12,29],remove_package_path:103,overal:29,camino:88,auth:[93,29],p10:29,mention:[98,73,29],p12:29,password_bcrypt:25,overkil:[9,27,105],tbody_clos:119,front:[109,128,29],profiler_no_memori:29,csrf_protect:[135,29],escape_identifi:[82,29],strive:48,models_info:109,another_nam:98,somewher:107,data_to_cach:60,xml:29,edit:[93,75,29],unlimit:70,wm_x_transp:49,tran:6,json_unescaped_unicod:92,ping_url:116,scrollbar:75,myfold:[143,107],mystyl:6,batch:[23,144,29],disregard:68,mycheck:87,error_report:41,register_glob:29,pygment:74,few:[73,19,29,120,30,93,22,8,53,116,25,98,126,136,100,101],yakutsk:86,better_d:86,due:[39,73,69,29,30,144,138,96,98],intellig:[129,29,75,62,7,141],"_lang":132,einstein:137,product:[65,0,89,50,29,30,93,14,7,145,81,5,134,125,98,73],consum:[37,77,29],sha224:73,meta:[43,6,51,29],"static":[47,112,94,95,96,97,52,53,54,55,17,18,57,115,21,65,66,67,68,29,15,30,16,32,33,34,113,114,35,61,118,148,149,150],driver_nam:80,connor:130,our:[48,73,144,103,131,98,30,21,22,8,134,133,116,45,46,126],meth:[23,74],hiddenemail:87,"_after":70,special:[28,91,70,29,98,134,116,87,46,101],out:[108,137,23,91,71,29,49,50,31,22,8,82,120,146,81,134,87,98,136,100,73],variabl:[0,89,69,29,51,146,41,14,44,77,117,27,9,144,141,100,127],set_flashdata:98,reload:46,influenc:73,parse_str:[110,29],hmac_digest:73,some_librari:120,categori:[120,27],thoma:137,clockwis:49,rel:[11,23,72,49,102,29,103,109,123,6,124],inaccess:45,inspir:122,rec:6,plural:[36,29],char_set:[89,118,70,141,29],math:6,random_el:[137,27],ecb:73,insid:[132,28,3,29,110,30,74,144,22,124,105,98,117,107,127],sendmail:[62,23,29],frank:144,msssql:29,sess_cookie_nam:98,umark_flash:98,readm:[98,74],get_var:[103,29],get_wher:[144,21,29],transliter:142,releas:[30,38,100,29],csrf_regener:[135,29],group_id:120,chatham:86,bleed:122,greedi:[120,29],prefix_tablenam:44,marginleft:39,get_day_nam:19,select_sum:[144,29],nowher:102,indent:136,should_do_someth:74,tripled:73,migration_add_blog:81,could:[39,2,120,41,73,45,46,126,127,91,131,52,98,100,136,21,81,70,29,92,30,75,78],lexer:74,put:[0,30,51,45,123,87,46,127,12,129,49,13,93,18,98,101,56,138,58,21,140,134,91,23,144,29,73,31,44,116,37,119],email_lang:132,timer:[0,37,92,44],keep:[31,29],profiler_no_memory_usag:29,length:[142,82,130,29,43,18,25,134],unidentifi:88,wrote:[21,136],outsid:[39,5,73,142,29],url:[0,29,93,45,24,27,9,117,76,100],retain:[98,104,29],do_xss_clean:[96,29],timezon:29,south:86,softwar:[138,71,59,73,41,133],cache_info:60,delete_cooki:[85,29],diplay_error:49,blown:[110,138],blogger:91,ci_ftp:143,qualiti:[49,62,136],echo:[69,70,51,44,43,76,144,106],whoop:131,date:[144,106,72,69,29],proxy_ip:[101,29],submit:[132,87,85,86,46,125,97,10,9,49,130,51,6,53,134,136,19,128,22,140,144,107,141,69,29,31,44,76,123,119],pgp:29,quick_refer:29,owner:[98,134],child_on:28,shortcut:6,facil:136,b99ccdf16028f015540f341130b6d8ec:125,utc:86,prioriti:[23,29,73,41,103,98],forgeri:[134,29],fair:[135,12],timestamp:[81,19,29,30,140,86,98],newus:98,unknown:[146,30],licens:[10,47,29],perfectli:0,mkdir:[98,143],system:[89,12,29,40,31,44,144,136],wrapper:[60,51,82],avoid:[132,23,29,120,60,30,7,145,123,98,87,46,101],attach:[62,138,23,29],attack:[29,73,22,123,134,98,135,101],physic:23,which:[0,2,3,39,120,93,73,8,87,138,5,44,86,68,9,46,126,127,48,12,129,101,49,130,50,51,14,95,53,148,98,141,135,100,18,56,57,125,19,136,139,142,60,89,103,140,23,104,91,25,63,107,110,27,131,28,144,29,92,30,31,75,145,76,77,35,116,81,134,119],termin:[45,116,100,75,29],erron:29,"final":[0,142,124,29],ipv4:[46,101],find_migr:81,haystack:[25,27],lot:[51,42,22,105,98,135],big:29,subsubsubsect:74,fetch_method:29,col_arrai:13,third_parti:29,shall:71,accompani:30,essenti:136,ogg:29,exactli:[144,70,29,49,110,93,104,98,9,46,101],haven:[46,73,103,22,98],kamchatka:86,rss:[59,6,86],prune:45,detail:[39,73,91,29,49,60,30,41,14,7,103,62,120,85,53,134,9,98,106,96,126],jsref:75,structur:[84,29],charact:[1,73,82,120,86,87,46,88,89,49,130,92,93,6,53,98,135,100,101,20,22,104,134,25,142,23,69,70,29,109,30,74,42,75,113,35,116],claim:71,your_str:56,htaccess:[5,29,109,50,14,134,126],session_data:[98,77],sens:[59,27,30,29],becom:[56,5,48,23,19,27,49,73,103,75,120,131,135,119],sensit:[98,80,69,134,29],foobarbaz:60,signifi:140,stricter:135,pgsql:89,accept_lang:[88,29],send_error_messag:91,"function":[136,29],counter:49,codeignitor:29,faster:[110,73,75,52,98,126,78],terribl:[46,86],falsi:87,explicit:[120,29],basepath:[65,108,81,19,29,103,9],respons:[81,129,29,92,41,31,75,116],clearli:120,correspond:[132,3,120,40,7,123,46,91,129,49,130,13,93,98,99,19,21,22,4,110,31,145,77],sufix:56,corrupt:29,have:[0,3,5,6,7,8,9,10,12,13,14,15,16,17,118,19,21,22,23,25,28,29,30,31,32,33,34,35,39,41,42,43,46,48,49,51,52,53,54,55,56,116,65,66,67,68,69,70,72,73,74,75,77,81,82,85,86,89,90,91,92,93,94,95,96,97,98,101,103,104,105,110,44,112,113,114,115,61,117,120,123,124,125,127,129,131,133,134,136,137,138,140,141,143,144,145,18,148,149,150],close:[136,29],get_metadata:[60,29],member_nam:82,superobject:[124,29],pg_version:29,tb_date:116,migration_auto_latest:81,admin:[30,69],in_arrai:27,rout:[45,0,124,24,29],fileproperti:120,accuraci:29,tighten:29,mix:[132,137,82,93,41,7,85,86,46,91,130,92,51,6,98,135,100,101,56,138,139,60,21,103,81,25,107,142,23,144,74,123,75,145,147,119],discret:[27,28,29,85,46,119,101],cheatsheet:29,hkdf:73,codeigniter_profil:29,or_where_in:[144,29],mit:29,singl:[89,82,136,31,29],uppercas:[0,29,120,130,104,101],address_info:87,unless:[73,120,85,125,10,129,49,92,51,53,98,137,138,20,103,104,25,107,144,70,29,30,42,123],post_control:124,ci_cor:29,oracl:[89,64,144,29],galleri:49,textmat:74,row_alt_end:119,header1:23,form_validation_rul:30,eight:119,max_filenam:[123,29],deploi:[81,29],segment:[82,136,31,29],payment:144,page_query_str:56,newprefix:44,placement:29,expert:73,child_two:28,gather:[43,88],upset:6,set_error_delimit:[46,29],character_limit:[142,29],face:20,inde:[120,29],my_log:30,determin:[76,82,31,29],built:[87,123,131,75,101],constrain:29,stark:126,plaintext_str:104,fact:[98,30,129,104,73],my_bio:107,ci_user_ag:88,cal_cell_start:19,extension_load:104,send_respons:91,ci_sess:[95,30,113,148,98],model_nam:[103,72],bring:[122,96],new_imag:49,format_charact:[29,20],trivial:[98,136],anywai:[73,29],texb:[49,140],redirect:[5,23,91,29,93,75,117,9],dbcollat:[89,118,70,141,29],textual:19,locat:[132,0,50,39,41,7,124,86,9,46,88,89,49,13,131,98,127,99,72,60,103,65,27,29,30,75,145,116],strip_image_tag:[46,63,29],blog_entri:110,holder:71,illus:137,calendar_lang:3,mug:125,should:[132,0,50,3,39,120,40,41,73,8,45,123,87,5,44,86,9,46,128,89,91,129,101,49,13,93,131,94,95,96,97,52,53,98,136,141,15,16,17,18,138,125,19,115,142,135,21,103,118,68,104,134,25,64,65,66,67,23,69,70,29,109,54,112,30,74,31,75,55,32,33,34,113,114,35,61,124,6,81,148,149,150,119],jan:19,lightest:48,smallest:48,suppor:29,intrigu:6,elseif:[120,146,88],local:[108,0,82,29,74,105,9],hope:8,meant:[132,98],um10:86,strip_slash:130,gettyp:29,server_url:91,sess_match_userag:[30,29],convert:[142,1,63,29,130,42,75,86,87],error_404:[65,93,41,150,29],wordi:120,made:[39,48,131,144,129,29,30,21,22,94,95,97,52,38,136],csrf:29,orig_data:104,db1:141,target_vers:81,in_list:[46,29],edg:[49,122,29],cur_tag_clos:56,endless:25,application_config:120,getuserinfo:91,dishearten:6,enabl:29,is_uniqu:[46,29],nl2br:[42,20],upper:[49,101],or_wher:[144,29],bounc:39,htmlspecialchar:[46,119,100,29],sha:73,csrf_token_nam:[94,135],image_url:13,integr:[45,142,73],contain:[79,0,1,5,120,93,41,31,43,85,124,44,86,87,11,63,130,13,51,95,97,134,6,136,137,142,102,140,25,144,106,147,141,65,27,28,69,70,29,109,72,74,42,75,113,114,36,82],menuitem:110,grab:131,view:[82,144,31,29],conform:134,legaci:[0,30,98,104,29],avg:[144,29],cal_cell_blank:19,frame:6,knowledg:[10,98],exit_unknown_class:108,group_nam:141,qty:[125,29],popup:75,rc2:73,equip:36,form_input:[87,125,29],my_uri:29,sphinxcontrib:74,entitl:7,thead_open:119,unexist:29,log_file_extens:29,error:[89,82,136,29],segment_arrai:145,adodb:12,correctli:[142,131,29,121,20,73,41,76,107,136],record:[10,144,29,30,21,22,96,98,135],mimes_typ:29,pointer:[57,51,29],boundari:29,last_visit:29,newnam:[23,29],written:[56,0,89,29,49,30,41,21,22,146,75,138,116,18,27,122,98,109],stacktrac:136,ci_trackback:116,progress:39,multiplelanguag:132,equiv:6,thumbnail:49,get_compiled_insert:[144,29],get_dir_file_info:[109,29],perfect:[49,22],core_class:34,sole:101,bed:137,kei:[82,29],vrt:49,weak:134,matic:91,simple_queri:[82,44,29],salli:146,fopen_write_create_destruct:108,job:[45,131],entir:[56,27,143,69,29,120,110,57,50,31,14,105,98,9,46,37,60],joe:[143,144,130,93,145,146,87],has_rul:46,poof:29,argument:[45,144,29],parenthesi:[120,144,29],thumb:49,proxy_port:91,date_rfc850:86,quote_identifi:29,plugin:[65,118,90,35,29],wrapchar:23,goal:[47,126,78],mpg:29,incident:30,foobaz:120,april:29,my_calendar:103,cachedir:[34,141,89,29],grain:75,mysecretkei:103,db_set_charset:[82,29],gmdate:92,fopen_read_write_create_strict:108,messagebodi:46,onchang:87,comment:[0,29,144,31,27],shirts_on_sal:87,unmark:98,sqlsrv_cursor_client_buff:29,ci_db_pdo_driv:29,password:[89,141,29],hyphen:29,heavi:[98,31,141],print_r:[120,69,143,19,91],chmod:[98,143,29],walk:51,image_reproport:29,rpc:[47,111,134,29],"0script":100,respect:[89,69,29,130,30,93,87,96,25,46],tuesdai:19,mcrypt_mode_cbc:[104,29],append:[56,89,23,129,29,130,92,75,123,7,87],utf8_general_ci:[89,141,70,118],mailto:75,quit:[27,91,138,120,74,6,18,116,126],foofoo:120,tort:71,addition:[70,29,120,40,30,103,7,6,99,101],endforeach:[129,123,21,146,125,126],get_inst:29,form_prep:[87,29],watermark:29,compon:[48,19,29,125,98,136],json:92,write_fil:[109,69],treat:[5,12,82,29,6,107],date_w3c:86,popul:[19,29],xlsx:29,curli:[29,20],censor:142,overlay_watermark:29,interbas:[76,64,69,29],togeth:[56,144,129,131,44,140,46],user_guid:34,fail_gracefulli:[103,7],mouseov:39,present:[89,29],opac:49,request_head:[101,29],replic:98,multi:[89,129,29,110,6,124,125,98,119],cypher:104,"14t16":86,plain:[13,63,29,92,30,73,104,110,25,134],align:[49,125],some_photo:107,harder:137,return_path:[23,29],cursor:29,defin:[51,70,100,29],filename_secur:29,suport:86,encrypted_str:104,hex2bin:[25,73,29],decept:6,wild:29,get_compiled_delet:[144,29],sess_time_to_upd:[98,118],"8bit":25,mydogspot:36,layer:[25,134,64,21,29],purchas:125,customiz:[56,89],cell:29,almost:[98,11,73,145],field_data:[43,82,51,31,29],site:29,langfil:132,some_class:[74,105],ruri_str:[145,29],svg11:6,bigint:[98,140],substanti:[105,71,29],lightweight:132,sting:88,incom:[91,116],unneed:29,symbolic_permiss:[109,29],test_datatyp:138,free_result:[51,31,29],uniti:29,human_to_unix:[86,29],let:[89,2,144,82,29,31,44,43,18],welcom:[93,129,105],ciper:73,parti:[74,21],cross:[63,29,6,134,100,101],ci_tabl:119,member:[144,82,31,122,46,101],code_end:37,data_seek:[51,29],pingomat:91,android:29,fubar:103,difficult:49,prais:8,immedi:[124,18,29],columbia:[122,71],hostnam:[29,89,143,82,72,141],equival:[120,142,13,131],keepal:29,maxlength:[87,125,29],upon:[10,29,49,82,8,46,126,135,101],effect:[31,29],coffe:125,dai:[119,29,19,86,8],column_nam:70,retriv:101,raboof:120,having_or:29,sooner:[95,30],set_:87,alpha_dash:46,expand:[29,22,8],andretti:137,ofb:73,orig_nam:123,my_const:120,off:[56,0,143,12,10,29,31,76,123,87,134,136],center:[49,131],reuse_query_str:[56,29],epub:74,unl:30,colour:29,well:[132,39,120,86,45,46,126,88,11,6,98,100,56,138,64,23,144,29,109,30,146,78],set_cooki:[85,101,29],weblog:[91,116],exampl:[89,2,82,29,31,141,136],command:[144,141,69,29],filesystem:81,undefin:[138,29],audio:29,loss:98,sibl:28,usual:[5,73,91,39,49,30,93,103,75,142,85,143,98,46,126,107,123,101],next:[30,144,29,130,13,51,31,14,136],taller:49,display_overrid:124,newest:[125,81],camel:36,drop_databas:[70,29],half:98,obtain:[132,71],tcp:[98,60],jar:29,settabl:29,ci_xmlrpc:[91,29],some_cookie2:101,rest:[93,89,72,74,8],glue:131,new_post:91,sku:125,web:31,"50off":125,filter_validate_email:121,fopen:[109,29],idiom:132,disagre:136,multipart:[87,123,29],arandom:25,smith:[45,91],my_backup:107,myprefix_:101,add:[0,5,40,9,44,87,89,142,129,130,51,6,52,53,93,136,58,140,105,144,141,65,27,69,70,29,74,75,34,147,36],wm_vrt_align:49,error_email_miss:132,foobar:[120,137,72],display_pag:56,logger:29,suit:[49,138],warrant:96,old_table_nam:70,gmt:[92,86],exot:101,set_mim:139,xmlrpc:[120,91,29],agnost:82,varieti:[74,78,29],http_x_cluster_client_ip:[101,29],foreign_charact:29,camelcas:120,five:[125,130,119],know:[0,73,69,70,30,93,131,22,43,134,136,104,105,45,98,101,62,64],convert_xml:116,octal_permiss:[109,29],set_select:[87,46,29],"2nd":29,recurs:[11,143,29,96,25,107],get_item:[125,29],desc:144,insert:[82,31,29],resid:3,like:[0,1,2,3,5,120,93,7,43,45,123,87,124,44,86,9,46,126,88,146,89,142,12,129,101,49,13,51,14,143,82,96,137,53,98,127,135,100,72,56,138,125,19,110,20,59,103,22,148,140,68,104,105,25,91,107,73,65,27,131,23,144,141,29,92,30,74,31,75,145,76,34,50,116,39,117,37,81,134,78,119],lost:[98,29],safe_mailto:75,um11:86,up105:86,sessionhandlerinterfac:98,num_tag_clos:56,interfer:98,session_regenerate_id:98,unord:[6,29],necessari:[0,144,82,120,29,87,16],active_r:[65,118,29],messi:46,lose:[120,137,73],resiz:[49,39,62,75,29],get_temp_kei:98,xsl:29,path_info:3,unabl:[109,116],exceed:[23,141,82],revers:29,"_html_entity_decode_callback":29,migration_path:[81,29],suppli:[2,82,121,41,43,123,87,46,89,49,13,135,100,101,138,19,103,140,25,106,107,143,144,29,109,30,75,136],update_batch:[144,29],daylight:86,"export":29,superclass:120,proper:[29,73,144,82,120,30,41,123,46,135],home:[131,88],use_strict:138,form_item:46,transport:91,auto_typographi:[29,42,20],week_row_start:19,trust:29,lead:[120,130,145,93,29],broad:[78,26],"_get":[101,30,134,29],lean:[110,126],februari:29,leap:86,log_error:[132,34,41,29],default_method:0,speak:70,malsup:39,myfunct:124,um12:86,congratul:[98,22],liabil:71,acronym:29,journal:93,"10px":87,usag:[84,144,70,29,51,31,43],values_pars:29,facilit:29,maintain_ratio:[49,29],host:[89,82,60,29,6,98,78,141],hash_pbkdf2:[25,134,29],nutshel:[45,0],cal_cell_oth:19,although:[56,27,73,30,44,18,46,126,78],offset:[56,144,29,49,60,51,145,86,25],product_name_rul:125,parserequest:29,slug:[130,21,22],stage:124,rsegment_arrai:145,sbin:23,rare:[98,96,73,44],interven:92,last_citi:120,column:[82,29],prop:49,sqlsrv:[30,64,29],error_username_miss:132,entity_decod:[135,42,29],includ:[5,2,39,120,40,82,125,123,86,9,46,126,10,11,91,129,50,131,143,96,133,98,135,100,72,136,142,21,22,103,30,134,144,107,27,23,69,70,71,29,109,110,73,74,75,145,77,101,148,149,150],member_id:[87,91,31,82],constructor:[141,117,29],cal_row_end:19,repercuss:53,powerpoint:29,is_tru:138,creating_librari:34,set_data:[46,29],own:[0,12,29,31,44,117,25,144,136],delete_al:29,inlin:[23,6,13,29],"_ci_autoload":29,easy_instal:74,automat:[2,136,31,29],first_tag_open:56,warranti:71,guard:[73,104,116],wm_overlay_path:49,awhil:29,col_limit:119,relicens:29,hang:8,mere:[137,136],merg:[144,71,29,103,7,136],is_brows:[88,29],beep:142,myform:[87,46],ctype_alpha:29,unix_start:86,val:[144,120,92,103,140,46,119],pictur:[6,23],myforg:70,transfer:[101,73,143,29],howland:86,support:29,db_query_build:[144,29],beer:124,language_kei:[79,132],macintosh:88,standard_d:[86,29],much:[81,29,30,103,86,25,98,126,78,101],pool:[140,29],filemtim:29,"var":[29,120,60,103,98,100],venezuelan:86,strtolow:[93,29],application_fold:[50,127],new_data:104,total_row:56,unexpect:98,unwrap:23,bcc_batch_mod:[23,29],brand:88,my_model:118,multical:29,"_util":0,is_natur:46,bodi:[23,144,129,29,110,13,51,131,123,121,46,106],gain:[95,60,73,31,104],select_min:[144,29],dbforg:[103,30,70,81,29],highest:[23,107],eat:6,count:[82,29],group_start:144,cleanup:29,temp:110,rc4:73,wish:[132,39,120,41,7,125,124,87,11,91,129,49,50,93,18,98,101,138,19,142,103,104,144,27,143,69,70,73,75,145,37],unload:39,writeabl:109,flip:49,ci_model:[96,21,72],asynchron:135,directori:[89,82,40,29,31,18],below:[5,73,39,41,7,9,123,124,86,87,46,12,129,49,13,98,125,19,142,21,103,140,105,91,106,141,27,23,144,70,29,72,74,31,77,134,150,119],item_valu:7,limit:[106,2,29],tini:6,fetch:[137,144,129,29,60,30,51,43,25],view_cascad:103,otherwis:[132,0,73,121,85,125,49,93,14,134,100,101,103,98,25,108,23,69,71,29,30,37,136],problem:[142,29,30,41,133,98,46,136],weblogupd:91,reliabl:[98,88,142,75,29],evalu:[120,138,29],timespan:[86,29],"int":[82,41,85,86,125,11,91,130,92,51,143,6,98,135,100,101,19,60,21,140,81,104,25,142,23,144,70,109,73,74,145,147,116,37,119],dure:[132,27,72,29,134,77,124,98,25,46],filenam:[132,27,23,63,139,29,49,135,30,120,123,7,109,34,81,124,105,9,69,107],novemb:29,implement:[132,73,12,144,29,30,98,82,25,116,9,46],some_nam:98,userag:23,path_cach:120,mistaken:120,ing:29,up1275:86,httponli:[98,85,101],inc:122,spell:29,my_:[9,27,34,60,105],last_tag_open:56,percent:[134,86],front_control:65,virtual:98,plular:36,other:[5,73,3,82,120,41,43,9,85,87,124,86,45,10,12,129,130,50,14,6,134,100,118,125,19,104,141,65,27,144,29,30,74,123,75,136],bool:[132,39,1,92,82,121,41,7,125,85,86,87,46,88,11,63,49,130,13,51,6,98,135,100,101,137,138,139,102,60,36,103,144,143,25,91,107,23,69,70,109,110,74,42,75,116,123,119],bin2hex:73,rememb:[129,31,44,103,45,46],unix_to_human:86,php4:0,php5:102,myphoto:107,stat:[0,29],repeat:[130,6,29],misc_model:30,my_db:70,repeat_password:87,"class":[136,29],oci_fetch:29,june:[19,29],ci_email:[9,23],"_parse_argv":29,news_model:[21,22],theother:130,is_ascii:29,unnecessarili:29,mondai:[19,119],has_opt:125,throughout:[29,27,72,40,73,41,132,128,135,141],trackback:[47,111,29],clean_email:29,ci_load:103,basketbal:46,stai:[125,137],experienc:[49,98,120,73],thead_clos:119,sphinx:74,amp:1,strpo:120,baker:86,root_path:107,extran:29,bcc:[23,29],form_radio:[87,29],"_protect_identifi":29,portion:[25,144,41,71],emerg:136,ci_uri:[145,29]},objtypes:{"0":"php:method","1":"php:function","2":"php:class"},objnames:{"0":["php","method","PHP method"],"1":["php","function","PHP function"],"2":["php","class","PHP class"]},filenames:["general/controllers","helpers/xml_helper","database/call_function","installation/upgrade_b11","installation/upgrading","general/urls","helpers/html_helper","libraries/config","tutorial/conclusion","general/creating_libraries","DCO","helpers/directory_helper","database/transactions","helpers/smiley_helper","general/environments","installation/upgrade_163","installation/upgrade_162","installation/upgrade_161","general/caching","libraries/calendar","libraries/typography","tutorial/news_section","tutorial/create_news_items","libraries/email","general/index","general/compatibility_functions","overview/index","general/helpers","general/drivers","changelog","installation/upgrade_300","database/caching","installation/upgrade_152","installation/upgrade_153","installation/upgrade_150","installation/upgrade_154","helpers/inflector_helper","libraries/benchmark","installation/downloads","libraries/javascript","general/autoloader","general/errors","helpers/typography_helper","database/metadata","database/queries","general/cli","libraries/form_validation","index","overview/goals","libraries/image_lib","installation/index","database/results","installation/upgrade_141","installation/upgrade_140","installation/upgrade_220","installation/upgrade_221","libraries/pagination","tutorial/index","installation/troubleshooting","overview/mvc","libraries/caching","installation/upgrade_212","overview/features","helpers/security_helper","general/requirements","installation/upgrade_130","installation/upgrade_131","installation/upgrade_132","installation/upgrade_133","database/utilities","database/forge","license","general/models","libraries/encryption","documentation/index","helpers/url_helper","database/helpers","general/profiling","general/welcome","helpers/language_helper","general/creating_drivers","libraries/migration","database/db_driver_reference","helpers/index","database/index","helpers/cookie_helper","helpers/date_helper","helpers/form_helper","libraries/user_agent","database/configuration","installation/upgrade_120","libraries/xmlrpc","libraries/output","general/routing","installation/upgrade_202","installation/upgrade_203","installation/upgrade_200","installation/upgrade_201","libraries/sessions","general/libraries","general/common_functions","libraries/input","helpers/path_helper","libraries/loader","libraries/encrypt","general/core_classes","database/examples","libraries/zip","general/reserved_names","helpers/file_helper","libraries/parser","libraries/index","installation/upgrade_214","installation/upgrade_211","installation/upgrade_210","installation/upgrade_213","libraries/trackback","general/ancillary_classes","installation/upgrade_160","libraries/table","general/styleguide","helpers/email_helper","general/credits","libraries/file_uploading","general/hooks","libraries/cart","overview/at_a_glance","general/managing_apps","overview/appflow","general/views","helpers/string_helper","tutorial/static_pages","libraries/language","overview/getting_started","general/security","libraries/security","contributing/index","helpers/array_helper","libraries/unit_testing","helpers/download_helper","helpers/captcha_helper","database/connecting","helpers/text_helper","libraries/ftp","database/query_builder","libraries/uri","general/alternative_php","helpers/number_helper","installation/upgrade_170","installation/upgrade_171","installation/upgrade_172"],titles:["Controllers","XML Helper","Custom Function Calls","Upgrading From Beta 1.0 to Beta 1.1","Upgrading From a Previous Version","CodeIgniter URLs","HTML Helper","Config Class","Conclusion","Creating Libraries","Developer’s Certificate of Origin 1.1","Directory Helper","Transactions","Smiley Helper","Handling Multiple Environments","Upgrading from 1.6.2 to 1.6.3","Upgrading from 1.6.1 to 1.6.2","Upgrading from 1.6.0 to 1.6.1","Web Page Caching","Calendaring Class","Typography Class","News section","Create news items","Email Class","General Topics","Compatibility Functions","CodeIgniter Overview","Helper Functions","Using CodeIgniter Drivers","Change Log","Upgrading from 2.2.x to 3.0.0","Database Caching Class","Upgrading from 1.5.0 to 1.5.2","Upgrading from 1.5.2 to 1.5.3","Upgrading from 1.4.1 to 1.5.0","Upgrading from 1.5.3 to 1.5.4","Inflector Helper","Benchmarking Class","Downloading CodeIgniter","Javascript Class","Auto-loading Resources","Error Handling","Typography Helper","Database Metadata","Queries","Running via the CLI","Form Validation","CodeIgniter User Guide","Design and Architectural Goals","Image Manipulation Class","Installation Instructions","Generating Query Results","Upgrading from 1.4.0 to 1.4.1","Upgrading from 1.3.3 to 1.4.0","Upgrading from 2.1.4 to 2.2.0","Upgrading from 2.2.0 to 2.2.1","Pagination Class","Tutorial","Troubleshooting","Model-View-Controller","Caching Driver","Upgrading from 2.1.1 to 2.1.2","CodeIgniter Features","Security Helper","Server Requirements","Upgrading from 1.2 to 1.3","Upgrading from 1.3 to 1.3.1","Upgrading from 1.3.1 to 1.3.2","Upgrading from 1.3.2 to 1.3.3","Database Utility Class","Database Forge Class","The MIT License (MIT)","Models","Encryption Library","Writing CodeIgniter Documentation","URL Helper","Query Helper Methods","Profiling Your Application","Welcome to CodeIgniter","Language Helper","Creating Drivers","Migrations Class","DB Driver Reference","Helpers","Database Reference","Cookie Helper","Date Helper","Form Helper","User Agent Class","Database Configuration","Upgrading From Beta 1.0 to Final 1.2","XML-RPC and XML-RPC Server Classes","Output Class","URI Routing","Upgrading from 2.0.1 to 2.0.2","Upgrading from 2.0.2 to 2.0.3","Upgrading from 1.7.2 to 2.0.0","Upgrading from 2.0.0 to 2.0.1","Session Library","Using CodeIgniter Libraries","Common Functions","Input Class","Path Helper","Loader Class","Encrypt Class","Creating Core System Classes","Database Quick Start: Example Code","Zip Encoding Class","Reserved Names","File Helper","Template Parser Class","Libraries","Upgrading from 2.1.3 to 2.1.4","Upgrading from 2.1.0 to 2.1.1","Upgrading from 2.0.3 to 2.1.0","Upgrading from 2.1.2 to 2.1.3","Trackback Class","Creating Ancillary Classes","Upgrading from 1.5.4 to 1.6.0","HTML Table Class","PHP Style Guide","Email Helper","Credits","File Uploading Class","Hooks - Extending the Framework Core","Shopping Cart Class","CodeIgniter at a Glance","Managing your Applications","Application Flow Chart","Views","String Helper","Static pages","Language Class","Getting Started With CodeIgniter","Security","Security Class","Contributing to CodeIgniter","Array Helper","Unit Testing Class","Download Helper","CAPTCHA Helper","Connecting to your Database","Text Helper","FTP Class","Query Builder Class","URI Class","Alternate PHP Syntax for View Files","Number Helper","Upgrading from 1.6.3 to 1.7.0","Upgrading from 1.7.0 to 1.7.1","Upgrading from 1.7.1 to 1.7.2"],objects:{"":{"CI_DB_driver::platform":[82,0,1,""],"CI_DB_forge::add_field":[70,0,1,""],mysql_to_unix:[86,1,1,""],"CI_DB_query_builder::or_where_in":[144,0,1,""],"CI_Input::get_request_header":[101,0,1,""],"CI_Calendar::get_total_days":[19,0,1,""],"CI_URI::segment":[145,0,1,""],"CI_FTP::delete_dir":[143,0,1,""],auto_link:[75,1,1,""],form_textarea:[87,1,1,""],"CI_Session::keep_flashdata":[98,0,1,""],"CI_DB_utility::repair_table":[69,0,1,""],"CI_DB_driver::update_string":[82,0,1,""],get_file_info:[109,1,1,""],base_url:[75,1,1,""],site_url:[75,1,1,""],"CI_DB_forge::add_column":[70,0,1,""],"CI_Output::set_output":[92,0,1,""],CI_Security:[135,2,1,""],"CI_DB_result::last_row":[51,0,1,""],"CI_Cart::destroy":[125,0,1,""],"CI_DB_query_builder::not_like":[144,0,1,""],"CI_DB_driver::cache_delete_all":[82,0,1,""],"CI_Encrypt::encode":[104,0,1,""],date_range:[86,1,1,""],underscore:[36,1,1,""],"CI_DB_query_builder::get_compiled_delete":[144,0,1,""],"CI_DB_driver::simple_query":[82,0,1,""],force_download:[139,1,1,""],"CI_Calendar::get_day_names":[19,0,1,""],"CI_Cache::is_supported":[60,0,1,""],byte_format:[147,1,1,""],"CI_Migration::latest":[81,0,1,""],"CI_DB_driver::trans_complete":[82,0,1,""],"CI_DB_driver::reconnect":[82,0,1,""],"CI_DB_utility::database_exists":[69,0,1,""],heading:[6,1,1,""],"CI_FTP::mirror":[143,0,1,""],CI_DB_query_builder:[144,2,1,""],CI_Loader:[103,2,1,""],nbs:[6,1,1,""],doctype:[6,1,1,""],word_limiter:[142,1,1,""],write_file:[109,1,1,""],quotes_to_entities:[130,1,1,""],"CI_DB_driver::db_select":[82,0,1,""],"CI_Unit_test::report":[138,0,1,""],sanitize_filename:[63,1,1,""],"CI_Image_lib::rotate":[49,0,1,""],standard_date:[86,1,1,""],mdate:[86,1,1,""],"CI_Calendar::get_month_name":[19,0,1,""],"CI_DB_query_builder::limit":[144,0,1,""],"CI_Input::server":[101,0,1,""],"CI_Output::_display":[92,0,1,""],"CI_DB_query_builder::where":[144,0,1,""],xss_clean:[63,1,1,""],"CI_Input::get_post":[101,0,1,""],"CI_DB_forge::drop_database":[70,0,1,""],"CI_Form_validation::error_string":[46,0,1,""],"CI_DB_driver::trans_strict":[82,0,1,""],"CI_Trackback::send":[116,0,1,""],camelize:[36,1,1,""],form_button:[87,1,1,""],"CI_User_agent::version":[88,0,1,""],"CI_URI::uri_string":[145,0,1,""],directory_map:[11,1,1,""],strip_image_tags:[63,1,1,""],"CI_Upload::do_upload":[123,0,1,""],gmt_to_local:[86,1,1,""],"CI_DB_query_builder::get":[144,0,1,""],"CI_DB_driver::list_tables":[82,0,1,""],current_url:[75,1,1,""],"CI_Lang::line":[132,0,1,""],mb_substr:[25,1,1,""],"CI_Input::input_stream":[101,0,1,""],"CI_Cart::contents":[125,0,1,""],"CI_Xmlrpc::send_error_message":[91,0,1,""],"CI_DB_result::first_row":[51,0,1,""],"CI_DB_query_builder::or_where":[144,0,1,""],"CI_DB_query_builder::having":[144,0,1,""],"CI_Config::slash_item":[7,0,1,""],"CI_Table::clear":[119,0,1,""],"CI_DB_driver::trans_start":[82,0,1,""],"CI_Cart::remove":[125,0,1,""],"CI_Upload::data":[123,0,1,""],CI_Benchmark:[37,2,1,""],"CI_Output::cache":[92,0,1,""],"CI_Zip::get_zip":[107,0,1,""],CI_DB_driver:[82,2,1,""],Some_class:[74,2,1,""],form_reset:[87,1,1,""],"CI_DB_query_builder::select_min":[144,0,1,""],"CI_FTP::rename":[143,0,1,""],"CI_Trackback::receive":[116,0,1,""],"CI_Loader::helper":[103,0,1,""],form_fieldset_close:[87,1,1,""],"CI_DB_result::free_result":[51,0,1,""],"CI_DB_utility::backup":[69,0,1,""],"CI_DB_result::unbuffered_row":[51,0,1,""],"CI_Trackback::convert_ascii":[116,0,1,""],"CI_Security::xss_clean":[135,0,1,""],set_select:[87,1,1,""],form_prep:[87,1,1,""],form_open:[87,1,1,""],"CI_URI::slash_segment":[145,0,1,""],"Some_class::should_do_something":[74,0,1,""],"CI_FTP::connect":[143,0,1,""],"CI_Loader::view":[103,0,1,""],"CI_Image_lib::display_errors":[49,0,1,""],"CI_DB_driver::trans_status":[82,0,1,""],"CI_Encryption::encrypt":[73,0,1,""],"CI_DB_query_builder::or_not_group_start":[144,0,1,""],"CI_Migration::version":[81,0,1,""],CI_DB_result:[51,2,1,""],"CI_DB_query_builder::replace":[144,0,1,""],"CI_DB_driver::cache_delete":[82,0,1,""],"CI_Trackback::extract_urls":[116,0,1,""],"CI_Form_validation::set_message":[46,0,1,""],array_column:[25,1,1,""],url_title:[75,1,1,""],get_instance:[117,1,1,""],CI_Lang:[132,2,1,""],trim_slashes:[130,1,1,""],xml_convert:[1,1,1,""],"CI_DB_query_builder::or_having":[144,0,1,""],"CI_DB_query_builder::from":[144,0,1,""],show_error:[41,1,1,""],"CI_DB_query_builder::offset":[144,0,1,""],singular:[36,1,1,""],"CI_DB_result::field_data":[51,0,1,""],show_404:[41,1,1,""],array_replace_recursive:[25,1,1,""],random_element:[137,1,1,""],"CI_Security::sanitize_filename":[135,0,1,""],form_checkbox:[87,1,1,""],"CI_Trackback::validate_url":[116,0,1,""],"CI_User_agent::is_robot":[88,0,1,""],"CI_Email::message":[23,0,1,""],"CI_FTP::close":[143,0,1,""],create_captcha:[140,1,1,""],"CI_Config::item":[7,0,1,""],"CI_DB_driver::db_pconnect":[82,0,1,""],"CI_Input::user_agent":[101,0,1,""],element:[137,1,1,""],"CI_Encryption::create_key":[73,0,1,""],days_in_month:[86,1,1,""],"CI_Session::unset_userdata":[98,0,1,""],"CI_Encrypt::set_mode":[104,0,1,""],"CI_DB_utility::csv_from_result":[69,0,1,""],"CI_Cache::decrement":[60,0,1,""],"CI_DB_query_builder::get_compiled_update":[144,0,1,""],"CI_Form_validation::error":[46,0,1,""],form_submit:[87,1,1,""],"CI_DB_driver::count_all":[82,0,1,""],"CI_DB_result::num_rows":[51,0,1,""],"CI_DB_driver::field_exists":[82,0,1,""],"CI_Trackback::limit_characters":[116,0,1,""],CI_Output:[92,2,1,""],password_hash:[25,1,1,""],CI_Encrypt:[104,2,1,""],"CI_Table::set_caption":[119,0,1,""],CI_Image_lib:[49,2,1,""],config_item:[100,1,1,""],"CI_Migration::find_migrations":[81,0,1,""],get_clickable_smileys:[13,1,1,""],form_password:[87,1,1,""],"CI_DB_query_builder::truncate":[144,0,1,""],"CI_Email::from":[23,0,1,""],"CI_User_agent::charsets":[88,0,1,""],ellipsize:[142,1,1,""],CI_Config:[7,2,1,""],"CI_Typography::nl2br_except_pre":[20,0,1,""],"CI_Zip::clear_data":[107,0,1,""],timezone_menu:[86,1,1,""],now:[86,1,1,""],"CI_DB_query_builder::count_all_results":[144,0,1,""],set_value:[87,1,1,""],strip_slashes:[130,1,1,""],"CI_DB_query_builder::or_where_not_in":[144,0,1,""],"CI_User_agent::accept_lang":[88,0,1,""],"CI_DB_query_builder::where_not_in":[144,0,1,""],highlight_phrase:[142,1,1,""],CI_Encryption:[73,2,1,""],"CI_Input::ip_address":[101,0,1,""],smiley_js:[13,1,1,""],"CI_URI::slash_rsegment":[145,0,1,""],"CI_DB_driver::db_set_charset":[82,0,1,""],"CI_Encrypt::set_cipher":[104,0,1,""],"CI_DB_driver::version":[82,0,1,""],"CI_Xmlrpc::timeout":[91,0,1,""],is_really_writable:[100,1,1,""],"CI_DB_driver::elapsed_time":[82,0,1,""],set_realpath:[102,1,1,""],"CI_Benchmark::elapsed_time":[37,0,1,""],nice_date:[86,1,1,""],"CI_DB_query_builder::update":[144,0,1,""],"CI_URI::segment_array":[145,0,1,""],CI_Cache:[60,2,1,""],"CI_DB_query_builder::reset_query":[144,0,1,""],"CI_Session::umark_flash":[98,0,1,""],"CI_DB_query_builder::not_group_start":[144,0,1,""],plural:[36,1,1,""],remove_invisible_characters:[100,1,1,""],"CI_Calendar::adjust_date":[19,0,1,""],"CI_DB_driver::call_function":[82,0,1,""],hash_equals:[25,1,1,""],CI_Pagination:[56,2,1,""],is_countable:[36,1,1,""],"CI_DB_result::list_fields":[51,0,1,""],"CI_Input::post_get":[101,0,1,""],"CI_Security::get_csrf_hash":[135,0,1,""],"CI_Table::set_template":[119,0,1,""],"CI_Image_lib::resize":[49,0,1,""],"CI_Config::load":[7,0,1,""],"CI_DB_driver::table_exists":[82,0,1,""],link_tag:[6,1,1,""],"CI_User_agent::mobile":[88,0,1,""],"CI_DB_query_builder::start_cache":[144,0,1,""],"CI_Email::bcc":[23,0,1,""],"CI_DB_driver::list_fields":[82,0,1,""],"CI_Encrypt::encode_from_legacy":[104,0,1,""],"CI_DB_driver::db_connect":[82,0,1,""],"CI_DB_query_builder::insert":[144,0,1,""],increment_string:[130,1,1,""],"CI_Email::reply_to":[23,0,1,""],"CI_Cache::cache_info":[60,0,1,""],"CI_DB_query_builder::select":[144,0,1,""],"CI_DB_query_builder::flush_cache":[144,0,1,""],"CI_Cart::product_options":[125,0,1,""],"CI_Loader::database":[103,0,1,""],"CI_Benchmark::memory_usage":[37,0,1,""],prep_url:[75,1,1,""],"CI_URI::uri_to_assoc":[145,0,1,""],encode_php_tags:[63,1,1,""],"CI_DB_query_builder::empty_table":[144,0,1,""],"CI_DB_query_builder::get_where":[144,0,1,""],"CI_Calendar::initialize":[19,0,1,""],"CI_DB_query_builder::group_end":[144,0,1,""],"CI_Parser::set_delimiters":[110,0,1,""],"CI_DB_query_builder::select_sum":[144,0,1,""],"CI_DB_forge::add_key":[70,0,1,""],"CI_Config::site_url":[7,0,1,""],"CI_Form_validation::has_rule":[46,0,1,""],"CI_URI::total_segments":[145,0,1,""],"CI_Email::attach":[23,0,1,""],"CI_Session::__set":[98,0,1,""],"CI_DB_forge::drop_column":[70,0,1,""],"CI_DB_utility::list_databases":[69,0,1,""],reduce_double_slashes:[130,1,1,""],"CI_Loader::dbforge":[103,0,1,""],"CI_Table::add_row":[119,0,1,""],"CI_Upload::initialize":[123,0,1,""],valid_email:[121,1,1,""],"CI_DB_result::next_row":[51,0,1,""],CI_Unit_test:[138,2,1,""],"CI_Cache::increment":[60,0,1,""],"CI_Session::sess_regenerate":[98,0,1,""],index_page:[75,1,1,""],delete_files:[109,1,1,""],is_php:[100,1,1,""],"CI_Email::set_alt_message":[23,0,1,""],"CI_Output::append_output":[92,0,1,""],"CI_Encryption::decrypt":[73,0,1,""],"CI_Table::set_heading":[119,0,1,""],humanize:[36,1,1,""],"CI_Session::__get":[98,0,1,""],anchor_popup:[75,1,1,""],"CI_DB_query_builder::get_compiled_select":[144,0,1,""],"CI_DB_result::data_seek":[51,0,1,""],"CI_Session::sess_destroy":[98,0,1,""],"CI_Trackback::data":[116,0,1,""],"CI_DB_query_builder::where_in":[144,0,1,""],"CI_Session::flashdata":[98,0,1,""],"CI_DB_driver::cache_off":[82,0,1,""],"CI_Config::system_url":[7,0,1,""],"CI_Loader::model":[103,0,1,""],"CI_Unit_test::active":[138,0,1,""],"CI_Session::has_userdata":[98,0,1,""],"CI_Cache::save":[60,0,1,""],"CI_Xmlrpc::server":[91,0,1,""],"CI_DB_query_builder::set_update_batch":[144,0,1,""],"CI_Session::userdata":[98,0,1,""],CI_Email:[23,2,1,""],"CI_Session::umark_temp":[98,0,1,""],set_status_header:[100,1,1,""],convert_accented_characters:[142,1,1,""],CI_Cart:[125,2,1,""],alternator:[130,1,1,""],"CI_Session::set_tempdata":[98,0,1,""],"CI_Unit_test::run":[138,0,1,""],"CI_Migration::current":[81,0,1,""],"CI_Loader::config":[103,0,1,""],"CI_Output::set_status_header":[92,0,1,""],CI_Zip:[107,2,1,""],"CI_Loader::driver":[103,0,1,""],nl2br_except_pre:[42,1,1,""],random_string:[130,1,1,""],"CI_Cart::total_items":[125,0,1,""],CI_FTP:[143,2,1,""],"CI_Unit_test::set_test_items":[138,0,1,""],"CI_Cart::total":[125,0,1,""],redirect:[75,1,1,""],strip_quotes:[130,1,1,""],"CI_Email::print_debugger":[23,0,1,""],"CI_User_agent::is_mobile":[88,0,1,""],mb_strpos:[25,1,1,""],"CI_Security::get_random_bytes":[135,0,1,""],CI_Parser:[110,2,1,""],"CI_DB_result::set_row":[51,0,1,""],"CI_DB_query_builder::stop_cache":[144,0,1,""],"CI_DB_driver::last_query":[82,0,1,""],ascii_to_entities:[142,1,1,""],CI_DB_forge:[70,2,1,""],"CI_Xmlrpc::display_error":[91,0,1,""],"CI_User_agent::agent_string":[88,0,1,""],octal_permissions:[109,1,1,""],form_error:[87,1,1,""],"CI_DB_query_builder::update_batch":[144,0,1,""],"CI_Calendar::parse_template":[19,0,1,""],form_multiselect:[87,1,1,""],"CI_FTP::delete_file":[143,0,1,""],"CI_DB_result::result_object":[51,0,1,""],highlight_code:[142,1,1,""],"CI_Email::cc":[23,0,1,""],"CI_Cart::has_options":[125,0,1,""],"CI_Session::set_flashdata":[98,0,1,""],"CI_Input::post":[101,0,1,""],local_to_gmt:[86,1,1,""],"CI_Image_lib::watermark":[49,0,1,""],"CI_Session::get_flash_keys":[98,0,1,""],"CI_Form_validation::error_array":[46,0,1,""],"CI_Xmlrpc::display_response":[91,0,1,""],timezones:[86,1,1,""],"CI_User_agent::is_referral":[88,0,1,""],password_get_info:[25,1,1,""],"CI_DB_driver::primary":[82,0,1,""],send_email:[121,1,1,""],"CI_DB_driver::close":[82,0,1,""],"CI_Form_validation::reset_validation":[46,0,1,""],validation_errors:[87,1,1,""],"CI_Table::make_columns":[119,0,1,""],"CI_Loader::get_vars":[103,0,1,""],"CI_DB_query_builder::delete":[144,0,1,""],form_close:[87,1,1,""],"CI_DB_driver::initialize":[82,0,1,""],"CI_URI::ruri_string":[145,0,1,""],"CI_Xmlrpc::send_request":[91,0,1,""],"CI_Loader::add_package_path":[103,0,1,""],"CI_DB_query_builder::set_insert_batch":[144,0,1,""],"CI_Session::mark_as_temp":[98,0,1,""],"CI_Calendar::default_template":[19,0,1,""],"CI_Xmlrpc::request":[91,0,1,""],"CI_Form_validation::set_rules":[46,0,1,""],"CI_URI::total_rsegments":[145,0,1,""],"CI_Encryption::hkdf":[73,0,1,""],"CI_Output::enable_profiler":[92,0,1,""],"CI_Cache::delete":[60,0,1,""],"CI_DB_query_builder::or_like":[144,0,1,""],"CI_DB_result::row":[51,0,1,""],"CI_Cart::get_item":[125,0,1,""],"CI_Config::base_url":[7,0,1,""],"CI_Encryption::initialize":[73,0,1,""],img:[6,1,1,""],CI_Trackback:[116,2,1,""],"CI_User_agent::browser":[88,0,1,""],CI_Session:[98,2,1,""],"CI_DB_result::custom_result_object":[51,0,1,""],set_radio:[87,1,1,""],"CI_Security::get_csrf_token_name":[135,0,1,""],"CI_DB_forge::create_table":[70,0,1,""],"CI_DB_utility::optimize_database":[69,0,1,""],"CI_Cart::update":[125,0,1,""],"CI_Lang::load":[132,0,1,""],"CI_Loader::vars":[103,0,1,""],"CI_DB_forge::drop_table":[70,0,1,""],"CI_Input::set_cookie":[101,0,1,""],"CI_Table::set_empty":[119,0,1,""],"CI_Migration::error_string":[81,0,1,""],mailto:[75,1,1,""],hash_pbkdf2:[25,1,1,""],CI_Form_validation:[46,2,1,""],"CI_DB_query_builder::set_dbprefix":[144,0,1,""],reduce_multiples:[130,1,1,""],"CI_Form_validation::set_error_delimiters":[46,0,1,""],"CI_Email::subject":[23,0,1,""],"CI_FTP::upload":[143,0,1,""],"CI_Output::set_profiler_sections":[92,0,1,""],"CI_Zip::add_dir":[107,0,1,""],get_filenames:[109,1,1,""],"CI_Typography::format_characters":[20,0,1,""],unix_to_human:[86,1,1,""],array_replace:[25,1,1,""],"CI_DB_query_builder::like":[144,0,1,""],"CI_Session::set_userdata":[98,0,1,""],"CI_DB_query_builder::distinct":[144,0,1,""],"CI_Unit_test::use_strict":[138,0,1,""],CI_Upload:[123,2,1,""],"CI_DB_driver::trans_off":[82,0,1,""],form_upload:[87,1,1,""],hex2bin:[25,1,1,""],CI_Calendar:[19,2,1,""],parse_smileys:[13,1,1,""],"CI_DB_query_builder::select_avg":[144,0,1,""],anchor:[75,1,1,""],uri_string:[75,1,1,""],"CI_Form_validation::run":[46,0,1,""],"CI_DB_driver::cache_on":[82,0,1,""],"CI_Output::get_output":[92,0,1,""],"CI_DB_driver::escape_str":[82,0,1,""],"CI_DB_query_builder::or_group_start":[144,0,1,""],human_to_unix:[86,1,1,""],"CI_Output::set_header":[92,0,1,""],"CI_Input::request_headers":[101,0,1,""],"CI_Loader::file":[103,0,1,""],word_censor:[142,1,1,""],"CI_DB_forge::modify_column":[70,0,1,""],CI_Xmlrpc:[91,2,1,""],form_fieldset:[87,1,1,""],"CI_Email::set_header":[23,0,1,""],"CI_Cart::insert":[125,0,1,""],"CI_Loader::remove_package_path":[103,0,1,""],"CI_Security::entity_decode":[135,0,1,""],"CI_Session::get_temp_keys":[98,0,1,""],"CI_DB_driver::escape":[82,0,1,""],"CI_FTP::move":[143,0,1,""],form_label:[87,1,1,""],"CI_DB_driver::protect_identifiers":[82,0,1,""],"CI_Cache::get":[60,0,1,""],"CI_DB_result::previous_row":[51,0,1,""],"CI_DB_query_builder::group_start":[144,0,1,""],"CI_Zip::download":[107,0,1,""],"CI_DB_driver::escape_identifiers":[82,0,1,""],"CI_Loader::get_var":[103,0,1,""],"CI_User_agent::parse":[88,0,1,""],"CI_Encrypt::decode":[104,0,1,""],"CI_Cache::clean":[60,0,1,""],html_escape:[100,1,1,""],symbolic_permissions:[109,1,1,""],form_hidden:[87,1,1,""],log_message:[41,1,1,""],"CI_DB_driver::cache_set_path":[82,0,1,""],"CI_Unit_test::set_template":[138,0,1,""],"CI_DB_driver::field_data":[82,0,1,""],"CI_URI::rsegment":[145,0,1,""],"CI_Loader::language":[103,0,1,""],get_dir_file_info:[109,1,1,""],set_checkbox:[87,1,1,""],"CI_Input::cookie":[101,0,1,""],"CI_Cache::get_metadata":[60,0,1,""],"CI_URI::assoc_to_uri":[145,0,1,""],"CI_Benchmark::mark":[37,0,1,""],"CI_FTP::changedir":[143,0,1,""],"CI_Parser::parse":[110,0,1,""],"CI_Output::get_content_type":[92,0,1,""],entity_decode:[42,1,1,""],"CI_FTP::chmod":[143,0,1,""],do_hash:[63,1,1,""],password_verify:[25,1,1,""],safe_mailto:[75,1,1,""],"Some_class::some_method":[74,0,1,""],"CI_Image_lib::clear":[49,0,1,""],character_limiter:[142,1,1,""],"CI_DB_result::result":[51,0,1,""],"CI_DB_query_builder::or_not_like":[144,0,1,""],"CI_FTP::download":[143,0,1,""],"CI_Zip::read_file":[107,0,1,""],"CI_Unit_test::result":[138,0,1,""],"CI_Zip::archive":[107,0,1,""],"CI_DB_driver::is_write_type":[82,0,1,""],"CI_Calendar::generate":[19,0,1,""],"CI_Form_validation::set_data":[46,0,1,""],read_file:[109,1,1,""],word_wrap:[142,1,1,""],"CI_DB_driver::compile_binds":[82,0,1,""],password_needs_rehash:[25,1,1,""],"CI_DB_result::row_object":[51,0,1,""],"CI_Xmlrpc::initialize":[91,0,1,""],"CI_Upload::display_errors":[123,0,1,""],auto_typography:[42,1,1,""],CI_Table:[119,2,1,""],"CI_Trackback::set_error":[116,0,1,""],"CI_Image_lib::initialize":[49,0,1,""],"CI_DB_forge::rename_table":[70,0,1,""],"CI_DB_result::custom_row_object":[51,0,1,""],CI_URI:[145,2,1,""],form_dropdown:[87,1,1,""],br:[6,1,1,""],"CI_DB_utility::optimize_table":[69,0,1,""],"CI_Input::valid_ip":[101,0,1,""],"CI_URI::ruri_to_assoc":[145,0,1,""],"CI_DB_utility::xml_from_result":[69,0,1,""],ol:[6,1,1,""],"CI_Output::set_content_type":[92,0,1,""],"CI_User_agent::referrer":[88,0,1,""],"CI_Input::is_ajax_request":[101,0,1,""],quoted_printable_encode:[25,1,1,""],"CI_DB_driver::insert_string":[82,0,1,""],"CI_DB_query_builder::set":[144,0,1,""],"CI_Email::attachment_cid":[23,0,1,""],"CI_DB_driver::display_error":[82,0,1,""],"CI_DB_query_builder::order_by":[144,0,1,""],"CI_Input::method":[101,0,1,""],"CI_Xmlrpc::method":[91,0,1,""],"CI_Input::is_cli_request":[101,0,1,""],"CI_DB_result::row_array":[51,0,1,""],CI_User_agent:[88,2,1,""],"CI_Session::all_userdata":[98,0,1,""],"CI_Session::tempdata":[98,0,1,""],"CI_DB_query_builder::insert_batch":[144,0,1,""],"CI_Trackback::convert_xml":[116,0,1,""],"CI_Pagination::initialize":[56,0,1,""],"CI_Zip::read_dir":[107,0,1,""],"CI_DB_driver::escape_like_str":[82,0,1,""],"CI_Zip::add_data":[107,0,1,""],"CI_Email::send":[23,0,1,""],"CI_Loader::is_loaded":[103,0,1,""],repeater:[130,1,1,""],is_cli:[100,1,1,""],"CI_DB_query_builder::select_max":[144,0,1,""],"CI_Output::get_header":[92,0,1,""],get_mime_by_extension:[109,1,1,""],"CI_Trackback::get_id":[116,0,1,""],mb_strlen:[25,1,1,""],"CI_User_agent::accept_charset":[88,0,1,""],"CI_DB_query_builder::get_compiled_insert":[144,0,1,""],"CI_Email::clear":[23,0,1,""],"CI_DB_query_builder::group_by":[144,0,1,""],"CI_FTP::mkdir":[143,0,1,""],is_https:[100,1,1,""],ul:[6,1,1,""],"CI_Input::get":[101,0,1,""],meta:[6,1,1,""],"CI_DB_forge::create_database":[70,0,1,""],"CI_User_agent::robot":[88,0,1,""],get_mimes:[100,1,1,""],"CI_Pagination::create_links":[56,0,1,""],"CI_URI::rsegment_array":[145,0,1,""],timespan:[86,1,1,""],"CI_Loader::dbutil":[103,0,1,""],"CI_DB_driver::total_queries":[82,0,1,""],"CI_DB_query_builder::dbprefix":[144,0,1,""],"CI_Email::to":[23,0,1,""],"CI_Trackback::display_errors":[116,0,1,""],"CI_DB_result::num_fields":[51,0,1,""],"CI_Loader::get_package_paths":[103,0,1,""],"CI_Table::generate":[119,0,1,""],"CI_Config::set_item":[7,0,1,""],"CI_User_agent::platform":[88,0,1,""],"CI_DB_result::result_array":[51,0,1,""],"CI_Loader::library":[103,0,1,""],elements:[137,1,1,""],"CI_User_agent::languages":[88,0,1,""],CI_Input:[101,2,1,""],CI_Typography:[20,2,1,""],"CI_Image_lib::crop":[49,0,1,""],function_usable:[100,1,1,""],lang:[79,1,1,""],"CI_Trackback::process":[116,0,1,""],"CI_Session::mark_as_flash":[98,0,1,""],"CI_Loader::clear_vars":[103,0,1,""],CI_DB_utility:[69,2,1,""],"CI_DB_query_builder::join":[144,0,1,""],CI_Migration:[81,2,1,""],form_radio:[87,1,1,""],"CI_FTP::list_files":[143,0,1,""],"CI_User_agent::is_browser":[88,0,1,""],"CI_Trackback::send_success":[116,0,1,""],"CI_Parser::parse_string":[110,0,1,""]}},titleterms:{all:[134,31],code:[120,106],chain:144,queri:[5,89,69,120,51,44,76,144,106],month:19,prefix:[9,27,44,105],row:[125,51],content:[0,70,72,120,45,46],privat:[120,0],specif:[46,73,144],depend:25,friendli:126,send:[23,91,116],form_prep:30,digit:56,string:[5,70,120,130,30,25],fals:[120,30],util:[9,69],verb:93,my_secur:94,word:23,fadeout:39,list:[43,69,105],upload:123,"try":[45,0,123,91,46],item:[39,30,22,52,7,125],adjust:96,quick:106,sign:136,design:48,cache_on:31,pass:[9,0,19,70],download:[38,139],slidetoggl:39,compat:[25,120,96,136],index:[65,5,34,3,95],what:[0,91,72,125,27,45,98],hide:[56,39,134],sub:[9,0,129],compar:120,section:[77,74,21],current:56,delet:[144,18],version:[9,106,4,29],xss_clean:30,method:[0,144,49,74,30,51,76,120,46],metadata:[43,98],hash:25,gener:[47,126,51,24,138],is_cli_request:30,punch:126,directory_map:30,let:[45,0],cart:[125,30],address:113,path:[39,102],modifi:70,encryption_kei:73,valu:[87,120,89],convert:96,memcach:[98,60],bbedit:120,credit:122,chang:[119,46,30,95,29],portabl:73,overrid:[23,30],via:45,display_error:134,prefer:[56,23,19,49,123,81,98,69],deprec:30,instal:[47,50,127],redi:[98,60],total:37,select:144,from:[3,90,33,94,95,96,97,52,53,54,55,17,118,115,4,65,66,67,68,70,15,112,30,16,32,76,34,113,114,35,61,148,149,150],zip:107,memori:37,internation:132,upgrad:[3,90,112,94,95,96,97,52,53,54,55,17,118,115,4,65,66,67,68,15,30,16,32,33,34,113,114,35,61,148,149,150],next:[56,19],call:[0,2,94,96,124,46],type:[49,30,91],prep:46,toggl:39,form_valid:30,claus:30,benchmark:[37,77],agent:88,xss:[134,30,135,101],cach:[60,144,31,18],retriev:[43,98,69],setup:39,work:[143,73,31,44,7,98,18],uniqu:30,fetch:[132,7],aliv:141,control:[108,0,131,59,13,146,123,97,46],sqlite:30,stream:101,process:[49,0,123,91,116],time_to_upd:118,wincach:60,"404_overrid":30,templat:[138,19,110,30,126,150],topic:[47,24],captcha:140,tag:[120,146],system_url:30,read_fil:30,multipl:[132,27,129,30,14,124,125,106,141,127],goal:48,secur:[63,30,94,134,135,101],charset:35,ping:116,write:74,how:[46,73,31,98,18],url_titl:30,instead:30,csv:69,config:[56,39,23,3,49,113,30,96,7,95,34,97,52,53,35,46,118,65,123,114],updat:[125,33,94,95,96,97,52,53,54,55,17,118,115,65,66,67,68,144,15,30,16,32,112,34,113,114,35,61,148,149,150],remap:0,cache_delete_al:31,resourc:[9,40],after:30,global_xss_filt:30,random_str:30,date:[30,86],underscor:30,associ:[46,91],trim_slash:30,"short":[120,146],practic:134,light:126,issu:[30,136],callback:[46,93],"switch":132,environ:[14,7],reloc:[3,127],callabl:46,order:144,origin:10,cache_delet:31,move:[94,96,30],autoload:[95,30,52,35,118],reconnect:141,system_path:150,digest:25,paramet:[9,73,91,141],style:[120,136],group:[46,144],cli:45,fix:29,clickabl:13,main:[95,34],easier:76,good:136,"return":[120,30,129],handl:[132,134,41,14,44],auto:[132,27,72,7,40],initi:[39,9,123,125,88,91,49,98,138,19,20,104,106,107,143,69,70,110,73,77,116,119],"break":120,framework:[126,124,14],now:[27,30],introduct:47,drop_tabl:30,name:[108,0,81,69,120,30,9,46],anyth:46,edit:3,troubleshoot:58,drop:70,authent:73,separ:30,mode:[138,73,12],debug:120,register_glob:134,reset:144,weight:126,replac:[3,30,95,97,113,114,105,9],individu:46,"static":131,connect:[141,72],event:39,variabl:[108,39,120,110],ftp:143,typecast:120,space:120,miss:30,profil:[37,77],rel:56,determin:[43,69],watermark:49,migrat:81,manipul:49,free:126,standard:[25,106],cooki:[85,101],base:60,mime:[97,30,113,16],dblib:30,anchor_class:30,indent:120,befor:134,keep:141,filter:[134,30,135,101],length:[73,104],pagin:[56,30],codeignit:[5,150,9,126,127,47,12,112,94,95,96,97,52,53,133,54,55,17,118,115,148,62,68,99,26,65,66,67,28,15,30,74,16,32,33,34,113,114,35,61,136,38,149,78],timezon:86,first:56,oper:120,suffix:5,fetch_directori:30,arrai:[137,46,106,51,91],number:147,cache_off:31,hook:124,instruct:[96,50],open:120,forgeri:135,convent:9,strict:[138,12],data:[19,129,73,144,134,96,91,98,46,101],licens:71,system:105,messag:[25,46,73,104],statement:120,"final":90,slidedown:39,tool:74,fetch_method:30,user_ag:[95,114],third_parti:95,apppath:95,enclos:56,than:46,remov:[5,30,94,95,96,98,150],structur:[80,146],jqueri:39,store:[96,31,129],bind:44,consumpt:37,typographi:[42,20],ani:[96,30],dash:30,packag:103,reserv:[108,0,93],"null":[120,30],engin:126,alias:13,ancillari:117,destroi:98,rout:[131,30,93,21,22],note:[56,91,110,116,96,98,69],exampl:[56,132,81,69,60,93,143,144,106,119,107,88],thoroughli:126,mit:71,singl:106,anatomi:[91,7,72],simplifi:44,who:78,chart:128,textmat:120,beta:[90,3,29],regular:[93,44],pair:110,segment:[0,5],why:45,fetch_class:30,avail:[79,1,121,85,86,87,11,63,130,13,6,137,139,102,140,141,142,109,42,75,147,36],renam:[52,70,127],url:[5,126,30,75,116],tempdata:98,request:[135,91],uri:[0,5,30,93,145,134],doe:[126,31,18],dummi:60,ext:[95,30],bracket:120,clean:126,pars:110,hmac:73,shop:125,show:[39,19,46],text:[49,120,30,132,142],concurr:98,syntax:[146,148],session:[95,30,148,98],corner:39,xml:[91,1,69],cell:19,transact:12,configur:[39,89,73,14],folder:[96,3],local:120,info:47,contribut:[47,136],get:[133,101],express:93,nativ:9,fadein:39,csrf:[134,135],"new":[21,22],report:[138,14,136],requir:[126,74,64],enabl:[5,12,138,31,77,124,18],organ:0,common:100,default_control:30,contain:30,where:96,view:[39,129,59,110,103,146],certif:10,set:[56,27,23,19,39,49,30,93,21,7,77,69,104,105,9,46,123,73],tablesort:39,mysql:30,highlight_phras:30,result:[69,106,51,144],respons:91,close:[120,141],calendar:[19,3,39],best:134,kei:[16,104,70],databas:[65,47,89,69,70,72,30,31,44,43,76,34,140,134,98,106,141,95,84,118],label:132,dynam:129,approach:12,email:[121,23,30],attribut:56,altern:[60,146],call_funct:2,extend:[9,27,124,105],all_userdata:30,javascript:[39,30],extens:[96,30,126],popul:46,protect:[134,44],last:56,delimit:46,plugin:[39,96],pdo:30,tutori:[46,57,13,47],logic:[120,131],improv:31,load:[79,132,1,121,7,9,85,86,87,11,63,129,130,13,94,96,6,40,137,139,142,102,140,27,72,109,42,75,147,36],point:[37,124,77],overview:[46,13,26],loader:103,header:150,rpc:91,guid:[120,123,47,96,52,53,15,16,17,118,35,65,66,67,68,32,33,34,114,115,61,148,149,150],github:38,basic:[47,44],magic_quotes_runtim:134,argument:120,present:43,look:[144,119],defin:[0,124],behavior:[73,14],error:[65,12,120,30,41,14,44,91,46,150],anchor:56,loop:129,pack:126,file:[132,5,80,81,3,120,7,123,9,46,146,112,49,14,94,95,96,97,52,53,98,54,55,17,118,56,115,60,103,68,134,65,66,67,23,69,109,15,30,31,16,32,33,34,113,114,35,61,148,149,150],helper:[79,1,121,83,85,86,87,46,47,11,63,130,13,51,96,6,137,139,142,102,140,27,109,30,42,75,76,147,36],slideup:39,tabl:[69,70,120,43,95,113,116,148,119],site:[135,31],inform:76,parent:96,inflector:36,develop:10,welcom:[47,78],get_post:30,perform:31,make:76,cross:135,same:124,fragment:110,html:[6,30,119],document:[74,126,69,136],http:93,optim:69,driver:[80,28,82,60,30,73,98],effect:[39,14],user:[126,88,47,96,52,53,15,16,17,118,35,65,66,67,68,32,33,34,114,115,61,148,149,150],mani:30,php:[65,5,136,114,120,60,30,146,95,34,97,52,53,35,113,118,101],sha1:30,builder:[89,144,106],object:106,anim:39,client:91,command:45,thi:[79,1,2,121,31,85,86,87,11,63,130,13,6,137,139,102,140,142,109,42,75,147,36],model:[68,72,59,21,22,118],explan:[46,89,91],comment:120,identifi:44,execut:[76,37],tip:[98,136],"_post":46,toggleclass:39,languag:[79,132,30,3,35],previous:30,web:18,get_dir_file_info:96,add:[3,35,118],valid:[46,30,148,134],guidelin:136,input:[134,30,101],save:46,applic:[128,96,103,77,126,127],format:[120,91],world:[45,0],password:[25,134],insert:[134,106,144],do_hash:30,success:[46,123],whitespac:120,manual:[12,44,7,141],server:[101,91,64],necessari:96,cascad:46,output:[0,92],manag:[12,31,127],subhead:74,parenthet:120,"export":69,bonu:98,apc:60,librari:[47,23,39,30,73,94,138,104,111,9,98,99],confirm:150,definit:88,per:120,unit:138,overlai:49,refer:[132,82,7,84,123,86,125,46,88,47,91,49,92,51,143,95,98,135,101,56,138,19,20,60,103,81,104,25,144,107,23,69,70,110,73,31,145,116,37,119],core:[96,30,124,105],previou:[56,19,4],run:[45,138,12,127],usag:[81,69,110,60,30,143,107],step:[3,33,94,95,96,97,52,53,54,55,17,118,115,65,66,67,68,15,30,16,32,112,34,113,114,35,61,148,149,150],post:[97,101],mssql:30,about:[76,98],column:70,commun:126,page:[56,0,72,131,74,123,18,45,46],cipher:73,modal:39,constructor:[0,96],backup:69,disabl:[56,138,77],repair:69,own:[27,28,91,93,105,9,46,99],within:[9,129],encod:107,automat:[146,141],two:49,wrap:23,storag:9,your:[0,73,3,39,43,9,46,127,91,76,93,77,94,95,96,97,52,53,134,15,16,17,118,19,115,66,61,21,68,99,104,105,141,65,27,67,28,69,72,54,112,30,31,55,32,33,34,113,114,35,116,37,148,149,150,119],log:[30,29],support:[146,73,136],fast:126,custom:[56,98,138,2,73],standard_d:30,start:[106,133],flashdata:98,add_column:30,"function":[79,1,2,120,121,31,85,86,87,11,63,130,13,6,100,137,139,142,102,140,25,108,27,109,30,42,75,147,36],head:74,form:[132,30,22,123,97,87,46,101],forg:[30,70],link:[56,19],translat:46,line:[45,120,30,132],"true":120,bug:29,conclus:8,count:144,"default":[120,0,73,14,97],bugfix:29,access:[98,101],displai:[125,138,37,19,21],limit:144,sampl:132,similar:144,featur:62,constant:[108,120,30,14,95,25,16],creat:[132,138,80,28,19,70,129,105,22,123,81,91,116,9,46,117,99],get_inst:117,multibyt:25,flow:128,parser:110,decrypt:73,exist:[43,69],glanc:126,check:[97,30],echo:146,encrypt:[96,30,16,104,73],when:9,field:[43,46,13,70,87],other:46,branch:136,test:[138,106,12],imag:49,architectur:48,repeat:30,wildcard:93,"class":[132,0,73,39,120,7,125,123,117,9,46,88,91,49,92,51,143,96,98,135,101,56,138,19,20,60,103,81,104,105,144,106,107,23,69,70,110,30,31,145,77,116,37,119],sql:120,trackback:116,smilei:[13,30],markup:56,receiv:116,algorithm:73,directori:[0,11,3,129,30,80,123,127],descript:69,rule:[46,30,93],potenti:30,time:37,escap:[87,134,44],hello:[45,0]}}) |
packages/mcs-lite-mobile-web/src/containers/Password/Password.js | MCS-Lite/mcs-lite | import PropTypes from 'prop-types';
import React from 'react';
import Input from 'mcs-lite-ui/lib/Input';
import Button from 'mcs-lite-ui/lib/Button';
import MobileFixedFooter from 'mcs-lite-ui/lib/MobileFixedFooter';
import MobileHeader from 'mcs-lite-ui/lib/MobileHeader';
import validators from 'mcs-lite-ui/lib/utils/validators';
import IconMenu from 'mcs-lite-icon/lib/IconMenu';
import Helmet from 'react-helmet';
import { Link } from 'react-router';
import { updatePathname } from 'mcs-lite-ui/lib/utils/routerHelper';
import StyledLink from '../../components/StyledLink';
import { Container, Label, ButtonWrapper, StyledP } from './styled-components';
class Password extends React.Component {
static propTypes = {
// Redux Action
changePassword: PropTypes.func.isRequired,
// React-intl I18n
getMessages: PropTypes.func.isRequired,
};
state = { new1: '', new2: '' };
onChange = e => this.setState({ [e.target.name]: e.target.value });
onSubmit = e => {
this.props.changePassword({
password: this.state.new2,
message: this.props.getMessages('success'),
});
e.preventDefault();
};
render() {
const { new1, new2 } = this.state;
const { onChange, onSubmit } = this;
const { getMessages: t } = this.props;
const isNew1Error = validators.isLt8(new1);
const isNew2Error = validators.isNotEqual(new1, new2);
return (
<div>
<Helmet>
<title>{t('changePassword')}</title>
</Helmet>
<MobileHeader.MobileHeader
title={t('changePassword')}
leftChildren={
<MobileHeader.MobileHeaderIcon
component={Link}
to={updatePathname('/account')}
>
<IconMenu />
</MobileHeader.MobileHeaderIcon>
}
/>
<form onSubmit={onSubmit}>
<main>
<Container>
<div>
<Label htmlFor="new1">{t('newPassword.label')}</Label>
<Input
name="new1"
value={new1}
onChange={onChange}
placeholder={t('newPassword.placeholder')}
type="password"
required
kind={isNew1Error ? 'error' : 'primary'}
/>
{isNew1Error && (
<StyledP color="error">{t('lengthError')}</StyledP>
)}
</div>
<div>
<Label htmlFor="new2">{t('newPasswordAgain.label')}</Label>
<Input
name="new2"
value={new2}
onChange={onChange}
placeholder={t('newPasswordAgain.placeholder')}
type="password"
required
kind={isNew2Error ? 'error' : 'primary'}
/>
{isNew2Error && (
<StyledP color="error">{t('newPasswordAgain.error')}</StyledP>
)}
</div>
</Container>
</main>
<MobileFixedFooter>
<ButtonWrapper>
<StyledLink to={updatePathname('/account')}>
<Button kind="default" block>
{t('cancel')}
</Button>
</StyledLink>
<Button component="input" type="submit" value={t('save')} block />
</ButtonWrapper>
</MobileFixedFooter>
</form>
</div>
);
}
}
export default Password;
|
packages/mui-icons-material/lib/esm/Looks6Outlined.js | oliviertassinari/material-ui | import createSvgIcon from './utils/createSvgIcon';
import { jsx as _jsx } from "react/jsx-runtime";
export default createSvgIcon( /*#__PURE__*/_jsx("path", {
d: "M11 17h2c1.1 0 2-.89 2-2v-2c0-1.11-.9-2-2-2h-2V9h4V7h-4c-1.1 0-2 .89-2 2v6c0 1.11.9 2 2 2zm0-4h2v2h-2v-2zm8-10H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z"
}), 'Looks6Outlined'); |
src/Parser/Mage/Frost/Modules/Features/SplittingIce.js | hasseboulen/WoWAnalyzer | import React from 'react';
import SPELLS from 'common/SPELLS';
import SpellIcon from 'common/SpellIcon';
import { formatPercentage } from 'common/format';
import StatisticBox, { STATISTIC_ORDER } from 'Main/StatisticBox';
import Combatants from 'Parser/Core/Modules/Combatants';
import Analyzer from 'Parser/Core/Analyzer';
import { encodeTargetString } from 'Parser/Core/Modules/EnemyInstances';
import calculateEffectiveDamage from 'Parser/Core/calculateEffectiveDamage';
const debug = false;
const DAMAGE_BONUS = 0.05;
const GLACIAL_SPIKE_BONUS_PORTION = 0.65; // GS benefits from Icicles in it, but totals less than the full 5%. This number currently a guess.
class SplittingIce extends Analyzer {
static dependencies = {
combatants: Combatants,
}
cleaveDamage = 0; // all damage to secondary target
boostDamage = 0; // damage to primary target attributable to boost
castTarget; // player's last directly targeted foe, used to tell which hit was on primary target
on_initialized() {
this.active = this.combatants.selected.hasTalent(SPELLS.SPLITTING_ICE_TALENT.id);
this.hasGlacialSpike = this.combatants.selected.hasTalent(SPELLS.GLACIAL_SPIKE_TALENT.id);
}
on_byPlayer_cast(event) {
const spellId = event.ability.guid;
// we check Frostbolt cast even though it doesn't split because it can launch overcapped icicles.
if(spellId !== SPELLS.ICE_LANCE.id && spellId !== SPELLS.FROSTBOLT.id && spellId !== SPELLS.GLACIAL_SPIKE_TALENT.id) {
return;
}
if(event.targetID) {
this.castTarget = encodeTargetString(event.targetID, event.targetInstance);
}
}
on_byPlayer_damage(event) {
const spellId = event.ability.guid;
if(spellId !== SPELLS.ICE_LANCE_DAMAGE.id && spellId !== SPELLS.ICICLE_DAMAGE.id && spellId !== SPELLS.GLACIAL_SPIKE_DAMAGE.id) {
return;
}
const damageTarget = encodeTargetString(event.targetID, event.targetInstance);
if(this.castTarget === damageTarget) {
let damageBonus = DAMAGE_BONUS;
if(spellId === SPELLS.GLACIAL_SPIKE_DAMAGE.id) {
damageBonus *= GLACIAL_SPIKE_BONUS_PORTION;
}
this.boostDamage += calculateEffectiveDamage(event, damageBonus);
} else {
this.cleaveDamage += event.amount + (event.absorbed || 0);
if(debug) { console.log(`Splitting Ice cleave for ${event.amount + (event.absorbed || 0)} : castTarget=${this.castTarget} damageTarget=${damageTarget}`); }
}
}
get damage() {
return this.cleaveDamage + this.boostDamage;
}
get damagePercent() {
return this.owner.getPercentageOfTotalDamageDone(this.damage);
}
get cleaveDamagePercent() {
return this.owner.getPercentageOfTotalDamageDone(this.cleaveDamage);
}
get boostDamagePercent() {
return this.owner.getPercentageOfTotalDamageDone(this.boostDamage);
}
statistic() {
return (
<StatisticBox
icon={<SpellIcon id={SPELLS.SPLITTING_ICE_TALENT.id} />}
value={`${this.hasGlacialSpike ? '≈' : ''}${formatPercentage(this.damagePercent)} %`}
label="Splitting Ice damage"
tooltip={`This is all the secondary target damage summed with the portion of primary target damage attributable to Splitting Ice.${this.hasGlacialSpike ? ' Because only the icicles inside each Glacial Spike are boosted, the damage bonus to Glacial Spike is estimated.' : ''}
<ul>
<li>Primary Target Boosted: <b>${this.hasGlacialSpike ? '≈' : ''}${formatPercentage(this.boostDamagePercent)}%</b></li>
<li>Secondary Target Total: <b>${formatPercentage(this.cleaveDamagePercent)}%</b></li>
</ul>
`}
/>
);
}
statisticOrder = STATISTIC_ORDER.OPTIONAL(10);
}
export default SplittingIce;
|
labware-library/src/components/LabwareDetails/WellDimensions.js | OpenTrons/opentrons_sdk | // @flow
// well dimensions and spacing for details page
import * as React from 'react'
import round from 'lodash/round'
import {
MEASUREMENTS,
WELL_X_DIM,
WELL_Y_DIM,
DIAMETER,
DEPTH,
TOTAL_LENGTH,
MM,
} from '../../localization'
import { LabeledValueTable, LowercaseText } from '../ui'
import { getMeasurementDiagram } from '../measurement-guide'
import type { LabwareWellGroupProperties, LabwareParameters } from '../../types'
// safe toFixed
const toFixed = (n: number): string => round(n, 2).toFixed(2)
export type WellDimensionsProps = {|
labwareParams: LabwareParameters,
wellProperties: LabwareWellGroupProperties,
wellLabel: string,
category: string,
labelSuffix?: string,
className?: string,
|}
export function WellDimensions(props: WellDimensionsProps): React.Node {
const {
labwareParams,
wellProperties,
wellLabel,
labelSuffix,
className,
category,
} = props
const {
shape,
depth,
metadata: { wellBottomShape },
} = wellProperties
const { isTiprack, tipLength } = labwareParams
const dimensions = []
if (isTiprack && tipLength) {
dimensions.push({ label: TOTAL_LENGTH, value: toFixed(tipLength) })
} else if (depth) {
dimensions.push({ label: DEPTH, value: toFixed(depth) })
}
if (shape) {
if (shape.shape === 'circular') {
dimensions.push({ label: DIAMETER, value: toFixed(shape.diameter) })
} else if (shape.shape === 'rectangular') {
dimensions.push(
{ label: WELL_X_DIM, value: toFixed(shape.xDimension) },
{ label: WELL_Y_DIM, value: toFixed(shape.yDimension) }
)
}
}
const diagram = getMeasurementDiagram({
category: category,
guideType: 'measurements',
shape: shape?.shape,
wellBottomShape: wellBottomShape,
}).map((src, index) => <img src={src} key={index} />)
return (
<LabeledValueTable
className={className}
label={
<>
{wellLabel} {MEASUREMENTS} <LowercaseText>({MM})</LowercaseText>{' '}
{labelSuffix || ''}
</>
}
values={dimensions}
diagram={diagram}
/>
)
}
|
ajax/libs/yui/3.4.0pr2/yui/yui.js | blairvanderhoof/cdnjs | /**
* The YUI module contains the components required for building the YUI seed
* file. This includes the script loading mechanism, a simple queue, and
* the core utilities for the library.
* @module yui
* @submodule yui-base
*/
if (typeof YUI != 'undefined') {
YUI._YUI = YUI;
}
/**
* The YUI global namespace object. If YUI is already defined, the
* existing YUI object will not be overwritten so that defined
* namespaces are preserved. It is the constructor for the object
* the end user interacts with. As indicated below, each instance
* has full custom event support, but only if the event system
* is available. This is a self-instantiable factory function. You
* can invoke it directly like this:
*
* YUI().use('*', function(Y) {
* // ready
* });
*
* But it also works like this:
*
* var Y = YUI();
*
* @class YUI
* @constructor
* @global
* @uses EventTarget
* @param o* {object} 0..n optional configuration objects. these values
* are store in Y.config. See config for the list of supported
* properties.
*/
/*global YUI*/
/*global YUI_config*/
var YUI = function() {
var i = 0,
Y = this,
args = arguments,
l = args.length,
instanceOf = function(o, type) {
return (o && o.hasOwnProperty && (o instanceof type));
},
gconf = (typeof YUI_config !== 'undefined') && YUI_config;
if (!(instanceOf(Y, YUI))) {
Y = new YUI();
} else {
// set up the core environment
Y._init();
// YUI.GlobalConfig is a master configuration that might span
// multiple contexts in a non-browser environment. It is applied
// first to all instances in all contexts.
if (YUI.GlobalConfig) {
Y.applyConfig(YUI.GlobalConfig);
}
// YUI_Config is a page-level config. It is applied to all
// instances created on the page. This is applied after
// YUI.GlobalConfig, and before the instance level configuration
// objects.
if (gconf) {
Y.applyConfig(gconf);
}
// bind the specified additional modules for this instance
if (!l) {
Y._setup();
}
}
if (l) {
// Each instance can accept one or more configuration objects.
// These are applied after YUI.GlobalConfig and YUI_Config,
// overriding values set in those config files if there is a '
// matching property.
for (; i < l; i++) {
Y.applyConfig(args[i]);
}
Y._setup();
}
Y.instanceOf = instanceOf;
return Y;
};
(function() {
var proto, prop,
VERSION = '@VERSION@',
PERIOD = '.',
BASE = 'http://yui.yahooapis.com/',
DOC_LABEL = 'yui3-js-enabled',
NOOP = function() {},
SLICE = Array.prototype.slice,
APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo
'io.xdrResponse': 1, // can call. this should
'SWF.eventHandler': 1 }, // be done at build time
hasWin = (typeof window != 'undefined'),
win = (hasWin) ? window : null,
doc = (hasWin) ? win.document : null,
docEl = doc && doc.documentElement,
docClass = docEl && docEl.className,
instances = {},
time = new Date().getTime(),
add = function(el, type, fn, capture) {
if (el && el.addEventListener) {
el.addEventListener(type, fn, capture);
} else if (el && el.attachEvent) {
el.attachEvent('on' + type, fn);
}
},
remove = function(el, type, fn, capture) {
if (el && el.removeEventListener) {
// this can throw an uncaught exception in FF
try {
el.removeEventListener(type, fn, capture);
} catch (ex) {}
} else if (el && el.detachEvent) {
el.detachEvent('on' + type, fn);
}
},
handleLoad = function() {
YUI.Env.windowLoaded = true;
YUI.Env.DOMReady = true;
if (hasWin) {
remove(window, 'load', handleLoad);
}
},
getLoader = function(Y, o) {
var loader = Y.Env._loader;
if (loader) {
//loader._config(Y.config);
loader.ignoreRegistered = false;
loader.onEnd = null;
loader.data = null;
loader.required = [];
loader.loadType = null;
} else {
loader = new Y.Loader(Y.config);
Y.Env._loader = loader;
}
return loader;
},
clobber = function(r, s) {
for (var i in s) {
if (s.hasOwnProperty(i)) {
r[i] = s[i];
}
}
},
ALREADY_DONE = { success: true };
// Stamp the documentElement (HTML) with a class of "yui-loaded" to
// enable styles that need to key off of JS being enabled.
if (docEl && docClass.indexOf(DOC_LABEL) == -1) {
if (docClass) {
docClass += ' ';
}
docClass += DOC_LABEL;
docEl.className = docClass;
}
if (VERSION.indexOf('@') > -1) {
VERSION = '3.3.0'; // dev time hack for cdn test
}
proto = {
/**
* Applies a new configuration object to the YUI instance config.
* This will merge new group/module definitions, and will also
* update the loader cache if necessary. Updating Y.config directly
* will not update the cache.
* @method applyConfig
* @param {object} the configuration object.
* @since 3.2.0
*/
applyConfig: function(o) {
o = o || NOOP;
var attr,
name,
// detail,
config = this.config,
mods = config.modules,
groups = config.groups,
rls = config.rls,
loader = this.Env._loader;
for (name in o) {
if (o.hasOwnProperty(name)) {
attr = o[name];
if (mods && name == 'modules') {
clobber(mods, attr);
} else if (groups && name == 'groups') {
clobber(groups, attr);
} else if (rls && name == 'rls') {
clobber(rls, attr);
} else if (name == 'win') {
config[name] = attr.contentWindow || attr;
config.doc = config[name].document;
} else if (name == '_yuid') {
// preserve the guid
} else {
config[name] = attr;
}
}
}
if (loader) {
loader._config(o);
}
},
_config: function(o) {
this.applyConfig(o);
},
/**
* Initialize this YUI instance
* @private
*/
_init: function() {
var filter,
Y = this,
G_ENV = YUI.Env,
Env = Y.Env,
prop;
/**
* The version number of the YUI instance.
* @property version
* @type string
*/
Y.version = VERSION;
if (!Env) {
Y.Env = {
mods: {}, // flat module map
versions: {}, // version module map
base: BASE,
cdn: BASE + VERSION + '/build/',
// bootstrapped: false,
_idx: 0,
_used: {},
_attached: {},
_missed: [],
_yidx: 0,
_uidx: 0,
_guidp: 'y',
_loaded: {},
// serviced: {},
// Regex in English:
// I'll start at the \b(simpleyui).
// 1. Look in the test string for "simpleyui" or "yui" or
// "yui-base" or "yui-rls" or "yui-foobar" that comes after a word break. That is, it
// can't match "foyui" or "i_heart_simpleyui". This can be anywhere in the string.
// 2. After #1 must come a forward slash followed by the string matched in #1, so
// "yui-base/yui-base" or "simpleyui/simpleyui" or "yui-pants/yui-pants".
// 3. The second occurence of the #1 token can optionally be followed by "-debug" or "-min",
// so "yui/yui-min", "yui/yui-debug", "yui-base/yui-base-debug". NOT "yui/yui-tshirt".
// 4. This is followed by ".js", so "yui/yui.js", "simpleyui/simpleyui-min.js"
// 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a "?" in the string,
// then capture the junk between the LAST "&" and the string in 1-4. So
// "blah?foo/yui/yui.js" will capture "foo/" and "blah?some/thing.js&3.3.0/build/yui-rls/yui-rls.js"
// will capture "3.3.0/build/"
//
// Regex Exploded:
// (?:\? Find a ?
// (?:[^&]*&) followed by 0..n characters followed by an &
// * in fact, find as many sets of characters followed by a & as you can
// ([^&]*) capture the stuff after the last & in \1
// )? but it's ok if all this ?junk&more_junk stuff isn't even there
// \b(simpleyui| after a word break find either the string "simpleyui" or
// yui(?:-\w+)? the string "yui" optionally followed by a -, then more characters
// ) and store the simpleyui or yui-* string in \2
// \/\2 then comes a / followed by the simpleyui or yui-* string in \2
// (?:-(min|debug))? optionally followed by "-min" or "-debug"
// .js and ending in ".js"
_BASE_RE: /(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,
parseBasePath: function(src, pattern) {
var match = src.match(pattern),
path, filter;
if (match) {
path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));
// this is to set up the path to the loader. The file
// filter for loader should match the yui include.
filter = match[3];
// extract correct path for mixed combo urls
// http://yuilibrary.com/projects/yui3/ticket/2528423
if (match[1]) {
path += '?' + match[1];
}
path = {
filter: filter,
path: path
}
}
return path;
},
getBase: G_ENV && G_ENV.getBase ||
function(pattern) {
var nodes = (doc && doc.getElementsByTagName('script')) || [],
path = Env.cdn, parsed,
i, len, src;
for (i = 0, len = nodes.length; i < len; ++i) {
src = nodes[i].src;
if (src) {
parsed = Y.Env.parseBasePath(src, pattern);
if (parsed) {
filter = parsed.filter;
path = parsed.path;
break;
}
}
}
// use CDN default
return path;
}
};
Env = Y.Env;
Env._loaded[VERSION] = {};
if (G_ENV && Y !== YUI) {
Env._yidx = ++G_ENV._yidx;
Env._guidp = ('yui_' + VERSION + '_' +
Env._yidx + '_' + time).replace(/\./g, '_');
} else if (YUI._YUI) {
G_ENV = YUI._YUI.Env;
Env._yidx += G_ENV._yidx;
Env._uidx += G_ENV._uidx;
for (prop in G_ENV) {
if (!(prop in Env)) {
Env[prop] = G_ENV[prop];
}
}
delete YUI._YUI;
}
Y.id = Y.stamp(Y);
instances[Y.id] = Y;
}
Y.constructor = YUI;
// configuration defaults
Y.config = Y.config || {
win: win,
doc: doc,
debug: true,
useBrowserConsole: true,
throwFail: true,
bootstrap: true,
cacheUse: true,
fetchCSS: true,
use_rls: false
};
Y.config.lang = Y.config.lang || 'en-US';
Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);
if (!filter || (!('mindebug').indexOf(filter))) {
filter = 'min';
}
filter = (filter) ? '-' + filter : filter;
Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';
},
/**
* Finishes the instance setup. Attaches whatever modules were defined
* when the yui modules was registered.
* @method _setup
* @private
*/
_setup: function(o) {
var i, Y = this,
core = [],
mods = YUI.Env.mods,
extras = Y.config.core || ['get','features','intl-base','yui-log','yui-later','loader-base', 'loader-rollup', 'loader-yui3'];
for (i = 0; i < extras.length; i++) {
if (mods[extras[i]]) {
core.push(extras[i]);
}
}
Y._attach(['yui-base']);
Y._attach(core);
},
/**
* Executes a method on a YUI instance with
* the specified id if the specified method is whitelisted.
* @method applyTo
* @param id {string} the YUI instance id.
* @param method {string} the name of the method to exectute.
* Ex: 'Object.keys'.
* @param args {Array} the arguments to apply to the method.
* @return {object} the return value from the applied method or null.
*/
applyTo: function(id, method, args) {
if (!(method in APPLY_TO_AUTH)) {
this.log(method + ': applyTo not allowed', 'warn', 'yui');
return null;
}
var instance = instances[id], nest, m, i;
if (instance) {
nest = method.split('.');
m = instance;
for (i = 0; i < nest.length; i = i + 1) {
m = m[nest[i]];
if (!m) {
this.log('applyTo not found: ' + method, 'warn', 'yui');
}
}
return m.apply(instance, args);
}
return null;
},
/**
* Registers a module with the YUI global. The easiest way to create a
* first-class YUI module is to use the YUI component build tool.
*
* http://yuilibrary.com/projects/builder
*
* The build system will produce the YUI.add wrapper for you module, along
* with any configuration info required for the module.
* @method add
* @param name {string} module name.
* @param fn {Function} entry point into the module that
* is used to bind module to the YUI instance.
* @param version {string} version string.
* @param details {object} optional config data:
* requires: features that must be present before this module can be
* attached.
* optional: optional features that should be present if loadOptional
* is defined. Note: modules are not often loaded this way in YUI 3,
* but this field is still useful to inform the user that certain
* features in the component will require additional dependencies.
* use: features that are included within this module which need to
* be attached automatically when this module is attached. This
* supports the YUI 3 rollup system -- a module with submodules
* defined will need to have the submodules listed in the 'use'
* config. The YUI component build tool does this for you.
* @return {YUI} the YUI instance.
*
*/
add: function(name, fn, version, details) {
details = details || {};
var env = YUI.Env,
mod = {
name: name,
fn: fn,
version: version,
details: details
},
loader,
i, versions = env.versions;
env.mods[name] = mod;
versions[version] = versions[version] || {};
versions[version][name] = mod;
for (i in instances) {
if (instances.hasOwnProperty(i)) {
loader = instances[i].Env._loader;
if (loader) {
if (!loader.moduleInfo[name]) {
loader.addModule(details, name);
}
}
}
}
return this;
},
/**
* Executes the function associated with each required
* module, binding the module to the YUI instance.
* @method _attach
* @private
*/
_attach: function(r, moot) {
var i, name, mod, details, req, use, after,
mods = YUI.Env.mods,
aliases = YUI.Env.aliases,
Y = this, j,
done = Y.Env._attached,
len = r.length, loader;
//console.info('attaching: ' + r, 'info', 'yui');
for (i = 0; i < len; i++) {
if (!done[r[i]]) {
name = r[i];
mod = mods[name];
if (aliases && aliases[name]) {
Y._attach(aliases[name]);
continue;
}
if (!mod) {
loader = Y.Env._loader;
if (loader && loader.moduleInfo[name]) {
mod = loader.moduleInfo[name];
if (mod.use) {
moot = true;
}
}
//if (!loader || !loader.moduleInfo[name]) {
//if ((!loader || !loader.moduleInfo[name]) && !moot) {
if (!moot) {
if (name.indexOf('skin-') === -1) {
Y.Env._missed.push(name);
Y.message('NOT loaded: ' + name, 'warn', 'yui');
}
}
} else {
done[name] = true;
//Don't like this, but in case a mod was asked for once, then we fetch it
//We need to remove it from the missed list
for (j = 0; j < Y.Env._missed.length; j++) {
if (Y.Env._missed[j] === name) {
Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');
Y.Env._missed.splice(j, 1);
}
}
details = mod.details;
req = details.requires;
use = details.use;
after = details.after;
if (req) {
for (j = 0; j < req.length; j++) {
if (!done[req[j]]) {
if (!Y._attach(req)) {
return false;
}
break;
}
}
}
if (after) {
for (j = 0; j < after.length; j++) {
if (!done[after[j]]) {
if (!Y._attach(after, true)) {
return false;
}
break;
}
}
}
if (mod.fn) {
try {
mod.fn(Y, name);
} catch (e) {
Y.error('Attach error: ' + name, e, name);
return false;
}
}
if (use) {
for (j = 0; j < use.length; j++) {
if (!done[use[j]]) {
if (!Y._attach(use)) {
return false;
}
break;
}
}
}
}
}
}
return true;
},
/**
* Attaches one or more modules to the YUI instance. When this
* is executed, the requirements are analyzed, and one of
* several things can happen:
*
* - All requirements are available on the page -- The modules
* are attached to the instance. If supplied, the use callback
* is executed synchronously.
*
* - Modules are missing, the Get utility is not available OR
* the 'bootstrap' config is false -- A warning is issued about
* the missing modules and all available modules are attached.
*
* - Modules are missing, the Loader is not available but the Get
* utility is and boostrap is not false -- The loader is bootstrapped
* before doing the following....
*
* - Modules are missing and the Loader is available -- The loader
* expands the dependency tree and fetches missing modules. When
* the loader is finshed the callback supplied to use is executed
* asynchronously.
*
* @param modules* {string} 1-n modules to bind (uses arguments array).
* @param *callback {function} callback function executed when
* the instance has the required functionality. If included, it
* must be the last parameter.
* <code>
* // loads and attaches dd and its dependencies
* YUI().use('dd', function(Y) {});
* // loads and attaches dd and node as well as all of their dependencies
* YUI().use(['dd', 'node'], function(Y) {});
* // attaches all modules that are available on the page
* YUI().use('*', function(Y) {});
* // intrinsic YUI gallery support (since 3.1.0)
* YUI().use('gallery-yql', function(Y) {});
* // intrinsic YUI 2in3 support (since 3.1.0)
* YUI().use('yui2-datatable', function(Y) {});.
* </code>
*
* @return {YUI} the YUI instance.
*/
use: function() {
var args = SLICE.call(arguments, 0),
callback = args[args.length - 1],
Y = this,
i = 0,
name,
Env = Y.Env,
provisioned = true;
// The last argument supplied to use can be a load complete callback
if (Y.Lang.isFunction(callback)) {
args.pop();
} else {
callback = null;
}
if (Y.Lang.isArray(args[0])) {
args = args[0];
}
if (Y.config.cacheUse) {
while ((name = args[i++])) {
if (!Env._attached[name]) {
provisioned = false;
break;
}
}
if (provisioned) {
if (args.length) {
}
Y._notify(callback, ALREADY_DONE, args);
return Y;
}
}
if (Y.config.cacheUse) {
while ((name = args[i++])) {
if (!Env._attached[name]) {
provisioned = false;
break;
}
}
if (provisioned) {
if (args.length) {
}
Y._notify(callback, ALREADY_DONE, args);
return Y;
}
}
if (Y._loading) {
Y._useQueue = Y._useQueue || new Y.Queue();
Y._useQueue.add([args, callback]);
} else {
Y._use(args, function(Y, response) {
Y._notify(callback, response, args);
});
}
return Y;
},
_notify: function(callback, response, args) {
if (!response.success && this.config.loadErrorFn) {
this.config.loadErrorFn.call(this, this, callback, response, args);
} else if (callback) {
try {
callback(this, response);
} catch (e) {
this.error('use callback error', e, args);
}
}
},
_use: function(args, callback) {
if (!this.Array) {
this._attach(['yui-base']);
}
var len, loader, handleBoot, handleRLS,
Y = this,
G_ENV = YUI.Env,
mods = G_ENV.mods,
Env = Y.Env,
used = Env._used,
queue = G_ENV._loaderQueue,
firstArg = args[0],
YArray = Y.Array,
config = Y.config,
boot = config.bootstrap,
missing = [],
r = [],
ret = true,
fetchCSS = config.fetchCSS,
process = function(names, skip) {
if (!names.length) {
return;
}
YArray.each(names, function(name) {
// add this module to full list of things to attach
if (!skip) {
r.push(name);
}
// only attach a module once
if (used[name]) {
return;
}
var m = mods[name], req, use;
if (m) {
used[name] = true;
req = m.details.requires;
use = m.details.use;
} else {
// CSS files don't register themselves, see if it has
// been loaded
if (!G_ENV._loaded[VERSION][name]) {
missing.push(name);
} else {
used[name] = true; // probably css
}
}
// make sure requirements are attached
if (req && req.length) {
process(req);
}
// make sure we grab the submodule dependencies too
if (use && use.length) {
process(use, 1);
}
});
},
handleLoader = function(fromLoader) {
var response = fromLoader || {
success: true,
msg: 'not dynamic'
},
redo, origMissing,
ret = true,
data = response.data;
Y._loading = false;
if (data) {
origMissing = missing;
missing = [];
r = [];
process(data);
redo = missing.length;
if (redo) {
if (missing.sort().join() ==
origMissing.sort().join()) {
redo = false;
}
}
}
if (redo && data) {
Y._loading = false;
Y._use(args, function() {
if (Y._attach(data)) {
Y._notify(callback, response, data);
}
});
} else {
if (data) {
ret = Y._attach(data);
}
if (ret) {
Y._notify(callback, response, args);
}
}
if (Y._useQueue && Y._useQueue.size() && !Y._loading) {
Y._use.apply(Y, Y._useQueue.next());
}
};
// YUI().use('*'); // bind everything available
if (firstArg === '*') {
ret = Y._attach(Y.Object.keys(mods));
if (ret) {
handleLoader();
}
return Y;
}
// use loader to expand dependencies and sort the
// requirements if it is available.
if (boot && Y.Loader && args.length) {
loader = getLoader(Y);
loader.require(args);
loader.ignoreRegistered = true;
loader.calculate(null, (fetchCSS) ? null : 'js');
args = loader.sorted;
}
// process each requirement and any additional requirements
// the module metadata specifies
process(args);
len = missing.length;
if (len) {
missing = Y.Object.keys(YArray.hash(missing));
len = missing.length;
}
// dynamic load
if (boot && len && Y.Loader) {
Y._loading = true;
loader = getLoader(Y);
loader.onEnd = handleLoader;
loader.context = Y;
loader.data = args;
loader.ignoreRegistered = false;
loader.require(args);
loader.insert(null, (fetchCSS) ? null : 'js');
// loader.partial(missing, (fetchCSS) ? null : 'js');
} else if (len && Y.config.use_rls) {
G_ENV._rls_queue = G_ENV._rls_queue || new Y.Queue();
// server side loader service
handleRLS = function(instance, argz) {
var rls_end = function(o) {
handleLoader(o);
G_ENV._rls_in_progress = false;
if (G_ENV._rls_queue.size()) {
G_ENV._rls_queue.next()();
}
},
rls_url = instance._rls(argz);
if (rls_url) {
instance.rls_oncomplete(function(o) {
rls_end(o);
});
instance.Get.script(rls_url, {
data: argz
});
} else {
rls_end({
data: argz
});
}
};
G_ENV._rls_queue.add(function() {
G_ENV._rls_in_progress = true;
Y.rls_locals(Y, args, handleRLS);
});
if (!G_ENV._rls_in_progress && G_ENV._rls_queue.size()) {
G_ENV._rls_queue.next()();
}
} else if (boot && len && Y.Get && !Env.bootstrapped) {
Y._loading = true;
handleBoot = function() {
Y._loading = false;
queue.running = false;
Env.bootstrapped = true;
if (Y._attach(['loader'])) {
Y._use(args, callback);
}
};
if (G_ENV._bootstrapping) {
queue.add(handleBoot);
} else {
G_ENV._bootstrapping = true;
Y.Get.script(config.base + config.loaderPath, {
onEnd: handleBoot
});
}
} else {
ret = Y._attach(args);
if (ret) {
handleLoader();
}
}
return Y;
},
/**
* Returns the namespace specified and creates it if it doesn't exist
* <pre>
* YUI.namespace("property.package");
* YUI.namespace("YAHOO.property.package");
* </pre>
* Either of the above would create YUI.property, then
* YUI.property.package (YAHOO is scrubbed out, this is
* to remain compatible with YUI2)
*
* Be careful when naming packages. Reserved words may work in some browsers
* and not others. For instance, the following will fail in Safari:
* <pre>
* YUI.namespace("really.long.nested.namespace");
* </pre>
* This fails because "long" is a future reserved word in ECMAScript
*
* @method namespace
* @param {string*} arguments 1-n namespaces to create.
* @return {object} A reference to the last namespace object created.
*/
namespace: function() {
var a = arguments, o = this, i = 0, j, d, arg;
for (; i < a.length; i++) {
// d = ('' + a[i]).split('.');
arg = a[i];
if (arg.indexOf(PERIOD)) {
d = arg.split(PERIOD);
for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {
o[d[j]] = o[d[j]] || {};
o = o[d[j]];
}
} else {
o[arg] = o[arg] || {};
}
}
return o;
},
// this is replaced if the log module is included
log: NOOP,
message: NOOP,
// this is replaced if the dump module is included
dump: NOOP,
/**
* Report an error. The reporting mechanism is controled by
* the 'throwFail' configuration attribute. If throwFail is
* not specified, the message is written to the Logger, otherwise
* a JS error is thrown
* @method error
* @param msg {string} the error message.
* @param e {Error|string} Optional JS error that was caught, or an error string.
* @param data Optional additional info
* and throwFail is specified, this error will be re-thrown.
* @return {YUI} this YUI instance.
*/
error: function(msg, e, data) {
var Y = this, ret;
if (Y.config.errorFn) {
ret = Y.config.errorFn.apply(Y, arguments);
}
if (Y.config.throwFail && !ret) {
throw (e || new Error(msg));
} else {
Y.message(msg, 'error'); // don't scrub this one
}
return Y;
},
/**
* Generate an id that is unique among all YUI instances
* @method guid
* @param pre {string} optional guid prefix.
* @return {string} the guid.
*/
guid: function(pre) {
var id = this.Env._guidp + '_' + (++this.Env._uidx);
return (pre) ? (pre + id) : id;
},
/**
* Returns a guid associated with an object. If the object
* does not have one, a new one is created unless readOnly
* is specified.
* @method stamp
* @param o The object to stamp.
* @param readOnly {boolean} if true, a valid guid will only
* be returned if the object has one assigned to it.
* @return {string} The object's guid or null.
*/
stamp: function(o, readOnly) {
var uid;
if (!o) {
return o;
}
// IE generates its own unique ID for dom nodes
// The uniqueID property of a document node returns a new ID
if (o.uniqueID && o.nodeType && o.nodeType !== 9) {
uid = o.uniqueID;
} else {
uid = (typeof o === 'string') ? o : o._yuid;
}
if (!uid) {
uid = this.guid();
if (!readOnly) {
try {
o._yuid = uid;
} catch (e) {
uid = null;
}
}
}
return uid;
},
/**
* Destroys the YUI instance
* @method destroy
* @since 3.3.0
*/
destroy: function() {
var Y = this;
if (Y.Event) {
Y.Event._unload();
}
delete instances[Y.id];
delete Y.Env;
delete Y.config;
}
/**
* instanceof check for objects that works around
* memory leak in IE when the item tested is
* window/document
* @method instanceOf
* @since 3.3.0
*/
};
YUI.prototype = proto;
// inheritance utilities are not available yet
for (prop in proto) {
if (proto.hasOwnProperty(prop)) {
YUI[prop] = proto[prop];
}
}
// set up the environment
YUI._init();
if (hasWin) {
// add a window load event at load time so we can capture
// the case where it fires before dynamic loading is
// complete.
add(window, 'load', handleLoad);
} else {
handleLoad();
}
YUI.Env.add = add;
YUI.Env.remove = remove;
/*global exports*/
// Support the CommonJS method for exporting our single global
if (typeof exports == 'object') {
exports.YUI = YUI;
}
}());
/**
* The config object contains all of the configuration options for
* the YUI instance. This object is supplied by the implementer
* when instantiating a YUI instance. Some properties have default
* values if they are not supplied by the implementer. This should
* not be updated directly because some values are cached. Use
* applyConfig() to update the config object on a YUI instance that
* has already been configured.
*
* @class config
* @static
*/
/**
* Allows the YUI seed file to fetch the loader component and library
* metadata to dynamically load additional dependencies.
*
* @property bootstrap
* @type boolean
* @default true
*/
/**
* Log to the browser console if debug is on and the browser has a
* supported console.
*
* @property useBrowserConsole
* @type boolean
* @default true
*/
/**
* A hash of log sources that should be logged. If specified, only
* log messages from these sources will be logged.
*
* @property logInclude
* @type object
*/
/**
* A hash of log sources that should be not be logged. If specified,
* all sources are logged if not on this list.
*
* @property logExclude
* @type object
*/
/**
* Set to true if the yui seed file was dynamically loaded in
* order to bootstrap components relying on the window load event
* and the 'domready' custom event.
*
* @property injected
* @type boolean
* @default false
*/
/**
* If throwFail is set, Y.error will generate or re-throw a JS Error.
* Otherwise the failure is logged.
*
* @property throwFail
* @type boolean
* @default true
*/
/**
* The window/frame that this instance should operate in.
*
* @property win
* @type Window
* @default the window hosting YUI
*/
/**
* The document associated with the 'win' configuration.
*
* @property doc
* @type Document
* @default the document hosting YUI
*/
/**
* A list of modules that defines the YUI core (overrides the default).
*
* @property core
* @type string[]
*/
/**
* A list of languages in order of preference. This list is matched against
* the list of available languages in modules that the YUI instance uses to
* determine the best possible localization of language sensitive modules.
* Languages are represented using BCP 47 language tags, such as "en-GB" for
* English as used in the United Kingdom, or "zh-Hans-CN" for simplified
* Chinese as used in China. The list can be provided as a comma-separated
* list or as an array.
*
* @property lang
* @type string|string[]
*/
/**
* The default date format
* @property dateFormat
* @type string
* @deprecated use configuration in DataType.Date.format() instead.
*/
/**
* The default locale
* @property locale
* @type string
* @deprecated use config.lang instead.
*/
/**
* The default interval when polling in milliseconds.
* @property pollInterval
* @type int
* @default 20
*/
/**
* The number of dynamic nodes to insert by default before
* automatically removing them. This applies to script nodes
* because remove the node will not make the evaluated script
* unavailable. Dynamic CSS is not auto purged, because removing
* a linked style sheet will also remove the style definitions.
* @property purgethreshold
* @type int
* @default 20
*/
/**
* The default interval when polling in milliseconds.
* @property windowResizeDelay
* @type int
* @default 40
*/
/**
* Base directory for dynamic loading
* @property base
* @type string
*/
/*
* The secure base dir (not implemented)
* For dynamic loading.
* @property secureBase
* @type string
*/
/**
* The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo?
* For dynamic loading.
* @property comboBase
* @type string
*/
/**
* The root path to prepend to module path for the combo service.
* Ex: 3.0.0b1/build/
* For dynamic loading.
* @property root
* @type string
*/
/**
* A filter to apply to result urls. This filter will modify the default
* path for all modules. The default path for the YUI library is the
* minified version of the files (e.g., event-min.js). The filter property
* can be a predefined filter or a custom filter. The valid predefined
* filters are:
* <dl>
* <dt>DEBUG</dt>
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* This option will automatically include the Logger widget</dd>
* <dt>RAW</dt>
* <dd>Selects the non-minified version of the library (e.g., event.js).</dd>
* </dl>
* You can also define a custom filter, which must be an object literal
* containing a search expression and a replace string:
* <pre>
* myFilter: {
* 'searchExp': "-min\\.js",
* 'replaceStr': "-debug.js"
* }
* </pre>
*
* For dynamic loading.
*
* @property filter
* @type string|object
*/
/**
* The 'skin' config let's you configure application level skin
* customizations. It contains the following attributes which
* can be specified to override the defaults:
*
* // The default skin, which is automatically applied if not
* // overriden by a component-specific skin definition.
* // Change this in to apply a different skin globally
* defaultSkin: 'sam',
*
* // This is combined with the loader base property to get
* // the default root directory for a skin.
* base: 'assets/skins/',
*
* // Any component-specific overrides can be specified here,
* // making it possible to load different skins for different
* // components. It is possible to load more than one skin
* // for a given component as well.
* overrides: {
* slider: ['capsule', 'round']
* }
*
* For dynamic loading.
*
* @property skin
*/
/**
* Hash of per-component filter specification. If specified for a given
* component, this overrides the filter config.
*
* For dynamic loading.
*
* @property filters
*/
/**
* Use the YUI combo service to reduce the number of http connections
* required to load your dependencies. Turning this off will
* disable combo handling for YUI and all module groups configured
* with a combo service.
*
* For dynamic loading.
*
* @property combine
* @type boolean
* @default true if 'base' is not supplied, false if it is.
*/
/**
* A list of modules that should never be dynamically loaded
*
* @property ignore
* @type string[]
*/
/**
* A list of modules that should always be loaded when required, even if already
* present on the page.
*
* @property force
* @type string[]
*/
/**
* Node or id for a node that should be used as the insertion point for new
* nodes. For dynamic loading.
*
* @property insertBefore
* @type string
*/
/**
* Object literal containing attributes to add to dynamically loaded script
* nodes.
* @property jsAttributes
* @type string
*/
/**
* Object literal containing attributes to add to dynamically loaded link
* nodes.
* @property cssAttributes
* @type string
*/
/**
* Number of milliseconds before a timeout occurs when dynamically
* loading nodes. If not set, there is no timeout.
* @property timeout
* @type int
*/
/**
* Callback for the 'CSSComplete' event. When dynamically loading YUI
* components with CSS, this property fires when the CSS is finished
* loading but script loading is still ongoing. This provides an
* opportunity to enhance the presentation of a loading page a little
* bit before the entire loading process is done.
*
* @property onCSS
* @type function
*/
/**
* A hash of module definitions to add to the list of YUI components.
* These components can then be dynamically loaded side by side with
* YUI via the use() method. This is a hash, the key is the module
* name, and the value is an object literal specifying the metdata
* for the module. * See Loader.addModule for the supported module
* metadata fields. Also @see groups, which provides a way to
* configure the base and combo spec for a set of modules.
* <code>
* modules: {
* mymod1: {
* requires: ['node'],
* fullpath: 'http://myserver.mydomain.com/mymod1/mymod1.js'
* },
* mymod2: {
* requires: ['mymod1'],
* fullpath: 'http://myserver.mydomain.com/mymod2/mymod2.js'
* }
* }
* </code>
*
* @property modules
* @type object
*/
/**
* A hash of module group definitions. It for each group you
* can specify a list of modules and the base path and
* combo spec to use when dynamically loading the modules. @see
* @see modules for the details about the modules part of the
* group definition.
* <code>
* groups: {
* yui2: {
* // specify whether or not this group has a combo service
* combine: true,
*
* // the base path for non-combo paths
* base: 'http://yui.yahooapis.com/2.8.0r4/build/',
*
* // the path to the combo service
* comboBase: 'http://yui.yahooapis.com/combo?',
*
* // a fragment to prepend to the path attribute when
* // when building combo urls
* root: '2.8.0r4/build/',
*
* // the module definitions
* modules: {
* yui2_yde: {
* path: "yahoo-dom-event/yahoo-dom-event.js"
* },
* yui2_anim: {
* path: "animation/animation.js",
* requires: ['yui2_yde']
* }
* }
* }
* }
* </code>
* @property modules
* @type object
*/
/**
* The loader 'path' attribute to the loader itself. This is combined
* with the 'base' attribute to dynamically load the loader component
* when boostrapping with the get utility alone.
*
* @property loaderPath
* @type string
* @default loader/loader-min.js
*/
/**
* Specifies whether or not YUI().use(...) will attempt to load CSS
* resources at all. Any truthy value will cause CSS dependencies
* to load when fetching script. The special value 'force' will
* cause CSS dependencies to be loaded even if no script is needed.
*
* @property fetchCSS
* @type boolean|string
* @default true
*/
/**
* The default gallery version to build gallery module urls
* @property gallery
* @type string
* @since 3.1.0
*/
/**
* The default YUI 2 version to build yui2 module urls. This is for
* intrinsic YUI 2 support via the 2in3 project. Also @see the '2in3'
* config for pulling different revisions of the wrapped YUI 2
* modules.
* @since 3.1.0
* @property yui2
* @type string
* @default 2.8.1
*/
/**
* The 2in3 project is a deployment of the various versions of YUI 2
* deployed as first-class YUI 3 modules. Eventually, the wrapper
* for the modules will change (but the underlying YUI 2 code will
* be the same), and you can select a particular version of
* the wrapper modules via this config.
* @since 3.1.0
* @property 2in3
* @type string
* @default 1
*/
/**
* Alternative console log function for use in environments without
* a supported native console. The function is executed in the
* YUI instance context.
* @since 3.1.0
* @property logFn
* @type Function
*/
/**
* A callback to execute when Y.error is called. It receives the
* error message and an javascript error object if Y.error was
* executed because a javascript error was caught. The function
* is executed in the YUI instance context.
*
* @since 3.2.0
* @property errorFn
* @type Function
*/
/**
* A callback to execute when the loader fails to load one or
* more resource. This could be because of a script load
* failure. It can also fail if a javascript module fails
* to register itself, but only when the 'requireRegistration'
* is true. If this function is defined, the use() callback will
* only be called when the loader succeeds, otherwise it always
* executes unless there was a javascript error when attaching
* a module.
*
* @since 3.3.0
* @property loadErrorFn
* @type Function
*/
/**
* When set to true, the YUI loader will expect that all modules
* it is responsible for loading will be first-class YUI modules
* that register themselves with the YUI global. If this is
* set to true, loader will fail if the module registration fails
* to happen after the script is loaded.
*
* @since 3.3.0
* @property requireRegistration
* @type boolean
* @default false
*/
/**
* Cache serviced use() requests.
* @since 3.3.0
* @property cacheUse
* @type boolean
* @default true
* @deprecated no longer used
*/
/**
* The parameter defaults for the remote loader service.
* Requires the rls submodule. The properties that are
* supported:
* <pre>
* m: comma separated list of module requirements. This
* must be the param name even for custom implemetations.
* v: the version of YUI to load. Defaults to the version
* of YUI that is being used.
* gv: the version of the gallery to load (@see the gallery config)
* env: comma separated list of modules already on the page.
* this must be the param name even for custom implemetations.
* lang: the languages supported on the page (@see the lang config)
* '2in3v': the version of the 2in3 wrapper to use (@see the 2in3 config).
* '2v': the version of yui2 to use in the yui 2in3 wrappers
* (@see the yui2 config)
* filt: a filter def to apply to the urls (@see the filter config).
* filts: a list of custom filters to apply per module
* (@see the filters config).
* tests: this is a map of conditional module test function id keys
* with the values of 1 if the test passes, 0 if not. This must be
* the name of the querystring param in custom templates.
*</pre>
*
* @since 3.2.0
* @property rls
*/
/**
* The base path to the remote loader service
*
* @since 3.2.0
* @property rls_base
*/
/**
* The template to use for building the querystring portion
* of the remote loader service url. The default is determined
* by the rls config -- each property that has a value will be
* represented.
*
* ex: m={m}&v={v}&env={env}&lang={lang}&filt={filt}&tests={tests}
*
*
* @since 3.2.0
* @property rls_tmpl
*/
/**
* Configure the instance to use a remote loader service instead of
* the client loader.
*
* @since 3.2.0
* @property use_rls
*/
YUI.add('yui-base', function(Y) {
/*
* YUI stub
* @module yui
* @submodule yui-base
*/
/**
* The YUI module contains the components required for building the YUI
* seed file. This includes the script loading mechanism, a simple queue,
* and the core utilities for the library.
* @module yui
* @submodule yui-base
*/
/**
* Provides core language utilites and extensions used throughout YUI.
*
* @class Lang
* @static
*/
var L = Y.Lang || (Y.Lang = {}),
STRING_PROTO = String.prototype,
TOSTRING = Object.prototype.toString,
TYPES = {
'undefined' : 'undefined',
'number' : 'number',
'boolean' : 'boolean',
'string' : 'string',
'[object Function]': 'function',
'[object RegExp]' : 'regexp',
'[object Array]' : 'array',
'[object Date]' : 'date',
'[object Error]' : 'error'
},
SUBREGEX = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,
TRIMREGEX = /^\s+|\s+$/g,
// If either MooTools or Prototype is on the page, then there's a chance that we
// can't trust "native" language features to actually be native. When this is
// the case, we take the safe route and fall back to our own non-native
// implementation.
win = Y.config.win,
unsafeNatives = win && !!(win.MooTools || win.Prototype);
/**
* Determines whether or not the provided item is an array.
*
* Returns `false` for array-like collections such as the function `arguments`
* collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to
* test for an array-like collection.
*
* @method isArray
* @param o The object to test.
* @return {boolean} true if o is an array.
* @static
*/
L.isArray = (!unsafeNatives && Array.isArray) || function (o) {
return L.type(o) === 'array';
};
/**
* Determines whether or not the provided item is a boolean.
* @method isBoolean
* @static
* @param o The object to test.
* @return {boolean} true if o is a boolean.
*/
L.isBoolean = function(o) {
return typeof o === 'boolean';
};
/**
* <p>
* Determines whether or not the provided item is a function.
* Note: Internet Explorer thinks certain functions are objects:
* </p>
*
* <pre>
* var obj = document.createElement("object");
* Y.Lang.isFunction(obj.getAttribute) // reports false in IE
*
* var input = document.createElement("input"); // append to body
* Y.Lang.isFunction(input.focus) // reports false in IE
* </pre>
*
* <p>
* You will have to implement additional tests if these functions
* matter to you.
* </p>
*
* @method isFunction
* @static
* @param o The object to test.
* @return {boolean} true if o is a function.
*/
L.isFunction = function(o) {
return L.type(o) === 'function';
};
/**
* Determines whether or not the supplied item is a date instance.
* @method isDate
* @static
* @param o The object to test.
* @return {boolean} true if o is a date.
*/
L.isDate = function(o) {
return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);
};
/**
* Determines whether or not the provided item is null.
* @method isNull
* @static
* @param o The object to test.
* @return {boolean} true if o is null.
*/
L.isNull = function(o) {
return o === null;
};
/**
* Determines whether or not the provided item is a legal number.
* @method isNumber
* @static
* @param o The object to test.
* @return {boolean} true if o is a number.
*/
L.isNumber = function(o) {
return typeof o === 'number' && isFinite(o);
};
/**
* Determines whether or not the provided item is of type object
* or function. Note that arrays are also objects, so
* <code>Y.Lang.isObject([]) === true</code>.
* @method isObject
* @static
* @param o The object to test.
* @param failfn {boolean} fail if the input is a function.
* @return {boolean} true if o is an object.
* @see isPlainObject
*/
L.isObject = function(o, failfn) {
var t = typeof o;
return (o && (t === 'object' ||
(!failfn && (t === 'function' || L.isFunction(o))))) || false;
};
/**
* Determines whether or not the provided item is a string.
* @method isString
* @static
* @param o The object to test.
* @return {boolean} true if o is a string.
*/
L.isString = function(o) {
return typeof o === 'string';
};
/**
* Determines whether or not the provided item is undefined.
* @method isUndefined
* @static
* @param o The object to test.
* @return {boolean} true if o is undefined.
*/
L.isUndefined = function(o) {
return typeof o === 'undefined';
};
/**
* Returns a string without any leading or trailing whitespace. If
* the input is not a string, the input will be returned untouched.
* @method trim
* @static
* @param s {string} the string to trim.
* @return {string} the trimmed string.
*/
L.trim = STRING_PROTO.trim ? function(s) {
return s && s.trim ? s.trim() : s;
} : function (s) {
try {
return s.replace(TRIMREGEX, '');
} catch (e) {
return s;
}
};
/**
* Returns a string without any leading whitespace.
* @method trimLeft
* @static
* @param s {string} the string to trim.
* @return {string} the trimmed string.
*/
L.trimLeft = STRING_PROTO.trimLeft ? function (s) {
return s.trimLeft();
} : function (s) {
return s.replace(/^\s+/, '');
};
/**
* Returns a string without any trailing whitespace.
* @method trimRight
* @static
* @param s {string} the string to trim.
* @return {string} the trimmed string.
*/
L.trimRight = STRING_PROTO.trimRight ? function (s) {
return s.trimRight();
} : function (s) {
return s.replace(/\s+$/, '');
};
/**
* A convenience method for detecting a legitimate non-null value.
* Returns false for null/undefined/NaN, true for other values,
* including 0/false/''
* @method isValue
* @static
* @param o The item to test.
* @return {boolean} true if it is not null/undefined/NaN || false.
*/
L.isValue = function(o) {
var t = L.type(o);
switch (t) {
case 'number':
return isFinite(o);
case 'null': // fallthru
case 'undefined':
return false;
default:
return !!t;
}
};
/**
* <p>
* Returns a string representing the type of the item passed in.
* </p>
*
* <p>
* Known issues:
* </p>
*
* <ul>
* <li>
* <code>typeof HTMLElementCollection</code> returns function in Safari, but
* <code>Y.type()</code> reports object, which could be a good thing --
* but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.
* </li>
* </ul>
*
* @method type
* @param o the item to test.
* @return {string} the detected type.
* @static
*/
L.type = function(o) {
return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');
};
/**
* Lightweight version of <code>Y.substitute</code>. Uses the same template
* structure as <code>Y.substitute</code>, but doesn't support recursion,
* auto-object coersion, or formats.
* @method sub
* @param {string} s String to be modified.
* @param {object} o Object containing replacement values.
* @return {string} the substitute result.
* @static
* @since 3.2.0
*/
L.sub = function(s, o) {
return s.replace ? s.replace(SUBREGEX, function (match, key) {
return L.isUndefined(o[key]) ? match : o[key];
}) : s;
};
/**
* Returns the current time in milliseconds.
*
* @method now
* @return {int} Current time in milliseconds.
* @since 3.3.0
*/
L.now = Date.now || function () {
return new Date().getTime();
};
/**
* The YUI module contains the components required for building the YUI seed
* file. This includes the script loading mechanism, a simple queue, and the
* core utilities for the library.
* @module yui
* @submodule yui-base
*/
var Lang = Y.Lang,
Native = Array.prototype,
hasOwn = Object.prototype.hasOwnProperty;
/**
* Adds utilities to the YUI instance for working with arrays. Additional array
* helpers can be found in the `collection` module.
*
* @class Array
*/
/**
* `Y.Array(thing)` returns an array created from _thing_. Depending on
* _thing_'s type, one of the following will happen:
*
* * Arrays are returned unmodified unless a non-zero _startIndex_ is
* specified.
* * Array-like collections (see `Array.test()`) are converted to arrays.
* * For everything else, a new array is created with _thing_ as the sole
* item.
*
* Note: elements that are also collections, such as `<form>` and `<select>`
* elements, are not automatically converted to arrays. To force a conversion,
* pass `true` as the value of the _force_ parameter.
*
* @method ()
* @param {mixed} thing The thing to arrayify.
* @param {int} [startIndex=0] If non-zero and _thing_ is an array or array-like
* collection, a subset of items starting at the specified index will be
* returned.
* @param {boolean} [force=false] If `true`, _thing_ will be treated as an
* array-like collection no matter what.
* @return {Array}
* @static
*/
function YArray(thing, startIndex, force) {
var len, result;
startIndex || (startIndex = 0);
if (force || YArray.test(thing)) {
// IE throws when trying to slice HTMLElement collections.
try {
return Native.slice.call(thing, startIndex);
} catch (ex) {
result = [];
for (len = thing.length; startIndex < len; ++startIndex) {
result.push(thing[startIndex]);
}
return result;
}
}
return [thing];
}
Y.Array = YArray;
/**
* Evaluates _obj_ to determine if it's an array, an array-like collection, or
* something else. This is useful when working with the function `arguments`
* collection and `HTMLElement` collections.
*
* Note: This implementation doesn't consider elements that are also
* collections, such as `<form>` and `<select>`, to be array-like.
*
* @method test
* @param {object} obj Object to test.
* @return {int} A number indicating the results of the test:
* * 0: Neither an array nor an array-like collection.
* * 1: Real array.
* * 2: Array-like collection.
* @static
*/
YArray.test = function (obj) {
var result = 0;
if (Lang.isArray(obj)) {
result = 1;
} else if (Lang.isObject(obj)) {
try {
// indexed, but no tagName (element) or alert (window),
// or functions without apply/call (Safari
// HTMLElementCollection bug).
if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {
result = 2;
}
} catch (ex) {}
}
return result;
};
/**
* Dedupes an array of strings, returning an array that's guaranteed to contain
* only one copy of a given string.
*
* This method differs from `Y.Array.unique` in that it's optimized for use only
* with strings, whereas `unique` may be used with other types (but is slower).
* Using `dedupe` with non-string values may result in unexpected behavior.
*
* @method dedupe
* @param {String[]} array Array of strings to dedupe.
* @return {Array} Deduped copy of _array_.
* @static
* @since 3.4.0
*/
YArray.dedupe = function (array) {
var hash = {},
results = [],
i, item, len;
for (i = 0, len = array.length; i < len; ++i) {
item = array[i];
if (!hasOwn.call(hash, item)) {
hash[item] = 1;
results.push(item);
}
}
return results;
};
/**
* Executes the supplied function on each item in the array. This method wraps
* the native ES5 `Array.forEach()` method if available.
*
* @method each
* @param {Array} array Array to iterate.
* @param {Function} fn Function to execute on each item in the array.
* @param {mixed} fn.item Current array item.
* @param {Number} fn.index Current array index.
* @param {Array} fn.array Array being iterated.
* @param {Object} [thisObj] `this` object to use when calling _fn_.
* @return {YUI} The YUI instance.
* @chainable
* @static
*/
YArray.each = YArray.forEach = Native.forEach ? function (array, fn, thisObj) {
Native.forEach.call(array || [], fn, thisObj || Y);
return Y;
} : function (array, fn, thisObj) {
for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {
if (i in array) {
fn.call(thisObj || Y, array[i], i, array);
}
}
return Y;
};
/**
* Alias for `each`.
*
* @method forEach
* @static
*/
/**
* Returns an object using the first array as keys and the second as values. If
* the second array is not provided, or if it doesn't contain the same number of
* values as the first array, then `true` will be used in place of the missing
* values.
*
* @example
*
* Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);
* // => {a: 'foo', b: 'bar', c: true}
*
* @method hash
* @param {Array} keys Array to use as keys.
* @param {Array} [values] Array to use as values.
* @return {Object}
* @static
*/
YArray.hash = function (keys, values) {
var hash = {},
vlen = (values && values.length) || 0,
i, len;
for (i = 0, len = keys.length; i < len; ++i) {
if (i in keys) {
hash[keys[i]] = vlen > i && i in values ? values[i] : true;
}
}
return hash;
};
/**
* Returns the index of the first item in the array that's equal (using a strict
* equality check) to the specified _value_, or `-1` if the value isn't found.
*
* This method wraps the native ES5 `Array.indexOf()` method if available.
*
* @method indexOf
* @param {Array} array Array to search.
* @param {any} value Value to search for.
* @return {Number} Index of the item strictly equal to _value_, or `-1` if not
* found.
* @static
*/
YArray.indexOf = Native.indexOf ? function (array, value) {
// TODO: support fromIndex
return Native.indexOf.call(array, value);
} : function (array, value) {
for (var i = 0, len = array.length; i < len; ++i) {
if (array[i] === value) {
return i;
}
}
return -1;
};
/**
* Numeric sort convenience function.
*
* The native `Array.prototype.sort()` function converts values to strings and
* sorts them in lexicographic order, which is unsuitable for sorting numeric
* values. Provide `Y.Array.numericSort` as a custom sort function when you want
* to sort values in numeric order.
*
* @example
*
* [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);
* // => [4, 8, 15, 16, 23, 42]
*
* @method numericSort
* @param {Number} a First value to compare.
* @param {Number} b Second value to compare.
* @return {Number} Difference between _a_ and _b_.
* @static
*/
YArray.numericSort = function (a, b) {
return a - b;
};
/**
* Executes the supplied function on each item in the array. Returning a truthy
* value from the function will stop the processing of remaining items.
*
* @method some
* @param {Array} array Array to iterate.
* @param {Function} fn Function to execute on each item.
* @param {mixed} fn.value Current array item.
* @param {Number} fn.index Current array index.
* @param {Array} fn.array Array being iterated.
* @param {Object} [thisObj] `this` object to use when calling _fn_.
* @return {Boolean} `true` if the function returns a truthy value on any of the
* items in the array; `false` otherwise.
* @static
*/
YArray.some = Native.some ? function (array, fn, thisObj) {
return Native.some.call(array, fn, thisObj);
} : function (array, fn, thisObj) {
for (var i = 0, len = array.length; i < len; ++i) {
if (i in array && fn.call(thisObj, array[i], i, array)) {
return true;
}
}
return false;
};
/**
* The YUI module contains the components required for building the YUI
* seed file. This includes the script loading mechanism, a simple queue,
* and the core utilities for the library.
* @module yui
* @submodule yui-base
*/
/**
* A simple FIFO queue. Items are added to the Queue with add(1..n items) and
* removed using next().
*
* @class Queue
* @constructor
* @param {MIXED} item* 0..n items to seed the queue.
*/
function Queue() {
this._init();
this.add.apply(this, arguments);
}
Queue.prototype = {
/**
* Initialize the queue
*
* @method _init
* @protected
*/
_init: function() {
/**
* The collection of enqueued items
*
* @property _q
* @type Array
* @protected
*/
this._q = [];
},
/**
* Get the next item in the queue. FIFO support
*
* @method next
* @return {MIXED} the next item in the queue.
*/
next: function() {
return this._q.shift();
},
/**
* Get the last in the queue. LIFO support.
*
* @method last
* @return {MIXED} the last item in the queue.
*/
last: function() {
return this._q.pop();
},
/**
* Add 0..n items to the end of the queue.
*
* @method add
* @param {MIXED} item* 0..n items.
* @return {object} this queue.
*/
add: function() {
this._q.push.apply(this._q, arguments);
return this;
},
/**
* Returns the current number of queued items.
*
* @method size
* @return {Number} The size.
*/
size: function() {
return this._q.length;
}
};
Y.Queue = Queue;
YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();
/**
The YUI module contains the components required for building the YUI seed file.
This includes the script loading mechanism, a simple queue, and the core
utilities for the library.
@module yui
@submodule yui-base
**/
var CACHED_DELIMITER = '__',
hasOwn = Object.prototype.hasOwnProperty,
isObject = Y.Lang.isObject;
/**
Returns a wrapper for a function which caches the return value of that function,
keyed off of the combined string representation of the argument values provided
when the wrapper is called.
Calling this function again with the same arguments will return the cached value
rather than executing the wrapped function.
Note that since the cache is keyed off of the string representation of arguments
passed to the wrapper function, arguments that aren't strings and don't provide
a meaningful `toString()` method may result in unexpected caching behavior. For
example, the objects `{}` and `{foo: 'bar'}` would both be converted to the
string `[object Object]` when used as a cache key.
@method cached
@param {Function} source The function to memoize.
@param {Object} [cache={}] Object in which to store cached values. You may seed
this object with pre-existing cached values if desired.
@param {any} [refetch] If supplied, this value is compared with the cached value
using a `==` comparison. If the values are equal, the wrapped function is
executed again even though a cached value exists.
@return {Function} Wrapped function.
@for YUI
**/
Y.cached = function (source, cache, refetch) {
cache || (cache = {});
return function (arg) {
var key = arguments.length > 1 ?
Array.prototype.join.call(arguments, CACHED_DELIMITER) :
arg.toString();
if (!(key in cache) || (refetch && cache[key] == refetch)) {
cache[key] = source.apply(source, arguments);
}
return cache[key];
};
};
/**
Returns a new object containing all of the properties of all the supplied
objects. The properties from later objects will overwrite those in earlier
objects.
Passing in a single object will create a shallow copy of it. For a deep copy,
use `clone()`.
@method merge
@param {Object} objects* One or more objects to merge.
@return {Object} A new merged object.
**/
Y.merge = function () {
var args = arguments,
i = 0,
len = args.length,
result = {};
for (; i < len; ++i) {
Y.mix(result, args[i], true);
}
return result;
};
/**
Mixes _supplier_'s properties into _receiver_. Properties will not be
overwritten or merged unless the _overwrite_ or _merge_ parameters are `true`,
respectively.
In the default mode (0), only properties the supplier owns are copied (prototype
properties are not copied). The following copying modes are available:
* `0`: _Default_. Object to object.
* `1`: Prototype to prototype.
* `2`: Prototype to prototype and object to object.
* `3`: Prototype to object.
* `4`: Object to prototype.
@method mix
@param {Function|Object} receiver The object or function to receive the mixed
properties.
@param {Function|Object} supplier The object or function supplying the
properties to be mixed.
@param {Boolean} [overwrite=false] If `true`, properties that already exist
on the receiver will be overwritten with properties from the supplier.
@param {String[]} [whitelist] An array of property names to copy. If
specified, only the whitelisted properties will be copied, and all others
will be ignored.
@param {Int} [mode=0] Mix mode to use. See above for available modes.
@param {Boolean} [merge=false] If `true`, objects and arrays that already
exist on the receiver will have the corresponding object/array from the
supplier merged into them, rather than being skipped or overwritten. When
both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.
@return {Function|Object|YUI} The receiver, or the YUI instance if the
specified receiver is falsy.
**/
Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {
var alwaysOverwrite, exists, from, i, key, len, to;
// If no supplier is given, we return the receiver. If no receiver is given,
// we return Y. Returning Y doesn't make much sense to me, but it's
// grandfathered in for backcompat reasons.
if (!receiver || !supplier) {
return receiver || Y;
}
if (mode) {
// In mode 2 (prototype to prototype and object to object), we recurse
// once to do the proto to proto mix. The object to object mix will be
// handled later on.
if (mode === 2) {
Y.mix(receiver.prototype, supplier.prototype, overwrite,
whitelist, 0, merge);
}
// Depending on which mode is specified, we may be copying from or to
// the prototypes of the supplier and receiver.
from = mode === 1 || mode === 3 ? supplier.prototype : supplier;
to = mode === 1 || mode === 4 ? receiver.prototype : receiver;
// If either the supplier or receiver doesn't actually have a
// prototype property, then we could end up with an undefined `from`
// or `to`. If that happens, we abort and return the receiver.
if (!from || !to) {
return receiver;
}
} else {
from = supplier;
to = receiver;
}
// If `overwrite` is truthy and `merge` is falsy, then we can skip a call
// to `hasOwnProperty` on each iteration and save some time.
alwaysOverwrite = overwrite && !merge;
if (whitelist) {
for (i = 0, len = whitelist.length; i < len; ++i) {
key = whitelist[i];
// We call `Object.prototype.hasOwnProperty` instead of calling
// `hasOwnProperty` on the object itself, since the object's
// `hasOwnProperty` method may have been overridden or removed.
// Also, some native objects don't implement a `hasOwnProperty`
// method.
if (!hasOwn.call(from, key)) {
continue;
}
exists = alwaysOverwrite ? false : hasOwn.call(to, key);
if (merge && exists && isObject(to[key], true)
&& isObject(from[key], true)) {
// If we're in merge mode, and the key is present on both
// objects, and the value on both objects is either an object or
// an array (but not a function), then we recurse to merge the
// `from` value into the `to` value instead of overwriting it.
//
// Note: It's intentional that the whitelist isn't passed to the
// recursive call here. This is legacy behavior that lots of
// code still depends on.
Y.mix(to[key], from[key], overwrite, null, 0, merge);
} else if (overwrite || !exists) {
// We're not in merge mode, so we'll only copy the `from` value
// to the `to` value if we're in overwrite mode or if the
// current key doesn't exist on the `to` object.
to[key] = from[key];
}
}
} else {
for (key in from) {
// The code duplication here is for runtime performance reasons.
// Combining whitelist and non-whitelist operations into a single
// loop or breaking the shared logic out into a function both result
// in worse performance, and Y.mix is critical enough that the byte
// tradeoff is worth it.
if (!hasOwn.call(from, key)) {
continue;
}
exists = alwaysOverwrite ? false : hasOwn.call(to, key);
if (merge && exists && isObject(to[key], true)
&& isObject(from[key], true)) {
Y.mix(to[key], from[key], overwrite, null, 0, merge);
} else if (overwrite || !exists) {
to[key] = from[key];
}
}
// If this is an IE browser with the JScript enumeration bug, force
// enumeration of the buggy properties by making a recursive call with
// the buggy properties as the whitelist.
if (Y.Object._hasEnumBug) {
Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);
}
}
return receiver;
};
/**
* The YUI module contains the components required for building the YUI
* seed file. This includes the script loading mechanism, a simple queue,
* and the core utilities for the library.
* @module yui
* @submodule yui-base
*/
/**
* Adds utilities to the YUI instance for working with objects.
*
* @class Object
*/
var hasOwn = Object.prototype.hasOwnProperty,
// If either MooTools or Prototype is on the page, then there's a chance that we
// can't trust "native" language features to actually be native. When this is
// the case, we take the safe route and fall back to our own non-native
// implementations.
win = Y.config.win,
unsafeNatives = win && !!(win.MooTools || win.Prototype),
UNDEFINED, // <-- Note the comma. We're still declaring vars.
/**
* Returns a new object that uses _obj_ as its prototype. This method wraps the
* native ES5 `Object.create()` method if available, but doesn't currently
* pass through `Object.create()`'s second argument (properties) in order to
* ensure compatibility with older browsers.
*
* @method ()
* @param {Object} obj Prototype object.
* @return {Object} New object using _obj_ as its prototype.
* @static
*/
O = Y.Object = (!unsafeNatives && Object.create) ? function (obj) {
// We currently wrap the native Object.create instead of simply aliasing it
// to ensure consistency with our fallback shim, which currently doesn't
// support Object.create()'s second argument (properties). Once we have a
// safe fallback for the properties arg, we can stop wrapping
// Object.create().
return Object.create(obj);
} : (function () {
// Reusable constructor function for the Object.create() shim.
function F() {}
// The actual shim.
return function (obj) {
F.prototype = obj;
return new F();
};
}()),
/**
* Property names that IE doesn't enumerate in for..in loops, even when they
* should be enumerable. When `_hasEnumBug` is `true`, it's necessary to
* manually enumerate these properties.
*
* @property _forceEnum
* @type String[]
* @protected
* @static
*/
forceEnum = O._forceEnum = [
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'toString',
'toLocaleString',
'valueOf'
],
/**
* `true` if this browser has the JScript enumeration bug that prevents
* enumeration of the properties named in the `_forceEnum` array, `false`
* otherwise.
*
* See:
* - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>
* - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>
*
* @property _hasEnumBug
* @type {Boolean}
* @protected
* @static
*/
hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),
/**
* Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or
* exists only on _obj_'s prototype. This is essentially a safer version of
* `obj.hasOwnProperty()`.
*
* @method owns
* @param {Object} obj Object to test.
* @param {String} key Property name to look for.
* @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
* @static
*/
owns = O.owns = function (obj, key) {
return !!obj && hasOwn.call(obj, key);
}; // <-- End of var declarations.
/**
* Alias for `owns()`.
*
* @method hasKey
* @param {Object} obj Object to test.
* @param {String} key Property name to look for.
* @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
* @static
*/
O.hasKey = owns;
/**
* Returns an array containing the object's enumerable keys. Does not include
* prototype keys or non-enumerable keys.
*
* Note that keys are returned in enumeration order (that is, in the same order
* that they would be enumerated by a `for-in` loop), which may not be the same
* as the order in which they were defined.
*
* This method is an alias for the native ES5 `Object.keys()` method if
* available.
*
* @example
*
* Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});
* // => ['a', 'b', 'c']
*
* @method keys
* @param {Object} obj An object.
* @return {String[]} Array of keys.
* @static
*/
O.keys = (!unsafeNatives && Object.keys) || function (obj) {
if (!Y.Lang.isObject(obj)) {
throw new TypeError('Object.keys called on a non-object');
}
var keys = [],
i, key, len;
for (key in obj) {
if (owns(obj, key)) {
keys.push(key);
}
}
if (hasEnumBug) {
for (i = 0, len = forceEnum.length; i < len; ++i) {
key = forceEnum[i];
if (owns(obj, key)) {
keys.push(key);
}
}
}
return keys;
};
/**
* Returns an array containing the values of the object's enumerable keys.
*
* Note that values are returned in enumeration order (that is, in the same
* order that they would be enumerated by a `for-in` loop), which may not be the
* same as the order in which they were defined.
*
* @example
*
* Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});
* // => ['foo', 'bar', 'baz']
*
* @method values
* @param {Object} obj An object.
* @return {Array} Array of values.
* @static
*/
O.values = function (obj) {
var keys = O.keys(obj),
i = 0,
len = keys.length,
values = [];
for (; i < len; ++i) {
values.push(obj[keys[i]]);
}
return values;
};
/**
* Returns the number of enumerable keys owned by an object.
*
* @method size
* @param {Object} obj An object.
* @return {Number} The object's size.
* @static
*/
O.size = function (obj) {
return O.keys(obj).length;
};
/**
* Returns `true` if the object owns an enumerable property with the specified
* value.
*
* @method hasValue
* @param {Object} obj An object.
* @param {any} value The value to search for.
* @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise.
* @static
*/
O.hasValue = function (obj, value) {
return Y.Array.indexOf(O.values(obj), value) > -1;
};
/**
* Executes a function on each enumerable property in _obj_. The function
* receives the value, the key, and the object itself as parameters (in that
* order).
*
* By default, only properties owned by _obj_ are enumerated. To include
* prototype properties, set the _proto_ parameter to `true`.
*
* @method each
* @param {Object} obj Object to enumerate.
* @param {Function} fn Function to execute on each enumerable property.
* @param {mixed} fn.value Value of the current property.
* @param {String} fn.key Key of the current property.
* @param {Object} fn.obj Object being enumerated.
* @param {Object} [thisObj] `this` object to use when calling _fn_.
* @param {Boolean} [proto=false] Include prototype properties.
* @return {YUI} the YUI instance.
* @chainable
* @static
*/
O.each = function (obj, fn, thisObj, proto) {
var key;
for (key in obj) {
if (proto || owns(obj, key)) {
fn.call(thisObj || Y, obj[key], key, obj);
}
}
return Y;
};
/**
* Executes a function on each enumerable property in _obj_, but halts if the
* function returns a truthy value. The function receives the value, the key,
* and the object itself as paramters (in that order).
*
* By default, only properties owned by _obj_ are enumerated. To include
* prototype properties, set the _proto_ parameter to `true`.
*
* @method some
* @param {Object} obj Object to enumerate.
* @param {Function} fn Function to execute on each enumerable property.
* @param {mixed} fn.value Value of the current property.
* @param {String} fn.key Key of the current property.
* @param {Object} fn.obj Object being enumerated.
* @param {Object} [thisObj] `this` object to use when calling _fn_.
* @param {Boolean} [proto=false] Include prototype properties.
* @return {Boolean} `true` if any execution of _fn_ returns a truthy value,
* `false` otherwise.
* @static
*/
O.some = function (obj, fn, thisObj, proto) {
var key;
for (key in obj) {
if (proto || owns(obj, key)) {
if (fn.call(thisObj || Y, obj[key], key, obj)) {
return true;
}
}
}
return false;
};
/**
* Retrieves the sub value at the provided path,
* from the value object provided.
*
* @method getValue
* @static
* @param o The object from which to extract the property value.
* @param path {Array} A path array, specifying the object traversal path
* from which to obtain the sub value.
* @return {Any} The value stored in the path, undefined if not found,
* undefined if the source is not an object. Returns the source object
* if an empty path is provided.
*/
O.getValue = function(o, path) {
if (!Y.Lang.isObject(o)) {
return UNDEFINED;
}
var i,
p = Y.Array(path),
l = p.length;
for (i = 0; o !== UNDEFINED && i < l; i++) {
o = o[p[i]];
}
return o;
};
/**
* Sets the sub-attribute value at the provided path on the
* value object. Returns the modified value object, or
* undefined if the path is invalid.
*
* @method setValue
* @static
* @param o The object on which to set the sub value.
* @param path {Array} A path array, specifying the object traversal path
* at which to set the sub value.
* @param val {Any} The new value for the sub-attribute.
* @return {Object} The modified object, with the new sub value set, or
* undefined, if the path was invalid.
*/
O.setValue = function(o, path, val) {
var i,
p = Y.Array(path),
leafIdx = p.length - 1,
ref = o;
if (leafIdx >= 0) {
for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {
ref = ref[p[i]];
}
if (ref !== UNDEFINED) {
ref[p[i]] = val;
} else {
return UNDEFINED;
}
}
return o;
};
/**
* Returns `true` if the object has no enumerable properties of its own.
*
* @method isEmpty
* @param {Object} obj An object.
* @return {Boolean} `true` if the object is empty.
* @static
* @since 3.2.0
*/
O.isEmpty = function (obj) {
return !O.keys(obj).length;
};
/**
* The YUI module contains the components required for building the YUI seed
* file. This includes the script loading mechanism, a simple queue, and the
* core utilities for the library.
* @module yui
* @submodule yui-base
*/
/**
* YUI user agent detection.
* Do not fork for a browser if it can be avoided. Use feature detection when
* you can. Use the user agent as a last resort. For all fields listed
* as @type float, UA stores a version number for the browser engine,
* 0 otherwise. This value may or may not map to the version number of
* the browser using the engine. The value is presented as a float so
* that it can easily be used for boolean evaluation as well as for
* looking for a particular range of versions. Because of this,
* some of the granularity of the version info may be lost. The fields that
* are @type string default to null. The API docs list the values that
* these fields can have.
* @class UA
* @static
*/
/**
* Static method for parsing the UA string. Defaults to assigning it's value to Y.UA
* @static
* @method Env.parseUA
* @param {String} subUA Parse this UA string instead of navigator.userAgent
* @returns {Object} The Y.UA object
*/
YUI.Env.parseUA = function(subUA) {
var numberify = function(s) {
var c = 0;
return parseFloat(s.replace(/\./g, function() {
return (c++ == 1) ? '' : '.';
}));
},
win = Y.config.win,
nav = win && win.navigator,
o = {
/**
* Internet Explorer version number or 0. Example: 6
* @property ie
* @type float
* @static
*/
ie: 0,
/**
* Opera version number or 0. Example: 9.2
* @property opera
* @type float
* @static
*/
opera: 0,
/**
* Gecko engine revision number. Will evaluate to 1 if Gecko
* is detected but the revision could not be found. Other browsers
* will be 0. Example: 1.8
* <pre>
* Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7
* Firefox 1.5.0.9: 1.8.0.9 <-- 1.8
* Firefox 2.0.0.3: 1.8.1.3 <-- 1.81
* Firefox 3.0 <-- 1.9
* Firefox 3.5 <-- 1.91
* </pre>
* @property gecko
* @type float
* @static
*/
gecko: 0,
/**
* AppleWebKit version. KHTML browsers that are not WebKit browsers
* will evaluate to 1, other browsers 0. Example: 418.9
* <pre>
* Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the
* latest available for Mac OSX 10.3.
* Safari 2.0.2: 416 <-- hasOwnProperty introduced
* Safari 2.0.4: 418 <-- preventDefault fixed
* Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
* different versions of webkit
* Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been
* updated, but not updated
* to the latest patch.
* Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native
* SVG and many major issues fixed).
* Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic
* update from 2.x via the 10.4.11 OS patch.
* Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event.
* yahoo.com user agent hack removed.
* </pre>
* http://en.wikipedia.org/wiki/Safari_version_history
* @property webkit
* @type float
* @static
*/
webkit: 0,
/**
* Safari will be detected as webkit, but this property will also
* be populated with the Safari version number
* @property safari
* @type float
* @static
*/
safari: 0,
/**
* Chrome will be detected as webkit, but this property will also
* be populated with the Chrome version number
* @property chrome
* @type float
* @static
*/
chrome: 0,
/**
* The mobile property will be set to a string containing any relevant
* user agent information when a modern mobile browser is detected.
* Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
* devices with the WebKit-based browser, and Opera Mini.
* @property mobile
* @type string
* @default null
* @static
*/
mobile: null,
/**
* Adobe AIR version number or 0. Only populated if webkit is detected.
* Example: 1.0
* @property air
* @type float
*/
air: 0,
/**
* Detects Apple iPad's OS version
* @property ipad
* @type float
* @static
*/
ipad: 0,
/**
* Detects Apple iPhone's OS version
* @property iphone
* @type float
* @static
*/
iphone: 0,
/**
* Detects Apples iPod's OS version
* @property ipod
* @type float
* @static
*/
ipod: 0,
/**
* General truthy check for iPad, iPhone or iPod
* @property ios
* @type float
* @default null
* @static
*/
ios: null,
/**
* Detects Googles Android OS version
* @property android
* @type float
* @static
*/
android: 0,
/**
* Detects Palms WebOS version
* @property webos
* @type float
* @static
*/
webos: 0,
/**
* Google Caja version number or 0.
* @property caja
* @type float
*/
caja: nav && nav.cajaVersion,
/**
* Set to true if the page appears to be in SSL
* @property secure
* @type boolean
* @static
*/
secure: false,
/**
* The operating system. Currently only detecting windows or macintosh
* @property os
* @type string
* @default null
* @static
*/
os: null
},
ua = subUA || nav && nav.userAgent,
loc = win && win.location,
href = loc && loc.href,
m;
o.secure = href && (href.toLowerCase().indexOf('https') === 0);
if (ua) {
if ((/windows|win32/i).test(ua)) {
o.os = 'windows';
} else if ((/macintosh/i).test(ua)) {
o.os = 'macintosh';
} else if ((/rhino/i).test(ua)) {
o.os = 'rhino';
}
// Modern KHTML browsers should qualify as Safari X-Grade
if ((/KHTML/).test(ua)) {
o.webkit = 1;
}
// Modern WebKit browsers are at least X-Grade
m = ua.match(/AppleWebKit\/([^\s]*)/);
if (m && m[1]) {
o.webkit = numberify(m[1]);
o.safari = o.webkit;
// Mobile browser check
if (/ Mobile\//.test(ua)) {
o.mobile = 'Apple'; // iPhone or iPod Touch
m = ua.match(/OS ([^\s]*)/);
if (m && m[1]) {
m = numberify(m[1].replace('_', '.'));
}
o.ios = m;
o.ipad = o.ipod = o.iphone = 0;
m = ua.match(/iPad|iPod|iPhone/);
if (m && m[0]) {
o[m[0].toLowerCase()] = o.ios;
}
} else {
m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);
if (m) {
// Nokia N-series, webOS, ex: NokiaN95
o.mobile = m[0];
}
if (/webOS/.test(ua)) {
o.mobile = 'WebOS';
m = ua.match(/webOS\/([^\s]*);/);
if (m && m[1]) {
o.webos = numberify(m[1]);
}
}
if (/ Android/.test(ua)) {
if (/Mobile/.test(ua)) {
o.mobile = 'Android';
}
m = ua.match(/Android ([^\s]*);/);
if (m && m[1]) {
o.android = numberify(m[1]);
}
}
}
m = ua.match(/Chrome\/([^\s]*)/);
if (m && m[1]) {
o.chrome = numberify(m[1]); // Chrome
o.safari = 0; //Reset safari back to 0
} else {
m = ua.match(/AdobeAIR\/([^\s]*)/);
if (m) {
o.air = m[0]; // Adobe AIR 1.0 or better
}
}
}
if (!o.webkit) { // not webkit
// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
m = ua.match(/Opera[\s\/]([^\s]*)/);
if (m && m[1]) {
o.opera = numberify(m[1]);
m = ua.match(/Version\/([^\s]*)/);
if (m && m[1]) {
o.opera = numberify(m[1]); // opera 10+
}
m = ua.match(/Opera Mini[^;]*/);
if (m) {
o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
}
} else { // not opera or webkit
m = ua.match(/MSIE\s([^;]*)/);
if (m && m[1]) {
o.ie = numberify(m[1]);
} else { // not opera, webkit, or ie
m = ua.match(/Gecko\/([^\s]*)/);
if (m) {
o.gecko = 1; // Gecko detected, look for revision
m = ua.match(/rv:([^\s\)]*)/);
if (m && m[1]) {
o.gecko = numberify(m[1]);
}
}
}
}
}
}
YUI.Env.UA = o;
return o;
};
Y.UA = YUI.Env.UA || YUI.Env.parseUA();
YUI.Env.aliases = {
"anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],
"app": ["controller","model","model-list","view"],
"attribute": ["attribute-base","attribute-complex"],
"autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],
"base": ["base-base","base-pluginhost","base-build"],
"cache": ["cache-base","cache-offline","cache-plugin"],
"collection": ["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],
"dataschema": ["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],
"datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],
"datatable": ["datatable-base","datatable-datasource","datatable-sort","datatable-scroll"],
"datatype": ["datatype-number","datatype-date","datatype-xml"],
"datatype-date": ["datatype-date-parse","datatype-date-format"],
"datatype-number": ["datatype-number-parse","datatype-number-format"],
"datatype-xml": ["datatype-xml-parse","datatype-xml-format"],
"dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],
"dom": ["dom-base","dom-screen","dom-style","selector-native","selector"],
"editor": ["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],
"event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside"],
"event-custom": ["event-custom-base","event-custom-complex"],
"event-gestures": ["event-flick","event-move"],
"highlight": ["highlight-base","highlight-accentfold"],
"history": ["history-base","history-hash","history-hash-ie","history-html5"],
"io": ["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],
"json": ["json-parse","json-stringify"],
"loader": ["loader-base","loader-rollup","loader-yui3"],
"node": ["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],
"pluginhost": ["pluginhost-base","pluginhost-config"],
"querystring": ["querystring-parse","querystring-stringify"],
"recordset": ["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],
"resize": ["resize-base","resize-proxy","resize-constrain"],
"slider": ["slider-base","slider-value-range","clickable-rail","range-slider"],
"text": ["text-accentfold","text-wordbreak"],
"transition": ["transition-native","transition-timer"],
"widget": ["widget-base","widget-htmlparser","widget-uievents","widget-skin"],
"yui-rls": ["yui-base","get","features","intl-base","rls","yui-log","yui-later"]
};
}, '@VERSION@' );
YUI.add('get', function(Y) {
/**
* Provides a mechanism to fetch remote resources and
* insert them into a document.
* @module yui
* @submodule get
*/
/**
* Fetches and inserts one or more script or link nodes into the document
* @class Get
* @static
*/
var ua = Y.UA,
L = Y.Lang,
TYPE_JS = 'text/javascript',
TYPE_CSS = 'text/css',
STYLESHEET = 'stylesheet',
SCRIPT = 'script',
AUTOPURGE = 'autopurge',
UTF8 = 'utf-8',
LINK = 'link',
ASYNC = 'async',
ALL = true,
// FireFox does not support the onload event for link nodes, so
// there is no way to make the css requests synchronous. This means
// that the css rules in multiple files could be applied out of order
// in this browser if a later request returns before an earlier one.
// Safari too.
ONLOAD_SUPPORTED = {
script: ALL,
css: !(ua.webkit || ua.gecko)
},
/**
* hash of queues to manage multiple requests
* @property queues
* @private
*/
queues = {},
/**
* queue index used to generate transaction ids
* @property qidx
* @type int
* @private
*/
qidx = 0,
/**
* interal property used to prevent multiple simultaneous purge
* processes
* @property purging
* @type boolean
* @private
*/
purging,
/**
* Clear timeout state
*
* @method _clearTimeout
* @param {Object} q Queue data
* @private
*/
_clearTimeout = function(q) {
var timer = q.timer;
if (timer) {
clearTimeout(timer);
q.timer = null;
}
},
/**
* Generates an HTML element, this is not appended to a document
* @method _node
* @param {string} type the type of element.
* @param {Object} attr the fixed set of attribute for the type.
* @param {Object} custAttrs optional Any custom attributes provided by the user.
* @param {Window} win optional window to create the element in.
* @return {HTMLElement} the generated node.
* @private
*/
_node = function(type, attr, custAttrs, win) {
var w = win || Y.config.win,
d = w.document,
n = d.createElement(type),
i;
if (custAttrs) {
Y.mix(attr, custAttrs);
}
for (i in attr) {
if (attr[i] && attr.hasOwnProperty(i)) {
n.setAttribute(i, attr[i]);
}
}
return n;
},
/**
* Generates a link node
* @method _linkNode
* @param {string} url the url for the css file.
* @param {Window} win optional window to create the node in.
* @param {object} attributes optional attributes collection to apply to the
* new node.
* @return {HTMLElement} the generated node.
* @private
*/
_linkNode = function(url, win, attributes) {
return _node(LINK, {
id: Y.guid(),
type: TYPE_CSS,
rel: STYLESHEET,
href: url
}, attributes, win);
},
/**
* Generates a script node
* @method _scriptNode
* @param {string} url the url for the script file.
* @param {Window} win optional window to create the node in.
* @param {object} attributes optional attributes collection to apply to the
* new node.
* @return {HTMLElement} the generated node.
* @private
*/
_scriptNode = function(url, win, attributes) {
return _node(SCRIPT, {
id: Y.guid(),
type: TYPE_JS,
src: url
}, attributes, win);
},
/**
* Returns the data payload for callback functions.
* @method _returnData
* @param {object} q the queue.
* @param {string} msg the result message.
* @param {string} result the status message from the request.
* @return {object} the state data from the request.
* @private
*/
_returnData = function(q, msg, result) {
return {
tId: q.tId,
win: q.win,
data: q.data,
nodes: q.nodes,
msg: msg,
statusText: result,
purge: function() {
_purge(this.tId);
}
};
},
/**
* The transaction is finished
* @method _end
* @param {string} id the id of the request.
* @param {string} msg the result message.
* @param {string} result the status message from the request.
* @private
*/
_end = function(id, msg, result) {
var q = queues[id],
onEnd = q && q.onEnd;
q.finished = true;
if (onEnd) {
onEnd.call(q.context, _returnData(q, msg, result));
}
},
/**
* The request failed, execute fail handler with whatever
* was accomplished. There isn't a failure case at the
* moment unless you count aborted transactions
* @method _fail
* @param {string} id the id of the request
* @private
*/
_fail = function(id, msg) {
var q = queues[id],
onFailure = q.onFailure;
_clearTimeout(q);
if (onFailure) {
onFailure.call(q.context, _returnData(q, msg));
}
_end(id, msg, 'failure');
},
/**
* Abort the transaction
*
* @method _abort
* @param {Object} id
* @private
*/
_abort = function(id) {
_fail(id, 'transaction ' + id + ' was aborted');
},
/**
* The request is complete, so executing the requester's callback
* @method _complete
* @param {string} id the id of the request.
* @private
*/
_complete = function(id) {
var q = queues[id],
onSuccess = q.onSuccess;
_clearTimeout(q);
if (q.aborted) {
_abort(id);
} else {
if (onSuccess) {
onSuccess.call(q.context, _returnData(q));
}
// 3.3.0 had undefined msg for this path.
_end(id, undefined, 'OK');
}
},
/**
* Get node reference, from string
*
* @method _getNodeRef
* @param {String|HTMLElement} nId The node id to find. If an HTMLElement is passed in, it will be returned.
* @param {String} tId Queue id, used to determine document for queue
* @private
*/
_getNodeRef = function(nId, tId) {
var q = queues[tId],
n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId;
if (!n) {
_fail(tId, 'target node not found: ' + nId);
}
return n;
},
/**
* Removes the nodes for the specified queue
* @method _purge
* @param {string} tId the transaction id.
* @private
*/
_purge = function(tId) {
var nodes, doc, parent, sibling, node, attr, insertBefore,
i, l,
q = queues[tId];
if (q) {
nodes = q.nodes;
l = nodes.length;
// TODO: Why is node.parentNode undefined? Which forces us to do this...
/*
doc = q.win.document;
parent = doc.getElementsByTagName('head')[0];
insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0];
if (insertBefore) {
sibling = _getNodeRef(insertBefore, tId);
if (sibling) {
parent = sibling.parentNode;
}
}
*/
for (i = 0; i < l; i++) {
node = nodes[i];
parent = node.parentNode;
if (node.clearAttributes) {
node.clearAttributes();
} else {
// This destroys parentNode ref, so we hold onto it above first.
for (attr in node) {
if (node.hasOwnProperty(attr)) {
delete node[attr];
}
}
}
parent.removeChild(node);
}
}
q.nodes = [];
},
/**
* Progress callback
*
* @method _progress
* @param {string} id The id of the request.
* @param {string} The url which just completed.
* @private
*/
_progress = function(id, url) {
var q = queues[id],
onProgress = q.onProgress,
o;
if (onProgress) {
o = _returnData(q);
o.url = url;
onProgress.call(q.context, o);
}
},
/**
* Timeout detected
* @method _timeout
* @param {string} id the id of the request.
* @private
*/
_timeout = function(id) {
var q = queues[id],
onTimeout = q.onTimeout;
if (onTimeout) {
onTimeout.call(q.context, _returnData(q));
}
_end(id, 'timeout', 'timeout');
},
/**
* onload callback
* @method _loaded
* @param {string} id the id of the request.
* @return {string} the result.
* @private
*/
_loaded = function(id, url) {
var q = queues[id],
sync = !q.async;
if (sync) {
_clearTimeout(q);
}
_progress(id, url);
// TODO: Cleaning up flow to have a consistent end point
// !q.finished check is for the async case,
// where scripts may still be loading when we've
// already aborted. Ideally there should be a single path
// for this.
if (!q.finished) {
if (q.aborted) {
_abort(id);
} else {
if ((--q.remaining) === 0) {
_complete(id);
} else if (sync) {
_next(id);
}
}
}
},
/**
* Detects when a node has been loaded. In the case of
* script nodes, this does not guarantee that contained
* script is ready to use.
* @method _trackLoad
* @param {string} type the type of node to track.
* @param {HTMLElement} n the node to track.
* @param {string} id the id of the request.
* @param {string} url the url that is being loaded.
* @private
*/
_trackLoad = function(type, n, id, url) {
// TODO: Can we massage this to use ONLOAD_SUPPORTED[type]?
// IE supports the readystatechange event for script and css nodes
// Opera only for script nodes. Opera support onload for script
// nodes, but this doesn't fire when there is a load failure.
// The onreadystatechange appears to be a better way to respond
// to both success and failure.
if (ua.ie) {
n.onreadystatechange = function() {
var rs = this.readyState;
if ('loaded' === rs || 'complete' === rs) {
n.onreadystatechange = null;
_loaded(id, url);
}
};
} else if (ua.webkit) {
// webkit prior to 3.x is no longer supported
if (type === SCRIPT) {
// Safari 3.x supports the load event for script nodes (DOM2)
n.addEventListener('load', function() {
_loaded(id, url);
}, false);
}
} else {
// FireFox and Opera support onload (but not DOM2 in FF) handlers for
// script nodes. Opera, but not FF, supports the onload event for link nodes.
n.onload = function() {
_loaded(id, url);
};
n.onerror = function(e) {
_fail(id, e + ': ' + url);
};
}
},
_insertInDoc = function(node, id, win) {
// Add it to the head or insert it before 'insertBefore'.
// Work around IE bug if there is a base tag.
var q = queues[id],
doc = win.document,
insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0],
sibling;
if (insertBefore) {
sibling = _getNodeRef(insertBefore, id);
if (sibling) {
sibling.parentNode.insertBefore(node, sibling);
}
} else {
// 3.3.0 assumed head is always around.
doc.getElementsByTagName('head')[0].appendChild(node);
}
},
/**
* Loads the next item for a given request
* @method _next
* @param {string} id the id of the request.
* @return {string} the result.
* @private
*/
_next = function(id) {
// Assigning out here for readability
var q = queues[id],
type = q.type,
attrs = q.attributes,
win = q.win,
timeout = q.timeout,
node,
url;
if (q.url.length > 0) {
url = q.url.shift();
// !q.timer ensures that this only happens once for async
if (timeout && !q.timer) {
q.timer = setTimeout(function() {
_timeout(id);
}, timeout);
}
if (type === SCRIPT) {
node = _scriptNode(url, win, attrs);
} else {
node = _linkNode(url, win, attrs);
}
// add the node to the queue so we can return it in the callback
q.nodes.push(node);
_trackLoad(type, node, id, url);
_insertInDoc(node, id, win);
if (!ONLOAD_SUPPORTED[type]) {
_loaded(id, url);
}
if (q.async) {
// For sync, the _next call is chained in _loaded
_next(id);
}
}
},
/**
* Removes processed queues and corresponding nodes
* @method _autoPurge
* @private
*/
_autoPurge = function() {
if (purging) {
return;
}
purging = true;
var i, q;
for (i in queues) {
if (queues.hasOwnProperty(i)) {
q = queues[i];
if (q.autopurge && q.finished) {
_purge(q.tId);
delete queues[i];
}
}
}
purging = false;
},
/**
* Saves the state for the request and begins loading
* the requested urls
* @method queue
* @param {string} type the type of node to insert.
* @param {string} url the url to load.
* @param {object} opts the hash of options for this request.
* @return {object} transaction object.
* @private
*/
_queue = function(type, url, opts) {
opts = opts || {};
var id = 'q' + (qidx++),
thresh = opts.purgethreshold || Y.Get.PURGE_THRESH,
q;
if (qidx % thresh === 0) {
_autoPurge();
}
// Merge to protect opts (grandfathered in).
q = queues[id] = Y.merge(opts);
// Avoid mix, merge overhead. Known set of props.
q.tId = id;
q.type = type;
q.url = url;
q.finished = false;
q.nodes = [];
q.win = q.win || Y.config.win;
q.context = q.context || q;
q.autopurge = (AUTOPURGE in q) ? q.autopurge : (type === SCRIPT) ? true : false;
q.attributes = q.attributes || {};
q.attributes.charset = opts.charset || q.attributes.charset || UTF8;
if (ASYNC in q && type === SCRIPT) {
q.attributes.async = q.async;
}
q.url = (L.isString(q.url)) ? [q.url] : q.url;
// TODO: Do we really need to account for this developer error?
// If the url is undefined, this is probably a trailing comma problem in IE.
if (!q.url[0]) {
q.url.shift();
}
q.remaining = q.url.length;
_next(id);
return {
tId: id
};
};
Y.Get = {
/**
* The number of request required before an automatic purge.
* Can be configured via the 'purgethreshold' config
* property PURGE_THRESH
* @static
* @type int
* @default 20
* @private
*/
PURGE_THRESH: 20,
/**
* Abort a transaction
* @method abort
* @static
* @param {string|object} o Either the tId or the object returned from
* script() or css().
*/
abort : function(o) {
var id = (L.isString(o)) ? o : o.tId,
q = queues[id];
if (q) {
q.aborted = true;
}
},
/**
* Fetches and inserts one or more script nodes into the head
* of the current document or the document in a specified window.
*
* @method script
* @static
* @param {string|string[]} url the url or urls to the script(s).
* @param {object} opts Options:
* <dl>
* <dt>onSuccess</dt>
* <dd>
* callback to execute when the script(s) are finished loading
* The callback receives an object back with the following
* data:
* <dl>
* <dt>win</dt>
* <dd>the window the script(s) were inserted into</dd>
* <dt>data</dt>
* <dd>the data object passed in when the request was made</dd>
* <dt>nodes</dt>
* <dd>An array containing references to the nodes that were
* inserted</dd>
* <dt>purge</dt>
* <dd>A function that, when executed, will remove the nodes
* that were inserted</dd>
* <dt>
* </dl>
* </dd>
* <dt>onTimeout</dt>
* <dd>
* callback to execute when a timeout occurs.
* The callback receives an object back with the following
* data:
* <dl>
* <dt>win</dt>
* <dd>the window the script(s) were inserted into</dd>
* <dt>data</dt>
* <dd>the data object passed in when the request was made</dd>
* <dt>nodes</dt>
* <dd>An array containing references to the nodes that were
* inserted</dd>
* <dt>purge</dt>
* <dd>A function that, when executed, will remove the nodes
* that were inserted</dd>
* <dt>
* </dl>
* </dd>
* <dt>onEnd</dt>
* <dd>a function that executes when the transaction finishes,
* regardless of the exit path</dd>
* <dt>onFailure</dt>
* <dd>
* callback to execute when the script load operation fails
* The callback receives an object back with the following
* data:
* <dl>
* <dt>win</dt>
* <dd>the window the script(s) were inserted into</dd>
* <dt>data</dt>
* <dd>the data object passed in when the request was made</dd>
* <dt>nodes</dt>
* <dd>An array containing references to the nodes that were
* inserted successfully</dd>
* <dt>purge</dt>
* <dd>A function that, when executed, will remove any nodes
* that were inserted</dd>
* <dt>
* </dl>
* </dd>
* <dt>onProgress</dt>
* <dd>callback to execute when each individual file is done loading
* (useful when passing in an array of js files). Receives the same
* payload as onSuccess, with the addition of a <code>url</code>
* property, which identifies the file which was loaded.</dd>
* <dt>async</dt>
* <dd>
* <p>When passing in an array of JS files, setting this flag to true
* will insert them into the document in parallel, as opposed to the
* default behavior, which is to chain load them serially. It will also
* set the async attribute on the script node to true.</p>
* <p>Setting async:true
* will lead to optimal file download performance allowing the browser to
* download multiple scripts in parallel, and execute them as soon as they
* are available.</p>
* <p>Note that async:true does not guarantee execution order of the
* scripts being downloaded. They are executed in whichever order they
* are received.</p>
* </dd>
* <dt>context</dt>
* <dd>the execution context for the callbacks</dd>
* <dt>win</dt>
* <dd>a window other than the one the utility occupies</dd>
* <dt>autopurge</dt>
* <dd>
* setting to true will let the utilities cleanup routine purge
* the script once loaded
* </dd>
* <dt>purgethreshold</dt>
* <dd>
* The number of transaction before autopurge should be initiated
* </dd>
* <dt>data</dt>
* <dd>
* data that is supplied to the callback when the script(s) are
* loaded.
* </dd>
* <dt>insertBefore</dt>
* <dd>node or node id that will become the new node's nextSibling.
* If this is not specified, nodes will be inserted before a base
* tag should it exist. Otherwise, the nodes will be appended to the
* end of the document head.</dd>
* </dl>
* <dt>charset</dt>
* <dd>Node charset, default utf-8 (deprecated, use the attributes
* config)</dd>
* <dt>attributes</dt>
* <dd>An object literal containing additional attributes to add to
* the link tags</dd>
* <dt>timeout</dt>
* <dd>Number of milliseconds to wait before aborting and firing
* the timeout event</dd>
* <pre>
* Y.Get.script(
* ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
* "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
* {
* onSuccess: function(o) {
* this.log("won't cause error because Y is the context");
* // immediately
* },
* onFailure: function(o) {
* },
* onTimeout: function(o) {
* },
* data: "foo",
* timeout: 10000, // 10 second timeout
* context: Y, // make the YUI instance
* // win: otherframe // target another window/frame
* autopurge: true // allow the utility to choose when to
* // remove the nodes
* purgetheshold: 1 // purge previous transaction before
* // next transaction
* });.
* </pre>
* @return {tId: string} an object containing info about the
* transaction.
*/
script: function(url, opts) {
return _queue(SCRIPT, url, opts);
},
/**
* Fetches and inserts one or more css link nodes into the
* head of the current document or the document in a specified
* window.
* @method css
* @static
* @param {string} url the url or urls to the css file(s).
* @param {object} opts Options:
* <dl>
* <dt>onSuccess</dt>
* <dd>
* callback to execute when the css file(s) are finished loading
* The callback receives an object back with the following
* data:
* <dl>win</dl>
* <dd>the window the link nodes(s) were inserted into</dd>
* <dt>data</dt>
* <dd>the data object passed in when the request was made</dd>
* <dt>nodes</dt>
* <dd>An array containing references to the nodes that were
* inserted</dd>
* <dt>purge</dt>
* <dd>A function that, when executed, will remove the nodes
* that were inserted</dd>
* <dt>
* </dl>
* </dd>
* <dt>onProgress</dt>
* <dd>callback to execute when each individual file is done loading (useful when passing in an array of css files). Receives the same
* payload as onSuccess, with the addition of a <code>url</code> property, which identifies the file which was loaded. Currently only useful for non Webkit/Gecko browsers,
* where onload for css is detected accurately.</dd>
* <dt>async</dt>
* <dd>When passing in an array of css files, setting this flag to true will insert them
* into the document in parallel, as oppposed to the default behavior, which is to chain load them (where possible).
* This flag is more useful for scripts currently, since for css Get only chains if not Webkit/Gecko.</dd>
* <dt>context</dt>
* <dd>the execution context for the callbacks</dd>
* <dt>win</dt>
* <dd>a window other than the one the utility occupies</dd>
* <dt>data</dt>
* <dd>
* data that is supplied to the callbacks when the nodes(s) are
* loaded.
* </dd>
* <dt>insertBefore</dt>
* <dd>node or node id that will become the new node's nextSibling</dd>
* <dt>charset</dt>
* <dd>Node charset, default utf-8 (deprecated, use the attributes
* config)</dd>
* <dt>attributes</dt>
* <dd>An object literal containing additional attributes to add to
* the link tags</dd>
* </dl>
* <pre>
* Y.Get.css("http://localhost/css/menu.css");
* </pre>
* <pre>
* Y.Get.css(
* ["http://localhost/css/menu.css",
* insertBefore: 'custom-styles' // nodes will be inserted
* // before the specified node
* });.
* </pre>
* @return {tId: string} an object containing info about the
* transaction.
*/
css: function(url, opts) {
return _queue('css', url, opts);
}
};
}, '@VERSION@' ,{requires:['yui-base']});
YUI.add('features', function(Y) {
var feature_tests = {};
Y.mix(Y.namespace('Features'), {
tests: feature_tests,
add: function(cat, name, o) {
feature_tests[cat] = feature_tests[cat] || {};
feature_tests[cat][name] = o;
},
all: function(cat, args) {
var cat_o = feature_tests[cat],
// results = {};
result = [];
if (cat_o) {
Y.Object.each(cat_o, function(v, k) {
result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0));
});
}
return (result.length) ? result.join(';') : '';
},
test: function(cat, name, args) {
args = args || [];
var result, ua, test,
cat_o = feature_tests[cat],
feature = cat_o && cat_o[name];
if (!feature) {
} else {
result = feature.result;
if (Y.Lang.isUndefined(result)) {
ua = feature.ua;
if (ua) {
result = (Y.UA[ua]);
}
test = feature.test;
if (test && ((!ua) || result)) {
result = test.apply(Y, args);
}
feature.result = result;
}
}
return result;
}
});
// Y.Features.add("load", "1", {});
// Y.Features.test("load", "1");
// caps=1:1;2:0;3:1;
/* This file is auto-generated by src/loader/meta_join.py */
var add = Y.Features.add;
// graphics-svg.js
add('load', '0', {
"name": "graphics-svg",
"test": function(Y) {
var DOCUMENT = Y.config.doc;
return (DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
},
"trigger": "graphics"
});
// ie-base-test.js
add('load', '1', {
"name": "event-base-ie",
"test": function(Y) {
var imp = Y.config.doc && Y.config.doc.implementation;
return (imp && (!imp.hasFeature('Events', '2.0')));
},
"trigger": "node-base"
});
// graphics-vml.js
add('load', '2', {
"name": "graphics-vml",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
canvas = DOCUMENT.createElement("canvas");
return (!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
"trigger": "graphics"
});
// ie-style-test.js
add('load', '3', {
"name": "dom-style-ie",
"test": function (Y) {
var testFeature = Y.Features.test,
addFeature = Y.Features.add,
WINDOW = Y.config.win,
DOCUMENT = Y.config.doc,
DOCUMENT_ELEMENT = 'documentElement',
ret = false;
addFeature('style', 'computedStyle', {
test: function() {
return WINDOW && 'getComputedStyle' in WINDOW;
}
});
addFeature('style', 'opacity', {
test: function() {
return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
}
});
ret = (!testFeature('style', 'opacity') &&
!testFeature('style', 'computedStyle'));
return ret;
},
"trigger": "dom-style"
});
// 0
add('load', '4', {
"name": "widget-base-ie",
"trigger": "widget-base",
"ua": "ie"
});
// autocomplete-list-keys-sniff.js
add('load', '5', {
"name": "autocomplete-list-keys",
"test": function (Y) {
// Only add keyboard support to autocomplete-list if this doesn't appear to
// be an iOS or Android-based mobile device.
//
// There's currently no feasible way to actually detect whether a device has
// a hardware keyboard, so this sniff will have to do. It can easily be
// overridden by manually loading the autocomplete-list-keys module.
//
// Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
// doesn't fire the keyboard events used by AutoCompleteList, so there's
// no point loading the -keys module even when a bluetooth keyboard may be
// available.
return !(Y.UA.ios || Y.UA.android);
},
"trigger": "autocomplete-list"
});
// graphics-canvas.js
add('load', '6', {
"name": "graphics-canvas-default",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
canvas = DOCUMENT.createElement("canvas");
return (!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
},
"trigger": "graphics"
});
// dd-gestures-test.js
add('load', '7', {
"name": "dd-gestures",
"test": function(Y) {
return (Y.config.win && ('ontouchstart' in Y.config.win && !Y.UA.chrome));
},
"trigger": "dd-drag"
});
// selector-test.js
add('load', '8', {
"name": "selector-css2",
"test": function (Y) {
var DOCUMENT = Y.config.doc,
ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
return ret;
},
"trigger": "selector"
});
// history-hash-ie-test.js
add('load', '9', {
"name": "history-hash-ie",
"test": function (Y) {
var docMode = Y.config.doc && Y.config.doc.documentMode;
return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
!docMode || docMode < 8);
},
"trigger": "history-hash"
});
}, '@VERSION@' ,{requires:['yui-base']});
YUI.add('intl-base', function(Y) {
/**
* The Intl utility provides a central location for managing sets of
* localized resources (strings and formatting patterns).
*
* @class Intl
* @uses EventTarget
* @static
*/
var SPLIT_REGEX = /[, ]/;
Y.mix(Y.namespace('Intl'), {
/**
* Returns the language among those available that
* best matches the preferred language list, using the Lookup
* algorithm of BCP 47.
* If none of the available languages meets the user's preferences,
* then "" is returned.
* Extended language ranges are not supported.
*
* @method lookupBestLang
* @param {String[] | String} preferredLanguages The list of preferred
* languages in descending preference order, represented as BCP 47
* language tags. A string array or a comma-separated list.
* @param {String[]} availableLanguages The list of languages
* that the application supports, represented as BCP 47 language
* tags.
*
* @return {String} The available language that best matches the
* preferred language list, or "".
* @since 3.1.0
*/
lookupBestLang: function(preferredLanguages, availableLanguages) {
var i, language, result, index;
// check whether the list of available languages contains language;
// if so return it
function scan(language) {
var i;
for (i = 0; i < availableLanguages.length; i += 1) {
if (language.toLowerCase() ===
availableLanguages[i].toLowerCase()) {
return availableLanguages[i];
}
}
}
if (Y.Lang.isString(preferredLanguages)) {
preferredLanguages = preferredLanguages.split(SPLIT_REGEX);
}
for (i = 0; i < preferredLanguages.length; i += 1) {
language = preferredLanguages[i];
if (!language || language === '*') {
continue;
}
// check the fallback sequence for one language
while (language.length > 0) {
result = scan(language);
if (result) {
return result;
} else {
index = language.lastIndexOf('-');
if (index >= 0) {
language = language.substring(0, index);
// one-character subtags get cut along with the
// following subtag
if (index >= 2 && language.charAt(index - 2) === '-') {
language = language.substring(0, index - 2);
}
} else {
// nothing available for this language
break;
}
}
}
}
return '';
}
});
}, '@VERSION@' ,{requires:['yui-base']});
YUI.add('yui-log', function(Y) {
/**
* Provides console log capability and exposes a custom event for
* console implementations.
* @module yui
* @submodule yui-log
*/
var INSTANCE = Y,
LOGEVENT = 'yui:log',
UNDEFINED = 'undefined',
LEVELS = { debug: 1,
info: 1,
warn: 1,
error: 1 };
/**
* If the 'debug' config is true, a 'yui:log' event will be
* dispatched, which the Console widget and anything else
* can consume. If the 'useBrowserConsole' config is true, it will
* write to the browser console if available. YUI-specific log
* messages will only be present in the -debug versions of the
* JS files. The build system is supposed to remove log statements
* from the raw and minified versions of the files.
*
* @method log
* @for YUI
* @param {String} msg The message to log.
* @param {String} cat The log category for the message. Default
* categories are "info", "warn", "error", time".
* Custom categories can be used as well. (opt).
* @param {String} src The source of the the message (opt).
* @param {boolean} silent If true, the log event won't fire.
* @return {YUI} YUI instance.
*/
INSTANCE.log = function(msg, cat, src, silent) {
var bail, excl, incl, m, f,
Y = INSTANCE,
c = Y.config,
publisher = (Y.fire) ? Y : YUI.Env.globalEvents;
// suppress log message if the config is off or the event stack
// or the event call stack contains a consumer of the yui:log event
if (c.debug) {
// apply source filters
if (src) {
excl = c.logExclude;
incl = c.logInclude;
if (incl && !(src in incl)) {
bail = 1;
} else if (incl && (src in incl)) {
bail = !incl[src];
} else if (excl && (src in excl)) {
bail = excl[src];
}
}
if (!bail) {
if (c.useBrowserConsole) {
m = (src) ? src + ': ' + msg : msg;
if (Y.Lang.isFunction(c.logFn)) {
c.logFn.call(Y, msg, cat, src);
} else if (typeof console != UNDEFINED && console.log) {
f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log';
console[f](m);
} else if (typeof opera != UNDEFINED) {
opera.postError(m);
}
}
if (publisher && !silent) {
if (publisher == Y && (!publisher.getEvent(LOGEVENT))) {
publisher.publish(LOGEVENT, {
broadcast: 2
});
}
publisher.fire(LOGEVENT, {
msg: msg,
cat: cat,
src: src
});
}
}
}
return Y;
};
/**
* Write a system message. This message will be preserved in the
* minified and raw versions of the YUI files, unlike log statements.
* @method message
* @for YUI
* @param {String} msg The message to log.
* @param {String} cat The log category for the message. Default
* categories are "info", "warn", "error", time".
* Custom categories can be used as well. (opt).
* @param {String} src The source of the the message (opt).
* @param {boolean} silent If true, the log event won't fire.
* @return {YUI} YUI instance.
*/
INSTANCE.message = function() {
return INSTANCE.log.apply(INSTANCE, arguments);
};
}, '@VERSION@' ,{requires:['yui-base']});
YUI.add('yui-later', function(Y) {
/**
* Provides a setTimeout/setInterval wrapper
* @module yui
* @submodule yui-later
*/
var NO_ARGS = [];
/**
* Executes the supplied function in the context of the supplied
* object 'when' milliseconds later. Executes the function a
* single time unless periodic is set to true.
* @method later
* @for YUI
* @param when {int} the number of milliseconds to wait until the fn
* is executed.
* @param o the context object.
* @param fn {Function|String} the function to execute or the name of
* the method in the 'o' object to execute.
* @param data [Array] data that is provided to the function. This
* accepts either a single item or an array. If an array is provided,
* the function is executed with one parameter for each array item.
* If you need to pass a single array parameter, it needs to be wrapped
* in an array [myarray].
*
* Note: native methods in IE may not have the call and apply methods.
* In this case, it will work, but you are limited to four arguments.
*
* @param periodic {boolean} if true, executes continuously at supplied
* interval until canceled.
* @return {object} a timer object. Call the cancel() method on this
* object to stop the timer.
*/
Y.later = function(when, o, fn, data, periodic) {
when = when || 0;
data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : data;
var cancelled = false,
method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,
wrapper = function() {
// IE 8- may execute a setInterval callback one last time
// after clearInterval was called, so in order to preserve
// the cancel() === no more runny-run, we have to jump through
// an extra hoop.
if (!cancelled) {
if (!method.apply) {
method(data[0], data[1], data[2], data[3]);
} else {
method.apply(o, data || NO_ARGS);
}
}
},
id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when);
return {
id: id,
interval: periodic,
cancel: function() {
cancelled = true;
if (this.interval) {
clearInterval(id);
} else {
clearTimeout(id);
}
}
};
};
Y.Lang.later = Y.later;
}, '@VERSION@' ,{requires:['yui-base']});
YUI.add('loader-base', function(Y) {
/**
* The YUI loader core
* @module loader
* @submodule loader-base
*/
if (!YUI.Env[Y.version]) {
(function() {
var VERSION = Y.version,
BUILD = '/build/',
ROOT = VERSION + BUILD,
CDN_BASE = Y.Env.base,
GALLERY_VERSION = 'gallery-2011.06.08-20-04',
TNT = '2in3',
TNT_VERSION = '4',
YUI2_VERSION = '2.9.0',
COMBO_BASE = CDN_BASE + 'combo?',
META = { version: VERSION,
root: ROOT,
base: Y.Env.base,
comboBase: COMBO_BASE,
skin: { defaultSkin: 'sam',
base: 'assets/skins/',
path: 'skin.css',
after: ['cssreset',
'cssfonts',
'cssgrids',
'cssbase',
'cssreset-context',
'cssfonts-context']},
groups: {},
patterns: {} },
groups = META.groups,
yui2Update = function(tnt, yui2) {
var root = TNT + '.' +
(tnt || TNT_VERSION) + '/' +
(yui2 || YUI2_VERSION) + BUILD;
groups.yui2.base = CDN_BASE + root;
groups.yui2.root = root;
},
galleryUpdate = function(tag) {
var root = (tag || GALLERY_VERSION) + BUILD;
groups.gallery.base = CDN_BASE + root;
groups.gallery.root = root;
};
groups[VERSION] = {};
groups.gallery = {
ext: false,
combine: true,
comboBase: COMBO_BASE,
update: galleryUpdate,
patterns: { 'gallery-': { },
'lang/gallery-': {},
'gallerycss-': { type: 'css' } }
};
groups.yui2 = {
combine: true,
ext: false,
comboBase: COMBO_BASE,
update: yui2Update,
patterns: {
'yui2-': {
configFn: function(me) {
if (/-skin|reset|fonts|grids|base/.test(me.name)) {
me.type = 'css';
me.path = me.path.replace(/\.js/, '.css');
// this makes skins in builds earlier than
// 2.6.0 work as long as combine is false
me.path = me.path.replace(/\/yui2-skin/,
'/assets/skins/sam/yui2-skin');
}
}
}
}
};
galleryUpdate();
yui2Update();
YUI.Env[VERSION] = META;
}());
}
/**
* Loader dynamically loads script and css files. It includes the dependency
* info for the version of the library in use, and will automatically pull in
* dependencies for the modules requested. It supports rollup files and will
* automatically use these when appropriate in order to minimize the number of
* http connections required to load all of the dependencies. It can load the
* files from the Yahoo! CDN, and it can utilize the combo service provided on
* this network to reduce the number of http connections required to download
* YUI files.
*
* @module loader
* @submodule loader-base
*/
var NOT_FOUND = {},
NO_REQUIREMENTS = [],
MAX_URL_LENGTH = (Y.UA.ie) ? 2048 : 8192,
GLOBAL_ENV = YUI.Env,
GLOBAL_LOADED = GLOBAL_ENV._loaded,
CSS = 'css',
JS = 'js',
INTL = 'intl',
VERSION = Y.version,
ROOT_LANG = '',
YObject = Y.Object,
oeach = YObject.each,
YArray = Y.Array,
_queue = GLOBAL_ENV._loaderQueue,
META = GLOBAL_ENV[VERSION],
SKIN_PREFIX = 'skin-',
L = Y.Lang,
ON_PAGE = GLOBAL_ENV.mods,
modulekey,
cache,
_path = function(dir, file, type, nomin) {
var path = dir + '/' + file;
if (!nomin) {
path += '-min';
}
path += '.' + (type || CSS);
return path;
};
/**
* The component metadata is stored in Y.Env.meta.
* Part of the loader module.
* @property Env.meta
* @for YUI
*/
Y.Env.meta = META;
/**
* Loader dynamically loads script and css files. It includes the dependency
* info for the version of the library in use, and will automatically pull in
* dependencies for the modules requested. It supports rollup files and will
* automatically use these when appropriate in order to minimize the number of
* http connections required to load all of the dependencies. It can load the
* files from the Yahoo! CDN, and it can utilize the combo service provided on
* this network to reduce the number of http connections required to download
* YUI files.
*
* While the loader can be instantiated by the end user, it normally is not.
* @see YUI.use for the normal use case. The use function automatically will
* pull in missing dependencies.
*
* @constructor
* @class Loader
* @param {object} o an optional set of configuration options. Valid options:
* <ul>
* <li>base:
* The base dir</li>
* <li>comboBase:
* The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo?</li>
* <li>root:
* The root path to prepend to module names for the combo service.
* Ex: 2.5.2/build/</li>
* <li>filter:.
*
* A filter to apply to result urls. This filter will modify the default
* path for all modules. The default path for the YUI library is the
* minified version of the files (e.g., event-min.js). The filter property
* can be a predefined filter or a custom filter. The valid predefined
* filters are:
* <dl>
* <dt>DEBUG</dt>
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* This option will automatically include the Logger widget</dd>
* <dt>RAW</dt>
* <dd>Selects the non-minified version of the library (e.g., event.js).
* </dd>
* </dl>
* You can also define a custom filter, which must be an object literal
* containing a search expression and a replace string:
* <pre>
* myFilter: {
* 'searchExp': "-min\\.js",
* 'replaceStr': "-debug.js"
* }
* </pre>
*
* </li>
* <li>filters: per-component filter specification. If specified
* for a given component, this overrides the filter config</li>
* <li>combine:
* Use the YUI combo service to reduce the number of http connections
* required to load your dependencies</li>
* <li>ignore:
* A list of modules that should never be dynamically loaded</li>
* <li>force:
* A list of modules that should always be loaded when required, even if
* already present on the page</li>
* <li>insertBefore:
* Node or id for a node that should be used as the insertion point for
* new nodes</li>
* <li>charset:
* charset for dynamic nodes (deprecated, use jsAttributes or cssAttributes)
* </li>
* <li>jsAttributes: object literal containing attributes to add to script
* nodes</li>
* <li>cssAttributes: object literal containing attributes to add to link
* nodes</li>
* <li>timeout:
* The number of milliseconds before a timeout occurs when dynamically
* loading nodes. If not set, there is no timeout</li>
* <li>context:
* execution context for all callbacks</li>
* <li>onSuccess:
* callback for the 'success' event</li>
* <li>onFailure: callback for the 'failure' event</li>
* <li>onCSS: callback for the 'CSSComplete' event. When loading YUI
* components with CSS the CSS is loaded first, then the script. This
* provides a moment you can tie into to improve
* the presentation of the page while the script is loading.</li>
* <li>onTimeout:
* callback for the 'timeout' event</li>
* <li>onProgress:
* callback executed each time a script or css file is loaded</li>
* <li>modules:
* A list of module definitions. See Loader.addModule for the supported
* module metadata</li>
* <li>groups:
* A list of group definitions. Each group can contain specific definitions
* for base, comboBase, combine, and accepts a list of modules. See above
* for the description of these properties.</li>
* <li>2in3: the version of the YUI 2 in 3 wrapper to use. The intrinsic
* support for YUI 2 modules in YUI 3 relies on versions of the YUI 2
* components inside YUI 3 module wrappers. These wrappers
* change over time to accomodate the issues that arise from running YUI 2
* in a YUI 3 sandbox.</li>
* <li>yui2: when using the 2in3 project, you can select the version of
* YUI 2 to use. Valid values * are 2.2.2, 2.3.1, 2.4.1, 2.5.2, 2.6.0,
* 2.7.0, 2.8.0, and 2.8.1 [default] -- plus all versions of YUI 2
* going forward.</li>
* </ul>
*/
Y.Loader = function(o) {
var defaults = META.modules,
self = this;
modulekey = META.md5;
/**
* Internal callback to handle multiple internal insert() calls
* so that css is inserted prior to js
* @property _internalCallback
* @private
*/
// self._internalCallback = null;
/**
* Callback that will be executed when the loader is finished
* with an insert
* @method onSuccess
* @type function
*/
// self.onSuccess = null;
/**
* Callback that will be executed if there is a failure
* @method onFailure
* @type function
*/
// self.onFailure = null;
/**
* Callback for the 'CSSComplete' event. When loading YUI components
* with CSS the CSS is loaded first, then the script. This provides
* a moment you can tie into to improve the presentation of the page
* while the script is loading.
* @method onCSS
* @type function
*/
// self.onCSS = null;
/**
* Callback executed each time a script or css file is loaded
* @method onProgress
* @type function
*/
// self.onProgress = null;
/**
* Callback that will be executed if a timeout occurs
* @method onTimeout
* @type function
*/
// self.onTimeout = null;
/**
* The execution context for all callbacks
* @property context
* @default {YUI} the YUI instance
*/
self.context = Y;
/**
* Data that is passed to all callbacks
* @property data
*/
// self.data = null;
/**
* Node reference or id where new nodes should be inserted before
* @property insertBefore
* @type string|HTMLElement
*/
// self.insertBefore = null;
/**
* The charset attribute for inserted nodes
* @property charset
* @type string
* @deprecated , use cssAttributes or jsAttributes.
*/
// self.charset = null;
/**
* An object literal containing attributes to add to link nodes
* @property cssAttributes
* @type object
*/
// self.cssAttributes = null;
/**
* An object literal containing attributes to add to script nodes
* @property jsAttributes
* @type object
*/
// self.jsAttributes = null;
/**
* The base directory.
* @property base
* @type string
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
*/
self.base = Y.Env.meta.base;
/**
* Base path for the combo service
* @property comboBase
* @type string
* @default http://yui.yahooapis.com/combo?
*/
self.comboBase = Y.Env.meta.comboBase;
/*
* Base path for language packs.
*/
// self.langBase = Y.Env.meta.langBase;
// self.lang = "";
/**
* If configured, the loader will attempt to use the combo
* service for YUI resources and configured external resources.
* @property combine
* @type boolean
* @default true if a base dir isn't in the config
*/
self.combine = o.base &&
(o.base.indexOf(self.comboBase.substr(0, 20)) > -1);
/**
* Max url length for combo urls. The default is 2048 for
* internet explorer, and 8192 otherwise. This is the URL
* limit for the Yahoo! hosted combo servers. If consuming
* a different combo service that has a different URL limit
* it is possible to override this default by supplying
* the maxURLLength config option. The config option will
* only take effect if lower than the default.
*
* Browsers:
* IE: 2048
* Other A-Grade Browsers: Higher that what is typically supported
* 'capable' mobile browsers:
*
* Servers:
* Apache: 8192
*
* @property maxURLLength
* @type int
*/
self.maxURLLength = MAX_URL_LENGTH;
/**
* Ignore modules registered on the YUI global
* @property ignoreRegistered
* @default false
*/
// self.ignoreRegistered = false;
/**
* Root path to prepend to module path for the combo
* service
* @property root
* @type string
* @default [YUI VERSION]/build/
*/
self.root = Y.Env.meta.root;
/**
* Timeout value in milliseconds. If set, self value will be used by
* the get utility. the timeout event will fire if
* a timeout occurs.
* @property timeout
* @type int
*/
self.timeout = 0;
/**
* A list of modules that should not be loaded, even if
* they turn up in the dependency tree
* @property ignore
* @type string[]
*/
// self.ignore = null;
/**
* A list of modules that should always be loaded, even
* if they have already been inserted into the page.
* @property force
* @type string[]
*/
// self.force = null;
self.forceMap = {};
/**
* Should we allow rollups
* @property allowRollup
* @type boolean
* @default false
*/
self.allowRollup = false;
/**
* A filter to apply to result urls. This filter will modify the default
* path for all modules. The default path for the YUI library is the
* minified version of the files (e.g., event-min.js). The filter property
* can be a predefined filter or a custom filter. The valid predefined
* filters are:
* <dl>
* <dt>DEBUG</dt>
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* This option will automatically include the Logger widget</dd>
* <dt>RAW</dt>
* <dd>Selects the non-minified version of the library (e.g., event.js).
* </dd>
* </dl>
* You can also define a custom filter, which must be an object literal
* containing a search expression and a replace string:
* <pre>
* myFilter: {
* 'searchExp': "-min\\.js",
* 'replaceStr': "-debug.js"
* }
* </pre>
* @property filter
* @type string| {searchExp: string, replaceStr: string}
*/
// self.filter = null;
/**
* per-component filter specification. If specified for a given
* component, this overrides the filter config.
* @property filters
* @type object
*/
self.filters = {};
/**
* The list of requested modules
* @property required
* @type {string: boolean}
*/
self.required = {};
/**
* If a module name is predefined when requested, it is checked againsts
* the patterns provided in this property. If there is a match, the
* module is added with the default configuration.
*
* At the moment only supporting module prefixes, but anticipate
* supporting at least regular expressions.
* @property patterns
* @type Object
*/
// self.patterns = Y.merge(Y.Env.meta.patterns);
self.patterns = {};
/**
* The library metadata
* @property moduleInfo
*/
// self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);
self.moduleInfo = {};
self.groups = Y.merge(Y.Env.meta.groups);
/**
* Provides the information used to skin the skinnable components.
* The following skin definition would result in 'skin1' and 'skin2'
* being loaded for calendar (if calendar was requested), and
* 'sam' for all other skinnable components:
*
* <code>
* skin: {
*
* // The default skin, which is automatically applied if not
* // overriden by a component-specific skin definition.
* // Change this in to apply a different skin globally
* defaultSkin: 'sam',
*
* // This is combined with the loader base property to get
* // the default root directory for a skin. ex:
* // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
* base: 'assets/skins/',
*
* // Any component-specific overrides can be specified here,
* // making it possible to load different skins for different
* // components. It is possible to load more than one skin
* // for a given component as well.
* overrides: {
* calendar: ['skin1', 'skin2']
* }
* }
* </code>
* @property skin
*/
self.skin = Y.merge(Y.Env.meta.skin);
/*
* Map of conditional modules
* @since 3.2.0
*/
self.conditions = {};
// map of modules with a hash of modules that meet the requirement
// self.provides = {};
self.config = o;
self._internal = true;
cache = GLOBAL_ENV._renderedMods;
if (cache) {
oeach(cache, function modCache(v, k) {
//self.moduleInfo[k] = Y.merge(v);
self.moduleInfo[k] = v;
});
cache = GLOBAL_ENV._conditions;
oeach(cache, function condCache(v, k) {
//self.conditions[k] = Y.merge(v);
self.conditions[k] = v;
});
} else {
oeach(defaults, self.addModule, self);
}
if (!GLOBAL_ENV._renderedMods) {
//GLOBAL_ENV._renderedMods = Y.merge(self.moduleInfo);
//GLOBAL_ENV._conditions = Y.merge(self.conditions);
GLOBAL_ENV._renderedMods = self.moduleInfo;
GLOBAL_ENV._conditions = self.conditions;
}
self._inspectPage();
self._internal = false;
self._config(o);
self.testresults = null;
if (Y.config.tests) {
self.testresults = Y.config.tests;
}
/**
* List of rollup files found in the library metadata
* @property rollups
*/
// self.rollups = null;
/**
* Whether or not to load optional dependencies for
* the requested modules
* @property loadOptional
* @type boolean
* @default false
*/
// self.loadOptional = false;
/**
* All of the derived dependencies in sorted order, which
* will be populated when either calculate() or insert()
* is called
* @property sorted
* @type string[]
*/
self.sorted = [];
/**
* Set when beginning to compute the dependency tree.
* Composed of what YUI reports to be loaded combined
* with what has been loaded by any instance on the page
* with the version number specified in the metadata.
* @property loaded
* @type {string: boolean}
*/
self.loaded = GLOBAL_LOADED[VERSION];
/*
* A list of modules to attach to the YUI instance when complete.
* If not supplied, the sorted list of dependencies are applied.
* @property attaching
*/
// self.attaching = null;
/**
* Flag to indicate the dependency tree needs to be recomputed
* if insert is called again.
* @property dirty
* @type boolean
* @default true
*/
self.dirty = true;
/**
* List of modules inserted by the utility
* @property inserted
* @type {string: boolean}
*/
self.inserted = {};
/**
* List of skipped modules during insert() because the module
* was not defined
* @property skipped
*/
self.skipped = {};
// Y.on('yui:load', self.loadNext, self);
self.tested = {};
/*
* Cached sorted calculate results
* @property results
* @since 3.2.0
*/
//self.results = {};
};
Y.Loader.prototype = {
FILTER_DEFS: {
RAW: {
'searchExp': '-min\\.js',
'replaceStr': '.js'
},
DEBUG: {
'searchExp': '-min\\.js',
'replaceStr': '-debug.js'
}
},
_inspectPage: function() {
oeach(ON_PAGE, function(v, k) {
if (v.details) {
var m = this.moduleInfo[k],
req = v.details.requires,
mr = m && m.requires;
if (m) {
if (!m._inspected && req && mr.length != req.length) {
// console.log('deleting ' + m.name);
// m.requres = YObject.keys(Y.merge(YArray.hash(req), YArray.hash(mr)));
delete m.expanded;
// delete m.expanded_map;
}
} else {
m = this.addModule(v.details, k);
}
m._inspected = true;
}
}, this);
},
// returns true if b is not loaded, and is required
// directly or by means of modules it supersedes.
_requires: function(mod1, mod2) {
var i, rm, after_map, s,
info = this.moduleInfo,
m = info[mod1],
other = info[mod2];
if (!m || !other) {
return false;
}
rm = m.expanded_map;
after_map = m.after_map;
// check if this module should be sorted after the other
// do this first to short circut circular deps
if (after_map && (mod2 in after_map)) {
return true;
}
after_map = other.after_map;
// and vis-versa
if (after_map && (mod1 in after_map)) {
return false;
}
// check if this module requires one the other supersedes
s = info[mod2] && info[mod2].supersedes;
if (s) {
for (i = 0; i < s.length; i++) {
if (this._requires(mod1, s[i])) {
return true;
}
}
}
s = info[mod1] && info[mod1].supersedes;
if (s) {
for (i = 0; i < s.length; i++) {
if (this._requires(mod2, s[i])) {
return false;
}
}
}
// check if this module requires the other directly
// if (r && YArray.indexOf(r, mod2) > -1) {
if (rm && (mod2 in rm)) {
return true;
}
// external css files should be sorted below yui css
if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {
return true;
}
return false;
},
_config: function(o) {
var i, j, val, f, group, groupName, self = this;
// apply config values
if (o) {
for (i in o) {
if (o.hasOwnProperty(i)) {
val = o[i];
if (i == 'require') {
self.require(val);
} else if (i == 'skin') {
Y.mix(self.skin, o[i], true);
} else if (i == 'groups') {
for (j in val) {
if (val.hasOwnProperty(j)) {
groupName = j;
group = val[j];
self.addGroup(group, groupName);
}
}
} else if (i == 'modules') {
// add a hash of module definitions
oeach(val, self.addModule, self);
} else if (i == 'gallery') {
this.groups.gallery.update(val);
} else if (i == 'yui2' || i == '2in3') {
this.groups.yui2.update(o['2in3'], o.yui2);
} else if (i == 'maxURLLength') {
self[i] = Math.min(MAX_URL_LENGTH, val);
} else {
self[i] = val;
}
}
}
}
// fix filter
f = self.filter;
if (L.isString(f)) {
f = f.toUpperCase();
self.filterName = f;
self.filter = self.FILTER_DEFS[f];
if (f == 'DEBUG') {
self.require('yui-log', 'dump');
}
}
if (self.lang) {
self.require('intl-base', 'intl');
}
},
/**
* Returns the skin module name for the specified skin name. If a
* module name is supplied, the returned skin module name is
* specific to the module passed in.
* @method formatSkin
* @param {string} skin the name of the skin.
* @param {string} mod optional: the name of a module to skin.
* @return {string} the full skin module name.
*/
formatSkin: function(skin, mod) {
var s = SKIN_PREFIX + skin;
if (mod) {
s = s + '-' + mod;
}
return s;
},
/**
* Adds the skin def to the module info
* @method _addSkin
* @param {string} skin the name of the skin.
* @param {string} mod the name of the module.
* @param {string} parent parent module if this is a skin of a
* submodule or plugin.
* @return {string} the module name for the skin.
* @private
*/
_addSkin: function(skin, mod, parent) {
var mdef, pkg, name, nmod,
info = this.moduleInfo,
sinf = this.skin,
ext = info[mod] && info[mod].ext;
// Add a module definition for the module-specific skin css
if (mod) {
name = this.formatSkin(skin, mod);
if (!info[name]) {
mdef = info[mod];
pkg = mdef.pkg || mod;
nmod = {
name: name,
group: mdef.group,
type: 'css',
after: sinf.after,
path: (parent || pkg) + '/' + sinf.base + skin +
'/' + mod + '.css',
ext: ext
};
if (mdef.base) {
nmod.base = mdef.base;
}
if (mdef.configFn) {
nmod.configFn = mdef.configFn;
}
this.addModule(nmod, name);
}
}
return name;
},
/**
* Add a new module group
* <dl>
* <dt>name:</dt> <dd>required, the group name</dd>
* <dt>base:</dt> <dd>The base dir for this module group</dd>
* <dt>root:</dt> <dd>The root path to add to each combo
* resource path</dd>
* <dt>combine:</dt> <dd>combo handle</dd>
* <dt>comboBase:</dt> <dd>combo service base path</dd>
* <dt>modules:</dt> <dd>the group of modules</dd>
* </dl>
* @method addGroup
* @param {object} o An object containing the module data.
* @param {string} name the group name.
*/
addGroup: function(o, name) {
var mods = o.modules,
self = this;
name = name || o.name;
o.name = name;
self.groups[name] = o;
if (o.patterns) {
oeach(o.patterns, function(v, k) {
v.group = name;
self.patterns[k] = v;
});
}
if (mods) {
oeach(mods, function(v, k) {
v.group = name;
self.addModule(v, k);
}, self);
}
},
/**
* Add a new module to the component metadata.
* <dl>
* <dt>name:</dt> <dd>required, the component name</dd>
* <dt>type:</dt> <dd>required, the component type (js or css)
* </dd>
* <dt>path:</dt> <dd>required, the path to the script from
* "base"</dd>
* <dt>requires:</dt> <dd>array of modules required by this
* component</dd>
* <dt>optional:</dt> <dd>array of optional modules for this
* component</dd>
* <dt>supersedes:</dt> <dd>array of the modules this component
* replaces</dd>
* <dt>after:</dt> <dd>array of modules the components which, if
* present, should be sorted above this one</dd>
* <dt>after_map:</dt> <dd>faster alternative to 'after' -- supply
* a hash instead of an array</dd>
* <dt>rollup:</dt> <dd>the number of superseded modules required
* for automatic rollup</dd>
* <dt>fullpath:</dt> <dd>If fullpath is specified, this is used
* instead of the configured base + path</dd>
* <dt>skinnable:</dt> <dd>flag to determine if skin assets should
* automatically be pulled in</dd>
* <dt>submodules:</dt> <dd>a hash of submodules</dd>
* <dt>group:</dt> <dd>The group the module belongs to -- this
* is set automatically when it is added as part of a group
* configuration.</dd>
* <dt>lang:</dt>
* <dd>array of BCP 47 language tags of languages for which this
* module has localized resource bundles,
* e.g., ["en-GB","zh-Hans-CN"]</dd>
* <dt>condition:</dt>
* <dd>Specifies that the module should be loaded automatically if
* a condition is met. This is an object with up to three fields:
* [trigger] - the name of a module that can trigger the auto-load
* [test] - a function that returns true when the module is to be
* loaded.
* [when] - specifies the load order of the conditional module
* with regard to the position of the trigger module.
* This should be one of three values: 'before', 'after', or
* 'instead'. The default is 'after'.
* </dd>
* <dt>testresults:</dt><dd>a hash of test results from Y.Features.all()</dd>
* </dl>
* @method addModule
* @param {object} o An object containing the module data.
* @param {string} name the module name (optional), required if not
* in the module data.
* @return {object} the module definition or null if
* the object passed in did not provide all required attributes.
*/
addModule: function(o, name) {
name = name || o.name;
if (this.moduleInfo[name]) {
//This catches temp modules loaded via a pattern
// The module will be added twice, once from the pattern and
// Once from the actual add call, this ensures that properties
// that were added to the module the first time around (group: gallery)
// are also added the second time around too.
o = Y.merge(this.moduleInfo[name], o);
}
o.name = name;
if (!o || !o.name) {
return null;
}
if (!o.type) {
o.type = JS;
}
if (!o.path && !o.fullpath) {
o.path = _path(name, name, o.type);
}
o.supersedes = o.supersedes || o.use;
o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;
o.requires = this.filterRequires(o.requires) || [];
// Handle submodule logic
var subs = o.submodules, i, l, sup, s, smod, plugins, plug,
j, langs, packName, supName, flatSup, flatLang, lang, ret,
overrides, skinname, when,
conditions = this.conditions, trigger;
// , existing = this.moduleInfo[name], newr;
this.moduleInfo[name] = o;
if (!o.langPack && o.lang) {
langs = YArray(o.lang);
for (j = 0; j < langs.length; j++) {
lang = langs[j];
packName = this.getLangPackName(lang, name);
smod = this.moduleInfo[packName];
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
}
}
if (subs) {
sup = o.supersedes || [];
l = 0;
for (i in subs) {
if (subs.hasOwnProperty(i)) {
s = subs[i];
s.path = s.path || _path(name, i, o.type);
s.pkg = name;
s.group = o.group;
if (s.supersedes) {
sup = sup.concat(s.supersedes);
}
smod = this.addModule(s, i);
sup.push(i);
if (smod.skinnable) {
o.skinnable = true;
overrides = this.skin.overrides;
if (overrides && overrides[i]) {
for (j = 0; j < overrides[i].length; j++) {
skinname = this._addSkin(overrides[i][j],
i, name);
sup.push(skinname);
}
}
skinname = this._addSkin(this.skin.defaultSkin,
i, name);
sup.push(skinname);
}
// looks like we are expected to work out the metadata
// for the parent module language packs from what is
// specified in the child modules.
if (s.lang && s.lang.length) {
langs = YArray(s.lang);
for (j = 0; j < langs.length; j++) {
lang = langs[j];
packName = this.getLangPackName(lang, name);
supName = this.getLangPackName(lang, i);
smod = this.moduleInfo[packName];
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
flatSup = flatSup || YArray.hash(smod.supersedes);
if (!(supName in flatSup)) {
smod.supersedes.push(supName);
}
o.lang = o.lang || [];
flatLang = flatLang || YArray.hash(o.lang);
if (!(lang in flatLang)) {
o.lang.push(lang);
}
// Add rollup file, need to add to supersedes list too
// default packages
packName = this.getLangPackName(ROOT_LANG, name);
supName = this.getLangPackName(ROOT_LANG, i);
smod = this.moduleInfo[packName];
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
if (!(supName in flatSup)) {
smod.supersedes.push(supName);
}
// Add rollup file, need to add to supersedes list too
}
}
l++;
}
}
//o.supersedes = YObject.keys(YArray.hash(sup));
o.supersedes = YArray.dedupe(sup);
if (this.allowRollup) {
o.rollup = (l < 4) ? l : Math.min(l - 1, 4);
}
}
plugins = o.plugins;
if (plugins) {
for (i in plugins) {
if (plugins.hasOwnProperty(i)) {
plug = plugins[i];
plug.pkg = name;
plug.path = plug.path || _path(name, i, o.type);
plug.requires = plug.requires || [];
plug.group = o.group;
this.addModule(plug, i);
if (o.skinnable) {
this._addSkin(this.skin.defaultSkin, i, name);
}
}
}
}
if (o.condition) {
trigger = o.condition.trigger;
when = o.condition.when;
conditions[trigger] = conditions[trigger] || {};
conditions[trigger][name] = o.condition;
// the 'when' attribute can be 'before', 'after', or 'instead'
// the default is after.
if (when && when != 'after') {
if (when == 'instead') { // replace the trigger
o.supersedes = o.supersedes || [];
o.supersedes.push(trigger);
} else { // before the trigger
// the trigger requires the conditional mod,
// so it should appear before the conditional
// mod if we do not intersede.
}
} else { // after the trigger
o.after = o.after || [];
o.after.push(trigger);
}
}
if (o.after) {
o.after_map = YArray.hash(o.after);
}
// this.dirty = true;
if (o.configFn) {
ret = o.configFn(o);
if (ret === false) {
delete this.moduleInfo[name];
o = null;
}
}
return o;
},
/**
* Add a requirement for one or more module
* @method require
* @param {string[] | string*} what the modules to load.
*/
require: function(what) {
var a = (typeof what === 'string') ? YArray(arguments) : what;
this.dirty = true;
this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));
this._explodeRollups();
},
/**
* Grab all the items that were asked for, check to see if the Loader
* meta-data contains a "use" array. If it doesm remove the asked item and replace it with
* the content of the "use".
* This will make asking for: "dd"
* Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"
* @private
* @method _explodeRollups
*/
_explodeRollups: function() {
var self = this, m,
r = self.required;
if (!self.allowRollup) {
oeach(r, function(v, name) {
m = self.getModule(name);
if (m && m.use) {
//delete r[name];
YArray.each(m.use, function(v) {
m = self.getModule(v);
if (m && m.use) {
//delete r[v];
YArray.each(m.use, function(v) {
r[v] = true;
});
} else {
r[v] = true;
}
});
}
});
self.required = r;
}
},
filterRequires: function(r) {
if (r) {
if (!Y.Lang.isArray(r)) {
r = [r];
}
r = Y.Array(r);
var c = [];
for (var i = 0; i < r.length; i++) {
var mod = this.getModule(r[i]);
if (mod && mod.use) {
for (var o = 0; o < mod.use.length; o++) {
c.push(mod.use[o]);
}
} else {
c.push(r[i]);
}
}
r = c;
}
return r;
},
/**
* Returns an object containing properties for all modules required
* in order to load the requested module
* @method getRequires
* @param {object} mod The module definition from moduleInfo.
* @return {array} the expanded requirement list.
*/
getRequires: function(mod) {
if (!mod || mod._parsed) {
return NO_REQUIREMENTS;
}
var i, m, j, add, packName, lang, testresults = this.testresults,
name = mod.name, cond, go,
adddef = ON_PAGE[name] && ON_PAGE[name].details,
d, k, m1,
r, old_mod,
o, skinmod, skindef,
intl = mod.lang || mod.intl,
info = this.moduleInfo,
ftests = Y.Features && Y.Features.tests.load,
hash;
// console.log(name);
// pattern match leaves module stub that needs to be filled out
if (mod.temp && adddef) {
old_mod = mod;
mod = this.addModule(adddef, name);
mod.group = old_mod.group;
mod.pkg = old_mod.pkg;
delete mod.expanded;
}
// console.log('cache: ' + mod.langCache + ' == ' + this.lang);
// if (mod.expanded && (!mod.langCache || mod.langCache == this.lang)) {
if (mod.expanded && (!this.lang || mod.langCache === this.lang)) {
return mod.expanded;
}
d = [];
hash = {};
r = this.filterRequires(mod.requires);
if (mod.lang) {
//If a module has a lang attribute, auto add the intl requirement.
d.unshift('intl');
r.unshift('intl');
intl = true;
}
o = mod.optional;
mod._parsed = true;
mod.langCache = this.lang;
for (i = 0; i < r.length; i++) {
if (!hash[r[i]]) {
d.push(r[i]);
hash[r[i]] = true;
m = this.getModule(r[i]);
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
// get the requirements from superseded modules, if any
r = mod.supersedes;
if (r) {
for (i = 0; i < r.length; i++) {
if (!hash[r[i]]) {
// if this module has submodules, the requirements list is
// expanded to include the submodules. This is so we can
// prevent dups when a submodule is already loaded and the
// parent is requested.
if (mod.submodules) {
d.push(r[i]);
}
hash[r[i]] = true;
m = this.getModule(r[i]);
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}
if (o && this.loadOptional) {
for (i = 0; i < o.length; i++) {
if (!hash[o[i]]) {
d.push(o[i]);
hash[o[i]] = true;
m = info[o[i]];
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}
cond = this.conditions[name];
if (cond) {
if (testresults && ftests) {
oeach(testresults, function(result, id) {
var condmod = ftests[id].name;
if (!hash[condmod] && ftests[id].trigger == name) {
if (result && ftests[id]) {
hash[condmod] = true;
d.push(condmod);
}
}
});
} else {
oeach(cond, function(def, condmod) {
if (!hash[condmod]) {
go = def && ((def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
hash[condmod] = true;
d.push(condmod);
m = this.getModule(condmod);
if (m) {
add = this.getRequires(m);
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}, this);
}
}
// Create skin modules
if (mod.skinnable) {
skindef = this.skin.overrides;
if (skindef && skindef[name]) {
for (i = 0; i < skindef[name].length; i++) {
skinmod = this._addSkin(skindef[name][i], name);
d.push(skinmod);
}
} else {
skinmod = this._addSkin(this.skin.defaultSkin, name);
d.push(skinmod);
}
}
mod._parsed = false;
if (intl) {
if (mod.lang && !mod.langPack && Y.Intl) {
lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);
packName = this.getLangPackName(lang, name);
if (packName) {
d.unshift(packName);
}
}
d.unshift(INTL);
}
mod.expanded_map = YArray.hash(d);
mod.expanded = YObject.keys(mod.expanded_map);
return mod.expanded;
},
/**
* Returns a hash of module names the supplied module satisfies.
* @method getProvides
* @param {string} name The name of the module.
* @return {object} what this module provides.
*/
getProvides: function(name) {
var m = this.getModule(name), o, s;
// supmap = this.provides;
if (!m) {
return NOT_FOUND;
}
if (m && !m.provides) {
o = {};
s = m.supersedes;
if (s) {
YArray.each(s, function(v) {
Y.mix(o, this.getProvides(v));
}, this);
}
o[name] = true;
m.provides = o;
}
return m.provides;
},
/**
* Calculates the dependency tree, the result is stored in the sorted
* property.
* @method calculate
* @param {object} o optional options object.
* @param {string} type optional argument to prune modules.
*/
calculate: function(o, type) {
if (o || type || this.dirty) {
if (o) {
this._config(o);
}
if (!this._init) {
this._setup();
}
this._explode();
if (this.allowRollup) {
this._rollup();
} else {
this._explodeRollups();
}
this._reduce();
this._sort();
}
},
_addLangPack: function(lang, m, packName) {
var name = m.name,
packPath,
existing = this.moduleInfo[packName];
if (!existing) {
packPath = _path((m.pkg || name), packName, JS, true);
this.addModule({ path: packPath,
intl: true,
langPack: true,
ext: m.ext,
group: m.group,
supersedes: [] }, packName);
if (lang) {
Y.Env.lang = Y.Env.lang || {};
Y.Env.lang[lang] = Y.Env.lang[lang] || {};
Y.Env.lang[lang][name] = true;
}
}
return this.moduleInfo[packName];
},
/**
* Investigates the current YUI configuration on the page. By default,
* modules already detected will not be loaded again unless a force
* option is encountered. Called by calculate()
* @method _setup
* @private
*/
_setup: function() {
var info = this.moduleInfo, name, i, j, m, l,
packName;
for (name in info) {
if (info.hasOwnProperty(name)) {
m = info[name];
if (m) {
// remove dups
//m.requires = YObject.keys(YArray.hash(m.requires));
m.requires = YArray.dedupe(m.requires);
// Create lang pack modules
if (m.lang && m.lang.length) {
// Setup root package if the module has lang defined,
// it needs to provide a root language pack
packName = this.getLangPackName(ROOT_LANG, name);
this._addLangPack(null, m, packName);
}
}
}
}
//l = Y.merge(this.inserted);
l = {};
// available modules
if (!this.ignoreRegistered) {
Y.mix(l, GLOBAL_ENV.mods);
}
// add the ignore list to the list of loaded packages
if (this.ignore) {
Y.mix(l, YArray.hash(this.ignore));
}
// expand the list to include superseded modules
for (j in l) {
if (l.hasOwnProperty(j)) {
Y.mix(l, this.getProvides(j));
}
}
// remove modules on the force list from the loaded list
if (this.force) {
for (i = 0; i < this.force.length; i++) {
if (this.force[i] in l) {
delete l[this.force[i]];
}
}
}
Y.mix(this.loaded, l);
this._init = true;
},
/**
* Builds a module name for a language pack
* @method getLangPackName
* @param {string} lang the language code.
* @param {string} mname the module to build it for.
* @return {string} the language pack module name.
*/
getLangPackName: function(lang, mname) {
return ('lang/' + mname + ((lang) ? '_' + lang : ''));
},
/**
* Inspects the required modules list looking for additional
* dependencies. Expands the required list to include all
* required modules. Called by calculate()
* @method _explode
* @private
*/
_explode: function() {
var r = this.required, m, reqs, done = {},
self = this;
// the setup phase is over, all modules have been created
self.dirty = false;
self._explodeRollups();
r = self.required;
oeach(r, function(v, name) {
if (!done[name]) {
done[name] = true;
m = self.getModule(name);
if (m) {
var expound = m.expound;
if (expound) {
r[expound] = self.getModule(expound);
reqs = self.getRequires(r[expound]);
Y.mix(r, YArray.hash(reqs));
}
reqs = self.getRequires(m);
Y.mix(r, YArray.hash(reqs));
}
}
});
},
getModule: function(mname) {
//TODO: Remove name check - it's a quick hack to fix pattern WIP
if (!mname) {
return null;
}
var p, found, pname,
m = this.moduleInfo[mname],
patterns = this.patterns;
// check the patterns library to see if we should automatically add
// the module with defaults
if (!m) {
for (pname in patterns) {
if (patterns.hasOwnProperty(pname)) {
p = patterns[pname];
// use the metadata supplied for the pattern
// as the module definition.
if (mname.indexOf(pname) > -1) {
found = p;
break;
}
}
}
if (found) {
if (p.action) {
p.action.call(this, mname, pname);
} else {
// ext true or false?
m = this.addModule(Y.merge(found), mname);
m.temp = true;
}
}
}
return m;
},
// impl in rollup submodule
_rollup: function() { },
/**
* Remove superceded modules and loaded modules. Called by
* calculate() after we have the mega list of all dependencies
* @method _reduce
* @return {object} the reduced dependency hash.
* @private
*/
_reduce: function(r) {
r = r || this.required;
var i, j, s, m, type = this.loadType;
for (i in r) {
if (r.hasOwnProperty(i)) {
m = this.getModule(i);
// remove if already loaded
if (((this.loaded[i] || ON_PAGE[i]) &&
!this.forceMap[i] && !this.ignoreRegistered) ||
(type && m && m.type != type)) {
delete r[i];
}
// remove anything this module supersedes
s = m && m.supersedes;
if (s) {
for (j = 0; j < s.length; j++) {
if (s[j] in r) {
delete r[s[j]];
}
}
}
}
}
return r;
},
_finish: function(msg, success) {
_queue.running = false;
var onEnd = this.onEnd;
if (onEnd) {
onEnd.call(this.context, {
msg: msg,
data: this.data,
success: success
});
}
this._continue();
},
_onSuccess: function() {
var self = this, skipped = Y.merge(self.skipped), fn,
failed = [], rreg = self.requireRegistration,
success, msg;
oeach(skipped, function(k) {
delete self.inserted[k];
});
self.skipped = {};
oeach(self.inserted, function(v, k) {
var mod = self.getModule(k);
if (mod && rreg && mod.type == JS && !(k in YUI.Env.mods)) {
failed.push(k);
} else {
Y.mix(self.loaded, self.getProvides(k));
}
});
fn = self.onSuccess;
msg = (failed.length) ? 'notregistered' : 'success';
success = !(failed.length);
if (fn) {
fn.call(self.context, {
msg: msg,
data: self.data,
success: success,
failed: failed,
skipped: skipped
});
}
self._finish(msg, success);
},
_onFailure: function(o) {
var f = this.onFailure, msg = 'failure: ' + o.msg;
if (f) {
f.call(this.context, {
msg: msg,
data: this.data,
success: false
});
}
this._finish(msg, false);
},
_onTimeout: function() {
var f = this.onTimeout;
if (f) {
f.call(this.context, {
msg: 'timeout',
data: this.data,
success: false
});
}
this._finish('timeout', false);
},
/**
* Sorts the dependency tree. The last step of calculate()
* @method _sort
* @private
*/
_sort: function() {
// create an indexed list
var s = YObject.keys(this.required),
// loaded = this.loaded,
done = {},
p = 0, l, a, b, j, k, moved, doneKey;
// keep going until we make a pass without moving anything
for (;;) {
l = s.length;
moved = false;
// start the loop after items that are already sorted
for (j = p; j < l; j++) {
// check the next module on the list to see if its
// dependencies have been met
a = s[j];
// check everything below current item and move if we
// find a requirement for the current item
for (k = j + 1; k < l; k++) {
doneKey = a + s[k];
if (!done[doneKey] && this._requires(a, s[k])) {
// extract the dependency so we can move it up
b = s.splice(k, 1);
// insert the dependency above the item that
// requires it
s.splice(j, 0, b[0]);
// only swap two dependencies once to short circut
// circular dependencies
done[doneKey] = true;
// keep working
moved = true;
break;
}
}
// jump out of loop if we moved something
if (moved) {
break;
// this item is sorted, move our pointer and keep going
} else {
p++;
}
}
// when we make it here and moved is false, we are
// finished sorting
if (!moved) {
break;
}
}
this.sorted = s;
},
partial: function(partial, o, type) {
this.sorted = partial;
this.insert(o, type, true);
},
_insert: function(source, o, type, skipcalc) {
// restore the state at the time of the request
if (source) {
this._config(source);
}
// build the dependency list
// don't include type so we can process CSS and script in
// one pass when the type is not specified.
if (!skipcalc) {
this.calculate(o);
}
this.loadType = type;
if (!type) {
var self = this;
this._internalCallback = function() {
var f = self.onCSS, n, p, sib;
// IE hack for style overrides that are not being applied
if (this.insertBefore && Y.UA.ie) {
n = Y.config.doc.getElementById(this.insertBefore);
p = n.parentNode;
sib = n.nextSibling;
p.removeChild(n);
if (sib) {
p.insertBefore(n, sib);
} else {
p.appendChild(n);
}
}
if (f) {
f.call(self.context, Y);
}
self._internalCallback = null;
self._insert(null, null, JS);
};
this._insert(null, null, CSS);
return;
}
// set a flag to indicate the load has started
this._loading = true;
// flag to indicate we are done with the combo service
// and any additional files will need to be loaded
// individually
this._combineComplete = {};
// start the load
this.loadNext();
},
// Once a loader operation is completely finished, process
// any additional queued items.
_continue: function() {
if (!(_queue.running) && _queue.size() > 0) {
_queue.running = true;
_queue.next()();
}
},
/**
* inserts the requested modules and their dependencies.
* <code>type</code> can be "js" or "css". Both script and
* css are inserted if type is not provided.
* @method insert
* @param {object} o optional options object.
* @param {string} type the type of dependency to insert.
*/
insert: function(o, type, skipsort) {
var self = this, copy = Y.merge(this);
delete copy.require;
delete copy.dirty;
_queue.add(function() {
self._insert(copy, o, type, skipsort);
});
this._continue();
},
/**
* Executed every time a module is loaded, and if we are in a load
* cycle, we attempt to load the next script. Public so that it
* is possible to call this if using a method other than
* Y.register to determine when scripts are fully loaded
* @method loadNext
* @param {string} mname optional the name of the module that has
* been loaded (which is usually why it is time to load the next
* one).
*/
loadNext: function(mname) {
// It is possible that this function is executed due to something
// else one the page loading a YUI module. Only react when we
// are actively loading something
if (!this._loading) {
return;
}
var s, len, i, m, url, fn, msg, attr, group, groupName, j, frag,
comboSource, comboSources, mods, combining, urls, comboBase,
self = this,
type = self.loadType,
handleSuccess = function(o) {
self.loadNext(o.data);
},
handleCombo = function(o) {
self._combineComplete[type] = true;
var i, len = combining.length;
for (i = 0; i < len; i++) {
self.inserted[combining[i]] = true;
}
handleSuccess(o);
};
if (self.combine && (!self._combineComplete[type])) {
combining = [];
self._combining = combining;
s = self.sorted;
len = s.length;
// the default combo base
comboBase = self.comboBase;
url = comboBase;
urls = [];
comboSources = {};
for (i = 0; i < len; i++) {
comboSource = comboBase;
m = self.getModule(s[i]);
groupName = m && m.group;
if (groupName) {
group = self.groups[groupName];
if (!group.combine) {
m.combine = false;
continue;
}
m.combine = true;
if (group.comboBase) {
comboSource = group.comboBase;
}
if ("root" in group && L.isValue(group.root)) {
m.root = group.root;
}
}
comboSources[comboSource] = comboSources[comboSource] || [];
comboSources[comboSource].push(m);
}
for (j in comboSources) {
if (comboSources.hasOwnProperty(j)) {
url = j;
mods = comboSources[j];
len = mods.length;
for (i = 0; i < len; i++) {
// m = self.getModule(s[i]);
m = mods[i];
// Do not try to combine non-yui JS unless combo def
// is found
if (m && (m.type === type) && (m.combine || !m.ext)) {
frag = ((L.isValue(m.root)) ? m.root : self.root) + m.path;
if ((url !== j) && (i < (len - 1)) &&
((frag.length + url.length) > self.maxURLLength)) {
urls.push(self._filter(url));
url = j;
}
url += frag;
if (i < (len - 1)) {
url += '&';
}
combining.push(m.name);
}
}
if (combining.length && (url != j)) {
urls.push(self._filter(url));
}
}
}
if (combining.length) {
// if (m.type === CSS) {
if (type === CSS) {
fn = Y.Get.css;
attr = self.cssAttributes;
} else {
fn = Y.Get.script;
attr = self.jsAttributes;
}
fn(urls, {
data: self._loading,
onSuccess: handleCombo,
onFailure: self._onFailure,
onTimeout: self._onTimeout,
insertBefore: self.insertBefore,
charset: self.charset,
attributes: attr,
timeout: self.timeout,
autopurge: false,
context: self
});
return;
} else {
self._combineComplete[type] = true;
}
}
if (mname) {
// if the module that was just loaded isn't what we were expecting,
// continue to wait
if (mname !== self._loading) {
return;
}
// The global handler that is called when each module is loaded
// will pass that module name to this function. Storing this
// data to avoid loading the same module multiple times
// centralize this in the callback
self.inserted[mname] = true;
// self.loaded[mname] = true;
// provided = self.getProvides(mname);
// Y.mix(self.loaded, provided);
// Y.mix(self.inserted, provided);
if (self.onProgress) {
self.onProgress.call(self.context, {
name: mname,
data: self.data
});
}
}
s = self.sorted;
len = s.length;
for (i = 0; i < len; i = i + 1) {
// this.inserted keeps track of what the loader has loaded.
// move on if this item is done.
if (s[i] in self.inserted) {
continue;
}
// Because rollups will cause multiple load notifications
// from Y, loadNext may be called multiple times for
// the same module when loading a rollup. We can safely
// skip the subsequent requests
if (s[i] === self._loading) {
return;
}
// log("inserting " + s[i]);
m = self.getModule(s[i]);
if (!m) {
if (!self.skipped[s[i]]) {
msg = 'Undefined module ' + s[i] + ' skipped';
// self.inserted[s[i]] = true;
self.skipped[s[i]] = true;
}
continue;
}
group = (m.group && self.groups[m.group]) || NOT_FOUND;
// The load type is stored to offer the possibility to load
// the css separately from the script.
if (!type || type === m.type) {
self._loading = s[i];
if (m.type === CSS) {
fn = Y.Get.css;
attr = self.cssAttributes;
} else {
fn = Y.Get.script;
attr = self.jsAttributes;
}
url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :
self._url(m.path, s[i], group.base || m.base);
fn(url, {
data: s[i],
onSuccess: handleSuccess,
insertBefore: self.insertBefore,
charset: self.charset,
attributes: attr,
onFailure: self._onFailure,
onTimeout: self._onTimeout,
timeout: self.timeout,
autopurge: false,
context: self
});
return;
}
}
// we are finished
self._loading = null;
fn = self._internalCallback;
// internal callback for loading css first
if (fn) {
self._internalCallback = null;
fn.call(self);
} else {
self._onSuccess();
}
},
/**
* Apply filter defined for this instance to a url/path
* method _filter
* @param {string} u the string to filter.
* @param {string} name the name of the module, if we are processing
* a single module as opposed to a combined url.
* @return {string} the filtered string.
* @private
*/
_filter: function(u, name) {
var f = this.filter,
hasFilter = name && (name in this.filters),
modFilter = hasFilter && this.filters[name];
if (u) {
if (hasFilter) {
f = (L.isString(modFilter)) ?
this.FILTER_DEFS[modFilter.toUpperCase()] || null :
modFilter;
}
if (f) {
u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);
}
}
return u;
},
/**
* Generates the full url for a module
* method _url
* @param {string} path the path fragment.
* @return {string} the full url.
* @private
*/
_url: function(path, name, base) {
return this._filter((base || this.base || '') + path, name);
}
};
}, '@VERSION@' ,{requires:['get']});
YUI.add('loader-rollup', function(Y) {
/**
* Optional automatic rollup logic for reducing http connections
* when not using a combo service.
* @module loader
* @submodule rollup
*/
/**
* Look for rollup packages to determine if all of the modules a
* rollup supersedes are required. If so, include the rollup to
* help reduce the total number of connections required. Called
* by calculate(). This is an optional feature, and requires the
* appropriate submodule to function.
* @method _rollup
* @for Loader
* @private
*/
Y.Loader.prototype._rollup = function() {
var i, j, m, s, r = this.required, roll,
info = this.moduleInfo, rolled, c, smod;
// find and cache rollup modules
if (this.dirty || !this.rollups) {
this.rollups = {};
for (i in info) {
if (info.hasOwnProperty(i)) {
m = this.getModule(i);
// if (m && m.rollup && m.supersedes) {
if (m && m.rollup) {
this.rollups[i] = m;
}
}
}
this.forceMap = (this.force) ? Y.Array.hash(this.force) : {};
}
// make as many passes as needed to pick up rollup rollups
for (;;) {
rolled = false;
// go through the rollup candidates
for (i in this.rollups) {
if (this.rollups.hasOwnProperty(i)) {
// there can be only one, unless forced
if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) {
m = this.getModule(i);
s = m.supersedes || [];
roll = false;
// @TODO remove continue
if (!m.rollup) {
continue;
}
c = 0;
// check the threshold
for (j = 0; j < s.length; j++) {
smod = info[s[j]];
// if the superseded module is loaded, we can't
// load the rollup unless it has been forced.
if (this.loaded[s[j]] && !this.forceMap[s[j]]) {
roll = false;
break;
// increment the counter if this module is required.
// if we are beyond the rollup threshold, we will
// use the rollup module
} else if (r[s[j]] && m.type == smod.type) {
c++;
roll = (c >= m.rollup);
if (roll) {
break;
}
}
}
if (roll) {
// add the rollup
r[i] = true;
rolled = true;
// expand the rollup's dependencies
this.getRequires(m);
}
}
}
}
// if we made it here w/o rolling up something, we are done
if (!rolled) {
break;
}
}
};
}, '@VERSION@' ,{requires:['loader-base']});
YUI.add('loader-yui3', function(Y) {
/* This file is auto-generated by src/loader/meta_join.py */
/**
* YUI 3 module metadata
* @module loader
* @submodule yui3
*/
YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
"align-plugin": {
"requires": [
"node-screen",
"node-pluginhost"
]
},
"anim": {
"use": [
"anim-base",
"anim-color",
"anim-curve",
"anim-easing",
"anim-node-plugin",
"anim-scroll",
"anim-xy"
]
},
"anim-base": {
"requires": [
"base-base",
"node-style"
]
},
"anim-color": {
"requires": [
"anim-base"
]
},
"anim-curve": {
"requires": [
"anim-xy"
]
},
"anim-easing": {
"requires": [
"anim-base"
]
},
"anim-node-plugin": {
"requires": [
"node-pluginhost",
"anim-base"
]
},
"anim-scroll": {
"requires": [
"anim-base"
]
},
"anim-xy": {
"requires": [
"anim-base",
"node-screen"
]
},
"app": {
"use": [
"controller",
"model",
"model-list",
"view"
]
},
"array-extras": {},
"array-invoke": {},
"arraylist": {},
"arraylist-add": {
"requires": [
"arraylist"
]
},
"arraylist-filter": {
"requires": [
"arraylist"
]
},
"arraysort": {
"requires": [
"yui-base"
]
},
"async-queue": {
"requires": [
"event-custom"
]
},
"attribute": {
"use": [
"attribute-base",
"attribute-complex"
]
},
"attribute-base": {
"requires": [
"event-custom"
]
},
"attribute-complex": {
"requires": [
"attribute-base"
]
},
"autocomplete": {
"use": [
"autocomplete-base",
"autocomplete-sources",
"autocomplete-list",
"autocomplete-plugin"
]
},
"autocomplete-base": {
"optional": [
"autocomplete-sources"
],
"requires": [
"array-extras",
"base-build",
"escape",
"event-valuechange",
"node-base"
]
},
"autocomplete-filters": {
"requires": [
"array-extras",
"text-wordbreak"
]
},
"autocomplete-filters-accentfold": {
"requires": [
"array-extras",
"text-accentfold",
"text-wordbreak"
]
},
"autocomplete-highlighters": {
"requires": [
"array-extras",
"highlight-base"
]
},
"autocomplete-highlighters-accentfold": {
"requires": [
"array-extras",
"highlight-accentfold"
]
},
"autocomplete-list": {
"after": [
"autocomplete-sources"
],
"lang": [
"en"
],
"requires": [
"autocomplete-base",
"event-resize",
"selector-css3",
"shim-plugin",
"widget",
"widget-position",
"widget-position-align"
],
"skinnable": true
},
"autocomplete-list-keys": {
"condition": {
"name": "autocomplete-list-keys",
"test": function (Y) {
// Only add keyboard support to autocomplete-list if this doesn't appear to
// be an iOS or Android-based mobile device.
//
// There's currently no feasible way to actually detect whether a device has
// a hardware keyboard, so this sniff will have to do. It can easily be
// overridden by manually loading the autocomplete-list-keys module.
//
// Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
// doesn't fire the keyboard events used by AutoCompleteList, so there's
// no point loading the -keys module even when a bluetooth keyboard may be
// available.
return !(Y.UA.ios || Y.UA.android);
},
"trigger": "autocomplete-list"
},
"requires": [
"autocomplete-list",
"base-build"
]
},
"autocomplete-plugin": {
"requires": [
"autocomplete-list",
"node-pluginhost"
]
},
"autocomplete-sources": {
"optional": [
"io-base",
"json-parse",
"jsonp",
"yql"
],
"requires": [
"autocomplete-base"
]
},
"base": {
"use": [
"base-base",
"base-pluginhost",
"base-build"
]
},
"base-base": {
"after": [
"attribute-complex"
],
"requires": [
"attribute-base"
]
},
"base-build": {
"requires": [
"base-base"
]
},
"base-pluginhost": {
"requires": [
"base-base",
"pluginhost"
]
},
"cache": {
"use": [
"cache-base",
"cache-offline",
"cache-plugin"
]
},
"cache-base": {
"requires": [
"base"
]
},
"cache-offline": {
"requires": [
"cache-base",
"json"
]
},
"cache-plugin": {
"requires": [
"plugin",
"cache-base"
]
},
"calendar": {
"lang": [
"en",
"ru"
],
"requires": [
"calendar-base"
],
"skinnable": true
},
"calendar-base": {
"lang": [
"en",
"ru"
],
"requires": [
"widget",
"substitute",
"datatype-date",
"datatype-date-math"
],
"skinnable": true
},
"charts": {
"requires": [
"dom",
"datatype",
"event-custom",
"event-mouseenter",
"widget",
"widget-position",
"widget-stack",
"graphics"
]
},
"classnamemanager": {
"requires": [
"yui-base"
]
},
"clickable-rail": {
"requires": [
"slider-base"
]
},
"collection": {
"use": [
"array-extras",
"arraylist",
"arraylist-add",
"arraylist-filter",
"array-invoke"
]
},
"compat": {
"requires": [
"event-base",
"dom",
"dump",
"substitute"
]
},
"console": {
"lang": [
"en",
"es"
],
"requires": [
"yui-log",
"widget",
"substitute"
],
"skinnable": true
},
"console-filters": {
"requires": [
"plugin",
"console"
],
"skinnable": true
},
"controller": {
"optional": [
"querystring-parse"
],
"requires": [
"array-extras",
"base-build",
"history"
]
},
"cookie": {
"requires": [
"yui-base"
]
},
"createlink-base": {
"requires": [
"editor-base"
]
},
"cssbase": {
"after": [
"cssreset",
"cssfonts",
"cssgrids",
"cssreset-context",
"cssfonts-context",
"cssgrids-context"
],
"type": "css"
},
"cssbase-context": {
"after": [
"cssreset",
"cssfonts",
"cssgrids",
"cssreset-context",
"cssfonts-context",
"cssgrids-context"
],
"type": "css"
},
"cssfonts": {
"type": "css"
},
"cssfonts-context": {
"type": "css"
},
"cssgrids": {
"optional": [
"cssreset",
"cssfonts"
],
"type": "css"
},
"cssgrids-context-deprecated": {
"optional": [
"cssreset-context"
],
"requires": [
"cssfonts-context"
],
"type": "css"
},
"cssgrids-deprecated": {
"optional": [
"cssreset"
],
"requires": [
"cssfonts"
],
"type": "css"
},
"cssreset": {
"type": "css"
},
"cssreset-context": {
"type": "css"
},
"dataschema": {
"use": [
"dataschema-base",
"dataschema-json",
"dataschema-xml",
"dataschema-array",
"dataschema-text"
]
},
"dataschema-array": {
"requires": [
"dataschema-base"
]
},
"dataschema-base": {
"requires": [
"base"
]
},
"dataschema-json": {
"requires": [
"dataschema-base",
"json"
]
},
"dataschema-text": {
"requires": [
"dataschema-base"
]
},
"dataschema-xml": {
"requires": [
"dataschema-base"
]
},
"datasource": {
"use": [
"datasource-local",
"datasource-io",
"datasource-get",
"datasource-function",
"datasource-cache",
"datasource-jsonschema",
"datasource-xmlschema",
"datasource-arrayschema",
"datasource-textschema",
"datasource-polling"
]
},
"datasource-arrayschema": {
"requires": [
"datasource-local",
"plugin",
"dataschema-array"
]
},
"datasource-cache": {
"requires": [
"datasource-local",
"plugin",
"cache-base"
]
},
"datasource-function": {
"requires": [
"datasource-local"
]
},
"datasource-get": {
"requires": [
"datasource-local",
"get"
]
},
"datasource-io": {
"requires": [
"datasource-local",
"io-base"
]
},
"datasource-jsonschema": {
"requires": [
"datasource-local",
"plugin",
"dataschema-json"
]
},
"datasource-local": {
"requires": [
"base"
]
},
"datasource-polling": {
"requires": [
"datasource-local"
]
},
"datasource-textschema": {
"requires": [
"datasource-local",
"plugin",
"dataschema-text"
]
},
"datasource-xmlschema": {
"requires": [
"datasource-local",
"plugin",
"dataschema-xml"
]
},
"datatable": {
"use": [
"datatable-base",
"datatable-datasource",
"datatable-sort",
"datatable-scroll"
]
},
"datatable-base": {
"requires": [
"recordset-base",
"widget",
"substitute",
"event-mouseenter"
],
"skinnable": true
},
"datatable-datasource": {
"requires": [
"datatable-base",
"plugin",
"datasource-local"
]
},
"datatable-scroll": {
"requires": [
"datatable-base",
"plugin",
"stylesheet"
]
},
"datatable-sort": {
"lang": [
"en"
],
"requires": [
"datatable-base",
"plugin",
"recordset-sort"
]
},
"datatype": {
"use": [
"datatype-number",
"datatype-date",
"datatype-xml"
]
},
"datatype-date": {
"supersedes": [
"datatype-date-format"
],
"use": [
"datatype-date-parse",
"datatype-date-format"
]
},
"datatype-date-format": {
"lang": [
"ar",
"ar-JO",
"ca",
"ca-ES",
"da",
"da-DK",
"de",
"de-AT",
"de-DE",
"el",
"el-GR",
"en",
"en-AU",
"en-CA",
"en-GB",
"en-IE",
"en-IN",
"en-JO",
"en-MY",
"en-NZ",
"en-PH",
"en-SG",
"en-US",
"es",
"es-AR",
"es-BO",
"es-CL",
"es-CO",
"es-EC",
"es-ES",
"es-MX",
"es-PE",
"es-PY",
"es-US",
"es-UY",
"es-VE",
"fi",
"fi-FI",
"fr",
"fr-BE",
"fr-CA",
"fr-FR",
"hi",
"hi-IN",
"id",
"id-ID",
"it",
"it-IT",
"ja",
"ja-JP",
"ko",
"ko-KR",
"ms",
"ms-MY",
"nb",
"nb-NO",
"nl",
"nl-BE",
"nl-NL",
"pl",
"pl-PL",
"pt",
"pt-BR",
"ro",
"ro-RO",
"ru",
"ru-RU",
"sv",
"sv-SE",
"th",
"th-TH",
"tr",
"tr-TR",
"vi",
"vi-VN",
"zh-Hans",
"zh-Hans-CN",
"zh-Hant",
"zh-Hant-HK",
"zh-Hant-TW"
]
},
"datatype-date-math": {
"requires": [
"yui-base"
]
},
"datatype-date-parse": {},
"datatype-number": {
"use": [
"datatype-number-parse",
"datatype-number-format"
]
},
"datatype-number-format": {},
"datatype-number-parse": {},
"datatype-xml": {
"use": [
"datatype-xml-parse",
"datatype-xml-format"
]
},
"datatype-xml-format": {},
"datatype-xml-parse": {},
"dd": {
"use": [
"dd-ddm-base",
"dd-ddm",
"dd-ddm-drop",
"dd-drag",
"dd-proxy",
"dd-constrain",
"dd-drop",
"dd-scroll",
"dd-delegate"
]
},
"dd-constrain": {
"requires": [
"dd-drag"
]
},
"dd-ddm": {
"requires": [
"dd-ddm-base",
"event-resize"
]
},
"dd-ddm-base": {
"requires": [
"node",
"base",
"yui-throttle",
"classnamemanager"
]
},
"dd-ddm-drop": {
"requires": [
"dd-ddm"
]
},
"dd-delegate": {
"requires": [
"dd-drag",
"dd-drop-plugin",
"event-mouseenter"
]
},
"dd-drag": {
"requires": [
"dd-ddm-base"
]
},
"dd-drop": {
"requires": [
"dd-drag",
"dd-ddm-drop"
]
},
"dd-drop-plugin": {
"requires": [
"dd-drop"
]
},
"dd-gestures": {
"condition": {
"name": "dd-gestures",
"test": function(Y) {
return (Y.config.win && ('ontouchstart' in Y.config.win && !Y.UA.chrome));
},
"trigger": "dd-drag"
},
"requires": [
"dd-drag",
"event-synthetic",
"event-gestures"
]
},
"dd-plugin": {
"optional": [
"dd-constrain",
"dd-proxy"
],
"requires": [
"dd-drag"
]
},
"dd-proxy": {
"requires": [
"dd-drag"
]
},
"dd-scroll": {
"requires": [
"dd-drag"
]
},
"dial": {
"lang": [
"en",
"es"
],
"requires": [
"widget",
"dd-drag",
"substitute",
"event-mouseenter",
"event-move",
"event-key",
"transition",
"intl"
],
"skinnable": true
},
"dom": {
"use": [
"dom-base",
"dom-screen",
"dom-style",
"selector-native",
"selector"
]
},
"dom-base": {
"requires": [
"dom-core"
]
},
"dom-core": {
"requires": [
"oop",
"features"
]
},
"dom-deprecated": {
"requires": [
"dom-base"
]
},
"dom-screen": {
"requires": [
"dom-base",
"dom-style"
]
},
"dom-style": {
"requires": [
"dom-base"
]
},
"dom-style-ie": {
"condition": {
"name": "dom-style-ie",
"test": function (Y) {
var testFeature = Y.Features.test,
addFeature = Y.Features.add,
WINDOW = Y.config.win,
DOCUMENT = Y.config.doc,
DOCUMENT_ELEMENT = 'documentElement',
ret = false;
addFeature('style', 'computedStyle', {
test: function() {
return WINDOW && 'getComputedStyle' in WINDOW;
}
});
addFeature('style', 'opacity', {
test: function() {
return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
}
});
ret = (!testFeature('style', 'opacity') &&
!testFeature('style', 'computedStyle'));
return ret;
},
"trigger": "dom-style"
},
"requires": [
"dom-style"
]
},
"dump": {},
"editor": {
"use": [
"frame",
"selection",
"exec-command",
"editor-base",
"editor-para",
"editor-br",
"editor-bidi",
"editor-tab",
"createlink-base"
]
},
"editor-base": {
"requires": [
"base",
"frame",
"node",
"exec-command",
"selection"
]
},
"editor-bidi": {
"requires": [
"editor-base"
]
},
"editor-br": {
"requires": [
"editor-base"
]
},
"editor-lists": {
"requires": [
"editor-base"
]
},
"editor-para": {
"requires": [
"editor-base"
]
},
"editor-tab": {
"requires": [
"editor-base"
]
},
"escape": {},
"event": {
"after": [
"node-base"
],
"use": [
"event-base",
"event-delegate",
"event-synthetic",
"event-mousewheel",
"event-mouseenter",
"event-key",
"event-focus",
"event-resize",
"event-hover",
"event-outside"
]
},
"event-base": {
"after": [
"node-base"
],
"requires": [
"event-custom-base"
]
},
"event-base-ie": {
"after": [
"event-base"
],
"condition": {
"name": "event-base-ie",
"test": function(Y) {
var imp = Y.config.doc && Y.config.doc.implementation;
return (imp && (!imp.hasFeature('Events', '2.0')));
},
"trigger": "node-base"
},
"requires": [
"node-base"
]
},
"event-custom": {
"use": [
"event-custom-base",
"event-custom-complex"
]
},
"event-custom-base": {
"requires": [
"oop"
]
},
"event-custom-complex": {
"requires": [
"event-custom-base"
]
},
"event-delegate": {
"requires": [
"node-base"
]
},
"event-flick": {
"requires": [
"node-base",
"event-touch",
"event-synthetic"
]
},
"event-focus": {
"requires": [
"event-synthetic"
]
},
"event-gestures": {
"use": [
"event-flick",
"event-move"
]
},
"event-hover": {
"requires": [
"event-mouseenter"
]
},
"event-key": {
"requires": [
"event-synthetic"
]
},
"event-mouseenter": {
"requires": [
"event-synthetic"
]
},
"event-mousewheel": {
"requires": [
"node-base"
]
},
"event-move": {
"requires": [
"node-base",
"event-touch",
"event-synthetic"
]
},
"event-outside": {
"requires": [
"event-synthetic"
]
},
"event-resize": {
"requires": [
"node-base"
]
},
"event-simulate": {
"requires": [
"event-base"
]
},
"event-synthetic": {
"requires": [
"node-base",
"event-custom-complex"
]
},
"event-touch": {
"requires": [
"node-base"
]
},
"event-valuechange": {
"requires": [
"event-focus",
"event-synthetic"
]
},
"exec-command": {
"requires": [
"frame"
]
},
"features": {
"requires": [
"yui-base"
]
},
"frame": {
"requires": [
"base",
"node",
"selector-css3",
"substitute",
"yui-throttle"
]
},
"get": {
"requires": [
"yui-base"
]
},
"graphics": {
"requires": [
"node",
"event-custom",
"pluginhost"
]
},
"graphics-canvas": {
"condition": {
"name": "graphics-canvas",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
canvas = DOCUMENT.createElement("canvas");
return (!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
},
"trigger": "graphics"
}
},
"graphics-canvas-default": {
"condition": {
"name": "graphics-canvas-default",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
canvas = DOCUMENT.createElement("canvas");
return (!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
},
"trigger": "graphics"
}
},
"graphics-svg": {
"condition": {
"name": "graphics-svg",
"test": function(Y) {
var DOCUMENT = Y.config.doc;
return (DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
},
"trigger": "graphics"
}
},
"graphics-svg-default": {
"condition": {
"name": "graphics-svg-default",
"test": function(Y) {
var DOCUMENT = Y.config.doc;
return (DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
},
"trigger": "graphics"
}
},
"graphics-vml": {
"condition": {
"name": "graphics-vml",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
canvas = DOCUMENT.createElement("canvas");
return (!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
"trigger": "graphics"
}
},
"graphics-vml-default": {
"condition": {
"name": "graphics-vml-default",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
canvas = DOCUMENT.createElement("canvas");
return (!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
"trigger": "graphics"
}
},
"highlight": {
"use": [
"highlight-base",
"highlight-accentfold"
]
},
"highlight-accentfold": {
"requires": [
"highlight-base",
"text-accentfold"
]
},
"highlight-base": {
"requires": [
"array-extras",
"escape",
"text-wordbreak"
]
},
"history": {
"use": [
"history-base",
"history-hash",
"history-hash-ie",
"history-html5"
]
},
"history-base": {
"requires": [
"event-custom-complex"
]
},
"history-hash": {
"after": [
"history-html5"
],
"requires": [
"event-synthetic",
"history-base",
"yui-later"
]
},
"history-hash-ie": {
"condition": {
"name": "history-hash-ie",
"test": function (Y) {
var docMode = Y.config.doc && Y.config.doc.documentMode;
return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
!docMode || docMode < 8);
},
"trigger": "history-hash"
},
"requires": [
"history-hash",
"node-base"
]
},
"history-html5": {
"optional": [
"json"
],
"requires": [
"event-base",
"history-base",
"node-base"
]
},
"imageloader": {
"requires": [
"base-base",
"node-style",
"node-screen"
]
},
"intl": {
"requires": [
"intl-base",
"event-custom"
]
},
"intl-base": {
"requires": [
"yui-base"
]
},
"io": {
"use": [
"io-base",
"io-xdr",
"io-form",
"io-upload-iframe",
"io-queue"
]
},
"io-base": {
"requires": [
"event-custom-base",
"querystring-stringify-simple"
]
},
"io-form": {
"requires": [
"io-base",
"node-base"
]
},
"io-queue": {
"requires": [
"io-base",
"queue-promote"
]
},
"io-upload-iframe": {
"requires": [
"io-base",
"node-base"
]
},
"io-xdr": {
"requires": [
"io-base",
"datatype-xml"
]
},
"json": {
"use": [
"json-parse",
"json-stringify"
]
},
"json-parse": {},
"json-stringify": {},
"jsonp": {
"requires": [
"get",
"oop"
]
},
"jsonp-url": {
"requires": [
"jsonp"
]
},
"loader": {
"use": [
"loader-base",
"loader-rollup",
"loader-yui3"
]
},
"loader-base": {
"requires": [
"get"
]
},
"loader-rollup": {
"requires": [
"loader-base"
]
},
"loader-yui3": {
"requires": [
"loader-base"
]
},
"model": {
"requires": [
"base-build",
"escape",
"json-parse"
]
},
"model-list": {
"requires": [
"array-extras",
"array-invoke",
"arraylist",
"base-build",
"json-parse",
"model"
]
},
"node": {
"use": [
"node-base",
"node-event-delegate",
"node-pluginhost",
"node-screen",
"node-style"
]
},
"node-base": {
"requires": [
"event-base",
"node-core",
"dom-base"
]
},
"node-core": {
"requires": [
"dom-core",
"selector"
]
},
"node-deprecated": {
"requires": [
"node-base"
]
},
"node-event-delegate": {
"requires": [
"node-base",
"event-delegate"
]
},
"node-event-html5": {
"requires": [
"node-base"
]
},
"node-event-simulate": {
"requires": [
"node-base",
"event-simulate"
]
},
"node-flick": {
"requires": [
"classnamemanager",
"transition",
"event-flick",
"plugin"
],
"skinnable": true
},
"node-focusmanager": {
"requires": [
"attribute",
"node",
"plugin",
"node-event-simulate",
"event-key",
"event-focus"
]
},
"node-load": {
"requires": [
"node-base",
"io-base"
]
},
"node-menunav": {
"requires": [
"node",
"classnamemanager",
"plugin",
"node-focusmanager"
],
"skinnable": true
},
"node-pluginhost": {
"requires": [
"node-base",
"pluginhost"
]
},
"node-screen": {
"requires": [
"dom-screen",
"node-base"
]
},
"node-style": {
"requires": [
"dom-style",
"node-base"
]
},
"oop": {
"requires": [
"yui-base"
]
},
"overlay": {
"requires": [
"widget",
"widget-stdmod",
"widget-position",
"widget-position-align",
"widget-stack",
"widget-position-constrain"
],
"skinnable": true
},
"plugin": {
"requires": [
"base-base"
]
},
"pluginattr": {
"requires": [
"plugin"
]
},
"pluginhost": {
"use": [
"pluginhost-base",
"pluginhost-config"
]
},
"pluginhost-base": {
"requires": [
"yui-base"
]
},
"pluginhost-config": {
"requires": [
"pluginhost-base"
]
},
"profiler": {
"requires": [
"yui-base"
]
},
"querystring": {
"use": [
"querystring-parse",
"querystring-stringify"
]
},
"querystring-parse": {
"requires": [
"yui-base",
"array-extras"
]
},
"querystring-parse-simple": {
"requires": [
"yui-base"
]
},
"querystring-stringify": {
"requires": [
"yui-base"
]
},
"querystring-stringify-simple": {
"requires": [
"yui-base"
]
},
"queue-promote": {
"requires": [
"yui-base"
]
},
"range-slider": {
"requires": [
"slider-base",
"slider-value-range",
"clickable-rail"
]
},
"recordset": {
"use": [
"recordset-base",
"recordset-sort",
"recordset-filter",
"recordset-indexer"
]
},
"recordset-base": {
"requires": [
"base",
"arraylist"
]
},
"recordset-filter": {
"requires": [
"recordset-base",
"array-extras",
"plugin"
]
},
"recordset-indexer": {
"requires": [
"recordset-base",
"plugin"
]
},
"recordset-sort": {
"requires": [
"arraysort",
"recordset-base",
"plugin"
]
},
"resize": {
"use": [
"resize-base",
"resize-proxy",
"resize-constrain"
]
},
"resize-base": {
"requires": [
"base",
"widget",
"substitute",
"event",
"oop",
"dd-drag",
"dd-delegate",
"dd-drop"
],
"skinnable": true
},
"resize-constrain": {
"requires": [
"plugin",
"resize-base"
]
},
"resize-plugin": {
"optional": [
"resize-constrain"
],
"requires": [
"resize-base",
"plugin"
]
},
"resize-proxy": {
"requires": [
"plugin",
"resize-base"
]
},
"rls": {
"requires": [
"get",
"features"
]
},
"scrollview": {
"requires": [
"scrollview-base",
"scrollview-scrollbars"
]
},
"scrollview-base": {
"requires": [
"widget",
"event-gestures",
"transition"
],
"skinnable": true
},
"scrollview-base-ie": {
"condition": {
"name": "scrollview-base-ie",
"trigger": "scrollview-base",
"ua": "ie"
},
"requires": [
"scrollview-base"
]
},
"scrollview-paginator": {
"requires": [
"plugin"
]
},
"scrollview-scrollbars": {
"requires": [
"classnamemanager",
"transition",
"plugin"
],
"skinnable": true
},
"selection": {
"requires": [
"node"
]
},
"selector": {
"requires": [
"selector-native"
]
},
"selector-css2": {
"condition": {
"name": "selector-css2",
"test": function (Y) {
var DOCUMENT = Y.config.doc,
ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
return ret;
},
"trigger": "selector"
},
"requires": [
"selector-native"
]
},
"selector-css3": {
"requires": [
"selector-native",
"selector-css2"
]
},
"selector-native": {
"requires": [
"dom-base"
]
},
"shim-plugin": {
"requires": [
"node-style",
"node-pluginhost"
]
},
"slider": {
"use": [
"slider-base",
"slider-value-range",
"clickable-rail",
"range-slider"
]
},
"slider-base": {
"requires": [
"widget",
"dd-constrain",
"substitute"
],
"skinnable": true
},
"slider-value-range": {
"requires": [
"slider-base"
]
},
"sortable": {
"requires": [
"dd-delegate",
"dd-drop-plugin",
"dd-proxy"
]
},
"sortable-scroll": {
"requires": [
"dd-scroll",
"sortable"
]
},
"stylesheet": {},
"substitute": {
"optional": [
"dump"
]
},
"swf": {
"requires": [
"event-custom",
"node",
"swfdetect"
]
},
"swfdetect": {},
"tabview": {
"requires": [
"widget",
"widget-parent",
"widget-child",
"tabview-base",
"node-pluginhost",
"node-focusmanager"
],
"skinnable": true
},
"tabview-base": {
"requires": [
"node-event-delegate",
"classnamemanager",
"skin-sam-tabview"
]
},
"tabview-plugin": {
"requires": [
"tabview-base"
]
},
"test": {
"requires": [
"event-simulate",
"event-custom",
"substitute",
"json-stringify"
],
"skinnable": true
},
"text": {
"use": [
"text-accentfold",
"text-wordbreak"
]
},
"text-accentfold": {
"requires": [
"array-extras",
"text-data-accentfold"
]
},
"text-data-accentfold": {},
"text-data-wordbreak": {},
"text-wordbreak": {
"requires": [
"array-extras",
"text-data-wordbreak"
]
},
"transition": {
"use": [
"transition-native",
"transition-timer"
]
},
"transition-native": {
"requires": [
"node-base"
]
},
"transition-timer": {
"requires": [
"transition-native",
"node-style"
]
},
"uploader": {
"requires": [
"event-custom",
"node",
"base",
"swf"
]
},
"view": {
"requires": [
"base-build",
"node-event-delegate"
]
},
"widget": {
"skinnable": true,
"use": [
"widget-base",
"widget-htmlparser",
"widget-uievents",
"widget-skin"
]
},
"widget-anim": {
"requires": [
"plugin",
"anim-base",
"widget"
]
},
"widget-autohide": {
"requires": [
"widget",
"plugin",
"event-outside",
"base-build"
],
"skinnable": false
},
"widget-base": {
"requires": [
"attribute",
"event-focus",
"base-base",
"base-pluginhost",
"node-base",
"node-style",
"classnamemanager"
]
},
"widget-base-ie": {
"condition": {
"name": "widget-base-ie",
"trigger": "widget-base",
"ua": "ie"
},
"requires": [
"widget-base"
]
},
"widget-child": {
"requires": [
"base-build",
"widget"
]
},
"widget-htmlparser": {
"requires": [
"widget-base"
]
},
"widget-locale": {
"requires": [
"widget-base"
]
},
"widget-modality": {
"requires": [
"widget",
"plugin",
"event-outside",
"base-build"
],
"skinnable": false
},
"widget-parent": {
"requires": [
"base-build",
"arraylist",
"widget"
]
},
"widget-position": {
"requires": [
"base-build",
"node-screen",
"widget"
]
},
"widget-position-align": {
"requires": [
"widget-position"
]
},
"widget-position-constrain": {
"requires": [
"widget-position"
]
},
"widget-skin": {
"requires": [
"widget-base"
]
},
"widget-stack": {
"requires": [
"base-build",
"widget"
],
"skinnable": true
},
"widget-stdmod": {
"requires": [
"base-build",
"widget"
]
},
"widget-uievents": {
"requires": [
"widget-base",
"node-event-delegate"
]
},
"yql": {
"requires": [
"jsonp",
"jsonp-url"
]
},
"yui": {
"use": [
"yui-base",
"get",
"features",
"intl-base",
"yui-log",
"yui-later",
"loader-base",
"loader-rollup",
"loader-yui3"
]
},
"yui-base": {},
"yui-later": {
"requires": [
"yui-base"
]
},
"yui-log": {
"requires": [
"yui-base"
]
},
"yui-rls": {
"use": [
"yui-base",
"get",
"features",
"intl-base",
"rls",
"yui-log",
"yui-later"
]
},
"yui-throttle": {
"requires": [
"yui-base"
]
}
};
YUI.Env[Y.version].md5 = 'ea3b697e30a4b7bf0c41e10e098f5bab';
}, '@VERSION@' ,{requires:['loader-base']});
YUI.add('yui', function(Y){}, '@VERSION@' ,{use:['yui-base','get','features','intl-base','yui-log','yui-later','loader-base', 'loader-rollup', 'loader-yui3' ]});
|
docs/src/ButtonsPage.js | jhernandezme/react-materialize | import React from 'react';
import Row from '../../src/Row';
import Col from '../../src/Col';
import ReactPlayground from './ReactPlayground';
import PropTable from './PropTable';
import store from './store';
import Samples from './Samples';
import raisedButton from '../../examples/RaisedButton';
import fixedActionButton from '../../examples/FixedActionButton';
import floatingButton from '../../examples/FloatingButton';
import horizontalFab from '../../examples/HorizontalFAB';
const component = 'Button';
class ButtonsPage extends React.Component {
componentDidMount() {
store.emit('component', component);
}
render() {
return (
<Row>
<Col m={9} s={12} l={10}>
<p className='caption'>
There are 3 main button types described in material design. The raised button is a standard button that signify actions and seek to give depth to a mostly flat page. The floating circular action button is meant for very important functions. Flat buttons are usually used within elements that already have depth like cards or modals.
</p>
<h4 className='col s12'>
Raised
</h4>
<Col s={12}>
<ReactPlayground code={ Samples.raisedButton }>
{raisedButton}
</ReactPlayground>
</Col>
<h4 className='col s12'>
Floating
</h4>
<Col s={12}>
<ReactPlayground code={ Samples.floatingButton }>
{floatingButton}
</ReactPlayground>
</Col>
<h4 className='col s12'>
Fixed Action Button
</h4>
<Col s={12}>
<ReactPlayground code={ Samples.fixedActionButton }>
{fixedActionButton}
</ReactPlayground>
</Col>
<h4 className='col s12'>
Horizontal FAB
</h4>
<Col s={12}>
<ReactPlayground code={ Samples.horizontalFab }>
{horizontalFab}
</ReactPlayground>
</Col>
<Col s={12}>
<PropTable component={component}/>
</Col>
</Col>
</Row>
);
}
}
export default ButtonsPage;
|
src/svg-icons/notification/no-encryption.js | verdan/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let NotificationNoEncryption = (props) => (
<SvgIcon {...props}>
<path d="M21 21.78L4.22 5 3 6.22l2.04 2.04C4.42 8.6 4 9.25 4 10v10c0 1.1.9 2 2 2h12c.23 0 .45-.05.66-.12L19.78 23 21 21.78zM8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H9.66L20 18.34V10c0-1.1-.9-2-2-2h-1V6c0-2.76-2.24-5-5-5-2.56 0-4.64 1.93-4.94 4.4L8.9 7.24V6z"/>
</SvgIcon>
);
NotificationNoEncryption = pure(NotificationNoEncryption);
NotificationNoEncryption.displayName = 'NotificationNoEncryption';
NotificationNoEncryption.muiName = 'SvgIcon';
export default NotificationNoEncryption;
|
src/React/Properties/ColorProperty/index.js | Kitware/paraviewweb | import React from 'react';
import PropTypes from 'prop-types';
import ToggleIconButton from 'paraviewweb/src/React/Widgets/ToggleIconButtonWidget';
import style from 'paraviewweb/style/ReactProperties/CellProperty.mcss';
import ColorItem from './ColorItem';
export function hex2float(hexStr, outFloatArray = [0, 0.5, 1]) {
switch (hexStr.length) {
case 3: // abc => #aabbcc
outFloatArray[0] = (parseInt(hexStr[0], 16) * 17) / 255;
outFloatArray[1] = (parseInt(hexStr[1], 16) * 17) / 255;
outFloatArray[2] = (parseInt(hexStr[2], 16) * 17) / 255;
return outFloatArray;
case 4: // #abc => #aabbcc
outFloatArray[0] = (parseInt(hexStr[1], 16) * 17) / 255;
outFloatArray[1] = (parseInt(hexStr[2], 16) * 17) / 255;
outFloatArray[2] = (parseInt(hexStr[3], 16) * 17) / 255;
return outFloatArray;
case 6: // ab01df => #ab01df
outFloatArray[0] = parseInt(hexStr.substr(0, 2), 16) / 255;
outFloatArray[1] = parseInt(hexStr.substr(2, 2), 16) / 255;
outFloatArray[2] = parseInt(hexStr.substr(4, 2), 16) / 255;
return outFloatArray;
case 7: // #ab01df
outFloatArray[0] = parseInt(hexStr.substr(1, 2), 16) / 255;
outFloatArray[1] = parseInt(hexStr.substr(3, 2), 16) / 255;
outFloatArray[2] = parseInt(hexStr.substr(5, 2), 16) / 255;
return outFloatArray;
case 9: // #ab01df00
outFloatArray[0] = parseInt(hexStr.substr(1, 2), 16) / 255;
outFloatArray[1] = parseInt(hexStr.substr(3, 2), 16) / 255;
outFloatArray[2] = parseInt(hexStr.substr(5, 2), 16) / 255;
outFloatArray[3] = parseInt(hexStr.substr(7, 2), 16) / 255;
return outFloatArray;
default:
return outFloatArray;
}
}
export function sameColor(rgbaFloat1, rgbaFloat2) {
if (rgbaFloat1.length !== rgbaFloat2.length) {
return false;
}
let same = true;
for (let i = 0; i < rgbaFloat1.length && same; i++) {
same = Math.abs(rgbaFloat1[i] - rgbaFloat2[i]) < 0.003; // (1/255)
}
return same;
}
/* eslint-disable react/no-danger */
/* eslint-disable react/no-unused-prop-types */
export default class ColorProperty extends React.Component {
constructor(props) {
super(props);
this.state = {
data: props.data,
helpOpen: false,
};
// Callback binding
this.helpToggled = this.helpToggled.bind(this);
this.onColorClick = this.onColorClick.bind(this);
}
componentWillMount() {
const newState = {};
if (this.props.ui.default && !this.props.data.value) {
newState.data = this.state.data;
newState.data.value = this.props.ui.default;
}
if (Object.keys(newState).length > 0) {
this.setState(newState);
}
}
componentWillReceiveProps(nextProps) {
const data = nextProps.data;
if (this.state.data !== data) {
this.setState({
data,
});
}
}
onColorClick(e) {
const newColor = e.target.dataset.color
.split(',')
.map((str) => Number(str));
const newData = this.state.data;
newData.value = newColor;
this.setState({
data: newData,
});
if (this.props.onChange) {
this.props.onChange(newData);
}
}
helpToggled(open) {
this.setState({
helpOpen: open,
});
}
render() {
const palette = (
(this.props.ui.domain && this.props.ui.domain.palette) ||
this.props.palette
).map((hex) => hex2float(hex));
return (
<div
className={
this.props.show(this.props.viewData) ? style.container : style.hidden
}
>
<div className={style.header}>
<strong>{this.props.ui.label}</strong>
<span>
<ToggleIconButton
icon={style.helpIcon}
value={this.state.helpOpen}
toggle={!!this.props.ui.help}
onChange={this.helpToggled}
/>
</span>
</div>
<div
className={style.inputBlock}
style={{
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'flex-start',
}}
>
{palette.map((c, i) => (
<ColorItem
key={btoa(i)}
active={sameColor(c, this.state.data.value)}
color={c}
onClick={this.onColorClick}
/>
))}
</div>
<div
className={this.state.helpOpen ? style.helpBox : style.hidden}
dangerouslySetInnerHTML={{ __html: this.props.ui.help }}
/>
</div>
);
}
}
ColorProperty.propTypes = {
data: PropTypes.object.isRequired,
help: PropTypes.string,
name: PropTypes.string,
onChange: PropTypes.func,
show: PropTypes.func,
ui: PropTypes.object.isRequired,
viewData: PropTypes.object,
palette: PropTypes.array,
};
ColorProperty.defaultProps = {
name: '',
help: '',
onChange: () => {},
show: () => true,
viewData: {},
palette: [
'#51574a',
'#447c69',
'#74c493',
'#8e8c6d',
'#e4bf80',
'#e9d78e',
'#e2975d',
'#f19670',
'#e16552',
'#c94a53',
'#be5168',
'#a34974',
'#993767',
'#65387d',
'#4e2472',
'#9163b6',
'#e279a3',
'#e0598b',
'#7c9fb0',
'#5698c4',
'#9abf88',
],
};
|
Samples/Core.DynamicPermissions/Core.DynamicPermissionsWeb/Scripts/jquery-1.10.2.min.js | erwinvanhunen/PnP | /* NUGET: BEGIN LICENSE TEXT
*
* Microsoft grants you the right to use these script files for the sole
* purpose of either: (i) interacting through your browser with the Microsoft
* website or online service, subject to the applicable licensing or use
* terms; or (ii) using the files as included with a Microsoft product subject
* to that product's license terms. Microsoft reserves all other rights to the
* files not expressly granted by Microsoft, whether by implication, estoppel
* or otherwise. Insofar as a script file is dual licensed under GPL,
* Microsoft neither took the code under GPL nor distributes it thereunder but
* under the terms set out in this paragraph. All notices and licenses
* below are for informational purposes only.
*
* JQUERY CORE 1.10.2; Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; http://jquery.org/license
* Includes Sizzle.js; Copyright 2013 jQuery Foundation, Inc. and other contributors; http://opensource.org/licenses/MIT
*
* NUGET: END LICENSE TEXT */
/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery-1.10.2.min.map
*/
(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={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:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.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(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
|
files/yasqe/2.2.0/yasqe.bundled.min.js | Craga89/jsdelivr | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.YASQE=e()}}(function(){var e;return function t(e,r,i){function n(s,a){if(!r[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[s]={exports:{}};e[s][0].call(p.exports,function(t){var r=e[s][1][t];return n(r?r:t)},p,p.exports,t,e,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)n(i[s]);return n}({1:[function(e,t){"use strict";window.console=window.console||{log:function(){}};var r=e("jquery"),i=e("codemirror"),n=(e("./sparql.js"),e("./utils.js")),o=e("yasgui-utils"),s=e("./imgs.js");e("../lib/deparam.js"),e("codemirror/addon/hint/show-hint.js"),e("codemirror/addon/search/searchcursor.js"),e("codemirror/addon/edit/matchbrackets.js"),e("codemirror/addon/runmode/runmode.js"),e("codemirror/addon/display/fullscreen.js"),e("../lib/flint.js");var a=t.exports=function(e,t){t=l(t);var r=u(i(e,t));return d(r),r},l=function(e){var t=r.extend(!0,{},a.defaults,e);return t},u=function(t){return r(t.getWrapperElement()).addClass("yasqe"),t.autocompleters=e("./autocompleters/autocompleterBase.js")(t),t.options.autocompleters&&t.options.autocompleters.forEach(function(e){a.Autocompleters[e]&&t.autocompleters.init(e,a.Autocompleters[e])}),t.getCompleteToken=function(r,i){return e("./tokenUtils.js").getCompleteToken(t,r,i)},t.getPreviousNonWsToken=function(r,i){return e("./tokenUtils.js").getPreviousNonWsToken(t,r,i)},t.getNextNonWsToken=function(r,i){return e("./tokenUtils.js").getNextNonWsToken(t,r,i)},t.query=function(e){a.executeQuery(t,e)},t.getPrefixesFromQuery=function(){return e("./prefixUtils.js").getPrefixesFromQuery(t)},t.addPrefixes=function(r){return e("./prefixUtils.js").addPrefixes(t,r)},t.removePrefixes=function(r){return e("./prefixUtils.js").removePrefixes(t,r)},t.getQueryType=function(){return t.queryType},t.getQueryMode=function(){var e=t.getQueryType();return"INSERT"==e||"DELETE"==e||"LOAD"==e||"CLEAR"==e||"CREATE"==e||"DROP"==e||"COPY"==e||"MOVE"==e||"ADD"==e?"update":"query"},t.setCheckSyntaxErrors=function(e){t.options.syntaxErrorCheck=e,f(t)},t.enableCompleter=function(e){p(t.options,e),YASQE.Autocompleters[e]&&t.autocompleters.init(e,YASQE.Autocompleters[e])},t.disableCompleter=function(e){c(t.options,e)},t},p=function(e,t){e.autocompleters||(e.autocompleters=[]),e.autocompleters.push(t)},c=function(e,t){if("object"==typeof e.autocompleters){var i=r.inArray(t,e.autocompleters);i>=0&&(e.autocompleters.splice(i,1),c(e,t))}},d=function(e){var t=n.getPersistencyId(e,e.options.persistent);if(t){var i=o.storage.get(t);i&&e.setValue(i)}if(a.drawButtons(e),e.on("blur",function(e){a.storeQuery(e)}),e.on("change",function(e){f(e),a.updateQueryButton(e),a.positionButtons(e)}),e.on("cursorActivity",function(e){h(e)}),e.prevQueryValid=!1,f(e),a.positionButtons(e),e.options.consumeShareLink){var s=r.deparam(window.location.search.substring(1));e.options.consumeShareLink(e,s)}},h=function(e){e.cursor=r(".CodeMirror-cursor"),e.buttons&&e.buttons.is(":visible")&&e.cursor.length>0&&(n.elementsOverlap(e.cursor,e.buttons)?e.buttons.find("svg").attr("opacity","0.2"):e.buttons.find("svg").attr("opacity","1.0"))},E=null,f=function(t,i){t.queryValid=!0,E&&(E(),E=null),t.clearGutter("gutterErrorBar");for(var n=null,a=0;a<t.lineCount();++a){var l=!1;t.prevQueryValid||(l=!0);var u=t.getTokenAt({line:a,ch:t.getLine(a).length},l),n=u.state;if(t.queryType=n.queryType,0==n.OK){if(!t.options.syntaxErrorCheck)return void r(t.getWrapperElement).find(".sp-error").css("color","black");var p=o.svg.getElement(s.warning,{width:"15px",height:"15px"});n.possibleCurrent&&n.possibleCurrent.length>0&&(p.style.zIndex="99999999",e("./tooltip")(t,p,function(){var e=[];return n.possibleCurrent.forEach(function(t){e.push("<strong style='text-decoration:underline'>"+r("<div/>").text(t).html()+"</strong>")}),"This line is invalid. Expected: "+e.join(", ")})),p.style.marginTop="2px",p.style.marginLeft="2px",t.setGutterMarker(a,"gutterErrorBar",p),E=function(){t.markText({line:a,ch:n.errorStartPos},{line:a,ch:n.errorEndPos},"sp-error")},t.queryValid=!1;break}}if(t.prevQueryValid=t.queryValid,i&&null!=n&&void 0!=n.stack){var c=n.stack,d=n.stack.length;d>1?t.queryValid=!1:1==d&&"solutionModifier"!=c[0]&&"?limitOffsetClauses"!=c[0]&&"?offsetClause"!=c[0]&&(t.queryValid=!1)}};r.extend(a,i),a.Autocompleters={},a.registerAutocompleter=function(e,t){a.Autocompleters[e]=t,p(a.defaults,e)},a.autoComplete=function(e){e.autocompleters.autoComplete(!1)},a.registerAutocompleter("prefixes",e("./autocompleters/prefixes.js")),a.registerAutocompleter("properties",e("./autocompleters/properties.js")),a.registerAutocompleter("classes",e("./autocompleters/classes.js")),a.registerAutocompleter("variables",e("./autocompleters/variables.js")),a.positionButtons=function(e){var t=r(e.getWrapperElement()).find(".CodeMirror-vscrollbar"),i=0;t.is(":visible")&&(i=t.outerWidth()),e.buttons.is(":visible")&&e.buttons.css("right",i)},a.createShareLink=function(e){return{query:e.getValue()}},a.consumeShareLink=function(e,t){t.query&&e.setValue(t.query)},a.drawButtons=function(e){if(e.buttons=r("<div class='yasqe_buttons'></div>").appendTo(r(e.getWrapperElement())),e.options.createShareLink){var t=r(o.svg.getElement(s.share,{width:"30px",height:"30px"}));t.click(function(i){i.stopPropagation();var n=r("<div class='yasqe_sharePopup'></div>").appendTo(e.buttons);r("html").click(function(){n&&n.remove()}),n.click(function(e){e.stopPropagation()});var o=r("<textarea></textarea>").val(location.protocol+"//"+location.host+location.pathname+"?"+r.param(e.options.createShareLink(e)));o.focus(function(){var e=r(this);e.select(),e.mouseup(function(){return e.unbind("mouseup"),!1})}),n.empty().append(o);var s=t.position();n.css("top",s.top+t.outerHeight()+"px").css("left",s.left+t.outerWidth()-n.outerWidth()+"px")}).addClass("yasqe_share").attr("title","Share your query").appendTo(e.buttons)}if(e.options.sparql.showQueryButton){var i=40,n=40;r("<div class='yasqe_queryButton'></div>").click(function(){r(this).hasClass("query_busy")?(e.xhr&&e.xhr.abort(),a.updateQueryButton(e)):e.query()}).height(i).width(n).appendTo(e.buttons),a.updateQueryButton(e)}};var m={busy:"loader",valid:"query",error:"queryInvalid"};a.updateQueryButton=function(e,t){var i=r(e.getWrapperElement()).find(".yasqe_queryButton");0!=i.length&&(t||(t="valid",e.queryValid===!1&&(t="error")),t==e.queryStatus||"busy"!=t&&"valid"!=t&&"error"!=t||(i.empty().removeClass(function(e,t){return t.split(" ").filter(function(e){return 0==e.indexOf("query_")}).join(" ")}).addClass("query_"+t).append(o.svg.getElement(s[m[t]],{width:"100%",height:"100%"})),e.queryStatus=t))},a.fromTextArea=function(e,t){t=l(t);var r=u(i.fromTextArea(e,t));return d(r),r},a.storeQuery=function(e){var t=n.getPersistencyId(e,e.options.persistent);t&&o.storage.set(t,e.getValue(),"month")},a.commentLines=function(e){for(var t=e.getCursor(!0).line,r=e.getCursor(!1).line,i=Math.min(t,r),n=Math.max(t,r),o=!0,s=i;n>=s;s++){var a=e.getLine(s);if(0==a.length||"#"!=a.substring(0,1)){o=!1;break}}for(var s=i;n>=s;s++)o?e.replaceRange("",{line:s,ch:0},{line:s,ch:1}):e.replaceRange("#",{line:s,ch:0})},a.copyLineUp=function(e){var t=e.getCursor(),r=e.lineCount();e.replaceRange("\n",{line:r-1,ch:e.getLine(r-1).length});for(var i=r;i>t.line;i--){var n=e.getLine(i-1);e.replaceRange(n,{line:i,ch:0},{line:i,ch:e.getLine(i).length})}},a.copyLineDown=function(e){a.copyLineUp(e);var t=e.getCursor();t.line++,e.setCursor(t)},a.doAutoFormat=function(e){if(e.somethingSelected()){var t={line:e.getCursor(!1).line,ch:e.getSelection().length};g(e,e.getCursor(!0),t)}else{var r=e.lineCount(),i=e.getTextArea().value.length;g(e,{line:0,ch:0},{line:r,ch:i})}};var g=function(e,t,r){var i=e.indexFromPos(t),n=e.indexFromPos(r),o=v(e.getValue(),i,n);e.operation(function(){e.replaceRange(o,t,r);for(var n=e.posFromIndex(i).line,s=e.posFromIndex(i+o.length).line,a=n;s>=a;a++)e.indentLine(a,"smart")})},v=function(e,t,n){e=e.substring(t,n);var o=[["keyword","ws","prefixed","ws","uri"],["keyword","ws","uri"]],s=["{",".",";"],a=["}"],l=function(e){for(var t=0;t<o.length;t++)if(c.valueOf().toString()==o[t].valueOf().toString())return 1;for(var t=0;t<s.length;t++)if(e==s[t])return 1;for(var t=0;t<a.length;t++)if(""!=r.trim(p)&&e==a[t])return-1;return 0},u="",p="",c=[];return i.runMode(e,"sparql11",function(e,t){c.push(t);var r=l(e,t);0!=r?(1==r?(u+=e+"\n",p=""):(u+="\n"+e,p=e),c=[]):(p+=e,u+=e),1==c.length&&"sp-ws"==c[0]&&(c=[])}),r.trim(u.replace(/\n\s*\n/g,"\n"))};e("./sparql.js").use(a),e("./defaults.js").use(a),a.version={CodeMirror:i.version,YASQE:e("../package.json").version,jquery:r.fn.jquery,"yasgui-utils":o.version}},{"../lib/deparam.js":2,"../lib/flint.js":3,"../package.json":17,"./autocompleters/autocompleterBase.js":18,"./autocompleters/classes.js":19,"./autocompleters/prefixes.js":20,"./autocompleters/properties.js":21,"./autocompleters/variables.js":23,"./defaults.js":24,"./imgs.js":25,"./prefixUtils.js":26,"./sparql.js":27,"./tokenUtils.js":28,"./tooltip":29,"./utils.js":30,codemirror:10,"codemirror/addon/display/fullscreen.js":5,"codemirror/addon/edit/matchbrackets.js":6,"codemirror/addon/hint/show-hint.js":7,"codemirror/addon/runmode/runmode.js":8,"codemirror/addon/search/searchcursor.js":9,jquery:11,"yasgui-utils":14}],2:[function(e){var t=e("jquery");t.deparam=function(e,r){var i={},n={"true":!0,"false":!1,"null":null};return t.each(e.replace(/\+/g," ").split("&"),function(e,o){var s,a=o.split("="),l=decodeURIComponent(a[0]),u=i,p=0,c=l.split("]["),d=c.length-1;if(/\[/.test(c[0])&&/\]$/.test(c[d])?(c[d]=c[d].replace(/\]$/,""),c=c.shift().split("[").concat(c),d=c.length-1):d=0,2===a.length)if(s=decodeURIComponent(a[1]),r&&(s=s&&!isNaN(s)?+s:"undefined"===s?void 0:void 0!==n[s]?n[s]:s),d)for(;d>=p;p++)l=""===c[p]?u.length:c[p],u=u[l]=d>p?u[l]||(c[p+1]&&isNaN(c[p+1])?{}:[]):s;else t.isArray(i[l])?i[l].push(s):i[l]=void 0!==i[l]?[i[l],s]:s;else l&&(i[l]=r?void 0:"")}),i}},{jquery:11}],3:[function(t,r,i){!function(n){"object"==typeof i&&"object"==typeof r?n(t("codemirror")):"function"==typeof e&&e.amd?e(["codemirror"],n):n(CodeMirror)}(function(e){"use strict";e.defineMode("sparql11",function(e){function t(){var e,t,r="<[^<>\"'|{}^\\\x00- ]*>",i="[A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]",n=i+"|_",o="("+n+"|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])",s="("+n+"|[0-9])("+n+"|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])*",a="\\?"+s,l="\\$"+s,p="("+i+")((("+o+")|\\.)*("+o+"))?",c="[0-9A-Fa-f]",d="(%"+c+c+")",h="(\\\\[_~\\.\\-!\\$&'\\(\\)\\*\\+,;=/\\?#@%])",E="("+d+"|"+h+")";"sparql11"==u?(e="("+n+"|:|[0-9]|"+E+")(("+o+"|\\.|:|"+E+")*("+o+"|:|"+E+"))?",t="_:("+n+"|[0-9])(("+o+"|\\.)*"+o+")?"):(e="("+n+"|[0-9])((("+o+")|\\.)*("+o+"))?",t="_:"+e);var f="("+p+")?:",m=f+e,g="@[a-zA-Z]+(-[a-zA-Z0-9]+)*",v="[eE][\\+-]?[0-9]+",x="[0-9]+",N="(([0-9]+\\.[0-9]*)|(\\.[0-9]+))",T="(([0-9]+\\.[0-9]*"+v+")|(\\.[0-9]+"+v+")|([0-9]+"+v+"))",L="\\+"+x,I="\\+"+N,y="\\+"+T,A="-"+x,S="-"+N,C="-"+T,R="\\\\[tbnrf\\\\\"']",b="'(([^\\x27\\x5C\\x0A\\x0D])|"+R+")*'",O='"(([^\\x22\\x5C\\x0A\\x0D])|'+R+')*"',P="'''(('|'')?([^'\\\\]|"+R+"))*'''",D='"""(("|"")?([^"\\\\]|'+R+'))*"""',_="[\\x20\\x09\\x0D\\x0A]",M="#([^\\n\\r]*[\\n\\r]|[^\\n\\r]*$)",w="("+_+"|("+M+"))*",G="\\("+w+"\\)",k="\\["+w+"\\]",B={terminal:[{name:"WS",regex:new RegExp("^"+_+"+"),style:"ws"},{name:"COMMENT",regex:new RegExp("^"+M),style:"comment"},{name:"IRI_REF",regex:new RegExp("^"+r),style:"variable-3"},{name:"VAR1",regex:new RegExp("^"+a),style:"atom"},{name:"VAR2",regex:new RegExp("^"+l),style:"atom"},{name:"LANGTAG",regex:new RegExp("^"+g),style:"meta"},{name:"DOUBLE",regex:new RegExp("^"+T),style:"number"},{name:"DECIMAL",regex:new RegExp("^"+N),style:"number"},{name:"INTEGER",regex:new RegExp("^"+x),style:"number"},{name:"DOUBLE_POSITIVE",regex:new RegExp("^"+y),style:"number"},{name:"DECIMAL_POSITIVE",regex:new RegExp("^"+I),style:"number"},{name:"INTEGER_POSITIVE",regex:new RegExp("^"+L),style:"number"},{name:"DOUBLE_NEGATIVE",regex:new RegExp("^"+C),style:"number"},{name:"DECIMAL_NEGATIVE",regex:new RegExp("^"+S),style:"number"},{name:"INTEGER_NEGATIVE",regex:new RegExp("^"+A),style:"number"},{name:"STRING_LITERAL_LONG1",regex:new RegExp("^"+P),style:"string"},{name:"STRING_LITERAL_LONG2",regex:new RegExp("^"+D),style:"string"},{name:"STRING_LITERAL1",regex:new RegExp("^"+b),style:"string"},{name:"STRING_LITERAL2",regex:new RegExp("^"+O),style:"string"},{name:"NIL",regex:new RegExp("^"+G),style:"punc"},{name:"ANON",regex:new RegExp("^"+k),style:"punc"},{name:"PNAME_LN",regex:new RegExp("^"+m),style:"string-2"},{name:"PNAME_NS",regex:new RegExp("^"+f),style:"string-2"},{name:"BLANK_NODE_LABEL",regex:new RegExp("^"+t),style:"string-2"}]};return B}function r(e){var t=[],r=o[e];if(void 0!=r)for(var i in r)t.push(i.toString());else t.push(e);return t}function i(e,t){function i(){for(var t=null,r=0;r<h.length;++r)if(t=e.match(h[r].regex,!0,!1))return{cat:h[r].name,style:h[r].style,text:t[0]};return(t=e.match(s,!0,!1))?{cat:e.current().toUpperCase(),style:"keyword",text:t[0]}:(t=e.match(a,!0,!1))?{cat:e.current(),style:"punc",text:t[0]}:(t=e.match(/^.[A-Za-z0-9]*/,!0,!1),{cat:"<invalid_token>",style:"error",text:t[0]})}function n(){var r=e.column();t.errorStartPos=r,t.errorEndPos=r+c.text.length}function l(e){null==t.queryType&&("SELECT"==e||"CONSTRUCT"==e||"ASK"==e||"DESCRIBE"==e||"INSERT"==e||"DELETE"==e||"LOAD"==e||"CLEAR"==e||"CREATE"==e||"DROP"==e||"COPY"==e||"MOVE"==e||"ADD"==e)&&(t.queryType=e)}function u(e){"disallowVars"==e?t.allowVars=!1:"allowVars"==e?t.allowVars=!0:"disallowBnodes"==e?t.allowBnodes=!1:"allowBnodes"==e?t.allowBnodes=!0:"storeProperty"==e&&(t.storeProperty=!0)}function p(e){return(t.allowVars||"var"!=e)&&(t.allowBnodes||"blankNode"!=e&&"blankNodePropertyList"!=e&&"blankNodePropertyListPath"!=e)}0==e.pos&&(t.possibleCurrent=t.possibleNext);var c=i();if("<invalid_token>"==c.cat)return 1==t.OK&&(t.OK=!1,n()),t.complete=!1,c.style;if("WS"==c.cat||"COMMENT"==c.cat)return t.possibleCurrent=t.possibleNext,c.style;for(var d,E=!1,f=c.cat;t.stack.length>0&&f&&t.OK&&!E;)if(d=t.stack.pop(),o[d]){var m=o[d][f];if(void 0!=m&&p(d)){for(var g=m.length-1;g>=0;--g)t.stack.push(m[g]);u(d)}else t.OK=!1,t.complete=!1,n(),t.stack.push(d)}else if(d==f){E=!0,l(d);for(var v=!0,x=t.stack.length;x>0;--x){var N=o[t.stack[x-1]];N&&N.$||(v=!1)}t.complete=v,t.storeProperty&&"punc"!=f.cat&&(t.lastProperty=c.text,t.storeProperty=!1)}else t.OK=!1,t.complete=!1,n();return!E&&t.OK&&(t.OK=!1,t.complete=!1,n()),t.possibleCurrent=t.possibleNext,t.possibleNext=r(t.stack[t.stack.length-1]),c.style}function n(t,r){var i=0,n=t.stack.length-1;if(/^[\}\]\)]/.test(r)){for(var o=r.substr(0,1);n>=0;--n)if(t.stack[n]==o){--n;break}}else{var s=E[t.stack[n]];s&&(i+=s,--n)}for(;n>=0;--n){var s=f[t.stack[n]];s&&(i+=s)}return i*e.indentUnit}var o=(e.indentUnit,{"*[&&,valueLogical]":{"&&":["[&&,valueLogical]","*[&&,valueLogical]"],AS:[],")":[],",":[],"||":[],";":[]},"*[,,expression]":{",":["[,,expression]","*[,,expression]"],")":[]},"*[,,objectPath]":{",":["[,,objectPath]","*[,,objectPath]"],".":[],";":[],"]":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"*[,,object]":{",":["[,,object]","*[,,object]"],".":[],";":[],"]":[],"}":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"*[/,pathEltOrInverse]":{"/":["[/,pathEltOrInverse]","*[/,pathEltOrInverse]"],"|":[],")":[],"(":[],"[":[],VAR1:[],VAR2:[],NIL:[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},"*[;,?[or([verbPath,verbSimple]),objectList]]":{";":["[;,?[or([verbPath,verbSimple]),objectList]]","*[;,?[or([verbPath,verbSimple]),objectList]]"],".":[],"]":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"*[;,?[verb,objectList]]":{";":["[;,?[verb,objectList]]","*[;,?[verb,objectList]]"],".":[],"]":[],"}":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"*[UNION,groupGraphPattern]":{UNION:["[UNION,groupGraphPattern]","*[UNION,groupGraphPattern]"],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],".":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"*[graphPatternNotTriples,?.,?triplesBlock]":{"{":["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],OPTIONAL:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],MINUS:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],GRAPH:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],SERVICE:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],FILTER:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],BIND:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],VALUES:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],"}":[]},"*[quadsNotTriples,?.,?triplesTemplate]":{GRAPH:["[quadsNotTriples,?.,?triplesTemplate]","*[quadsNotTriples,?.,?triplesTemplate]"],"}":[]},"*[|,pathOneInPropertySet]":{"|":["[|,pathOneInPropertySet]","*[|,pathOneInPropertySet]"],")":[]},"*[|,pathSequence]":{"|":["[|,pathSequence]","*[|,pathSequence]"],")":[],"(":[],"[":[],VAR1:[],VAR2:[],NIL:[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},"*[||,conditionalAndExpression]":{"||":["[||,conditionalAndExpression]","*[||,conditionalAndExpression]"],AS:[],")":[],",":[],";":[]},"*dataBlockValue":{UNDEF:["dataBlockValue","*dataBlockValue"],IRI_REF:["dataBlockValue","*dataBlockValue"],TRUE:["dataBlockValue","*dataBlockValue"],FALSE:["dataBlockValue","*dataBlockValue"],PNAME_LN:["dataBlockValue","*dataBlockValue"],PNAME_NS:["dataBlockValue","*dataBlockValue"],STRING_LITERAL1:["dataBlockValue","*dataBlockValue"],STRING_LITERAL2:["dataBlockValue","*dataBlockValue"],STRING_LITERAL_LONG1:["dataBlockValue","*dataBlockValue"],STRING_LITERAL_LONG2:["dataBlockValue","*dataBlockValue"],INTEGER:["dataBlockValue","*dataBlockValue"],DECIMAL:["dataBlockValue","*dataBlockValue"],DOUBLE:["dataBlockValue","*dataBlockValue"],INTEGER_POSITIVE:["dataBlockValue","*dataBlockValue"],DECIMAL_POSITIVE:["dataBlockValue","*dataBlockValue"],DOUBLE_POSITIVE:["dataBlockValue","*dataBlockValue"],INTEGER_NEGATIVE:["dataBlockValue","*dataBlockValue"],DECIMAL_NEGATIVE:["dataBlockValue","*dataBlockValue"],DOUBLE_NEGATIVE:["dataBlockValue","*dataBlockValue"],"}":[],")":[]},"*datasetClause":{FROM:["datasetClause","*datasetClause"],WHERE:[],"{":[]},"*describeDatasetClause":{FROM:["describeDatasetClause","*describeDatasetClause"],ORDER:[],HAVING:[],GROUP:[],LIMIT:[],OFFSET:[],WHERE:[],"{":[],VALUES:[],$:[]},"*graphNode":{"(":["graphNode","*graphNode"],"[":["graphNode","*graphNode"],VAR1:["graphNode","*graphNode"],VAR2:["graphNode","*graphNode"],NIL:["graphNode","*graphNode"],IRI_REF:["graphNode","*graphNode"],TRUE:["graphNode","*graphNode"],FALSE:["graphNode","*graphNode"],BLANK_NODE_LABEL:["graphNode","*graphNode"],ANON:["graphNode","*graphNode"],PNAME_LN:["graphNode","*graphNode"],PNAME_NS:["graphNode","*graphNode"],STRING_LITERAL1:["graphNode","*graphNode"],STRING_LITERAL2:["graphNode","*graphNode"],STRING_LITERAL_LONG1:["graphNode","*graphNode"],STRING_LITERAL_LONG2:["graphNode","*graphNode"],INTEGER:["graphNode","*graphNode"],DECIMAL:["graphNode","*graphNode"],DOUBLE:["graphNode","*graphNode"],INTEGER_POSITIVE:["graphNode","*graphNode"],DECIMAL_POSITIVE:["graphNode","*graphNode"],DOUBLE_POSITIVE:["graphNode","*graphNode"],INTEGER_NEGATIVE:["graphNode","*graphNode"],DECIMAL_NEGATIVE:["graphNode","*graphNode"],DOUBLE_NEGATIVE:["graphNode","*graphNode"],")":[]},"*graphNodePath":{"(":["graphNodePath","*graphNodePath"],"[":["graphNodePath","*graphNodePath"],VAR1:["graphNodePath","*graphNodePath"],VAR2:["graphNodePath","*graphNodePath"],NIL:["graphNodePath","*graphNodePath"],IRI_REF:["graphNodePath","*graphNodePath"],TRUE:["graphNodePath","*graphNodePath"],FALSE:["graphNodePath","*graphNodePath"],BLANK_NODE_LABEL:["graphNodePath","*graphNodePath"],ANON:["graphNodePath","*graphNodePath"],PNAME_LN:["graphNodePath","*graphNodePath"],PNAME_NS:["graphNodePath","*graphNodePath"],STRING_LITERAL1:["graphNodePath","*graphNodePath"],STRING_LITERAL2:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG1:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG2:["graphNodePath","*graphNodePath"],INTEGER:["graphNodePath","*graphNodePath"],DECIMAL:["graphNodePath","*graphNodePath"],DOUBLE:["graphNodePath","*graphNodePath"],INTEGER_POSITIVE:["graphNodePath","*graphNodePath"],DECIMAL_POSITIVE:["graphNodePath","*graphNodePath"],DOUBLE_POSITIVE:["graphNodePath","*graphNodePath"],INTEGER_NEGATIVE:["graphNodePath","*graphNodePath"],DECIMAL_NEGATIVE:["graphNodePath","*graphNodePath"],DOUBLE_NEGATIVE:["graphNodePath","*graphNodePath"],")":[]},"*groupCondition":{"(":["groupCondition","*groupCondition"],STR:["groupCondition","*groupCondition"],LANG:["groupCondition","*groupCondition"],LANGMATCHES:["groupCondition","*groupCondition"],DATATYPE:["groupCondition","*groupCondition"],BOUND:["groupCondition","*groupCondition"],IRI:["groupCondition","*groupCondition"],URI:["groupCondition","*groupCondition"],BNODE:["groupCondition","*groupCondition"],RAND:["groupCondition","*groupCondition"],ABS:["groupCondition","*groupCondition"],CEIL:["groupCondition","*groupCondition"],FLOOR:["groupCondition","*groupCondition"],ROUND:["groupCondition","*groupCondition"],CONCAT:["groupCondition","*groupCondition"],STRLEN:["groupCondition","*groupCondition"],UCASE:["groupCondition","*groupCondition"],LCASE:["groupCondition","*groupCondition"],ENCODE_FOR_URI:["groupCondition","*groupCondition"],CONTAINS:["groupCondition","*groupCondition"],STRSTARTS:["groupCondition","*groupCondition"],STRENDS:["groupCondition","*groupCondition"],STRBEFORE:["groupCondition","*groupCondition"],STRAFTER:["groupCondition","*groupCondition"],YEAR:["groupCondition","*groupCondition"],MONTH:["groupCondition","*groupCondition"],DAY:["groupCondition","*groupCondition"],HOURS:["groupCondition","*groupCondition"],MINUTES:["groupCondition","*groupCondition"],SECONDS:["groupCondition","*groupCondition"],TIMEZONE:["groupCondition","*groupCondition"],TZ:["groupCondition","*groupCondition"],NOW:["groupCondition","*groupCondition"],UUID:["groupCondition","*groupCondition"],STRUUID:["groupCondition","*groupCondition"],MD5:["groupCondition","*groupCondition"],SHA1:["groupCondition","*groupCondition"],SHA256:["groupCondition","*groupCondition"],SHA384:["groupCondition","*groupCondition"],SHA512:["groupCondition","*groupCondition"],COALESCE:["groupCondition","*groupCondition"],IF:["groupCondition","*groupCondition"],STRLANG:["groupCondition","*groupCondition"],STRDT:["groupCondition","*groupCondition"],SAMETERM:["groupCondition","*groupCondition"],ISIRI:["groupCondition","*groupCondition"],ISURI:["groupCondition","*groupCondition"],ISBLANK:["groupCondition","*groupCondition"],ISLITERAL:["groupCondition","*groupCondition"],ISNUMERIC:["groupCondition","*groupCondition"],VAR1:["groupCondition","*groupCondition"],VAR2:["groupCondition","*groupCondition"],SUBSTR:["groupCondition","*groupCondition"],REPLACE:["groupCondition","*groupCondition"],REGEX:["groupCondition","*groupCondition"],EXISTS:["groupCondition","*groupCondition"],NOT:["groupCondition","*groupCondition"],IRI_REF:["groupCondition","*groupCondition"],PNAME_LN:["groupCondition","*groupCondition"],PNAME_NS:["groupCondition","*groupCondition"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],HAVING:[],$:[],"}":[]},"*havingCondition":{"(":["havingCondition","*havingCondition"],STR:["havingCondition","*havingCondition"],LANG:["havingCondition","*havingCondition"],LANGMATCHES:["havingCondition","*havingCondition"],DATATYPE:["havingCondition","*havingCondition"],BOUND:["havingCondition","*havingCondition"],IRI:["havingCondition","*havingCondition"],URI:["havingCondition","*havingCondition"],BNODE:["havingCondition","*havingCondition"],RAND:["havingCondition","*havingCondition"],ABS:["havingCondition","*havingCondition"],CEIL:["havingCondition","*havingCondition"],FLOOR:["havingCondition","*havingCondition"],ROUND:["havingCondition","*havingCondition"],CONCAT:["havingCondition","*havingCondition"],STRLEN:["havingCondition","*havingCondition"],UCASE:["havingCondition","*havingCondition"],LCASE:["havingCondition","*havingCondition"],ENCODE_FOR_URI:["havingCondition","*havingCondition"],CONTAINS:["havingCondition","*havingCondition"],STRSTARTS:["havingCondition","*havingCondition"],STRENDS:["havingCondition","*havingCondition"],STRBEFORE:["havingCondition","*havingCondition"],STRAFTER:["havingCondition","*havingCondition"],YEAR:["havingCondition","*havingCondition"],MONTH:["havingCondition","*havingCondition"],DAY:["havingCondition","*havingCondition"],HOURS:["havingCondition","*havingCondition"],MINUTES:["havingCondition","*havingCondition"],SECONDS:["havingCondition","*havingCondition"],TIMEZONE:["havingCondition","*havingCondition"],TZ:["havingCondition","*havingCondition"],NOW:["havingCondition","*havingCondition"],UUID:["havingCondition","*havingCondition"],STRUUID:["havingCondition","*havingCondition"],MD5:["havingCondition","*havingCondition"],SHA1:["havingCondition","*havingCondition"],SHA256:["havingCondition","*havingCondition"],SHA384:["havingCondition","*havingCondition"],SHA512:["havingCondition","*havingCondition"],COALESCE:["havingCondition","*havingCondition"],IF:["havingCondition","*havingCondition"],STRLANG:["havingCondition","*havingCondition"],STRDT:["havingCondition","*havingCondition"],SAMETERM:["havingCondition","*havingCondition"],ISIRI:["havingCondition","*havingCondition"],ISURI:["havingCondition","*havingCondition"],ISBLANK:["havingCondition","*havingCondition"],ISLITERAL:["havingCondition","*havingCondition"],ISNUMERIC:["havingCondition","*havingCondition"],SUBSTR:["havingCondition","*havingCondition"],REPLACE:["havingCondition","*havingCondition"],REGEX:["havingCondition","*havingCondition"],EXISTS:["havingCondition","*havingCondition"],NOT:["havingCondition","*havingCondition"],IRI_REF:["havingCondition","*havingCondition"],PNAME_LN:["havingCondition","*havingCondition"],PNAME_NS:["havingCondition","*havingCondition"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],$:[],"}":[]},"*or([[ (,*dataBlockValue,)],NIL])":{"(":["or([[ (,*dataBlockValue,)],NIL])","*or([[ (,*dataBlockValue,)],NIL])"],NIL:["or([[ (,*dataBlockValue,)],NIL])","*or([[ (,*dataBlockValue,)],NIL])"],"}":[]},"*or([[*,unaryExpression],[/,unaryExpression]])":{"*":["or([[*,unaryExpression],[/,unaryExpression]])","*or([[*,unaryExpression],[/,unaryExpression]])"],"/":["or([[*,unaryExpression],[/,unaryExpression]])","*or([[*,unaryExpression],[/,unaryExpression]])"],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],"+":[],"-":[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],";":[]},"*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])":{"+":["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"-":["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_POSITIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_POSITIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_POSITIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_NEGATIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_NEGATIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_NEGATIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],";":[]},"*or([var,[ (,expression,AS,var,)]])":{"(":["or([var,[ (,expression,AS,var,)]])","*or([var,[ (,expression,AS,var,)]])"],VAR1:["or([var,[ (,expression,AS,var,)]])","*or([var,[ (,expression,AS,var,)]])"],VAR2:["or([var,[ (,expression,AS,var,)]])","*or([var,[ (,expression,AS,var,)]])"],WHERE:[],"{":[],FROM:[]},"*orderCondition":{ASC:["orderCondition","*orderCondition"],DESC:["orderCondition","*orderCondition"],VAR1:["orderCondition","*orderCondition"],VAR2:["orderCondition","*orderCondition"],"(":["orderCondition","*orderCondition"],STR:["orderCondition","*orderCondition"],LANG:["orderCondition","*orderCondition"],LANGMATCHES:["orderCondition","*orderCondition"],DATATYPE:["orderCondition","*orderCondition"],BOUND:["orderCondition","*orderCondition"],IRI:["orderCondition","*orderCondition"],URI:["orderCondition","*orderCondition"],BNODE:["orderCondition","*orderCondition"],RAND:["orderCondition","*orderCondition"],ABS:["orderCondition","*orderCondition"],CEIL:["orderCondition","*orderCondition"],FLOOR:["orderCondition","*orderCondition"],ROUND:["orderCondition","*orderCondition"],CONCAT:["orderCondition","*orderCondition"],STRLEN:["orderCondition","*orderCondition"],UCASE:["orderCondition","*orderCondition"],LCASE:["orderCondition","*orderCondition"],ENCODE_FOR_URI:["orderCondition","*orderCondition"],CONTAINS:["orderCondition","*orderCondition"],STRSTARTS:["orderCondition","*orderCondition"],STRENDS:["orderCondition","*orderCondition"],STRBEFORE:["orderCondition","*orderCondition"],STRAFTER:["orderCondition","*orderCondition"],YEAR:["orderCondition","*orderCondition"],MONTH:["orderCondition","*orderCondition"],DAY:["orderCondition","*orderCondition"],HOURS:["orderCondition","*orderCondition"],MINUTES:["orderCondition","*orderCondition"],SECONDS:["orderCondition","*orderCondition"],TIMEZONE:["orderCondition","*orderCondition"],TZ:["orderCondition","*orderCondition"],NOW:["orderCondition","*orderCondition"],UUID:["orderCondition","*orderCondition"],STRUUID:["orderCondition","*orderCondition"],MD5:["orderCondition","*orderCondition"],SHA1:["orderCondition","*orderCondition"],SHA256:["orderCondition","*orderCondition"],SHA384:["orderCondition","*orderCondition"],SHA512:["orderCondition","*orderCondition"],COALESCE:["orderCondition","*orderCondition"],IF:["orderCondition","*orderCondition"],STRLANG:["orderCondition","*orderCondition"],STRDT:["orderCondition","*orderCondition"],SAMETERM:["orderCondition","*orderCondition"],ISIRI:["orderCondition","*orderCondition"],ISURI:["orderCondition","*orderCondition"],ISBLANK:["orderCondition","*orderCondition"],ISLITERAL:["orderCondition","*orderCondition"],ISNUMERIC:["orderCondition","*orderCondition"],SUBSTR:["orderCondition","*orderCondition"],REPLACE:["orderCondition","*orderCondition"],REGEX:["orderCondition","*orderCondition"],EXISTS:["orderCondition","*orderCondition"],NOT:["orderCondition","*orderCondition"],IRI_REF:["orderCondition","*orderCondition"],PNAME_LN:["orderCondition","*orderCondition"],PNAME_NS:["orderCondition","*orderCondition"],VALUES:[],LIMIT:[],OFFSET:[],$:[],"}":[]},"*prefixDecl":{PREFIX:["prefixDecl","*prefixDecl"],$:[],CONSTRUCT:[],DESCRIBE:[],ASK:[],INSERT:[],DELETE:[],SELECT:[],LOAD:[],CLEAR:[],DROP:[],ADD:[],MOVE:[],COPY:[],CREATE:[],WITH:[]},"*usingClause":{USING:["usingClause","*usingClause"],WHERE:[]},"*var":{VAR1:["var","*var"],VAR2:["var","*var"],")":[]},"*varOrIRIref":{VAR1:["varOrIRIref","*varOrIRIref"],VAR2:["varOrIRIref","*varOrIRIref"],IRI_REF:["varOrIRIref","*varOrIRIref"],PNAME_LN:["varOrIRIref","*varOrIRIref"],PNAME_NS:["varOrIRIref","*varOrIRIref"],ORDER:[],HAVING:[],GROUP:[],LIMIT:[],OFFSET:[],WHERE:[],"{":[],FROM:[],VALUES:[],$:[]},"+graphNode":{"(":["graphNode","*graphNode"],"[":["graphNode","*graphNode"],VAR1:["graphNode","*graphNode"],VAR2:["graphNode","*graphNode"],NIL:["graphNode","*graphNode"],IRI_REF:["graphNode","*graphNode"],TRUE:["graphNode","*graphNode"],FALSE:["graphNode","*graphNode"],BLANK_NODE_LABEL:["graphNode","*graphNode"],ANON:["graphNode","*graphNode"],PNAME_LN:["graphNode","*graphNode"],PNAME_NS:["graphNode","*graphNode"],STRING_LITERAL1:["graphNode","*graphNode"],STRING_LITERAL2:["graphNode","*graphNode"],STRING_LITERAL_LONG1:["graphNode","*graphNode"],STRING_LITERAL_LONG2:["graphNode","*graphNode"],INTEGER:["graphNode","*graphNode"],DECIMAL:["graphNode","*graphNode"],DOUBLE:["graphNode","*graphNode"],INTEGER_POSITIVE:["graphNode","*graphNode"],DECIMAL_POSITIVE:["graphNode","*graphNode"],DOUBLE_POSITIVE:["graphNode","*graphNode"],INTEGER_NEGATIVE:["graphNode","*graphNode"],DECIMAL_NEGATIVE:["graphNode","*graphNode"],DOUBLE_NEGATIVE:["graphNode","*graphNode"]},"+graphNodePath":{"(":["graphNodePath","*graphNodePath"],"[":["graphNodePath","*graphNodePath"],VAR1:["graphNodePath","*graphNodePath"],VAR2:["graphNodePath","*graphNodePath"],NIL:["graphNodePath","*graphNodePath"],IRI_REF:["graphNodePath","*graphNodePath"],TRUE:["graphNodePath","*graphNodePath"],FALSE:["graphNodePath","*graphNodePath"],BLANK_NODE_LABEL:["graphNodePath","*graphNodePath"],ANON:["graphNodePath","*graphNodePath"],PNAME_LN:["graphNodePath","*graphNodePath"],PNAME_NS:["graphNodePath","*graphNodePath"],STRING_LITERAL1:["graphNodePath","*graphNodePath"],STRING_LITERAL2:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG1:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG2:["graphNodePath","*graphNodePath"],INTEGER:["graphNodePath","*graphNodePath"],DECIMAL:["graphNodePath","*graphNodePath"],DOUBLE:["graphNodePath","*graphNodePath"],INTEGER_POSITIVE:["graphNodePath","*graphNodePath"],DECIMAL_POSITIVE:["graphNodePath","*graphNodePath"],DOUBLE_POSITIVE:["graphNodePath","*graphNodePath"],INTEGER_NEGATIVE:["graphNodePath","*graphNodePath"],DECIMAL_NEGATIVE:["graphNodePath","*graphNodePath"],DOUBLE_NEGATIVE:["graphNodePath","*graphNodePath"]},"+groupCondition":{"(":["groupCondition","*groupCondition"],STR:["groupCondition","*groupCondition"],LANG:["groupCondition","*groupCondition"],LANGMATCHES:["groupCondition","*groupCondition"],DATATYPE:["groupCondition","*groupCondition"],BOUND:["groupCondition","*groupCondition"],IRI:["groupCondition","*groupCondition"],URI:["groupCondition","*groupCondition"],BNODE:["groupCondition","*groupCondition"],RAND:["groupCondition","*groupCondition"],ABS:["groupCondition","*groupCondition"],CEIL:["groupCondition","*groupCondition"],FLOOR:["groupCondition","*groupCondition"],ROUND:["groupCondition","*groupCondition"],CONCAT:["groupCondition","*groupCondition"],STRLEN:["groupCondition","*groupCondition"],UCASE:["groupCondition","*groupCondition"],LCASE:["groupCondition","*groupCondition"],ENCODE_FOR_URI:["groupCondition","*groupCondition"],CONTAINS:["groupCondition","*groupCondition"],STRSTARTS:["groupCondition","*groupCondition"],STRENDS:["groupCondition","*groupCondition"],STRBEFORE:["groupCondition","*groupCondition"],STRAFTER:["groupCondition","*groupCondition"],YEAR:["groupCondition","*groupCondition"],MONTH:["groupCondition","*groupCondition"],DAY:["groupCondition","*groupCondition"],HOURS:["groupCondition","*groupCondition"],MINUTES:["groupCondition","*groupCondition"],SECONDS:["groupCondition","*groupCondition"],TIMEZONE:["groupCondition","*groupCondition"],TZ:["groupCondition","*groupCondition"],NOW:["groupCondition","*groupCondition"],UUID:["groupCondition","*groupCondition"],STRUUID:["groupCondition","*groupCondition"],MD5:["groupCondition","*groupCondition"],SHA1:["groupCondition","*groupCondition"],SHA256:["groupCondition","*groupCondition"],SHA384:["groupCondition","*groupCondition"],SHA512:["groupCondition","*groupCondition"],COALESCE:["groupCondition","*groupCondition"],IF:["groupCondition","*groupCondition"],STRLANG:["groupCondition","*groupCondition"],STRDT:["groupCondition","*groupCondition"],SAMETERM:["groupCondition","*groupCondition"],ISIRI:["groupCondition","*groupCondition"],ISURI:["groupCondition","*groupCondition"],ISBLANK:["groupCondition","*groupCondition"],ISLITERAL:["groupCondition","*groupCondition"],ISNUMERIC:["groupCondition","*groupCondition"],VAR1:["groupCondition","*groupCondition"],VAR2:["groupCondition","*groupCondition"],SUBSTR:["groupCondition","*groupCondition"],REPLACE:["groupCondition","*groupCondition"],REGEX:["groupCondition","*groupCondition"],EXISTS:["groupCondition","*groupCondition"],NOT:["groupCondition","*groupCondition"],IRI_REF:["groupCondition","*groupCondition"],PNAME_LN:["groupCondition","*groupCondition"],PNAME_NS:["groupCondition","*groupCondition"]},"+havingCondition":{"(":["havingCondition","*havingCondition"],STR:["havingCondition","*havingCondition"],LANG:["havingCondition","*havingCondition"],LANGMATCHES:["havingCondition","*havingCondition"],DATATYPE:["havingCondition","*havingCondition"],BOUND:["havingCondition","*havingCondition"],IRI:["havingCondition","*havingCondition"],URI:["havingCondition","*havingCondition"],BNODE:["havingCondition","*havingCondition"],RAND:["havingCondition","*havingCondition"],ABS:["havingCondition","*havingCondition"],CEIL:["havingCondition","*havingCondition"],FLOOR:["havingCondition","*havingCondition"],ROUND:["havingCondition","*havingCondition"],CONCAT:["havingCondition","*havingCondition"],STRLEN:["havingCondition","*havingCondition"],UCASE:["havingCondition","*havingCondition"],LCASE:["havingCondition","*havingCondition"],ENCODE_FOR_URI:["havingCondition","*havingCondition"],CONTAINS:["havingCondition","*havingCondition"],STRSTARTS:["havingCondition","*havingCondition"],STRENDS:["havingCondition","*havingCondition"],STRBEFORE:["havingCondition","*havingCondition"],STRAFTER:["havingCondition","*havingCondition"],YEAR:["havingCondition","*havingCondition"],MONTH:["havingCondition","*havingCondition"],DAY:["havingCondition","*havingCondition"],HOURS:["havingCondition","*havingCondition"],MINUTES:["havingCondition","*havingCondition"],SECONDS:["havingCondition","*havingCondition"],TIMEZONE:["havingCondition","*havingCondition"],TZ:["havingCondition","*havingCondition"],NOW:["havingCondition","*havingCondition"],UUID:["havingCondition","*havingCondition"],STRUUID:["havingCondition","*havingCondition"],MD5:["havingCondition","*havingCondition"],SHA1:["havingCondition","*havingCondition"],SHA256:["havingCondition","*havingCondition"],SHA384:["havingCondition","*havingCondition"],SHA512:["havingCondition","*havingCondition"],COALESCE:["havingCondition","*havingCondition"],IF:["havingCondition","*havingCondition"],STRLANG:["havingCondition","*havingCondition"],STRDT:["havingCondition","*havingCondition"],SAMETERM:["havingCondition","*havingCondition"],ISIRI:["havingCondition","*havingCondition"],ISURI:["havingCondition","*havingCondition"],ISBLANK:["havingCondition","*havingCondition"],ISLITERAL:["havingCondition","*havingCondition"],ISNUMERIC:["havingCondition","*havingCondition"],SUBSTR:["havingCondition","*havingCondition"],REPLACE:["havingCondition","*havingCondition"],REGEX:["havingCondition","*havingCondition"],EXISTS:["havingCondition","*havingCondition"],NOT:["havingCondition","*havingCondition"],IRI_REF:["havingCondition","*havingCondition"],PNAME_LN:["havingCondition","*havingCondition"],PNAME_NS:["havingCondition","*havingCondition"]},"+or([var,[ (,expression,AS,var,)]])":{"(":["or([var,[ (,expression,AS,var,)]])","*or([var,[ (,expression,AS,var,)]])"],VAR1:["or([var,[ (,expression,AS,var,)]])","*or([var,[ (,expression,AS,var,)]])"],VAR2:["or([var,[ (,expression,AS,var,)]])","*or([var,[ (,expression,AS,var,)]])"]},"+orderCondition":{ASC:["orderCondition","*orderCondition"],DESC:["orderCondition","*orderCondition"],VAR1:["orderCondition","*orderCondition"],VAR2:["orderCondition","*orderCondition"],"(":["orderCondition","*orderCondition"],STR:["orderCondition","*orderCondition"],LANG:["orderCondition","*orderCondition"],LANGMATCHES:["orderCondition","*orderCondition"],DATATYPE:["orderCondition","*orderCondition"],BOUND:["orderCondition","*orderCondition"],IRI:["orderCondition","*orderCondition"],URI:["orderCondition","*orderCondition"],BNODE:["orderCondition","*orderCondition"],RAND:["orderCondition","*orderCondition"],ABS:["orderCondition","*orderCondition"],CEIL:["orderCondition","*orderCondition"],FLOOR:["orderCondition","*orderCondition"],ROUND:["orderCondition","*orderCondition"],CONCAT:["orderCondition","*orderCondition"],STRLEN:["orderCondition","*orderCondition"],UCASE:["orderCondition","*orderCondition"],LCASE:["orderCondition","*orderCondition"],ENCODE_FOR_URI:["orderCondition","*orderCondition"],CONTAINS:["orderCondition","*orderCondition"],STRSTARTS:["orderCondition","*orderCondition"],STRENDS:["orderCondition","*orderCondition"],STRBEFORE:["orderCondition","*orderCondition"],STRAFTER:["orderCondition","*orderCondition"],YEAR:["orderCondition","*orderCondition"],MONTH:["orderCondition","*orderCondition"],DAY:["orderCondition","*orderCondition"],HOURS:["orderCondition","*orderCondition"],MINUTES:["orderCondition","*orderCondition"],SECONDS:["orderCondition","*orderCondition"],TIMEZONE:["orderCondition","*orderCondition"],TZ:["orderCondition","*orderCondition"],NOW:["orderCondition","*orderCondition"],UUID:["orderCondition","*orderCondition"],STRUUID:["orderCondition","*orderCondition"],MD5:["orderCondition","*orderCondition"],SHA1:["orderCondition","*orderCondition"],SHA256:["orderCondition","*orderCondition"],SHA384:["orderCondition","*orderCondition"],SHA512:["orderCondition","*orderCondition"],COALESCE:["orderCondition","*orderCondition"],IF:["orderCondition","*orderCondition"],STRLANG:["orderCondition","*orderCondition"],STRDT:["orderCondition","*orderCondition"],SAMETERM:["orderCondition","*orderCondition"],ISIRI:["orderCondition","*orderCondition"],ISURI:["orderCondition","*orderCondition"],ISBLANK:["orderCondition","*orderCondition"],ISLITERAL:["orderCondition","*orderCondition"],ISNUMERIC:["orderCondition","*orderCondition"],SUBSTR:["orderCondition","*orderCondition"],REPLACE:["orderCondition","*orderCondition"],REGEX:["orderCondition","*orderCondition"],EXISTS:["orderCondition","*orderCondition"],NOT:["orderCondition","*orderCondition"],IRI_REF:["orderCondition","*orderCondition"],PNAME_LN:["orderCondition","*orderCondition"],PNAME_NS:["orderCondition","*orderCondition"]},"+varOrIRIref":{VAR1:["varOrIRIref","*varOrIRIref"],VAR2:["varOrIRIref","*varOrIRIref"],IRI_REF:["varOrIRIref","*varOrIRIref"],PNAME_LN:["varOrIRIref","*varOrIRIref"],PNAME_NS:["varOrIRIref","*varOrIRIref"]},"?.":{".":["."],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?DISTINCT":{DISTINCT:["DISTINCT"],"!":[],"+":[],"-":[],VAR1:[],VAR2:[],"(":[],STR:[],LANG:[],LANGMATCHES:[],DATATYPE:[],BOUND:[],IRI:[],URI:[],BNODE:[],RAND:[],ABS:[],CEIL:[],FLOOR:[],ROUND:[],CONCAT:[],STRLEN:[],UCASE:[],LCASE:[],ENCODE_FOR_URI:[],CONTAINS:[],STRSTARTS:[],STRENDS:[],STRBEFORE:[],STRAFTER:[],YEAR:[],MONTH:[],DAY:[],HOURS:[],MINUTES:[],SECONDS:[],TIMEZONE:[],TZ:[],NOW:[],UUID:[],STRUUID:[],MD5:[],SHA1:[],SHA256:[],SHA384:[],SHA512:[],COALESCE:[],IF:[],STRLANG:[],STRDT:[],SAMETERM:[],ISIRI:[],ISURI:[],ISBLANK:[],ISLITERAL:[],ISNUMERIC:[],TRUE:[],FALSE:[],COUNT:[],SUM:[],MIN:[],MAX:[],AVG:[],SAMPLE:[],GROUP_CONCAT:[],SUBSTR:[],REPLACE:[],REGEX:[],EXISTS:[],NOT:[],IRI_REF:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],PNAME_LN:[],PNAME_NS:[],"*":[]},"?GRAPH":{GRAPH:["GRAPH"],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?SILENT":{SILENT:["SILENT"],VAR1:[],VAR2:[],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?SILENT_1":{SILENT:["SILENT"],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?SILENT_2":{SILENT:["SILENT"],GRAPH:[],DEFAULT:[],NAMED:[],ALL:[]},"?SILENT_3":{SILENT:["SILENT"],GRAPH:[]},"?SILENT_4":{SILENT:["SILENT"],DEFAULT:[],GRAPH:[],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?WHERE":{WHERE:["WHERE"],"{":[]},"?[,,expression]":{",":["[,,expression]"],")":[]},"?[.,?constructTriples]":{".":["[.,?constructTriples]"],"}":[]},"?[.,?triplesBlock]":{".":["[.,?triplesBlock]"],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?[.,?triplesTemplate]":{".":["[.,?triplesTemplate]"],"}":[],GRAPH:[]},"?[;,SEPARATOR,=,string]":{";":["[;,SEPARATOR,=,string]"],")":[]},"?[;,update]":{";":["[;,update]"],$:[]},"?[AS,var]":{AS:["[AS,var]"],")":[]},"?[INTO,graphRef]":{INTO:["[INTO,graphRef]"],";":[],$:[]},"?[or([verbPath,verbSimple]),objectList]":{VAR1:["[or([verbPath,verbSimple]),objectList]"],VAR2:["[or([verbPath,verbSimple]),objectList]"],"^":["[or([verbPath,verbSimple]),objectList]"],a:["[or([verbPath,verbSimple]),objectList]"],"!":["[or([verbPath,verbSimple]),objectList]"],"(":["[or([verbPath,verbSimple]),objectList]"],IRI_REF:["[or([verbPath,verbSimple]),objectList]"],PNAME_LN:["[or([verbPath,verbSimple]),objectList]"],PNAME_NS:["[or([verbPath,verbSimple]),objectList]"],";":[],".":[],"]":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?[pathOneInPropertySet,*[|,pathOneInPropertySet]]":{a:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],"^":["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],IRI_REF:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],PNAME_LN:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],PNAME_NS:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],")":[]},"?[update1,?[;,update]]":{INSERT:["[update1,?[;,update]]"],DELETE:["[update1,?[;,update]]"],LOAD:["[update1,?[;,update]]"],CLEAR:["[update1,?[;,update]]"],DROP:["[update1,?[;,update]]"],ADD:["[update1,?[;,update]]"],MOVE:["[update1,?[;,update]]"],COPY:["[update1,?[;,update]]"],CREATE:["[update1,?[;,update]]"],WITH:["[update1,?[;,update]]"],$:[]},"?[verb,objectList]":{a:["[verb,objectList]"],VAR1:["[verb,objectList]"],VAR2:["[verb,objectList]"],IRI_REF:["[verb,objectList]"],PNAME_LN:["[verb,objectList]"],PNAME_NS:["[verb,objectList]"],";":[],".":[],"]":[],"}":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"?argList":{NIL:["argList"],"(":["argList"],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],"+":[],"-":[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],"*":[],"/":[],";":[]},"?baseDecl":{BASE:["baseDecl"],$:[],CONSTRUCT:[],DESCRIBE:[],ASK:[],INSERT:[],DELETE:[],SELECT:[],LOAD:[],CLEAR:[],DROP:[],ADD:[],MOVE:[],COPY:[],CREATE:[],WITH:[],PREFIX:[]},"?constructTriples":{VAR1:["constructTriples"],VAR2:["constructTriples"],NIL:["constructTriples"],"(":["constructTriples"],"[":["constructTriples"],IRI_REF:["constructTriples"],TRUE:["constructTriples"],FALSE:["constructTriples"],BLANK_NODE_LABEL:["constructTriples"],ANON:["constructTriples"],PNAME_LN:["constructTriples"],PNAME_NS:["constructTriples"],STRING_LITERAL1:["constructTriples"],STRING_LITERAL2:["constructTriples"],STRING_LITERAL_LONG1:["constructTriples"],STRING_LITERAL_LONG2:["constructTriples"],INTEGER:["constructTriples"],DECIMAL:["constructTriples"],DOUBLE:["constructTriples"],INTEGER_POSITIVE:["constructTriples"],DECIMAL_POSITIVE:["constructTriples"],DOUBLE_POSITIVE:["constructTriples"],INTEGER_NEGATIVE:["constructTriples"],DECIMAL_NEGATIVE:["constructTriples"],DOUBLE_NEGATIVE:["constructTriples"],"}":[]},"?groupClause":{GROUP:["groupClause"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],HAVING:[],$:[],"}":[]},"?havingClause":{HAVING:["havingClause"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],$:[],"}":[]},"?insertClause":{INSERT:["insertClause"],WHERE:[],USING:[]},"?limitClause":{LIMIT:["limitClause"],VALUES:[],$:[],"}":[]},"?limitOffsetClauses":{LIMIT:["limitOffsetClauses"],OFFSET:["limitOffsetClauses"],VALUES:[],$:[],"}":[]},"?offsetClause":{OFFSET:["offsetClause"],VALUES:[],$:[],"}":[]},"?or([DISTINCT,REDUCED])":{DISTINCT:["or([DISTINCT,REDUCED])"],REDUCED:["or([DISTINCT,REDUCED])"],"*":[],"(":[],VAR1:[],VAR2:[]},"?or([LANGTAG,[^^,iriRef]])":{LANGTAG:["or([LANGTAG,[^^,iriRef]])"],"^^":["or([LANGTAG,[^^,iriRef]])"],UNDEF:[],IRI_REF:[],TRUE:[],FALSE:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],a:[],VAR1:[],VAR2:[],"^":[],"!":[],"(":[],".":[],";":[],",":[],AS:[],")":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],"+":[],"-":[],"*":[],"/":[],"}":[],"[":[],NIL:[],BLANK_NODE_LABEL:[],ANON:[],"]":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"?or([[*,unaryExpression],[/,unaryExpression]])":{"*":["or([[*,unaryExpression],[/,unaryExpression]])"],"/":["or([[*,unaryExpression],[/,unaryExpression]])"],"+":[],"-":[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],";":[]},"?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])":{"=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"!=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"<":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],">":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"<=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],">=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IN:["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],NOT:["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],AS:[],")":[],",":[],"||":[],"&&":[],";":[]},"?orderClause":{ORDER:["orderClause"],VALUES:[],LIMIT:[],OFFSET:[],$:[],"}":[]},"?pathMod":{"*":["pathMod"],"?":["pathMod"],"+":["pathMod"],"{":["pathMod"],"|":[],"/":[],")":[],"(":[],"[":[],VAR1:[],VAR2:[],NIL:[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},"?triplesBlock":{VAR1:["triplesBlock"],VAR2:["triplesBlock"],NIL:["triplesBlock"],"(":["triplesBlock"],"[":["triplesBlock"],IRI_REF:["triplesBlock"],TRUE:["triplesBlock"],FALSE:["triplesBlock"],BLANK_NODE_LABEL:["triplesBlock"],ANON:["triplesBlock"],PNAME_LN:["triplesBlock"],PNAME_NS:["triplesBlock"],STRING_LITERAL1:["triplesBlock"],STRING_LITERAL2:["triplesBlock"],STRING_LITERAL_LONG1:["triplesBlock"],STRING_LITERAL_LONG2:["triplesBlock"],INTEGER:["triplesBlock"],DECIMAL:["triplesBlock"],DOUBLE:["triplesBlock"],INTEGER_POSITIVE:["triplesBlock"],DECIMAL_POSITIVE:["triplesBlock"],DOUBLE_POSITIVE:["triplesBlock"],INTEGER_NEGATIVE:["triplesBlock"],DECIMAL_NEGATIVE:["triplesBlock"],DOUBLE_NEGATIVE:["triplesBlock"],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?triplesTemplate":{VAR1:["triplesTemplate"],VAR2:["triplesTemplate"],NIL:["triplesTemplate"],"(":["triplesTemplate"],"[":["triplesTemplate"],IRI_REF:["triplesTemplate"],TRUE:["triplesTemplate"],FALSE:["triplesTemplate"],BLANK_NODE_LABEL:["triplesTemplate"],ANON:["triplesTemplate"],PNAME_LN:["triplesTemplate"],PNAME_NS:["triplesTemplate"],STRING_LITERAL1:["triplesTemplate"],STRING_LITERAL2:["triplesTemplate"],STRING_LITERAL_LONG1:["triplesTemplate"],STRING_LITERAL_LONG2:["triplesTemplate"],INTEGER:["triplesTemplate"],DECIMAL:["triplesTemplate"],DOUBLE:["triplesTemplate"],INTEGER_POSITIVE:["triplesTemplate"],DECIMAL_POSITIVE:["triplesTemplate"],DOUBLE_POSITIVE:["triplesTemplate"],INTEGER_NEGATIVE:["triplesTemplate"],DECIMAL_NEGATIVE:["triplesTemplate"],DOUBLE_NEGATIVE:["triplesTemplate"],"}":[],GRAPH:[]},"?whereClause":{WHERE:["whereClause"],"{":["whereClause"],ORDER:[],HAVING:[],GROUP:[],LIMIT:[],OFFSET:[],VALUES:[],$:[]},"[ (,*dataBlockValue,)]":{"(":["(","*dataBlockValue",")"]},"[ (,*var,)]":{"(":["(","*var",")"]},"[ (,expression,)]":{"(":["(","expression",")"]},"[ (,expression,AS,var,)]":{"(":["(","expression","AS","var",")"]},"[!=,numericExpression]":{"!=":["!=","numericExpression"]},"[&&,valueLogical]":{"&&":["&&","valueLogical"]},"[*,unaryExpression]":{"*":["*","unaryExpression"]},"[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]":{WHERE:["*datasetClause","WHERE","{","?triplesTemplate","}","solutionModifier"],FROM:["*datasetClause","WHERE","{","?triplesTemplate","}","solutionModifier"]},"[+,multiplicativeExpression]":{"+":["+","multiplicativeExpression"]},"[,,expression]":{",":[",","expression"]},"[,,integer,}]":{",":[",","integer","}"]},"[,,objectPath]":{",":[",","objectPath"]},"[,,object]":{",":[",","object"]},"[,,or([},[integer,}]])]":{",":[",","or([},[integer,}]])"]},"[-,multiplicativeExpression]":{"-":["-","multiplicativeExpression"]},"[.,?constructTriples]":{".":[".","?constructTriples"]},"[.,?triplesBlock]":{".":[".","?triplesBlock"]},"[.,?triplesTemplate]":{".":[".","?triplesTemplate"]},"[/,pathEltOrInverse]":{"/":["/","pathEltOrInverse"]},"[/,unaryExpression]":{"/":["/","unaryExpression"]},"[;,?[or([verbPath,verbSimple]),objectList]]":{";":[";","?[or([verbPath,verbSimple]),objectList]"]},"[;,?[verb,objectList]]":{";":[";","?[verb,objectList]"]},"[;,SEPARATOR,=,string]":{";":[";","SEPARATOR","=","string"]},"[;,update]":{";":[";","update"]},"[<,numericExpression]":{"<":["<","numericExpression"]},"[<=,numericExpression]":{"<=":["<=","numericExpression"]},"[=,numericExpression]":{"=":["=","numericExpression"]},"[>,numericExpression]":{">":[">","numericExpression"]},"[>=,numericExpression]":{">=":[">=","numericExpression"]},"[AS,var]":{AS:["AS","var"]},"[IN,expressionList]":{IN:["IN","expressionList"]},"[INTO,graphRef]":{INTO:["INTO","graphRef"]},"[NAMED,iriRef]":{NAMED:["NAMED","iriRef"]},"[NOT,IN,expressionList]":{NOT:["NOT","IN","expressionList"]},"[UNION,groupGraphPattern]":{UNION:["UNION","groupGraphPattern"]},"[^^,iriRef]":{"^^":["^^","iriRef"]},"[constructTemplate,*datasetClause,whereClause,solutionModifier]":{"{":["constructTemplate","*datasetClause","whereClause","solutionModifier"]},"[deleteClause,?insertClause]":{DELETE:["deleteClause","?insertClause"]},"[graphPatternNotTriples,?.,?triplesBlock]":{"{":["graphPatternNotTriples","?.","?triplesBlock"],OPTIONAL:["graphPatternNotTriples","?.","?triplesBlock"],MINUS:["graphPatternNotTriples","?.","?triplesBlock"],GRAPH:["graphPatternNotTriples","?.","?triplesBlock"],SERVICE:["graphPatternNotTriples","?.","?triplesBlock"],FILTER:["graphPatternNotTriples","?.","?triplesBlock"],BIND:["graphPatternNotTriples","?.","?triplesBlock"],VALUES:["graphPatternNotTriples","?.","?triplesBlock"]},"[integer,or([[,,or([},[integer,}]])],}])]":{INTEGER:["integer","or([[,,or([},[integer,}]])],}])"]},"[integer,}]":{INTEGER:["integer","}"]},"[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]":{INTEGER_POSITIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_POSITIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_POSITIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER_NEGATIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_NEGATIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_NEGATIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"]},"[or([verbPath,verbSimple]),objectList]":{VAR1:["or([verbPath,verbSimple])","objectList"],VAR2:["or([verbPath,verbSimple])","objectList"],"^":["or([verbPath,verbSimple])","objectList"],a:["or([verbPath,verbSimple])","objectList"],"!":["or([verbPath,verbSimple])","objectList"],"(":["or([verbPath,verbSimple])","objectList"],IRI_REF:["or([verbPath,verbSimple])","objectList"],PNAME_LN:["or([verbPath,verbSimple])","objectList"],PNAME_NS:["or([verbPath,verbSimple])","objectList"]},"[pathOneInPropertySet,*[|,pathOneInPropertySet]]":{a:["pathOneInPropertySet","*[|,pathOneInPropertySet]"],"^":["pathOneInPropertySet","*[|,pathOneInPropertySet]"],IRI_REF:["pathOneInPropertySet","*[|,pathOneInPropertySet]"],PNAME_LN:["pathOneInPropertySet","*[|,pathOneInPropertySet]"],PNAME_NS:["pathOneInPropertySet","*[|,pathOneInPropertySet]"]},"[quadsNotTriples,?.,?triplesTemplate]":{GRAPH:["quadsNotTriples","?.","?triplesTemplate"]},"[update1,?[;,update]]":{INSERT:["update1","?[;,update]"],DELETE:["update1","?[;,update]"],LOAD:["update1","?[;,update]"],CLEAR:["update1","?[;,update]"],DROP:["update1","?[;,update]"],ADD:["update1","?[;,update]"],MOVE:["update1","?[;,update]"],COPY:["update1","?[;,update]"],CREATE:["update1","?[;,update]"],WITH:["update1","?[;,update]"]},"[verb,objectList]":{a:["verb","objectList"],VAR1:["verb","objectList"],VAR2:["verb","objectList"],IRI_REF:["verb","objectList"],PNAME_LN:["verb","objectList"],PNAME_NS:["verb","objectList"]},"[|,pathOneInPropertySet]":{"|":["|","pathOneInPropertySet"]},"[|,pathSequence]":{"|":["|","pathSequence"]},"[||,conditionalAndExpression]":{"||":["||","conditionalAndExpression"]},add:{ADD:["ADD","?SILENT_4","graphOrDefault","TO","graphOrDefault"]},additiveExpression:{"!":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"+":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"-":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],VAR1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],VAR2:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"(":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],LANG:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],LANGMATCHES:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DATATYPE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],BOUND:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],IRI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],URI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],BNODE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],RAND:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ABS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],CEIL:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],FLOOR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ROUND:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],CONCAT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRLEN:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],UCASE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],LCASE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ENCODE_FOR_URI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],CONTAINS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRSTARTS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRENDS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRBEFORE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRAFTER:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],YEAR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MONTH:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DAY:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],HOURS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MINUTES:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SECONDS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],TIMEZONE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],TZ:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],NOW:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],UUID:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRUUID:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MD5:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA256:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA384:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA512:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],COALESCE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],IF:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRLANG:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRDT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SAMETERM:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISIRI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISURI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISBLANK:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISLITERAL:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISNUMERIC:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],TRUE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],FALSE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],COUNT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SUM:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MIN:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MAX:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],AVG:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SAMPLE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],GROUP_CONCAT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SUBSTR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],REPLACE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],REGEX:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],EXISTS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],NOT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],IRI_REF:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL2:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL_LONG1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL_LONG2:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_POSITIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_POSITIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_POSITIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_NEGATIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_NEGATIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_NEGATIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],PNAME_LN:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],PNAME_NS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"]},aggregate:{COUNT:["COUNT","(","?DISTINCT","or([*,expression])",")"],SUM:["SUM","(","?DISTINCT","expression",")"],MIN:["MIN","(","?DISTINCT","expression",")"],MAX:["MAX","(","?DISTINCT","expression",")"],AVG:["AVG","(","?DISTINCT","expression",")"],SAMPLE:["SAMPLE","(","?DISTINCT","expression",")"],GROUP_CONCAT:["GROUP_CONCAT","(","?DISTINCT","expression","?[;,SEPARATOR,=,string]",")"]},allowBnodes:{"}":[]},allowVars:{"}":[]},argList:{NIL:["NIL"],"(":["(","?DISTINCT","expression","*[,,expression]",")"]},askQuery:{ASK:["ASK","*datasetClause","whereClause","solutionModifier"]},baseDecl:{BASE:["BASE","IRI_REF"]},bind:{BIND:["BIND","(","expression","AS","var",")"]},blankNode:{BLANK_NODE_LABEL:["BLANK_NODE_LABEL"],ANON:["ANON"]},blankNodePropertyList:{"[":["[","propertyListNotEmpty","]"]},blankNodePropertyListPath:{"[":["[","propertyListPathNotEmpty","]"]},booleanLiteral:{TRUE:["TRUE"],FALSE:["FALSE"]},brackettedExpression:{"(":["(","expression",")"]},builtInCall:{STR:["STR","(","expression",")"],LANG:["LANG","(","expression",")"],LANGMATCHES:["LANGMATCHES","(","expression",",","expression",")"],DATATYPE:["DATATYPE","(","expression",")"],BOUND:["BOUND","(","var",")"],IRI:["IRI","(","expression",")"],URI:["URI","(","expression",")"],BNODE:["BNODE","or([[ (,expression,)],NIL])"],RAND:["RAND","NIL"],ABS:["ABS","(","expression",")"],CEIL:["CEIL","(","expression",")"],FLOOR:["FLOOR","(","expression",")"],ROUND:["ROUND","(","expression",")"],CONCAT:["CONCAT","expressionList"],SUBSTR:["substringExpression"],STRLEN:["STRLEN","(","expression",")"],REPLACE:["strReplaceExpression"],UCASE:["UCASE","(","expression",")"],LCASE:["LCASE","(","expression",")"],ENCODE_FOR_URI:["ENCODE_FOR_URI","(","expression",")"],CONTAINS:["CONTAINS","(","expression",",","expression",")"],STRSTARTS:["STRSTARTS","(","expression",",","expression",")"],STRENDS:["STRENDS","(","expression",",","expression",")"],STRBEFORE:["STRBEFORE","(","expression",",","expression",")"],STRAFTER:["STRAFTER","(","expression",",","expression",")"],YEAR:["YEAR","(","expression",")"],MONTH:["MONTH","(","expression",")"],DAY:["DAY","(","expression",")"],HOURS:["HOURS","(","expression",")"],MINUTES:["MINUTES","(","expression",")"],SECONDS:["SECONDS","(","expression",")"],TIMEZONE:["TIMEZONE","(","expression",")"],TZ:["TZ","(","expression",")"],NOW:["NOW","NIL"],UUID:["UUID","NIL"],STRUUID:["STRUUID","NIL"],MD5:["MD5","(","expression",")"],SHA1:["SHA1","(","expression",")"],SHA256:["SHA256","(","expression",")"],SHA384:["SHA384","(","expression",")"],SHA512:["SHA512","(","expression",")"],COALESCE:["COALESCE","expressionList"],IF:["IF","(","expression",",","expression",",","expression",")"],STRLANG:["STRLANG","(","expression",",","expression",")"],STRDT:["STRDT","(","expression",",","expression",")"],SAMETERM:["SAMETERM","(","expression",",","expression",")"],ISIRI:["ISIRI","(","expression",")"],ISURI:["ISURI","(","expression",")"],ISBLANK:["ISBLANK","(","expression",")"],ISLITERAL:["ISLITERAL","(","expression",")"],ISNUMERIC:["ISNUMERIC","(","expression",")"],REGEX:["regexExpression"],EXISTS:["existsFunc"],NOT:["notExistsFunc"]},clear:{CLEAR:["CLEAR","?SILENT_2","graphRefAll"]},collection:{"(":["(","+graphNode",")"]},collectionPath:{"(":["(","+graphNodePath",")"]},conditionalAndExpression:{"!":["valueLogical","*[&&,valueLogical]"],"+":["valueLogical","*[&&,valueLogical]"],"-":["valueLogical","*[&&,valueLogical]"],VAR1:["valueLogical","*[&&,valueLogical]"],VAR2:["valueLogical","*[&&,valueLogical]"],"(":["valueLogical","*[&&,valueLogical]"],STR:["valueLogical","*[&&,valueLogical]"],LANG:["valueLogical","*[&&,valueLogical]"],LANGMATCHES:["valueLogical","*[&&,valueLogical]"],DATATYPE:["valueLogical","*[&&,valueLogical]"],BOUND:["valueLogical","*[&&,valueLogical]"],IRI:["valueLogical","*[&&,valueLogical]"],URI:["valueLogical","*[&&,valueLogical]"],BNODE:["valueLogical","*[&&,valueLogical]"],RAND:["valueLogical","*[&&,valueLogical]"],ABS:["valueLogical","*[&&,valueLogical]"],CEIL:["valueLogical","*[&&,valueLogical]"],FLOOR:["valueLogical","*[&&,valueLogical]"],ROUND:["valueLogical","*[&&,valueLogical]"],CONCAT:["valueLogical","*[&&,valueLogical]"],STRLEN:["valueLogical","*[&&,valueLogical]"],UCASE:["valueLogical","*[&&,valueLogical]"],LCASE:["valueLogical","*[&&,valueLogical]"],ENCODE_FOR_URI:["valueLogical","*[&&,valueLogical]"],CONTAINS:["valueLogical","*[&&,valueLogical]"],STRSTARTS:["valueLogical","*[&&,valueLogical]"],STRENDS:["valueLogical","*[&&,valueLogical]"],STRBEFORE:["valueLogical","*[&&,valueLogical]"],STRAFTER:["valueLogical","*[&&,valueLogical]"],YEAR:["valueLogical","*[&&,valueLogical]"],MONTH:["valueLogical","*[&&,valueLogical]"],DAY:["valueLogical","*[&&,valueLogical]"],HOURS:["valueLogical","*[&&,valueLogical]"],MINUTES:["valueLogical","*[&&,valueLogical]"],SECONDS:["valueLogical","*[&&,valueLogical]"],TIMEZONE:["valueLogical","*[&&,valueLogical]"],TZ:["valueLogical","*[&&,valueLogical]"],NOW:["valueLogical","*[&&,valueLogical]"],UUID:["valueLogical","*[&&,valueLogical]"],STRUUID:["valueLogical","*[&&,valueLogical]"],MD5:["valueLogical","*[&&,valueLogical]"],SHA1:["valueLogical","*[&&,valueLogical]"],SHA256:["valueLogical","*[&&,valueLogical]"],SHA384:["valueLogical","*[&&,valueLogical]"],SHA512:["valueLogical","*[&&,valueLogical]"],COALESCE:["valueLogical","*[&&,valueLogical]"],IF:["valueLogical","*[&&,valueLogical]"],STRLANG:["valueLogical","*[&&,valueLogical]"],STRDT:["valueLogical","*[&&,valueLogical]"],SAMETERM:["valueLogical","*[&&,valueLogical]"],ISIRI:["valueLogical","*[&&,valueLogical]"],ISURI:["valueLogical","*[&&,valueLogical]"],ISBLANK:["valueLogical","*[&&,valueLogical]"],ISLITERAL:["valueLogical","*[&&,valueLogical]"],ISNUMERIC:["valueLogical","*[&&,valueLogical]"],TRUE:["valueLogical","*[&&,valueLogical]"],FALSE:["valueLogical","*[&&,valueLogical]"],COUNT:["valueLogical","*[&&,valueLogical]"],SUM:["valueLogical","*[&&,valueLogical]"],MIN:["valueLogical","*[&&,valueLogical]"],MAX:["valueLogical","*[&&,valueLogical]"],AVG:["valueLogical","*[&&,valueLogical]"],SAMPLE:["valueLogical","*[&&,valueLogical]"],GROUP_CONCAT:["valueLogical","*[&&,valueLogical]"],SUBSTR:["valueLogical","*[&&,valueLogical]"],REPLACE:["valueLogical","*[&&,valueLogical]"],REGEX:["valueLogical","*[&&,valueLogical]"],EXISTS:["valueLogical","*[&&,valueLogical]"],NOT:["valueLogical","*[&&,valueLogical]"],IRI_REF:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL1:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL2:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL_LONG1:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL_LONG2:["valueLogical","*[&&,valueLogical]"],INTEGER:["valueLogical","*[&&,valueLogical]"],DECIMAL:["valueLogical","*[&&,valueLogical]"],DOUBLE:["valueLogical","*[&&,valueLogical]"],INTEGER_POSITIVE:["valueLogical","*[&&,valueLogical]"],DECIMAL_POSITIVE:["valueLogical","*[&&,valueLogical]"],DOUBLE_POSITIVE:["valueLogical","*[&&,valueLogical]"],INTEGER_NEGATIVE:["valueLogical","*[&&,valueLogical]"],DECIMAL_NEGATIVE:["valueLogical","*[&&,valueLogical]"],DOUBLE_NEGATIVE:["valueLogical","*[&&,valueLogical]"],PNAME_LN:["valueLogical","*[&&,valueLogical]"],PNAME_NS:["valueLogical","*[&&,valueLogical]"]},conditionalOrExpression:{"!":["conditionalAndExpression","*[||,conditionalAndExpression]"],"+":["conditionalAndExpression","*[||,conditionalAndExpression]"],"-":["conditionalAndExpression","*[||,conditionalAndExpression]"],VAR1:["conditionalAndExpression","*[||,conditionalAndExpression]"],VAR2:["conditionalAndExpression","*[||,conditionalAndExpression]"],"(":["conditionalAndExpression","*[||,conditionalAndExpression]"],STR:["conditionalAndExpression","*[||,conditionalAndExpression]"],LANG:["conditionalAndExpression","*[||,conditionalAndExpression]"],LANGMATCHES:["conditionalAndExpression","*[||,conditionalAndExpression]"],DATATYPE:["conditionalAndExpression","*[||,conditionalAndExpression]"],BOUND:["conditionalAndExpression","*[||,conditionalAndExpression]"],IRI:["conditionalAndExpression","*[||,conditionalAndExpression]"],URI:["conditionalAndExpression","*[||,conditionalAndExpression]"],BNODE:["conditionalAndExpression","*[||,conditionalAndExpression]"],RAND:["conditionalAndExpression","*[||,conditionalAndExpression]"],ABS:["conditionalAndExpression","*[||,conditionalAndExpression]"],CEIL:["conditionalAndExpression","*[||,conditionalAndExpression]"],FLOOR:["conditionalAndExpression","*[||,conditionalAndExpression]"],ROUND:["conditionalAndExpression","*[||,conditionalAndExpression]"],CONCAT:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRLEN:["conditionalAndExpression","*[||,conditionalAndExpression]"],UCASE:["conditionalAndExpression","*[||,conditionalAndExpression]"],LCASE:["conditionalAndExpression","*[||,conditionalAndExpression]"],ENCODE_FOR_URI:["conditionalAndExpression","*[||,conditionalAndExpression]"],CONTAINS:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRSTARTS:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRENDS:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRBEFORE:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRAFTER:["conditionalAndExpression","*[||,conditionalAndExpression]"],YEAR:["conditionalAndExpression","*[||,conditionalAndExpression]"],MONTH:["conditionalAndExpression","*[||,conditionalAndExpression]"],DAY:["conditionalAndExpression","*[||,conditionalAndExpression]"],HOURS:["conditionalAndExpression","*[||,conditionalAndExpression]"],MINUTES:["conditionalAndExpression","*[||,conditionalAndExpression]"],SECONDS:["conditionalAndExpression","*[||,conditionalAndExpression]"],TIMEZONE:["conditionalAndExpression","*[||,conditionalAndExpression]"],TZ:["conditionalAndExpression","*[||,conditionalAndExpression]"],NOW:["conditionalAndExpression","*[||,conditionalAndExpression]"],UUID:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRUUID:["conditionalAndExpression","*[||,conditionalAndExpression]"],MD5:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA1:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA256:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA384:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA512:["conditionalAndExpression","*[||,conditionalAndExpression]"],COALESCE:["conditionalAndExpression","*[||,conditionalAndExpression]"],IF:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRLANG:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRDT:["conditionalAndExpression","*[||,conditionalAndExpression]"],SAMETERM:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISIRI:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISURI:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISBLANK:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISLITERAL:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISNUMERIC:["conditionalAndExpression","*[||,conditionalAndExpression]"],TRUE:["conditionalAndExpression","*[||,conditionalAndExpression]"],FALSE:["conditionalAndExpression","*[||,conditionalAndExpression]"],COUNT:["conditionalAndExpression","*[||,conditionalAndExpression]"],SUM:["conditionalAndExpression","*[||,conditionalAndExpression]"],MIN:["conditionalAndExpression","*[||,conditionalAndExpression]"],MAX:["conditionalAndExpression","*[||,conditionalAndExpression]"],AVG:["conditionalAndExpression","*[||,conditionalAndExpression]"],SAMPLE:["conditionalAndExpression","*[||,conditionalAndExpression]"],GROUP_CONCAT:["conditionalAndExpression","*[||,conditionalAndExpression]"],SUBSTR:["conditionalAndExpression","*[||,conditionalAndExpression]"],REPLACE:["conditionalAndExpression","*[||,conditionalAndExpression]"],REGEX:["conditionalAndExpression","*[||,conditionalAndExpression]"],EXISTS:["conditionalAndExpression","*[||,conditionalAndExpression]"],NOT:["conditionalAndExpression","*[||,conditionalAndExpression]"],IRI_REF:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL1:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL2:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL_LONG1:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL_LONG2:["conditionalAndExpression","*[||,conditionalAndExpression]"],INTEGER:["conditionalAndExpression","*[||,conditionalAndExpression]"],DECIMAL:["conditionalAndExpression","*[||,conditionalAndExpression]"],DOUBLE:["conditionalAndExpression","*[||,conditionalAndExpression]"],INTEGER_POSITIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DECIMAL_POSITIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DOUBLE_POSITIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],INTEGER_NEGATIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DECIMAL_NEGATIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DOUBLE_NEGATIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],PNAME_LN:["conditionalAndExpression","*[||,conditionalAndExpression]"],PNAME_NS:["conditionalAndExpression","*[||,conditionalAndExpression]"]},constraint:{"(":["brackettedExpression"],STR:["builtInCall"],LANG:["builtInCall"],LANGMATCHES:["builtInCall"],DATATYPE:["builtInCall"],BOUND:["builtInCall"],IRI:["builtInCall"],URI:["builtInCall"],BNODE:["builtInCall"],RAND:["builtInCall"],ABS:["builtInCall"],CEIL:["builtInCall"],FLOOR:["builtInCall"],ROUND:["builtInCall"],CONCAT:["builtInCall"],STRLEN:["builtInCall"],UCASE:["builtInCall"],LCASE:["builtInCall"],ENCODE_FOR_URI:["builtInCall"],CONTAINS:["builtInCall"],STRSTARTS:["builtInCall"],STRENDS:["builtInCall"],STRBEFORE:["builtInCall"],STRAFTER:["builtInCall"],YEAR:["builtInCall"],MONTH:["builtInCall"],DAY:["builtInCall"],HOURS:["builtInCall"],MINUTES:["builtInCall"],SECONDS:["builtInCall"],TIMEZONE:["builtInCall"],TZ:["builtInCall"],NOW:["builtInCall"],UUID:["builtInCall"],STRUUID:["builtInCall"],MD5:["builtInCall"],SHA1:["builtInCall"],SHA256:["builtInCall"],SHA384:["builtInCall"],SHA512:["builtInCall"],COALESCE:["builtInCall"],IF:["builtInCall"],STRLANG:["builtInCall"],STRDT:["builtInCall"],SAMETERM:["builtInCall"],ISIRI:["builtInCall"],ISURI:["builtInCall"],ISBLANK:["builtInCall"],ISLITERAL:["builtInCall"],ISNUMERIC:["builtInCall"],SUBSTR:["builtInCall"],REPLACE:["builtInCall"],REGEX:["builtInCall"],EXISTS:["builtInCall"],NOT:["builtInCall"],IRI_REF:["functionCall"],PNAME_LN:["functionCall"],PNAME_NS:["functionCall"]},constructQuery:{CONSTRUCT:["CONSTRUCT","or([[constructTemplate,*datasetClause,whereClause,solutionModifier],[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]])"]},constructTemplate:{"{":["{","?constructTriples","}"]},constructTriples:{VAR1:["triplesSameSubject","?[.,?constructTriples]"],VAR2:["triplesSameSubject","?[.,?constructTriples]"],NIL:["triplesSameSubject","?[.,?constructTriples]"],"(":["triplesSameSubject","?[.,?constructTriples]"],"[":["triplesSameSubject","?[.,?constructTriples]"],IRI_REF:["triplesSameSubject","?[.,?constructTriples]"],TRUE:["triplesSameSubject","?[.,?constructTriples]"],FALSE:["triplesSameSubject","?[.,?constructTriples]"],BLANK_NODE_LABEL:["triplesSameSubject","?[.,?constructTriples]"],ANON:["triplesSameSubject","?[.,?constructTriples]"],PNAME_LN:["triplesSameSubject","?[.,?constructTriples]"],PNAME_NS:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL1:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL2:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL_LONG1:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL_LONG2:["triplesSameSubject","?[.,?constructTriples]"],INTEGER:["triplesSameSubject","?[.,?constructTriples]"],DECIMAL:["triplesSameSubject","?[.,?constructTriples]"],DOUBLE:["triplesSameSubject","?[.,?constructTriples]"],INTEGER_POSITIVE:["triplesSameSubject","?[.,?constructTriples]"],DECIMAL_POSITIVE:["triplesSameSubject","?[.,?constructTriples]"],DOUBLE_POSITIVE:["triplesSameSubject","?[.,?constructTriples]"],INTEGER_NEGATIVE:["triplesSameSubject","?[.,?constructTriples]"],DECIMAL_NEGATIVE:["triplesSameSubject","?[.,?constructTriples]"],DOUBLE_NEGATIVE:["triplesSameSubject","?[.,?constructTriples]"]},copy:{COPY:["COPY","?SILENT_4","graphOrDefault","TO","graphOrDefault"]},create:{CREATE:["CREATE","?SILENT_3","graphRef"]},dataBlock:{NIL:["or([inlineDataOneVar,inlineDataFull])"],"(":["or([inlineDataOneVar,inlineDataFull])"],VAR1:["or([inlineDataOneVar,inlineDataFull])"],VAR2:["or([inlineDataOneVar,inlineDataFull])"]},dataBlockValue:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],STRING_LITERAL1:["rdfLiteral"],STRING_LITERAL2:["rdfLiteral"],STRING_LITERAL_LONG1:["rdfLiteral"],STRING_LITERAL_LONG2:["rdfLiteral"],INTEGER:["numericLiteral"],DECIMAL:["numericLiteral"],DOUBLE:["numericLiteral"],INTEGER_POSITIVE:["numericLiteral"],DECIMAL_POSITIVE:["numericLiteral"],DOUBLE_POSITIVE:["numericLiteral"],INTEGER_NEGATIVE:["numericLiteral"],DECIMAL_NEGATIVE:["numericLiteral"],DOUBLE_NEGATIVE:["numericLiteral"],TRUE:["booleanLiteral"],FALSE:["booleanLiteral"],UNDEF:["UNDEF"]},datasetClause:{FROM:["FROM","or([defaultGraphClause,namedGraphClause])"]},defaultGraphClause:{IRI_REF:["sourceSelector"],PNAME_LN:["sourceSelector"],PNAME_NS:["sourceSelector"]},delete1:{DATA:["DATA","quadDataNoBnodes"],WHERE:["WHERE","quadPatternNoBnodes"],"{":["quadPatternNoBnodes","?insertClause","*usingClause","WHERE","groupGraphPattern"]},deleteClause:{DELETE:["DELETE","quadPattern"]},describeDatasetClause:{FROM:["FROM","or([defaultGraphClause,namedGraphClause])"]},describeQuery:{DESCRIBE:["DESCRIBE","or([+varOrIRIref,*])","*describeDatasetClause","?whereClause","solutionModifier"]},disallowBnodes:{"}":[],GRAPH:[],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},disallowVars:{"}":[],GRAPH:[],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},drop:{DROP:["DROP","?SILENT_2","graphRefAll"]},existsFunc:{EXISTS:["EXISTS","groupGraphPattern"]},expression:{"!":["conditionalOrExpression"],"+":["conditionalOrExpression"],"-":["conditionalOrExpression"],VAR1:["conditionalOrExpression"],VAR2:["conditionalOrExpression"],"(":["conditionalOrExpression"],STR:["conditionalOrExpression"],LANG:["conditionalOrExpression"],LANGMATCHES:["conditionalOrExpression"],DATATYPE:["conditionalOrExpression"],BOUND:["conditionalOrExpression"],IRI:["conditionalOrExpression"],URI:["conditionalOrExpression"],BNODE:["conditionalOrExpression"],RAND:["conditionalOrExpression"],ABS:["conditionalOrExpression"],CEIL:["conditionalOrExpression"],FLOOR:["conditionalOrExpression"],ROUND:["conditionalOrExpression"],CONCAT:["conditionalOrExpression"],STRLEN:["conditionalOrExpression"],UCASE:["conditionalOrExpression"],LCASE:["conditionalOrExpression"],ENCODE_FOR_URI:["conditionalOrExpression"],CONTAINS:["conditionalOrExpression"],STRSTARTS:["conditionalOrExpression"],STRENDS:["conditionalOrExpression"],STRBEFORE:["conditionalOrExpression"],STRAFTER:["conditionalOrExpression"],YEAR:["conditionalOrExpression"],MONTH:["conditionalOrExpression"],DAY:["conditionalOrExpression"],HOURS:["conditionalOrExpression"],MINUTES:["conditionalOrExpression"],SECONDS:["conditionalOrExpression"],TIMEZONE:["conditionalOrExpression"],TZ:["conditionalOrExpression"],NOW:["conditionalOrExpression"],UUID:["conditionalOrExpression"],STRUUID:["conditionalOrExpression"],MD5:["conditionalOrExpression"],SHA1:["conditionalOrExpression"],SHA256:["conditionalOrExpression"],SHA384:["conditionalOrExpression"],SHA512:["conditionalOrExpression"],COALESCE:["conditionalOrExpression"],IF:["conditionalOrExpression"],STRLANG:["conditionalOrExpression"],STRDT:["conditionalOrExpression"],SAMETERM:["conditionalOrExpression"],ISIRI:["conditionalOrExpression"],ISURI:["conditionalOrExpression"],ISBLANK:["conditionalOrExpression"],ISLITERAL:["conditionalOrExpression"],ISNUMERIC:["conditionalOrExpression"],TRUE:["conditionalOrExpression"],FALSE:["conditionalOrExpression"],COUNT:["conditionalOrExpression"],SUM:["conditionalOrExpression"],MIN:["conditionalOrExpression"],MAX:["conditionalOrExpression"],AVG:["conditionalOrExpression"],SAMPLE:["conditionalOrExpression"],GROUP_CONCAT:["conditionalOrExpression"],SUBSTR:["conditionalOrExpression"],REPLACE:["conditionalOrExpression"],REGEX:["conditionalOrExpression"],EXISTS:["conditionalOrExpression"],NOT:["conditionalOrExpression"],IRI_REF:["conditionalOrExpression"],STRING_LITERAL1:["conditionalOrExpression"],STRING_LITERAL2:["conditionalOrExpression"],STRING_LITERAL_LONG1:["conditionalOrExpression"],STRING_LITERAL_LONG2:["conditionalOrExpression"],INTEGER:["conditionalOrExpression"],DECIMAL:["conditionalOrExpression"],DOUBLE:["conditionalOrExpression"],INTEGER_POSITIVE:["conditionalOrExpression"],DECIMAL_POSITIVE:["conditionalOrExpression"],DOUBLE_POSITIVE:["conditionalOrExpression"],INTEGER_NEGATIVE:["conditionalOrExpression"],DECIMAL_NEGATIVE:["conditionalOrExpression"],DOUBLE_NEGATIVE:["conditionalOrExpression"],PNAME_LN:["conditionalOrExpression"],PNAME_NS:["conditionalOrExpression"]},expressionList:{NIL:["NIL"],"(":["(","expression","*[,,expression]",")"]},filter:{FILTER:["FILTER","constraint"]},functionCall:{IRI_REF:["iriRef","argList"],PNAME_LN:["iriRef","argList"],PNAME_NS:["iriRef","argList"]},graphGraphPattern:{GRAPH:["GRAPH","varOrIRIref","groupGraphPattern"]},graphNode:{VAR1:["varOrTerm"],VAR2:["varOrTerm"],NIL:["varOrTerm"],IRI_REF:["varOrTerm"],TRUE:["varOrTerm"],FALSE:["varOrTerm"],BLANK_NODE_LABEL:["varOrTerm"],ANON:["varOrTerm"],PNAME_LN:["varOrTerm"],PNAME_NS:["varOrTerm"],STRING_LITERAL1:["varOrTerm"],STRING_LITERAL2:["varOrTerm"],STRING_LITERAL_LONG1:["varOrTerm"],STRING_LITERAL_LONG2:["varOrTerm"],INTEGER:["varOrTerm"],DECIMAL:["varOrTerm"],DOUBLE:["varOrTerm"],INTEGER_POSITIVE:["varOrTerm"],DECIMAL_POSITIVE:["varOrTerm"],DOUBLE_POSITIVE:["varOrTerm"],INTEGER_NEGATIVE:["varOrTerm"],DECIMAL_NEGATIVE:["varOrTerm"],DOUBLE_NEGATIVE:["varOrTerm"],"(":["triplesNode"],"[":["triplesNode"]},graphNodePath:{VAR1:["varOrTerm"],VAR2:["varOrTerm"],NIL:["varOrTerm"],IRI_REF:["varOrTerm"],TRUE:["varOrTerm"],FALSE:["varOrTerm"],BLANK_NODE_LABEL:["varOrTerm"],ANON:["varOrTerm"],PNAME_LN:["varOrTerm"],PNAME_NS:["varOrTerm"],STRING_LITERAL1:["varOrTerm"],STRING_LITERAL2:["varOrTerm"],STRING_LITERAL_LONG1:["varOrTerm"],STRING_LITERAL_LONG2:["varOrTerm"],INTEGER:["varOrTerm"],DECIMAL:["varOrTerm"],DOUBLE:["varOrTerm"],INTEGER_POSITIVE:["varOrTerm"],DECIMAL_POSITIVE:["varOrTerm"],DOUBLE_POSITIVE:["varOrTerm"],INTEGER_NEGATIVE:["varOrTerm"],DECIMAL_NEGATIVE:["varOrTerm"],DOUBLE_NEGATIVE:["varOrTerm"],"(":["triplesNodePath"],"[":["triplesNodePath"]},graphOrDefault:{DEFAULT:["DEFAULT"],IRI_REF:["?GRAPH","iriRef"],PNAME_LN:["?GRAPH","iriRef"],PNAME_NS:["?GRAPH","iriRef"],GRAPH:["?GRAPH","iriRef"]},graphPatternNotTriples:{"{":["groupOrUnionGraphPattern"],OPTIONAL:["optionalGraphPattern"],MINUS:["minusGraphPattern"],GRAPH:["graphGraphPattern"],SERVICE:["serviceGraphPattern"],FILTER:["filter"],BIND:["bind"],VALUES:["inlineData"]},graphRef:{GRAPH:["GRAPH","iriRef"]},graphRefAll:{GRAPH:["graphRef"],DEFAULT:["DEFAULT"],NAMED:["NAMED"],ALL:["ALL"]},graphTerm:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],STRING_LITERAL1:["rdfLiteral"],STRING_LITERAL2:["rdfLiteral"],STRING_LITERAL_LONG1:["rdfLiteral"],STRING_LITERAL_LONG2:["rdfLiteral"],INTEGER:["numericLiteral"],DECIMAL:["numericLiteral"],DOUBLE:["numericLiteral"],INTEGER_POSITIVE:["numericLiteral"],DECIMAL_POSITIVE:["numericLiteral"],DOUBLE_POSITIVE:["numericLiteral"],INTEGER_NEGATIVE:["numericLiteral"],DECIMAL_NEGATIVE:["numericLiteral"],DOUBLE_NEGATIVE:["numericLiteral"],TRUE:["booleanLiteral"],FALSE:["booleanLiteral"],BLANK_NODE_LABEL:["blankNode"],ANON:["blankNode"],NIL:["NIL"]},groupClause:{GROUP:["GROUP","BY","+groupCondition"]},groupCondition:{STR:["builtInCall"],LANG:["builtInCall"],LANGMATCHES:["builtInCall"],DATATYPE:["builtInCall"],BOUND:["builtInCall"],IRI:["builtInCall"],URI:["builtInCall"],BNODE:["builtInCall"],RAND:["builtInCall"],ABS:["builtInCall"],CEIL:["builtInCall"],FLOOR:["builtInCall"],ROUND:["builtInCall"],CONCAT:["builtInCall"],STRLEN:["builtInCall"],UCASE:["builtInCall"],LCASE:["builtInCall"],ENCODE_FOR_URI:["builtInCall"],CONTAINS:["builtInCall"],STRSTARTS:["builtInCall"],STRENDS:["builtInCall"],STRBEFORE:["builtInCall"],STRAFTER:["builtInCall"],YEAR:["builtInCall"],MONTH:["builtInCall"],DAY:["builtInCall"],HOURS:["builtInCall"],MINUTES:["builtInCall"],SECONDS:["builtInCall"],TIMEZONE:["builtInCall"],TZ:["builtInCall"],NOW:["builtInCall"],UUID:["builtInCall"],STRUUID:["builtInCall"],MD5:["builtInCall"],SHA1:["builtInCall"],SHA256:["builtInCall"],SHA384:["builtInCall"],SHA512:["builtInCall"],COALESCE:["builtInCall"],IF:["builtInCall"],STRLANG:["builtInCall"],STRDT:["builtInCall"],SAMETERM:["builtInCall"],ISIRI:["builtInCall"],ISURI:["builtInCall"],ISBLANK:["builtInCall"],ISLITERAL:["builtInCall"],ISNUMERIC:["builtInCall"],SUBSTR:["builtInCall"],REPLACE:["builtInCall"],REGEX:["builtInCall"],EXISTS:["builtInCall"],NOT:["builtInCall"],IRI_REF:["functionCall"],PNAME_LN:["functionCall"],PNAME_NS:["functionCall"],"(":["(","expression","?[AS,var]",")"],VAR1:["var"],VAR2:["var"]},groupGraphPattern:{"{":["{","or([subSelect,groupGraphPatternSub])","}"]},groupGraphPatternSub:{"{":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],OPTIONAL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],MINUS:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],GRAPH:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],SERVICE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],FILTER:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],BIND:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],VALUES:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],VAR1:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],VAR2:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],NIL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"(":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"[":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],IRI_REF:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],TRUE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],FALSE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],BLANK_NODE_LABEL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],ANON:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],PNAME_LN:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],PNAME_NS:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL1:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL2:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL_LONG1:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL_LONG2:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],INTEGER:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DECIMAL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DOUBLE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],INTEGER_POSITIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DECIMAL_POSITIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DOUBLE_POSITIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],INTEGER_NEGATIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DECIMAL_NEGATIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DOUBLE_NEGATIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"}":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"]},groupOrUnionGraphPattern:{"{":["groupGraphPattern","*[UNION,groupGraphPattern]"]},havingClause:{HAVING:["HAVING","+havingCondition"]},havingCondition:{"(":["constraint"],STR:["constraint"],LANG:["constraint"],LANGMATCHES:["constraint"],DATATYPE:["constraint"],BOUND:["constraint"],IRI:["constraint"],URI:["constraint"],BNODE:["constraint"],RAND:["constraint"],ABS:["constraint"],CEIL:["constraint"],FLOOR:["constraint"],ROUND:["constraint"],CONCAT:["constraint"],STRLEN:["constraint"],UCASE:["constraint"],LCASE:["constraint"],ENCODE_FOR_URI:["constraint"],CONTAINS:["constraint"],STRSTARTS:["constraint"],STRENDS:["constraint"],STRBEFORE:["constraint"],STRAFTER:["constraint"],YEAR:["constraint"],MONTH:["constraint"],DAY:["constraint"],HOURS:["constraint"],MINUTES:["constraint"],SECONDS:["constraint"],TIMEZONE:["constraint"],TZ:["constraint"],NOW:["constraint"],UUID:["constraint"],STRUUID:["constraint"],MD5:["constraint"],SHA1:["constraint"],SHA256:["constraint"],SHA384:["constraint"],SHA512:["constraint"],COALESCE:["constraint"],IF:["constraint"],STRLANG:["constraint"],STRDT:["constraint"],SAMETERM:["constraint"],ISIRI:["constraint"],ISURI:["constraint"],ISBLANK:["constraint"],ISLITERAL:["constraint"],ISNUMERIC:["constraint"],SUBSTR:["constraint"],REPLACE:["constraint"],REGEX:["constraint"],EXISTS:["constraint"],NOT:["constraint"],IRI_REF:["constraint"],PNAME_LN:["constraint"],PNAME_NS:["constraint"]},inlineData:{VALUES:["VALUES","dataBlock"]},inlineDataFull:{NIL:["or([NIL,[ (,*var,)]])","{","*or([[ (,*dataBlockValue,)],NIL])","}"],"(":["or([NIL,[ (,*var,)]])","{","*or([[ (,*dataBlockValue,)],NIL])","}"]},inlineDataOneVar:{VAR1:["var","{","*dataBlockValue","}"],VAR2:["var","{","*dataBlockValue","}"]},insert1:{DATA:["DATA","quadData"],"{":["quadPattern","*usingClause","WHERE","groupGraphPattern"]},insertClause:{INSERT:["INSERT","quadPattern"]},integer:{INTEGER:["INTEGER"]},iriRef:{IRI_REF:["IRI_REF"],PNAME_LN:["prefixedName"],PNAME_NS:["prefixedName"]},iriRefOrFunction:{IRI_REF:["iriRef","?argList"],PNAME_LN:["iriRef","?argList"],PNAME_NS:["iriRef","?argList"]},limitClause:{LIMIT:["LIMIT","INTEGER"]},limitOffsetClauses:{LIMIT:["limitClause","?offsetClause"],OFFSET:["offsetClause","?limitClause"]},load:{LOAD:["LOAD","?SILENT_1","iriRef","?[INTO,graphRef]"]},minusGraphPattern:{MINUS:["MINUS","groupGraphPattern"]},modify:{WITH:["WITH","iriRef","or([[deleteClause,?insertClause],insertClause])","*usingClause","WHERE","groupGraphPattern"]},move:{MOVE:["MOVE","?SILENT_4","graphOrDefault","TO","graphOrDefault"]},multiplicativeExpression:{"!":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"+":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"-":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],VAR1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],VAR2:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"(":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],LANG:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],LANGMATCHES:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DATATYPE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],BOUND:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],IRI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],URI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],BNODE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],RAND:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ABS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],CEIL:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],FLOOR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ROUND:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],CONCAT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRLEN:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],UCASE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],LCASE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ENCODE_FOR_URI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],CONTAINS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRSTARTS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRENDS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRBEFORE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRAFTER:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],YEAR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MONTH:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DAY:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],HOURS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MINUTES:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SECONDS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],TIMEZONE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],TZ:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],NOW:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],UUID:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRUUID:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MD5:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA256:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA384:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA512:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],COALESCE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],IF:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRLANG:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRDT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SAMETERM:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISIRI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISURI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISBLANK:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISLITERAL:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISNUMERIC:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],TRUE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],FALSE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],COUNT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SUM:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MIN:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MAX:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],AVG:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SAMPLE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],GROUP_CONCAT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SUBSTR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],REPLACE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],REGEX:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],EXISTS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],NOT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],IRI_REF:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL2:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL_LONG1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL_LONG2:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER_POSITIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_POSITIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_POSITIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER_NEGATIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_NEGATIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_NEGATIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],PNAME_LN:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],PNAME_NS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"]},namedGraphClause:{NAMED:["NAMED","sourceSelector"]},notExistsFunc:{NOT:["NOT","EXISTS","groupGraphPattern"]},numericExpression:{"!":["additiveExpression"],"+":["additiveExpression"],"-":["additiveExpression"],VAR1:["additiveExpression"],VAR2:["additiveExpression"],"(":["additiveExpression"],STR:["additiveExpression"],LANG:["additiveExpression"],LANGMATCHES:["additiveExpression"],DATATYPE:["additiveExpression"],BOUND:["additiveExpression"],IRI:["additiveExpression"],URI:["additiveExpression"],BNODE:["additiveExpression"],RAND:["additiveExpression"],ABS:["additiveExpression"],CEIL:["additiveExpression"],FLOOR:["additiveExpression"],ROUND:["additiveExpression"],CONCAT:["additiveExpression"],STRLEN:["additiveExpression"],UCASE:["additiveExpression"],LCASE:["additiveExpression"],ENCODE_FOR_URI:["additiveExpression"],CONTAINS:["additiveExpression"],STRSTARTS:["additiveExpression"],STRENDS:["additiveExpression"],STRBEFORE:["additiveExpression"],STRAFTER:["additiveExpression"],YEAR:["additiveExpression"],MONTH:["additiveExpression"],DAY:["additiveExpression"],HOURS:["additiveExpression"],MINUTES:["additiveExpression"],SECONDS:["additiveExpression"],TIMEZONE:["additiveExpression"],TZ:["additiveExpression"],NOW:["additiveExpression"],UUID:["additiveExpression"],STRUUID:["additiveExpression"],MD5:["additiveExpression"],SHA1:["additiveExpression"],SHA256:["additiveExpression"],SHA384:["additiveExpression"],SHA512:["additiveExpression"],COALESCE:["additiveExpression"],IF:["additiveExpression"],STRLANG:["additiveExpression"],STRDT:["additiveExpression"],SAMETERM:["additiveExpression"],ISIRI:["additiveExpression"],ISURI:["additiveExpression"],ISBLANK:["additiveExpression"],ISLITERAL:["additiveExpression"],ISNUMERIC:["additiveExpression"],TRUE:["additiveExpression"],FALSE:["additiveExpression"],COUNT:["additiveExpression"],SUM:["additiveExpression"],MIN:["additiveExpression"],MAX:["additiveExpression"],AVG:["additiveExpression"],SAMPLE:["additiveExpression"],GROUP_CONCAT:["additiveExpression"],SUBSTR:["additiveExpression"],REPLACE:["additiveExpression"],REGEX:["additiveExpression"],EXISTS:["additiveExpression"],NOT:["additiveExpression"],IRI_REF:["additiveExpression"],STRING_LITERAL1:["additiveExpression"],STRING_LITERAL2:["additiveExpression"],STRING_LITERAL_LONG1:["additiveExpression"],STRING_LITERAL_LONG2:["additiveExpression"],INTEGER:["additiveExpression"],DECIMAL:["additiveExpression"],DOUBLE:["additiveExpression"],INTEGER_POSITIVE:["additiveExpression"],DECIMAL_POSITIVE:["additiveExpression"],DOUBLE_POSITIVE:["additiveExpression"],INTEGER_NEGATIVE:["additiveExpression"],DECIMAL_NEGATIVE:["additiveExpression"],DOUBLE_NEGATIVE:["additiveExpression"],PNAME_LN:["additiveExpression"],PNAME_NS:["additiveExpression"]},numericLiteral:{INTEGER:["numericLiteralUnsigned"],DECIMAL:["numericLiteralUnsigned"],DOUBLE:["numericLiteralUnsigned"],INTEGER_POSITIVE:["numericLiteralPositive"],DECIMAL_POSITIVE:["numericLiteralPositive"],DOUBLE_POSITIVE:["numericLiteralPositive"],INTEGER_NEGATIVE:["numericLiteralNegative"],DECIMAL_NEGATIVE:["numericLiteralNegative"],DOUBLE_NEGATIVE:["numericLiteralNegative"]},numericLiteralNegative:{INTEGER_NEGATIVE:["INTEGER_NEGATIVE"],DECIMAL_NEGATIVE:["DECIMAL_NEGATIVE"],DOUBLE_NEGATIVE:["DOUBLE_NEGATIVE"]},numericLiteralPositive:{INTEGER_POSITIVE:["INTEGER_POSITIVE"],DECIMAL_POSITIVE:["DECIMAL_POSITIVE"],DOUBLE_POSITIVE:["DOUBLE_POSITIVE"]},numericLiteralUnsigned:{INTEGER:["INTEGER"],DECIMAL:["DECIMAL"],DOUBLE:["DOUBLE"]},object:{"(":["graphNode"],"[":["graphNode"],VAR1:["graphNode"],VAR2:["graphNode"],NIL:["graphNode"],IRI_REF:["graphNode"],TRUE:["graphNode"],FALSE:["graphNode"],BLANK_NODE_LABEL:["graphNode"],ANON:["graphNode"],PNAME_LN:["graphNode"],PNAME_NS:["graphNode"],STRING_LITERAL1:["graphNode"],STRING_LITERAL2:["graphNode"],STRING_LITERAL_LONG1:["graphNode"],STRING_LITERAL_LONG2:["graphNode"],INTEGER:["graphNode"],DECIMAL:["graphNode"],DOUBLE:["graphNode"],INTEGER_POSITIVE:["graphNode"],DECIMAL_POSITIVE:["graphNode"],DOUBLE_POSITIVE:["graphNode"],INTEGER_NEGATIVE:["graphNode"],DECIMAL_NEGATIVE:["graphNode"],DOUBLE_NEGATIVE:["graphNode"]},objectList:{"(":["object","*[,,object]"],"[":["object","*[,,object]"],VAR1:["object","*[,,object]"],VAR2:["object","*[,,object]"],NIL:["object","*[,,object]"],IRI_REF:["object","*[,,object]"],TRUE:["object","*[,,object]"],FALSE:["object","*[,,object]"],BLANK_NODE_LABEL:["object","*[,,object]"],ANON:["object","*[,,object]"],PNAME_LN:["object","*[,,object]"],PNAME_NS:["object","*[,,object]"],STRING_LITERAL1:["object","*[,,object]"],STRING_LITERAL2:["object","*[,,object]"],STRING_LITERAL_LONG1:["object","*[,,object]"],STRING_LITERAL_LONG2:["object","*[,,object]"],INTEGER:["object","*[,,object]"],DECIMAL:["object","*[,,object]"],DOUBLE:["object","*[,,object]"],INTEGER_POSITIVE:["object","*[,,object]"],DECIMAL_POSITIVE:["object","*[,,object]"],DOUBLE_POSITIVE:["object","*[,,object]"],INTEGER_NEGATIVE:["object","*[,,object]"],DECIMAL_NEGATIVE:["object","*[,,object]"],DOUBLE_NEGATIVE:["object","*[,,object]"]},objectListPath:{"(":["objectPath","*[,,objectPath]"],"[":["objectPath","*[,,objectPath]"],VAR1:["objectPath","*[,,objectPath]"],VAR2:["objectPath","*[,,objectPath]"],NIL:["objectPath","*[,,objectPath]"],IRI_REF:["objectPath","*[,,objectPath]"],TRUE:["objectPath","*[,,objectPath]"],FALSE:["objectPath","*[,,objectPath]"],BLANK_NODE_LABEL:["objectPath","*[,,objectPath]"],ANON:["objectPath","*[,,objectPath]"],PNAME_LN:["objectPath","*[,,objectPath]"],PNAME_NS:["objectPath","*[,,objectPath]"],STRING_LITERAL1:["objectPath","*[,,objectPath]"],STRING_LITERAL2:["objectPath","*[,,objectPath]"],STRING_LITERAL_LONG1:["objectPath","*[,,objectPath]"],STRING_LITERAL_LONG2:["objectPath","*[,,objectPath]"],INTEGER:["objectPath","*[,,objectPath]"],DECIMAL:["objectPath","*[,,objectPath]"],DOUBLE:["objectPath","*[,,objectPath]"],INTEGER_POSITIVE:["objectPath","*[,,objectPath]"],DECIMAL_POSITIVE:["objectPath","*[,,objectPath]"],DOUBLE_POSITIVE:["objectPath","*[,,objectPath]"],INTEGER_NEGATIVE:["objectPath","*[,,objectPath]"],DECIMAL_NEGATIVE:["objectPath","*[,,objectPath]"],DOUBLE_NEGATIVE:["objectPath","*[,,objectPath]"]},objectPath:{"(":["graphNodePath"],"[":["graphNodePath"],VAR1:["graphNodePath"],VAR2:["graphNodePath"],NIL:["graphNodePath"],IRI_REF:["graphNodePath"],TRUE:["graphNodePath"],FALSE:["graphNodePath"],BLANK_NODE_LABEL:["graphNodePath"],ANON:["graphNodePath"],PNAME_LN:["graphNodePath"],PNAME_NS:["graphNodePath"],STRING_LITERAL1:["graphNodePath"],STRING_LITERAL2:["graphNodePath"],STRING_LITERAL_LONG1:["graphNodePath"],STRING_LITERAL_LONG2:["graphNodePath"],INTEGER:["graphNodePath"],DECIMAL:["graphNodePath"],DOUBLE:["graphNodePath"],INTEGER_POSITIVE:["graphNodePath"],DECIMAL_POSITIVE:["graphNodePath"],DOUBLE_POSITIVE:["graphNodePath"],INTEGER_NEGATIVE:["graphNodePath"],DECIMAL_NEGATIVE:["graphNodePath"],DOUBLE_NEGATIVE:["graphNodePath"]},offsetClause:{OFFSET:["OFFSET","INTEGER"]},optionalGraphPattern:{OPTIONAL:["OPTIONAL","groupGraphPattern"]},"or([*,expression])":{"*":["*"],"!":["expression"],"+":["expression"],"-":["expression"],VAR1:["expression"],VAR2:["expression"],"(":["expression"],STR:["expression"],LANG:["expression"],LANGMATCHES:["expression"],DATATYPE:["expression"],BOUND:["expression"],IRI:["expression"],URI:["expression"],BNODE:["expression"],RAND:["expression"],ABS:["expression"],CEIL:["expression"],FLOOR:["expression"],ROUND:["expression"],CONCAT:["expression"],STRLEN:["expression"],UCASE:["expression"],LCASE:["expression"],ENCODE_FOR_URI:["expression"],CONTAINS:["expression"],STRSTARTS:["expression"],STRENDS:["expression"],STRBEFORE:["expression"],STRAFTER:["expression"],YEAR:["expression"],MONTH:["expression"],DAY:["expression"],HOURS:["expression"],MINUTES:["expression"],SECONDS:["expression"],TIMEZONE:["expression"],TZ:["expression"],NOW:["expression"],UUID:["expression"],STRUUID:["expression"],MD5:["expression"],SHA1:["expression"],SHA256:["expression"],SHA384:["expression"],SHA512:["expression"],COALESCE:["expression"],IF:["expression"],STRLANG:["expression"],STRDT:["expression"],SAMETERM:["expression"],ISIRI:["expression"],ISURI:["expression"],ISBLANK:["expression"],ISLITERAL:["expression"],ISNUMERIC:["expression"],TRUE:["expression"],FALSE:["expression"],COUNT:["expression"],SUM:["expression"],MIN:["expression"],MAX:["expression"],AVG:["expression"],SAMPLE:["expression"],GROUP_CONCAT:["expression"],SUBSTR:["expression"],REPLACE:["expression"],REGEX:["expression"],EXISTS:["expression"],NOT:["expression"],IRI_REF:["expression"],STRING_LITERAL1:["expression"],STRING_LITERAL2:["expression"],STRING_LITERAL_LONG1:["expression"],STRING_LITERAL_LONG2:["expression"],INTEGER:["expression"],DECIMAL:["expression"],DOUBLE:["expression"],INTEGER_POSITIVE:["expression"],DECIMAL_POSITIVE:["expression"],DOUBLE_POSITIVE:["expression"],INTEGER_NEGATIVE:["expression"],DECIMAL_NEGATIVE:["expression"],DOUBLE_NEGATIVE:["expression"],PNAME_LN:["expression"],PNAME_NS:["expression"]},"or([+or([var,[ (,expression,AS,var,)]]),*])":{"(":["+or([var,[ (,expression,AS,var,)]])"],VAR1:["+or([var,[ (,expression,AS,var,)]])"],VAR2:["+or([var,[ (,expression,AS,var,)]])"],"*":["*"]},"or([+varOrIRIref,*])":{VAR1:["+varOrIRIref"],VAR2:["+varOrIRIref"],IRI_REF:["+varOrIRIref"],PNAME_LN:["+varOrIRIref"],PNAME_NS:["+varOrIRIref"],"*":["*"]},"or([ASC,DESC])":{ASC:["ASC"],DESC:["DESC"]},"or([DISTINCT,REDUCED])":{DISTINCT:["DISTINCT"],REDUCED:["REDUCED"]},"or([LANGTAG,[^^,iriRef]])":{LANGTAG:["LANGTAG"],"^^":["[^^,iriRef]"]},"or([NIL,[ (,*var,)]])":{NIL:["NIL"],"(":["[ (,*var,)]"]},"or([[ (,*dataBlockValue,)],NIL])":{"(":["[ (,*dataBlockValue,)]"],NIL:["NIL"]},"or([[ (,expression,)],NIL])":{"(":["[ (,expression,)]"],NIL:["NIL"]},"or([[*,unaryExpression],[/,unaryExpression]])":{"*":["[*,unaryExpression]"],"/":["[/,unaryExpression]"]},"or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])":{"+":["[+,multiplicativeExpression]"],"-":["[-,multiplicativeExpression]"],INTEGER_POSITIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DECIMAL_POSITIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DOUBLE_POSITIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],INTEGER_NEGATIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DECIMAL_NEGATIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DOUBLE_NEGATIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"]},"or([[,,or([},[integer,}]])],}])":{",":["[,,or([},[integer,}]])]"],"}":["}"]},"or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])":{"=":["[=,numericExpression]"],"!=":["[!=,numericExpression]"],"<":["[<,numericExpression]"],">":["[>,numericExpression]"],"<=":["[<=,numericExpression]"],">=":["[>=,numericExpression]"],IN:["[IN,expressionList]"],NOT:["[NOT,IN,expressionList]"]},"or([[constructTemplate,*datasetClause,whereClause,solutionModifier],[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]])":{"{":["[constructTemplate,*datasetClause,whereClause,solutionModifier]"],WHERE:["[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]"],FROM:["[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]"]},"or([[deleteClause,?insertClause],insertClause])":{DELETE:["[deleteClause,?insertClause]"],INSERT:["insertClause"]},"or([[integer,or([[,,or([},[integer,}]])],}])],[,,integer,}]])":{INTEGER:["[integer,or([[,,or([},[integer,}]])],}])]"],",":["[,,integer,}]"]},"or([defaultGraphClause,namedGraphClause])":{IRI_REF:["defaultGraphClause"],PNAME_LN:["defaultGraphClause"],PNAME_NS:["defaultGraphClause"],NAMED:["namedGraphClause"]},"or([inlineDataOneVar,inlineDataFull])":{VAR1:["inlineDataOneVar"],VAR2:["inlineDataOneVar"],NIL:["inlineDataFull"],"(":["inlineDataFull"]},"or([iriRef,[NAMED,iriRef]])":{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],NAMED:["[NAMED,iriRef]"]},"or([iriRef,a])":{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],a:["a"]},"or([numericLiteralPositive,numericLiteralNegative])":{INTEGER_POSITIVE:["numericLiteralPositive"],DECIMAL_POSITIVE:["numericLiteralPositive"],DOUBLE_POSITIVE:["numericLiteralPositive"],INTEGER_NEGATIVE:["numericLiteralNegative"],DECIMAL_NEGATIVE:["numericLiteralNegative"],DOUBLE_NEGATIVE:["numericLiteralNegative"]},"or([queryAll,updateAll])":{CONSTRUCT:["queryAll"],DESCRIBE:["queryAll"],ASK:["queryAll"],SELECT:["queryAll"],INSERT:["updateAll"],DELETE:["updateAll"],LOAD:["updateAll"],CLEAR:["updateAll"],DROP:["updateAll"],ADD:["updateAll"],MOVE:["updateAll"],COPY:["updateAll"],CREATE:["updateAll"],WITH:["updateAll"],$:["updateAll"]},"or([selectQuery,constructQuery,describeQuery,askQuery])":{SELECT:["selectQuery"],CONSTRUCT:["constructQuery"],DESCRIBE:["describeQuery"],ASK:["askQuery"]},"or([subSelect,groupGraphPatternSub])":{SELECT:["subSelect"],"{":["groupGraphPatternSub"],OPTIONAL:["groupGraphPatternSub"],MINUS:["groupGraphPatternSub"],GRAPH:["groupGraphPatternSub"],SERVICE:["groupGraphPatternSub"],FILTER:["groupGraphPatternSub"],BIND:["groupGraphPatternSub"],VALUES:["groupGraphPatternSub"],VAR1:["groupGraphPatternSub"],VAR2:["groupGraphPatternSub"],NIL:["groupGraphPatternSub"],"(":["groupGraphPatternSub"],"[":["groupGraphPatternSub"],IRI_REF:["groupGraphPatternSub"],TRUE:["groupGraphPatternSub"],FALSE:["groupGraphPatternSub"],BLANK_NODE_LABEL:["groupGraphPatternSub"],ANON:["groupGraphPatternSub"],PNAME_LN:["groupGraphPatternSub"],PNAME_NS:["groupGraphPatternSub"],STRING_LITERAL1:["groupGraphPatternSub"],STRING_LITERAL2:["groupGraphPatternSub"],STRING_LITERAL_LONG1:["groupGraphPatternSub"],STRING_LITERAL_LONG2:["groupGraphPatternSub"],INTEGER:["groupGraphPatternSub"],DECIMAL:["groupGraphPatternSub"],DOUBLE:["groupGraphPatternSub"],INTEGER_POSITIVE:["groupGraphPatternSub"],DECIMAL_POSITIVE:["groupGraphPatternSub"],DOUBLE_POSITIVE:["groupGraphPatternSub"],INTEGER_NEGATIVE:["groupGraphPatternSub"],DECIMAL_NEGATIVE:["groupGraphPatternSub"],DOUBLE_NEGATIVE:["groupGraphPatternSub"],"}":["groupGraphPatternSub"]},"or([var,[ (,expression,AS,var,)]])":{VAR1:["var"],VAR2:["var"],"(":["[ (,expression,AS,var,)]"]},"or([verbPath,verbSimple])":{"^":["verbPath"],a:["verbPath"],"!":["verbPath"],"(":["verbPath"],IRI_REF:["verbPath"],PNAME_LN:["verbPath"],PNAME_NS:["verbPath"],VAR1:["verbSimple"],VAR2:["verbSimple"]},"or([},[integer,}]])":{"}":["}"],INTEGER:["[integer,}]"]},orderClause:{ORDER:["ORDER","BY","+orderCondition"]},orderCondition:{ASC:["or([ASC,DESC])","brackettedExpression"],DESC:["or([ASC,DESC])","brackettedExpression"],"(":["constraint"],STR:["constraint"],LANG:["constraint"],LANGMATCHES:["constraint"],DATATYPE:["constraint"],BOUND:["constraint"],IRI:["constraint"],URI:["constraint"],BNODE:["constraint"],RAND:["constraint"],ABS:["constraint"],CEIL:["constraint"],FLOOR:["constraint"],ROUND:["constraint"],CONCAT:["constraint"],STRLEN:["constraint"],UCASE:["constraint"],LCASE:["constraint"],ENCODE_FOR_URI:["constraint"],CONTAINS:["constraint"],STRSTARTS:["constraint"],STRENDS:["constraint"],STRBEFORE:["constraint"],STRAFTER:["constraint"],YEAR:["constraint"],MONTH:["constraint"],DAY:["constraint"],HOURS:["constraint"],MINUTES:["constraint"],SECONDS:["constraint"],TIMEZONE:["constraint"],TZ:["constraint"],NOW:["constraint"],UUID:["constraint"],STRUUID:["constraint"],MD5:["constraint"],SHA1:["constraint"],SHA256:["constraint"],SHA384:["constraint"],SHA512:["constraint"],COALESCE:["constraint"],IF:["constraint"],STRLANG:["constraint"],STRDT:["constraint"],SAMETERM:["constraint"],ISIRI:["constraint"],ISURI:["constraint"],ISBLANK:["constraint"],ISLITERAL:["constraint"],ISNUMERIC:["constraint"],SUBSTR:["constraint"],REPLACE:["constraint"],REGEX:["constraint"],EXISTS:["constraint"],NOT:["constraint"],IRI_REF:["constraint"],PNAME_LN:["constraint"],PNAME_NS:["constraint"],VAR1:["var"],VAR2:["var"]},path:{"^":["pathAlternative"],a:["pathAlternative"],"!":["pathAlternative"],"(":["pathAlternative"],IRI_REF:["pathAlternative"],PNAME_LN:["pathAlternative"],PNAME_NS:["pathAlternative"]},pathAlternative:{"^":["pathSequence","*[|,pathSequence]"],a:["pathSequence","*[|,pathSequence]"],"!":["pathSequence","*[|,pathSequence]"],"(":["pathSequence","*[|,pathSequence]"],IRI_REF:["pathSequence","*[|,pathSequence]"],PNAME_LN:["pathSequence","*[|,pathSequence]"],PNAME_NS:["pathSequence","*[|,pathSequence]"]},pathElt:{a:["pathPrimary","?pathMod"],"!":["pathPrimary","?pathMod"],"(":["pathPrimary","?pathMod"],IRI_REF:["pathPrimary","?pathMod"],PNAME_LN:["pathPrimary","?pathMod"],PNAME_NS:["pathPrimary","?pathMod"]},pathEltOrInverse:{a:["pathElt"],"!":["pathElt"],"(":["pathElt"],IRI_REF:["pathElt"],PNAME_LN:["pathElt"],PNAME_NS:["pathElt"],"^":["^","pathElt"]},pathMod:{"*":["*"],"?":["?"],"+":["+"],"{":["{","or([[integer,or([[,,or([},[integer,}]])],}])],[,,integer,}]])"]},pathNegatedPropertySet:{a:["pathOneInPropertySet"],"^":["pathOneInPropertySet"],IRI_REF:["pathOneInPropertySet"],PNAME_LN:["pathOneInPropertySet"],PNAME_NS:["pathOneInPropertySet"],"(":["(","?[pathOneInPropertySet,*[|,pathOneInPropertySet]]",")"]},pathOneInPropertySet:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],a:["a"],"^":["^","or([iriRef,a])"]},pathPrimary:{IRI_REF:["storeProperty","iriRef"],PNAME_LN:["storeProperty","iriRef"],PNAME_NS:["storeProperty","iriRef"],a:["storeProperty","a"],"!":["!","pathNegatedPropertySet"],"(":["(","path",")"]},pathSequence:{"^":["pathEltOrInverse","*[/,pathEltOrInverse]"],a:["pathEltOrInverse","*[/,pathEltOrInverse]"],"!":["pathEltOrInverse","*[/,pathEltOrInverse]"],"(":["pathEltOrInverse","*[/,pathEltOrInverse]"],IRI_REF:["pathEltOrInverse","*[/,pathEltOrInverse]"],PNAME_LN:["pathEltOrInverse","*[/,pathEltOrInverse]"],PNAME_NS:["pathEltOrInverse","*[/,pathEltOrInverse]"]},prefixDecl:{PREFIX:["PREFIX","PNAME_NS","IRI_REF"]},prefixedName:{PNAME_LN:["PNAME_LN"],PNAME_NS:["PNAME_NS"]},primaryExpression:{"(":["brackettedExpression"],STR:["builtInCall"],LANG:["builtInCall"],LANGMATCHES:["builtInCall"],DATATYPE:["builtInCall"],BOUND:["builtInCall"],IRI:["builtInCall"],URI:["builtInCall"],BNODE:["builtInCall"],RAND:["builtInCall"],ABS:["builtInCall"],CEIL:["builtInCall"],FLOOR:["builtInCall"],ROUND:["builtInCall"],CONCAT:["builtInCall"],STRLEN:["builtInCall"],UCASE:["builtInCall"],LCASE:["builtInCall"],ENCODE_FOR_URI:["builtInCall"],CONTAINS:["builtInCall"],STRSTARTS:["builtInCall"],STRENDS:["builtInCall"],STRBEFORE:["builtInCall"],STRAFTER:["builtInCall"],YEAR:["builtInCall"],MONTH:["builtInCall"],DAY:["builtInCall"],HOURS:["builtInCall"],MINUTES:["builtInCall"],SECONDS:["builtInCall"],TIMEZONE:["builtInCall"],TZ:["builtInCall"],NOW:["builtInCall"],UUID:["builtInCall"],STRUUID:["builtInCall"],MD5:["builtInCall"],SHA1:["builtInCall"],SHA256:["builtInCall"],SHA384:["builtInCall"],SHA512:["builtInCall"],COALESCE:["builtInCall"],IF:["builtInCall"],STRLANG:["builtInCall"],STRDT:["builtInCall"],SAMETERM:["builtInCall"],ISIRI:["builtInCall"],ISURI:["builtInCall"],ISBLANK:["builtInCall"],ISLITERAL:["builtInCall"],ISNUMERIC:["builtInCall"],SUBSTR:["builtInCall"],REPLACE:["builtInCall"],REGEX:["builtInCall"],EXISTS:["builtInCall"],NOT:["builtInCall"],IRI_REF:["iriRefOrFunction"],PNAME_LN:["iriRefOrFunction"],PNAME_NS:["iriRefOrFunction"],STRING_LITERAL1:["rdfLiteral"],STRING_LITERAL2:["rdfLiteral"],STRING_LITERAL_LONG1:["rdfLiteral"],STRING_LITERAL_LONG2:["rdfLiteral"],INTEGER:["numericLiteral"],DECIMAL:["numericLiteral"],DOUBLE:["numericLiteral"],INTEGER_POSITIVE:["numericLiteral"],DECIMAL_POSITIVE:["numericLiteral"],DOUBLE_POSITIVE:["numericLiteral"],INTEGER_NEGATIVE:["numericLiteral"],DECIMAL_NEGATIVE:["numericLiteral"],DOUBLE_NEGATIVE:["numericLiteral"],TRUE:["booleanLiteral"],FALSE:["booleanLiteral"],VAR1:["var"],VAR2:["var"],COUNT:["aggregate"],SUM:["aggregate"],MIN:["aggregate"],MAX:["aggregate"],AVG:["aggregate"],SAMPLE:["aggregate"],GROUP_CONCAT:["aggregate"]},prologue:{PREFIX:["?baseDecl","*prefixDecl"],BASE:["?baseDecl","*prefixDecl"],$:["?baseDecl","*prefixDecl"],CONSTRUCT:["?baseDecl","*prefixDecl"],DESCRIBE:["?baseDecl","*prefixDecl"],ASK:["?baseDecl","*prefixDecl"],INSERT:["?baseDecl","*prefixDecl"],DELETE:["?baseDecl","*prefixDecl"],SELECT:["?baseDecl","*prefixDecl"],LOAD:["?baseDecl","*prefixDecl"],CLEAR:["?baseDecl","*prefixDecl"],DROP:["?baseDecl","*prefixDecl"],ADD:["?baseDecl","*prefixDecl"],MOVE:["?baseDecl","*prefixDecl"],COPY:["?baseDecl","*prefixDecl"],CREATE:["?baseDecl","*prefixDecl"],WITH:["?baseDecl","*prefixDecl"]},propertyList:{a:["propertyListNotEmpty"],VAR1:["propertyListNotEmpty"],VAR2:["propertyListNotEmpty"],IRI_REF:["propertyListNotEmpty"],PNAME_LN:["propertyListNotEmpty"],PNAME_NS:["propertyListNotEmpty"],".":[],"}":[],GRAPH:[]},propertyListNotEmpty:{a:["verb","objectList","*[;,?[verb,objectList]]"],VAR1:["verb","objectList","*[;,?[verb,objectList]]"],VAR2:["verb","objectList","*[;,?[verb,objectList]]"],IRI_REF:["verb","objectList","*[;,?[verb,objectList]]"],PNAME_LN:["verb","objectList","*[;,?[verb,objectList]]"],PNAME_NS:["verb","objectList","*[;,?[verb,objectList]]"]},propertyListPath:{a:["propertyListNotEmpty"],VAR1:["propertyListNotEmpty"],VAR2:["propertyListNotEmpty"],IRI_REF:["propertyListNotEmpty"],PNAME_LN:["propertyListNotEmpty"],PNAME_NS:["propertyListNotEmpty"],".":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},propertyListPathNotEmpty:{VAR1:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],VAR2:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],"^":["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],a:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],"!":["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],"(":["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],IRI_REF:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],PNAME_LN:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],PNAME_NS:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"]},quadData:{"{":["{","disallowVars","quads","allowVars","}"]},quadDataNoBnodes:{"{":["{","disallowBnodes","disallowVars","quads","allowVars","allowBnodes","}"]},quadPattern:{"{":["{","quads","}"]},quadPatternNoBnodes:{"{":["{","disallowBnodes","quads","allowBnodes","}"]},quads:{GRAPH:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],VAR1:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],VAR2:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],NIL:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"(":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"[":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],IRI_REF:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],TRUE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],FALSE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],BLANK_NODE_LABEL:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],ANON:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],PNAME_LN:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],PNAME_NS:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL1:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL2:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL_LONG1:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL_LONG2:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],INTEGER:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DECIMAL:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DOUBLE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],INTEGER_POSITIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DECIMAL_POSITIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DOUBLE_POSITIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],INTEGER_NEGATIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DECIMAL_NEGATIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DOUBLE_NEGATIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"}":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"]},quadsNotTriples:{GRAPH:["GRAPH","varOrIRIref","{","?triplesTemplate","}"]},queryAll:{CONSTRUCT:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"],DESCRIBE:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"],ASK:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"],SELECT:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"]},rdfLiteral:{STRING_LITERAL1:["string","?or([LANGTAG,[^^,iriRef]])"],STRING_LITERAL2:["string","?or([LANGTAG,[^^,iriRef]])"],STRING_LITERAL_LONG1:["string","?or([LANGTAG,[^^,iriRef]])"],STRING_LITERAL_LONG2:["string","?or([LANGTAG,[^^,iriRef]])"]},regexExpression:{REGEX:["REGEX","(","expression",",","expression","?[,,expression]",")"]},relationalExpression:{"!":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"+":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"-":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],VAR1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],VAR2:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"(":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],LANG:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],LANGMATCHES:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DATATYPE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],BOUND:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IRI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],URI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],BNODE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],RAND:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ABS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],CEIL:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],FLOOR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ROUND:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],CONCAT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRLEN:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],UCASE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],LCASE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ENCODE_FOR_URI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],CONTAINS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRSTARTS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRENDS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRBEFORE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRAFTER:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],YEAR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MONTH:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DAY:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],HOURS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MINUTES:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SECONDS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],TIMEZONE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],TZ:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],NOW:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],UUID:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRUUID:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MD5:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA256:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA384:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA512:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],COALESCE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IF:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRLANG:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRDT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SAMETERM:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISIRI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISURI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISBLANK:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISLITERAL:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISNUMERIC:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],TRUE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],FALSE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],COUNT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SUM:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MIN:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MAX:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],AVG:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SAMPLE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],GROUP_CONCAT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SUBSTR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],REPLACE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],REGEX:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],EXISTS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],NOT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IRI_REF:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL2:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL_LONG1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL_LONG2:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],INTEGER:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DECIMAL:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DOUBLE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],INTEGER_POSITIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DECIMAL_POSITIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DOUBLE_POSITIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],INTEGER_NEGATIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DECIMAL_NEGATIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DOUBLE_NEGATIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],PNAME_LN:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],PNAME_NS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"]},selectClause:{SELECT:["SELECT","?or([DISTINCT,REDUCED])","or([+or([var,[ (,expression,AS,var,)]]),*])"]},selectQuery:{SELECT:["selectClause","*datasetClause","whereClause","solutionModifier"]},serviceGraphPattern:{SERVICE:["SERVICE","?SILENT","varOrIRIref","groupGraphPattern"]},solutionModifier:{LIMIT:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],OFFSET:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],ORDER:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],HAVING:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],GROUP:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],VALUES:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],$:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],"}":["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"]},sourceSelector:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"]},sparql11:{$:["prologue","or([queryAll,updateAll])","$"],CONSTRUCT:["prologue","or([queryAll,updateAll])","$"],DESCRIBE:["prologue","or([queryAll,updateAll])","$"],ASK:["prologue","or([queryAll,updateAll])","$"],INSERT:["prologue","or([queryAll,updateAll])","$"],DELETE:["prologue","or([queryAll,updateAll])","$"],SELECT:["prologue","or([queryAll,updateAll])","$"],LOAD:["prologue","or([queryAll,updateAll])","$"],CLEAR:["prologue","or([queryAll,updateAll])","$"],DROP:["prologue","or([queryAll,updateAll])","$"],ADD:["prologue","or([queryAll,updateAll])","$"],MOVE:["prologue","or([queryAll,updateAll])","$"],COPY:["prologue","or([queryAll,updateAll])","$"],CREATE:["prologue","or([queryAll,updateAll])","$"],WITH:["prologue","or([queryAll,updateAll])","$"],PREFIX:["prologue","or([queryAll,updateAll])","$"],BASE:["prologue","or([queryAll,updateAll])","$"]},storeProperty:{VAR1:[],VAR2:[],IRI_REF:[],PNAME_LN:[],PNAME_NS:[],a:[]},strReplaceExpression:{REPLACE:["REPLACE","(","expression",",","expression",",","expression","?[,,expression]",")"]},string:{STRING_LITERAL1:["STRING_LITERAL1"],STRING_LITERAL2:["STRING_LITERAL2"],STRING_LITERAL_LONG1:["STRING_LITERAL_LONG1"],STRING_LITERAL_LONG2:["STRING_LITERAL_LONG2"]},subSelect:{SELECT:["selectClause","whereClause","solutionModifier","valuesClause"]},substringExpression:{SUBSTR:["SUBSTR","(","expression",",","expression","?[,,expression]",")"]},triplesBlock:{VAR1:["triplesSameSubjectPath","?[.,?triplesBlock]"],VAR2:["triplesSameSubjectPath","?[.,?triplesBlock]"],NIL:["triplesSameSubjectPath","?[.,?triplesBlock]"],"(":["triplesSameSubjectPath","?[.,?triplesBlock]"],"[":["triplesSameSubjectPath","?[.,?triplesBlock]"],IRI_REF:["triplesSameSubjectPath","?[.,?triplesBlock]"],TRUE:["triplesSameSubjectPath","?[.,?triplesBlock]"],FALSE:["triplesSameSubjectPath","?[.,?triplesBlock]"],BLANK_NODE_LABEL:["triplesSameSubjectPath","?[.,?triplesBlock]"],ANON:["triplesSameSubjectPath","?[.,?triplesBlock]"],PNAME_LN:["triplesSameSubjectPath","?[.,?triplesBlock]"],PNAME_NS:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL1:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL2:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL_LONG1:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL_LONG2:["triplesSameSubjectPath","?[.,?triplesBlock]"],INTEGER:["triplesSameSubjectPath","?[.,?triplesBlock]"],DECIMAL:["triplesSameSubjectPath","?[.,?triplesBlock]"],DOUBLE:["triplesSameSubjectPath","?[.,?triplesBlock]"],INTEGER_POSITIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DECIMAL_POSITIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DOUBLE_POSITIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],INTEGER_NEGATIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DECIMAL_NEGATIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DOUBLE_NEGATIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"]},triplesNode:{"(":["collection"],"[":["blankNodePropertyList"]},triplesNodePath:{"(":["collectionPath"],"[":["blankNodePropertyListPath"]},triplesSameSubject:{VAR1:["varOrTerm","propertyListNotEmpty"],VAR2:["varOrTerm","propertyListNotEmpty"],NIL:["varOrTerm","propertyListNotEmpty"],IRI_REF:["varOrTerm","propertyListNotEmpty"],TRUE:["varOrTerm","propertyListNotEmpty"],FALSE:["varOrTerm","propertyListNotEmpty"],BLANK_NODE_LABEL:["varOrTerm","propertyListNotEmpty"],ANON:["varOrTerm","propertyListNotEmpty"],PNAME_LN:["varOrTerm","propertyListNotEmpty"],PNAME_NS:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL1:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL2:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL_LONG1:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL_LONG2:["varOrTerm","propertyListNotEmpty"],INTEGER:["varOrTerm","propertyListNotEmpty"],DECIMAL:["varOrTerm","propertyListNotEmpty"],DOUBLE:["varOrTerm","propertyListNotEmpty"],INTEGER_POSITIVE:["varOrTerm","propertyListNotEmpty"],DECIMAL_POSITIVE:["varOrTerm","propertyListNotEmpty"],DOUBLE_POSITIVE:["varOrTerm","propertyListNotEmpty"],INTEGER_NEGATIVE:["varOrTerm","propertyListNotEmpty"],DECIMAL_NEGATIVE:["varOrTerm","propertyListNotEmpty"],DOUBLE_NEGATIVE:["varOrTerm","propertyListNotEmpty"],"(":["triplesNode","propertyList"],"[":["triplesNode","propertyList"]},triplesSameSubjectPath:{VAR1:["varOrTerm","propertyListPathNotEmpty"],VAR2:["varOrTerm","propertyListPathNotEmpty"],NIL:["varOrTerm","propertyListPathNotEmpty"],IRI_REF:["varOrTerm","propertyListPathNotEmpty"],TRUE:["varOrTerm","propertyListPathNotEmpty"],FALSE:["varOrTerm","propertyListPathNotEmpty"],BLANK_NODE_LABEL:["varOrTerm","propertyListPathNotEmpty"],ANON:["varOrTerm","propertyListPathNotEmpty"],PNAME_LN:["varOrTerm","propertyListPathNotEmpty"],PNAME_NS:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL1:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL2:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL_LONG1:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL_LONG2:["varOrTerm","propertyListPathNotEmpty"],INTEGER:["varOrTerm","propertyListPathNotEmpty"],DECIMAL:["varOrTerm","propertyListPathNotEmpty"],DOUBLE:["varOrTerm","propertyListPathNotEmpty"],INTEGER_POSITIVE:["varOrTerm","propertyListPathNotEmpty"],DECIMAL_POSITIVE:["varOrTerm","propertyListPathNotEmpty"],DOUBLE_POSITIVE:["varOrTerm","propertyListPathNotEmpty"],INTEGER_NEGATIVE:["varOrTerm","propertyListPathNotEmpty"],DECIMAL_NEGATIVE:["varOrTerm","propertyListPathNotEmpty"],DOUBLE_NEGATIVE:["varOrTerm","propertyListPathNotEmpty"],"(":["triplesNodePath","propertyListPath"],"[":["triplesNodePath","propertyListPath"]},triplesTemplate:{VAR1:["triplesSameSubject","?[.,?triplesTemplate]"],VAR2:["triplesSameSubject","?[.,?triplesTemplate]"],NIL:["triplesSameSubject","?[.,?triplesTemplate]"],"(":["triplesSameSubject","?[.,?triplesTemplate]"],"[":["triplesSameSubject","?[.,?triplesTemplate]"],IRI_REF:["triplesSameSubject","?[.,?triplesTemplate]"],TRUE:["triplesSameSubject","?[.,?triplesTemplate]"],FALSE:["triplesSameSubject","?[.,?triplesTemplate]"],BLANK_NODE_LABEL:["triplesSameSubject","?[.,?triplesTemplate]"],ANON:["triplesSameSubject","?[.,?triplesTemplate]"],PNAME_LN:["triplesSameSubject","?[.,?triplesTemplate]"],PNAME_NS:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL1:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL2:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL_LONG1:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL_LONG2:["triplesSameSubject","?[.,?triplesTemplate]"],INTEGER:["triplesSameSubject","?[.,?triplesTemplate]"],DECIMAL:["triplesSameSubject","?[.,?triplesTemplate]"],DOUBLE:["triplesSameSubject","?[.,?triplesTemplate]"],INTEGER_POSITIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DECIMAL_POSITIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DOUBLE_POSITIVE:["triplesSameSubject","?[.,?triplesTemplate]"],INTEGER_NEGATIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DECIMAL_NEGATIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DOUBLE_NEGATIVE:["triplesSameSubject","?[.,?triplesTemplate]"]},unaryExpression:{"!":["!","primaryExpression"],"+":["+","primaryExpression"],"-":["-","primaryExpression"],VAR1:["primaryExpression"],VAR2:["primaryExpression"],"(":["primaryExpression"],STR:["primaryExpression"],LANG:["primaryExpression"],LANGMATCHES:["primaryExpression"],DATATYPE:["primaryExpression"],BOUND:["primaryExpression"],IRI:["primaryExpression"],URI:["primaryExpression"],BNODE:["primaryExpression"],RAND:["primaryExpression"],ABS:["primaryExpression"],CEIL:["primaryExpression"],FLOOR:["primaryExpression"],ROUND:["primaryExpression"],CONCAT:["primaryExpression"],STRLEN:["primaryExpression"],UCASE:["primaryExpression"],LCASE:["primaryExpression"],ENCODE_FOR_URI:["primaryExpression"],CONTAINS:["primaryExpression"],STRSTARTS:["primaryExpression"],STRENDS:["primaryExpression"],STRBEFORE:["primaryExpression"],STRAFTER:["primaryExpression"],YEAR:["primaryExpression"],MONTH:["primaryExpression"],DAY:["primaryExpression"],HOURS:["primaryExpression"],MINUTES:["primaryExpression"],SECONDS:["primaryExpression"],TIMEZONE:["primaryExpression"],TZ:["primaryExpression"],NOW:["primaryExpression"],UUID:["primaryExpression"],STRUUID:["primaryExpression"],MD5:["primaryExpression"],SHA1:["primaryExpression"],SHA256:["primaryExpression"],SHA384:["primaryExpression"],SHA512:["primaryExpression"],COALESCE:["primaryExpression"],IF:["primaryExpression"],STRLANG:["primaryExpression"],STRDT:["primaryExpression"],SAMETERM:["primaryExpression"],ISIRI:["primaryExpression"],ISURI:["primaryExpression"],ISBLANK:["primaryExpression"],ISLITERAL:["primaryExpression"],ISNUMERIC:["primaryExpression"],TRUE:["primaryExpression"],FALSE:["primaryExpression"],COUNT:["primaryExpression"],SUM:["primaryExpression"],MIN:["primaryExpression"],MAX:["primaryExpression"],AVG:["primaryExpression"],SAMPLE:["primaryExpression"],GROUP_CONCAT:["primaryExpression"],SUBSTR:["primaryExpression"],REPLACE:["primaryExpression"],REGEX:["primaryExpression"],EXISTS:["primaryExpression"],NOT:["primaryExpression"],IRI_REF:["primaryExpression"],STRING_LITERAL1:["primaryExpression"],STRING_LITERAL2:["primaryExpression"],STRING_LITERAL_LONG1:["primaryExpression"],STRING_LITERAL_LONG2:["primaryExpression"],INTEGER:["primaryExpression"],DECIMAL:["primaryExpression"],DOUBLE:["primaryExpression"],INTEGER_POSITIVE:["primaryExpression"],DECIMAL_POSITIVE:["primaryExpression"],DOUBLE_POSITIVE:["primaryExpression"],INTEGER_NEGATIVE:["primaryExpression"],DECIMAL_NEGATIVE:["primaryExpression"],DOUBLE_NEGATIVE:["primaryExpression"],PNAME_LN:["primaryExpression"],PNAME_NS:["primaryExpression"]},update:{INSERT:["prologue","?[update1,?[;,update]]"],DELETE:["prologue","?[update1,?[;,update]]"],LOAD:["prologue","?[update1,?[;,update]]"],CLEAR:["prologue","?[update1,?[;,update]]"],DROP:["prologue","?[update1,?[;,update]]"],ADD:["prologue","?[update1,?[;,update]]"],MOVE:["prologue","?[update1,?[;,update]]"],COPY:["prologue","?[update1,?[;,update]]"],CREATE:["prologue","?[update1,?[;,update]]"],WITH:["prologue","?[update1,?[;,update]]"],PREFIX:["prologue","?[update1,?[;,update]]"],BASE:["prologue","?[update1,?[;,update]]"],$:["prologue","?[update1,?[;,update]]"]},update1:{LOAD:["load"],CLEAR:["clear"],DROP:["drop"],ADD:["add"],MOVE:["move"],COPY:["copy"],CREATE:["create"],INSERT:["INSERT","insert1"],DELETE:["DELETE","delete1"],WITH:["modify"]},updateAll:{INSERT:["?[update1,?[;,update]]"],DELETE:["?[update1,?[;,update]]"],LOAD:["?[update1,?[;,update]]"],CLEAR:["?[update1,?[;,update]]"],DROP:["?[update1,?[;,update]]"],ADD:["?[update1,?[;,update]]"],MOVE:["?[update1,?[;,update]]"],COPY:["?[update1,?[;,update]]"],CREATE:["?[update1,?[;,update]]"],WITH:["?[update1,?[;,update]]"],$:["?[update1,?[;,update]]"]},usingClause:{USING:["USING","or([iriRef,[NAMED,iriRef]])"]},valueLogical:{"!":["relationalExpression"],"+":["relationalExpression"],"-":["relationalExpression"],VAR1:["relationalExpression"],VAR2:["relationalExpression"],"(":["relationalExpression"],STR:["relationalExpression"],LANG:["relationalExpression"],LANGMATCHES:["relationalExpression"],DATATYPE:["relationalExpression"],BOUND:["relationalExpression"],IRI:["relationalExpression"],URI:["relationalExpression"],BNODE:["relationalExpression"],RAND:["relationalExpression"],ABS:["relationalExpression"],CEIL:["relationalExpression"],FLOOR:["relationalExpression"],ROUND:["relationalExpression"],CONCAT:["relationalExpression"],STRLEN:["relationalExpression"],UCASE:["relationalExpression"],LCASE:["relationalExpression"],ENCODE_FOR_URI:["relationalExpression"],CONTAINS:["relationalExpression"],STRSTARTS:["relationalExpression"],STRENDS:["relationalExpression"],STRBEFORE:["relationalExpression"],STRAFTER:["relationalExpression"],YEAR:["relationalExpression"],MONTH:["relationalExpression"],DAY:["relationalExpression"],HOURS:["relationalExpression"],MINUTES:["relationalExpression"],SECONDS:["relationalExpression"],TIMEZONE:["relationalExpression"],TZ:["relationalExpression"],NOW:["relationalExpression"],UUID:["relationalExpression"],STRUUID:["relationalExpression"],MD5:["relationalExpression"],SHA1:["relationalExpression"],SHA256:["relationalExpression"],SHA384:["relationalExpression"],SHA512:["relationalExpression"],COALESCE:["relationalExpression"],IF:["relationalExpression"],STRLANG:["relationalExpression"],STRDT:["relationalExpression"],SAMETERM:["relationalExpression"],ISIRI:["relationalExpression"],ISURI:["relationalExpression"],ISBLANK:["relationalExpression"],ISLITERAL:["relationalExpression"],ISNUMERIC:["relationalExpression"],TRUE:["relationalExpression"],FALSE:["relationalExpression"],COUNT:["relationalExpression"],SUM:["relationalExpression"],MIN:["relationalExpression"],MAX:["relationalExpression"],AVG:["relationalExpression"],SAMPLE:["relationalExpression"],GROUP_CONCAT:["relationalExpression"],SUBSTR:["relationalExpression"],REPLACE:["relationalExpression"],REGEX:["relationalExpression"],EXISTS:["relationalExpression"],NOT:["relationalExpression"],IRI_REF:["relationalExpression"],STRING_LITERAL1:["relationalExpression"],STRING_LITERAL2:["relationalExpression"],STRING_LITERAL_LONG1:["relationalExpression"],STRING_LITERAL_LONG2:["relationalExpression"],INTEGER:["relationalExpression"],DECIMAL:["relationalExpression"],DOUBLE:["relationalExpression"],INTEGER_POSITIVE:["relationalExpression"],DECIMAL_POSITIVE:["relationalExpression"],DOUBLE_POSITIVE:["relationalExpression"],INTEGER_NEGATIVE:["relationalExpression"],DECIMAL_NEGATIVE:["relationalExpression"],DOUBLE_NEGATIVE:["relationalExpression"],PNAME_LN:["relationalExpression"],PNAME_NS:["relationalExpression"]},valuesClause:{VALUES:["VALUES","dataBlock"],$:[],"}":[]},"var":{VAR1:["VAR1"],VAR2:["VAR2"]},varOrIRIref:{VAR1:["var"],VAR2:["var"],IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"]},varOrTerm:{VAR1:["var"],VAR2:["var"],NIL:["graphTerm"],IRI_REF:["graphTerm"],TRUE:["graphTerm"],FALSE:["graphTerm"],BLANK_NODE_LABEL:["graphTerm"],ANON:["graphTerm"],PNAME_LN:["graphTerm"],PNAME_NS:["graphTerm"],STRING_LITERAL1:["graphTerm"],STRING_LITERAL2:["graphTerm"],STRING_LITERAL_LONG1:["graphTerm"],STRING_LITERAL_LONG2:["graphTerm"],INTEGER:["graphTerm"],DECIMAL:["graphTerm"],DOUBLE:["graphTerm"],INTEGER_POSITIVE:["graphTerm"],DECIMAL_POSITIVE:["graphTerm"],DOUBLE_POSITIVE:["graphTerm"],INTEGER_NEGATIVE:["graphTerm"],DECIMAL_NEGATIVE:["graphTerm"],DOUBLE_NEGATIVE:["graphTerm"]},verb:{VAR1:["storeProperty","varOrIRIref"],VAR2:["storeProperty","varOrIRIref"],IRI_REF:["storeProperty","varOrIRIref"],PNAME_LN:["storeProperty","varOrIRIref"],PNAME_NS:["storeProperty","varOrIRIref"],a:["storeProperty","a"]},verbPath:{"^":["path"],a:["path"],"!":["path"],"(":["path"],IRI_REF:["path"],PNAME_LN:["path"],PNAME_NS:["path"]},verbSimple:{VAR1:["var"],VAR2:["var"]},whereClause:{"{":["?WHERE","groupGraphPattern"],WHERE:["?WHERE","groupGraphPattern"]}}),s=/^(GROUP_CONCAT|DATATYPE|BASE|PREFIX|SELECT|CONSTRUCT|DESCRIBE|ASK|FROM|NAMED|ORDER|BY|LIMIT|ASC|DESC|OFFSET|DISTINCT|REDUCED|WHERE|GRAPH|OPTIONAL|UNION|FILTER|GROUP|HAVING|AS|VALUES|LOAD|CLEAR|DROP|CREATE|MOVE|COPY|SILENT|INSERT|DELETE|DATA|WITH|TO|USING|NAMED|MINUS|BIND|LANGMATCHES|LANG|BOUND|SAMETERM|ISIRI|ISURI|ISBLANK|ISLITERAL|REGEX|TRUE|FALSE|UNDEF|ADD|DEFAULT|ALL|SERVICE|INTO|IN|NOT|IRI|URI|BNODE|RAND|ABS|CEIL|FLOOR|ROUND|CONCAT|STRLEN|UCASE|LCASE|ENCODE_FOR_URI|CONTAINS|STRSTARTS|STRENDS|STRBEFORE|STRAFTER|YEAR|MONTH|DAY|HOURS|MINUTES|SECONDS|TIMEZONE|TZ|NOW|UUID|STRUUID|MD5|SHA1|SHA256|SHA384|SHA512|COALESCE|IF|STRLANG|STRDT|ISNUMERIC|SUBSTR|REPLACE|EXISTS|COUNT|SUM|MIN|MAX|AVG|SAMPLE|SEPARATOR|STR)/i,a=/^(\*|a|\.|\{|\}|,|\(|\)|;|\[|\]|\|\||&&|=|!=|!|<=|>=|<|>|\+|-|\/|\^\^|\?|\||\^)/,l=null,u="sparql11",p="sparql11",c=!0,d=t(),h=d.terminal,E={"*[,, object]":3,"*[(,),object]":3,"*[(,),objectPath]":3,"*[/,pathEltOrInverse]":2,object:2,objectPath:2,objectList:2,objectListPath:2,storeProperty:2,pathMod:2,"?pathMod":2,propertyListNotEmpty:1,propertyList:1,propertyListPath:1,propertyListPathNotEmpty:1,"?[verb,objectList]":1,"?[or([verbPath, verbSimple]),objectList]":1},f={"}":1,"]":0,")":1,"{":-1,"(":-1,"*[;,?[or([verbPath,verbSimple]),objectList]]":1};
return{token:i,startState:function(){return{tokenize:i,OK:!0,complete:c,errorStartPos:null,errorEndPos:null,queryType:l,possibleCurrent:r(p),possibleNext:r(p),allowVars:!0,allowBnodes:!0,storeProperty:!1,lastProperty:"",stack:[p]}},indent:n,electricChars:"}])"}}),e.defineMIME("application/x-sparql-query","sparql11")})},{codemirror:10}],4:[function(e,t){t.exports=Trie=function(){this.words=0,this.prefixes=0,this.children=[]},Trie.prototype={insert:function(e,t){if(0!=e.length){var r,i,n=this;if(void 0===t&&(t=0),t===e.length)return void n.words++;n.prefixes++,r=e[t],void 0===n.children[r]&&(n.children[r]=new Trie),i=n.children[r],i.insert(e,t+1)}},remove:function(e,t){if(0!=e.length){var r,i,n=this;if(void 0===t&&(t=0),void 0!==n){if(t===e.length)return void n.words--;n.prefixes--,r=e[t],i=n.children[r],i.remove(e,t+1)}}},update:function(e,t){0!=e.length&&0!=t.length&&(this.remove(e),this.insert(t))},countWord:function(e,t){if(0==e.length)return 0;var r,i,n=this,o=0;return void 0===t&&(t=0),t===e.length?n.words:(r=e[t],i=n.children[r],void 0!==i&&(o=i.countWord(e,t+1)),o)},countPrefix:function(e,t){if(0==e.length)return 0;var r,i,n=this,o=0;if(void 0===t&&(t=0),t===e.length)return n.prefixes;var r=e[t];return i=n.children[r],void 0!==i&&(o=i.countPrefix(e,t+1)),o},find:function(e){return 0==e.length?!1:this.countWord(e)>0?!0:!1},getAllWords:function(e){var t,r,i=this,n=[];if(void 0===e&&(e=""),void 0===i)return[];i.words>0&&n.push(e);for(t in i.children)r=i.children[t],n=n.concat(r.getAllWords(e+t));return n},autoComplete:function(e,t){var r,i,n=this;return 0==e.length?void 0===t?n.getAllWords(e):[]:(void 0===t&&(t=0),r=e[t],i=n.children[r],void 0===i?[]:t===e.length-1?i.getAllWords(e):i.autoComplete(e,t+1))}}},{}],5:[function(t,r,i){!function(n){"object"==typeof i&&"object"==typeof r?n(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],n):n(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function r(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var r=e.state.fullScreenRestore;t.style.width=r.width,t.style.height=r.height,window.scrollTo(r.scrollLeft,r.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(i,n,o){o==e.Init&&(o=!1),!o!=!n&&(n?t(i):r(i))})})},{"../../lib/codemirror":10}],6:[function(t,r,i){!function(n){"object"==typeof i&&"object"==typeof r?n(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],n):n(CodeMirror)}(function(e){function t(e,t,i,n){var o=e.getLineHandle(t.line),l=t.ch-1,u=l>=0&&a[o.text.charAt(l)]||a[o.text.charAt(++l)];if(!u)return null;var p=">"==u.charAt(1)?1:-1;if(i&&p>0!=(l==t.ch))return null;var c=e.getTokenTypeAt(s(t.line,l+1)),d=r(e,s(t.line,l+(p>0?1:0)),p,c||null,n);return null==d?null:{from:s(t.line,l),to:d&&d.pos,match:d&&d.ch==u.charAt(0),forward:p>0}}function r(e,t,r,i,n){for(var o=n&&n.maxScanLineLength||1e4,l=n&&n.maxScanLines||1e3,u=[],p=n&&n.bracketRegex?n.bracketRegex:/[(){}[\]]/,c=r>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),d=t.line;d!=c;d+=r){var h=e.getLine(d);if(h){var E=r>0?0:h.length-1,f=r>0?h.length:-1;if(!(h.length>o))for(d==t.line&&(E=t.ch-(0>r?1:0));E!=f;E+=r){var m=h.charAt(E);if(p.test(m)&&(void 0===i||e.getTokenTypeAt(s(d,E+1))==i)){var g=a[m];if(">"==g.charAt(1)==r>0)u.push(m);else{if(!u.length)return{pos:s(d,E),ch:m};u.pop()}}}}}return d-r==(r>0?e.lastLine():e.firstLine())?!1:null}function i(e,r,i){for(var n=e.state.matchBrackets.maxHighlightLineLength||1e3,a=[],l=e.listSelections(),u=0;u<l.length;u++){var p=l[u].empty()&&t(e,l[u].head,!1,i);if(p&&e.getLine(p.from.line).length<=n){var c=p.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";a.push(e.markText(p.from,s(p.from.line,p.from.ch+1),{className:c})),p.to&&e.getLine(p.to.line).length<=n&&a.push(e.markText(p.to,s(p.to.line,p.to.ch+1),{className:c}))}}if(a.length){o&&e.state.focused&&e.display.input.focus();var d=function(){e.operation(function(){for(var e=0;e<a.length;e++)a[e].clear()})};if(!r)return d;setTimeout(d,800)}}function n(e){e.operation(function(){l&&(l(),l=null),l=i(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),s=e.Pos,a={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,r,i){i&&i!=e.Init&&t.off("cursorActivity",n),r&&(t.state.matchBrackets="object"==typeof r?r:{},t.on("cursorActivity",n))}),e.defineExtension("matchBrackets",function(){i(this,!0)}),e.defineExtension("findMatchingBracket",function(e,r,i){return t(this,e,r,i)}),e.defineExtension("scanForBracket",function(e,t,i,n){return r(this,e,t,i,n)})})},{"../../lib/codemirror":10}],7:[function(t,r,i){!function(n){"object"==typeof i&&"object"==typeof r?n(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],n):n(CodeMirror)}(function(e){"use strict";function t(e,t){this.cm=e,this.options=this.buildOptions(t),this.widget=this.onClose=null}function r(e){return"string"==typeof e?e:e.text}function i(e,t){function r(e,r){var n;n="string"!=typeof r?function(e){return r(e,t)}:i.hasOwnProperty(r)?i[r]:r,o[e]=n}var i={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(-t.menuSize()+1,!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close},n=e.options.customKeys,o=n?{}:i;if(n)for(var s in n)n.hasOwnProperty(s)&&r(s,n[s]);var a=e.options.extraKeys;if(a)for(var s in a)a.hasOwnProperty(s)&&r(s,a[s]);return o}function n(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function o(t,o){this.completion=t,this.data=o;var l=this,u=t.cm,p=this.hints=document.createElement("ul");p.className="CodeMirror-hints",this.selectedHint=o.selectedHint||0;for(var c=o.list,d=0;d<c.length;++d){var h=p.appendChild(document.createElement("li")),E=c[d],f=s+(d!=this.selectedHint?"":" "+a);null!=E.className&&(f=E.className+" "+f),h.className=f,E.render?E.render(h,o,E):h.appendChild(document.createTextNode(E.displayText||r(E))),h.hintId=d}var m=u.cursorCoords(t.options.alignWithWord?o.from:null),g=m.left,v=m.bottom,x=!0;p.style.left=g+"px",p.style.top=v+"px";var N=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),T=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(t.options.container||document.body).appendChild(p);var L=p.getBoundingClientRect(),I=L.bottom-T;if(I>0){var y=L.bottom-L.top,A=m.top-(m.bottom-L.top);if(A-y>0)p.style.top=(v=m.top-y)+"px",x=!1;else if(y>T){p.style.height=T-5+"px",p.style.top=(v=m.bottom-L.top)+"px";var S=u.getCursor();o.from.ch!=S.ch&&(m=u.cursorCoords(S),p.style.left=(g=m.left)+"px",L=p.getBoundingClientRect())}}var C=L.left-N;if(C>0&&(L.right-L.left>N&&(p.style.width=N-5+"px",C-=L.right-L.left-N),p.style.left=(g=m.left-C)+"px"),u.addKeyMap(this.keyMap=i(t,{moveFocus:function(e,t){l.changeActive(l.selectedHint+e,t)},setFocus:function(e){l.changeActive(e)},menuSize:function(){return l.screenAmount()},length:c.length,close:function(){t.close()},pick:function(){l.pick()},data:o})),t.options.closeOnUnfocus){var R;u.on("blur",this.onBlur=function(){R=setTimeout(function(){t.close()},100)}),u.on("focus",this.onFocus=function(){clearTimeout(R)})}var b=u.getScrollInfo();return u.on("scroll",this.onScroll=function(){var e=u.getScrollInfo(),r=u.getWrapperElement().getBoundingClientRect(),i=v+b.top-e.top,n=i-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return x||(n+=p.offsetHeight),n<=r.top||n>=r.bottom?t.close():(p.style.top=i+"px",void(p.style.left=g+b.left-e.left+"px"))}),e.on(p,"dblclick",function(e){var t=n(p,e.target||e.srcElement);t&&null!=t.hintId&&(l.changeActive(t.hintId),l.pick())}),e.on(p,"click",function(e){var r=n(p,e.target||e.srcElement);r&&null!=r.hintId&&(l.changeActive(r.hintId),t.options.completeOnSingleClick&&l.pick())}),e.on(p,"mousedown",function(){setTimeout(function(){u.focus()},20)}),e.signal(o,"select",c[0],p.firstChild),!0}var s="CodeMirror-hint",a="CodeMirror-hint-active";e.showHint=function(e,t,r){if(!t)return e.showHint(r);r&&r.async&&(t.async=!0);var i={hint:t};if(r)for(var n in r)i[n]=r[n];return e.showHint(i)},e.defineExtension("showHint",function(r){if(!(this.listSelections().length>1||this.somethingSelected())){this.state.completionActive&&this.state.completionActive.close();var i=this.state.completionActive=new t(this,r),n=i.options.hint;if(n)return e.signal(this,"startCompletion",this),n.async?void n(this,function(e){i.showHints(e)},i.options):i.showHints(n(this,i.options))}}),t.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.widget&&this.widget.close(),this.onClose&&this.onClose(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,i){var n=t.list[i];n.hint?n.hint(this.cm,t,n):this.cm.replaceRange(r(n),n.from||t.from,n.to||t.to,"complete"),e.signal(t,"pick",n),this.close()},showHints:function(e){return e&&e.list.length&&this.active()?void(this.options.completeSingle&&1==e.list.length?this.pick(e,0):this.showWidget(e)):this.close()},showWidget:function(t){function r(){l||(l=!0,p.close(),p.cm.off("cursorActivity",a),t&&e.signal(t,"close"))}function i(){if(!l){e.signal(t,"update");var r=p.options.hint;r.async?r(p.cm,n,p.options):n(r(p.cm,p.options))}}function n(e){if(t=e,!l){if(!t||!t.list.length)return r();p.widget&&p.widget.close(),p.widget=new o(p,t)}}function s(){u&&(f(u),u=0)}function a(){s();var e=p.cm.getCursor(),t=p.cm.getLine(e.line);e.line!=d.line||t.length-e.ch!=h-d.ch||e.ch<d.ch||p.cm.somethingSelected()||e.ch&&c.test(t.charAt(e.ch-1))?p.close():(u=E(i),p.widget&&p.widget.close())}this.widget=new o(this,t),e.signal(t,"shown");var l,u=0,p=this,c=this.options.closeCharacters,d=this.cm.getCursor(),h=this.cm.getLine(d.line).length,E=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},f=window.cancelAnimationFrame||clearTimeout;this.cm.on("cursorActivity",a),this.onClose=r},buildOptions:function(e){var t=this.cm.options.hintOptions,r={};for(var i in l)r[i]=l[i];if(t)for(var i in t)void 0!==t[i]&&(r[i]=t[i]);if(e)for(var i in e)void 0!==e[i]&&(r[i]=e[i]);return r}},o.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 e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)}},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,r){if(t>=this.data.list.length?t=r?this.data.list.length-1:0:0>t&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i.className=i.className.replace(" "+a,""),i=this.hints.childNodes[this.selectedHint=t],i.className+=" "+a,i.offsetTop<this.hints.scrollTop?this.hints.scrollTop=i.offsetTop-3:i.offsetTop+i.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],i)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",function(t,r){var i,n=t.getHelpers(t.getCursor(),"hint");if(n.length)for(var o=0;o<n.length;o++){var s=n[o](t,r);if(s&&s.list.length)return s}else if(i=t.getHelper(t.getCursor(),"hintWords")){if(i)return e.hint.fromList(t,{words:i})}else if(e.hint.anyword)return e.hint.anyword(t,r)}),e.registerHelper("hint","fromList",function(t,r){for(var i=t.getCursor(),n=t.getTokenAt(i),o=[],s=0;s<r.words.length;s++){var a=r.words[s];a.slice(0,n.string.length)==n.string&&o.push(a)}return o.length?{list:o,from:e.Pos(i.line,n.start),to:e.Pos(i.line,n.end)}:void 0}),e.commands.autocomplete=e.showHint;var l={hint:e.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!1,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)})},{"../../lib/codemirror":10}],8:[function(t,r,i){!function(n){"object"==typeof i&&"object"==typeof r?n(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],n):n(CodeMirror)}(function(e){"use strict";e.runMode=function(t,r,i,n){var o=e.getMode(e.defaults,r),s=/MSIE \d/.test(navigator.userAgent),a=s&&(null==document.documentMode||document.documentMode<9);if(1==i.nodeType){var l=n&&n.tabSize||e.defaults.tabSize,u=i,p=0;u.innerHTML="",i=function(e,t){if("\n"==e)return u.appendChild(document.createTextNode(a?"\r":e)),void(p=0);for(var r="",i=0;;){var n=e.indexOf(" ",i);if(-1==n){r+=e.slice(i),p+=e.length-i;break}p+=n-i,r+=e.slice(i,n);var o=l-p%l;p+=o;for(var s=0;o>s;++s)r+=" ";i=n+1}if(t){var c=u.appendChild(document.createElement("span"));c.className="cm-"+t.replace(/ +/g," cm-"),c.appendChild(document.createTextNode(r))}else u.appendChild(document.createTextNode(r))}}for(var c=e.splitLines(t),d=n&&n.state||e.startState(o),h=0,E=c.length;E>h;++h){h&&i("\n");var f=new e.StringStream(c[h]);for(!f.string&&o.blankLine&&o.blankLine(d);!f.eol();){var m=o.token(f,d);i(f.current(),m,h,f.start,d),f.start=f.pos}}}})},{"../../lib/codemirror":10}],9:[function(t,r,i){!function(n){"object"==typeof i&&"object"==typeof r?n(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],n):n(CodeMirror)}(function(e){"use strict";function t(e,t,n,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),n=n?e.clipPos(n):i(0,0),this.pos={from:n,to:n},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(r,n){if(r){t.lastIndex=0;for(var o,s,a=e.getLine(n.line).slice(0,n.ch),l=0;;){t.lastIndex=l;var u=t.exec(a);if(!u)break;if(o=u,s=o.index,l=o.index+(o[0].length||1),l==a.length)break}var p=o&&o[0].length||0;p||(0==s&&0==a.length?o=void 0:s!=e.getLine(n.line).length&&p++)}else{t.lastIndex=n.ch;var a=e.getLine(n.line),o=t.exec(a),p=o&&o[0].length||0,s=o&&o.index;s+p==a.length||p||(p=1)}return o&&p?{from:i(n.line,s),to:i(n.line,s+p),match:o}:void 0};else{var s=t;o&&(t=t.toLowerCase());var a=o?function(e){return e.toLowerCase()}:function(e){return e},l=t.split("\n");if(1==l.length)this.matches=t.length?function(n,o){if(n){var l=e.getLine(o.line).slice(0,o.ch),u=a(l),p=u.lastIndexOf(t);if(p>-1)return p=r(l,u,p),{from:i(o.line,p),to:i(o.line,p+s.length)}}else{var l=e.getLine(o.line).slice(o.ch),u=a(l),p=u.indexOf(t);if(p>-1)return p=r(l,u,p)+o.ch,{from:i(o.line,p),to:i(o.line,p+s.length)}}}:function(){};else{var u=s.split("\n");this.matches=function(t,r){var n=l.length-1;if(t){if(r.line-(l.length-1)<e.firstLine())return;if(a(e.getLine(r.line).slice(0,u[n].length))!=l[l.length-1])return;for(var o=i(r.line,u[n].length),s=r.line-1,p=n-1;p>=1;--p,--s)if(l[p]!=a(e.getLine(s)))return;var c=e.getLine(s),d=c.length-u[0].length;if(a(c.slice(d))!=l[0])return;return{from:i(s,d),to:o}}if(!(r.line+(l.length-1)>e.lastLine())){var c=e.getLine(r.line),d=c.length-u[0].length;if(a(c.slice(d))==l[0]){for(var h=i(r.line,d),s=r.line+1,p=1;n>p;++p,++s)if(l[p]!=a(e.getLine(s)))return;if(a(e.getLine(s).slice(0,u[n].length))==l[n])return{from:h,to:i(s,u[n].length)}}}}}}}function r(e,t,r){if(e.length==t.length)return r;for(var i=Math.min(r,e.length);;){var n=e.slice(0,i).toLowerCase().length;if(r>n)++i;else{if(!(n>r))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 r.pos={from:t,to:t},r.atOccurrence=!1,!1}for(var r=this,n=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,n))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!n.line)return t(0);n=i(n.line-1,this.doc.getLine(n.line-1).length)}else{var o=this.doc.lineCount();if(n.line==o-1)return t(o);n=i(n.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to),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,r,i){return new t(this.doc,e,r,i)}),e.defineDocExtension("getSearchCursor",function(e,r,i){return new t(this,e,r,i)}),e.defineExtension("selectMatches",function(t,r){for(var i,n=[],o=this.getSearchCursor(t,this.getCursor("from"),r);(i=o.findNext())&&!(e.cmpPos(o.to(),this.getCursor("to"))>0);)n.push({anchor:o.from(),head:o.to()});n.length&&this.setSelections(n,0)})})},{"../../lib/codemirror":10}],10:[function(t,r,i){!function(t){if("object"==typeof i&&"object"==typeof r)r.exports=t();else{if("function"==typeof e&&e.amd)return e([],t);this.CodeMirror=t()}}(function(){"use strict";function e(r,i){if(!(this instanceof e))return new e(r,i);this.options=i=i?mo(i):{},mo(_s,i,!1),E(i);var n=i.value;"string"==typeof n&&(n=new ia(n,i.mode)),this.doc=n;var o=this.display=new t(r,n);o.wrapper.CodeMirror=this,p(this),l(this),i.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),i.autofocus&&!ps&&Ar(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new lo},Jo&&11>es&&setTimeout(go(yr,this,!0),20),Rr(this),Po(),Jt(this),this.curOp.forceUpdate=!0,bn(this,n),i.autofocus&&!ps||Ao()==o.input?setTimeout(go(Qr,this),20):Zr(this);for(var s in Ms)Ms.hasOwnProperty(s)&&Ms[s](this,i[s],ws);N(this);for(var a=0;a<Us.length;++a)Us[a](this);tr(this)}function t(e,t){var r=this,i=r.input=To("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");ts?i.style.width="1000px":i.setAttribute("wrap","off"),us&&(i.style.border="1px solid black"),i.setAttribute("autocorrect","off"),i.setAttribute("autocapitalize","off"),i.setAttribute("spellcheck","false"),r.inputDiv=To("div",[i],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),r.scrollbarH=To("div",[To("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar"),r.scrollbarV=To("div",[To("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r.scrollbarFiller=To("div",null,"CodeMirror-scrollbar-filler"),r.gutterFiller=To("div",null,"CodeMirror-gutter-filler"),r.lineDiv=To("div",null,"CodeMirror-code"),r.selectionDiv=To("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=To("div",null,"CodeMirror-cursors"),r.measure=To("div",null,"CodeMirror-measure"),r.lineMeasure=To("div",null,"CodeMirror-measure"),r.lineSpace=To("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=To("div",[To("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=To("div",[r.mover],"CodeMirror-sizer"),r.heightForcer=To("div",null,null,"position: absolute; height: "+ha+"px; width: 1px;"),r.gutters=To("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=To("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=To("div",[r.inputDiv,r.scrollbarH,r.scrollbarV,r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),Jo&&8>es&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),us&&(i.style.width="0px"),ts||(r.scroller.draggable=!0),ss&&(r.inputDiv.style.height="1px",r.inputDiv.style.position="absolute"),Jo&&8>es&&(r.scrollbarH.style.minHeight=r.scrollbarV.style.minWidth="18px"),e.appendChild?e.appendChild(r.wrapper):e(r.wrapper),r.viewFrom=r.viewTo=t.first,r.view=[],r.externalMeasured=null,r.viewOffset=0,r.lastSizeC=0,r.updateLineNumbers=null,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.prevInput="",r.alignWidgets=!1,r.pollingFast=!1,r.poll=new lo,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.inaccurateSelection=!1,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null}function r(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),i(t)}function i(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Lt(e,100),e.state.modeGen++,e.curOp&&Er(e)}function n(e){e.options.lineWrapping?(Ro(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth=""):(Co(e.display.wrapper,"CodeMirror-wrap"),h(e)),s(e),Er(e),Vt(e),setTimeout(function(){g(e)},100)}function o(e){var t=Qt(e.display),r=e.options.lineWrapping,i=r&&Math.max(5,e.display.scroller.clientWidth/Zt(e.display)-3);return function(n){if(tn(e.doc,n))return 0;var o=0;if(n.widgets)for(var s=0;s<n.widgets.length;s++)n.widgets[s].height&&(o+=n.widgets[s].height);return r?o+(Math.ceil(n.text.length/i)||1)*t:o+t}}function s(e){var t=e.doc,r=o(e);t.iter(function(e){var t=r(e);t!=e.height&&_n(e,t)})}function a(e){var t=Ws[e.options.keyMap],r=t.style;e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(r?" cm-keymap-"+r:"")}function l(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Vt(e)}function u(e){p(e),Er(e),setTimeout(function(){x(e)},20)}function p(e){var t=e.display.gutters,r=e.options.gutters;Lo(t);for(var i=0;i<r.length;++i){var n=r[i],o=t.appendChild(To("div",null,"CodeMirror-gutter "+n));"CodeMirror-linenumbers"==n&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=i?"":"none",c(e)}function c(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px",e.display.scrollbarH.style.left=e.options.fixedGutter?t+"px":0}function d(e){if(0==e.height)return 0;for(var t,r=e.text.length,i=e;t=Yi(i);){var n=t.find(0,!0);i=n.from.line,r+=n.from.ch-n.to.ch}for(i=e;t=Ki(i);){var n=t.find(0,!0);r-=i.text.length-n.from.ch,i=n.to.line,r+=i.text.length-n.to.ch}return r}function h(e){var t=e.display,r=e.doc;t.maxLine=On(r,r.first),t.maxLineLength=d(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=d(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function E(e){var t=ho(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 f(e){return e.display.scroller.clientHeight-e.display.wrapper.clientHeight<ha-3}function m(e){var t=e.display.scroller;return{clientHeight:t.clientHeight,barHeight:e.display.scrollbarV.clientHeight,scrollWidth:t.scrollWidth,clientWidth:t.clientWidth,hScrollbarTakesSpace:f(e),barWidth:e.display.scrollbarH.clientWidth,docHeight:Math.round(e.doc.height+Ct(e.display))}}function g(e,t){t||(t=m(e));var r=e.display,i=_o(r.measure),n=t.docHeight+ha,o=t.scrollWidth>t.clientWidth;o&&t.scrollWidth<=t.clientWidth+1&&i>0&&!t.hScrollbarTakesSpace&&(o=!1);var s=n>t.clientHeight;if(s?(r.scrollbarV.style.display="block",r.scrollbarV.style.bottom=o?i+"px":"0",r.scrollbarV.firstChild.style.height=Math.max(0,n-t.clientHeight+(t.barHeight||r.scrollbarV.clientHeight))+"px"):(r.scrollbarV.style.display="",r.scrollbarV.firstChild.style.height="0"),o?(r.scrollbarH.style.display="block",r.scrollbarH.style.right=s?i+"px":"0",r.scrollbarH.firstChild.style.width=t.scrollWidth-t.clientWidth+(t.barWidth||r.scrollbarH.clientWidth)+"px"):(r.scrollbarH.style.display="",r.scrollbarH.firstChild.style.width="0"),o&&s?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=r.scrollbarFiller.style.width=i+"px"):r.scrollbarFiller.style.display="",o&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=i+"px",r.gutterFiller.style.width=r.gutters.offsetWidth+"px"):r.gutterFiller.style.display="",!e.state.checkedOverlayScrollbar&&t.clientHeight>0){if(0===i){var a=cs&&!as?"12px":"18px";r.scrollbarV.style.minWidth=r.scrollbarH.style.minHeight=a;var l=function(t){eo(t)!=r.scrollbarV&&eo(t)!=r.scrollbarH&&ur(e,Dr)(t)};ua(r.scrollbarV,"mousedown",l),ua(r.scrollbarH,"mousedown",l)}e.state.checkedOverlayScrollbar=!0}}function v(e,t,r){var i=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;i=Math.floor(i-St(e));var n=r&&null!=r.bottom?r.bottom:i+e.wrapper.clientHeight,o=wn(t,i),s=wn(t,n);if(r&&r.ensure){var a=r.ensure.from.line,l=r.ensure.to.line;if(o>a)return{from:a,to:wn(t,Gn(On(t,a))+e.wrapper.clientHeight)};if(Math.min(l,t.lastLine())>=s)return{from:wn(t,Gn(On(t,l))-e.wrapper.clientHeight),to:l}}return{from:o,to:Math.max(s,o+1)}}function x(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=L(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,o=i+"px",s=0;s<r.length;s++)if(!r[s].hidden){e.options.fixedGutter&&r[s].gutter&&(r[s].gutter.style.left=o);var a=r[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=i+n+"px")}}function N(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=T(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var n=i.measure.appendChild(To("div",[To("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=n.firstChild.offsetWidth,s=n.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-s),i.lineNumWidth=i.lineNumInnerWidth+s,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",c(e),!0}return!1}function T(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function L(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function I(e,t,r){var i=e.display;this.viewport=t,this.visible=v(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.oldViewFrom=i.viewFrom,this.oldViewTo=i.viewTo,this.oldScrollerWidth=i.scroller.clientWidth,this.force=r,this.dims=P(e)}function y(e,t){var r=e.display,i=e.doc;if(t.editorIsHidden)return mr(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&0==Nr(e))return!1;N(e)&&(mr(e),t.dims=P(e));var n=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),s=Math.min(n,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(i.first,r.viewFrom)),r.viewTo>s&&r.viewTo-s<20&&(s=Math.min(n,r.viewTo)),gs&&(o=Ji(e.doc,o),s=en(e.doc,s));var a=o!=r.viewFrom||s!=r.viewTo||r.lastSizeC!=t.wrapperHeight;xr(e,o,s),r.viewOffset=Gn(On(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var l=Nr(e);if(!a&&0==l&&!t.force&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Ao();return l>4&&(r.lineDiv.style.display="none"),D(e,r.updateLineNumbers,t.dims),l>4&&(r.lineDiv.style.display=""),u&&Ao()!=u&&u.offsetHeight&&u.focus(),Lo(r.cursorDiv),Lo(r.selectionDiv),a&&(r.lastSizeC=t.wrapperHeight,Lt(e,400)),r.updateLineNumbers=null,!0}function A(e,t){for(var r=t.force,i=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldScrollerWidth!=e.display.scroller.clientWidth)r=!0;else if(r=!1,i&&null!=i.top&&(i={top:Math.min(e.doc.height+Ct(e.display)-ha-e.display.scroller.clientHeight,i.top)}),t.visible=v(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!y(e,t))break;b(e);var o=m(e);vt(e),C(e,o),g(e,o)}ro(e,"update",e),(e.display.viewFrom!=t.oldViewFrom||e.display.viewTo!=t.oldViewTo)&&ro(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo)}function S(e,t){var r=new I(e,t);if(y(e,r)){b(e),A(e,r);var i=m(e);vt(e),C(e,i),g(e,i)}}function C(e,t){e.display.sizer.style.minHeight=e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=Math.max(t.docHeight,t.clientHeight-ha)+"px"}function R(e,t){e.display.sizer.offsetWidth+e.display.gutters.offsetWidth<e.display.scroller.clientWidth-1&&(e.display.sizer.style.minHeight=e.display.heightForcer.style.top="0px",e.display.gutters.style.height=t.docHeight+"px")}function b(e){for(var t=e.display,r=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var n,o=t.view[i];if(!o.hidden){if(Jo&&8>es){var s=o.node.offsetTop+o.node.offsetHeight;n=s-r,r=s}else{var a=o.node.getBoundingClientRect();n=a.bottom-a.top}var l=o.line.height-n;if(2>n&&(n=Qt(t)),(l>.001||-.001>l)&&(_n(o.line,n),O(o.line),o.rest))for(var u=0;u<o.rest.length;u++)O(o.rest[u])}}}function O(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function P(e){for(var t=e.display,r={},i={},n=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s)r[e.options.gutters[s]]=o.offsetLeft+o.clientLeft+n,i[e.options.gutters[s]]=o.clientWidth;return{fixedPos:L(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function D(e,t,r){function i(t){var r=t.nextSibling;return ts&&cs&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var n=e.display,o=e.options.lineNumbers,s=n.lineDiv,a=s.firstChild,l=n.view,u=n.viewFrom,p=0;p<l.length;p++){var c=l[p];if(c.hidden);else if(c.node){for(;a!=c.node;)a=i(a);var d=o&&null!=t&&u>=t&&c.lineNumber;c.changes&&(ho(c.changes,"gutter")>-1&&(d=!1),_(e,c,u,r)),d&&(Lo(c.lineNumber),c.lineNumber.appendChild(document.createTextNode(T(e.options,u)))),a=c.node.nextSibling}else{var h=H(e,c,u,r);s.insertBefore(h,a)}u+=c.size}for(;a;)a=i(a)}function _(e,t,r,i){for(var n=0;n<t.changes.length;n++){var o=t.changes[n];"text"==o?k(e,t):"gutter"==o?U(e,t,r,i):"class"==o?B(t):"widget"==o&&V(t,i)}t.changes=null}function M(e){return e.node==e.text&&(e.node=To("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Jo&&8>es&&(e.node.style.zIndex=2)),e.node}function w(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=M(e);e.background=r.insertBefore(To("div",null,t),r.firstChild)}}function G(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):gn(e,t)}function k(e,t){var r=t.text.className,i=G(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,B(t)):r&&(t.text.className=r)}function B(e){w(e),e.line.wrapClass?M(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function U(e,t,r,i){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var n=t.line.gutterMarkers;if(e.options.lineNumbers||n){var o=M(t),s=t.gutter=o.insertBefore(To("div",null,"CodeMirror-gutter-wrapper","position: absolute; left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px"),t.text);if(!e.options.lineNumbers||n&&n["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(To("div",T(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),n)for(var a=0;a<e.options.gutters.length;++a){var l=e.options.gutters[a],u=n.hasOwnProperty(l)&&n[l];
u&&s.appendChild(To("div",[u],"CodeMirror-gutter-elt","left: "+i.gutterLeft[l]+"px; width: "+i.gutterWidth[l]+"px"))}}}function V(e,t){e.alignable&&(e.alignable=null);for(var r,i=e.node.firstChild;i;i=r){var r=i.nextSibling;"CodeMirror-linewidget"==i.className&&e.node.removeChild(i)}F(e,t)}function H(e,t,r,i){var n=G(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),B(t),U(e,t,r,i),F(t,i),t.node}function F(e,t){if(j(e.line,e,t,!0),e.rest)for(var r=0;r<e.rest.length;r++)j(e.rest[r],e,t,!1)}function j(e,t,r,i){if(e.widgets)for(var n=M(t),o=0,s=e.widgets;o<s.length;++o){var a=s[o],l=To("div",[a.node],"CodeMirror-linewidget");a.handleMouseEvents||(l.ignoreEvents=!0),W(a,l,t,r),i&&a.above?n.insertBefore(l,t.gutter||t.text):n.appendChild(l),ro(a,"redraw")}}function W(e,t,r,i){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var n=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(n-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=n+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function q(e){return vs(e.line,e.ch)}function z(e,t){return xs(e,t)<0?t:e}function X(e,t){return xs(e,t)<0?e:t}function Y(e,t){this.ranges=e,this.primIndex=t}function K(e,t){this.anchor=e,this.head=t}function $(e,t){var r=e[t];e.sort(function(e,t){return xs(e.from(),t.from())}),t=ho(e,r);for(var i=1;i<e.length;i++){var n=e[i],o=e[i-1];if(xs(o.to(),n.from())>=0){var s=X(o.from(),n.from()),a=z(o.to(),n.to()),l=o.empty()?n.from()==n.head:o.from()==o.head;t>=i&&--t,e.splice(--i,2,new K(l?a:s,l?s:a))}}return new Y(e,t)}function Q(e,t){return new Y([new K(e,t||e)],0)}function Z(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function J(e,t){if(t.line<e.first)return vs(e.first,0);var r=e.first+e.size-1;return t.line>r?vs(r,On(e,r).text.length):et(t,On(e,t.line).text.length)}function et(e,t){var r=e.ch;return null==r||r>t?vs(e.line,t):0>r?vs(e.line,0):e}function tt(e,t){return t>=e.first&&t<e.first+e.size}function rt(e,t){for(var r=[],i=0;i<t.length;i++)r[i]=J(e,t[i]);return r}function it(e,t,r,i){if(e.cm&&e.cm.display.shift||e.extend){var n=t.anchor;if(i){var o=xs(r,n)<0;o!=xs(i,n)<0?(n=r,r=i):o!=xs(r,i)<0&&(r=i)}return new K(n,r)}return new K(i||r,r)}function nt(e,t,r,i){pt(e,new Y([it(e,e.sel.primary(),t,r)],0),i)}function ot(e,t,r){for(var i=[],n=0;n<e.sel.ranges.length;n++)i[n]=it(e,e.sel.ranges[n],t[n],null);var o=$(i,e.sel.primIndex);pt(e,o,r)}function st(e,t,r,i){var n=e.sel.ranges.slice(0);n[t]=r,pt(e,$(n,e.sel.primIndex),i)}function at(e,t,r,i){pt(e,Q(t,r),i)}function lt(e,t){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new K(J(e,t[r].anchor),J(e,t[r].head))}};return ca(e,"beforeSelectionChange",e,r),e.cm&&ca(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?$(r.ranges,r.ranges.length-1):t}function ut(e,t,r){var i=e.history.done,n=co(i);n&&n.ranges?(i[i.length-1]=t,ct(e,t,r)):pt(e,t,r)}function pt(e,t,r){ct(e,t,r),Wn(e,e.sel,e.cm?e.cm.curOp.id:0/0,r)}function ct(e,t,r){(so(e,"beforeSelectionChange")||e.cm&&so(e.cm,"beforeSelectionChange"))&&(t=lt(e,t));var i=r&&r.bias||(xs(t.primary().head,e.sel.primary().head)<0?-1:1);dt(e,Et(e,t,i,!0)),r&&r.scroll===!1||!e.cm||vi(e.cm)}function dt(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,oo(e.cm)),ro(e,"cursorActivity",e))}function ht(e){dt(e,Et(e,e.sel,null,!1),fa)}function Et(e,t,r,i){for(var n,o=0;o<t.ranges.length;o++){var s=t.ranges[o],a=ft(e,s.anchor,r,i),l=ft(e,s.head,r,i);(n||a!=s.anchor||l!=s.head)&&(n||(n=t.ranges.slice(0,o)),n[o]=new K(a,l))}return n?$(n,t.primIndex):t}function ft(e,t,r,i){var n=!1,o=t,s=r||1;e.cantEdit=!1;e:for(;;){var a=On(e,o.line);if(a.markedSpans)for(var l=0;l<a.markedSpans.length;++l){var u=a.markedSpans[l],p=u.marker;if((null==u.from||(p.inclusiveLeft?u.from<=o.ch:u.from<o.ch))&&(null==u.to||(p.inclusiveRight?u.to>=o.ch:u.to>o.ch))){if(i&&(ca(p,"beforeCursorEnter"),p.explicitlyCleared)){if(a.markedSpans){--l;continue}break}if(!p.atomic)continue;var c=p.find(0>s?-1:1);if(0==xs(c,o)&&(c.ch+=s,c.ch<0?c=c.line>e.first?J(e,vs(c.line-1)):null:c.ch>a.text.length&&(c=c.line<e.first+e.size-1?vs(c.line+1,0):null),!c)){if(n)return i?(e.cantEdit=!0,vs(e.first,0)):ft(e,t,r,!0);n=!0,c=t,s=-s}o=c;continue e}}return o}}function mt(e){for(var t=e.display,r=e.doc,i={},n=i.cursors=document.createDocumentFragment(),o=i.selection=document.createDocumentFragment(),s=0;s<r.sel.ranges.length;s++){var a=r.sel.ranges[s],l=a.empty();(l||e.options.showCursorWhenSelecting)&&xt(e,a,n),l||Nt(e,a,o)}if(e.options.moveInputWithCursor){var u=zt(e,r.sel.primary().head,"div"),p=t.wrapper.getBoundingClientRect(),c=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,u.top+c.top-p.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,u.left+c.left-p.left))}return i}function gt(e,t){Io(e.display.cursorDiv,t.cursors),Io(e.display.selectionDiv,t.selection),null!=t.teTop&&(e.display.inputDiv.style.top=t.teTop+"px",e.display.inputDiv.style.left=t.teLeft+"px")}function vt(e){gt(e,mt(e))}function xt(e,t,r){var i=zt(e,t.head,"div",null,null,!e.options.singleCursorHeightPerLine),n=r.appendChild(To("div"," ","CodeMirror-cursor"));if(n.style.left=i.left+"px",n.style.top=i.top+"px",n.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var o=r.appendChild(To("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=i.other.left+"px",o.style.top=i.other.top+"px",o.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Nt(e,t,r){function i(e,t,r,i){0>t&&(t=0),t=Math.round(t),i=Math.round(i),a.appendChild(To("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?p-e:r)+"px; height: "+(i-t)+"px"))}function n(t,r,n){function o(r,i){return qt(e,vs(t,r),"div",c,i)}var a,l,c=On(s,t),d=c.text.length;return ko(kn(c),r||0,null==n?d:n,function(e,t,s){var c,h,E,f=o(e,"left");if(e==t)c=f,h=E=f.left;else{if(c=o(t-1,"right"),"rtl"==s){var m=f;f=c,c=m}h=f.left,E=c.right}null==r&&0==e&&(h=u),c.top-f.top>3&&(i(h,f.top,null,f.bottom),h=u,f.bottom<c.top&&i(h,f.bottom,null,c.top)),null==n&&t==d&&(E=p),(!a||f.top<a.top||f.top==a.top&&f.left<a.left)&&(a=f),(!l||c.bottom>l.bottom||c.bottom==l.bottom&&c.right>l.right)&&(l=c),u+1>h&&(h=u),i(h,c.top,E-h,c.bottom)}),{start:a,end:l}}var o=e.display,s=e.doc,a=document.createDocumentFragment(),l=Rt(e.display),u=l.left,p=o.lineSpace.offsetWidth-l.right,c=t.from(),d=t.to();if(c.line==d.line)n(c.line,c.ch,d.ch);else{var h=On(s,c.line),E=On(s,d.line),f=Qi(h)==Qi(E),m=n(c.line,c.ch,f?h.text.length+1:null).end,g=n(d.line,f?0:null,d.ch).start;f&&(m.top<g.top-2?(i(m.right,m.top,null,m.bottom),i(u,g.top,g.left,g.bottom)):i(m.right,m.top,g.left-m.right,m.bottom)),m.bottom<g.top&&i(u,m.bottom,null,g.top)}r.appendChild(a)}function Tt(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 Lt(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,go(It,e))}function It(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,i=Hs(t.mode,At(e,t.frontier)),n=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var s=o.styles,a=hn(e,o,i,!0);o.styles=a.styles;var l=o.styleClasses,u=a.classes;u?o.styleClasses=u:l&&(o.styleClasses=null);for(var p=!s||s.length!=o.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),c=0;!p&&c<s.length;++c)p=s[c]!=o.styles[c];p&&n.push(t.frontier),o.stateAfter=Hs(t.mode,i)}else fn(e,o.text,i),o.stateAfter=t.frontier%5==0?Hs(t.mode,i):null;return++t.frontier,+new Date>r?(Lt(e,e.options.workDelay),!0):void 0}),n.length&&lr(e,function(){for(var t=0;t<n.length;t++)fr(e,n[t],"text")})}}function yt(e,t,r){for(var i,n,o=e.doc,s=r?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>s;--a){if(a<=o.first)return o.first;var l=On(o,a-1);if(l.stateAfter&&(!r||a<=o.frontier))return a;var u=va(l.text,null,e.options.tabSize);(null==n||i>u)&&(n=a-1,i=u)}return n}function At(e,t,r){var i=e.doc,n=e.display;if(!i.mode.startState)return!0;var o=yt(e,t,r),s=o>i.first&&On(i,o-1).stateAfter;return s=s?Hs(i.mode,s):Fs(i.mode),i.iter(o,t,function(r){fn(e,r.text,s);var a=o==t-1||o%5==0||o>=n.viewFrom&&o<n.viewTo;r.stateAfter=a?Hs(i.mode,s):null,++o}),r&&(i.frontier=o),s}function St(e){return e.lineSpace.offsetTop}function Ct(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Rt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Io(e.measure,To("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(e.cachedPaddingH=i),i}function bt(e,t,r){var i=e.options.lineWrapping,n=i&&e.display.scroller.clientWidth;if(!t.measure.heights||i&&t.measure.width!=n){var o=t.measure.heights=[];if(i){t.measure.width=n;for(var s=t.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],u=s[a+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Ot(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var i=0;i<e.rest.length;i++)if(Mn(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Pt(e,t){t=Qi(t);var r=Mn(t),i=e.display.externalMeasured=new dr(e.doc,t,r);i.lineN=r;var n=i.built=gn(e,i);return i.text=n.pre,Io(e.display.lineMeasure,n.pre),i}function Dt(e,t,r,i){return wt(e,Mt(e,t),r,i)}function _t(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[gr(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Mt(e,t){var r=Mn(t),i=_t(e,r);i&&!i.text?i=null:i&&i.changes&&_(e,i,r,P(e)),i||(i=Pt(e,t));var n=Ot(i,t,r);return{line:t,view:i,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function wt(e,t,r,i,n){t.before&&(r=-1);var o,s=r+(i||"");return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(bt(e,t.view,t.rect),t.hasHeights=!0),o=Gt(e,t,r,i),o.bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:n?o.rtop:o.top,bottom:n?o.rbottom:o.bottom}}function Gt(e,t,r,i){for(var n,o,s,a,l=t.map,u=0;u<l.length;u+=3){var p=l[u],c=l[u+1];if(p>r?(o=0,s=1,a="left"):c>r?(o=r-p,s=o+1):(u==l.length-3||r==c&&l[u+3]>r)&&(s=c-p,o=s-1,r>=c&&(a="right")),null!=o){if(n=l[u+2],p==c&&i==(n.insertLeft?"left":"right")&&(a=i),"left"==i&&0==o)for(;u&&l[u-2]==l[u-3]&&l[u-1].insertLeft;)n=l[(u-=3)+2],a="left";if("right"==i&&o==c-p)for(;u<l.length-3&&l[u+3]==l[u+4]&&!l[u+5].insertLeft;)n=l[(u+=3)+2],a="right";break}}var d;if(3==n.nodeType){for(var u=0;4>u;u++){for(;o&&No(t.line.text.charAt(p+o));)--o;for(;c>p+s&&No(t.line.text.charAt(p+s));)++s;if(Jo&&9>es&&0==o&&s==c-p)d=n.parentNode.getBoundingClientRect();else if(Jo&&e.options.lineWrapping){var h=Ta(n,o,s).getClientRects();d=h.length?h["right"==i?h.length-1:0]:Is}else d=Ta(n,o,s).getBoundingClientRect()||Is;if(d.left||d.right||0==o)break;s=o,o-=1,a="right"}Jo&&11>es&&(d=kt(e.display.measure,d))}else{o>0&&(a=i="right");var h;d=e.options.lineWrapping&&(h=n.getClientRects()).length>1?h["right"==i?h.length-1:0]:n.getBoundingClientRect()}if(Jo&&9>es&&!o&&(!d||!d.left&&!d.right)){var E=n.parentNode.getClientRects()[0];d=E?{left:E.left,right:E.left+Zt(e.display),top:E.top,bottom:E.bottom}:Is}for(var f=d.top-t.rect.top,m=d.bottom-t.rect.top,g=(f+m)/2,v=t.view.measure.heights,u=0;u<v.length-1&&!(g<v[u]);u++);var x=u?v[u-1]:0,N=v[u],T={left:("right"==a?d.right:d.left)-t.rect.left,right:("left"==a?d.left:d.right)-t.rect.left,top:x,bottom:N};return d.left||d.right||(T.bogus=!0),e.options.singleCursorHeightPerLine||(T.rtop=f,T.rbottom=m),T}function kt(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Go(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*i,bottom:t.bottom*i}}function Bt(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Ut(e){e.display.externalMeasure=null,Lo(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Bt(e.display.view[t])}function Vt(e){Ut(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ht(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ft(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function jt(e,t,r,i){if(t.widgets)for(var n=0;n<t.widgets.length;++n)if(t.widgets[n].above){var o=on(t.widgets[n]);r.top+=o,r.bottom+=o}if("line"==i)return r;i||(i="local");var s=Gn(t);if("local"==i?s+=St(e.display):s-=e.display.viewOffset,"page"==i||"window"==i){var a=e.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==i?0:Ft());var l=a.left+("window"==i?0:Ht());r.left+=l,r.right+=l}return r.top+=s,r.bottom+=s,r}function Wt(e,t,r){if("div"==r)return t;var i=t.left,n=t.top;if("page"==r)i-=Ht(),n-=Ft();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();i+=o.left,n+=o.top}var s=e.display.lineSpace.getBoundingClientRect();return{left:i-s.left,top:n-s.top}}function qt(e,t,r,i,n){return i||(i=On(e.doc,t.line)),jt(e,i,Dt(e,i,t.ch,n),r)}function zt(e,t,r,i,n,o){function s(t,s){var a=wt(e,n,t,s?"right":"left",o);return s?a.left=a.right:a.right=a.left,jt(e,i,a,r)}function a(e,t){var r=l[t],i=r.level%2;return e==Bo(r)&&t&&r.level<l[t-1].level?(r=l[--t],e=Uo(r)-(r.level%2?0:1),i=!0):e==Uo(r)&&t<l.length-1&&r.level<l[t+1].level&&(r=l[++t],e=Bo(r)-r.level%2,i=!1),i&&e==r.to&&e>r.from?s(e-1):s(e,i)}i=i||On(e.doc,t.line),n||(n=Mt(e,i));var l=kn(i),u=t.ch;if(!l)return s(u);var p=zo(l,u),c=a(u,p);return null!=wa&&(c.other=a(u,wa)),c}function Xt(e,t){var r=0,t=J(e.doc,t);e.options.lineWrapping||(r=Zt(e.display)*t.ch);var i=On(e.doc,t.line),n=Gn(i)+St(e.display);return{left:r,right:r,top:n,bottom:n+i.height}}function Yt(e,t,r,i){var n=vs(e,t);return n.xRel=i,r&&(n.outside=!0),n}function Kt(e,t,r){var i=e.doc;if(r+=e.display.viewOffset,0>r)return Yt(i.first,0,!0,-1);var n=wn(i,r),o=i.first+i.size-1;if(n>o)return Yt(i.first+i.size-1,On(i,o).text.length,!0,1);0>t&&(t=0);for(var s=On(i,n);;){var a=$t(e,s,n,t,r),l=Ki(s),u=l&&l.find(0,!0);if(!l||!(a.ch>u.from.ch||a.ch==u.from.ch&&a.xRel>0))return a;n=Mn(s=u.to.line)}}function $t(e,t,r,i,n){function o(i){var n=zt(e,vs(r,i),"line",t,u);return a=!0,s>n.bottom?n.left-l:s<n.top?n.left+l:(a=!1,n.left)}var s=n-Gn(t),a=!1,l=2*e.display.wrapper.clientWidth,u=Mt(e,t),p=kn(t),c=t.text.length,d=Vo(t),h=Ho(t),E=o(d),f=a,m=o(h),g=a;if(i>m)return Yt(r,h,g,1);for(;;){if(p?h==d||h==Yo(t,d,1):1>=h-d){for(var v=E>i||m-i>=i-E?d:h,x=i-(v==d?E:m);No(t.text.charAt(v));)++v;var N=Yt(r,v,v==d?f:g,-1>x?-1:x>1?1:0);return N}var T=Math.ceil(c/2),L=d+T;if(p){L=d;for(var I=0;T>I;++I)L=Yo(t,L,1)}var y=o(L);y>i?(h=L,m=y,(g=a)&&(m+=1e3),c=T):(d=L,E=y,f=a,c-=T)}}function Qt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ns){Ns=To("pre");for(var t=0;49>t;++t)Ns.appendChild(document.createTextNode("x")),Ns.appendChild(To("br"));Ns.appendChild(document.createTextNode("x"))}Io(e.measure,Ns);var r=Ns.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Lo(e.measure),r||1}function Zt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=To("span","xxxxxxxxxx"),r=To("pre",[t]);Io(e.measure,r);var i=t.getBoundingClientRect(),n=(i.right-i.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function Jt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++As},ys?ys.ops.push(e.curOp):e.curOp.ownsGroup=ys={ops:[e.curOp],delayedCallbacks:[]}}function er(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r]();for(var i=0;i<e.ops.length;i++){var n=e.ops[i];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++](n.cm)}}while(r<t.length)}function tr(e){var t=e.curOp,r=t.ownsGroup;if(r)try{er(r)}finally{ys=null;for(var i=0;i<r.ops.length;i++)r.ops[i].cm.curOp=null;rr(r)}}function rr(e){for(var t=e.ops,r=0;r<t.length;r++)ir(t[r]);for(var r=0;r<t.length;r++)nr(t[r]);for(var r=0;r<t.length;r++)or(t[r]);for(var r=0;r<t.length;r++)sr(t[r]);for(var r=0;r<t.length;r++)ar(t[r])}function ir(e){var t=e.cm,r=t.display;e.updateMaxLine&&h(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 I(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function nr(e){e.updatedDisplay=e.mustUpdate&&y(e.cm,e.update)}function or(e){var t=e.cm,r=t.display;e.updatedDisplay&&b(t),e.barMeasure=m(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Dt(t,r.maxLine,r.maxLine.text.length).left+3,e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo+ha-r.scroller.clientWidth)),(e.updatedDisplay||e.selectionChanged)&&(e.newSelectionNodes=mt(t))}function sr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Hr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.newSelectionNodes&>(t,e.newSelectionNodes),e.updatedDisplay&&C(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&g(t,e.barMeasure),e.selectionChanged&&Tt(t),t.state.focused&&e.updateInput&&yr(t,e.typing)}function ar(e){var t=e.cm,r=t.display,i=t.doc;if(null!=e.adjustWidthTo&&Math.abs(e.barMeasure.scrollWidth-t.display.scroller.scrollWidth)>1&&g(t),e.updatedDisplay&&A(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)){var n=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop));r.scroller.scrollTop=r.scrollbarV.scrollTop=i.scrollTop=n}if(null!=e.scrollLeft&&(r.scroller.scrollLeft!=e.scrollLeft||e.forceScroll)){var o=Math.max(0,Math.min(r.scroller.scrollWidth-r.scroller.clientWidth,e.scrollLeft));r.scroller.scrollLeft=r.scrollbarH.scrollLeft=i.scrollLeft=o,x(t)}if(e.scrollToPos){var s=Ei(t,J(i,e.scrollToPos.from),J(i,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&hi(t,s)}var a=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(a)for(var u=0;u<a.length;++u)a[u].lines.length||ca(a[u],"hide");if(l)for(var u=0;u<l.length;++u)l[u].lines.length&&ca(l[u],"unhide");r.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.updatedDisplay&&ts&&(t.options.lineWrapping&&R(t,e.barMeasure),e.barMeasure.scrollWidth>e.barMeasure.clientWidth&&e.barMeasure.scrollWidth<e.barMeasure.clientWidth+1&&!f(t)&&g(t)),e.changeObjs&&ca(t,"changes",t,e.changeObjs)}function lr(e,t){if(e.curOp)return t();Jt(e);try{return t()}finally{tr(e)}}function ur(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Jt(e);try{return t.apply(e,arguments)}finally{tr(e)}}}function pr(e){return function(){if(this.curOp)return e.apply(this,arguments);Jt(this);try{return e.apply(this,arguments)}finally{tr(this)}}}function cr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Jt(t);try{return e.apply(this,arguments)}finally{tr(t)}}}function dr(e,t,r){this.line=t,this.rest=Zi(t),this.size=this.rest?Mn(co(this.rest))-r+1:1,this.node=this.text=null,this.hidden=tn(e,t)}function hr(e,t,r){for(var i,n=[],o=t;r>o;o=i){var s=new dr(e.doc,On(e.doc,o),o);i=o+s.size,n.push(s)}return n}function Er(e,t,r,i){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),i||(i=0);var n=e.display;if(i&&r<n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>t)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)gs&&Ji(e.doc,t)<n.viewTo&&mr(e);else if(r<=n.viewFrom)gs&&en(e.doc,r+i)>n.viewFrom?mr(e):(n.viewFrom+=i,n.viewTo+=i);else if(t<=n.viewFrom&&r>=n.viewTo)mr(e);else if(t<=n.viewFrom){var o=vr(e,r,r+i,1);o?(n.view=n.view.slice(o.index),n.viewFrom=o.lineN,n.viewTo+=i):mr(e)}else if(r>=n.viewTo){var o=vr(e,t,t,-1);o?(n.view=n.view.slice(0,o.index),n.viewTo=o.lineN):mr(e)}else{var s=vr(e,t,t,-1),a=vr(e,r,r+i,1);s&&a?(n.view=n.view.slice(0,s.index).concat(hr(e,s.lineN,a.lineN)).concat(n.view.slice(a.index)),n.viewTo+=i):mr(e)}var l=n.externalMeasured;l&&(r<l.lineN?l.lineN+=i:t<l.lineN+l.size&&(n.externalMeasured=null))}function fr(e,t,r){e.curOp.viewChanged=!0;var i=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var o=i.view[gr(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==ho(s,r)&&s.push(r)}}}function mr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function gr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var r=e.display.view,i=0;i<r.length;i++)if(t-=r[i].size,0>t)return i}function vr(e,t,r,i){var n,o=gr(e,t),s=e.display.view;if(!gs||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var a=0,l=e.display.viewFrom;o>a;a++)l+=s[a].size;if(l!=t){if(i>0){if(o==s.length-1)return null;n=l+s[o].size-t,o++}else n=l-t;t+=n,r+=n}for(;Ji(e.doc,r)!=r;){if(o==(0>i?0:s.length-1))return null;r+=i*s[o-(0>i?1:0)].size,o+=i}return{index:o,lineN:r}}function xr(e,t,r){var i=e.display,n=i.view;0==n.length||t>=i.viewTo||r<=i.viewFrom?(i.view=hr(e,t,r),i.viewFrom=t):(i.viewFrom>t?i.view=hr(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(gr(e,t))),i.viewFrom=t,i.viewTo<r?i.view=i.view.concat(hr(e,i.viewTo,r)):i.viewTo>r&&(i.view=i.view.slice(0,gr(e,r)))),i.viewTo=r}function Nr(e){for(var t=e.display.view,r=0,i=0;i<t.length;i++){var n=t[i];n.hidden||n.node&&!n.changes||++r}return r}function Tr(e){e.display.pollingFast||e.display.poll.set(e.options.pollInterval,function(){Ir(e),e.state.focused&&Tr(e)})}function Lr(e){function t(){var i=Ir(e);i||r?(e.display.pollingFast=!1,Tr(e)):(r=!0,e.display.poll.set(60,t))}var r=!1;e.display.pollingFast=!0,e.display.poll.set(20,t)}function Ir(e){var t=e.display.input,r=e.display.prevInput,i=e.doc;if(!e.state.focused||Pa(t)&&!r||Cr(e)||e.options.disableInput)return!1;e.state.pasteIncoming&&e.state.fakedLastChar&&(t.value=t.value.substring(0,t.value.length-1),e.state.fakedLastChar=!1);var n=t.value;if(n==r&&!e.somethingSelected())return!1;if(Jo&&es>=9&&e.display.inputHasSelection===n||cs&&/[\uf700-\uf7ff]/.test(n))return yr(e),!1;var o=!e.curOp;o&&Jt(e),e.display.shift=!1,8203!=n.charCodeAt(0)||i.sel!=e.display.selForContextMenu||r||(r="");for(var s=0,a=Math.min(r.length,n.length);a>s&&r.charCodeAt(s)==n.charCodeAt(s);)++s;var l=n.slice(s),u=Oa(l),p=null;e.state.pasteIncoming&&i.sel.ranges.length>1&&(Ss&&Ss.join("\n")==l?p=i.sel.ranges.length%Ss.length==0&&Eo(Ss,Oa):u.length==i.sel.ranges.length&&(p=Eo(u,function(e){return[e]})));for(var c=i.sel.ranges.length-1;c>=0;c--){var d=i.sel.ranges[c],h=d.from(),E=d.to();s<r.length?h=vs(h.line,h.ch-(r.length-s)):e.state.overwrite&&d.empty()&&!e.state.pasteIncoming&&(E=vs(E.line,Math.min(On(i,E.line).text.length,E.ch+co(u).length)));var f=e.curOp.updateInput,m={from:h,to:E,text:p?p[c%p.length]:u,origin:e.state.pasteIncoming?"paste":e.state.cutIncoming?"cut":"+input"};if(si(e.doc,m),ro(e,"inputRead",e,m),l&&!e.state.pasteIncoming&&e.options.electricChars&&e.options.smartIndent&&d.head.ch<100&&(!c||i.sel.ranges[c-1].head.line!=d.head.line)){var g=e.getModeAt(d.head),v=Ds(m);if(g.electricChars){for(var x=0;x<g.electricChars.length;x++)if(l.indexOf(g.electricChars.charAt(x))>-1){Ni(e,v.line,"smart");break}}else g.electricInput&&g.electricInput.test(On(i,v.line).text.slice(0,v.ch))&&Ni(e,v.line,"smart")}}return vi(e),e.curOp.updateInput=f,e.curOp.typing=!0,n.length>1e3||n.indexOf("\n")>-1?t.value=e.display.prevInput="":e.display.prevInput=n,o&&tr(e),e.state.pasteIncoming=e.state.cutIncoming=!1,!0}function yr(e,t){var r,i,n=e.doc;if(e.somethingSelected()){e.display.prevInput="";var o=n.sel.primary();r=Da&&(o.to().line-o.from().line>100||(i=e.getSelection()).length>1e3);var s=r?"-":i||e.getSelection();e.display.input.value=s,e.state.focused&&Na(e.display.input),Jo&&es>=9&&(e.display.inputHasSelection=s)}else t||(e.display.prevInput=e.display.input.value="",Jo&&es>=9&&(e.display.inputHasSelection=null));e.display.inaccurateSelection=r}function Ar(e){"nocursor"==e.options.readOnly||ps&&Ao()==e.display.input||e.display.input.focus()}function Sr(e){e.state.focused||(Ar(e),Qr(e))}function Cr(e){return e.options.readOnly||e.doc.cantEdit}function Rr(e){function t(){e.state.focused&&setTimeout(go(Ar,e),0)}function r(t){no(e,t)||la(t)}function i(t){if(e.somethingSelected())Ss=e.getSelections(),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,n.input.value=Ss.join("\n"),Na(n.input));else{for(var r=[],i=[],o=0;o<e.doc.sel.ranges.length;o++){var s=e.doc.sel.ranges[o].head.line,a={anchor:vs(s,0),head:vs(s+1,0)};i.push(a),r.push(e.getRange(a.anchor,a.head))}"cut"==t.type?e.setSelections(i,null,fa):(n.prevInput="",n.input.value=r.join("\n"),Na(n.input)),Ss=r}"cut"==t.type&&(e.state.cutIncoming=!0)}var n=e.display;ua(n.scroller,"mousedown",ur(e,Dr)),Jo&&11>es?ua(n.scroller,"dblclick",ur(e,function(t){if(!no(e,t)){var r=Pr(e,t);if(r&&!kr(e,t)&&!Or(e.display,t)){sa(t);var i=e.findWordAt(r);nt(e.doc,i.anchor,i.head)}}})):ua(n.scroller,"dblclick",function(t){no(e,t)||sa(t)}),ua(n.lineSpace,"selectstart",function(e){Or(n,e)||sa(e)}),fs||ua(n.scroller,"contextmenu",function(t){Jr(e,t)}),ua(n.scroller,"scroll",function(){n.scroller.clientHeight&&(Vr(e,n.scroller.scrollTop),Hr(e,n.scroller.scrollLeft,!0),ca(e,"scroll",e))}),ua(n.scrollbarV,"scroll",function(){n.scroller.clientHeight&&Vr(e,n.scrollbarV.scrollTop)}),ua(n.scrollbarH,"scroll",function(){n.scroller.clientHeight&&Hr(e,n.scrollbarH.scrollLeft)}),ua(n.scroller,"mousewheel",function(t){Fr(e,t)}),ua(n.scroller,"DOMMouseScroll",function(t){Fr(e,t)}),ua(n.scrollbarH,"mousedown",t),ua(n.scrollbarV,"mousedown",t),ua(n.wrapper,"scroll",function(){n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),ua(n.input,"keyup",function(t){Kr.call(e,t)}),ua(n.input,"input",function(){Jo&&es>=9&&e.display.inputHasSelection&&(e.display.inputHasSelection=null),Lr(e)}),ua(n.input,"keydown",ur(e,Xr)),ua(n.input,"keypress",ur(e,$r)),ua(n.input,"focus",go(Qr,e)),ua(n.input,"blur",go(Zr,e)),e.options.dragDrop&&(ua(n.scroller,"dragstart",function(t){Ur(e,t)}),ua(n.scroller,"dragenter",r),ua(n.scroller,"dragover",r),ua(n.scroller,"drop",ur(e,Br))),ua(n.scroller,"paste",function(t){Or(n,t)||(e.state.pasteIncoming=!0,Ar(e),Lr(e))}),ua(n.input,"paste",function(){if(ts&&!e.state.fakedLastChar&&!(new Date-e.state.lastMiddleDown<200)){var t=n.input.selectionStart,r=n.input.selectionEnd;n.input.value+="$",n.input.selectionEnd=r,n.input.selectionStart=t,e.state.fakedLastChar=!0}e.state.pasteIncoming=!0,Lr(e)}),ua(n.input,"cut",i),ua(n.input,"copy",i),ss&&ua(n.sizer,"mouseup",function(){Ao()==n.input&&n.input.blur(),Ar(e)})}function br(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,e.setSize()}function Or(e,t){for(var r=eo(t);r!=e.wrapper;r=r.parentNode)if(!r||r.ignoreEvents||r.parentNode==e.sizer&&r!=e.mover)return!0}function Pr(e,t,r,i){var n=e.display;if(!r){var o=eo(t);if(o==n.scrollbarH||o==n.scrollbarV||o==n.scrollbarFiller||o==n.gutterFiller)return null}var s,a,l=n.lineSpace.getBoundingClientRect();try{s=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var u,p=Kt(e,s,a);if(i&&1==p.xRel&&(u=On(e.doc,p.line).text).length==p.ch){var c=va(u,u.length,e.options.tabSize)-u.length;p=vs(p.line,Math.max(0,Math.round((s-Rt(e.display).left)/Zt(e.display))-c))}return p}function Dr(e){if(!no(this,e)){var t=this,r=t.display;if(r.shift=e.shiftKey,Or(r,e))return void(ts||(r.scroller.draggable=!1,setTimeout(function(){r.scroller.draggable=!0},100)));if(!kr(t,e)){var i=Pr(t,e);switch(window.focus(),to(e)){case 1:i?_r(t,e,i):eo(e)==r.scroller&&sa(e);break;case 2:ts&&(t.state.lastMiddleDown=+new Date),i&&nt(t.doc,i),setTimeout(go(Ar,t),20),sa(e);break;case 3:fs&&Jr(t,e)}}}}function _r(e,t,r){setTimeout(go(Sr,e),0);var i,n=+new Date;Ls&&Ls.time>n-400&&0==xs(Ls.pos,r)?i="triple":Ts&&Ts.time>n-400&&0==xs(Ts.pos,r)?(i="double",Ls={time:n,pos:r}):(i="single",Ts={time:n,pos:r});var o=e.doc.sel,s=cs?t.metaKey:t.ctrlKey;e.options.dragDrop&&ba&&!Cr(e)&&"single"==i&&o.contains(r)>-1&&o.somethingSelected()?Mr(e,t,r,s):wr(e,t,r,i,s)}function Mr(e,t,r,i){var n=e.display,o=ur(e,function(s){ts&&(n.scroller.draggable=!1),e.state.draggingText=!1,pa(document,"mouseup",o),pa(n.scroller,"drop",o),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(sa(s),i||nt(e.doc,r),Ar(e),Jo&&9==es&&setTimeout(function(){document.body.focus(),Ar(e)},20))});ts&&(n.scroller.draggable=!0),e.state.draggingText=o,n.scroller.dragDrop&&n.scroller.dragDrop(),ua(document,"mouseup",o),ua(n.scroller,"drop",o)}function wr(e,t,r,i,n){function o(t){if(0!=xs(f,t))if(f=t,"rect"==i){for(var n=[],o=e.options.tabSize,s=va(On(u,r.line).text,r.ch,o),a=va(On(u,t.line).text,t.ch,o),l=Math.min(s,a),h=Math.max(s,a),E=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));m>=E;E++){var g=On(u,E).text,v=uo(g,l,o);l==h?n.push(new K(vs(E,v),vs(E,v))):g.length>v&&n.push(new K(vs(E,v),vs(E,uo(g,h,o))))}n.length||n.push(new K(r,r)),pt(u,$(d.ranges.slice(0,c).concat(n),c),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=p,N=x.anchor,T=t;if("single"!=i){if("double"==i)var L=e.findWordAt(t);else var L=new K(vs(t.line,0),J(u,vs(t.line+1,0)));xs(L.anchor,N)>0?(T=L.head,N=X(x.from(),L.anchor)):(T=L.anchor,N=z(x.to(),L.head))}var n=d.ranges.slice(0);n[c]=new K(J(u,N),T),pt(u,$(n,c),ma)}}function s(t){var r=++g,n=Pr(e,t,!0,"rect"==i);if(n)if(0!=xs(n,f)){Sr(e),o(n);var a=v(l,u);(n.line>=a.to||n.line<a.from)&&setTimeout(ur(e,function(){g==r&&s(t)}),150)}else{var p=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;p&&setTimeout(ur(e,function(){g==r&&(l.scroller.scrollTop+=p,s(t))}),50)}}function a(t){g=1/0,sa(t),Ar(e),pa(document,"mousemove",x),pa(document,"mouseup",N),u.history.lastSelOrigin=null}var l=e.display,u=e.doc;sa(t);var p,c,d=u.sel;if(n&&!t.shiftKey?(c=u.sel.contains(r),p=c>-1?u.sel.ranges[c]:new K(r,r)):p=u.sel.primary(),t.altKey)i="rect",n||(p=new K(r,r)),r=Pr(e,t,!0,!0),c=-1;else if("double"==i){var h=e.findWordAt(r);p=e.display.shift||u.extend?it(u,p,h.anchor,h.head):h}else if("triple"==i){var E=new K(vs(r.line,0),J(u,vs(r.line+1,0)));p=e.display.shift||u.extend?it(u,p,E.anchor,E.head):E}else p=it(u,p,r);n?c>-1?st(u,c,p,ma):(c=u.sel.ranges.length,pt(u,$(u.sel.ranges.concat([p]),c),{scroll:!1,origin:"*mouse"})):(c=0,pt(u,new Y([p],0),ma),d=u.sel);var f=r,m=l.wrapper.getBoundingClientRect(),g=0,x=ur(e,function(e){to(e)?s(e):a(e)}),N=ur(e,a);ua(document,"mousemove",x),ua(document,"mouseup",N)}function Gr(e,t,r,i,n){try{var o=t.clientX,s=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&sa(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(s>l.bottom||!so(e,r))return Jn(t);
s-=l.top-a.viewOffset;for(var u=0;u<e.options.gutters.length;++u){var p=a.gutters.childNodes[u];if(p&&p.getBoundingClientRect().right>=o){var c=wn(e.doc,s),d=e.options.gutters[u];return n(e,r,e,c,d,t),Jn(t)}}}function kr(e,t){return Gr(e,t,"gutterClick",!0,ro)}function Br(e){var t=this;if(!no(t,e)&&!Or(t.display,e)){sa(e),Jo&&(Cs=+new Date);var r=Pr(t,e,!0),i=e.dataTransfer.files;if(r&&!Cr(t))if(i&&i.length&&window.FileReader&&window.File)for(var n=i.length,o=Array(n),s=0,a=function(e,i){var a=new FileReader;a.onload=ur(t,function(){if(o[i]=a.result,++s==n){r=J(t.doc,r);var e={from:r,to:r,text:Oa(o.join("\n")),origin:"paste"};si(t.doc,e),ut(t.doc,Q(r,Ds(e)))}}),a.readAsText(e)},l=0;n>l;++l)a(i[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(go(Ar,t),20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(cs?e.metaKey:e.ctrlKey))var u=t.listSelections();if(ct(t.doc,Q(r,r)),u)for(var l=0;l<u.length;++l)di(t.doc,"",u[l].anchor,u[l].head,"drag");t.replaceSelection(o,"around","paste"),Ar(t)}}catch(e){}}}}function Ur(e,t){if(Jo&&(!e.state.draggingText||+new Date-Cs<100))return void la(t);if(!no(e,t)&&!Or(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!os)){var r=To("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ns&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),ns&&r.parentNode.removeChild(r)}}function Vr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,$o||S(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbarV.scrollTop!=t&&(e.display.scrollbarV.scrollTop=t),$o&&S(e),Lt(e,100))}function Hr(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.scrollbarH.scrollLeft!=t&&(e.display.scrollbarH.scrollLeft=t))}function Fr(e,t){var r=t.wheelDeltaX,i=t.wheelDeltaY;null==r&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(r=t.detail),null==i&&t.detail&&t.axis==t.VERTICAL_AXIS?i=t.detail:null==i&&(i=t.wheelDelta);var n=e.display,o=n.scroller;if(r&&o.scrollWidth>o.clientWidth||i&&o.scrollHeight>o.clientHeight){if(i&&cs&&ts)e:for(var s=t.target,a=n.view;s!=o;s=s.parentNode)for(var l=0;l<a.length;l++)if(a[l].node==s){e.display.currentWheelTarget=s;break e}if(r&&!$o&&!ns&&null!=bs)return i&&Vr(e,Math.max(0,Math.min(o.scrollTop+i*bs,o.scrollHeight-o.clientHeight))),Hr(e,Math.max(0,Math.min(o.scrollLeft+r*bs,o.scrollWidth-o.clientWidth))),sa(t),void(n.wheelStartX=null);if(i&&null!=bs){var u=i*bs,p=e.doc.scrollTop,c=p+n.wrapper.clientHeight;0>u?p=Math.max(0,p+u-50):c=Math.min(e.doc.height,c+u+50),S(e,{top:p,bottom:c})}20>Rs&&(null==n.wheelStartX?(n.wheelStartX=o.scrollLeft,n.wheelStartY=o.scrollTop,n.wheelDX=r,n.wheelDY=i,setTimeout(function(){if(null!=n.wheelStartX){var e=o.scrollLeft-n.wheelStartX,t=o.scrollTop-n.wheelStartY,r=t&&n.wheelDY&&t/n.wheelDY||e&&n.wheelDX&&e/n.wheelDX;n.wheelStartX=n.wheelStartY=null,r&&(bs=(bs*Rs+r)/(Rs+1),++Rs)}},200)):(n.wheelDX+=r,n.wheelDY+=i))}}function jr(e,t,r){if("string"==typeof t&&(t=js[t],!t))return!1;e.display.pollingFast&&Ir(e)&&(e.display.pollingFast=!1);var i=e.display.shift,n=!1;try{Cr(e)&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),n=t(e)!=Ea}finally{e.display.shift=i,e.state.suppressEdits=!1}return n}function Wr(e){var t=e.state.keyMaps.slice(0);return e.options.extraKeys&&t.push(e.options.extraKeys),t.push(e.options.keyMap),t}function qr(e,t){var r=Si(e.options.keyMap),i=r.auto;clearTimeout(Os),i&&!zs(t)&&(Os=setTimeout(function(){Si(e.options.keyMap)==r&&(e.options.keyMap=i.call?i.call(null,e):i,a(e))},50));var n=Xs(t,!0),o=!1;if(!n)return!1;var s=Wr(e);return o=t.shiftKey?qs("Shift-"+n,s,function(t){return jr(e,t,!0)})||qs(n,s,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?jr(e,t):void 0}):qs(n,s,function(t){return jr(e,t)}),o&&(sa(t),Tt(e),ro(e,"keyHandled",e,n,t)),o}function zr(e,t,r){var i=qs("'"+r+"'",Wr(e),function(t){return jr(e,t,!0)});return i&&(sa(t),Tt(e),ro(e,"keyHandled",e,"'"+r+"'",t)),i}function Xr(e){var t=this;if(Sr(t),!no(t,e)){Jo&&11>es&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=qr(t,e);ns&&(Ps=i?r:null,!i&&88==r&&!Da&&(cs?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||Yr(t)}}function Yr(e){function t(e){18!=e.keyCode&&e.altKey||(Co(r,"CodeMirror-crosshair"),pa(document,"keyup",t),pa(document,"mouseover",t))}var r=e.display.lineDiv;Ro(r,"CodeMirror-crosshair"),ua(document,"keyup",t),ua(document,"mouseover",t)}function Kr(e){16==e.keyCode&&(this.doc.sel.shift=!1),no(this,e)}function $r(e){var t=this;if(!(no(t,e)||e.ctrlKey&&!e.altKey||cs&&e.metaKey)){var r=e.keyCode,i=e.charCode;if(ns&&r==Ps)return Ps=null,void sa(e);if(!(ns&&(!e.which||e.which<10)||ss)||!qr(t,e)){var n=String.fromCharCode(null==i?r:i);zr(t,e,n)||(Jo&&es>=9&&(t.display.inputHasSelection=null),Lr(t))}}}function Qr(e){"nocursor"!=e.options.readOnly&&(e.state.focused||(ca(e,"focus",e),e.state.focused=!0,Ro(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(yr(e),ts&&setTimeout(go(yr,e,!0),0))),Tr(e),Tt(e))}function Zr(e){e.state.focused&&(ca(e,"blur",e),e.state.focused=!1,Co(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Jr(e,t){function r(){if(null!=n.input.selectionStart){var t=e.somethingSelected(),r=n.input.value=""+(t?n.input.value:"");n.prevInput=t?"":"",n.input.selectionStart=1,n.input.selectionEnd=r.length,n.selForContextMenu=e.doc.sel}}function i(){if(n.inputDiv.style.position="relative",n.input.style.cssText=l,Jo&&9>es&&(n.scrollbarV.scrollTop=n.scroller.scrollTop=s),Tr(e),null!=n.input.selectionStart){(!Jo||Jo&&9>es)&&r();var t=0,i=function(){n.selForContextMenu==e.doc.sel&&0==n.input.selectionStart?ur(e,js.selectAll)(e):t++<10?n.detectingSelectAll=setTimeout(i,500):yr(e)};n.detectingSelectAll=setTimeout(i,200)}}if(!no(e,t,"contextmenu")){var n=e.display;if(!Or(n,t)&&!ei(e,t)){var o=Pr(e,t),s=n.scroller.scrollTop;if(o&&!ns){var a=e.options.resetSelectionOnContextMenu;a&&-1==e.doc.sel.contains(o)&&ur(e,pt)(e.doc,Q(o),fa);var l=n.input.style.cssText;if(n.inputDiv.style.position="absolute",n.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: "+(Jo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",ts)var u=window.scrollY;if(Ar(e),ts&&window.scrollTo(null,u),yr(e),e.somethingSelected()||(n.input.value=n.prevInput=" "),n.selForContextMenu=e.doc.sel,clearTimeout(n.detectingSelectAll),Jo&&es>=9&&r(),fs){la(t);var p=function(){pa(window,"mouseup",p),setTimeout(i,20)};ua(window,"mouseup",p)}else setTimeout(i,50)}}}}function ei(e,t){return so(e,"gutterContextMenu")?Gr(e,t,"gutterContextMenu",!1,ca):!1}function ti(e,t){if(xs(e,t.from)<0)return e;if(xs(e,t.to)<=0)return Ds(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Ds(t).ch-t.to.ch),vs(r,i)}function ri(e,t){for(var r=[],i=0;i<e.sel.ranges.length;i++){var n=e.sel.ranges[i];r.push(new K(ti(n.anchor,t),ti(n.head,t)))}return $(r,e.sel.primIndex)}function ii(e,t,r){return e.line==t.line?vs(r.line,e.ch-t.ch+r.ch):vs(r.line+(e.line-t.line),e.ch)}function ni(e,t,r){for(var i=[],n=vs(e.first,0),o=n,s=0;s<t.length;s++){var a=t[s],l=ii(a.from,n,o),u=ii(Ds(a),n,o);if(n=a.to,o=u,"around"==r){var p=e.sel.ranges[s],c=xs(p.head,p.anchor)<0;i[s]=new K(c?u:l,c?l:u)}else i[s]=new K(l,l)}return new Y(i,e.sel.primIndex)}function oi(e,t,r){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return r&&(i.update=function(t,r,i,n){t&&(this.from=J(e,t)),r&&(this.to=J(e,r)),i&&(this.text=i),void 0!==n&&(this.origin=n)}),ca(e,"beforeChange",e,i),e.cm&&ca(e.cm,"beforeChange",e.cm,i),i.canceled?null:{from:i.from,to:i.to,text:i.text,origin:i.origin}}function si(e,t,r){if(e.cm){if(!e.cm.curOp)return ur(e.cm,si)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(so(e,"beforeChange")||e.cm&&so(e.cm,"beforeChange"))||(t=oi(e,t,!0))){var i=ms&&!r&&Hi(e,t.from,t.to);if(i)for(var n=i.length-1;n>=0;--n)ai(e,{from:i[n].from,to:i[n].to,text:n?[""]:t.text});else ai(e,t)}}function ai(e,t){if(1!=t.text.length||""!=t.text[0]||0!=xs(t.from,t.to)){var r=ri(e,t);Fn(e,t,r,e.cm?e.cm.curOp.id:0/0),pi(e,t,r,Bi(e,t));var i=[];Rn(e,function(e,r){r||-1!=ho(i,e.history)||(Zn(e.history,t),i.push(e.history)),pi(e,t,null,Bi(e,t))})}}function li(e,t,r){if(!e.cm||!e.cm.state.suppressEdits){for(var i,n=e.history,o=e.sel,s="undo"==t?n.done:n.undone,a="undo"==t?n.undone:n.done,l=0;l<s.length&&(i=s[l],r?!i.ranges||i.equals(e.sel):i.ranges);l++);if(l!=s.length){for(n.lastOrigin=n.lastSelOrigin=null;i=s.pop(),i.ranges;){if(qn(i,a),r&&!i.equals(e.sel))return void pt(e,i,{clearRedo:!1});o=i}var u=[];qn(o,a),a.push({changes:u,generation:n.generation}),n.generation=i.generation||++n.maxGeneration;for(var p=so(e,"beforeChange")||e.cm&&so(e.cm,"beforeChange"),l=i.changes.length-1;l>=0;--l){var c=i.changes[l];if(c.origin=t,p&&!oi(e,c,!1))return void(s.length=0);u.push(Un(e,c));var d=l?ri(e,c):co(s);pi(e,c,d,Vi(e,c)),!l&&e.cm&&e.cm.scrollIntoView({from:c.from,to:Ds(c)});var h=[];Rn(e,function(e,t){t||-1!=ho(h,e.history)||(Zn(e.history,c),h.push(e.history)),pi(e,c,null,Vi(e,c))})}}}}function ui(e,t){if(0!=t&&(e.first+=t,e.sel=new Y(Eo(e.sel.ranges,function(e){return new K(vs(e.anchor.line+t,e.anchor.ch),vs(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Er(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,i=r.viewFrom;i<r.viewTo;i++)fr(e.cm,i,"gutter")}}function pi(e,t,r,i){if(e.cm&&!e.cm.curOp)return ur(e.cm,pi)(e,t,r,i);if(t.to.line<e.first)return void ui(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var n=t.text.length-1-(e.first-t.from.line);ui(e,n),t={from:vs(e.first,0),to:vs(t.to.line+n,t.to.ch),text:[co(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:vs(o,On(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Pn(e,t.from,t.to),r||(r=ri(e,t)),e.cm?ci(e.cm,t,i):An(e,t,i),ct(e,r,fa)}}function ci(e,t,r){var i=e.doc,n=e.display,s=t.from,a=t.to,l=!1,u=s.line;e.options.lineWrapping||(u=Mn(Qi(On(i,s.line))),i.iter(u,a.line+1,function(e){return e==n.maxLine?(l=!0,!0):void 0})),i.sel.contains(t.from,t.to)>-1&&oo(e),An(i,t,r,o(e)),e.options.lineWrapping||(i.iter(u,s.line+t.text.length,function(e){var t=d(e);t>n.maxLineLength&&(n.maxLine=e,n.maxLineLength=t,n.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),i.frontier=Math.min(i.frontier,s.line),Lt(e,400);var p=t.text.length-(a.line-s.line)-1;s.line!=a.line||1!=t.text.length||yn(e.doc,t)?Er(e,s.line,a.line+1,p):fr(e,s.line,"text");var c=so(e,"changes"),h=so(e,"change");if(h||c){var E={from:s,to:a,text:t.text,removed:t.removed,origin:t.origin};h&&ro(e,"change",e,E),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(E)}e.display.selForContextMenu=null}function di(e,t,r,i,n){if(i||(i=r),xs(i,r)<0){var o=i;i=r,r=o}"string"==typeof t&&(t=Oa(t)),si(e,{from:r,to:i,text:t,origin:n})}function hi(e,t){var r=e.display,i=r.sizer.getBoundingClientRect(),n=null;if(t.top+i.top<0?n=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1),null!=n&&!ls){var o=To("div","",null,"position: absolute; top: "+(t.top-r.viewOffset-St(e.display))+"px; height: "+(t.bottom-t.top+ha)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(n),e.display.lineSpace.removeChild(o)}}function Ei(e,t,r,i){null==i&&(i=0);for(var n=0;5>n;n++){var o=!1,s=zt(e,t),a=r&&r!=t?zt(e,r):s,l=mi(e,Math.min(s.left,a.left),Math.min(s.top,a.top)-i,Math.max(s.left,a.left),Math.max(s.bottom,a.bottom)+i),u=e.doc.scrollTop,p=e.doc.scrollLeft;if(null!=l.scrollTop&&(Vr(e,l.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=l.scrollLeft&&(Hr(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(o=!0)),!o)return s}}function fi(e,t,r,i,n){var o=mi(e,t,r,i,n);null!=o.scrollTop&&Vr(e,o.scrollTop),null!=o.scrollLeft&&Hr(e,o.scrollLeft)}function mi(e,t,r,i,n){var o=e.display,s=Qt(e.display);0>r&&(r=0);var a=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,l=o.scroller.clientHeight-ha,u={};n-r>l&&(n=r+l);var p=e.doc.height+Ct(o),c=s>r,d=n>p-s;if(a>r)u.scrollTop=c?0:r;else if(n>a+l){var h=Math.min(r,(d?p:n)-l);h!=a&&(u.scrollTop=h)}var E=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,f=o.scroller.clientWidth-ha-o.gutters.offsetWidth,m=i-t>f;return m&&(i=t+f),10>t?u.scrollLeft=0:E>t?u.scrollLeft=Math.max(0,t-(m?0:10)):i>f+E-3&&(u.scrollLeft=i+(m?0:10)-f),u}function gi(e,t,r){(null!=t||null!=r)&&xi(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 vi(e){xi(e);var t=e.getCursor(),r=t,i=t;e.options.lineWrapping||(r=t.ch?vs(t.line,t.ch-1):t,i=vs(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:i,margin:e.options.cursorScrollMargin,isCursor:!0}}function xi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=Xt(e,t.from),i=Xt(e,t.to),n=mi(e,Math.min(r.left,i.left),Math.min(r.top,i.top)-t.margin,Math.max(r.right,i.right),Math.max(r.bottom,i.bottom)+t.margin);e.scrollTo(n.scrollLeft,n.scrollTop)}}function Ni(e,t,r,i){var n,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?n=At(e,t):r="prev");var s=e.options.tabSize,a=On(o,t),l=va(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var u,p=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==r&&(u=o.mode.indent(n,a.text.slice(p.length),a.text),u==Ea||u>150)){if(!i)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?va(On(o,t-1).text,null,s):0:"add"==r?u=l+e.options.indentUnit:"subtract"==r?u=l-e.options.indentUnit:"number"==typeof r&&(u=l+r),u=Math.max(0,u);var c="",d=0;if(e.options.indentWithTabs)for(var h=Math.floor(u/s);h;--h)d+=s,c+=" ";if(u>d&&(c+=po(u-d)),c!=p)di(o,c,vs(t,0),vs(t,p.length),"+input");else for(var h=0;h<o.sel.ranges.length;h++){var E=o.sel.ranges[h];if(E.head.line==t&&E.head.ch<p.length){var d=vs(t,p.length);st(o,h,new K(d,d));break}}a.stateAfter=null}function Ti(e,t,r,i){var n=t,o=t;return"number"==typeof t?o=On(e,Z(e,t)):n=Mn(t),null==n?null:(i(o,n)&&e.cm&&fr(e.cm,n,r),o)}function Li(e,t){for(var r=e.doc.sel.ranges,i=[],n=0;n<r.length;n++){for(var o=t(r[n]);i.length&&xs(o.from,co(i).to)<=0;){var s=i.pop();if(xs(s.from,o.from)<0){o.from=s.from;break}}i.push(o)}lr(e,function(){for(var t=i.length-1;t>=0;t--)di(e.doc,"",i[t].from,i[t].to,"+delete");vi(e)})}function Ii(e,t,r,i,n){function o(){var t=a+r;return t<e.first||t>=e.first+e.size?c=!1:(a=t,p=On(e,t))}function s(e){var t=(n?Yo:Ko)(p,l,r,!0);if(null==t){if(e||!o())return c=!1;l=n?(0>r?Ho:Vo)(p):0>r?p.text.length:0}else l=t;return!0}var a=t.line,l=t.ch,u=r,p=On(e,a),c=!0;if("char"==i)s();else if("column"==i)s(!0);else if("word"==i||"group"==i)for(var d=null,h="group"==i,E=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(0>r)||s(!f);f=!1){var m=p.text.charAt(l)||"\n",g=vo(m,E)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";if(!h||f||g||(g="s"),d&&d!=g){0>r&&(r=1,s());break}if(g&&(d=g),r>0&&!s(!f))break}var v=ft(e,vs(a,l),u,!0);return c||(v.hitSide=!0),v}function yi(e,t,r,i){var n,o=e.doc,s=t.left;if("page"==i){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);n=t.top+r*(a-(0>r?1.5:.5)*Qt(e.display))}else"line"==i&&(n=r>0?t.bottom+3:t.top-3);for(;;){var l=Kt(e,s,n);if(!l.outside)break;if(0>r?0>=n:n>=o.height){l.hitSide=!0;break}n+=5*r}return l}function Ai(t,r,i,n){e.defaults[t]=r,i&&(Ms[t]=n?function(e,t,r){r!=ws&&i(e,t,r)}:i)}function Si(e){return"string"==typeof e?Ws[e]:e}function Ci(e,t,r,i,n){if(i&&i.shared)return Ri(e,t,r,i,n);if(e.cm&&!e.cm.curOp)return ur(e.cm,Ci)(e,t,r,i,n);var o=new Ks(e,n),s=xs(t,r);if(i&&mo(i,o,!1),s>0||0==s&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=To("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||(o.widgetNode.ignoreEvents=!0),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if($i(e,t.line,t,r,o)||t.line!=r.line&&$i(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");gs=!0}o.addToHistory&&Fn(e,{from:t,to:r,origin:"markText"},e.sel,0/0);var a,l=t.line,u=e.cm;if(e.iter(l,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&Qi(e)==u.display.maxLine&&(a=!0),o.collapsed&&l!=t.line&&_n(e,0),wi(e,new Di(o,l==t.line?t.ch:null,l==r.line?r.ch:null)),++l}),o.collapsed&&e.iter(t.line,r.line+1,function(t){tn(e,t)&&_n(t,0)}),o.clearOnEnter&&ua(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(ms=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++$s,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)Er(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle)for(var p=t.line;p<=r.line;p++)fr(u,p,"text");o.atomic&&ht(u.doc),ro(u,"markerAdded",u,o)}return o}function Ri(e,t,r,i,n){i=mo(i),i.shared=!1;var o=[Ci(e,t,r,i,n)],s=o[0],a=i.widgetNode;return Rn(e,function(e){a&&(i.widgetNode=a.cloneNode(!0)),o.push(Ci(e,J(e,t),J(e,r),i,n));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;s=co(o)}),new Qs(o,s)}function bi(e){return e.findMarks(vs(e.first,0),e.clipPos(vs(e.lastLine())),function(e){return e.parent})}function Oi(e,t){for(var r=0;r<t.length;r++){var i=t[r],n=i.find(),o=e.clipPos(n.from),s=e.clipPos(n.to);if(xs(o,s)){var a=Ci(e,o,s,i.primary,i.primary.type);i.markers.push(a),a.parent=i}}}function Pi(e){for(var t=0;t<e.length;t++){var r=e[t],i=[r.primary.doc];Rn(r.primary.doc,function(e){i.push(e)});for(var n=0;n<r.markers.length;n++){var o=r.markers[n];-1==ho(i,o.doc)&&(o.parent=null,r.markers.splice(n--,1))}}}function Di(e,t,r){this.marker=e,this.from=t,this.to=r}function _i(e,t){if(e)for(var r=0;r<e.length;++r){var i=e[r];if(i.marker==t)return i}}function Mi(e,t){for(var r,i=0;i<e.length;++i)e[i]!=t&&(r||(r=[])).push(e[i]);return r}function wi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Gi(e,t,r){if(e)for(var i,n=0;n<e.length;++n){var o=e[n],s=o.marker,a=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&"bookmark"==s.type&&(!r||!o.marker.insertLeft)){var l=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);(i||(i=[])).push(new Di(s,o.from,l?null:o.to))}}return i}function ki(e,t,r){if(e)for(var i,n=0;n<e.length;++n){var o=e[n],s=o.marker,a=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&"bookmark"==s.type&&(!r||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);(i||(i=[])).push(new Di(s,l?null:o.from-t,null==o.to?null:o.to-t))}}return i}function Bi(e,t){var r=tt(e,t.from.line)&&On(e,t.from.line).markedSpans,i=tt(e,t.to.line)&&On(e,t.to.line).markedSpans;if(!r&&!i)return null;var n=t.from.ch,o=t.to.ch,s=0==xs(t.from,t.to),a=Gi(r,n,s),l=ki(i,o,s),u=1==t.text.length,p=co(t.text).length+(u?n:0);if(a)for(var c=0;c<a.length;++c){var d=a[c];if(null==d.to){var h=_i(l,d.marker);h?u&&(d.to=null==h.to?null:h.to+p):d.to=n}}if(l)for(var c=0;c<l.length;++c){var d=l[c];if(null!=d.to&&(d.to+=p),null==d.from){var h=_i(a,d.marker);h||(d.from=p,u&&(a||(a=[])).push(d))}else d.from+=p,u&&(a||(a=[])).push(d)}a&&(a=Ui(a)),l&&l!=a&&(l=Ui(l));var E=[a];if(!u){var f,m=t.text.length-2;if(m>0&&a)for(var c=0;c<a.length;++c)null==a[c].to&&(f||(f=[])).push(new Di(a[c].marker,null,null));for(var c=0;m>c;++c)E.push(f);E.push(l)}return E}function Ui(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 Vi(e,t){var r=Yn(e,t),i=Bi(e,t);if(!r)return i;if(!i)return r;for(var n=0;n<r.length;++n){var o=r[n],s=i[n];if(o&&s)e:for(var a=0;a<s.length;++a){for(var l=s[a],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue e;o.push(l)}else s&&(r[n]=s)}return r}function Hi(e,t,r){var i=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||i&&-1!=ho(i,r)||(i||(i=[])).push(r)}}),!i)return null;for(var n=[{from:t,to:r}],o=0;o<i.length;++o)for(var s=i[o],a=s.find(0),l=0;l<n.length;++l){var u=n[l];if(!(xs(u.to,a.from)<0||xs(u.from,a.to)>0)){var p=[l,1],c=xs(u.from,a.from),d=xs(u.to,a.to);(0>c||!s.inclusiveLeft&&!c)&&p.push({from:u.from,to:a.from}),(d>0||!s.inclusiveRight&&!d)&&p.push({from:a.to,to:u.to}),n.splice.apply(n,p),l+=p.length-1}}return n}function Fi(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function ji(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Wi(e){return e.inclusiveLeft?-1:0}function qi(e){return e.inclusiveRight?1:0}function zi(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var i=e.find(),n=t.find(),o=xs(i.from,n.from)||Wi(e)-Wi(t);if(o)return-o;var s=xs(i.to,n.to)||qi(e)-qi(t);return s?s:t.id-e.id}function Xi(e,t){var r,i=gs&&e.markedSpans;if(i)for(var n,o=0;o<i.length;++o)n=i[o],n.marker.collapsed&&null==(t?n.from:n.to)&&(!r||zi(r,n.marker)<0)&&(r=n.marker);return r}function Yi(e){return Xi(e,!0)}function Ki(e){return Xi(e,!1)}function $i(e,t,r,i,n){var o=On(e,t),s=gs&&o.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var u=l.marker.find(0),p=xs(u.from,r)||Wi(l.marker)-Wi(n),c=xs(u.to,i)||qi(l.marker)-qi(n);if(!(p>=0&&0>=c||0>=p&&c>=0)&&(0>=p&&(xs(u.to,r)>0||l.marker.inclusiveRight&&n.inclusiveLeft)||p>=0&&(xs(u.from,i)<0||l.marker.inclusiveLeft&&n.inclusiveRight)))return!0}}}function Qi(e){for(var t;t=Yi(e);)e=t.find(-1,!0).line;return e}function Zi(e){for(var t,r;t=Ki(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function Ji(e,t){var r=On(e,t),i=Qi(r);return r==i?t:Mn(i)}function en(e,t){if(t>e.lastLine())return t;var r,i=On(e,t);if(!tn(e,i))return t;for(;r=Ki(i);)i=r.find(1,!0).line;return Mn(i)+1}function tn(e,t){var r=gs&&t.markedSpans;if(r)for(var i,n=0;n<r.length;++n)if(i=r[n],i.marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&rn(e,t,i))return!0}}function rn(e,t,r){if(null==r.to){var i=r.marker.find(1,!0);return rn(e,i.line,_i(i.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var n,o=0;o<t.markedSpans.length;++o)if(n=t.markedSpans[o],n.marker.collapsed&&!n.marker.widgetNode&&n.from==r.to&&(null==n.to||n.to!=r.from)&&(n.marker.inclusiveLeft||r.marker.inclusiveRight)&&rn(e,t,n))return!0}function nn(e,t,r){Gn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&gi(e,null,r)}function on(e){if(null!=e.height)return e.height;if(!yo(document.body,e.node)){var t="position: relative;";e.coverGutter&&(t+="margin-left: -"+e.cm.getGutterElement().offsetWidth+"px;"),Io(e.cm.display.measure,To("div",[e.node],null,t))}return e.height=e.node.offsetHeight}function sn(e,t,r,i){var n=new Zs(e,r,i);return n.noHScroll&&(e.display.alignWidgets=!0),Ti(e.doc,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==n.insertAt?r.push(n):r.splice(Math.min(r.length-1,Math.max(0,n.insertAt)),0,n),n.line=t,!tn(e.doc,t)){var i=Gn(t)<e.doc.scrollTop;_n(t,t.height+on(n)),i&&gi(e,null,n.height),e.curOp.forceUpdate=!0}return!0}),n}function an(e,t,r,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Fi(e),ji(e,r);var n=i?i(e):1;n!=e.height&&_n(e,n)}function ln(e){e.parent=null,Fi(e)}function un(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 i=r[1]?"bgClass":"textClass";null==t[i]?t[i]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[i])||(t[i]+=" "+r[2])}return e}function pn(t,r){if(t.blankLine)return t.blankLine(r);if(t.innerMode){var i=e.innerMode(t,r);return i.mode.blankLine?i.mode.blankLine(i.state):void 0}}function cn(e,t,r){for(var i=0;10>i;i++){var n=e.token(t,r);if(t.pos>t.start)return n}throw new Error("Mode "+e.name+" failed to advance stream.")}function dn(t,r,i,n,o,s,a){var l=i.flattenSpans;null==l&&(l=t.options.flattenSpans);var u,p=0,c=null,d=new Ys(r,t.options.tabSize);for(""==r&&un(pn(i,n),s);!d.eol();){if(d.pos>t.options.maxHighlightLength?(l=!1,a&&fn(t,r,n,d.pos),d.pos=r.length,u=null):u=un(cn(i,d,n),s),t.options.addModeClass){var h=e.innerMode(i,n).mode.name;h&&(u="m-"+(u?h+" "+u:h))}l&&c==u||(p<d.start&&o(d.start,c),p=d.start,c=u),d.start=d.pos}for(;p<d.pos;){var E=Math.min(d.pos,p+5e4);o(E,c),p=E}}function hn(e,t,r,i){var n=[e.state.modeGen],o={};dn(e,t.text,e.doc.mode,r,function(e,t){n.push(e,t)},o,i);for(var s=0;s<e.state.overlays.length;++s){var a=e.state.overlays[s],l=1,u=0;dn(e,t.text,a.mode,!0,function(e,t){for(var r=l;e>u;){var i=n[l];i>e&&n.splice(l,1,e,n[l+1],i),l+=2,u=Math.min(e,i)}if(t)if(a.opaque)n.splice(r,l-r,e,"cm-overlay "+t),l=r+2;else for(;l>r;r+=2){var o=n[r+1];n[r+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:n,classes:o.bgClass||o.textClass?o:null}}function En(e,t){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=hn(e,t,t.stateAfter=At(e,Mn(t)));t.styles=r.styles,r.classes?t.styleClasses=r.classes:t.styleClasses&&(t.styleClasses=null)}return t.styles}function fn(e,t,r,i){var n=e.doc.mode,o=new Ys(t,e.options.tabSize);for(o.start=o.pos=i||0,""==t&&pn(n,r);!o.eol()&&o.pos<=e.options.maxHighlightLength;)cn(n,o,r),o.start=o.pos}function mn(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?ta:ea;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function gn(e,t){var r=To("span",null,null,ts?"padding-right: .1px":null),i={pre:To("pre",[r]),content:r,col:0,pos:0,cm:e};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var o,s=n?t.rest[n-1]:t.line;i.pos=0,i.addToken=xn,(Jo||ts)&&e.getOption("lineWrapping")&&(i.addToken=Nn(i.addToken)),wo(e.display.measure)&&(o=kn(s))&&(i.addToken=Tn(i.addToken,o)),i.map=[],In(s,i,En(e,s)),s.styleClasses&&(s.styleClasses.bgClass&&(i.bgClass=bo(s.styleClasses.bgClass,i.bgClass||"")),s.styleClasses.textClass&&(i.textClass=bo(s.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Mo(e.display.measure))),0==n?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return ca(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=bo(i.pre.className,i.textClass||"")),i}function vn(e){var t=To("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t}function xn(e,t,r,i,n,o){if(t){var s=e.cm.options.specialChars,a=!1;if(s.test(t))for(var l=document.createDocumentFragment(),u=0;;){s.lastIndex=u;var p=s.exec(t),c=p?p.index-u:t.length-u;if(c){var d=document.createTextNode(t.slice(u,u+c));l.appendChild(Jo&&9>es?To("span",[d]):d),e.map.push(e.pos,e.pos+c,d),e.col+=c,e.pos+=c}if(!p)break;if(u+=c+1," "==p[0]){var h=e.cm.options.tabSize,E=h-e.col%h,d=l.appendChild(To("span",po(E),"cm-tab"));e.col+=E}else{var d=e.cm.options.specialCharPlaceholder(p[0]);l.appendChild(Jo&&9>es?To("span",[d]):d),e.col+=1}e.map.push(e.pos,e.pos+1,d),e.pos++}else{e.col+=t.length;var l=document.createTextNode(t);e.map.push(e.pos,e.pos+t.length,l),Jo&&9>es&&(a=!0),e.pos+=t.length}if(r||i||n||a){var f=r||"";i&&(f+=i),n&&(f+=n);var m=To("span",[l],f);return o&&(m.title=o),e.content.appendChild(m)}e.content.appendChild(l)}}function Nn(e){function t(e){for(var t=" ",r=0;r<e.length-2;++r)t+=r%2?" ":" ";return t+=" "}return function(r,i,n,o,s,a){e(r,i.replace(/ {3,}/g,t),n,o,s,a)}}function Tn(e,t){return function(r,i,n,o,s,a){n=n?n+" cm-force-border":"cm-force-border";for(var l=r.pos,u=l+i.length;;){for(var p=0;p<t.length;p++){var c=t[p];if(c.to>l&&c.from<=l)break}if(c.to>=u)return e(r,i,n,o,s,a);e(r,i.slice(0,c.to-l),n,o,null,a),o=null,i=i.slice(c.to-l),l=c.to}}}function Ln(e,t,r,i){var n=!i&&r.widgetNode;n&&(e.map.push(e.pos,e.pos+t,n),e.content.appendChild(n)),e.pos+=t}function In(e,t,r){var i=e.markedSpans,n=e.text,o=0;if(i)for(var s,a,l,u,p,c,d=n.length,h=0,E=1,f="",m=0;;){if(m==h){a=l=u=p="",c=null,m=1/0;for(var g=[],v=0;v<i.length;++v){var x=i[v],N=x.marker;x.from<=h&&(null==x.to||x.to>h)?(null!=x.to&&m>x.to&&(m=x.to,l=""),N.className&&(a+=" "+N.className),N.startStyle&&x.from==h&&(u+=" "+N.startStyle),N.endStyle&&x.to==m&&(l+=" "+N.endStyle),N.title&&!p&&(p=N.title),N.collapsed&&(!c||zi(c.marker,N)<0)&&(c=x)):x.from>h&&m>x.from&&(m=x.from),"bookmark"==N.type&&x.from==h&&N.widgetNode&&g.push(N)}if(c&&(c.from||0)==h&&(Ln(t,(null==c.to?d+1:c.to)-h,c.marker,null==c.from),null==c.to))return;if(!c&&g.length)for(var v=0;v<g.length;++v)Ln(t,0,g[v])}if(h>=d)break;for(var T=Math.min(d,m);;){if(f){var L=h+f.length;if(!c){var I=L>T?f.slice(0,T-h):f;t.addToken(t,I,s?s+a:a,u,h+I.length==m?l:"",p)}if(L>=T){f=f.slice(T-h),h=T;break}h=L,u=""}f=n.slice(o,o=r[E++]),s=mn(r[E++],t.cm.options)}}else for(var E=1;E<r.length;E+=2)t.addToken(t,n.slice(o,o=r[E]),mn(r[E+1],t.cm.options))}function yn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==co(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function An(e,t,r,i){function n(e){return r?r[e]:null}function o(e,r,n){an(e,r,n,i),ro(e,"change",e,t)}var s=t.from,a=t.to,l=t.text,u=On(e,s.line),p=On(e,a.line),c=co(l),d=n(l.length-1),h=a.line-s.line;if(yn(e,t)){for(var E=0,f=[];E<l.length-1;++E)f.push(new Js(l[E],n(E),i));o(p,p.text,d),h&&e.remove(s.line,h),f.length&&e.insert(s.line,f)}else if(u==p)if(1==l.length)o(u,u.text.slice(0,s.ch)+c+u.text.slice(a.ch),d);else{for(var f=[],E=1;E<l.length-1;++E)f.push(new Js(l[E],n(E),i));f.push(new Js(c+u.text.slice(a.ch),d,i)),o(u,u.text.slice(0,s.ch)+l[0],n(0)),e.insert(s.line+1,f)}else if(1==l.length)o(u,u.text.slice(0,s.ch)+l[0]+p.text.slice(a.ch),n(0)),e.remove(s.line+1,h);else{o(u,u.text.slice(0,s.ch)+l[0],n(0)),o(p,c+p.text.slice(a.ch),d);for(var E=1,f=[];E<l.length-1;++E)f.push(new Js(l[E],n(E),i));h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,f)}ro(e,"change",e,t)}function Sn(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 Cn(e){this.children=e;for(var t=0,r=0,i=0;i<e.length;++i){var n=e[i];t+=n.chunkSize(),r+=n.height,n.parent=this}this.size=t,this.height=r,this.parent=null}function Rn(e,t,r){function i(e,n,o){if(e.linked)for(var s=0;s<e.linked.length;++s){var a=e.linked[s];if(a.doc!=n){var l=o&&a.sharedHist;(!r||l)&&(t(a.doc,l),i(a.doc,e,l))}}}i(e,null,!0)}function bn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,s(e),r(e),e.options.lineWrapping||h(e),e.options.mode=t.modeOption,Er(e)}function On(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 i=0;;++i){var n=r.children[i],o=n.chunkSize();if(o>t){r=n;break}t-=o}return r.lines[t]}function Pn(e,t,r){var i=[],n=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;n==r.line&&(o=o.slice(0,r.ch)),n==t.line&&(o=o.slice(t.ch)),i.push(o),++n}),i}function Dn(e,t,r){var i=[];return e.iter(t,r,function(e){i.push(e.text)}),i}function _n(e,t){var r=t-e.height;if(r)for(var i=e;i;i=i.parent)i.height+=r}function Mn(e){if(null==e.parent)return null;for(var t=e.parent,r=ho(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var n=0;i.children[n]!=t;++n)r+=i.children[n].chunkSize();return r+t.first}function wn(e,t){var r=e.first;e:do{for(var i=0;i<e.children.length;++i){var n=e.children[i],o=n.height;
if(o>t){e=n;continue e}t-=o,r+=n.chunkSize()}return r}while(!e.lines);for(var i=0;i<e.lines.length;++i){var s=e.lines[i],a=s.height;if(a>t)break;t-=a}return r+i}function Gn(e){e=Qi(e);for(var t=0,r=e.parent,i=0;i<r.lines.length;++i){var n=r.lines[i];if(n==e)break;t+=n.height}for(var o=r.parent;o;r=o,o=r.parent)for(var i=0;i<o.children.length;++i){var s=o.children[i];if(s==r)break;t+=s.height}return t}function kn(e){var t=e.order;return null==t&&(t=e.order=Ga(e.text)),t}function Bn(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 Un(e,t){var r={from:q(t.from),to:Ds(t),text:Pn(e,t.from,t.to)};return zn(e,r,t.from.line,t.to.line+1),Rn(e,function(e){zn(e,r,t.from.line,t.to.line+1)},!0),r}function Vn(e){for(;e.length;){var t=co(e);if(!t.ranges)break;e.pop()}}function Hn(e,t){return t?(Vn(e.done),co(e.done)):e.done.length&&!co(e.done).ranges?co(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),co(e.done)):void 0}function Fn(e,t,r,i){var n=e.history;n.undone.length=0;var o,s=+new Date;if((n.lastOp==i||n.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&n.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Hn(n,n.lastOp==i))){var a=co(o.changes);0==xs(t.from,t.to)&&0==xs(t.from,a.to)?a.to=Ds(t):o.changes.push(Un(e,t))}else{var l=co(n.done);for(l&&l.ranges||qn(e.sel,n.done),o={changes:[Un(e,t)],generation:n.generation},n.done.push(o);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(r),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=s,n.lastOp=n.lastSelOp=i,n.lastOrigin=n.lastSelOrigin=t.origin,a||ca(e,"historyAdded")}function jn(e,t,r,i){var n=t.charAt(0);return"*"==n||"+"==n&&r.ranges.length==i.ranges.length&&r.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Wn(e,t,r,i){var n=e.history,o=i&&i.origin;r==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||jn(e,o,co(n.done),t))?n.done[n.done.length-1]=t:qn(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=o,n.lastSelOp=r,i&&i.clearRedo!==!1&&Vn(n.undone)}function qn(e,t){var r=co(t);r&&r.ranges&&r.equals(e)||t.push(e)}function zn(e,t,r,i){var n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,i),function(r){r.markedSpans&&((n||(n=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function Xn(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 Yn(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var i=0,n=[];i<t.text.length;++i)n.push(Xn(r[i]));return n}function Kn(e,t,r){for(var i=0,n=[];i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?Y.prototype.deepCopy.call(o):o);else{var s=o.changes,a=[];n.push({changes:a});for(var l=0;l<s.length;++l){var u,p=s[l];if(a.push({from:p.from,to:p.to,text:p.text}),t)for(var c in p)(u=c.match(/^spans_(\d+)$/))&&ho(t,Number(u[1]))>-1&&(co(a)[c]=p[c],delete p[c])}}}return n}function $n(e,t,r,i){r<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function Qn(e,t,r,i){for(var n=0;n<e.length;++n){var o=e[n],s=!0;if(o.ranges){o.copied||(o=e[n]=o.deepCopy(),o.copied=!0);for(var a=0;a<o.ranges.length;a++)$n(o.ranges[a].anchor,t,r,i),$n(o.ranges[a].head,t,r,i)}else{for(var a=0;a<o.changes.length;++a){var l=o.changes[a];if(r<l.from.line)l.from=vs(l.from.line+i,l.from.ch),l.to=vs(l.to.line+i,l.to.ch);else if(t<=l.to.line){s=!1;break}}s||(e.splice(0,n+1),n=0)}}}function Zn(e,t){var r=t.from.line,i=t.to.line,n=t.text.length-(i-r)-1;Qn(e.done,r,i,n),Qn(e.undone,r,i,n)}function Jn(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function eo(e){return e.target||e.srcElement}function to(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),cs&&e.ctrlKey&&1==t&&(t=3),t}function ro(e,t){function r(e){return function(){e.apply(null,o)}}var i=e._handlers&&e._handlers[t];if(i){var n,o=Array.prototype.slice.call(arguments,2);ys?n=ys.delayedCallbacks:da?n=da:(n=da=[],setTimeout(io,0));for(var s=0;s<i.length;++s)n.push(r(i[s]))}}function io(){var e=da;da=null;for(var t=0;t<e.length;++t)e[t]()}function no(e,t,r){return ca(e,r||t.type,e,t),Jn(t)||t.codemirrorIgnore}function oo(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==ho(r,t[i])&&r.push(t[i])}function so(e,t){var r=e._handlers&&e._handlers[t];return r&&r.length>0}function ao(e){e.prototype.on=function(e,t){ua(this,e,t)},e.prototype.off=function(e,t){pa(this,e,t)}}function lo(){this.id=null}function uo(e,t,r){for(var i=0,n=0;;){var o=e.indexOf(" ",i);-1==o&&(o=e.length);var s=o-i;if(o==e.length||n+s>=t)return i+Math.min(s,t-n);if(n+=o-i,n+=r-n%r,i=o+1,n>=t)return i}}function po(e){for(;xa.length<=e;)xa.push(co(xa)+" ");return xa[e]}function co(e){return e[e.length-1]}function ho(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function Eo(e,t){for(var r=[],i=0;i<e.length;i++)r[i]=t(e[i],i);return r}function fo(e,t){var r;if(Object.create)r=Object.create(e);else{var i=function(){};i.prototype=e,r=new i}return t&&mo(t,r),r}function mo(e,t,r){t||(t={});for(var i in e)!e.hasOwnProperty(i)||r===!1&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function go(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function vo(e,t){return t?t.source.indexOf("\\w")>-1&&Ia(e)?!0:t.test(e):Ia(e)}function xo(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function No(e){return e.charCodeAt(0)>=768&&ya.test(e)}function To(e,t,r,i){var n=document.createElement(e);if(r&&(n.className=r),i&&(n.style.cssText=i),"string"==typeof t)n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)n.appendChild(t[o]);return n}function Lo(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Io(e,t){return Lo(e).appendChild(t)}function yo(e,t){if(e.contains)return e.contains(t);for(;t=t.parentNode;)if(t==e)return!0}function Ao(){return document.activeElement}function So(e){return new RegExp("\\b"+e+"\\b\\s*")}function Co(e,t){var r=So(t);r.test(e.className)&&(e.className=e.className.replace(r,""))}function Ro(e,t){So(t).test(e.className)||(e.className+=" "+t)}function bo(e,t){for(var r=e.split(" "),i=0;i<r.length;i++)r[i]&&!So(r[i]).test(t)&&(t+=" "+r[i]);return t}function Oo(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&e(i)}}function Po(){Ra||(Do(),Ra=!0)}function Do(){var e;ua(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Aa=null,Oo(br)},100))}),ua(window,"blur",function(){Oo(Zr)})}function _o(e){if(null!=Aa)return Aa;var t=To("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return Io(e,t),t.offsetWidth&&(Aa=t.offsetHeight-t.clientHeight),Aa||0}function Mo(e){if(null==Sa){var t=To("span","");Io(e,To("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Sa=t.offsetWidth<=1&&t.offsetHeight>2&&!(Jo&&8>es))}return Sa?To("span",""):To("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function wo(e){if(null!=Ca)return Ca;var t=Io(e,document.createTextNode("AخA")),r=Ta(t,0,1).getBoundingClientRect();if(!r||r.left==r.right)return!1;var i=Ta(t,1,2).getBoundingClientRect();return Ca=i.right-r.right<3}function Go(e){if(null!=_a)return _a;var t=Io(e,To("span","x")),r=t.getBoundingClientRect(),i=Ta(t,0,1).getBoundingClientRect();return _a=Math.abs(r.left-i.left)>1}function ko(e,t,r,i){if(!e)return i(t,r,"ltr");for(var n=!1,o=0;o<e.length;++o){var s=e[o];(s.from<r&&s.to>t||t==r&&s.to==t)&&(i(Math.max(s.from,t),Math.min(s.to,r),1==s.level?"rtl":"ltr"),n=!0)}n||i(t,r,"ltr")}function Bo(e){return e.level%2?e.to:e.from}function Uo(e){return e.level%2?e.from:e.to}function Vo(e){var t=kn(e);return t?Bo(t[0]):0}function Ho(e){var t=kn(e);return t?Uo(co(t)):e.text.length}function Fo(e,t){var r=On(e.doc,t),i=Qi(r);i!=r&&(t=Mn(i));var n=kn(i),o=n?n[0].level%2?Ho(i):Vo(i):0;return vs(t,o)}function jo(e,t){for(var r,i=On(e.doc,t);r=Ki(i);)i=r.find(1,!0).line,t=null;var n=kn(i),o=n?n[0].level%2?Vo(i):Ho(i):i.text.length;return vs(null==t?Mn(i):t,o)}function Wo(e,t){var r=Fo(e,t.line),i=On(e.doc,r.line),n=kn(i);if(!n||0==n[0].level){var o=Math.max(0,i.text.search(/\S/)),s=t.line==r.line&&t.ch<=o&&t.ch;return vs(r.line,s?0:o)}return r}function qo(e,t,r){var i=e[0].level;return t==i?!0:r==i?!1:r>t}function zo(e,t){wa=null;for(var r,i=0;i<e.length;++i){var n=e[i];if(n.from<t&&n.to>t)return i;if(n.from==t||n.to==t){if(null!=r)return qo(e,n.level,e[r].level)?(n.from!=n.to&&(wa=r),i):(n.from!=n.to&&(wa=i),r);r=i}}return r}function Xo(e,t,r,i){if(!i)return t+r;do t+=r;while(t>0&&No(e.text.charAt(t)));return t}function Yo(e,t,r,i){var n=kn(e);if(!n)return Ko(e,t,r,i);for(var o=zo(n,t),s=n[o],a=Xo(e,t,s.level%2?-r:r,i);;){if(a>s.from&&a<s.to)return a;if(a==s.from||a==s.to)return zo(n,a)==o?a:(s=n[o+=r],r>0==s.level%2?s.to:s.from);if(s=n[o+=r],!s)return null;a=r>0==s.level%2?Xo(e,s.to,-1,i):Xo(e,s.from,1,i)}}function Ko(e,t,r,i){var n=t+r;if(i)for(;n>0&&No(e.text.charAt(n));)n+=r;return 0>n||n>e.text.length?null:n}var $o=/gecko\/\d/i.test(navigator.userAgent),Qo=/MSIE \d/.test(navigator.userAgent),Zo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Jo=Qo||Zo,es=Jo&&(Qo?document.documentMode||6:Zo[1]),ts=/WebKit\//.test(navigator.userAgent),rs=ts&&/Qt\/\d+\.\d+/.test(navigator.userAgent),is=/Chrome\//.test(navigator.userAgent),ns=/Opera\//.test(navigator.userAgent),os=/Apple Computer/.test(navigator.vendor),ss=/KHTML\//.test(navigator.userAgent),as=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),ls=/PhantomJS/.test(navigator.userAgent),us=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),ps=us||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),cs=us||/Mac/.test(navigator.platform),ds=/win/i.test(navigator.platform),hs=ns&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);hs&&(hs=Number(hs[1])),hs&&hs>=15&&(ns=!1,ts=!0);var Es=cs&&(rs||ns&&(null==hs||12.11>hs)),fs=$o||Jo&&es>=9,ms=!1,gs=!1,vs=e.Pos=function(e,t){return this instanceof vs?(this.line=e,void(this.ch=t)):new vs(e,t)},xs=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch};Y.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],i=e.ranges[t];if(0!=xs(r.anchor,i.anchor)||0!=xs(r.head,i.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new K(q(this.ranges[t].anchor),q(this.ranges[t].head));return new Y(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 i=this.ranges[r];if(xs(t,i.from())>=0&&xs(e,i.to())<=0)return r}return-1}},K.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return z(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Ns,Ts,Ls,Is={left:0,right:0,top:0,bottom:0},ys=null,As=0,Ss=null,Cs=0,Rs=0,bs=null;Jo?bs=-.53:$o?bs=15:is?bs=-.7:os&&(bs=-1/3);var Os,Ps=null,Ds=e.changeEnd=function(e){return e.text?vs(e.from.line+e.text.length-1,co(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),Ar(this),Lr(this)},setOption:function(e,t){var r=this.options,i=r[e];(r[e]!=t||"mode"==e)&&(r[e]=t,Ms.hasOwnProperty(e)&&ur(this,Ms[e])(this,t,i))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](e)},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||"string"!=typeof t[r]&&t[r].name==e)return t.splice(r,1),!0},addOverlay:pr(function(t,r){var i=t.token?t:e.getMode(this.options,t);if(i.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:i,modeSpec:t,opaque:r&&r.opaque}),this.state.modeGen++,Er(this)}),removeOverlay:pr(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var i=t[r].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return t.splice(r,1),this.state.modeGen++,void Er(this)}}),indentLine:pr(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),tt(this.doc,e)&&Ni(this,e,t,r)}),indentSelection:pr(function(e){for(var t=this.doc.sel.ranges,r=-1,i=0;i<t.length;i++){var n=t[i];if(n.empty())n.head.line>r&&(Ni(this,n.head.line,e,!0),r=n.head.line,i==this.doc.sel.primIndex&&vi(this));else{var o=n.from(),s=n.to(),a=Math.max(r,o.line);r=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;r>l;++l)Ni(this,l,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[i].from().ch>0&&st(this.doc,i,new K(o,u[i].to()),fa)}}}),getTokenAt:function(e,t){var r=this.doc;e=J(r,e);for(var i=At(this,e.line,t),n=this.doc.mode,o=On(r,e.line),s=new Ys(o.text,this.options.tabSize);s.pos<e.ch&&!s.eol();){s.start=s.pos;var a=cn(n,s,i)}return{start:s.start,end:s.pos,string:s.current(),type:a||null,state:i}},getTokenTypeAt:function(e){e=J(this.doc,e);var t,r=En(this,On(this.doc,e.line)),i=0,n=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var s=i+n>>1;if((s?r[2*s-1]:0)>=o)n=s;else{if(!(r[2*s+1]<o)){t=r[2*s+2];break}i=s+1}}var a=t?t.indexOf("cm-overlay "):-1;return 0>a?t:0==a?null:t.slice(0,a-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(!Vs.hasOwnProperty(t))return Vs;var i=Vs[t],n=this.getModeAt(e);if("string"==typeof n[t])i[n[t]]&&r.push(i[n[t]]);else if(n[t])for(var o=0;o<n[t].length;o++){var s=i[n[t][o]];s&&r.push(s)}else n.helperType&&i[n.helperType]?r.push(i[n.helperType]):i[n.name]&&r.push(i[n.name]);for(var o=0;o<i._global.length;o++){var a=i._global[o];a.pred(n,this)&&-1==ho(r,a.val)&&r.push(a.val)}return r},getStateAfter:function(e,t){var r=this.doc;return e=Z(r,null==e?r.first+r.size-1:e),At(this,e+1,t)},cursorCoords:function(e,t){var r,i=this.doc.sel.primary();return r=null==e?i.head:"object"==typeof e?J(this.doc,e):e?i.from():i.to(),zt(this,r,t||"page")},charCoords:function(e,t){return qt(this,J(this.doc,e),t||"page")},coordsChar:function(e,t){return e=Wt(this,e,t||"page"),Kt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=Wt(this,{top:e,left:0},t||"page").top,wn(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var r=!1,i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,r=!0);var n=On(this.doc,e);return jt(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-Gn(n):0)},defaultTextHeight:function(){return Qt(this.display)},defaultCharWidth:function(){return Zt(this.display)},setGutterMarker:pr(function(e,t,r){return Ti(this.doc,e,"gutter",function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return i[t]=r,!r&&xo(i)&&(e.gutterMarkers=null),!0})}),clearGutter:pr(function(e){var t=this,r=t.doc,i=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,fr(t,i,"gutter"),xo(r.gutterMarkers)&&(r.gutterMarkers=null)),++i})}),addLineWidget:pr(function(e,t,r){return sn(this,e,t,r)}),removeLineWidget:function(e){e.clear()},lineInfo:function(e){if("number"==typeof e){if(!tt(this.doc,e))return null;var t=e;if(e=On(this.doc,e),!e)return null}else{var t=Mn(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,i,n){var o=this.display;e=zt(this,J(this.doc,e));var s=e.bottom,a=e.left;if(t.style.position="absolute",o.sizer.appendChild(t),"over"==i)s=e.top;else if("above"==i||"near"==i){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(s=e.bottom),a+t.offsetWidth>u&&(a=u-t.offsetWidth)}t.style.top=s+"px",t.style.left=t.style.right="","right"==n?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==n?a=0:"middle"==n&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),r&&fi(this,a,s,a+t.offsetWidth,s+t.offsetHeight)},triggerOnKeyDown:pr(Xr),triggerOnKeyPress:pr($r),triggerOnKeyUp:Kr,execCommand:function(e){return js.hasOwnProperty(e)?js[e](this):void 0},findPosH:function(e,t,r,i){var n=1;0>t&&(n=-1,t=-t);for(var o=0,s=J(this.doc,e);t>o&&(s=Ii(this.doc,s,n,r,i),!s.hitSide);++o);return s},moveH:pr(function(e,t){var r=this;r.extendSelectionsBy(function(i){return r.display.shift||r.doc.extend||i.empty()?Ii(r.doc,i.head,e,t,r.options.rtlMoveVisually):0>e?i.from():i.to()},ga)}),deleteH:pr(function(e,t){var r=this.doc.sel,i=this.doc;r.somethingSelected()?i.replaceSelection("",null,"+delete"):Li(this,function(r){var n=Ii(i,r.head,e,t,!1);return 0>e?{from:n,to:r.head}:{from:r.head,to:n}})}),findPosV:function(e,t,r,i){var n=1,o=i;0>t&&(n=-1,t=-t);for(var s=0,a=J(this.doc,e);t>s;++s){var l=zt(this,a,"div");if(null==o?o=l.left:l.left=o,a=yi(this,l,n,r),a.hitSide)break}return a},moveV:pr(function(e,t){var r=this,i=this.doc,n=[],o=!r.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy(function(s){if(o)return 0>e?s.from():s.to();var a=zt(r,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),n.push(a.left);var l=yi(r,a,e,t);return"page"==t&&s==i.sel.primary()&&gi(r,null,qt(r,l,"div").top-a.top),l},ga),n.length)for(var s=0;s<i.sel.ranges.length;s++)i.sel.ranges[s].goalColumn=n[s]}),findWordAt:function(e){var t=this.doc,r=On(t,e.line).text,i=e.ch,n=e.ch;if(r){var o=this.getHelper(e,"wordChars");(e.xRel<0||n==r.length)&&i?--i:++n;for(var s=r.charAt(i),a=vo(s,o)?function(e){return vo(e,o)}:/\s/.test(s)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!vo(e)};i>0&&a(r.charAt(i-1));)--i;for(;n<r.length&&a(r.charAt(n));)++n}return new K(vs(e.line,i),vs(e.line,n))},toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?Ro(this.display.cursorDiv,"CodeMirror-overwrite"):Co(this.display.cursorDiv,"CodeMirror-overwrite"),ca(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return Ao()==this.display.input},scrollTo:pr(function(e,t){(null!=e||null!=t)&&xi(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller,t=ha;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-t,width:e.scrollWidth-t,clientHeight:e.clientHeight-t,clientWidth:e.clientWidth-t}},scrollIntoView:pr(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:vs(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)xi(this),this.curOp.scrollToPos=e;else{var r=mi(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:pr(function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var i=this;null!=e&&(i.display.wrapper.style.width=r(e)),null!=t&&(i.display.wrapper.style.height=r(t)),i.options.lineWrapping&&Ut(this);var n=i.display.viewFrom;i.doc.iter(n,i.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){fr(i,n,"widget");break}++n}),i.curOp.forceUpdate=!0,ca(i,"refresh",this)}),operation:function(e){return lr(this,e)},refresh:pr(function(){var e=this.display.cachedTextHeight;Er(this),this.curOp.forceUpdate=!0,Vt(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),c(this),(null==e||Math.abs(e-Qt(this.display))>.5)&&s(this),ca(this,"refresh",this)}),swapDoc:pr(function(e){var t=this.doc;return t.cm=null,bn(this,e),Vt(this),yr(this),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ro(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ao(e);var _s=e.defaults={},Ms=e.optionHandlers={},ws=e.Init={toString:function(){return"CodeMirror.Init"}};Ai("value","",function(e,t){e.setValue(t)},!0),Ai("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),Ai("indentUnit",2,r,!0),Ai("indentWithTabs",!1),Ai("smartIndent",!0),Ai("tabSize",4,function(e){i(e),Vt(e),Er(e)},!0),Ai("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t){e.options.specialChars=new RegExp(t.source+(t.test(" ")?"":"| "),"g"),e.refresh()},!0),Ai("specialCharPlaceholder",vn,function(e){e.refresh()},!0),Ai("electricChars",!0),Ai("rtlMoveVisually",!ds),Ai("wholeLineUpdateBefore",!0),Ai("theme","default",function(e){l(e),u(e)},!0),Ai("keyMap","default",a),Ai("extraKeys",null),Ai("lineWrapping",!1,n,!0),Ai("gutters",[],function(e){E(e.options),u(e)},!0),Ai("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?L(e.display)+"px":"0",e.refresh()},!0),Ai("coverGutterNextToScrollbar",!1,g,!0),Ai("lineNumbers",!1,function(e){E(e.options),u(e)},!0),Ai("firstLineNumber",1,u,!0),Ai("lineNumberFormatter",function(e){return e},u,!0),Ai("showCursorWhenSelecting",!1,vt,!0),Ai("resetSelectionOnContextMenu",!0),Ai("readOnly",!1,function(e,t){"nocursor"==t?(Zr(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||yr(e))}),Ai("disableInput",!1,function(e,t){t||yr(e)},!0),Ai("dragDrop",!0),Ai("cursorBlinkRate",530),Ai("cursorScrollMargin",0),Ai("cursorHeight",1,vt,!0),Ai("singleCursorHeightPerLine",!0,vt,!0),Ai("workTime",100),Ai("workDelay",100),Ai("flattenSpans",!0,i,!0),Ai("addModeClass",!1,i,!0),Ai("pollInterval",100),Ai("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Ai("historyEventDelay",1250),Ai("viewportMargin",10,function(e){e.refresh()},!0),Ai("maxHighlightLength",1e4,i,!0),Ai("moveInputWithCursor",!0,function(e,t){t||(e.display.inputDiv.style.top=e.display.inputDiv.style.left=0)}),Ai("tabindex",null,function(e,t){e.display.input.tabIndex=t||""}),Ai("autofocus",null);var Gs=e.modes={},ks=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)),Gs[t]=r},e.defineMIME=function(e,t){ks[e]=t},e.resolveMode=function(t){if("string"==typeof t&&ks.hasOwnProperty(t))t=ks[t];else if(t&&"string"==typeof t.name&&ks.hasOwnProperty(t.name)){var r=ks[t.name];"string"==typeof r&&(r={name:r}),t=fo(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),i=Gs[r.name];if(!i)return e.getMode(t,"text/plain");var n=i(t,r);if(Bs.hasOwnProperty(r.name)){var o=Bs[r.name];for(var s in o)o.hasOwnProperty(s)&&(n.hasOwnProperty(s)&&(n["_"+s]=n[s]),n[s]=o[s])}if(n.name=r.name,r.helperType&&(n.helperType=r.helperType),r.modeProps)for(var s in r.modeProps)n[s]=r.modeProps[s];return n},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var Bs=e.modeExtensions={};e.extendMode=function(e,t){var r=Bs.hasOwnProperty(e)?Bs[e]:Bs[e]={};mo(t,r)},e.defineExtension=function(t,r){e.prototype[t]=r},e.defineDocExtension=function(e,t){ia.prototype[e]=t},e.defineOption=Ai;var Us=[];e.defineInitHook=function(e){Us.push(e)};var Vs=e.helpers={};e.registerHelper=function(t,r,i){Vs.hasOwnProperty(t)||(Vs[t]=e[t]={_global:[]}),Vs[t][r]=i},e.registerGlobalHelper=function(t,r,i,n){e.registerHelper(t,r,n),Vs[t]._global.push({pred:i,val:n})};var Hs=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var i in t){var n=t[i];n instanceof Array&&(n=n.concat([])),r[i]=n}return r},Fs=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 js=e.commands={selectAll:function(e){e.setSelection(vs(e.firstLine(),0),vs(e.lastLine()),fa)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),fa)},killLine:function(e){Li(e,function(t){if(t.empty()){var r=On(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:vs(t.head.line+1,0)}:{from:t.head,to:vs(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Li(e,function(t){return{from:vs(t.from().line,0),to:J(e.doc,vs(t.to().line+1,0))}})},delLineLeft:function(e){Li(e,function(e){return{from:vs(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Li(e,function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){Li(e,function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:i}})},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(vs(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(vs(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return Fo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return Wo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return jo(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")},ga)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},ga)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return i.ch<e.getLine(i.line).search(/\S/)?Wo(e,t.head):i},ga)},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(),i=e.options.tabSize,n=0;n<r.length;n++){var o=r[n].from(),s=va(e.getLine(o.line),o.ch,i);t.push(new Array(i-s%i+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){lr(e,function(){for(var t=e.listSelections(),r=[],i=0;i<t.length;i++){var n=t[i].head,o=On(e.doc,n.line).text;if(o)if(n.ch==o.length&&(n=new vs(n.line,n.ch-1)),n.ch>0)n=new vs(n.line,n.ch+1),e.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),vs(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var s=On(e.doc,n.line-1).text;s&&e.replaceRange(o.charAt(0)+"\n"+s.charAt(s.length-1),vs(n.line-1,s.length-1),vs(n.line,1),"+transpose")}r.push(new K(n,n))}e.setSelections(r)})},newlineAndIndent:function(e){lr(e,function(){for(var t=e.listSelections().length,r=0;t>r;r++){var i=e.listSelections()[r];e.replaceRange("\n",i.anchor,i.head,"+input"),e.indentLine(i.from().line+1,null,!0),vi(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},Ws=e.keyMap={};Ws.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"},Ws.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"},Ws.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"]},Ws.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"},Ws["default"]=cs?Ws.macDefault:Ws.pcDefault;var qs=e.lookupKey=function(e,t,r){function i(t){t=Si(t);var n=t[e];if(n===!1)return"stop";if(null!=n&&r(n))return!0;if(t.nofallthrough)return"stop";var o=t.fallthrough;if(null==o)return!1;if("[object Array]"!=Object.prototype.toString.call(o))return i(o);for(var s=0;s<o.length;++s){var a=i(o[s]);if(a)return a}return!1}for(var n=0;n<t.length;++n){var o=i(t[n]);if(o)return"stop"!=o}},zs=e.isModifierKey=function(e){var t=Ma[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},Xs=e.keyName=function(e,t){if(ns&&34==e.keyCode&&e["char"])return!1;var r=Ma[e.keyCode];return null==r||e.altGraphKey?!1:(e.altKey&&(r="Alt-"+r),(Es?e.metaKey:e.ctrlKey)&&(r="Ctrl-"+r),(Es?e.ctrlKey:e.metaKey)&&(r="Cmd-"+r),!t&&e.shiftKey&&(r="Shift-"+r),r)
};e.fromTextArea=function(t,r){function i(){t.value=u.getValue()}if(r||(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 n=Ao();r.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}if(t.form&&(ua(t.form,"submit",i),!r.leaveSubmitMethodAlone)){var o=t.form,s=o.submit;try{var a=o.submit=function(){i(),o.submit=s,o.submit(),o.submit=a}}catch(l){}}t.style.display="none";var u=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},r);return u.save=i,u.getTextArea=function(){return t},u.toTextArea=function(){u.toTextArea=isNaN,i(),t.parentNode.removeChild(u.getWrapperElement()),t.style.display="",t.form&&(pa(t.form,"submit",i),"function"==typeof t.form.submit&&(t.form.submit=s))},u};var Ys=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};Ys.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=va(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?va(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return va(this.string,null,this.tabSize)-(this.lineStart?va(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,r){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}var n=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return n(o)==n(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 Ks=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e};ao(Ks),Ks.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Jt(e),so(this,"clear")){var r=this.find();r&&ro(this,"clear",r.from,r.to)}for(var i=null,n=null,o=0;o<this.lines.length;++o){var s=this.lines[o],a=_i(s.markedSpans,this);e&&!this.collapsed?fr(e,Mn(s),"text"):e&&(null!=a.to&&(n=Mn(s)),null!=a.from&&(i=Mn(s))),s.markedSpans=Mi(s.markedSpans,a),null==a.from&&this.collapsed&&!tn(this.doc,s)&&e&&_n(s,Qt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var l=Qi(this.lines[o]),u=d(l);u>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&Er(e,i,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ht(e.doc)),e&&ro(e,"markerCleared",e,this),t&&tr(e),this.parent&&this.parent.clear()}},Ks.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,i,n=0;n<this.lines.length;++n){var o=this.lines[n],s=_i(o.markedSpans,this);if(null!=s.from&&(r=vs(t?o:Mn(o),s.from),-1==e))return r;if(null!=s.to&&(i=vs(t?o:Mn(o),s.to),1==e))return i}return r&&{from:r,to:i}},Ks.prototype.changed=function(){var e=this.find(-1,!0),t=this,r=this.doc.cm;e&&r&&lr(r,function(){var i=e.line,n=Mn(e.line),o=_t(r,n);if(o&&(Bt(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!tn(t.doc,i)&&null!=t.height){var s=t.height;t.height=null;var a=on(t)-s;a&&_n(i,i.height+a)}})},Ks.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=ho(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ks.prototype.detachLine=function(e){if(this.lines.splice(ho(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var $s=0,Qs=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};ao(Qs),Qs.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ro(this,"clear")}},Qs.prototype.find=function(e,t){return this.primary.find(e,t)};var Zs=e.LineWidget=function(e,t,r){if(r)for(var i in r)r.hasOwnProperty(i)&&(this[i]=r[i]);this.cm=e,this.node=t};ao(Zs),Zs.prototype.clear=function(){var e=this.cm,t=this.line.widgets,r=this.line,i=Mn(r);if(null!=i&&t){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(r.widgets=null);var o=on(this);lr(e,function(){nn(e,r,-o),fr(e,i,"widget"),_n(r,Math.max(0,r.height-o))})}},Zs.prototype.changed=function(){var e=this.height,t=this.cm,r=this.line;this.height=null;var i=on(this)-e;i&&lr(t,function(){t.curOp.forceUpdate=!0,nn(t,r,i),_n(r,r.height+i)})};var Js=e.Line=function(e,t,r){this.text=e,ji(this,t),this.height=r?r(this):1};ao(Js),Js.prototype.lineNo=function(){return Mn(this)};var ea={},ta={};Sn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,i=e+t;i>r;++r){var n=this.lines[r];this.height-=n.height,ln(n),ro(n,"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 i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,r){for(var i=e+t;i>e;++e)if(r(this.lines[e]))return!0}},Cn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],n=i.chunkSize();if(n>e){var o=Math.min(t,n-e),s=i.height;if(i.removeInner(e,o),this.height-=s-i.height,n==o&&(this.children.splice(r--,1),i.parent=null),0==(t-=o))break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Sn))){var a=[];this.collapse(a),this.children=[new Sn(a)],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 i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(o>=e){if(n.insertInner(e,t,r),n.lines&&n.lines.length>50){for(;n.lines.length>50;){var s=n.lines.splice(n.lines.length-25,25),a=new Sn(s);n.height-=a.height,this.children.splice(i+1,0,a),a.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 Cn(t);if(e.parent){e.size-=r.size,e.height-=r.height;var i=ho(e.parent.children,e);e.parent.children.splice(i+1,0,r)}else{var n=new Cn(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(o>e){var s=Math.min(t,o-e);if(n.iterN(e,s,r))return!0;if(0==(t-=s))break;e=0}else e-=o}}};var ra=0,ia=e.Doc=function(e,t,r){if(!(this instanceof ia))return new ia(e,t,r);null==r&&(r=0),Cn.call(this,[new Sn([new Js("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var i=vs(r,0);this.sel=Q(i),this.history=new Bn(null),this.id=++ra,this.modeOption=t,"string"==typeof e&&(e=Oa(e)),An(this,{from:i,to:i,text:e}),pt(this,Q(i),fa)};ia.prototype=fo(Cn.prototype,{constructor:ia,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,i=0;i<t.length;++i)r+=t[i].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Dn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||"\n")},setValue:cr(function(e){var t=vs(this.first,0),r=this.first+this.size-1;si(this,{from:t,to:vs(r,On(this,r).text.length),text:Oa(e),origin:"setValue"},!0),pt(this,Q(t))}),replaceRange:function(e,t,r,i){t=J(this,t),r=r?J(this,r):t,di(this,e,t,r,i)},getRange:function(e,t,r){var i=Pn(this,J(this,e),J(this,t));return r===!1?i:i.join(r||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return tt(this,e)?On(this,e):void 0},getLineNumber:function(e){return Mn(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=On(this,e)),Qi(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return J(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:cr(function(e,t,r){at(this,J(this,"number"==typeof e?vs(e,t||0):e),null,r)}),setSelection:cr(function(e,t,r){at(this,J(this,e),J(this,t||e),r)}),extendSelection:cr(function(e,t,r){nt(this,J(this,e),t&&J(this,t),r)}),extendSelections:cr(function(e,t){ot(this,rt(this,e,t))}),extendSelectionsBy:cr(function(e,t){ot(this,Eo(this.sel.ranges,e),t)}),setSelections:cr(function(e,t,r){if(e.length){for(var i=0,n=[];i<e.length;i++)n[i]=new K(J(this,e[i].anchor),J(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),pt(this,$(n,t),r)}}),addSelection:cr(function(e,t,r){var i=this.sel.ranges.slice(0);i.push(new K(J(this,e),J(this,t||e))),pt(this,$(i,i.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,i=0;i<r.length;i++){var n=Pn(this,r[i].from(),r[i].to());t=t?t.concat(n):n}return e===!1?t:t.join(e||"\n")},getSelections:function(e){for(var t=[],r=this.sel.ranges,i=0;i<r.length;i++){var n=Pn(this,r[i].from(),r[i].to());e!==!1&&(n=n.join(e||"\n")),t[i]=n}return t},replaceSelection:function(e,t,r){for(var i=[],n=0;n<this.sel.ranges.length;n++)i[n]=e;this.replaceSelections(i,t,r||"+input")},replaceSelections:cr(function(e,t,r){for(var i=[],n=this.sel,o=0;o<n.ranges.length;o++){var s=n.ranges[o];i[o]={from:s.from(),to:s.to(),text:Oa(e[o]),origin:r}}for(var a=t&&"end"!=t&&ni(this,i,t),o=i.length-1;o>=0;o--)si(this,i[o]);a?ut(this,a):this.cm&&vi(this.cm)}),undo:cr(function(){li(this,"undo")}),redo:cr(function(){li(this,"redo")}),undoSelection:cr(function(){li(this,"undo",!0)}),redoSelection:cr(function(){li(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,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new Bn(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:Kn(this.history.done),undone:Kn(this.history.undone)}},setHistory:function(e){var t=this.history=new Bn(this.history.maxGeneration);t.done=Kn(e.done.slice(0),null,!0),t.undone=Kn(e.undone.slice(0),null,!0)},addLineClass:cr(function(e,t,r){return Ti(this,e,"class",function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"wrapClass";if(e[i]){if(new RegExp("(?:^|\\s)"+r+"(?:$|\\s)").test(e[i]))return!1;e[i]+=" "+r}else e[i]=r;return!0})}),removeLineClass:cr(function(e,t,r){return Ti(this,e,"class",function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"wrapClass",n=e[i];if(!n)return!1;if(null==r)e[i]=null;else{var o=n.match(new RegExp("(?:^|\\s+)"+r+"(?:$|\\s+)"));if(!o)return!1;var s=o.index+o[0].length;e[i]=n.slice(0,o.index)+(o.index&&s!=n.length?" ":"")+n.slice(s)||null}return!0})}),markText:function(e,t,r){return Ci(this,J(this,e),J(this,t),r,"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};return e=J(this,e),Ci(this,e,e,r,"bookmark")},findMarksAt:function(e){e=J(this,e);var t=[],r=On(this,e.line).markedSpans;if(r)for(var i=0;i<r.length;++i){var n=r[i];(null==n.from||n.from<=e.ch)&&(null==n.to||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,r){e=J(this,e),t=J(this,t);var i=[],n=e.line;return this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];n==e.line&&e.ch>l.to||null==l.from&&n!=e.line||n==t.line&&l.from>t.ch||r&&!r(l.marker)||i.push(l.marker.parent||l.marker)}++n}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var i=0;i<r.length;++i)null!=r[i].from&&e.push(r[i].marker)}),e},posFromIndex:function(e){var t,r=this.first;return this.iter(function(i){var n=i.text.length+1;return n>e?(t=e,!0):(e-=n,void++r)}),J(this,vs(r,t))},indexFromPos:function(e){e=J(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 ia(Dn(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var i=new ia(Dn(this,t,r),e.mode||this.modeOption,t);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Oi(i,bi(this)),i},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var r=0;r<this.linked.length;++r){var i=this.linked[r];if(i.doc==t){this.linked.splice(r,1),t.unlinkDoc(this),Pi(bi(this));break}}if(t.history==this.history){var n=[t.id];Rn(t,function(e){n.push(e.id)},!0),t.history=new Bn(null),t.history.done=Kn(this.history.done,n),t.history.undone=Kn(this.history.undone,n)}},iterLinkedDocs:function(e){Rn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),ia.prototype.eachLine=ia.prototype.iter;var na="iter insert remove copy getEditor".split(" ");for(var oa in ia.prototype)ia.prototype.hasOwnProperty(oa)&&ho(na,oa)<0&&(e.prototype[oa]=function(e){return function(){return e.apply(this.doc,arguments)}}(ia.prototype[oa]));ao(ia);var sa=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},aa=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},la=e.e_stop=function(e){sa(e),aa(e)},ua=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 i=e._handlers||(e._handlers={}),n=i[t]||(i[t]=[]);n.push(r)}},pa=e.off=function(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var i=e._handlers&&e._handlers[t];if(!i)return;for(var n=0;n<i.length;++n)if(i[n]==r){i.splice(n,1);break}}},ca=e.signal=function(e,t){var r=e._handlers&&e._handlers[t];if(r)for(var i=Array.prototype.slice.call(arguments,2),n=0;n<r.length;++n)r[n].apply(null,i)},da=null,ha=30,Ea=e.Pass={toString:function(){return"CodeMirror.Pass"}},fa={scroll:!1},ma={origin:"*mouse"},ga={origin:"+move"};lo.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var va=e.countColumn=function(e,t,r,i,n){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=i||0,s=n||0;;){var a=e.indexOf(" ",o);if(0>a||a>=t)return s+(t-o);s+=a-o,s+=r-s%r,o=a+1}},xa=[""],Na=function(e){e.select()};us?Na=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Jo&&(Na=function(e){try{e.select()}catch(t){}}),[].indexOf&&(ho=function(e,t){return e.indexOf(t)}),[].map&&(Eo=function(e,t){return e.map(t)});var Ta,La=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ia=e.isWordChar=function(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||La.test(e))},ya=/[\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]/;Ta=document.createRange?function(e,t,r){var i=document.createRange();return i.setEnd(e,r),i.setStart(e,t),i}:function(e,t,r){var i=document.body.createTextRange();return i.moveToElementText(e.parentNode),i.collapse(!0),i.moveEnd("character",r),i.moveStart("character",t),i},Jo&&11>es&&(Ao=function(){try{return document.activeElement}catch(e){return document.body}});var Aa,Sa,Ca,Ra=!1,ba=function(){if(Jo&&9>es)return!1;var e=To("div");return"draggable"in e||"dragDrop"in e}(),Oa=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],i=e.length;i>=t;){var n=e.indexOf("\n",t);-1==n&&(n=e.length);var o=e.slice(t,"\r"==e.charAt(n-1)?n-1:n),s=o.indexOf("\r");-1!=s?(r.push(o.slice(0,s)),t+=s+1):(r.push(o),t=n+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Pa=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},Da=function(){var e=To("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),_a=null,Ma={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=Ma,function(){for(var e=0;10>e;e++)Ma[e+48]=Ma[e+96]=String(e);for(var e=65;90>=e;e++)Ma[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)Ma[e+111]=Ma[e+63235]="F"+e}();var wa,Ga=function(){function e(e){return 247>=e?r.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?i.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",i="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,s=/[LRr]/,a=/[Lb1n]/,l=/[1n]/,u="L";return function(r){if(!n.test(r))return!1;for(var i,p=r.length,c=[],d=0;p>d;++d)c.push(i=e(r.charCodeAt(d)));for(var d=0,h=u;p>d;++d){var i=c[d];"m"==i?c[d]=h:h=i}for(var d=0,E=u;p>d;++d){var i=c[d];"1"==i&&"r"==E?c[d]="n":s.test(i)&&(E=i,"r"==i&&(c[d]="R"))}for(var d=1,h=c[0];p-1>d;++d){var i=c[d];"+"==i&&"1"==h&&"1"==c[d+1]?c[d]="1":","!=i||h!=c[d+1]||"1"!=h&&"n"!=h||(c[d]=h),h=i}for(var d=0;p>d;++d){var i=c[d];if(","==i)c[d]="N";else if("%"==i){for(var f=d+1;p>f&&"%"==c[f];++f);for(var m=d&&"!"==c[d-1]||p>f&&"1"==c[f]?"1":"N",g=d;f>g;++g)c[g]=m;d=f-1}}for(var d=0,E=u;p>d;++d){var i=c[d];"L"==E&&"1"==i?c[d]="L":s.test(i)&&(E=i)}for(var d=0;p>d;++d)if(o.test(c[d])){for(var f=d+1;p>f&&o.test(c[f]);++f);for(var v="L"==(d?c[d-1]:u),x="L"==(p>f?c[f]:u),m=v||x?"L":"R",g=d;f>g;++g)c[g]=m;d=f-1}for(var N,T=[],d=0;p>d;)if(a.test(c[d])){var L=d;for(++d;p>d&&a.test(c[d]);++d);T.push(new t(0,L,d))}else{var I=d,y=T.length;for(++d;p>d&&"L"!=c[d];++d);for(var g=I;d>g;)if(l.test(c[g])){g>I&&T.splice(y,0,new t(1,I,g));var A=g;for(++g;d>g&&l.test(c[g]);++g);T.splice(y,0,new t(2,A,g)),I=g}else++g;d>I&&T.splice(y,0,new t(1,I,d))}return 1==T[0].level&&(N=r.match(/^\s+/))&&(T[0].from=N[0].length,T.unshift(new t(0,0,N[0].length))),1==co(T).level&&(N=r.match(/\s+$/))&&(co(T).to-=N[0].length,T.push(new t(0,p-N[0].length,p))),T[0].level!=co(T).level&&T.push(new t(T[0].level,p,p)),T}}();return e.version="4.7.0",e})},{}],11:[function(t,r){!function(e,t){"object"==typeof r&&"object"==typeof r.exports?r.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(t,r){function i(e){var t=e.length,r=ot.type(e);return"function"===r||ot.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e}function n(e,t,r){if(ot.isFunction(t))return ot.grep(e,function(e,i){return!!t.call(e,i,e)!==r});if(t.nodeType)return ot.grep(e,function(e){return e===t!==r});if("string"==typeof t){if(ht.test(t))return ot.filter(t,e,r);t=ot.filter(t,e)}return ot.grep(e,function(e){return ot.inArray(e,t)>=0!==r})}function o(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function s(e){var t=Tt[e]={};return ot.each(e.match(Nt)||[],function(e,r){t[r]=!0}),t}function a(){ft.addEventListener?(ft.removeEventListener("DOMContentLoaded",l,!1),t.removeEventListener("load",l,!1)):(ft.detachEvent("onreadystatechange",l),t.detachEvent("onload",l))}function l(){(ft.addEventListener||"load"===event.type||"complete"===ft.readyState)&&(a(),ot.ready())}function u(e,t,r){if(void 0===r&&1===e.nodeType){var i="data-"+t.replace(St,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:At.test(r)?ot.parseJSON(r):r}catch(n){}ot.data(e,t,r)}else r=void 0}return r}function p(e){var t;for(t in e)if(("data"!==t||!ot.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,r,i){if(ot.acceptData(e)){var n,o,s=ot.expando,a=e.nodeType,l=a?ot.cache:e,u=a?e[s]:e[s]&&s;if(u&&l[u]&&(i||l[u].data)||void 0!==r||"string"!=typeof t)return u||(u=a?e[s]=K.pop()||ot.guid++:s),l[u]||(l[u]=a?{}:{toJSON:ot.noop}),("object"==typeof t||"function"==typeof t)&&(i?l[u]=ot.extend(l[u],t):l[u].data=ot.extend(l[u].data,t)),o=l[u],i||(o.data||(o.data={}),o=o.data),void 0!==r&&(o[ot.camelCase(t)]=r),"string"==typeof t?(n=o[t],null==n&&(n=o[ot.camelCase(t)])):n=o,n}}function d(e,t,r){if(ot.acceptData(e)){var i,n,o=e.nodeType,s=o?ot.cache:e,a=o?e[ot.expando]:ot.expando;if(s[a]){if(t&&(i=r?s[a]:s[a].data)){ot.isArray(t)?t=t.concat(ot.map(t,ot.camelCase)):t in i?t=[t]:(t=ot.camelCase(t),t=t in i?[t]:t.split(" ")),n=t.length;for(;n--;)delete i[t[n]];if(r?!p(i):!ot.isEmptyObject(i))return}(r||(delete s[a].data,p(s[a])))&&(o?ot.cleanData([e],!0):it.deleteExpando||s!=s.window?delete s[a]:s[a]=null)}}}function h(){return!0}function E(){return!1}function f(){try{return ft.activeElement}catch(e){}}function m(e){var t=kt.split("|"),r=e.createDocumentFragment();if(r.createElement)for(;t.length;)r.createElement(t.pop());return r}function g(e,t){var r,i,n=0,o=typeof e.getElementsByTagName!==yt?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==yt?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],r=e.childNodes||e;null!=(i=r[n]);n++)!t||ot.nodeName(i,t)?o.push(i):ot.merge(o,g(i,t));return void 0===t||t&&ot.nodeName(e,t)?ot.merge([e],o):o}function v(e){Pt.test(e.type)&&(e.defaultChecked=e.checked)}function x(e,t){return ot.nodeName(e,"table")&&ot.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function N(e){return e.type=(null!==ot.find.attr(e,"type"))+"/"+e.type,e}function T(e){var t=Yt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function L(e,t){for(var r,i=0;null!=(r=e[i]);i++)ot._data(r,"globalEval",!t||ot._data(t[i],"globalEval"))}function I(e,t){if(1===t.nodeType&&ot.hasData(e)){var r,i,n,o=ot._data(e),s=ot._data(t,o),a=o.events;if(a){delete s.handle,s.events={};for(r in a)for(i=0,n=a[r].length;n>i;i++)ot.event.add(t,r,a[r][i])}s.data&&(s.data=ot.extend({},s.data))}}function y(e,t){var r,i,n;if(1===t.nodeType){if(r=t.nodeName.toLowerCase(),!it.noCloneEvent&&t[ot.expando]){n=ot._data(t);for(i in n.events)ot.removeEvent(t,i,n.handle);t.removeAttribute(ot.expando)}"script"===r&&t.text!==e.text?(N(t).text=e.text,T(t)):"object"===r?(t.parentNode&&(t.outerHTML=e.outerHTML),it.html5Clone&&e.innerHTML&&!ot.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===r&&Pt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===r?t.defaultSelected=t.selected=e.defaultSelected:("input"===r||"textarea"===r)&&(t.defaultValue=e.defaultValue)}}function A(e,r){var i,n=ot(r.createElement(e)).appendTo(r.body),o=t.getDefaultComputedStyle&&(i=t.getDefaultComputedStyle(n[0]))?i.display:ot.css(n[0],"display");return n.detach(),o}function S(e){var t=ft,r=er[e];return r||(r=A(e,t),"none"!==r&&r||(Jt=(Jt||ot("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=(Jt[0].contentWindow||Jt[0].contentDocument).document,t.write(),t.close(),r=A(e,t),Jt.detach()),er[e]=r),r}function C(e,t){return{get:function(){var r=e();if(null!=r)return r?void delete this.get:(this.get=t).apply(this,arguments)}}}function R(e,t){if(t in e)return t;for(var r=t.charAt(0).toUpperCase()+t.slice(1),i=t,n=hr.length;n--;)if(t=hr[n]+r,t in e)return t;return i}function b(e,t){for(var r,i,n,o=[],s=0,a=e.length;a>s;s++)i=e[s],i.style&&(o[s]=ot._data(i,"olddisplay"),r=i.style.display,t?(o[s]||"none"!==r||(i.style.display=""),""===i.style.display&&bt(i)&&(o[s]=ot._data(i,"olddisplay",S(i.nodeName)))):(n=bt(i),(r&&"none"!==r||!n)&&ot._data(i,"olddisplay",n?r:ot.css(i,"display"))));for(s=0;a>s;s++)i=e[s],i.style&&(t&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=t?o[s]||"":"none"));return e}function O(e,t,r){var i=ur.exec(t);return i?Math.max(0,i[1]-(r||0))+(i[2]||"px"):t}function P(e,t,r,i,n){for(var o=r===(i?"border":"content")?4:"width"===t?1:0,s=0;4>o;o+=2)"margin"===r&&(s+=ot.css(e,r+Rt[o],!0,n)),i?("content"===r&&(s-=ot.css(e,"padding"+Rt[o],!0,n)),"margin"!==r&&(s-=ot.css(e,"border"+Rt[o]+"Width",!0,n))):(s+=ot.css(e,"padding"+Rt[o],!0,n),"padding"!==r&&(s+=ot.css(e,"border"+Rt[o]+"Width",!0,n)));return s}function D(e,t,r){var i=!0,n="width"===t?e.offsetWidth:e.offsetHeight,o=tr(e),s=it.boxSizing&&"border-box"===ot.css(e,"boxSizing",!1,o);if(0>=n||null==n){if(n=rr(e,t,o),(0>n||null==n)&&(n=e.style[t]),nr.test(n))return n;i=s&&(it.boxSizingReliable()||n===e.style[t]),n=parseFloat(n)||0}return n+P(e,t,r||(s?"border":"content"),i,o)+"px"}function _(e,t,r,i,n){return new _.prototype.init(e,t,r,i,n)}function M(){return setTimeout(function(){Er=void 0}),Er=ot.now()}function w(e,t){var r,i={height:e},n=0;for(t=t?1:0;4>n;n+=2-t)r=Rt[n],i["margin"+r]=i["padding"+r]=e;return t&&(i.opacity=i.width=e),i}function G(e,t,r){for(var i,n=(Nr[t]||[]).concat(Nr["*"]),o=0,s=n.length;s>o;o++)if(i=n[o].call(r,t,e))return i}function k(e,t,r){var i,n,o,s,a,l,u,p,c=this,d={},h=e.style,E=e.nodeType&&bt(e),f=ot._data(e,"fxshow");r.queue||(a=ot._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,l=a.empty.fire,a.empty.fire=function(){a.unqueued||l()}),a.unqueued++,c.always(function(){c.always(function(){a.unqueued--,ot.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(r.overflow=[h.overflow,h.overflowX,h.overflowY],u=ot.css(e,"display"),p="none"===u?ot._data(e,"olddisplay")||S(e.nodeName):u,"inline"===p&&"none"===ot.css(e,"float")&&(it.inlineBlockNeedsLayout&&"inline"!==S(e.nodeName)?h.zoom=1:h.display="inline-block")),r.overflow&&(h.overflow="hidden",it.shrinkWrapBlocks()||c.always(function(){h.overflow=r.overflow[0],h.overflowX=r.overflow[1],h.overflowY=r.overflow[2]}));for(i in t)if(n=t[i],mr.exec(n)){if(delete t[i],o=o||"toggle"===n,n===(E?"hide":"show")){if("show"!==n||!f||void 0===f[i])continue;E=!0}d[i]=f&&f[i]||ot.style(e,i)}else u=void 0;if(ot.isEmptyObject(d))"inline"===("none"===u?S(e.nodeName):u)&&(h.display=u);else{f?"hidden"in f&&(E=f.hidden):f=ot._data(e,"fxshow",{}),o&&(f.hidden=!E),E?ot(e).show():c.done(function(){ot(e).hide()}),c.done(function(){var t;ot._removeData(e,"fxshow");for(t in d)ot.style(e,t,d[t])});for(i in d)s=G(E?f[i]:0,i,c),i in f||(f[i]=s.start,E&&(s.end=s.start,s.start="width"===i||"height"===i?1:0))}}function B(e,t){var r,i,n,o,s;for(r in e)if(i=ot.camelCase(r),n=t[i],o=e[r],ot.isArray(o)&&(n=o[1],o=e[r]=o[0]),r!==i&&(e[i]=o,delete e[r]),s=ot.cssHooks[i],s&&"expand"in s){o=s.expand(o),delete e[i];for(r in o)r in e||(e[r]=o[r],t[r]=n)}else t[i]=n}function U(e,t,r){var i,n,o=0,s=xr.length,a=ot.Deferred().always(function(){delete l.elem}),l=function(){if(n)return!1;for(var t=Er||M(),r=Math.max(0,u.startTime+u.duration-t),i=r/u.duration||0,o=1-i,s=0,l=u.tweens.length;l>s;s++)u.tweens[s].run(o);return a.notifyWith(e,[u,o,r]),1>o&&l?r:(a.resolveWith(e,[u]),!1)},u=a.promise({elem:e,props:ot.extend({},t),opts:ot.extend(!0,{specialEasing:{}},r),originalProperties:t,originalOptions:r,startTime:Er||M(),duration:r.duration,tweens:[],createTween:function(t,r){var i=ot.Tween(e,u.opts,t,r,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(i),i},stop:function(t){var r=0,i=t?u.tweens.length:0;if(n)return this;for(n=!0;i>r;r++)u.tweens[r].run(1);
return t?a.resolveWith(e,[u,t]):a.rejectWith(e,[u,t]),this}}),p=u.props;for(B(p,u.opts.specialEasing);s>o;o++)if(i=xr[o].call(u,e,p,u.opts))return i;return ot.map(p,G,u),ot.isFunction(u.opts.start)&&u.opts.start.call(e,u),ot.fx.timer(ot.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function V(e){return function(t,r){"string"!=typeof t&&(r=t,t="*");var i,n=0,o=t.toLowerCase().match(Nt)||[];if(ot.isFunction(r))for(;i=o[n++];)"+"===i.charAt(0)?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(r)):(e[i]=e[i]||[]).push(r)}}function H(e,t,r,i){function n(a){var l;return o[a]=!0,ot.each(e[a]||[],function(e,a){var u=a(t,r,i);return"string"!=typeof u||s||o[u]?s?!(l=u):void 0:(t.dataTypes.unshift(u),n(u),!1)}),l}var o={},s=e===Wr;return n(t.dataTypes[0])||!o["*"]&&n("*")}function F(e,t){var r,i,n=ot.ajaxSettings.flatOptions||{};for(i in t)void 0!==t[i]&&((n[i]?e:r||(r={}))[i]=t[i]);return r&&ot.extend(!0,e,r),e}function j(e,t,r){for(var i,n,o,s,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(s in a)if(a[s]&&a[s].test(n)){l.unshift(s);break}if(l[0]in r)o=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){o=s;break}i||(i=s)}o=o||i}return o?(o!==l[0]&&l.unshift(o),r[o]):void 0}function W(e,t,r,i){var n,o,s,a,l,u={},p=e.dataTypes.slice();if(p[1])for(s in e.converters)u[s.toLowerCase()]=e.converters[s];for(o=p.shift();o;)if(e.responseFields[o]&&(r[e.responseFields[o]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=p.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(s=u[l+" "+o]||u["* "+o],!s)for(n in u)if(a=n.split(" "),a[1]===o&&(s=u[l+" "+a[0]]||u["* "+a[0]])){s===!0?s=u[n]:u[n]!==!0&&(o=a[0],p.unshift(a[1]));break}if(s!==!0)if(s&&e["throws"])t=s(t);else try{t=s(t)}catch(c){return{state:"parsererror",error:s?c:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}function q(e,t,r,i){var n;if(ot.isArray(t))ot.each(t,function(t,n){r||Yr.test(e)?i(e,n):q(e+"["+("object"==typeof n?t:"")+"]",n,r,i)});else if(r||"object"!==ot.type(t))i(e,t);else for(n in t)q(e+"["+n+"]",t[n],r,i)}function z(){try{return new t.XMLHttpRequest}catch(e){}}function X(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function Y(e){return ot.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var K=[],$=K.slice,Q=K.concat,Z=K.push,J=K.indexOf,et={},tt=et.toString,rt=et.hasOwnProperty,it={},nt="1.11.1",ot=function(e,t){return new ot.fn.init(e,t)},st=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,at=/^-ms-/,lt=/-([\da-z])/gi,ut=function(e,t){return t.toUpperCase()};ot.fn=ot.prototype={jquery:nt,constructor:ot,selector:"",length:0,toArray:function(){return $.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:$.call(this)},pushStack:function(e){var t=ot.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return ot.each(this,e,t)},map:function(e){return this.pushStack(ot.map(this,function(t,r){return e.call(t,r,t)}))},slice:function(){return this.pushStack($.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,r=+e+(0>e?t:0);return this.pushStack(r>=0&&t>r?[this[r]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:Z,sort:K.sort,splice:K.splice},ot.extend=ot.fn.extend=function(){var e,t,r,i,n,o,s=arguments[0]||{},a=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[a]||{},a++),"object"==typeof s||ot.isFunction(s)||(s={}),a===l&&(s=this,a--);l>a;a++)if(null!=(n=arguments[a]))for(i in n)e=s[i],r=n[i],s!==r&&(u&&r&&(ot.isPlainObject(r)||(t=ot.isArray(r)))?(t?(t=!1,o=e&&ot.isArray(e)?e:[]):o=e&&ot.isPlainObject(e)?e:{},s[i]=ot.extend(u,o,r)):void 0!==r&&(s[i]=r));return s},ot.extend({expando:"jQuery"+(nt+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===ot.type(e)},isArray:Array.isArray||function(e){return"array"===ot.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!ot.isArray(e)&&e-parseFloat(e)>=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==ot.type(e)||e.nodeType||ot.isWindow(e))return!1;try{if(e.constructor&&!rt.call(e,"constructor")&&!rt.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(it.ownLast)for(t in e)return rt.call(e,t);for(t in e);return void 0===t||rt.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?et[tt.call(e)]||"object":typeof e},globalEval:function(e){e&&ot.trim(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(e){return e.replace(at,"ms-").replace(lt,ut)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,r){var n,o=0,s=e.length,a=i(e);if(r){if(a)for(;s>o&&(n=t.apply(e[o],r),n!==!1);o++);else for(o in e)if(n=t.apply(e[o],r),n===!1)break}else if(a)for(;s>o&&(n=t.call(e[o],o,e[o]),n!==!1);o++);else for(o in e)if(n=t.call(e[o],o,e[o]),n===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(st,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(i(Object(e))?ot.merge(r,"string"==typeof e?[e]:e):Z.call(r,e)),r},inArray:function(e,t,r){var i;if(t){if(J)return J.call(t,e,r);for(i=t.length,r=r?0>r?Math.max(0,i+r):r:0;i>r;r++)if(r in t&&t[r]===e)return r}return-1},merge:function(e,t){for(var r=+t.length,i=0,n=e.length;r>i;)e[n++]=t[i++];if(r!==r)for(;void 0!==t[i];)e[n++]=t[i++];return e.length=n,e},grep:function(e,t,r){for(var i,n=[],o=0,s=e.length,a=!r;s>o;o++)i=!t(e[o],o),i!==a&&n.push(e[o]);return n},map:function(e,t,r){var n,o=0,s=e.length,a=i(e),l=[];if(a)for(;s>o;o++)n=t(e[o],o,r),null!=n&&l.push(n);else for(o in e)n=t(e[o],o,r),null!=n&&l.push(n);return Q.apply([],l)},guid:1,proxy:function(e,t){var r,i,n;return"string"==typeof t&&(n=e[t],t=e,e=n),ot.isFunction(e)?(r=$.call(arguments,2),i=function(){return e.apply(t||this,r.concat($.call(arguments)))},i.guid=e.guid=e.guid||ot.guid++,i):void 0},now:function(){return+new Date},support:it}),ot.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){et["[object "+t+"]"]=t.toLowerCase()});var pt=function(e){function t(e,t,r,i){var n,o,s,a,l,u,c,h,E,f;if((t?t.ownerDocument||t:V)!==D&&P(t),t=t||D,r=r||[],!e||"string"!=typeof e)return r;if(1!==(a=t.nodeType)&&9!==a)return[];if(M&&!i){if(n=vt.exec(e))if(s=n[1]){if(9===a){if(o=t.getElementById(s),!o||!o.parentNode)return r;if(o.id===s)return r.push(o),r}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&B(t,o)&&o.id===s)return r.push(o),r}else{if(n[2])return J.apply(r,t.getElementsByTagName(e)),r;if((s=n[3])&&T.getElementsByClassName&&t.getElementsByClassName)return J.apply(r,t.getElementsByClassName(s)),r}if(T.qsa&&(!w||!w.test(e))){if(h=c=U,E=t,f=9===a&&e,1===a&&"object"!==t.nodeName.toLowerCase()){for(u=A(e),(c=t.getAttribute("id"))?h=c.replace(Nt,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=u.length;l--;)u[l]=h+d(u[l]);E=xt.test(e)&&p(t.parentNode)||t,f=u.join(",")}if(f)try{return J.apply(r,E.querySelectorAll(f)),r}catch(m){}finally{c||t.removeAttribute("id")}}}return C(e.replace(lt,"$1"),t,r,i)}function r(){function e(r,i){return t.push(r+" ")>L.cacheLength&&delete e[t.shift()],e[r+" "]=i}var t=[];return e}function i(e){return e[U]=!0,e}function n(e){var t=D.createElement("div");try{return!!e(t)}catch(r){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var r=e.split("|"),i=e.length;i--;)L.attrHandle[r[i]]=t}function s(e,t){var r=t&&e,i=r&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||Y)-(~e.sourceIndex||Y);if(i)return i;if(r)for(;r=r.nextSibling;)if(r===t)return-1;return e?1:-1}function a(e){return function(t){var r=t.nodeName.toLowerCase();return"input"===r&&t.type===e}}function l(e){return function(t){var r=t.nodeName.toLowerCase();return("input"===r||"button"===r)&&t.type===e}}function u(e){return i(function(t){return t=+t,i(function(r,i){for(var n,o=e([],r.length,t),s=o.length;s--;)r[n=o[s]]&&(r[n]=!(i[n]=r[n]))})})}function p(e){return e&&typeof e.getElementsByTagName!==X&&e}function c(){}function d(e){for(var t=0,r=e.length,i="";r>t;t++)i+=e[t].value;return i}function h(e,t,r){var i=t.dir,n=r&&"parentNode"===i,o=F++;return t.first?function(t,r,o){for(;t=t[i];)if(1===t.nodeType||n)return e(t,r,o)}:function(t,r,s){var a,l,u=[H,o];if(s){for(;t=t[i];)if((1===t.nodeType||n)&&e(t,r,s))return!0}else for(;t=t[i];)if(1===t.nodeType||n){if(l=t[U]||(t[U]={}),(a=l[i])&&a[0]===H&&a[1]===o)return u[2]=a[2];if(l[i]=u,u[2]=e(t,r,s))return!0}}}function E(e){return e.length>1?function(t,r,i){for(var n=e.length;n--;)if(!e[n](t,r,i))return!1;return!0}:e[0]}function f(e,r,i){for(var n=0,o=r.length;o>n;n++)t(e,r[n],i);return i}function m(e,t,r,i,n){for(var o,s=[],a=0,l=e.length,u=null!=t;l>a;a++)(o=e[a])&&(!r||r(o,i,n))&&(s.push(o),u&&t.push(a));return s}function g(e,t,r,n,o,s){return n&&!n[U]&&(n=g(n)),o&&!o[U]&&(o=g(o,s)),i(function(i,s,a,l){var u,p,c,d=[],h=[],E=s.length,g=i||f(t||"*",a.nodeType?[a]:a,[]),v=!e||!i&&t?g:m(g,d,e,a,l),x=r?o||(i?e:E||n)?[]:s:v;if(r&&r(v,x,a,l),n)for(u=m(x,h),n(u,[],a,l),p=u.length;p--;)(c=u[p])&&(x[h[p]]=!(v[h[p]]=c));if(i){if(o||e){if(o){for(u=[],p=x.length;p--;)(c=x[p])&&u.push(v[p]=c);o(null,x=[],u,l)}for(p=x.length;p--;)(c=x[p])&&(u=o?tt.call(i,c):d[p])>-1&&(i[u]=!(s[u]=c))}}else x=m(x===s?x.splice(E,x.length):x),o?o(null,s,x,l):J.apply(s,x)})}function v(e){for(var t,r,i,n=e.length,o=L.relative[e[0].type],s=o||L.relative[" "],a=o?1:0,l=h(function(e){return e===t},s,!0),u=h(function(e){return tt.call(t,e)>-1},s,!0),p=[function(e,r,i){return!o&&(i||r!==R)||((t=r).nodeType?l(e,r,i):u(e,r,i))}];n>a;a++)if(r=L.relative[e[a].type])p=[h(E(p),r)];else{if(r=L.filter[e[a].type].apply(null,e[a].matches),r[U]){for(i=++a;n>i&&!L.relative[e[i].type];i++);return g(a>1&&E(p),a>1&&d(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(lt,"$1"),r,i>a&&v(e.slice(a,i)),n>i&&v(e=e.slice(i)),n>i&&d(e))}p.push(r)}return E(p)}function x(e,r){var n=r.length>0,o=e.length>0,s=function(i,s,a,l,u){var p,c,d,h=0,E="0",f=i&&[],g=[],v=R,x=i||o&&L.find.TAG("*",u),N=H+=null==v?1:Math.random()||.1,T=x.length;for(u&&(R=s!==D&&s);E!==T&&null!=(p=x[E]);E++){if(o&&p){for(c=0;d=e[c++];)if(d(p,s,a)){l.push(p);break}u&&(H=N)}n&&((p=!d&&p)&&h--,i&&f.push(p))}if(h+=E,n&&E!==h){for(c=0;d=r[c++];)d(f,g,s,a);if(i){if(h>0)for(;E--;)f[E]||g[E]||(g[E]=Q.call(l));g=m(g)}J.apply(l,g),u&&!i&&g.length>0&&h+r.length>1&&t.uniqueSort(l)}return u&&(H=N,R=v),f};return n?i(s):s}var N,T,L,I,y,A,S,C,R,b,O,P,D,_,M,w,G,k,B,U="sizzle"+-new Date,V=e.document,H=0,F=0,j=r(),W=r(),q=r(),z=function(e,t){return e===t&&(O=!0),0},X="undefined",Y=1<<31,K={}.hasOwnProperty,$=[],Q=$.pop,Z=$.push,J=$.push,et=$.slice,tt=$.indexOf||function(e){for(var t=0,r=this.length;r>t;t++)if(this[t]===e)return t;return-1},rt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",it="[\\x20\\t\\r\\n\\f]",nt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ot=nt.replace("w","w#"),st="\\["+it+"*("+nt+")(?:"+it+"*([*^$|!~]?=)"+it+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ot+"))|)"+it+"*\\]",at=":("+nt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+st+")*)|.*)\\)|)",lt=new RegExp("^"+it+"+|((?:^|[^\\\\])(?:\\\\.)*)"+it+"+$","g"),ut=new RegExp("^"+it+"*,"+it+"*"),pt=new RegExp("^"+it+"*([>+~]|"+it+")"+it+"*"),ct=new RegExp("="+it+"*([^\\]'\"]*?)"+it+"*\\]","g"),dt=new RegExp(at),ht=new RegExp("^"+ot+"$"),Et={ID:new RegExp("^#("+nt+")"),CLASS:new RegExp("^\\.("+nt+")"),TAG:new RegExp("^("+nt.replace("w","w*")+")"),ATTR:new RegExp("^"+st),PSEUDO:new RegExp("^"+at),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+it+"*(even|odd|(([+-]|)(\\d*)n|)"+it+"*(?:([+-]|)"+it+"*(\\d+)|))"+it+"*\\)|)","i"),bool:new RegExp("^(?:"+rt+")$","i"),needsContext:new RegExp("^"+it+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+it+"*((?:-\\d)?\\d*)"+it+"*\\)|)(?=[^-]|$)","i")},ft=/^(?:input|select|textarea|button)$/i,mt=/^h\d$/i,gt=/^[^{]+\{\s*\[native \w/,vt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xt=/[+~]/,Nt=/'|\\/g,Tt=new RegExp("\\\\([\\da-f]{1,6}"+it+"?|("+it+")|.)","ig"),Lt=function(e,t,r){var i="0x"+t-65536;return i!==i||r?t:0>i?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)};try{J.apply($=et.call(V.childNodes),V.childNodes),$[V.childNodes.length].nodeType}catch(It){J={apply:$.length?function(e,t){Z.apply(e,et.call(t))}:function(e,t){for(var r=e.length,i=0;e[r++]=t[i++];);e.length=r-1}}}T=t.support={},y=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},P=t.setDocument=function(e){var t,r=e?e.ownerDocument||e:V,i=r.defaultView;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,_=r.documentElement,M=!y(r),i&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",function(){P()},!1):i.attachEvent&&i.attachEvent("onunload",function(){P()})),T.attributes=n(function(e){return e.className="i",!e.getAttribute("className")}),T.getElementsByTagName=n(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),T.getElementsByClassName=gt.test(r.getElementsByClassName)&&n(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),T.getById=n(function(e){return _.appendChild(e).id=U,!r.getElementsByName||!r.getElementsByName(U).length}),T.getById?(L.find.ID=function(e,t){if(typeof t.getElementById!==X&&M){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}},L.filter.ID=function(e){var t=e.replace(Tt,Lt);return function(e){return e.getAttribute("id")===t}}):(delete L.find.ID,L.filter.ID=function(e){var t=e.replace(Tt,Lt);return function(e){var r=typeof e.getAttributeNode!==X&&e.getAttributeNode("id");return r&&r.value===t}}),L.find.TAG=T.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==X?t.getElementsByTagName(e):void 0}:function(e,t){var r,i=[],n=0,o=t.getElementsByTagName(e);if("*"===e){for(;r=o[n++];)1===r.nodeType&&i.push(r);return i}return o},L.find.CLASS=T.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==X&&M?t.getElementsByClassName(e):void 0},G=[],w=[],(T.qsa=gt.test(r.querySelectorAll))&&(n(function(e){e.innerHTML="<select msallowclip=''><option selected=''></option></select>",e.querySelectorAll("[msallowclip^='']").length&&w.push("[*^$]="+it+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||w.push("\\["+it+"*(?:value|"+rt+")"),e.querySelectorAll(":checked").length||w.push(":checked")}),n(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&w.push("name"+it+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||w.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),w.push(",.*:")})),(T.matchesSelector=gt.test(k=_.matches||_.webkitMatchesSelector||_.mozMatchesSelector||_.oMatchesSelector||_.msMatchesSelector))&&n(function(e){T.disconnectedMatch=k.call(e,"div"),k.call(e,"[s!='']:x"),G.push("!=",at)}),w=w.length&&new RegExp(w.join("|")),G=G.length&&new RegExp(G.join("|")),t=gt.test(_.compareDocumentPosition),B=t||gt.test(_.contains)?function(e,t){var r=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(r.contains?r.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},z=t?function(e,t){if(e===t)return O=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i?i:(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&i||!T.sortDetached&&t.compareDocumentPosition(e)===i?e===r||e.ownerDocument===V&&B(V,e)?-1:t===r||t.ownerDocument===V&&B(V,t)?1:b?tt.call(b,e)-tt.call(b,t):0:4&i?-1:1)}:function(e,t){if(e===t)return O=!0,0;var i,n=0,o=e.parentNode,a=t.parentNode,l=[e],u=[t];if(!o||!a)return e===r?-1:t===r?1:o?-1:a?1:b?tt.call(b,e)-tt.call(b,t):0;if(o===a)return s(e,t);for(i=e;i=i.parentNode;)l.unshift(i);for(i=t;i=i.parentNode;)u.unshift(i);for(;l[n]===u[n];)n++;return n?s(l[n],u[n]):l[n]===V?-1:u[n]===V?1:0},r):D},t.matches=function(e,r){return t(e,null,null,r)},t.matchesSelector=function(e,r){if((e.ownerDocument||e)!==D&&P(e),r=r.replace(ct,"='$1']"),!(!T.matchesSelector||!M||G&&G.test(r)||w&&w.test(r)))try{var i=k.call(e,r);if(i||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(n){}return t(r,D,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==D&&P(e),B(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==D&&P(e);var r=L.attrHandle[t.toLowerCase()],i=r&&K.call(L.attrHandle,t.toLowerCase())?r(e,t,!M):void 0;return void 0!==i?i:T.attributes||!M?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,r=[],i=0,n=0;if(O=!T.detectDuplicates,b=!T.sortStable&&e.slice(0),e.sort(z),O){for(;t=e[n++];)t===e[n]&&(i=r.push(n));for(;i--;)e.splice(r[i],1)}return b=null,e},I=t.getText=function(e){var t,r="",i=0,n=e.nodeType;if(n){if(1===n||9===n||11===n){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)r+=I(e)}else if(3===n||4===n)return e.nodeValue}else for(;t=e[i++];)r+=I(t);return r},L=t.selectors={cacheLength:50,createPseudo:i,match:Et,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Tt,Lt),e[3]=(e[3]||e[4]||e[5]||"").replace(Tt,Lt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,r=!e[6]&&e[2];return Et.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":r&&dt.test(r)&&(t=A(r,!0))&&(t=r.indexOf(")",r.length-t)-r.length)&&(e[0]=e[0].slice(0,t),e[2]=r.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Tt,Lt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=j[e+" "];return t||(t=new RegExp("(^|"+it+")"+e+"("+it+"|$)"))&&j(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==X&&e.getAttribute("class")||"")})},ATTR:function(e,r,i){return function(n){var o=t.attr(n,e);return null==o?"!="===r:r?(o+="","="===r?o===i:"!="===r?o!==i:"^="===r?i&&0===o.indexOf(i):"*="===r?i&&o.indexOf(i)>-1:"$="===r?i&&o.slice(-i.length)===i:"~="===r?(" "+o+" ").indexOf(i)>-1:"|="===r?o===i||o.slice(0,i.length+1)===i+"-":!1):!0}},CHILD:function(e,t,r,i,n){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===n?function(e){return!!e.parentNode}:function(t,r,l){var u,p,c,d,h,E,f=o!==s?"nextSibling":"previousSibling",m=t.parentNode,g=a&&t.nodeName.toLowerCase(),v=!l&&!a;if(m){if(o){for(;f;){for(c=t;c=c[f];)if(a?c.nodeName.toLowerCase()===g:1===c.nodeType)return!1;E=f="only"===e&&!E&&"nextSibling"}return!0}if(E=[s?m.firstChild:m.lastChild],s&&v){for(p=m[U]||(m[U]={}),u=p[e]||[],h=u[0]===H&&u[1],d=u[0]===H&&u[2],c=h&&m.childNodes[h];c=++h&&c&&c[f]||(d=h=0)||E.pop();)if(1===c.nodeType&&++d&&c===t){p[e]=[H,h,d];break}}else if(v&&(u=(t[U]||(t[U]={}))[e])&&u[0]===H)d=u[1];else for(;(c=++h&&c&&c[f]||(d=h=0)||E.pop())&&((a?c.nodeName.toLowerCase()!==g:1!==c.nodeType)||!++d||(v&&((c[U]||(c[U]={}))[e]=[H,d]),c!==t)););return d-=n,d===i||d%i===0&&d/i>=0}}},PSEUDO:function(e,r){var n,o=L.pseudos[e]||L.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[U]?o(r):o.length>1?(n=[e,e,"",r],L.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,t){for(var i,n=o(e,r),s=n.length;s--;)i=tt.call(e,n[s]),e[i]=!(t[i]=n[s])}):function(e){return o(e,0,n)}):o}},pseudos:{not:i(function(e){var t=[],r=[],n=S(e.replace(lt,"$1"));return n[U]?i(function(e,t,r,i){for(var o,s=n(e,null,i,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,n(t,null,o,r),!r.pop()}}),has:i(function(e){return function(r){return t(e,r).length>0}}),contains:i(function(e){return function(t){return(t.textContent||t.innerText||I(t)).indexOf(e)>-1}}),lang:i(function(e){return ht.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(Tt,Lt).toLowerCase(),function(t){var r;do if(r=M?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return r=r.toLowerCase(),r===e||0===r.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var r=e.location&&e.location.hash;return r&&r.slice(1)===t.id},root:function(e){return e===_},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!L.pseudos.empty(e)},header:function(e){return mt.test(e.nodeName)},input:function(e){return ft.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,r){return[0>r?r+t:r]}),even:u(function(e,t){for(var r=0;t>r;r+=2)e.push(r);return e}),odd:u(function(e,t){for(var r=1;t>r;r+=2)e.push(r);return e}),lt:u(function(e,t,r){for(var i=0>r?r+t:r;--i>=0;)e.push(i);return e}),gt:u(function(e,t,r){for(var i=0>r?r+t:r;++i<t;)e.push(i);return e})}},L.pseudos.nth=L.pseudos.eq;for(N in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})L.pseudos[N]=a(N);for(N in{submit:!0,reset:!0})L.pseudos[N]=l(N);return c.prototype=L.filters=L.pseudos,L.setFilters=new c,A=t.tokenize=function(e,r){var i,n,o,s,a,l,u,p=W[e+" "];if(p)return r?0:p.slice(0);for(a=e,l=[],u=L.preFilter;a;){(!i||(n=ut.exec(a)))&&(n&&(a=a.slice(n[0].length)||a),l.push(o=[])),i=!1,(n=pt.exec(a))&&(i=n.shift(),o.push({value:i,type:n[0].replace(lt," ")}),a=a.slice(i.length));for(s in L.filter)!(n=Et[s].exec(a))||u[s]&&!(n=u[s](n))||(i=n.shift(),o.push({value:i,type:s,matches:n}),a=a.slice(i.length));if(!i)break}return r?a.length:a?t.error(e):W(e,l).slice(0)},S=t.compile=function(e,t){var r,i=[],n=[],o=q[e+" "];if(!o){for(t||(t=A(e)),r=t.length;r--;)o=v(t[r]),o[U]?i.push(o):n.push(o);o=q(e,x(n,i)),o.selector=e}return o},C=t.select=function(e,t,r,i){var n,o,s,a,l,u="function"==typeof e&&e,c=!i&&A(e=u.selector||e);if(r=r||[],1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(s=o[0]).type&&T.getById&&9===t.nodeType&&M&&L.relative[o[1].type]){if(t=(L.find.ID(s.matches[0].replace(Tt,Lt),t)||[])[0],!t)return r;u&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(n=Et.needsContext.test(e)?0:o.length;n--&&(s=o[n],!L.relative[a=s.type]);)if((l=L.find[a])&&(i=l(s.matches[0].replace(Tt,Lt),xt.test(o[0].type)&&p(t.parentNode)||t))){if(o.splice(n,1),e=i.length&&d(o),!e)return J.apply(r,i),r;break}}return(u||S(e,c))(i,t,!M,r,xt.test(e)&&p(t.parentNode)||t),r},T.sortStable=U.split("").sort(z).join("")===U,T.detectDuplicates=!!O,P(),T.sortDetached=n(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),n(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,r){return r?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),T.attributes&&n(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,r){return r||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),n(function(e){return null==e.getAttribute("disabled")})||o(rt,function(e,t,r){var i;return r?void 0:e[t]===!0?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null}),t}(t);ot.find=pt,ot.expr=pt.selectors,ot.expr[":"]=ot.expr.pseudos,ot.unique=pt.uniqueSort,ot.text=pt.getText,ot.isXMLDoc=pt.isXML,ot.contains=pt.contains;var ct=ot.expr.match.needsContext,dt=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ht=/^.[^:#\[\.,]*$/;ot.filter=function(e,t,r){var i=t[0];return r&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?ot.find.matchesSelector(i,e)?[i]:[]:ot.find.matches(e,ot.grep(t,function(e){return 1===e.nodeType}))},ot.fn.extend({find:function(e){var t,r=[],i=this,n=i.length;if("string"!=typeof e)return this.pushStack(ot(e).filter(function(){for(t=0;n>t;t++)if(ot.contains(i[t],this))return!0}));for(t=0;n>t;t++)ot.find(e,i[t],r);return r=this.pushStack(n>1?ot.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(n(this,e||[],!1))},not:function(e){return this.pushStack(n(this,e||[],!0))},is:function(e){return!!n(this,"string"==typeof e&&ct.test(e)?ot(e):e||[],!1).length}});var Et,ft=t.document,mt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,gt=ot.fn.init=function(e,t){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:mt.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||Et).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ot?t[0]:t,ot.merge(this,ot.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:ft,!0)),dt.test(r[1])&&ot.isPlainObject(t))for(r in t)ot.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(i=ft.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return Et.find(e);this.length=1,this[0]=i}return this.context=ft,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):ot.isFunction(e)?"undefined"!=typeof Et.ready?Et.ready(e):e(ot):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),ot.makeArray(e,this))};gt.prototype=ot.fn,Et=ot(ft);var vt=/^(?:parents|prev(?:Until|All))/,xt={children:!0,contents:!0,next:!0,prev:!0};ot.extend({dir:function(e,t,r){for(var i=[],n=e[t];n&&9!==n.nodeType&&(void 0===r||1!==n.nodeType||!ot(n).is(r));)1===n.nodeType&&i.push(n),n=n[t];return i},sibling:function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r}}),ot.fn.extend({has:function(e){var t,r=ot(e,this),i=r.length;return this.filter(function(){for(t=0;i>t;t++)if(ot.contains(this,r[t]))return!0})},closest:function(e,t){for(var r,i=0,n=this.length,o=[],s=ct.test(e)||"string"!=typeof e?ot(e,t||this.context):0;n>i;i++)for(r=this[i];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(s?s.index(r)>-1:1===r.nodeType&&ot.find.matchesSelector(r,e))){o.push(r);break}return this.pushStack(o.length>1?ot.unique(o):o)},index:function(e){return e?"string"==typeof e?ot.inArray(this[0],ot(e)):ot.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ot.unique(ot.merge(this.get(),ot(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ot.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ot.dir(e,"parentNode")},parentsUntil:function(e,t,r){return ot.dir(e,"parentNode",r)},next:function(e){return o(e,"nextSibling")},prev:function(e){return o(e,"previousSibling")},nextAll:function(e){return ot.dir(e,"nextSibling")},prevAll:function(e){return ot.dir(e,"previousSibling")},nextUntil:function(e,t,r){return ot.dir(e,"nextSibling",r)},prevUntil:function(e,t,r){return ot.dir(e,"previousSibling",r)},siblings:function(e){return ot.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return ot.sibling(e.firstChild)},contents:function(e){return ot.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:ot.merge([],e.childNodes)}},function(e,t){ot.fn[e]=function(r,i){var n=ot.map(this,t,r);return"Until"!==e.slice(-5)&&(i=r),i&&"string"==typeof i&&(n=ot.filter(i,n)),this.length>1&&(xt[e]||(n=ot.unique(n)),vt.test(e)&&(n=n.reverse())),this.pushStack(n)}});var Nt=/\S+/g,Tt={};ot.Callbacks=function(e){e="string"==typeof e?Tt[e]||s(e):ot.extend({},e);var t,r,i,n,o,a,l=[],u=!e.once&&[],p=function(s){for(r=e.memory&&s,i=!0,o=a||0,a=0,n=l.length,t=!0;l&&n>o;o++)if(l[o].apply(s[0],s[1])===!1&&e.stopOnFalse){r=!1;break}t=!1,l&&(u?u.length&&p(u.shift()):r?l=[]:c.disable())},c={add:function(){if(l){var i=l.length;!function o(t){ot.each(t,function(t,r){var i=ot.type(r);"function"===i?e.unique&&c.has(r)||l.push(r):r&&r.length&&"string"!==i&&o(r)})}(arguments),t?n=l.length:r&&(a=i,p(r))}return this},remove:function(){return l&&ot.each(arguments,function(e,r){for(var i;(i=ot.inArray(r,l,i))>-1;)l.splice(i,1),t&&(n>=i&&n--,o>=i&&o--)}),this},has:function(e){return e?ot.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],n=0,this},disable:function(){return l=u=r=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,r||c.disable(),this},locked:function(){return!u},fireWith:function(e,r){return!l||i&&!u||(r=r||[],r=[e,r.slice?r.slice():r],t?u.push(r):p(r)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},ot.extend({Deferred:function(e){var t=[["resolve","done",ot.Callbacks("once memory"),"resolved"],["reject","fail",ot.Callbacks("once memory"),"rejected"],["notify","progress",ot.Callbacks("memory")]],r="pending",i={state:function(){return r},always:function(){return n.done(arguments).fail(arguments),this},then:function(){var e=arguments;return ot.Deferred(function(r){ot.each(t,function(t,o){var s=ot.isFunction(e[t])&&e[t];n[o[1]](function(){var e=s&&s.apply(this,arguments);e&&ot.isFunction(e.promise)?e.promise().done(r.resolve).fail(r.reject).progress(r.notify):r[o[0]+"With"](this===i?r.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?ot.extend(e,i):i}},n={};return i.pipe=i.then,ot.each(t,function(e,o){var s=o[2],a=o[3];i[o[1]]=s.add,a&&s.add(function(){r=a},t[1^e][2].disable,t[2][2].lock),n[o[0]]=function(){return n[o[0]+"With"](this===n?i:this,arguments),this},n[o[0]+"With"]=s.fireWith}),i.promise(n),e&&e.call(n,n),n},when:function(e){var t,r,i,n=0,o=$.call(arguments),s=o.length,a=1!==s||e&&ot.isFunction(e.promise)?s:0,l=1===a?e:ot.Deferred(),u=function(e,r,i){return function(n){r[e]=this,i[e]=arguments.length>1?$.call(arguments):n,i===t?l.notifyWith(r,i):--a||l.resolveWith(r,i)}};if(s>1)for(t=new Array(s),r=new Array(s),i=new Array(s);s>n;n++)o[n]&&ot.isFunction(o[n].promise)?o[n].promise().done(u(n,i,o)).fail(l.reject).progress(u(n,r,t)):--a;return a||l.resolveWith(i,o),l.promise()}});var Lt;ot.fn.ready=function(e){return ot.ready.promise().done(e),this},ot.extend({isReady:!1,readyWait:1,holdReady:function(e){e?ot.readyWait++:ot.ready(!0)},ready:function(e){if(e===!0?!--ot.readyWait:!ot.isReady){if(!ft.body)return setTimeout(ot.ready);ot.isReady=!0,e!==!0&&--ot.readyWait>0||(Lt.resolveWith(ft,[ot]),ot.fn.triggerHandler&&(ot(ft).triggerHandler("ready"),ot(ft).off("ready")))}}}),ot.ready.promise=function(e){if(!Lt)if(Lt=ot.Deferred(),"complete"===ft.readyState)setTimeout(ot.ready);else if(ft.addEventListener)ft.addEventListener("DOMContentLoaded",l,!1),t.addEventListener("load",l,!1);else{ft.attachEvent("onreadystatechange",l),t.attachEvent("onload",l);var r=!1;try{r=null==t.frameElement&&ft.documentElement}catch(i){}r&&r.doScroll&&!function n(){if(!ot.isReady){try{r.doScroll("left")
}catch(e){return setTimeout(n,50)}a(),ot.ready()}}()}return Lt.promise(e)};var It,yt="undefined";for(It in ot(it))break;it.ownLast="0"!==It,it.inlineBlockNeedsLayout=!1,ot(function(){var e,t,r,i;r=ft.getElementsByTagName("body")[0],r&&r.style&&(t=ft.createElement("div"),i=ft.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",r.appendChild(i).appendChild(t),typeof t.style.zoom!==yt&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",it.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(r.style.zoom=1)),r.removeChild(i))}),function(){var e=ft.createElement("div");if(null==it.deleteExpando){it.deleteExpando=!0;try{delete e.test}catch(t){it.deleteExpando=!1}}e=null}(),ot.acceptData=function(e){var t=ot.noData[(e.nodeName+" ").toLowerCase()],r=+e.nodeType||1;return 1!==r&&9!==r?!1:!t||t!==!0&&e.getAttribute("classid")===t};var At=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,St=/([A-Z])/g;ot.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?ot.cache[e[ot.expando]]:e[ot.expando],!!e&&!p(e)},data:function(e,t,r){return c(e,t,r)},removeData:function(e,t){return d(e,t)},_data:function(e,t,r){return c(e,t,r,!0)},_removeData:function(e,t){return d(e,t,!0)}}),ot.fn.extend({data:function(e,t){var r,i,n,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(n=ot.data(o),1===o.nodeType&&!ot._data(o,"parsedAttrs"))){for(r=s.length;r--;)s[r]&&(i=s[r].name,0===i.indexOf("data-")&&(i=ot.camelCase(i.slice(5)),u(o,i,n[i])));ot._data(o,"parsedAttrs",!0)}return n}return"object"==typeof e?this.each(function(){ot.data(this,e)}):arguments.length>1?this.each(function(){ot.data(this,e,t)}):o?u(o,e,ot.data(o,e)):void 0},removeData:function(e){return this.each(function(){ot.removeData(this,e)})}}),ot.extend({queue:function(e,t,r){var i;return e?(t=(t||"fx")+"queue",i=ot._data(e,t),r&&(!i||ot.isArray(r)?i=ot._data(e,t,ot.makeArray(r)):i.push(r)),i||[]):void 0},dequeue:function(e,t){t=t||"fx";var r=ot.queue(e,t),i=r.length,n=r.shift(),o=ot._queueHooks(e,t),s=function(){ot.dequeue(e,t)};"inprogress"===n&&(n=r.shift(),i--),n&&("fx"===t&&r.unshift("inprogress"),delete o.stop,n.call(e,s,o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var r=t+"queueHooks";return ot._data(e,r)||ot._data(e,r,{empty:ot.Callbacks("once memory").add(function(){ot._removeData(e,t+"queue"),ot._removeData(e,r)})})}}),ot.fn.extend({queue:function(e,t){var r=2;return"string"!=typeof e&&(t=e,e="fx",r--),arguments.length<r?ot.queue(this[0],e):void 0===t?this:this.each(function(){var r=ot.queue(this,e,t);ot._queueHooks(this,e),"fx"===e&&"inprogress"!==r[0]&&ot.dequeue(this,e)})},dequeue:function(e){return this.each(function(){ot.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var r,i=1,n=ot.Deferred(),o=this,s=this.length,a=function(){--i||n.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)r=ot._data(o[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),n.promise(t)}});var Ct=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Rt=["Top","Right","Bottom","Left"],bt=function(e,t){return e=t||e,"none"===ot.css(e,"display")||!ot.contains(e.ownerDocument,e)},Ot=ot.access=function(e,t,r,i,n,o,s){var a=0,l=e.length,u=null==r;if("object"===ot.type(r)){n=!0;for(a in r)ot.access(e,t,a,r[a],!0,o,s)}else if(void 0!==i&&(n=!0,ot.isFunction(i)||(s=!0),u&&(s?(t.call(e,i),t=null):(u=t,t=function(e,t,r){return u.call(ot(e),r)})),t))for(;l>a;a++)t(e[a],r,s?i:i.call(e[a],a,t(e[a],r)));return n?e:u?t.call(e):l?t(e[0],r):o},Pt=/^(?:checkbox|radio)$/i;!function(){var e=ft.createElement("input"),t=ft.createElement("div"),r=ft.createDocumentFragment();if(t.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",it.leadingWhitespace=3===t.firstChild.nodeType,it.tbody=!t.getElementsByTagName("tbody").length,it.htmlSerialize=!!t.getElementsByTagName("link").length,it.html5Clone="<:nav></:nav>"!==ft.createElement("nav").cloneNode(!0).outerHTML,e.type="checkbox",e.checked=!0,r.appendChild(e),it.appendChecked=e.checked,t.innerHTML="<textarea>x</textarea>",it.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,r.appendChild(t),t.innerHTML="<input type='radio' checked='checked' name='t'/>",it.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,it.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){it.noCloneEvent=!1}),t.cloneNode(!0).click()),null==it.deleteExpando){it.deleteExpando=!0;try{delete t.test}catch(i){it.deleteExpando=!1}}}(),function(){var e,r,i=ft.createElement("div");for(e in{submit:!0,change:!0,focusin:!0})r="on"+e,(it[e+"Bubbles"]=r in t)||(i.setAttribute(r,"t"),it[e+"Bubbles"]=i.attributes[r].expando===!1);i=null}();var Dt=/^(?:input|select|textarea)$/i,_t=/^key/,Mt=/^(?:mouse|pointer|contextmenu)|click/,wt=/^(?:focusinfocus|focusoutblur)$/,Gt=/^([^.]*)(?:\.(.+)|)$/;ot.event={global:{},add:function(e,t,r,i,n){var o,s,a,l,u,p,c,d,h,E,f,m=ot._data(e);if(m){for(r.handler&&(l=r,r=l.handler,n=l.selector),r.guid||(r.guid=ot.guid++),(s=m.events)||(s=m.events={}),(p=m.handle)||(p=m.handle=function(e){return typeof ot===yt||e&&ot.event.triggered===e.type?void 0:ot.event.dispatch.apply(p.elem,arguments)},p.elem=e),t=(t||"").match(Nt)||[""],a=t.length;a--;)o=Gt.exec(t[a])||[],h=f=o[1],E=(o[2]||"").split(".").sort(),h&&(u=ot.event.special[h]||{},h=(n?u.delegateType:u.bindType)||h,u=ot.event.special[h]||{},c=ot.extend({type:h,origType:f,data:i,handler:r,guid:r.guid,selector:n,needsContext:n&&ot.expr.match.needsContext.test(n),namespace:E.join(".")},l),(d=s[h])||(d=s[h]=[],d.delegateCount=0,u.setup&&u.setup.call(e,i,E,p)!==!1||(e.addEventListener?e.addEventListener(h,p,!1):e.attachEvent&&e.attachEvent("on"+h,p))),u.add&&(u.add.call(e,c),c.handler.guid||(c.handler.guid=r.guid)),n?d.splice(d.delegateCount++,0,c):d.push(c),ot.event.global[h]=!0);e=null}},remove:function(e,t,r,i,n){var o,s,a,l,u,p,c,d,h,E,f,m=ot.hasData(e)&&ot._data(e);if(m&&(p=m.events)){for(t=(t||"").match(Nt)||[""],u=t.length;u--;)if(a=Gt.exec(t[u])||[],h=f=a[1],E=(a[2]||"").split(".").sort(),h){for(c=ot.event.special[h]||{},h=(i?c.delegateType:c.bindType)||h,d=p[h]||[],a=a[2]&&new RegExp("(^|\\.)"+E.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=d.length;o--;)s=d[o],!n&&f!==s.origType||r&&r.guid!==s.guid||a&&!a.test(s.namespace)||i&&i!==s.selector&&("**"!==i||!s.selector)||(d.splice(o,1),s.selector&&d.delegateCount--,c.remove&&c.remove.call(e,s));l&&!d.length&&(c.teardown&&c.teardown.call(e,E,m.handle)!==!1||ot.removeEvent(e,h,m.handle),delete p[h])}else for(h in p)ot.event.remove(e,h+t[u],r,i,!0);ot.isEmptyObject(p)&&(delete m.handle,ot._removeData(e,"events"))}},trigger:function(e,r,i,n){var o,s,a,l,u,p,c,d=[i||ft],h=rt.call(e,"type")?e.type:e,E=rt.call(e,"namespace")?e.namespace.split("."):[];if(a=p=i=i||ft,3!==i.nodeType&&8!==i.nodeType&&!wt.test(h+ot.event.triggered)&&(h.indexOf(".")>=0&&(E=h.split("."),h=E.shift(),E.sort()),s=h.indexOf(":")<0&&"on"+h,e=e[ot.expando]?e:new ot.Event(h,"object"==typeof e&&e),e.isTrigger=n?2:3,e.namespace=E.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+E.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),r=null==r?[e]:ot.makeArray(r,[e]),u=ot.event.special[h]||{},n||!u.trigger||u.trigger.apply(i,r)!==!1)){if(!n&&!u.noBubble&&!ot.isWindow(i)){for(l=u.delegateType||h,wt.test(l+h)||(a=a.parentNode);a;a=a.parentNode)d.push(a),p=a;p===(i.ownerDocument||ft)&&d.push(p.defaultView||p.parentWindow||t)}for(c=0;(a=d[c++])&&!e.isPropagationStopped();)e.type=c>1?l:u.bindType||h,o=(ot._data(a,"events")||{})[e.type]&&ot._data(a,"handle"),o&&o.apply(a,r),o=s&&a[s],o&&o.apply&&ot.acceptData(a)&&(e.result=o.apply(a,r),e.result===!1&&e.preventDefault());if(e.type=h,!n&&!e.isDefaultPrevented()&&(!u._default||u._default.apply(d.pop(),r)===!1)&&ot.acceptData(i)&&s&&i[h]&&!ot.isWindow(i)){p=i[s],p&&(i[s]=null),ot.event.triggered=h;try{i[h]()}catch(f){}ot.event.triggered=void 0,p&&(i[s]=p)}return e.result}},dispatch:function(e){e=ot.event.fix(e);var t,r,i,n,o,s=[],a=$.call(arguments),l=(ot._data(this,"events")||{})[e.type]||[],u=ot.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,e)!==!1){for(s=ot.event.handlers.call(this,e,l),t=0;(n=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=n.elem,o=0;(i=n.handlers[o++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((ot.event.special[i.origType]||{}).handle||i.handler).apply(n.elem,a),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var r,i,n,o,s=[],a=t.delegateCount,l=e.target;if(a&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(n=[],o=0;a>o;o++)i=t[o],r=i.selector+" ",void 0===n[r]&&(n[r]=i.needsContext?ot(r,this).index(l)>=0:ot.find(r,this,null,[l]).length),n[r]&&n.push(i);n.length&&s.push({elem:l,handlers:n})}return a<t.length&&s.push({elem:this,handlers:t.slice(a)}),s},fix:function(e){if(e[ot.expando])return e;var t,r,i,n=e.type,o=e,s=this.fixHooks[n];for(s||(this.fixHooks[n]=s=Mt.test(n)?this.mouseHooks:_t.test(n)?this.keyHooks:{}),i=s.props?this.props.concat(s.props):this.props,e=new ot.Event(o),t=i.length;t--;)r=i[t],e[r]=o[r];return e.target||(e.target=o.srcElement||ft),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var r,i,n,o=t.button,s=t.fromElement;return null==e.pageX&&null!=t.clientX&&(i=e.target.ownerDocument||ft,n=i.documentElement,r=i.body,e.pageX=t.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0),e.pageY=t.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?t.toElement:s),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==f()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===f()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return ot.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(e){return ot.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,r,i){var n=ot.extend(new ot.Event,r,{type:e,isSimulated:!0,originalEvent:{}});i?ot.event.trigger(n,null,t):ot.event.dispatch.call(t,n),n.isDefaultPrevented()&&r.preventDefault()}},ot.removeEvent=ft.removeEventListener?function(e,t,r){e.removeEventListener&&e.removeEventListener(t,r,!1)}:function(e,t,r){var i="on"+t;e.detachEvent&&(typeof e[i]===yt&&(e[i]=null),e.detachEvent(i,r))},ot.Event=function(e,t){return this instanceof ot.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?h:E):this.type=e,t&&ot.extend(this,t),this.timeStamp=e&&e.timeStamp||ot.now(),void(this[ot.expando]=!0)):new ot.Event(e,t)},ot.Event.prototype={isDefaultPrevented:E,isPropagationStopped:E,isImmediatePropagationStopped:E,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=h,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=h,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=h,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},ot.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){ot.event.special[e]={delegateType:t,bindType:t,handle:function(e){var r,i=this,n=e.relatedTarget,o=e.handleObj;return(!n||n!==i&&!ot.contains(i,n))&&(e.type=o.origType,r=o.handler.apply(this,arguments),e.type=t),r}}}),it.submitBubbles||(ot.event.special.submit={setup:function(){return ot.nodeName(this,"form")?!1:void ot.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,r=ot.nodeName(t,"input")||ot.nodeName(t,"button")?t.form:void 0;r&&!ot._data(r,"submitBubbles")&&(ot.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),ot._data(r,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&ot.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return ot.nodeName(this,"form")?!1:void ot.event.remove(this,"._submit")}}),it.changeBubbles||(ot.event.special.change={setup:function(){return Dt.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(ot.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),ot.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),ot.event.simulate("change",this,e,!0)})),!1):void ot.event.add(this,"beforeactivate._change",function(e){var t=e.target;Dt.test(t.nodeName)&&!ot._data(t,"changeBubbles")&&(ot.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||ot.event.simulate("change",this.parentNode,e,!0)}),ot._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;return this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type?e.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return ot.event.remove(this,"._change"),!Dt.test(this.nodeName)}}),it.focusinBubbles||ot.each({focus:"focusin",blur:"focusout"},function(e,t){var r=function(e){ot.event.simulate(t,e.target,ot.event.fix(e),!0)};ot.event.special[t]={setup:function(){var i=this.ownerDocument||this,n=ot._data(i,t);n||i.addEventListener(e,r,!0),ot._data(i,t,(n||0)+1)},teardown:function(){var i=this.ownerDocument||this,n=ot._data(i,t)-1;n?ot._data(i,t,n):(i.removeEventListener(e,r,!0),ot._removeData(i,t))}}}),ot.fn.extend({on:function(e,t,r,i,n){var o,s;if("object"==typeof e){"string"!=typeof t&&(r=r||t,t=void 0);for(o in e)this.on(o,t,r,e[o],n);return this}if(null==r&&null==i?(i=t,r=t=void 0):null==i&&("string"==typeof t?(i=r,r=void 0):(i=r,r=t,t=void 0)),i===!1)i=E;else if(!i)return this;return 1===n&&(s=i,i=function(e){return ot().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=ot.guid++)),this.each(function(){ot.event.add(this,e,i,r,t)})},one:function(e,t,r,i){return this.on(e,t,r,i,1)},off:function(e,t,r){var i,n;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,ot(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(n in e)this.off(n,t,e[n]);return this}return(t===!1||"function"==typeof t)&&(r=t,t=void 0),r===!1&&(r=E),this.each(function(){ot.event.remove(this,e,r,t)})},trigger:function(e,t){return this.each(function(){ot.event.trigger(e,t,this)})},triggerHandler:function(e,t){var r=this[0];return r?ot.event.trigger(e,t,r,!0):void 0}});var kt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Bt=/ jQuery\d+="(?:null|\d+)"/g,Ut=new RegExp("<(?:"+kt+")[\\s/>]","i"),Vt=/^\s+/,Ht=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ft=/<([\w:]+)/,jt=/<tbody/i,Wt=/<|&#?\w+;/,qt=/<(?:script|style|link)/i,zt=/checked\s*(?:[^=]|=\s*.checked.)/i,Xt=/^$|\/(?:java|ecma)script/i,Yt=/^true\/(.*)/,Kt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,$t={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:it.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},Qt=m(ft),Zt=Qt.appendChild(ft.createElement("div"));$t.optgroup=$t.option,$t.tbody=$t.tfoot=$t.colgroup=$t.caption=$t.thead,$t.th=$t.td,ot.extend({clone:function(e,t,r){var i,n,o,s,a,l=ot.contains(e.ownerDocument,e);if(it.html5Clone||ot.isXMLDoc(e)||!Ut.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Zt.innerHTML=e.outerHTML,Zt.removeChild(o=Zt.firstChild)),!(it.noCloneEvent&&it.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ot.isXMLDoc(e)))for(i=g(o),a=g(e),s=0;null!=(n=a[s]);++s)i[s]&&y(n,i[s]);if(t)if(r)for(a=a||g(e),i=i||g(o),s=0;null!=(n=a[s]);s++)I(n,i[s]);else I(e,o);return i=g(o,"script"),i.length>0&&L(i,!l&&g(e,"script")),i=a=n=null,o},buildFragment:function(e,t,r,i){for(var n,o,s,a,l,u,p,c=e.length,d=m(t),h=[],E=0;c>E;E++)if(o=e[E],o||0===o)if("object"===ot.type(o))ot.merge(h,o.nodeType?[o]:o);else if(Wt.test(o)){for(a=a||d.appendChild(t.createElement("div")),l=(Ft.exec(o)||["",""])[1].toLowerCase(),p=$t[l]||$t._default,a.innerHTML=p[1]+o.replace(Ht,"<$1></$2>")+p[2],n=p[0];n--;)a=a.lastChild;if(!it.leadingWhitespace&&Vt.test(o)&&h.push(t.createTextNode(Vt.exec(o)[0])),!it.tbody)for(o="table"!==l||jt.test(o)?"<table>"!==p[1]||jt.test(o)?0:a:a.firstChild,n=o&&o.childNodes.length;n--;)ot.nodeName(u=o.childNodes[n],"tbody")&&!u.childNodes.length&&o.removeChild(u);for(ot.merge(h,a.childNodes),a.textContent="";a.firstChild;)a.removeChild(a.firstChild);a=d.lastChild}else h.push(t.createTextNode(o));for(a&&d.removeChild(a),it.appendChecked||ot.grep(g(h,"input"),v),E=0;o=h[E++];)if((!i||-1===ot.inArray(o,i))&&(s=ot.contains(o.ownerDocument,o),a=g(d.appendChild(o),"script"),s&&L(a),r))for(n=0;o=a[n++];)Xt.test(o.type||"")&&r.push(o);return a=null,d},cleanData:function(e,t){for(var r,i,n,o,s=0,a=ot.expando,l=ot.cache,u=it.deleteExpando,p=ot.event.special;null!=(r=e[s]);s++)if((t||ot.acceptData(r))&&(n=r[a],o=n&&l[n])){if(o.events)for(i in o.events)p[i]?ot.event.remove(r,i):ot.removeEvent(r,i,o.handle);l[n]&&(delete l[n],u?delete r[a]:typeof r.removeAttribute!==yt?r.removeAttribute(a):r[a]=null,K.push(n))}}}),ot.fn.extend({text:function(e){return Ot(this,function(e){return void 0===e?ot.text(this):this.empty().append((this[0]&&this[0].ownerDocument||ft).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=x(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=x(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var r,i=e?ot.filter(e,this):this,n=0;null!=(r=i[n]);n++)t||1!==r.nodeType||ot.cleanData(g(r)),r.parentNode&&(t&&ot.contains(r.ownerDocument,r)&&L(g(r,"script")),r.parentNode.removeChild(r));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&ot.cleanData(g(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&ot.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return ot.clone(this,e,t)})},html:function(e){return Ot(this,function(e){var t=this[0]||{},r=0,i=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Bt,""):void 0;if(!("string"!=typeof e||qt.test(e)||!it.htmlSerialize&&Ut.test(e)||!it.leadingWhitespace&&Vt.test(e)||$t[(Ft.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Ht,"<$1></$2>");try{for(;i>r;r++)t=this[r]||{},1===t.nodeType&&(ot.cleanData(g(t,!1)),t.innerHTML=e);t=0}catch(n){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,ot.cleanData(g(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=Q.apply([],e);var r,i,n,o,s,a,l=0,u=this.length,p=this,c=u-1,d=e[0],h=ot.isFunction(d);if(h||u>1&&"string"==typeof d&&!it.checkClone&&zt.test(d))return this.each(function(r){var i=p.eq(r);h&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t)});if(u&&(a=ot.buildFragment(e,this[0].ownerDocument,!1,this),r=a.firstChild,1===a.childNodes.length&&(a=r),r)){for(o=ot.map(g(a,"script"),N),n=o.length;u>l;l++)i=a,l!==c&&(i=ot.clone(i,!0,!0),n&&ot.merge(o,g(i,"script"))),t.call(this[l],i,l);if(n)for(s=o[o.length-1].ownerDocument,ot.map(o,T),l=0;n>l;l++)i=o[l],Xt.test(i.type||"")&&!ot._data(i,"globalEval")&&ot.contains(s,i)&&(i.src?ot._evalUrl&&ot._evalUrl(i.src):ot.globalEval((i.text||i.textContent||i.innerHTML||"").replace(Kt,"")));a=r=null}return this}}),ot.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){ot.fn[e]=function(e){for(var r,i=0,n=[],o=ot(e),s=o.length-1;s>=i;i++)r=i===s?this:this.clone(!0),ot(o[i])[t](r),Z.apply(n,r.get());return this.pushStack(n)}});var Jt,er={};!function(){var e;it.shrinkWrapBlocks=function(){if(null!=e)return e;e=!1;var t,r,i;return r=ft.getElementsByTagName("body")[0],r&&r.style?(t=ft.createElement("div"),i=ft.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",r.appendChild(i).appendChild(t),typeof t.style.zoom!==yt&&(t.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",t.appendChild(ft.createElement("div")).style.width="5px",e=3!==t.offsetWidth),r.removeChild(i),e):void 0}}();var tr,rr,ir=/^margin/,nr=new RegExp("^("+Ct+")(?!px)[a-z%]+$","i"),or=/^(top|right|bottom|left)$/;t.getComputedStyle?(tr=function(e){return e.ownerDocument.defaultView.getComputedStyle(e,null)},rr=function(e,t,r){var i,n,o,s,a=e.style;return r=r||tr(e),s=r?r.getPropertyValue(t)||r[t]:void 0,r&&(""!==s||ot.contains(e.ownerDocument,e)||(s=ot.style(e,t)),nr.test(s)&&ir.test(t)&&(i=a.width,n=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=r.width,a.width=i,a.minWidth=n,a.maxWidth=o)),void 0===s?s:s+""}):ft.documentElement.currentStyle&&(tr=function(e){return e.currentStyle},rr=function(e,t,r){var i,n,o,s,a=e.style;return r=r||tr(e),s=r?r[t]:void 0,null==s&&a&&a[t]&&(s=a[t]),nr.test(s)&&!or.test(t)&&(i=a.left,n=e.runtimeStyle,o=n&&n.left,o&&(n.left=e.currentStyle.left),a.left="fontSize"===t?"1em":s,s=a.pixelLeft+"px",a.left=i,o&&(n.left=o)),void 0===s?s:s+""||"auto"}),function(){function e(){var e,r,i,n;r=ft.getElementsByTagName("body")[0],r&&r.style&&(e=ft.createElement("div"),i=ft.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",r.appendChild(i).appendChild(e),e.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o=s=!1,l=!0,t.getComputedStyle&&(o="1%"!==(t.getComputedStyle(e,null)||{}).top,s="4px"===(t.getComputedStyle(e,null)||{width:"4px"}).width,n=e.appendChild(ft.createElement("div")),n.style.cssText=e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",e.style.width="1px",l=!parseFloat((t.getComputedStyle(n,null)||{}).marginRight)),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",n=e.getElementsByTagName("td"),n[0].style.cssText="margin:0;border:0;padding:0;display:none",a=0===n[0].offsetHeight,a&&(n[0].style.display="",n[1].style.display="none",a=0===n[0].offsetHeight),r.removeChild(i))}var r,i,n,o,s,a,l;r=ft.createElement("div"),r.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=r.getElementsByTagName("a")[0],i=n&&n.style,i&&(i.cssText="float:left;opacity:.5",it.opacity="0.5"===i.opacity,it.cssFloat=!!i.cssFloat,r.style.backgroundClip="content-box",r.cloneNode(!0).style.backgroundClip="",it.clearCloneStyle="content-box"===r.style.backgroundClip,it.boxSizing=""===i.boxSizing||""===i.MozBoxSizing||""===i.WebkitBoxSizing,ot.extend(it,{reliableHiddenOffsets:function(){return null==a&&e(),a},boxSizingReliable:function(){return null==s&&e(),s},pixelPosition:function(){return null==o&&e(),o},reliableMarginRight:function(){return null==l&&e(),l}}))}(),ot.swap=function(e,t,r,i){var n,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];n=r.apply(e,i||[]);for(o in t)e.style[o]=s[o];return n};var sr=/alpha\([^)]*\)/i,ar=/opacity\s*=\s*([^)]*)/,lr=/^(none|table(?!-c[ea]).+)/,ur=new RegExp("^("+Ct+")(.*)$","i"),pr=new RegExp("^([+-])=("+Ct+")","i"),cr={position:"absolute",visibility:"hidden",display:"block"},dr={letterSpacing:"0",fontWeight:"400"},hr=["Webkit","O","Moz","ms"];ot.extend({cssHooks:{opacity:{get:function(e,t){if(t){var r=rr(e,"opacity");return""===r?"1":r}}}},cssNumber:{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":it.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var n,o,s,a=ot.camelCase(t),l=e.style;if(t=ot.cssProps[a]||(ot.cssProps[a]=R(l,a)),s=ot.cssHooks[t]||ot.cssHooks[a],void 0===r)return s&&"get"in s&&void 0!==(n=s.get(e,!1,i))?n:l[t];if(o=typeof r,"string"===o&&(n=pr.exec(r))&&(r=(n[1]+1)*n[2]+parseFloat(ot.css(e,t)),o="number"),null!=r&&r===r&&("number"!==o||ot.cssNumber[a]||(r+="px"),it.clearCloneStyle||""!==r||0!==t.indexOf("background")||(l[t]="inherit"),!(s&&"set"in s&&void 0===(r=s.set(e,r,i)))))try{l[t]=r}catch(u){}}},css:function(e,t,r,i){var n,o,s,a=ot.camelCase(t);return t=ot.cssProps[a]||(ot.cssProps[a]=R(e.style,a)),s=ot.cssHooks[t]||ot.cssHooks[a],s&&"get"in s&&(o=s.get(e,!0,r)),void 0===o&&(o=rr(e,t,i)),"normal"===o&&t in dr&&(o=dr[t]),""===r||r?(n=parseFloat(o),r===!0||ot.isNumeric(n)?n||0:o):o}}),ot.each(["height","width"],function(e,t){ot.cssHooks[t]={get:function(e,r,i){return r?lr.test(ot.css(e,"display"))&&0===e.offsetWidth?ot.swap(e,cr,function(){return D(e,t,i)}):D(e,t,i):void 0},set:function(e,r,i){var n=i&&tr(e);return O(e,r,i?P(e,t,i,it.boxSizing&&"border-box"===ot.css(e,"boxSizing",!1,n),n):0)}}}),it.opacity||(ot.cssHooks.opacity={get:function(e,t){return ar.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var r=e.style,i=e.currentStyle,n=ot.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=i&&i.filter||r.filter||"";r.zoom=1,(t>=1||""===t)&&""===ot.trim(o.replace(sr,""))&&r.removeAttribute&&(r.removeAttribute("filter"),""===t||i&&!i.filter)||(r.filter=sr.test(o)?o.replace(sr,n):o+" "+n)}}),ot.cssHooks.marginRight=C(it.reliableMarginRight,function(e,t){return t?ot.swap(e,{display:"inline-block"},rr,[e,"marginRight"]):void 0}),ot.each({margin:"",padding:"",border:"Width"},function(e,t){ot.cssHooks[e+t]={expand:function(r){for(var i=0,n={},o="string"==typeof r?r.split(" "):[r];4>i;i++)n[e+Rt[i]+t]=o[i]||o[i-2]||o[0];return n}},ir.test(e)||(ot.cssHooks[e+t].set=O)}),ot.fn.extend({css:function(e,t){return Ot(this,function(e,t,r){var i,n,o={},s=0;if(ot.isArray(t)){for(i=tr(e),n=t.length;n>s;s++)o[t[s]]=ot.css(e,t[s],!1,i);return o}return void 0!==r?ot.style(e,t,r):ot.css(e,t)},e,t,arguments.length>1)},show:function(){return b(this,!0)},hide:function(){return b(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){bt(this)?ot(this).show():ot(this).hide()})}}),ot.Tween=_,_.prototype={constructor:_,init:function(e,t,r,i,n,o){this.elem=e,this.prop=r,this.easing=n||"swing",this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(ot.cssNumber[r]?"":"px")},cur:function(){var e=_.propHooks[this.prop];return e&&e.get?e.get(this):_.propHooks._default.get(this)},run:function(e){var t,r=_.propHooks[this.prop];return this.pos=t=this.options.duration?ot.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):_.propHooks._default.set(this),this}},_.prototype.init.prototype=_.prototype,_.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=ot.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){ot.fx.step[e.prop]?ot.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[ot.cssProps[e.prop]]||ot.cssHooks[e.prop])?ot.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},_.propHooks.scrollTop=_.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ot.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},ot.fx=_.prototype.init,ot.fx.step={};var Er,fr,mr=/^(?:toggle|show|hide)$/,gr=new RegExp("^(?:([+-])=|)("+Ct+")([a-z%]*)$","i"),vr=/queueHooks$/,xr=[k],Nr={"*":[function(e,t){var r=this.createTween(e,t),i=r.cur(),n=gr.exec(t),o=n&&n[3]||(ot.cssNumber[e]?"":"px"),s=(ot.cssNumber[e]||"px"!==o&&+i)&&gr.exec(ot.css(r.elem,e)),a=1,l=20;if(s&&s[3]!==o){o=o||s[3],n=n||[],s=+i||1;do a=a||".5",s/=a,ot.style(r.elem,e,s+o);while(a!==(a=r.cur()/i)&&1!==a&&--l)}return n&&(s=r.start=+s||+i||0,r.unit=o,r.end=n[1]?s+(n[1]+1)*n[2]:+n[2]),r}]};ot.Animation=ot.extend(U,{tweener:function(e,t){ot.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var r,i=0,n=e.length;n>i;i++)r=e[i],Nr[r]=Nr[r]||[],Nr[r].unshift(t)},prefilter:function(e,t){t?xr.unshift(e):xr.push(e)}}),ot.speed=function(e,t,r){var i=e&&"object"==typeof e?ot.extend({},e):{complete:r||!r&&t||ot.isFunction(e)&&e,duration:e,easing:r&&t||t&&!ot.isFunction(t)&&t};return i.duration=ot.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in ot.fx.speeds?ot.fx.speeds[i.duration]:ot.fx.speeds._default,(null==i.queue||i.queue===!0)&&(i.queue="fx"),i.old=i.complete,i.complete=function(){ot.isFunction(i.old)&&i.old.call(this),i.queue&&ot.dequeue(this,i.queue)},i},ot.fn.extend({fadeTo:function(e,t,r,i){return this.filter(bt).css("opacity",0).show().end().animate({opacity:t},e,r,i)},animate:function(e,t,r,i){var n=ot.isEmptyObject(e),o=ot.speed(t,r,i),s=function(){var t=U(this,ot.extend({},e),o);(n||ot._data(this,"finish"))&&t.stop(!0)};return s.finish=s,n||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(e,t,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=ot.timers,s=ot._data(this);if(n)s[n]&&s[n].stop&&i(s[n]);else for(n in s)s[n]&&s[n].stop&&vr.test(n)&&i(s[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&ot.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,r=ot._data(this),i=r[e+"queue"],n=r[e+"queueHooks"],o=ot.timers,s=i?i.length:0;for(r.finish=!0,ot.queue(this,e,[]),n&&n.stop&&n.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;s>t;t++)i[t]&&i[t].finish&&i[t].finish.call(this);
delete r.finish})}}),ot.each(["toggle","show","hide"],function(e,t){var r=ot.fn[t];ot.fn[t]=function(e,i,n){return null==e||"boolean"==typeof e?r.apply(this,arguments):this.animate(w(t,!0),e,i,n)}}),ot.each({slideDown:w("show"),slideUp:w("hide"),slideToggle:w("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){ot.fn[e]=function(e,r,i){return this.animate(t,e,r,i)}}),ot.timers=[],ot.fx.tick=function(){var e,t=ot.timers,r=0;for(Er=ot.now();r<t.length;r++)e=t[r],e()||t[r]!==e||t.splice(r--,1);t.length||ot.fx.stop(),Er=void 0},ot.fx.timer=function(e){ot.timers.push(e),e()?ot.fx.start():ot.timers.pop()},ot.fx.interval=13,ot.fx.start=function(){fr||(fr=setInterval(ot.fx.tick,ot.fx.interval))},ot.fx.stop=function(){clearInterval(fr),fr=null},ot.fx.speeds={slow:600,fast:200,_default:400},ot.fn.delay=function(e,t){return e=ot.fx?ot.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,r){var i=setTimeout(t,e);r.stop=function(){clearTimeout(i)}})},function(){var e,t,r,i,n;t=ft.createElement("div"),t.setAttribute("className","t"),t.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",i=t.getElementsByTagName("a")[0],r=ft.createElement("select"),n=r.appendChild(ft.createElement("option")),e=t.getElementsByTagName("input")[0],i.style.cssText="top:1px",it.getSetAttribute="t"!==t.className,it.style=/top/.test(i.getAttribute("style")),it.hrefNormalized="/a"===i.getAttribute("href"),it.checkOn=!!e.value,it.optSelected=n.selected,it.enctype=!!ft.createElement("form").enctype,r.disabled=!0,it.optDisabled=!n.disabled,e=ft.createElement("input"),e.setAttribute("value",""),it.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),it.radioValue="t"===e.value}();var Tr=/\r/g;ot.fn.extend({val:function(e){var t,r,i,n=this[0];{if(arguments.length)return i=ot.isFunction(e),this.each(function(r){var n;1===this.nodeType&&(n=i?e.call(this,r,ot(this).val()):e,null==n?n="":"number"==typeof n?n+="":ot.isArray(n)&&(n=ot.map(n,function(e){return null==e?"":e+""})),t=ot.valHooks[this.type]||ot.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,n,"value")||(this.value=n))});if(n)return t=ot.valHooks[n.type]||ot.valHooks[n.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(r=t.get(n,"value"))?r:(r=n.value,"string"==typeof r?r.replace(Tr,""):null==r?"":r)}}}),ot.extend({valHooks:{option:{get:function(e){var t=ot.find.attr(e,"value");return null!=t?t:ot.trim(ot.text(e))}},select:{get:function(e){for(var t,r,i=e.options,n=e.selectedIndex,o="select-one"===e.type||0>n,s=o?null:[],a=o?n+1:i.length,l=0>n?a:o?n:0;a>l;l++)if(r=i[l],!(!r.selected&&l!==n||(it.optDisabled?r.disabled:null!==r.getAttribute("disabled"))||r.parentNode.disabled&&ot.nodeName(r.parentNode,"optgroup"))){if(t=ot(r).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var r,i,n=e.options,o=ot.makeArray(t),s=n.length;s--;)if(i=n[s],ot.inArray(ot.valHooks.option.get(i),o)>=0)try{i.selected=r=!0}catch(a){i.scrollHeight}else i.selected=!1;return r||(e.selectedIndex=-1),n}}}}),ot.each(["radio","checkbox"],function(){ot.valHooks[this]={set:function(e,t){return ot.isArray(t)?e.checked=ot.inArray(ot(e).val(),t)>=0:void 0}},it.checkOn||(ot.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Lr,Ir,yr=ot.expr.attrHandle,Ar=/^(?:checked|selected)$/i,Sr=it.getSetAttribute,Cr=it.input;ot.fn.extend({attr:function(e,t){return Ot(this,ot.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){ot.removeAttr(this,e)})}}),ot.extend({attr:function(e,t,r){var i,n,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===yt?ot.prop(e,t,r):(1===o&&ot.isXMLDoc(e)||(t=t.toLowerCase(),i=ot.attrHooks[t]||(ot.expr.match.bool.test(t)?Ir:Lr)),void 0===r?i&&"get"in i&&null!==(n=i.get(e,t))?n:(n=ot.find.attr(e,t),null==n?void 0:n):null!==r?i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:(e.setAttribute(t,r+""),r):void ot.removeAttr(e,t))},removeAttr:function(e,t){var r,i,n=0,o=t&&t.match(Nt);if(o&&1===e.nodeType)for(;r=o[n++];)i=ot.propFix[r]||r,ot.expr.match.bool.test(r)?Cr&&Sr||!Ar.test(r)?e[i]=!1:e[ot.camelCase("default-"+r)]=e[i]=!1:ot.attr(e,r,""),e.removeAttribute(Sr?r:i)},attrHooks:{type:{set:function(e,t){if(!it.radioValue&&"radio"===t&&ot.nodeName(e,"input")){var r=e.value;return e.setAttribute("type",t),r&&(e.value=r),t}}}}}),Ir={set:function(e,t,r){return t===!1?ot.removeAttr(e,r):Cr&&Sr||!Ar.test(r)?e.setAttribute(!Sr&&ot.propFix[r]||r,r):e[ot.camelCase("default-"+r)]=e[r]=!0,r}},ot.each(ot.expr.match.bool.source.match(/\w+/g),function(e,t){var r=yr[t]||ot.find.attr;yr[t]=Cr&&Sr||!Ar.test(t)?function(e,t,i){var n,o;return i||(o=yr[t],yr[t]=n,n=null!=r(e,t,i)?t.toLowerCase():null,yr[t]=o),n}:function(e,t,r){return r?void 0:e[ot.camelCase("default-"+t)]?t.toLowerCase():null}}),Cr&&Sr||(ot.attrHooks.value={set:function(e,t,r){return ot.nodeName(e,"input")?void(e.defaultValue=t):Lr&&Lr.set(e,t,r)}}),Sr||(Lr={set:function(e,t,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=t+="","value"===r||t===e.getAttribute(r)?t:void 0}},yr.id=yr.name=yr.coords=function(e,t,r){var i;return r?void 0:(i=e.getAttributeNode(t))&&""!==i.value?i.value:null},ot.valHooks.button={get:function(e,t){var r=e.getAttributeNode(t);return r&&r.specified?r.value:void 0},set:Lr.set},ot.attrHooks.contenteditable={set:function(e,t,r){Lr.set(e,""===t?!1:t,r)}},ot.each(["width","height"],function(e,t){ot.attrHooks[t]={set:function(e,r){return""===r?(e.setAttribute(t,"auto"),r):void 0}}})),it.style||(ot.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Rr=/^(?:input|select|textarea|button|object)$/i,br=/^(?:a|area)$/i;ot.fn.extend({prop:function(e,t){return Ot(this,ot.prop,e,t,arguments.length>1)},removeProp:function(e){return e=ot.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),ot.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,r){var i,n,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return o=1!==s||!ot.isXMLDoc(e),o&&(t=ot.propFix[t]||t,n=ot.propHooks[t]),void 0!==r?n&&"set"in n&&void 0!==(i=n.set(e,r,t))?i:e[t]=r:n&&"get"in n&&null!==(i=n.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=ot.find.attr(e,"tabindex");return t?parseInt(t,10):Rr.test(e.nodeName)||br.test(e.nodeName)&&e.href?0:-1}}}}),it.hrefNormalized||ot.each(["href","src"],function(e,t){ot.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),it.optSelected||(ot.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),ot.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ot.propFix[this.toLowerCase()]=this}),it.enctype||(ot.propFix.enctype="encoding");var Or=/[\t\r\n\f]/g;ot.fn.extend({addClass:function(e){var t,r,i,n,o,s,a=0,l=this.length,u="string"==typeof e&&e;if(ot.isFunction(e))return this.each(function(t){ot(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(Nt)||[];l>a;a++)if(r=this[a],i=1===r.nodeType&&(r.className?(" "+r.className+" ").replace(Or," "):" ")){for(o=0;n=t[o++];)i.indexOf(" "+n+" ")<0&&(i+=n+" ");s=ot.trim(i),r.className!==s&&(r.className=s)}return this},removeClass:function(e){var t,r,i,n,o,s,a=0,l=this.length,u=0===arguments.length||"string"==typeof e&&e;if(ot.isFunction(e))return this.each(function(t){ot(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(Nt)||[];l>a;a++)if(r=this[a],i=1===r.nodeType&&(r.className?(" "+r.className+" ").replace(Or," "):"")){for(o=0;n=t[o++];)for(;i.indexOf(" "+n+" ")>=0;)i=i.replace(" "+n+" "," ");s=e?ot.trim(i):"",r.className!==s&&(r.className=s)}return this},toggleClass:function(e,t){var r=typeof e;return"boolean"==typeof t&&"string"===r?t?this.addClass(e):this.removeClass(e):this.each(ot.isFunction(e)?function(r){ot(this).toggleClass(e.call(this,r,this.className,t),t)}:function(){if("string"===r)for(var t,i=0,n=ot(this),o=e.match(Nt)||[];t=o[i++];)n.hasClass(t)?n.removeClass(t):n.addClass(t);else(r===yt||"boolean"===r)&&(this.className&&ot._data(this,"__className__",this.className),this.className=this.className||e===!1?"":ot._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",r=0,i=this.length;i>r;r++)if(1===this[r].nodeType&&(" "+this[r].className+" ").replace(Or," ").indexOf(t)>=0)return!0;return!1}}),ot.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(e,t){ot.fn[t]=function(e,r){return arguments.length>0?this.on(t,null,e,r):this.trigger(t)}}),ot.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,r){return this.on(e,null,t,r)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,r,i){return this.on(t,e,r,i)},undelegate:function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)}});var Pr=ot.now(),Dr=/\?/,_r=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;ot.parseJSON=function(e){if(t.JSON&&t.JSON.parse)return t.JSON.parse(e+"");var r,i=null,n=ot.trim(e+"");return n&&!ot.trim(n.replace(_r,function(e,t,n,o){return r&&t&&(i=0),0===i?e:(r=n||t,i+=!o-!n,"")}))?Function("return "+n)():ot.error("Invalid JSON: "+e)},ot.parseXML=function(e){var r,i;if(!e||"string"!=typeof e)return null;try{t.DOMParser?(i=new DOMParser,r=i.parseFromString(e,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(e))}catch(n){r=void 0}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||ot.error("Invalid XML: "+e),r};var Mr,wr,Gr=/#.*$/,kr=/([?&])_=[^&]*/,Br=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ur=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Vr=/^(?:GET|HEAD)$/,Hr=/^\/\//,Fr=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,jr={},Wr={},qr="*/".concat("*");try{wr=location.href}catch(zr){wr=ft.createElement("a"),wr.href="",wr=wr.href}Mr=Fr.exec(wr.toLowerCase())||[],ot.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:wr,type:"GET",isLocal:Ur.test(Mr[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":qr,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ot.parseJSON,"text xml":ot.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?F(F(e,ot.ajaxSettings),t):F(ot.ajaxSettings,e)},ajaxPrefilter:V(jr),ajaxTransport:V(Wr),ajax:function(e,t){function r(e,t,r,i){var n,p,g,v,N,L=t;2!==x&&(x=2,a&&clearTimeout(a),u=void 0,s=i||"",T.readyState=e>0?4:0,n=e>=200&&300>e||304===e,r&&(v=j(c,T,r)),v=W(c,v,T,n),n?(c.ifModified&&(N=T.getResponseHeader("Last-Modified"),N&&(ot.lastModified[o]=N),N=T.getResponseHeader("etag"),N&&(ot.etag[o]=N)),204===e||"HEAD"===c.type?L="nocontent":304===e?L="notmodified":(L=v.state,p=v.data,g=v.error,n=!g)):(g=L,(e||!L)&&(L="error",0>e&&(e=0))),T.status=e,T.statusText=(t||L)+"",n?E.resolveWith(d,[p,L,T]):E.rejectWith(d,[T,L,g]),T.statusCode(m),m=void 0,l&&h.trigger(n?"ajaxSuccess":"ajaxError",[T,c,n?p:g]),f.fireWith(d,[T,L]),l&&(h.trigger("ajaxComplete",[T,c]),--ot.active||ot.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,n,o,s,a,l,u,p,c=ot.ajaxSetup({},t),d=c.context||c,h=c.context&&(d.nodeType||d.jquery)?ot(d):ot.event,E=ot.Deferred(),f=ot.Callbacks("once memory"),m=c.statusCode||{},g={},v={},x=0,N="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!p)for(p={};t=Br.exec(s);)p[t[1].toLowerCase()]=t[2];t=p[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?s:null},setRequestHeader:function(e,t){var r=e.toLowerCase();return x||(e=v[r]=v[r]||e,g[e]=t),this},overrideMimeType:function(e){return x||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||N;return u&&u.abort(t),r(0,t),this}};if(E.promise(T).complete=f.add,T.success=T.done,T.error=T.fail,c.url=((e||c.url||wr)+"").replace(Gr,"").replace(Hr,Mr[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=ot.trim(c.dataType||"*").toLowerCase().match(Nt)||[""],null==c.crossDomain&&(i=Fr.exec(c.url.toLowerCase()),c.crossDomain=!(!i||i[1]===Mr[1]&&i[2]===Mr[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(Mr[3]||("http:"===Mr[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=ot.param(c.data,c.traditional)),H(jr,c,t,T),2===x)return T;l=c.global,l&&0===ot.active++&&ot.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Vr.test(c.type),o=c.url,c.hasContent||(c.data&&(o=c.url+=(Dr.test(o)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=kr.test(o)?o.replace(kr,"$1_="+Pr++):o+(Dr.test(o)?"&":"?")+"_="+Pr++)),c.ifModified&&(ot.lastModified[o]&&T.setRequestHeader("If-Modified-Since",ot.lastModified[o]),ot.etag[o]&&T.setRequestHeader("If-None-Match",ot.etag[o])),(c.data&&c.hasContent&&c.contentType!==!1||t.contentType)&&T.setRequestHeader("Content-Type",c.contentType),T.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+qr+"; q=0.01":""):c.accepts["*"]);for(n in c.headers)T.setRequestHeader(n,c.headers[n]);if(c.beforeSend&&(c.beforeSend.call(d,T,c)===!1||2===x))return T.abort();N="abort";for(n in{success:1,error:1,complete:1})T[n](c[n]);if(u=H(Wr,c,t,T)){T.readyState=1,l&&h.trigger("ajaxSend",[T,c]),c.async&&c.timeout>0&&(a=setTimeout(function(){T.abort("timeout")},c.timeout));try{x=1,u.send(g,r)}catch(L){if(!(2>x))throw L;r(-1,L)}}else r(-1,"No Transport");return T},getJSON:function(e,t,r){return ot.get(e,t,r,"json")},getScript:function(e,t){return ot.get(e,void 0,t,"script")}}),ot.each(["get","post"],function(e,t){ot[t]=function(e,r,i,n){return ot.isFunction(r)&&(n=n||i,i=r,r=void 0),ot.ajax({url:e,type:t,dataType:n,data:r,success:i})}}),ot.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ot.fn[t]=function(e){return this.on(t,e)}}),ot._evalUrl=function(e){return ot.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},ot.fn.extend({wrapAll:function(e){if(ot.isFunction(e))return this.each(function(t){ot(this).wrapAll(e.call(this,t))});if(this[0]){var t=ot(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return this.each(ot.isFunction(e)?function(t){ot(this).wrapInner(e.call(this,t))}:function(){var t=ot(this),r=t.contents();r.length?r.wrapAll(e):t.append(e)})},wrap:function(e){var t=ot.isFunction(e);return this.each(function(r){ot(this).wrapAll(t?e.call(this,r):e)})},unwrap:function(){return this.parent().each(function(){ot.nodeName(this,"body")||ot(this).replaceWith(this.childNodes)}).end()}}),ot.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!it.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||ot.css(e,"display"))},ot.expr.filters.visible=function(e){return!ot.expr.filters.hidden(e)};var Xr=/%20/g,Yr=/\[\]$/,Kr=/\r?\n/g,$r=/^(?:submit|button|image|reset|file)$/i,Qr=/^(?:input|select|textarea|keygen)/i;ot.param=function(e,t){var r,i=[],n=function(e,t){t=ot.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=ot.ajaxSettings&&ot.ajaxSettings.traditional),ot.isArray(e)||e.jquery&&!ot.isPlainObject(e))ot.each(e,function(){n(this.name,this.value)});else for(r in e)q(r,e[r],t,n);return i.join("&").replace(Xr,"+")},ot.fn.extend({serialize:function(){return ot.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ot.prop(this,"elements");return e?ot.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ot(this).is(":disabled")&&Qr.test(this.nodeName)&&!$r.test(e)&&(this.checked||!Pt.test(e))}).map(function(e,t){var r=ot(this).val();return null==r?null:ot.isArray(r)?ot.map(r,function(e){return{name:t.name,value:e.replace(Kr,"\r\n")}}):{name:t.name,value:r.replace(Kr,"\r\n")}}).get()}}),ot.ajaxSettings.xhr=void 0!==t.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&z()||X()}:z;var Zr=0,Jr={},ei=ot.ajaxSettings.xhr();t.ActiveXObject&&ot(t).on("unload",function(){for(var e in Jr)Jr[e](void 0,!0)}),it.cors=!!ei&&"withCredentials"in ei,ei=it.ajax=!!ei,ei&&ot.ajaxTransport(function(e){if(!e.crossDomain||it.cors){var t;return{send:function(r,i){var n,o=e.xhr(),s=++Zr;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(n in e.xhrFields)o[n]=e.xhrFields[n];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(n in r)void 0!==r[n]&&o.setRequestHeader(n,r[n]+"");o.send(e.hasContent&&e.data||null),t=function(r,n){var a,l,u;if(t&&(n||4===o.readyState))if(delete Jr[s],t=void 0,o.onreadystatechange=ot.noop,n)4!==o.readyState&&o.abort();else{u={},a=o.status,"string"==typeof o.responseText&&(u.text=o.responseText);try{l=o.statusText}catch(p){l=""}a||!e.isLocal||e.crossDomain?1223===a&&(a=204):a=u.text?200:404}u&&i(a,l,u,o.getAllResponseHeaders())},e.async?4===o.readyState?setTimeout(t):o.onreadystatechange=Jr[s]=t:t()},abort:function(){t&&t(void 0,!0)}}}}),ot.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return ot.globalEval(e),e}}}),ot.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),ot.ajaxTransport("script",function(e){if(e.crossDomain){var t,r=ft.head||ot("head")[0]||ft.documentElement;return{send:function(i,n){t=ft.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,r){(r||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,r||n(200,"success"))},r.insertBefore(t,r.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var ti=[],ri=/(=)\?(?=&|$)|\?\?/;ot.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=ti.pop()||ot.expando+"_"+Pr++;return this[e]=!0,e}}),ot.ajaxPrefilter("json jsonp",function(e,r,i){var n,o,s,a=e.jsonp!==!1&&(ri.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&ri.test(e.data)&&"data");return a||"jsonp"===e.dataTypes[0]?(n=e.jsonpCallback=ot.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(ri,"$1"+n):e.jsonp!==!1&&(e.url+=(Dr.test(e.url)?"&":"?")+e.jsonp+"="+n),e.converters["script json"]=function(){return s||ot.error(n+" was not called"),s[0]},e.dataTypes[0]="json",o=t[n],t[n]=function(){s=arguments},i.always(function(){t[n]=o,e[n]&&(e.jsonpCallback=r.jsonpCallback,ti.push(n)),s&&ot.isFunction(o)&&o(s[0]),s=o=void 0}),"script"):void 0}),ot.parseHTML=function(e,t,r){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(r=t,t=!1),t=t||ft;var i=dt.exec(e),n=!r&&[];return i?[t.createElement(i[1])]:(i=ot.buildFragment([e],t,n),n&&n.length&&ot(n).remove(),ot.merge([],i.childNodes))};var ii=ot.fn.load;ot.fn.load=function(e,t,r){if("string"!=typeof e&&ii)return ii.apply(this,arguments);var i,n,o,s=this,a=e.indexOf(" ");return a>=0&&(i=ot.trim(e.slice(a,e.length)),e=e.slice(0,a)),ot.isFunction(t)?(r=t,t=void 0):t&&"object"==typeof t&&(o="POST"),s.length>0&&ot.ajax({url:e,type:o,dataType:"html",data:t}).done(function(e){n=arguments,s.html(i?ot("<div>").append(ot.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,n||[e.responseText,t,e])}),this},ot.expr.filters.animated=function(e){return ot.grep(ot.timers,function(t){return e===t.elem}).length};var ni=t.document.documentElement;ot.offset={setOffset:function(e,t,r){var i,n,o,s,a,l,u,p=ot.css(e,"position"),c=ot(e),d={};"static"===p&&(e.style.position="relative"),a=c.offset(),o=ot.css(e,"top"),l=ot.css(e,"left"),u=("absolute"===p||"fixed"===p)&&ot.inArray("auto",[o,l])>-1,u?(i=c.position(),s=i.top,n=i.left):(s=parseFloat(o)||0,n=parseFloat(l)||0),ot.isFunction(t)&&(t=t.call(e,r,a)),null!=t.top&&(d.top=t.top-a.top+s),null!=t.left&&(d.left=t.left-a.left+n),"using"in t?t.using.call(e,d):c.css(d)}},ot.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){ot.offset.setOffset(this,e,t)});var t,r,i={top:0,left:0},n=this[0],o=n&&n.ownerDocument;if(o)return t=o.documentElement,ot.contains(t,n)?(typeof n.getBoundingClientRect!==yt&&(i=n.getBoundingClientRect()),r=Y(o),{top:i.top+(r.pageYOffset||t.scrollTop)-(t.clientTop||0),left:i.left+(r.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):i},position:function(){if(this[0]){var e,t,r={top:0,left:0},i=this[0];return"fixed"===ot.css(i,"position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),ot.nodeName(e[0],"html")||(r=e.offset()),r.top+=ot.css(e[0],"borderTopWidth",!0),r.left+=ot.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-ot.css(i,"marginTop",!0),left:t.left-r.left-ot.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||ni;e&&!ot.nodeName(e,"html")&&"static"===ot.css(e,"position");)e=e.offsetParent;return e||ni})}}),ot.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r=/Y/.test(t);ot.fn[e]=function(i){return Ot(this,function(e,i,n){var o=Y(e);return void 0===n?o?t in o?o[t]:o.document.documentElement[i]:e[i]:void(o?o.scrollTo(r?ot(o).scrollLeft():n,r?n:ot(o).scrollTop()):e[i]=n)},e,i,arguments.length,null)}}),ot.each(["top","left"],function(e,t){ot.cssHooks[t]=C(it.pixelPosition,function(e,r){return r?(r=rr(e,t),nr.test(r)?ot(e).position()[t]+"px":r):void 0})}),ot.each({Height:"height",Width:"width"},function(e,t){ot.each({padding:"inner"+e,content:t,"":"outer"+e},function(r,i){ot.fn[i]=function(i,n){var o=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||n===!0?"margin":"border");return Ot(this,function(t,r,i){var n;return ot.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(n=t.documentElement,Math.max(t.body["scroll"+e],n["scroll"+e],t.body["offset"+e],n["offset"+e],n["client"+e])):void 0===i?ot.css(t,r,s):ot.style(t,r,i,s)},t,o?i:void 0,o,null)}})}),ot.fn.size=function(){return this.length},ot.fn.andSelf=ot.fn.addBack,"function"==typeof e&&e.amd&&e("jquery",[],function(){return ot});var oi=t.jQuery,si=t.$;return ot.noConflict=function(e){return t.$===ot&&(t.$=si),e&&t.jQuery===ot&&(t.jQuery=oi),ot},typeof r===yt&&(t.jQuery=t.$=ot),ot})},{}],12:[function(t,r){!function(t){function i(){try{return u in t&&t[u]}catch(e){return!1}}function n(e){return function(){var t=Array.prototype.slice.call(arguments,0);t.unshift(s),c.appendChild(s),s.addBehavior("#default#userData"),s.load(u);var r=e.apply(a,t);return c.removeChild(s),r}}function o(e){return e.replace(/^d/,"___$&").replace(E,"___")}var s,a={},l=t.document,u="localStorage",p="script";if(a.disabled=!1,a.set=function(){},a.get=function(){},a.remove=function(){},a.clear=function(){},a.transact=function(e,t,r){var i=a.get(e);null==r&&(r=t,t=null),"undefined"==typeof i&&(i=t||{}),r(i),a.set(e,i)},a.getAll=function(){},a.forEach=function(){},a.serialize=function(e){return JSON.stringify(e)},a.deserialize=function(e){if("string"!=typeof e)return void 0;try{return JSON.parse(e)}catch(t){return e||void 0}},i())s=t[u],a.set=function(e,t){return void 0===t?a.remove(e):(s.setItem(e,a.serialize(t)),t)},a.get=function(e){return a.deserialize(s.getItem(e))},a.remove=function(e){s.removeItem(e)},a.clear=function(){s.clear()},a.getAll=function(){var e={};return a.forEach(function(t,r){e[t]=r}),e},a.forEach=function(e){for(var t=0;t<s.length;t++){var r=s.key(t);e(r,a.get(r))}};else if(l.documentElement.addBehavior){var c,d;try{d=new ActiveXObject("htmlfile"),d.open(),d.write("<"+p+">document.w=window</"+p+'><iframe src="/favicon.ico"></iframe>'),d.close(),c=d.w.frames[0].document,s=c.createElement("div")}catch(h){s=l.createElement("div"),c=l.body}var E=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");a.set=n(function(e,t,r){return t=o(t),void 0===r?a.remove(t):(e.setAttribute(t,a.serialize(r)),e.save(u),r)}),a.get=n(function(e,t){return t=o(t),a.deserialize(e.getAttribute(t))}),a.remove=n(function(e,t){t=o(t),e.removeAttribute(t),e.save(u)}),a.clear=n(function(e){var t=e.XMLDocument.documentElement.attributes;e.load(u);for(var r,i=0;r=t[i];i++)e.removeAttribute(r.name);e.save(u)}),a.getAll=function(){var e={};return a.forEach(function(t,r){e[t]=r}),e},a.forEach=n(function(e,t){for(var r,i=e.XMLDocument.documentElement.attributes,n=0;r=i[n];++n)t(r.name,a.deserialize(e.getAttribute(r.name)))})}try{var f="__storejs__";a.set(f,f),a.get(f)!=f&&(a.disabled=!0),a.remove(f)}catch(h){a.disabled=!0}a.enabled=!a.disabled,"undefined"!=typeof r&&r.exports&&this.module!==r?r.exports=a:"function"==typeof e&&e.amd?e(a):t.store=a}(Function("return this")())},{}],13:[function(e,t){t.exports={name:"yasgui-utils",version:"1.4.1",description:"Utils for YASGUI libs",main:"src/main.js",repository:{type:"git",url:"git://github.com/YASGUI/Utils.git"},licenses:[{type:"MIT",url:"http://yasgui.github.io/license.txt"}],author:"Laurens Rietveld",maintainers:[{name:"Laurens Rietveld",email:"[email protected]",web:"http://laurensrietveld.nl"}],bugs:{url:"https://github.com/YASGUI/Utils/issues"},homepage:"https://github.com/YASGUI/Utils",dependencies:{store:"^1.3.14"}}},{}],14:[function(e,t){window.console=window.console||{log:function(){}},t.exports={storage:e("./storage.js"),svg:e("./svg.js"),version:{"yasgui-utils":e("../package.json").version}}},{"../package.json":13,"./storage.js":15,"./svg.js":16}],15:[function(e,t){{var r=e("store"),i={day:function(){return 864e5},month:function(){30*i.day()},year:function(){12*i.month()}};t.exports={set:function(e,t,n){"string"==typeof n&&(n=i[n]()),t.documentElement&&(t=(new XMLSerializer).serializeToString(t.documentElement)),r.set(e,{val:t,exp:n,time:(new Date).getTime()})},get:function(e){var t=r.get(e);return t?t.exp&&(new Date).getTime()-t.time>t.exp?null:t.val:null}}}},{store:12}],16:[function(e,t){t.exports={draw:function(e,r,i){if(e){var n=t.exports.getElement(r,i);n&&(e.append?e.append(n):e.appendChild(n))}},getElement:function(e,t){if(e&&0==e.indexOf("<svg")){t.width||(t.width="100%"),t.height||(t.height="100%");var r=new DOMParser,i=r.parseFromString(e,"text/xml"),n=i.documentElement,o=document.createElement("div");return o.style.display="inline-block",o.style.width=t.width,o.style.height=t.height,o.appendChild(n),o}return!1}}},{}],17:[function(e,t){t.exports={name:"yasgui-yasqe",description:"Yet Another SPARQL Query Editor",version:"2.2.0",main:"src/main.js",licenses:[{type:"MIT",url:"http://yasqe.yasgui.org/license.txt"}],author:"Laurens Rietveld",homepage:"http://yasqe.yasgui.org",devDependencies:{browserify:"^6.1.0",gulp:"~3.6.0","gulp-bump":"^0.1.11","gulp-concat":"^2.4.1","gulp-connect":"^2.0.5","gulp-embedlr":"^0.5.2","gulp-filter":"^1.0.2","gulp-git":"^0.5.2","gulp-jsvalidate":"^0.2.0","gulp-livereload":"^1.3.1","gulp-minify-css":"^0.3.11","gulp-notify":"^1.2.5","gulp-rename":"^1.2.0","gulp-streamify":"0.0.5","gulp-tag-version":"^1.1.0","gulp-uglify":"^0.2.1","require-dir":"^0.1.0","run-sequence":"^1.0.1","vinyl-buffer":"^1.0.0","vinyl-source-stream":"~0.1.1",watchify:"^0.6.4","gulp-sourcemaps":"^1.2.4",exorcist:"^0.1.6","vinyl-transform":"0.0.1","gulp-sass":"^1.2.2","browserify-transform-tools":"^1.2.1"},bugs:"https://github.com/YASGUI/YASQE/issues/",keywords:["JavaScript","SPARQL","Editor","Semantic Web","Linked Data"],maintainers:[{name:"Laurens Rietveld",email:"[email protected]",web:"http://laurensrietveld.nl"}],repository:{type:"git",url:"https://github.com/YASGUI/YASQE.git"},dependencies:{jquery:"~ 1.11.0",codemirror:"^4.7.0","twitter-bootstrap-3.0.0":"^3.0.0","yasgui-utils":"^1.4.1"},optionalShim:{codemirror:{require:"codemirror",global:"CodeMirror"},jquery:{require:"jquery",global:"jQuery"},"../../lib/codemirror":{require:"codemirror",global:"CodeMirror"}}}},{}],18:[function(e,t){var r=e("jquery"),i=e("../utils.js"),n=e("yasgui-utils"),o=e("../../lib/trie.js");t.exports=function(e){var t={},a={},l={};e.on("cursorActivity",function(){c(!0)}),e.on("change",function(){var i=[];for(var n in t)t[n].is(":visible")&&i.push(t[n]);if(i.length>0){var o=r(e.getWrapperElement()).find(".CodeMirror-vscrollbar"),s=0;o.is(":visible")&&(s=o.outerWidth()),i.forEach(function(e){e.css("right",s)})}});var u=function(t,r){l[t.name]=new o;for(var s=0;s<r.length;s++)l[t.name].insert(r[s]);var a=i.getPersistencyId(e,t.persistent);a&&n.storage.set(a,r,"month")},p=function(t,r){var o=a[t]=new r(e,t);if(o.name=t,o.bulk){var s=function(e){e&&e instanceof Array&&e.length>0&&u(o,e)};if(o.get instanceof Array)s(o.get);else{var l=null,p=i.getPersistencyId(e,o.persistent);p&&(l=n.storage.get(p)),l&&l.length>0?s(l):o.get instanceof Function&&(o.async?o.get(null,s):s(o.get()))}}},c=function(t){if(!e.somethingSelected()){var i=function(r){if(t&&(!r.autoShow||!r.bulk&&r.async))return!1;var i={closeCharacters:/(?=a)b/,completeSingle:!1};!r.bulk&&r.async&&(i.async=!0);{var n=function(e,t){return d(r,t)};YASQE.showHint(e,n,i)}return!0};for(var n in a)if(-1!=r.inArray(n,e.options.autocompleters)){var o=a[n];if(o.isValidCompletionPosition)if(o.isValidCompletionPosition()){if(!o.callbacks||!o.callbacks.validPosition||o.callbacks.validPosition(e,o)!==!1){var s=i(o);if(s)break}}else o.callbacks&&o.callbacks.invalidPosition&&o.callbacks.invalidPosition(e,o)}}},d=function(t,r){var i=function(e){var r=e.autocompletionString||e.string,i=[];if(l[t.name])i=l[t.name].autoComplete(r);else if("function"==typeof t.get&&0==t.async)i=t.get(r);else if("object"==typeof t.get)for(var n=r.length,o=0;o<t.get.length;o++){var s=t.get[o];s.slice(0,n)==r&&i.push(s)}return h(i,t,e)},n=e.getCompleteToken();if(t.preProcessToken&&(n=t.preProcessToken(n)),n){if(t.bulk||!t.async)return i(n);var o=function(e){r(h(e,t,n))};t.get(n,o)}},h=function(t,r,i){for(var n=[],o=0;o<t.length;o++){var a=t[o];r.postProcessToken&&(a=r.postProcessToken(i,a)),n.push({text:a,displayText:a,hint:s})}var l=e.getCursor(),u={completionToken:i.string,list:n,from:{line:l.line,ch:i.start},to:{line:l.line,ch:i.end}};if(r.callbacks)for(var p in r.callbacks)r.callbacks[p]&&e.on(u,p,r.callbacks[p]);return u};return{init:p,completers:a,notifications:{getEl:function(e){return r(t[e.name])},show:function(e,i){i.autoshow||(t[i.name]||(t[i.name]=r("<div class='completionNotification'></div>")),t[i.name].show().text("Press "+(-1!=navigator.userAgent.indexOf("Mac OS X")?"CMD":"CTRL")+" - <spacebar> to autocomplete").appendTo(r(e.getWrapperElement())))},hide:function(e,r){t[r.name]&&t[r.name].hide()}},autoComplete:c,getTrie:function(e){return"string"==typeof e?l[e]:l[e.name]}}};var s=function(e,t,r){r.text!=e.getTokenAt(e.getCursor()).string&&e.replaceRange(r.text,t.from,t.to)}},{"../../lib/trie.js":4,"../utils.js":30,jquery:11,"yasgui-utils":14}],19:[function(e,t){e("jquery");t.exports=function(r,i){return{isValidCompletionPosition:function(){return t.exports.isValidCompletionPosition(r)},get:function(t,i){return e("./utils").fetchFromLov(r,this,t,i)
},preProcessToken:function(e){return t.exports.preProcessToken(r,e)},postProcessToken:function(e,i){return t.exports.postProcessToken(r,e,i)},async:!0,bulk:!1,autoShow:!1,persistent:i,callbacks:{validPosition:r.autocompleters.notifications.show,invalidPosition:r.autocompleters.notifications.hide}}},t.exports.isValidCompletionPosition=function(e){var t=e.getCompleteToken();if(0==t.string.indexOf("?"))return!1;var r=e.getCursor(),i=e.getPreviousNonWsToken(r.line,t);return"a"==i.string?!0:"rdf:type"==i.string?!0:"rdfs:domain"==i.string?!0:"rdfs:range"==i.string?!0:!1},t.exports.preProcessToken=function(t,r){return e("./utils.js").preprocessResourceTokenForCompletion(t,r)},t.exports.postProcessToken=function(t,r,i){return e("./utils.js").postprocessResourceTokenForCompletion(t,r,i)}},{"./utils":22,"./utils.js":22,jquery:11}],20:[function(e,t){var r=e("jquery"),i={"string-2":"prefixed",atom:"var"};t.exports=function(e,i){return e.on("change",function(){t.exports.appendPrefixIfNeeded(e,i)}),{isValidCompletionPosition:function(){t.exports.isValidCompletionPosition(e)},get:function(e,t){r.get("http://prefix.cc/popular/all.file.json",function(e){var r=[];for(var i in e)if("bif"!=i){var n=i+": <"+e[i]+">";r.push(n)}r.sort(),t(r)})},preProcessToken:function(r){t.exports.preprocessPrefixTokenForCompletion(e,r)},async:!0,bulk:!0,persistent:i}},t.exports.isValidCompletionPosition=function(e){var t=e.getCursor(),i=e.getTokenAt(t);if(e.getLine(t.line).length>t.ch)return!1;if("ws"!=i.type&&(i=e.getCompleteToken()),0==!i.string.indexOf("a")&&-1==r.inArray("PNAME_NS",i.state.possibleCurrent))return!1;var n=e.getPreviousNonWsToken(t.line,i);return n&&"PREFIX"==n.string.toUpperCase()?!0:!1},t.exports.preprocessPrefixTokenForCompletion=function(e,t){var r=e.getPreviousNonWsToken(e.getCursor().line,t);return r&&r.string&&":"==r.string.slice(-1)&&(t={start:r.start,end:t.end,string:r.string+" "+t.string,state:t.state}),t},t.exports.appendPrefixIfNeeded=function(e,t){if(e.autocompleters.getTrie(t)&&e.options.autocompleters&&-1!=e.options.autocompleters.indexOf(t)){var r=e.getCursor(),n=e.getTokenAt(r);if("prefixed"==i[n.type]){var o=n.string.indexOf(":");if(-1!==o){var s=e.getPreviousNonWsToken(r.line,n).string.toUpperCase(),a=e.getTokenAt({line:r.line,ch:n.start});if("PREFIX"!=s&&("ws"==a.type||null==a.type)){var l=n.string.substring(0,o+1),u=e.getPrefixesFromQuery();if(null==u[l]){var p=e.autocompleters.getTrie(t).autoComplete(l);p.length>0&&e.addPrefixes(p[0])}}}}}}},{jquery:11}],21:[function(e,t){var r=e("jquery");t.exports=function(r,i){return{isValidCompletionPosition:function(){return t.exports.isValidCompletionPosition(r)},get:function(t,i){return e("./utils").fetchFromLov(r,this,t,i)},preProcessToken:function(e){return t.exports.preProcessToken(r,e)},postProcessToken:function(e,i){return t.exports.postProcessToken(r,e,i)},async:!0,bulk:!1,autoShow:!1,persistent:i,callbacks:{validPosition:r.autocompleters.notifications.show,invalidPosition:r.autocompleters.notifications.hide}}},t.exports.isValidCompletionPosition=function(e){var t=e.getCompleteToken();if(0==t.string.length)return!1;if(0==t.string.indexOf("?"))return!1;if(r.inArray("a",t.state.possibleCurrent)>=0)return!0;var i=e.getCursor(),n=e.getPreviousNonWsToken(i.line,t);return"rdfs:subPropertyOf"==n.string?!0:!1},t.exports.preProcessToken=function(t,r){return e("./utils.js").preprocessResourceTokenForCompletion(t,r)},t.exports.postProcessToken=function(t,r,i){return e("./utils.js").postprocessResourceTokenForCompletion(t,r,i)}},{"./utils":22,"./utils.js":22,jquery:11}],22:[function(e,t){var r=e("jquery"),i=(e("./utils.js"),e("yasgui-utils")),n=function(e,t){var r=e.getPrefixesFromQuery();if(0==!t.string.indexOf("<")&&(t.tokenPrefix=t.string.substring(0,t.string.indexOf(":")+1),null!=r[t.tokenPrefix]&&(t.tokenPrefixUri=r[t.tokenPrefix])),t.autocompletionString=t.string.trim(),0==!t.string.indexOf("<")&&t.string.indexOf(":")>-1)for(var i in r)if(r.hasOwnProperty(i)&&0==t.string.indexOf(i)){t.autocompletionString=r[i],t.autocompletionString+=t.string.substring(i.length);break}return 0==t.autocompletionString.indexOf("<")&&(t.autocompletionString=t.autocompletionString.substring(1)),-1!==t.autocompletionString.indexOf(">",t.length-1)&&(t.autocompletionString=t.autocompletionString.substring(0,t.autocompletionString.length-1)),t},o=function(e,t,r){return r=t.tokenPrefix&&t.autocompletionString&&t.tokenPrefixUri?t.tokenPrefix+r.substring(t.tokenPrefixUri.length):"<"+r+">"},s=function(t,n,o,s){if(!o||!o.string||0==o.string.trim().length)return t.autocompleters.notifications.getEl(n).empty().append("Nothing to autocomplete yet!"),!1;var a=50,l={q:o.autocompletionString,page:1};l.type="classes"==n.name?"class":"property";var u=[],p="",c=function(){p="http://lov.okfn.org/dataset/lov/api/v2/autocomplete/terms?"+r.param(l)};c();var d=function(){l.page++,c()},h=function(){r.get(p,function(e){for(var i=0;i<e.results.length;i++)u.push(r.isArray(e.results[i].uri)&&e.results[i].uri.length>0?e.results[i].uri[0]:e.results[i].uri);u.length<e.total_results&&u.length<a?(d(),h()):(u.length>0?t.autocompleters.notifications.hide(t,n):t.autocompleters.notifications.getEl(n).text("0 matches found..."),s(u))}).fail(function(){t.autocompleters.notifications.getEl(n).empty().append("Failed fetching suggestions..")})};t.autocompleters.notifications.getEl(n).empty().append(r("<span>Fetchting autocompletions </span>")).append(r(i.svg.getElement(e("../imgs.js").loader,{width:"18px",height:"18px"})).css("vertical-align","middle")),h()};t.exports={fetchFromLov:s,preprocessResourceTokenForCompletion:n,postprocessResourceTokenForCompletion:o}},{"../imgs.js":25,"./utils.js":22,jquery:11,"yasgui-utils":14}],23:[function(e,t){var r=e("jquery");t.exports=function(e){return{isValidCompletionPosition:function(){var t=e.getTokenAt(e.getCursor());return"ws"!=t.type&&(t=e.getCompleteToken(t),t&&0==t.string.indexOf("?"))?!0:!1},get:function(t){if(0==t.trim().length)return[];var i={};r(e.getWrapperElement()).find(".cm-atom").each(function(){var e=this.innerHTML;if(0==e.indexOf("?")){var n=r(this).next(),o=n.attr("class");if(o&&n.attr("class").indexOf("cm-atom")>=0&&(e+=n.text()),e.length<=1)return;if(0!==e.indexOf(t))return;if(e==t)return;i[e]=!0}});var n=[];for(var o in i)n.push(o);return n.sort(),n},async:!1,bulk:!1,autoShow:!0}}},{jquery:11}],24:[function(e,t){var r=e("jquery"),i=e("./sparql.js");t.exports={use:function(e){e.defaults=r.extend(e.defaults,{mode:"sparql11",value:"SELECT * WHERE {\n ?sub ?pred ?obj .\n} \nLIMIT 10",highlightSelectionMatches:{showToken:/\w/},tabMode:"indent",lineNumbers:!0,gutters:["gutterErrorBar","CodeMirror-linenumbers"],matchBrackets:!0,fixedGutter:!0,syntaxErrorCheck:!0,extraKeys:{"Ctrl-Space":e.autoComplete,"Cmd-Space":e.autoComplete,"Ctrl-D":e.deleteLine,"Ctrl-K":e.deleteLine,"Cmd-D":e.deleteLine,"Cmd-K":e.deleteLine,"Ctrl-/":e.commentLines,"Cmd-/":e.commentLines,"Ctrl-Alt-Down":e.copyLineDown,"Ctrl-Alt-Up":e.copyLineUp,"Cmd-Alt-Down":e.copyLineDown,"Cmd-Alt-Up":e.copyLineUp,"Shift-Ctrl-F":e.doAutoFormat,"Shift-Cmd-F":e.doAutoFormat,"Ctrl-]":e.indentMore,"Cmd-]":e.indentMore,"Ctrl-[":e.indentLess,"Cmd-[":e.indentLess,"Ctrl-S":e.storeQuery,"Cmd-S":e.storeQuery,"Ctrl-Enter":i.executeQuery,"Cmd-Enter":i.executeQuery,F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}},cursorHeight:.9,createShareLink:e.createShareLink,consumeShareLink:e.consumeShareLink,persistent:function(e){return"queryVal_"+r(e.getWrapperElement()).closest("[id]").attr("id")},sparql:{showQueryButton:!1,endpoint:"http://dbpedia.org/sparql",requestMethod:"POST",acceptHeaderGraph:"text/turtle,*/*;q=0.9",acceptHeaderSelect:"application/sparql-results+json,*/*;q=0.9",acceptHeaderUpdate:"text/plain,*/*;q=0.9",namedGraphs:[],defaultGraphs:[],args:[],headers:{},callbacks:{beforeSend:null,complete:null,error:null,success:null},handlers:{}}})}}},{"./sparql.js":27,jquery:11}],25:[function(e,t){t.exports={loader:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="100%" height="100%" fill="black"> <circle cx="16" cy="3" r="0"> <animate attributeName="r" values="0;3;0;0" dur="1s" repeatCount="indefinite" begin="0" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" calcMode="spline" /> </circle> <circle transform="rotate(45 16 16)" cx="16" cy="3" r="0"> <animate attributeName="r" values="0;3;0;0" dur="1s" repeatCount="indefinite" begin="0.125s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" calcMode="spline" /> </circle> <circle transform="rotate(90 16 16)" cx="16" cy="3" r="0"> <animate attributeName="r" values="0;3;0;0" dur="1s" repeatCount="indefinite" begin="0.25s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" calcMode="spline" /> </circle> <circle transform="rotate(135 16 16)" cx="16" cy="3" r="0"> <animate attributeName="r" values="0;3;0;0" dur="1s" repeatCount="indefinite" begin="0.375s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" calcMode="spline" /> </circle> <circle transform="rotate(180 16 16)" cx="16" cy="3" r="0"> <animate attributeName="r" values="0;3;0;0" dur="1s" repeatCount="indefinite" begin="0.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" calcMode="spline" /> </circle> <circle transform="rotate(225 16 16)" cx="16" cy="3" r="0"> <animate attributeName="r" values="0;3;0;0" dur="1s" repeatCount="indefinite" begin="0.625s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" calcMode="spline" /> </circle> <circle transform="rotate(270 16 16)" cx="16" cy="3" r="0"> <animate attributeName="r" values="0;3;0;0" dur="1s" repeatCount="indefinite" begin="0.75s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" calcMode="spline" /> </circle> <circle transform="rotate(315 16 16)" cx="16" cy="3" r="0"> <animate attributeName="r" values="0;3;0;0" dur="1s" repeatCount="indefinite" begin="0.875s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" calcMode="spline" /> </circle> <circle transform="rotate(180 16 16)" cx="16" cy="3" r="0"> <animate attributeName="r" values="0;3;0;0" dur="1s" repeatCount="indefinite" begin="0.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" calcMode="spline" /> </circle></svg>',query:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 80 80" enable-background="new 0 0 80 80" xml:space="preserve"><g id="Layer_1"></g><g id="Layer_2"> <path d="M64.622,2.411H14.995c-6.627,0-12,5.373-12,12v49.897c0,6.627,5.373,12,12,12h49.627c6.627,0,12-5.373,12-12V14.411 C76.622,7.783,71.249,2.411,64.622,2.411z M24.125,63.906V15.093L61,39.168L24.125,63.906z"/></g></svg>',queryInvalid:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 73.627 73.897" enable-background="new 0 0 80 80" xml:space="preserve" ><g id="Layer_1" transform="translate(-2.995,-2.411)" /><g id="Layer_2" transform="translate(-2.995,-2.411)"><path d="M 64.622,2.411 H 14.995 c -6.627,0 -12,5.373 -12,12 v 49.897 c 0,6.627 5.373,12 12,12 h 49.627 c 6.627,0 12,-5.373 12,-12 V 14.411 c 0,-6.628 -5.373,-12 -12,-12 z M 24.125,63.906 V 15.093 L 61,39.168 24.125,63.906 z" id="path6" inkscape:connector-curvature="0" /></g><g transform="matrix(0.76805408,0,0,0.76805408,-0.90231954,-2.0060895)" id="g3"><path style="fill:#c02608;fill-opacity:1" inkscape:connector-curvature="0" d="m 88.184,81.468 c 1.167,1.167 1.167,3.075 0,4.242 l -2.475,2.475 c -1.167,1.167 -3.076,1.167 -4.242,0 l -69.65,-69.65 c -1.167,-1.167 -1.167,-3.076 0,-4.242 l 2.476,-2.476 c 1.167,-1.167 3.076,-1.167 4.242,0 l 69.649,69.651 z" id="path5" /></g><g transform="matrix(0.76805408,0,0,0.76805408,-0.90231954,-2.0060895)" id="g7"><path style="fill:#c02608;fill-opacity:1" inkscape:connector-curvature="0" d="m 18.532,88.184 c -1.167,1.166 -3.076,1.166 -4.242,0 l -2.475,-2.475 c -1.167,-1.166 -1.167,-3.076 0,-4.242 l 69.65,-69.651 c 1.167,-1.167 3.075,-1.167 4.242,0 l 2.476,2.476 c 1.166,1.167 1.166,3.076 0,4.242 l -69.651,69.65 z" id="path9" /></g></svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 100 100" xml:space="preserve"><g id="Captions"></g><g id="Your_Icon"> <path fill-rule="evenodd" fill="#000000" d="M88,84v-2c0-2.961-0.859-4-4-4H16c-2.961,0-4,0.98-4,4v2c0,3.102,1.039,4,4,4h68 C87.02,88,88,87.039,88,84z M58,12H42c-5,0-6,0.941-6,6v22H16l34,34l34-34H64V18C64,12.941,62.939,12,58,12z"/></g></svg>',share:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Icons" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve"><path id="ShareThis" d="M36.764,50c0,0.308-0.07,0.598-0.088,0.905l32.247,16.119c2.76-2.338,6.293-3.797,10.195-3.797 C87.89,63.228,95,70.338,95,79.109C95,87.89,87.89,95,79.118,95c-8.78,0-15.882-7.11-15.882-15.891c0-0.316,0.07-0.598,0.088-0.905 L31.077,62.085c-2.769,2.329-6.293,3.788-10.195,3.788C12.11,65.873,5,58.771,5,50c0-8.78,7.11-15.891,15.882-15.891 c3.902,0,7.427,1.468,10.195,3.797l32.247-16.119c-0.018-0.308-0.088-0.598-0.088-0.914C63.236,12.11,70.338,5,79.118,5 C87.89,5,95,12.11,95,20.873c0,8.78-7.11,15.891-15.882,15.891c-3.911,0-7.436-1.468-10.195-3.806L36.676,49.086 C36.693,49.394,36.764,49.684,36.764,50z"/></svg>',warning:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" viewBox="0 0 66.399998 66.399998" enable-background="new 0 0 69.3 69.3" xml:space="preserve" height="100%" width="100%" inkscape:version="0.48.4 r9939" ><g id="g3" transform="translate(-1.5,-1.5)" style="fill:#ff0000"><path d="M 34.7,1.5 C 16.4,1.5 1.5,16.4 1.5,34.7 1.5,53 16.4,67.9 34.7,67.9 53,67.9 67.9,53 67.9,34.7 67.9,16.4 53,1.5 34.7,1.5 z m 0,59.4 C 20.2,60.9 8.5,49.1 8.5,34.7 8.5,20.2 20.3,8.5 34.7,8.5 c 14.4,0 26.2,11.8 26.2,26.2 0,14.4 -11.8,26.2 -26.2,26.2 z" id="path5" inkscape:connector-curvature="0" style="fill:#ff0000" /><path d="m 34.6,47.1 c -1.4,0 -2.5,0.5 -3.5,1.5 -0.9,1 -1.4,2.2 -1.4,3.6 0,1.6 0.5,2.8 1.5,3.8 1,0.9 2.1,1.3 3.4,1.3 1.3,0 2.4,-0.5 3.4,-1.4 1,-0.9 1.5,-2.2 1.5,-3.7 0,-1.4 -0.5,-2.6 -1.4,-3.6 -0.9,-1 -2.1,-1.5 -3.5,-1.5 z" id="path7" inkscape:connector-curvature="0" style="fill:#ff0000" /><path d="m 34.8,13.9 c -1.5,0 -2.8,0.5 -3.7,1.6 -0.9,1 -1.4,2.4 -1.4,4.2 0,1.1 0.1,2.9 0.2,5.6 l 0.8,13.1 c 0.2,1.8 0.4,3.2 0.9,4.1 0.5,1.2 1.5,1.8 2.9,1.8 1.3,0 2.3,-0.7 2.9,-1.9 0.5,-1 0.7,-2.3 0.9,-4 L 39.4,25 c 0.1,-1.3 0.2,-2.5 0.2,-3.8 0,-2.2 -0.3,-3.9 -0.8,-5.1 -0.5,-1 -1.6,-2.2 -4,-2.2 z" id="path9" inkscape:connector-curvature="0" style="fill:#ff0000" /></g></svg>'}},{}],26:[function(e,t){var r=function(e,t){if("string"==typeof t)i(e,t);else for(var r in t)i(r+" "+t)},i=function(e,t){for(var r=null,i=0,n=e.lineCount(),o=0;n>o;o++){var a=e.getNextNonWsToken(o);null==a||"PREFIX"!=a.string&&"BASE"!=a.string||(r=a,i=o)}if(null==r)e.replaceRange("PREFIX "+t+"\n",{line:0,ch:0});else{var l=s(e,i);e.replaceRange("\n"+l+"PREFIX "+t,{line:i})}},n=function(e,t){var r=function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")};for(var i in t)e.setValue(e.getValue().replace(new RegExp("PREFIX\\s*"+i+"\\s*"+r(t[i])+"\\s*","ig"),""))},o=function(e){for(var t={},r=!0,i=function(n,s){if(r){s||(s=1);var a=e.getNextNonWsToken(o,s);if(a)if(-1==a.state.possibleCurrent.indexOf("PREFIX")&&-1==a.state.possibleNext.indexOf("PREFIX")&&(r=!1),"PREFIX"==a.string.toUpperCase()){var l=e.getNextNonWsToken(o,a.end+1);if(l){var u=e.getNextNonWsToken(o,l.end+1);if(u){var p=u.string;0==p.indexOf("<")&&(p=p.substring(1)),">"==p.slice(-1)&&(p=p.substring(0,p.length-1)),t[l.string]=p,i(n,u.end+1)}else i(n,l.end+1)}else i(n,a.end+1)}else i(n,a.end+1)}},n=e.lineCount(),o=0;n>o&&r;o++)i(o);return t},s=function(e,t,r){void 0==r&&(r=1);var i=e.getTokenAt({line:t,ch:r});return null==i||void 0==i||"ws"!=i.type?"":i.string+s(e,t,i.end+1)};t.exports={addPrefixes:r,getPrefixesFromQuery:o,removePrefixes:n}},{}],27:[function(e,t){var r=e("jquery");t.exports={use:function(e){e.executeQuery=function(t,n){var o="function"==typeof n?n:null,s="object"==typeof n?n:{},a=t.getQueryMode();if(t.options.sparql&&(s=r.extend({},t.options.sparql,s)),s.handlers&&r.extend(!0,s.callbacks,s.handlers),s.endpoint&&0!=s.endpoint.length){var l={url:"function"==typeof s.endpoint?s.endpoint(t):s.endpoint,type:"function"==typeof s.requestMethod?s.requestMethod(t):s.requestMethod,data:[{name:a,value:t.getValue()}],headers:{Accept:i(t,s)}},u=!1;if(s.callbacks)for(var p in s.callbacks)s.callbacks[p]&&(u=!0,l[p]=s.callbacks[p]);if(u||o){if(o&&(l.complete=o),s.namedGraphs&&s.namedGraphs.length>0)for(var c="query"==a?"named-graph-uri":"using-named-graph-uri ",d=0;d<s.namedGraphs.length;d++)l.data.push({name:c,value:s.namedGraphs[d]});if(s.defaultGraphs&&s.defaultGraphs.length>0)for(var c="query"==a?"default-graph-uri":"using-graph-uri ",d=0;d<s.defaultGraphs.length;d++)l.data.push({name:c,value:s.defaultGraphs[d]});s.headers&&!r.isEmptyObject(s.headers)&&r.extend(l.headers,s.headers),s.args&&s.args.length>0&&r.merge(l.data,s.args),e.updateQueryButton(t,"busy");var h=function(){e.updateQueryButton(t)};if(l.complete){var E=l.complete;l.complete=function(e,t){E(e,t),h()}}else l.complete=h;t.xhr=r.ajax(l)}}}}};var i=function(e,t){var r=null;if(!t.acceptHeader||t.acceptHeaderGraph||t.acceptHeaderSelect||t.acceptHeaderUpdate)if("update"==e.getQueryMode())r="function"==typeof t.acceptHeader?t.acceptHeaderUpdate(e):t.acceptHeaderUpdate;else{var i=e.getQueryType();r="DESCRIBE"==i||"CONSTRUCT"==i?"function"==typeof t.acceptHeaderGraph?t.acceptHeaderGraph(e):t.acceptHeaderGraph:"function"==typeof t.acceptHeaderSelect?t.acceptHeaderSelect(e):t.acceptHeaderSelect}else r="function"==typeof t.acceptHeader?t.acceptHeader(e):t.acceptHeader;return r}},{jquery:11}],28:[function(e,t){var r=function(e,t,i){i||(i=e.getCursor()),t||(t=e.getTokenAt(i));var n=e.getTokenAt({line:i.line,ch:t.start});return null!=n.type&&"ws"!=n.type&&null!=t.type&&"ws"!=t.type?(t.start=n.start,t.string=n.string+t.string,r(e,t,{line:i.line,ch:n.start})):null!=t.type&&"ws"==t.type?(t.start=t.start+1,t.string=t.string.substring(1),t):t},i=function(e,t,r){var n=e.getTokenAt({line:t,ch:r.start});return null!=n&&"ws"==n.type&&(n=i(e,t,n)),n},n=function(e,t,r){void 0==r&&(r=1);var i=e.getTokenAt({line:t,ch:r});return null==i||void 0==i||i.end<r?null:"ws"==i.type?n(e,t,i.end+1):i};t.exports={getPreviousNonWsToken:i,getCompleteToken:r,getNextNonWsToken:n}},{}],29:[function(e,t){{var r=e("jquery");e("./utils.js")}t.exports=function(e,t,i){var n,t=r(t);t.hover(function(){"function"==typeof i&&(i=i()),n=r("<div>").addClass("yasqe_tooltip").html(i).appendTo(t),o()},function(){r(".yasqe_tooltip").remove()});var o=function(){r(e.getWrapperElement()).offset().top>=n.offset().top&&(n.css("bottom","auto"),n.css("top","26px"))}}},{"./utils.js":30,jquery:11}],30:[function(e,t){var r=e("jquery"),i=function(e,t){var r=!1;try{void 0!==e[t]&&(r=!0)}catch(i){}return r},n=function(e,t){var r=null;return t&&(r="string"==typeof t?t:t(e)),r},o=function(){function e(e){var t,i,n;return t=r(e).offset(),i=r(e).width(),n=r(e).height(),[[t.left,t.left+i],[t.top,t.top+n]]}function t(e,t){var r,i;return r=e[0]<t[0]?e:t,i=e[0]<t[0]?t:e,r[1]>i[0]||r[0]===i[0]}return function(r,i){var n=e(r),o=e(i);return t(n[0],o[0])&&t(n[1],o[1])}}();t.exports={keyExists:i,getPersistencyId:n,elementsOverlap:o}},{jquery:11}]},{},[1])(1)});
//# sourceMappingURL=yasqe.bundled.min.js.map |
ajax/libs/react-router/3.0.4/ReactRouter.min.js | cdnjs/cdnjs | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactRouter=e(require("react")):t.ReactRouter=e(t.React)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.createMemoryHistory=e.hashHistory=e.browserHistory=e.applyRouterMiddleware=e.formatPattern=e.useRouterHistory=e.match=e.routerShape=e.locationShape=e.RouterContext=e.createRoutes=e.Route=e.Redirect=e.IndexRoute=e.IndexRedirect=e.withRouter=e.IndexLink=e.Link=e.Router=void 0;var o=n(4);Object.defineProperty(e,"createRoutes",{enumerable:!0,get:function(){return o.createRoutes}});var i=n(16);Object.defineProperty(e,"locationShape",{enumerable:!0,get:function(){return i.locationShape}}),Object.defineProperty(e,"routerShape",{enumerable:!0,get:function(){return i.routerShape}});var u=n(8);Object.defineProperty(e,"formatPattern",{enumerable:!0,get:function(){return u.formatPattern}});var a=n(42),c=r(a),s=n(23),f=r(s),l=n(38),d=r(l),p=n(53),h=r(p),v=n(39),y=r(v),m=n(40),g=r(m),_=n(25),b=r(_),O=n(41),E=r(O),R=n(17),P=r(R),w=n(51),x=r(w),M=n(30),j=r(M),C=n(44),A=r(C),S=n(45),L=r(S),I=n(49),N=r(I),k=n(27),T=r(k);e.Router=c.default,e.Link=f.default,e.IndexLink=d.default,e.withRouter=h.default,e.IndexRedirect=y.default,e.IndexRoute=g.default,e.Redirect=b.default,e.Route=E.default,e.RouterContext=P.default,e.match=x.default,e.useRouterHistory=j.default,e.applyRouterMiddleware=A.default,e.browserHistory=L.default,e.hashHistory=N.default,e.createMemoryHistory=T.default},function(t,e,n){"use strict";var r=function(t,e,n,r,o,i,u,a){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,o,i,u,a],f=0;c=new Error(e.replace(/%s/g,function(){return s[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};t.exports=r},function(t,e,n){function r(t){return"object"==typeof t&&null!==t&&t.$$typeof===i}var o=n(64),i="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;t.exports=o(r)},function(t,e,n){"use strict";var r=n(7),o=n(54),i=(new r.Component).updater;t.exports=o(r.Component,r.isValidElement,i)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return null==t||d.default.isValidElement(t)}function i(t){return o(t)||Array.isArray(t)&&t.every(o)}function u(t,e){return f({},t,e)}function a(t){var e=t.type,n=u(e.defaultProps,t.props);if(n.children){var r=c(n.children,n);r.length&&(n.childRoutes=r),delete n.children}return n}function c(t,e){var n=[];return d.default.Children.forEach(t,function(t){if(d.default.isValidElement(t))if(t.type.createRouteFromReactElement){var r=t.type.createRouteFromReactElement(t,e);r&&n.push(r)}else n.push(a(t))}),n}function s(t){return i(t)?t=c(t):t&&!Array.isArray(t)&&(t=[t]),t}e.__esModule=!0;var f=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.isReactChildren=i,e.createRouteFromReactElement=a,e.createRoutesFromReactChildren=c,e.createRoutes=s;var l=n(7),d=r(l)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.createPath=e.parsePath=e.getQueryStringValueFromPath=e.stripQueryStringValueFromPath=e.addQueryStringValueToPath=void 0;var o=n(6),i=(r(o),e.addQueryStringValueToPath=function(t,e,n){var r=u(t),o=r.pathname,i=r.search,c=r.hash;return a({pathname:o,search:i+(i.indexOf("?")===-1?"?":"&")+e+"="+n,hash:c})},e.stripQueryStringValueFromPath=function(t,e){var n=u(t),r=n.pathname,o=n.search,i=n.hash;return a({pathname:r,search:o.replace(new RegExp("([?&])"+e+"=[a-zA-Z0-9]+(&?)"),function(t,e,n){return"?"===e?e:n}),hash:i})},e.getQueryStringValueFromPath=function(t,e){var n=u(t),r=n.search,o=r.match(new RegExp("[?&]"+e+"=([a-zA-Z0-9]+)"));return o&&o[1]},function(t){var e=t.match(/^(https?:)?\/\/[^\/]*/);return null==e?t:t.substring(e[0].length)}),u=e.parsePath=function(t){var e=i(t),n="",r="",o=e.indexOf("#");o!==-1&&(r=e.substring(o),e=e.substring(0,o));var u=e.indexOf("?");return u!==-1&&(n=e.substring(u),e=e.substring(0,u)),""===e&&(e="/"),{pathname:e,search:n,hash:r}},a=e.createPath=function(t){if(null==t||"string"==typeof t)return t;var e=t.basename,n=t.pathname,r=t.search,o=t.hash,i=(e||"")+n;return r&&"?"!==r&&(i+=r),o&&(i+=o),i}},function(t,e,n){"use strict";var r=function(){};t.exports=r},function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function i(t){for(var e="",n=[],r=[],i=void 0,u=0,a=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*\*|\*|\(|\)|\\\(|\\\)/g;i=a.exec(t);)i.index!==u&&(r.push(t.slice(u,i.index)),e+=o(t.slice(u,i.index))),i[1]?(e+="([^/]+)",n.push(i[1])):"**"===i[0]?(e+="(.*)",n.push("splat")):"*"===i[0]?(e+="(.*?)",n.push("splat")):"("===i[0]?e+="(?:":")"===i[0]?e+=")?":"\\("===i[0]?e+="\\(":"\\)"===i[0]&&(e+="\\)"),r.push(i[0]),u=a.lastIndex;return u!==t.length&&(r.push(t.slice(u,t.length)),e+=o(t.slice(u,t.length))),{pattern:t,regexpSource:e,paramNames:n,tokens:r}}function u(t){return p[t]||(p[t]=i(t)),p[t]}function a(t,e){"/"!==t.charAt(0)&&(t="/"+t);var n=u(t),r=n.regexpSource,o=n.paramNames,i=n.tokens;"/"!==t.charAt(t.length-1)&&(r+="/?"),"*"===i[i.length-1]&&(r+="$");var a=e.match(new RegExp("^"+r,"i"));if(null==a)return null;var c=a[0],s=e.substr(c.length);if(s){if("/"!==c.charAt(c.length-1))return null;s="/"+s}return{remainingPathname:s,paramNames:o,paramValues:a.slice(1).map(function(t){return t&&decodeURIComponent(t)})}}function c(t){return u(t).paramNames}function s(t,e){var n=a(t,e);if(!n)return null;var r=n.paramNames,o=n.paramValues,i={};return r.forEach(function(t,e){i[t]=o[e]}),i}function f(t,e){e=e||{};for(var n=u(t),r=n.tokens,o=0,i="",a=0,c=[],s=void 0,f=void 0,l=void 0,p=0,h=r.length;p<h;++p)if(s=r[p],"*"===s||"**"===s)l=Array.isArray(e.splat)?e.splat[a++]:e.splat,null!=l||o>0?void 0:(0,d.default)(!1),null!=l&&(i+=encodeURI(l));else if("("===s)c[o]="",o+=1;else if(")"===s){var v=c.pop();o-=1,o?c[o-1]+=v:i+=v}else if("\\("===s)i+="(";else if("\\)"===s)i+=")";else if(":"===s.charAt(0))if(f=s.substring(1),l=e[f],null!=l||o>0?void 0:(0,d.default)(!1),null==l){if(o){c[o-1]="";for(var y=r.indexOf(s),m=r.slice(y,r.length),g=-1,_=0;_<m.length;_++)if(")"==m[_]){g=_;break}g>0?void 0:(0,d.default)(!1),p=y+g-1}}else o?c[o-1]+=encodeURIComponent(l):i+=encodeURIComponent(l);else o?c[o-1]+=s:i+=s;return o<=0?void 0:(0,d.default)(!1),i.replace(/\/+/g,"/")}e.__esModule=!0,e.compilePattern=u,e.matchPattern=a,e.getParamNames=c,e.getParams=s,e.formatPattern=f;var l=n(1),d=r(l),p=Object.create(null)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(e.indexOf("deprecated")!==-1){if(c[e])return;c[e]=!0}e="[react-router] "+e;for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];a.default.apply(void 0,[t,e].concat(r))}function i(){c={}}e.__esModule=!0,e.default=o,e._resetWarned=i;var u=n(6),a=r(u),c={}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.locationsAreEqual=e.statesAreEqual=e.createLocation=e.createQuery=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},u=n(1),a=r(u),c=n(6),s=(r(c),n(5)),f=n(12),l=(e.createQuery=function(t){return i(Object.create(null),t)},e.createLocation=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f.POP,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r="string"==typeof t?(0,s.parsePath)(t):t,o=r.pathname||"/",i=r.search||"",u=r.hash||"",a=r.state;return{pathname:o,search:i,hash:u,state:a,action:e,key:n}},function(t){return"[object Date]"===Object.prototype.toString.call(t)}),d=e.statesAreEqual=function t(e,n){if(e===n)return!0;var r="undefined"==typeof e?"undefined":o(e),i="undefined"==typeof n?"undefined":o(n);if(r!==i)return!1;if("function"===r?(0,a.default)(!1):void 0,"object"===r){if(l(e)&&l(n)?(0,a.default)(!1):void 0,!Array.isArray(e)){var u=Object.keys(e),c=Object.keys(n);return u.length===c.length&&u.every(function(r){return t(e[r],n[r])})}return Array.isArray(n)&&e.length===n.length&&e.every(function(e,r){return t(e,n[r])})}return!1};e.locationsAreEqual=function(t,e){return t.key===e.key&&t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&d(t.state,e.state)}},function(t,e,n){"use strict";function r(t,e,n){if(t[e])return new Error("<"+n+'> should not have a "'+e+'" prop')}e.__esModule=!0,e.routes=e.route=e.components=e.component=e.history=void 0,e.falsy=r;var o=n(2),i=(e.history=(0,o.shape)({listen:o.func.isRequired,push:o.func.isRequired,replace:o.func.isRequired,go:o.func.isRequired,goBack:o.func.isRequired,goForward:o.func.isRequired}),e.component=(0,o.oneOfType)([o.func,o.string])),u=(e.components=(0,o.oneOfType)([i,o.object]),e.route=(0,o.oneOfType)([o.object,o.element]));e.routes=(0,o.oneOfType)([u,(0,o.arrayOf)(u)])},function(t,e){"use strict";e.__esModule=!0;e.PUSH="PUSH",e.REPLACE="REPLACE",e.POP="POP"},function(t,e){"use strict";e.__esModule=!0;e.addEventListener=function(t,e,n){return t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},e.removeEventListener=function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},e.supportsHistory=function(){var t=window.navigator.userAgent;return(t.indexOf("Android 2.")===-1&&t.indexOf("Android 4.0")===-1||t.indexOf("Mobile Safari")===-1||t.indexOf("Chrome")!==-1||t.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)},e.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1},e.supportsPopstateOnHashchange=function(){return window.navigator.userAgent.indexOf("Trident")===-1},e.isExtraneousPopstateEvent=function(t){return void 0===t.state&&navigator.userAgent.indexOf("CriOS")===-1}},function(t,e){"use strict";function n(t,e,n){function r(){return u=!0,a?void(s=[].concat(Array.prototype.slice.call(arguments))):void n.apply(this,arguments)}function o(){if(!u&&(c=!0,!a)){for(a=!0;!u&&i<t&&c;)c=!1,e.call(this,i++,o,r);return a=!1,u?void n.apply(this,s):void(i>=t&&c&&(u=!0,n()))}}var i=0,u=!1,a=!1,c=!1,s=void 0;o()}function r(t,e,n){function r(t,e,r){u||(e?(u=!0,n(e)):(i[t]=r,u=++a===o,u&&n(null,i)))}var o=t.length,i=[];if(0===o)return n(null,i);var u=!1,a=0;t.forEach(function(t,n){e(t,n,function(t,e){r(n,t,e)})})}e.__esModule=!0,e.loopAsync=n,e.mapAsync=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return"@@contextSubscriber/"+t}function i(t){var e,n,r=o(t),i=r+"/listeners",u=r+"/eventIndex",a=r+"/subscribe";return n={childContextTypes:(e={},e[r]=s.isRequired,e),getChildContext:function(){var t;return t={},t[r]={eventIndex:this[u],subscribe:this[a]},t},componentWillMount:function(){this[i]=[],this[u]=0},componentWillReceiveProps:function(){this[u]++},componentDidUpdate:function(){var t=this;this[i].forEach(function(e){return e(t[u])})}},n[a]=function(t){var e=this;return this[i].push(t),function(){e[i]=e[i].filter(function(e){return e!==t})}},n}function u(t){var e,n,r=o(t),i=r+"/lastRenderedEventIndex",u=r+"/handleContextUpdate",a=r+"/unsubscribe";return n={contextTypes:(e={},e[r]=s,e),getInitialState:function(){var t;return this.context[r]?(t={},t[i]=this.context[r].eventIndex,t):{}},componentDidMount:function(){this.context[r]&&(this[a]=this.context[r].subscribe(this[u]))},componentWillReceiveProps:function(){var t;this.context[r]&&this.setState((t={},t[i]=this.context[r].eventIndex,t))},componentWillUnmount:function(){this[a]&&(this[a](),this[a]=null)}},n[u]=function(t){if(t!==this.state[i]){var e;this.setState((e={},e[i]=t,e))}},n}e.__esModule=!0,e.ContextProvider=i,e.ContextSubscriber=u;var a=n(2),c=r(a),s=c.default.shape({subscribe:c.default.func.isRequired,eventIndex:c.default.number.isRequired})},function(t,e,n){"use strict";e.__esModule=!0,e.locationShape=e.routerShape=void 0;var r=n(2);e.routerShape=(0,r.shape)({push:r.func.isRequired,replace:r.func.isRequired,go:r.func.isRequired,goBack:r.func.isRequired,goForward:r.func.isRequired,setRouteLeaveHook:r.func.isRequired,isActive:r.func.isRequired}),e.locationShape=(0,r.shape)({pathname:r.string.isRequired,search:r.string.isRequired,state:r.object,action:r.string.isRequired,key:r.string})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=n(1),a=r(u),c=n(7),s=r(c),f=n(3),l=r(f),d=n(2),p=n(48),h=r(p),v=n(15),y=n(4),m=(0,l.default)({mixins:[(0,v.ContextProvider)("router")],propTypes:{router:d.object.isRequired,location:d.object.isRequired,routes:d.array.isRequired,params:d.object.isRequired,components:d.array.isRequired,createElement:d.func.isRequired},getDefaultProps:function(){return{createElement:s.default.createElement}},childContextTypes:{router:d.object.isRequired},getChildContext:function(){return{router:this.props.router}},createElement:function(t,e){return null==t?null:this.props.createElement(t,e)},render:function(){var t=this,e=this.props,n=e.location,r=e.routes,u=e.params,c=e.components,f=e.router,l=null;return c&&(l=c.reduceRight(function(e,a,c){if(null==a)return e;var s=r[c],l=(0,h.default)(s,u),d={location:n,params:u,route:s,router:f,routeParams:l,routes:r};if((0,y.isReactChildren)(e))d.children=e;else if(e)for(var p in e)Object.prototype.hasOwnProperty.call(e,p)&&(d[p]=e[p]);if("object"===("undefined"==typeof a?"undefined":i(a))){var v={};for(var m in a)Object.prototype.hasOwnProperty.call(a,m)&&(v[m]=t.createElement(a[m],o({key:m},d)));return v}return t.createElement(a,d)},l)),null===l||l===!1||s.default.isValidElement(l)?void 0:(0,a.default)(!1),l}});e.default=m},function(t,e,n){"use strict";function r(t,e,n,r,i,u,a,c){if(o(e),!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,r,i,u,a,c],l=0;s=new Error(e.replace(/%s/g,function(){return f[l++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(t){};t.exports=r},function(t,e,n){"use strict";e.__esModule=!0,e.go=e.replaceLocation=e.pushLocation=e.startListener=e.getUserConfirmation=e.getCurrentLocation=void 0;var r=n(10),o=n(13),i=n(33),u=n(5),a=n(20),c="popstate",s="hashchange",f=a.canUseDOM&&!(0,o.supportsPopstateOnHashchange)(),l=function(t){var e=t&&t.key;return(0,r.createLocation)({pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,state:e?(0,i.readState)(e):void 0},void 0,e)},d=e.getCurrentLocation=function(){var t=void 0;try{t=window.history.state||{}}catch(e){t={}}return l(t)},p=(e.getUserConfirmation=function(t,e){return e(window.confirm(t))},e.startListener=function(t){var e=function(e){(0,o.isExtraneousPopstateEvent)(e)||t(l(e.state))};(0,o.addEventListener)(window,c,e);var n=function(){return t(d())};return f&&(0,o.addEventListener)(window,s,n),function(){(0,o.removeEventListener)(window,c,e),f&&(0,o.removeEventListener)(window,s,n)}},function(t,e){var n=t.state,r=t.key;void 0!==n&&(0,i.saveState)(r,n),e({key:r},(0,u.createPath)(t))});e.pushLocation=function(t){return p(t,function(t,e){return window.history.pushState(t,null,e)})},e.replaceLocation=function(t){return p(t,function(t,e){return window.history.replaceState(t,null,e)})},e.go=function(t){t&&window.history.go(t)}},function(t,e){"use strict";e.__esModule=!0;e.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(56),i=n(5),u=n(22),a=r(u),c=n(12),s=n(10),f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.getCurrentLocation,n=t.getUserConfirmation,r=t.pushLocation,u=t.replaceLocation,f=t.go,l=t.keyLength,d=void 0,p=void 0,h=[],v=[],y=[],m=function(){return p&&p.action===c.POP?y.indexOf(p.key):d?y.indexOf(d.key):-1},g=function(t){var e=m();d=t,d.action===c.PUSH?y=[].concat(y.slice(0,e+1),[d.key]):d.action===c.REPLACE&&(y[e]=d.key),v.forEach(function(t){return t(d)})},_=function(t){return h.push(t),function(){return h=h.filter(function(e){return e!==t})}},b=function(t){return v.push(t),function(){return v=v.filter(function(e){return e!==t})}},O=function(t,e){(0,o.loopAsync)(h.length,function(e,n,r){(0,a.default)(h[e],t,function(t){return null!=t?r(t):n()})},function(t){n&&"string"==typeof t?n(t,function(t){return e(t!==!1)}):e(t!==!1)})},E=function(t){d&&(0,s.locationsAreEqual)(d,t)||p&&(0,s.locationsAreEqual)(p,t)||(p=t,O(t,function(e){if(p===t)if(p=null,e){if(t.action===c.PUSH){var n=(0,i.createPath)(d),o=(0,i.createPath)(t);o===n&&(0,s.statesAreEqual)(d.state,t.state)&&(t.action=c.REPLACE)}t.action===c.POP?g(t):t.action===c.PUSH?r(t)!==!1&&g(t):t.action===c.REPLACE&&u(t)!==!1&&g(t)}else if(d&&t.action===c.POP){var a=y.indexOf(d.key),l=y.indexOf(t.key);a!==-1&&l!==-1&&f(a-l)}}))},R=function(t){return E(C(t,c.PUSH))},P=function(t){return E(C(t,c.REPLACE))},w=function(){return f(-1)},x=function(){return f(1)},M=function(){return Math.random().toString(36).substr(2,l||6)},j=function(t){return(0,i.createPath)(t)},C=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M();return(0,s.createLocation)(t,e,n)};return{getCurrentLocation:e,listenBefore:_,listen:b,transitionTo:E,push:R,replace:P,go:f,goBack:w,goForward:x,createKey:M,createPath:i.createPath,createHref:j,createLocation:C}};e.default=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(6),i=(r(o),function(t,e,n){var r=t(e,n);t.length<2&&n(r)});e.default=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t){return 0===t.button}function u(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function a(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function c(t,e){return"function"==typeof t?t(e.location):t}e.__esModule=!0;var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},f=n(7),l=r(f),d=n(3),p=r(d),h=n(2),v=n(1),y=r(v),m=n(16),g=n(15),_=(0,p.default)({mixins:[(0,g.ContextSubscriber)("router")],contextTypes:{router:m.routerShape},propTypes:{to:(0,h.oneOfType)([h.string,h.object,h.func]),activeStyle:h.object,activeClassName:h.string,onlyActiveOnIndex:h.bool.isRequired,onClick:h.func,target:h.string},getDefaultProps:function(){return{onlyActiveOnIndex:!1,style:{}}},handleClick:function(t){if(this.props.onClick&&this.props.onClick(t),!t.defaultPrevented){var e=this.context.router;e?void 0:(0,y.default)(!1),!u(t)&&i(t)&&(this.props.target||(t.preventDefault(),e.push(c(this.props.to,e))))}},render:function(){var t=this.props,e=t.to,n=t.activeClassName,r=t.activeStyle,i=t.onlyActiveOnIndex,u=o(t,["to","activeClassName","activeStyle","onlyActiveOnIndex"]),f=this.context.router;if(f){if(!e)return l.default.createElement("a",u);var d=c(e,f);u.href=f.createHref(d),(n||null!=r&&!a(r))&&f.isActive(d,i)&&(n&&(u.className?u.className+=" "+n:u.className=n),r&&(u.style=s({},u.style,r)))}return l.default.createElement("a",s({},u,{onClick:this.handleClick}))}});e.default=_},function(t,e){"use strict";function n(t){return t&&"function"==typeof t.then}e.__esModule=!0,e.isPromise=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(3),i=r(o),u=n(2),a=n(1),c=r(a),s=n(4),f=n(8),l=n(11),d=(0,i.default)({statics:{createRouteFromReactElement:function(t){var e=(0,s.createRouteFromReactElement)(t);return e.from&&(e.path=e.from),e.onEnter=function(t,n){var r=t.location,o=t.params,i=void 0;if("/"===e.to.charAt(0))i=(0,f.formatPattern)(e.to,o);else if(e.to){var u=t.routes.indexOf(e),a=d.getRoutePattern(t.routes,u-1),c=a.replace(/\/*$/,"/")+e.to;i=(0,f.formatPattern)(c,o)}else i=r.pathname;n({pathname:i,query:e.query||r.query,state:e.state||r.state})},e},getRoutePattern:function(t,e){for(var n="",r=e;r>=0;r--){var o=t[r],i=o.path||"";if(n=i.replace(/\/*$/,"/")+n,0===i.indexOf("/"))break}return"/"+n}},propTypes:{path:u.string,from:u.string,to:u.string.isRequired,query:u.object,state:u.object,onEnter:l.falsy,children:l.falsy},render:function(){(0,c.default)(!1)}});e.default=d},function(t,e){"use strict";function n(t,e,n){var i=o({},t,{setRouteLeaveHook:e.listenBeforeLeavingRoute,isActive:e.isActive});return r(i,n)}function r(t,e){var n=e.location,r=e.params,o=e.routes;return t.location=n,t.params=r,t.routes=o,t}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.createRouterObject=n,e.assignRouterState=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){var e=(0,f.default)(t),n=function(){return e},r=(0,u.default)((0,c.default)(n))(t);return r}e.__esModule=!0,e.default=o;var i=n(35),u=r(i),a=n(34),c=r(a),s=n(61),f=r(s)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){var e=void 0;return a&&(e=(0,u.default)(t)()),e}e.__esModule=!0,e.default=o;var i=n(30),u=r(i),a=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!0;return!1}function i(t,e){function n(e,n){return e=t.createLocation(e),(0,d.default)(e,n,_.location,_.routes,_.params)}function r(t,n){b&&b.location===t?i(b,n):(0,y.default)(e,t,function(e,r){e?n(e):r?i(u({},r,{location:t}),n):n()})}function i(t,e){function n(n,o){return n||o?r(n,o):void(0,h.default)(t,function(n,r){n?e(n):e(null,null,_=u({},t,{components:r}))})}function r(t,n){t?e(t):e(null,n)}var o=(0,s.default)(_,t),i=o.leaveRoutes,a=o.changeRoutes,c=o.enterRoutes;(0,f.runLeaveHooks)(i,_),i.filter(function(t){return c.indexOf(t)===-1}).forEach(v),(0,f.runChangeHooks)(a,_,t,function(e,o){return e||o?r(e,o):void(0,f.runEnterHooks)(c,t,n)})}function a(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.__id__||e&&(t.__id__=O++)}function c(t){return t.map(function(t){return E[a(t)]}).filter(function(t){return t})}function l(t,n){(0,y.default)(e,t,function(e,r){if(null==r)return void n();b=u({},r,{location:t});for(var o=c((0,s.default)(_,b).leaveRoutes),i=void 0,a=0,f=o.length;null==i&&a<f;++a)i=o[a](t);n(i)})}function p(){if(_.routes){for(var t=c(_.routes),e=void 0,n=0,r=t.length;"string"!=typeof e&&n<r;++n)e=t[n]();return e}}function v(t){var e=a(t);e&&(delete E[e],o(E)||(R&&(R(),R=null),P&&(P(),P=null)))}function m(e,n){var r=!o(E),i=a(e,!0);return E[i]=n,r&&(R=t.listenBefore(l),t.listenBeforeUnload&&(P=t.listenBeforeUnload(p))),function(){v(e)}}function g(e){function n(n){_.location===n?e(null,_):r(n,function(n,r,o){n?e(n):r?t.replace(r):o&&e(null,o)})}var o=t.listen(n);return _.location?e(null,_):n(t.getCurrentLocation()),o}var _={},b=void 0,O=1,E=Object.create(null),R=void 0,P=void 0;return{isActive:n,match:r,listenBeforeLeavingRoute:m,listen:g}}e.__esModule=!0;var u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.default=i;var a=n(9),c=(r(a),n(46)),s=r(c),f=n(43),l=n(50),d=r(l),p=n(47),h=r(p),v=n(52),y=r(v)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return function(e){var n=(0,u.default)((0,c.default)(t))(e);return n}}e.__esModule=!0,e.default=o;var i=n(35),u=r(i),a=n(34),c=r(a)},function(t,e){"use strict";function n(t){return function(){return t}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(t){return t},t.exports=r},function(t,e,n){"use strict";var r=n(31),o=r;t.exports=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.readState=e.saveState=void 0;var o=n(6),i=(r(o),{QuotaExceededError:!0,QUOTA_EXCEEDED_ERR:!0}),u={SecurityError:!0},a="@@History/",c=function(t){return a+t};e.saveState=function(t,e){if(window.sessionStorage)try{null==e?window.sessionStorage.removeItem(c(t)):window.sessionStorage.setItem(c(t),JSON.stringify(e))}catch(t){if(u[t.name])return;if(i[t.name]&&0===window.sessionStorage.length)return;throw t}},e.readState=function(t){var e=void 0;try{e=window.sessionStorage.getItem(c(t))}catch(t){if(u[t.name])return}if(e)try{return JSON.parse(e)}catch(t){}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(22),u=r(i),a=n(5),c=function(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t(e),r=e.basename,i=function(t){return t?(r&&null==t.basename&&(0===t.pathname.toLowerCase().indexOf(r.toLowerCase())?(t.pathname=t.pathname.substring(r.length),t.basename=r,""===t.pathname&&(t.pathname="/")):t.basename=""),t):t},c=function(t){if(!r)return t;var e="string"==typeof t?(0,a.parsePath)(t):t,n=e.pathname,i="/"===r.slice(-1)?r:r+"/",u="/"===n.charAt(0)?n.slice(1):n,c=i+u;return o({},e,{pathname:c})},s=function(){return i(n.getCurrentLocation())},f=function(t){return n.listenBefore(function(e,n){return(0,u.default)(t,i(e),n)})},l=function(t){return n.listen(function(e){return t(i(e))})},d=function(t){return n.push(c(t))},p=function(t){return n.replace(c(t))},h=function(t){return n.createPath(c(t))},v=function(t){return n.createHref(c(t))},y=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];return i(n.createLocation.apply(n,[c(t)].concat(r)))};return o({},n,{getCurrentLocation:s,listenBefore:f,listen:l,push:d,replace:p,createPath:h,createHref:v,createLocation:y})}};e.default=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(65),u=n(22),a=r(u),c=n(10),s=n(5),f=function(t){return(0,i.stringify)(t).replace(/%20/g,"+")},l=i.parse,d=function(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t(e),r=e.stringifyQuery,i=e.parseQueryString;"function"!=typeof r&&(r=f),"function"!=typeof i&&(i=l);var u=function(t){return t?(null==t.query&&(t.query=i(t.search.substring(1))),t):t},d=function(t,e){if(null==e)return t;var n="string"==typeof t?(0,s.parsePath)(t):t,i=r(e),u=i?"?"+i:"";return o({},n,{search:u})},p=function(){return u(n.getCurrentLocation())},h=function(t){return n.listenBefore(function(e,n){return(0,a.default)(t,u(e),n)})},v=function(t){return n.listen(function(e){return t(u(e))})},y=function(t){return n.push(d(t,t.query))},m=function(t){return n.replace(d(t,t.query))},g=function(t){return n.createPath(d(t,t.query))},_=function(t){return n.createHref(d(t,t.query))},b=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];var i=n.createLocation.apply(n,[d(t,t.query)].concat(r));return t.query&&(i.query=(0,c.createQuery)(t.query)),u(i)};return o({},n,{getCurrentLocation:p,listenBefore:h,listen:v,push:y,replace:m,createPath:g,createHref:_,createLocation:b})}};e.default=d},function(t,e){/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function r(){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={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(t){o[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(t){return!1}}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;t.exports=r()?Object.assign:function(t,e){for(var r,a,c=n(t),s=1;s<arguments.length;s++){r=Object(arguments[s]);for(var f in r)i.call(r,f)&&(c[f]=r[f]);if(o){a=o(r);for(var l=0;l<a.length;l++)u.call(r,a[l])&&(c[a[l]]=r[a[l]])}}return c}},function(t,e){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(7),u=r(i),a=n(3),c=r(a),s=n(23),f=r(s),l=(0,c.default)({render:function(){return u.default.createElement(f.default,o({},this.props,{onlyActiveOnIndex:!0}))}});e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(3),i=r(o),u=n(2),a=n(9),c=(r(a),n(1)),s=r(c),f=n(25),l=r(f),d=n(11),p=(0,i.default)({statics:{createRouteFromReactElement:function(t,e){e&&(e.indexRoute=l.default.createRouteFromReactElement(t))}},propTypes:{to:u.string.isRequired,query:u.object,state:u.object,onEnter:d.falsy,children:d.falsy},render:function(){(0,s.default)(!1)}});e.default=p},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(3),i=r(o),u=n(2),a=n(9),c=(r(a),n(1)),s=r(c),f=n(4),l=n(11),d=(0,i.default)({statics:{createRouteFromReactElement:function(t,e){e&&(e.indexRoute=(0,f.createRouteFromReactElement)(t))}},propTypes:{path:l.falsy,component:l.component,components:l.components,getComponent:u.func,getComponents:u.func},render:function(){(0,s.default)(!1)}});e.default=d},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(3),i=r(o),u=n(2),a=n(1),c=r(a),s=n(4),f=n(11),l=(0,i.default)({statics:{createRouteFromReactElement:s.createRouteFromReactElement},propTypes:{path:u.string,component:f.component,components:f.components,getComponent:u.func,getComponents:u.func},render:function(){(0,c.default)(!1)}});e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}e.__esModule=!0;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},u=n(1),a=r(u),c=n(7),s=r(c),f=n(3),l=r(f),d=n(2),p=n(29),h=r(p),v=n(11),y=n(17),m=r(y),g=n(4),_=n(26),b=n(9),O=(r(b),{history:d.object,children:v.routes,routes:v.routes,render:d.func,createElement:d.func,onError:d.func,onUpdate:d.func,matchContext:d.object}),E=(0,l.default)({propTypes:O,getDefaultProps:function(){return{render:function(t){return s.default.createElement(m.default,t)}}},getInitialState:function(){return{location:null,routes:null,params:null,components:null}},handleError:function(t){if(!this.props.onError)throw t;this.props.onError.call(this,t)},createRouterObject:function(t){var e=this.props.matchContext;if(e)return e.router;var n=this.props.history;return(0,_.createRouterObject)(n,this.transitionManager,t)},createTransitionManager:function(){var t=this.props.matchContext;if(t)return t.transitionManager;var e=this.props.history,n=this.props,r=n.routes,o=n.children;return e.getCurrentLocation?void 0:(0,a.default)(!1),(0,h.default)(e,(0,g.createRoutes)(r||o))},componentWillMount:function(){var t=this;this.transitionManager=this.createTransitionManager(),this.router=this.createRouterObject(this.state),this._unlisten=this.transitionManager.listen(function(e,n){e?t.handleError(e):((0,_.assignRouterState)(t.router,n),t.setState(n,t.props.onUpdate))})},componentWillReceiveProps:function(t){},componentWillUnmount:function(){this._unlisten&&this._unlisten()},render:function t(){var e=this.state,n=e.location,r=e.routes,u=e.params,a=e.components,c=this.props,s=c.createElement,t=c.render,f=o(c,["createElement","render"]);return null==n?null:(Object.keys(O).forEach(function(t){return delete f[t]}),t(i({},f,{router:this.router,location:n,routes:r,params:u,components:a,createElement:s})))}});e.default=E},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n,r){var o=t.length<n,i=function(){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];if(t.apply(e,r),o){var u=r[r.length-1];u()}};return r.add(i),i}function i(t){return t.reduce(function(t,e){return e.onEnter&&t.push(o(e.onEnter,e,3,p)),t},[])}function u(t){return t.reduce(function(t,e){return e.onChange&&t.push(o(e.onChange,e,4,h)),t},[])}function a(t,e,n){function r(t){o=t}if(!t)return void n();var o=void 0;(0,l.loopAsync)(t,function(t,n,i){e(t,r,function(t){t||o?i(t,o):n()})},n)}function c(t,e,n){p.clear();var r=i(t);return a(r.length,function(t,n,o){var i=function(){p.has(r[t])&&(o.apply(void 0,arguments),p.remove(r[t]))};r[t](e,n,i)},n)}function s(t,e,n,r){h.clear();var o=u(t);return a(o.length,function(t,r,i){var u=function(){h.has(o[t])&&(i.apply(void 0,arguments),h.remove(o[t]))};o[t](e,n,r,u)},r)}function f(t,e){for(var n=0,r=t.length;n<r;++n)t[n].onLeave&&t[n].onLeave.call(t[n],e)}e.__esModule=!0,e.runEnterHooks=c,e.runChangeHooks=s,e.runLeaveHooks=f;var l=n(14),d=function t(){var e=this;r(this,t),this.hooks=[],this.add=function(t){return e.hooks.push(t)},this.remove=function(t){return e.hooks=e.hooks.filter(function(e){return e!==t})},this.has=function(t){return e.hooks.indexOf(t)!==-1},this.clear=function(){return e.hooks=[]}},p=new d,h=new d},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(7),u=r(i),a=n(17),c=r(a),s=n(9);r(s);e.default=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e.map(function(t){return t.renderRouterContext}).filter(Boolean),a=e.map(function(t){return t.renderRouteComponent}).filter(Boolean),s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.createElement;return function(e,n){return a.reduceRight(function(t,e){return e(t,n)},t(e,n))}};return function(t){return r.reduceRight(function(e,n){return n(e,t)},u.default.createElement(c.default,o({},t,{createElement:s(t.createElement)})))}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(59),i=r(o),u=n(28),a=r(u);e.default=(0,a.default)(i.default)},function(t,e,n){"use strict";function r(t,e,n){if(!t.path)return!1;var r=(0,i.getParamNames)(t.path);return r.some(function(t){return e.params[t]!==n.params[t]})}function o(t,e){var n=t&&t.routes,o=e.routes,i=void 0,u=void 0,a=void 0;if(n){var c=!1;i=n.filter(function(n){if(c)return!0;var i=o.indexOf(n)===-1||r(n,t,e);return i&&(c=!0),i}),i.reverse(),a=[],u=[],o.forEach(function(t){var e=n.indexOf(t)===-1,r=i.indexOf(t)!==-1;e||r?a.push(t):u.push(t)})}else i=[],u=[],a=o;return{leaveRoutes:i,changeRoutes:u,enterRoutes:a}}e.__esModule=!0;var i=n(8);e.default=o},function(t,e,n){"use strict";function r(t,e,n){if(e.component||e.components)return void n(null,e.component||e.components);var r=e.getComponent||e.getComponents;if(r){var o=r.call(e,t,n);(0,u.isPromise)(o)&&o.then(function(t){return n(null,t)},n)}else n()}function o(t,e){(0,i.mapAsync)(t.routes,function(e,n,o){r(t,e,o)},e)}e.__esModule=!0;var i=n(14),u=n(24);e.default=o},function(t,e,n){"use strict";function r(t,e){var n={};return t.path?((0,o.getParamNames)(t.path).forEach(function(t){Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}),n):n}e.__esModule=!0;var o=n(8);e.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(60),i=r(o),u=n(28),a=r(u);e.default=(0,a.default)(i.default)},function(t,e,n){"use strict";function r(t,e){if(t==e)return!0;if(null==t||null==e)return!1;if(Array.isArray(t))return Array.isArray(e)&&t.length===e.length&&t.every(function(t,n){return r(t,e[n])});if("object"===("undefined"==typeof t?"undefined":c(t))){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))if(void 0===t[n]){if(void 0!==e[n])return!1}else{if(!Object.prototype.hasOwnProperty.call(e,n))return!1;if(!r(t[n],e[n]))return!1}return!0}return String(t)===String(e)}function o(t,e){return"/"!==e.charAt(0)&&(e="/"+e),"/"!==t.charAt(t.length-1)&&(t+="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e===t}function i(t,e,n){for(var r=t,o=[],i=[],u=0,a=e.length;u<a;++u){var c=e[u],f=c.path||"";if("/"===f.charAt(0)&&(r=t,o=[],i=[]),null!==r&&f){var l=(0,s.matchPattern)(f,r);if(l?(r=l.remainingPathname,o=[].concat(o,l.paramNames),i=[].concat(i,l.paramValues)):r=null,""===r)return o.every(function(t,e){return String(i[e])===String(n[t])})}}return!1}function u(t,e){return null==e?null==t:null==t||r(t,e)}function a(t,e,n,r,a){var c=t.pathname,s=t.query;return null!=n&&("/"!==c.charAt(0)&&(c="/"+c),!!(o(c,n.pathname)||!e&&i(c,r,a))&&u(s,n.query))}e.__esModule=!0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.default=a;var s=n(8)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){var n=t.history,r=t.routes,i=t.location,c=o(t,["history","routes","location"]);n||i?void 0:(0,s.default)(!1),n=n?n:(0,l.default)(c);var f=(0,p.default)(n,(0,h.createRoutes)(r));i=i?n.createLocation(i):n.getCurrentLocation(),f.match(i,function(t,r,o){var i=void 0;if(o){var c=(0,v.createRouterObject)(n,f,o);i=u({},o,{router:c,matchContext:{transitionManager:f,router:c}})}e(t,r&&n.createLocation(r,a.REPLACE),i)})}e.__esModule=!0;var u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},a=n(12),c=n(1),s=r(c),f=n(27),l=r(f),d=n(29),p=r(d),h=n(4),v=n(26);e.default=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n,r,o){if(t.childRoutes)return[null,t.childRoutes];if(!t.getChildRoutes)return[];var i=!0,u=void 0,c={location:e,params:a(n,r)},s=t.getChildRoutes(c,function(t,e){return e=!t&&(0,v.createRoutes)(e),i?void(u=[t,e]):void o(t,e)});return(0,d.isPromise)(s)&&s.then(function(t){return o(null,(0,v.createRoutes)(t))},o),i=!1,u}function i(t,e,n,r,u){if(t.indexRoute)u(null,t.indexRoute);else if(t.getIndexRoute){var c={location:e,params:a(n,r)},s=t.getIndexRoute(c,function(t,e){u(t,!t&&(0,v.createRoutes)(e)[0])});(0,d.isPromise)(s)&&s.then(function(t){return u(null,(0,v.createRoutes)(t)[0])},u)}else if(t.childRoutes||t.getChildRoutes){var f=function(t,o){if(t)return void u(t);var a=o.filter(function(t){return!t.path});(0,l.loopAsync)(a.length,function(t,o,u){i(a[t],e,n,r,function(e,n){if(e||n){var r=[a[t]].concat(Array.isArray(n)?n:[n]);u(e,r)}else o()})},function(t,e){u(null,e)})},p=o(t,e,n,r,f);p&&f.apply(void 0,p)}else u()}function u(t,e,n){return e.reduce(function(t,e,r){var o=n&&n[r];return Array.isArray(t[e])?t[e].push(o):e in t?t[e]=[t[e],o]:t[e]=o,t},t)}function a(t,e){return u({},t,e)}function c(t,e,n,r,u,c){var f=t.path||"";if("/"===f.charAt(0)&&(n=e.pathname,r=[],u=[]),null!==n&&f){try{var l=(0,p.matchPattern)(f,n);l?(n=l.remainingPathname,r=[].concat(r,l.paramNames),u=[].concat(u,l.paramValues)):n=null}catch(t){c(t)}if(""===n){var d={routes:[t],params:a(r,u)};return void i(t,e,r,u,function(t,e){if(t)c(t);else{if(Array.isArray(e)){var n;(n=d.routes).push.apply(n,e)}else e&&d.routes.push(e);c(null,d)}})}}if(null!=n||t.childRoutes){var h=function(o,i){o?c(o):i?s(i,e,function(e,n){e?c(e):n?(n.routes.unshift(t),c(null,n)):c()},n,r,u):c()},v=o(t,e,r,u,h);v&&h.apply(void 0,v)}else c()}function s(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];void 0===r&&("/"!==e.pathname.charAt(0)&&(e=f({},e,{pathname:"/"+e.pathname})),r=e.pathname),(0,l.loopAsync)(t.length,function(n,u,a){c(t[n],e,r,o,i,function(t,e){t||e?a(t,e):u()})},n)}e.__esModule=!0;var f=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.default=s;var l=n(14),d=n(24),p=n(8),h=n(9),v=(r(h),n(4))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return t.displayName||t.name||"Component"}function i(t,e){var n=e&&e.withRef,r=(0,d.default)({mixins:[(0,v.ContextSubscriber)("router")],contextTypes:{router:y.routerShape},propTypes:{router:y.routerShape},getWrappedInstance:function(){return n?void 0:(0,c.default)(!1),this.wrappedInstance},render:function(){var e=this,r=this.props.router||this.context.router;if(!r)return f.default.createElement(t,this.props);var o=r.params,i=r.location,a=r.routes,c=u({},this.props,{router:r,params:o,location:i,routes:a});return n&&(c.ref=function(t){e.wrappedInstance=t}),f.default.createElement(t,c)}});return r.displayName="withRouter("+o(t)+")",r.WrappedComponent=t,(0,h.default)(r,t)}e.__esModule=!0;var u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.default=i;var a=n(1),c=r(a),s=n(7),f=r(s),l=n(3),d=r(l),p=n(62),h=r(p),v=n(15),y=n(16)},function(t,e,n){"use strict";function r(t){return t}function o(t,e,n){function o(t,e){var n=g.hasOwnProperty(e)?g[e]:null;O.hasOwnProperty(e)&&c("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",e),t&&c("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",e)}function i(t,n){if(n){c("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),c(!e(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=t.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(s)&&_.mixins(t,n.mixins);for(var u in n)if(n.hasOwnProperty(u)&&u!==s){var a=n[u],f=r.hasOwnProperty(u);if(o(f,u),_.hasOwnProperty(u))_[u](t,a);else{var l=g.hasOwnProperty(u),h="function"==typeof a,v=h&&!l&&!f&&n.autobind!==!1;if(v)i.push(u,a),r[u]=a;else if(f){var y=g[u];c(l&&("DEFINE_MANY_MERGED"===y||"DEFINE_MANY"===y),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",y,u),"DEFINE_MANY_MERGED"===y?r[u]=d(r[u],a):"DEFINE_MANY"===y&&(r[u]=p(r[u],a))}else r[u]=a}}}else;}function f(t,e){if(e)for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){var o=n in _;c(!o,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in t;c(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),t[n]=r}}}function l(t,e){c(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in e)e.hasOwnProperty(n)&&(c(void 0===t[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),t[n]=e[n]);return t}function d(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return l(o,n),l(o,r),o}}function p(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function h(t,e){var n=e.bind(t);return n}function v(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];t[r]=h(t,o)}}function y(t){var e=r(function(t,r,o){this.__reactAutoBindPairs.length&&v(this),this.props=t,this.context=r,this.refs=a,this.updater=o||n,this.state=null;var i=this.getInitialState?this.getInitialState():null;c("object"==typeof i&&!Array.isArray(i),"%s.getInitialState(): must return an object or null",e.displayName||"ReactCompositeComponent"),this.state=i});e.prototype=new E,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],m.forEach(i.bind(null,e)),i(e,b),i(e,t),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),c(e.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var o in g)e.prototype[o]||(e.prototype[o]=null);return e}var m=[],g={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},_={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)i(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=u({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=u({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=d(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=u({},t.propTypes,e)},statics:function(t,e){f(t,e)},autobind:function(){}},b={componentDidMount:function(){this.__isMounted=!0},componentWillUnmount:function(){this.__isMounted=!1}},O={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e)},isMounted:function(){return!!this.__isMounted}},E=function(){};return u(E.prototype,t.prototype,O),y}var i,u=n(36),a=n(55),c=n(18),s="mixins";i={},t.exports=o},function(t,e,n){"use strict";var r={};t.exports=r},function(t,e){"use strict";e.__esModule=!0;e.loopAsync=function(t,e,n){var r=0,o=!1,i=!1,u=!1,a=void 0,c=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return o=!0,i?void(a=e):void n.apply(void 0,e)},s=function s(){if(!o&&(u=!0,!i)){for(i=!0;!o&&r<t&&u;)u=!1,e(r++,s,c);return i=!1,o?void n.apply(void 0,a):void(r>=t&&u&&(o=!0,n()))}};s()}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.replaceLocation=e.pushLocation=e.startListener=e.getCurrentLocation=e.go=e.getUserConfirmation=void 0;var o=n(19);Object.defineProperty(e,"getUserConfirmation",{enumerable:!0,get:function(){return o.getUserConfirmation}}),Object.defineProperty(e,"go",{enumerable:!0,get:function(){return o.go}});var i=n(6),u=(r(i),n(10)),a=n(13),c=n(33),s=n(5),f="hashchange",l=function(){var t=window.location.href,e=t.indexOf("#");return e===-1?"":t.substring(e+1)},d=function(t){return window.location.hash=t},p=function(t){var e=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,e>=0?e:0)+"#"+t)},h=e.getCurrentLocation=function(t,e){var n=t.decodePath(l()),r=(0,s.getQueryStringValueFromPath)(n,e),o=void 0;r&&(n=(0,s.stripQueryStringValueFromPath)(n,e),o=(0,c.readState)(r));var i=(0,s.parsePath)(n);return i.state=o,(0,u.createLocation)(i,void 0,r)},v=void 0,y=(e.startListener=function(t,e,n){var r=function(){var r=l(),o=e.encodePath(r);if(r!==o)p(o);else{var i=h(e,n);if(v&&i.key&&v.key===i.key)return;v=i,t(i)}},o=l(),i=e.encodePath(o);return o!==i&&p(i),(0,a.addEventListener)(window,f,r),function(){return(0,a.removeEventListener)(window,f,r)}},function(t,e,n,r){var o=t.state,i=t.key,u=e.encodePath((0,s.createPath)(t));void 0!==o&&(u=(0,s.addQueryStringValueToPath)(u,n,i),(0,c.saveState)(i,o)),v=t,r(u)});e.pushLocation=function(t,e,n){return y(t,e,n,function(t){l()!==t&&d(t)})},e.replaceLocation=function(t,e,n){return y(t,e,n,function(t){l()!==t&&p(t)})}},function(t,e,n){"use strict";e.__esModule=!0,e.replaceLocation=e.pushLocation=e.getCurrentLocation=e.go=e.getUserConfirmation=void 0;var r=n(19);Object.defineProperty(e,"getUserConfirmation",{enumerable:!0,get:function(){return r.getUserConfirmation}}),Object.defineProperty(e,"go",{enumerable:!0,get:function(){return r.go}});var o=n(10),i=n(5);e.getCurrentLocation=function(){return(0,o.createLocation)(window.location)},e.pushLocation=function(t){return window.location.href=(0,i.createPath)(t),!1},e.replaceLocation=function(t){return window.location.replace((0,i.createPath)(t)),!1}},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},u=n(1),a=o(u),c=n(20),s=n(19),f=r(s),l=n(58),d=r(l),p=n(13),h=n(21),v=o(h),y=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c.canUseDOM?void 0:(0,a.default)(!1);var e=t.forceRefresh||!(0,p.supportsHistory)(),n=e?d:f,r=n.getUserConfirmation,o=n.getCurrentLocation,u=n.pushLocation,s=n.replaceLocation,l=n.go,h=(0,v.default)(i({getUserConfirmation:r},t,{getCurrentLocation:o,pushLocation:u,replaceLocation:s,go:l})),y=0,m=void 0,g=function(t,e){1===++y&&(m=f.startListener(h.transitionTo));var n=e?h.listenBefore(t):h.listen(t);return function(){n(),0===--y&&m()}},_=function(t){return g(t,!0)},b=function(t){return g(t,!1)};return i({},h,{listenBefore:_,listen:b})};e.default=y},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},u=n(6),a=(o(u),n(1)),c=o(a),s=n(20),f=n(13),l=n(57),d=r(l),p=n(21),h=o(p),v="_k",y=function(t){return"/"===t.charAt(0)?t:"/"+t},m={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!"+t},decodePath:function(t){return"!"===t.charAt(0)?t.substring(1):t}},noslash:{encodePath:function(t){return"/"===t.charAt(0)?t.substring(1):t},decodePath:y},slash:{encodePath:y,decodePath:y}},g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s.canUseDOM?void 0:(0,c.default)(!1);var e=t.queryKey,n=t.hashType;"string"!=typeof e&&(e=v),null==n&&(n="slash"),n in m||(n="slash");var r=m[n],o=d.getUserConfirmation,u=function(){return d.getCurrentLocation(r,e)},a=function(t){return d.pushLocation(t,r,e)},l=function(t){return d.replaceLocation(t,r,e)},p=(0,h.default)(i({getUserConfirmation:o},t,{getCurrentLocation:u,pushLocation:a,replaceLocation:l,go:d.go})),y=0,g=void 0,_=function(t,n){1===++y&&(g=d.startListener(p.transitionTo,r,e));var o=n?p.listenBefore(t):p.listen(t);return function(){o(),0===--y&&g()}},b=function(t){return _(t,!0)},O=function(t){return _(t,!1)},E=((0,f.supportsGoWithoutReloadUsingHash)(),function(t){p.go(t)}),R=function(t){return"#"+r.encodePath(p.createHref(t))};return i({},p,{listenBefore:b,listen:O,go:E,createHref:R})};e.default=g},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(6),u=(r(i),n(1)),a=r(u),c=n(10),s=n(5),f=n(21),l=r(f),d=n(12),p=function(t){return t.filter(function(t){return t.state}).reduce(function(t,e){return t[e.key]=e.state,t},{})},h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(t)?t={entries:t}:"string"==typeof t&&(t={entries:[t]});var e=function(){var t=v[y],e=(0,s.createPath)(t),n=void 0,r=void 0;t.key&&(n=t.key,r=_(n));var i=(0,s.parsePath)(e);return(0,c.createLocation)(o({},i,{state:r}),void 0,n)},n=function(t){var e=y+t;return e>=0&&e<v.length},r=function(t){if(t&&n(t)){y+=t;var r=e();f.transitionTo(o({},r,{action:d.POP}))}},i=function(t){y+=1,y<v.length&&v.splice(y),v.push(t),g(t.key,t.state)},u=function(t){v[y]=t,g(t.key,t.state)},f=(0,l.default)(o({},t,{getCurrentLocation:e,pushLocation:i,replaceLocation:u,go:r})),h=t,v=h.entries,y=h.current;"string"==typeof v?v=[v]:Array.isArray(v)||(v=["/"]),v=v.map(function(t){return(0,c.createLocation)(t)}),null==y?y=v.length-1:y>=0&&y<v.length?void 0:(0,a.default)(!1);var m=p(v),g=function(t,e){return m[t]=e},_=function(t){return m[t]};return o({},f,{canGo:n})};e.default=h},function(t,e){"use strict";var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},o="function"==typeof Object.getOwnPropertySymbols;t.exports=function(t,e,i){if("string"!=typeof e){var u=Object.getOwnPropertyNames(e);o&&(u=u.concat(Object.getOwnPropertySymbols(e)));for(var a=0;a<u.length;++a)if(!(n[u[a]]||r[u[a]]||i&&i[u[a]]))try{t[u[a]]=e[u[a]]}catch(t){}}return t}},function(t,e,n){"use strict";function r(t,e,n,r,o){}n(18),n(32),n(37);t.exports=r},function(t,e,n){"use strict";var r=(n(31),n(18)),o=(n(32),n(37),n(63));t.exports=function(t){function e(t){this.message=t,this.stack=""}var n,i=("function"==typeof Symbol&&Symbol.iterator,function(){r(!1,"React.PropTypes type checking code is stripped in production.")});i.isRequired=i;var u=function(){return i};return n={array:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:u,element:i,instanceOf:u,node:i,objectOf:u,oneOf:u,oneOfType:u,shape:u},e.prototype=Error.prototype,n.checkPropTypes=o,n.PropTypes=n,n}},function(t,e,n){"use strict";function r(t){switch(t.arrayFormat){case"index":return function(e,n,r){return null===n?[i(e,t),"[",r,"]"].join(""):[i(e,t),"[",i(r,t),"]=",i(n,t)].join("")};case"bracket":return function(e,n){return null===n?i(e,t):[i(e,t),"[]=",i(n,t)].join("")};default:return function(e,n){return null===n?i(e,t):[i(e,t),"=",i(n,t)].join("")}}}function o(t){var e;switch(t.arrayFormat){case"index":return function(t,n,r){return e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===r[t]&&(r[t]={}),void(r[t][e[1]]=n)):void(r[t]=n)};case"bracket":return function(t,n,r){return e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e&&void 0!==r[t]?void(r[t]=[].concat(r[t],n)):void(r[t]=n)};default:return function(t,e,n){return void 0===n[t]?void(n[t]=e):void(n[t]=[].concat(n[t],e))}}}function i(t,e){return e.encode?e.strict?a(t):encodeURIComponent(t):t}function u(t){return Array.isArray(t)?t.sort():"object"==typeof t?u(Object.keys(t)).sort(function(t,e){return Number(t)-Number(e)}).map(function(e){return t[e]}):t}var a=n(66),c=n(36);e.extract=function(t){return t.split("?")[1]||""},e.parse=function(t,e){e=c({arrayFormat:"none"},e);var n=o(e),r=Object.create(null);return"string"!=typeof t?r:(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(function(t){var e=t.replace(/\+/g," ").split("="),o=e.shift(),i=e.length>0?e.join("="):void 0;i=void 0===i?null:decodeURIComponent(i),n(decodeURIComponent(o),i,r)}),Object.keys(r).sort().reduce(function(t,e){var n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=u(n):t[e]=n,t},Object.create(null))):r},e.stringify=function(t,e){var n={encode:!0,strict:!0,arrayFormat:"none"};e=c(n,e);var o=r(e);return t?Object.keys(t).sort().map(function(n){var r=t[n];if(void 0===r)return"";if(null===r)return i(n,e);if(Array.isArray(r)){var u=[];return r.slice().forEach(function(t){void 0!==t&&u.push(o(n,t,u.length))}),u.join("&")}return i(n,e)+"="+i(r,e)}).filter(function(t){return t.length>0}).join("&"):""}},function(t,e){"use strict";t.exports=function(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}}])}); |
src/svg-icons/editor/text-fields.js | ngbrown/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let EditorTextFields = (props) => (
<SvgIcon {...props}>
<path d="M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"/>
</SvgIcon>
);
EditorTextFields = pure(EditorTextFields);
EditorTextFields.displayName = 'EditorTextFields';
EditorTextFields.muiName = 'SvgIcon';
export default EditorTextFields;
|
lib/yuilib/2in3/2.9.0/build/yui2-yuiloader/yui2-yuiloader-debug.js | dwaynetin/garage | YUI.add('yui2-yahoo', function(Y) { Y.use('yui2-yuiloader'); }, '3.3.0' ,{});
YUI.add('yui2-get', function(Y) { Y.use('yui2-yuiloader'); }, '3.3.0' ,{"requires": ["yui2-yahoo"]});
YUI.add('yui2-yuiloader', function(Y) {
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
/**
* The YAHOO object is the single global object used by YUI Library. It
* contains utility function for setting up namespaces, inheritance, and
* logging. YAHOO.util, YAHOO.widget, and YAHOO.example are namespaces
* created automatically for and used by the library.
* @module yahoo
* @title YAHOO Global
*/
/**
* YAHOO_config is not included as part of the library. Instead it is an
* object that can be defined by the implementer immediately before
* including the YUI library. The properties included in this object
* will be used to configure global properties needed as soon as the
* library begins to load.
* @class YAHOO_config
* @static
*/
/**
* A reference to a function that will be executed every time a YAHOO module
* is loaded. As parameter, this function will receive the version
* information for the module. See <a href="YAHOO.env.html#getVersion">
* YAHOO.env.getVersion</a> for the description of the version data structure.
* @property listener
* @type Function
* @static
* @default undefined
*/
/**
* Set to true if the library will be dynamically loaded after window.onload.
* Defaults to false
* @property injecting
* @type boolean
* @static
* @default undefined
*/
/**
* Instructs the yuiloader component to dynamically load yui components and
* their dependencies. See the yuiloader documentation for more information
* about dynamic loading
* @property load
* @static
* @default undefined
* @see yuiloader
*/
/**
* Forces the use of the supplied locale where applicable in the library
* @property locale
* @type string
* @static
* @default undefined
*/
if (typeof YAHOO == "undefined" || !YAHOO) {
/**
* The YAHOO global namespace object. If YAHOO is already defined, the
* existing YAHOO object will not be overwritten so that defined
* namespaces are preserved.
* @class YAHOO
* @static
*/
var YAHOO = {};
}
/**
* Returns the namespace specified and creates it if it doesn't exist
* <pre>
* YAHOO.namespace("property.package");
* YAHOO.namespace("YAHOO.property.package");
* </pre>
* Either of the above would create YAHOO.property, then
* YAHOO.property.package
*
* Be careful when naming packages. Reserved words may work in some browsers
* and not others. For instance, the following will fail in Safari:
* <pre>
* YAHOO.namespace("really.long.nested.namespace");
* </pre>
* This fails because "long" is a future reserved word in ECMAScript
*
* For implementation code that uses YUI, do not create your components
* in the namespaces defined by YUI (
* <code>YAHOO.util</code>,
* <code>YAHOO.widget</code>,
* <code>YAHOO.lang</code>,
* <code>YAHOO.tool</code>,
* <code>YAHOO.example</code>,
* <code>YAHOO.env</code>) -- create your own namespace (e.g., 'companyname').
*
* @method namespace
* @static
* @param {String*} arguments 1-n namespaces to create
* @return {Object} A reference to the last namespace object created
*/
YAHOO.namespace = function() {
var a=arguments, o=null, i, j, d;
for (i=0; i<a.length; i=i+1) {
d=(""+a[i]).split(".");
o=YAHOO;
// YAHOO is implied, so it is ignored if it is included
for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; j=j+1) {
o[d[j]]=o[d[j]] || {};
o=o[d[j]];
}
}
return o;
};
/**
* Uses YAHOO.widget.Logger to output a log message, if the widget is
* available.
* Note: LogReader adds the message, category, and source to the DOM as HTML.
*
* @method log
* @static
* @param {HTML} msg The message to log.
* @param {HTML} cat The log category for the message. Default
* categories are "info", "warn", "error", time".
* Custom categories can be used as well. (opt)
* @param {HTML} src The source of the the message (opt)
* @return {Boolean} True if the log operation was successful.
*/
YAHOO.log = function(msg, cat, src) {
var l=YAHOO.widget.Logger;
if(l && l.log) {
return l.log(msg, cat, src);
} else {
return false;
}
};
/**
* Registers a module with the YAHOO object
* @method register
* @static
* @param {String} name the name of the module (event, slider, etc)
* @param {Function} mainClass a reference to class in the module. This
* class will be tagged with the version info
* so that it will be possible to identify the
* version that is in use when multiple versions
* have loaded
* @param {Object} data metadata object for the module. Currently it
* is expected to contain a "version" property
* and a "build" property at minimum.
*/
YAHOO.register = function(name, mainClass, data) {
var mods = YAHOO.env.modules, m, v, b, ls, i;
if (!mods[name]) {
mods[name] = {
versions:[],
builds:[]
};
}
m = mods[name];
v = data.version;
b = data.build;
ls = YAHOO.env.listeners;
m.name = name;
m.version = v;
m.build = b;
m.versions.push(v);
m.builds.push(b);
m.mainClass = mainClass;
// fire the module load listeners
for (i=0;i<ls.length;i=i+1) {
ls[i](m);
}
// label the main class
if (mainClass) {
mainClass.VERSION = v;
mainClass.BUILD = b;
} else {
YAHOO.log("mainClass is undefined for module " + name, "warn");
}
};
/**
* YAHOO.env is used to keep track of what is known about the YUI library and
* the browsing environment
* @class YAHOO.env
* @static
*/
YAHOO.env = YAHOO.env || {
/**
* Keeps the version info for all YUI modules that have reported themselves
* @property modules
* @type Object[]
*/
modules: [],
/**
* List of functions that should be executed every time a YUI module
* reports itself.
* @property listeners
* @type Function[]
*/
listeners: []
};
/**
* Returns the version data for the specified module:
* <dl>
* <dt>name:</dt> <dd>The name of the module</dd>
* <dt>version:</dt> <dd>The version in use</dd>
* <dt>build:</dt> <dd>The build number in use</dd>
* <dt>versions:</dt> <dd>All versions that were registered</dd>
* <dt>builds:</dt> <dd>All builds that were registered.</dd>
* <dt>mainClass:</dt> <dd>An object that was was stamped with the
* current version and build. If
* mainClass.VERSION != version or mainClass.BUILD != build,
* multiple versions of pieces of the library have been
* loaded, potentially causing issues.</dd>
* </dl>
*
* @method getVersion
* @static
* @param {String} name the name of the module (event, slider, etc)
* @return {Object} The version info
*/
YAHOO.env.getVersion = function(name) {
return YAHOO.env.modules[name] || null;
};
/**
* Do not fork for a browser if it can be avoided. Use feature detection when
* you can. Use the user agent as a last resort. YAHOO.env.ua stores a version
* number for the browser engine, 0 otherwise. This value may or may not map
* to the version number of the browser using the engine. The value is
* presented as a float so that it can easily be used for boolean evaluation
* as well as for looking for a particular range of versions. Because of this,
* some of the granularity of the version info may be lost (e.g., Gecko 1.8.0.9
* reports 1.8).
* @class YAHOO.env.ua
* @static
*/
/**
* parses a user agent string (or looks for one in navigator to parse if
* not supplied).
* @method parseUA
* @since 2.9.0
* @static
*/
YAHOO.env.parseUA = function(agent) {
var numberify = function(s) {
var c = 0;
return parseFloat(s.replace(/\./g, function() {
return (c++ == 1) ? '' : '.';
}));
},
nav = navigator,
o = {
/**
* Internet Explorer version number or 0. Example: 6
* @property ie
* @type float
* @static
*/
ie: 0,
/**
* Opera version number or 0. Example: 9.2
* @property opera
* @type float
* @static
*/
opera: 0,
/**
* Gecko engine revision number. Will evaluate to 1 if Gecko
* is detected but the revision could not be found. Other browsers
* will be 0. Example: 1.8
* <pre>
* Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7
* Firefox 1.5.0.9: 1.8.0.9 <-- 1.8
* Firefox 2.0.0.3: 1.8.1.3 <-- 1.81
* Firefox 3.0 <-- 1.9
* Firefox 3.5 <-- 1.91
* </pre>
* @property gecko
* @type float
* @static
*/
gecko: 0,
/**
* AppleWebKit version. KHTML browsers that are not WebKit browsers
* will evaluate to 1, other browsers 0. Example: 418.9
* <pre>
* Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the
* latest available for Mac OSX 10.3.
* Safari 2.0.2: 416 <-- hasOwnProperty introduced
* Safari 2.0.4: 418 <-- preventDefault fixed
* Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
* different versions of webkit
* Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been
* updated, but not updated
* to the latest patch.
* Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native
* SVG and many major issues fixed).
* Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic
* update from 2.x via the 10.4.11 OS patch.
* Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event.
* yahoo.com user agent hack removed.
* </pre>
* http://en.wikipedia.org/wiki/Safari_version_history
* @property webkit
* @type float
* @static
*/
webkit: 0,
/**
* Chrome will be detected as webkit, but this property will also
* be populated with the Chrome version number
* @property chrome
* @type float
* @static
*/
chrome: 0,
/**
* The mobile property will be set to a string containing any relevant
* user agent information when a modern mobile browser is detected.
* Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
* devices with the WebKit-based browser, and Opera Mini.
* @property mobile
* @type string
* @static
*/
mobile: null,
/**
* Adobe AIR version number or 0. Only populated if webkit is detected.
* Example: 1.0
* @property air
* @type float
*/
air: 0,
/**
* Detects Apple iPad's OS version
* @property ipad
* @type float
* @static
*/
ipad: 0,
/**
* Detects Apple iPhone's OS version
* @property iphone
* @type float
* @static
*/
iphone: 0,
/**
* Detects Apples iPod's OS version
* @property ipod
* @type float
* @static
*/
ipod: 0,
/**
* General truthy check for iPad, iPhone or iPod
* @property ios
* @type float
* @static
*/
ios: null,
/**
* Detects Googles Android OS version
* @property android
* @type float
* @static
*/
android: 0,
/**
* Detects Palms WebOS version
* @property webos
* @type float
* @static
*/
webos: 0,
/**
* Google Caja version number or 0.
* @property caja
* @type float
*/
caja: nav && nav.cajaVersion,
/**
* Set to true if the page appears to be in SSL
* @property secure
* @type boolean
* @static
*/
secure: false,
/**
* The operating system. Currently only detecting windows or macintosh
* @property os
* @type string
* @static
*/
os: null
},
ua = agent || (navigator && navigator.userAgent),
loc = window && window.location,
href = loc && loc.href,
m;
o.secure = href && (href.toLowerCase().indexOf("https") === 0);
if (ua) {
if ((/windows|win32/i).test(ua)) {
o.os = 'windows';
} else if ((/macintosh/i).test(ua)) {
o.os = 'macintosh';
} else if ((/rhino/i).test(ua)) {
o.os = 'rhino';
}
// Modern KHTML browsers should qualify as Safari X-Grade
if ((/KHTML/).test(ua)) {
o.webkit = 1;
}
// Modern WebKit browsers are at least X-Grade
m = ua.match(/AppleWebKit\/([^\s]*)/);
if (m && m[1]) {
o.webkit = numberify(m[1]);
// Mobile browser check
if (/ Mobile\//.test(ua)) {
o.mobile = 'Apple'; // iPhone or iPod Touch
m = ua.match(/OS ([^\s]*)/);
if (m && m[1]) {
m = numberify(m[1].replace('_', '.'));
}
o.ios = m;
o.ipad = o.ipod = o.iphone = 0;
m = ua.match(/iPad|iPod|iPhone/);
if (m && m[0]) {
o[m[0].toLowerCase()] = o.ios;
}
} else {
m = ua.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);
if (m) {
// Nokia N-series, Android, webOS, ex: NokiaN95
o.mobile = m[0];
}
if (/webOS/.test(ua)) {
o.mobile = 'WebOS';
m = ua.match(/webOS\/([^\s]*);/);
if (m && m[1]) {
o.webos = numberify(m[1]);
}
}
if (/ Android/.test(ua)) {
o.mobile = 'Android';
m = ua.match(/Android ([^\s]*);/);
if (m && m[1]) {
o.android = numberify(m[1]);
}
}
}
m = ua.match(/Chrome\/([^\s]*)/);
if (m && m[1]) {
o.chrome = numberify(m[1]); // Chrome
} else {
m = ua.match(/AdobeAIR\/([^\s]*)/);
if (m) {
o.air = m[0]; // Adobe AIR 1.0 or better
}
}
}
if (!o.webkit) { // not webkit
// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
m = ua.match(/Opera[\s\/]([^\s]*)/);
if (m && m[1]) {
o.opera = numberify(m[1]);
m = ua.match(/Version\/([^\s]*)/);
if (m && m[1]) {
o.opera = numberify(m[1]); // opera 10+
}
m = ua.match(/Opera Mini[^;]*/);
if (m) {
o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
}
} else { // not opera or webkit
m = ua.match(/MSIE\s([^;]*)/);
if (m && m[1]) {
o.ie = numberify(m[1]);
} else { // not opera, webkit, or ie
m = ua.match(/Gecko\/([^\s]*)/);
if (m) {
o.gecko = 1; // Gecko detected, look for revision
m = ua.match(/rv:([^\s\)]*)/);
if (m && m[1]) {
o.gecko = numberify(m[1]);
}
}
}
}
}
}
return o;
};
YAHOO.env.ua = YAHOO.env.parseUA();
/*
* Initializes the global by creating the default namespaces and applying
* any new configuration information that is detected. This is the setup
* for env.
* @method init
* @static
* @private
*/
(function() {
YAHOO.namespace("util", "widget", "example");
/*global YAHOO_config*/
if ("undefined" !== typeof YAHOO_config) {
var l=YAHOO_config.listener, ls=YAHOO.env.listeners,unique=true, i;
if (l) {
// if YAHOO is loaded multiple times we need to check to see if
// this is a new config object. If it is, add the new component
// load listener to the stack
for (i=0; i<ls.length; i++) {
if (ls[i] == l) {
unique = false;
break;
}
}
if (unique) {
ls.push(l);
}
}
}
})();
/**
* Provides the language utilites and extensions used by the library
* @class YAHOO.lang
*/
YAHOO.lang = YAHOO.lang || {};
(function() {
var L = YAHOO.lang,
OP = Object.prototype,
ARRAY_TOSTRING = '[object Array]',
FUNCTION_TOSTRING = '[object Function]',
OBJECT_TOSTRING = '[object Object]',
NOTHING = [],
HTML_CHARS = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
'/': '/',
'`': '`'
},
// ADD = ["toString", "valueOf", "hasOwnProperty"],
ADD = ["toString", "valueOf"],
OB = {
/**
* Determines wheather or not the provided object is an array.
* @method isArray
* @param {any} o The object being testing
* @return {boolean} the result
*/
isArray: function(o) {
return OP.toString.apply(o) === ARRAY_TOSTRING;
},
/**
* Determines whether or not the provided object is a boolean
* @method isBoolean
* @param {any} o The object being testing
* @return {boolean} the result
*/
isBoolean: function(o) {
return typeof o === 'boolean';
},
/**
* Determines whether or not the provided object is a function.
* Note: Internet Explorer thinks certain functions are objects:
*
* var obj = document.createElement("object");
* YAHOO.lang.isFunction(obj.getAttribute) // reports false in IE
*
* var input = document.createElement("input"); // append to body
* YAHOO.lang.isFunction(input.focus) // reports false in IE
*
* You will have to implement additional tests if these functions
* matter to you.
*
* @method isFunction
* @param {any} o The object being testing
* @return {boolean} the result
*/
isFunction: function(o) {
return (typeof o === 'function') || OP.toString.apply(o) === FUNCTION_TOSTRING;
},
/**
* Determines whether or not the provided object is null
* @method isNull
* @param {any} o The object being testing
* @return {boolean} the result
*/
isNull: function(o) {
return o === null;
},
/**
* Determines whether or not the provided object is a legal number
* @method isNumber
* @param {any} o The object being testing
* @return {boolean} the result
*/
isNumber: function(o) {
return typeof o === 'number' && isFinite(o);
},
/**
* Determines whether or not the provided object is of type object
* or function
* @method isObject
* @param {any} o The object being testing
* @return {boolean} the result
*/
isObject: function(o) {
return (o && (typeof o === 'object' || L.isFunction(o))) || false;
},
/**
* Determines whether or not the provided object is a string
* @method isString
* @param {any} o The object being testing
* @return {boolean} the result
*/
isString: function(o) {
return typeof o === 'string';
},
/**
* Determines whether or not the provided object is undefined
* @method isUndefined
* @param {any} o The object being testing
* @return {boolean} the result
*/
isUndefined: function(o) {
return typeof o === 'undefined';
},
/**
* IE will not enumerate native functions in a derived object even if the
* function was overridden. This is a workaround for specific functions
* we care about on the Object prototype.
* @property _IEEnumFix
* @param {Function} r the object to receive the augmentation
* @param {Function} s the object that supplies the properties to augment
* @static
* @private
*/
_IEEnumFix: (YAHOO.env.ua.ie) ? function(r, s) {
var i, fname, f;
for (i=0;i<ADD.length;i=i+1) {
fname = ADD[i];
f = s[fname];
if (L.isFunction(f) && f!=OP[fname]) {
r[fname]=f;
}
}
} : function(){},
/**
* <p>
* Returns a copy of the specified string with special HTML characters
* escaped. The following characters will be converted to their
* corresponding character entities:
* <code>& < > " ' / `</code>
* </p>
*
* <p>
* This implementation is based on the
* <a href="http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet">OWASP
* HTML escaping recommendations</a>. In addition to the characters
* in the OWASP recommendation, we also escape the <code>`</code>
* character, since IE interprets it as an attribute delimiter when used in
* innerHTML.
* </p>
*
* @method escapeHTML
* @param {String} html String to escape.
* @return {String} Escaped string.
* @static
* @since 2.9.0
*/
escapeHTML: function (html) {
return html.replace(/[&<>"'\/`]/g, function (match) {
return HTML_CHARS[match];
});
},
/**
* Utility to set up the prototype, constructor and superclass properties to
* support an inheritance strategy that can chain constructors and methods.
* Static members will not be inherited.
*
* @method extend
* @static
* @param {Function} subc the object to modify
* @param {Function} superc the object to inherit
* @param {Object} overrides additional properties/methods to add to the
* subclass prototype. These will override the
* matching items obtained from the superclass
* if present.
*/
extend: function(subc, superc, overrides) {
if (!superc||!subc) {
throw new Error("extend failed, please check that " +
"all dependencies are included.");
}
var F = function() {}, i;
F.prototype=superc.prototype;
subc.prototype=new F();
subc.prototype.constructor=subc;
subc.superclass=superc.prototype;
if (superc.prototype.constructor == OP.constructor) {
superc.prototype.constructor=superc;
}
if (overrides) {
for (i in overrides) {
if (L.hasOwnProperty(overrides, i)) {
subc.prototype[i]=overrides[i];
}
}
L._IEEnumFix(subc.prototype, overrides);
}
},
/**
* Applies all properties in the supplier to the receiver if the
* receiver does not have these properties yet. Optionally, one or
* more methods/properties can be specified (as additional
* parameters). This option will overwrite the property if receiver
* has it already. If true is passed as the third parameter, all
* properties will be applied and _will_ overwrite properties in
* the receiver.
*
* @method augmentObject
* @static
* @since 2.3.0
* @param {Function} r the object to receive the augmentation
* @param {Function} s the object that supplies the properties to augment
* @param {String*|boolean} arguments zero or more properties methods
* to augment the receiver with. If none specified, everything
* in the supplier will be used unless it would
* overwrite an existing property in the receiver. If true
* is specified as the third parameter, all properties will
* be applied and will overwrite an existing property in
* the receiver
*/
augmentObject: function(r, s) {
if (!s||!r) {
throw new Error("Absorb failed, verify dependencies.");
}
var a=arguments, i, p, overrideList=a[2];
if (overrideList && overrideList!==true) { // only absorb the specified properties
for (i=2; i<a.length; i=i+1) {
r[a[i]] = s[a[i]];
}
} else { // take everything, overwriting only if the third parameter is true
for (p in s) {
if (overrideList || !(p in r)) {
r[p] = s[p];
}
}
L._IEEnumFix(r, s);
}
return r;
},
/**
* Same as YAHOO.lang.augmentObject, except it only applies prototype properties
* @see YAHOO.lang.augmentObject
* @method augmentProto
* @static
* @param {Function} r the object to receive the augmentation
* @param {Function} s the object that supplies the properties to augment
* @param {String*|boolean} arguments zero or more properties methods
* to augment the receiver with. If none specified, everything
* in the supplier will be used unless it would overwrite an existing
* property in the receiver. if true is specified as the third
* parameter, all properties will be applied and will overwrite an
* existing property in the receiver
*/
augmentProto: function(r, s) {
if (!s||!r) {
throw new Error("Augment failed, verify dependencies.");
}
//var a=[].concat(arguments);
var a=[r.prototype,s.prototype], i;
for (i=2;i<arguments.length;i=i+1) {
a.push(arguments[i]);
}
L.augmentObject.apply(this, a);
return r;
},
/**
* Returns a simple string representation of the object or array.
* Other types of objects will be returned unprocessed. Arrays
* are expected to be indexed. Use object notation for
* associative arrays.
* @method dump
* @since 2.3.0
* @param o {Object} The object to dump
* @param d {int} How deep to recurse child objects, default 3
* @return {String} the dump result
*/
dump: function(o, d) {
var i,len,s=[],OBJ="{...}",FUN="f(){...}",
COMMA=', ', ARROW=' => ';
// Cast non-objects to string
// Skip dates because the std toString is what we want
// Skip HTMLElement-like objects because trying to dump
// an element will cause an unhandled exception in FF 2.x
if (!L.isObject(o)) {
return o + "";
} else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
return o;
} else if (L.isFunction(o)) {
return FUN;
}
// dig into child objects the depth specifed. Default 3
d = (L.isNumber(d)) ? d : 3;
// arrays [1, 2, 3]
if (L.isArray(o)) {
s.push("[");
for (i=0,len=o.length;i<len;i=i+1) {
if (L.isObject(o[i])) {
s.push((d > 0) ? L.dump(o[i], d-1) : OBJ);
} else {
s.push(o[i]);
}
s.push(COMMA);
}
if (s.length > 1) {
s.pop();
}
s.push("]");
// objects {k1 => v1, k2 => v2}
} else {
s.push("{");
for (i in o) {
if (L.hasOwnProperty(o, i)) {
s.push(i + ARROW);
if (L.isObject(o[i])) {
s.push((d > 0) ? L.dump(o[i], d-1) : OBJ);
} else {
s.push(o[i]);
}
s.push(COMMA);
}
}
if (s.length > 1) {
s.pop();
}
s.push("}");
}
return s.join("");
},
/**
* Does variable substitution on a string. It scans through the string
* looking for expressions enclosed in { } braces. If an expression
* is found, it is used a key on the object. If there is a space in
* the key, the first word is used for the key and the rest is provided
* to an optional function to be used to programatically determine the
* value (the extra information might be used for this decision). If
* the value for the key in the object, or what is returned from the
* function has a string value, number value, or object value, it is
* substituted for the bracket expression and it repeats. If this
* value is an object, it uses the Object's toString() if this has
* been overridden, otherwise it does a shallow dump of the key/value
* pairs.
*
* By specifying the recurse option, the string is rescanned after
* every replacement, allowing for nested template substitutions.
* The side effect of this option is that curly braces in the
* replacement content must be encoded.
*
* @method substitute
* @since 2.3.0
* @param s {String} The string that will be modified.
* @param o {Object} An object containing the replacement values
* @param f {Function} An optional function that can be used to
* process each match. It receives the key,
* value, and any extra metadata included with
* the key inside of the braces.
* @param recurse {boolean} default true - if not false, the replaced
* string will be rescanned so that nested substitutions are possible.
* @return {String} the substituted string
*/
substitute: function (s, o, f, recurse) {
var i, j, k, key, v, meta, saved=[], token, lidx=s.length,
DUMP='dump', SPACE=' ', LBRACE='{', RBRACE='}',
dump, objstr;
for (;;) {
i = s.lastIndexOf(LBRACE, lidx);
if (i < 0) {
break;
}
j = s.indexOf(RBRACE, i);
if (i + 1 > j) {
break;
}
//Extract key and meta info
token = s.substring(i + 1, j);
key = token;
meta = null;
k = key.indexOf(SPACE);
if (k > -1) {
meta = key.substring(k + 1);
key = key.substring(0, k);
}
// lookup the value
v = o[key];
// if a substitution function was provided, execute it
if (f) {
v = f(key, v, meta);
}
if (L.isObject(v)) {
if (L.isArray(v)) {
v = L.dump(v, parseInt(meta, 10));
} else {
meta = meta || "";
// look for the keyword 'dump', if found force obj dump
dump = meta.indexOf(DUMP);
if (dump > -1) {
meta = meta.substring(4);
}
objstr = v.toString();
// use the toString if it is not the Object toString
// and the 'dump' meta info was not found
if (objstr === OBJECT_TOSTRING || dump > -1) {
v = L.dump(v, parseInt(meta, 10));
} else {
v = objstr;
}
}
} else if (!L.isString(v) && !L.isNumber(v)) {
// This {block} has no replace string. Save it for later.
v = "~-" + saved.length + "-~";
saved[saved.length] = token;
// break;
}
s = s.substring(0, i) + v + s.substring(j + 1);
if (recurse === false) {
lidx = i-1;
}
}
// restore saved {block}s
for (i=saved.length-1; i>=0; i=i-1) {
s = s.replace(new RegExp("~-" + i + "-~"), "{" + saved[i] + "}", "g");
}
return s;
},
/**
* Returns a string without any leading or trailing whitespace. If
* the input is not a string, the input will be returned untouched.
* @method trim
* @since 2.3.0
* @param s {string} the string to trim
* @return {string} the trimmed string
*/
trim: function(s){
try {
return s.replace(/^\s+|\s+$/g, "");
} catch(e) {
return s;
}
},
/**
* Returns a new object containing all of the properties of
* all the supplied objects. The properties from later objects
* will overwrite those in earlier objects.
* @method merge
* @since 2.3.0
* @param arguments {Object*} the objects to merge
* @return the new merged object
*/
merge: function() {
var o={}, a=arguments, l=a.length, i;
for (i=0; i<l; i=i+1) {
L.augmentObject(o, a[i], true);
}
return o;
},
/**
* Executes the supplied function in the context of the supplied
* object 'when' milliseconds later. Executes the function a
* single time unless periodic is set to true.
* @method later
* @since 2.4.0
* @param when {int} the number of milliseconds to wait until the fn
* is executed
* @param o the context object
* @param fn {Function|String} the function to execute or the name of
* the method in the 'o' object to execute
* @param data [Array] data that is provided to the function. This accepts
* either a single item or an array. If an array is provided, the
* function is executed with one parameter for each array item. If
* you need to pass a single array parameter, it needs to be wrapped in
* an array [myarray]
* @param periodic {boolean} if true, executes continuously at supplied
* interval until canceled
* @return a timer object. Call the cancel() method on this object to
* stop the timer.
*/
later: function(when, o, fn, data, periodic) {
when = when || 0;
o = o || {};
var m=fn, d=data, f, r;
if (L.isString(fn)) {
m = o[fn];
}
if (!m) {
throw new TypeError("method undefined");
}
if (!L.isUndefined(data) && !L.isArray(d)) {
d = [data];
}
f = function() {
m.apply(o, d || NOTHING);
};
r = (periodic) ? setInterval(f, when) : setTimeout(f, when);
return {
interval: periodic,
cancel: function() {
if (this.interval) {
clearInterval(r);
} else {
clearTimeout(r);
}
}
};
},
/**
* A convenience method for detecting a legitimate non-null value.
* Returns false for null/undefined/NaN, true for other values,
* including 0/false/''
* @method isValue
* @since 2.3.0
* @param o {any} the item to test
* @return {boolean} true if it is not null/undefined/NaN || false
*/
isValue: function(o) {
// return (o || o === false || o === 0 || o === ''); // Infinity fails
return (L.isObject(o) || L.isString(o) || L.isNumber(o) || L.isBoolean(o));
}
};
/**
* Determines whether or not the property was added
* to the object instance. Returns false if the property is not present
* in the object, or was inherited from the prototype.
* This abstraction is provided to enable hasOwnProperty for Safari 1.3.x.
* There is a discrepancy between YAHOO.lang.hasOwnProperty and
* Object.prototype.hasOwnProperty when the property is a primitive added to
* both the instance AND prototype with the same value:
* <pre>
* var A = function() {};
* A.prototype.foo = 'foo';
* var a = new A();
* a.foo = 'foo';
* alert(a.hasOwnProperty('foo')); // true
* alert(YAHOO.lang.hasOwnProperty(a, 'foo')); // false when using fallback
* </pre>
* @method hasOwnProperty
* @param {any} o The object being testing
* @param prop {string} the name of the property to test
* @return {boolean} the result
*/
L.hasOwnProperty = (OP.hasOwnProperty) ?
function(o, prop) {
return o && o.hasOwnProperty && o.hasOwnProperty(prop);
} : function(o, prop) {
return !L.isUndefined(o[prop]) &&
o.constructor.prototype[prop] !== o[prop];
};
// new lang wins
OB.augmentObject(L, OB, true);
/*
* An alias for <a href="YAHOO.lang.html">YAHOO.lang</a>
* @class YAHOO.util.Lang
*/
YAHOO.util.Lang = L;
/**
* Same as YAHOO.lang.augmentObject, except it only applies prototype
* properties. This is an alias for augmentProto.
* @see YAHOO.lang.augmentObject
* @method augment
* @static
* @param {Function} r the object to receive the augmentation
* @param {Function} s the object that supplies the properties to augment
* @param {String*|boolean} arguments zero or more properties methods to
* augment the receiver with. If none specified, everything
* in the supplier will be used unless it would
* overwrite an existing property in the receiver. if true
* is specified as the third parameter, all properties will
* be applied and will overwrite an existing property in
* the receiver
*/
L.augment = L.augmentProto;
/**
* An alias for <a href="YAHOO.lang.html#augment">YAHOO.lang.augment</a>
* @for YAHOO
* @method augment
* @static
* @param {Function} r the object to receive the augmentation
* @param {Function} s the object that supplies the properties to augment
* @param {String*} arguments zero or more properties methods to
* augment the receiver with. If none specified, everything
* in the supplier will be used unless it would
* overwrite an existing property in the receiver
*/
YAHOO.augment = L.augmentProto;
/**
* An alias for <a href="YAHOO.lang.html#extend">YAHOO.lang.extend</a>
* @method extend
* @static
* @param {Function} subc the object to modify
* @param {Function} superc the object to inherit
* @param {Object} overrides additional properties/methods to add to the
* subclass prototype. These will override the
* matching items obtained from the superclass if present.
*/
YAHOO.extend = L.extend;
})();
YAHOO.register("yahoo", YAHOO, {version: "2.9.0", build: "2800"});
/**
* Provides a mechanism to fetch remote resources and
* insert them into a document
* This utility can fetch JavaScript and CSS files, inserting script
* tags for script and link tags for CSS. Note, this
* is done via the normal browser mechanisms for inserting
* these resources and making the content available to
* code that would access it. Be careful when retreiving
* remote resources. Only use this utility to fetch
* files from sites you trust.
*
* @module get
* @requires yahoo
*/
/**
* Fetches and inserts one or more script or link nodes into the document.
* This utility can fetch JavaScript and CSS files, inserting script
* tags for script and link tags for CSS. Note, this
* is done via the normal browser mechanisms for inserting
* these resources and making the content available to
* code that would access it. Be careful when retreiving
* remote resources. Only use this utility to fetch
* files from sites you trust.
*
* @namespace YAHOO.util
* @class YAHOO.util.Get
*/
YAHOO.util.Get = function() {
/**
* hash of queues to manage multiple requests
* @property queues
* @private
*/
var queues={},
/**
* queue index used to generate transaction ids
* @property qidx
* @type int
* @private
*/
qidx=0,
/**
* node index used to generate unique node ids
* @property nidx
* @type int
* @private
*/
nidx=0,
/**
* interal property used to prevent multiple simultaneous purge
* processes
* @property purging
* @type boolean
* @private
*/
_purging=false,
ua=YAHOO.env.ua,
lang=YAHOO.lang,
_fail,
_purge,
_track,
/**
* Generates an HTML element, this is not appended to a document
* @method _node
* @param type {string} the type of element
* @param attr {string} the attributes
* @param win {Window} optional window to create the element in
* @return {HTMLElement} the generated node
* @private
*/
_node = function(type, attr, win) {
var w = win || window, d=w.document, n=d.createElement(type), i;
for (i in attr) {
if (attr.hasOwnProperty(i)) {
n.setAttribute(i, attr[i]);
}
}
return n;
},
/**
* Generates a link node
* @method _linkNode
* @param url {string} the url for the css file
* @param win {Window} optional window to create the node in
* @return {HTMLElement} the generated node
* @private
*/
_linkNode = function(url, win, attributes) {
var o = {
id: "yui__dyn_" + (nidx++),
type: "text/css",
rel: "stylesheet",
href: url
};
if (attributes) {
lang.augmentObject(o, attributes);
}
return _node("link", o, win);
},
/**
* Generates a script node
* @method _scriptNode
* @param url {string} the url for the script file
* @param win {Window} optional window to create the node in
* @return {HTMLElement} the generated node
* @private
*/
_scriptNode = function(url, win, attributes) {
var o = {
id: "yui__dyn_" + (nidx++),
type: "text/javascript",
src: url
};
if (attributes) {
lang.augmentObject(o, attributes);
}
return _node("script", o, win);
},
/**
* Returns the data payload for callback functions
* @method _returnData
* @private
*/
_returnData = function(q, msg) {
return {
tId: q.tId,
win: q.win,
data: q.data,
nodes: q.nodes,
msg: msg,
purge: function() {
_purge(this.tId);
}
};
},
_get = function(nId, tId) {
var q = queues[tId],
n = (lang.isString(nId)) ? q.win.document.getElementById(nId) : nId;
if (!n) {
_fail(tId, "target node not found: " + nId);
}
return n;
},
/**
* The request is complete, so executing the requester's callback
* @method _finish
* @param id {string} the id of the request
* @private
*/
_finish = function(id) {
YAHOO.log("Finishing transaction " + id);
var q = queues[id], msg, context;
q.finished = true;
if (q.aborted) {
msg = "transaction " + id + " was aborted";
_fail(id, msg);
return;
}
// execute success callback
if (q.onSuccess) {
context = q.scope || q.win;
q.onSuccess.call(context, _returnData(q));
}
},
/**
* Timeout detected
* @method _timeout
* @param id {string} the id of the request
* @private
*/
_timeout = function(id) {
YAHOO.log("Timeout " + id, "info", "get");
var q = queues[id], context;
if (q.onTimeout) {
context = q.scope || q;
q.onTimeout.call(context, _returnData(q));
}
},
/**
* Loads the next item for a given request
* @method _next
* @param id {string} the id of the request
* @param loaded {string} the url that was just loaded, if any
* @private
*/
_next = function(id, loaded) {
YAHOO.log("_next: " + id + ", loaded: " + loaded, "info", "Get");
var q = queues[id], w=q.win, d=w.document, h=d.getElementsByTagName("head")[0],
n, msg, url, s, extra;
if (q.timer) {
// Y.log('cancel timer');
q.timer.cancel();
}
if (q.aborted) {
msg = "transaction " + id + " was aborted";
_fail(id, msg);
return;
}
if (loaded) {
q.url.shift();
if (q.varName) {
q.varName.shift();
}
} else {
// This is the first pass: make sure the url is an array
q.url = (lang.isString(q.url)) ? [q.url] : q.url;
if (q.varName) {
q.varName = (lang.isString(q.varName)) ? [q.varName] : q.varName;
}
}
if (q.url.length === 0) {
// Safari 2.x workaround - There is no way to know when
// a script is ready in versions of Safari prior to 3.x.
// Adding an extra node reduces the problem, but doesn't
// eliminate it completely because the browser executes
// them asynchronously.
if (q.type === "script" && ua.webkit && ua.webkit < 420 &&
!q.finalpass && !q.varName) {
// Add another script node. This does not guarantee that the
// scripts will execute in order, but it does appear to fix the
// problem on fast connections more effectively than using an
// arbitrary timeout. It is possible that the browser does
// block subsequent script execution in this case for a limited
// time.
extra = _scriptNode(null, q.win, q.attributes);
extra.innerHTML='YAHOO.util.Get._finalize("' + id + '");';
q.nodes.push(extra); h.appendChild(extra);
} else {
_finish(id);
}
return;
}
url = q.url[0];
// if the url is undefined, this is probably a trailing comma problem in IE
if (!url) {
q.url.shift();
YAHOO.log('skipping empty url');
return _next(id);
}
YAHOO.log("attempting to load " + url, "info", "Get");
if (q.timeout) {
// Y.log('create timer');
q.timer = lang.later(q.timeout, q, _timeout, id);
}
if (q.type === "script") {
n = _scriptNode(url, w, q.attributes);
} else {
n = _linkNode(url, w, q.attributes);
}
// track this node's load progress
_track(q.type, n, id, url, w, q.url.length);
// add the node to the queue so we can return it to the user supplied callback
q.nodes.push(n);
// add it to the head or insert it before 'insertBefore'
if (q.insertBefore) {
s = _get(q.insertBefore, id);
if (s) {
s.parentNode.insertBefore(n, s);
}
} else {
h.appendChild(n);
}
YAHOO.log("Appending node: " + url, "info", "Get");
// FireFox does not support the onload event for link nodes, so there is
// no way to make the css requests synchronous. This means that the css
// rules in multiple files could be applied out of order in this browser
// if a later request returns before an earlier one. Safari too.
if ((ua.webkit || ua.gecko) && q.type === "css") {
_next(id, url);
}
},
/**
* Removes processed queues and corresponding nodes
* @method _autoPurge
* @private
*/
_autoPurge = function() {
if (_purging) {
return;
}
_purging = true;
var i, q;
for (i in queues) {
if (queues.hasOwnProperty(i)) {
q = queues[i];
if (q.autopurge && q.finished) {
_purge(q.tId);
delete queues[i];
}
}
}
_purging = false;
},
/**
* Saves the state for the request and begins loading
* the requested urls
* @method queue
* @param type {string} the type of node to insert
* @param url {string} the url to load
* @param opts the hash of options for this request
* @private
*/
_queue = function(type, url, opts) {
var id = "q" + (qidx++), q;
opts = opts || {};
if (qidx % YAHOO.util.Get.PURGE_THRESH === 0) {
_autoPurge();
}
queues[id] = lang.merge(opts, {
tId: id,
type: type,
url: url,
finished: false,
aborted: false,
nodes: []
});
q = queues[id];
q.win = q.win || window;
q.scope = q.scope || q.win;
q.autopurge = ("autopurge" in q) ? q.autopurge :
(type === "script") ? true : false;
q.attributes = q.attributes || {};
q.attributes.charset = opts.charset || q.attributes.charset || 'utf-8';
lang.later(0, q, _next, id);
return {
tId: id
};
};
/**
* Detects when a node has been loaded. In the case of
* script nodes, this does not guarantee that contained
* script is ready to use.
* @method _track
* @param type {string} the type of node to track
* @param n {HTMLElement} the node to track
* @param id {string} the id of the request
* @param url {string} the url that is being loaded
* @param win {Window} the targeted window
* @param qlength the number of remaining items in the queue,
* including this one
* @param trackfn {Function} function to execute when finished
* the default is _next
* @private
*/
_track = function(type, n, id, url, win, qlength, trackfn) {
var f = trackfn || _next, rs, q, a, freq, w, l, i, msg;
// IE supports the readystatechange event for script and css nodes
if (ua.ie) {
n.onreadystatechange = function() {
rs = this.readyState;
if ("loaded" === rs || "complete" === rs) {
YAHOO.log(id + " onload " + url, "info", "Get");
n.onreadystatechange = null;
f(id, url);
}
};
// webkit prior to 3.x is problemmatic
} else if (ua.webkit) {
if (type === "script") {
// Safari 3.x supports the load event for script nodes (DOM2)
if (ua.webkit >= 420) {
n.addEventListener("load", function() {
YAHOO.log(id + " DOM2 onload " + url, "info", "Get");
f(id, url);
});
// Nothing can be done with Safari < 3.x except to pause and hope
// for the best, particularly after last script is inserted. The
// scripts will always execute in the order they arrive, not
// necessarily the order in which they were inserted. To support
// script nodes with complete reliability in these browsers, script
// nodes either need to invoke a function in the window once they
// are loaded or the implementer needs to provide a well-known
// property that the utility can poll for.
} else {
// Poll for the existence of the named variable, if it
// was supplied.
q = queues[id];
if (q.varName) {
freq = YAHOO.util.Get.POLL_FREQ;
YAHOO.log("Polling for " + q.varName[0]);
q.maxattempts = YAHOO.util.Get.TIMEOUT/freq;
q.attempts = 0;
q._cache = q.varName[0].split(".");
q.timer = lang.later(freq, q, function(o) {
a = this._cache;
l = a.length;
w = this.win;
for (i=0; i<l; i=i+1) {
w = w[a[i]];
if (!w) {
// if we have exausted our attempts, give up
this.attempts++;
if (this.attempts++ > this.maxattempts) {
msg = "Over retry limit, giving up";
q.timer.cancel();
_fail(id, msg);
} else {
YAHOO.log(a[i] + " failed, retrying");
}
return;
}
}
YAHOO.log("Safari poll complete");
q.timer.cancel();
f(id, url);
}, null, true);
} else {
lang.later(YAHOO.util.Get.POLL_FREQ, null, f, [id, url]);
}
}
}
// FireFox and Opera support onload (but not DOM2 in FF) handlers for
// script nodes. Opera, but not FF, supports the onload event for link
// nodes.
} else {
n.onload = function() {
YAHOO.log(id + " onload " + url, "info", "Get");
f(id, url);
};
}
};
/*
* The request failed, execute fail handler with whatever
* was accomplished. There isn't a failure case at the
* moment unless you count aborted transactions
* @method _fail
* @param id {string} the id of the request
* @private
*/
_fail = function(id, msg) {
YAHOO.log("get failure: " + msg, "warn", "Get");
var q = queues[id], context;
// execute failure callback
if (q.onFailure) {
context = q.scope || q.win;
q.onFailure.call(context, _returnData(q, msg));
}
};
/**
* Removes the nodes for the specified queue
* @method _purge
* @private
*/
_purge = function(tId) {
if (queues[tId]) {
var q = queues[tId],
nodes = q.nodes,
l = nodes.length,
d = q.win.document,
h = d.getElementsByTagName("head")[0],
sib, i, node, attr;
if (q.insertBefore) {
sib = _get(q.insertBefore, tId);
if (sib) {
h = sib.parentNode;
}
}
for (i=0; i<l; i=i+1) {
node = nodes[i];
if (node.clearAttributes) {
node.clearAttributes();
} else {
for (attr in node) {
if (node.hasOwnProperty(attr)) {
delete node[attr];
}
}
}
h.removeChild(node);
}
q.nodes = [];
}
};
return {
/**
* The default poll freqency in ms, when needed
* @property POLL_FREQ
* @static
* @type int
* @default 10
*/
POLL_FREQ: 10,
/**
* The number of request required before an automatic purge.
* property PURGE_THRESH
* @static
* @type int
* @default 20
*/
PURGE_THRESH: 20,
/**
* The length time to poll for varName when loading a script in
* Safari 2.x before the transaction fails.
* property TIMEOUT
* @static
* @type int
* @default 2000
*/
TIMEOUT: 2000,
/**
* Called by the the helper for detecting script load in Safari
* @method _finalize
* @param id {string} the transaction id
* @private
*/
_finalize: function(id) {
YAHOO.log(id + " finalized ", "info", "Get");
lang.later(0, null, _finish, id);
},
/**
* Abort a transaction
* @method abort
* @param {string|object} either the tId or the object returned from
* script() or css()
*/
abort: function(o) {
var id = (lang.isString(o)) ? o : o.tId,
q = queues[id];
if (q) {
YAHOO.log("Aborting " + id, "info", "Get");
q.aborted = true;
}
},
/**
* Fetches and inserts one or more script nodes into the head
* of the current document or the document in a specified window.
*
* @method script
* @static
* @param url {string|string[]} the url or urls to the script(s)
* @param opts {object} Options:
* <dl>
* <dt>onSuccess</dt>
* <dd>
* callback to execute when the script(s) are finished loading
* The callback receives an object back with the following
* data:
* <dl>
* <dt>win</dt>
* <dd>the window the script(s) were inserted into</dd>
* <dt>data</dt>
* <dd>the data object passed in when the request was made</dd>
* <dt>nodes</dt>
* <dd>An array containing references to the nodes that were
* inserted</dd>
* <dt>purge</dt>
* <dd>A function that, when executed, will remove the nodes
* that were inserted</dd>
* <dt>
* </dl>
* </dd>
* <dt>onFailure</dt>
* <dd>
* callback to execute when the script load operation fails
* The callback receives an object back with the following
* data:
* <dl>
* <dt>win</dt>
* <dd>the window the script(s) were inserted into</dd>
* <dt>data</dt>
* <dd>the data object passed in when the request was made</dd>
* <dt>nodes</dt>
* <dd>An array containing references to the nodes that were
* inserted successfully</dd>
* <dt>purge</dt>
* <dd>A function that, when executed, will remove any nodes
* that were inserted</dd>
* <dt>
* </dl>
* </dd>
* <dt>onTimeout</dt>
* <dd>
* callback to execute when a timeout occurs.
* The callback receives an object back with the following
* data:
* <dl>
* <dt>win</dt>
* <dd>the window the script(s) were inserted into</dd>
* <dt>data</dt>
* <dd>the data object passed in when the request was made</dd>
* <dt>nodes</dt>
* <dd>An array containing references to the nodes that were
* inserted</dd>
* <dt>purge</dt>
* <dd>A function that, when executed, will remove the nodes
* that were inserted</dd>
* <dt>
* </dl>
* </dd>
* <dt>scope</dt>
* <dd>the execution context for the callbacks</dd>
* <dt>win</dt>
* <dd>a window other than the one the utility occupies</dd>
* <dt>autopurge</dt>
* <dd>
* setting to true will let the utilities cleanup routine purge
* the script once loaded
* </dd>
* <dt>data</dt>
* <dd>
* data that is supplied to the callback when the script(s) are
* loaded.
* </dd>
* <dt>varName</dt>
* <dd>
* variable that should be available when a script is finished
* loading. Used to help Safari 2.x and below with script load
* detection. The type of this property should match what was
* passed into the url parameter: if loading a single url, a
* string can be supplied. If loading multiple scripts, you
* must supply an array that contains the variable name for
* each script.
* </dd>
* <dt>insertBefore</dt>
* <dd>node or node id that will become the new node's nextSibling</dd>
* </dl>
* <dt>charset</dt>
* <dd>Node charset, deprecated, use 'attributes'</dd>
* <dt>attributes</dt>
* <dd>A hash of attributes to apply to dynamic nodes.</dd>
* <dt>timeout</dt>
* <dd>Number of milliseconds to wait before aborting and firing the timeout event</dd>
* <pre>
* // assumes yahoo, dom, and event are already on the page
* YAHOO.util.Get.script(
* ["http://yui.yahooapis.com/2.7.0/build/dragdrop/dragdrop-min.js",
* "http://yui.yahooapis.com/2.7.0/build/animation/animation-min.js"], {
* onSuccess: function(o) {
* YAHOO.log(o.data); // foo
* new YAHOO.util.DDProxy("dd1"); // also new o.reference("dd1"); would work
* this.log("won't cause error because YAHOO is the scope");
* this.log(o.nodes.length === 2) // true
* // o.purge(); // optionally remove the script nodes immediately
* },
* onFailure: function(o) {
* YAHOO.log("transaction failed");
* },
* data: "foo",
* timeout: 10000, // 10 second timeout
* scope: YAHOO,
* // win: otherframe // target another window/frame
* autopurge: true // allow the utility to choose when to remove the nodes
* });
* </pre>
* @return {tId: string} an object containing info about the transaction
*/
script: function(url, opts) { return _queue("script", url, opts); },
/**
* Fetches and inserts one or more css link nodes into the
* head of the current document or the document in a specified
* window.
* @method css
* @static
* @param url {string} the url or urls to the css file(s)
* @param opts Options:
* <dl>
* <dt>onSuccess</dt>
* <dd>
* callback to execute when the css file(s) are finished loading
* The callback receives an object back with the following
* data:
* <dl>win</dl>
* <dd>the window the link nodes(s) were inserted into</dd>
* <dt>data</dt>
* <dd>the data object passed in when the request was made</dd>
* <dt>nodes</dt>
* <dd>An array containing references to the nodes that were
* inserted</dd>
* <dt>purge</dt>
* <dd>A function that, when executed, will remove the nodes
* that were inserted</dd>
* <dt>
* </dl>
* </dd>
* <dt>scope</dt>
* <dd>the execution context for the callbacks</dd>
* <dt>win</dt>
* <dd>a window other than the one the utility occupies</dd>
* <dt>data</dt>
* <dd>
* data that is supplied to the callbacks when the nodes(s) are
* loaded.
* </dd>
* <dt>insertBefore</dt>
* <dd>node or node id that will become the new node's nextSibling</dd>
* <dt>charset</dt>
* <dd>Node charset, deprecated, use 'attributes'</dd>
* <dt>attributes</dt>
* <dd>A hash of attributes to apply to dynamic nodes.</dd>
* </dl>
* <pre>
* YAHOO.util.Get.css("http://yui.yahooapis.com/2.7.0/build/menu/assets/skins/sam/menu.css");
* </pre>
* <pre>
* YAHOO.util.Get.css(["http://yui.yahooapis.com/2.7.0/build/menu/assets/skins/sam/menu.css",
* "http://yui.yahooapis.com/2.7.0/build/logger/assets/skins/sam/logger.css"]);
* </pre>
* @return {tId: string} an object containing info about the transaction
*/
css: function(url, opts) {
return _queue("css", url, opts);
}
};
}();
YAHOO.register("get", YAHOO.util.Get, {version: "2.9.0", build: "2800"});
/*jslint evil: true, strict: false, regexp: false*/
/**
* Provides dynamic loading for the YUI library. It includes the dependency
* info for the library, and will automatically pull in dependencies for
* the modules requested. It supports rollup files (such as utilities.js
* and yahoo-dom-event.js), and will automatically use these when
* appropriate in order to minimize the number of http connections
* required to load all of the dependencies.
*
* @module yuiloader
* @namespace YAHOO.util
*/
/**
* YUILoader provides dynamic loading for YUI.
* @class YAHOO.util.YUILoader
* @todo
* version management, automatic sandboxing
*/
(function() {
var Y = YAHOO,
util = Y.util,
lang = Y.lang,
env = Y.env,
PROV = "_provides",
SUPER = "_supersedes",
REQ = "expanded",
AFTER = "_after",
VERSION = "2.9.0";
// version hack for cdn testing
// if (/VERSION/.test(VERSION)) {
// VERSION = "2.8.2";
// }
var YUI = {
dupsAllowed: {'yahoo': true, 'get': true},
/*
* The library metadata for the current release The is the default
* value for YAHOO.util.YUILoader.moduleInfo
* @property YUIInfo
* @static
*/
info: {
// 'root': '2.5.2/build/',
// 'base': 'http://yui.yahooapis.com/2.5.2/build/',
'root': VERSION + '/build/',
'base': 'http://yui.yahooapis.com/' + VERSION + '/build/',
'comboBase': 'http://yui.yahooapis.com/combo?',
'skin': {
'defaultSkin': 'sam',
'base': 'assets/skins/',
'path': 'skin.css',
'after': ['reset', 'fonts', 'grids', 'base'],
'rollup': 3
},
dupsAllowed: ['yahoo', 'get'],
'moduleInfo': {
'animation': {
'type': 'js',
'path': 'animation/animation-min.js',
'requires': ['dom', 'event']
},
'autocomplete': {
'type': 'js',
'path': 'autocomplete/autocomplete-min.js',
'requires': ['dom', 'event', 'datasource'],
'optional': ['connection', 'animation'],
'skinnable': true
},
'base': {
'type': 'css',
'path': 'base/base-min.css',
'after': ['reset', 'fonts', 'grids']
},
'button': {
'type': 'js',
'path': 'button/button-min.js',
'requires': ['element'],
'optional': ['menu'],
'skinnable': true
},
'calendar': {
'type': 'js',
'path': 'calendar/calendar-min.js',
'requires': ['event', 'dom'],
supersedes: ['datemath'],
'skinnable': true
},
'carousel': {
'type': 'js',
'path': 'carousel/carousel-min.js',
'requires': ['element'],
'optional': ['animation'],
'skinnable': true
},
'charts': {
'type': 'js',
'path': 'charts/charts-min.js',
'requires': ['element', 'json', 'datasource', 'swf']
},
'colorpicker': {
'type': 'js',
'path': 'colorpicker/colorpicker-min.js',
'requires': ['slider', 'element'],
'optional': ['animation'],
'skinnable': true
},
'connection': {
'type': 'js',
'path': 'connection/connection-min.js',
'requires': ['event'],
'supersedes': ['connectioncore']
},
'connectioncore': {
'type': 'js',
'path': 'connection/connection_core-min.js',
'requires': ['event'],
'pkg': 'connection'
},
'container': {
'type': 'js',
'path': 'container/container-min.js',
'requires': ['dom', 'event'],
// button is also optional, but this creates a circular
// dependency when loadOptional is specified. button
// optionally includes menu, menu requires container.
'optional': ['dragdrop', 'animation', 'connection'],
'supersedes': ['containercore'],
'skinnable': true
},
'containercore': {
'type': 'js',
'path': 'container/container_core-min.js',
'requires': ['dom', 'event'],
'pkg': 'container'
},
'cookie': {
'type': 'js',
'path': 'cookie/cookie-min.js',
'requires': ['yahoo']
},
'datasource': {
'type': 'js',
'path': 'datasource/datasource-min.js',
'requires': ['event'],
'optional': ['connection']
},
'datatable': {
'type': 'js',
'path': 'datatable/datatable-min.js',
'requires': ['element', 'datasource'],
'optional': ['calendar', 'dragdrop', 'paginator'],
'skinnable': true
},
datemath: {
'type': 'js',
'path': 'datemath/datemath-min.js',
'requires': ['yahoo']
},
'dom': {
'type': 'js',
'path': 'dom/dom-min.js',
'requires': ['yahoo']
},
'dragdrop': {
'type': 'js',
'path': 'dragdrop/dragdrop-min.js',
'requires': ['dom', 'event']
},
'editor': {
'type': 'js',
'path': 'editor/editor-min.js',
'requires': ['menu', 'element', 'button'],
'optional': ['animation', 'dragdrop'],
'supersedes': ['simpleeditor'],
'skinnable': true
},
'element': {
'type': 'js',
'path': 'element/element-min.js',
'requires': ['dom', 'event'],
'optional': ['event-mouseenter', 'event-delegate']
},
'element-delegate': {
'type': 'js',
'path': 'element-delegate/element-delegate-min.js',
'requires': ['element']
},
'event': {
'type': 'js',
'path': 'event/event-min.js',
'requires': ['yahoo']
},
'event-simulate': {
'type': 'js',
'path': 'event-simulate/event-simulate-min.js',
'requires': ['event']
},
'event-delegate': {
'type': 'js',
'path': 'event-delegate/event-delegate-min.js',
'requires': ['event'],
'optional': ['selector']
},
'event-mouseenter': {
'type': 'js',
'path': 'event-mouseenter/event-mouseenter-min.js',
'requires': ['dom', 'event']
},
'fonts': {
'type': 'css',
'path': 'fonts/fonts-min.css'
},
'get': {
'type': 'js',
'path': 'get/get-min.js',
'requires': ['yahoo']
},
'grids': {
'type': 'css',
'path': 'grids/grids-min.css',
'requires': ['fonts'],
'optional': ['reset']
},
'history': {
'type': 'js',
'path': 'history/history-min.js',
'requires': ['event']
},
'imagecropper': {
'type': 'js',
'path': 'imagecropper/imagecropper-min.js',
'requires': ['dragdrop', 'element', 'resize'],
'skinnable': true
},
'imageloader': {
'type': 'js',
'path': 'imageloader/imageloader-min.js',
'requires': ['event', 'dom']
},
'json': {
'type': 'js',
'path': 'json/json-min.js',
'requires': ['yahoo']
},
'layout': {
'type': 'js',
'path': 'layout/layout-min.js',
'requires': ['element'],
'optional': ['animation', 'dragdrop', 'resize', 'selector'],
'skinnable': true
},
'logger': {
'type': 'js',
'path': 'logger/logger-min.js',
'requires': ['event', 'dom'],
'optional': ['dragdrop'],
'skinnable': true
},
'menu': {
'type': 'js',
'path': 'menu/menu-min.js',
'requires': ['containercore'],
'skinnable': true
},
'paginator': {
'type': 'js',
'path': 'paginator/paginator-min.js',
'requires': ['element'],
'skinnable': true
},
'profiler': {
'type': 'js',
'path': 'profiler/profiler-min.js',
'requires': ['yahoo']
},
'profilerviewer': {
'type': 'js',
'path': 'profilerviewer/profilerviewer-min.js',
'requires': ['profiler', 'yuiloader', 'element'],
'skinnable': true
},
'progressbar': {
'type': 'js',
'path': 'progressbar/progressbar-min.js',
'requires': ['element'],
'optional': ['animation'],
'skinnable': true
},
'reset': {
'type': 'css',
'path': 'reset/reset-min.css'
},
'reset-fonts-grids': {
'type': 'css',
'path': 'reset-fonts-grids/reset-fonts-grids.css',
'supersedes': ['reset', 'fonts', 'grids', 'reset-fonts'],
'rollup': 4
},
'reset-fonts': {
'type': 'css',
'path': 'reset-fonts/reset-fonts.css',
'supersedes': ['reset', 'fonts'],
'rollup': 2
},
'resize': {
'type': 'js',
'path': 'resize/resize-min.js',
'requires': ['dragdrop', 'element'],
'optional': ['animation'],
'skinnable': true
},
'selector': {
'type': 'js',
'path': 'selector/selector-min.js',
'requires': ['yahoo', 'dom']
},
'simpleeditor': {
'type': 'js',
'path': 'editor/simpleeditor-min.js',
'requires': ['element'],
'optional': ['containercore', 'menu', 'button', 'animation', 'dragdrop'],
'skinnable': true,
'pkg': 'editor'
},
'slider': {
'type': 'js',
'path': 'slider/slider-min.js',
'requires': ['dragdrop'],
'optional': ['animation'],
'skinnable': true
},
'storage': {
'type': 'js',
'path': 'storage/storage-min.js',
'requires': ['yahoo', 'event', 'cookie'],
'optional': ['swfstore']
},
'stylesheet': {
'type': 'js',
'path': 'stylesheet/stylesheet-min.js',
'requires': ['yahoo']
},
'swf': {
'type': 'js',
'path': 'swf/swf-min.js',
'requires': ['element'],
'supersedes': ['swfdetect']
},
'swfdetect': {
'type': 'js',
'path': 'swfdetect/swfdetect-min.js',
'requires': ['yahoo']
},
'swfstore': {
'type': 'js',
'path': 'swfstore/swfstore-min.js',
'requires': ['element', 'cookie', 'swf']
},
'tabview': {
'type': 'js',
'path': 'tabview/tabview-min.js',
'requires': ['element'],
'optional': ['connection'],
'skinnable': true
},
'treeview': {
'type': 'js',
'path': 'treeview/treeview-min.js',
'requires': ['event', 'dom'],
'optional': ['json', 'animation', 'calendar'],
'skinnable': true
},
'uploader': {
'type': 'js',
'path': 'uploader/uploader-min.js',
'requires': ['element']
},
'utilities': {
'type': 'js',
'path': 'utilities/utilities.js',
'supersedes': ['yahoo', 'event', 'dragdrop', 'animation', 'dom', 'connection', 'element', 'yahoo-dom-event', 'get', 'yuiloader', 'yuiloader-dom-event'],
'rollup': 8
},
'yahoo': {
'type': 'js',
'path': 'yahoo/yahoo-min.js'
},
'yahoo-dom-event': {
'type': 'js',
'path': 'yahoo-dom-event/yahoo-dom-event.js',
'supersedes': ['yahoo', 'event', 'dom'],
'rollup': 3
},
'yuiloader': {
'type': 'js',
'path': 'yuiloader/yuiloader-min.js',
'supersedes': ['yahoo', 'get']
},
'yuiloader-dom-event': {
'type': 'js',
'path': 'yuiloader-dom-event/yuiloader-dom-event.js',
'supersedes': ['yahoo', 'dom', 'event', 'get', 'yuiloader', 'yahoo-dom-event'],
'rollup': 5
},
'yuitest': {
'type': 'js',
'path': 'yuitest/yuitest-min.js',
'requires': ['logger'],
'optional': ['event-simulate'],
'skinnable': true
}
}
},
ObjectUtil: {
appendArray: function(o, a) {
if (a) {
for (var i=0; i<a.length; i=i+1) {
o[a[i]] = true;
}
}
},
keys: function(o, ordered) {
var a=[], i;
for (i in o) {
if (lang.hasOwnProperty(o, i)) {
a.push(i);
}
}
return a;
}
},
ArrayUtil: {
appendArray: function(a1, a2) {
Array.prototype.push.apply(a1, a2);
/*
for (var i=0; i<a2.length; i=i+1) {
a1.push(a2[i]);
}
*/
},
indexOf: function(a, val) {
for (var i=0; i<a.length; i=i+1) {
if (a[i] === val) {
return i;
}
}
return -1;
},
toObject: function(a) {
var o = {};
for (var i=0; i<a.length; i=i+1) {
o[a[i]] = true;
}
return o;
},
/*
* Returns a unique array. Does not maintain order, which is fine
* for this application, and performs better than it would if it
* did.
*/
uniq: function(a) {
return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));
}
}
};
YAHOO.util.YUILoader = function(o) {
/**
* Internal callback to handle multiple internal insert() calls
* so that css is inserted prior to js
* @property _internalCallback
* @private
*/
this._internalCallback = null;
/**
* Use the YAHOO environment listener to detect script load. This
* is only switched on for Safari 2.x and below.
* @property _useYahooListener
* @private
*/
this._useYahooListener = false;
/**
* Callback that will be executed when the loader is finished
* with an insert
* @method onSuccess
* @type function
*/
this.onSuccess = null;
/**
* Callback that will be executed if there is a failure
* @method onFailure
* @type function
*/
this.onFailure = Y.log;
/**
* Callback that will be executed each time a new module is loaded
* @method onProgress
* @type function
*/
this.onProgress = null;
/**
* Callback that will be executed if a timeout occurs
* @method onTimeout
* @type function
*/
this.onTimeout = null;
/**
* The execution scope for all callbacks
* @property scope
* @default this
*/
this.scope = this;
/**
* Data that is passed to all callbacks
* @property data
*/
this.data = null;
/**
* Node reference or id where new nodes should be inserted before
* @property insertBefore
* @type string|HTMLElement
*/
this.insertBefore = null;
/**
* The charset attribute for inserted nodes
* @property charset
* @type string
* @default utf-8
*/
this.charset = null;
/**
* The name of the variable in a sandbox or script node
* (for external script support in Safari 2.x and earlier)
* to reference when the load is complete. If this variable
* is not available in the specified scripts, the operation will
* fail.
* @property varName
* @type string
*/
this.varName = null;
/**
* The base directory.
* @property base
* @type string
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
*/
this.base = YUI.info.base;
/**
* Base path for the combo service
* @property comboBase
* @type string
* @default http://yui.yahooapis.com/combo?
*/
this.comboBase = YUI.info.comboBase;
/**
* If configured, YUI will use the the combo handler on the
* Yahoo! CDN to pontentially reduce the number of http requests
* required.
* @property combine
* @type boolean
* @default false
*/
// this.combine = (o && !('base' in o));
this.combine = false;
/**
* Root path to prepend to module path for the combo
* service
* @property root
* @type string
* @default [YUI VERSION]/build/
*/
this.root = YUI.info.root;
/**
* Timeout value in milliseconds. If set, this value will be used by
* the get utility. the timeout event will fire if
* a timeout occurs.
* @property timeout
* @type int
*/
this.timeout = 0;
/**
* A list of modules that should not be loaded, even if
* they turn up in the dependency tree
* @property ignore
* @type string[]
*/
this.ignore = null;
/**
* A list of modules that should always be loaded, even
* if they have already been inserted into the page.
* @property force
* @type string[]
*/
this.force = null;
/**
* Should we allow rollups
* @property allowRollup
* @type boolean
* @default true
*/
this.allowRollup = true;
/**
* A filter to apply to result urls. This filter will modify the default
* path for all modules. The default path for the YUI library is the
* minified version of the files (e.g., event-min.js). The filter property
* can be a predefined filter or a custom filter. The valid predefined
* filters are:
* <dl>
* <dt>DEBUG</dt>
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* This option will automatically include the logger widget</dd>
* <dt>RAW</dt>
* <dd>Selects the non-minified version of the library (e.g., event.js).
* </dl>
* You can also define a custom filter, which must be an object literal
* containing a search expression and a replace string:
* <pre>
* myFilter: {
* 'searchExp': "-min\\.js",
* 'replaceStr': "-debug.js"
* }
* </pre>
* @property filter
* @type string|{searchExp: string, replaceStr: string}
*/
this.filter = null;
/**
* The list of requested modules
* @property required
* @type {string: boolean}
*/
this.required = {};
/**
* The library metadata
* @property moduleInfo
*/
this.moduleInfo = lang.merge(YUI.info.moduleInfo);
/**
* List of rollup files found in the library metadata
* @property rollups
*/
this.rollups = null;
/**
* Whether or not to load optional dependencies for
* the requested modules
* @property loadOptional
* @type boolean
* @default false
*/
this.loadOptional = false;
/**
* All of the derived dependencies in sorted order, which
* will be populated when either calculate() or insert()
* is called
* @property sorted
* @type string[]
*/
this.sorted = [];
/**
* Set when beginning to compute the dependency tree.
* Composed of what YAHOO reports to be loaded combined
* with what has been loaded by the tool
* @propery loaded
* @type {string: boolean}
*/
this.loaded = {};
/**
* Flag to indicate the dependency tree needs to be recomputed
* if insert is called again.
* @property dirty
* @type boolean
* @default true
*/
this.dirty = true;
/**
* List of modules inserted by the utility
* @property inserted
* @type {string: boolean}
*/
this.inserted = {};
/**
* Provides the information used to skin the skinnable components.
* The following skin definition would result in 'skin1' and 'skin2'
* being loaded for calendar (if calendar was requested), and
* 'sam' for all other skinnable components:
*
* <code>
* skin: {
*
* // The default skin, which is automatically applied if not
* // overriden by a component-specific skin definition.
* // Change this in to apply a different skin globally
* defaultSkin: 'sam',
*
* // This is combined with the loader base property to get
* // the default root directory for a skin. ex:
* // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
* base: 'assets/skins/',
*
* // The name of the rollup css file for the skin
* path: 'skin.css',
*
* // The number of skinnable components requested that are
* // required before using the rollup file rather than the
* // individual component css files
* rollup: 3,
*
* // Any component-specific overrides can be specified here,
* // making it possible to load different skins for different
* // components. It is possible to load more than one skin
* // for a given component as well.
* overrides: {
* calendar: ['skin1', 'skin2']
* }
* }
* </code>
* @property skin
*/
var self = this;
env.listeners.push(function(m) {
if (self._useYahooListener) {
//Y.log("YAHOO listener: " + m.name);
self.loadNext(m.name);
}
});
this.skin = lang.merge(YUI.info.skin);
this._config(o);
};
Y.util.YUILoader.prototype = {
FILTERS: {
RAW: {
'searchExp': "-min\\.js",
'replaceStr': ".js"
},
DEBUG: {
'searchExp': "-min\\.js",
'replaceStr': "-debug.js"
}
},
SKIN_PREFIX: "skin-",
_config: function(o) {
// apply config values
if (o) {
for (var i in o) {
if (lang.hasOwnProperty(o, i)) {
if (i == "require") {
this.require(o[i]);
} else {
this[i] = o[i];
}
}
}
}
// fix filter
var f = this.filter;
if (lang.isString(f)) {
f = f.toUpperCase();
// the logger must be available in order to use the debug
// versions of the library
if (f === "DEBUG") {
this.require("logger");
}
// hack to handle a a bug where LogWriter is being instantiated
// at load time, and the loader has no way to sort above it
// at the moment.
if (!Y.widget.LogWriter) {
Y.widget.LogWriter = function() {
return Y;
};
}
this.filter = this.FILTERS[f];
}
},
/** Add a new module to the component metadata.
* <dl>
* <dt>name:</dt> <dd>required, the component name</dd>
* <dt>type:</dt> <dd>required, the component type (js or css)</dd>
* <dt>path:</dt> <dd>required, the path to the script from "base"</dd>
* <dt>requires:</dt> <dd>array of modules required by this component</dd>
* <dt>optional:</dt> <dd>array of optional modules for this component</dd>
* <dt>supersedes:</dt> <dd>array of the modules this component replaces</dd>
* <dt>after:</dt> <dd>array of modules the components which, if present, should be sorted above this one</dd>
* <dt>rollup:</dt> <dd>the number of superseded modules required for automatic rollup</dd>
* <dt>fullpath:</dt> <dd>If fullpath is specified, this is used instead of the configured base + path</dd>
* <dt>skinnable:</dt> <dd>flag to determine if skin assets should automatically be pulled in</dd>
* </dl>
* @method addModule
* @param o An object containing the module data
* @return {boolean} true if the module was added, false if
* the object passed in did not provide all required attributes
*/
addModule: function(o) {
if (!o || !o.name || !o.type || (!o.path && !o.fullpath)) {
return false;
}
o.ext = ('ext' in o) ? o.ext : true;
o.requires = o.requires || [];
this.moduleInfo[o.name] = o;
this.dirty = true;
return true;
},
/**
* Add a requirement for one or more module
* @method require
* @param what {string[] | string*} the modules to load
*/
require: function(what) {
var a = (typeof what === "string") ? arguments : what;
this.dirty = true;
YUI.ObjectUtil.appendArray(this.required, a);
},
/**
* Adds the skin def to the module info
* @method _addSkin
* @param skin {string} the name of the skin
* @param mod {string} the name of the module
* @return {string} the module name for the skin
* @private
*/
_addSkin: function(skin, mod) {
// Add a module definition for the skin rollup css
var name = this.formatSkin(skin), info = this.moduleInfo,
sinf = this.skin, ext = info[mod] && info[mod].ext;
// Y.log('ext? ' + mod + ": " + ext);
if (!info[name]) {
// Y.log('adding skin ' + name);
this.addModule({
'name': name,
'type': 'css',
'path': sinf.base + skin + '/' + sinf.path,
//'supersedes': '*',
'after': sinf.after,
'rollup': sinf.rollup,
'ext': ext
});
}
// Add a module definition for the module-specific skin css
if (mod) {
name = this.formatSkin(skin, mod);
if (!info[name]) {
var mdef = info[mod], pkg = mdef.pkg || mod;
// Y.log('adding skin ' + name);
this.addModule({
'name': name,
'type': 'css',
'after': sinf.after,
'path': pkg + '/' + sinf.base + skin + '/' + mod + '.css',
'ext': ext
});
}
}
return name;
},
/**
* Returns an object containing properties for all modules required
* in order to load the requested module
* @method getRequires
* @param mod The module definition from moduleInfo
*/
getRequires: function(mod) {
if (!mod) {
return [];
}
if (!this.dirty && mod.expanded) {
return mod.expanded;
}
mod.requires=mod.requires || [];
var i, d=[], r=mod.requires, o=mod.optional, info=this.moduleInfo, m;
for (i=0; i<r.length; i=i+1) {
d.push(r[i]);
m = info[r[i]];
YUI.ArrayUtil.appendArray(d, this.getRequires(m));
}
if (o && this.loadOptional) {
for (i=0; i<o.length; i=i+1) {
d.push(o[i]);
YUI.ArrayUtil.appendArray(d, this.getRequires(info[o[i]]));
}
}
mod.expanded = YUI.ArrayUtil.uniq(d);
return mod.expanded;
},
/**
* Returns an object literal of the modules the supplied module satisfies
* @method getProvides
* @param name{string} The name of the module
* @param notMe {string} don't add this module name, only include superseded modules
* @return what this module provides
*/
getProvides: function(name, notMe) {
var addMe = !(notMe), ckey = (addMe) ? PROV : SUPER,
m = this.moduleInfo[name], o = {};
if (!m) {
return o;
}
if (m[ckey]) {
// Y.log('cached: ' + name + ' ' + ckey + ' ' + lang.dump(this.moduleInfo[name][ckey], 0));
return m[ckey];
}
var s = m.supersedes, done={}, me = this;
// use worker to break cycles
var add = function(mm) {
if (!done[mm]) {
// Y.log(name + ' provides worker trying: ' + mm);
done[mm] = true;
// we always want the return value normal behavior
// (provides) for superseded modules.
lang.augmentObject(o, me.getProvides(mm));
}
// else {
// Y.log(name + ' provides worker skipping done: ' + mm);
// }
};
// calculate superseded modules
if (s) {
for (var i=0; i<s.length; i=i+1) {
add(s[i]);
}
}
// supersedes cache
m[SUPER] = o;
// provides cache
m[PROV] = lang.merge(o);
m[PROV][name] = true;
// Y.log(name + " supersedes " + lang.dump(m[SUPER], 0));
// Y.log(name + " provides " + lang.dump(m[PROV], 0));
return m[ckey];
},
/**
* Calculates the dependency tree, the result is stored in the sorted
* property
* @method calculate
* @param o optional options object
*/
calculate: function(o) {
if (o || this.dirty) {
this._config(o);
this._setup();
this._explode();
if (this.allowRollup) {
this._rollup();
}
this._reduce();
this._sort();
// Y.log("after calculate: " + lang.dump(this.required));
this.dirty = false;
}
},
/**
* Investigates the current YUI configuration on the page. By default,
* modules already detected will not be loaded again unless a force
* option is encountered. Called by calculate()
* @method _setup
* @private
*/
_setup: function() {
var info = this.moduleInfo, name, i, j;
// Create skin modules
for (name in info) {
if (lang.hasOwnProperty(info, name)) {
var m = info[name];
if (m && m.skinnable) {
// Y.log("skinning: " + name);
var o=this.skin.overrides, smod;
if (o && o[name]) {
for (i=0; i<o[name].length; i=i+1) {
smod = this._addSkin(o[name][i], name);
}
} else {
smod = this._addSkin(this.skin.defaultSkin, name);
}
if (YUI.ArrayUtil.indexOf(m.requires, smod) == -1) {
m.requires.push(smod);
}
}
}
}
var l = lang.merge(this.inserted); // shallow clone
if (!this._sandbox) {
l = lang.merge(l, env.modules);
}
// Y.log("Already loaded stuff: " + lang.dump(l, 0));
// add the ignore list to the list of loaded packages
if (this.ignore) {
YUI.ObjectUtil.appendArray(l, this.ignore);
}
// remove modules on the force list from the loaded list
if (this.force) {
for (i=0; i<this.force.length; i=i+1) {
if (this.force[i] in l) {
delete l[this.force[i]];
}
}
}
// expand the list to include superseded modules
for (j in l) {
// Y.log("expanding: " + j);
if (lang.hasOwnProperty(l, j)) {
lang.augmentObject(l, this.getProvides(j));
}
}
// Y.log("loaded expanded: " + lang.dump(l, 0));
this.loaded = l;
},
/**
* Inspects the required modules list looking for additional
* dependencies. Expands the required list to include all
* required modules. Called by calculate()
* @method _explode
* @private
*/
_explode: function() {
var r=this.required, i, mod;
for (i in r) {
if (lang.hasOwnProperty(r, i)) {
mod = this.moduleInfo[i];
if (mod) {
var req = this.getRequires(mod);
if (req) {
YUI.ObjectUtil.appendArray(r, req);
}
}
}
}
},
/*
* @method _skin
* @private
* @deprecated
*/
_skin: function() {
},
/**
* Returns the skin module name for the specified skin name. If a
* module name is supplied, the returned skin module name is
* specific to the module passed in.
* @method formatSkin
* @param skin {string} the name of the skin
* @param mod {string} optional: the name of a module to skin
* @return {string} the full skin module name
*/
formatSkin: function(skin, mod) {
var s = this.SKIN_PREFIX + skin;
if (mod) {
s = s + "-" + mod;
}
return s;
},
/**
* Reverses <code>formatSkin</code>, providing the skin name and
* module name if the string matches the pattern for skins.
* @method parseSkin
* @param mod {string} the module name to parse
* @return {skin: string, module: string} the parsed skin name
* and module name, or null if the supplied string does not match
* the skin pattern
*/
parseSkin: function(mod) {
if (mod.indexOf(this.SKIN_PREFIX) === 0) {
var a = mod.split("-");
return {skin: a[1], module: a[2]};
}
return null;
},
/**
* Look for rollup packages to determine if all of the modules a
* rollup supersedes are required. If so, include the rollup to
* help reduce the total number of connections required. Called
* by calculate()
* @method _rollup
* @private
*/
_rollup: function() {
var i, j, m, s, rollups={}, r=this.required, roll,
info = this.moduleInfo;
// find and cache rollup modules
if (this.dirty || !this.rollups) {
for (i in info) {
if (lang.hasOwnProperty(info, i)) {
m = info[i];
//if (m && m.rollup && m.supersedes) {
if (m && m.rollup) {
rollups[i] = m;
}
}
}
this.rollups = rollups;
}
// make as many passes as needed to pick up rollup rollups
for (;;) {
var rolled = false;
// go through the rollup candidates
for (i in rollups) {
// there can be only one
if (!r[i] && !this.loaded[i]) {
m =info[i]; s = m.supersedes; roll=false;
if (!m.rollup) {
continue;
}
var skin = (m.ext) ? false : this.parseSkin(i), c = 0;
// Y.log('skin? ' + i + ": " + skin);
if (skin) {
for (j in r) {
if (lang.hasOwnProperty(r, j)) {
if (i !== j && this.parseSkin(j)) {
c++;
roll = (c >= m.rollup);
if (roll) {
// Y.log("skin rollup " + lang.dump(r));
break;
}
}
}
}
} else {
// check the threshold
for (j=0;j<s.length;j=j+1) {
// if the superseded module is loaded, we can't load the rollup
if (this.loaded[s[j]] && (!YUI.dupsAllowed[s[j]])) {
roll = false;
break;
// increment the counter if this module is required. if we are
// beyond the rollup threshold, we will use the rollup module
} else if (r[s[j]]) {
c++;
roll = (c >= m.rollup);
if (roll) {
// Y.log("over thresh " + c + ", " + lang.dump(r));
break;
}
}
}
}
if (roll) {
// Y.log("rollup: " + i + ", " + lang.dump(this, 1));
// add the rollup
r[i] = true;
rolled = true;
// expand the rollup's dependencies
this.getRequires(m);
}
}
}
// if we made it here w/o rolling up something, we are done
if (!rolled) {
break;
}
}
},
/**
* Remove superceded modules and loaded modules. Called by
* calculate() after we have the mega list of all dependencies
* @method _reduce
* @private
*/
_reduce: function() {
var i, j, s, m, r=this.required;
for (i in r) {
// remove if already loaded
if (i in this.loaded) {
delete r[i];
// remove anything this module supersedes
} else {
var skinDef = this.parseSkin(i);
if (skinDef) {
//YAHOO.log("skin found in reduce: " + skinDef.skin + ", " + skinDef.module);
// the skin rollup will not have a module name
if (!skinDef.module) {
var skin_pre = this.SKIN_PREFIX + skinDef.skin;
//YAHOO.log("skin_pre: " + skin_pre);
for (j in r) {
if (lang.hasOwnProperty(r, j)) {
m = this.moduleInfo[j];
var ext = m && m.ext;
if (!ext && j !== i && j.indexOf(skin_pre) > -1) {
// Y.log ("removing component skin: " + j);
delete r[j];
}
}
}
}
} else {
m = this.moduleInfo[i];
s = m && m.supersedes;
if (s) {
for (j=0; j<s.length; j=j+1) {
if (s[j] in r) {
delete r[s[j]];
}
}
}
}
}
}
},
_onFailure: function(msg) {
YAHOO.log('Failure', 'info', 'loader');
var f = this.onFailure;
if (f) {
f.call(this.scope, {
msg: 'failure: ' + msg,
data: this.data,
success: false
});
}
},
_onTimeout: function() {
YAHOO.log('Timeout', 'info', 'loader');
var f = this.onTimeout;
if (f) {
f.call(this.scope, {
msg: 'timeout',
data: this.data,
success: false
});
}
},
/**
* Sorts the dependency tree. The last step of calculate()
* @method _sort
* @private
*/
_sort: function() {
// create an indexed list
var s=[], info=this.moduleInfo, loaded=this.loaded,
checkOptional=!this.loadOptional, me = this;
// returns true if b is not loaded, and is required
// directly or by means of modules it supersedes.
var requires = function(aa, bb) {
var mm=info[aa];
if (loaded[bb] || !mm) {
return false;
}
var ii,
rr = mm.expanded,
after = mm.after,
other = info[bb],
optional = mm.optional;
// check if this module requires the other directly
if (rr && YUI.ArrayUtil.indexOf(rr, bb) > -1) {
return true;
}
// check if this module should be sorted after the other
if (after && YUI.ArrayUtil.indexOf(after, bb) > -1) {
return true;
}
// if loadOptional is not specified, optional dependencies still
// must be sorted correctly when present.
if (checkOptional && optional && YUI.ArrayUtil.indexOf(optional, bb) > -1) {
return true;
}
// check if this module requires one the other supersedes
var ss=info[bb] && info[bb].supersedes;
if (ss) {
for (ii=0; ii<ss.length; ii=ii+1) {
if (requires(aa, ss[ii])) {
return true;
}
}
}
// external css files should be sorted below yui css
if (mm.ext && mm.type == 'css' && !other.ext && other.type == 'css') {
return true;
}
return false;
};
// get the required items out of the obj into an array so we
// can sort
for (var i in this.required) {
if (lang.hasOwnProperty(this.required, i)) {
s.push(i);
}
}
// pointer to the first unsorted item
var p=0;
// keep going until we make a pass without moving anything
for (;;) {
var l=s.length, a, b, j, k, moved=false;
// start the loop after items that are already sorted
for (j=p; j<l; j=j+1) {
// check the next module on the list to see if its
// dependencies have been met
a = s[j];
// check everything below current item and move if we
// find a requirement for the current item
for (k=j+1; k<l; k=k+1) {
if (requires(a, s[k])) {
// extract the dependency so we can move it up
b = s.splice(k, 1);
// insert the dependency above the item that
// requires it
s.splice(j, 0, b[0]);
moved = true;
break;
}
}
// jump out of loop if we moved something
if (moved) {
break;
// this item is sorted, move our pointer and keep going
} else {
p = p + 1;
}
}
// when we make it here and moved is false, we are
// finished sorting
if (!moved) {
break;
}
}
this.sorted = s;
},
toString: function() {
var o = {
type: "YUILoader",
base: this.base,
filter: this.filter,
required: this.required,
loaded: this.loaded,
inserted: this.inserted
};
lang.dump(o, 1);
},
_combine: function() {
this._combining = [];
var self = this,
s=this.sorted,
len = s.length,
js = this.comboBase,
css = this.comboBase,
target,
startLen = js.length,
i, m, type = this.loadType;
YAHOO.log('type ' + type);
for (i=0; i<len; i=i+1) {
m = this.moduleInfo[s[i]];
if (m && !m.ext && (!type || type === m.type)) {
target = this.root + m.path;
// if (i < len-1) {
target += '&';
// }
if (m.type == 'js') {
js += target;
} else {
css += target;
}
// YAHOO.log(target);
this._combining.push(s[i]);
}
}
if (this._combining.length) {
YAHOO.log('Attempting to combine: ' + this._combining, "info", "loader");
var callback=function(o) {
// YAHOO.log('Combo complete: ' + o.data, "info", "loader");
// this._combineComplete = true;
var c=this._combining, len=c.length, i, m;
for (i=0; i<len; i=i+1) {
this.inserted[c[i]] = true;
}
this.loadNext(o.data);
},
loadScript = function() {
// YAHOO.log('combining js: ' + js);
if (js.length > startLen) {
YAHOO.util.Get.script(self._filter(js), {
data: self._loading,
onSuccess: callback,
onFailure: self._onFailure,
onTimeout: self._onTimeout,
insertBefore: self.insertBefore,
charset: self.charset,
timeout: self.timeout,
scope: self
});
} else {
this.loadNext();
}
};
// load the css first
// YAHOO.log('combining css: ' + css);
if (css.length > startLen) {
YAHOO.util.Get.css(this._filter(css), {
data: this._loading,
onSuccess: loadScript,
onFailure: this._onFailure,
onTimeout: this._onTimeout,
insertBefore: this.insertBefore,
charset: this.charset,
timeout: this.timeout,
scope: self
});
} else {
loadScript();
}
return;
} else {
// this._combineComplete = true;
this.loadNext(this._loading);
}
},
/**
* inserts the requested modules and their dependencies.
* <code>type</code> can be "js" or "css". Both script and
* css are inserted if type is not provided.
* @method insert
* @param o optional options object
* @param type {string} the type of dependency to insert
*/
insert: function(o, type) {
// if (o) {
// Y.log("insert: " + lang.dump(o, 1) + ", " + type);
// } else {
// Y.log("insert: " + this.toString() + ", " + type);
// }
// build the dependency list
this.calculate(o);
// set a flag to indicate the load has started
this._loading = true;
// flag to indicate we are done with the combo service
// and any additional files will need to be loaded
// individually
// this._combineComplete = false;
// keep the loadType (js, css or undefined) cached
this.loadType = type;
if (this.combine) {
return this._combine();
}
if (!type) {
// Y.log("trying to load css first");
var self = this;
this._internalCallback = function() {
self._internalCallback = null;
self.insert(null, "js");
};
this.insert(null, "css");
return;
}
// start the load
this.loadNext();
},
/**
* Interns the script for the requested modules. The callback is
* provided a reference to the sandboxed YAHOO object. This only
* applies to the script: css can not be sandboxed; css will be
* loaded into the page normally if specified.
* @method sandbox
* @param callback {Function} the callback to exectued when the load is
* complete.
*/
sandbox: function(o, type) {
// if (o) {
// YAHOO.log("sandbox: " + lang.dump(o, 1) + ", " + type);
// } else {
// YAHOO.log("sandbox: " + this.toString() + ", " + type);
// }
var self = this,
success = function(o) {
var idx=o.argument[0], name=o.argument[2];
// store the response in the position it was requested
self._scriptText[idx] = o.responseText;
// YAHOO.log("received: " + o.responseText.substr(0, 100) + ", " + idx);
if (self.onProgress) {
self.onProgress.call(self.scope, {
name: name,
scriptText: o.responseText,
xhrResponse: o,
data: self.data
});
}
// only generate the sandbox once everything is loaded
self._loadCount++;
if (self._loadCount >= self._stopCount) {
// the variable to find
var v = self.varName || "YAHOO";
// wrap the contents of the requested modules in an anonymous function
var t = "(function() {\n";
// return the locally scoped reference.
var b = "\nreturn " + v + ";\n})();";
var ref = eval(t + self._scriptText.join("\n") + b);
self._pushEvents(ref);
if (ref) {
self.onSuccess.call(self.scope, {
reference: ref,
data: self.data
});
} else {
self._onFailure.call(self.varName + " reference failure");
}
}
},
failure = function(o) {
self.onFailure.call(self.scope, {
msg: "XHR failure",
xhrResponse: o,
data: self.data
});
};
self._config(o);
if (!self.onSuccess) {
throw new Error("You must supply an onSuccess handler for your sandbox");
}
self._sandbox = true;
// take care of any css first (this can't be sandboxed)
if (!type || type !== "js") {
self._internalCallback = function() {
self._internalCallback = null;
self.sandbox(null, "js");
};
self.insert(null, "css");
return;
}
// get the connection manager if not on the page
if (!util.Connect) {
// get a new loader instance to load connection.
var ld = new YAHOO.util.YUILoader();
ld.insert({
base: self.base,
filter: self.filter,
require: "connection",
insertBefore: self.insertBefore,
charset: self.charset,
onSuccess: function() {
self.sandbox(null, "js");
},
scope: self
}, "js");
return;
}
self._scriptText = [];
self._loadCount = 0;
self._stopCount = self.sorted.length;
self._xhr = [];
self.calculate();
var s=self.sorted, l=s.length, i, m, url;
for (i=0; i<l; i=i+1) {
m = self.moduleInfo[s[i]];
// undefined modules cause a failure
if (!m) {
self._onFailure("undefined module " + m);
for (var j=0;j<self._xhr.length;j=j+1) {
self._xhr[j].abort();
}
return;
}
// css files should be done
if (m.type !== "js") {
self._loadCount++;
continue;
}
url = m.fullpath;
url = (url) ? self._filter(url) : self._url(m.path);
// YAHOO.log("xhr request: " + url + ", " + i);
var xhrData = {
success: success,
failure: failure,
scope: self,
// [module index, module name, sandbox name]
argument: [i, url, s[i]]
};
self._xhr.push(util.Connect.asyncRequest('GET', url, xhrData));
}
},
/**
* Executed every time a module is loaded, and if we are in a load
* cycle, we attempt to load the next script. Public so that it
* is possible to call this if using a method other than
* YAHOO.register to determine when scripts are fully loaded
* @method loadNext
* @param mname {string} optional the name of the module that has
* been loaded (which is usually why it is time to load the next
* one)
*/
loadNext: function(mname) {
// It is possible that this function is executed due to something
// else one the page loading a YUI module. Only react when we
// are actively loading something
if (!this._loading) {
return;
}
var self = this,
donext = function(o) {
self.loadNext(o.data);
}, successfn, s = this.sorted, len=s.length, i, fn, m, url;
if (mname) {
// if the module that was just loaded isn't what we were expecting,
// continue to wait
if (mname !== this._loading) {
return;
}
// YAHOO.log("loadNext executing, just loaded " + mname);
// The global handler that is called when each module is loaded
// will pass that module name to this function. Storing this
// data to avoid loading the same module multiple times
this.inserted[mname] = true;
if (this.onProgress) {
this.onProgress.call(this.scope, {
name: mname,
data: this.data
});
}
//var o = this.getProvides(mname);
//this.inserted = lang.merge(this.inserted, o);
}
for (i=0; i<len; i=i+1) {
// This.inserted keeps track of what the loader has loaded
if (s[i] in this.inserted) {
// YAHOO.log(s[i] + " alread loaded ");
continue;
}
// Because rollups will cause multiple load notifications
// from YAHOO, loadNext may be called multiple times for
// the same module when loading a rollup. We can safely
// skip the subsequent requests
if (s[i] === this._loading) {
// YAHOO.log("still loading " + s[i] + ", waiting");
return;
}
// log("inserting " + s[i]);
m = this.moduleInfo[s[i]];
if (!m) {
this.onFailure.call(this.scope, {
msg: "undefined module " + m,
data: this.data
});
return;
}
// The load type is stored to offer the possibility to load
// the css separately from the script.
if (!this.loadType || this.loadType === m.type) {
successfn = donext;
this._loading = s[i];
//YAHOO.log("attempting to load " + s[i] + ", " + this.base);
fn = (m.type === "css") ? util.Get.css : util.Get.script;
url = m.fullpath;
url = (url) ? this._filter(url) : this._url(m.path);
// safari 2.x or lower, script, and part of YUI
if (env.ua.webkit && env.ua.webkit < 420 && m.type === "js" &&
!m.varName) {
//YUI.info.moduleInfo[s[i]]) {
//YAHOO.log("using YAHOO env " + s[i] + ", " + m.varName);
successfn = null;
this._useYahooListener = true;
}
fn(url, {
data: s[i],
onSuccess: successfn,
onFailure: this._onFailure,
onTimeout: this._onTimeout,
insertBefore: this.insertBefore,
charset: this.charset,
timeout: this.timeout,
varName: m.varName,
scope: self
});
return;
}
}
// we are finished
this._loading = null;
// internal callback for loading css first
if (this._internalCallback) {
var f = this._internalCallback;
this._internalCallback = null;
f.call(this);
} else if (this.onSuccess) {
this._pushEvents();
this.onSuccess.call(this.scope, {
data: this.data
});
}
},
/**
* In IE, the onAvailable/onDOMReady events need help when Event is
* loaded dynamically
* @method _pushEvents
* @param {Function} optional function reference
* @private
*/
_pushEvents: function(ref) {
var r = ref || YAHOO;
if (r.util && r.util.Event) {
r.util.Event._load();
}
},
/**
* Applies filter
* method _filter
* @return {string} the filtered string
* @private
*/
_filter: function(str) {
var f = this.filter;
return (f) ? str.replace(new RegExp(f.searchExp, 'g'), f.replaceStr) : str;
},
/**
* Generates the full url for a module
* method _url
* @param path {string} the path fragment
* @return {string} the full url
* @private
*/
_url: function(path) {
return this._filter((this.base || "") + path);
}
};
})();
YAHOO.register("yuiloader", YAHOO.util.YUILoader, {version: "2.9.0", build: "2800"});
Y.YUI2 = YAHOO;
}, '2.9.0' ,{"supersedes": ["yui2-yahoo", "yui2-get"]});
|
docs/src/app/components/pages/components/AutoComplete/ExampleSimple.js | ngbrown/material-ui | import React from 'react';
import AutoComplete from 'material-ui/AutoComplete';
export default class AutoCompleteExampleSimple extends React.Component {
constructor(props) {
super(props);
this.state = {
dataSource: [],
};
}
handleUpdateInput = (value) => {
this.setState({
dataSource: [
value,
value + value,
value + value + value,
],
});
};
render() {
return (
<div>
<AutoComplete
hintText="Type anything"
dataSource={this.state.dataSource}
onUpdateInput={this.handleUpdateInput}
/>
<AutoComplete
hintText="Type anything"
dataSource={this.state.dataSource}
onUpdateInput={this.handleUpdateInput}
floatingLabelText="Full width"
fullWidth={true}
/>
</div>
);
}
}
|
src/scripts/views/LoginView.js | IronNation/NCI-trial-search | import Header from './header'
import React from 'react'
class LoginView extends React.Component {
render() {
return (
<div className = 'loginView'>
<Header />
<Login />
<SignUp />
</div>
)
}
}
class Login extends React.Component {
render() {
return (
<div className = 'login'>
<h3>Login</h3>
<input type = 'email' placeholder = 'Login Email'/>
<input type = 'password' placeholder = 'Login password' />
</div>
)
}
}
class SignUp extends React.Component {
render() {
return (
<div className = 'signUp'>
<h3>Sign Up</h3>
<input type = 'email' placeholder = 'SignUp email' />
<input type = 'password' placeholder = 'Create password' />
<input type = 'password' placeholder = 'Confirm password' />
</div>
)
}
}
export default LoginView |
client/modules/App/components/Header/Header.js | leranf/hotwireCarRentalSearch | import React from 'react';
import styles from './Header.css';
export function Header() {
return (
<div className={styles.header}>
<div className={styles.content}>
<h1 style={{ color: 'white' }}>
Search Hotwire Cars!!
</h1>
</div>
</div>
);
}
export default Header;
|
newclient/scripts/components/user/back-to-dashboard/index.js | kuali/research-coi | /*
The Conflict of Interest (COI) module of Kuali Research
Copyright © 2005-2016 Kuali, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
import styles from './style';
import React from 'react';
import {Link} from 'react-router';
export default function BackToDashboard(props) {
return (
<Link to={{pathname: '/coi/new/dashboard'}}>
<div className={`${styles.container} ${props.className}`}>
<div>
<i className={'fa fa-arrow-left'} />
<span className={styles.label}>BACK TO DASHBOARD</span>
</div>
</div>
</Link>
);
}
|
src/App.js | leecade/react-transform-boilerplate | import React, { Component } from 'react';
import { NICE, SUPER_NICE } from './colors';
class Counter extends Component {
constructor(props) {
super(props);
this.state = { counter: 0 };
this.interval = setInterval(() => this.tick(), 1000);
}
tick() {
this.setState({
counter: this.state.counter + this.props.increment
});
}
componentWillUnmount() {
clearInterval(this.interval);
}
render() {
return (
<h1 style={{ color: this.props.color }}>
Counter ({this.props.increment}): {this.state.counter}
</h1>
);
}
}
export class App extends Component {
render() {
return (
<div>
<Counter increment={1} color={NICE} />
<Counter increment={5} color={SUPER_NICE} />
</div>
);
}
} |
packages/material-ui-icons/src/FiberNewTwoTone.js | kybarg/material-ui | import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path d="M9.12 14.47V9.53H8.09v2.88L6.03 9.53H5v4.94h1.03v-2.88l2.1 2.88zm4.12-3.9V9.53h-3.3v4.94h3.3v-1.03h-2.06v-.91h2.06v-1.04h-2.06v-.92zm.82-1.04v4.12c0 .45.37.82.82.82h3.29c.45 0 .82-.37.82-.82V9.53h-1.03v3.71h-.92v-2.89h-1.03v2.9h-.93V9.53h-1.02z" /><path d="M4 6h16v12H4z" opacity=".3" /><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 14H4V6h16v12z" /></React.Fragment>
, 'FiberNewTwoTone');
|
scripts/apps/translations/directives/TranslationReactDropdown.js | ioanpocol/superdesk-client-core | /* eslint-disable react/no-multi-comp */
import React from 'react';
import PropTypes from 'prop-types';
/**
* @ngdoc directive
* @module superdesk.apps.translations
* @name TranslationReactDropdown
*
* @requires React
* @requires item
* @requires className
* @requires TranslationService
* @requires noLanguagesLabel
*
* @param {Object} [langugages] collection of languages
*
* @description Creates dropdown react element with list of available languages
*/
TranslationReactDropdown.$inject = ['item', 'className', 'TranslationService', 'noLanguagesLabel'];
export function TranslationReactDropdown(item, className, TranslationService, noLanguagesLabel) {
var languages = TranslationService.get() || {_items: []};
/*
* Creates specific language button in list
* @return {React} Language button
*/
class TranslateBtn extends React.Component {
constructor(props) {
super(props);
this.markTranslate = this.markTranslate.bind(this);
}
markTranslate(event) {
event.stopPropagation();
TranslationService.set(this.props.item, this.props.language);
}
render() {
var item = this.props.item;
var language = this.props.language;
var isCurrentLang = item.language === language.language;
if (!language.destination) {
return false;
}
return React.createElement(
'button', {
disabled: isCurrentLang,
onClick: this.markTranslate,
},
language.label
);
}
}
TranslateBtn.propTypes = {
item: PropTypes.object,
language: PropTypes.object,
};
/*
* Creates list element for specific language
* @return {React} Single list element
*/
var createTranslateItem = function(language) {
return React.createElement(
'li',
{key: 'language-' + language._id},
React.createElement(TranslateBtn, {item: item, language: language})
);
};
/*
* If there are no languages, print none-langugage message
* @return {React} List element
*/
var noLanguage = function() {
return React.createElement(
'li',
{},
React.createElement(
'button',
{disabled: true},
noLanguagesLabel)
);
};
/*
* Creates list with languages
* @return {React} List element
*/
return React.createElement(
'ul',
{className: className},
languages._items.length ? languages._items.map(createTranslateItem) : React.createElement(noLanguage)
);
}
|
docs/API/swagger-ui-bundle.js | teharrison/AWE | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["esprima"],t):"object"==typeof exports?exports.SwaggerUIBundle=t(function(){try{return require("esprima")}catch(e){}}()):e.SwaggerUIBundle=t(e.esprima)}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=481)}([function(e,t,n){"use strict";e.exports=n(100)},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:J(e)}function r(e){return s(e)?e:Y(e)}function o(e){return u(e)?e:K(e)}function i(e){return a(e)&&!c(e)?e:G(e)}function a(e){return!(!e||!e[p])}function s(e){return!(!e||!e[f])}function u(e){return!(!e||!e[h])}function c(e){return s(e)||u(e)}function l(e){return!(!e||!e[d])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=u,n.isAssociative=c,n.isOrdered=l,n.Keyed=r,n.Indexed=o,n.Set=i;var p="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",m=5,v=1<<m,g=v-1,y={},b={value:!1},_={value:!1};function w(e){return e.value=!1,e}function x(e){e&&(e.value=!0)}function E(){}function S(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function C(e){return void 0===e.size&&(e.size=e.__iterate(O)),e.size}function k(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?C(e)+t:t}function O(){return!0}function A(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function T(e,t){return P(e,t,0)}function j(e,t){return P(e,t,t)}function P(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var I=0,M=1,N=2,R="function"==typeof Symbol&&Symbol.iterator,D="@@iterator",L=R||D;function U(e){this.next=e}function q(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function F(){return{value:void 0,done:!0}}function z(e){return!!H(e)}function B(e){return e&&"function"==typeof e.next}function V(e){var t=H(e);return t&&t.call(e)}function H(e){var t=e&&(R&&e[R]||e[D]);if("function"==typeof t)return t}function W(e){return e&&"number"==typeof e.length}function J(e){return null==e?ie():a(e)?e.toSeq():function(e){var t=ue(e)||"object"==typeof e&&new te(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function Y(e){return null==e?ie().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():ae(e)}function K(e){return null==e?ie():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():se(e)}function G(e){return(null==e?ie():a(e)?s(e)?e.entrySeq():e:se(e)).toSetSeq()}U.prototype.toString=function(){return"[Iterator]"},U.KEYS=I,U.VALUES=M,U.ENTRIES=N,U.prototype.inspect=U.prototype.toSource=function(){return this.toString()},U.prototype[L]=function(){return this},t(J,n),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},J.prototype.__iterate=function(e,t){return ce(this,e,t,!0)},J.prototype.__iterator=function(e,t){return le(this,e,t,!0)},t(Y,J),Y.prototype.toKeyedSeq=function(){return this},t(K,J),K.of=function(){return K(arguments)},K.prototype.toIndexedSeq=function(){return this},K.prototype.toString=function(){return this.__toString("Seq [","]")},K.prototype.__iterate=function(e,t){return ce(this,e,t,!1)},K.prototype.__iterator=function(e,t){return le(this,e,t,!1)},t(G,J),G.of=function(){return G(arguments)},G.prototype.toSetSeq=function(){return this},J.isSeq=oe,J.Keyed=Y,J.Set=G,J.Indexed=K;var $,Z,X,Q="@@__IMMUTABLE_SEQ__@@";function ee(e){this._array=e,this.size=e.length}function te(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function ne(e){this._iterable=e,this.size=e.length||e.size}function re(e){this._iterator=e,this._iteratorCache=[]}function oe(e){return!(!e||!e[Q])}function ie(){return $||($=new ee([]))}function ae(e){var t=Array.isArray(e)?new ee(e).fromEntrySeq():B(e)?new re(e).fromEntrySeq():z(e)?new ne(e).fromEntrySeq():"object"==typeof e?new te(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function se(e){var t=ue(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ue(e){return W(e)?new ee(e):B(e)?new re(e):z(e)?new ne(e):void 0}function ce(e,t,n,r){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var s=o[n?i-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function le(e,t,n,r){var o=e._cache;if(o){var i=o.length-1,a=0;return new U(function(){var e=o[n?i-a:a];return a++>i?{value:void 0,done:!0}:q(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function pe(e,t){return t?function e(t,n,r,o){return Array.isArray(n)?t.call(o,r,K(n).map(function(r,o){return e(t,r,o,n)})):he(n)?t.call(o,r,Y(n).map(function(r,o){return e(t,r,o,n)})):n}(t,e,"",{"":e}):fe(e)}function fe(e){return Array.isArray(e)?K(e).map(fe).toList():he(e)?Y(e).map(fe).toMap():e}function he(e){return e&&(e.constructor===Object||void 0===e.constructor)}function de(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function me(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||u(e)!==u(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!c(e);if(l(e)){var r=e.entries();return t.every(function(e,t){var o=r.next().value;return o&&de(o[1],e)&&(n||de(o[0],t))})&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var p=!0,f=t.__iterate(function(t,r){if(n?!e.has(t):o?!de(t,e.get(r,y)):!de(e.get(r,y),t))return p=!1,!1});return p&&e.size===f}function ve(e,t){if(!(this instanceof ve))return new ve(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(Z)return Z;Z=this}}function ge(e,t){if(!e)throw new Error(t)}function ye(e,t,n){if(!(this instanceof ye))return new ye(e,t,n);if(ge(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(X)return X;X=this}}function be(){throw TypeError("Abstract")}function _e(){}function we(){}function xe(){}J.prototype[Q]=!0,t(ee,K),ee.prototype.get=function(e,t){return this.has(e)?this._array[k(this,e)]:t},ee.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},ee.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new U(function(){return o>r?{value:void 0,done:!0}:q(e,o,n[t?r-o++:o++])})},t(te,Y),te.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},te.prototype.has=function(e){return this._object.hasOwnProperty(e)},te.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[t?o-i:i];if(!1===e(n[a],a,this))return i+1}return i},te.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,i=0;return new U(function(){var a=r[t?o-i:i];return i++>o?{value:void 0,done:!0}:q(e,a,n[a])})},te.prototype[d]=!0,t(ne,K),ne.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=V(n),o=0;if(B(r))for(var i;!(i=r.next()).done&&!1!==e(i.value,o++,this););return o},ne.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=V(n);if(!B(r))return new U(F);var o=0;return new U(function(){var t=r.next();return t.done?t:q(e,o++,t.value)})},t(re,K),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,i=0;i<o.length;)if(!1===e(o[i],i++,this))return i;for(;!(n=r.next()).done;){var a=n.value;if(o[i]=a,!1===e(a,i++,this))break}return i},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new U(function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return q(e,o,r[o++])})},t(ve,K),ve.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},ve.prototype.get=function(e,t){return this.has(e)?this._value:t},ve.prototype.includes=function(e){return de(this._value,e)},ve.prototype.slice=function(e,t){var n=this.size;return A(e,t,n)?this:new ve(this._value,j(t,n)-T(e,n))},ve.prototype.reverse=function(){return this},ve.prototype.indexOf=function(e){return de(this._value,e)?0:-1},ve.prototype.lastIndexOf=function(e){return de(this._value,e)?this.size:-1},ve.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},ve.prototype.__iterator=function(e,t){var n=this,r=0;return new U(function(){return r<n.size?q(e,r++,n._value):{value:void 0,done:!0}})},ve.prototype.equals=function(e){return e instanceof ve?de(this._value,e._value):me(e)},t(ye,K),ye.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},ye.prototype.get=function(e,t){return this.has(e)?this._start+k(this,e)*this._step:t},ye.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},ye.prototype.slice=function(e,t){return A(e,t,this.size)?this:(e=T(e,this.size),(t=j(t,this.size))<=e?new ye(0,0):new ye(this.get(e,this._end),this.get(t,this._end),this._step))},ye.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},ye.prototype.lastIndexOf=function(e){return this.indexOf(e)},ye.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;i<=n;i++){if(!1===e(o,i,this))return i+1;o+=t?-r:r}return i},ye.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;return new U(function(){var a=o;return o+=t?-r:r,i>n?{value:void 0,done:!0}:q(e,i++,a)})},ye.prototype.equals=function(e){return e instanceof ye?this._start===e._start&&this._end===e._end&&this._step===e._step:me(this,e)},t(be,n),t(_e,be),t(we,be),t(xe,be),be.Keyed=_e,be.Indexed=we,be.Set=xe;var Ee="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Se(e){return e>>>1&1073741824|3221225471&e}function Ce(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return Se(n)}if("string"===t)return e.length>Me?function(e){var t=De[e];return void 0===t&&(t=ke(e),Re===Ne&&(Re=0,De={}),Re++,De[e]=t),t}(e):ke(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(je&&void 0!==(t=Oe.get(e)))return t;if(void 0!==(t=e[Ie]))return t;if(!Te){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Ie]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Pe,1073741824&Pe&&(Pe=0),je)Oe.set(e,t);else{if(void 0!==Ae&&!1===Ae(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Te)Object.defineProperty(e,Ie,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Ie]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Ie]=t}}return t}(e);if("function"==typeof e.toString)return ke(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ke(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Se(t)}var Oe,Ae=Object.isExtensible,Te=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),je="function"==typeof WeakMap;je&&(Oe=new WeakMap);var Pe=0,Ie="__immutablehash__";"function"==typeof Symbol&&(Ie=Symbol(Ie));var Me=16,Ne=255,Re=0,De={};function Le(e){ge(e!==1/0,"Cannot perform this action with an infinite size.")}function Ue(e){return null==e?Xe():qe(e)&&!l(e)?e:Xe().withMutations(function(t){var n=r(e);Le(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function qe(e){return!(!e||!e[ze])}t(Ue,_e),Ue.of=function(){var t=e.call(arguments,0);return Xe().withMutations(function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}})},Ue.prototype.toString=function(){return this.__toString("Map {","}")},Ue.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Ue.prototype.set=function(e,t){return Qe(this,e,t)},Ue.prototype.setIn=function(e,t){return this.updateIn(e,y,function(){return t})},Ue.prototype.remove=function(e){return Qe(this,e,y)},Ue.prototype.deleteIn=function(e){return this.updateIn(e,function(){return y})},Ue.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Ue.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=function e(t,n,r,o){var i=t===y,a=n.next();if(a.done){var s=i?r:t,u=o(s);return u===s?t:u}ge(i||t&&t.set,"invalid keyPath");var c=a.value,l=i?y:t.get(c,y),p=e(l,n,r,o);return p===l?t:p===y?t.remove(c):(i?Xe():t).set(c,p)}(this,rn(e),t,n);return r===y?void 0:r},Ue.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Xe()},Ue.prototype.merge=function(){return rt(this,void 0,arguments)},Ue.prototype.mergeWith=function(t){var n=e.call(arguments,1);return rt(this,t,n)},Ue.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Xe(),function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]})},Ue.prototype.mergeDeep=function(){return rt(this,ot,arguments)},Ue.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return rt(this,it(t),n)},Ue.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Xe(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]})},Ue.prototype.sort=function(e){return Tt(Jt(this,e))},Ue.prototype.sortBy=function(e,t){return Tt(Jt(this,t,e))},Ue.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Ue.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new E)},Ue.prototype.asImmutable=function(){return this.__ensureOwner()},Ue.prototype.wasAltered=function(){return this.__altered},Ue.prototype.__iterator=function(e,t){return new Ke(this,e,t)},Ue.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},Ue.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ze(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Ue.isMap=qe;var Fe,ze="@@__IMMUTABLE_MAP__@@",Be=Ue.prototype;function Ve(e,t){this.ownerID=e,this.entries=t}function He(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function We(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Je(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Ye(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function Ke(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&$e(e._root)}function Ge(e,t){return q(e,t[0],t[1])}function $e(e,t){return{node:e,index:0,__prev:t}}function Ze(e,t,n,r){var o=Object.create(Be);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Xe(){return Fe||(Fe=Ze(0))}function Qe(e,t,n){var r,o;if(e._root){var i=w(b),a=w(_);if(r=et(e._root,e.__ownerID,0,void 0,t,n,i,a),!a.value)return e;o=e.size+(i.value?n===y?-1:1:0)}else{if(n===y)return e;o=1,r=new Ve(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Ze(o,r):Xe()}function et(e,t,n,r,o,i,a,s){return e?e.update(t,n,r,o,i,a,s):i===y?e:(x(s),x(a),new Ye(t,r,[o,i]))}function tt(e){return e.constructor===Ye||e.constructor===Je}function nt(e,t,n,r,o){if(e.keyHash===r)return new Je(t,r,[e.entry,o]);var i,a=(0===n?e.keyHash:e.keyHash>>>n)&g,s=(0===n?r:r>>>n)&g,u=a===s?[nt(e,t,n+m,r,o)]:(i=new Ye(t,r,o),a<s?[e,i]:[i,e]);return new He(t,1<<a|1<<s,u)}function rt(e,t,n){for(var o=[],i=0;i<n.length;i++){var s=n[i],u=r(s);a(s)||(u=u.map(function(e){return pe(e)})),o.push(u)}return at(e,t,o)}function ot(e,t,n){return e&&e.mergeDeep&&a(t)?e.mergeDeep(t):de(e,t)?e:t}function it(e){return function(t,n,r){if(t&&t.mergeDeepWith&&a(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return de(t,o)?t:o}}function at(e,t,n){return 0===(n=n.filter(function(e){return 0!==e.size})).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations(function(e){for(var r=t?function(n,r){e.update(r,y,function(e){return e===y?n:t(e,n,r)})}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)}):e.constructor(n[0])}function st(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function ut(e,t,n,r){var o=r?e:S(e);return o[t]=n,o}Be[ze]=!0,Be.delete=Be.remove,Be.removeIn=Be.deleteIn,Ve.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(de(n,o[i][0]))return o[i][1];return r},Ve.prototype.update=function(e,t,n,r,o,i,a){for(var s=o===y,u=this.entries,c=0,l=u.length;c<l&&!de(r,u[c][0]);c++);var p=c<l;if(p?u[c][1]===o:s)return this;if(x(a),(s||!p)&&x(i),!s||1!==u.length){if(!p&&!s&&u.length>=ct)return function(e,t,n,r){e||(e=new E);for(var o=new Ye(e,Ce(n),[n,r]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}(e,u,r,o);var f=e&&e===this.ownerID,h=f?u:S(u);return p?s?c===l-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Ve(e,h)}},He.prototype.get=function(e,t,n,r){void 0===t&&(t=Ce(n));var o=1<<((0===e?t:t>>>e)&g),i=this.bitmap;return 0==(i&o)?r:this.nodes[st(i&o-1)].get(e+m,t,n,r)},He.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Ce(r));var s=(0===t?n:n>>>t)&g,u=1<<s,c=this.bitmap,l=0!=(c&u);if(!l&&o===y)return this;var p=st(c&u-1),f=this.nodes,h=l?f[p]:void 0,d=et(h,e,t+m,n,r,o,i,a);if(d===h)return this;if(!l&&d&&f.length>=lt)return function(e,t,n,r,o){for(var i=0,a=new Array(v),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[i++]:void 0;return a[r]=o,new We(e,i+1,a)}(e,f,c,s,d);if(l&&!d&&2===f.length&&tt(f[1^p]))return f[1^p];if(l&&d&&1===f.length&&tt(d))return d;var b=e&&e===this.ownerID,_=l?d?c:c^u:c|u,w=l?d?ut(f,p,d,b):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),i=0,a=0;a<r;a++)a===t&&(i=1),o[a]=e[a+i];return o}(f,p,b):function(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var i=new Array(o),a=0,s=0;s<o;s++)s===t?(i[s]=n,a=-1):i[s]=e[s+a];return i}(f,p,d,b);return b?(this.bitmap=_,this.nodes=w,this):new He(e,_,w)},We.prototype.get=function(e,t,n,r){void 0===t&&(t=Ce(n));var o=(0===e?t:t>>>e)&g,i=this.nodes[o];return i?i.get(e+m,t,n,r):r},We.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Ce(r));var s=(0===t?n:n>>>t)&g,u=o===y,c=this.nodes,l=c[s];if(u&&!l)return this;var p=et(l,e,t+m,n,r,o,i,a);if(p===l)return this;var f=this.count;if(l){if(!p&&--f<pt)return function(e,t,n,r){for(var o=0,i=0,a=new Array(n),s=0,u=1,c=t.length;s<c;s++,u<<=1){var l=t[s];void 0!==l&&s!==r&&(o|=u,a[i++]=l)}return new He(e,o,a)}(e,c,f,s)}else f++;var h=e&&e===this.ownerID,d=ut(c,s,p,h);return h?(this.count=f,this.nodes=d,this):new We(e,f,d)},Je.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(de(n,o[i][0]))return o[i][1];return r},Je.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Ce(r));var s=o===y;if(n!==this.keyHash)return s?this:(x(a),x(i),nt(this,e,t,n,[r,o]));for(var u=this.entries,c=0,l=u.length;c<l&&!de(r,u[c][0]);c++);var p=c<l;if(p?u[c][1]===o:s)return this;if(x(a),(s||!p)&&x(i),s&&2===l)return new Ye(e,this.keyHash,u[1^c]);var f=e&&e===this.ownerID,h=f?u:S(u);return p?s?c===l-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Je(e,this.keyHash,h)},Ye.prototype.get=function(e,t,n,r){return de(n,this.entry[0])?this.entry[1]:r},Ye.prototype.update=function(e,t,n,r,o,i,a){var s=o===y,u=de(r,this.entry[0]);return(u?o===this.entry[1]:s)?this:(x(a),s?void x(i):u?e&&e===this.ownerID?(this.entry[1]=o,this):new Ye(e,this.keyHash,[r,o]):(x(i),nt(this,e,t,Ce(r),[r,o])))},Ve.prototype.iterate=Je.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},He.prototype.iterate=We.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var i=n[t?o-r:r];if(i&&!1===i.iterate(e,t))return!1}},Ye.prototype.iterate=function(e,t){return e(this.entry)},t(Ke,U),Ke.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return Ge(e,r.entry)}else if(r.entries){if(n=r.entries.length-1,o<=n)return Ge(e,r.entries[this._reverse?n-o:o])}else if(n=r.nodes.length-1,o<=n){var i=r.nodes[this._reverse?n-o:o];if(i){if(i.entry)return Ge(e,i.entry);t=this._stack=$e(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var ct=v/4,lt=v/2,pt=v/4;function ft(e){var t=xt();if(null==e)return t;if(ht(e))return e;var n=o(e),r=n.size;return 0===r?t:(Le(r),r>0&&r<v?wt(0,r,m,null,new vt(n.toArray())):t.withMutations(function(e){e.setSize(r),n.forEach(function(t,n){return e.set(n,t)})}))}function ht(e){return!(!e||!e[dt])}t(ft,we),ft.of=function(){return this(arguments)},ft.prototype.toString=function(){return this.__toString("List [","]")},ft.prototype.get=function(e,t){if((e=k(this,e))>=0&&e<this.size){var n=Ct(this,e+=this._origin);return n&&n.array[e&g]}return t},ft.prototype.set=function(e,t){return function(e,t,n){if((t=k(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations(function(e){t<0?kt(e,t).set(0,n):kt(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,o=e._root,i=w(_);return t>=At(e._capacity)?r=Et(r,e.__ownerID,0,t,n,i):o=Et(o,e.__ownerID,e._level,t,n,i),i.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):wt(e._origin,e._capacity,e._level,o,r):e}(this,e,t)},ft.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},ft.prototype.insert=function(e,t){return this.splice(e,0,t)},ft.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=m,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):xt()},ft.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(n){kt(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])})},ft.prototype.pop=function(){return kt(this,0,-1)},ft.prototype.unshift=function(){var e=arguments;return this.withMutations(function(t){kt(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])})},ft.prototype.shift=function(){return kt(this,1)},ft.prototype.merge=function(){return Ot(this,void 0,arguments)},ft.prototype.mergeWith=function(t){var n=e.call(arguments,1);return Ot(this,t,n)},ft.prototype.mergeDeep=function(){return Ot(this,ot,arguments)},ft.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return Ot(this,it(t),n)},ft.prototype.setSize=function(e){return kt(this,0,e)},ft.prototype.slice=function(e,t){var n=this.size;return A(e,t,n)?this:kt(this,T(e,n),j(t,n))},ft.prototype.__iterator=function(e,t){var n=0,r=_t(this,t);return new U(function(){var t=r();return t===bt?{value:void 0,done:!0}:q(e,n++,t)})},ft.prototype.__iterate=function(e,t){for(var n,r=0,o=_t(this,t);(n=o())!==bt&&!1!==e(n,r++,this););return r},ft.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?wt(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},ft.isList=ht;var dt="@@__IMMUTABLE_LIST__@@",mt=ft.prototype;function vt(e,t){this.array=e,this.ownerID=t}mt[dt]=!0,mt.delete=mt.remove,mt.setIn=Be.setIn,mt.deleteIn=mt.removeIn=Be.removeIn,mt.update=Be.update,mt.updateIn=Be.updateIn,mt.mergeIn=Be.mergeIn,mt.mergeDeepIn=Be.mergeDeepIn,mt.withMutations=Be.withMutations,mt.asMutable=Be.asMutable,mt.asImmutable=Be.asImmutable,mt.wasAltered=Be.wasAltered,vt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&g;if(r>=this.array.length)return new vt([],e);var o,i=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-m,n))===a&&i)return this}if(i&&!o)return this;var s=St(this,e);if(!i)for(var u=0;u<r;u++)s.array[u]=void 0;return o&&(s.array[r]=o),s},vt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,o=n-1>>>t&g;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((r=i&&i.removeAfter(e,t-m,n))===i&&o===this.array.length-1)return this}var a=St(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var gt,yt,bt={};function _t(e,t){var n=e._origin,r=e._capacity,o=At(r),i=e._tail;return a(e._root,e._level,0);function a(e,s,u){return 0===s?function(e,a){var s=a===o?i&&i.array:e&&e.array,u=a>n?0:n-a,c=r-a;return c>v&&(c=v),function(){if(u===c)return bt;var e=t?--c:u++;return s&&s[e]}}(e,u):function(e,o,i){var s,u=e&&e.array,c=i>n?0:n-i>>o,l=1+(r-i>>o);return l>v&&(l=v),function(){for(;;){if(s){var e=s();if(e!==bt)return e;s=null}if(c===l)return bt;var n=t?--l:c++;s=a(u&&u[n],o-m,i+(n<<o))}}}(e,s,u)}}function wt(e,t,n,r,o,i,a){var s=Object.create(mt);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=o,s.__ownerID=i,s.__hash=a,s.__altered=!1,s}function xt(){return gt||(gt=wt(0,0,m))}function Et(e,t,n,r,o,i){var a,s=r>>>n&g,u=e&&s<e.array.length;if(!u&&void 0===o)return e;if(n>0){var c=e&&e.array[s],l=Et(c,t,n-m,r,o,i);return l===c?e:((a=St(e,t)).array[s]=l,a)}return u&&e.array[s]===o?e:(x(i),a=St(e,t),void 0===o&&s===a.array.length-1?a.array.pop():a.array[s]=o,a)}function St(e,t){return t&&e&&t===e.ownerID?e:new vt(e?e.array.slice():[],t)}function Ct(e,t){if(t>=At(e._capacity))return e._tail;if(t<1<<e._level+m){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&g],r-=m;return n}}function kt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new E,o=e._origin,i=e._capacity,a=o+t,s=void 0===n?i:n<0?i+n:o+n;if(a===o&&s===i)return e;if(a>=s)return e.clear();for(var u=e._level,c=e._root,l=0;a+l<0;)c=new vt(c&&c.array.length?[void 0,c]:[],r),l+=1<<(u+=m);l&&(a+=l,o+=l,s+=l,i+=l);for(var p=At(i),f=At(s);f>=1<<u+m;)c=new vt(c&&c.array.length?[c]:[],r),u+=m;var h=e._tail,d=f<p?Ct(e,s-1):f>p?new vt([],r):h;if(h&&f>p&&a<i&&h.array.length){for(var v=c=St(c,r),y=u;y>m;y-=m){var b=p>>>y&g;v=v.array[b]=St(v.array[b],r)}v.array[p>>>m&g]=h}if(s<i&&(d=d&&d.removeAfter(r,0,s)),a>=f)a-=f,s-=f,u=m,c=null,d=d&&d.removeBefore(r,0,a);else if(a>o||f<p){for(l=0;c;){var _=a>>>u&g;if(_!==f>>>u&g)break;_&&(l+=(1<<u)*_),u-=m,c=c.array[_]}c&&a>o&&(c=c.removeBefore(r,u,a-l)),c&&f<p&&(c=c.removeAfter(r,u,f-l)),l&&(a-=l,s-=l)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=u,e._root=c,e._tail=d,e.__hash=void 0,e.__altered=!0,e):wt(a,s,u,c,d)}function Ot(e,t,n){for(var r=[],i=0,s=0;s<n.length;s++){var u=n[s],c=o(u);c.size>i&&(i=c.size),a(u)||(c=c.map(function(e){return pe(e)})),r.push(c)}return i>e.size&&(e=e.setSize(i)),at(e,t,r)}function At(e){return e<v?0:e-1>>>m<<m}function Tt(e){return null==e?It():jt(e)?e:It().withMutations(function(t){var n=r(e);Le(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function jt(e){return qe(e)&&l(e)}function Pt(e,t,n,r){var o=Object.create(Tt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function It(){return yt||(yt=Pt(Xe(),xt()))}function Mt(e,t,n){var r,o,i=e._map,a=e._list,s=i.get(t),u=void 0!==s;if(n===y){if(!u)return e;a.size>=v&&a.size>=2*i.size?(o=a.filter(function(e,t){return void 0!==e&&s!==t}),r=o.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=i.remove(t),o=s===a.size-1?a.pop():a.set(s,void 0))}else if(u){if(n===a.get(s)[1])return e;r=i,o=a.set(s,[t,n])}else r=i.set(t,a.size),o=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Pt(r,o)}function Nt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Rt(e){this._iter=e,this.size=e.size}function Dt(e){this._iter=e,this.size=e.size}function Lt(e){this._iter=e,this.size=e.size}function Ut(e){var t=en(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=tn,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===N){var r=e.__iterator(t,n);return new U(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===M?I:M,n)},t}function qt(e,t,n){var r=en(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var i=e.get(r,y);return i===y?o:t.call(n,i,r,e)},r.__iterateUncached=function(r,o){var i=this;return e.__iterate(function(e,o,a){return!1!==r(t.call(n,e,o,a),o,i)},o)},r.__iteratorUncached=function(r,o){var i=e.__iterator(N,o);return new U(function(){var o=i.next();if(o.done)return o;var a=o.value,s=a[0];return q(r,s,t.call(n,a[1],s,e),o)})},r}function Ft(e,t){var n=en(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Ut(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=tn,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function zt(e,t,n,r){var o=en(e);return r&&(o.has=function(r){var o=e.get(r,y);return o!==y&&!!t.call(n,o,r,e)},o.get=function(r,o){var i=e.get(r,y);return i!==y&&t.call(n,i,r,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,s=0;return e.__iterate(function(e,i,u){if(t.call(n,e,i,u))return s++,o(e,r?i:s-1,a)},i),s},o.__iteratorUncached=function(o,i){var a=e.__iterator(N,i),s=0;return new U(function(){for(;;){var i=a.next();if(i.done)return i;var u=i.value,c=u[0],l=u[1];if(t.call(n,l,c,e))return q(o,r?c:s++,l,i)}})},o}function Bt(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=o:n|=0),A(t,n,o))return e;var i=T(t,o),a=j(n,o);if(i!=i||a!=a)return Bt(e.toSeq().cacheResult(),t,n,r);var s,u=a-i;u==u&&(s=u<0?0:u);var c=en(e);return c.size=0===s?s:e.size&&s||void 0,!r&&oe(e)&&s>=0&&(c.get=function(t,n){return(t=k(this,t))>=0&&t<s?e.get(t+i,n):n}),c.__iterateUncached=function(t,n){var o=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,u=!0,c=0;return e.__iterate(function(e,n){if(!u||!(u=a++<i))return c++,!1!==t(e,r?n:c-1,o)&&c!==s}),c},c.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var o=0!==s&&e.__iterator(t,n),a=0,u=0;return new U(function(){for(;a++<i;)o.next();if(++u>s)return{value:void 0,done:!0};var e=o.next();return r||t===M?e:q(t,u-1,t===I?void 0:e.value[1],e)})},c}function Vt(e,t,n,r){var o=en(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var s=!0,u=0;return e.__iterate(function(e,i,c){if(!s||!(s=t.call(n,e,i,c)))return u++,o(e,r?i:u-1,a)}),u},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var s=e.__iterator(N,i),u=!0,c=0;return new U(function(){var e,i,l;do{if((e=s.next()).done)return r||o===M?e:q(o,c++,o===I?void 0:e.value[1],e);var p=e.value;i=p[0],l=p[1],u&&(u=t.call(n,l,i,a))}while(u);return o===N?e:q(o,i,l,e)})},o}function Ht(e,t){var n=s(e),o=[e].concat(t).map(function(e){return a(e)?n&&(e=r(e)):e=n?ae(e):se(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||n&&s(i)||u(e)&&u(i))return i}var c=new ee(o);return n?c=c.toKeyedSeq():u(e)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=o.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),c}function Wt(e,t,n){var r=en(e);return r.__iterateUncached=function(r,o){var i=0,s=!1;return function e(u,c){var l=this;u.__iterate(function(o,u){return(!t||c<t)&&a(o)?e(o,c+1):!1===r(o,n?u:i++,l)&&(s=!0),!s},o)}(e,0),i},r.__iteratorUncached=function(r,o){var i=e.__iterator(r,o),s=[],u=0;return new U(function(){for(;i;){var e=i.next();if(!1===e.done){var c=e.value;if(r===N&&(c=c[1]),t&&!(s.length<t)||!a(c))return n?e:q(r,u++,c,e);s.push(i),i=c.__iterator(r,o)}else i=s.pop()}return{value:void 0,done:!0}})},r}function Jt(e,t,n){t||(t=nn);var r=s(e),o=0,i=e.toSeq().map(function(t,r){return[r,t,o++,n?n(t,r,e):t]}).toArray();return i.sort(function(e,n){return t(e[3],n[3])||e[2]-n[2]}).forEach(r?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),r?Y(i):u(e)?K(i):G(i)}function Yt(e,t,n){if(t||(t=nn),n){var r=e.toSeq().map(function(t,r){return[t,n(t,r,e)]}).reduce(function(e,n){return Kt(t,e[1],n[1])?n:e});return r&&r[0]}return e.reduce(function(e,n){return Kt(t,e,n)?n:e})}function Kt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(null==n||n!=n)||r>0}function Gt(e,t,r){var o=en(e);return o.size=new ee(r).map(function(e){return e.size}).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(M,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map(function(e){return e=n(e),V(o?e.reverse():e)}),a=0,s=!1;return new U(function(){var n;return s||(n=i.map(function(e){return e.next()}),s=n.some(function(e){return e.done})),s?{value:void 0,done:!0}:q(e,a++,t.apply(null,n.map(function(e){return e.value})))})},o}function $t(e,t){return oe(e)?t:e.constructor(t)}function Zt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Xt(e){return Le(e.size),C(e)}function Qt(e){return s(e)?r:u(e)?o:i}function en(e){return Object.create((s(e)?Y:u(e)?K:G).prototype)}function tn(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):J.prototype.cacheResult.call(this)}function nn(e,t){return e>t?1:e<t?-1:0}function rn(e){var t=V(e);if(!t){if(!W(e))throw new TypeError("Expected iterable or array-like: "+e);t=V(n(e))}return t}function on(e,t){var n,r=function(i){if(i instanceof r)return i;if(!(this instanceof r))return new r(i);if(!n){n=!0;var a=Object.keys(e);!function(e,t){try{t.forEach(function(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){ge(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}.bind(void 0,e))}catch(e){}}(o,a),o.size=a.length,o._name=t,o._keys=a,o._defaultValues=e}this._map=Ue(i)},o=r.prototype=Object.create(an);return o.constructor=r,r}t(Tt,Ue),Tt.of=function(){return this(arguments)},Tt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Tt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Tt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):It()},Tt.prototype.set=function(e,t){return Mt(this,e,t)},Tt.prototype.remove=function(e){return Mt(this,e,y)},Tt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Tt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Tt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Tt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Pt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Tt.isOrderedMap=jt,Tt.prototype[d]=!0,Tt.prototype.delete=Tt.prototype.remove,t(Nt,Y),Nt.prototype.get=function(e,t){return this._iter.get(e,t)},Nt.prototype.has=function(e){return this._iter.has(e)},Nt.prototype.valueSeq=function(){return this._iter.valueSeq()},Nt.prototype.reverse=function(){var e=this,t=Ft(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},Nt.prototype.map=function(e,t){var n=this,r=qt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},Nt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Xt(this):0,function(o){return e(o,t?--n:n++,r)}),t)},Nt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(M,t),r=t?Xt(this):0;return new U(function(){var o=n.next();return o.done?o:q(e,t?--r:r++,o.value,o)})},Nt.prototype[d]=!0,t(Rt,K),Rt.prototype.includes=function(e){return this._iter.includes(e)},Rt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},Rt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t),r=0;return new U(function(){var t=n.next();return t.done?t:q(e,r++,t.value,t)})},t(Dt,G),Dt.prototype.has=function(e){return this._iter.includes(e)},Dt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},Dt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new U(function(){var t=n.next();return t.done?t:q(e,t.value,t.value,t)})},t(Lt,Y),Lt.prototype.entrySeq=function(){return this._iter.toSeq()},Lt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){Zt(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},Lt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new U(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){Zt(r);var o=a(r);return q(e,o?r.get(0):r[0],o?r.get(1):r[1],t)}}})},Rt.prototype.cacheResult=Nt.prototype.cacheResult=Dt.prototype.cacheResult=Lt.prototype.cacheResult=tn,t(on,_e),on.prototype.toString=function(){return this.__toString(un(this)+" {","}")},on.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},on.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},on.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=sn(this,Xe()))},on.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+un(this));if(this._map&&!this._map.has(e)){var n=this._defaultValues[e];if(t===n)return this}var r=this._map&&this._map.set(e,t);return this.__ownerID||r===this._map?this:sn(this,r)},on.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:sn(this,t)},on.prototype.wasAltered=function(){return this._map.wasAltered()},on.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterator(e,t)},on.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterate(e,t)},on.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?sn(this,t,e):(this.__ownerID=e,this._map=t,this)};var an=on.prototype;function sn(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function un(e){return e._name||e.constructor.name||"Record"}function cn(e){return null==e?vn():ln(e)&&!l(e)?e:vn().withMutations(function(t){var n=i(e);Le(n.size),n.forEach(function(e){return t.add(e)})})}function ln(e){return!(!e||!e[fn])}an.delete=an.remove,an.deleteIn=an.removeIn=Be.removeIn,an.merge=Be.merge,an.mergeWith=Be.mergeWith,an.mergeIn=Be.mergeIn,an.mergeDeep=Be.mergeDeep,an.mergeDeepWith=Be.mergeDeepWith,an.mergeDeepIn=Be.mergeDeepIn,an.setIn=Be.setIn,an.update=Be.update,an.updateIn=Be.updateIn,an.withMutations=Be.withMutations,an.asMutable=Be.asMutable,an.asImmutable=Be.asImmutable,t(cn,xe),cn.of=function(){return this(arguments)},cn.fromKeys=function(e){return this(r(e).keySeq())},cn.prototype.toString=function(){return this.__toString("Set {","}")},cn.prototype.has=function(e){return this._map.has(e)},cn.prototype.add=function(e){return dn(this,this._map.set(e,!0))},cn.prototype.remove=function(e){return dn(this,this._map.remove(e))},cn.prototype.clear=function(){return dn(this,this._map.clear())},cn.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter(function(e){return 0!==e.size})).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach(function(t){return e.add(t)})}):this.constructor(t[0])},cn.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map(function(e){return i(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.every(function(e){return e.includes(n)})||e.remove(n)})})},cn.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map(function(e){return i(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.some(function(e){return e.includes(n)})&&e.remove(n)})})},cn.prototype.merge=function(){return this.union.apply(this,arguments)},cn.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},cn.prototype.sort=function(e){return gn(Jt(this,e))},cn.prototype.sortBy=function(e,t){return gn(Jt(this,t,e))},cn.prototype.wasAltered=function(){return this._map.wasAltered()},cn.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate(function(t,r){return e(r,r,n)},t)},cn.prototype.__iterator=function(e,t){return this._map.map(function(e,t){return t}).__iterator(e,t)},cn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},cn.isSet=ln;var pn,fn="@@__IMMUTABLE_SET__@@",hn=cn.prototype;function dn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function mn(e,t){var n=Object.create(hn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function vn(){return pn||(pn=mn(Xe()))}function gn(e){return null==e?xn():yn(e)?e:xn().withMutations(function(t){var n=i(e);Le(n.size),n.forEach(function(e){return t.add(e)})})}function yn(e){return ln(e)&&l(e)}hn[fn]=!0,hn.delete=hn.remove,hn.mergeDeep=hn.merge,hn.mergeDeepWith=hn.mergeWith,hn.withMutations=Be.withMutations,hn.asMutable=Be.asMutable,hn.asImmutable=Be.asImmutable,hn.__empty=vn,hn.__make=mn,t(gn,cn),gn.of=function(){return this(arguments)},gn.fromKeys=function(e){return this(r(e).keySeq())},gn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},gn.isOrderedSet=yn;var bn,_n=gn.prototype;function wn(e,t){var n=Object.create(_n);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function xn(){return bn||(bn=wn(It()))}function En(e){return null==e?Tn():Sn(e)?e:Tn().unshiftAll(e)}function Sn(e){return!(!e||!e[kn])}_n[d]=!0,_n.__empty=xn,_n.__make=wn,t(En,we),En.of=function(){return this(arguments)},En.prototype.toString=function(){return this.__toString("Stack [","]")},En.prototype.get=function(e,t){var n=this._head;for(e=k(this,e);n&&e--;)n=n.next;return n?n.value:t},En.prototype.peek=function(){return this._head&&this._head.value},En.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):An(e,t)},En.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Le(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):An(t,n)},En.prototype.pop=function(){return this.slice(1)},En.prototype.unshift=function(){return this.push.apply(this,arguments)},En.prototype.unshiftAll=function(e){return this.pushAll(e)},En.prototype.shift=function(){return this.pop.apply(this,arguments)},En.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Tn()},En.prototype.slice=function(e,t){if(A(e,t,this.size))return this;var n=T(e,this.size),r=j(t,this.size);if(r!==this.size)return we.prototype.slice.call(this,e,t);for(var o=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):An(o,i)},En.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?An(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},En.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},En.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new U(function(){if(r){var t=r.value;return r=r.next,q(e,n++,t)}return{value:void 0,done:!0}})},En.isStack=Sn;var Cn,kn="@@__IMMUTABLE_STACK__@@",On=En.prototype;function An(e,t,n,r){var o=Object.create(On);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Tn(){return Cn||(Cn=An(0))}function jn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}On[kn]=!0,On.withMutations=Be.withMutations,On.asMutable=Be.asMutable,On.asImmutable=Be.asImmutable,On.wasAltered=Be.wasAltered,n.Iterator=U,jn(n,{toArray:function(){Le(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new Rt(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new Nt(this,!0)},toMap:function(){return Ue(this.toKeyedSeq())},toObject:function(){Le(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Tt(this.toKeyedSeq())},toOrderedSet:function(){return gn(s(this)?this.valueSeq():this)},toSet:function(){return cn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Dt(this)},toSeq:function(){return u(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return En(s(this)?this.valueSeq():this)},toList:function(){return ft(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return $t(this,Ht(this,t))},includes:function(e){return this.some(function(t){return de(t,e)})},entries:function(){return this.__iterator(N)},every:function(e,t){Le(this.size);var n=!0;return this.__iterate(function(r,o,i){if(!e.call(t,r,o,i))return n=!1,!1}),n},filter:function(e,t){return $t(this,zt(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return Le(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Le(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""}),t},keys:function(){return this.__iterator(I)},map:function(e,t){return $t(this,qt(this,e,t))},reduce:function(e,t,n){var r,o;return Le(this.size),arguments.length<2?o=!0:r=t,this.__iterate(function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return $t(this,Ft(this,!0))},slice:function(e,t){return $t(this,Bt(this,e,t,!0))},some:function(e,t){return!this.every(Rn(e),t)},sort:function(e){return $t(this,Jt(this,e))},values:function(){return this.__iterator(M)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return C(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Ue().asMutable();return e.__iterate(function(o,i){r.update(t.call(n,o,i,e),0,function(e){return e+1})}),r.asImmutable()}(this,e,t)},equals:function(e){return me(this,e)},entrySeq:function(){var e=this;if(e._cache)return new ee(e._cache);var t=e.toSeq().map(Nn).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Rn(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,o,i){if(e.call(t,n,o,i))return r=[o,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(O)},flatMap:function(e,t){return $t(this,function(e,t,n){var r=Qt(e);return e.toSeq().map(function(o,i){return r(t.call(n,o,i,e))}).flatten(!0)}(this,e,t))},flatten:function(e){return $t(this,Wt(this,e,!0))},fromEntrySeq:function(){return new Lt(this)},get:function(e,t){return this.find(function(t,n){return de(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,o=rn(e);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,y):y)===y)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),o=(l(e)?Tt():Ue()).asMutable();e.__iterate(function(i,a){o.update(t.call(n,i,a,e),function(e){return(e=e||[]).push(r?[a,i]:i),e})});var i=Qt(e);return o.map(function(t){return $t(e,i(t))})}(this,e,t)},has:function(e){return this.get(e,y)!==y},hasIn:function(e){return this.getIn(e,y)!==y},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey(function(t){return de(t,e)})},keySeq:function(){return this.toSeq().map(Mn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Yt(this,e)},maxBy:function(e,t){return Yt(this,t,e)},min:function(e){return Yt(this,e?Dn(e):qn)},minBy:function(e,t){return Yt(this,t?Dn(t):qn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return $t(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return $t(this,Vt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Rn(e),t)},sortBy:function(e,t){return $t(this,Jt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return $t(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return $t(this,function(e,t,n){var r=en(e);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return e.__iterate(function(e,o,s){return t.call(n,e,o,s)&&++a&&r(e,o,i)}),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=e.__iterator(N,o),s=!0;return new U(function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,u=o[0],c=o[1];return t.call(n,c,u,i)?r===N?e:q(r,u,c,e):(s=!1,{value:void 0,done:!0})})},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Rn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=l(e),n=s(e),r=t?1:0;return function(e,t){return t=Ee(t,3432918353),t=Ee(t<<15|t>>>-15,461845907),t=Ee(t<<13|t>>>-13,5),t=Ee((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=Se((t=Ee(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Fn(Ce(e),Ce(t))|0}:function(e,t){r=r+Fn(Ce(e),Ce(t))|0}:t?function(e){r=31*r+Ce(e)|0}:function(e){r=r+Ce(e)|0}),r)}(this))}});var Pn=n.prototype;Pn[p]=!0,Pn[L]=Pn.values,Pn.__toJS=Pn.toArray,Pn.__toStringMapper=Ln,Pn.inspect=Pn.toSource=function(){return this.toString()},Pn.chain=Pn.flatMap,Pn.contains=Pn.includes,jn(r,{flip:function(){return $t(this,Ut(this))},mapEntries:function(e,t){var n=this,r=0;return $t(this,this.toSeq().map(function(o,i){return e.call(t,[i,o],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return $t(this,this.toSeq().flip().map(function(r,o){return e.call(t,r,o,n)}).flip())}});var In=r.prototype;function Mn(e,t){return t}function Nn(e,t){return[t,e]}function Rn(e){return function(){return!e.apply(this,arguments)}}function Dn(e){return function(){return-e.apply(this,arguments)}}function Ln(e){return"string"==typeof e?JSON.stringify(e):String(e)}function Un(){return S(arguments)}function qn(e,t){return e<t?1:e>t?-1:0}function Fn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return In[f]=!0,In[L]=Pn.entries,In.__toJS=Pn.toObject,In.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Ln(e)},jn(o,{toKeyedSeq:function(){return new Nt(this,!1)},filter:function(e,t){return $t(this,zt(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return $t(this,Ft(this,!1))},slice:function(e,t){return $t(this,Bt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=T(e,e<0?this.count():this.size);var r=this.slice(0,e);return $t(this,1===n?r:r.concat(S(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return $t(this,Wt(this,e,!1))},get:function(e,t){return(e=k(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=k(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return $t(this,function(e,t){var n=en(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var o=this,i=0;return e.__iterate(function(e,r){return(!i||!1!==n(t,i++,o))&&!1!==n(e,i++,o)},r),i},n.__iteratorUncached=function(n,r){var o,i=e.__iterator(M,r),a=0;return new U(function(){return(!o||a%2)&&(o=i.next()).done?o:a%2?q(n,a++,t):q(n,a++,o.value,o)})},n}(this,e))},interleave:function(){var e=[this].concat(S(arguments)),t=Gt(this.toSeq(),K.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),$t(this,n)},keySeq:function(){return ye(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return $t(this,Vt(this,e,t,!1))},zip:function(){var e=[this].concat(S(arguments));return $t(this,Gt(this,Un,e))},zipWith:function(e){var t=S(arguments);return t[0]=this,$t(this,Gt(this,e,t))}}),o.prototype[h]=!0,o.prototype[d]=!0,jn(i,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=Pn.includes,i.prototype.contains=i.prototype.includes,jn(Y,r.prototype),jn(K,o.prototype),jn(G,i.prototype),jn(_e,r.prototype),jn(we,o.prototype),jn(xe,i.prototype),{Iterable:n,Seq:J,Collection:be,Map:Ue,OrderedMap:Tt,List:ft,Stack:En,Set:cn,OrderedSet:gn,Record:on,Range:ye,Repeat:ve,is:de,fromJS:pe}}()},function(e,t,n){var r=n(51);e.exports=function(e,t,n){return t in e?r(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";(function(e){n.d(t,"r",function(){return N}),n.d(t,"y",function(){return R}),n.d(t,"h",function(){return D}),n.d(t,"u",function(){return L}),n.d(t,"p",function(){return U}),n.d(t,"s",function(){return q}),n.d(t,"q",function(){return F}),n.d(t,"o",function(){return z}),n.d(t,"t",function(){return B}),n.d(t,"w",function(){return V}),n.d(t,"x",function(){return H}),n.d(t,"H",function(){return W}),n.d(t,"e",function(){return J}),n.d(t,"l",function(){return Y}),n.d(t,"n",function(){return K}),n.d(t,"g",function(){return G}),n.d(t,"C",function(){return $}),n.d(t,"I",function(){return ce}),n.d(t,"m",function(){return le}),n.d(t,"B",function(){return pe}),n.d(t,"a",function(){return fe}),n.d(t,"F",function(){return he}),n.d(t,"b",function(){return de}),n.d(t,"E",function(){return me}),n.d(t,"D",function(){return ve}),n.d(t,"i",function(){return ge}),n.d(t,"c",function(){return ye}),n.d(t,"f",function(){return be}),n.d(t,"k",function(){return _e}),n.d(t,"j",function(){return we}),n.d(t,"d",function(){return xe}),n.d(t,"G",function(){return Ee}),n.d(t,"v",function(){return Se}),n.d(t,"z",function(){return Ce}),n.d(t,"A",function(){return ke});var r=n(28),o=n.n(r),i=(n(13),n(90),n(16)),a=n.n(i),s=n(17),u=n.n(s),c=n(14),l=n.n(c),p=n(26),f=n.n(p),h=n(1),d=n.n(h),m=n(465),v=n(466),g=n.n(v),y=n(262),b=n.n(y),_=n(263),w=n.n(_),x=n(264),E=n.n(x),S=(n(467),n(89)),C=n.n(S),k=n(116),O=n(18),A=n.n(O),T=n(469),j=n.n(T),P=n(118),I="default",M=function(e){return d.a.Iterable.isIterable(e)};function N(e){try{var t=JSON.parse(e);if(t&&"object"===f()(t))return t}catch(e){}return!1}function R(e){return q(e)?M(e)?e.toJS():e:{}}function D(e){return M(e)?e:e instanceof A.a.File?e:q(e)?l()(e)?d.a.Seq(e).map(D).toList():d.a.OrderedMap(e).map(D):e}function L(e){return l()(e)?e:[e]}function U(e){return"function"==typeof e}function q(e){return!!e&&"object"===f()(e)}function F(e){return"function"==typeof e}function z(e){return l()(e)}var B=w.a;function V(e,t){return u()(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})}function H(e,t){return u()(e).reduce(function(n,r){var o=t(e[r],r);return o&&"object"===f()(o)&&a()(n,o),n},{})}function W(e){return function(t){t.dispatch,t.getState;return function(t){return function(n){return"function"==typeof n?n(e()):t(n)}}}}function J(e){var t=e.keySeq();return t.contains(I)?I:t.filter(function(e){return"2"===(e+"")[0]}).sort().first()}function Y(e,t){if(!d.a.Iterable.isIterable(e))return d.a.List();var n=e.getIn(l()(t)?t:[t]);return d.a.List.isList(n)?n:d.a.List()}function K(e){var t=document;if(!e)return"";if(e.textContent.length>5e3)return e.textContent;return function(e){for(var n,r,o,i,a,s=e.textContent,u=0,c=s[0],l=1,p=e.innerHTML="",f=0;r=n,n=f<7&&"\\"==n?1:l;){if(l=c,c=s[++u],i=p.length>1,!l||f>8&&"\n"==l||[/\S/.test(l),1,1,!/[$\w]/.test(l),("/"==n||"\n"==n)&&i,'"'==n&&i,"'"==n&&i,s[u-4]+r+n=="--\x3e",r+n=="*/"][f])for(p&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][f?f<3?2:f>6?4:f>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(p):0]),a.appendChild(t.createTextNode(p))),o=f&&f<7?f:o,p="",f=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(l),/[\])]/.test(l),/[$\w]/.test(l),"/"==l&&o<2&&"<"!=n,'"'==l,"'"==l,l+c+s[u+1]+s[u+2]=="\x3c!--",l+c=="/*",l+c=="//","#"==l][--f];);p+=l}}(e)}function G(e){var t;if([/filename\*=[^']+'\w*'"([^"]+)";?/i,/filename\*=[^']+'\w*'([^;]+);?/i,/filename="([^;]*);?"/i,/filename=([^;]*);?/i].some(function(n){return null!==(t=n.exec(e))}),null!==t&&t.length>1)try{return decodeURIComponent(t[1])}catch(e){console.error(e)}return null}function $(e){return t=e.replace(/\.[^.\/]*$/,""),b()(g()(t));var t}var Z=function(e,t){if(e>t)return"Value must be less than Maximum"},X=function(e,t){if(e<t)return"Value must be greater than Minimum"},Q=function(e){if(!/^-?\d+(\.?\d+)?$/.test(e))return"Value must be a number"},ee=function(e){if(!/^-?\d+$/.test(e))return"Value must be an integer"},te=function(e){if(e&&!(e instanceof A.a.File))return"Value must be a file"},ne=function(e){if("true"!==e&&"false"!==e&&!0!==e&&!1!==e)return"Value must be a boolean"},re=function(e){if(e&&"string"!=typeof e)return"Value must be a string"},oe=function(e){if(isNaN(Date.parse(e)))return"Value must be a DateTime"},ie=function(e){if(e=e.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(e))return"Value must be a Guid"},ae=function(e,t){if(e.length>t)return"Value must be less than MaxLength"},se=function(e,t){if(e.length<t)return"Value must be greater than MinLength"},ue=function(e,t){if(!new RegExp(t).test(e))return"Value must follow pattern "+t},ce=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.isOAS3,o=void 0!==r&&r,i=n.bypassRequiredCheck,a=void 0!==i&&i,s=[],u=e.get("required"),c=Object(P.a)(e,{isOAS3:o});if(!c)return s;var p=c.get("maximum"),h=c.get("minimum"),m=c.get("type"),v=c.get("format"),g=c.get("maxLength"),y=c.get("minLength"),b=c.get("pattern");if(m&&(u||t)){var _="string"===m&&t,w="array"===m&&l()(t)&&t.length,x="array"===m&&d.a.List.isList(t)&&t.count(),E="array"===m&&"string"==typeof t&&t,S="file"===m&&t instanceof A.a.File,C="boolean"===m&&(t||!1===t),k="number"===m&&(t||0===t),O="integer"===m&&(t||0===t),T="object"===m&&"object"===f()(t)&&null!==t,j="object"===m&&"string"==typeof t&&t,I=[_,w,x,E,S,C,k,O,T,j],M=I.some(function(e){return!!e});if(u&&!M&&!a)return s.push("Required field is not provided"),s;if(b){var N=ue(t,b);N&&s.push(N)}if(g||0===g){var R=ae(t,g);R&&s.push(R)}if(y){var D=se(t,y);D&&s.push(D)}if(p||0===p){var L=Z(t,p);L&&s.push(L)}if(h||0===h){var U=X(t,h);U&&s.push(U)}if("string"===m){var q;if(!(q="date-time"===v?oe(t):"uuid"===v?ie(t):re(t)))return s;s.push(q)}else if("boolean"===m){var F=ne(t);if(!F)return s;s.push(F)}else if("number"===m){var z=Q(t);if(!z)return s;s.push(z)}else if("integer"===m){var B=ee(t);if(!B)return s;s.push(B)}else if("array"===m){var V;if(!x||!t.count())return s;V=c.getIn(["items","type"]),t.forEach(function(e,t){var n;"number"===V?n=Q(e):"integer"===V?n=ee(e):"string"===V&&(n=re(e)),n&&s.push({index:t,error:n})})}else if("file"===m){var H=te(t);if(!H)return s;s.push(H)}}return s},le=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'<?xml version="1.0" encoding="UTF-8"?>\n\x3c!-- XML example cannot be generated; root element name is undefined --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return Object(k.memoizedCreateXMLExample)(e,n)}var i=Object(k.memoizedSampleFromSchema)(e,n);return"object"===f()(i)?o()(i,null,2):i},pe=function(){var e={},t=A.a.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=r[1]&&decodeURIComponent(r[1])||"")}return e},fe=function(t){return(t instanceof e?t:new e(t.toString(),"utf-8")).toString("base64")},he={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},de=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},me=function(e,t,n){return!!E()(n,function(n){return C()(e[n],t[n])})};function ve(e){return"string"!=typeof e||""===e?"":Object(m.sanitizeUrl)(e)}function ge(e){if(!d.a.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find(function(e,t){return t.startsWith("2")&&u()(e.get("content")||{}).length>0}),n=e.get("default")||d.a.OrderedMap(),r=(n.get("content")||d.a.OrderedMap()).keySeq().toJS().length?n:null;return t||r}var ye=function(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"%20"):""},be=function(e){return j()(ye(e).replace(/%20/g,"_"))},_e=function(e){return e.filter(function(e,t){return/^x-/.test(t)})},we=function(e){return e.filter(function(e,t){return/^pattern|maxLength|minLength|maximum|minimum/.test(t)})};function xe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("object"!==f()(e)||l()(e)||null===e||!t)return e;var r=a()({},e);return u()(r).forEach(function(e){e===t&&n(r[e],e)?delete r[e]:r[e]=xe(r[e],t,n)}),r}function Ee(e){if("string"==typeof e)return e;if(e&&e.toJS&&(e=e.toJS()),"object"===f()(e)&&null!==e)try{return o()(e,null,2)}catch(t){return String(e)}return null==e?"":e.toString()}function Se(e){return"number"==typeof e?e.toString():e}function Ce(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.returnAll,r=void 0!==n&&n,o=t.allowHashes,i=void 0===o||o;if(!d.a.Map.isMap(e))throw new Error("paramToIdentifier: received a non-Im.Map parameter as input");var a=e.get("name"),s=e.get("in"),u=[];return e&&e.hashCode&&s&&a&&i&&u.push("".concat(s,".").concat(a,".hash-").concat(e.hashCode())),s&&a&&u.push("".concat(s,".").concat(a)),u.push(a),r?u:u[0]||""}function ke(e,t){return Ce(e,{returnAll:!0}).map(function(e){return t[e]}).filter(function(e){return void 0!==e})[0]}}).call(this,n(61).Buffer)},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var r=n(51);function o(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),r(e,o.key,o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}},function(e,t,n){var r=n(26),o=n(9);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){var r=n(791),o=n(413);function i(t){return e.exports=i=o?r:function(e){return e.__proto__||r(e)},i(t)}e.exports=i},function(e,t,n){var r=n(414),o=n(799);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=r(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){e.exports=n(957)()},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){return e===t}function i(e){var t=arguments.length<=1||void 0===arguments[1]?o:arguments[1],n=null,r=null;return function(){for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return null!==n&&n.length===i.length&&i.every(function(e,r){return t(e,n[r])})||(r=e.apply(void 0,i)),n=i,r}}function a(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var n=t.map(function(e){return typeof e}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function s(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return function(){for(var t=arguments.length,o=Array(t),i=0;i<t;i++)o[i]=arguments[i];var s=0,u=o.pop(),c=a(o),l=e.apply(void 0,[function(){return s++,u.apply(void 0,arguments)}].concat(n)),p=function(e,t){for(var n=arguments.length,o=Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];var a=c.map(function(n){return n.apply(void 0,[e,t].concat(o))});return l.apply(void 0,r(a))};return p.resultFunc=u,p.recomputations=function(){return s},p.resetRecomputations=function(){return s=0},p}}t.__esModule=!0,t.defaultMemoize=i,t.createSelectorCreator=s,t.createStructuredSelector=function(e){var t=arguments.length<=1||void 0===arguments[1]?u:arguments[1];if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(e,t,r){return e[n[r]]=t,e},{})})};var u=t.createSelector=s(i)},function(e,t,n){var r=n(739),o=n(740),i=n(747);e.exports=function(e){return r(e)||o(e)||i()}},function(e,t,n){var r=n(586),o=n(587),i=n(590);e.exports=function(e,t){return r(e)||o(e,t)||i()}},function(e,t,n){e.exports=n(560)},function(e,t,n){"use strict";var r=function(e){};e.exports=function(e,t,n,o,i,a,s,u){if(r(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,i,a,s,u],p=0;(c=new Error(t.replace(/%s/g,function(){return l[p++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){e.exports=n(564)},function(e,t,n){e.exports=n(542)},function(e,t){e.exports=function(){var e={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return e;try{e=window;for(var t=0,n=["File","Blob","FormData"];t<n.length;t++){var r=n[t];r in window&&(e[r]=window[r])}}catch(e){console.error(e)}return e}()},function(e,t,n){"use strict";var r=n(1),o="<<anonymous>>",i={listOf:function(e){return c(e,"List",r.List.isList)},mapOf:function(e,t){return l(e,t,"Map",r.Map.isMap)},orderedMapOf:function(e,t){return l(e,t,"OrderedMap",r.OrderedMap.isOrderedMap)},setOf:function(e){return c(e,"Set",r.Set.isSet)},orderedSetOf:function(e){return c(e,"OrderedSet",r.OrderedSet.isOrderedSet)},stackOf:function(e){return c(e,"Stack",r.Stack.isStack)},iterableOf:function(e){return c(e,"Iterable",r.Iterable.isIterable)},recordOf:function(e){return s(function(t,n,o,i,s){for(var u=arguments.length,c=Array(u>5?u-5:0),l=5;l<u;l++)c[l-5]=arguments[l];var p=t[n];if(!(p instanceof r.Record)){var f=a(p),h=i;return new Error("Invalid "+h+" `"+s+"` of type `"+f+"` supplied to `"+o+"`, expected an Immutable.js Record.")}for(var d in e){var m=e[d];if(m){var v=p.toObject(),g=m.apply(void 0,[v,d,o,i,s+"."+d].concat(c));if(g)return g}}})},shape:f,contains:f,mapContains:function(e){return p(e,"Map",r.Map.isMap)},list:u("List",r.List.isList),map:u("Map",r.Map.isMap),orderedMap:u("OrderedMap",r.OrderedMap.isOrderedMap),set:u("Set",r.Set.isSet),orderedSet:u("OrderedSet",r.OrderedSet.isOrderedSet),stack:u("Stack",r.Stack.isStack),seq:u("Seq",r.Seq.isSeq),record:u("Record",function(e){return e instanceof r.Record}),iterable:u("Iterable",r.Iterable.isIterable)};function a(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof r.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function s(e){function t(t,n,r,i,a,s){for(var u=arguments.length,c=Array(u>6?u-6:0),l=6;l<u;l++)c[l-6]=arguments[l];return s=s||r,i=i||o,null!=n[r]?e.apply(void 0,[n,r,i,a,s].concat(c)):t?new Error("Required "+a+" `"+s+"` was not specified in `"+i+"`."):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function u(e,t){return s(function(n,r,o,i,s){var u=n[r];if(!t(u)){var c=a(u);return new Error("Invalid "+i+" `"+s+"` of type `"+c+"` supplied to `"+o+"`, expected `"+e+"`.")}return null})}function c(e,t,n){return s(function(r,o,i,s,u){for(var c=arguments.length,l=Array(c>5?c-5:0),p=5;p<c;p++)l[p-5]=arguments[p];var f=r[o];if(!n(f)){var h=s,d=a(f);return new Error("Invalid "+h+" `"+u+"` of type `"+d+"` supplied to `"+i+"`, expected an Immutable.js "+t+".")}if("function"!=typeof e)return new Error("Invalid typeChecker supplied to `"+i+"` for propType `"+u+"`, expected a function.");for(var m=f.toArray(),v=0,g=m.length;v<g;v++){var y=e.apply(void 0,[m,v,i,s,u+"["+v+"]"].concat(l));if(y instanceof Error)return y}})}function l(e,t,n,r){return s(function(){for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return c(e,n,r).apply(void 0,i)||t&&(u=t,s(function(e,t,n,r,o){for(var i=arguments.length,a=Array(i>5?i-5:0),s=5;s<i;s++)a[s-5]=arguments[s];var c=e[t];if("function"!=typeof u)return new Error("Invalid keysTypeChecker (optional second argument) supplied to `"+n+"` for propType `"+o+"`, expected a function.");for(var l=c.keySeq().toArray(),p=0,f=l.length;p<f;p++){var h=u.apply(void 0,[l,p,n,r,o+" -> key("+l[p]+")"].concat(a));if(h instanceof Error)return h}})).apply(void 0,i);var u})}function p(e){var t=void 0===arguments[1]?"Iterable":arguments[1],n=void 0===arguments[2]?r.Iterable.isIterable:arguments[2];return s(function(r,o,i,s,u){for(var c=arguments.length,l=Array(c>5?c-5:0),p=5;p<c;p++)l[p-5]=arguments[p];var f=r[o];if(!n(f)){var h=a(f);return new Error("Invalid "+s+" `"+u+"` of type `"+h+"` supplied to `"+i+"`, expected an Immutable.js "+t+".")}var d=f.toObject();for(var m in e){var v=e[m];if(v){var g=v.apply(void 0,[d,m,i,s,u+"."+m].concat(l));if(g)return g}}})}function f(e){return p(e)}e.exports=i},function(e,t,n){var r=n(16);function o(){return e.exports=o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}e.exports=o},function(e,t,n){"use strict";e.exports=function(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}},function(e,t){var n=e.exports={version:"2.6.9"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";var r=n(54);e.exports=r},function(e,t,n){"use strict";n.r(t),n.d(t,"isOAS3",function(){return s}),n.d(t,"isSwagger2",function(){return u}),n.d(t,"OAS3ComponentWrapFactory",function(){return c});var r=n(20),o=n.n(r),i=n(0),a=n.n(i);function s(e){var t=e.get("openapi");return"string"==typeof t&&(t.startsWith("3.0.")&&t.length>4)}function u(e){var t=e.get("swagger");return"string"==typeof t&&t.startsWith("2.0")}function c(e){return function(t,n){return function(r){return n&&n.specSelectors&&n.specSelectors.specJson?s(n.specSelectors.specJson())?a.a.createElement(e,o()({},r,n,{Ori:t})):a.a.createElement(t,r):(console.warn("OAS3 wrapper: couldn't get spec"),null)}}}},function(e,t,n){"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=a(e),c=1;c<arguments.length;c++){for(var l in n=Object(arguments[c]))o.call(n,l)&&(u[l]=n[l]);if(r){s=r(n);for(var p=0;p<s.length;p++)i.call(n,s[p])&&(u[s[p]]=n[s[p]])}}return u}},function(e,t,n){var r=n(546),o=n(552);function i(e){return(i="function"==typeof o&&"symbol"==typeof r?function(e){return typeof e}:function(e){return e&&"function"==typeof o&&e.constructor===o&&e!==o.prototype?"symbol":typeof e})(e)}function a(t){return"function"==typeof o&&"symbol"===i(r)?e.exports=a=function(e){return i(e)}:e.exports=a=function(e){return e&&"function"==typeof o&&e.constructor===o&&e!==o.prototype?"symbol":i(e)},a(t)}e.exports=a},function(e,t,n){"use strict";var r=n(21),o=n(111),i=n(415),a=(n(15),o.ID_ATTRIBUTE_NAME),s=i,u="__reactInternalInstance$"+Math.random().toString(36).slice(2);function c(e,t){return 1===e.nodeType&&e.getAttribute(a)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function l(e){for(var t;t=e._renderedComponent;)e=t;return e}function p(e,t){var n=l(e);n._hostNode=t,t[u]=n}function f(e,t){if(!(e._flags&s.hasCachedChildNodes)){var n=e._renderedChildren,o=t.firstChild;e:for(var i in n)if(n.hasOwnProperty(i)){var a=n[i],u=l(a)._domID;if(0!==u){for(;null!==o;o=o.nextSibling)if(c(o,u)){p(a,o);continue e}r("32",u)}}e._flags|=s.hasCachedChildNodes}}function h(e){if(e[u])return e[u];for(var t,n,r=[];!e[u];){if(r.push(e),!e.parentNode)return null;e=e.parentNode}for(;e&&(n=e[u]);e=r.pop())t=n,r.length&&f(n,e);return t}var d={getClosestInstanceFromNode:h,getInstanceFromNode:function(e){var t=h(e);return null!=t&&t._hostNode===e?t:null},getNodeFromInstance:function(e){if(void 0===e._hostNode&&r("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||r("34"),e=e._hostParent;for(;t.length;e=t.pop())f(e,e._hostNode);return e._hostNode},precacheChildNodes:f,precacheNode:p,uncacheNode:function(e){var t=e._hostNode;t&&(delete t[u],e._hostNode=null)}};e.exports=d},function(e,t,n){e.exports=n(541)},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_SPEC",function(){return G}),n.d(t,"UPDATE_URL",function(){return $}),n.d(t,"UPDATE_JSON",function(){return Z}),n.d(t,"UPDATE_PARAM",function(){return X}),n.d(t,"UPDATE_EMPTY_PARAM_INCLUSION",function(){return Q}),n.d(t,"VALIDATE_PARAMS",function(){return ee}),n.d(t,"SET_RESPONSE",function(){return te}),n.d(t,"SET_REQUEST",function(){return ne}),n.d(t,"SET_MUTATED_REQUEST",function(){return re}),n.d(t,"LOG_REQUEST",function(){return oe}),n.d(t,"CLEAR_RESPONSE",function(){return ie}),n.d(t,"CLEAR_REQUEST",function(){return ae}),n.d(t,"CLEAR_VALIDATE_PARAMS",function(){return se}),n.d(t,"UPDATE_OPERATION_META_VALUE",function(){return ue}),n.d(t,"UPDATE_RESOLVED",function(){return ce}),n.d(t,"UPDATE_RESOLVED_SUBTREE",function(){return le}),n.d(t,"SET_SCHEME",function(){return pe}),n.d(t,"updateSpec",function(){return he}),n.d(t,"updateResolved",function(){return de}),n.d(t,"updateUrl",function(){return me}),n.d(t,"updateJsonSpec",function(){return ve}),n.d(t,"parseToJson",function(){return ge}),n.d(t,"resolveSpec",function(){return be}),n.d(t,"requestResolvedSubtree",function(){return xe}),n.d(t,"changeParam",function(){return Ee}),n.d(t,"changeParamByIdentity",function(){return Se}),n.d(t,"updateResolvedSubtree",function(){return Ce}),n.d(t,"invalidateResolvedSubtreeCache",function(){return ke}),n.d(t,"validateParams",function(){return Oe}),n.d(t,"updateEmptyParamInclusion",function(){return Ae}),n.d(t,"clearValidateParams",function(){return Te}),n.d(t,"changeConsumesValue",function(){return je}),n.d(t,"changeProducesValue",function(){return Pe}),n.d(t,"setResponse",function(){return Ie}),n.d(t,"setRequest",function(){return Me}),n.d(t,"setMutatedRequest",function(){return Ne}),n.d(t,"logRequest",function(){return Re}),n.d(t,"executeRequest",function(){return De}),n.d(t,"execute",function(){return Le}),n.d(t,"clearResponse",function(){return Ue}),n.d(t,"clearRequest",function(){return qe}),n.d(t,"setScheme",function(){return Fe});var r=n(92),o=n.n(r),i=n(57),a=n.n(i),s=n(58),u=n.n(s),c=n(52),l=n.n(c),p=n(2),f=n.n(p),h=n(38),d=n.n(h),m=n(324),v=n.n(m),g=n(16),y=n.n(g),b=n(17),_=n.n(b),w=n(189),x=n.n(w),E=n(119),S=n.n(E),C=n(190),k=n.n(C),O=n(51),A=n.n(O),T=n(14),j=n.n(T),P=n(26),I=n.n(P),M=n(143),N=n.n(M),R=n(1),D=n(93),L=n.n(D),U=n(115),q=n.n(U),F=n(275),z=n.n(F),B=n(471),V=n.n(B),H=n(325),W=n.n(H),J=n(3);function Y(e,t){var n=_()(e);if(l.a){var r=l()(e);t&&(r=r.filter(function(t){return u()(e,t).enumerable})),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(n,!0).forEach(function(t){f()(e,t,n[t])}):a.a?o()(e,a()(n)):Y(n).forEach(function(t){A()(e,t,u()(n,t))})}return e}var G="spec_update_spec",$="spec_update_url",Z="spec_update_json",X="spec_update_param",Q="spec_update_empty_param_inclusion",ee="spec_validate_param",te="spec_set_response",ne="spec_set_request",re="spec_set_mutated_request",oe="spec_log_request",ie="spec_clear_response",ae="spec_clear_request",se="spec_clear_validate_param",ue="spec_update_operation_meta_value",ce="spec_update_resolved",le="spec_update_resolved_subtree",pe="set_scheme",fe=function(e){return z()(e)?e:""};function he(e){var t=fe(e).replace(/\t/g," ");if("string"==typeof e)return{type:G,payload:t}}function de(e){return{type:ce,payload:e}}function me(e){return{type:$,payload:e}}function ve(e){return{type:Z,payload:e}}var ge=function(e){return function(t){var n=t.specActions,r=t.specSelectors,o=t.errActions,i=r.specStr,a=null;try{e=e||i(),o.clear({source:"parser"}),a=N.a.safeLoad(e)}catch(e){return console.error(e),o.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return a&&"object"===I()(a)?n.updateJsonSpec(a):{}}},ye=!1,be=function(e,t){return function(n){var r=n.specActions,o=n.specSelectors,i=n.errActions,a=n.fn,s=a.fetch,u=a.resolve,c=a.AST,l=void 0===c?{}:c,p=n.getConfigs;ye||(console.warn("specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!"),ye=!0);var f=p(),h=f.modelPropertyMacro,d=f.parameterMacro,m=f.requestInterceptor,v=f.responseInterceptor;void 0===e&&(e=o.specJson()),void 0===t&&(t=o.url());var g=l.getLineNumberForPath?l.getLineNumberForPath:function(){},y=o.specStr();return u({fetch:s,spec:e,baseDoc:t,modelPropertyMacro:h,parameterMacro:d,requestInterceptor:m,responseInterceptor:v}).then(function(e){var t=e.spec,n=e.errors;if(i.clear({type:"thrown"}),j()(n)&&n.length>0){var o=n.map(function(e){return console.error(e),e.line=e.fullPath?g(y,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",A()(e,"message",{enumerable:!0,value:e.message}),e});i.newThrownErrBatch(o)}return r.updateResolved(t)})}},_e=[],we=V()(k()(S.a.mark(function e(){var t,n,r,o,i,a,s,u,c,l,p,f,h,d,m,v,g;return S.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=_e.system){e.next=4;break}return console.error("debResolveSubtrees: don't have a system to operate on, aborting."),e.abrupt("return");case 4:if(n=t.errActions,r=t.errSelectors,o=t.fn,i=o.resolveSubtree,a=o.AST,s=void 0===a?{}:a,u=t.specSelectors,c=t.specActions,i){e.next=8;break}return console.error("Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing."),e.abrupt("return");case 8:return l=s.getLineNumberForPath?s.getLineNumberForPath:function(){},p=u.specStr(),f=t.getConfigs(),h=f.modelPropertyMacro,d=f.parameterMacro,m=f.requestInterceptor,v=f.responseInterceptor,e.prev=11,e.next=14,_e.reduce(function(){var e=k()(S.a.mark(function e(t,o){var a,s,c,f,g,y,b;return S.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return a=e.sent,s=a.resultMap,c=a.specWithCurrentSubtrees,e.next=7,i(c,o,{baseDoc:u.url(),modelPropertyMacro:h,parameterMacro:d,requestInterceptor:m,responseInterceptor:v});case 7:return f=e.sent,g=f.errors,y=f.spec,r.allErrors().size&&n.clearBy(function(e){return"thrown"!==e.get("type")||"resolver"!==e.get("source")||!e.get("fullPath").every(function(e,t){return e===o[t]||void 0===o[t]})}),j()(g)&&g.length>0&&(b=g.map(function(e){return e.line=e.fullPath?l(p,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",A()(e,"message",{enumerable:!0,value:e.message}),e}),n.newThrownErrBatch(b)),W()(s,o,y),W()(c,o,y),e.abrupt("return",{resultMap:s,specWithCurrentSubtrees:c});case 15:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),x.a.resolve({resultMap:(u.specResolvedSubtree([])||Object(R.Map)()).toJS(),specWithCurrentSubtrees:u.specJson().toJS()}));case 14:g=e.sent,delete _e.system,_e=[],e.next=22;break;case 19:e.prev=19,e.t0=e.catch(11),console.error(e.t0);case 22:c.updateResolvedSubtree([],g.resultMap);case 23:case"end":return e.stop()}},e,null,[[11,19]])})),35),xe=function(e){return function(t){_e.map(function(e){return e.join("@@")}).indexOf(e.join("@@"))>-1||(_e.push(e),_e.system=t,we())}};function Ee(e,t,n,r,o){return{type:X,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:o}}}function Se(e,t,n,r){return{type:X,payload:{path:e,param:t,value:n,isXml:r}}}var Ce=function(e,t){return{type:le,payload:{path:e,value:t}}},ke=function(){return{type:le,payload:{path:[],value:Object(R.Map)()}}},Oe=function(e,t){return{type:ee,payload:{pathMethod:e,isOAS3:t}}},Ae=function(e,t,n,r){return{type:Q,payload:{pathMethod:e,paramName:t,paramIn:n,includeEmptyValue:r}}};function Te(e){return{type:se,payload:{pathMethod:e}}}function je(e,t){return{type:ue,payload:{path:e,value:t,key:"consumes_value"}}}function Pe(e,t){return{type:ue,payload:{path:e,value:t,key:"produces_value"}}}var Ie=function(e,t,n){return{payload:{path:e,method:t,res:n},type:te}},Me=function(e,t,n){return{payload:{path:e,method:t,req:n},type:ne}},Ne=function(e,t,n){return{payload:{path:e,method:t,req:n},type:re}},Re=function(e){return{payload:e,type:oe}},De=function(e){return function(t){var n=t.fn,r=t.specActions,o=t.specSelectors,i=t.getConfigs,a=t.oas3Selectors,s=e.pathName,u=e.method,c=e.operation,l=i(),p=l.requestInterceptor,f=l.responseInterceptor,h=c.toJS();if(c&&c.get("parameters")&&c.get("parameters").filter(function(e){return e&&!0===e.get("allowEmptyValue")}).forEach(function(t){if(o.parameterInclusionSettingFor([s,u],t.get("name"),t.get("in"))){e.parameters=e.parameters||{};var n=Object(J.A)(t,e.parameters);(!n||n&&0===n.size)&&(e.parameters[t.get("name")]="")}}),e.contextUrl=L()(o.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&s&&u&&(e.operationId=n.opId(h,s,u)),o.isOAS3()){var d="".concat(s,":").concat(u);e.server=a.selectedServer(d)||a.selectedServer();var m=a.serverVariables({server:e.server,namespace:d}).toJS(),g=a.serverVariables({server:e.server}).toJS();e.serverVariables=_()(m).length?m:g,e.requestContentType=a.requestContentType(s,u),e.responseContentType=a.responseContentType(s,u)||"*/*";var b=a.requestBodyValue(s,u);Object(J.r)(b)?e.requestBody=JSON.parse(b):b&&b.toJS?e.requestBody=b.toJS():e.requestBody=b}var w=y()({},e);w=n.buildRequest(w),r.setRequest(e.pathName,e.method,w);e.requestInterceptor=function(t){var n=p.apply(this,[t]),o=y()({},n);return r.setMutatedRequest(e.pathName,e.method,o),n},e.responseInterceptor=f;var x=v()();return n.execute(e).then(function(t){t.duration=v()()-x,r.setResponse(e.pathName,e.method,t)}).catch(function(t){console.error(t),r.setResponse(e.pathName,e.method,{error:!0,err:q()(t)})})}},Le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,r=d()(e,["path","method"]);return function(e){var o=e.fn.fetch,i=e.specSelectors,a=e.specActions,s=i.specJsonWithResolvedSubtrees().toJS(),u=i.operationScheme(t,n),c=i.contentTypeValues([t,n]).toJS(),l=c.requestContentType,p=c.responseContentType,f=/xml/i.test(l),h=i.parameterValues([t,n],f).toJS();return a.executeRequest(K({},r,{fetch:o,spec:s,pathName:t,method:n,parameters:h,requestContentType:l,scheme:u,responseContentType:p}))}};function Ue(e,t){return{type:ie,payload:{path:e,method:t}}}function qe(e,t){return{type:ae,payload:{path:e,method:t}}}function Fe(e,t,n){return{type:pe,payload:{scheme:e,path:t,method:n}}}},function(e,t,n){var r=n(32),o=n(22),i=n(60),a=n(71),s=n(69),u=function(e,t,n){var c,l,p,f=e&u.F,h=e&u.G,d=e&u.S,m=e&u.P,v=e&u.B,g=e&u.W,y=h?o:o[t]||(o[t]={}),b=y.prototype,_=h?r:d?r[t]:(r[t]||{}).prototype;for(c in h&&(n=t),n)(l=!f&&_&&void 0!==_[c])&&s(y,c)||(p=l?_[c]:n[c],y[c]=h&&"function"!=typeof _[c]?n[c]:v&&l?i(p,r):g&&_[c]==p?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(p):m&&"function"==typeof p?i(Function.call,p):p,m&&((y.virtual||(y.virtual={}))[c]=p,e&u.R&&b&&!b[c]&&a(b,c,p)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){"use strict";var r=n(135),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];e.exports=function(e,t){var n,a;if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,a={},null!==n&&Object.keys(n).forEach(function(e){n[e].forEach(function(t){a[String(t)]=e})}),a),-1===i.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(328)("wks"),o=n(195),i=n(44).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){var r=n(206)("wks"),o=n(155),i=n(32).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return!!e&&r.call(e,t)}var i=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function a(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function s(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var u=/&([a-z#][a-z0-9]{1,31});/gi,c=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,l=n(457);function p(e,t){var n=0;return o(l,t)?l[t]:35===t.charCodeAt(0)&&c.test(t)&&a(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?s(n):e}var f=/[&<>"]/,h=/[&<>"]/g,d={"&":"&","<":"<",">":">",'"':"""};function m(e){return d[e]}t.assign=function(e){return[].slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=o,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(i,"$1")},t.isValidEntityCode=a,t.fromCodePoint=s,t.replaceEntities=function(e){return e.indexOf("&")<0?e:e.replace(u,p)},t.escapeHtml=function(e){return f.test(e)?e.replace(h,m):e}},function(e,t,n){var r=n(52),o=n(756);e.exports=function(e,t){if(null==e)return{};var n,i,a=o(e,t);if(r){var s=r(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){var r=n(44),o=n(78),i=n(76),a=n(95),s=n(150),u=function(e,t,n){var c,l,p,f,h=e&u.F,d=e&u.G,m=e&u.S,v=e&u.P,g=e&u.B,y=d?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,b=d?o:o[t]||(o[t]={}),_=b.prototype||(b.prototype={});for(c in d&&(n=t),n)p=((l=!h&&y&&void 0!==y[c])?y:n)[c],f=g&&l?s(p,r):v&&"function"==typeof p?s(Function.call,p):p,y&&a(y,c,p,e&u.U),b[c]!=p&&i(b,c,f),v&&_[c]!=p&&(_[c]=p)};r.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(39),o=n(123),i=n(68),a=/"/g,s=function(e,t,n,r){var o=String(i(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+o+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*o(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"NEW_THROWN_ERR",function(){return i}),n.d(t,"NEW_THROWN_ERR_BATCH",function(){return a}),n.d(t,"NEW_SPEC_ERR",function(){return s}),n.d(t,"NEW_SPEC_ERR_BATCH",function(){return u}),n.d(t,"NEW_AUTH_ERR",function(){return c}),n.d(t,"CLEAR",function(){return l}),n.d(t,"CLEAR_BY",function(){return p}),n.d(t,"newThrownErr",function(){return f}),n.d(t,"newThrownErrBatch",function(){return h}),n.d(t,"newSpecErr",function(){return d}),n.d(t,"newSpecErrBatch",function(){return m}),n.d(t,"newAuthErr",function(){return v}),n.d(t,"clear",function(){return g}),n.d(t,"clearBy",function(){return y});var r=n(115),o=n.n(r),i="err_new_thrown_err",a="err_new_thrown_err_batch",s="err_new_spec_err",u="err_new_spec_err_batch",c="err_new_auth_err",l="err_clear",p="err_clear_by";function f(e){return{type:i,payload:o()(e)}}function h(e){return{type:a,payload:e}}function d(e){return{type:s,payload:e}}function m(e){return{type:u,payload:e}}function v(e){return{type:c,payload:e}}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:l,payload:e}}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return{type:p,payload:e}}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(41);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(80)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(45),o=n(344),i=n(210),a=Object.defineProperty;t.f=n(46)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(361),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";e.exports={debugTool:null}},function(e,t,n){e.exports=n(562)},function(e,t,n){e.exports=n(755)},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=45)}([function(e,t){e.exports=n(17)},function(e,t){e.exports=n(14)},function(e,t){e.exports=n(26)},function(e,t){e.exports=n(16)},function(e,t){e.exports=n(119)},function(e,t){e.exports=n(57)},function(e,t){e.exports=n(58)},function(e,t){e.exports=n(52)},function(e,t){e.exports=n(2)},function(e,t){e.exports=n(51)},function(e,t){e.exports=n(92)},function(e,t){e.exports=n(28)},function(e,t){e.exports=n(916)},function(e,t){e.exports=n(12)},function(e,t){e.exports=n(189)},function(e,t){e.exports=n(922)},function(e,t){e.exports=n(91)},function(e,t){e.exports=n(190)},function(e,t){e.exports=n(925)},function(e,t){e.exports=n(929)},function(e,t){e.exports=n(930)},function(e,t){e.exports=n(90)},function(e,t){e.exports=n(13)},function(e,t){e.exports=n(143)},function(e,t){e.exports=n(4)},function(e,t){e.exports=n(5)},function(e,t){e.exports=n(932)},function(e,t){e.exports=n(414)},function(e,t){e.exports=n(935)},function(e,t){e.exports=n(49)},function(e,t){e.exports=n(61)},function(e,t){e.exports=n(275)},function(e,t){e.exports=n(264)},function(e,t){e.exports=n(936)},function(e,t){e.exports=n(142)},function(e,t){e.exports=n(937)},function(e,t){e.exports=n(945)},function(e,t){e.exports=n(946)},function(e,t){e.exports=n(947)},function(e,t){e.exports=n(38)},function(e,t){e.exports=n(256)},function(e,t){e.exports=n(35)},function(e,t){e.exports=n(950)},function(e,t){e.exports=n(951)},function(e,t){e.exports=n(952)},function(e,t,n){e.exports=n(50)},function(e,t){e.exports=n(953)},function(e,t){e.exports=n(954)},function(e,t){e.exports=n(955)},function(e,t){e.exports=n(956)},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"path",function(){return dn}),n.d(r,"query",function(){return mn}),n.d(r,"header",function(){return gn}),n.d(r,"cookie",function(){return yn});var o=n(9),i=n.n(o),a=n(10),s=n.n(a),u=n(5),c=n.n(u),l=n(6),p=n.n(l),f=n(7),h=n.n(f),d=n(0),m=n.n(d),v=n(8),g=n.n(v),y=(n(46),n(15)),b=n.n(y),_=n(20),w=n.n(_),x=n(12),E=n.n(x),S=n(4),C=n.n(S),k=n(22),O=n.n(k),A=n(11),T=n.n(A),j=n(2),P=n.n(j),I=n(1),M=n.n(I),N=n(17),R=n.n(N),D=(n(47),n(26)),L=n.n(D),U=n(23),q=n.n(U),F=n(31),z=n.n(F),B={serializeRes:J,mergeInQueryOrForm:Z};function V(e){return H.apply(this,arguments)}function H(){return(H=R()(C.a.mark(function e(t){var n,r,o,i,a,s=arguments;return C.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:{},"object"===P()(t)&&(t=(n=t).url),n.headers=n.headers||{},B.mergeInQueryOrForm(n),n.headers&&m()(n.headers).forEach(function(e){var t=n.headers[e];"string"==typeof t&&(n.headers[e]=t.replace(/\n+/g," "))}),!n.requestInterceptor){e.next=12;break}return e.next=8,n.requestInterceptor(n);case 8:if(e.t0=e.sent,e.t0){e.next=11;break}e.t0=n;case 11:n=e.t0;case 12:return r=n.headers["content-type"]||n.headers["Content-Type"],/multipart\/form-data/i.test(r)&&(delete n.headers["content-type"],delete n.headers["Content-Type"]),e.prev=14,e.next=17,(n.userFetch||fetch)(n.url,n);case 17:return o=e.sent,e.next=20,B.serializeRes(o,t,n);case 20:if(o=e.sent,!n.responseInterceptor){e.next=28;break}return e.next=24,n.responseInterceptor(o);case 24:if(e.t1=e.sent,e.t1){e.next=27;break}e.t1=o;case 27:o=e.t1;case 28:e.next=38;break;case 30:if(e.prev=30,e.t2=e.catch(14),o){e.next=34;break}throw e.t2;case 34:throw(i=new Error(o.statusText)).statusCode=i.status=o.status,i.responseError=e.t2,i;case 38:if(o.ok){e.next=43;break}throw(a=new Error(o.statusText)).statusCode=a.status=o.status,a.response=o,a;case 43:return e.abrupt("return",o);case 44:case"end":return e.stop()}},e,null,[[14,30]])}))).apply(this,arguments)}var W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(e)};function J(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).loadSpec,r=void 0!==n&&n,o={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:Y(e.headers)},i=o.headers["content-type"],a=r||W(i);return(a?e.text:e.blob||e.buffer).call(e).then(function(e){if(o.text=e,o.data=e,a)try{var t=function(e,t){return t&&(0===t.indexOf("application/json")||t.indexOf("+json")>0)?JSON.parse(e):q.a.safeLoad(e)}(e,i);o.body=t,o.obj=t}catch(e){o.parseError=e}return o})}function Y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return"function"==typeof e.forEach?(e.forEach(function(e,n){void 0!==t[n]?(t[n]=M()(t[n])?t[n]:[t[n]],t[n].push(e)):t[n]=e}),t):t}function K(e,t){return t||"undefined"==typeof navigator||(t=navigator),t&&"ReactNative"===t.product?!(!e||"object"!==P()(e)||"string"!=typeof e.uri):"undefined"!=typeof File?e instanceof File:null!==e&&"object"===P()(e)&&"function"==typeof e.pipe}function G(e,t){var n=e.collectionFormat,r=e.allowEmptyValue,o="object"===P()(e)?e.value:e;if(void 0===o&&r)return"";if(K(o)||"boolean"==typeof o)return o;var i=encodeURIComponent;return t&&(i=z()(o)?function(e){return e}:function(e){return T()(e)}),"object"!==P()(o)||M()(o)?M()(o)?M()(o)&&!n?o.map(i).join(","):"multi"===n?o.map(i):o.map(i).join({csv:",",ssv:"%20",tsv:"%09",pipes:"|"}[n]):i(o):""}function $(e){var t=m()(e).reduce(function(t,n){var r,o=e[n],i=!!o.skipEncoding,a=i?n:encodeURIComponent(n),s=(r=o)&&"object"===P()(r)&&!M()(o);return t[a]=G(s?o:{value:o},i),t},{});return L.a.stringify(t,{encode:!1,indices:!1})||""}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.url,r=void 0===t?"":t,o=e.query,i=e.form;if(i){var a=m()(i).some(function(e){return K(i[e].value)}),s=e.headers["content-type"]||e.headers["Content-Type"];if(a||/multipart\/form-data/i.test(s)){var u=n(48);e.body=new u,m()(i).forEach(function(t){e.body.append(t,G(i[t],!0))})}else e.body=$(i);delete e.form}if(o){var c=r.split("?"),l=O()(c,2),p=l[0],f=l[1],h="";if(f){var d=L.a.parse(f);m()(o).forEach(function(e){return delete d[e]}),h=L.a.stringify(d,{encode:!0})}var v=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(function(e){return e}).join("&");return r?"?".concat(r):""}(h,$(o));e.url=p+v,delete e.query}return e}var X=n(14),Q=n.n(X),ee=n(21),te=n.n(ee),ne=n(27),re=n.n(ne),oe=n(3),ie=n.n(oe),ae=n(24),se=n.n(ae),ue=n(25),ce=n.n(ue),le=n(32),pe=n.n(le),fe=n(13),he=n.n(fe),de=n(18),me=n.n(de),ve=n(33),ge=n.n(ve),ye=n(34),be=n.n(ye),_e={add:function(e,t){return{op:"add",path:e,value:t}},replace:xe,remove:function(e,t){return{op:"remove",path:e}},merge:function(e,t){return{type:"mutation",op:"merge",path:e,value:t}},mergeDeep:function(e,t){return{type:"mutation",op:"mergeDeep",path:e,value:t}},context:function(e,t){return{type:"context",path:e,value:t}},getIn:function(e,t){return t.reduce(function(e,t){return void 0!==t&&e?e[t]:e},e)},applyPatch:function(e,t,n){if(n=n||{},"merge"===(t=ie()({},t,{path:t.path&&we(t.path)})).op){var r=Re(e,t.path);ie()(r,t.value),me.a.applyPatch(e,[xe(t.path,r)])}else if("mergeDeep"===t.op){var o=Re(e,t.path);for(var i in t.value){var a=t.value[i],s=M()(a);if(s){var u=o[i]||[];o[i]=u.concat(a)}else if(Te(a)&&!s){var c=ie()({},o[i]);for(var l in a){if(Object.prototype.hasOwnProperty.call(c,l)){c=ge()(be()({},c),a);break}ie()(c,g()({},l,a[l]))}o[i]=c}else o[i]=a}}else if("add"===t.op&&""===t.path&&Te(t.value)){var p=m()(t.value).reduce(function(e,n){return e.push({op:"add",path:"/".concat(we(n)),value:t.value[n]}),e},[]);me.a.applyPatch(e,p)}else if("replace"===t.op&&""===t.path){var f=t.value;n.allowMetaPatches&&t.meta&&Me(t)&&(M()(t.value)||Te(t.value))&&(f=ie()({},f,t.meta)),e=f}else if(me.a.applyPatch(e,[t]),n.allowMetaPatches&&t.meta&&Me(t)&&(M()(t.value)||Te(t.value))){var h=Re(e,t.path),d=ie()({},h,t.meta);me.a.applyPatch(e,[xe(t.path,d)])}return e},parentPathMatch:function(e,t){if(!M()(t))return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0},flatten:Oe,fullyNormalizeArray:function(e){return Ae(Oe(ke(e)))},normalizeArray:ke,isPromise:function(e){return Te(e)&&je(e.then)},forEachNew:function(e,t){try{return Ee(e,Ce,t)}catch(e){return e}},forEachNewPrimitive:function(e,t){try{return Ee(e,Se,t)}catch(e){return e}},isJsonPatch:Pe,isContextPatch:function(e){return Ne(e)&&"context"===e.type},isPatch:Ne,isMutation:Ie,isAdditiveMutation:Me,isGenerator:function(e){return C.a.isGeneratorFunction(e)},isFunction:je,isObject:Te,isError:function(e){return e instanceof Error}};function we(e){return M()(e)?e.length<1?"":"/"+e.map(function(e){return(e+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/"):e}function xe(e,t,n){return{op:"replace",path:e,value:t,meta:n}}function Ee(e,t,n){return Ae(Oe(e.filter(Me).map(function(e){return t(e.value,n,e.path)})||[]))}function Se(e,t,n){return n=n||[],M()(e)?e.map(function(e,r){return Se(e,t,n.concat(r))}):Te(e)?m()(e).map(function(r){return Se(e[r],t,n.concat(r))}):t(e,n[n.length-1],n)}function Ce(e,t,n){var r=[];if((n=n||[]).length>0){var o=t(e,n[n.length-1],n);o&&(r=r.concat(o))}if(M()(e)){var i=e.map(function(e,r){return Ce(e,t,n.concat(r))});i&&(r=r.concat(i))}else if(Te(e)){var a=m()(e).map(function(r){return Ce(e[r],t,n.concat(r))});a&&(r=r.concat(a))}return r=Oe(r)}function ke(e){return M()(e)?e:[e]}function Oe(e){var t;return(t=[]).concat.apply(t,he()(e.map(function(e){return M()(e)?Oe(e):e})))}function Ae(e){return e.filter(function(e){return void 0!==e})}function Te(e){return e&&"object"===P()(e)}function je(e){return e&&"function"==typeof e}function Pe(e){if(Ne(e)){var t=e.op;return"add"===t||"remove"===t||"replace"===t}return!1}function Ie(e){return Pe(e)||Ne(e)&&"mutation"===e.type}function Me(e){return Ie(e)&&("add"===e.op||"replace"===e.op||"merge"===e.op||"mergeDeep"===e.op)}function Ne(e){return e&&"object"===P()(e)}function Re(e,t){try{return me.a.getValueByPointer(e,t)}catch(e){return console.error(e),{}}}var De=n(35),Le=n.n(De),Ue=n(36),qe=n(28),Fe=n.n(qe);function ze(e,t){function n(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.message=n[0],t&&t.apply(this,n)}return n.prototype=new Error,n.prototype.name=e,n.prototype.constructor=n,n}var Be=n(37),Ve=n.n(Be),He=["properties"],We=["properties"],Je=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],Ye=["schema/example","items/example"];function Ke(e){var t=e[e.length-1],n=e[e.length-2],r=e.join("/");return He.indexOf(t)>-1&&-1===We.indexOf(n)||Je.indexOf(r)>-1||Ye.some(function(e){return r.indexOf(e)>-1})}function Ge(e,t){var n=e.split("#"),r=O()(n,2),o=r[0],i=r[1],a=E.a.resolve(o||"",t||"");return i?"".concat(a,"#").concat(i):a}var $e=new RegExp("^([a-z]+://|//)","i"),Ze=ze("JSONRefError",function(e,t,n){this.originalError=n,ie()(this,t||{})}),Xe={},Qe=new Le.a,et=[function(e){return"paths"===e[0]&&"responses"===e[3]&&"content"===e[5]&&"example"===e[7]},function(e){return"paths"===e[0]&&"requestBody"===e[3]&&"content"===e[4]&&"example"===e[6]}],tt={key:"$ref",plugin:function(e,t,n,r){var o=r.getInstance(),i=n.slice(0,-1);if(!Ke(i)&&(a=i,!et.some(function(e){return e(a)}))){var a,s=r.getContext(n).baseDoc;if("string"!=typeof e)return new Ze("$ref: must be a string (JSON-Ref)",{$ref:e,baseDoc:s,fullPath:n});var u,c,l,p=at(e),f=p[0],h=p[1]||"";try{u=s||f?ot(f,s):null}catch(t){return it(t,{pointer:h,$ref:e,basePath:u,fullPath:n})}if(function(e,t,n,r){var o=Qe.get(r);o||(o={},Qe.set(r,o));var i=function(e){if(0===e.length)return"";return"/".concat(e.map(ft).join("/"))}(n),a="".concat(t||"<specmap-base>","#").concat(e),s=i.replace(/allOf\/\d+\/?/g,""),u=r.contextTree.get([]).baseDoc;if(t==u&&dt(s,e))return!0;var c="";if(n.some(function(e){return c="".concat(c,"/").concat(ft(e)),o[c]&&o[c].some(function(e){return dt(e,a)||dt(a,e)})}))return!0;o[s]=(o[s]||[]).concat(a)}(h,u,i,r)&&!o.useCircularStructures){var d=Ge(e,u);return e===d?null:_e.replace(n,d)}if(null==u?(l=lt(h),void 0===(c=r.get(l))&&(c=new Ze("Could not resolve reference: ".concat(e),{pointer:h,$ref:e,baseDoc:s,fullPath:n}))):c=null!=(c=st(u,h)).__value?c.__value:c.catch(function(t){throw it(t,{pointer:h,$ref:e,baseDoc:s,fullPath:n})}),c instanceof Error)return[_e.remove(n),c];var v=Ge(e,u),g=_e.replace(i,c,{$$ref:v});if(u&&u!==s)return[g,_e.context(i,{baseDoc:u})];try{if(!function(e,t){var n=[e];return t.path.reduce(function(e,t){return n.push(e[t]),e[t]},e),function e(t){return _e.isObject(t)&&(n.indexOf(t)>=0||m()(t).some(function(n){return e(t[n])}))}(t.value)}(r.state,g)||o.useCircularStructures)return g}catch(e){return null}}}},nt=ie()(tt,{docCache:Xe,absoluteify:ot,clearCache:function(e){void 0!==e?delete Xe[e]:m()(Xe).forEach(function(e){delete Xe[e]})},JSONRefError:Ze,wrapError:it,getDoc:ut,split:at,extractFromDoc:st,fetchJSON:function(e){return Object(Ue.fetch)(e,{headers:{Accept:"application/json, application/yaml"},loadSpec:!0}).then(function(e){return e.text()}).then(function(e){return q.a.safeLoad(e)})},extract:ct,jsonPointerToArray:lt,unescapeJsonPointerToken:pt}),rt=nt;function ot(e,t){if(!$e.test(e)){if(!t)throw new Ze("Tried to resolve a relative URL, without having a basePath. path: '".concat(e,"' basePath: '").concat(t,"'"));return E.a.resolve(t,e)}return e}function it(e,t){var n;return n=e&&e.response&&e.response.body?"".concat(e.response.body.code," ").concat(e.response.body.message):e.message,new Ze("Could not resolve reference: ".concat(n),t,e)}function at(e){return(e+"").split("#")}function st(e,t){var n=Xe[e];if(n&&!_e.isPromise(n))try{var r=ct(t,n);return ie()(Q.a.resolve(r),{__value:r})}catch(e){return Q.a.reject(e)}return ut(e).then(function(e){return ct(t,e)})}function ut(e){var t=Xe[e];return t?_e.isPromise(t)?t:Q.a.resolve(t):(Xe[e]=nt.fetchJSON(e).then(function(t){return Xe[e]=t,t}),Xe[e])}function ct(e,t){var n=lt(e);if(n.length<1)return t;var r=_e.getIn(t,n);if(void 0===r)throw new Ze("Could not resolve pointer: ".concat(e," does not exist in document"),{pointer:e});return r}function lt(e){if("string"!=typeof e)throw new TypeError("Expected a string, got a ".concat(P()(e)));return"/"===e[0]&&(e=e.substr(1)),""===e?[]:e.split("/").map(pt)}function pt(e){return"string"!=typeof e?e:Fe.a.unescape(e.replace(/~1/g,"/").replace(/~0/g,"~"))}function ft(e){return Fe.a.escape(e.replace(/~/g,"~0").replace(/\//g,"~1"))}var ht=function(e){return!e||"/"===e||"#"===e};function dt(e,t){if(ht(t))return!0;var n=e.charAt(t.length),r=t.slice(-1);return 0===e.indexOf(t)&&(!n||"/"===n||"#"===n)&&"#"!==r}var mt={key:"allOf",plugin:function(e,t,n,r,o){if(!o.meta||!o.meta.$$ref){var i=n.slice(0,-1);if(!Ke(i)){if(!M()(e)){var a=new TypeError("allOf must be an array");return a.fullPath=n,a}var s=!1,u=o.value;i.forEach(function(e){u&&(u=u[e])}),delete(u=ie()({},u)).allOf;var c=[];return c.push(r.replace(i,{})),e.forEach(function(e,t){if(!r.isObject(e)){if(s)return null;s=!0;var o=new TypeError("Elements in allOf must be objects");return o.fullPath=n,c.push(o)}c.push(r.mergeDeep(i,e));var a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.specmap,o=n.getBaseUrlForNodePath,i=void 0===o?function(e){return r.getContext([].concat(he()(t),he()(e))).baseDoc}:o,a=n.targetKeys,s=void 0===a?["$ref","$$ref"]:a,u=[];return Ve()(e).forEach(function(){if(s.indexOf(this.key)>-1){var e=this.path,n=t.concat(this.path),o=Ge(this.node,i(e));u.push(r.replace(n,o))}}),u}(e,n.slice(0,-1),{getBaseUrlForNodePath:function(e){return r.getContext([].concat(he()(n),[t],he()(e))).baseDoc},specmap:r});c.push.apply(c,he()(a))}),c.push(r.mergeDeep(i,u)),u.$$ref||c.push(r.remove([].concat(i,"$$ref"))),c}}}},vt={key:"parameters",plugin:function(e,t,n,r,o){if(M()(e)&&e.length){var i=ie()([],e),a=n.slice(0,-1),s=ie()({},_e.getIn(r.spec,a));return e.forEach(function(e,t){try{i[t].default=r.parameterMacro(s,e)}catch(e){var o=new Error(e);return o.fullPath=n,o}}),_e.replace(n,i)}return _e.replace(n,e)}},gt={key:"properties",plugin:function(e,t,n,r){var o=ie()({},e);for(var i in e)try{o[i].default=r.modelPropertyMacro(o[i])}catch(e){var a=new Error(e);return a.fullPath=n,a}return _e.replace(n,o)}};function yt(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}var bt=function(){function e(t){se()(this,e),this.root=_t(t||{})}return ce()(e,[{key:"set",value:function(e,t){var n=this.getParent(e,!0);if(n){var r=e[e.length-1],o=n.children;o[r]?wt(o[r],t,n):o[r]=_t(t,n)}else wt(this.root,t,null)}},{key:"get",value:function(e){if((e=e||[]).length<1)return this.root.value;for(var t,n,r=this.root,o=0;o<e.length&&(n=e[o],(t=r.children)[n]);o++)r=t[n];return r&&r.protoValue}},{key:"getParent",value:function(e,t){return!e||e.length<1?null:e.length<2?this.root:e.slice(0,-1).reduce(function(e,n){if(!e)return e;var r=e.children;return!r[n]&&t&&(r[n]=_t(null,e)),r[n]},this.root)}}]),e}();function _t(e,t){return wt({children:{}},e,t)}function wt(e,t,n){return e.value=t||{},e.protoValue=n?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yt(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):yt(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}({},n.protoValue,{},e.value):e.value,m()(e.children).forEach(function(t){var n=e.children[t];e.children[t]=wt(n,n.value,e)}),e}var xt=function(){function e(t){var n=this;se()(this,e),ie()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new bt,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:ie()(re()(this),_e,{getInstance:function(){return n}}),allowMetaPatches:!1},t),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=this.plugins.map(this.wrapPlugin.bind(this)).filter(_e.isFunction),this.patches.push(_e.add([],this.spec)),this.patches.push(_e.context([],this.context)),this.updatePatches(this.patches)}return ce()(e,[{key:"debug",value:function(e){if(this.debugLevel===e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console).log.apply(t,r)}}},{key:"verbose",value:function(e){if("verbose"===this.debugLevel){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console).log.apply(t,["[".concat(e,"] ")].concat(r))}}},{key:"wrapPlugin",value:function(e,t){var n,r,o,i=this.pathDiscriminator,a=null;return e[this.pluginProp]?(a=e,n=e[this.pluginProp]):_e.isFunction(e)?n=e:_e.isObject(e)&&(r=e,o=function(e,t){return!M()(e)||e.every(function(e,n){return e===t[n]})},n=C.a.mark(function e(t,n){var a,s,u,c,l,p,f,h,d;return C.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:d=function(e,t,u){var c,l,p,f,h,v,g,y,b,_,w,x,E;return C.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(_e.isObject(e)){a.next=6;break}if(r.key!==t[t.length-1]){a.next=4;break}return a.next=4,r.plugin(e,r.key,t,n);case 4:a.next=30;break;case 6:c=t.length-1,l=t[c],p=t.indexOf("properties"),f="properties"===l&&c===p,h=n.allowMetaPatches&&s[e.$$ref],v=0,g=m()(e);case 12:if(!(v<g.length)){a.next=30;break}if(y=g[v],b=e[y],_=t.concat(y),w=_e.isObject(b),x=e.$$ref,h){a.next=22;break}if(!w){a.next=22;break}return n.allowMetaPatches&&x&&(s[x]=!0),a.delegateYield(d(b,_,u),"t0",22);case 22:if(f||y!==r.key){a.next=27;break}if(E=o(i,t),i&&!E){a.next=27;break}return a.next=27,r.plugin(b,y,_,n,u);case 27:v++,a.next=12;break;case 30:case"end":return a.stop()}},a)},a=C.a.mark(d),s={},u=!0,c=!1,l=void 0,e.prev=6,p=te()(t.filter(_e.isAdditiveMutation));case 8:if(u=(f=p.next()).done){e.next=14;break}return h=f.value,e.delegateYield(d(h.value,h.path,h),"t0",11);case 11:u=!0,e.next=8;break;case 14:e.next=20;break;case 16:e.prev=16,e.t1=e.catch(6),c=!0,l=e.t1;case 20:e.prev=20,e.prev=21,u||null==p.return||p.return();case 23:if(e.prev=23,!c){e.next=26;break}throw l;case 26:return e.finish(23);case 27:return e.finish(20);case 28:case"end":return e.stop()}},e,null,[[6,16,20,28],[21,,23,27]])})),ie()(n.bind(a),{pluginName:e.name||t,isGenerator:_e.isGenerator(n)})}},{key:"nextPlugin",value:function(){var e=this;return pe()(this.wrappedPlugins,function(t){return e.getMutationsForPlugin(t).length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0)return Q.a.race(this.promisedPatches.map(function(e){return e.value}))}},{key:"getPluginHistory",value:function(e){var t=this.getPluginName(e);return this.pluginHistory[t]||[]}},{key:"getPluginRunCount",value:function(e){return this.getPluginHistory(e).length}},{key:"getPluginHistoryTip",value:function(e){var t=this.getPluginHistory(e);return t&&t[t.length-1]||{}}},{key:"getPluginMutationIndex",value:function(e){var t=this.getPluginHistoryTip(e).mutationIndex;return"number"!=typeof t?-1:t}},{key:"getPluginName",value:function(e){return e.pluginName}},{key:"updatePluginHistory",value:function(e,t){var n=this.getPluginName(e);(this.pluginHistory[n]=this.pluginHistory[n]||[]).push(t)}},{key:"updatePatches",value:function(e,t){var n=this;_e.normalizeArray(e).forEach(function(e){if(e instanceof Error)n.errors.push(e);else try{if(!_e.isObject(e))return void n.debug("updatePatches","Got a non-object patch",e);if(n.showDebug&&n.allPatches.push(e),_e.isPromise(e.value))return n.promisedPatches.push(e),void n.promisedPatchThen(e);if(_e.isContextPatch(e))return void n.setContext(e.path,e.value);if(_e.isMutation(e))return void n.updateMutations(e)}catch(e){console.error(e),n.errors.push(e)}})}},{key:"updateMutations",value:function(e){"object"===P()(e.value)&&!M()(e.value)&&this.allowMetaPatches&&(e.value=ie()({},e.value));var t=_e.applyPatch(this.state,e,{allowMetaPatches:this.allowMetaPatches});t&&(this.mutations.push(e),this.state=t)}},{key:"removePromisedPatch",value:function(e){var t=this.promisedPatches.indexOf(e);t<0?this.debug("Tried to remove a promisedPatch that isn't there!"):this.promisedPatches.splice(t,1)}},{key:"promisedPatchThen",value:function(e){var t=this;return e.value=e.value.then(function(n){var r=ie()({},e,{value:n});t.removePromisedPatch(e),t.updatePatches(r)}).catch(function(n){t.removePromisedPatch(e),t.updatePatches(n)})}},{key:"getMutations",value:function(e,t){return e=e||0,"number"!=typeof t&&(t=this.mutations.length),this.mutations.slice(e,t)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(e){var t=this.getPluginMutationIndex(e);return this.getMutations(t+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getPatchesOfType",value:function(e,t){return e.filter(t)}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(e){return _e.getIn(this.state,e)}},{key:"_getContext",value:function(e){return this.contextTree.get(e)}},{key:"setContext",value:function(e,t){return this.contextTree.set(e,t)}},{key:"_hasRun",value:function(e){return this.getPluginRunCount(this.getCurrentPlugin())>(e||0)}},{key:"_clone",value:function(e){return JSON.parse(T()(e))}},{key:"dispatch",value:function(){var e=this,t=this,n=this.nextPlugin();if(!n){var r=this.nextPromisedPatch();if(r)return r.then(function(){return e.dispatch()}).catch(function(){return e.dispatch()});var o={spec:this.state,errors:this.errors};return this.showDebug&&(o.patches=this.allPatches),Q.a.resolve(o)}if(t.pluginCount=t.pluginCount||{},t.pluginCount[n]=(t.pluginCount[n]||0)+1,t.pluginCount[n]>100)return Q.a.resolve({spec:t.state,errors:t.errors.concat(new Error("We've reached a hard limit of ".concat(100," plugin runs")))});if(n!==this.currentPlugin&&this.promisedPatches.length){var i=this.promisedPatches.map(function(e){return e.value});return Q.a.all(i.map(function(e){return e.then(Function,Function)})).then(function(){return e.dispatch()})}return function(){t.currentPlugin=n;var e=t.getCurrentMutations(),r=t.mutations.length-1;try{if(n.isGenerator){var o=!0,i=!1,s=void 0;try{for(var u,c=te()(n(e,t.getLib()));!(o=(u=c.next()).done);o=!0){var l=u.value;a(l)}}catch(e){i=!0,s=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw s}}}else{var p=n(e,t.getLib());a(p)}}catch(e){console.error(e),a([ie()(re()(e),{plugin:n})])}finally{t.updatePluginHistory(n,{mutationIndex:r})}return t.dispatch()}();function a(e){e&&(e=_e.fullyNormalizeArray(e),t.updatePatches(e,n))}}}]),e}();var Et={refs:rt,allOf:mt,parameters:vt,properties:gt},St=n(29),Ct=n.n(St),kt=function(e){return String.prototype.toLowerCase.call(e)},Ot=function(e){return e.replace(/[^\w]/gi,"_")};function At(e){var t=e.openapi;return!!t&&w()(t,"3")}function Tt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).v2OperationIdCompatibilityMode;return e&&"object"===P()(e)?(e.operationId||"").replace(/\s/g,"").length?Ot(e.operationId):function(e,t){if((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).v2OperationIdCompatibilityMode){var n="".concat(t.toLowerCase(),"_").concat(e).replace(/[\s!@#$%^&*()_+=[{\]};:<>|.\/?,\\'""-]/g,"_");return(n=n||"".concat(e.substring(1),"_").concat(t)).replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return"".concat(kt(t)).concat(Ot(e))}(t,n,{v2OperationIdCompatibilityMode:r}):null}function jt(e,t){return"".concat(kt(t),"-").concat(e)}function Pt(e,t){return e&&e.paths?function(e,t){return It(e,t,!0)||null}(e,function(e){var n=e.pathName,r=e.method,o=e.operation;if(!o||"object"!==P()(o))return!1;var i=o.operationId;return[Tt(o,n,r),jt(n,r),i].some(function(e){return e&&e===t})}):null}function It(e,t,n){if(!e||"object"!==P()(e)||!e.paths||"object"!==P()(e.paths))return null;var r=e.paths;for(var o in r)for(var i in r[o])if("PARAMETERS"!==i.toUpperCase()){var a=r[o][i];if(a&&"object"===P()(a)){var s={spec:e,pathName:o,method:i.toUpperCase(),operation:a},u=t(s);if(n&&u)return s}}}function Mt(e){var t=e.spec,n=t.paths,r={};if(!n||t.$$normalized)return e;for(var o in n){var i=n[o];if(Ct()(i)){var a=i.parameters,s=function(e){var n=i[e];if(!Ct()(n))return"continue";var s=Tt(n,o,e);if(s){r[s]?r[s].push(n):r[s]=[n];var u=r[s];if(u.length>1)u.forEach(function(e,t){e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId="".concat(s).concat(t+1)});else if(void 0!==n.operationId){var c=u[0];c.__originalOperationId=c.__originalOperationId||n.operationId,c.operationId=s}}if("parameters"!==e){var l=[],p={};for(var f in t)"produces"!==f&&"consumes"!==f&&"security"!==f||(p[f]=t[f],l.push(p));if(a&&(p.parameters=a,l.push(p)),l.length)for(var h=0,d=l;h<d.length;h++){var m=d[h];for(var v in m)if(n[v]){if("parameters"===v){var g=!0,y=!1,b=void 0;try{for(var _,w=function(){var e=_.value;n[v].some(function(t){return t.name&&t.name===e.name||t.$ref&&t.$ref===e.$ref||t.$$ref&&t.$$ref===e.$$ref||t===e})||n[v].push(e)},x=te()(m[v]);!(g=(_=x.next()).done);g=!0)w()}catch(e){y=!0,b=e}finally{try{g||null==x.return||x.return()}finally{if(y)throw b}}}}else n[v]=m[v]}}};for(var u in i)s(u)}}return t.$$normalized=!0,e}function Nt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.requestInterceptor,r=t.responseInterceptor,o=e.withCredentials?"include":"same-origin";return function(t){return e({url:t,loadSpec:!0,requestInterceptor:n,responseInterceptor:r,headers:{Accept:"application/json"},credentials:o}).then(function(e){return e.body})}}function Rt(e){var t=e.fetch,n=e.spec,r=e.url,o=e.mode,i=e.allowMetaPatches,a=void 0===i||i,s=e.pathDiscriminator,u=e.modelPropertyMacro,c=e.parameterMacro,l=e.requestInterceptor,p=e.responseInterceptor,f=e.skipNormalization,h=e.useCircularStructures,d=e.http,m=e.baseDoc;return m=m||r,d=t||d||V,n?v(n):Nt(d,{requestInterceptor:l,responseInterceptor:p})(m).then(v);function v(e){m&&(Et.refs.docCache[m]=e),Et.refs.fetchJSON=Nt(d,{requestInterceptor:l,responseInterceptor:p});var t,n=[Et.refs];return"function"==typeof c&&n.push(Et.parameters),"function"==typeof u&&n.push(Et.properties),"strict"!==o&&n.push(Et.allOf),(t={spec:e,context:{baseDoc:m},plugins:n,allowMetaPatches:a,pathDiscriminator:s,parameterMacro:c,modelPropertyMacro:u,useCircularStructures:h},new xt(t).dispatch()).then(f?function(){var e=R()(C.a.mark(function e(t){return C.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t);case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}():Mt)}}var Dt=n(16),Lt=n.n(Dt);function Ut(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}function qt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ut(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):Ut(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}function Ft(){return(Ft=R()(C.a.mark(function e(t,n){var r,o,i,a,s,u,c,l,p,f,h,d,m=arguments;return C.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=m.length>2&&void 0!==m[2]?m[2]:{},o=r.returnEntireTree,i=r.baseDoc,a=r.requestInterceptor,s=r.responseInterceptor,u=r.parameterMacro,c=r.modelPropertyMacro,l=r.useCircularStructures,p={pathDiscriminator:n,baseDoc:i,requestInterceptor:a,responseInterceptor:s,parameterMacro:u,modelPropertyMacro:c,useCircularStructures:l},f=Mt({spec:t}),h=f.spec,e.next=6,Rt(qt({},p,{spec:h,allowMetaPatches:!0,skipNormalization:!0}));case 6:return d=e.sent,!o&&M()(n)&&n.length&&(d.spec=Lt()(d.spec,n)||null),e.abrupt("return",d);case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}var zt=n(38),Bt=n.n(zt);function Vt(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}function Ht(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vt(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):Vt(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}var Wt=function(){return null},Jt=function(e){return M()(e)?e:[e]},Yt={mapTagOperations:function(e){var t=e.spec,n=e.cb,r=void 0===n?Wt:n,o=e.defaultTag,i=void 0===o?"default":o,a=e.v2OperationIdCompatibilityMode,s={},u={};return It(t,function(e){var n=e.pathName,o=e.method,c=e.operation;(c.tags?Jt(c.tags):[i]).forEach(function(e){if("string"==typeof e){var i=u[e]=u[e]||{},l=Tt(c,n,o,{v2OperationIdCompatibilityMode:a}),p=r({spec:t,pathName:n,method:o,operation:c,operationId:l});if(s[l])s[l]++,i["".concat(l).concat(s[l])]=p;else if(void 0!==i[l]){var f=s[l]||1;s[l]=f+1,i["".concat(l).concat(s[l])]=p;var h=i[l];delete i[l],i["".concat(l).concat(f)]=h}else i[l]=p}})}),u},makeExecute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=t.pathName,r=t.method,o=t.operationId;return function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.execute(Ht({spec:e.spec},Bt()(e,"requestInterceptor","responseInterceptor","userFetch"),{pathName:n,method:r,parameters:t,operationId:o},i))}}}};var Kt=n(39),Gt=n.n(Kt),$t=n(40),Zt=n.n($t),Xt=n(41),Qt=n.n(Xt),en=n(19),tn=n.n(en),nn=n(42),rn=n.n(nn),on={body:function(e){var t=e.req,n=e.value;t.body=n},header:function(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{},void 0!==r&&(t.headers[n.name]=r)},query:function(e){var t=e.req,n=e.value,r=e.parameter;t.query=t.query||{},!1===n&&"boolean"===r.type&&(n="false");0===n&&["number","integer"].indexOf(r.type)>-1&&(n="0");if(n)t.query[r.name]={collectionFormat:r.collectionFormat,value:n};else if(r.allowEmptyValue&&void 0!==n){var o=r.name;t.query[o]=t.query[o]||{},t.query[o].allowEmptyValue=!0}},path:function(e){var t=e.req,n=e.value,r=e.parameter;t.url=t.url.split("{".concat(r.name,"}")).join(encodeURIComponent(n))},formData:function(e){var t=e.req,n=e.value,r=e.parameter;(n||r.allowEmptyValue)&&(t.form=t.form||{},t.form[r.name]={value:n,allowEmptyValue:r.allowEmptyValue,collectionFormat:r.collectionFormat})}};n(49);var an=n(43),sn=n.n(an),un=n(44),cn=function(e){return":/?#[]@!$&'()*+,;=".indexOf(e)>-1},ln=function(e){return/^[a-z0-9\-._~]+$/i.test(e)};function pn(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).escape,n=arguments.length>2?arguments[2]:void 0;return"number"==typeof e&&(e=e.toString()),"string"==typeof e&&e.length&&t?n?JSON.parse(e):Object(un.stringToCharArray)(e).map(function(e){return ln(e)?e:cn(e)&&"unsafe"===t?e:(sn()(e)||[]).map(function(e){return"0".concat(e.toString(16).toUpperCase()).slice(-2)}).map(function(e){return"%".concat(e)}).join("")}).join(""):e}function fn(e){var t=e.value;return M()(t)?function(e){var t=e.key,n=e.value,r=e.style,o=e.explode,i=e.escape,a=function(e){return pn(e,{escape:i})};if("simple"===r)return n.map(function(e){return a(e)}).join(",");if("label"===r)return".".concat(n.map(function(e){return a(e)}).join("."));if("matrix"===r)return n.map(function(e){return a(e)}).reduce(function(e,n){return!e||o?"".concat(e||"",";").concat(t,"=").concat(n):"".concat(e,",").concat(n)},"");if("form"===r){var s=o?"&".concat(t,"="):",";return n.map(function(e){return a(e)}).join(s)}if("spaceDelimited"===r){var u=o?"".concat(t,"="):"";return n.map(function(e){return a(e)}).join(" ".concat(u))}if("pipeDelimited"===r){var c=o?"".concat(t,"="):"";return n.map(function(e){return a(e)}).join("|".concat(c))}}(e):"object"===P()(t)?function(e){var t=e.key,n=e.value,r=e.style,o=e.explode,i=e.escape,a=function(e){return pn(e,{escape:i})},s=m()(n);if("simple"===r)return s.reduce(function(e,t){var r=a(n[t]),i=o?"=":",",s=e?"".concat(e,","):"";return"".concat(s).concat(t).concat(i).concat(r)},"");if("label"===r)return s.reduce(function(e,t){var r=a(n[t]),i=o?"=":".",s=e?"".concat(e,"."):".";return"".concat(s).concat(t).concat(i).concat(r)},"");if("matrix"===r&&o)return s.reduce(function(e,t){var r=a(n[t]),o=e?"".concat(e,";"):";";return"".concat(o).concat(t,"=").concat(r)},"");if("matrix"===r)return s.reduce(function(e,r){var o=a(n[r]),i=e?"".concat(e,","):";".concat(t,"=");return"".concat(i).concat(r,",").concat(o)},"");if("form"===r)return s.reduce(function(e,t){var r=a(n[t]),i=e?"".concat(e).concat(o?"&":","):"",s=o?"=":",";return"".concat(i).concat(t).concat(s).concat(r)},"")}(e):function(e){var t=e.key,n=e.value,r=e.style,o=e.escape,i=function(e){return pn(e,{escape:o})};if("simple"===r)return i(n);if("label"===r)return".".concat(i(n));if("matrix"===r)return";".concat(t,"=").concat(i(n));if("form"===r)return i(n);if("deepObject"===r)return i(n)}(e)}function hn(e,t){return t.includes("application/json")?"string"==typeof e?e:T()(e):e.toString()}function dn(e){var t=e.req,n=e.value,r=e.parameter,o=r.name,i=r.style,a=r.explode,s=r.content;if(s){var u=m()(s)[0];t.url=t.url.split("{".concat(o,"}")).join(pn(hn(n,u),{escape:!0}))}else{var c=fn({key:r.name,value:n,style:i||"simple",explode:a||!1,escape:!0});t.url=t.url.split("{".concat(o,"}")).join(c)}}function mn(e){var t=e.req,n=e.value,r=e.parameter;if(t.query=t.query||{},r.content){var o=m()(r.content)[0];t.query[r.name]=hn(n,o)}else if(!1===n&&(n="false"),0===n&&(n="0"),n){var i=P()(n);if("deepObject"===r.style)m()(n).forEach(function(e){var o=n[e];t.query["".concat(r.name,"[").concat(e,"]")]={value:fn({key:e,value:o,style:"deepObject",escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}});else if("object"!==i||M()(n)||"form"!==r.style&&r.style||!r.explode&&void 0!==r.explode)t.query[r.name]={value:fn({key:r.name,value:n,style:r.style||"form",explode:void 0===r.explode||r.explode,escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0};else{m()(n).forEach(function(e){var o=n[e];t.query[e]={value:fn({key:e,value:o,style:r.style||"form",escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}})}}else if(r.allowEmptyValue&&void 0!==n){var a=r.name;t.query[a]=t.query[a]||{},t.query[a].allowEmptyValue=!0}}var vn=["accept","authorization","content-type"];function gn(e){var t=e.req,n=e.parameter,r=e.value;if(t.headers=t.headers||{},!(vn.indexOf(n.name.toLowerCase())>-1))if(n.content){var o=m()(n.content)[0];t.headers[n.name]=hn(r,o)}else void 0!==r&&(t.headers[n.name]=fn({key:n.name,value:r,style:n.style||"simple",explode:void 0!==n.explode&&n.explode,escape:!1}))}function yn(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{};var o=P()(r);if(n.content){var i=m()(n.content)[0];t.headers.Cookie="".concat(n.name,"=").concat(hn(r,i))}else if("undefined"!==o){var a="object"===o&&!M()(r)&&n.explode?"":"".concat(n.name,"=");t.headers.Cookie=a+fn({key:n.name,value:r,escape:!1,style:n.style||"form",explode:void 0!==n.explode&&n.explode})}}var bn=n(30),_n=function(e,t){var n=e.operation,r=e.requestBody,o=e.securities,i=e.spec,a=e.attachContentTypeForEmptyPayload,s=e.requestContentType;t=function(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,o=e.operation,i=void 0===o?{}:o,a=e.spec,s=b()({},t),u=r.authorized,c=void 0===u?{}:u,l=i.security||a.security||[],p=c&&!!m()(c).length,f=Lt()(a,["components","securitySchemes"])||{};if(s.headers=s.headers||{},s.query=s.query||{},!m()(r).length||!p||!l||M()(i.security)&&!i.security.length)return t;return l.forEach(function(e,t){for(var n in e){var r=c[n],o=f[n];if(r){var i=r.value||r,a=o.type;if(r)if("apiKey"===a)"query"===o.in&&(s.query[o.name]=i),"header"===o.in&&(s.headers[o.name]=i),"cookie"===o.in&&(s.cookies[o.name]=i);else if("http"===a){if("basic"===o.scheme){var u=i.username,l=i.password,p=tn()("".concat(u,":").concat(l));s.headers.Authorization="Basic ".concat(p)}"bearer"===o.scheme&&(s.headers.Authorization="Bearer ".concat(i))}else if("oauth2"===a){var h=r.token||{},d=h.access_token,m=h.token_type;m&&"bearer"!==m.toLowerCase()||(m="Bearer"),s.headers.Authorization="".concat(m," ").concat(d)}}}}),s}({request:t,securities:o,operation:n,spec:i});var u=n.requestBody||{},c=m()(u.content||{}),l=s&&c.indexOf(s)>-1;if(r||a){if(s&&l)t.headers["Content-Type"]=s;else if(!s){var p=c[0];p&&(t.headers["Content-Type"]=p,s=p)}}else s&&l&&(t.headers["Content-Type"]=s);return r&&(s?c.indexOf(s)>-1&&("application/x-www-form-urlencoded"===s||0===s.indexOf("multipart/")?"object"===P()(r)?(t.form={},m()(r).forEach(function(e){var n,o,i=r[e];"undefined"!=typeof File&&(o=i instanceof File),"undefined"!=typeof Blob&&(o=o||i instanceof Blob),void 0!==bn.Buffer&&(o=o||bn.Buffer.isBuffer(i)),n="object"!==P()(i)||o?i:M()(i)?i.toString():T()(i),t.form[e]={value:n}})):t.form=r:t.body=r):t.body=r),t};var wn=function(e,t){var n=e.spec,r=e.operation,o=e.securities,i=e.requestContentType,a=e.attachContentTypeForEmptyPayload;if((t=function(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,o=e.operation,i=void 0===o?{}:o,a=e.spec,s=b()({},t),u=r.authorized,c=void 0===u?{}:u,l=r.specSecurity,p=void 0===l?[]:l,f=i.security||p,h=c&&!!m()(c).length,d=a.securityDefinitions;if(s.headers=s.headers||{},s.query=s.query||{},!m()(r).length||!h||!f||M()(i.security)&&!i.security.length)return t;return f.forEach(function(e,t){for(var n in e){var r=c[n];if(r){var o=r.token,i=r.value||r,a=d[n],u=a.type,l=a["x-tokenName"]||"access_token",p=o&&o[l],f=o&&o.token_type;if(r)if("apiKey"===u){var h="query"===a.in?"query":"headers";s[h]=s[h]||{},s[h][a.name]=i}else"basic"===u?i.header?s.headers.authorization=i.header:(i.base64=tn()("".concat(i.username,":").concat(i.password)),s.headers.authorization="Basic ".concat(i.base64)):"oauth2"===u&&p&&(f=f&&"bearer"!==f.toLowerCase()?f:"Bearer",s.headers.authorization="".concat(f," ").concat(p))}}}),s}({request:t,securities:o,operation:r,spec:n})).body||t.form||a)i?t.headers["Content-Type"]=i:M()(r.consumes)?t.headers["Content-Type"]=r.consumes[0]:M()(n.consumes)?t.headers["Content-Type"]=n.consumes[0]:r.parameters&&r.parameters.filter(function(e){return"file"===e.type}).length?t.headers["Content-Type"]="multipart/form-data":r.parameters&&r.parameters.filter(function(e){return"formData"===e.in}).length&&(t.headers["Content-Type"]="application/x-www-form-urlencoded");else if(i){var s=r.parameters&&r.parameters.filter(function(e){return"body"===e.in}).length>0,u=r.parameters&&r.parameters.filter(function(e){return"formData"===e.in}).length>0;(s||u)&&(t.headers["Content-Type"]=i)}return t};function xn(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}function En(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xn(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):xn(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}var Sn=function(e){return M()(e)?e:[]},Cn=ze("OperationNotFoundError",function(e,t,n){this.originalError=n,ie()(this,t||{})}),kn=function(e,t){return t.filter(function(t){return t.name===e})},On=function(e){var t={};e.forEach(function(e){t[e.in]||(t[e.in]={}),t[e.in][e.name]=e});var n=[];return m()(t).forEach(function(e){m()(t[e]).forEach(function(r){n.push(t[e][r])})}),n},An={buildRequest:Tn};function Tn(e){var t=e.spec,n=e.operationId,o=(e.securities,e.requestContentType,e.responseContentType),i=e.scheme,a=e.requestInterceptor,s=e.responseInterceptor,u=e.contextUrl,c=e.userFetch,l=(e.requestBody,e.server),p=e.serverVariables,f=e.http,h=e.parameters,d=e.parameterBuilders,v=At(t);d||(d=v?r:on);var g={url:"",credentials:f&&f.withCredentials?"include":"same-origin",headers:{},cookies:{}};a&&(g.requestInterceptor=a),s&&(g.responseInterceptor=s),c&&(g.userFetch=c);var y=Pt(t,n);if(!y)throw new Cn("Operation ".concat(n," not found"));var b,_=y.operation,w=void 0===_?{}:_,x=y.method,S=y.pathName;if(g.url+=At((b={spec:t,scheme:i,contextUrl:u,server:l,serverVariables:p,pathName:S,method:x}).spec)?function(e){var t=e.spec,n=e.pathName,r=e.method,o=e.server,i=e.contextUrl,a=e.serverVariables,s=void 0===a?{}:a,u=Lt()(t,["paths",n,(r||"").toLowerCase(),"servers"])||Lt()(t,["paths",n,"servers"])||Lt()(t,["servers"]),c="",l=null;if(o&&u&&u.length){var p=u.map(function(e){return e.url});p.indexOf(o)>-1&&(c=o,l=u[p.indexOf(o)])}if(!c&&u&&u.length&&(c=u[0].url,l=u[0]),c.indexOf("{")>-1){var f=function(e){for(var t,n=[],r=/{([^}]+)}/g;t=r.exec(e);)n.push(t[1]);return n}(c);f.forEach(function(e){if(l.variables&&l.variables[e]){var t=l.variables[e],n=s[e]||t.default,r=new RegExp("{".concat(e,"}"),"g");c=c.replace(r,n)}})}return function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=E.a.parse(t),o=E.a.parse(n),i=jn(r.protocol)||jn(o.protocol)||"",a=r.host||o.host,s=r.pathname||"";return"/"===(e=i&&a?"".concat(i,"://").concat(a+s):s)[e.length-1]?e.slice(0,-1):e}(c,i)}(b):function(e){var t,n=e.spec,r=e.scheme,o=e.contextUrl,i=void 0===o?"":o,a=E.a.parse(i),s=M()(n.schemes)?n.schemes[0]:null,u=r||s||jn(a.protocol)||"http",c=n.host||a.host||"",l=n.basePath||"";return"/"===(t=u&&c?"".concat(u,"://").concat(c+l):l)[t.length-1]?t.slice(0,-1):t}(b),!n)return delete g.cookies,g;g.url+=S,g.method="".concat(x).toUpperCase(),h=h||{};var C=t.paths[S]||{};o&&(g.headers.accept=o);var k=On([].concat(Sn(w.parameters)).concat(Sn(C.parameters)));k.forEach(function(e){var n,r=d[e.in];if("body"===e.in&&e.schema&&e.schema.properties&&(n=h),void 0===(n=e&&e.name&&h[e.name])?n=e&&e.name&&h["".concat(e.in,".").concat(e.name)]:kn(e.name,k).length>1&&console.warn("Parameter '".concat(e.name,"' is ambiguous because the defined spec has more than one parameter with the name: '").concat(e.name,"' and the passed-in parameter values did not define an 'in' value.")),null!==n){if(void 0!==e.default&&void 0===n&&(n=e.default),void 0===n&&e.required&&!e.allowEmptyValue)throw new Error("Required parameter ".concat(e.name," is not provided"));if(v&&e.schema&&"object"===e.schema.type&&"string"==typeof n)try{n=JSON.parse(n)}catch(e){throw new Error("Could not parse object parameter value string as JSON")}r&&r({req:g,parameter:e,value:n,operation:w,spec:t})}});var O=En({},e,{operation:w});if((g=v?_n(O,g):wn(O,g)).cookies&&m()(g.cookies).length){var A=m()(g.cookies).reduce(function(e,t){var n=g.cookies[t];return e+(e?"&":"")+rn.a.serialize(t,n)},"");g.headers.Cookie=A}return g.cookies&&delete g.cookies,Z(g),g}var jn=function(e){return e?e.replace(/\W/g,""):null};function Pn(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}function In(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e?n.url=e:n=e,!(this instanceof In))return new In(n);b()(this,n);var r=this.resolve().then(function(){return t.disableInterfaces||b()(t,In.makeApisTagOperation(t)),t});return r.client=this,r}In.http=V,In.makeHttp=function(e,t,n){return n=n||function(e){return e},t=t||function(e){return e},function(r){return"string"==typeof r&&(r={url:r}),B.mergeInQueryOrForm(r),r=t(r),n(e(r))}}.bind(null,In.http),In.resolve=Rt,In.resolveSubtree=function(e,t){return Ft.apply(this,arguments)},In.execute=function(e){var t=e.http,n=e.fetch,r=e.spec,o=e.operationId,i=e.pathName,a=e.method,s=e.parameters,u=e.securities,c=Gt()(e,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),l=t||n||V;i&&a&&!o&&(o=jt(i,a));var p=An.buildRequest(En({spec:r,operationId:o,parameters:s,securities:u,http:l},c));return p.body&&(Zt()(p.body)||Qt()(p.body))&&(p.body=T()(p.body)),l(p)},In.serializeRes=J,In.serializeHeaders=Y,In.clearCache=function(){Et.refs.clearCache()},In.makeApisTagOperation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Yt.makeExecute(e);return{apis:Yt.mapTagOperations({v2OperationIdCompatibilityMode:e.v2OperationIdCompatibilityMode,spec:e.spec,cb:t})}},In.buildRequest=Tn,In.helpers={opId:Tt},In.prototype={http:V,execute:function(e){return this.applyDefaults(),In.execute(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pn(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):Pn(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:"string"==typeof this.url?this.url:void 0},e))},resolve:function(){var e=this;return In.resolve({spec:this.spec,url:this.url,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null}).then(function(t){return e.originalSpec=e.spec,e.spec=t.spec,e.errors=t.errors,e})}},In.prototype.applyDefaults=function(){var e=this.spec,t=this.url;if(t&&w()(t,"http")){var n=E.a.parse(t);e.host||(e.host=n.host),e.schemes||(e.schemes=[n.protocol.replace(":","")]),e.basePath||(e.basePath="/")}};t.default=In}]).default},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(419),a=n(88),s=n(420),u=n(112),c=n(182),l=n(15),p=[],f=0,h=i.getPooled(),d=!1,m=null;function v(){x.ReactReconcileTransaction&&m||r("123")}var g=[{initialize:function(){this.dirtyComponentsLength=p.length},close:function(){this.dirtyComponentsLength!==p.length?(p.splice(0,this.dirtyComponentsLength),w()):p.length=0}},{initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}}];function y(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=i.getPooled(),this.reconcileTransaction=x.ReactReconcileTransaction.getPooled(!0)}function b(e,t){return e._mountOrder-t._mountOrder}function _(e){var t=e.dirtyComponentsLength;t!==p.length&&r("124",t,p.length),p.sort(b),f++;for(var n=0;n<t;n++){var o,i=p[n],a=i._pendingCallbacks;if(i._pendingCallbacks=null,s.logTopLevelRenders){var c=i;i._currentElement.type.isReactTopLevelWrapper&&(c=i._renderedComponent),o="React update: "+c.getName(),console.time(o)}if(u.performUpdateIfNecessary(i,e.reconcileTransaction,f),o&&console.timeEnd(o),a)for(var l=0;l<a.length;l++)e.callbackQueue.enqueue(a[l],i.getPublicInstance())}}o(y.prototype,c,{getTransactionWrappers:function(){return g},destructor:function(){this.dirtyComponentsLength=null,i.release(this.callbackQueue),this.callbackQueue=null,x.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return c.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),a.addPoolingTo(y);var w=function(){for(;p.length||d;){if(p.length){var e=y.getPooled();e.perform(_,null,e),y.release(e)}if(d){d=!1;var t=h;h=i.getPooled(),t.notifyAll(),i.release(t)}}};var x={ReactReconcileTransaction:null,batchedUpdates:function(e,t,n,r,o,i){return v(),m.batchedUpdates(e,t,n,r,o,i)},enqueueUpdate:function e(t){v(),m.isBatchingUpdates?(p.push(t),null==t._updateBatchNumber&&(t._updateBatchNumber=f+1)):m.batchedUpdates(e,t)},flushBatchedUpdates:w,injection:{injectReconcileTransaction:function(e){e||r("126"),x.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e||r("127"),"function"!=typeof e.batchedUpdates&&r("128"),"boolean"!=typeof e.isBatchingUpdates&&r("129"),m=e}},asap:function(e,t){l(m.isBatchingUpdates,"ReactUpdates.asap: Can't enqueue an asap callback in a context whereupdates are not being batched."),h.enqueue(e,t),d=!0}};e.exports=x},function(e,t,n){var r;
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){e.exports=n(750)},function(e,t,n){e.exports=n(753)},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_SELECTED_SERVER",function(){return r}),n.d(t,"UPDATE_REQUEST_BODY_VALUE",function(){return o}),n.d(t,"UPDATE_ACTIVE_EXAMPLES_MEMBER",function(){return i}),n.d(t,"UPDATE_REQUEST_CONTENT_TYPE",function(){return a}),n.d(t,"UPDATE_RESPONSE_CONTENT_TYPE",function(){return s}),n.d(t,"UPDATE_SERVER_VARIABLE_VALUE",function(){return u}),n.d(t,"setSelectedServer",function(){return c}),n.d(t,"setRequestBodyValue",function(){return l}),n.d(t,"setActiveExamplesMember",function(){return p}),n.d(t,"setRequestContentType",function(){return f}),n.d(t,"setResponseContentType",function(){return h}),n.d(t,"setServerVariableValue",function(){return d});var r="oas3_set_servers",o="oas3_set_request_body_value",i="oas3_set_active_examples_member",a="oas3_set_request_content_type",s="oas3_set_response_content_type",u="oas3_set_server_variable_value";function c(e,t){return{type:r,payload:{selectedServerUrl:e,namespace:t}}}function l(e){var t=e.value,n=e.pathMethod;return{type:o,payload:{value:t,pathMethod:n}}}function p(e){var t=e.name,n=e.pathMethod,r=e.contextType,o=e.contextName;return{type:i,payload:{name:t,pathMethod:n,contextType:r,contextName:o}}}function f(e){var t=e.value,n=e.pathMethod;return{type:a,payload:{value:t,pathMethod:n}}}function h(e){var t=e.value,n=e.path,r=e.method;return{type:s,payload:{value:t,path:n,method:r}}}function d(e){var t=e.server,n=e.namespace,r=e.key,o=e.val;return{type:u,payload:{server:t,namespace:n,key:r,val:o}}}},function(e,t,n){var r=n(129);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";(function(e){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <[email protected]> <http://feross.org>
* @license MIT
*/
var r=n(558),o=n(559),i=n(350);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(t,n),o=(e=s(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):f(e,t);if("Buffer"===t.type&&i(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t){if(l(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(e).length;default:if(r)return z(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(n+u>s&&(n=s-u),i=n;i>=0;i--){for(var p=!0,f=0;f<u;f++)if(c(e,i+f)!==c(t,f)){p=!1;break}if(p)return i}return-1}function b(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function _(e,t,n,r){return V(z(t,e.length-n),e,n,r)}function w(e,t,n,r){return V(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return w(e,t,n,r)}function E(e,t,n,r){return V(B(t),e,n,r)}function S(e,t,n,r){return V(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,u,c=e[o],l=null,p=c>239?4:c>223?3:c>191?2:1;if(o+p<=n)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,p=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=p}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=O));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return p(null,e)},u.allocUnsafeSlow=function(e){return p(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):m.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n),p=0;p<s;++p)if(c[p]!==l[p]){i=c[p],a=l[p];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function A(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function T(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function j(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=F(e[i]);return o}function P(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function I(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function N(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function D(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,i){return i||D(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,i){return i||D(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;n=new u(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);M(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);M(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=u.isBuffer(e)?e:z(new u(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var q=/[^+\/0-9A-Za-z-_]/g;function F(e){return e<16?"0"+e.toString(16):e.toString(16)}function z(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function B(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(42))},function(e,t,n){"use strict";e.exports={current:null}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";var r=n(25),o=n(88),i=n(54),a=(n(23),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),s={type:null,target:null,currentTarget:i.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};function u(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var o=this.constructor.Interface;for(var a in o)if(o.hasOwnProperty(a)){0;var s=o[a];s?this[a]=s(n):"target"===a?this.target=r:this[a]=n[a]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?i.thatReturnsTrue:i.thatReturnsFalse,this.isPropagationStopped=i.thatReturnsFalse,this}r(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=i.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=i.thatReturnsTrue)},persist:function(){this.isPersistent=i.thatReturnsTrue},isPersistent:i.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n<a.length;n++)this[a[n]]=null}}),u.Interface=s,u.augmentClass=function(e,t){var n=function(){};n.prototype=this.prototype;var i=new n;r(i,e.prototype),e.prototype=i,e.prototype.constructor=e,e.Interface=r({},this.Interface,t),e.augmentClass=this.augmentClass,o.addPoolingTo(e,o.fourArgumentPooler)},o.addPoolingTo(u,o.fourArgumentPooler),e.exports=u},function(e,t,n){var r=n(360);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"lastError",function(){return d}),n.d(t,"url",function(){return m}),n.d(t,"specStr",function(){return v}),n.d(t,"specSource",function(){return g}),n.d(t,"specJson",function(){return y}),n.d(t,"specResolved",function(){return b}),n.d(t,"specResolvedSubtree",function(){return _}),n.d(t,"specJsonWithResolvedSubtrees",function(){return x}),n.d(t,"spec",function(){return E}),n.d(t,"isOAS3",function(){return S}),n.d(t,"info",function(){return C}),n.d(t,"externalDocs",function(){return k}),n.d(t,"version",function(){return O}),n.d(t,"semver",function(){return A}),n.d(t,"paths",function(){return T}),n.d(t,"operations",function(){return j}),n.d(t,"consumes",function(){return P}),n.d(t,"produces",function(){return I}),n.d(t,"security",function(){return M}),n.d(t,"securityDefinitions",function(){return N}),n.d(t,"findDefinition",function(){return R}),n.d(t,"definitions",function(){return D}),n.d(t,"basePath",function(){return L}),n.d(t,"host",function(){return U}),n.d(t,"schemes",function(){return q}),n.d(t,"operationsWithRootInherited",function(){return F}),n.d(t,"tags",function(){return z}),n.d(t,"tagDetails",function(){return B}),n.d(t,"operationsWithTags",function(){return V}),n.d(t,"taggedOperations",function(){return H}),n.d(t,"responses",function(){return W}),n.d(t,"requests",function(){return J}),n.d(t,"mutatedRequests",function(){return Y}),n.d(t,"responseFor",function(){return K}),n.d(t,"requestFor",function(){return G}),n.d(t,"mutatedRequestFor",function(){return $}),n.d(t,"allowTryItOutFor",function(){return Z}),n.d(t,"parameterWithMetaByIdentity",function(){return X}),n.d(t,"parameterInclusionSettingFor",function(){return Q}),n.d(t,"parameterWithMeta",function(){return ee}),n.d(t,"operationWithMeta",function(){return te}),n.d(t,"getParameter",function(){return ne}),n.d(t,"hasHost",function(){return re}),n.d(t,"parameterValues",function(){return oe}),n.d(t,"parametersIncludeIn",function(){return ie}),n.d(t,"parametersIncludeType",function(){return ae}),n.d(t,"contentTypeValues",function(){return se}),n.d(t,"currentProducesFor",function(){return ue}),n.d(t,"producesOptionsFor",function(){return ce}),n.d(t,"consumesOptionsFor",function(){return le}),n.d(t,"operationScheme",function(){return pe}),n.d(t,"canExecuteScheme",function(){return fe}),n.d(t,"validateBeforeExecute",function(){return he});var r=n(14),o=n.n(r),i=n(13),a=n.n(i),s=n(12),u=n.n(s),c=n(11),l=n(3),p=n(1),f=["get","put","post","delete","options","head","patch","trace"],h=function(e){return e||Object(p.Map)()},d=Object(c.createSelector)(h,function(e){return e.get("lastError")}),m=Object(c.createSelector)(h,function(e){return e.get("url")}),v=Object(c.createSelector)(h,function(e){return e.get("spec")||""}),g=Object(c.createSelector)(h,function(e){return e.get("specSource")||"not-editor"}),y=Object(c.createSelector)(h,function(e){return e.get("json",Object(p.Map)())}),b=Object(c.createSelector)(h,function(e){return e.get("resolved",Object(p.Map)())}),_=function(e,t){return e.getIn(["resolvedSubtrees"].concat(u()(t)),void 0)},w=function e(t,n){return p.Map.isMap(t)&&p.Map.isMap(n)?n.get("$$ref")?n:Object(p.OrderedMap)().mergeWith(e,t,n):n},x=Object(c.createSelector)(h,function(e){return Object(p.OrderedMap)().mergeWith(w,e.get("json"),e.get("resolvedSubtrees"))}),E=function(e){return y(e)},S=Object(c.createSelector)(E,function(){return!1}),C=Object(c.createSelector)(E,function(e){return de(e&&e.get("info"))}),k=Object(c.createSelector)(E,function(e){return de(e&&e.get("externalDocs"))}),O=Object(c.createSelector)(C,function(e){return e&&e.get("version")}),A=Object(c.createSelector)(O,function(e){return/v?([0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(e).slice(1)}),T=Object(c.createSelector)(x,function(e){return e.get("paths")}),j=Object(c.createSelector)(T,function(e){if(!e||e.size<1)return Object(p.List)();var t=Object(p.List)();return e&&e.forEach?(e.forEach(function(e,n){if(!e||!e.forEach)return{};e.forEach(function(e,r){f.indexOf(r)<0||(t=t.push(Object(p.fromJS)({path:n,method:r,operation:e,id:"".concat(r,"-").concat(n)})))})}),t):Object(p.List)()}),P=Object(c.createSelector)(E,function(e){return Object(p.Set)(e.get("consumes"))}),I=Object(c.createSelector)(E,function(e){return Object(p.Set)(e.get("produces"))}),M=Object(c.createSelector)(E,function(e){return e.get("security",Object(p.List)())}),N=Object(c.createSelector)(E,function(e){return e.get("securityDefinitions")}),R=function(e,t){var n=e.getIn(["resolvedSubtrees","definitions",t],null),r=e.getIn(["json","definitions",t],null);return n||r||null},D=Object(c.createSelector)(E,function(e){var t=e.get("definitions");return p.Map.isMap(t)?t:Object(p.Map)()}),L=Object(c.createSelector)(E,function(e){return e.get("basePath")}),U=Object(c.createSelector)(E,function(e){return e.get("host")}),q=Object(c.createSelector)(E,function(e){return e.get("schemes",Object(p.Map)())}),F=Object(c.createSelector)(j,P,I,function(e,t,n){return e.map(function(e){return e.update("operation",function(e){if(e){if(!p.Map.isMap(e))return;return e.withMutations(function(e){return e.get("consumes")||e.update("consumes",function(e){return Object(p.Set)(e).merge(t)}),e.get("produces")||e.update("produces",function(e){return Object(p.Set)(e).merge(n)}),e})}return Object(p.Map)()})})}),z=Object(c.createSelector)(E,function(e){var t=e.get("tags",Object(p.List)());return p.List.isList(t)?t.filter(function(e){return p.Map.isMap(e)}):Object(p.List)()}),B=function(e,t){return(z(e)||Object(p.List)()).filter(p.Map.isMap).find(function(e){return e.get("name")===t},Object(p.Map)())},V=Object(c.createSelector)(F,z,function(e,t){return e.reduce(function(e,t){var n=Object(p.Set)(t.getIn(["operation","tags"]));return n.count()<1?e.update("default",Object(p.List)(),function(e){return e.push(t)}):n.reduce(function(e,n){return e.update(n,Object(p.List)(),function(e){return e.push(t)})},e)},t.reduce(function(e,t){return e.set(t.get("name"),Object(p.List)())},Object(p.OrderedMap)()))}),H=function(e){return function(t){var n=(0,t.getConfigs)(),r=n.tagsSorter,o=n.operationsSorter;return V(e).sortBy(function(e,t){return t},function(e,t){var n="function"==typeof r?r:l.F.tagsSorter[r];return n?n(e,t):null}).map(function(t,n){var r="function"==typeof o?o:l.F.operationsSorter[o],i=r?t.sort(r):t;return Object(p.Map)({tagDetails:B(e,n),operations:i})})}},W=Object(c.createSelector)(h,function(e){return e.get("responses",Object(p.Map)())}),J=Object(c.createSelector)(h,function(e){return e.get("requests",Object(p.Map)())}),Y=Object(c.createSelector)(h,function(e){return e.get("mutatedRequests",Object(p.Map)())}),K=function(e,t,n){return W(e).getIn([t,n],null)},G=function(e,t,n){return J(e).getIn([t,n],null)},$=function(e,t,n){return Y(e).getIn([t,n],null)},Z=function(){return!0},X=function(e,t,n){var r=x(e).getIn(["paths"].concat(u()(t),["parameters"]),Object(p.OrderedMap)()),o=e.getIn(["meta","paths"].concat(u()(t),["parameters"]),Object(p.OrderedMap)());return r.map(function(e){var t=o.get("".concat(n.get("in"),".").concat(n.get("name"))),r=o.get("".concat(n.get("in"),".").concat(n.get("name"),".hash-").concat(n.hashCode()));return Object(p.OrderedMap)().merge(e,t,r)}).find(function(e){return e.get("in")===n.get("in")&&e.get("name")===n.get("name")},Object(p.OrderedMap)())},Q=function(e,t,n,r){var o="".concat(r,".").concat(n);return e.getIn(["meta","paths"].concat(u()(t),["parameter_inclusions",o]),!1)},ee=function(e,t,n,r){var o=x(e).getIn(["paths"].concat(u()(t),["parameters"]),Object(p.OrderedMap)()).find(function(e){return e.get("in")===r&&e.get("name")===n},Object(p.OrderedMap)());return X(e,t,o)},te=function(e,t,n){var r=x(e).getIn(["paths",t,n],Object(p.OrderedMap)()),o=e.getIn(["meta","paths",t,n],Object(p.OrderedMap)()),i=r.get("parameters",Object(p.List)()).map(function(r){return X(e,[t,n],r)});return Object(p.OrderedMap)().merge(r,o).set("parameters",i)};function ne(e,t,n,r){return t=t||[],e.getIn(["meta","paths"].concat(u()(t),["parameters"]),Object(p.fromJS)([])).find(function(e){return p.Map.isMap(e)&&e.get("name")===n&&e.get("in")===r})||Object(p.Map)()}var re=Object(c.createSelector)(E,function(e){var t=e.get("host");return"string"==typeof t&&t.length>0&&"/"!==t[0]});function oe(e,t,n){return t=t||[],te.apply(void 0,[e].concat(u()(t))).get("parameters",Object(p.List)()).reduce(function(e,t){var r=n&&"body"===t.get("in")?t.get("value_xml"):t.get("value");return e.set(Object(l.z)(t,{allowHashes:!1}),r)},Object(p.fromJS)({}))}function ie(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(p.List.isList(e))return e.some(function(e){return p.Map.isMap(e)&&e.get("in")===t})}function ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(p.List.isList(e))return e.some(function(e){return p.Map.isMap(e)&&e.get("type")===t})}function se(e,t){t=t||[];var n=x(e).getIn(["paths"].concat(u()(t)),Object(p.fromJS)({})),r=e.getIn(["meta","paths"].concat(u()(t)),Object(p.fromJS)({})),o=ue(e,t),i=n.get("parameters")||new p.List,a=r.get("consumes_value")?r.get("consumes_value"):ae(i,"file")?"multipart/form-data":ae(i,"formData")?"application/x-www-form-urlencoded":void 0;return Object(p.fromJS)({requestContentType:a,responseContentType:o})}function ue(e,t){t=t||[];var n=x(e).getIn(["paths"].concat(u()(t)),null);if(null!==n){var r=e.getIn(["meta","paths"].concat(u()(t),["produces_value"]),null),o=n.getIn(["produces",0],null);return r||o||"application/json"}}function ce(e,t){t=t||[];var n=x(e),r=n.getIn(["paths"].concat(u()(t)),null);if(null!==r){var o=t,i=a()(o,1)[0],s=r.get("produces",null),c=n.getIn(["paths",i,"produces"],null),l=n.getIn(["produces"],null);return s||c||l}}function le(e,t){t=t||[];var n=x(e),r=n.getIn(["paths"].concat(u()(t)),null);if(null!==r){var o=t,i=a()(o,1)[0],s=r.get("consumes",null),c=n.getIn(["paths",i,"consumes"],null),l=n.getIn(["consumes"],null);return s||c||l}}var pe=function(e,t,n){var r=e.get("url").match(/^([a-z][a-z0-9+\-.]*):/),i=o()(r)?r[1]:null;return e.getIn(["scheme",t,n])||e.getIn(["scheme","_defaultScheme"])||i||""},fe=function(e,t,n){return["http","https"].indexOf(pe(e,t,n))>-1},he=function(e,t){t=t||[];var n=e.getIn(["meta","paths"].concat(u()(t),["parameters"]),Object(p.fromJS)([])),r=!0;return n.forEach(function(e){var t=e.get("errors");t&&t.count()&&(r=!1)}),r};function de(e){return p.Map.isMap(e)?e:new p.Map}},function(e,t,n){"use strict";n.r(t),n.d(t,"SHOW_AUTH_POPUP",function(){return d}),n.d(t,"AUTHORIZE",function(){return m}),n.d(t,"LOGOUT",function(){return v}),n.d(t,"PRE_AUTHORIZE_OAUTH2",function(){return g}),n.d(t,"AUTHORIZE_OAUTH2",function(){return y}),n.d(t,"VALIDATE",function(){return b}),n.d(t,"CONFIGURE_AUTH",function(){return _}),n.d(t,"showDefinitions",function(){return w}),n.d(t,"authorize",function(){return x}),n.d(t,"logout",function(){return E}),n.d(t,"preAuthorizeImplicit",function(){return S}),n.d(t,"authorizeOauth2",function(){return C}),n.d(t,"authorizePassword",function(){return k}),n.d(t,"authorizeApplication",function(){return O}),n.d(t,"authorizeAccessCodeWithFormParams",function(){return A}),n.d(t,"authorizeAccessCodeWithBasicAuthentication",function(){return T}),n.d(t,"authorizeRequest",function(){return j}),n.d(t,"configureAuth",function(){return P});var r=n(26),o=n.n(r),i=n(16),a=n.n(i),s=n(28),u=n.n(s),c=n(93),l=n.n(c),p=n(18),f=n.n(p),h=n(3),d="show_popup",m="authorize",v="logout",g="pre_authorize_oauth2",y="authorize_oauth2",b="validate",_="configure_auth";function w(e){return{type:d,payload:e}}function x(e){return{type:m,payload:e}}function E(e){return{type:v,payload:e}}var S=function(e){return function(t){var n=t.authActions,r=t.errActions,o=e.auth,i=e.token,a=e.isValid,s=o.schema,c=o.name,l=s.get("flow");delete f.a.swaggerUIRedirectOauth2,"accessCode"===l||a||r.newAuthErr({authId:c,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),i.error?r.newAuthErr({authId:c,source:"auth",level:"error",message:u()(i)}):n.authorizeOauth2({auth:o,token:i})}};function C(e){return{type:y,payload:e}}var k=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.name,i=e.username,s=e.password,u=e.passwordType,c=e.clientId,l=e.clientSecret,p={grant_type:"password",scope:e.scopes.join(" "),username:i,password:s},f={};switch(u){case"request-body":!function(e,t,n){t&&a()(e,{client_id:t});n&&a()(e,{client_secret:n})}(p,c,l);break;case"basic":f.Authorization="Basic "+Object(h.a)(c+":"+l);break;default:console.warn("Warning: invalid passwordType ".concat(u," was passed, not including client id and secret"))}return n.authorizeRequest({body:Object(h.b)(p),url:r.get("tokenUrl"),name:o,headers:f,query:{},auth:e})}};var O=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.scopes,i=e.name,a=e.clientId,s=e.clientSecret,u={Authorization:"Basic "+Object(h.a)(a+":"+s)},c={grant_type:"client_credentials",scope:o.join(" ")};return n.authorizeRequest({body:Object(h.b)(c),name:i,url:r.get("tokenUrl"),auth:e,headers:u})}},A=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,i=t.name,a=t.clientId,s=t.clientSecret,u={grant_type:"authorization_code",code:t.code,client_id:a,client_secret:s,redirect_uri:n};return r.authorizeRequest({body:Object(h.b)(u),name:i,url:o.get("tokenUrl"),auth:t})}},T=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,i=t.name,a=t.clientId,s=t.clientSecret,u={Authorization:"Basic "+Object(h.a)(a+":"+s)},c={grant_type:"authorization_code",code:t.code,client_id:a,redirect_uri:n};return r.authorizeRequest({body:Object(h.b)(c),name:i,url:o.get("tokenUrl"),auth:t,headers:u})}},j=function(e){return function(t){var n,r=t.fn,i=t.getConfigs,s=t.authActions,c=t.errActions,p=t.oas3Selectors,f=t.specSelectors,h=t.authSelectors,d=e.body,m=e.query,v=void 0===m?{}:m,g=e.headers,y=void 0===g?{}:g,b=e.name,_=e.url,w=e.auth,x=(h.getConfigs()||{}).additionalQueryStringParams;n=f.isOAS3()?l()(_,p.selectedServer(),!0):l()(_,f.url(),!0),"object"===o()(x)&&(n.query=a()({},n.query,x));var E=n.toString(),S=a()({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},y);r.fetch({url:E,method:"post",headers:S,query:v,body:d,requestInterceptor:i().requestInterceptor,responseInterceptor:i().responseInterceptor}).then(function(e){var t=JSON.parse(e.data),n=t&&(t.error||""),r=t&&(t.parseError||"");e.ok?n||r?c.newAuthErr({authId:b,level:"error",source:"auth",message:u()(t)}):s.authorizeOauth2({auth:w,token:t}):c.newAuthErr({authId:b,level:"error",source:"auth",message:e.statusText})}).catch(function(e){var t=new Error(e).message;if(e.response&&e.response.data){var n=e.response.data;try{var r="string"==typeof n?JSON.parse(n):n;r.error&&(t+=", error: ".concat(r.error)),r.error_description&&(t+=", description: ".concat(r.error_description))}catch(e){}}c.newAuthErr({authId:b,level:"error",source:"auth",message:t})})}};function P(e){return{type:_,payload:e}}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(203),o=n(202);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(47),o=n(130);e.exports=n(46)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,p=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):p=-1,c.length&&h())}function h(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++p<t;)u&&u[p].run();p=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new d(e,t)),1!==c.length||l||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_LAYOUT",function(){return o}),n.d(t,"UPDATE_FILTER",function(){return i}),n.d(t,"UPDATE_MODE",function(){return a}),n.d(t,"SHOW",function(){return s}),n.d(t,"updateLayout",function(){return u}),n.d(t,"updateFilter",function(){return c}),n.d(t,"show",function(){return l}),n.d(t,"changeMode",function(){return p});var r=n(3),o="layout_update_layout",i="layout_update_filter",a="layout_update_mode",s="layout_show";function u(e){return{type:o,payload:e}}function c(e){return{type:i,payload:e}}function l(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=Object(r.u)(e),{type:s,payload:{thing:e,shown:t}}}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=Object(r.u)(e),{type:a,payload:{thing:e,mode:t}}}},function(e,t,n){"use strict";(function(t){
/*!
* @description Recursive object extending
* @author Viacheslav Lotsmanov <[email protected]>
* @license MIT
*
* The MIT License (MIT)
*
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(e){var t=[];return e.forEach(function(e,i){"object"==typeof e&&null!==e?Array.isArray(e)?t[i]=o(e):n(e)?t[i]=r(e):t[i]=a({},e):t[i]=e}),t}function i(e,t){return"__proto__"===t?void 0:e[t]}var a=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,s=arguments[0],u=Array.prototype.slice.call(arguments,1);return u.forEach(function(u){"object"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach(function(c){return t=i(s,c),(e=i(u,c))===s?void 0:"object"!=typeof e||null===e?void(s[c]=e):Array.isArray(e)?void(s[c]=o(e)):n(e)?void(s[c]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(s[c]=a({},e)):void(s[c]=a(t,e))})}),s}}).call(this,n(61).Buffer)},function(e,t,n){var r=n(147),o=n(329);e.exports=n(122)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(96);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports={version:"2.5.5"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(202);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(102),o=n(592),i=n(593),a="[object Null]",s="[object Undefined]",u=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?s:a:u&&u in Object(e)?o(e):i(e)}},function(e,t,n){var r=n(610),o=n(613);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(375),o=n(650),i=n(103);e.exports=function(e){return i(e)?r(e):o(e)}},function(e,t,n){"use strict";var r=n(174),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=p;var i=n(134);i.inherits=n(106);var a=n(385),s=n(232);i.inherits(p,a);for(var u=o(s.prototype),c=0;c<u.length;c++){var l=u[c];p.prototype[l]||(p.prototype[l]=s.prototype[l])}function p(e){if(!(this instanceof p))return new p(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(p.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),p.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){"use strict";var r=n(392)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";var r=n(685),o=Math.max;e.exports=function(e){return o(0,r(e))}},function(e,t,n){},function(e,t,n){"use strict";var r=n(21),o=(n(15),function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)}),i=function(e){e instanceof this||r("25"),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)},a=o,s={addPoolingTo:function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||a,n.poolSize||(n.poolSize=10),n.release=i,n},oneArgumentPooler:o,twoArgumentPooler:function(e,t){if(this.instancePool.length){var n=this.instancePool.pop();return this.call(n,e,t),n}return new this(e,t)},threeArgumentPooler:function(e,t,n){if(this.instancePool.length){var r=this.instancePool.pop();return this.call(r,e,t,n),r}return new this(e,t,n)},fourArgumentPooler:function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}};e.exports=s},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){e.exports=n(588)},function(e,t,n){var r=n(173);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},function(e,t,n){e.exports=n(748)},function(e,t,n){"use strict";(function(t){var r=n(788),o=n(789),i=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,a=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,s=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function u(e){return(e||"").toString().replace(s,"")}var c=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function p(e){var n,r=("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{}).location||{},o={},a=typeof(e=e||r);if("blob:"===e.protocol)o=new h(unescape(e.pathname),{});else if("string"===a)for(n in o=new h(e,{}),l)delete o[n];else if("object"===a){for(n in e)n in l||(o[n]=e[n]);void 0===o.slashes&&(o.slashes=i.test(e.href))}return o}function f(e){e=u(e);var t=a.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function h(e,t,n){if(e=u(e),!(this instanceof h))return new h(e,t,n);var i,a,s,l,d,m,v=c.slice(),g=typeof t,y=this,b=0;for("object"!==g&&"string"!==g&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),t=p(t),i=!(a=f(e||"")).protocol&&!a.slashes,y.slashes=a.slashes||i&&t.slashes,y.protocol=a.protocol||t.protocol||"",e=a.rest,a.slashes||(v[3]=[/(.*)/,"pathname"]);b<v.length;b++)"function"!=typeof(l=v[b])?(s=l[0],m=l[1],s!=s?y[m]=e:"string"==typeof s?~(d=e.indexOf(s))&&("number"==typeof l[2]?(y[m]=e.slice(0,d),e=e.slice(d+l[2])):(y[m]=e.slice(d),e=e.slice(0,d))):(d=s.exec(e))&&(y[m]=d[1],e=e.slice(0,d.index)),y[m]=y[m]||i&&l[3]&&t[m]||"",l[4]&&(y[m]=y[m].toLowerCase())):e=l(e);n&&(y.query=n(y.query)),i&&t.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==t.pathname)&&(y.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],i=!1,a=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),a++):a&&(0===r&&(i=!0),n.splice(r,1),a--);return i&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(y.pathname,t.pathname)),r(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(l=y.auth.split(":"),y.username=l[0]||"",y.password=l[1]||""),y.origin=y.protocol&&y.host&&"file:"!==y.protocol?y.protocol+"//"+y.host:"null",y.href=y.toString()}h.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),i[e]=t;break;case"port":i[e]=t,r(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,/:\d+$/.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var a="pathname"===e?"/":"#";i[e]=t.charAt(0)!==a?a+t:t}else i[e]=t;break;default:i[e]=t}for(var s=0;s<c.length;s++){var u=c[s];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.origin=i.protocol&&i.host&&"file:"!==i.protocol?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var i=r+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},h.extractProtocol=f,h.location=p,h.trimLeft=u,h.qs=o,e.exports=h}).call(this,n(42))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return a});var r=n(470),o=n.n(r),i=[n(267),n(268)];function a(e,t){var n={jsSpec:t.specSelectors.specJson().toJS()};return o()(i,function(e,t){try{return t.transform(e,n).filter(function(e){return!!e})}catch(t){return console.error("Transformer error:",t),e}},e).filter(function(e){return!!e}).map(function(e){return!e.get("line")&&e.get("path"),e})}},function(e,t,n){var r=n(44),o=n(76),i=n(148),a=n(195)("src"),s=Function.toString,u=(""+s).split("toString");n(78).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(c&&(i(n,a)||o(n,a,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){"use strict";var r=n(548)(!0);n(211)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t){e.exports={}},function(e,t,n){n(550);for(var r=n(32),o=n(71),i=n(98),a=n(34)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<s.length;u++){var c=s[u],l=r[c],p=l&&l.prototype;p&&!p[a]&&o(p,a,c),i[c]=i.Array}},function(e,t,n){"use strict";var r=n(25),o=n(352),i=n(567),a=n(572),s=n(101),u=n(573),c=n(577),l=n(578),p=n(580),f=s.createElement,h=s.createFactory,d=s.cloneElement,m=r,v={Children:{map:i.map,forEach:i.forEach,count:i.count,toArray:i.toArray,only:p},Component:o.Component,PureComponent:o.PureComponent,createElement:f,cloneElement:d,isValidElement:s.isValidElement,PropTypes:u,createClass:l,createFactory:h,createMixin:function(e){return e},DOM:a,version:c,__spread:m};e.exports=v},function(e,t,n){"use strict";var r=n(25),o=n(62),i=(n(23),n(354),Object.prototype.hasOwnProperty),a=n(355),s={key:!0,ref:!0,__self:!0,__source:!0};function u(e){return void 0!==e.ref}function c(e){return void 0!==e.key}var l=function(e,t,n,r,o,i,s){return{$$typeof:a,type:e,key:t,ref:n,props:s,_owner:i}};l.createElement=function(e,t,n){var r,a={},p=null,f=null;if(null!=t)for(r in u(t)&&(f=t.ref),c(t)&&(p=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source,t)i.call(t,r)&&!s.hasOwnProperty(r)&&(a[r]=t[r]);var h=arguments.length-2;if(1===h)a.children=n;else if(h>1){for(var d=Array(h),m=0;m<h;m++)d[m]=arguments[m+2];0,a.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(r in v)void 0===a[r]&&(a[r]=v[r])}return l(e,p,f,0,0,o.current,a)},l.createFactory=function(e){var t=l.createElement.bind(null,e);return t.type=e,t},l.cloneAndReplaceKey=function(e,t){return l(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},l.cloneElement=function(e,t,n){var a,p,f=r({},e.props),h=e.key,d=e.ref,m=(e._self,e._source,e._owner);if(null!=t)for(a in u(t)&&(d=t.ref,m=o.current),c(t)&&(h=""+t.key),e.type&&e.type.defaultProps&&(p=e.type.defaultProps),t)i.call(t,a)&&!s.hasOwnProperty(a)&&(void 0===t[a]&&void 0!==p?f[a]=p[a]:f[a]=t[a]);var v=arguments.length-2;if(1===v)f.children=n;else if(v>1){for(var g=Array(v),y=0;y<v;y++)g[y]=arguments[y+2];f.children=g}return l(e.type,h,d,0,0,m,f)},l.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},e.exports=l},function(e,t,n){var r=n(48).Symbol;e.exports=r},function(e,t,n){var r=n(366),o=n(225);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(35),o=n(228),i=n(658),a=n(65);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},function(e,t,n){var r=n(163),o=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";var r=n(85);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){var r=n(60),o=n(399),i=n(400),a=n(45),s=n(154),u=n(217),c={},l={};(t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(i(g)){for(h=s(e.length);h>b;b++)if((v=t?y(a(d=e[b])[0],d[1]):y(e[b]))===c||v===l)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=o(m,y,d.value,t))===c||v===l)return v}).BREAK=c,t.RETURN=l},function(e,t,n){"use strict";function r(e){return null==e}e.exports.isNothing=r,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:r(e)?[]:[e]},e.exports.repeat=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},e.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},e.exports.extend=function(e,t){var n,r,o,i;if(t)for(n=0,r=(i=Object.keys(t)).length;n<r;n+=1)e[o=i[n]]=t[o];return e}},function(e,t,n){"use strict";var r=n(109),o=n(135),i=n(31);function a(e,t,n){var r=[];return e.include.forEach(function(e){n=a(e,t,n)}),e[t].forEach(function(e){n.forEach(function(t,n){t.tag===e.tag&&t.kind===e.kind&&r.push(n)}),n.push(e)}),n.filter(function(e,t){return-1===r.indexOf(t)})}function s(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=a(this,"implicit",[]),this.compiledExplicit=a(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(this.compiledImplicit,this.compiledExplicit)}s.DEFAULT=null,s.create=function(){var e,t;switch(arguments.length){case 1:e=s.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new o("Wrong number of arguments for Schema.create function")}if(e=r.toArray(e),t=r.toArray(t),!e.every(function(e){return e instanceof s}))throw new o("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof i}))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new s({include:e,explicit:t})},e.exports=s},function(e,t,n){"use strict";var r=n(21);n(15);function o(e,t){return(e&t)===t}var i={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,injectDOMPropertyConfig:function(e){var t=i,n=e.Properties||{},a=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},c=e.DOMPropertyNames||{},l=e.DOMMutationMethods||{};for(var p in e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute),n){s.properties.hasOwnProperty(p)&&r("48",p);var f=p.toLowerCase(),h=n[p],d={attributeName:f,attributeNamespace:null,propertyName:p,mutationMethod:null,mustUseProperty:o(h,t.MUST_USE_PROPERTY),hasBooleanValue:o(h,t.HAS_BOOLEAN_VALUE),hasNumericValue:o(h,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:o(h,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:o(h,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(d.hasBooleanValue+d.hasNumericValue+d.hasOverloadedBooleanValue<=1||r("50",p),u.hasOwnProperty(p)){var m=u[p];d.attributeName=m}a.hasOwnProperty(p)&&(d.attributeNamespace=a[p]),c.hasOwnProperty(p)&&(d.propertyName=c[p]),l.hasOwnProperty(p)&&(d.mutationMethod=l[p]),s.properties[p]=d}}},a=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",s={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:a,ATTRIBUTE_NAME_CHAR:a+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<s._isCustomAttributeFunctions.length;t++){if((0,s._isCustomAttributeFunctions[t])(e))return!0}return!1},injection:i};e.exports=s},function(e,t,n){"use strict";var r=n(808);n(50),n(23);function o(){r.attachRefs(this,this._currentElement)}var i={mountComponent:function(e,t,n,r,i,a){var s=e.mountComponent(t,n,r,i,a);return e._currentElement&&null!=e._currentElement.ref&&t.getReactMountReady().enqueue(o,e),s},getHostNode:function(e){return e.getHostNode()},unmountComponent:function(e,t){r.detachRefs(e,e._currentElement),e.unmountComponent(t)},receiveComponent:function(e,t,n,i){var a=e._currentElement;if(t!==a||i!==e._context){0;var s=r.shouldUpdateRefs(a,t);s&&r.detachRefs(e,a),e.receiveComponent(t,n,i),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(o,e)}},performUpdateIfNecessary:function(e,t,n){e._updateBatchNumber===n&&e.performUpdateIfNecessary(t)}};e.exports=i},function(e,t,n){"use strict";var r=n(246),o=n(184),i=n(247),a=n(424),s="undefined"!=typeof document&&"number"==typeof document.documentMode||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&/\bEdge\/\d/.test(navigator.userAgent);function u(e){if(s){var t=e.node,n=e.children;if(n.length)for(var r=0;r<n.length;r++)c(t,n[r],null);else null!=e.html?o(t,e.html):null!=e.text&&a(t,e.text)}}var c=i(function(e,t,n){11===t.node.nodeType||1===t.node.nodeType&&"object"===t.node.nodeName.toLowerCase()&&(null==t.node.namespaceURI||t.node.namespaceURI===r.html)?(u(t),e.insertBefore(t.node,n)):(e.insertBefore(t.node,n),u(t))});function l(){return this.node.nodeName}function p(e){return{node:e,children:[],html:null,text:null,toString:l}}p.insertTreeBefore=c,p.replaceChildWithTree=function(e,t){e.parentNode.replaceChild(t.node,e),u(t)},p.queueChild=function(e,t){s?e.children.push(t):e.node.appendChild(t.node)},p.queueHTML=function(e,t){s?e.html=t:o(e.node,t)},p.queueText=function(e,t){s?e.text=t:a(e.node,t)},e.exports=p},function(e,t,n){var r=n(181),o=n(411);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=i?i(n[c],e[c],c,n,e):void 0;void 0===l&&(l=e[c]),a?o(n,c,l):r(n,c,l)}return n}},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e?function e(t,n){var r;r=Array.isArray(t)?[]:{};n.push(t);Object.keys(t).forEach(function(o){var i=t[o];"function"!=typeof i&&(i&&"object"==typeof i?-1!==n.indexOf(t[o])?r[o]="[Circular]":r[o]=e(t[o],n.slice(0)):r[o]=i)});"string"==typeof t.name&&(r.name=t.name);"string"==typeof t.message&&(r.message=t.message);"string"==typeof t.stack&&(r.stack=t.stack);return r}(e,[]):"function"==typeof e?"[Function: "+(e.name||"anonymous")+"]":e}},function(e,t,n){"use strict";n.r(t),n.d(t,"sampleFromSchema",function(){return d}),n.d(t,"inferSchema",function(){return m}),n.d(t,"sampleXmlFromSchema",function(){return v}),n.d(t,"createXMLExample",function(){return g}),n.d(t,"memoizedCreateXMLExample",function(){return y}),n.d(t,"memoizedSampleFromSchema",function(){return b});var r=n(14),o=n.n(r),i=n(3),a=n(468),s=n.n(a),u=n(323),c=n.n(u),l=n(142),p=n.n(l),f={string:function(){return"string"},string_email:function(){return"[email protected]"},"string_date-time":function(){return(new Date).toISOString()},string_date:function(){return(new Date).toISOString().substring(0,10)},string_uuid:function(){return"3fa85f64-5717-4562-b3fc-2c963f66afa6"},string_hostname:function(){return"example.com"},string_ipv4:function(){return"198.51.100.42"},string_ipv6:function(){return"2001:0db8:5b96:0000:0000:426f:8e17:642a"},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(e){return"boolean"!=typeof e.default||e.default}},h=function(e){var t=e=Object(i.y)(e),n=t.type,r=t.format,o=f["".concat(n,"_").concat(r)]||f[n];return Object(i.q)(o)?o(e):"Unknown Type: "+e.type},d=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(i.y)(t),a=r.type,s=r.example,u=r.properties,c=r.additionalProperties,l=r.items,p=n.includeReadOnly,f=n.includeWriteOnly;if(void 0!==s)return Object(i.d)(s,"$$ref",function(e){return"string"==typeof e&&e.indexOf("#")>-1});if(!a)if(u)a="object";else{if(!l)return;a="array"}if("object"===a){var d=Object(i.y)(u),m={};for(var v in d)d[v]&&d[v].deprecated||d[v]&&d[v].readOnly&&!p||d[v]&&d[v].writeOnly&&!f||(m[v]=e(d[v],n));if(!0===c)m.additionalProp1={};else if(c)for(var g=Object(i.y)(c),y=e(g,n),b=1;b<4;b++)m["additionalProp"+b]=y;return m}return"array"===a?o()(l.anyOf)?l.anyOf.map(function(t){return e(t,n)}):o()(l.oneOf)?l.oneOf.map(function(t){return e(t,n)}):[e(l,n)]:t.enum?t.default?t.default:Object(i.u)(t.enum)[0]:"file"!==a?h(t):void 0},m=function(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},v=function e(t){var n,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=p()({},Object(i.y)(t)),u=s.type,c=s.properties,l=s.additionalProperties,f=s.items,d=s.example,m=a.includeReadOnly,v=a.includeWriteOnly,g=s.default,y={},b={},_=t.xml,w=_.name,x=_.prefix,E=_.namespace,S=s.enum;if(!u)if(c||l)u="object";else{if(!f)return;u="array"}if(n=(x?x+":":"")+(w=w||"notagname"),E){var C=x?"xmlns:"+x:"xmlns";b[C]=E}if("array"===u&&f){if(f.xml=f.xml||_||{},f.xml.name=f.xml.name||_.name,_.wrapped)return y[n]=[],o()(d)?d.forEach(function(t){f.example=t,y[n].push(e(f,a))}):o()(g)?g.forEach(function(t){f.default=t,y[n].push(e(f,a))}):y[n]=[e(f,a)],b&&y[n].push({_attr:b}),y;var k=[];return o()(d)?(d.forEach(function(t){f.example=t,k.push(e(f,a))}),k):o()(g)?(g.forEach(function(t){f.default=t,k.push(e(f,a))}),k):e(f,a)}if("object"===u){var O=Object(i.y)(c);for(var A in y[n]=[],d=d||{},O)if(O.hasOwnProperty(A)&&(!O[A].readOnly||m)&&(!O[A].writeOnly||v))if(O[A].xml=O[A].xml||{},O[A].xml.attribute){var T=o()(O[A].enum)&&O[A].enum[0],j=O[A].example,P=O[A].default;b[O[A].xml.name||A]=void 0!==j&&j||void 0!==d[A]&&d[A]||void 0!==P&&P||T||h(O[A])}else{O[A].xml.name=O[A].xml.name||A,void 0===O[A].example&&void 0!==d[A]&&(O[A].example=d[A]);var I=e(O[A]);o()(I)?y[n]=y[n].concat(I):y[n].push(I)}return!0===l?y[n].push({additionalProp:"Anything can be here"}):l&&y[n].push({additionalProp:h(l)}),b&&y[n].push({_attr:b}),y}return r=void 0!==d?d:void 0!==g?g:o()(S)?S[0]:h(t),y[n]=b?[{_attr:b},r]:r,y};function g(e,t){var n=v(e,t);if(n)return s()(n,{declaration:!0,indent:"\t"})}var y=c()(g),b=c()(d)},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_CONFIGS",function(){return i}),n.d(t,"TOGGLE_CONFIGS",function(){return a}),n.d(t,"update",function(){return s}),n.d(t,"toggle",function(){return u}),n.d(t,"loaded",function(){return c});var r=n(2),o=n.n(r),i="configs_update",a="configs_toggle";function s(e,t){return{type:i,payload:o()({},e,t)}}function u(e){return{type:a,payload:e}}var c=function(){return function(){}}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),o=n.n(r),i=o.a.Set.of("type","format","items","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf");function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isOAS3;if(!o.a.Map.isMap(e))return o.a.Map();if(!t)return"body"===e.get("in")?e.get("schema",o.a.Map()):e.filter(function(e,t){return i.includes(t)});if(e.get("content")){var n=e.get("content",o.a.Map({})).keySeq();return e.getIn(["content",n.first(),"schema"],o.a.Map())}return e.get("schema",o.a.Map())}},function(e,t,n){e.exports=n(766)},function(e,t,n){"use strict";n.r(t);var r=n(463),o="object"==typeof self&&self&&self.Object===Object&&self,i=(r.a||o||Function("return this")()).Symbol,a=Object.prototype,s=a.hasOwnProperty,u=a.toString,c=i?i.toStringTag:void 0;var l=function(e){var t=s.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=u.call(e);return r&&(t?e[c]=n:delete e[c]),o},p=Object.prototype.toString;var f=function(e){return p.call(e)},h="[object Null]",d="[object Undefined]",m=i?i.toStringTag:void 0;var v=function(e){return null==e?void 0===e?d:h:m&&m in Object(e)?l(e):f(e)};var g=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object);var y=function(e){return null!=e&&"object"==typeof e},b="[object Object]",_=Function.prototype,w=Object.prototype,x=_.toString,E=w.hasOwnProperty,S=x.call(Object);var C=function(e){if(!y(e)||v(e)!=b)return!1;var t=g(e);if(null===t)return!0;var n=E.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==S},k=n(322),O={INIT:"@@redux/INIT"};function A(e,t,n){var r;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(A)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var o=e,i=t,a=[],s=a,u=!1;function c(){s===a&&(s=a.slice())}function l(){return i}function p(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return c(),s.push(e),function(){if(t){t=!1,c();var n=s.indexOf(e);s.splice(n,1)}}}function f(e){if(!C(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(u)throw new Error("Reducers may not dispatch actions.");try{u=!0,i=o(i,e)}finally{u=!1}for(var t=a=s,n=0;n<t.length;n++){(0,t[n])()}return e}return f({type:O.INIT}),(r={dispatch:f,subscribe:p,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");o=e,f({type:O.INIT})}})[k.a]=function(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(l())}return n(),{unsubscribe:t(n)}}})[k.a]=function(){return this},e},r}function T(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function j(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];0,"function"==typeof e[o]&&(n[o]=e[o])}var i=Object.keys(n);var a=void 0;try{!function(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:O.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+O.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(n)}catch(e){a=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(a)throw a;for(var r=!1,o={},s=0;s<i.length;s++){var u=i[s],c=n[u],l=e[u],p=c(l,t);if(void 0===p){var f=T(u,t);throw new Error(f)}o[u]=p,r=r||p!==l}return r?o:e}}function P(e,t){return function(){return t(e.apply(void 0,arguments))}}function I(e,t){if("function"==typeof e)return P(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),r={},o=0;o<n.length;o++){var i=n[o],a=e[i];"function"==typeof a&&(r[i]=P(a,t))}return r}function M(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}var N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function R(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,o){var i,a=e(n,r,o),s=a.dispatch,u={getState:a.getState,dispatch:function(e){return s(e)}};return i=t.map(function(e){return e(u)}),s=M.apply(void 0,i)(a.dispatch),N({},a,{dispatch:s})}}}n.d(t,"createStore",function(){return A}),n.d(t,"combineReducers",function(){return j}),n.d(t,"bindActionCreators",function(){return I}),n.d(t,"applyMiddleware",function(){return R}),n.d(t,"compose",function(){return M})},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){e.exports=!n(123)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports={}},function(e,t,n){var r=n(149),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(343),o=n(207);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=!0},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(47).f,o=n(69),i=n(34)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){var r=n(155)("meta"),o=n(41),i=n(69),a=n(47).f,s=0,u=Object.isExtensible||function(){return!0},c=!n(80)(function(){return u(Object.preventExtensions({}))}),l=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},p=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!u(e))return"F";if(!t)return"E";l(e)}return e[r].i},getWeak:function(e,t){if(!i(e,r)){if(!u(e))return!0;if(!t)return!1;l(e)}return e[r].w},onFreeze:function(e){return c&&p.NEED&&u(e)&&!i(e,r)&&l(e),e}}},function(e,t,n){"use strict";e.exports=function(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(61).Buffer)},function(e,t,n){"use strict";function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=r},function(e,t,n){"use strict";var r=n(110);e.exports=new r({include:[n(408)],implicit:[n(777),n(778)],explicit:[n(779),n(780),n(781),n(782)]})},function(e,t,n){"use strict";var r=n(138),o=n(240),i=n(416),a=n(417),s=(n(23),r.getListener);function u(e,t,n){var r=function(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return s(e,r)}(e,n,t);r&&(n._dispatchListeners=i(n._dispatchListeners,r),n._dispatchInstances=i(n._dispatchInstances,e))}function c(e){e&&e.dispatchConfig.phasedRegistrationNames&&o.traverseTwoPhase(e._targetInst,u,e)}function l(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst,n=t?o.getParentInstance(t):null;o.traverseTwoPhase(n,u,e)}}function p(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=s(e,r);o&&(n._dispatchListeners=i(n._dispatchListeners,o),n._dispatchInstances=i(n._dispatchInstances,e))}}function f(e){e&&e.dispatchConfig.registrationName&&p(e._targetInst,0,e)}var h={accumulateTwoPhaseDispatches:function(e){a(e,c)},accumulateTwoPhaseDispatchesSkipTarget:function(e){a(e,l)},accumulateDirectDispatches:function(e){a(e,f)},accumulateEnterLeaveDispatches:function(e,t,n,r){o.traverseEnterLeave(n,r,p,e,t)}};e.exports=h},function(e,t,n){"use strict";var r=n(21),o=n(239),i=n(240),a=n(241),s=n(416),u=n(417),c=(n(15),{}),l=null,p=function(e,t){e&&(i.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},f=function(e){return p(e,!0)},h=function(e){return p(e,!1)},d=function(e){return"."+e._rootNodeID};var m={injection:{injectEventPluginOrder:o.injectEventPluginOrder,injectEventPluginsByName:o.injectEventPluginsByName},putListener:function(e,t,n){"function"!=typeof n&&r("94",t,typeof n);var i=d(e);(c[t]||(c[t]={}))[i]=n;var a=o.registrationNameModules[t];a&&a.didPutListener&&a.didPutListener(e,t,n)},getListener:function(e,t){var n=c[t];if(function(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||(r=t,"button"!==r&&"input"!==r&&"select"!==r&&"textarea"!==r));default:return!1}var r}(t,e._currentElement.type,e._currentElement.props))return null;var r=d(e);return n&&n[r]},deleteListener:function(e,t){var n=o.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var r=c[t];r&&delete r[d(e)]},deleteAllListeners:function(e){var t=d(e);for(var n in c)if(c.hasOwnProperty(n)&&c[n][t]){var r=o.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(e,n),delete c[n][t]}},extractEvents:function(e,t,n,r){for(var i,a=o.plugins,u=0;u<a.length;u++){var c=a[u];if(c){var l=c.extractEvents(e,t,n,r);l&&(i=s(i,l))}}return i},enqueueEvents:function(e){e&&(l=s(l,e))},processEventQueue:function(e){var t=l;l=null,u(t,e?f:h),l&&r("95"),a.rethrowCaughtError()},__purge:function(){c={}},__getListenerBank:function(){return c}};e.exports=m},function(e,t,n){"use strict";var r=n(64),o=n(242),i={view:function(e){if(e.view)return e.view;var t=o(e);if(t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,i),e.exports=a},function(e,t,n){"use strict";var r={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};e.exports=r},function(e,t,n){var r=n(41);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(e){return null===e?"null":void 0===e?"undefined":"object"===(void 0===e?"undefined":r(e))?Array.isArray(e)?"array":"object":void 0===e?"undefined":r(e)}function i(e){return"object"===o(e)?s(e):"array"===o(e)?a(e):e}function a(e){return e.map(i)}function s(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=i(e[n]));return t}function u(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={arrayBehaviour:(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).arrayBehaviour||"replace"},r=t.map(function(e){return e||{}}),i=e||{},c=0;c<r.length;c++)for(var l=r[c],p=Object.keys(l),f=0;f<p.length;f++){var h=p[f],d=l[h],m=o(d),v=o(i[h]);if("object"===m)if("undefined"!==v){var g="object"===v?i[h]:{};i[h]=u({},[g,s(d)],n)}else i[h]=s(d);else if("array"===m)if("array"===v){var y=a(d);i[h]="merge"===n.arrayBehaviour?i[h].concat(y):y}else i[h]=a(d);else i[h]=d}return i}e.exports=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return u(e,n)},e.exports.noMutate=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u({},t)},e.exports.withOptions=function(e,t,n){return u(e,t,n)}},function(e,t,n){"use strict";var r=n(767);e.exports=r},function(e,t,n){"use strict";n.r(t),n.d(t,"parseYamlConfig",function(){return i});var r=n(143),o=n.n(r),i=function(e,t){try{return o.a.safeLoad(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"makeMappedContainer",function(){return j}),n.d(t,"render",function(){return P}),n.d(t,"getComponent",function(){return N});var r=n(26),o=n.n(r),i=n(17),a=n.n(i),s=n(16),u=n.n(s),c=n(20),l=n.n(c),p=n(4),f=n.n(p),h=n(5),d=n.n(h),m=n(6),v=n.n(m),g=n(7),y=n.n(g),b=n(8),_=n.n(b),w=n(0),x=n.n(w),E=n(472),S=n.n(E),C=n(326),k=n(473),O=n.n(k),A=function(e,t,n){var r=function(e,t){return function(n){function r(){return f()(this,r),v()(this,y()(r).apply(this,arguments))}return _()(r,n),d()(r,[{key:"render",value:function(){return x.a.createElement(t,l()({},e(),this.props,this.context))}}]),r}(w.Component)}(e,t),o=Object(C.connect)(function(n,r){var o=u()({},r,e());return(t.prototype.mapStateToProps||function(e){return{state:e}})(n,o)})(r);return n?function(e,t){return function(n){function r(){return f()(this,r),v()(this,y()(r).apply(this,arguments))}return _()(r,n),d()(r,[{key:"render",value:function(){return x.a.createElement(C.Provider,{store:e},x.a.createElement(t,l()({},this.props,this.context)))}}]),r}(w.Component)}(n,o):o},T=function(e,t,n,r){for(var o in t){var i=t[o];"function"==typeof i&&i(n[o],r[o],e())}},j=function(e,t,n,r,o,i){return function(t){function r(t,n){var o;return f()(this,r),o=v()(this,y()(r).call(this,t,n)),T(e,i,t,{}),o}return _()(r,t),d()(r,[{key:"componentWillReceiveProps",value:function(t){T(e,i,t,this.props)}},{key:"render",value:function(){var e=O()(this.props,i?a()(i):[]),t=n(o,"root");return x.a.createElement(t,e)}}]),r}(w.Component)},P=function(e,t,n,r,o){var i=n(e,t,r,"App","root");S.a.render(x.a.createElement(i,null),o)},I=function(e){var t=e.name;return x.a.createElement("div",{style:{padding:"1em",color:"#aaa"}},"😱 ",x.a.createElement("i",null,"Could not render ","t"===t?"this component":t,", see the console."))},M=function(e){var t=function(e){return!(e.prototype&&e.prototype.isReactComponent)}(e)?function(e){return function(t){function n(){return f()(this,n),v()(this,y()(n).apply(this,arguments))}return _()(n,t),d()(n,[{key:"render",value:function(){return e(this.props)}}]),n}(w.Component)}(e):e,n=t.prototype.render;return t.prototype.render=function(){try{for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return n.apply(this,r)}catch(e){return console.error(e),x.a.createElement(I,{error:e,name:t.name})}},t},N=function(e,t,n,r,i){if("string"!=typeof r)throw new TypeError("Need a string, to fetch a component. Was given a "+o()(r));var a=n(r);return a?i?"root"===i?A(e,a,t()):A(e,M(a)):M(a):(e().log.warn("Could not find component",r),null)}},function(e,t,n){"use strict";n.r(t),n.d(t,"setHash",function(){return r});var r=function(e){return e?history.pushState(null,null,"#".concat(e)):window.location.hash=""}},function(e,t,n){var r=n(77),o=n(485),i=n(486),a=Object.defineProperty;t.f=n(122)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(151);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(491),o=n(68);e.exports=function(e){return r(o(e))}},function(e,t,n){"use strict";var r=n(76),o=n(95),i=n(123),a=n(68),s=n(33);e.exports=function(e,t,n){var u=s(e),c=n(a,u,""[e]),l=c[0],p=c[1];i(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(o(String.prototype,e,l),r(RegExp.prototype,u,2==t?function(e,t){return p.call(e,this,t)}:function(e){return p.call(e,this)}))}},function(e,t,n){var r=n(204),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(45),o=n(345),i=n(207),a=n(205)("IE_PROTO"),s=function(){},u=function(){var e,t=n(209)("iframe"),r=i.length;for(t.style.display="none",n(346).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[i[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:o(n,t)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(158),o=n(130),i=n(70),a=n(210),s=n(69),u=n(344),c=Object.getOwnPropertyDescriptor;t.f=n(46)?c:function(e,t){if(e=i(e),t=a(t,!0),u)try{return c(e,t)}catch(e){}if(s(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t){},function(e,t,n){"use strict";e.exports={}},function(e,t,n){var r=n(127),o=n(34)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var r=n(81),o=n(63),i="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||o(e)&&r(e)==i}},function(e,t,n){var r=n(82)(Object,"create");e.exports=r},function(e,t,n){var r=n(618),o=n(619),i=n(620),a=n(621),s=n(622);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(89);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(624);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(629),o=n(657),i=n(229),a=n(35),s=n(662);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):r(e):s(e)}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var o=typeof e;return!!(t=null==t?n:t)&&("number"==o||"symbol"!=o&&r.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(652),o=n(219),i=n(653),a=n(654),s=n(655),u=n(81),c=n(367),l=c(r),p=c(o),f=c(i),h=c(a),d=c(s),m=u;(r&&"[object DataView]"!=m(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=m(new o)||i&&"[object Promise]"!=m(i.resolve())||a&&"[object Set]"!=m(new a)||s&&"[object WeakMap]"!=m(new s))&&(m=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case l:return"[object DataView]";case p:return"[object Map]";case f:return"[object Promise]";case h:return"[object Set]";case d:return"[object WeakMap]"}return t}),e.exports=m},function(e,t,n){var r=n(104),o=n(105);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},function(e,t,n){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,r)});case 4:return t.nextTick(function(){e.call(null,n,r,o)});default:for(i=new Array(s-1),a=0;a<i.length;)i[a++]=arguments[a];return t.nextTick(function(){e.apply(null,i)})}}}:e.exports=t}).call(this,n(72))},function(e,t,n){var r=n(61),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),i(o,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";e.exports=n(690)("forEach")},function(e,t,n){"use strict";var r=n(394),o=n(391),i=n(233),a=n(699);(e.exports=function(e,t){var n,i,s,u,c;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],null==e?(n=s=!0,i=!1):(n=a.call(e,"c"),i=a.call(e,"e"),s=a.call(e,"w")),c={value:t,configurable:n,enumerable:i,writable:s},u?r(o(u),c):c}).gs=function(e,t,n){var s,u,c,l;return"string"!=typeof e?(c=n,n=t,t=e,e=null):c=arguments[3],null==t?t=void 0:i(t)?null==n?n=void 0:i(n)||(c=n,n=void 0):(c=t,t=n=void 0),null==e?(s=!0,u=!1):(s=a.call(e,"c"),u=a.call(e,"e")),l={get:t,set:n,configurable:s,enumerable:u},c?r(o(c),l):l}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(71);e.exports=function(e,t,n){for(var o in t)n&&e[o]?e[o]=t[o]:r(e,o,t[o]);return e}},function(e,t,n){"use strict";var r=n(110);e.exports=r.DEFAULT=new r({include:[n(136)],explicit:[n(783),n(784),n(785)]})},function(e,t,n){var r=n(411),o=n(89),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){"use strict";var r=n(21),o=(n(15),{}),i={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,n,o,i,a,s,u){var c,l;this.isInTransaction()&&r("27");try{this._isInTransaction=!0,c=!0,this.initializeAll(0),l=e.call(t,n,o,i,a,s,u),c=!1}finally{try{if(c)try{this.closeAll(0)}catch(e){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return l},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var r=t[n];try{this.wrapperInitData[n]=o,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===o)try{this.initializeAll(n+1)}catch(e){}}}},closeAll:function(e){this.isInTransaction()||r("28");for(var t=this.transactionWrappers,n=e;n<t.length;n++){var i,a=t[n],s=this.wrapperInitData[n];try{i=!0,s!==o&&a.close&&a.close.call(this,s),i=!1}finally{if(i)try{this.closeAll(n+1)}catch(e){}}}this.wrapperInitData.length=0}};e.exports=i},function(e,t,n){"use strict";var r=n(139),o=n(423),i={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:n(244),button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+o.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+o.currentScrollTop}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,i),e.exports=a},function(e,t,n){"use strict";var r,o=n(36),i=n(246),a=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=n(247)(function(e,t){if(e.namespaceURI!==i.svg||"innerHTML"in e)e.innerHTML=t;else{(r=r||document.createElement("div")).innerHTML="<svg>"+t+"</svg>";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(o.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(u=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}e.exports=u},function(e,t,n){"use strict";var r=/["'&<>]/;e.exports=function(e){return"boolean"==typeof e||"number"==typeof e?""+e:function(e){var t,n=""+e,o=r.exec(n);if(!o)return n;var i="",a=0,s=0;for(a=o.index;a<n.length;a++){switch(n.charCodeAt(a)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}s!==a&&(i+=n.substring(s,a)),s=a+1,i+=t}return s!==a?i+n.substring(s,a):i}(e)}},function(e,t,n){"use strict";var r,o=n(25),i=n(239),a=n(829),s=n(423),u=n(830),c=n(243),l={},p=!1,f=0,h={topAbort:"abort",topAnimationEnd:u("animationend")||"animationend",topAnimationIteration:u("animationiteration")||"animationiteration",topAnimationStart:u("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:u("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},d="_reactListenersID"+String(Math.random()).slice(2);var m=o({},a,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(m.handleTopLevel),m.ReactEventListener=e}},setEnabled:function(e){m.ReactEventListener&&m.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!m.ReactEventListener||!m.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,r=function(e){return Object.prototype.hasOwnProperty.call(e,d)||(e[d]=f++,l[e[d]]={}),l[e[d]]}(n),o=i.registrationNameDependencies[e],a=0;a<o.length;a++){var s=o[a];r.hasOwnProperty(s)&&r[s]||("topWheel"===s?c("wheel")?m.ReactEventListener.trapBubbledEvent("topWheel","wheel",n):c("mousewheel")?m.ReactEventListener.trapBubbledEvent("topWheel","mousewheel",n):m.ReactEventListener.trapBubbledEvent("topWheel","DOMMouseScroll",n):"topScroll"===s?c("scroll",!0)?m.ReactEventListener.trapCapturedEvent("topScroll","scroll",n):m.ReactEventListener.trapBubbledEvent("topScroll","scroll",m.ReactEventListener.WINDOW_HANDLE):"topFocus"===s||"topBlur"===s?(c("focus",!0)?(m.ReactEventListener.trapCapturedEvent("topFocus","focus",n),m.ReactEventListener.trapCapturedEvent("topBlur","blur",n)):c("focusin")&&(m.ReactEventListener.trapBubbledEvent("topFocus","focusin",n),m.ReactEventListener.trapBubbledEvent("topBlur","focusout",n)),r.topBlur=!0,r.topFocus=!0):h.hasOwnProperty(s)&&m.ReactEventListener.trapBubbledEvent(s,h[s],n),r[s]=!0)}},trapBubbledEvent:function(e,t,n){return m.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return m.ReactEventListener.trapCapturedEvent(e,t,n)},supportsEventPageXY:function(){if(!document.createEvent)return!1;var e=document.createEvent("MouseEvent");return null!=e&&"pageX"in e},ensureScrollValueMonitoring:function(){if(void 0===r&&(r=m.supportsEventPageXY()),!r&&!p){var e=s.refreshScrollValues;m.ReactEventListener.monitorScrollValue(e),p=!0}}});e.exports=m},function(e,t,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(e){for(var t=this.__rules__.length,n=-1;t--;)if(this.__rules__[++n].name===e)return n;return-1},r.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},r.prototype.at=function(e,t,n){var r=this.__find__(e),o=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=o.alt||[],this.__cache__=null},r.prototype.before=function(e,t,n,r){var o=this.__find__(e),i=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},r.prototype.after=function(e,t,n,r){var o=this.__find__(e),i=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},r.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},r.prototype.enable=function(e,t){e=Array.isArray(e)?e:[e],t&&this.__rules__.forEach(function(e){e.enabled=!1}),e.forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0},this),this.__cache__=null},r.prototype.disable=function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1},this),this.__cache__=null},r.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i=-1,a=e.posMax,s=e.pos,u=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos<a;){if(91===(o=e.src.charCodeAt(e.pos)))n++;else if(93===o&&0===--n){r=!0;break}e.parser.skipToken(e)}return r?(i=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=n-1,e.pos=s,e.isInLabel=u,i}},function(e,t,n){e.exports=n(759)},function(e,t,n){var r=n(189);function o(e,t,n,o,i,a,s){try{var u=e[a](s),c=u.value}catch(e){return void n(e)}u.done?t(c):r.resolve(c).then(o,i)}e.exports=function(e){return function(){var t=this,n=arguments;return new r(function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";n.d(t,"a",function(){return O});var r=n(20),o=n.n(r),i=n(4),a=n.n(i),s=n(5),u=n.n(s),c=n(6),l=n.n(c),p=n(7),f=n.n(p),h=n(9),d=n.n(h),m=n(8),v=n.n(m),g=n(2),y=n.n(g),b=n(0),_=n.n(b),w=n(479),x=n.n(w),E=n(19),S=n.n(E),C=n(10),k=n.n(C),O=function(e){function t(){var e,n;a()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=l()(this,(e=f()(t)).call.apply(e,[this].concat(o))),y()(d()(n),"getModelName",function(e){return-1!==e.indexOf("#/definitions/")?e.replace(/^.*#\/definitions\//,""):-1!==e.indexOf("#/components/schemas/")?e.replace(/^.*#\/components\/schemas\//,""):void 0}),y()(d()(n),"getRefSchema",function(e){return n.props.specSelectors.findDefinition(e)}),n}return v()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,r=e.getConfigs,i=e.specSelectors,a=e.schema,s=e.required,u=e.name,c=e.isRef,l=e.specPath,p=e.displayName,f=t("ObjectModel"),h=t("ArrayModel"),d=t("PrimitiveModel"),m="object",v=a&&a.get("$$ref");if(!u&&v&&(u=this.getModelName(v)),!a&&v&&(a=this.getRefSchema(u)),!a)return _.a.createElement("span",{className:"model model-title"},_.a.createElement("span",{className:"model-title__text"},p||u),_.a.createElement("img",{src:n(456),height:"20px",width:"20px",style:{marginLeft:"1em",position:"relative",bottom:"0px"}}));var g=i.isOAS3()&&a.get("deprecated");switch(c=void 0!==c?c:!!v,m=a&&a.get("type")||m){case"object":return _.a.createElement(f,o()({className:"object"},this.props,{specPath:l,getConfigs:r,schema:a,name:u,deprecated:g,isRef:c}));case"array":return _.a.createElement(h,o()({className:"array"},this.props,{getConfigs:r,schema:a,name:u,deprecated:g,required:s}));case"string":case"number":case"integer":case"boolean":default:return _.a.createElement(d,o()({},this.props,{getComponent:t,getConfigs:r,schema:a,name:u,deprecated:g,required:s}))}}}]),t}(x.a);y()(O,"propTypes",{schema:S.a.orderedMap.isRequired,getComponent:k.a.func.isRequired,getConfigs:k.a.func.isRequired,specSelectors:k.a.object.isRequired,name:k.a.string,displayName:k.a.string,isRef:k.a.bool,required:k.a.bool,expandDepth:k.a.number,depth:k.a.number,specPath:S.a.list.isRequired})},function(e,t,n){"use strict";n.d(t,"b",function(){return p});var r=n(0),o=n.n(r),i=(n(10),n(193)),a=n.n(i),s=n(327),u=n.n(s),c=n(56),l=n.n(c);function p(e){return u.a.sanitize(e,{ADD_ATTR:["target"],FORBID_TAGS:["style"]})}u.a.addHook("beforeSanitizeElements",function(e){return e.href&&e.setAttribute("rel","noopener noreferrer"),e}),t.a=function(e){var t=e.source,n=e.className,r=void 0===n?"":n;if("string"!=typeof t)return null;var i=new a.a({html:!0,typographer:!0,breaks:!0,linkify:!0,linkTarget:"_blank"});i.core.ruler.disable(["replacements","smartquotes"]);var s=i.render(t),u=p(s);return t&&s&&u?o.a.createElement("div",{className:l()(r,"markdown"),dangerouslySetInnerHTML:{__html:u}}):null}},function(e,t,n){"use strict";e.exports=n(967)},function(e,t,n){var r=n(121),o=n(33)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(96),o=n(44).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(328)("keys"),o=n(195);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(147).f,o=n(148),i=n(33)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){"use strict";var r=n(151);function o(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new o(e)}},function(e,t,n){var r=n(342),o=n(68);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(e))}},function(e,t,n){var r=n(33)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(127);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(206)("keys"),o=n(155);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(22),o=n(32),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(128)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(30),o=n(22),i=n(80);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",a)}},function(e,t,n){var r=n(41),o=n(32).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(41);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){"use strict";var r=n(128),o=n(30),i=n(212),a=n(71),s=n(98),u=n(549),c=n(131),l=n(347),p=n(34)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,d,m,v,g){u(n,t,d);var y,b,_,w=function(e){if(!f&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",E="values"==m,S=!1,C=e.prototype,k=C[p]||C["@@iterator"]||m&&C[m],O=k||w(m),A=m?E?w("entries"):O:void 0,T="Array"==t&&C.entries||k;if(T&&(_=l(T.call(new e)))!==Object.prototype&&_.next&&(c(_,x,!0),r||"function"==typeof _[p]||a(_,p,h)),E&&k&&"values"!==k.name&&(S=!0,O=function(){return k.call(this)}),r&&!g||!f&&!S&&C[p]||a(C,p,O),s[t]=O,s[x]=h,m)if(y={values:E?O:w("values"),keys:v?O:w("keys"),entries:A},g)for(b in y)b in C||i(C,b,y[b]);else o(o.P+o.F*(f||S),t,y);return y}},function(e,t,n){e.exports=n(71)},function(e,t,n){t.f=n(34)},function(e,t,n){var r=n(32),o=n(22),i=n(128),a=n(213),s=n(47).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(127);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(343),o=n(207).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){var r=n(162),o=n(34)("iterator"),i=n(98);e.exports=n(22).getIteratorMethod=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){var r=n(607),o=n(623),i=n(625),a=n(626),s=n(627);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(82)(n(48),"Map");e.exports=r},function(e,t,n){var r=n(165),o=n(631),i=n(632),a=n(633),s=n(634),u=n(635);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(645),o=n(374),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return i.call(e,t)}))}:o;e.exports=s},function(e,t,n){var r=n(647),o=n(63),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},function(e,t,n){(function(e){var r=n(48),o=n(648),i=t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;e.exports=u}).call(this,n(169)(e))},function(e,t){var n=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(361),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s}).call(this,n(169)(e))},function(e,t,n){var r=n(35),o=n(163),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!i.test(e)||null!=t&&e in Object(t)}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var o,i,a,s;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=c(e))>0&&a.length>o&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,i(this.listener,this.target,e))}.bind(r);return o.listener=n,r.wrapFn=o,o}function f(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):d(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function d(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else{var c=u.length,l=d(u,c);for(n=0;n<c;++n)i(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,o,i,a;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(385)).Stream=t,t.Readable=t,t.Writable=n(232),t.Duplex=n(84),t.Transform=n(390),t.PassThrough=n(680)},function(e,t,n){"use strict";(function(t,r,o){var i=n(174);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;y.WritableState=g;var c=n(134);c.inherits=n(106);var l={deprecate:n(679)},p=n(386),f=n(175).Buffer,h=o.Uint8Array||function(){};var d,m=n(387);function v(){}function g(e,t){s=s||n(84),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var p=!1===e.decodeStrings;this.decodeStrings=!p,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}(e,n,r,t,o);else{var a=x(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?u(_,e,n,a,o):_(e,n,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||n(84),!(d.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),p.call(this)}function b(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function _(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0,u=!0;n;)o[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;o.allBuffers=u,b(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,p=n.callback;if(b(e,t,!1,t.objectMode?1:c.length,c,l,p),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)})}function S(e,t){var n=x(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(y,p),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:l.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):d=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,n){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=e,f.isBuffer(r)||r instanceof h);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=v),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,s,r,o,i);return u}(this,o,s,e,t,n)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(72),n(388).setImmediate,n(42))},function(e,t,n){"use strict";e.exports=function(e){return"function"==typeof e}},function(e,t,n){"use strict";e.exports=n(705)()?Array.from:n(706)},function(e,t,n){"use strict";var r=n(719),o=n(86),i=n(107),a=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,u=Math.abs,c=Math.floor;e.exports=function(e){var t,n,l,p;if(!r(e))return a.apply(this,arguments);for(n=o(i(this).length),l=arguments[1],t=l=isNaN(l)?0:l>=0?c(l):o(this.length)-c(u(l));t<n;++t)if(s.call(this,t)&&(p=this[t],r(p)))return t;return-1}},function(e,t,n){"use strict";(function(t,n){var r,o;r=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},o=function(e){var t,n,o=document.createTextNode(""),i=0;return new e(function(){var e;if(t)n&&(t=n.concat(t));else{if(!n)return;t=n}if(n=t,t=null,"function"==typeof n)return e=n,n=null,void e();for(o.data=i=++i%2;n;)e=n.shift(),n.length||(n=null),e()}).observe(o,{characterData:!0}),function(e){r(e),t?"function"==typeof t?t=[t,e]:t.push(e):(t=e,o.data=i=++i%2)}},e.exports=function(){if("object"==typeof t&&t&&"function"==typeof t.nextTick)return t.nextTick;if("object"==typeof document&&document){if("function"==typeof MutationObserver)return o(MutationObserver);if("function"==typeof WebKitMutationObserver)return o(WebKitMutationObserver)}return"function"==typeof n?function(e){n(r(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(r(e),0)}:null}()}).call(this,n(72),n(388).setImmediate)},function(e,t,n){"use strict";var r=n(129);function o(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new o(e)}},function(e,t,n){"use strict";var r=n(110);e.exports=new r({explicit:[n(770),n(771),n(772)]})},function(e,t,n){"use strict";var r=n(21),o=(n(15),null),i={};function a(){if(o)for(var e in i){var t=i[e],n=o.indexOf(e);if(n>-1||r("96",e),!c.plugins[n]){t.extractEvents||r("97",e),c.plugins[n]=t;var a=t.eventTypes;for(var u in a)s(a[u],t,u)||r("98",u,e)}}}function s(e,t,n){c.eventNameDispatchConfigs.hasOwnProperty(n)&&r("99",n),c.eventNameDispatchConfigs[n]=e;var o=e.phasedRegistrationNames;if(o){for(var i in o){if(o.hasOwnProperty(i))u(o[i],t,n)}return!0}return!!e.registrationName&&(u(e.registrationName,t,n),!0)}function u(e,t,n){c.registrationNameModules[e]&&r("100",e),c.registrationNameModules[e]=t,c.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){o&&r("101"),o=Array.prototype.slice.call(e),a()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];i.hasOwnProperty(n)&&i[n]===o||(i[n]&&r("102",n),i[n]=o,t=!0)}t&&a()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return c.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var o=c.registrationNameModules[n[r]];if(o)return o}}return null},_resetEventPlugins:function(){for(var e in o=null,i)i.hasOwnProperty(e)&&delete i[e];c.plugins.length=0;var t=c.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=c.registrationNameModules;for(var a in r)r.hasOwnProperty(a)&&delete r[a]}};e.exports=c},function(e,t,n){"use strict";var r,o,i=n(21),a=n(241);n(15),n(23);function s(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=u.getNodeFromInstance(r),t?a.invokeGuardedCallbackWithCatch(o,n,e):a.invokeGuardedCallback(o,n,e),e.currentTarget=null}var u={isEndish:function(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e},isMoveish:function(e){return"topMouseMove"===e||"topTouchMove"===e},isStartish:function(e){return"topMouseDown"===e||"topTouchStart"===e},executeDirectDispatch:function(e){var t=e._dispatchListeners,n=e._dispatchInstances;Array.isArray(t)&&i("103"),e.currentTarget=t?u.getNodeFromInstance(n):null;var r=t?t(e):null;return e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,r},executeDispatchesInOrder:function(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)s(e,t,n[o],r[o]);else n&&s(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null},executeDispatchesInOrderStopAtTrue:function(e){var t=function(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}(e);return e._dispatchInstances=null,e._dispatchListeners=null,t},hasDispatches:function(e){return!!e._dispatchListeners},getInstanceFromNode:function(e){return r.getInstanceFromNode(e)},getNodeFromInstance:function(e){return r.getNodeFromInstance(e)},isAncestor:function(e,t){return o.isAncestor(e,t)},getLowestCommonAncestor:function(e,t){return o.getLowestCommonAncestor(e,t)},getParentInstance:function(e){return o.getParentInstance(e)},traverseTwoPhase:function(e,t,n){return o.traverseTwoPhase(e,t,n)},traverseEnterLeave:function(e,t,n,r,i){return o.traverseEnterLeave(e,t,n,r,i)},injection:{injectComponentTree:function(e){r=e},injectTreeTraversal:function(e){o=e}}};e.exports=u},function(e,t,n){"use strict";var r=null;function o(e,t,n){try{t(n)}catch(e){null===r&&(r=e)}}var i={invokeGuardedCallback:o,invokeGuardedCallbackWithCatch:o,rethrowCaughtError:function(){if(r){var e=r;throw r=null,e}}};e.exports=i},function(e,t,n){"use strict";e.exports=function(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}},function(e,t,n){"use strict";var r,o=n(36);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""))
/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/,e.exports=function(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i="function"==typeof a[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},function(e,t,n){"use strict";var r={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o(e){var t=this.nativeEvent;if(t.getModifierState)return t.getModifierState(e);var n=r[e];return!!n&&!!t[n]}e.exports=function(e){return o}},function(e,t,n){"use strict";var r=n(113),o=n(814),i=(n(27),n(50),n(247)),a=n(184),s=n(424);function u(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}var c=i(function(e,t,n){e.insertBefore(t,n)});function l(e,t,n){r.insertTreeBefore(e,t,n)}function p(e,t,n){Array.isArray(t)?function(e,t,n,r){var o=t;for(;;){var i=o.nextSibling;if(c(e,o,r),o===n)break;o=i}}(e,t[0],t[1],n):c(e,t,n)}function f(e,t){if(Array.isArray(t)){var n=t[1];h(e,t=t[0],n),e.removeChild(n)}e.removeChild(t)}function h(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}var d={dangerouslyReplaceNodeWithMarkup:o.dangerouslyReplaceNodeWithMarkup,replaceDelimitedText:function(e,t,n){var r=e.parentNode,o=e.nextSibling;o===t?n&&c(r,document.createTextNode(n),o):n?(s(o,n),h(r,o,t)):h(r,e,t)},processUpdates:function(e,t){for(var n=0;n<t.length;n++){var r=t[n];switch(r.type){case"INSERT_MARKUP":l(e,r.content,u(e,r.afterNode));break;case"MOVE_EXISTING":p(e,r.fromNode,u(e,r.afterNode));break;case"SET_MARKUP":a(e,r.content);break;case"TEXT_CONTENT":s(e,r.content);break;case"REMOVE_NODE":f(e,r.fromNode)}}}};e.exports=d},function(e,t,n){"use strict";e.exports={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}},function(e,t,n){"use strict";e.exports=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}},function(e,t,n){"use strict";var r=n(21),o=n(832),i=n(356)(n(100).isValidElement),a=(n(15),n(23),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0});function s(e){null!=e.checkedLink&&null!=e.valueLink&&r("87")}function u(e){s(e),(null!=e.value||null!=e.onChange)&&r("88")}function c(e){s(e),(null!=e.checked||null!=e.onChange)&&r("89")}var l={value:function(e,t,n){return!e[t]||a[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:i.func},p={};function f(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var h={checkPropTypes:function(e,t,n){for(var r in l){if(l.hasOwnProperty(r))var i=l[r](t,r,e,"prop",null,o);if(i instanceof Error&&!(i.message in p)){p[i.message]=!0;f(n)}}},getValue:function(e){return e.valueLink?(u(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(c(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(u(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(c(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};e.exports=h},function(e,t,n){"use strict";var r=n(21),o=(n(15),!1),i={replaceNodeWithMarkup:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){o&&r("104"),i.replaceNodeWithMarkup=e.replaceNodeWithMarkup,i.processChildrenUpdates=e.processChildrenUpdates,o=!0}}};e.exports=i},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}e.exports=function(e,t){if(o(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var a=0;a<n.length;a++)if(!r.call(t,n[a])||!o(e[n[a]],t[n[a]]))return!1;return!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n=null===e||!1===e,r=null===t||!1===t;if(n||r)return n===r;var o=typeof e,i=typeof t;return"string"===o||"number"===o?"string"===i||"number"===i:"object"===i&&e.type===t.type&&e.key===t.key}},function(e,t,n){"use strict";var r={escape:function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})},unescape:function(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}};e.exports=r},function(e,t,n){"use strict";var r=n(21),o=(n(62),n(140)),i=(n(50),n(55));n(15),n(23);function a(e){i.enqueueUpdate(e)}function s(e,t){var n=o.get(e);return n||null}var u={isMounted:function(e){var t=o.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){u.validateCallback(t,n);var r=s(e);if(!r)return null;r._pendingCallbacks?r._pendingCallbacks.push(t):r._pendingCallbacks=[t],a(r)},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],a(e)},enqueueForceUpdate:function(e){var t=s(e);t&&(t._pendingForceUpdate=!0,a(t))},enqueueReplaceState:function(e,t,n){var r=s(e);r&&(r._pendingStateQueue=[t],r._pendingReplaceState=!0,null!=n&&(u.validateCallback(n,"replaceState"),r._pendingCallbacks?r._pendingCallbacks.push(n):r._pendingCallbacks=[n]),a(r))},enqueueSetState:function(e,t){var n=s(e);n&&((n._pendingStateQueue||(n._pendingStateQueue=[])).push(t),a(n))},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,a(e)},validateCallback:function(e,t){e&&"function"!=typeof e&&r("122",t,function(e){var t=typeof e;if("object"!==t)return t;var n=e.constructor&&e.constructor.name||t,r=Object.keys(e);return r.length>0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}(e))}};e.exports=u},function(e,t,n){"use strict";n(25);var r=n(54),o=(n(23),r);e.exports=o},function(e,t,n){"use strict";e.exports=function(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,t>=32||13===t?t:0}},function(e,t,n){var r=n(81),o=n(257),i=n(63),a="[object Object]",s=Function.prototype,u=Object.prototype,c=s.toString,l=u.hasOwnProperty,p=c.call(Object);e.exports=function(e){if(!i(e)||r(e)!=a)return!1;var t=o(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==p}},function(e,t,n){var r=n(377)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(371);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t){
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017 Joachim Wester
* MIT license
*/
var n=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},r=Object.prototype.hasOwnProperty;function o(e,t){return r.call(e,t)}function i(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);t=[];for(var r in e)o(e,r)&&t.push(r);return t}function a(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function s(e,t){var n;for(var r in e)if(o(e,r)){if(e[r]===t)return a(r)+"/";if("object"==typeof e[r]&&""!=(n=s(e[r],t)))return a(r)+"/"+n}return""}function u(e,t){var n=[e];for(var r in t){var o="object"==typeof t[r]?JSON.stringify(t[r],null,2):t[r];void 0!==o&&n.push(r+": "+o)}return n.join("\n")}t.hasOwnProperty=o,t._objectKeys=i,t._deepClone=function(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}},t.isInteger=function(e){for(var t,n=0,r=e.length;n<r;){if(!((t=e.charCodeAt(n))>=48&&t<=57))return!1;n++}return!0},t.escapePathComponent=a,t.unescapePathComponent=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},t._getPathRecursive=s,t.getPath=function(e,t){if(e===t)return"/";var n=s(e,t);if(""===n)throw new Error("Object not found in root");return"/"+n},t.hasUndefined=function e(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var n=0,r=t.length;n<r;n++)if(e(t[n]))return!0}else if("object"==typeof t){var o=i(t),a=o.length;for(n=0;n<a;n++)if(e(t[o[n]]))return!0}return!1};var c=function(e){function t(t,n,r,o,i){e.call(this,u(t,{name:n,index:r,operation:o,tree:i})),this.name=n,this.index=r,this.operation=o,this.tree=i,this.message=u(t,{name:n,index:r,operation:o,tree:i})}return n(t,e),t}(Error);t.PatchError=c},function(e,t,n){var r=n(60),o=n(203),i=n(79),a=n(154),s=n(940);e.exports=function(e,t){var n=1==e,u=2==e,c=3==e,l=4==e,p=6==e,f=5==e||p,h=t||s;return function(t,s,d){for(var m,v,g=i(t),y=o(g),b=r(s,d,3),_=a(y.length),w=0,x=n?h(t,_):u?h(t,0):void 0;_>w;w++)if((f||w in y)&&(v=b(m=y[w],w,g),e))if(n)x[w]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return w;case 2:x.push(m)}else if(l)return!1;return p?-1:c||l?l:x}}},function(e,t,n){"use strict";function r(e,t,n,r,o){this.src=e,this.env=r,this.options=n,this.parser=t,this.tokens=o,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}r.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},r.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},r.prototype.cacheSet=function(e,t){for(var n=this.cache.length;n<=e;n++)this.cache.push(0);this.cache[e]=t},r.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0},e.exports=r},function(e,t,n){var r=n(594)("toUpperCase");e.exports=r},function(e,t,n){var r=n(218),o="Expected a function";function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},function(e,t,n){var r=n(628)(n(665));e.exports=r},function(e,t,n){"use strict";n.r(t);var r=n(266),o=n(43),i=n(269);t.default=function(e){return{statePlugins:{err:{reducers:Object(r.default)(e),actions:o,selectors:i}}}}},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),i=n(16),a=n.n(i),s=n(43),u=n(1),c=n(94),l={line:0,level:"error",message:"Unknown error"};t.default=function(e){var t;return t={},o()(t,s.NEW_THROWN_ERR,function(t,n){var r=n.payload,o=a()(l,r,{type:"thrown"});return t.update("errors",function(e){return(e||Object(u.List)()).push(Object(u.fromJS)(o))}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.NEW_THROWN_ERR_BATCH,function(t,n){var r=n.payload;return r=r.map(function(e){return Object(u.fromJS)(a()(l,e,{type:"thrown"}))}),t.update("errors",function(e){return(e||Object(u.List)()).concat(Object(u.fromJS)(r))}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.NEW_SPEC_ERR,function(t,n){var r=n.payload,o=Object(u.fromJS)(r);return o=o.set("type","spec"),t.update("errors",function(e){return(e||Object(u.List)()).push(Object(u.fromJS)(o)).sortBy(function(e){return e.get("line")})}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.NEW_SPEC_ERR_BATCH,function(t,n){var r=n.payload;return r=r.map(function(e){return Object(u.fromJS)(a()(l,e,{type:"spec"}))}),t.update("errors",function(e){return(e||Object(u.List)()).concat(Object(u.fromJS)(r))}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.NEW_AUTH_ERR,function(t,n){var r=n.payload,o=Object(u.fromJS)(a()({},r));return o=o.set("type","auth"),t.update("errors",function(e){return(e||Object(u.List)()).push(Object(u.fromJS)(o))}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.CLEAR,function(e,t){var n=t.payload;if(!n||!e.get("errors"))return e;var r=e.get("errors").filter(function(e){return e.keySeq().every(function(t){var r=e.get(t),o=n[t];return!o||r!==o})});return e.merge({errors:r})}),o()(t,s.CLEAR_BY,function(e,t){var n=t.payload;if(!n||"function"!=typeof n)return e;var r=e.get("errors").filter(function(e){return n(e)});return e.merge({errors:r})}),t}},function(e,t,n){"use strict";function r(e){return e.map(function(e){var t=e.get("message").indexOf("is not of a type(s)");if(t>-1){var n=e.get("message").slice(t+"is not of a type(s)".length).split(",");return e.set("message",e.get("message").slice(0,t)+function(e){return e.reduce(function(e,t,n,r){return n===r.length-1&&r.length>1?e+"or "+t:r[n+1]&&r.length>2?e+t+", ":r[n+1]?e+t+" ":e+t},"should be a")}(n))}return e})}n.r(t),n.d(t,"transform",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"transform",function(){return r});n(91),n(1);function r(e,t){t.jsSpec;return e}},function(e,t,n){"use strict";n.r(t),n.d(t,"allErrors",function(){return i}),n.d(t,"lastError",function(){return a});var r=n(1),o=n(11),i=Object(o.createSelector)(function(e){return e},function(e){return e.get("errors",Object(r.List)())}),a=Object(o.createSelector)(i,function(e){return e.last()})},function(e,t,n){"use strict";n.r(t);var r=n(271),o=n(74),i=n(272);t.default=function(){return{statePlugins:{layout:{reducers:r.default,actions:o,selectors:i}}}}},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(1),s=n(74);t.default=(r={},i()(r,s.UPDATE_LAYOUT,function(e,t){return e.set("layout",t.payload)}),i()(r,s.UPDATE_FILTER,function(e,t){return e.set("filter",t.payload)}),i()(r,s.SHOW,function(e,t){var n=t.payload.shown,r=Object(a.fromJS)(t.payload.thing);return e.update("shown",Object(a.fromJS)({}),function(e){return e.set(r,n)})}),i()(r,s.UPDATE_MODE,function(e,t){var n=t.payload.thing,r=t.payload.mode;return e.setIn(["modes"].concat(n),(r||"")+"")}),r)},function(e,t,n){"use strict";n.r(t),n.d(t,"current",function(){return u}),n.d(t,"currentFilter",function(){return c}),n.d(t,"isShown",function(){return l}),n.d(t,"whatMode",function(){return p}),n.d(t,"showSummary",function(){return f});var r=n(12),o=n.n(r),i=n(11),a=n(3),s=n(1),u=function(e){return e.get("layout")},c=function(e){return e.get("filter")},l=function(e,t,n){return t=Object(a.u)(t),e.get("shown",Object(s.fromJS)({})).get(Object(s.fromJS)(t),n)},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t=Object(a.u)(t),e.getIn(["modes"].concat(o()(t)),n)},f=Object(i.createSelector)(function(e){return e},function(e){return!l(e,"editor")})},function(e,t,n){"use strict";n.r(t);var r=n(274),o=n(29),i=n(66),a=n(276);t.default=function(){return{statePlugins:{spec:{wrapActions:a,reducers:r.default,actions:o,selectors:i}}}}},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(16),s=n.n(a),u=n(12),c=n.n(u),l=n(1),p=n(3),f=n(18),h=n.n(f),d=n(66),m=n(29);t.default=(r={},i()(r,m.UPDATE_SPEC,function(e,t){return"string"==typeof t.payload?e.set("spec",t.payload):e}),i()(r,m.UPDATE_URL,function(e,t){return e.set("url",t.payload+"")}),i()(r,m.UPDATE_JSON,function(e,t){return e.set("json",Object(p.h)(t.payload))}),i()(r,m.UPDATE_RESOLVED,function(e,t){return e.setIn(["resolved"],Object(p.h)(t.payload))}),i()(r,m.UPDATE_RESOLVED_SUBTREE,function(e,t){var n=t.payload,r=n.value,o=n.path;return e.setIn(["resolvedSubtrees"].concat(c()(o)),Object(p.h)(r))}),i()(r,m.UPDATE_PARAM,function(e,t){var n=t.payload,r=n.path,o=n.paramName,i=n.paramIn,a=n.param,s=n.value,u=n.isXml,l=a?Object(p.z)(a):"".concat(i,".").concat(o),f=u?"value_xml":"value";return e.setIn(["meta","paths"].concat(c()(r),["parameters",l,f]),s)}),i()(r,m.UPDATE_EMPTY_PARAM_INCLUSION,function(e,t){var n=t.payload,r=n.pathMethod,o=n.paramName,i=n.paramIn,a=n.includeEmptyValue;if(!o||!i)return console.warn("Warning: UPDATE_EMPTY_PARAM_INCLUSION could not generate a paramKey."),e;var s="".concat(i,".").concat(o);return e.setIn(["meta","paths"].concat(c()(r),["parameter_inclusions",s]),a)}),i()(r,m.VALIDATE_PARAMS,function(e,t){var n=t.payload,r=n.pathMethod,o=n.isOAS3,i=Object(d.specJsonWithResolvedSubtrees)(e).getIn(["paths"].concat(c()(r))),a=Object(d.parameterValues)(e,r).toJS();return e.updateIn(["meta","paths"].concat(c()(r),["parameters"]),Object(l.fromJS)({}),function(t){return i.get("parameters",Object(l.List)()).reduce(function(t,n){var i=Object(p.A)(n,a),s=Object(d.parameterInclusionSettingFor)(e,r,n.get("name"),n.get("in")),u=Object(p.I)(n,i,{bypassRequiredCheck:s,isOAS3:o});return t.setIn([Object(p.z)(n),"errors"],Object(l.fromJS)(u))},t)})}),i()(r,m.CLEAR_VALIDATE_PARAMS,function(e,t){var n=t.payload.pathMethod;return e.updateIn(["meta","paths"].concat(c()(n),["parameters"]),Object(l.fromJS)([]),function(e){return e.map(function(e){return e.set("errors",Object(l.fromJS)([]))})})}),i()(r,m.SET_RESPONSE,function(e,t){var n,r=t.payload,o=r.res,i=r.path,a=r.method;(n=o.error?s()({error:!0,name:o.err.name,message:o.err.message,statusCode:o.err.statusCode},o.err.response):o).headers=n.headers||{};var u=e.setIn(["responses",i,a],Object(p.h)(n));return h.a.Blob&&o.data instanceof h.a.Blob&&(u=u.setIn(["responses",i,a,"text"],o.data)),u}),i()(r,m.SET_REQUEST,function(e,t){var n=t.payload,r=n.req,o=n.path,i=n.method;return e.setIn(["requests",o,i],Object(p.h)(r))}),i()(r,m.SET_MUTATED_REQUEST,function(e,t){var n=t.payload,r=n.req,o=n.path,i=n.method;return e.setIn(["mutatedRequests",o,i],Object(p.h)(r))}),i()(r,m.UPDATE_OPERATION_META_VALUE,function(e,t){var n=t.payload,r=n.path,o=n.value,i=n.key,a=["paths"].concat(c()(r)),s=["meta","paths"].concat(c()(r));return e.getIn(["json"].concat(c()(a)))||e.getIn(["resolved"].concat(c()(a)))||e.getIn(["resolvedSubtrees"].concat(c()(a)))?e.setIn([].concat(c()(s),[i]),Object(l.fromJS)(o)):e}),i()(r,m.CLEAR_RESPONSE,function(e,t){var n=t.payload,r=n.path,o=n.method;return e.deleteIn(["responses",r,o])}),i()(r,m.CLEAR_REQUEST,function(e,t){var n=t.payload,r=n.path,o=n.method;return e.deleteIn(["requests",r,o])}),i()(r,m.SET_SCHEME,function(e,t){var n=t.payload,r=n.scheme,o=n.path,i=n.method;return o&&i?e.setIn(["scheme",o,i],r):o||i?void 0:e.setIn(["scheme","_defaultScheme"],r)}),r)},function(e,t,n){var r=n(81),o=n(35),i=n(63),a="[object String]";e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&r(e)==a}},function(e,t,n){"use strict";n.r(t),n.d(t,"updateSpec",function(){return s}),n.d(t,"updateJsonSpec",function(){return u}),n.d(t,"executeRequest",function(){return c}),n.d(t,"validateParams",function(){return l});var r=n(17),o=n.n(r),i=n(91),a=n.n(i),s=function(e,t){var n=t.specActions;return function(){e.apply(void 0,arguments),n.parseToJson.apply(n,arguments)}},u=function(e,t){var n=t.specActions;return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.apply(void 0,r),n.invalidateResolvedSubtreeCache();var s=r[0],u=a()(s,["paths"])||{},c=o()(u);c.forEach(function(e){a()(u,[e]).$ref&&n.requestResolvedSubtree(["paths",e])}),n.requestResolvedSubtree(["components","securitySchemes"])}},c=function(e,t){var n=t.specActions;return function(t){return n.logRequest(t),e(t)}},l=function(e,t){var n=t.specSelectors;return function(t){return e(t,n.isOAS3())}}},function(e,t,n){"use strict";n.r(t);var r=n(145),o=n(3);t.default=function(e){var t=e.getComponents,n=e.getStore,i=e.getSystem,a=r.getComponent,s=r.render,u=r.makeMappedContainer,c=Object(o.t)(a.bind(null,i,n,t));return{rootInjects:{getComponent:c,makeMappedContainer:Object(o.t)(u.bind(null,i,n,c,t)),render:s.bind(null,i,n,a,t)}}}},function(e,t,n){"use strict";n.r(t);var r=n(116);t.default=function(){return{fn:r}}},function(e,t,n){"use strict";n.r(t),t.default=function(e){var t=e.configs,n={debug:0,info:1,log:2,warn:3,error:4},r=function(e){return n[e]||-1},o=t.logLevel,i=r(o);function a(e){for(var t,n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];r(e)>=i&&(t=console)[e].apply(t,o)}return a.warn=a.bind(null,"warn"),a.error=a.bind(null,"error"),a.info=a.bind(null,"info"),a.debug=a.bind(null,"debug"),{rootInjects:{log:a}}}},function(e,t,n){"use strict";n.r(t);var r=n(53),o=n.n(r),i=n(281);t.default=function(e){var t=e.configs,n=e.getConfigs;return{fn:{fetch:o.a.makeHttp(t.preFetch,t.postFetch),buildRequest:o.a.buildRequest,execute:o.a.execute,resolve:o.a.resolve,resolveSubtree:function(e,t,r){if(void 0===r){var i=n();r={modelPropertyMacro:i.modelPropertyMacro,parameterMacro:i.parameterMacro,requestInterceptor:i.requestInterceptor,responseInterceptor:i.responseInterceptor}}for(var a=arguments.length,s=new Array(a>3?a-3:0),u=3;u<a;u++)s[u-3]=arguments[u];return o.a.resolveSubtree.apply(o.a,[e,t,r].concat(s))},serializeRes:o.a.serializeRes,opId:o.a.helpers.opId},statePlugins:{configs:{wrapActions:i}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"loaded",function(){return r});var r=function(e,t){return function(){e.apply(void 0,arguments);var n=t.getConfigs().withCredentials;void 0!==n&&(t.fn.fetch.withCredentials="string"==typeof n?"true"===n:!!n)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"preauthorizeBasic",function(){return c}),n.d(t,"preauthorizeApiKey",function(){return l});var r=n(2),o=n.n(r),i=n(283),a=n(67),s=n(284),u=n(285);function c(e,t,n,r){var i=e.authActions.authorize,a=e.specSelectors,s=a.specJson,u=(0,a.isOAS3)()?["components","securitySchemes"]:["securityDefinitions"],c=s().getIn([].concat(u,[t]));return c?i(o()({},t,{value:{username:n,password:r},schema:c.toJS()})):null}function l(e,t,n){var r=e.authActions.authorize,i=e.specSelectors,a=i.specJson,s=(0,i.isOAS3)()?["components","securitySchemes"]:["securityDefinitions"],u=a().getIn([].concat(s,[t]));return u?r(o()({},t,{value:n,schema:u.toJS()})):null}t.default=function(){return{afterLoad:function(e){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=e.authActions.configureAuth,this.rootInjects.preauthorizeApiKey=l.bind(null,e),this.rootInjects.preauthorizeBasic=c.bind(null,e)},statePlugins:{auth:{reducers:i.default,actions:a,selectors:s},spec:{wrapActions:u}}}}},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(16),s=n.n(a),u=n(13),c=n.n(u),l=n(1),p=n(3),f=n(67);t.default=(r={},i()(r,f.SHOW_AUTH_POPUP,function(e,t){var n=t.payload;return e.set("showDefinitions",n)}),i()(r,f.AUTHORIZE,function(e,t){var n=t.payload,r=Object(l.fromJS)(n),o=e.get("authorized")||Object(l.Map)();return r.entrySeq().forEach(function(e){var t=c()(e,2),n=t[0],r=t[1],i=r.getIn(["schema","type"]);if("apiKey"===i||"http"===i)o=o.set(n,r);else if("basic"===i){var a=r.getIn(["value","username"]),s=r.getIn(["value","password"]);o=(o=o.setIn([n,"value"],{username:a,header:"Basic "+Object(p.a)(a+":"+s)})).setIn([n,"schema"],r.get("schema"))}}),e.set("authorized",o)}),i()(r,f.AUTHORIZE_OAUTH2,function(e,t){var n,r=t.payload,o=r.auth,i=r.token;return o.token=s()({},i),n=Object(l.fromJS)(o),e.setIn(["authorized",n.get("name")],n)}),i()(r,f.LOGOUT,function(e,t){var n=t.payload,r=e.get("authorized").withMutations(function(e){n.forEach(function(t){e.delete(t)})});return e.set("authorized",r)}),i()(r,f.CONFIGURE_AUTH,function(e,t){var n=t.payload;return e.set("configs",n)}),r)},function(e,t,n){"use strict";n.r(t),n.d(t,"shownDefinitions",function(){return l}),n.d(t,"definitionsToAuthorize",function(){return p}),n.d(t,"getDefinitionsByNames",function(){return f}),n.d(t,"definitionsForRequirements",function(){return h}),n.d(t,"authorized",function(){return d}),n.d(t,"isAuthorized",function(){return m}),n.d(t,"getConfigs",function(){return v});var r=n(17),o=n.n(r),i=n(13),a=n.n(i),s=n(11),u=n(1),c=function(e){return e},l=Object(s.createSelector)(c,function(e){return e.get("showDefinitions")}),p=Object(s.createSelector)(c,function(){return function(e){var t=e.specSelectors.securityDefinitions()||Object(u.Map)({}),n=Object(u.List)();return t.entrySeq().forEach(function(e){var t=a()(e,2),r=t[0],o=t[1],i=Object(u.Map)();i=i.set(r,o),n=n.push(i)}),n}}),f=function(e,t){return function(e){var n=e.specSelectors;console.warn("WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.");var r=n.securityDefinitions(),o=Object(u.List)();return t.valueSeq().forEach(function(e){var t=Object(u.Map)();e.entrySeq().forEach(function(e){var n,o=a()(e,2),i=o[0],s=o[1],u=r.get(i);"oauth2"===u.get("type")&&s.size&&((n=u.get("scopes")).keySeq().forEach(function(e){s.contains(e)||(n=n.delete(e))}),u=u.set("allowedScopes",n)),t=t.set(i,u)}),o=o.push(t)}),o}},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(u.List)();return function(e){return(e.authSelectors.definitionsToAuthorize()||Object(u.List)()).filter(function(e){return t.some(function(t){return t.get(e.keySeq().first())})})}},d=Object(s.createSelector)(c,function(e){return e.get("authorized")||Object(u.Map)()}),m=function(e,t){return function(e){var n=e.authSelectors.authorized();return u.List.isList(t)?!!t.toJS().filter(function(e){return-1===o()(e).map(function(e){return!!n.get(e)}).indexOf(!1)}).length:null}},v=Object(s.createSelector)(c,function(e){return e.get("configs")})},function(e,t,n){"use strict";n.r(t),n.d(t,"execute",function(){return y});var r=n(51),o=n.n(r),i=n(92),a=n.n(i),s=n(57),u=n.n(s),c=n(58),l=n.n(c),p=n(52),f=n.n(p),h=n(17),d=n.n(h),m=n(2),v=n.n(m);function g(e,t){var n=d()(e);if(f.a){var r=f()(e);t&&(r=r.filter(function(t){return l()(e,t).enumerable})),n.push.apply(n,r)}return n}var y=function(e,t){var n=t.authSelectors,r=t.specSelectors;return function(t){var i=t.path,s=t.method,c=t.operation,p=t.extras,f={authorized:n.authorized()&&n.authorized().toJS(),definitions:r.securityDefinitions()&&r.securityDefinitions().toJS(),specSecurity:r.security()&&r.security().toJS()};return e(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(n,!0).forEach(function(t){v()(e,t,n[t])}):u.a?a()(e,u()(n)):g(n).forEach(function(t){o()(e,t,l()(n,t))})}return e}({path:i,method:s,operation:c,securities:f},p))}}},function(e,t,n){"use strict";n.r(t);var r=n(3);t.default=function(){return{fn:{shallowEqualKeys:r.E}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return p});var r=n(28),o=n.n(r),i=n(16),a=n.n(i),s=n(11),u=n(1),c=n(18),l=n.n(c);function p(e){var t=e.fn;return{statePlugins:{spec:{actions:{download:function(e){return function(n){var r=n.errActions,o=n.specSelectors,i=n.specActions,s=n.getConfigs,u=t.fetch,c=s();function p(t){if(t instanceof Error||t.status>=400)return i.updateLoadingStatus("failed"),r.newThrownErr(a()(new Error((t.message||t.statusText)+" "+e),{source:"fetch"})),void(!t.status&&t instanceof Error&&function(){try{var t;if("URL"in l.a?t=new URL(e):(t=document.createElement("a")).href=e,"https:"!==t.protocol&&"https:"===l.a.location.protocol){var n=a()(new Error("Possible mixed-content issue? The page was loaded over https:// but a ".concat(t.protocol,"// URL was specified. Check that you are not attempting to load mixed content.")),{source:"fetch"});return void r.newThrownErr(n)}if(t.origin!==l.a.location.origin){var o=a()(new Error("Possible cross-origin (CORS) issue? The URL origin (".concat(t.origin,") does not match the page (").concat(l.a.location.origin,"). Check the server returns the correct 'Access-Control-Allow-*' headers.")),{source:"fetch"});r.newThrownErr(o)}}catch(e){return}}());i.updateLoadingStatus("success"),i.updateSpec(t.text),o.url()!==e&&i.updateUrl(e)}e=e||o.url(),i.updateLoadingStatus("loading"),r.clear({source:"fetch"}),u({url:e,loadSpec:!0,requestInterceptor:c.requestInterceptor||function(e){return e},responseInterceptor:c.responseInterceptor||function(e){return e},credentials:"same-origin",headers:{Accept:"application/json,*/*"}}).then(p,p)}},updateLoadingStatus:function(e){var t=[null,"loading","failed","success","failedConfig"];return-1===t.indexOf(e)&&console.error("Error: ".concat(e," is not one of ").concat(o()(t))),{type:"spec_update_loading_status",payload:e}}},reducers:{spec_update_loading_status:function(e,t){return"string"==typeof t.payload?e.set("loadingStatus",t.payload):e}},selectors:{loadingStatus:Object(s.createSelector)(function(e){return e||Object(u.Map)()},function(e){return e.get("loadingStatus")||null})}}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"downloadConfig",function(){return o}),n.d(t,"getConfigByUrl",function(){return i});var r=n(144),o=function(e){return function(t){return(0,t.fn.fetch)(e)}},i=function(e,t){return function(n){var o=n.specActions;if(e)return o.downloadConfig(e).then(i,i);function i(n){n instanceof Error||n.status>=400?(o.updateLoadingStatus("failedConfig"),o.updateLoadingStatus("failedConfig"),o.updateUrl(""),console.error(n.statusText+" "+e.url),t(null)):t(Object(r.parseYamlConfig)(n.text))}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"get",function(){return i});var r=n(14),o=n.n(r),i=function(e,t){return e.getIn(o()(t)?t:[t])}},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(1),s=n(117);t.default=(r={},i()(r,s.UPDATE_CONFIGS,function(e,t){return e.merge(Object(a.fromJS)(t.payload))}),i()(r,s.TOGGLE_CONFIGS,function(e,t){var n=t.payload,r=e.get(n);return e.set(n,!r)}),r)},function(e,t,n){"use strict";n.r(t);var r=n(292),o=n(293),i=n(294);t.default=function(){return[r.default,{statePlugins:{configs:{wrapActions:{loaded:function(e,t){return function(){e.apply(void 0,arguments);var n=decodeURIComponent(window.location.hash);t.layoutActions.parseDeepLinkHash(n)}}}}},wrapComponents:{operation:o.default,OperationTag:i.default}}]}},function(e,t,n){"use strict";n.r(t),n.d(t,"show",function(){return v}),n.d(t,"scrollTo",function(){return g}),n.d(t,"parseDeepLinkHash",function(){return y}),n.d(t,"readyToScroll",function(){return b}),n.d(t,"scrollToElement",function(){return _}),n.d(t,"clearScrollTo",function(){return w});var r,o=n(2),i=n.n(o),a=n(13),s=n.n(a),u=n(14),c=n.n(u),l=n(146),p=n(474),f=n.n(p),h=n(3),d=n(1),m=n.n(d),v=function(e,t){var n=t.getConfigs,r=t.layoutSelectors;return function(){for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];if(e.apply(void 0,o),n().deepLinking)try{var a=o[0],u=o[1];a=c()(a)?a:[a];var p=r.urlHashArrayFromIsShownKey(a);if(!p.length)return;var f=s()(p,2),d=f[0],m=f[1];if(!u)return Object(l.setHash)("/");2===p.length?Object(l.setHash)(Object(h.c)("/".concat(encodeURIComponent(d),"/").concat(encodeURIComponent(m)))):1===p.length&&Object(l.setHash)(Object(h.c)("/".concat(encodeURIComponent(d))))}catch(e){console.error(e)}}},g=function(e){return{type:"layout_scroll_to",payload:c()(e)?e:[e]}},y=function(e){return function(t){var n=t.layoutActions,r=t.layoutSelectors;if((0,t.getConfigs)().deepLinking&&e){var o=e.slice(1);"!"===o[0]&&(o=o.slice(1)),"/"===o[0]&&(o=o.slice(1));var i=o.split("/").map(function(e){return e||""}),a=r.isShownKeyFromUrlHashArray(i),u=s()(a,3),c=u[0],l=u[1],p=void 0===l?"":l,f=u[2],h=void 0===f?"":f;if("operations"===c){var d=r.isShownKeyFromUrlHashArray([p]);p.indexOf("_")>-1&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),n.show(d.map(function(e){return e.replace(/_/g," ")}),!0)),n.show(d,!0)}(p.indexOf("_")>-1||h.indexOf("_")>-1)&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),n.show(a.map(function(e){return e.replace(/_/g," ")}),!0)),n.show(a,!0),n.scrollTo(a)}}},b=function(e,t){return function(n){var r=n.layoutSelectors.getScrollToKey();m.a.is(r,Object(d.fromJS)(e))&&(n.layoutActions.scrollToElement(t),n.layoutActions.clearScrollTo())}},_=function(e,t){return function(n){try{t=t||n.fn.getScrollParent(e),f.a.createScroller(t).to(e)}catch(e){console.error(e)}}},w=function(){return{type:"layout_clear_scroll"}};t.default={fn:{getScrollParent:function(e,t){var n=document.documentElement,r=getComputedStyle(e),o="absolute"===r.position,i=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===r.position)return n;for(var a=e;a=a.parentElement;)if(r=getComputedStyle(a),(!o||"static"!==r.position)&&i.test(r.overflow+r.overflowY+r.overflowX))return a;return n}},statePlugins:{layout:{actions:{scrollToElement:_,scrollTo:g,clearScrollTo:w,readyToScroll:b,parseDeepLinkHash:y},selectors:{getScrollToKey:function(e){return e.get("scrollToKey")},isShownKeyFromUrlHashArray:function(e,t){var n=s()(t,2),r=n[0],o=n[1];return o?["operations",r,o]:r?["operations-tag",r]:[]},urlHashArrayFromIsShownKey:function(e,t){var n=s()(t,3),r=n[0],o=n[1],i=n[2];return"operations"==r?[o,i]:"operations-tag"==r?[o]:[]}},reducers:(r={},i()(r,"layout_scroll_to",function(e,t){return e.set("scrollToKey",m.a.fromJS(t.payload))}),i()(r,"layout_clear_scroll",function(e){return e.delete("scrollToKey")}),r),wrapActions:{show:v}}}}},function(e,t,n){"use strict";n.r(t);var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(9),f=n.n(p),h=n(8),d=n.n(h),m=n(2),v=n.n(m),g=n(0),y=n.n(g);n(19);t.default=function(e,t){return function(n){function r(){var e,n;o()(this,r);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=u()(this,(e=l()(r)).call.apply(e,[this].concat(a))),v()(f()(n),"onLoad",function(e){var r=n.props.operation.toObject(),o=["operations",r.tag,r.operationId];t.layoutActions.readyToScroll(o,e)}),n}return d()(r,n),a()(r,[{key:"render",value:function(){return y.a.createElement("span",{ref:this.onLoad},y.a.createElement(e,this.props))}}]),r}(y.a.Component)}},function(e,t,n){"use strict";n.r(t);var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(9),f=n.n(p),h=n(8),d=n.n(h),m=n(2),v=n.n(m),g=n(0),y=n.n(g);n(10);t.default=function(e,t){return function(n){function r(){var e,n;o()(this,r);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=u()(this,(e=l()(r)).call.apply(e,[this].concat(a))),v()(f()(n),"onLoad",function(e){var r=["operations-tag",n.props.tag];t.layoutActions.readyToScroll(r,e)}),n}return d()(r,n),a()(r,[{key:"render",value:function(){return y.a.createElement("span",{ref:this.onLoad},y.a.createElement(e,this.props))}}]),r}(y.a.Component)}},function(e,t,n){"use strict";n.r(t);var r=n(296);t.default=function(){return{fn:{opsFilter:r.default}}}},function(e,t,n){"use strict";n.r(t),t.default=function(e,t){return e.filter(function(e,n){return-1!==n.indexOf(t)})}},function(e,t,n){"use strict";n.r(t);var r=!1;t.default=function(){return{statePlugins:{spec:{wrapActions:{updateSpec:function(e){return function(){return r=!0,e.apply(void 0,arguments)}},updateJsonSpec:function(e,t){return function(){var n=t.getConfigs().onComplete;return r&&"function"==typeof n&&(setTimeout(n,0),r=!1),e.apply(void 0,arguments)}}}}}}}},function(e,t,n){"use strict";n.r(t);var r=n(299),o=n(300),i=n(301),a=n(302),s=n(311),u=n(59),c=n(318),l=n(319);t.default=function(){return{components:a.default,wrapComponents:s.default,statePlugins:{spec:{wrapSelectors:r,selectors:i},auth:{wrapSelectors:o},oas3:{actions:u,reducers:l.default,selectors:c}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"definitions",function(){return h}),n.d(t,"hasHost",function(){return d}),n.d(t,"securityDefinitions",function(){return m}),n.d(t,"host",function(){return v}),n.d(t,"basePath",function(){return g}),n.d(t,"consumes",function(){return y}),n.d(t,"produces",function(){return b}),n.d(t,"schemes",function(){return _}),n.d(t,"servers",function(){return w}),n.d(t,"isOAS3",function(){return x}),n.d(t,"isSwagger2",function(){return E});var r=n(11),o=n(66),i=n(1),a=n(24);function s(e){return function(t,n){return function(){var r=n.getSystem().specSelectors.specJson();return Object(a.isOAS3)(r)?e.apply(void 0,arguments):t.apply(void 0,arguments)}}}var u=function(e){return e||Object(i.Map)()},c=s(Object(r.createSelector)(function(){return null})),l=Object(r.createSelector)(u,function(e){return e.get("json",Object(i.Map)())}),p=Object(r.createSelector)(u,function(e){return e.get("resolved",Object(i.Map)())}),f=function(e){var t=p(e);return t.count()<1&&(t=l(e)),t},h=s(Object(r.createSelector)(f,function(e){var t=e.getIn(["components","schemas"]);return i.Map.isMap(t)?t:Object(i.Map)()})),d=s(function(e){return f(e).hasIn(["servers",0])}),m=s(Object(r.createSelector)(o.specJsonWithResolvedSubtrees,function(e){return e.getIn(["components","securitySchemes"])||null})),v=c,g=c,y=c,b=c,_=c,w=s(Object(r.createSelector)(f,function(e){return e.getIn(["servers"])||Object(i.Map)()})),x=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return Object(a.isOAS3)(i.Map.isMap(e)?e:Object(i.Map)())}},E=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return Object(a.isSwagger2)(i.Map.isMap(e)?e:Object(i.Map)())}}},function(e,t,n){"use strict";n.r(t),n.d(t,"definitionsToAuthorize",function(){return p});var r=n(2),o=n.n(r),i=n(13),a=n.n(i),s=n(11),u=n(1),c=n(24);var l,p=(l=Object(s.createSelector)(function(e){return e},function(e){return e.specSelectors.securityDefinitions()},function(e,t){var n=Object(u.List)();return t?(t.entrySeq().forEach(function(e){var t=a()(e,2),r=t[0],i=t[1],s=i.get("type");"oauth2"===s&&i.get("flows").entrySeq().forEach(function(e){var t=a()(e,2),s=t[0],c=t[1],l=Object(u.fromJS)({flow:s,authorizationUrl:c.get("authorizationUrl"),tokenUrl:c.get("tokenUrl"),scopes:c.get("scopes"),type:i.get("type")});n=n.push(new u.Map(o()({},r,l.filter(function(e){return void 0!==e}))))}),"http"!==s&&"apiKey"!==s||(n=n.push(new u.Map(o()({},r,i))))}),n):n}),function(e,t){return function(n){for(var r=t.getSystem().specSelectors.specJson(),o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return Object(c.isOAS3)(r)?l.apply(void 0,[t].concat(i)):e.apply(void 0,i)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"servers",function(){return l}),n.d(t,"isSwagger2",function(){return p});var r=n(11),o=n(1),i=n(24);var a,s=function(e){return e||Object(o.Map)()},u=Object(r.createSelector)(s,function(e){return e.get("json",Object(o.Map)())}),c=Object(r.createSelector)(s,function(e){return e.get("resolved",Object(o.Map)())}),l=(a=Object(r.createSelector)(function(e){var t=c(e);return t.count()<1&&(t=u(e)),t},function(e){return e.getIn(["servers"])||Object(o.Map)()}),function(){return function(e){var t=e.getSystem().specSelectors.specJson();if(Object(i.isOAS3)(t)){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return a.apply(void 0,r)}return null}}),p=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return Object(i.isSwagger2)(e)}}},function(e,t,n){"use strict";n.r(t);var r=n(303),o=n(304),i=n(305),a=n(306),s=n(307),u=n(308),c=n(309),l=n(310);t.default={Callbacks:r.default,HttpAuth:c.default,RequestBody:o.default,Servers:a.default,ServersContainer:s.default,RequestBodyEditor:u.default,OperationServers:l.default,operationLink:i.default}},function(e,t,n){"use strict";n.r(t);var r=n(20),o=n.n(r),i=n(0),a=n.n(i),s=(n(10),n(19),n(1));t.default=function(e){var t=e.callbacks,n=e.getComponent,r=e.specPath,i=n("OperationContainer",!0);if(!t)return a.a.createElement("span",null,"No callbacks");var u=t.map(function(t,n){return a.a.createElement("div",{key:n},a.a.createElement("h2",null,n),t.map(function(t,u){return"$$ref"===u?null:a.a.createElement("div",{key:u},t.map(function(t,c){if("$$ref"===c)return null;var l=Object(s.fromJS)({operation:t});return a.a.createElement(i,o()({},e,{op:l,key:c,tag:"",method:c,path:u,specPath:r.push(n,u,c),allowTryItOut:!1}))}))}))});return a.a.createElement("div",null,u)}},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=(n(10),n(19),n(1)),a=n(3);function s(e,t,n){var r=e.getIn(["content",t]),o=r.get("schema").toJS(),i=void 0!==r.get("example")?Object(a.G)(r.get("example")):null,s=r.getIn(["examples",n,"value"]);return r.get("examples")?Object(a.G)(s)||"":Object(a.G)(i||Object(a.m)(o,t,{includeWriteOnly:!0})||"")}t.default=function(e){var t=e.requestBody,n=e.requestBodyValue,r=e.getComponent,u=e.getConfigs,c=e.specSelectors,l=e.fn,p=e.contentType,f=e.isExecute,h=e.specPath,d=e.onChange,m=e.activeExamplesKey,v=e.updateActiveExamplesKey,g=r("Markdown"),y=r("modelExample"),b=r("RequestBodyEditor"),_=r("highlightCode"),w=r("ExamplesSelectValueRetainer"),x=r("Example"),E=u().showCommonExtensions,S=t&&t.get("description")||null,C=t&&t.get("content")||new i.OrderedMap;p=p||C.keySeq().first()||"";var k=C.get(p,Object(i.OrderedMap)()),O=k.get("schema",Object(i.OrderedMap)()),A=k.get("examples",null);if(!k.size)return null;var T="object"===k.getIn(["schema","type"]);if("application/octet-stream"===p||0===p.indexOf("image/")||0===p.indexOf("audio/")||0===p.indexOf("video/")){var j=r("Input");return f?o.a.createElement(j,{type:"file",onChange:function(e){d(e.target.files[0])}}):o.a.createElement("i",null,"Example values are not available for ",o.a.createElement("code",null,"application/octet-stream")," media types.")}if(T&&("application/x-www-form-urlencoded"===p||0===p.indexOf("multipart/"))&&O.get("properties",Object(i.OrderedMap)()).size>0){var P=r("JsonSchemaForm"),I=r("ParameterExt"),M=O.get("properties",Object(i.OrderedMap)());return n=i.Map.isMap(n)?n:Object(i.OrderedMap)(),o.a.createElement("div",{className:"table-container"},S&&o.a.createElement(g,{source:S}),o.a.createElement("table",null,o.a.createElement("tbody",null,M.map(function(e,t){var s=E?Object(a.j)(e):null,u=O.get("required",Object(i.List)()).includes(t),c=e.get("type"),p=e.get("format"),h=e.get("description"),m=n.get(t),v=e.get("default")||e.get("example")||"";""===v&&"object"===c&&(v=Object(a.m)(e,!1,{includeWriteOnly:!0})),"string"!=typeof v&&"object"===c&&(v=Object(a.G)(v));var y="string"===c&&("binary"===p||"base64"===p);return o.a.createElement("tr",{key:t,className:"parameters","data-property-name":t},o.a.createElement("td",{className:"parameters-col_name"},o.a.createElement("div",{className:u?"parameter__name required":"parameter__name"},t,u?o.a.createElement("span",{style:{color:"red"}}," *"):null),o.a.createElement("div",{className:"parameter__type"},c,p&&o.a.createElement("span",{className:"prop-format"},"($",p,")"),E&&s.size?s.map(function(e,t){return o.a.createElement(I,{key:"".concat(t,"-").concat(e),xKey:t,xVal:e})}):null),o.a.createElement("div",{className:"parameter__deprecated"},e.get("deprecated")?"deprecated":null)),o.a.createElement("td",{className:"parameters-col_description"},o.a.createElement(g,{source:h}),f?o.a.createElement("div",null,o.a.createElement(P,{fn:l,dispatchInitialValue:!y,schema:e,description:t,getComponent:r,value:void 0===m?v:m,onChange:function(e){d(e,[t])}})):null))}))))}return o.a.createElement("div",null,S&&o.a.createElement(g,{source:S}),A?o.a.createElement(w,{examples:A,currentKey:m,currentUserInputValue:n,onSelect:function(e){v(e)},updateValue:d,defaultToFirstExample:!0,getComponent:r}):null,f?o.a.createElement("div",null,o.a.createElement(b,{value:n,defaultValue:s(t,p,m),onChange:d,getComponent:r})):o.a.createElement(y,{getComponent:r,getConfigs:u,specSelectors:c,expandDepth:1,isExecute:f,schema:k.get("schema"),specPath:h.push("content",p),example:o.a.createElement(_,{className:"body-param__example",value:Object(a.G)(n)||s(t,p,m)})}),A?o.a.createElement(x,{example:A.get(m),getComponent:r}):null)}},function(e,t,n){"use strict";n.r(t);var r=n(28),o=n.n(r),i=n(4),a=n.n(i),s=n(5),u=n.n(s),c=n(6),l=n.n(c),p=n(7),f=n.n(p),h=n(8),d=n.n(h),m=n(0),v=n.n(m),g=(n(10),n(19),function(e){function t(){return a()(this,t),l()(this,f()(t).apply(this,arguments))}return d()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.link,n=e.name,r=(0,e.getComponent)("Markdown"),i=t.get("operationId")||t.get("operationRef"),a=t.get("parameters")&&t.get("parameters").toJS(),s=t.get("description");return v.a.createElement("div",{style:{marginBottom:"1.5em"}},v.a.createElement("div",{style:{marginBottom:".5em"}},v.a.createElement("b",null,v.a.createElement("code",null,n)),s?v.a.createElement(r,{source:s}):null),v.a.createElement("pre",null,"Operation `",i,"`",v.a.createElement("br",null),v.a.createElement("br",null),"Parameters ",function(e,t){if("string"!=typeof t)return"";return t.split("\n").map(function(t,n){return n>0?Array(e+1).join(" ")+t:t}).join("\n")}(0,o()(a,null,2))||"{}",v.a.createElement("br",null)))}}]),t}(m.Component));t.default=g},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return _});var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(9),f=n.n(p),h=n(8),d=n.n(h),m=n(2),v=n.n(m),g=n(0),y=n.n(g),b=n(1),_=(n(10),n(19),function(e){function t(){var e,n;o()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=u()(this,(e=l()(t)).call.apply(e,[this].concat(i))),v()(f()(n),"onServerChange",function(e){n.setServer(e.target.value)}),v()(f()(n),"onServerVariableValueChange",function(e){var t=n.props,r=t.setServerVariableValue,o=t.currentServer,i=e.target.getAttribute("data-variable"),a=e.target.value;"function"==typeof r&&r({server:o,key:i,val:a})}),v()(f()(n),"setServer",function(e){(0,n.props.setSelectedServer)(e)}),n}return d()(t,e),a()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.servers;e.currentServer||this.setServer(t.first().get("url"))}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.servers,r=t.setServerVariableValue,o=t.getServerVariable;if(this.props.currentServer!==e.currentServer){var i=n.find(function(t){return t.get("url")===e.currentServer});if(!i)return this.setServer(n.first().get("url"));(i.get("variables")||Object(b.OrderedMap)()).map(function(t,n){o(e.currentServer,n)||r({server:e.currentServer,key:n,val:t.get("default")||""})})}}},{key:"render",value:function(){var e=this,t=this.props,n=t.servers,r=t.currentServer,o=t.getServerVariable,i=t.getEffectiveServerValue,a=(n.find(function(e){return e.get("url")===r})||Object(b.OrderedMap)()).get("variables")||Object(b.OrderedMap)(),s=0!==a.size;return y.a.createElement("div",{className:"servers"},y.a.createElement("label",{htmlFor:"servers"},y.a.createElement("select",{onChange:this.onServerChange},n.valueSeq().map(function(e){return y.a.createElement("option",{value:e.get("url"),key:e.get("url")},e.get("url"),e.get("description")&&" - ".concat(e.get("description")))}).toArray())),s?y.a.createElement("div",null,y.a.createElement("div",{className:"computed-url"},"Computed URL:",y.a.createElement("code",null,i(r))),y.a.createElement("h4",null,"Server variables"),y.a.createElement("table",null,y.a.createElement("tbody",null,a.map(function(t,n){return y.a.createElement("tr",{key:n},y.a.createElement("td",null,n),y.a.createElement("td",null,t.get("enum")?y.a.createElement("select",{"data-variable":n,onChange:e.onServerVariableValueChange},t.get("enum").map(function(e){return y.a.createElement("option",{selected:e===o(r,n),key:e,value:e},e)})):y.a.createElement("input",{type:"text",value:o(r,n)||"",onChange:e.onServerVariableValueChange,"data-variable":n})))})))):null)}}]),t}(y.a.Component))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return m});var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(8),f=n.n(p),h=n(0),d=n.n(h),m=(n(10),function(e){function t(){return o()(this,t),u()(this,l()(t).apply(this,arguments))}return f()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.oas3Selectors,r=e.oas3Actions,o=e.getComponent,i=t.servers(),a=o("Servers");return i&&i.size?d.a.createElement("div",null,d.a.createElement("span",{className:"servers-title"},"Servers"),d.a.createElement(a,{servers:i,currentServer:n.selectedServer(),setSelectedServer:r.setSelectedServer,setServerVariableValue:r.setServerVariableValue,getServerVariable:n.serverVariableValue,getEffectiveServerValue:n.serverEffectiveValue})):null}}]),t}(d.a.Component))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return w});var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(9),f=n.n(p),h=n(8),d=n.n(h),m=n(2),v=n.n(m),g=n(0),y=n.n(g),b=(n(10),n(3)),_=Function.prototype,w=function(e){function t(e,n){var r;return o()(this,t),r=u()(this,l()(t).call(this,e,n)),v()(f()(r),"applyDefaultValue",function(e){var t=e||r.props,n=t.onChange,o=t.defaultValue;return r.setState({value:o}),n(o)}),v()(f()(r),"onChange",function(e){r.props.onChange(Object(b.G)(e))}),v()(f()(r),"onDomChange",function(e){var t=e.target.value;r.setState({value:t},function(){return r.onChange(t)})}),r.state={value:Object(b.G)(e.value)||e.defaultValue},e.onChange(e.value),r}return d()(t,e),a()(t,[{key:"componentWillReceiveProps",value:function(e){this.props.value!==e.value&&e.value!==this.state.value&&this.setState({value:Object(b.G)(e.value)}),!e.value&&e.defaultValue&&this.state.value&&this.applyDefaultValue(e)}},{key:"render",value:function(){var e=this.props.getComponent,t=this.state.value,n=e("TextArea");return y.a.createElement("div",{className:"body-param"},y.a.createElement(n,{className:"body-param__text",value:t,onChange:this.onDomChange}))}}]),t}(g.PureComponent);v()(w,"defaultProps",{onChange:_})},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return w});var r=n(16),o=n.n(r),i=n(4),a=n.n(i),s=n(5),u=n.n(s),c=n(6),l=n.n(c),p=n(7),f=n.n(p),h=n(9),d=n.n(h),m=n(8),v=n.n(m),g=n(2),y=n.n(g),b=n(0),_=n.n(b),w=(n(10),function(e){function t(e,n){var r;a()(this,t),r=l()(this,f()(t).call(this,e,n)),y()(d()(r),"onChange",function(e){var t=r.props.onChange,n=e.target,i=n.value,a=n.name,s=o()({},r.state.value);a?s[a]=i:s=i,r.setState({value:s},function(){return t(r.state)})});var i=r.props,s=i.name,u=i.schema,c=r.getValue();return r.state={name:s,schema:u,value:c},r}return v()(t,e),u()(t,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.errSelectors,o=e.name,i=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),c=n("Markdown"),l=n("JumpToPath",!0),p=(t.get("scheme")||"").toLowerCase(),f=this.getValue(),h=r.allErrors().filter(function(e){return e.get("authId")===o});if("basic"===p){var d=f?f.get("username"):null;return _.a.createElement("div",null,_.a.createElement("h4",null,_.a.createElement("code",null,o||t.get("name"))," (http, Basic)",_.a.createElement(l,{path:["securityDefinitions",o]})),d&&_.a.createElement("h6",null,"Authorized"),_.a.createElement(a,null,_.a.createElement(c,{source:t.get("description")})),_.a.createElement(a,null,_.a.createElement("label",null,"Username:"),d?_.a.createElement("code",null," ",d," "):_.a.createElement(s,null,_.a.createElement(i,{type:"text",required:"required",name:"username",onChange:this.onChange}))),_.a.createElement(a,null,_.a.createElement("label",null,"Password:"),d?_.a.createElement("code",null," ****** "):_.a.createElement(s,null,_.a.createElement(i,{required:"required",autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),h.valueSeq().map(function(e,t){return _.a.createElement(u,{error:e,key:t})}))}return"bearer"===p?_.a.createElement("div",null,_.a.createElement("h4",null,_.a.createElement("code",null,o||t.get("name"))," (http, Bearer)",_.a.createElement(l,{path:["securityDefinitions",o]})),f&&_.a.createElement("h6",null,"Authorized"),_.a.createElement(a,null,_.a.createElement(c,{source:t.get("description")})),_.a.createElement(a,null,_.a.createElement("label",null,"Value:"),f?_.a.createElement("code",null," ****** "):_.a.createElement(s,null,_.a.createElement(i,{type:"text",onChange:this.onChange}))),h.valueSeq().map(function(e,t){return _.a.createElement(u,{error:e,key:t})})):_.a.createElement("div",null,_.a.createElement("em",null,_.a.createElement("b",null,o)," HTTP authentication: unsupported scheme ","'".concat(p,"'")))}}]),t}(_.a.Component))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return I});var r=n(51),o=n.n(r),i=n(92),a=n.n(i),s=n(57),u=n.n(s),c=n(58),l=n.n(c),p=n(52),f=n.n(p),h=n(17),d=n.n(h),m=n(4),v=n.n(m),g=n(5),y=n.n(g),b=n(6),_=n.n(b),w=n(7),x=n.n(w),E=n(9),S=n.n(E),C=n(8),k=n.n(C),O=n(2),A=n.n(O),T=n(0),j=n.n(T);n(10),n(19);function P(e,t){var n=d()(e);if(f.a){var r=f()(e);t&&(r=r.filter(function(t){return l()(e,t).enumerable})),n.push.apply(n,r)}return n}var I=function(e){function t(){var e,n;v()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=_()(this,(e=x()(t)).call.apply(e,[this].concat(i))),A()(S()(n),"setSelectedServer",function(e){var t=n.props,r=t.path,o=t.method;return n.forceUpdate(),n.props.setSelectedServer(e,"".concat(r,":").concat(o))}),A()(S()(n),"setServerVariableValue",function(e){var t=n.props,r=t.path,i=t.method;return n.forceUpdate(),n.props.setServerVariableValue(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(n,!0).forEach(function(t){A()(e,t,n[t])}):u.a?a()(e,u()(n)):P(n).forEach(function(t){o()(e,t,l()(n,t))})}return e}({},e,{namespace:"".concat(r,":").concat(i)}))}),A()(S()(n),"getSelectedServer",function(){var e=n.props,t=e.path,r=e.method;return n.props.getSelectedServer("".concat(t,":").concat(r))}),A()(S()(n),"getServerVariable",function(e,t){var r=n.props,o=r.path,i=r.method;return n.props.getServerVariable({namespace:"".concat(o,":").concat(i),server:e},t)}),A()(S()(n),"getEffectiveServerValue",function(e){var t=n.props,r=t.path,o=t.method;return n.props.getEffectiveServerValue({server:e,namespace:"".concat(r,":").concat(o)})}),n}return k()(t,e),y()(t,[{key:"render",value:function(){var e=this.props,t=e.operationServers,n=e.pathServers,r=e.getComponent;if(!t&&!n)return null;var o=r("Servers"),i=t||n,a=t?"operation":"path";return j.a.createElement("div",{className:"opblock-section operation-servers"},j.a.createElement("div",{className:"opblock-section-header"},j.a.createElement("div",{className:"tab-header"},j.a.createElement("h4",{className:"opblock-title"},"Servers"))),j.a.createElement("div",{className:"opblock-description-wrapper"},j.a.createElement("h4",{className:"message"},"These ",a,"-level options override the global server options."),j.a.createElement(o,{servers:i,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}]),t}(j.a.Component)},function(e,t,n){"use strict";n.r(t);var r=n(312),o=n(313),i=n(314),a=n(315),s=n(316),u=n(317);t.default={Markdown:r.default,AuthItem:o.default,JsonSchema_string:u.default,VersionStamp:i.default,model:s.default,onlineValidatorBadge:a.default}},function(e,t,n){"use strict";n.r(t),n.d(t,"Markdown",function(){return f});var r=n(0),o=n.n(r),i=(n(10),n(56)),a=n.n(i),s=n(193),u=n.n(s),c=n(24),l=n(192),p=new u.a("commonmark");p.block.ruler.enable(["table"]),p.set({linkTarget:"_blank"});var f=function(e){var t=e.source,n=e.className,r=void 0===n?"":n;if("string"!=typeof t)return null;if(t){var i,s=p.render(t),u=Object(l.b)(s);return"string"==typeof u&&(i=u.trim()),o.a.createElement("div",{dangerouslySetInnerHTML:{__html:i},className:a()(r,"renderedMarkdown")})}return null};t.default=Object(c.OAS3ComponentWrapFactory)(f)},function(e,t,n){"use strict";n.r(t);var r=n(38),o=n.n(r),i=n(0),a=n.n(i),s=n(24);t.default=Object(s.OAS3ComponentWrapFactory)(function(e){var t=e.Ori,n=o()(e,["Ori"]),r=n.schema,i=n.getComponent,s=n.errSelectors,u=n.authorized,c=n.onAuthChange,l=n.name,p=i("HttpAuth");return"http"===r.get("type")?a.a.createElement(p,{key:l,schema:r,name:l,errSelectors:s,authorized:u,getComponent:i,onChange:c}):a.a.createElement(t,n)})},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=n(24);t.default=Object(i.OAS3ComponentWrapFactory)(function(e){var t=e.Ori;return o.a.createElement("span",null,o.a.createElement(t,e),o.a.createElement("small",{style:{backgroundColor:"#89bf04"}},o.a.createElement("pre",{className:"version"},"OAS3")))})},function(e,t,n){"use strict";n.r(t);var r=n(24);t.default=Object(r.OAS3ComponentWrapFactory)(function(){return null})},function(e,t,n){"use strict";n.r(t);var r=n(20),o=n.n(r),i=n(4),a=n.n(i),s=n(5),u=n.n(s),c=n(6),l=n.n(c),p=n(7),f=n.n(p),h=n(8),d=n.n(h),m=n(0),v=n.n(m),g=(n(10),n(24)),y=n(191),b=function(e){function t(){return a()(this,t),l()(this,f()(t).apply(this,arguments))}return d()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.getConfigs,n=["model-box"],r=null;return!0===e.schema.get("deprecated")&&(n.push("deprecated"),r=v.a.createElement("span",{className:"model-deprecated-warning"},"Deprecated:")),v.a.createElement("div",{className:n.join(" ")},r,v.a.createElement(y.a,o()({},this.props,{getConfigs:t,depth:1,expandDepth:this.props.expandDepth||0})))}}]),t}(m.Component);t.default=Object(g.OAS3ComponentWrapFactory)(b)},function(e,t,n){"use strict";n.r(t);var r=n(38),o=n.n(r),i=n(0),a=n.n(i),s=n(24);t.default=Object(s.OAS3ComponentWrapFactory)(function(e){var t=e.Ori,n=o()(e,["Ori"]),r=n.schema,i=n.getComponent,s=n.errors,u=n.onChange,c=r.type,l=r.format,p=i("Input");return"string"!==c||"binary"!==l&&"base64"!==l?a.a.createElement(t,n):a.a.createElement(p,{type:"file",className:s.length?"invalid":"",title:s.length?s:"",onChange:function(e){u(e.target.files[0])},disabled:t.isDisabled})})},function(e,t,n){"use strict";n.r(t),n.d(t,"selectedServer",function(){return a}),n.d(t,"requestBodyValue",function(){return s}),n.d(t,"activeExamplesMember",function(){return u}),n.d(t,"requestContentType",function(){return c}),n.d(t,"responseContentType",function(){return l}),n.d(t,"serverVariableValue",function(){return p}),n.d(t,"serverVariables",function(){return f}),n.d(t,"serverEffectiveValue",function(){return h});var r=n(1),o=n(24);function i(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(t){var r=t.getSystem().specSelectors.specJson();return Object(o.isOAS3)(r)?e.apply(void 0,n):null}}}var a=i(function(e,t){var n=t?[t,"selectedServer"]:["selectedServer"];return e.getIn(n)||""}),s=i(function(e,t,n){return e.getIn(["requestData",t,n,"bodyValue"])||null}),u=i(function(e,t,n,r,o){return e.getIn(["examples",t,n,r,o,"activeExample"])||null}),c=i(function(e,t,n){return e.getIn(["requestData",t,n,"requestContentType"])||null}),l=i(function(e,t,n){return e.getIn(["requestData",t,n,"responseContentType"])||null}),p=i(function(e,t,n){var r;if("string"!=typeof t){var o=t.server,i=t.namespace;r=i?[i,"serverVariableValues",o,n]:["serverVariableValues",o,n]}else{r=["serverVariableValues",t,n]}return e.getIn(r)||null}),f=i(function(e,t){var n;if("string"!=typeof t){var o=t.server,i=t.namespace;n=i?[i,"serverVariableValues",o]:["serverVariableValues",o]}else{n=["serverVariableValues",t]}return e.getIn(n)||Object(r.OrderedMap)()}),h=i(function(e,t){var n,o;if("string"!=typeof t){var i=t.server,a=t.namespace;o=i,n=a?e.getIn([a,"serverVariableValues",o]):e.getIn(["serverVariableValues",o])}else o=t,n=e.getIn(["serverVariableValues",o]);n=n||Object(r.OrderedMap)();var s=o;return n.map(function(e,t){s=s.replace(new RegExp("{".concat(t,"}"),"g"),e)}),s})},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(13),s=n.n(a),u=n(59);t.default=(r={},i()(r,u.UPDATE_SELECTED_SERVER,function(e,t){var n=t.payload,r=n.selectedServerUrl,o=n.namespace,i=o?[o,"selectedServer"]:["selectedServer"];return e.setIn(i,r)}),i()(r,u.UPDATE_REQUEST_BODY_VALUE,function(e,t){var n=t.payload,r=n.value,o=n.pathMethod,i=s()(o,2),a=i[0],u=i[1];return e.setIn(["requestData",a,u,"bodyValue"],r)}),i()(r,u.UPDATE_ACTIVE_EXAMPLES_MEMBER,function(e,t){var n=t.payload,r=n.name,o=n.pathMethod,i=n.contextType,a=n.contextName,u=s()(o,2),c=u[0],l=u[1];return e.setIn(["examples",c,l,i,a,"activeExample"],r)}),i()(r,u.UPDATE_REQUEST_CONTENT_TYPE,function(e,t){var n=t.payload,r=n.value,o=n.pathMethod,i=s()(o,2),a=i[0],u=i[1];return e.setIn(["requestData",a,u,"requestContentType"],r)}),i()(r,u.UPDATE_RESPONSE_CONTENT_TYPE,function(e,t){var n=t.payload,r=n.value,o=n.path,i=n.method;return e.setIn(["requestData",o,i,"responseContentType"],r)}),i()(r,u.UPDATE_SERVER_VARIABLE_VALUE,function(e,t){var n=t.payload,r=n.server,o=n.namespace,i=n.key,a=n.val,s=o?[o,"serverVariableValues",r,i]:["serverVariableValues",r,i];return e.setIn(s,a)}),r)},function(e,t,n){"use strict";n.r(t);var r=n(3),o=n(1020),i={};o.keys().forEach(function(e){if("./index.js"!==e){var t=o(e);i[Object(r.C)(e)]=t.default?t.default:t}}),t.default=i},function(e,t,n){"use strict";n.r(t);var r=n(144),o=n(117),i=n(288),a=n(289),s=n(290);n.d(t,"default",function(){return c});var u={getLocalConfig:function(){return Object(r.parseYamlConfig)('---\nurl: "https://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://validator.swagger.io/validator"\n')}};function c(){return{statePlugins:{spec:{actions:i,selectors:u},configs:{reducers:s.default,actions:o,selectors:a}}}}},function(e,t,n){"use strict";(function(e,r){var o,i=n(462);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var a=Object(i.a)(o);t.a=a}).call(this,n(42),n(581)(e))},function(e,t,n){"use strict";var r=n(391),o=n(393),i=n(689);e.exports=function(e){var t,a=r(arguments[1]);return a.normalizer||0!==(t=a.length=o(a.length,e.length,a.async))&&(a.primitive?!1===t?a.normalizer=n(716):t>1&&(a.normalizer=n(717)(t)):a.normalizer=!1===t?n(718)():1===t?n(722)():n(723)(t)),a.async&&n(724),a.promise&&n(725),a.dispose&&n(731),a.maxAge&&n(732),a.max&&n(735),a.refCounter&&n(737),i(e,a)}},function(e,t,n){e.exports=n(757)},function(e,t,n){var r=n(410);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},function(e,t,n){"use strict";t.__esModule=!0,t.connect=t.Provider=void 0;var r=i(n(876)),o=i(n(879));function i(e){return e&&e.__esModule?e:{default:e}}t.Provider=r.default,t.connect=o.default},function(e,t,n){e.exports=function(){"use strict";var e=Object.freeze||function(e){return e},t=e(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),n=e(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"]),r=e(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),o=e(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),i=e(["#text"]),a=Object.freeze||function(e){return e},s=a(["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","coords","crossorigin","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","integrity","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns"]),u=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),c=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),l=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),p=Object.hasOwnProperty,f=Object.setPrototypeOf,h=("undefined"!=typeof Reflect&&Reflect).apply;function d(e,t){f&&f(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=r.toLowerCase();o!==r&&(Object.isFrozen(t)||(t[n]=o),r=o)}e[r]=!0}return e}function m(e){var t={},n=void 0;for(n in e)h(p,e,[n])&&(t[n]=e[n]);return t}h||(h=function(e,t,n){return e.apply(t,n)});var v=Object.seal||function(e){return e},g=v(/\{\{[\s\S]*|[\s\S]*\}\}/gm),y=v(/<%[\s\S]*|[\s\S]*%>/gm),b=v(/^data-[\-\w.\u00B7-\uFFFF]/),_=v(/^aria-[\-\w]+$/),w=v(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),x=v(/^(?:\w+script|data):/i),E=v(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g),S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function C(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var k=("undefined"!=typeof Reflect&&Reflect).apply,O=Array.prototype.slice,A=Object.freeze,T=function(){return"undefined"==typeof window?null:window};k||(k=function(e,t,n){return e.apply(t,n)});var j=function(e,t){if("object"!==(void 0===e?"undefined":S(e))||"function"!=typeof e.createPolicy)return null;var n=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=t.currentScript.getAttribute("data-tt-policy-suffix"));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};return function e(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T(),p=function(t){return e(t)};if(p.version="1.0.11",p.removed=[],!a||!a.document||9!==a.document.nodeType)return p.isSupported=!1,p;var f=a.document,h=!1,v=!1,P=a.document,I=a.DocumentFragment,M=a.HTMLTemplateElement,N=a.Node,R=a.NodeFilter,D=a.NamedNodeMap,L=void 0===D?a.NamedNodeMap||a.MozNamedAttrMap:D,U=a.Text,q=a.Comment,F=a.DOMParser,z=a.TrustedTypes;if("function"==typeof M){var B=P.createElement("template");B.content&&B.content.ownerDocument&&(P=B.content.ownerDocument)}var V=j(z,f),H=V?V.createHTML(""):"",W=P,J=W.implementation,Y=W.createNodeIterator,K=W.getElementsByTagName,G=W.createDocumentFragment,$=f.importNode,Z={};p.isSupported=J&&void 0!==J.createHTMLDocument&&9!==P.documentMode;var X=g,Q=y,ee=b,te=_,ne=x,re=E,oe=w,ie=null,ae=d({},[].concat(C(t),C(n),C(r),C(o),C(i))),se=null,ue=d({},[].concat(C(s),C(u),C(c),C(l))),ce=null,le=null,pe=!0,fe=!0,he=!1,de=!1,me=!1,ve=!1,ge=!1,ye=!1,be=!1,_e=!1,we=!1,xe=!0,Ee=!0,Se=!1,Ce={},ke=d({},["audio","head","math","script","style","template","svg","video"]),Oe=d({},["audio","video","img","source","image"]),Ae=null,Te=d({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),je=null,Pe=P.createElement("form"),Ie=function(e){je&&je===e||(e&&"object"===(void 0===e?"undefined":S(e))||(e={}),ie="ALLOWED_TAGS"in e?d({},e.ALLOWED_TAGS):ae,se="ALLOWED_ATTR"in e?d({},e.ALLOWED_ATTR):ue,Ae="ADD_URI_SAFE_ATTR"in e?d({},e.ADD_URI_SAFE_ATTR):Te,ce="FORBID_TAGS"in e?d({},e.FORBID_TAGS):{},le="FORBID_ATTR"in e?d({},e.FORBID_ATTR):{},Ce="USE_PROFILES"in e&&e.USE_PROFILES,pe=!1!==e.ALLOW_ARIA_ATTR,fe=!1!==e.ALLOW_DATA_ATTR,he=e.ALLOW_UNKNOWN_PROTOCOLS||!1,de=e.SAFE_FOR_JQUERY||!1,me=e.SAFE_FOR_TEMPLATES||!1,ve=e.WHOLE_DOCUMENT||!1,be=e.RETURN_DOM||!1,_e=e.RETURN_DOM_FRAGMENT||!1,we=e.RETURN_DOM_IMPORT||!1,ye=e.FORCE_BODY||!1,xe=!1!==e.SANITIZE_DOM,Ee=!1!==e.KEEP_CONTENT,Se=e.IN_PLACE||!1,oe=e.ALLOWED_URI_REGEXP||oe,me&&(fe=!1),_e&&(be=!0),Ce&&(ie=d({},[].concat(C(i))),se=[],!0===Ce.html&&(d(ie,t),d(se,s)),!0===Ce.svg&&(d(ie,n),d(se,u),d(se,l)),!0===Ce.svgFilters&&(d(ie,r),d(se,u),d(se,l)),!0===Ce.mathMl&&(d(ie,o),d(se,c),d(se,l))),e.ADD_TAGS&&(ie===ae&&(ie=m(ie)),d(ie,e.ADD_TAGS)),e.ADD_ATTR&&(se===ue&&(se=m(se)),d(se,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&d(Ae,e.ADD_URI_SAFE_ATTR),Ee&&(ie["#text"]=!0),ve&&d(ie,["html","head","body"]),ie.table&&d(ie,["tbody"]),A&&A(e),je=e)},Me=function(e){p.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=H}},Ne=function(e,t){try{p.removed.push({attribute:t.getAttributeNode(e),from:t})}catch(e){p.removed.push({attribute:null,from:t})}t.removeAttribute(e)},Re=function(e){var t=void 0,n=void 0;if(ye)e="<remove></remove>"+e;else{var r=e.match(/^[\s]+/);(n=r&&r[0])&&(e=e.slice(n.length))}if(h)try{t=(new F).parseFromString(e,"text/html")}catch(e){}if(v&&d(ce,["title"]),!t||!t.documentElement){var o=t=J.createHTMLDocument(""),i=o.body;i.parentNode.removeChild(i.parentNode.firstElementChild),i.outerHTML=V?V.createHTML(e):e}return n&&t.body.insertBefore(P.createTextNode(n),t.body.childNodes[0]||null),K.call(t,ve?"html":"body")[0]};p.isSupported&&(function(){try{var e=Re('<svg><p><style><img src="</style><img src=x onerror=1//">');e.querySelector("svg img")&&(h=!0)}catch(e){}}(),function(){try{var e=Re("<x/><title></title><img>");e.querySelector("title").innerHTML.match(/<\/title/)&&(v=!0)}catch(e){}}());var De=function(e){return Y.call(e.ownerDocument||e,e,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT,function(){return R.FILTER_ACCEPT},!1)},Le=function(e){return"object"===(void 0===N?"undefined":S(N))?e instanceof N:e&&"object"===(void 0===e?"undefined":S(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Ue=function(e,t,n){Z[e]&&Z[e].forEach(function(e){e.call(p,t,n,je)})},qe=function(e){var t,n=void 0;if(Ue("beforeSanitizeElements",e,null),!((t=e)instanceof U||t instanceof q||"string"==typeof t.nodeName&&"string"==typeof t.textContent&&"function"==typeof t.removeChild&&t.attributes instanceof L&&"function"==typeof t.removeAttribute&&"function"==typeof t.setAttribute))return Me(e),!0;var r=e.nodeName.toLowerCase();if(Ue("uponSanitizeElement",e,{tagName:r,allowedTags:ie}),!ie[r]||ce[r]){if(Ee&&!ke[r]&&"function"==typeof e.insertAdjacentHTML)try{var o=e.innerHTML;e.insertAdjacentHTML("AfterEnd",V?V.createHTML(o):o)}catch(e){}return Me(e),!0}return"noscript"===r&&e.innerHTML.match(/<\/noscript/i)?(Me(e),!0):"noembed"===r&&e.innerHTML.match(/<\/noembed/i)?(Me(e),!0):(!de||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(p.removed.push({element:e.cloneNode()}),e.innerHTML?e.innerHTML=e.innerHTML.replace(/</g,"<"):e.innerHTML=e.textContent.replace(/</g,"<")),me&&3===e.nodeType&&(n=(n=(n=e.textContent).replace(X," ")).replace(Q," "),e.textContent!==n&&(p.removed.push({element:e.cloneNode()}),e.textContent=n)),Ue("afterSanitizeElements",e,null),!1)},Fe=function(e,t,n){if(xe&&("id"===t||"name"===t)&&(n in P||n in Pe))return!1;if(fe&&ee.test(t));else if(pe&&te.test(t));else{if(!se[t]||le[t])return!1;if(Ae[t]);else if(oe.test(n.replace(re,"")));else if("src"!==t&&"xlink:href"!==t||"script"===e||0!==n.indexOf("data:")||!Oe[e])if(he&&!ne.test(n.replace(re,"")));else if(n)return!1}return!0},ze=function(e){var t=void 0,n=void 0,r=void 0,o=void 0,i=void 0;Ue("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:se};for(i=a.length;i--;){var u=t=a[i],c=u.name,l=u.namespaceURI;if(n=t.value.trim(),r=c.toLowerCase(),s.attrName=r,s.attrValue=n,s.keepAttr=!0,Ue("uponSanitizeAttribute",e,s),n=s.attrValue,"name"===r&&"IMG"===e.nodeName&&a.id)o=a.id,a=k(O,a,[]),Ne("id",e),Ne(c,e),a.indexOf(o)>i&&e.setAttribute("id",o.value);else{if("INPUT"===e.nodeName&&"type"===r&&"file"===n&&s.keepAttr&&(se[r]||!le[r]))continue;"id"===c&&e.setAttribute(c,""),Ne(c,e)}if(s.keepAttr){me&&(n=(n=n.replace(X," ")).replace(Q," "));var f=e.nodeName.toLowerCase();if(Fe(f,r,n))try{l?e.setAttributeNS(l,c,n):e.setAttribute(c,n),p.removed.pop()}catch(e){}}}Ue("afterSanitizeAttributes",e,null)}},Be=function e(t){var n=void 0,r=De(t);for(Ue("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Ue("uponSanitizeShadowNode",n,null),qe(n)||(n.content instanceof I&&e(n.content),ze(n));Ue("afterSanitizeShadowDOM",t,null)};return p.sanitize=function(e,t){var n=void 0,r=void 0,o=void 0,i=void 0,s=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!Le(e)){if("function"!=typeof e.toString)throw new TypeError("toString is not a function");if("string"!=typeof(e=e.toString()))throw new TypeError("dirty is not a string, aborting")}if(!p.isSupported){if("object"===S(a.toStaticHTML)||"function"==typeof a.toStaticHTML){if("string"==typeof e)return a.toStaticHTML(e);if(Le(e))return a.toStaticHTML(e.outerHTML)}return e}if(ge||Ie(t),p.removed=[],Se);else if(e instanceof N)n=Re("\x3c!--\x3e"),1===(r=n.ownerDocument.importNode(e,!0)).nodeType&&"BODY"===r.nodeName?n=r:"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!be&&!me&&!ve&&-1===e.indexOf("<"))return V?V.createHTML(e):e;if(!(n=Re(e)))return be?null:H}n&&ye&&Me(n.firstChild);for(var u=De(Se?e:n);o=u.nextNode();)3===o.nodeType&&o===i||qe(o)||(o.content instanceof I&&Be(o.content),ze(o),i=o);if(i=null,Se)return e;if(be){if(_e)for(s=G.call(n.ownerDocument);n.firstChild;)s.appendChild(n.firstChild);else s=n;return we&&(s=$.call(f,s,!0)),s}var c=ve?n.outerHTML:n.innerHTML;return me&&(c=(c=c.replace(X," ")).replace(Q," ")),V?V.createHTML(c):c},p.setConfig=function(e){Ie(e),ge=!0},p.clearConfig=function(){je=null,ge=!1},p.isValidAttribute=function(e,t,n){je||Ie({});var r=e.toLowerCase(),o=t.toLowerCase();return Fe(r,o,n)},p.addHook=function(e,t){"function"==typeof t&&(Z[e]=Z[e]||[],Z[e].push(t))},p.removeHook=function(e){Z[e]&&Z[e].pop()},p.removeHooks=function(e){Z[e]&&(Z[e]=[])},p.removeAllHooks=function(){Z={}},p}()}()},function(e,t,n){var r=n(44),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){"use strict";var r=n(331)(!0);n(332)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var r=n(149),o=n(68);e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(i=s.charCodeAt(u))<55296||i>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):i:e?s.slice(u,u+2):a-56320+(i-55296<<10)+65536}}},function(e,t,n){"use strict";var r=n(333),o=n(39),i=n(95),a=n(76),s=n(124),u=n(487),c=n(198),l=n(493),p=n(33)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,d,m,v,g){u(n,t,d);var y,b,_,w=function(e){if(!f&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",E="values"==m,S=!1,C=e.prototype,k=C[p]||C["@@iterator"]||m&&C[m],O=k||w(m),A=m?E?w("entries"):O:void 0,T="Array"==t&&C.entries||k;if(T&&(_=l(T.call(new e)))!==Object.prototype&&_.next&&(c(_,x,!0),r||"function"==typeof _[p]||a(_,p,h)),E&&k&&"values"!==k.name&&(S=!0,O=function(){return k.call(this)}),r&&!g||!f&&!S&&C[p]||a(C,p,O),s[t]=O,s[x]=h,m)if(y={values:E?O:w("values"),keys:v?O:w("keys"),entries:A},g)for(b in y)b in C||i(C,b,y[b]);else o(o.P+o.F*(f||S),t,y);return y}},function(e,t){e.exports=!1},function(e,t,n){var r=n(490),o=n(336);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(149),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(44).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(77),o=n(151),i=n(33)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[i])?t:o(n)}},function(e,t,n){var r,o,i,a=n(150),s=n(505),u=n(337),c=n(196),l=n(44),p=l.process,f=l.setImmediate,h=l.clearImmediate,d=l.MessageChannel,m=l.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};f&&h||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},h=function(e){delete g[e]},"process"==n(121)(p)?r=function(e){p.nextTick(a(y,e,1))}:m&&m.now?r=function(e){m.now(a(y,e,1))}:d?(i=(o=new d).port2,o.port1.onmessage=b,r=a(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:f,clear:h}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(77),o=n(96),i=n(199);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var r=n(96),o=n(121),i=n(33)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(69),o=n(70),i=n(544)(!1),a=n(205)("IE_PROTO");e.exports=function(e,t){var n,s=o(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~i(c,n)||c.push(n));return c}},function(e,t,n){e.exports=!n(46)&&!n(80)(function(){return 7!=Object.defineProperty(n(209)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(47),o=n(45),i=n(126);e.exports=n(46)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(32).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(69),o=n(79),i=n(205)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r=n(32),o=n(69),i=n(46),a=n(30),s=n(212),u=n(132).KEY,c=n(80),l=n(206),p=n(131),f=n(155),h=n(34),d=n(213),m=n(214),v=n(554),g=n(215),y=n(45),b=n(41),_=n(79),w=n(70),x=n(210),E=n(130),S=n(156),C=n(555),k=n(159),O=n(157),A=n(47),T=n(126),j=k.f,P=A.f,I=C.f,M=r.Symbol,N=r.JSON,R=N&&N.stringify,D=h("_hidden"),L=h("toPrimitive"),U={}.propertyIsEnumerable,q=l("symbol-registry"),F=l("symbols"),z=l("op-symbols"),B=Object.prototype,V="function"==typeof M&&!!O.f,H=r.QObject,W=!H||!H.prototype||!H.prototype.findChild,J=i&&c(function(){return 7!=S(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=j(B,t);r&&delete B[t],P(e,t,n),r&&e!==B&&P(B,t,r)}:P,Y=function(e){var t=F[e]=S(M.prototype);return t._k=e,t},K=V&&"symbol"==typeof M.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof M},G=function(e,t,n){return e===B&&G(z,t,n),y(e),t=x(t,!0),y(n),o(F,t)?(n.enumerable?(o(e,D)&&e[D][t]&&(e[D][t]=!1),n=S(n,{enumerable:E(0,!1)})):(o(e,D)||P(e,D,E(1,{})),e[D][t]=!0),J(e,t,n)):P(e,t,n)},$=function(e,t){y(e);for(var n,r=v(t=w(t)),o=0,i=r.length;i>o;)G(e,n=r[o++],t[n]);return e},Z=function(e){var t=U.call(this,e=x(e,!0));return!(this===B&&o(F,e)&&!o(z,e))&&(!(t||!o(this,e)||!o(F,e)||o(this,D)&&this[D][e])||t)},X=function(e,t){if(e=w(e),t=x(t,!0),e!==B||!o(F,t)||o(z,t)){var n=j(e,t);return!n||!o(F,t)||o(e,D)&&e[D][t]||(n.enumerable=!0),n}},Q=function(e){for(var t,n=I(w(e)),r=[],i=0;n.length>i;)o(F,t=n[i++])||t==D||t==u||r.push(t);return r},ee=function(e){for(var t,n=e===B,r=I(n?z:w(e)),i=[],a=0;r.length>a;)!o(F,t=r[a++])||n&&!o(B,t)||i.push(F[t]);return i};V||(s((M=function(){if(this instanceof M)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===B&&t.call(z,n),o(this,D)&&o(this[D],e)&&(this[D][e]=!1),J(this,e,E(1,n))};return i&&W&&J(B,e,{configurable:!0,set:t}),Y(e)}).prototype,"toString",function(){return this._k}),k.f=X,A.f=G,n(216).f=C.f=Q,n(158).f=Z,O.f=ee,i&&!n(128)&&s(B,"propertyIsEnumerable",Z,!0),d.f=function(e){return Y(h(e))}),a(a.G+a.W+a.F*!V,{Symbol:M});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)h(te[ne++]);for(var re=T(h.store),oe=0;re.length>oe;)m(re[oe++]);a(a.S+a.F*!V,"Symbol",{for:function(e){return o(q,e+="")?q[e]:q[e]=M(e)},keyFor:function(e){if(!K(e))throw TypeError(e+" is not a symbol!");for(var t in q)if(q[t]===e)return t},useSetter:function(){W=!0},useSimple:function(){W=!1}}),a(a.S+a.F*!V,"Object",{create:function(e,t){return void 0===t?S(e):$(S(e),t)},defineProperty:G,defineProperties:$,getOwnPropertyDescriptor:X,getOwnPropertyNames:Q,getOwnPropertySymbols:ee});var ie=c(function(){O.f(1)});a(a.S+a.F*ie,"Object",{getOwnPropertySymbols:function(e){return O.f(_(e))}}),N&&a(a.S+a.F*(!V||c(function(){var e=M();return"[null]"!=R([e])||"{}"!=R({a:e})||"{}"!=R(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=t=r[1],(b(t)||void 0!==e)&&!K(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!K(t))return t}),r[1]=t,R.apply(N,r)}}),M.prototype[L]||n(71)(M.prototype,L,M.prototype.valueOf),p(M,"Symbol"),p(Math,"Math",!0),p(r.JSON,"JSON",!0)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=n(46),o=n(126),i=n(157),a=n(158),s=n(79),u=n(203),c=Object.assign;e.exports=!c||n(80)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=c({},e)[n]||Object.keys(c({},t)).join("")!=r})?function(e,t){for(var n=s(e),c=arguments.length,l=1,p=i.f,f=a.f;c>l;)for(var h,d=u(arguments[l++]),m=p?o(d).concat(p(d)):o(d),v=m.length,g=0;v>g;)h=m[g++],r&&!f.call(d,h)||(n[h]=d[h]);return n}:c},function(e,t,n){"use strict";var r=n(133),o=n(25),i=n(353),a=(n(354),n(161));n(15),n(566);function s(e,t,n){this.props=e,this.context=t,this.refs=a,this.updater=n||i}function u(e,t,n){this.props=e,this.context=t,this.refs=a,this.updater=n||i}function c(){}s.prototype.isReactComponent={},s.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&r("85"),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},s.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")},c.prototype=s.prototype,u.prototype=new c,u.prototype.constructor=u,o(u.prototype,s.prototype),u.prototype.isPureReactComponent=!0,e.exports={Component:s,PureComponent:u}},function(e,t,n){"use strict";n(23);var r={isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){},enqueueReplaceState:function(e,t){},enqueueSetState:function(e,t){}};e.exports=r},function(e,t,n){"use strict";e.exports=!1},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r=n(574);e.exports=function(e){return r(e,!1)}},function(e,t,n){"use strict";e.exports=n(575)},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e&&"@@redux/INIT"===e.type?"initialState argument passed to createStore":"previous state received by the reducer"},e.exports=t.default},function(e,t,n){var r=n(102),o=n(362),i=n(35),a=n(163),s=1/0,u=r?r.prototype:void 0,c=u?u.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-s?"-0":n}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(42))},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},function(e,t){e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}},function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},function(e,t){e.exports=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}},function(e,t,n){var r=n(81),o=n(49),i="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=r(e);return t==a||t==s||t==i||t==u}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(636),o=n(63);e.exports=function e(t,n,i,a,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,s))}},function(e,t,n){var r=n(637),o=n(370),i=n(640),a=1,s=2;e.exports=function(e,t,n,u,c,l){var p=n&a,f=e.length,h=t.length;if(f!=h&&!(p&&h>f))return!1;var d=l.get(e);if(d&&l.get(t))return d==t;var m=-1,v=!0,g=n&s?new r:void 0;for(l.set(e,t),l.set(t,e);++m<f;){var y=e[m],b=t[m];if(u)var _=p?u(b,y,m,t,e,l):u(y,b,m,e,t,l);if(void 0!==_){if(_)continue;v=!1;break}if(g){if(!o(t,function(e,t){if(!i(g,t)&&(y===e||c(y,e,n,u,l)))return g.push(t)})){v=!1;break}}else if(y!==b&&!c(y,b,n,u,l)){v=!1;break}}return l.delete(e),l.delete(t),v}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t,n){var r=n(48).Uint8Array;e.exports=r},function(e,t,n){var r=n(373),o=n(222),i=n(83);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(221),o=n(35);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(646),o=n(223),i=n(35),a=n(224),s=n(170),u=n(376),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),p=!n&&!l&&a(e),f=!n&&!l&&!p&&u(e),h=n||l||p||f,d=h?r(e.length,String):[],m=d.length;for(var v in e)!t&&!c.call(e,v)||h&&("length"==v||p&&("offset"==v||"parent"==v)||f&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,m))||d.push(v);return d}},function(e,t,n){var r=n(649),o=n(226),i=n(227),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(49);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},function(e,t,n){var r=n(660),o=n(661);e.exports=function(e,t){return null!=e&&o(e,t,r)}},function(e,t,n){var r=n(667);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t,n){var r=n(49),o=n(163),i=NaN,a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return i;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=u.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):s.test(e)?i:+e}},function(e,t,n){var r=n(669),o=n(672)(r);e.exports=o},function(e,t,n){var r=n(89),o=n(103),i=n(170),a=n(49);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?o(n)&&i(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},function(e,t,n){"use strict";(function(t,r){var o=n(174);e.exports=b;var i,a=n(350);b.ReadableState=y;n(230).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(386),c=n(175).Buffer,l=t.Uint8Array||function(){};var p=n(134);p.inherits=n(106);var f=n(675),h=void 0;h=f&&f.debuglog?f.debuglog("stream"):function(){};var d,m=n(676),v=n(387);p.inherits(b,u);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var r=t instanceof(i=i||n(84));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=n(389).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function b(e){if(i=i||n(84),!(this instanceof b))return new b(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function _(e,t,n,r,o){var i,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,S(e)}(e,a)):(o||(i=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),i?e.emit("error",i):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):k(e,a)):w(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function w(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&S(e)),k(e,t)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(e,t){this.push(null),t(e)},b.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=c.from(e,t),t=""),n=!0),_(this,e,t,!1,n)},b.prototype.unshift=function(e){return _(this,e,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(e){return d||(d=n(389).StringDecoder),this._readableState.decoder=new d(e),this._readableState.encoding=e,this};var x=8388608;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=x?e=x:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(C,e):C(e))}function C(e){h("emit readable"),e.emit("readable"),j(e)}function k(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(O,e,t))}function O(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function A(e){h("readable nexttick read 0"),e.read(0)}function T(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,o=n.data;e-=o.length;for(;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function N(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}b.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):S(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&I(this),null;var r,o=t.needReadable;return h("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",o=!0),t.ended||t.reading?h("reading or ended",o=!1):o&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(n,t))),null===(r=e>0?P(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&I(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:b;function c(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",p),e.removeListener("error",v),e.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",b),n.removeListener("data",m),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||p())}function l(){h("onend"),e.end()}i.endEmitted?o.nextTick(u):n.once("end",u),e.on("unpipe",c);var p=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,j(e))}}(n);e.on("drain",p);var f=!1;var d=!1;function m(t){h("ondata"),d=!1,!1!==e.write(t)||d||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==N(i.pipes,e))&&!f&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function v(t){h("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){h("onfinish"),e.removeListener("close",g),b()}function b(){h("unpipe"),n.unpipe(e)}return n.on("data",m),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",n),i.flowing||(h("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,n);return this}var a=N(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},b.prototype.on=function(e,t){var n=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&S(this):o.nextTick(A,this))}return n},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(T,e,t))}(this,e)),this},b.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",function(){if(h("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(h("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<g.length;i++)e.on(g[i],this.emit.bind(this,g[i]));return this._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=P}).call(this,n(42),n(72))},function(e,t,n){e.exports=n(230).EventEmitter},function(e,t,n){"use strict";var r=n(174);function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(678),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(42))},function(e,t,n){"use strict";var r=n(175).Buffer,o=r.isEncoding||function(e){switch((e=""+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}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=p,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var o=a(t[r]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--r<n||-2===o)return 0;if((o=a(t[r]))>=0)return o>0&&(e.lastNeed=o-2),o;if(--r<n||-2===o)return 0;if((o=a(t[r]))>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(84),o=n(134);function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);r.call(this,e),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush(function(t,n){u(e,t,n)}):u(this,null,null)}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}o.inherits=n(106),o.inherits(a,r),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){"use strict";var r=n(85),o=Array.prototype.forEach,i=Object.create,a=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=i(null);return o.call(arguments,function(e){r(e)&&a(Object(e),t)}),t}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var r=n(86);e.exports=function(e,t,n){var o;return isNaN(e)?(o=t)>=0?n&&o?o-1:o:1:!1!==e&&r(e)}},function(e,t,n){"use strict";e.exports=n(693)()?Object.assign:n(694)},function(e,t,n){"use strict";var r,o,i,a,s,u=n(86),c=function(e,t){return t};try{Object.defineProperty(c,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(e){}1===c.length?(r={configurable:!0,writable:!1,enumerable:!1},o=Object.defineProperty,e.exports=function(e,t){return t=u(t),e.length===t?e:(r.value=t,o(e,"length",r))}):(a=n(396),s=[],i=function(e){var t,n=0;if(s[e])return s[e];for(t=[];e--;)t.push("a"+(++n).toString(36));return new Function("fn","return function ("+t.join(", ")+") { return fn.apply(this, arguments); };")},e.exports=function(e,t){var n;if(t=u(t),e.length===t)return e;n=i(t)(e);try{a(n,e)}catch(e){}return n})},function(e,t,n){"use strict";var r=n(107),o=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;e.exports=function(e,t){var n,u=Object(r(t));if(e=Object(r(e)),a(u).forEach(function(r){try{o(e,r,i(t,r))}catch(e){n=e}}),"function"==typeof s&&s(u).forEach(function(r){try{o(e,r,i(t,r))}catch(e){n=e}}),void 0!==n)throw n;return e}},function(e,t,n){"use strict";var r=n(73),o=n(176),i=Function.prototype.call;e.exports=function(e,t){var n={},a=arguments[2];return r(t),o(e,function(e,r,o,s){n[r]=i.call(t,a,e,r,o,s)}),n}},function(e,t){e.exports=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}},function(e,t,n){var r=n(45);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(98),o=n(34)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){"use strict";var r=n(47),o=n(130);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},function(e,t,n){var r=n(34)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},function(e,t,n){var r=n(45),o=n(129),i=n(34)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[i])?t:o(n)}},function(e,t,n){var r,o,i,a=n(60),s=n(761),u=n(346),c=n(209),l=n(32),p=l.process,f=l.setImmediate,h=l.clearImmediate,d=l.MessageChannel,m=l.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};f&&h||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},h=function(e){delete g[e]},"process"==n(127)(p)?r=function(e){p.nextTick(a(y,e,1))}:m&&m.now?r=function(e){m.now(a(y,e,1))}:d?(i=(o=new d).port2,o.port1.onmessage=b,r=a(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:f,clear:h}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(45),o=n(41),i=n(237);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(32),o=n(22),i=n(47),a=n(46),s=n(34)("species");e.exports=function(e){var t="function"==typeof o[e]?o[e]:r[e];a&&t&&!t[s]&&i.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(110);e.exports=new r({include:[n(409)]})},function(e,t,n){"use strict";var r=n(110);e.exports=new r({include:[n(238)],implicit:[n(773),n(774),n(775),n(776)]})},function(e,t,n){var r=n(181),o=n(104),i=n(170),a=n(49),s=n(105);e.exports=function(e,t,n,u){if(!a(e))return e;for(var c=-1,l=(t=o(t,e)).length,p=l-1,f=e;null!=f&&++c<l;){var h=s(t[c]),d=n;if(c!=p){var m=f[h];void 0===(d=u?u(m,h,f):void 0)&&(d=a(m)?m:i(t[c+1])?[]:{})}r(f,h,d),f=f[h]}return e}},function(e,t,n){var r=n(412);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(82),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t,n){e.exports=n(794)},function(e,t,n){e.exports=n(797)},function(e,t,n){"use strict";e.exports={hasCachedChildNodes:1}},function(e,t,n){"use strict";var r=n(21);n(15);e.exports=function(e,t){return null==t&&r("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}},function(e,t,n){"use strict";e.exports=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}},function(e,t,n){"use strict";var r=n(36),o=null;e.exports=function(){return!o&&r.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}},function(e,t,n){"use strict";var r=n(21);var o=n(88),i=(n(15),function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._callbacks=null,this._contexts=null,this._arg=t}return e.prototype.enqueue=function(e,t){this._callbacks=this._callbacks||[],this._callbacks.push(e),this._contexts=this._contexts||[],this._contexts.push(t)},e.prototype.notifyAll=function(){var e=this._callbacks,t=this._contexts,n=this._arg;if(e&&t){e.length!==t.length&&r("24"),this._callbacks=null,this._contexts=null;for(var o=0;o<e.length;o++)e[o].call(t[o],n);e.length=0,t.length=0}},e.prototype.checkpoint=function(){return this._callbacks?this._callbacks.length:0},e.prototype.rollback=function(e){this._callbacks&&this._contexts&&(this._callbacks.length=e,this._contexts.length=e)},e.prototype.reset=function(){this._callbacks=null,this._contexts=null},e.prototype.destructor=function(){this.reset()},e}());e.exports=o.addPoolingTo(i)},function(e,t,n){"use strict";e.exports={logTopLevelRenders:!1}},function(e,t,n){"use strict";var r=n(27);function o(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===t||"radio"===t)}function i(e){return e._wrapperState.valueTracker}var a={_getTrackerFromNode:function(e){return i(r.getInstanceFromNode(e))},track:function(e){if(!i(e)){var t=r.getNodeFromInstance(e),n=o(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),s=""+t[n];t.hasOwnProperty(n)||"function"!=typeof a.get||"function"!=typeof a.set||(Object.defineProperty(t,n,{enumerable:a.enumerable,configurable:!0,get:function(){return a.get.call(this)},set:function(e){s=""+e,a.set.call(this,e)}}),function(e,t){e._wrapperState.valueTracker=t}(e,{getValue:function(){return s},setValue:function(e){s=""+e},stopTracking:function(){!function(e){e._wrapperState.valueTracker=null}(e),delete t[n]}}))}},updateValueIfChanged:function(e){if(!e)return!1;var t=i(e);if(!t)return a.track(e),!0;var n,s,u=t.getValue(),c=((n=r.getNodeFromInstance(e))&&(s=o(n)?""+n.checked:n.value),s);return c!==u&&(t.setValue(c),!0)},stopTracking:function(e){var t=i(e);t&&t.stopTracking()}};e.exports=a},function(e,t,n){"use strict";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=function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!r[e.type]:"textarea"===t}},function(e,t,n){"use strict";var r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};e.exports=r},function(e,t,n){"use strict";var r=n(36),o=n(185),i=n(184),a=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){3!==e.nodeType?i(e,o(t)):e.nodeValue=t})),e.exports=a},function(e,t,n){"use strict";e.exports=function(e){try{e.focus()}catch(e){}}},function(e,t,n){"use strict";var r={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};var o=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){o.forEach(function(t){r[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(t,e)]=r[e]})});var i={isUnitlessNumber:r,shorthandPropertyExpansions:{background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!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},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}}};e.exports=i},function(e,t,n){"use strict";var r=n(111),o=(n(27),n(50),n(828)),i=(n(23),new RegExp("^["+r.ATTRIBUTE_NAME_START_CHAR+"]["+r.ATTRIBUTE_NAME_CHAR+"]*$")),a={},s={};function u(e){return!!s.hasOwnProperty(e)||!a.hasOwnProperty(e)&&(i.test(e)?(s[e]=!0,!0):(a[e]=!0,!1))}function c(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&!1===t}var l={createMarkupForID:function(e){return r.ID_ATTRIBUTE_NAME+"="+o(e)},setAttributeForID:function(e,t){e.setAttribute(r.ID_ATTRIBUTE_NAME,t)},createMarkupForRoot:function(){return r.ROOT_ATTRIBUTE_NAME+'=""'},setAttributeForRoot:function(e){e.setAttribute(r.ROOT_ATTRIBUTE_NAME,"")},createMarkupForProperty:function(e,t){var n=r.properties.hasOwnProperty(e)?r.properties[e]:null;if(n){if(c(n,t))return"";var i=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&!0===t?i+'=""':i+"="+o(t)}return r.isCustomAttribute(e)?null==t?"":e+"="+o(t):null},createMarkupForCustomAttribute:function(e,t){return u(e)&&null!=t?e+"="+o(t):""},setValueForProperty:function(e,t,n){var o=r.properties.hasOwnProperty(t)?r.properties[t]:null;if(o){var i=o.mutationMethod;if(i)i(e,n);else{if(c(o,n))return void this.deleteValueForProperty(e,t);if(o.mustUseProperty)e[o.propertyName]=n;else{var a=o.attributeName,s=o.attributeNamespace;s?e.setAttributeNS(s,a,""+n):o.hasBooleanValue||o.hasOverloadedBooleanValue&&!0===n?e.setAttribute(a,""):e.setAttribute(a,""+n)}}}else if(r.isCustomAttribute(t))return void l.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){u(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForAttribute:function(e,t){e.removeAttribute(t)},deleteValueForProperty:function(e,t){var n=r.properties.hasOwnProperty(t)?r.properties[t]:null;if(n){var o=n.mutationMethod;if(o)o(e,void 0);else if(n.mustUseProperty){var i=n.propertyName;n.hasBooleanValue?e[i]=!1:e[i]=""}else e.removeAttribute(n.attributeName)}else r.isCustomAttribute(t)&&e.removeAttribute(t)}};e.exports=l},function(e,t,n){"use strict";var r=n(25),o=n(248),i=n(27),a=n(55),s=(n(23),!1);function u(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=o.getValue(e);null!=t&&c(this,Boolean(e.multiple),t)}}function c(e,t,n){var r,o,a=i.getNodeFromInstance(e).options;if(t){for(r={},o=0;o<n.length;o++)r[""+n[o]]=!0;for(o=0;o<a.length;o++){var s=r.hasOwnProperty(a[o].value);a[o].selected!==s&&(a[o].selected=s)}}else{for(r=""+n,o=0;o<a.length;o++)if(a[o].value===r)return void(a[o].selected=!0);a.length&&(a[0].selected=!0)}}var l={getHostProps:function(e,t){return r({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){var n=o.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=n?n:t.defaultValue,listeners:null,onChange:p.bind(e),wasMultiple:Boolean(t.multiple)},void 0===t.value||void 0===t.defaultValue||s||(s=!0)},getSelectValueContext:function(e){return e._wrapperState.initialValue},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var n=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var r=o.getValue(t);null!=r?(e._wrapperState.pendingUpdate=!1,c(e,Boolean(t.multiple),r)):n!==Boolean(t.multiple)&&(null!=t.defaultValue?c(e,Boolean(t.multiple),t.defaultValue):c(e,Boolean(t.multiple),t.multiple?[]:""))}};function p(e){var t=this._currentElement.props,n=o.executeOnChange(t,e);return this._rootNodeID&&(this._wrapperState.pendingUpdate=!0),a.asap(u,this),n}e.exports=l},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(837),a=n(431),s=n(432),u=(n(838),n(15),n(23),function(e){this.construct(e)});function c(e,t){var n;if(null===e||!1===e)n=a.create(c);else if("object"==typeof e){var o=e,i=o.type;if("function"!=typeof i&&"string"!=typeof i){var l="";0,l+=function(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}(o._owner),r("130",null==i?i:typeof i,l)}"string"==typeof o.type?n=s.createInternalComponent(o):!function(e){return"function"==typeof e&&void 0!==e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}(o.type)?n=new u(o):(n=new o.type(o)).getHostNode||(n.getHostNode=n.getNativeNode)}else"string"==typeof e||"number"==typeof e?n=s.createInstanceForText(e):r("131",typeof e);return n._mountIndex=0,n._mountImage=null,n}o(u.prototype,i,{_instantiateReactComponent:c}),e.exports=c},function(e,t,n){"use strict";var r=n(21),o=n(100),i=(n(15),{HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||!1===e?i.EMPTY:o.isValidElement(e)?"function"==typeof e.type?i.COMPOSITE:i.HOST:void r("26",e)}});e.exports=i},function(e,t,n){"use strict";var r,o={injectEmptyComponentFactory:function(e){r=e}},i={create:function(e){return r(e)}};i.injection=o,e.exports=i},function(e,t,n){"use strict";var r=n(21),o=(n(15),null),i=null;var a={createInternalComponent:function(e){return o||r("111",e.type),new o(e)},createInstanceForText:function(e){return new i(e)},isTextComponent:function(e){return e instanceof i},injection:{injectGenericComponentClass:function(e){o=e},injectTextComponentClass:function(e){i=e}}};e.exports=a},function(e,t,n){"use strict";var r=n(21),o=(n(62),n(839)),i=n(840),a=(n(15),n(252)),s=(n(23),"."),u=":";function c(e,t){return e&&"object"==typeof e&&null!=e.key?a.escape(e.key):t.toString(36)}e.exports=function(e,t,n){return null==e?0:function e(t,n,l,p){var f,h=typeof t;if("undefined"!==h&&"boolean"!==h||(t=null),null===t||"string"===h||"number"===h||"object"===h&&t.$$typeof===o)return l(p,t,""===n?s+c(t,0):n),1;var d=0,m=""===n?s:n+u;if(Array.isArray(t))for(var v=0;v<t.length;v++)d+=e(f=t[v],m+c(f,v),l,p);else{var g=i(t);if(g){var y,b=g.call(t);if(g!==t.entries)for(var _=0;!(y=b.next()).done;)d+=e(f=y.value,m+c(f,_++),l,p);else for(;!(y=b.next()).done;){var w=y.value;w&&(d+=e(f=w[1],m+a.escape(w[0])+u+c(f,0),l,p))}}else if("object"===h){var x=String(t);r("31","[object Object]"===x?"object with keys {"+Object.keys(t).join(", ")+"}":x,"")}}return d}(e,"",t,n)}},function(e,t,n){"use strict";var r,o,i,a,s,u,c,l=n(133),p=n(62);n(15),n(23);function f(e){var t=Function.prototype.toString,n=Object.prototype.hasOwnProperty,r=RegExp("^"+t.call(n).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");try{var o=t.call(e);return r.test(o)}catch(e){return!1}}if("function"==typeof Array.from&&"function"==typeof Map&&f(Map)&&null!=Map.prototype&&"function"==typeof Map.prototype.keys&&f(Map.prototype.keys)&&"function"==typeof Set&&f(Set)&&null!=Set.prototype&&"function"==typeof Set.prototype.keys&&f(Set.prototype.keys)){var h=new Map,d=new Set;r=function(e,t){h.set(e,t)},o=function(e){return h.get(e)},i=function(e){h.delete(e)},a=function(){return Array.from(h.keys())},s=function(e){d.add(e)},u=function(e){d.delete(e)},c=function(){return Array.from(d.keys())}}else{var m={},v={},g=function(e){return"."+e},y=function(e){return parseInt(e.substr(1),10)};r=function(e,t){var n=g(e);m[n]=t},o=function(e){var t=g(e);return m[t]},i=function(e){var t=g(e);delete m[t]},a=function(){return Object.keys(m).map(y)},s=function(e){var t=g(e);v[t]=!0},u=function(e){var t=g(e);delete v[t]},c=function(){return Object.keys(v).map(y)}}var b=[];function _(e){var t=o(e);if(t){var n=t.childIDs;i(e),n.forEach(_)}}function w(e,t,n){return"\n in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":n?" (created by "+n+")":"")}function x(e){return null==e?"#empty":"string"==typeof e||"number"==typeof e?"#text":"string"==typeof e.type?e.type:e.type.displayName||e.type.name||"Unknown"}function E(e){var t,n=S.getDisplayName(e),r=S.getElement(e),o=S.getOwnerID(e);return o&&(t=S.getDisplayName(o)),w(n,r&&r._source,t)}var S={onSetChildren:function(e,t){var n=o(e);n||l("144"),n.childIDs=t;for(var r=0;r<t.length;r++){var i=t[r],a=o(i);a||l("140"),null==a.childIDs&&"object"==typeof a.element&&null!=a.element&&l("141"),a.isMounted||l("71"),null==a.parentID&&(a.parentID=e),a.parentID!==e&&l("142",i,a.parentID,e)}},onBeforeMountComponent:function(e,t,n){r(e,{element:t,parentID:n,text:null,childIDs:[],isMounted:!1,updateCount:0})},onBeforeUpdateComponent:function(e,t){var n=o(e);n&&n.isMounted&&(n.element=t)},onMountComponent:function(e){var t=o(e);t||l("144"),t.isMounted=!0,0===t.parentID&&s(e)},onUpdateComponent:function(e){var t=o(e);t&&t.isMounted&&t.updateCount++},onUnmountComponent:function(e){var t=o(e);t&&(t.isMounted=!1,0===t.parentID&&u(e));b.push(e)},purgeUnmountedComponents:function(){if(!S._preventPurging){for(var e=0;e<b.length;e++){_(b[e])}b.length=0}},isMounted:function(e){var t=o(e);return!!t&&t.isMounted},getCurrentStackAddendum:function(e){var t="";if(e){var n=x(e),r=e._owner;t+=w(n,e._source,r&&r.getName())}var o=p.current,i=o&&o._debugID;return t+=S.getStackAddendumByID(i)},getStackAddendumByID:function(e){for(var t="";e;)t+=E(e),e=S.getParentID(e);return t},getChildIDs:function(e){var t=o(e);return t?t.childIDs:[]},getDisplayName:function(e){var t=S.getElement(e);return t?x(t):null},getElement:function(e){var t=o(e);return t?t.element:null},getOwnerID:function(e){var t=S.getElement(e);return t&&t._owner?t._owner._debugID:null},getParentID:function(e){var t=o(e);return t?t.parentID:null},getSource:function(e){var t=o(e),n=t?t.element:null;return null!=n?n._source:null},getText:function(e){var t=S.getElement(e);return"string"==typeof t?t:"number"==typeof t?""+t:null},getUpdateCount:function(e){var t=o(e);return t?t.updateCount:0},getRootIDs:c,getRegisteredIDs:a,pushNonStandardWarningStack:function(e,t){if("function"==typeof console.reactStack){var n=[],r=p.current,o=r&&r._debugID;try{for(e&&n.push({name:o?S.getDisplayName(o):null,fileName:t?t.fileName:null,lineNumber:t?t.lineNumber:null});o;){var i=S.getElement(o),a=S.getParentID(o),s=S.getOwnerID(o),u=s?S.getDisplayName(s):null,c=i&&i._source;n.push({name:u,fileName:c?c.fileName:null,lineNumber:c?c.lineNumber:null}),o=a}}catch(e){}console.reactStack(n)}},popNonStandardWarningStack:function(){"function"==typeof console.reactStackEnd&&console.reactStackEnd()}};e.exports=S},function(e,t,n){"use strict";var r=n(54),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=o},function(e,t,n){"use strict";var r=n(852),o=n(854),i=n(425),a=n(437);var s={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=a();return{focusedElem:e,selectionRange:s.hasSelectionCapabilities(e)?s.getSelection(e):null}},restoreSelection:function(e){var t,n=a(),r=e.focusedElem,u=e.selectionRange;n!==r&&(t=r,o(document.documentElement,t))&&(s.hasSelectionCapabilities(r)&&s.setSelection(r,u),i(r))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,o=t.end;if(void 0===o&&(o=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(o,e.value.length);else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",o-n),i.select()}else r.setOffsets(e,t)}};e.exports=s},function(e,t,n){"use strict";e.exports=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}},function(e,t,n){"use strict";var r=n(21),o=n(113),i=n(111),a=n(100),s=n(186),u=(n(62),n(27)),c=n(869),l=n(870),p=n(420),f=n(140),h=(n(50),n(871)),d=n(112),m=n(253),v=n(55),g=n(161),y=n(429),b=(n(15),n(184)),_=n(251),w=(n(23),i.ID_ATTRIBUTE_NAME),x=i.ROOT_ATTRIBUTE_NAME,E=1,S=9,C=11,k={};function O(e){return e?e.nodeType===S?e.documentElement:e.firstChild:null}function A(e,t,n,r,o){var i;if(p.logTopLevelRenders){var a=e._currentElement.props.child.type;i="React mount: "+("string"==typeof a?a:a.displayName||a.name),console.time(i)}var s=d.mountComponent(e,n,null,c(e,t),o,0);i&&console.timeEnd(i),e._renderedComponent._topLevelWrapper=e,D._mountImageIntoNode(s,t,e,r,n)}function T(e,t,n,r){var o=v.ReactReconcileTransaction.getPooled(!n&&l.useCreateElement);o.perform(A,null,e,t,o,n,r),v.ReactReconcileTransaction.release(o)}function j(e,t,n){for(0,d.unmountComponent(e,n),t.nodeType===S&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function P(e){var t=O(e);if(t){var n=u.getInstanceFromNode(t);return!(!n||!n._hostParent)}}function I(e){return!(!e||e.nodeType!==E&&e.nodeType!==S&&e.nodeType!==C)}function M(e){var t=function(e){var t=O(e),n=t&&u.getInstanceFromNode(t);return n&&!n._hostParent?n:null}(e);return t?t._hostContainerInfo._topLevelWrapper:null}var N=1,R=function(){this.rootID=N++};R.prototype.isReactComponent={},R.prototype.render=function(){return this.props.child},R.isReactTopLevelWrapper=!0;var D={TopLevelWrapper:R,_instancesByReactRootID:k,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r,o){return D.scrollMonitor(r,function(){m.enqueueElementInternal(e,t,n),o&&m.enqueueCallbackInternal(e,o)}),e},_renderNewRootComponent:function(e,t,n,o){I(t)||r("37"),s.ensureScrollValueMonitoring();var i=y(e,!1);v.batchedUpdates(T,i,t,n,o);var a=i._instance.rootID;return k[a]=i,i},renderSubtreeIntoContainer:function(e,t,n,o){return null!=e&&f.has(e)||r("38"),D._renderSubtreeIntoContainer(e,t,n,o)},_renderSubtreeIntoContainer:function(e,t,n,o){m.validateCallback(o,"ReactDOM.render"),a.isValidElement(t)||r("39","string"==typeof t?" Instead of passing a string like 'div', pass React.createElement('div') or <div />.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or <Foo />.":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var i,s=a.createElement(R,{child:t});if(e){var u=f.get(e);i=u._processChildContext(u._context)}else i=g;var c=M(n);if(c){var l=c._currentElement.props.child;if(_(l,t)){var p=c._renderedComponent.getPublicInstance(),h=o&&function(){o.call(p)};return D._updateRootComponent(c,s,i,n,h),p}D.unmountComponentAtNode(n)}var d,v=O(n),y=v&&!(!(d=v).getAttribute||!d.getAttribute(w)),b=P(n),x=y&&!c&&!b,E=D._renderNewRootComponent(s,n,x,i)._renderedComponent.getPublicInstance();return o&&o.call(E),E},render:function(e,t,n){return D._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){I(e)||r("40");var t=M(e);if(!t){P(e),1===e.nodeType&&e.hasAttribute(x);return!1}return delete k[t._instance.rootID],v.batchedUpdates(j,t,e,!1),!0},_mountImageIntoNode:function(e,t,n,i,a){if(I(t)||r("41"),i){var s=O(t);if(h.canReuseMarkup(e,s))return void u.precacheNode(n,s);var c=s.getAttribute(h.CHECKSUM_ATTR_NAME);s.removeAttribute(h.CHECKSUM_ATTR_NAME);var l=s.outerHTML;s.setAttribute(h.CHECKSUM_ATTR_NAME,c);var p=e,f=function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}(p,l),d=" (client) "+p.substring(f-20,f+20)+"\n (server) "+l.substring(f-20,f+20);t.nodeType===S&&r("42",d)}if(t.nodeType===S&&r("43"),a.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);o.insertTreeBefore(t,e,null)}else b(t,e),u.precacheNode(n,t.firstChild)}};e.exports=D},function(e,t,n){"use strict";var r=n(430);e.exports=function(e){for(var t;(t=e._renderedNodeType)===r.COMPOSITE;)e=e._renderedComponent;return t===r.HOST?e._renderedComponent:t===r.EMPTY?null:void 0}},function(e,t,n){e.exports=n(877)()},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(440),i=(r=o)&&r.__esModule?r:{default:r};t.default=i.default.shape({subscribe:i.default.func.isRequired,dispatch:i.default.func.isRequired,getState:i.default.func.isRequired})},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}},function(e,t,n){var r=n(220),o=n(884),i=n(181),a=n(885),s=n(886),u=n(889),c=n(890),l=n(891),p=n(892),f=n(372),h=n(446),d=n(172),m=n(893),v=n(894),g=n(899),y=n(35),b=n(224),_=n(901),w=n(49),x=n(903),E=n(83),S=1,C=2,k=4,O="[object Arguments]",A="[object Function]",T="[object GeneratorFunction]",j="[object Object]",P={};P[O]=P["[object Array]"]=P["[object ArrayBuffer]"]=P["[object DataView]"]=P["[object Boolean]"]=P["[object Date]"]=P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Map]"]=P["[object Number]"]=P[j]=P["[object RegExp]"]=P["[object Set]"]=P["[object String]"]=P["[object Symbol]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P["[object Error]"]=P[A]=P["[object WeakMap]"]=!1,e.exports=function e(t,n,I,M,N,R){var D,L=n&S,U=n&C,q=n&k;if(I&&(D=N?I(t,M,N,R):I(t)),void 0!==D)return D;if(!w(t))return t;var F=y(t);if(F){if(D=m(t),!L)return c(t,D)}else{var z=d(t),B=z==A||z==T;if(b(t))return u(t,L);if(z==j||z==O||B&&!N){if(D=U||B?{}:g(t),!L)return U?p(t,s(D,t)):l(t,a(D,t))}else{if(!P[z])return N?t:{};D=v(t,z,L)}}R||(R=new r);var V=R.get(t);if(V)return V;R.set(t,D),x(t)?t.forEach(function(r){D.add(e(r,n,I,r,t,R))}):_(t)&&t.forEach(function(r,o){D.set(o,e(r,n,I,o,t,R))});var H=q?U?h:f:U?keysIn:E,W=F?void 0:H(t);return o(W||t,function(r,o){W&&(r=t[o=r]),i(D,o,e(r,n,I,o,t,R))}),D}},function(e,t,n){var r=n(375),o=n(887),i=n(103);e.exports=function(e){return i(e)?r(e,!0):o(e)}},function(e,t,n){var r=n(221),o=n(257),i=n(222),a=n(374),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=s},function(e,t,n){var r=n(373),o=n(445),i=n(444);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(909),o=n(448),i=n(449);e.exports=function(e){return i(o(e,void 0,r),e+"")}},function(e,t,n){var r=n(912),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),u=Array(s);++a<s;)u[a]=i[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=i[a];return c[t]=n(u),r(e,this,c)}}},function(e,t,n){var r=n(913),o=n(915)(r);e.exports=o},function(e,t,n){var r={strict:!0},o=n(926),i=function(e,t){return o(e,t,r)},a=n(259);t.JsonPatchError=a.PatchError,t.deepClone=a._deepClone;var s={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=c(n,this.path);r&&(r=a._deepClone(r));var o=l(n,{op:"remove",path:this.from}).removed;return l(n,{op:"add",path:this.path,value:o}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=c(n,this.from);return l(n,{op:"add",path:this.path,value:a._deepClone(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:i(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},u={add:function(e,t,n){return a.isInteger(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:s.move,copy:s.copy,test:s.test,_get:s._get};function c(e,t){if(""==t)return e;var n={op:"_get",path:t};return l(e,n),n.value}function l(e,n,r,o,l,p){if(void 0===r&&(r=!1),void 0===o&&(o=!0),void 0===l&&(l=!0),void 0===p&&(p=0),r&&("function"==typeof r?r(n,0,e,n.path):f(n,0)),""===n.path){var h={newDocument:e};if("add"===n.op)return h.newDocument=n.value,h;if("replace"===n.op)return h.newDocument=n.value,h.removed=e,h;if("move"===n.op||"copy"===n.op)return h.newDocument=c(e,n.from),"move"===n.op&&(h.removed=e),h;if("test"===n.op){if(h.test=i(e,n.value),!1===h.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",p,n,e);return h.newDocument=e,h}if("remove"===n.op)return h.removed=e,h.newDocument=null,h;if("_get"===n.op)return n.value=e,h;if(r)throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",p,n,e);return h}o||(e=a._deepClone(e));var d=(n.path||"").split("/"),m=e,v=1,g=d.length,y=void 0,b=void 0,_=void 0;for(_="function"==typeof r?r:f;;){if(b=d[v],l&&"__proto__"==b)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&void 0===y&&(void 0===m[b]?y=d.slice(0,v).join("/"):v==g-1&&(y=n.path),void 0!==y&&_(n,0,e,y)),v++,Array.isArray(m)){if("-"===b)b=m.length;else{if(r&&!a.isInteger(b))throw new t.JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",p,n,e);a.isInteger(b)&&(b=~~b)}if(v>=g){if(r&&"add"===n.op&&b>m.length)throw new t.JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",p,n,e);if(!1===(h=u[n.op].call(n,m,b,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",p,n,e);return h}}else if(b&&-1!=b.indexOf("~")&&(b=a.unescapePathComponent(b)),v>=g){if(!1===(h=s[n.op].call(n,m,b,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",p,n,e);return h}m=m[b]}}function p(e,n,r,o,i){if(void 0===o&&(o=!0),void 0===i&&(i=!0),r&&!Array.isArray(n))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");o||(e=a._deepClone(e));for(var s=new Array(n.length),u=0,c=n.length;u<c;u++)s[u]=l(e,n[u],r,!0,i,u),e=s[u].newDocument;return s.newDocument=e,s}function f(e,n,r,o){if("object"!=typeof e||null===e||Array.isArray(e))throw new t.JsonPatchError("Operation is not an object","OPERATION_NOT_AN_OBJECT",n,e,r);if(!s[e.op])throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",n,e,r);if("string"!=typeof e.path)throw new t.JsonPatchError("Operation `path` property is not a string","OPERATION_PATH_INVALID",n,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new t.JsonPatchError('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",n,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new t.JsonPatchError("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",n,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",n,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&a.hasUndefined(e.value))throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",n,e,r);if(r)if("add"==e.op){var i=e.path.split("/").length,u=o.split("/").length;if(i!==u+1&&i!==u)throw new t.JsonPatchError("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",n,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==o)throw new t.JsonPatchError("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",n,e,r)}else if("move"===e.op||"copy"===e.op){var c=h([{op:"_get",path:e.from,value:void 0}],r);if(c&&"OPERATION_PATH_UNRESOLVABLE"===c.name)throw new t.JsonPatchError("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",n,e,r)}}function h(e,n,r){try{if(!Array.isArray(e))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(n)p(a._deepClone(n),a._deepClone(e),r||!0);else{r=r||f;for(var o=0;o<e.length;o++)r(e[o],o,n,void 0)}}catch(e){if(e instanceof t.JsonPatchError)return e;throw e}}t.getValueByPointer=c,t.applyOperation=l,t.applyPatch=p,t.applyReducer=function(e,n,r){var o=l(e,n);if(!1===o.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",r,n,e);return o.newDocument},t.validator=f,t.validate=h},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o=Array.isArray,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],a=i.obj[i.prop],s=Object.keys(a),u=0;u<s.length;++u){var c=s[u],l=a[c];"object"==typeof l&&null!==l&&-1===n.indexOf(l)&&(t.push({obj:a,prop:c}),n.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n){if(0===e.length)return e;var r="string"==typeof e?e:String(e);if("iso-8859-1"===n)return escape(r).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var o="",a=0;a<r.length;++a){var s=r.charCodeAt(a);45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122?o+=r.charAt(a):s<128?o+=i[s]:s<2048?o+=i[192|s>>6]+i[128|63&s]:s<55296||s>=57344?o+=i[224|s>>12]+i[128|s>>6&63]+i[128|63&s]:(a+=1,s=65536+((1023&s)<<10|1023&r.charCodeAt(a)),o+=i[240|s>>18]+i[128|s>>12&63]+i[128|s>>6&63]+i[128|63&s])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,i){if(!n)return t;if("object"!=typeof n){if(o(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(i&&(i.plainObjects||i.allowPrototypes)||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var s=t;return o(t)&&!o(n)&&(s=a(t,i)),o(t)&&o(n)?(n.forEach(function(n,o){if(r.call(t,o)){var a=t[o];a&&"object"==typeof a&&n&&"object"==typeof n?t[o]=e(a,n,i):t.push(n)}else t[o]=n}),t):Object.keys(n).reduce(function(t,o){var a=n[o];return r.call(t,o)?t[o]=e(t[o],a,i):t[o]=a,t},s)}}},function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){"use strict";var r=n(32),o=n(30),i=n(132),a=n(80),s=n(71),u=n(179),c=n(108),l=n(178),p=n(41),f=n(131),h=n(47).f,d=n(260)(0),m=n(46);e.exports=function(e,t,n,v,g,y){var b=r[e],_=b,w=g?"set":"add",x=_&&_.prototype,E={};return m&&"function"==typeof _&&(y||x.forEach&&!a(function(){(new _).entries().next()}))?(_=t(function(t,n){l(t,_,e,"_c"),t._c=new b,null!=n&&c(n,g,t[w],t)}),d("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in x&&(!y||"clear"!=e)&&s(_.prototype,e,function(n,r){if(l(this,_,e),!t&&y&&!p(n))return"get"==e&&void 0;var o=this._c[e](0===n?0:n,r);return t?this:o})}),y||h(_.prototype,"size",{get:function(){return this._c.size}})):(_=v.getConstructor(t,e,g,w),u(_.prototype,n),i.NEED=!0),f(_,e),E[e]=_,o(o.G+o.W+o.F,E),y||v.setStrong(_,e,g),_}},function(e,t,n){"use strict";var r=n(30);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){"use strict";var r=n(30),o=n(129),i=n(60),a=n(108);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,s,u=arguments[1];return o(this),(t=void 0!==u)&&o(u),null==e?new this:(n=[],t?(r=0,s=i(u,arguments[2],2),a(e,!1,function(e){n.push(s(e,r++))})):a(e,!1,n.push,n),new this(n))}})}},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwcHgiICBoZWlnaHQ9IjIwMHB4IiAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiIGNsYXNzPSJsZHMtcm9sbGluZyIgc3R5bGU9ImJhY2tncm91bmQtaW1hZ2U6IG5vbmU7IGJhY2tncm91bmQtcG9zaXRpb246IGluaXRpYWwgaW5pdGlhbDsgYmFja2dyb3VuZC1yZXBlYXQ6IGluaXRpYWwgaW5pdGlhbDsiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIGZpbGw9Im5vbmUiIG5nLWF0dHItc3Ryb2tlPSJ7e2NvbmZpZy5jb2xvcn19IiBuZy1hdHRyLXN0cm9rZS13aWR0aD0ie3tjb25maWcud2lkdGh9fSIgbmctYXR0ci1yPSJ7e2NvbmZpZy5yYWRpdXN9fSIgbmctYXR0ci1zdHJva2UtZGFzaGFycmF5PSJ7e2NvbmZpZy5kYXNoYXJyYXl9fSIgc3Ryb2tlPSIjNTU1NTU1IiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij48YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgY2FsY01vZGU9ImxpbmVhciIgdmFsdWVzPSIwIDUwIDUwOzM2MCA1MCA1MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49IjBzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlVHJhbnNmb3JtPjwvY2lyY2xlPjwvc3ZnPgo="},function(e,t,n){"use strict";e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",GT:">",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}},function(e,t,n){"use strict";var r=n(459),o=n(37).unescapeMd;e.exports=function(e,t){var n,i,a,s=t,u=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;t<u;){if(10===(n=e.src.charCodeAt(t)))return!1;if(62===n)return a=r(o(e.src.slice(s+1,t))),!!e.parser.validateLink(a)&&(e.pos=t+1,e.linkContent=a,!0);92===n&&t+1<u?t+=2:t++}return!1}for(i=0;t<u&&32!==(n=e.src.charCodeAt(t))&&!(n<32||127===n);)if(92===n&&t+1<u)t+=2;else{if(40===n&&++i>1)break;if(41===n&&--i<0)break;t++}return s!==t&&(a=o(e.src.slice(s,t)),!!e.parser.validateLink(a)&&(e.linkContent=a,e.pos=t,!0))}},function(e,t,n){"use strict";var r=n(37).replaceEntities;e.exports=function(e){var t=r(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}},function(e,t,n){"use strict";var r=n(37).unescapeMd;e.exports=function(e,t){var n,o=t,i=e.posMax,a=e.src.charCodeAt(t);if(34!==a&&39!==a&&40!==a)return!1;for(t++,40===a&&(a=41);t<i;){if((n=e.src.charCodeAt(t))===a)return e.pos=t+1,e.linkContent=r(e.src.slice(o+1,t)),!0;92===n&&t+1<i?t+=2:t++}return!1}},function(e,t,n){"use strict";e.exports=function(e){return e.trim().replace(/\s+/g," ").toUpperCase()}},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(this,n(42))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineReducers=void 0;var r,o=n(582),i=(r=o)&&r.__esModule?r:{default:r};t.combineReducers=i.default},function(e,t,n){"use strict";var r=/^(%20|\s)*(javascript|data)/im,o=/[^\x20-\x7E]/gim,i=/^([^:]+):/gm,a=[".","/"];e.exports={sanitizeUrl:function(e){var t,n,s=e.replace(o,"");return function(e){return a.indexOf(e[0])>-1}(s)?s:(n=s.match(i))?(t=n[0],r.test(t)?"about:blank":s):"about:blank"}}},function(e,t,n){var r=n(591),o=n(599)(function(e,t,n){return t=t.toLowerCase(),e+(n?r(t):t)});e.exports=o},function(e,t,n){var r=n(370),o=n(168),i=n(668),a=n(35),s=n(384);e.exports=function(e,t,n){var u=a(e)?r:i;return n&&s(e,t,n)&&(t=void 0),u(e,o(t,3))}},function(e,t,n){(function(t){var r=n(673),o=n(674).Stream,i=" ";function a(e,t,n){n=n||0;var o,i,s=(o=t,new Array(n||0).join(o||"")),u=e;if("object"==typeof e&&((u=e[i=Object.keys(e)[0]])&&u._elem))return u._elem.name=i,u._elem.icount=n,u._elem.indent=t,u._elem.indents=s,u._elem.interrupt=u,u._elem;var c,l=[],p=[];function f(e){Object.keys(e).forEach(function(t){l.push(function(e,t){return e+'="'+r(t)+'"'}(t,e[t]))})}switch(typeof u){case"object":if(null===u)break;u._attr&&f(u._attr),u._cdata&&p.push(("<![CDATA["+u._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),u.forEach&&(c=!1,p.push(""),u.forEach(function(e){"object"==typeof e?"_attr"==Object.keys(e)[0]?f(e._attr):p.push(a(e,t,n+1)):(p.pop(),c=!0,p.push(r(e)))}),c||p.push(""));break;default:p.push(r(u))}return{name:i,interrupt:!1,attributes:l,content:p,icount:n,indents:s,indent:t}}function s(e,t,n){if("object"!=typeof t)return e(!1,t);var r=t.interrupt?1:t.content.length;function o(){for(;t.content.length;){var o=t.content.shift();if(void 0!==o){if(i(o))return;s(e,o)}}e(!1,(r>1?t.indents:"")+(t.name?"</"+t.name+">":"")+(t.indent&&!n?"\n":"")),n&&n()}function i(t){return!!t.interrupt&&(t.interrupt.append=e,t.interrupt.end=o,t.interrupt=!1,e(!0),!0)}if(e(!1,t.indents+(t.name?"<"+t.name:"")+(t.attributes.length?" "+t.attributes.join(" "):"")+(r?t.name?">":"":t.name?"/>":"")+(t.indent&&r>1?"\n":"")),!r)return e(!1,t.indent?"\n":"");i(t)||o()}e.exports=function(e,n){"object"!=typeof n&&(n={indent:n});var r,u,c=n.stream?new o:null,l="",p=!1,f=n.indent?!0===n.indent?i:n.indent:"",h=!0;function d(e){h?t.nextTick(e):e()}function m(e,t){if(void 0!==t&&(l+=t),e&&!p&&(c=c||new o,p=!0),e&&p){var n=l;d(function(){c.emit("data",n)}),l=""}}function v(e,t){s(m,a(e,f,f?1:0),t)}function g(){if(c){var e=l;d(function(){c.emit("data",e),c.emit("end"),c.readable=!1,c.emit("close")})}}return d(function(){h=!1}),n.declaration&&(r=n.declaration,u={version:"1.0",encoding:r.encoding||"UTF-8"},r.standalone&&(u.standalone=r.standalone),v({"?xml":{_attr:u}}),l=l.replace("/>","?>")),e&&e.forEach?e.forEach(function(t,n){var r;n+1===e.length&&(r=g),v(t,r)}):v(e,g),c?(c.readable=!0,c):l},e.exports.element=e.exports.Element=function(){var e={_elem:a(Array.prototype.slice.call(arguments)),push:function(e){if(!this.append)throw new Error("not assigned to a parent!");var t=this,n=this._elem.indent;s(this.append,a(e,n,this._elem.icount+(n?1:0)),function(){t.append(!0)})},close:function(e){void 0!==e&&this.push(e),this.end&&this.end()}};return e}}).call(this,n(72))},function(e,t,n){(function(t){var n;n=void 0!==t?t:this,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),r=n.length,o=-1,i="",a=n.charCodeAt(0);++o<r;)0!=(t=n.charCodeAt(o))?i+=t>=1&&t<=31||127==t||0==o&&t>=48&&t<=57||1==o&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":0==o&&1==r&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+n.charAt(o):n.charAt(o):i+="�";return i};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(n)}).call(this,n(42))},function(e,t,n){var r=n(365),o=n(383),i=n(168),a=n(738),s=n(35);e.exports=function(e,t,n){var u=s(e)?r:a,c=arguments.length<3;return u(e,i(t,4),n,c,o)}},function(e,t,n){var r=n(49),o=n(790),i=n(382),a="Expected a function",s=Math.max,u=Math.min;e.exports=function(e,t,n){var c,l,p,f,h,d,m=0,v=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError(a);function b(t){var n=c,r=l;return c=l=void 0,m=t,f=e.apply(r,n)}function _(e){var n=e-d;return void 0===d||n>=t||n<0||g&&e-m>=p}function w(){var e=o();if(_(e))return x(e);h=setTimeout(w,function(e){var n=t-(e-d);return g?u(n,p-(e-m)):n}(e))}function x(e){return h=void 0,y&&c?b(e):(c=l=void 0,f)}function E(){var e=o(),n=_(e);if(c=arguments,l=this,d=e,n){if(void 0===h)return function(e){return m=e,h=setTimeout(w,t),v?b(e):f}(d);if(g)return clearTimeout(h),h=setTimeout(w,t),b(d)}return void 0===h&&(h=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(v=!!n.leading,p=(g="maxWait"in n)?s(i(n.maxWait)||0,t):p,y="trailing"in n?!!n.trailing:y),E.cancel=function(){void 0!==h&&clearTimeout(h),m=0,c=d=l=h=void 0},E.flush=function(){return void 0===h?f:x(o())},E}},function(e,t,n){"use strict";e.exports=n(800)},function(e,t,n){var r=n(362),o=n(443),i=n(905),a=n(104),s=n(114),u=n(908),c=n(447),l=n(446),p=c(function(e,t){var n={};if(null==e)return n;var c=!1;t=r(t,function(t){return t=a(t,e),c||(c=t.length>1),t}),s(e,l(e),n),c&&(n=o(n,7,u));for(var p=t.length;p--;)i(n,t[p]);return n});e.exports=p},function(e,t,n){var r,o,i;o=[],r=function(){"use strict";var e=function(e){return e&&"getComputedStyle"in window&&"smooth"===window.getComputedStyle(e)["scroll-behavior"]};if("undefined"==typeof window||!("document"in window))return{};var t=function(t,n,r){var o;n=n||999,r||0===r||(r=9);var i=function(e){o=e},a=function(){clearTimeout(o),i(0)},s=function(e){return Math.max(0,t.getTopOf(e)-r)},u=function(r,o,s){if(a(),0===o||o&&o<0||e(t.body))t.toY(r),s&&s();else{var u=t.getY(),c=Math.max(0,r)-u,l=(new Date).getTime();o=o||Math.min(Math.abs(c),n),function e(){i(setTimeout(function(){var n=Math.min(1,((new Date).getTime()-l)/o),r=Math.max(0,Math.floor(u+c*(n<.5?2*n*n:n*(4-2*n)-1)));t.toY(r),n<1&&t.getHeight()+r<t.body.scrollHeight?e():(setTimeout(a,99),s&&s())},9))}()}},c=function(e,t,n){u(s(e),t,n)};return{setup:function(e,t){return(0===e||e)&&(n=e),(0===t||t)&&(r=t),{defaultDuration:n,edgeOffset:r}},to:c,toY:u,intoView:function(e,n,o){var i=e.getBoundingClientRect().height,a=t.getTopOf(e)+i,l=t.getHeight(),p=t.getY(),f=p+l;s(e)<p||i+r>l?c(e,n,o):a+r>f?u(a-l+r,n,o):o&&o()},center:function(e,n,r,o){u(Math.max(0,t.getTopOf(e)-t.getHeight()/2+(r||e.getBoundingClientRect().height/2)),n,o)},stop:a,moving:function(){return!!o},getY:t.getY,getTopOf:t.getTopOf}},n=document.documentElement,r=function(){return window.scrollY||n.scrollTop},o=t({body:document.scrollingElement||document.body,toY:function(e){window.scrollTo(0,e)},getY:r,getHeight:function(){return window.innerHeight||n.clientHeight},getTopOf:function(e){return e.getBoundingClientRect().top+r()-n.offsetTop}});if(o.createScroller=function(e,r,o){return t({body:e,toY:function(t){e.scrollTop=t},getY:function(){return e.scrollTop},getHeight:function(){return Math.min(e.clientHeight,window.innerHeight||n.clientHeight)},getTopOf:function(e){return e.offsetTop}},r,o)},"addEventListener"in window&&!window.noZensmooth&&!e(document.body)){var i="history"in window&&"pushState"in history,a=i&&"scrollRestoration"in history;a&&(history.scrollRestoration="auto"),window.addEventListener("load",function(){a&&(setTimeout(function(){history.scrollRestoration="manual"},9),window.addEventListener("popstate",function(e){e.state&&"zenscrollY"in e.state&&o.toY(e.state.zenscrollY)},!1)),window.location.hash&&setTimeout(function(){var e=o.setup().edgeOffset;if(e){var t=document.getElementById(window.location.href.split("#")[1]);if(t){var n=Math.max(0,o.getTopOf(t)-e),r=o.getY()-n;0<=r&&r<9&&window.scrollTo(0,n)}}},9)},!1);var s=new RegExp("(^|\\s)noZensmooth(\\s|$)");window.addEventListener("click",function(e){for(var t=e.target;t&&"A"!==t.tagName;)t=t.parentNode;if(!(!t||1!==e.which||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)){if(a){var n=history.state&&"object"==typeof history.state?history.state:{};n.zenscrollY=o.getY();try{history.replaceState(n,"")}catch(e){}}var r=t.getAttribute("href")||"";if(0===r.indexOf("#")&&!s.test(t.className)){var u=0,c=document.getElementById(r.substring(1));if("#"!==r){if(!c)return;u=o.getTopOf(c)}e.preventDefault();var l=function(){window.location=r},p=o.setup().edgeOffset;p&&(u=Math.max(0,u-p),i&&(l=function(){history.pushState({},"",r)})),o.toY(u,null,l)}}},!1)}return o}(),void 0===(i="function"==typeof r?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){e.exports=n(958)},function(e,t){e.exports=function(e,t,n){var r=new Blob([e],{type:n||"application/octet-stream"});if(void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(r,t);else{var o=window.URL.createObjectURL(r),i=document.createElement("a");i.style.display="none",i.href=o,i.setAttribute("download",t),void 0===i.download&&i.setAttribute("target","_blank"),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(o)}}},function(e,t,n){"use strict";var r=n(966),o=function(e){return e.split(/(<\/?[^>]+>)/g).filter(function(e){return""!==e.trim()})},i=function(e){return/<\/+[^>]+>/.test(e)},a=function(e){return/<[^>]+\/>/.test(e)},s=function(e){return function(e){return/<[^>!]+>/.test(e)}(e)&&!i(e)&&!a(e)};function u(e){return o(e).map(function(e){return{value:e,type:c(e)}})}function c(e){return i(e)?"ClosingTag":s(e)?"OpeningTag":a(e)?"SelfClosingTag":"Text"}e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.indentor,o=t.textNodesOnSameLine,i=0,a=[];n=n||" ";var s=u(e).map(function(e,t,s){var u=e.value,c=e.type;"ClosingTag"===c&&i--;var l=r(n,i),p=l+u;if("OpeningTag"===c&&i++,o){var f=s[t-1],h=s[t-2];"ClosingTag"===c&&"Text"===f.type&&"OpeningTag"===h.type&&(p=""+l+h.value+f.value+u,a.push(t-2,t-1))}return p});return a.forEach(function(e){return s[e]=null}),s.filter(function(e){return!!e}).join("\n")}},function(e,t,n){var r=n(65);e.exports=function(e){return r(e).toLowerCase()}},function(e,t,n){!function(e,t,n){"use strict";t=t&&"default"in t?t.default:t;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return 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)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.state||{};return!(this.updateOnProps||Object.keys(r({},e,this.props))).every(function(r){return n.is(e[r],t.props[r])})||!(this.updateOnStates||Object.keys(r({},o,i))).every(function(e){return n.is(o[e],i[e])})}}]),t}(t.Component);e.ImmutablePureComponent=i,e.default=i,Object.defineProperty(e,"__esModule",{value:!0})}(t,n(0),n(1))},function(e,t,n){"use strict";var r=n(1018).DebounceInput;r.DebounceInput=r,e.exports=r},function(e,t,n){n(482),e.exports=n(1021)},function(e,t,n){"use strict";n.r(t);var r=n(18);void 0===n.n(r).a.Promise&&n(483),String.prototype.startsWith||n(512)},function(e,t,n){n(484),n(330),n(495),n(499),n(510),n(511),e.exports=n(78).Promise},function(e,t,n){"use strict";var r=n(194),o={};o[n(33)("toStringTag")]="z",o+""!="[object z]"&&n(95)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){e.exports=!n(122)&&!n(123)(function(){return 7!=Object.defineProperty(n(196)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(96);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){"use strict";var r=n(488),o=n(329),i=n(198),a={};n(76)(a,n(33)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(77),o=n(489),i=n(336),a=n(197)("IE_PROTO"),s=function(){},u=function(){var e,t=n(196)("iframe"),r=i.length;for(t.style.display="none",n(337).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[i[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(147),o=n(77),i=n(334);e.exports=n(122)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(148),o=n(152),i=n(492)(!1),a=n(197)("IE_PROTO");e.exports=function(e,t){var n,s=o(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~i(c,n)||c.push(n));return c}},function(e,t,n){var r=n(121);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(152),o=n(125),i=n(335);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=o(u.length),l=i(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(148),o=n(494),i=n(197)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(68);e.exports=function(e){return Object(r(e))}},function(e,t,n){for(var r=n(496),o=n(334),i=n(95),a=n(44),s=n(76),u=n(124),c=n(33),l=c("iterator"),p=c("toStringTag"),f=u.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=o(h),m=0;m<d.length;m++){var v,g=d[m],y=h[g],b=a[g],_=b&&b.prototype;if(_&&(_[l]||s(_,l,f),_[p]||s(_,p,g),u[g]=f,y))for(v in r)_[v]||i(_,v,r[v],!0)}},function(e,t,n){"use strict";var r=n(497),o=n(498),i=n(124),a=n(152);e.exports=n(332)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(33)("unscopables"),o=Array.prototype;null==o[r]&&n(76)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r,o,i,a,s=n(333),u=n(44),c=n(150),l=n(194),p=n(39),f=n(96),h=n(151),d=n(500),m=n(501),v=n(338),g=n(339).set,y=n(506)(),b=n(199),_=n(340),w=n(341),x=u.TypeError,E=u.process,S=u.Promise,C="process"==l(E),k=function(){},O=o=b.f,A=!!function(){try{var e=S.resolve(1),t=(e.constructor={})[n(33)("species")]=function(e){e(k,k)};return(C||"function"==typeof PromiseRejectionEvent)&&e.then(k)instanceof t}catch(e){}}(),T=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},j=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,s=o?t.ok:t.fail,u=t.resolve,c=t.reject,l=t.domain;try{s?(o||(2==e._h&&M(e),e._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),a=!0)),n===t.promise?c(x("Promise-chain cycle")):(i=T(n))?i.call(n,u,c):u(n)):c(r)}catch(e){l&&!a&&l.exit(),c(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&P(e)})}},P=function(e){g.call(u,function(){var t,n,r,o=e._v,i=I(e);if(i&&(t=_(function(){C?E.emit("unhandledRejection",o,e):(n=u.onunhandledrejection)?n({promise:e,reason:o}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=C||I(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},I=function(e){return 1!==e._h&&0===(e._a||e._c).length},M=function(e){g.call(u,function(){var t;C?E.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},N=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),j(t,!0))},R=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw x("Promise can't be resolved itself");(t=T(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,c(R,r,1),c(N,r,1))}catch(e){N.call(r,e)}}):(n._v=e,n._s=1,j(n,!1))}catch(e){N.call({_w:n,_d:!1},e)}}};A||(S=function(e){d(this,S,"Promise","_h"),h(e),r.call(this);try{e(c(R,this,1),c(N,this,1))}catch(e){N.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(507)(S.prototype,{then:function(e,t){var n=O(v(this,S));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=C?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&j(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=c(R,e,1),this.reject=c(N,e,1)},b.f=O=function(e){return e===S||e===a?new i(e):o(e)}),p(p.G+p.W+p.F*!A,{Promise:S}),n(198)(S,"Promise"),n(508)("Promise"),a=n(78).Promise,p(p.S+p.F*!A,"Promise",{reject:function(e){var t=O(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(s||!A),"Promise",{resolve:function(e){return w(s&&this===a?S:this,e)}}),p(p.S+p.F*!(A&&n(509)(function(e){S.all(e).catch(k)})),"Promise",{all:function(e){var t=this,n=O(t),r=n.resolve,o=n.reject,i=_(function(){var n=[],i=0,a=1;m(e,!1,function(e){var s=i++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=O(t),r=n.reject,o=_(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(150),o=n(502),i=n(503),a=n(77),s=n(125),u=n(504),c={},l={};(t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(i(g)){for(h=s(e.length);h>b;b++)if((v=t?y(a(d=e[b])[0],d[1]):y(e[b]))===c||v===l)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=o(m,y,d.value,t))===c||v===l)return v}).BREAK=c,t.RETURN=l},function(e,t,n){var r=n(77);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(124),o=n(33)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){var r=n(194),o=n(33)("iterator"),i=n(124);e.exports=n(78).getIteratorMethod=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(44),o=n(339).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(121)(a);e.exports=function(){var e,t,n,c=function(){var r,o;for(u&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve();n=function(){l.then(c)}}else n=function(){o.call(r,c)};else{var p=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t,n){var r=n(95);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},function(e,t,n){"use strict";var r=n(44),o=n(147),i=n(122),a=n(33)("species");e.exports=function(e){var t=r[e];i&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(33)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(39),o=n(78),i=n(44),a=n(338),s=n(341);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,o.Promise||i.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(39),o=n(199),i=n(340);r(r.S,"Promise",{try:function(e){var t=o.f(this),n=i(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){n(513),n(514),n(515),n(330),n(518),n(519),n(520),n(521),n(523),n(524),n(525),n(526),n(527),n(528),n(529),n(530),n(531),n(532),n(533),n(534),n(535),n(536),n(537),n(538),n(539),n(540),e.exports=n(78).String},function(e,t,n){var r=n(39),o=n(335),i=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],o(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?i(t):i(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(39),o=n(152),i=n(125);r(r.S,"String",{raw:function(e){for(var t=o(e.raw),n=i(t.length),r=arguments.length,a=[],s=0;n>s;)a.push(String(t[s++])),s<r&&a.push(String(arguments[s]));return a.join("")}})},function(e,t,n){"use strict";n(516)("trim",function(e){return function(){return e(this,3)}})},function(e,t,n){var r=n(39),o=n(68),i=n(123),a=n(517),s="["+a+"]",u=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),l=function(e,t,n){var o={},s=i(function(){return!!a[e]()||"
"!="
"[e]()}),u=o[e]=s?t(p):a[e];n&&(o[n]=u),r(r.P+r.F*s,"String",o)},p=l.trim=function(e,t){return e=String(o(e)),1&t&&(e=e.replace(u,"")),2&t&&(e=e.replace(c,"")),e};e.exports=l},function(e,t){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(e,t,n){"use strict";var r=n(39),o=n(331)(!1);r(r.P,"String",{codePointAt:function(e){return o(this,e)}})},function(e,t,n){"use strict";var r=n(39),o=n(125),i=n(200),a="".endsWith;r(r.P+r.F*n(201)("endsWith"),"String",{endsWith:function(e){var t=i(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(t.length),s=void 0===n?r:Math.min(o(n),r),u=String(e);return a?a.call(t,u,s):t.slice(s-u.length,s)===u}})},function(e,t,n){"use strict";var r=n(39),o=n(200);r(r.P+r.F*n(201)("includes"),"String",{includes:function(e){return!!~o(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(39);r(r.P,"String",{repeat:n(522)})},function(e,t,n){"use strict";var r=n(149),o=n(68);e.exports=function(e){var t=String(o(this)),n="",i=r(e);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n}},function(e,t,n){"use strict";var r=n(39),o=n(125),i=n(200),a="".startsWith;r(r.P+r.F*n(201)("startsWith"),"String",{startsWith:function(e){var t=i(this,e,"startsWith"),n=o(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(40)("anchor",function(e){return function(t){return e(this,"a","name",t)}})},function(e,t,n){"use strict";n(40)("big",function(e){return function(){return e(this,"big","","")}})},function(e,t,n){"use strict";n(40)("blink",function(e){return function(){return e(this,"blink","","")}})},function(e,t,n){"use strict";n(40)("bold",function(e){return function(){return e(this,"b","","")}})},function(e,t,n){"use strict";n(40)("fixed",function(e){return function(){return e(this,"tt","","")}})},function(e,t,n){"use strict";n(40)("fontcolor",function(e){return function(t){return e(this,"font","color",t)}})},function(e,t,n){"use strict";n(40)("fontsize",function(e){return function(t){return e(this,"font","size",t)}})},function(e,t,n){"use strict";n(40)("italics",function(e){return function(){return e(this,"i","","")}})},function(e,t,n){"use strict";n(40)("link",function(e){return function(t){return e(this,"a","href",t)}})},function(e,t,n){"use strict";n(40)("small",function(e){return function(){return e(this,"small","","")}})},function(e,t,n){"use strict";n(40)("strike",function(e){return function(){return e(this,"strike","","")}})},function(e,t,n){"use strict";n(40)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";n(40)("sup",function(e){return function(){return e(this,"sup","","")}})},function(e,t,n){n(153)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(153)("replace",2,function(e,t,n){return[function(r,o){"use strict";var i=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},n]})},function(e,t,n){n(153)("search",1,function(e,t,n){return[function(n){"use strict";var r=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(153)("split",2,function(e,t,r){"use strict";var o=n(342),i=r,a=[].push;if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length){var s=void 0===/()??/.exec("")[1];r=function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!o(e))return i.call(n,e,t);var r,u,c,l,p,f=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,m=void 0===t?4294967295:t>>>0,v=new RegExp(e.source,h+"g");for(s||(r=new RegExp("^"+v.source+"$(?!\\s)",h));(u=v.exec(n))&&!((c=u.index+u[0].length)>d&&(f.push(n.slice(d,u.index)),!s&&u.length>1&&u[0].replace(r,function(){for(p=1;p<arguments.length-2;p++)void 0===arguments[p]&&(u[p]=void 0)}),u.length>1&&u.index<n.length&&a.apply(f,u.slice(1)),l=u[0].length,d=c,f.length>=m));)v.lastIndex===u.index&&v.lastIndex++;return d===n.length?!l&&v.test("")||f.push(""):f.push(n.slice(d)),f.length>m?f.slice(0,m):f}}else"0".split(void 0,0).length&&(r=function(e,t){return void 0===e&&0===t?[]:i.call(this,e,t)});return[function(n,o){var i=e(this),a=null==n?void 0:n[t];return void 0!==a?a.call(n,i,o):r.call(String(i),n,o)},r]})},function(e,t,n){var r=n(22),o=r.JSON||(r.JSON={stringify:JSON.stringify});e.exports=function(e){return o.stringify.apply(o,arguments)}},function(e,t,n){n(543),e.exports=n(22).Object.keys},function(e,t,n){var r=n(79),o=n(126);n(208)("keys",function(){return function(e){return o(r(e))}})},function(e,t,n){var r=n(70),o=n(154),i=n(545);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=o(u.length),l=i(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(204),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){e.exports=n(547)},function(e,t,n){n(97),n(99),e.exports=n(213).f("iterator")},function(e,t,n){var r=n(204),o=n(202);e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(i=s.charCodeAt(u))<55296||i>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):i:e?s.slice(u,u+2):a-56320+(i-55296<<10)+65536}}},function(e,t,n){"use strict";var r=n(156),o=n(130),i=n(131),a={};n(71)(a,n(34)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){"use strict";var r=n(551),o=n(348),i=n(98),a=n(70);e.exports=n(211)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t,n){e.exports=n(553)},function(e,t,n){n(349),n(160),n(556),n(557),e.exports=n(22).Symbol},function(e,t,n){var r=n(126),o=n(157),i=n(158);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var a,s=n(e),u=i.f,c=0;s.length>c;)u.call(e,a=s[c++])&&t.push(a);return t}},function(e,t,n){var r=n(70),o=n(216).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(r(e))}},function(e,t,n){n(214)("asyncIterator")},function(e,t,n){n(214)("observable")},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=c(e),r=n[0],a=n[1],s=new i(function(e,t,n){return 3*(t+n)/4-n}(0,r,a)),u=0,l=a>0?r-4:r,p=0;p<l;p+=4)t=o[e.charCodeAt(p)]<<18|o[e.charCodeAt(p+1)]<<12|o[e.charCodeAt(p+2)]<<6|o[e.charCodeAt(p+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;2===a&&(t=o[e.charCodeAt(p)]<<2|o[e.charCodeAt(p+1)]>>4,s[u++]=255&t);1===a&&(t=o[e.charCodeAt(p)]<<10|o[e.charCodeAt(p+1)]<<4|o[e.charCodeAt(p+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t);return s},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(l(e,a,a+16383>s?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],o[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,l=-7,p=n?o-1:0,f=n?-1:1,h=e[t+p];for(p+=f,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+p],p+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+p],p+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,p=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+p>=1?f/u:f*Math.pow(2,1-p))*u>=2&&(a++,u/=2),a+p>=l?(s=0,a=l):a+p>=1?(s=(t*u-1)*Math.pow(2,o),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=d,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=d,a/=256,c-=8);e[n+h-d]|=128*m}},function(e,t,n){n(561),e.exports=n(22).Array.isArray},function(e,t,n){var r=n(30);r(r.S,"Array",{isArray:n(215)})},function(e,t,n){n(563);var r=n(22).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},function(e,t,n){var r=n(30);r(r.S+r.F*!n(46),"Object",{defineProperty:n(47).f})},function(e,t,n){n(565),e.exports=n(22).Object.assign},function(e,t,n){var r=n(30);r(r.S+r.F,"Object",{assign:n(351)})},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var r=n(568),o=n(101),i=n(54),a=n(569),s=r.twoArgumentPooler,u=r.fourArgumentPooler,c=/\/+/g;function l(e){return(""+e).replace(c,"$&/")}function p(e,t){this.func=e,this.context=t,this.count=0}function f(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function h(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function d(e,t,n){var r=e.result,a=e.keyPrefix,s=e.func,u=e.context,c=s.call(u,t,e.count++);Array.isArray(c)?m(c,r,n,i.thatReturnsArgument):null!=c&&(o.isValidElement(c)&&(c=o.cloneAndReplaceKey(c,a+(!c.key||t&&t.key===c.key?"":l(c.key)+"/")+n)),r.push(c))}function m(e,t,n,r,o){var i="";null!=n&&(i=l(n)+"/");var s=h.getPooled(t,i,r,o);a(e,d,s),h.release(s)}function v(e,t,n){return null}p.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},r.addPoolingTo(p,s),h.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},r.addPoolingTo(h,u);var g={forEach:function(e,t,n){if(null==e)return e;var r=p.getPooled(t,n);a(e,f,r),p.release(r)},map:function(e,t,n){if(null==e)return e;var r=[];return m(e,r,null,t,n),r},mapIntoWithKeyPrefixInternal:m,count:function(e,t){return a(e,v,null)},toArray:function(e){var t=[];return m(e,t,null,i.thatReturnsArgument),t}};e.exports=g},function(e,t,n){"use strict";var r=n(133),o=(n(15),function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)}),i=function(e){e instanceof this||r("25"),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)},a=o,s={addPoolingTo:function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||a,n.poolSize||(n.poolSize=10),n.release=i,n},oneArgumentPooler:o,twoArgumentPooler:function(e,t){if(this.instancePool.length){var n=this.instancePool.pop();return this.call(n,e,t),n}return new this(e,t)},threeArgumentPooler:function(e,t,n){if(this.instancePool.length){var r=this.instancePool.pop();return this.call(r,e,t,n),r}return new this(e,t,n)},fourArgumentPooler:function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}};e.exports=s},function(e,t,n){"use strict";var r=n(133),o=(n(62),n(355)),i=n(570),a=(n(15),n(571)),s=(n(23),"."),u=":";function c(e,t){return e&&"object"==typeof e&&null!=e.key?a.escape(e.key):t.toString(36)}e.exports=function(e,t,n){return null==e?0:function e(t,n,l,p){var f,h=typeof t;if("undefined"!==h&&"boolean"!==h||(t=null),null===t||"string"===h||"number"===h||"object"===h&&t.$$typeof===o)return l(p,t,""===n?s+c(t,0):n),1;var d=0,m=""===n?s:n+u;if(Array.isArray(t))for(var v=0;v<t.length;v++)d+=e(f=t[v],m+c(f,v),l,p);else{var g=i(t);if(g){var y,b=g.call(t);if(g!==t.entries)for(var _=0;!(y=b.next()).done;)d+=e(f=y.value,m+c(f,_++),l,p);else for(;!(y=b.next()).done;){var w=y.value;w&&(d+=e(f=w[1],m+a.escape(w[0])+u+c(f,0),l,p))}}else if("object"===h){var x=String(t);r("31","[object Object]"===x?"object with keys {"+Object.keys(t).join(", ")+"}":x,"")}}return d}(e,"",t,n)}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=function(e){var t=e&&(r&&e[r]||e[o]);if("function"==typeof t)return t}},function(e,t,n){"use strict";var r={escape:function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})},unescape:function(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}};e.exports=r},function(e,t,n){"use strict";var r=n(101).createFactory,o={a:r("a"),abbr:r("abbr"),address:r("address"),area:r("area"),article:r("article"),aside:r("aside"),audio:r("audio"),b:r("b"),base:r("base"),bdi:r("bdi"),bdo:r("bdo"),big:r("big"),blockquote:r("blockquote"),body:r("body"),br:r("br"),button:r("button"),canvas:r("canvas"),caption:r("caption"),cite:r("cite"),code:r("code"),col:r("col"),colgroup:r("colgroup"),data:r("data"),datalist:r("datalist"),dd:r("dd"),del:r("del"),details:r("details"),dfn:r("dfn"),dialog:r("dialog"),div:r("div"),dl:r("dl"),dt:r("dt"),em:r("em"),embed:r("embed"),fieldset:r("fieldset"),figcaption:r("figcaption"),figure:r("figure"),footer:r("footer"),form:r("form"),h1:r("h1"),h2:r("h2"),h3:r("h3"),h4:r("h4"),h5:r("h5"),h6:r("h6"),head:r("head"),header:r("header"),hgroup:r("hgroup"),hr:r("hr"),html:r("html"),i:r("i"),iframe:r("iframe"),img:r("img"),input:r("input"),ins:r("ins"),kbd:r("kbd"),keygen:r("keygen"),label:r("label"),legend:r("legend"),li:r("li"),link:r("link"),main:r("main"),map:r("map"),mark:r("mark"),menu:r("menu"),menuitem:r("menuitem"),meta:r("meta"),meter:r("meter"),nav:r("nav"),noscript:r("noscript"),object:r("object"),ol:r("ol"),optgroup:r("optgroup"),option:r("option"),output:r("output"),p:r("p"),param:r("param"),picture:r("picture"),pre:r("pre"),progress:r("progress"),q:r("q"),rp:r("rp"),rt:r("rt"),ruby:r("ruby"),s:r("s"),samp:r("samp"),script:r("script"),section:r("section"),select:r("select"),small:r("small"),source:r("source"),span:r("span"),strong:r("strong"),style:r("style"),sub:r("sub"),summary:r("summary"),sup:r("sup"),table:r("table"),tbody:r("tbody"),td:r("td"),textarea:r("textarea"),tfoot:r("tfoot"),th:r("th"),thead:r("thead"),time:r("time"),title:r("title"),tr:r("tr"),track:r("track"),u:r("u"),ul:r("ul"),var:r("var"),video:r("video"),wbr:r("wbr"),circle:r("circle"),clipPath:r("clipPath"),defs:r("defs"),ellipse:r("ellipse"),g:r("g"),image:r("image"),line:r("line"),linearGradient:r("linearGradient"),mask:r("mask"),path:r("path"),pattern:r("pattern"),polygon:r("polygon"),polyline:r("polyline"),radialGradient:r("radialGradient"),rect:r("rect"),stop:r("stop"),svg:r("svg"),text:r("text"),tspan:r("tspan")};e.exports=o},function(e,t,n){"use strict";var r=n(101).isValidElement,o=n(356);e.exports=o(r)},function(e,t,n){"use strict";var r=n(357),o=n(25),i=n(358),a=n(576),s=Function.call.bind(Object.prototype.hasOwnProperty),u=function(){};function c(){return null}e.exports=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l="@@iterator";var p="<<anonymous>>",f={array:v("array"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:m(c),arrayOf:function(e){return m(function(t,n,r,o,a){if("function"!=typeof e)return new d("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var u=y(s);return new d("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected an array.")}for(var c=0;c<s.length;c++){var l=e(s,c,r,o,a+"["+c+"]",i);if(l instanceof Error)return l}return null})},element:m(function(t,n,r,o,i){var a=t[n];if(!e(a)){var s=y(a);return new d("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}),elementType:m(function(e,t,n,o,i){var a=e[t];if(!r.isValidElementType(a)){var s=y(a);return new d("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+n+"`, expected a single ReactElement type.")}return null}),instanceOf:function(e){return m(function(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||p,s=function(e){if(!e.constructor||!e.constructor.name)return p;return e.constructor.name}(t[n]);return new d("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null})},node:m(function(e,t,n,r,o){return g(e[t])?null:new d("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return m(function(t,n,r,o,a){if("function"!=typeof e)return new d("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var u=t[n],c=y(u);if("object"!==c)return new d("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var l in u)if(s(u,l)){var p=e(u,l,r,o,a+"."+l,i);if(p instanceof Error)return p}return null})},oneOf:function(e){if(!Array.isArray(e))return c;return m(function(t,n,r,o,i){for(var a=t[n],s=0;s<e.length;s++)if(h(a,e[s]))return null;var u=JSON.stringify(e,function(e,t){var n=b(t);return"symbol"===n?String(t):t});return new d("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+u+".")})},oneOfType:function(e){if(!Array.isArray(e))return c;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return u("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+_(n)+" at index "+t+"."),c}return m(function(t,n,r,o,a){for(var s=0;s<e.length;s++){var u=e[s];if(null==u(t,n,r,o,a,i))return null}return new d("Invalid "+o+" `"+a+"` supplied to `"+r+"`.")})},shape:function(e){return m(function(t,n,r,o,a){var s=t[n],u=y(s);if("object"!==u)return new d("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var c in e){var l=e[c];if(l){var p=l(s,c,r,o,a+"."+c,i);if(p)return p}}return null})},exact:function(e){return m(function(t,n,r,a,s){var u=t[n],c=y(u);if("object"!==c)return new d("Invalid "+a+" `"+s+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var l=o({},t[n],e);for(var p in l){var f=e[p];if(!f)return new d("Invalid "+a+" `"+s+"` key `"+p+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=f(u,p,r,a,s+"."+p,i);if(h)return h}return null})}};function h(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){this.message=e,this.stack=""}function m(e){function n(n,r,o,a,s,u,c){if((a=a||p,u=u||o,c!==i)&&t){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}return null==r[o]?n?null===r[o]?new d("The "+s+" `"+u+"` is marked as required in `"+a+"`, but its value is `null`."):new d("The "+s+" `"+u+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(r,o,a,s,u)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function v(e){return m(function(t,n,r,o,i,a){var s=t[n];return y(s)!==e?new d("Invalid "+o+" `"+i+"` of type `"+b(s)+"` supplied to `"+r+"`, expected `"+e+"`."):null})}function g(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(g);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e[l]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!g(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!g(a[1]))return!1}return!0;default:return!1}}function y(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=y(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function _(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return d.prototype=Error.prototype,f.checkPropTypes=a,f.resetWarningCache=a.resetWarningCache,f.PropTypes=f,f}},function(e,t,n){"use strict";
/** @license React v16.8.6
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116;function g(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case p:case f:case a:case u:case s:case d:return e;default:switch(e=e&&e.$$typeof){case l:case h:case c:return e;default:return t}}case v:case m:case i:return t}}}function y(e){return g(e)===f}t.typeOf=g,t.AsyncMode=p,t.ConcurrentMode=f,t.ContextConsumer=l,t.ContextProvider=c,t.Element=o,t.ForwardRef=h,t.Fragment=a,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=u,t.StrictMode=s,t.Suspense=d,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===f||e===u||e===s||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===c||e.$$typeof===l||e.$$typeof===h)},t.isAsyncMode=function(e){return y(e)||g(e)===p},t.isConcurrentMode=y,t.isContextConsumer=function(e){return g(e)===l},t.isContextProvider=function(e){return g(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return g(e)===h},t.isFragment=function(e){return g(e)===a},t.isLazy=function(e){return g(e)===v},t.isMemo=function(e){return g(e)===m},t.isPortal=function(e){return g(e)===i},t.isProfiler=function(e){return g(e)===u},t.isStrictMode=function(e){return g(e)===s},t.isSuspense=function(e){return g(e)===d}},function(e,t,n){"use strict";function r(e,t,n,r,o){}r.resetWarningCache=function(){0},e.exports=r},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r=n(352).Component,o=n(101).isValidElement,i=n(353),a=n(579);e.exports=a(r,o,i)},function(e,t,n){"use strict";var r=n(25),o=n(161),i=n(15),a="mixins";e.exports=function(e,t,n){var s=[],u={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},c={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},l={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)f(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=r({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=r({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=d(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=r({},e.propTypes,t)},statics:function(e,t){!function(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in l;i(!o,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var a=n in e;if(a){var s=c.hasOwnProperty(n)?c[n]:null;return i("DEFINE_MANY_MERGED"===s,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),void(e[n]=d(e[n],r))}e[n]=r}}}(e,t)},autobind:function(){}};function p(e,t){var n=u.hasOwnProperty(t)?u[t]:null;b.hasOwnProperty(t)&&i("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&i("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function f(e,n){if(n){i("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),i(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,o=r.__reactAutoBindPairs;for(var s in n.hasOwnProperty(a)&&l.mixins(e,n.mixins),n)if(n.hasOwnProperty(s)&&s!==a){var c=n[s],f=r.hasOwnProperty(s);if(p(f,s),l.hasOwnProperty(s))l[s](e,c);else{var h=u.hasOwnProperty(s);if("function"!=typeof c||h||f||!1===n.autobind)if(f){var v=u[s];i(h&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,s),"DEFINE_MANY_MERGED"===v?r[s]=d(r[s],c):"DEFINE_MANY"===v&&(r[s]=m(r[s],c))}else r[s]=c;else o.push(s,c),r[s]=c}}}}function h(e,t){for(var n in i(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."),t)t.hasOwnProperty(n)&&(i(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function d(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return h(o,n),h(o,r),o}}function m(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function v(e,t){return t.bind(e)}var g={componentDidMount:function(){this.__isMounted=!0}},y={componentWillUnmount:function(){this.__isMounted=!1}},b={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},_=function(){};return r(_.prototype,e.prototype,b),function(e){var t=function(e,r,a){this.__reactAutoBindPairs.length&&function(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=v(e,o)}}(this),this.props=e,this.context=r,this.refs=o,this.updater=a||n,this.state=null;var s=this.getInitialState?this.getInitialState():null;i("object"==typeof s&&!Array.isArray(s),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=s};for(var r in t.prototype=new _,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],s.forEach(f.bind(null,t)),f(t,g),f(t,e),f(t,y),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),i(t.prototype.render,"createClass(...): Class specification must implement a `render` method."),u)t.prototype[r]||(t.prototype[r]=null);return t}}},function(e,t,n){"use strict";var r=n(133),o=n(101);n(15);e.exports=function(e){return o.isValidElement(e)||r("143"),e}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),i=(r=o)&&r.__esModule?r:{default:r},a=n(583);t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.Map,n=Object.keys(e);return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t(),o=arguments[1];return r.withMutations(function(t){n.forEach(function(n){var r=(0,e[n])(t.get(n),o);(0,a.validateNextState)(r,n,o),t.set(n,r)})})}},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateNextState=t.getUnexpectedInvocationParameterMessage=t.getStateName=void 0;var r=a(n(359)),o=a(n(584)),i=a(n(585));function a(e){return e&&e.__esModule?e:{default:e}}t.getStateName=r.default,t.getUnexpectedInvocationParameterMessage=o.default,t.validateNextState=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(1)),o=i(n(359));function i(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){var i=Object.keys(t);if(!i.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";var a=(0,o.default)(n);if(!r.default.Iterable.isIterable(e))return"The "+a+' is of unexpected type. Expected argument to be an instance of Immutable.Iterable with the following properties: "'+i.join('", "')+'".';var s=e.keySeq().toArray().filter(function(e){return!t.hasOwnProperty(e)});return s.length>0?"Unexpected "+(1===s.length?"property":"properties")+' "'+s.join('", "')+'" found in '+a+'. Expected to find one of the known reducer property names instead: "'+i.join('", "')+'". Unexpected properties will be ignored.':null},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(void 0===e)throw new Error('Reducer "'+t+'" returned undefined when handling "'+n.type+'" action. To ignore an action, you must explicitly return the previous state.')},e.exports=t.default},function(e,t,n){var r=n(14);e.exports=function(e){if(r(e))return e}},function(e,t,n){var r=n(90);e.exports=function(e,t){var n=[],o=!0,i=!1,a=void 0;try{for(var s,u=r(e);!(o=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}return n}},function(e,t,n){n(99),n(97),e.exports=n(589)},function(e,t,n){var r=n(45),o=n(217);e.exports=n(22).getIterator=function(e){var t=o(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){var r=n(65),o=n(262);e.exports=function(e){return o(r(e).toLowerCase())}},function(e,t,n){var r=n(102),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(595),o=n(364),i=n(596),a=n(65);e.exports=function(e){return function(t){t=a(t);var n=o(t)?i(t):void 0,s=n?n[0]:t.charAt(0),u=n?r(n,1).join(""):t.slice(1);return s[e]()+u}}},function(e,t,n){var r=n(363);e.exports=function(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:r(e,t,n)}},function(e,t,n){var r=n(597),o=n(364),i=n(598);e.exports=function(e){return o(e)?i(e):r(e)}},function(e,t){e.exports=function(e){return e.split("")}},function(e,t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+r+"|"+o+")"+"?",c="[\\ufe0e\\ufe0f]?"+u+("(?:\\u200d(?:"+[i,a,s].join("|")+")[\\ufe0e\\ufe0f]?"+u+")*"),l="(?:"+[i+r+"?",r,a,s,n].join("|")+")",p=RegExp(o+"(?="+o+")|"+l+c,"g");e.exports=function(e){return e.match(p)||[]}},function(e,t,n){var r=n(365),o=n(600),i=n(603),a=RegExp("['’]","g");e.exports=function(e){return function(t){return r(i(o(t).replace(a,"")),e,"")}}},function(e,t,n){var r=n(601),o=n(65),i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=o(e))&&e.replace(i,r).replace(a,"")}},function(e,t,n){var r=n(602)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t,n){var r=n(604),o=n(605),i=n(65),a=n(606);e.exports=function(e,t,n){return e=i(e),void 0===(t=n?void 0:t)?o(e)?a(e):r(e):e.match(t)||[]}},function(e,t){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(n)||[]}},function(e,t){var n=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return n.test(e)}},function(e,t){var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",r="["+n+"]",o="\\d+",i="[\\u2700-\\u27bf]",a="[a-z\\xdf-\\xf6\\xf8-\\xff]",s="[^\\ud800-\\udfff"+n+o+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",u="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]",l="[A-Z\\xc0-\\xd6\\xd8-\\xde]",p="(?:"+a+"|"+s+")",f="(?:"+l+"|"+s+")",h="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",d="[\\ufe0e\\ufe0f]?"+h+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",u,c].join("|")+")[\\ufe0e\\ufe0f]?"+h+")*"),m="(?:"+[i,u,c].join("|")+")"+d,v=RegExp([l+"?"+a+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[r,l,"$"].join("|")+")",f+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[r,l+p,"$"].join("|")+")",l+"?"+p+"+(?:['’](?:d|ll|m|re|s|t|ve))?",l+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",o,m].join("|"),"g");e.exports=function(e){return e.match(v)||[]}},function(e,t,n){var r=n(608),o=n(165),i=n(219);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(e,t,n){var r=n(609),o=n(614),i=n(615),a=n(616),s=n(617);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(164);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t,n){var r=n(366),o=n(611),i=n(49),a=n(367),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,p=c.hasOwnProperty,f=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:s).test(a(e))}},function(e,t,n){var r,o=n(612),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},function(e,t,n){var r=n(48)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(164),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return n===o?void 0:n}return i.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(164),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(164),o="__lodash_hash_undefined__";e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?o:t,this}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(166),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},function(e,t,n){var r=n(166);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(166);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(166);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(167);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(167);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(167);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(167);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(168),o=n(103),i=n(83);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!o(t)){var u=r(n,3);t=i(t),n=function(e){return u(s[e],e,s)}}var c=e(t,n,a);return c>-1?s[u?t[c]:c]:void 0}}},function(e,t,n){var r=n(630),o=n(656),i=n(379);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(220),o=n(368),i=1,a=2;e.exports=function(e,t,n,s){var u=n.length,c=u,l=!s;if(null==e)return!c;for(e=Object(e);u--;){var p=n[u];if(l&&p[2]?p[1]!==e[p[0]]:!(p[0]in e))return!1}for(;++u<c;){var f=(p=n[u])[0],h=e[f],d=p[1];if(l&&p[2]){if(void 0===h&&!(f in e))return!1}else{var m=new r;if(s)var v=s(h,d,f,e,t,m);if(!(void 0===v?o(d,h,i|a,s,m):v))return!1}}return!0}},function(e,t,n){var r=n(165);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(165),o=n(219),i=n(218),a=200;e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<a-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(220),o=n(369),i=n(641),a=n(644),s=n(172),u=n(35),c=n(224),l=n(376),p=1,f="[object Arguments]",h="[object Array]",d="[object Object]",m=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,g,y){var b=u(e),_=u(t),w=b?h:s(e),x=_?h:s(t),E=(w=w==f?d:w)==d,S=(x=x==f?d:x)==d,C=w==x;if(C&&c(e)){if(!c(t))return!1;b=!0,E=!1}if(C&&!E)return y||(y=new r),b||l(e)?o(e,t,n,v,g,y):i(e,t,w,n,v,g,y);if(!(n&p)){var k=E&&m.call(e,"__wrapped__"),O=S&&m.call(t,"__wrapped__");if(k||O){var A=k?e.value():e,T=O?t.value():t;return y||(y=new r),g(A,T,n,v,y)}}return!!C&&(y||(y=new r),a(e,t,n,v,g,y))}},function(e,t,n){var r=n(218),o=n(638),i=n(639);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},function(e,t){var n="__lodash_hash_undefined__";e.exports=function(e){return this.__data__.set(e,n),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(102),o=n(371),i=n(89),a=n(369),s=n(642),u=n(643),c=1,l=2,p="[object Boolean]",f="[object Date]",h="[object Error]",d="[object Map]",m="[object Number]",v="[object RegExp]",g="[object Set]",y="[object String]",b="[object Symbol]",_="[object ArrayBuffer]",w="[object DataView]",x=r?r.prototype:void 0,E=x?x.valueOf:void 0;e.exports=function(e,t,n,r,x,S,C){switch(n){case w:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!S(new o(e),new o(t)));case p:case f:case m:return i(+e,+t);case h:return e.name==t.name&&e.message==t.message;case v:case y:return e==t+"";case d:var k=s;case g:var O=r&c;if(k||(k=u),e.size!=t.size&&!O)return!1;var A=C.get(e);if(A)return A==t;r|=l,C.set(e,t);var T=a(k(e),k(t),r,x,S,C);return C.delete(e),T;case b:if(E)return E.call(e)==E.call(t)}return!1}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},function(e,t,n){var r=n(372),o=1,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,s,u){var c=n&o,l=r(e),p=l.length;if(p!=r(t).length&&!c)return!1;for(var f=p;f--;){var h=l[f];if(!(c?h in t:i.call(t,h)))return!1}var d=u.get(e);if(d&&u.get(t))return d==t;var m=!0;u.set(e,t),u.set(t,e);for(var v=c;++f<p;){var g=e[h=l[f]],y=t[h];if(a)var b=c?a(y,g,h,t,e,u):a(g,y,h,e,t,u);if(!(void 0===b?g===y||s(g,y,n,a,u):b)){m=!1;break}v||(v="constructor"==h)}if(m&&!v){var _=e.constructor,w=t.constructor;_!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof _&&_ instanceof _&&"function"==typeof w&&w instanceof w)&&(m=!1)}return u.delete(e),u.delete(t),m}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(81),o=n(63),i="[object Arguments]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(81),o=n(225),i=n(63),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},function(e,t,n){var r=n(171),o=n(651),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(377)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(82)(n(48),"DataView");e.exports=r},function(e,t,n){var r=n(82)(n(48),"Promise");e.exports=r},function(e,t,n){var r=n(82)(n(48),"Set");e.exports=r},function(e,t,n){var r=n(82)(n(48),"WeakMap");e.exports=r},function(e,t,n){var r=n(378),o=n(83);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,r(a)]}return t}},function(e,t,n){var r=n(368),o=n(91),i=n(380),a=n(228),s=n(378),u=n(379),c=n(105),l=1,p=2;e.exports=function(e,t){return a(e)&&s(t)?u(c(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?i(n,e):r(t,a,l|p)}}},function(e,t,n){var r=n(659),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)}),t});e.exports=a},function(e,t,n){var r=n(263),o=500;e.exports=function(e){var t=r(e,function(e){return n.size===o&&n.clear(),e}),n=t.cache;return t}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(104),o=n(223),i=n(35),a=n(170),s=n(225),u=n(105);e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,p=!1;++c<l;){var f=u(t[c]);if(!(p=null!=e&&n(e,f)))break;e=e[f]}return p||++c!=l?p:!!(l=null==e?0:e.length)&&s(l)&&a(f,l)&&(i(e)||o(e))}},function(e,t,n){var r=n(663),o=n(664),i=n(228),a=n(105);e.exports=function(e){return i(e)?r(a(e)):o(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(173);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(666),o=n(168),i=n(381),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var u=null==n?0:i(n);return u<0&&(u=a(s+u,0)),r(e,o(t,3),u)}},function(e,t){e.exports=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},function(e,t,n){var r=n(382),o=1/0,i=17976931348623157e292;e.exports=function(e){return e?(e=r(e))===o||e===-o?(e<0?-1:1)*i:e==e?e:0:0===e?e:0}},function(e,t,n){var r=n(383);e.exports=function(e,t){var n;return r(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}},function(e,t,n){var r=n(670),o=n(83);e.exports=function(e,t){return e&&r(e,t,o)}},function(e,t,n){var r=n(671)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++o];if(!1===n(i[u],u,i))break}return t}}},function(e,t,n){var r=n(103);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var i=n.length,a=t?i:-1,s=Object(n);(t?a--:++a<i)&&!1!==o(s[a],a,s););return n}}},function(e,t){var n={"&":"&",'"':""","'":"'","<":"<",">":">"};e.exports=function(e){return e&&e.replace?e.replace(/([&"<>'])/g,function(e,t){return n[t]}):e}},function(e,t,n){e.exports=o;var r=n(230).EventEmitter;function o(){r.call(this)}n(106)(o,r),o.Readable=n(231),o.Writable=n(681),o.Duplex=n(682),o.Transform=n(683),o.PassThrough=n(684),o.Stream=o,o.prototype.pipe=function(e,t){var n=this;function o(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(l(),0===r.listenerCount(this,"error"))throw e}function l(){n.removeListener("data",o),e.removeListener("drain",i),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("error",c),e.on("error",c),n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e}},function(e,t){},function(e,t,n){"use strict";var r=n(175).Buffer,o=n(677);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=i,o=s,t.copy(n,o),s+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,u=1,c={},l=!1,p=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){d(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):p&&"onreadystatechange"in p.createElement("script")?(o=p.documentElement,r=function(e){var t=p.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},f.clearImmediate=h}function h(e){delete c[e]}function d(e){if(l)setTimeout(d,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(42),n(72))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(42))},function(e,t,n){"use strict";e.exports=i;var r=n(390),o=n(134);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(106),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(232)},function(e,t,n){e.exports=n(84)},function(e,t,n){e.exports=n(231).Transform},function(e,t,n){e.exports=n(231).PassThrough},function(e,t,n){"use strict";var r=n(686),o=Math.abs,i=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?r(e)*i(o(e)):e}},function(e,t,n){"use strict";e.exports=n(687)()?Math.sign:n(688)},function(e,t,n){"use strict";e.exports=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}},function(e,t,n){"use strict";e.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},function(e,t,n){"use strict";var r=n(73),o=n(176),i=n(87),a=n(691),s=n(393);e.exports=function e(t){var n,u,c;if(r(t),(n=Object(arguments[1])).async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(t,"__memoized__")&&!n.force?t:(u=s(n.length,t.length,n.async&&i.async),c=a(t,u,n),o(i,function(e,t){n[t]&&e(n[t],c,n)}),e.__profiler__&&e.__profiler__(c),c.updateEnv(),c.memoized)}},function(e,t,n){"use strict";var r=n(73),o=n(107),i=Function.prototype.bind,a=Function.prototype.call,s=Object.keys,u=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(n,c){var l,p=arguments[2],f=arguments[3];return n=Object(o(n)),r(c),l=s(n),f&&l.sort("function"==typeof f?i.call(f,n):void 0),"function"!=typeof e&&(e=l[e]),a.call(e,l,function(e,r){return u.call(n,e)?a.call(c,p,n[e],e,n,r):t})}}},function(e,t,n){"use strict";var r=n(692),o=n(395),i=n(177),a=n(702).methods,s=n(703),u=n(715),c=Function.prototype.apply,l=Function.prototype.call,p=Object.create,f=Object.defineProperties,h=a.on,d=a.emit;e.exports=function(e,t,n){var a,m,v,g,y,b,_,w,x,E,S,C,k,O,A,T=p(null);return m=!1!==t?t:isNaN(e.length)?1:e.length,n.normalizer&&(E=u(n.normalizer),v=E.get,g=E.set,y=E.delete,b=E.clear),null!=n.resolvers&&(A=s(n.resolvers)),O=v?o(function(t){var n,o,i=arguments;if(A&&(i=A(i)),null!==(n=v(i))&&hasOwnProperty.call(T,n))return S&&a.emit("get",n,i,this),T[n];if(o=1===i.length?l.call(e,this,i[0]):c.call(e,this,i),null===n){if(null!==(n=v(i)))throw r("Circular invocation","CIRCULAR_INVOCATION");n=g(i)}else if(hasOwnProperty.call(T,n))throw r("Circular invocation","CIRCULAR_INVOCATION");return T[n]=o,C&&a.emit("set",n,null,o),o},m):0===t?function(){var t;if(hasOwnProperty.call(T,"data"))return S&&a.emit("get","data",arguments,this),T.data;if(t=arguments.length?c.call(e,this,arguments):l.call(e,this),hasOwnProperty.call(T,"data"))throw r("Circular invocation","CIRCULAR_INVOCATION");return T.data=t,C&&a.emit("set","data",null,t),t}:function(t){var n,o,i=arguments;if(A&&(i=A(arguments)),o=String(i[0]),hasOwnProperty.call(T,o))return S&&a.emit("get",o,i,this),T[o];if(n=1===i.length?l.call(e,this,i[0]):c.call(e,this,i),hasOwnProperty.call(T,o))throw r("Circular invocation","CIRCULAR_INVOCATION");return T[o]=n,C&&a.emit("set",o,null,n),n},a={original:e,memoized:O,profileName:n.profileName,get:function(e){return A&&(e=A(e)),v?v(e):String(e[0])},has:function(e){return hasOwnProperty.call(T,e)},delete:function(e){var t;hasOwnProperty.call(T,e)&&(y&&y(e),t=T[e],delete T[e],k&&a.emit("delete",e,t))},clear:function(){var e=T;b&&b(),T=p(null),a.emit("clear",e)},on:function(e,t){return"get"===e?S=!0:"set"===e?C=!0:"delete"===e&&(k=!0),h.call(this,e,t)},emit:d,updateEnv:function(){e=a.original}},_=v?o(function(e){var t,n=arguments;A&&(n=A(n)),null!==(t=v(n))&&a.delete(t)},m):0===t?function(){return a.delete("data")}:function(e){return A&&(e=A(arguments)[0]),a.delete(e)},w=o(function(){var e,n=arguments;return 0===t?T.data:(A&&(n=A(n)),e=v?v(n):String(n[0]),T[e])}),x=o(function(){var e,n=arguments;return 0===t?a.has("data"):(A&&(n=A(n)),null!==(e=v?v(n):String(n[0]))&&a.has(e))}),f(O,{__memoized__:i(!0),delete:i(_),clear:i(a.clear),_get:i(w),_has:i(x)}),a}},function(e,t,n){"use strict";var r=n(394),o=n(698),i=n(85),a=Error.captureStackTrace;t=e.exports=function(e){var n=new Error(e),s=arguments[1],u=arguments[2];return i(u)||o(s)&&(u=s,s=null),i(u)&&r(n,u),i(s)&&(n.code=s),a&&a(n,t),n}},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var r=n(695),o=n(107),i=Math.max;e.exports=function(e,t){var n,a,s,u=i(arguments.length,2);for(e=Object(o(e)),s=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},a=1;a<u;++a)t=arguments[a],r(t).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(696)()?Object.keys:n(697)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var r=n(85),o=Object.keys;e.exports=function(e){return o(r(e)?Object(e):e)}},function(e,t,n){"use strict";var r=n(85),o={function:!0,object:!0};e.exports=function(e){return r(e)&&o[typeof e]||!1}},function(e,t,n){"use strict";e.exports=n(700)()?String.prototype.contains:n(701)},function(e,t,n){"use strict";var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(e,t,n){"use strict";var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";var r,o,i,a,s,u,c,l=n(177),p=n(73),f=Function.prototype.apply,h=Function.prototype.call,d=Object.create,m=Object.defineProperty,v=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};o=function(e,t){var n,o;return p(t),o=this,r.call(this,e,n=function(){i.call(o,e,n),f.call(t,this,arguments)}),n.__eeOnceListener__=t,this},s={on:r=function(e,t){var n;return p(t),g.call(this,"__ee__")?n=this.__ee__:(n=y.value=d(null),m(this,"__ee__",y),y.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},once:o,off:i=function(e,t){var n,r,o,i;if(p(t),!g.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(i=0;o=r[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===r.length?n[e]=r[i?0:1]:r.splice(i,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},emit:a=function(e){var t,n,r,o,i;if(g.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)f.call(r,this,i)}else switch(arguments.length){case 1:h.call(o,this);break;case 2:h.call(o,this,arguments[1]);break;case 3:h.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];f.call(o,this,i)}}},u={on:l(r),once:l(o),off:l(i),emit:l(a)},c=v({},u),e.exports=t=function(e){return null==e?d(c):v(Object(e),u)},t.methods=s},function(e,t,n){"use strict";var r,o=n(704),i=n(85),a=n(73),s=Array.prototype.slice;r=function(e){return this.map(function(t,n){return t?t(e[n]):e[n]}).concat(s.call(e,this.length))},e.exports=function(e){return(e=o(e)).forEach(function(e){i(e)&&a(e)}),r.bind(e)}},function(e,t,n){"use strict";var r=n(234),o=Array.isArray;e.exports=function(e){return o(e)?e:r(e)}},function(e,t,n){"use strict";e.exports=function(){var e,t,n=Array.from;return"function"==typeof n&&(t=n(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}},function(e,t,n){"use strict";var r=n(707).iterator,o=n(712),i=n(713),a=n(86),s=n(73),u=n(107),c=n(85),l=n(714),p=Array.isArray,f=Function.prototype.call,h={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(e){var t,n,m,v,g,y,b,_,w,x,E=arguments[1],S=arguments[2];if(e=Object(u(e)),c(E)&&s(E),this&&this!==Array&&i(this))t=this;else{if(!E){if(o(e))return 1!==(g=e.length)?Array.apply(null,e):((v=new Array(1))[0]=e[0],v);if(p(e)){for(v=new Array(g=e.length),n=0;n<g;++n)v[n]=e[n];return v}}v=[]}if(!p(e))if(void 0!==(w=e[r])){for(b=s(w).call(e),t&&(v=new t),_=b.next(),n=0;!_.done;)x=E?f.call(E,S,_.value,n):_.value,t?(h.value=x,d(v,n,h)):v[n]=x,_=b.next(),++n;g=n}else if(l(e)){for(g=e.length,t&&(v=new t),n=0,m=0;n<g;++n)x=e[n],n+1<g&&(y=x.charCodeAt(0))>=55296&&y<=56319&&(x+=e[++n]),x=E?f.call(E,S,x,m):x,t?(h.value=x,d(v,m,h)):v[m]=x,++m;g=m}if(void 0===g)for(g=a(e.length),t&&(v=new t(g)),n=0;n<g;++n)x=E?f.call(E,S,e[n],n):e[n],t?(h.value=x,d(v,n,h)):v[n]=x;return t&&(h.value=null,v.length=g),v}},function(e,t,n){"use strict";e.exports=n(708)()?Symbol:n(709)},function(e,t,n){"use strict";var r={object:!0,symbol:!0};e.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{String(e)}catch(e){return!1}return!!r[typeof Symbol.iterator]&&(!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag])}},function(e,t,n){"use strict";var r,o,i,a,s=n(177),u=n(710),c=Object.create,l=Object.defineProperties,p=Object.defineProperty,f=Object.prototype,h=c(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),a=!0}catch(e){}}var d,m=(d=c(null),function(e){for(var t,n,r=0;d[e+(r||"")];)++r;return d[e+=r||""]=!0,p(f,t="@@"+e,s.gs(null,function(e){n||(n=!0,p(this,t,s(e)),n=!1)})),t});i=function(e){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return o(e)},e.exports=o=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return a?r(t):(n=c(i.prototype),t=void 0===t?"":String(t),l(n,{__description__:s("",t),__name__:s("",m(t))}))},l(o,{for:s(function(e){return h[e]?h[e]:h[e]=o(String(e))}),keyFor:s(function(e){var t;for(t in u(e),h)if(h[t]===e)return t}),hasInstance:s("",r&&r.hasInstance||o("hasInstance")),isConcatSpreadable:s("",r&&r.isConcatSpreadable||o("isConcatSpreadable")),iterator:s("",r&&r.iterator||o("iterator")),match:s("",r&&r.match||o("match")),replace:s("",r&&r.replace||o("replace")),search:s("",r&&r.search||o("search")),species:s("",r&&r.species||o("species")),split:s("",r&&r.split||o("split")),toPrimitive:s("",r&&r.toPrimitive||o("toPrimitive")),toStringTag:s("",r&&r.toStringTag||o("toStringTag")),unscopables:s("",r&&r.unscopables||o("unscopables"))}),l(i.prototype,{constructor:s(o),toString:s("",function(){return this.__name__})}),l(o.prototype,{toString:s(function(){return"Symbol ("+u(this).__description__+")"}),valueOf:s(function(){return u(this)})}),p(o.prototype,o.toPrimitive,s("",function(){var e=u(this);return"symbol"==typeof e?e:e.toString()})),p(o.prototype,o.toStringTag,s("c","Symbol")),p(i.prototype,o.toStringTag,s("c",o.prototype[o.toStringTag])),p(i.prototype,o.toPrimitive,s("c",o.prototype[o.toPrimitive]))},function(e,t,n){"use strict";var r=n(711);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}},function(e,t,n){"use strict";e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call(function(){return arguments}());e.exports=function(e){return r.call(e)===o}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call(n(392));e.exports=function(e){return"function"==typeof e&&r.call(e)===o}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===o)||!1}},function(e,t,n){"use strict";var r=n(73);e.exports=function(e){var t;return"function"==typeof e?{set:e,get:e}:(t={get:r(e.get)},void 0!==e.set?(t.set=r(e.set),e.delete&&(t.delete=r(e.delete)),e.clear&&(t.clear=r(e.clear)),t):(t.set=t.get,t))}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r=e.length;if(!r)return"";for(t=String(e[n=0]);--r;)t+=""+e[++n];return t}},function(e,t,n){"use strict";e.exports=function(e){return e?function(t){for(var n=String(t[0]),r=0,o=e;--o;)n+=""+t[++r];return n}:function(){return""}}},function(e,t,n){"use strict";var r=n(235),o=Object.create;e.exports=function(){var e=0,t=[],n=o(null);return{get:function(e){var n,o=0,i=t,a=e.length;if(0===a)return i[a]||null;if(i=i[a]){for(;o<a-1;){if(-1===(n=r.call(i[0],e[o])))return null;i=i[1][n],++o}return-1===(n=r.call(i[0],e[o]))?null:i[1][n]||null}return null},set:function(o){var i,a=0,s=t,u=o.length;if(0===u)s[u]=++e;else{for(s[u]||(s[u]=[[],[]]),s=s[u];a<u-1;)-1===(i=r.call(s[0],o[a]))&&(i=s[0].push(o[a])-1,s[1].push([[],[]])),s=s[1][i],++a;-1===(i=r.call(s[0],o[a]))&&(i=s[0].push(o[a])-1),s[1][i]=++e}return n[e]=o,e},delete:function(e){var o,i=0,a=t,s=n[e],u=s.length,c=[];if(0===u)delete a[u];else if(a=a[u]){for(;i<u-1;){if(-1===(o=r.call(a[0],s[i])))return;c.push(a,o),a=a[1][o],++i}if(-1===(o=r.call(a[0],s[i])))return;for(e=a[1][o],a[0].splice(o,1),a[1].splice(o,1);!a[0].length&&c.length;)o=c.pop(),(a=c.pop())[0].splice(o,1),a[1].splice(o,1)}delete n[e]},clear:function(){t=[],n=o(null)}}}},function(e,t,n){"use strict";e.exports=n(720)()?Number.isNaN:n(721)},function(e,t,n){"use strict";e.exports=function(){var e=Number.isNaN;return"function"==typeof e&&(!e({})&&e(NaN)&&!e(34))}},function(e,t,n){"use strict";e.exports=function(e){return e!=e}},function(e,t,n){"use strict";var r=n(235);e.exports=function(){var e=0,t=[],n=[];return{get:function(e){var o=r.call(t,e[0]);return-1===o?null:n[o]},set:function(r){return t.push(r[0]),n.push(++e),e},delete:function(e){var o=r.call(n,e);-1!==o&&(t.splice(o,1),n.splice(o,1))},clear:function(){t=[],n=[]}}}},function(e,t,n){"use strict";var r=n(235),o=Object.create;e.exports=function(e){var t=0,n=[[],[]],i=o(null);return{get:function(t){for(var o,i=0,a=n;i<e-1;){if(-1===(o=r.call(a[0],t[i])))return null;a=a[1][o],++i}return-1===(o=r.call(a[0],t[i]))?null:a[1][o]||null},set:function(o){for(var a,s=0,u=n;s<e-1;)-1===(a=r.call(u[0],o[s]))&&(a=u[0].push(o[s])-1,u[1].push([[],[]])),u=u[1][a],++s;return-1===(a=r.call(u[0],o[s]))&&(a=u[0].push(o[s])-1),u[1][a]=++t,i[t]=o,t},delete:function(t){for(var o,a=0,s=n,u=[],c=i[t];a<e-1;){if(-1===(o=r.call(s[0],c[a])))return;u.push(s,o),s=s[1][o],++a}if(-1!==(o=r.call(s[0],c[a]))){for(t=s[1][o],s[0].splice(o,1),s[1].splice(o,1);!s[0].length&&u.length;)o=u.pop(),(s=u.pop())[0].splice(o,1),s[1].splice(o,1);delete i[t]}},clear:function(){n=[[],[]],i=o(null)}}}},function(e,t,n){"use strict";var r=n(234),o=n(397),i=n(396),a=n(395),s=n(236),u=Array.prototype.slice,c=Function.prototype.apply,l=Object.create;n(87).async=function(e,t){var n,p,f,h=l(null),d=l(null),m=t.memoized,v=t.original;t.memoized=a(function(e){var t=arguments,r=t[t.length-1];return"function"==typeof r&&(n=r,t=u.call(t,0,-1)),m.apply(p=this,f=t)},m);try{i(t.memoized,m)}catch(e){}t.on("get",function(e){var r,o,i;if(n){if(h[e])return"function"==typeof h[e]?h[e]=[h[e],n]:h[e].push(n),void(n=null);r=n,o=p,i=f,n=p=f=null,s(function(){var a;hasOwnProperty.call(d,e)?(a=d[e],t.emit("getasync",e,i,o),c.call(r,a.context,a.args)):(n=r,p=o,f=i,m.apply(o,i))})}}),t.original=function(){var e,o,i,a;return n?(e=r(arguments),o=function e(n){var o,i,u=e.id;if(null!=u){if(delete e.id,o=h[u],delete h[u],o)return i=r(arguments),t.has(u)&&(n?t.delete(u):(d[u]={context:this,args:i},t.emit("setasync",u,"function"==typeof o?1:o.length))),"function"==typeof o?a=c.call(o,this,i):o.forEach(function(e){a=c.call(e,this,i)},this),a}else s(c.bind(e,this,arguments))},i=n,n=p=f=null,e.push(o),a=c.call(v,this,e),o.cb=i,n=o,a):c.call(v,this,arguments)},t.on("set",function(e){n?(h[e]?"function"==typeof h[e]?h[e]=[h[e],n.cb]:h[e].push(n.cb):h[e]=n.cb,delete n.cb,n.id=e,n=null):t.delete(e)}),t.on("delete",function(e){var n;hasOwnProperty.call(h,e)||d[e]&&(n=d[e],delete d[e],t.emit("deleteasync",e,u.call(n.args,1)))}),t.on("clear",function(){var e=d;d=l(null),t.emit("clearasync",o(e,function(e){return u.call(e.args,1)}))})}},function(e,t,n){"use strict";var r=n(397),o=n(726),i=n(727),a=n(729),s=n(398),u=n(236),c=Object.create,l=o("then","then:finally","done","done:finally");n(87).promise=function(e,t){var n=c(null),o=c(null),p=c(null);if(!0===e)e=null;else if(e=i(e),!l[e])throw new TypeError("'"+a(e)+"' is not valid promise mode");t.on("set",function(r,i,a){var c=!1;if(!s(a))return o[r]=a,void t.emit("setasync",r,1);n[r]=1,p[r]=a;var l=function(e){var i=n[r];if(c)throw new Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");i&&(delete n[r],o[r]=e,t.emit("setasync",r,i))},f=function(){c=!0,n[r]&&(delete n[r],delete p[r],t.delete(r))},h=e;if(h||(h="then"),"then"===h)a.then(function(e){u(l.bind(this,e))},function(){u(f)});else if("done"===h){if("function"!=typeof a.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");a.done(l,f)}else if("done:finally"===h){if("function"!=typeof a.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof a.finally)throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");a.done(l),a.finally(f)}}),t.on("get",function(e,r,o){var i;if(n[e])++n[e];else{i=p[e];var a=function(){t.emit("getasync",e,r,o)};s(i)?"function"==typeof i.done?i.done(a):i.then(function(){u(a)}):a()}}),t.on("delete",function(e){if(delete p[e],n[e])delete n[e];else if(hasOwnProperty.call(o,e)){var r=o[e];delete o[e],t.emit("deleteasync",e,[r])}}),t.on("clear",function(){var e=o;o=c(null),n=c(null),p=c(null),t.emit("clearasync",r(e,function(e){return[e]}))})}},function(e,t,n){"use strict";var r=Array.prototype.forEach,o=Object.create;e.exports=function(e){var t=o(null);return r.call(arguments,function(e){t[e]=!0}),t}},function(e,t,n){"use strict";var r=n(107),o=n(728);e.exports=function(e){return o(r(e))}},function(e,t,n){"use strict";var r=n(233);e.exports=function(e){try{return e&&r(e.toString)?e.toString():String(e)}catch(e){throw new TypeError("Passed argument cannot be stringifed")}}},function(e,t,n){"use strict";var r=n(730),o=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=r(e);return t.length>100&&(t=t.slice(0,99)+"…"),t=t.replace(o,function(e){return JSON.stringify(e).slice(1,-1)})}},function(e,t,n){"use strict";var r=n(233);e.exports=function(e){try{return e&&r(e.toString)?e.toString():String(e)}catch(e){return"[Non-coercible (to string) value]"}}},function(e,t,n){"use strict";var r=n(73),o=n(176),i=n(87),a=Function.prototype.apply;i.dispose=function(e,t,n){var s;if(r(e),n.async&&i.async||n.promise&&i.promise)return t.on("deleteasync",s=function(t,n){a.call(e,null,n)}),void t.on("clearasync",function(e){o(e,function(e,t){s(t,e)})});t.on("delete",s=function(t,n){e(n)}),t.on("clear",function(e){o(e,function(e,t){s(t,e)})})}},function(e,t,n){"use strict";var r=n(234),o=n(176),i=n(236),a=n(398),s=n(733),u=n(87),c=Function.prototype,l=Math.max,p=Math.min,f=Object.create;u.maxAge=function(e,t,n){var h,d,m,v;(e=s(e))&&(h=f(null),d=n.async&&u.async||n.promise&&u.promise?"async":"",t.on("set"+d,function(n){h[n]=setTimeout(function(){t.delete(n)},e),"function"==typeof h[n].unref&&h[n].unref(),v&&(v[n]&&"nextTick"!==v[n]&&clearTimeout(v[n]),v[n]=setTimeout(function(){delete v[n]},m),"function"==typeof v[n].unref&&v[n].unref())}),t.on("delete"+d,function(e){clearTimeout(h[e]),delete h[e],v&&("nextTick"!==v[e]&&clearTimeout(v[e]),delete v[e])}),n.preFetch&&(m=!0===n.preFetch||isNaN(n.preFetch)?.333:l(p(Number(n.preFetch),1),0))&&(v={},m=(1-m)*e,t.on("get"+d,function(e,o,s){v[e]||(v[e]="nextTick",i(function(){var i;"nextTick"===v[e]&&(delete v[e],t.delete(e),n.async&&(o=r(o)).push(c),i=t.memoized.apply(s,o),n.promise&&a(i)&&("function"==typeof i.done?i.done(c,c):i.then(c,c)))}))})),t.on("clear"+d,function(){o(h,function(e){clearTimeout(e)}),h={},v&&(o(v,function(e){"nextTick"!==e&&clearTimeout(e)}),v={})}))}},function(e,t,n){"use strict";var r=n(86),o=n(734);e.exports=function(e){if((e=r(e))>o)throw new TypeError(e+" exceeds maximum possible timeout");return e}},function(e,t,n){"use strict";e.exports=2147483647},function(e,t,n){"use strict";var r=n(86),o=n(736),i=n(87);i.max=function(e,t,n){var a,s,u;(e=r(e))&&(s=o(e),a=n.async&&i.async||n.promise&&i.promise?"async":"",t.on("set"+a,u=function(e){void 0!==(e=s.hit(e))&&t.delete(e)}),t.on("get"+a,u),t.on("delete"+a,s.delete),t.on("clear"+a,s.clear))}},function(e,t,n){"use strict";var r=n(86),o=Object.create,i=Object.prototype.hasOwnProperty;e.exports=function(e){var t,n=0,a=1,s=o(null),u=o(null),c=0;return e=r(e),{hit:function(r){var o=u[r],l=++c;if(s[l]=r,u[r]=l,!o){if(++n<=e)return;return r=s[a],t(r),r}if(delete s[o],a===o)for(;!i.call(s,++a);)continue},delete:t=function(e){var t=u[e];if(t&&(delete s[t],delete u[e],--n,a===t)){if(!n)return c=0,void(a=1);for(;!i.call(s,++a);)continue}},clear:function(){n=0,a=1,s=o(null),u=o(null),c=0}}}},function(e,t,n){"use strict";var r=n(177),o=n(87),i=Object.create,a=Object.defineProperties;o.refCounter=function(e,t,n){var s,u;s=i(null),u=n.async&&o.async||n.promise&&o.promise?"async":"",t.on("set"+u,function(e,t){s[e]=t||1}),t.on("get"+u,function(e){++s[e]}),t.on("delete"+u,function(e){delete s[e]}),t.on("clear"+u,function(){s={}}),a(t.memoized,{deleteRef:r(function(){var e=t.get(arguments);return null===e?null:s[e]?!--s[e]&&(t.delete(e),!0):null}),getRefCount:r(function(){var e=t.get(arguments);return null===e?0:s[e]?s[e]:0})})}},function(e,t){e.exports=function(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}},function(e,t,n){var r=n(14);e.exports=function(e){if(r(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t,n){var r=n(741),o=n(744);e.exports=function(e){if(o(Object(e))||"[object Arguments]"===Object.prototype.toString.call(e))return r(e)}},function(e,t,n){e.exports=n(742)},function(e,t,n){n(97),n(743),e.exports=n(22).Array.from},function(e,t,n){"use strict";var r=n(60),o=n(30),i=n(79),a=n(399),s=n(400),u=n(154),c=n(401),l=n(217);o(o.S+o.F*!n(402)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,o,p,f=i(e),h="function"==typeof this?this:Array,d=arguments.length,m=d>1?arguments[1]:void 0,v=void 0!==m,g=0,y=l(f);if(v&&(m=r(m,d>2?arguments[2]:void 0,2)),null==y||h==Array&&s(y))for(n=new h(t=u(f.length));t>g;g++)c(n,g,v?m(f[g],g):f[g]);else for(p=y.call(f),n=new h;!(o=p.next()).done;g++)c(n,g,v?a(p,m,[o.value,g],!0):o.value);return n.length=g,n}})},function(e,t,n){e.exports=n(745)},function(e,t,n){n(99),n(97),e.exports=n(746)},function(e,t,n){var r=n(162),o=n(34)("iterator"),i=n(98);e.exports=n(22).isIterable=function(e){var t=Object(e);return void 0!==t[o]||"@@iterator"in t||i.hasOwnProperty(r(t))}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t,n){n(749);var r=n(22).Object;e.exports=function(e,t){return r.defineProperties(e,t)}},function(e,t,n){var r=n(30);r(r.S+r.F*!n(46),"Object",{defineProperties:n(345)})},function(e,t,n){n(751),e.exports=n(22).Object.getOwnPropertyDescriptors},function(e,t,n){var r=n(30),o=n(752),i=n(70),a=n(159),s=n(401);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=i(e),u=a.f,c=o(r),l={},p=0;c.length>p;)void 0!==(n=u(r,t=c[p++]))&&s(l,t,n);return l}})},function(e,t,n){var r=n(216),o=n(157),i=n(45),a=n(32).Reflect;e.exports=a&&a.ownKeys||function(e){var t=r.f(i(e)),n=o.f;return n?t.concat(n(e)):t}},function(e,t,n){n(754);var r=n(22).Object;e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)}},function(e,t,n){var r=n(70),o=n(159).f;n(208)("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},function(e,t,n){n(349),e.exports=n(22).Object.getOwnPropertySymbols},function(e,t,n){var r=n(17);e.exports=function(e,t){if(null==e)return{};var n,o,i={},a=r(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}},function(e,t,n){n(758),e.exports=n(22).Date.now},function(e,t,n){var r=n(30);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){n(160),n(97),n(99),n(760),n(764),n(765),e.exports=n(22).Promise},function(e,t,n){"use strict";var r,o,i,a,s=n(128),u=n(32),c=n(60),l=n(162),p=n(30),f=n(41),h=n(129),d=n(178),m=n(108),v=n(403),g=n(404).set,y=n(762)(),b=n(237),_=n(405),w=n(763),x=n(406),E=u.TypeError,S=u.process,C=S&&S.versions,k=C&&C.v8||"",O=u.Promise,A="process"==l(S),T=function(){},j=o=b.f,P=!!function(){try{var e=O.resolve(1),t=(e.constructor={})[n(34)("species")]=function(e){e(T,T)};return(A||"function"==typeof PromiseRejectionEvent)&&e.then(T)instanceof t&&0!==k.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(e){}}(),I=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},M=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,s=o?t.ok:t.fail,u=t.resolve,c=t.reject,l=t.domain;try{s?(o||(2==e._h&&D(e),e._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),a=!0)),n===t.promise?c(E("Promise-chain cycle")):(i=I(n))?i.call(n,u,c):u(n)):c(r)}catch(e){l&&!a&&l.exit(),c(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&N(e)})}},N=function(e){g.call(u,function(){var t,n,r,o=e._v,i=R(e);if(i&&(t=_(function(){A?S.emit("unhandledRejection",o,e):(n=u.onunhandledrejection)?n({promise:e,reason:o}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=A||R(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},R=function(e){return 1!==e._h&&0===(e._a||e._c).length},D=function(e){g.call(u,function(){var t;A?S.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},L=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),M(t,!0))},U=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw E("Promise can't be resolved itself");(t=I(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,c(U,r,1),c(L,r,1))}catch(e){L.call(r,e)}}):(n._v=e,n._s=1,M(n,!1))}catch(e){L.call({_w:n,_d:!1},e)}}};P||(O=function(e){d(this,O,"Promise","_h"),h(e),r.call(this);try{e(c(U,this,1),c(L,this,1))}catch(e){L.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(179)(O.prototype,{then:function(e,t){var n=j(v(this,O));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=A?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=c(U,e,1),this.reject=c(L,e,1)},b.f=j=function(e){return e===O||e===a?new i(e):o(e)}),p(p.G+p.W+p.F*!P,{Promise:O}),n(131)(O,"Promise"),n(407)("Promise"),a=n(22).Promise,p(p.S+p.F*!P,"Promise",{reject:function(e){var t=j(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(s||!P),"Promise",{resolve:function(e){return x(s&&this===a?O:this,e)}}),p(p.S+p.F*!(P&&n(402)(function(e){O.all(e).catch(T)})),"Promise",{all:function(e){var t=this,n=j(t),r=n.resolve,o=n.reject,i=_(function(){var n=[],i=0,a=1;m(e,!1,function(e){var s=i++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=j(t),r=n.reject,o=_(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(32),o=n(404).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(127)(a);e.exports=function(){var e,t,n,c=function(){var r,o;for(u&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve(void 0);n=function(){l.then(c)}}else n=function(){o.call(r,c)};else{var p=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t,n){var r=n(32).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){"use strict";var r=n(30),o=n(22),i=n(32),a=n(403),s=n(406);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,o.Promise||i.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(30),o=n(237),i=n(405);r(r.S,"Promise",{try:function(e){var t=o.f(this),n=i(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,i=Object.create(o.prototype),a=new O(r||[]);return i._invoke=function(e,t,n){var r=l;return function(o,i){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return T()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?h:p,u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",p="suspendedYield",f="executing",h="completed",d={};function m(){}function v(){}function g(){}var y={};y[i]=function(){return this};var b=Object.getPrototypeOf,_=b&&b(b(A([])));_&&_!==n&&r.call(_,i)&&(y=_);var w=g.prototype=m.prototype=Object.create(y);function x(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function E(e){var t;this._invoke=function(n,o){function i(){return new Promise(function(t,i){!function t(n,o,i,a){var s=c(e[n],e,o);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,i,a)},function(e){t("throw",e,i,a)}):Promise.resolve(l).then(function(e){u.value=e,i(u)},function(e){return t("throw",e,i,a)})}a(s.arg)}(n,o,t,i)})}return t=t?t.then(i,i):i()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=c(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function A(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:T}}function T(){return{value:t,done:!0}}return v.prototype=w.constructor=g,g.constructor=v,g[s]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},x(E.prototype),E.prototype[a]=function(){return this},e.AsyncIterator=E,e.async=function(t,n,r,o){var i=new E(u(t,n,r,o));return e.isGeneratorFunction(n)?i:i.next().then(function(e){return e.done?e.value:i.next()})},x(w),w[s]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=A,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";var r=n(768),o=n(787);function i(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}e.exports.Type=n(31),e.exports.Schema=n(110),e.exports.FAILSAFE_SCHEMA=n(238),e.exports.JSON_SCHEMA=n(409),e.exports.CORE_SCHEMA=n(408),e.exports.DEFAULT_SAFE_SCHEMA=n(136),e.exports.DEFAULT_FULL_SCHEMA=n(180),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.safeLoad=r.safeLoad,e.exports.safeLoadAll=r.safeLoadAll,e.exports.dump=o.dump,e.exports.safeDump=o.safeDump,e.exports.YAMLException=n(135),e.exports.MINIMAL_SCHEMA=n(238),e.exports.SAFE_SCHEMA=n(136),e.exports.DEFAULT_SCHEMA=n(180),e.exports.scan=i("scan"),e.exports.parse=i("parse"),e.exports.compose=i("compose"),e.exports.addConstructor=i("addConstructor")},function(e,t,n){"use strict";var r=n(109),o=n(135),i=n(769),a=n(136),s=n(180),u=Object.prototype.hasOwnProperty,c=1,l=2,p=3,f=4,h=1,d=2,m=3,v=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g=/[\x85\u2028\u2029]/,y=/[,\[\]\{\}]/,b=/^(?:!|!!|![a-z\-]+!)$/i,_=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function w(e){return Object.prototype.toString.call(e)}function x(e){return 10===e||13===e}function E(e){return 9===e||32===e}function S(e){return 9===e||32===e||10===e||13===e}function C(e){return 44===e||91===e||93===e||123===e||125===e}function k(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function O(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e?"\t":9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function A(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var T=new Array(256),j=new Array(256),P=0;P<256;P++)T[P]=O(P)?1:0,j[P]=O(P);function I(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||s,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function M(e,t){return new o(t,new i(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function N(e,t){throw M(e,t)}function R(e,t){e.onWarning&&e.onWarning.call(null,M(e,t))}var D={YAML:function(e,t,n){var r,o,i;null!==e.version&&N(e,"duplication of %YAML directive"),1!==n.length&&N(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&N(e,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),i=parseInt(r[2],10),1!==o&&N(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=i<2,1!==i&&2!==i&&R(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,o;2!==n.length&&N(e,"TAG directive accepts exactly two arguments"),r=n[0],o=n[1],b.test(r)||N(e,"ill-formed tag handle (first argument) of the TAG directive"),u.call(e.tagMap,r)&&N(e,'there is a previously declared suffix for "'+r+'" tag handle'),_.test(o)||N(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=o}};function L(e,t,n,r){var o,i,a,s;if(t<n){if(s=e.input.slice(t,n),r)for(o=0,i=s.length;o<i;o+=1)9===(a=s.charCodeAt(o))||32<=a&&a<=1114111||N(e,"expected valid JSON character");else v.test(s)&&N(e,"the stream contains non-printable characters");e.result+=s}}function U(e,t,n,o){var i,a,s,c;for(r.isObject(n)||N(e,"cannot merge mappings; the provided source object is unacceptable"),s=0,c=(i=Object.keys(n)).length;s<c;s+=1)a=i[s],u.call(t,a)||(t[a]=n[a],o[a]=!0)}function q(e,t,n,r,o,i,a,s){var c,l;if(Array.isArray(o))for(c=0,l=(o=Array.prototype.slice.call(o)).length;c<l;c+=1)Array.isArray(o[c])&&N(e,"nested arrays are not supported inside keys"),"object"==typeof o&&"[object Object]"===w(o[c])&&(o[c]="[object Object]");if("object"==typeof o&&"[object Object]"===w(o)&&(o="[object Object]"),o=String(o),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(i))for(c=0,l=i.length;c<l;c+=1)U(e,t,i[c],n);else U(e,t,i,n);else e.json||u.call(n,o)||!u.call(t,o)||(e.line=a||e.line,e.position=s||e.position,N(e,"duplicated mapping key")),t[o]=i,delete n[o];return t}function F(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):N(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function z(e,t,n){for(var r=0,o=e.input.charCodeAt(e.position);0!==o;){for(;E(o);)o=e.input.charCodeAt(++e.position);if(t&&35===o)do{o=e.input.charCodeAt(++e.position)}while(10!==o&&13!==o&&0!==o);if(!x(o))break;for(F(e),o=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&R(e,"deficient indentation"),r}function B(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!S(t)))}function V(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}function H(e,t){var n,r,o=e.tag,i=e.anchor,a=[],s=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),r=e.input.charCodeAt(e.position);0!==r&&45===r&&S(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,z(e,!0,-1)&&e.lineIndent<=t)a.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,Y(e,t,p,!1,!0),a.push(e.result),z(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)N(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=o,e.anchor=i,e.kind="sequence",e.result=a,!0)}function W(e){var t,n,r,o,i=!1,a=!1;if(33!==(o=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&N(e,"duplication of a tag property"),60===(o=e.input.charCodeAt(++e.position))?(i=!0,o=e.input.charCodeAt(++e.position)):33===o?(a=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",t=e.position,i){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&62!==o);e.position<e.length?(r=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):N(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==o&&!S(o);)33===o&&(a?N(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),b.test(n)||N(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),y.test(r)&&N(e,"tag suffix cannot contain flow indicator characters")}return r&&!_.test(r)&&N(e,"tag name cannot contain such characters: "+r),i?e.tag=r:u.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:N(e,'undeclared tag handle "'+n+'"'),!0}function J(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&N(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!S(n)&&!C(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Y(e,t,n,o,i){var a,s,v,g,y,b,_,w,O=1,P=!1,I=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=s=v=f===n||p===n,o&&z(e,!0,-1)&&(P=!0,e.lineIndent>t?O=1:e.lineIndent===t?O=0:e.lineIndent<t&&(O=-1)),1===O)for(;W(e)||J(e);)z(e,!0,-1)?(P=!0,v=a,e.lineIndent>t?O=1:e.lineIndent===t?O=0:e.lineIndent<t&&(O=-1)):v=!1;if(v&&(v=P||i),1!==O&&f!==n||(_=c===n||l===n?t:t+1,w=e.position-e.lineStart,1===O?v&&(H(e,w)||function(e,t,n){var r,o,i,a,s,u=e.tag,c=e.anchor,p={},h={},d=null,m=null,v=null,g=!1,y=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=p),s=e.input.charCodeAt(e.position);0!==s;){if(r=e.input.charCodeAt(e.position+1),i=e.line,a=e.position,63!==s&&58!==s||!S(r)){if(!Y(e,n,l,!1,!0))break;if(e.line===i){for(s=e.input.charCodeAt(e.position);E(s);)s=e.input.charCodeAt(++e.position);if(58===s)S(s=e.input.charCodeAt(++e.position))||N(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(q(e,p,h,d,m,null),d=m=v=null),y=!0,g=!1,o=!1,d=e.tag,m=e.result;else{if(!y)return e.tag=u,e.anchor=c,!0;N(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return e.tag=u,e.anchor=c,!0;N(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(g&&(q(e,p,h,d,m,null),d=m=v=null),y=!0,g=!0,o=!0):g?(g=!1,o=!0):N(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,s=r;if((e.line===i||e.lineIndent>t)&&(Y(e,t,f,!0,o)&&(g?m=e.result:v=e.result),g||(q(e,p,h,d,m,v,i,a),d=m=v=null),z(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)N(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return g&&q(e,p,h,d,m,null),y&&(e.tag=u,e.anchor=c,e.kind="mapping",e.result=p),y}(e,w,_))||function(e,t){var n,r,o,i,a,s,u,l,p,f,h=!0,d=e.tag,m=e.anchor,v={};if(91===(f=e.input.charCodeAt(e.position)))o=93,s=!1,r=[];else{if(123!==f)return!1;o=125,s=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),f=e.input.charCodeAt(++e.position);0!==f;){if(z(e,!0,t),(f=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=d,e.anchor=m,e.kind=s?"mapping":"sequence",e.result=r,!0;h||N(e,"missed comma between flow collection entries"),p=null,i=a=!1,63===f&&S(e.input.charCodeAt(e.position+1))&&(i=a=!0,e.position++,z(e,!0,t)),n=e.line,Y(e,t,c,!1,!0),l=e.tag,u=e.result,z(e,!0,t),f=e.input.charCodeAt(e.position),!a&&e.line!==n||58!==f||(i=!0,f=e.input.charCodeAt(++e.position),z(e,!0,t),Y(e,t,c,!1,!0),p=e.result),s?q(e,r,v,l,u,p):i?r.push(q(e,null,v,l,u,p)):r.push(u),z(e,!0,t),44===(f=e.input.charCodeAt(e.position))?(h=!0,f=e.input.charCodeAt(++e.position)):h=!1}N(e,"unexpected end of the stream within a flow collection")}(e,_)?I=!0:(s&&function(e,t){var n,o,i,a,s,u=h,c=!1,l=!1,p=t,f=0,v=!1;if(124===(a=e.input.charCodeAt(e.position)))o=!1;else{if(62!==a)return!1;o=!0}for(e.kind="scalar",e.result="";0!==a;)if(43===(a=e.input.charCodeAt(++e.position))||45===a)h===u?u=43===a?m:d:N(e,"repeat of a chomping mode identifier");else{if(!((i=48<=(s=a)&&s<=57?s-48:-1)>=0))break;0===i?N(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?N(e,"repeat of an indentation width identifier"):(p=t+i-1,l=!0)}if(E(a)){do{a=e.input.charCodeAt(++e.position)}while(E(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!x(a)&&0!==a)}for(;0!==a;){for(F(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!l||e.lineIndent<p)&&32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>p&&(p=e.lineIndent),x(a))f++;else{if(e.lineIndent<p){u===m?e.result+=r.repeat("\n",c?1+f:f):u===h&&c&&(e.result+="\n");break}for(o?E(a)?(v=!0,e.result+=r.repeat("\n",c?1+f:f)):v?(v=!1,e.result+=r.repeat("\n",f+1)):0===f?c&&(e.result+=" "):e.result+=r.repeat("\n",f):e.result+=r.repeat("\n",c?1+f:f),c=!0,l=!0,f=0,n=e.position;!x(a)&&0!==a;)a=e.input.charCodeAt(++e.position);L(e,n,e.position,!1)}}return!0}(e,_)||function(e,t){var n,r,o;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(L(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,o=e.position}else x(n)?(L(e,r,o,!0),V(e,z(e,!1,t)),r=o=e.position):e.position===e.lineStart&&B(e)?N(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);N(e,"unexpected end of the stream within a single quoted scalar")}(e,_)||function(e,t){var n,r,o,i,a,s,u;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return L(e,n,e.position,!0),e.position++,!0;if(92===s){if(L(e,n,e.position,!0),x(s=e.input.charCodeAt(++e.position)))z(e,!1,t);else if(s<256&&T[s])e.result+=j[s],e.position++;else if((a=120===(u=s)?2:117===u?4:85===u?8:0)>0){for(o=a,i=0;o>0;o--)(a=k(s=e.input.charCodeAt(++e.position)))>=0?i=(i<<4)+a:N(e,"expected hexadecimal character");e.result+=A(i),e.position++}else N(e,"unknown escape sequence");n=r=e.position}else x(s)?(L(e,n,r,!0),V(e,z(e,!1,t)),n=r=e.position):e.position===e.lineStart&&B(e)?N(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}N(e,"unexpected end of the stream within a double quoted scalar")}(e,_)?I=!0:!function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!S(r)&&!C(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||N(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],z(e,!0,-1),!0}(e)?function(e,t,n){var r,o,i,a,s,u,c,l,p=e.kind,f=e.result;if(S(l=e.input.charCodeAt(e.position))||C(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(S(r=e.input.charCodeAt(e.position+1))||n&&C(r)))return!1;for(e.kind="scalar",e.result="",o=i=e.position,a=!1;0!==l;){if(58===l){if(S(r=e.input.charCodeAt(e.position+1))||n&&C(r))break}else if(35===l){if(S(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&B(e)||n&&C(l))break;if(x(l)){if(s=e.line,u=e.lineStart,c=e.lineIndent,z(e,!1,-1),e.lineIndent>=t){a=!0,l=e.input.charCodeAt(e.position);continue}e.position=i,e.line=s,e.lineStart=u,e.lineIndent=c;break}}a&&(L(e,o,i,!1),V(e,e.line-s),o=i=e.position,a=!1),E(l)||(i=e.position+1),l=e.input.charCodeAt(++e.position)}return L(e,o,i,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,_,c===n)&&(I=!0,null===e.tag&&(e.tag="?")):(I=!0,null===e.tag&&null===e.anchor||N(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===O&&(I=v&&H(e,w))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(g=0,y=e.implicitTypes.length;g<y;g+=1)if((b=e.implicitTypes[g]).resolve(e.result)){e.result=b.construct(e.result),e.tag=b.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else u.call(e.typeMap[e.kind||"fallback"],e.tag)?(b=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&b.kind!==e.kind&&N(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result)?(e.result=b.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):N(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):N(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||I}function K(e){var t,n,r,o,i=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(o=e.input.charCodeAt(e.position))&&(z(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==o));){for(a=!0,o=e.input.charCodeAt(++e.position),t=e.position;0!==o&&!S(o);)o=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&N(e,"directive name must not be less than one character in length");0!==o;){for(;E(o);)o=e.input.charCodeAt(++e.position);if(35===o){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&!x(o));break}if(x(o))break;for(t=e.position;0!==o&&!S(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==o&&F(e),u.call(D,n)?D[n](e,n,r):R(e,'unknown document directive "'+n+'"')}z(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,z(e,!0,-1)):a&&N(e,"directives end mark is expected"),Y(e,e.lineIndent-1,f,!1,!0),z(e,!0,-1),e.checkLineBreaks&&g.test(e.input.slice(i,e.position))&&R(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&B(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,z(e,!0,-1)):e.position<e.length-1&&N(e,"end of the stream or a document separator is expected")}function G(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new I(e,t);for(n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)K(n);return n.documents}function $(e,t,n){var r,o,i=G(e,n);if("function"!=typeof t)return i;for(r=0,o=i.length;r<o;r+=1)t(i[r])}function Z(e,t){var n=G(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new o("expected a single document in the stream, but found more")}}e.exports.loadAll=$,e.exports.load=Z,e.exports.safeLoadAll=function(e,t,n){if("function"!=typeof t)return $(e,r.extend({schema:a},n));$(e,t,r.extend({schema:a},n))},e.exports.safeLoad=function(e,t){return Z(e,r.extend({schema:a},t))}},function(e,t,n){"use strict";var r=n(109);function o(e,t,n,r,o){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=o}o.prototype.getSnippet=function(e,t){var n,o,i,a,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",o=this.position;o>0&&-1==="\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(o-1));)if(o-=1,this.position-o>t/2-1){n=" ... ",o+=5;break}for(i="",a=this.position;a<this.buffer.length&&-1==="\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(a));)if((a+=1)-this.position>t/2-1){i=" ... ",a-=5;break}return s=this.buffer.slice(o,a),r.repeat(" ",e)+n+s+i+"\n"+r.repeat(" ",e+this.position-o+n.length)+"^"},o.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},e.exports=o},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(109),o=n(31);function i(e){return 48<=e&&e<=55}function a(e){return 48<=e&&e<=57}e.exports=new o("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,o=0,s=!1;if(!r)return!1;if("-"!==(t=e[o])&&"+"!==t||(t=e[++o]),"0"===t){if(o+1===r)return!0;if("b"===(t=e[++o])){for(o++;o<r;o++)if("_"!==(t=e[o])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(o++;o<r;o++)if("_"!==(t=e[o])){if(!(48<=(n=e.charCodeAt(o))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==t}for(;o<r;o++)if("_"!==(t=e[o])){if(!i(e.charCodeAt(o)))return!1;s=!0}return s&&"_"!==t}if("_"===t)return!1;for(;o<r;o++)if("_"!==(t=e[o])){if(":"===t)break;if(!a(e.charCodeAt(o)))return!1;s=!0}return!(!s||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(o)))},construct:function(e){var t,n,r=e,o=1,i=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(t=r[0])&&"+"!==t||("-"===t&&(o=-1),t=(r=r.slice(1))[0]),"0"===r?0:"0"===t?"b"===r[1]?o*parseInt(r.slice(2),2):"x"===r[1]?o*parseInt(r,16):o*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(e){i.unshift(parseInt(e,10))}),r=0,n=1,i.forEach(function(e){r+=e*n,n*=60}),o*r):o*parseInt(r,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!r.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(e,t,n){"use strict";var r=n(109),o=n(31),i=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var a=/^[-+]?[0-9]+e/;e.exports=new o("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!i.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,r,o;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,o=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(e){o.unshift(parseFloat(e,10))}),t=0,r=1,o.forEach(function(e){t+=e*r,r*=60}),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||r.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(e))return"-0.0";return n=e.toString(10),a.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(31),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==o.exec(e)||null!==i.exec(e))},construct:function(e){var t,n,r,a,s,u,c,l,p=0,f=null;if(null===(t=o.exec(e))&&(t=i.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(n,r,a));if(s=+t[4],u=+t[5],c=+t[6],t[7]){for(p=t[7].slice(0,3);p.length<3;)p+="0";p=+p}return t[9]&&(f=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(f=-f)),l=new Date(Date.UTC(n,r,a,s,u,c,p)),f&&l.setTime(l.getTime()-f),l},instanceOf:Date,represent:function(e){return e.toISOString()}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},function(e,t,n){"use strict";var r;try{r=n(61).Buffer}catch(e){}var o=n(31),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new o("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,o=e.length,a=i;for(n=0;n<o;n++)if(!((t=a.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,o=e.replace(/[\r\n=]/g,""),a=o.length,s=i,u=0,c=[];for(t=0;t<a;t++)t%4==0&&t&&(c.push(u>>16&255),c.push(u>>8&255),c.push(255&u)),u=u<<6|s.indexOf(o.charAt(t));return 0==(n=a%4*6)?(c.push(u>>16&255),c.push(u>>8&255),c.push(255&u)):18===n?(c.push(u>>10&255),c.push(u>>2&255)):12===n&&c.push(u>>4&255),r?r.from?r.from(c):new r(c):c},predicate:function(e){return r&&r.isBuffer(e)},represent:function(e){var t,n,r="",o=0,a=e.length,s=i;for(t=0;t<a;t++)t%3==0&&t&&(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]),o=(o<<8)+e[t];return 0==(n=a%3)?(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]):2===n?(r+=s[o>>10&63],r+=s[o>>4&63],r+=s[o<<2&63],r+=s[64]):1===n&&(r+=s[o>>2&63],r+=s[o<<4&63],r+=s[64],r+=s[64]),r}})},function(e,t,n){"use strict";var r=n(31),o=Object.prototype.hasOwnProperty,i=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,a,s,u=[],c=e;for(t=0,n=c.length;t<n;t+=1){if(r=c[t],s=!1,"[object Object]"!==i.call(r))return!1;for(a in r)if(o.call(r,a)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==u.indexOf(a))return!1;u.push(a)}return!0},construct:function(e){return null!==e?e:[]}})},function(e,t,n){"use strict";var r=n(31),o=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,a,s=e;for(a=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],"[object Object]"!==o.call(r))return!1;if(1!==(i=Object.keys(r)).length)return!1;a[t]=[i[0],r[i[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,o,i,a=e;for(i=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],o=Object.keys(r),i[t]=[o[0],r[o[0]]];return i}})},function(e,t,n){"use strict";var r=n(31),o=Object.prototype.hasOwnProperty;e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(o.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}})},function(e,t,n){"use strict";var r;try{r=n(786)}catch(e){"undefined"!=typeof window&&(r=window.esprima)}var o=n(31);e.exports=new o("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",n=r.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(e){return!1}},construct:function(e){var t,n="("+e+")",o=r.parse(n,{range:!0}),i=[];if("Program"!==o.type||1!==o.body.length||"ExpressionStatement"!==o.body[0].type||"ArrowFunctionExpression"!==o.body[0].expression.type&&"FunctionExpression"!==o.body[0].expression.type)throw new Error("Failed to resolve function");return o.body[0].expression.params.forEach(function(e){i.push(e.name)}),t=o.body[0].expression.body.range,"BlockStatement"===o.body[0].expression.body.type?new Function(i,n.slice(t[0]+1,t[1]-1)):new Function(i,"return "+n.slice(t[0],t[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}})},function(t,n){if(void 0===e){var r=new Error("Cannot find module 'esprima'");throw r.code="MODULE_NOT_FOUND",r}t.exports=e},function(e,t,n){"use strict";var r=n(109),o=n(135),i=n(180),a=n(136),s=Object.prototype.toString,u=Object.prototype.hasOwnProperty,c=9,l=10,p=32,f=33,h=34,d=35,m=37,v=38,g=39,y=42,b=44,_=45,w=58,x=62,E=63,S=64,C=91,k=93,O=96,A=123,T=124,j=125,P={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},I=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function M(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else{if(!(e<=4294967295))throw new o("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+r.repeat("0",i-t.length)+t}function N(e){this.schema=e.schema||i,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=r.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,o,i,a,s,c;if(null===t)return{};for(n={},o=0,i=(r=Object.keys(t)).length;o<i;o+=1)a=r[o],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(c=e.compiledTypeMap.fallback[a])&&u.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[a]=s;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function R(e,t){for(var n,o=r.repeat(" ",t),i=0,a=-1,s="",u=e.length;i<u;)-1===(a=e.indexOf("\n",i))?(n=e.slice(i),i=u):(n=e.slice(i,a+1),i=a+1),n.length&&"\n"!==n&&(s+=o),s+=n;return s}function D(e,t){return"\n"+r.repeat(" ",e.indent*t)}function L(e){return e===p||e===c}function U(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function q(e){return U(e)&&65279!==e&&e!==b&&e!==C&&e!==k&&e!==A&&e!==j&&e!==w&&e!==d}function F(e){return/^\n* /.test(e)}var z=1,B=2,V=3,H=4,W=5;function J(e,t,n,r,o){var i,a,s,u=!1,c=!1,p=-1!==r,P=-1,I=U(s=e.charCodeAt(0))&&65279!==s&&!L(s)&&s!==_&&s!==E&&s!==w&&s!==b&&s!==C&&s!==k&&s!==A&&s!==j&&s!==d&&s!==v&&s!==y&&s!==f&&s!==T&&s!==x&&s!==g&&s!==h&&s!==m&&s!==S&&s!==O&&!L(e.charCodeAt(e.length-1));if(t)for(i=0;i<e.length;i++){if(!U(a=e.charCodeAt(i)))return W;I=I&&q(a)}else{for(i=0;i<e.length;i++){if((a=e.charCodeAt(i))===l)u=!0,p&&(c=c||i-P-1>r&&" "!==e[P+1],P=i);else if(!U(a))return W;I=I&&q(a)}c=c||p&&i-P-1>r&&" "!==e[P+1]}return u||c?n>9&&F(e)?W:c?H:V:I&&!o(e)?z:B}function Y(e,t,n,r){e.dump=function(){if(0===t.length)return"''";if(!e.noCompatMode&&-1!==I.indexOf(t))return"'"+t+"'";var i=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=r||e.flowLevel>-1&&n>=e.flowLevel;switch(J(t,s,e.indent,a,function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)})){case z:return t;case B:return"'"+t.replace(/'/g,"''")+"'";case V:return"|"+K(t,e.indent)+G(R(t,i));case H:return">"+K(t,e.indent)+G(R(function(e,t){var n,r,o=/(\n+)([^\n]*)/g,i=(s=e.indexOf("\n"),s=-1!==s?s:e.length,o.lastIndex=s,$(e.slice(0,s),t)),a="\n"===e[0]||" "===e[0];var s;for(;r=o.exec(e);){var u=r[1],c=r[2];n=" "===c[0],i+=u+(a||n||""===c?"":"\n")+$(c,t),a=n}return i}(t,a),i));case W:return'"'+function(e){for(var t,n,r,o="",i=0;i<e.length;i++)(t=e.charCodeAt(i))>=55296&&t<=56319&&(n=e.charCodeAt(i+1))>=56320&&n<=57343?(o+=M(1024*(t-55296)+n-56320+65536),i++):(r=P[t],o+=!r&&U(t)?e[i]:r||M(t));return o}(t)+'"';default:throw new o("impossible error: invalid scalar style")}}()}function K(e,t){var n=F(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function G(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function $(e,t){if(""===e||" "===e[0])return e;for(var n,r,o=/ [^ ]/g,i=0,a=0,s=0,u="";n=o.exec(e);)(s=n.index)-i>t&&(r=a>i?a:s,u+="\n"+e.slice(i,r),i=r+1),a=s;return u+="\n",e.length-i>t&&a>i?u+=e.slice(i,a)+"\n"+e.slice(a+1):u+=e.slice(i),u.slice(1)}function Z(e,t,n){var r,i,a,c,l,p;for(a=0,c=(i=n?e.explicitTypes:e.implicitTypes).length;a<c;a+=1)if(((l=i[a]).instanceOf||l.predicate)&&(!l.instanceOf||"object"==typeof t&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(e.tag=n?l.tag:"?",l.represent){if(p=e.styleMap[l.tag]||l.defaultStyle,"[object Function]"===s.call(l.represent))r=l.represent(t,p);else{if(!u.call(l.represent,p))throw new o("!<"+l.tag+'> tag resolver accepts not "'+p+'" style');r=l.represent[p](t,p)}e.dump=r}return!0}return!1}function X(e,t,n,r,i,a){e.tag=null,e.dump=n,Z(e,n,!1)||Z(e,n,!0);var u=s.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var c,p,f="[object Object]"===u||"[object Array]"===u;if(f&&(p=-1!==(c=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||p||2!==e.indent&&t>0)&&(i=!1),p&&e.usedDuplicates[c])e.dump="*ref_"+c;else{if(f&&p&&!e.usedDuplicates[c]&&(e.usedDuplicates[c]=!0),"[object Object]"===u)r&&0!==Object.keys(e.dump).length?(!function(e,t,n,r){var i,a,s,u,c,p,f="",h=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new o("sortKeys must be a boolean or a function");for(i=0,a=d.length;i<a;i+=1)p="",r&&0===i||(p+=D(e,t)),u=n[s=d[i]],X(e,t+1,s,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&l===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,c&&(p+=D(e,t)),X(e,t+1,u,!0,c)&&(e.dump&&l===e.dump.charCodeAt(0)?p+=":":p+=": ",f+=p+=e.dump));e.tag=h,e.dump=f||"{}"}(e,t,e.dump,i),p&&(e.dump="&ref_"+c+e.dump)):(!function(e,t,n){var r,o,i,a,s,u="",c=e.tag,l=Object.keys(n);for(r=0,o=l.length;r<o;r+=1)s=e.condenseFlow?'"':"",0!==r&&(s+=", "),a=n[i=l[r]],X(e,t,i,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),X(e,t,a,!1,!1)&&(u+=s+=e.dump));e.tag=c,e.dump="{"+u+"}"}(e,t,e.dump),p&&(e.dump="&ref_"+c+" "+e.dump));else if("[object Array]"===u){var h=e.noArrayIndent&&t>0?t-1:t;r&&0!==e.dump.length?(!function(e,t,n,r){var o,i,a="",s=e.tag;for(o=0,i=n.length;o<i;o+=1)X(e,t+1,n[o],!0,!0)&&(r&&0===o||(a+=D(e,t)),e.dump&&l===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=s,e.dump=a||"[]"}(e,h,e.dump,i),p&&(e.dump="&ref_"+c+e.dump)):(!function(e,t,n){var r,o,i="",a=e.tag;for(r=0,o=n.length;r<o;r+=1)X(e,t,n[r],!1,!1)&&(0!==r&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=a,e.dump="["+i+"]"}(e,h,e.dump),p&&(e.dump="&ref_"+c+" "+e.dump))}else{if("[object String]"!==u){if(e.skipInvalid)return!1;throw new o("unacceptable kind of an object to dump "+u)}"?"!==e.tag&&Y(e,e.dump,t,a)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function Q(e,t){var n,r,o=[],i=[];for(function e(t,n,r){var o,i,a;if(null!==t&&"object"==typeof t)if(-1!==(i=n.indexOf(t)))-1===r.indexOf(i)&&r.push(i);else if(n.push(t),Array.isArray(t))for(i=0,a=t.length;i<a;i+=1)e(t[i],n,r);else for(o=Object.keys(t),i=0,a=o.length;i<a;i+=1)e(t[o[i]],n,r)}(e,o,i),n=0,r=i.length;n<r;n+=1)t.duplicates.push(o[i[n]]);t.usedDuplicates=new Array(r)}function ee(e,t){var n=new N(t=t||{});return n.noRefs||Q(e,n),X(n,0,e,!0,!0)?n.dump+"\n":""}e.exports.dump=ee,e.exports.safeDump=function(e,t){return ee(e,r.extend({schema:a},t))}},function(e,t,n){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},function(e,t,n){"use strict";var r,o=Object.prototype.hasOwnProperty;function i(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,i,a=[];for(i in"string"!=typeof t&&(t="?"),e)if(o.call(e,i)){if((n=e[i])||null!==n&&n!==r&&!isNaN(n)||(n=""),i=encodeURIComponent(i),n=encodeURIComponent(n),null===i||null===n)continue;a.push(i+"="+n)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,n=/([^=?&]+)=?([^&]*)/g,r={};t=n.exec(e);){var o=i(t[1]),a=i(t[2]);null===o||null===a||o in r||(r[o]=a)}return r}},function(e,t,n){var r=n(48);e.exports=function(){return r.Date.now()}},function(e,t,n){e.exports=n(792)},function(e,t,n){n(793),e.exports=n(22).Object.getPrototypeOf},function(e,t,n){var r=n(79),o=n(347);n(208)("getPrototypeOf",function(){return function(e){return o(r(e))}})},function(e,t,n){n(795),e.exports=n(22).Object.setPrototypeOf},function(e,t,n){var r=n(30);r(r.S,"Object",{setPrototypeOf:n(796).set})},function(e,t,n){var r=n(41),o=n(45),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(60)(Function.call,n(159).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},function(e,t,n){n(798);var r=n(22).Object;e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){var r=n(30);r(r.S,"Object",{create:n(156)})},function(e,t,n){var r=n(413);function o(t,n){return e.exports=o=r||function(e,t){return e.__proto__=t,e},o(t,n)}e.exports=o},function(e,t,n){"use strict";var r=n(27),o=n(801),i=n(438),a=n(112),s=n(55),u=n(873),c=n(874),l=n(439),p=n(875);n(23);o.inject();var f={findDOMNode:c,render:i.render,unmountComponentAtNode:i.unmountComponentAtNode,version:u,unstable_batchedUpdates:s.batchedUpdates,unstable_renderSubtreeIntoContainer:p};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ComponentTree:{getClosestInstanceFromNode:r.getClosestInstanceFromNode,getNodeFromInstance:function(e){return e._renderedComponent&&(e=l(e)),e?r.getNodeFromInstance(e):null}},Mount:i,Reconciler:a}),e.exports=f},function(e,t,n){"use strict";var r=n(802),o=n(803),i=n(807),a=n(810),s=n(811),u=n(812),c=n(813),l=n(819),p=n(27),f=n(844),h=n(845),d=n(846),m=n(847),v=n(848),g=n(850),y=n(851),b=n(857),_=n(858),w=n(859),x=!1;e.exports={inject:function(){x||(x=!0,g.EventEmitter.injectReactEventListener(v),g.EventPluginHub.injectEventPluginOrder(a),g.EventPluginUtils.injectComponentTree(p),g.EventPluginUtils.injectTreeTraversal(h),g.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:s,ChangeEventPlugin:i,SelectEventPlugin:_,BeforeInputEventPlugin:o}),g.HostComponent.injectGenericComponentClass(l),g.HostComponent.injectTextComponentClass(d),g.DOMProperty.injectDOMPropertyConfig(r),g.DOMProperty.injectDOMPropertyConfig(u),g.DOMProperty.injectDOMPropertyConfig(b),g.EmptyComponent.injectEmptyComponentFactory(function(e){return new f(e)}),g.Updates.injectReconcileTransaction(y),g.Updates.injectBatchingStrategy(m),g.Component.injectEnvironment(c))}}},function(e,t,n){"use strict";e.exports={Properties:{"aria-current":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},DOMAttributeNames:{},DOMPropertyNames:{}}},function(e,t,n){"use strict";var r=n(137),o=n(36),i=n(804),a=n(805),s=n(806),u=[9,13,27,32],c=229,l=o.canUseDOM&&"CompositionEvent"in window,p=null;o.canUseDOM&&"documentMode"in document&&(p=document.documentMode);var f,h=o.canUseDOM&&"TextEvent"in window&&!p&&!("object"==typeof(f=window.opera)&&"function"==typeof f.version&&parseInt(f.version(),10)<=12),d=o.canUseDOM&&(!l||p&&p>8&&p<=11);var m=32,v=String.fromCharCode(m),g={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},y=!1;function b(e,t){switch(e){case"topKeyUp":return-1!==u.indexOf(t.keyCode);case"topKeyDown":return t.keyCode!==c;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function _(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}var w=null;function x(e,t,n,o){var s,u;if(l?s=function(e){switch(e){case"topCompositionStart":return g.compositionStart;case"topCompositionEnd":return g.compositionEnd;case"topCompositionUpdate":return g.compositionUpdate}}(e):w?b(e,n)&&(s=g.compositionEnd):function(e,t){return"topKeyDown"===e&&t.keyCode===c}(e,n)&&(s=g.compositionStart),!s)return null;d&&(w||s!==g.compositionStart?s===g.compositionEnd&&w&&(u=w.getData()):w=i.getPooled(o));var p=a.getPooled(s,t,n,o);if(u)p.data=u;else{var f=_(n);null!==f&&(p.data=f)}return r.accumulateTwoPhaseDispatches(p),p}function E(e,t,n,o){var a;if(!(a=h?function(e,t){switch(e){case"topCompositionEnd":return _(t);case"topKeyPress":return t.which!==m?null:(y=!0,v);case"topTextInput":var n=t.data;return n===v&&y?null:n;default:return null}}(e,n):function(e,t){if(w){if("topCompositionEnd"===e||!l&&b(e,t)){var n=w.getData();return i.release(w),w=null,n}return null}switch(e){case"topPaste":return null;case"topKeyPress":return t.which&&!function(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}(t)?String.fromCharCode(t.which):null;case"topCompositionEnd":return d?null:t.data;default:return null}}(e,n)))return null;var u=s.getPooled(g.beforeInput,t,n,o);return u.data=a,r.accumulateTwoPhaseDispatches(u),u}var S={eventTypes:g,extractEvents:function(e,t,n,r){return[x(e,t,n,r),E(e,t,n,r)]}};e.exports=S},function(e,t,n){"use strict";var r=n(25),o=n(88),i=n(418);function a(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}r(a.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[i()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),o.addPoolingTo(a),e.exports=a},function(e,t,n){"use strict";var r=n(64);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{data:null}),e.exports=o},function(e,t,n){"use strict";var r=n(64);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{data:null}),e.exports=o},function(e,t,n){"use strict";var r=n(138),o=n(137),i=n(36),a=n(27),s=n(55),u=n(64),c=n(421),l=n(242),p=n(243),f=n(422),h={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}};function d(e,t,n){var r=u.getPooled(h.change,e,t,n);return r.type="change",o.accumulateTwoPhaseDispatches(r),r}var m=null,v=null;var g=!1;function y(e){var t=d(v,e,l(e));s.batchedUpdates(b,t)}function b(e){r.enqueueEvents(e),r.processEventQueue(!1)}function _(){m&&(m.detachEvent("onchange",y),m=null,v=null)}function w(e,t){var n=c.updateValueIfChanged(e),r=!0===t.simulated&&P._allowSimulatedPassThrough;if(n||r)return e}function x(e,t){if("topChange"===e)return t}function E(e,t,n){"topFocus"===e?(_(),function(e,t){v=t,(m=e).attachEvent("onchange",y)}(t,n)):"topBlur"===e&&_()}i.canUseDOM&&(g=p("change")&&(!document.documentMode||document.documentMode>8));var S=!1;function C(){m&&(m.detachEvent("onpropertychange",k),m=null,v=null)}function k(e){"value"===e.propertyName&&w(v,e)&&y(e)}function O(e,t,n){"topFocus"===e?(C(),function(e,t){v=t,(m=e).attachEvent("onpropertychange",k)}(t,n)):"topBlur"===e&&C()}function A(e,t,n){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return w(v,n)}function T(e,t,n){if("topClick"===e)return w(t,n)}function j(e,t,n){if("topInput"===e||"topChange"===e)return w(t,n)}i.canUseDOM&&(S=p("input")&&(!document.documentMode||document.documentMode>9));var P={eventTypes:h,_allowSimulatedPassThrough:!0,_isInputEventSupported:S,extractEvents:function(e,t,n,r){var o,i,s,u,c=t?a.getNodeFromInstance(t):window;if("select"===(u=(s=c).nodeName&&s.nodeName.toLowerCase())||"input"===u&&"file"===s.type?g?o=x:i=E:f(c)?S?o=j:(o=A,i=O):function(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}(c)&&(o=T),o){var l=o(e,t,n);if(l)return d(l,n,r)}i&&i(e,c,t),"topBlur"===e&&function(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var r=""+t.value;t.getAttribute("value")!==r&&t.setAttribute("value",r)}}}(t,c)}};e.exports=P},function(e,t,n){"use strict";var r=n(809),o={};o.attachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&function(e,t,n){"function"==typeof e?e(t.getPublicInstance()):r.addComponentAsRefTo(t,e,n)}(n,e,t._owner)}},o.shouldUpdateRefs=function(e,t){var n=null,r=null;null!==e&&"object"==typeof e&&(n=e.ref,r=e._owner);var o=null,i=null;return null!==t&&"object"==typeof t&&(o=t.ref,i=t._owner),n!==o||"string"==typeof o&&i!==r},o.detachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&function(e,t,n){"function"==typeof e?e(null):r.removeComponentAsRefFrom(t,e,n)}(n,e,t._owner)}},e.exports=o},function(e,t,n){"use strict";var r=n(21);n(15);function o(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)}var i={addComponentAsRefTo:function(e,t,n){o(n)||r("119"),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){o(n)||r("120");var i=n.getPublicInstance();i&&i.refs[t]===e.getPublicInstance()&&n.detachRef(t)}};e.exports=i},function(e,t,n){"use strict";e.exports=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"]},function(e,t,n){"use strict";var r=n(137),o=n(27),i=n(183),a={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},s={eventTypes:a,extractEvents:function(e,t,n,s){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var u,c,l;if(s.window===s)u=s;else{var p=s.ownerDocument;u=p?p.defaultView||p.parentWindow:window}if("topMouseOut"===e){c=t;var f=n.relatedTarget||n.toElement;l=f?o.getClosestInstanceFromNode(f):null}else c=null,l=t;if(c===l)return null;var h=null==c?u:o.getNodeFromInstance(c),d=null==l?u:o.getNodeFromInstance(l),m=i.getPooled(a.mouseLeave,c,n,s);m.type="mouseleave",m.target=h,m.relatedTarget=d;var v=i.getPooled(a.mouseEnter,l,n,s);return v.type="mouseenter",v.target=d,v.relatedTarget=h,r.accumulateEnterLeaveDispatches(m,v,c,l),[m,v]}};e.exports=s},function(e,t,n){"use strict";var r=n(111),o=r.injection.MUST_USE_PROPERTY,i=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_NUMERIC_VALUE,s=r.injection.HAS_POSITIVE_NUMERIC_VALUE,u=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,c={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:i,allowTransparency:0,alt:0,as:0,async:i,autoComplete:0,autoPlay:i,capture:i,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|i,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:i,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:i,defer:i,dir:0,disabled:i,download:u,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:i,formTarget:0,frameBorder:0,headers:0,height:0,hidden:i,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:i,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|i,muted:o|i,name:0,nonce:0,noValidate:i,open:i,optimum:0,pattern:0,placeholder:0,playsInline:i,poster:0,preload:0,profile:0,radioGroup:0,readOnly:i,referrerPolicy:0,rel:0,required:i,reversed:i,role:0,rows:s,rowSpan:a,sandbox:0,scope:0,scoped:i,scrolling:0,seamless:i,selected:o|i,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:a,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:i,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}};e.exports=c},function(e,t,n){"use strict";var r=n(245),o={processChildrenUpdates:n(818).dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};e.exports=o},function(e,t,n){"use strict";var r=n(21),o=n(113),i=n(36),a=n(815),s=n(54),u=(n(15),{dangerouslyReplaceNodeWithMarkup:function(e,t){if(i.canUseDOM||r("56"),t||r("57"),"HTML"===e.nodeName&&r("58"),"string"==typeof t){var n=a(t,s)[0];e.parentNode.replaceChild(n,e)}else o.replaceChildWithTree(e,t)}});e.exports=u},function(e,t,n){"use strict";var r=n(36),o=n(816),i=n(817),a=n(15),s=r.canUseDOM?document.createElement("div"):null,u=/^\s*<(\w+)/;e.exports=function(e,t){var n=s;s||a(!1);var r=function(e){var t=e.match(u);return t&&t[1].toLowerCase()}(e),c=r&&i(r);if(c){n.innerHTML=c[1]+e+c[2];for(var l=c[0];l--;)n=n.lastChild}else n.innerHTML=e;var p=n.getElementsByTagName("script");p.length&&(t||a(!1),o(p).forEach(t));for(var f=Array.from(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return f}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e){return function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}(e)?Array.isArray(e)?e.slice():function(e){var t=e.length;if((Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e)&&r(!1),"number"!=typeof t&&r(!1),0===t||t-1 in e||r(!1),"function"==typeof e.callee&&r(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var n=Array(t),o=0;o<t;o++)n[o]=e[o];return n}(e):[e]}},function(e,t,n){"use strict";var r=n(36),o=n(15),i=r.canUseDOM?document.createElement("div"):null,a={},s=[1,'<select multiple="true">',"</select>"],u=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],l=[1,'<svg xmlns="http://www.w3.org/2000/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","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach(function(e){p[e]=l,a[e]=!0}),e.exports=function(e){return i||o(!1),p.hasOwnProperty(e)||(e="*"),a.hasOwnProperty(e)||(i.innerHTML="*"===e?"<link />":"<"+e+"></"+e+">",a[e]=!i.firstChild),a[e]?p[e]:null}},function(e,t,n){"use strict";var r=n(245),o=n(27),i={dangerouslyProcessChildrenUpdates:function(e,t){var n=o.getNodeFromInstance(e);r.processUpdates(n,t)}};e.exports=i},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(820),a=n(821),s=n(113),u=n(246),c=n(111),l=n(427),p=n(138),f=n(239),h=n(186),d=n(415),m=n(27),v=n(831),g=n(833),y=n(428),b=n(834),_=(n(50),n(835)),w=n(842),x=(n(54),n(185)),E=(n(15),n(243),n(250),n(421)),S=(n(254),n(23),d),C=p.deleteListener,k=m.getNodeFromInstance,O=h.listenTo,A=f.registrationNameModules,T={string:!0,number:!0},j="__html",P={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},I=11;function M(e,t){t&&(W[e._tag]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&r("137",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&r("60"),"object"==typeof t.dangerouslySetInnerHTML&&j in t.dangerouslySetInnerHTML||r("61")),null!=t.style&&"object"!=typeof t.style&&r("62",function(e){if(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" This DOM node was rendered by `"+n+"`."}}return""}(e)))}function N(e,t,n,r){if(!(r instanceof w)){0;var o=e._hostContainerInfo,i=o._node&&o._node.nodeType===I?o._node:o._ownerDocument;O(t,i),r.getReactMountReady().enqueue(R,{inst:e,registrationName:t,listener:n})}}function R(){p.putListener(this.inst,this.registrationName,this.listener)}function D(){v.postMountWrapper(this)}function L(){b.postMountWrapper(this)}function U(){g.postMountWrapper(this)}var q={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"};function F(){E.track(this)}function z(){this._rootNodeID||r("63");var e=k(this);switch(e||r("64"),this._tag){case"iframe":case"object":this._wrapperState.listeners=[h.trapBubbledEvent("topLoad","load",e)];break;case"video":case"audio":for(var t in this._wrapperState.listeners=[],q)q.hasOwnProperty(t)&&this._wrapperState.listeners.push(h.trapBubbledEvent(t,q[t],e));break;case"source":this._wrapperState.listeners=[h.trapBubbledEvent("topError","error",e)];break;case"img":this._wrapperState.listeners=[h.trapBubbledEvent("topError","error",e),h.trapBubbledEvent("topLoad","load",e)];break;case"form":this._wrapperState.listeners=[h.trapBubbledEvent("topReset","reset",e),h.trapBubbledEvent("topSubmit","submit",e)];break;case"input":case"select":case"textarea":this._wrapperState.listeners=[h.trapBubbledEvent("topInvalid","invalid",e)]}}function B(){y.postUpdateWrapper(this)}var V={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},H={listing:!0,pre:!0,textarea:!0},W=o({menuitem:!0},V),J=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Y={},K={}.hasOwnProperty;function G(e,t){return e.indexOf("-")>=0||null!=t.is}var $=1;function Z(e){var t=e.type;!function(e){K.call(Y,e)||(J.test(e)||r("65",e),Y[e]=!0)}(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}Z.displayName="ReactDOMComponent",Z.Mixin={mountComponent:function(e,t,n,r){this._rootNodeID=$++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var o,a,c,p=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(z,this);break;case"input":v.mountWrapper(this,p,t),p=v.getHostProps(this,p),e.getReactMountReady().enqueue(F,this),e.getReactMountReady().enqueue(z,this);break;case"option":g.mountWrapper(this,p,t),p=g.getHostProps(this,p);break;case"select":y.mountWrapper(this,p,t),p=y.getHostProps(this,p),e.getReactMountReady().enqueue(z,this);break;case"textarea":b.mountWrapper(this,p,t),p=b.getHostProps(this,p),e.getReactMountReady().enqueue(F,this),e.getReactMountReady().enqueue(z,this)}if(M(this,p),null!=t?(o=t._namespaceURI,a=t._tag):n._tag&&(o=n._namespaceURI,a=n._tag),(null==o||o===u.svg&&"foreignobject"===a)&&(o=u.html),o===u.html&&("svg"===this._tag?o=u.svg:"math"===this._tag&&(o=u.mathml)),this._namespaceURI=o,e.useCreateElement){var f,h=n._ownerDocument;if(o===u.html)if("script"===this._tag){var d=h.createElement("div"),_=this._currentElement.type;d.innerHTML="<"+_+"></"+_+">",f=d.removeChild(d.firstChild)}else f=p.is?h.createElement(this._currentElement.type,p.is):h.createElement(this._currentElement.type);else f=h.createElementNS(o,this._currentElement.type);m.precacheNode(this,f),this._flags|=S.hasCachedChildNodes,this._hostParent||l.setAttributeForRoot(f),this._updateDOMProperties(null,p,e);var w=s(f);this._createInitialChildren(e,p,r,w),c=w}else{var x=this._createOpenTagMarkupAndPutListeners(e,p),E=this._createContentMarkup(e,p,r);c=!E&&V[this._tag]?x+"/>":x+">"+E+"</"+this._currentElement.type+">"}switch(this._tag){case"input":e.getReactMountReady().enqueue(D,this),p.autoFocus&&e.getReactMountReady().enqueue(i.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(L,this),p.autoFocus&&e.getReactMountReady().enqueue(i.focusDOMComponent,this);break;case"select":case"button":p.autoFocus&&e.getReactMountReady().enqueue(i.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(U,this)}return c},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(A.hasOwnProperty(r))i&&N(this,r,i,e);else{"style"===r&&(i&&(i=this._previousStyleCopy=o({},t.style)),i=a.createMarkupForStyles(i,this));var s=null;null!=this._tag&&G(this._tag,t)?P.hasOwnProperty(r)||(s=l.createMarkupForCustomAttribute(r,i)):s=l.createMarkupForProperty(r,i),s&&(n+=" "+s)}}return e.renderToStaticMarkup?n:(this._hostParent||(n+=" "+l.createMarkupForRoot()),n+=" "+l.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var i=T[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)r=x(i);else if(null!=a){r=this.mountChildren(a,e,n).join("")}}return H[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&s.queueHTML(r,o.__html);else{var i=T[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)""!==i&&s.queueText(r,i);else if(null!=a)for(var u=this.mountChildren(a,e,n),c=0;c<u.length;c++)s.queueChild(r,u[c])}},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){var o=t.props,i=this._currentElement.props;switch(this._tag){case"input":o=v.getHostProps(this,o),i=v.getHostProps(this,i);break;case"option":o=g.getHostProps(this,o),i=g.getHostProps(this,i);break;case"select":o=y.getHostProps(this,o),i=y.getHostProps(this,i);break;case"textarea":o=b.getHostProps(this,o),i=b.getHostProps(this,i)}switch(M(this,i),this._updateDOMProperties(o,i,e),this._updateDOMChildren(o,i,e,r),this._tag){case"input":v.updateWrapper(this),E.updateValueIfChanged(this);break;case"textarea":b.updateWrapper(this);break;case"select":e.getReactMountReady().enqueue(B,this)}},_updateDOMProperties:function(e,t,n){var r,i,s;for(r in e)if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&null!=e[r])if("style"===r){var u=this._previousStyleCopy;for(i in u)u.hasOwnProperty(i)&&((s=s||{})[i]="");this._previousStyleCopy=null}else A.hasOwnProperty(r)?e[r]&&C(this,r):G(this._tag,e)?P.hasOwnProperty(r)||l.deleteValueForAttribute(k(this),r):(c.properties[r]||c.isCustomAttribute(r))&&l.deleteValueForProperty(k(this),r);for(r in t){var p=t[r],f="style"===r?this._previousStyleCopy:null!=e?e[r]:void 0;if(t.hasOwnProperty(r)&&p!==f&&(null!=p||null!=f))if("style"===r)if(p?p=this._previousStyleCopy=o({},p):this._previousStyleCopy=null,f){for(i in f)!f.hasOwnProperty(i)||p&&p.hasOwnProperty(i)||((s=s||{})[i]="");for(i in p)p.hasOwnProperty(i)&&f[i]!==p[i]&&((s=s||{})[i]=p[i])}else s=p;else if(A.hasOwnProperty(r))p?N(this,r,p,n):f&&C(this,r);else if(G(this._tag,t))P.hasOwnProperty(r)||l.setValueForAttribute(k(this),r,p);else if(c.properties[r]||c.isCustomAttribute(r)){var h=k(this);null!=p?l.setValueForProperty(h,r,p):l.deleteValueForProperty(h,r)}}s&&a.setValueForStyles(k(this),s,this)},_updateDOMChildren:function(e,t,n,r){var o=T[typeof e.children]?e.children:null,i=T[typeof t.children]?t.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,u=null!=o?null:e.children,c=null!=i?null:t.children,l=null!=o||null!=a,p=null!=i||null!=s;null!=u&&null==c?this.updateChildren(null,n,r):l&&!p&&this.updateTextContent(""),null!=i?o!==i&&this.updateTextContent(""+i):null!=s?a!==s&&this.updateMarkup(""+s):null!=c&&this.updateChildren(c,n,r)},getHostNode:function(){return k(this)},unmountComponent:function(e){switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":var t=this._wrapperState.listeners;if(t)for(var n=0;n<t.length;n++)t[n].remove();break;case"input":case"textarea":E.stopTracking(this);break;case"html":case"head":case"body":r("66",this._tag)}this.unmountChildren(e),m.uncacheNode(this),p.deleteAllListeners(this),this._rootNodeID=0,this._domID=0,this._wrapperState=null},getPublicInstance:function(){return k(this)}},o(Z.prototype,Z.Mixin,_.Mixin),e.exports=Z},function(e,t,n){"use strict";var r=n(27),o=n(425),i={focusDOMComponent:function(){o(r.getNodeFromInstance(this))}};e.exports=i},function(e,t,n){"use strict";var r=n(426),o=n(36),i=(n(50),n(822),n(824)),a=n(825),s=n(827),u=(n(23),s(function(e){return a(e)})),c=!1,l="cssFloat";if(o.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(e){c=!0}void 0===document.documentElement.style.cssFloat&&(l="styleFloat")}var f={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=0===r.indexOf("--"),a=e[r];0,null!=a&&(n+=u(r)+":",n+=i(r,a,t,o)+";")}return n||null},setValueForStyles:function(e,t,n){var o=e.style;for(var a in t)if(t.hasOwnProperty(a)){var s=0===a.indexOf("--");0;var u=i(a,t[a],n,s);if("float"!==a&&"cssFloat"!==a||(a=l),s)o.setProperty(a,u);else if(u)o[a]=u;else{var p=c&&r.shorthandPropertyExpansions[a];if(p)for(var f in p)o[f]="";else o[a]=""}}}};e.exports=f},function(e,t,n){"use strict";var r=n(823),o=/^-ms-/;e.exports=function(e){return r(e.replace(o,"ms-"))}},function(e,t,n){"use strict";var r=/-(.)/g;e.exports=function(e){return e.replace(r,function(e,t){return t.toUpperCase()})}},function(e,t,n){"use strict";var r=n(426),o=(n(23),r.isUnitlessNumber);e.exports=function(e,t,n,r){if(null==t||"boolean"==typeof t||""===t)return"";var i=isNaN(t);return r||i||0===t||o.hasOwnProperty(e)&&o[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}},function(e,t,n){"use strict";var r=n(826),o=/^ms-/;e.exports=function(e){return r(e).replace(o,"-ms-")}},function(e,t,n){"use strict";var r=/([A-Z])/g;e.exports=function(e){return e.replace(r,"-$1").toLowerCase()}},function(e,t,n){"use strict";e.exports=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}},function(e,t,n){"use strict";var r=n(185);e.exports=function(e){return'"'+r(e)+'"'}},function(e,t,n){"use strict";var r=n(138);var o={handleTopLevel:function(e,t,n,o){!function(e){r.enqueueEvents(e),r.processEventQueue(!1)}(r.extractEvents(e,t,n,o))}};e.exports=o},function(e,t,n){"use strict";var r=n(36);function o(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}var i={animationend:o("Animation","AnimationEnd"),animationiteration:o("Animation","AnimationIteration"),animationstart:o("Animation","AnimationStart"),transitionend:o("Transition","TransitionEnd")},a={},s={};r.canUseDOM&&(s=document.createElement("div").style,"AnimationEvent"in window||(delete i.animationend.animation,delete i.animationiteration.animation,delete i.animationstart.animation),"TransitionEvent"in window||delete i.transitionend.transition),e.exports=function(e){if(a[e])return a[e];if(!i[e])return e;var t=i[e];for(var n in t)if(t.hasOwnProperty(n)&&n in s)return a[e]=t[n];return""}},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(427),a=n(248),s=n(27),u=n(55);n(15),n(23);function c(){this._rootNodeID&&p.updateWrapper(this)}function l(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}var p={getHostProps:function(e,t){var n=a.getValue(t),r=a.getChecked(t);return o({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,listeners:null,onChange:f.bind(e),controlled:l(t)}},updateWrapper:function(e){var t=e._currentElement.props,n=t.checked;null!=n&&i.setValueForProperty(s.getNodeFromInstance(e),"checked",n||!1);var r=s.getNodeFromInstance(e),o=a.getValue(t);if(null!=o)if(0===o&&""===r.value)r.value="0";else if("number"===t.type){var u=parseFloat(r.value,10)||0;(o!=u||o==u&&r.value!=o)&&(r.value=""+o)}else r.value!==""+o&&(r.value=""+o);else null==t.value&&null!=t.defaultValue&&r.defaultValue!==""+t.defaultValue&&(r.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(r.defaultChecked=!!t.defaultChecked)},postMountWrapper:function(e){var t=e._currentElement.props,n=s.getNodeFromInstance(e);switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":n.value="",n.value=n.defaultValue;break;default:n.value=n.value}var r=n.name;""!==r&&(n.name=""),n.defaultChecked=!n.defaultChecked,n.defaultChecked=!n.defaultChecked,""!==r&&(n.name=r)}};function f(e){var t=this._currentElement.props,n=a.executeOnChange(t,e);u.asap(c,this);var o=t.name;if("radio"===t.type&&null!=o){for(var i=s.getNodeFromInstance(this),l=i;l.parentNode;)l=l.parentNode;for(var p=l.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),f=0;f<p.length;f++){var h=p[f];if(h!==i&&h.form===i.form){var d=s.getInstanceFromNode(h);d||r("90"),u.asap(c,d)}}}return n}e.exports=p},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=n(25),o=n(100),i=n(27),a=n(428),s=(n(23),!1);function u(e){var t="";return o.Children.forEach(e,function(e){null!=e&&("string"==typeof e||"number"==typeof e?t+=e:s||(s=!0))}),t}var c={mountWrapper:function(e,t,n){var r=null;if(null!=n){var o=n;"optgroup"===o._tag&&(o=o._hostParent),null!=o&&"select"===o._tag&&(r=a.getSelectValueContext(o))}var i,s=null;if(null!=r)if(i=null!=t.value?t.value+"":u(t.children),s=!1,Array.isArray(r)){for(var c=0;c<r.length;c++)if(""+r[c]===i){s=!0;break}}else s=""+r===i;e._wrapperState={selected:s}},postMountWrapper:function(e){var t=e._currentElement.props;null!=t.value&&i.getNodeFromInstance(e).setAttribute("value",t.value)},getHostProps:function(e,t){var n=r({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(n.selected=e._wrapperState.selected);var o=u(t.children);return o&&(n.children=o),n}};e.exports=c},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(248),a=n(27),s=n(55);n(15),n(23);function u(){this._rootNodeID&&c.updateWrapper(this)}var c={getHostProps:function(e,t){return null!=t.dangerouslySetInnerHTML&&r("91"),o({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=i.getValue(t),o=n;if(null==n){var a=t.defaultValue,s=t.children;null!=s&&(null!=a&&r("92"),Array.isArray(s)&&(s.length<=1||r("93"),s=s[0]),a=""+s),null==a&&(a=""),o=a}e._wrapperState={initialValue:""+o,listeners:null,onChange:l.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=a.getNodeFromInstance(e),r=i.getValue(t);if(null!=r){var o=""+r;o!==n.value&&(n.value=o),null==t.defaultValue&&(n.defaultValue=o)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=a.getNodeFromInstance(e),n=t.textContent;n===e._wrapperState.initialValue&&(t.value=n)}};function l(e){var t=this._currentElement.props,n=i.executeOnChange(t,e);return s.asap(u,this),n}e.exports=c},function(e,t,n){"use strict";var r=n(21),o=n(249),i=(n(140),n(50),n(62),n(112)),a=n(836),s=(n(54),n(841));n(15);function u(e,t){return t&&(e=e||[]).push(t),e}function c(e,t){o.processChildrenUpdates(e,t)}var l={Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return a.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,o,i){var u;return u=s(t,0),a.updateChildren(e,u,n,r,o,this,this._hostContainerInfo,i,0),u},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var o=[],a=0;for(var s in r)if(r.hasOwnProperty(s)){var u=r[s];0;var c=i.mountComponent(u,t,this,this._hostContainerInfo,n,0);u._mountIndex=a++,o.push(c)}return o},updateTextContent:function(e){var t,n=this._renderedChildren;for(var o in a.unmountChildren(n,!1),n)n.hasOwnProperty(o)&&r("118");c(this,[(t=e,{type:"TEXT_CONTENT",content:t,fromIndex:null,fromNode:null,toIndex:null,afterNode:null})])},updateMarkup:function(e){var t,n=this._renderedChildren;for(var o in a.unmountChildren(n,!1),n)n.hasOwnProperty(o)&&r("118");c(this,[(t=e,{type:"SET_MARKUP",content:t,fromIndex:null,fromNode:null,toIndex:null,afterNode:null})])},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,o={},a=[],s=this._reconcilerUpdateChildren(r,e,a,o,t,n);if(s||r){var l,p=null,f=0,h=0,d=0,m=null;for(l in s)if(s.hasOwnProperty(l)){var v=r&&r[l],g=s[l];v===g?(p=u(p,this.moveChild(v,m,f,h)),h=Math.max(v._mountIndex,h),v._mountIndex=f):(v&&(h=Math.max(v._mountIndex,h)),p=u(p,this._mountChildAtIndex(g,a[d],m,f,t,n)),d++),f++,m=i.getHostNode(g)}for(l in o)o.hasOwnProperty(l)&&(p=u(p,this._unmountChild(r[l],o[l])));p&&c(this,p),this._renderedChildren=s}},unmountChildren:function(e){var t=this._renderedChildren;a.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex<r)return function(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:i.getHostNode(e),toIndex:n,afterNode:t}}(e,t,n)},createChild:function(e,t,n){return function(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}(n,t,e._mountIndex)},removeChild:function(e,t){return function(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}(e,t)},_mountChildAtIndex:function(e,t,n,r,o,i){return e._mountIndex=r,this.createChild(e,n,t)},_unmountChild:function(e,t){var n=this.removeChild(e,t);return e._mountIndex=null,n}}};e.exports=l},function(e,t,n){"use strict";(function(t){var r=n(112),o=n(429),i=(n(252),n(251)),a=n(433);n(23);function s(e,t,n,r){var i=void 0===e[n];null!=t&&i&&(e[n]=o(t,!0))}void 0!==t&&t.env;var u={instantiateChildren:function(e,t,n,r){if(null==e)return null;var o={};return a(e,s,o),o},updateChildren:function(e,t,n,a,s,u,c,l,p){if(t||e){var f,h;for(f in t)if(t.hasOwnProperty(f)){var d=(h=e&&e[f])&&h._currentElement,m=t[f];if(null!=h&&i(d,m))r.receiveComponent(h,m,s,l),t[f]=h;else{h&&(a[f]=r.getHostNode(h),r.unmountComponent(h,!1));var v=o(m,!0);t[f]=v;var g=r.mountComponent(v,s,u,c,l,p);n.push(g)}}for(f in e)!e.hasOwnProperty(f)||t&&t.hasOwnProperty(f)||(h=e[f],a[f]=r.getHostNode(h),r.unmountComponent(h,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];r.unmountComponent(o,t)}}};e.exports=u}).call(this,n(72))},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(100),a=n(249),s=n(62),u=n(241),c=n(140),l=(n(50),n(430)),p=n(112),f=n(161),h=(n(15),n(250)),d=n(251),m=(n(23),0),v=1,g=2;function y(e){}function b(e,t){0}y.prototype.render=function(){var e=c.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return b(e,t),t};var _=1,w={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1},mountComponent:function(e,t,n,o){this._context=o,this._mountOrder=_++,this._hostParent=t,this._hostContainerInfo=n;var a,s=this._currentElement.props,u=this._processContext(o),l=this._currentElement.type,p=e.getUpdateQueue(),h=function(e){return!(!e.prototype||!e.prototype.isReactComponent)}(l),d=this._constructComponent(h,s,u,p);h||null!=d&&null!=d.render?!function(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}(l)?this._compositeType=m:this._compositeType=v:(a=d,b(),null===d||!1===d||i.isValidElement(d)||r("105",l.displayName||l.name||"Component"),d=new y(l),this._compositeType=g),d.props=s,d.context=u,d.refs=f,d.updater=p,this._instance=d,c.set(d,this);var w,x=d.state;return void 0===x&&(d.state=x=null),("object"!=typeof x||Array.isArray(x))&&r("106",this.getName()||"ReactCompositeComponent"),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,w=d.unstable_handleError?this.performInitialMountWithErrorHandling(a,t,n,e,o):this.performInitialMount(a,t,n,e,o),d.componentDidMount&&e.getReactMountReady().enqueue(d.componentDidMount,d),w},_constructComponent:function(e,t,n,r){return this._constructComponentWithoutOwner(e,t,n,r)},_constructComponentWithoutOwner:function(e,t,n,r){var o=this._currentElement.type;return e?new o(t,n,r):o(t,n,r)},performInitialMountWithErrorHandling:function(e,t,n,r,o){var i,a=r.checkpoint();try{i=this.performInitialMount(e,t,n,r,o)}catch(s){r.rollback(a),this._instance.unstable_handleError(s),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),a=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(a),i=this.performInitialMount(e,t,n,r,o)}return i},performInitialMount:function(e,t,n,r,o){var i=this._instance;i.componentWillMount&&(i.componentWillMount(),this._pendingStateQueue&&(i.state=this._processPendingState(i.props,i.context))),void 0===e&&(e=this._renderValidatedComponent());var a=l.getType(e);this._renderedNodeType=a;var s=this._instantiateReactComponent(e,a!==l.EMPTY);return this._renderedComponent=s,p.mountComponent(s,r,t,n,this._processChildContext(o),0)},getHostNode:function(){return p.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var n=this.getName()+".componentWillUnmount()";u.invokeGuardedCallback(n,t.componentWillUnmount.bind(t))}else t.componentWillUnmount();this._renderedComponent&&(p.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,c.remove(t)}},_maskContext:function(e){var t=this._currentElement.type.contextTypes;if(!t)return f;var n={};for(var r in t)n[r]=e[r];return n},_processContext:function(e){return this._maskContext(e)},_processChildContext:function(e){var t,n=this._currentElement.type,i=this._instance;if(i.getChildContext&&(t=i.getChildContext()),t){for(var a in"object"!=typeof n.childContextTypes&&r("107",this.getName()||"ReactCompositeComponent"),t)a in n.childContextTypes||r("108",this.getName()||"ReactCompositeComponent",a);return o({},e,t)}return e},_checkContextTypes:function(e,t,n){0},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?p.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,n,o,i){var a=this._instance;null==a&&r("136",this.getName()||"ReactCompositeComponent");var s,u=!1;this._context===i?s=a.context:(s=this._processContext(i),u=!0);var c=t.props,l=n.props;t!==n&&(u=!0),u&&a.componentWillReceiveProps&&a.componentWillReceiveProps(l,s);var p=this._processPendingState(l,s),f=!0;this._pendingForceUpdate||(a.shouldComponentUpdate?f=a.shouldComponentUpdate(l,p,s):this._compositeType===v&&(f=!h(c,l)||!h(a.state,p))),this._updateBatchNumber=null,f?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,l,p,s,e,i)):(this._currentElement=n,this._context=i,a.props=l,a.state=p,a.context=s)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,i=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(i&&1===r.length)return r[0];for(var a=o({},i?r[0]:n.state),s=i?1:0;s<r.length;s++){var u=r[s];o(a,"function"==typeof u?u.call(n,a,e,t):u)}return a},_performComponentUpdate:function(e,t,n,r,o,i){var a,s,u,c=this._instance,l=Boolean(c.componentDidUpdate);l&&(a=c.props,s=c.state,u=c.context),c.componentWillUpdate&&c.componentWillUpdate(t,n,r),this._currentElement=e,this._context=i,c.props=t,c.state=n,c.context=r,this._updateRenderedComponent(o,i),l&&o.getReactMountReady().enqueue(c.componentDidUpdate.bind(c,a,s,u),c)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,r=n._currentElement,o=this._renderValidatedComponent();if(d(r,o))p.receiveComponent(n,o,e,this._processChildContext(t));else{var i=p.getHostNode(n);p.unmountComponent(n,!1);var a=l.getType(o);this._renderedNodeType=a;var s=this._instantiateReactComponent(o,a!==l.EMPTY);this._renderedComponent=s;var u=p.mountComponent(s,e,this._hostParent,this._hostContainerInfo,this._processChildContext(t),0);this._replaceNodeWithMarkup(i,u,n)}},_replaceNodeWithMarkup:function(e,t,n){a.replaceNodeWithMarkup(e,t,n)},_renderValidatedComponentWithoutOwnerOrContext:function(){return this._instance.render()},_renderValidatedComponent:function(){var e;if(this._compositeType!==g){s.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{s.current=null}}else e=this._renderValidatedComponentWithoutOwnerOrContext();return null===e||!1===e||i.isValidElement(e)||r("109",this.getName()||"ReactCompositeComponent"),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n&&r("110");var o=t.getPublicInstance();(n.refs===f?n.refs={}:n.refs)[e]=o},detachRef:function(e){delete this.getPublicInstance().refs[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return this._compositeType===g?null:e},_instantiateReactComponent:null};e.exports=w},function(e,t,n){"use strict";var r=1;e.exports=function(){return r++}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=function(e){var t=e&&(r&&e[r]||e[o]);if("function"==typeof t)return t}},function(e,t,n){"use strict";(function(t){n(252);var r=n(433);n(23);function o(e,t,n,r){if(e&&"object"==typeof e){var o=e;0,void 0===o[n]&&null!=t&&(o[n]=t)}}void 0!==t&&t.env,e.exports=function(e,t){if(null==e)return e;var n={};return r(e,o,n),n}}).call(this,n(72))},function(e,t,n){"use strict";var r=n(25),o=n(88),i=n(182),a=(n(50),n(843)),s=[];var u={enqueue:function(){}};function c(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1,this.updateQueue=new a(this)}var l={getTransactionWrappers:function(){return s},getReactMountReady:function(){return u},getUpdateQueue:function(){return this.updateQueue},destructor:function(){},checkpoint:function(){},rollback:function(){}};r(c.prototype,i,l),o.addPoolingTo(c),e.exports=c},function(e,t,n){"use strict";var r=n(253);n(23);var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.transaction=t}return e.prototype.isMounted=function(e){return!1},e.prototype.enqueueCallback=function(e,t,n){this.transaction.isInTransaction()&&r.enqueueCallback(e,t,n)},e.prototype.enqueueForceUpdate=function(e){this.transaction.isInTransaction()&&r.enqueueForceUpdate(e)},e.prototype.enqueueReplaceState=function(e,t){this.transaction.isInTransaction()&&r.enqueueReplaceState(e,t)},e.prototype.enqueueSetState=function(e,t){this.transaction.isInTransaction()&&r.enqueueSetState(e,t)},e}();e.exports=o},function(e,t,n){"use strict";var r=n(25),o=n(113),i=n(27),a=function(e){this._currentElement=null,this._hostNode=null,this._hostParent=null,this._hostContainerInfo=null,this._domID=0};r(a.prototype,{mountComponent:function(e,t,n,r){var a=n._idCounter++;this._domID=a,this._hostParent=t,this._hostContainerInfo=n;var s=" react-empty: "+this._domID+" ";if(e.useCreateElement){var u=n._ownerDocument.createComment(s);return i.precacheNode(this,u),o(u)}return e.renderToStaticMarkup?"":"\x3c!--"+s+"--\x3e"},receiveComponent:function(){},getHostNode:function(){return i.getNodeFromInstance(this)},unmountComponent:function(){i.uncacheNode(this)}}),e.exports=a},function(e,t,n){"use strict";var r=n(21);n(15);function o(e,t){"_hostNode"in e||r("33"),"_hostNode"in t||r("33");for(var n=0,o=e;o;o=o._hostParent)n++;for(var i=0,a=t;a;a=a._hostParent)i++;for(;n-i>0;)e=e._hostParent,n--;for(;i-n>0;)t=t._hostParent,i--;for(var s=n;s--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}e.exports={isAncestor:function(e,t){"_hostNode"in e||r("35"),"_hostNode"in t||r("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1},getLowestCommonAncestor:o,getParentInstance:function(e){return"_hostNode"in e||r("36"),e._hostParent},traverseTwoPhase:function(e,t,n){for(var r,o=[];e;)o.push(e),e=e._hostParent;for(r=o.length;r-- >0;)t(o[r],"captured",n);for(r=0;r<o.length;r++)t(o[r],"bubbled",n)},traverseEnterLeave:function(e,t,n,r,i){for(var a=e&&t?o(e,t):null,s=[];e&&e!==a;)s.push(e),e=e._hostParent;for(var u,c=[];t&&t!==a;)c.push(t),t=t._hostParent;for(u=0;u<s.length;u++)n(s[u],"bubbled",r);for(u=c.length;u-- >0;)n(c[u],"captured",i)}}},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(245),a=n(113),s=n(27),u=n(185),c=(n(15),n(254),function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});o(c.prototype,{mountComponent:function(e,t,n,r){var o=n._idCounter++,i=" react-text: "+o+" ";if(this._domID=o,this._hostParent=t,e.useCreateElement){var c=n._ownerDocument,l=c.createComment(i),p=c.createComment(" /react-text "),f=a(c.createDocumentFragment());return a.queueChild(f,a(l)),this._stringText&&a.queueChild(f,a(c.createTextNode(this._stringText))),a.queueChild(f,a(p)),s.precacheNode(this,l),this._closingComment=p,f}var h=u(this._stringText);return e.renderToStaticMarkup?h:"\x3c!--"+i+"--\x3e"+h+"\x3c!-- /react-text --\x3e"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();i.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=s.getNodeFromInstance(this).nextSibling;;){if(null==t&&r("67",this._domID),8===t.nodeType&&" /react-text "===t.nodeValue){this._closingComment=t;break}t=t.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,s.uncacheNode(this)}}),e.exports=c},function(e,t,n){"use strict";var r=n(25),o=n(55),i=n(182),a=n(54),s={initialize:a,close:function(){p.isBatchingUpdates=!1}},u=[{initialize:a,close:o.flushBatchedUpdates.bind(o)},s];function c(){this.reinitializeTransaction()}r(c.prototype,i,{getTransactionWrappers:function(){return u}});var l=new c,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o,i){var a=p.isBatchingUpdates;return p.isBatchingUpdates=!0,a?e(t,n,r,o,i):l.perform(e,null,t,n,r,o,i)}};e.exports=p},function(e,t,n){"use strict";var r=n(25),o=n(435),i=n(36),a=n(88),s=n(27),u=n(55),c=n(242),l=n(849);function p(e){for(;e._hostParent;)e=e._hostParent;var t=s.getNodeFromInstance(e).parentNode;return s.getClosestInstanceFromNode(t)}function f(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function h(e){var t=c(e.nativeEvent),n=s.getClosestInstanceFromNode(t),r=n;do{e.ancestors.push(r),r=r&&p(r)}while(r);for(var o=0;o<e.ancestors.length;o++)n=e.ancestors[o],d._handleTopLevel(e.topLevelType,n,e.nativeEvent,c(e.nativeEvent))}r(f.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),a.addPoolingTo(f,a.twoArgumentPooler);var d={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:i.canUseDOM?window:null,setHandleTopLevel:function(e){d._handleTopLevel=e},setEnabled:function(e){d._enabled=!!e},isEnabled:function(){return d._enabled},trapBubbledEvent:function(e,t,n){return n?o.listen(n,t,d.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){return n?o.capture(n,t,d.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=function(e){e(l(window))}.bind(null,e);o.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(d._enabled){var n=f.getPooled(e,t);try{u.batchedUpdates(h,n)}finally{f.release(n)}}}};e.exports=d},function(e,t,n){"use strict";e.exports=function(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}},function(e,t,n){"use strict";var r=n(111),o=n(138),i=n(240),a=n(249),s=n(431),u=n(186),c=n(432),l=n(55),p={Component:a.injection,DOMProperty:r.injection,EmptyComponent:s.injection,EventPluginHub:o.injection,EventPluginUtils:i.injection,EventEmitter:u.injection,HostComponent:c.injection,Updates:l.injection};e.exports=p},function(e,t,n){"use strict";var r=n(25),o=n(419),i=n(88),a=n(186),s=n(436),u=(n(50),n(182)),c=n(253),l=[{initialize:s.getSelectionInformation,close:s.restoreSelection},{initialize:function(){var e=a.isEnabled();return a.setEnabled(!1),e},close:function(e){a.setEnabled(e)}},{initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}}];function p(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=o.getPooled(null),this.useCreateElement=e}var f={getTransactionWrappers:function(){return l},getReactMountReady:function(){return this.reactMountReady},getUpdateQueue:function(){return c},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null}};r(p.prototype,u,f),i.addPoolingTo(p),e.exports=p},function(e,t,n){"use strict";var r=n(36),o=n(853),i=n(418);function a(e,t,n,r){return e===n&&t===r}var s=r.canUseDOM&&"selection"in document&&!("getSelection"in window),u={getOffsets:s?function(e){var t=document.selection.createRange(),n=t.text.length,r=t.duplicate();r.moveToElementText(e),r.setEndPoint("EndToStart",t);var o=r.text.length;return{start:o,end:o+n}}:function(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,r=t.anchorOffset,o=t.focusNode,i=t.focusOffset,s=t.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(e){return null}var u=a(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)?0:s.toString().length,c=s.cloneRange();c.selectNodeContents(e),c.setEnd(s.startContainer,s.startOffset);var l=a(c.startContainer,c.startOffset,c.endContainer,c.endOffset)?0:c.toString().length,p=l+u,f=document.createRange();f.setStart(n,r),f.setEnd(o,i);var h=f.collapsed;return{start:h?p:l,end:h?l:p}},setOffsets:s?function(e,t){var n,r,o=document.selection.createRange().duplicate();void 0===t.end?r=n=t.start:t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}:function(e,t){if(window.getSelection){var n=window.getSelection(),r=e[i()].length,a=Math.min(t.start,r),s=void 0===t.end?a:Math.min(t.end,r);if(!n.extend&&a>s){var u=s;s=a,a=u}var c=o(e,a),l=o(e,s);if(c&&l){var p=document.createRange();p.setStart(c.node,c.offset),n.removeAllRanges(),a>s?(n.addRange(p),n.extend(l.node,l.offset)):(p.setEnd(l.node,l.offset),n.addRange(p))}}}};e.exports=u},function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function o(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}e.exports=function(e,t){for(var n=r(e),i=0,a=0;n;){if(3===n.nodeType){if(a=i+n.textContent.length,i<=t&&a>=t)return{node:n,offset:t-i};i=a}n=r(o(n))}}},function(e,t,n){"use strict";var r=n(855);e.exports=function e(t,n){return!(!t||!n)&&(t===n||!r(t)&&(r(n)?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}},function(e,t,n){"use strict";var r=n(856);e.exports=function(e){return r(e)&&3==e.nodeType}},function(e,t,n){"use strict";e.exports=function(e){var t=(e?e.ownerDocument||e:document).defaultView||window;return!(!e||!("function"==typeof t.Node?e instanceof t.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}},function(e,t,n){"use strict";var r="http://www.w3.org/1999/xlink",o="http://www.w3.org/XML/1998/namespace",i={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},a={Properties:{},DOMAttributeNamespaces:{xlinkActuate:r,xlinkArcrole:r,xlinkHref:r,xlinkRole:r,xlinkShow:r,xlinkTitle:r,xlinkType:r,xmlBase:o,xmlLang:o,xmlSpace:o},DOMAttributeNames:{}};Object.keys(i).forEach(function(e){a.Properties[e]=0,i[e]&&(a.DOMAttributeNames[e]=i[e])}),e.exports=a},function(e,t,n){"use strict";var r=n(137),o=n(36),i=n(27),a=n(436),s=n(64),u=n(437),c=n(422),l=n(250),p=o.canUseDOM&&"documentMode"in document&&document.documentMode<=11,f={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:["topBlur","topContextMenu","topFocus","topKeyDown","topKeyUp","topMouseDown","topMouseUp","topSelectionChange"]}},h=null,d=null,m=null,v=!1,g=!1;function y(e,t){if(v||null==h||h!==u())return null;var n=function(e){if("selectionStart"in e&&a.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}(h);if(!m||!l(m,n)){m=n;var o=s.getPooled(f.select,d,e,t);return o.type="select",o.target=h,r.accumulateTwoPhaseDispatches(o),o}return null}var b={eventTypes:f,extractEvents:function(e,t,n,r){if(!g)return null;var o=t?i.getNodeFromInstance(t):window;switch(e){case"topFocus":(c(o)||"true"===o.contentEditable)&&(h=o,d=t,m=null);break;case"topBlur":h=null,d=null,m=null;break;case"topMouseDown":v=!0;break;case"topContextMenu":case"topMouseUp":return v=!1,y(n,r);case"topSelectionChange":if(p)break;case"topKeyDown":case"topKeyUp":return y(n,r)}return null},didPutListener:function(e,t,n){"onSelect"===t&&(g=!0)}};e.exports=b},function(e,t,n){"use strict";var r=n(21),o=n(435),i=n(137),a=n(27),s=n(860),u=n(861),c=n(64),l=n(862),p=n(863),f=n(183),h=n(865),d=n(866),m=n(867),v=n(139),g=n(868),y=n(54),b=n(255),_=(n(15),{}),w={};["abort","animationEnd","animationIteration","animationStart","blur","canPlay","canPlayThrough","click","contextMenu","copy","cut","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","focus","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","progress","rateChange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchMove","touchStart","transitionEnd","volumeChange","waiting","wheel"].forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t,r="top"+t,o={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[r]};_[e]=o,w[r]=o});var x={};function E(e){return"."+e._rootNodeID}function S(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}var C={eventTypes:_,extractEvents:function(e,t,n,o){var a,y=w[e];if(!y)return null;switch(e){case"topAbort":case"topCanPlay":case"topCanPlayThrough":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topVolumeChange":case"topWaiting":a=c;break;case"topKeyPress":if(0===b(n))return null;case"topKeyDown":case"topKeyUp":a=p;break;case"topBlur":case"topFocus":a=l;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":a=f;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":a=h;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":a=d;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":a=s;break;case"topTransitionEnd":a=m;break;case"topScroll":a=v;break;case"topWheel":a=g;break;case"topCopy":case"topCut":case"topPaste":a=u}a||r("86",e);var _=a.getPooled(y,t,n,o);return i.accumulateTwoPhaseDispatches(_),_},didPutListener:function(e,t,n){if("onClick"===t&&!S(e._tag)){var r=E(e),i=a.getNodeFromInstance(e);x[r]||(x[r]=o.listen(i,"click",y))}},willDeleteListener:function(e,t){if("onClick"===t&&!S(e._tag)){var n=E(e);x[n].remove(),delete x[n]}}};e.exports=C},function(e,t,n){"use strict";var r=n(64);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{animationName:null,elapsedTime:null,pseudoElement:null}),e.exports=o},function(e,t,n){"use strict";var r=n(64),o={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};function i(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(i,o),e.exports=i},function(e,t,n){"use strict";var r=n(139);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{relatedTarget:null}),e.exports=o},function(e,t,n){"use strict";var r=n(139),o=n(255),i={key:n(864),location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:n(244),charCode:function(e){return"keypress"===e.type?o(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?o(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,i),e.exports=a},function(e,t,n){"use strict";var r=n(255),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=function(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=r(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?i[e.keyCode]||"Unidentified":""}},function(e,t,n){"use strict";var r=n(183);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{dataTransfer:null}),e.exports=o},function(e,t,n){"use strict";var r=n(139),o={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:n(244)};function i(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(i,o),e.exports=i},function(e,t,n){"use strict";var r=n(64);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{propertyName:null,elapsedTime:null,pseudoElement:null}),e.exports=o},function(e,t,n){"use strict";var r=n(183);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),e.exports=o},function(e,t,n){"use strict";n(254);var r=9;e.exports=function(e,t){return{_topLevelWrapper:e,_idCounter:1,_ownerDocument:t?t.nodeType===r?t:t.ownerDocument:null,_node:t,_tag:t?t.nodeName.toLowerCase():null,_namespaceURI:t?t.namespaceURI:null}}},function(e,t,n){"use strict";e.exports={useCreateElement:!0,useFiber:!1}},function(e,t,n){"use strict";var r=n(872),o=/\/?>/,i=/^<\!\-\-/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return i.test(e)?e:e.replace(o," "+a.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(a.CHECKSUM_ATTR_NAME);return n=n&&parseInt(n,10),r(e)===n}};e.exports=a},function(e,t,n){"use strict";var r=65521;e.exports=function(e){for(var t=1,n=0,o=0,i=e.length,a=-4&i;o<a;){for(var s=Math.min(o+4096,a);o<s;o+=4)n+=(t+=e.charCodeAt(o))+(t+=e.charCodeAt(o+1))+(t+=e.charCodeAt(o+2))+(t+=e.charCodeAt(o+3));t%=r,n%=r}for(;o<i;o++)n+=t+=e.charCodeAt(o);return(t%=r)|(n%=r)<<16}},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r=n(21),o=(n(62),n(27)),i=n(140),a=n(439);n(15),n(23);e.exports=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=i.get(e);if(t)return(t=a(t))?o.getNodeFromInstance(t):null;"function"==typeof e.render?r("44"):r("45",Object.keys(e))}},function(e,t,n){"use strict";var r=n(438);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(0),o=a(n(440)),i=a(n(441));a(n(442));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(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}(this,e.call(this,n,r));return o.store=n.store,o}return 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)}(t,e),t.prototype.getChildContext=function(){return{store:this.store}},t.prototype.render=function(){return r.Children.only(this.props.children)},t}(r.Component);t.default=s,s.propTypes={store:i.default.isRequired,children:o.default.element.isRequired},s.childContextTypes={store:i.default.isRequired}},function(e,t,n){"use strict";var r=n(878);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(e,t,n){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},v=Boolean(e),g=e||p,y=void 0;y="function"==typeof t?t:t?(0,s.default)(t):f;var b=n||h,_=l.pure,w=void 0===_||_,x=l.withRef,E=void 0!==x&&x,S=w&&b!==h,C=m++;return function(e){var t="Connect("+function(e){return e.displayName||e.name||"Component"}(e)+")";var n=function(n){function i(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var o=function(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}(this,n.call(this,e,r));o.version=C,o.store=e.store||r.store,(0,c.default)(o.store,'Could not find "store" in either the context or props of "'+t+'". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "'+t+'".');var a=o.store.getState();return o.state={storeState:a},o.clearCache(),o}return 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)}(i,n),i.prototype.shouldComponentUpdate=function(){return!w||this.haveOwnPropsChanged||this.hasStoreStateChanged},i.prototype.computeStateProps=function(e,t){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,t);var n=e.getState(),r=this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(n,t):this.finalMapStateToProps(n);return r},i.prototype.configureFinalMapState=function(e,t){var n=g(e.getState(),t),r="function"==typeof n;return this.finalMapStateToProps=r?n:g,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,r?this.computeStateProps(e,t):n},i.prototype.computeDispatchProps=function(e,t){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,t);var n=e.dispatch,r=this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(n,t):this.finalMapDispatchToProps(n);return r},i.prototype.configureFinalMapDispatch=function(e,t){var n=y(e.dispatch,t),r="function"==typeof n;return this.finalMapDispatchToProps=r?n:y,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,r?this.computeDispatchProps(e,t):n},i.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return(!this.stateProps||!(0,a.default)(e,this.stateProps))&&(this.stateProps=e,!0)},i.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return(!this.dispatchProps||!(0,a.default)(e,this.dispatchProps))&&(this.dispatchProps=e,!0)},i.prototype.updateMergedPropsIfNeeded=function(){var e=function(e,t,n){0;return b(e,t,n)}(this.stateProps,this.dispatchProps,this.props);return!(this.mergedProps&&S&&(0,a.default)(e,this.mergedProps))&&(this.mergedProps=e,!0)},i.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},i.prototype.trySubscribe=function(){v&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},i.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},i.prototype.componentDidMount=function(){this.trySubscribe()},i.prototype.componentWillReceiveProps=function(e){w&&(0,a.default)(e,this.props)||(this.haveOwnPropsChanged=!0)},i.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},i.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},i.prototype.handleChange=function(){if(this.unsubscribe){var e=this.store.getState(),t=this.state.storeState;if(!w||t!==e){if(w&&!this.doStatePropsDependOnOwnProps){var n=function(e,t){try{return e.apply(t)}catch(e){return d.value=e,d}}(this.updateStatePropsIfNeeded,this);if(!n)return;n===d&&(this.statePropsPrecalculationError=d.value),this.haveStatePropsBeenPrecalculated=!0}this.hasStoreStateChanged=!0,this.setState({storeState:e})}}},i.prototype.getWrappedInstance=function(){return(0,c.default)(E,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},i.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,i=this.haveStatePropsBeenPrecalculated,a=this.statePropsPrecalculationError,s=this.renderedElement;if(this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,a)throw a;var u=!0,c=!0;w&&s&&(u=n||t&&this.doStatePropsDependOnOwnProps,c=t&&this.doDispatchPropsDependOnOwnProps);var l=!1,p=!1;i?l=!0:u&&(l=this.updateStatePropsIfNeeded()),c&&(p=this.updateDispatchPropsIfNeeded());return!(!!(l||p||t)&&this.updateMergedPropsIfNeeded())&&s?s:(this.renderedElement=E?(0,o.createElement)(e,r({},this.mergedProps,{ref:"wrappedInstance"})):(0,o.createElement)(e,this.mergedProps),this.renderedElement)},i}(o.Component);return n.displayName=t,n.WrappedComponent=e,n.contextTypes={store:i.default},n.propTypes={store:i.default},(0,u.default)(n,e)}};var o=n(0),i=l(n(441)),a=l(n(880)),s=l(n(881)),u=(l(n(442)),l(n(256)),l(n(882))),c=l(n(883));function l(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{}},f=function(e){return{dispatch:e}},h=function(e,t,n){return r({},n,e,t)};var d={value:null};var m=0},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<n.length;i++)if(!o.call(t,n[i])||e[n[i]]!==t[n[i]])return!1;return!0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){return function(t){return(0,r.bindActionCreators)(e,t)}};var r=n(120)},function(e,t,n){"use strict";var r=n(357),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var c=Object.defineProperty,l=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,d=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(d){var o=h(n);o&&o!==d&&e(t,o,r)}var a=l(n);p&&(a=a.concat(p(n)));for(var s=u(t),m=u(n),v=0;v<a.length;++v){var g=a[v];if(!(i[g]||r&&r[g]||m&&m[g]||s&&s[g])){var y=f(n,g);try{c(t,g,y)}catch(e){}}}return t}return t}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,s],l=0;(u=new Error(t.replace(/%s/g,function(){return c[l++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},function(e,t,n){var r=n(114),o=n(83);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(114),o=n(444);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(49),o=n(171),i=n(888),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t,n){(function(e){var r=n(48),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}}).call(this,n(169)(e))},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(114),o=n(222);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t,n){var r=n(114),o=n(445);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},function(e,t,n){var r=n(258),o=n(895),i=n(896),a=n(897),s=n(898),u="[object Boolean]",c="[object Date]",l="[object Map]",p="[object Number]",f="[object RegExp]",h="[object Set]",d="[object String]",m="[object Symbol]",v="[object ArrayBuffer]",g="[object DataView]",y="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",w="[object Int16Array]",x="[object Int32Array]",E="[object Uint8Array]",S="[object Uint8ClampedArray]",C="[object Uint16Array]",k="[object Uint32Array]";e.exports=function(e,t,n){var O=e.constructor;switch(t){case v:return r(e);case u:case c:return new O(+e);case g:return o(e,n);case y:case b:case _:case w:case x:case E:case S:case C:case k:return s(e,n);case l:return new O;case p:case d:return new O(e);case f:return i(e);case h:return new O;case m:return a(e)}}},function(e,t,n){var r=n(258);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},function(e,t){var n=/\w*$/;e.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}},function(e,t,n){var r=n(102),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},function(e,t,n){var r=n(258);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},function(e,t,n){var r=n(900),o=n(257),i=n(171);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},function(e,t,n){var r=n(49),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},function(e,t,n){var r=n(902),o=n(226),i=n(227),a=i&&i.isMap,s=a?o(a):r;e.exports=s},function(e,t,n){var r=n(172),o=n(63),i="[object Map]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t,n){var r=n(904),o=n(226),i=n(227),a=i&&i.isSet,s=a?o(a):r;e.exports=s},function(e,t,n){var r=n(172),o=n(63),i="[object Set]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t,n){var r=n(104),o=n(906),i=n(907),a=n(105);e.exports=function(e,t){return t=r(t,e),null==(e=i(e,t))||delete e[a(o(t))]}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){var r=n(173),o=n(363);e.exports=function(e,t){return t.length<2?e:r(e,o(t,0,-1))}},function(e,t,n){var r=n(256);e.exports=function(e){return r(e)?void 0:e}},function(e,t,n){var r=n(910);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},function(e,t,n){var r=n(221),o=n(911);e.exports=function e(t,n,i,a,s){var u=-1,c=t.length;for(i||(i=o),s||(s=[]);++u<c;){var l=t[u];n>0&&i(l)?n>1?e(l,n-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}},function(e,t,n){var r=n(102),o=n(223),i=n(35),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},function(e,t){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},function(e,t,n){var r=n(914),o=n(412),i=n(229),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){var n=800,r=16,o=Date.now;e.exports=function(e){var t=0,i=0;return function(){var a=o(),s=r-(a-i);if(i=a,s>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){"use strict";var r=n(917),o=n(918);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=b(e));return e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),p=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(919);function b(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i<e.indexOf("#")?"?":"#",c=e.split(s);c[0]=c[0].replace(/\\/g,"/");var b=e=c.join(s);if(b=b.trim(),!n&&1===e.split("#").length){var _=u.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=a.exec(b);if(w){var x=(w=w[0]).toLowerCase();this.protocol=x,b=b.substr(w.length)}if(n||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===b.substr(0,2);!E||w&&v[w]||(b=b.substr(2),this.slashes=!0)}if(!v[w]&&(E||w&&!g[w])){for(var S,C,k=-1,O=0;O<f.length;O++){-1!==(A=b.indexOf(f[O]))&&(-1===k||A<k)&&(k=A)}-1!==(C=-1===k?b.lastIndexOf("@"):b.lastIndexOf("@",k))&&(S=b.slice(0,C),b=b.slice(C+1),this.auth=decodeURIComponent(S)),k=-1;for(O=0;O<p.length;O++){var A;-1!==(A=b.indexOf(p[O]))&&(-1===k||A<k)&&(k=A)}-1===k&&(k=b.length),this.host=b.slice(0,k),b=b.slice(k),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var j=this.hostname.split(/\./),P=(O=0,j.length);O<P;O++){var I=j[O];if(I&&!I.match(h)){for(var M="",N=0,R=I.length;N<R;N++)I.charCodeAt(N)>127?M+="x":M+=I[N];if(!M.match(h)){var D=j.slice(0,O),L=j.slice(O+1),U=I.match(d);U&&(D.push(U[1]),L.unshift(U[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=r.toASCII(this.hostname));var q=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+q,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[x])for(O=0,P=l.length;O<P;O++){var z=l[O];if(-1!==b.indexOf(z)){var B=encodeURIComponent(z);B===z&&(B=escape(z)),b=b.split(z).join(B)}}var V=b.indexOf("#");-1!==V&&(this.hash=b.substr(V),b=b.slice(0,V));var H=b.indexOf("?");if(-1!==H?(this.search=b.substr(H),this.query=b.substr(H+1),t&&(this.query=y.parse(this.query)),b=b.slice(0,H)):t&&(this.search="",this.query={}),b&&(this.pathname=b),g[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){q=this.pathname||"";var W=this.search||"";this.path=q+W}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,a="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(a=y.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+r},i.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,r=Object.keys(this),a=0;a<r.length;a++){var s=r[a];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(n[l]=e[l])}return g[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!g[e.protocol]){for(var p=Object.keys(e),f=0;f<p.length;f++){var h=p[f];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||v[e.protocol])n.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),n.pathname=d.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",y=n.search||"";n.path=m+y}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=_||b||n.host&&e.pathname,x=w,E=n.pathname&&n.pathname.split("/")||[],S=(d=e.pathname&&e.pathname.split("/")||[],n.protocol&&!g[n.protocol]);if(S&&(n.hostname="",n.port=null,n.host&&(""===E[0]?E[0]=n.host:E.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),w=w&&(""===d[0]||""===E[0])),_)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,E=d;else if(d.length)E||(E=[]),E.pop(),E=E.concat(d),n.search=e.search,n.query=e.query;else if(!o.isNullOrUndefined(e.search)){if(S)n.hostname=n.host=E.shift(),(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=E.slice(-1)[0],k=(n.host||e.host||E.length>1)&&("."===C||".."===C)||""===C,O=0,A=E.length;A>=0;A--)"."===(C=E[A])?E.splice(A,1):".."===C?(E.splice(A,1),O++):O&&(E.splice(A,1),O--);if(!w&&!x)for(;O--;O)E.unshift("..");!w||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),k&&"/"!==E.join("/").substr(-1)&&E.push("");var T,j=""===E[0]||E[0]&&"/"===E[0].charAt(0);S&&(n.hostname=n.host=j?"":E.length?E.shift():"",(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift()));return(w=w||n.host&&E.length)&&!j&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){(function(e,r){var o;/*! https://mths.be/punycode v1.3.2 by @mathias */!function(i){t&&t.nodeType,e&&e.nodeType;var a="object"==typeof r&&r;a.global!==a&&a.window!==a&&a.self;var s,u=2147483647,c=36,l=1,p=26,f=38,h=700,d=72,m=128,v="-",g=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=c-l,x=Math.floor,E=String.fromCharCode;function S(e){throw RangeError(_[e])}function C(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function k(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+C((e=e.replace(b,".")).split("."),t).join(".")}function O(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function A(e){return C(e,function(e){var t="";return e>65535&&(t+=E((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=E(e)}).join("")}function T(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function j(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function P(e,t,n){var r=0;for(e=n?x(e/h):e>>1,e+=x(e/t);e>w*p>>1;r+=c)e=x(e/w);return x(r+(w+1)*e/(e+f))}function I(e){var t,n,r,o,i,a,s,f,h,g,y=[],b=e.length,_=0,w=m,E=d;for((n=e.lastIndexOf(v))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&S("not-basic"),y.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<b;){for(i=_,a=1,s=c;o>=b&&S("invalid-input"),((f=T(e.charCodeAt(o++)))>=c||f>x((u-_)/a))&&S("overflow"),_+=f*a,!(f<(h=s<=E?l:s>=E+p?p:s-E));s+=c)a>x(u/(g=c-h))&&S("overflow"),a*=g;E=P(_-i,t=y.length+1,0==i),x(_/t)>u-w&&S("overflow"),w+=x(_/t),_%=t,y.splice(_++,0,w)}return A(y)}function M(e){var t,n,r,o,i,a,s,f,h,g,y,b,_,w,C,k=[];for(b=(e=O(e)).length,t=m,n=0,i=d,a=0;a<b;++a)(y=e[a])<128&&k.push(E(y));for(r=o=k.length,o&&k.push(v);r<b;){for(s=u,a=0;a<b;++a)(y=e[a])>=t&&y<s&&(s=y);for(s-t>x((u-n)/(_=r+1))&&S("overflow"),n+=(s-t)*_,t=s,a=0;a<b;++a)if((y=e[a])<t&&++n>u&&S("overflow"),y==t){for(f=n,h=c;!(f<(g=h<=i?l:h>=i+p?p:h-i));h+=c)C=f-g,w=c-g,k.push(E(j(g+C%w,0))),f=x(C/w);k.push(E(j(f,0))),i=P(n,_,r==o),n=0,++r}++n,++t}return k.join("")}s={version:"1.3.2",ucs2:{decode:O,encode:A},decode:I,encode:M,toASCII:function(e){return k(e,function(e){return y.test(e)?"xn--"+M(e):e})},toUnicode:function(e){return k(e,function(e){return g.test(e)?I(e.slice(4).toLowerCase()):e})}},void 0===(o=function(){return s}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(169)(e),n(42))},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(920),t.encode=t.stringify=n(921)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var p,f,h,d,m=e[l].replace(s,"%20"),v=m.indexOf(n);v>=0?(p=m.substr(0,v),f=m.substr(v+1)):(p=m,f=""),h=decodeURIComponent(p),d=decodeURIComponent(f),r(a,h)?o(a[h])?a[h].push(d):a[h]=[a[h],d]:a[h]=d}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(a(e),function(a){var s=encodeURIComponent(r(a))+n;return o(e[a])?i(e[a],function(e){return s+encodeURIComponent(r(e))}).join(t):s+encodeURIComponent(r(e[a]))}).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){var r=n(181),o=n(114),i=n(923),a=n(103),s=n(171),u=n(83),c=Object.prototype.hasOwnProperty,l=i(function(e,t){if(s(t)||a(t))o(t,u(t),e);else for(var n in t)c.call(t,n)&&r(e,n,t[n])});e.exports=l},function(e,t,n){var r=n(924),o=n(384);e.exports=function(e){return r(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var u=n[r];u&&e(t,u,r,a)}return t})}},function(e,t,n){var r=n(229),o=n(448),i=n(449);e.exports=function(e,t){return i(o(e,t,r),e+"")}},function(e,t,n){
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017 Joachim Wester
* MIT license
*/
var r=n(259),o=n(450),i=n(450);t.applyOperation=i.applyOperation,t.applyPatch=i.applyPatch,t.applyReducer=i.applyReducer,t.getValueByPointer=i.getValueByPointer,t.validate=i.validate,t.validator=i.validator;var a=n(259);t.JsonPatchError=a.PatchError,t.deepClone=a._deepClone,t.escapePathComponent=a.escapePathComponent,t.unescapePathComponent=a.unescapePathComponent;var s=new WeakMap,u=function(e){this.observers=new Map,this.obj=e},c=function(e,t){this.callback=e,this.observer=t};function l(e){var t=s.get(e.object);p(t.value,e.object,e.patches,""),e.patches.length&&o.applyPatch(t.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function p(e,t,n,o){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var i=r._objectKeys(t),a=r._objectKeys(e),s=!1,u=a.length-1;u>=0;u--){var c=e[f=a[u]];if(!r.hasOwnProperty(t,f)||void 0===t[f]&&void 0!==c&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(n.push({op:"remove",path:o+"/"+r.escapePathComponent(f)}),s=!0):(n.push({op:"replace",path:o,value:t}),!0);else{var l=t[f];"object"==typeof c&&null!=c&&"object"==typeof l&&null!=l?p(c,l,n,o+"/"+r.escapePathComponent(f)):c!==l&&(!0,n.push({op:"replace",path:o+"/"+r.escapePathComponent(f),value:r._deepClone(l)}))}}if(s||i.length!=a.length)for(u=0;u<i.length;u++){var f=i[u];r.hasOwnProperty(e,f)||void 0===t[f]||n.push({op:"add",path:o+"/"+r.escapePathComponent(f),value:r._deepClone(t[f])})}}}t.unobserve=function(e,t){t.unobserve()},t.observe=function(e,t){var n,o=function(e){return s.get(e)}(e);if(o){var i=function(e,t){return e.observers.get(t)}(o,t);n=i&&i.observer}else o=new u(e),s.set(e,o);if(n)return n;if(n={},o.value=r._deepClone(e),t){n.callback=t,n.next=null;var a=function(){l(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(a)};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p)):(document.documentElement.attachEvent("onmouseup",p),document.documentElement.attachEvent("onkeyup",p),document.documentElement.attachEvent("onmousedown",p),document.documentElement.attachEvent("onkeydown",p),document.documentElement.attachEvent("onchange",p)))}return n.patches=[],n.object=e,n.unobserve=function(){l(n),clearTimeout(n.next),function(e,t){e.observers.delete(t.callback)}(o,n),"undefined"!=typeof window&&(window.removeEventListener?(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p)):(document.documentElement.detachEvent("onmouseup",p),document.documentElement.detachEvent("onkeyup",p),document.documentElement.detachEvent("onmousedown",p),document.documentElement.detachEvent("onkeydown",p)))},o.observers.set(t,new c(t,n)),n},t.generate=l,t.compare=function(e,t){var n=[];return p(e,t,n,""),n}},function(e,t,n){var r=Array.prototype.slice,o=n(927),i=n(928),a=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:function(e,t,n){var c,l;if(s(e)||s(t))return!1;if(e.prototype!==t.prototype)return!1;if(i(e))return!!i(t)&&(e=r.call(e),t=r.call(t),a(e,t,n));if(u(e)){if(!u(t))return!1;if(e.length!==t.length)return!1;for(c=0;c<e.length;c++)if(e[c]!==t[c])return!1;return!0}try{var p=o(e),f=o(t)}catch(e){return!1}if(p.length!=f.length)return!1;for(p.sort(),f.sort(),c=p.length-1;c>=0;c--)if(p[c]!=f[c])return!1;for(c=p.length-1;c>=0;c--)if(l=p[c],!a(e[l],t[l],n))return!1;return typeof e==typeof t}(e,t,n))};function s(e){return null==e}function u(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}(e.exports="function"==typeof Object.keys?Object.keys:n).shim=n},function(e,t){var n="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function r(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}(t=e.exports=n?r:o).supported=r,t.unsupported=o},function(e,t,n){(function(t){!function(){"use strict";e.exports=function(e){return(e instanceof t?e:new t(e.toString(),"binary")).toString("base64")}}()}).call(this,n(61).Buffer)},function(e,t,n){var r=n(931),o=n(360),i=n(381),a=n(65);e.exports=function(e,t,n){return e=a(e),n=null==n?0:r(i(n),0,e.length),t=o(t),e.slice(n,n+t.length)==t}},function(e,t){e.exports=function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}},function(e,t,n){"use strict";var r=n(933),o=n(934),i=n(452);e.exports={formats:i,parse:o,stringify:r}},function(e,t,n){"use strict";var r=n(451),o=n(452),i=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,u=Array.prototype.push,c=function(e,t){u.apply(e,s(t)?t:[t])},l=Date.prototype.toISOString,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,formatter:o.formatters[o.default],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},f=function e(t,n,o,i,a,u,l,f,h,d,m,v,g){var y=t;if("function"==typeof l?y=l(n,y):y instanceof Date?y=d(y):"comma"===o&&s(y)&&(y=y.join(",")),null===y){if(i)return u&&!v?u(n,p.encoder,g):n;y=""}if("string"==typeof y||"number"==typeof y||"boolean"==typeof y||r.isBuffer(y))return u?[m(v?n:u(n,p.encoder,g))+"="+m(u(y,p.encoder,g))]:[m(n)+"="+m(String(y))];var b,_=[];if(void 0===y)return _;if(s(l))b=l;else{var w=Object.keys(y);b=f?w.sort(f):w}for(var x=0;x<b.length;++x){var E=b[x];a&&null===y[E]||(s(y)?c(_,e(y[E],"function"==typeof o?o(n,E):n,o,i,a,u,l,f,h,d,m,v,g)):c(_,e(y[E],n+(h?"."+E:"["+E+"]"),o,i,a,u,l,f,h,d,m,v,g)))}return _};e.exports=function(e,t){var n,r=e,u=function(e){if(!e)return p;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||p.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if(void 0!==e.format){if(!i.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=o.formatters[n],a=p.filter;return("function"==typeof e.filter||s(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:p.addQueryPrefix,allowDots:void 0===e.allowDots?p.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:p.charsetSentinel,delimiter:void 0===e.delimiter?p.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:p.encode,encoder:"function"==typeof e.encoder?e.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:p.encodeValuesOnly,filter:a,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:p.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:p.strictNullHandling}}(t);"function"==typeof u.filter?r=(0,u.filter)("",r):s(u.filter)&&(n=u.filter);var l,h=[];if("object"!=typeof r||null===r)return"";l=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var d=a[l];n||(n=Object.keys(r)),u.sort&&n.sort(u.sort);for(var m=0;m<n.length;++m){var v=n[m];u.skipNulls&&null===r[v]||c(h,f(r[v],v,d,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.formatter,u.encodeValuesOnly,u.charset))}var g=h.join(u.delimiter),y=!0===u.addQueryPrefix?"?":"";return u.charsetSentinel&&("iso-8859-1"===u.charset?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),g.length>0?y+g:""}},function(e,t,n){"use strict";var r=n(451),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),s=a?r.slice(0,a.index):r,u=[];if(s){if(!n.plainObjects&&o.call(Object.prototype,s)&&!n.allowPrototypes)return;u.push(s)}for(var c=0;null!==(a=i.exec(r))&&c<n.depth;){if(c+=1,!n.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+r.slice(a.index)+"]"),function(e,t,n){for(var r=t,o=e.length-1;o>=0;--o){var i,a=e[o];if("[]"===a&&n.parseArrays)i=[].concat(r);else{i=n.plainObjects?Object.create(null):{};var s="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(s,10);n.parseArrays||""!==s?!isNaN(u)&&a!==s&&String(u)===s&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(i=[])[u]=r:i[s]=r:i={0:r}}r=i}return r}(u,t,n)}};e.exports=function(e,t){var n=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?i.charset:e.charset;return{allowDots:void 0===e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth?e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,s={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,c=t.parameterLimit===1/0?void 0:t.parameterLimit,l=u.split(t.delimiter,c),p=-1,f=t.charset;if(t.charsetSentinel)for(n=0;n<l.length;++n)0===l[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===l[n]?f="utf-8":"utf8=%26%2310003%3B"===l[n]&&(f="iso-8859-1"),p=n,n=l.length);for(n=0;n<l.length;++n)if(n!==p){var h,d,m=l[n],v=m.indexOf("]="),g=-1===v?m.indexOf("="):v+1;-1===g?(h=t.decoder(m,i.decoder,f),d=t.strictNullHandling?null:""):(h=t.decoder(m.slice(0,g),i.decoder,f),d=t.decoder(m.slice(g+1),i.decoder,f)),d&&t.interpretNumericEntities&&"iso-8859-1"===f&&(d=a(d)),d&&t.comma&&d.indexOf(",")>-1&&(d=d.split(",")),o.call(s,h)?s[h]=r.combine(s[h],d):s[h]=d}return s}(e,n):e,c=n.plainObjects?Object.create(null):{},l=Object.keys(u),p=0;p<l.length;++p){var f=l[p],h=s(f,u[f],n);c=r.merge(c,h,n)}return r.compact(c)}},function(e,t,n){"use strict";var r=t,o=n(61).Buffer;function i(e,t){try{return decodeURIComponent(e)}catch(n){return r.unescapeBuffer(e,t).toString()}}r.unescapeBuffer=function(e,t){for(var n,r,i,a=new o(e.length),s=0,u=0,c=0;u<=e.length;u++){var l=u<e.length?e.charCodeAt(u):NaN;switch(s){case 0:switch(l){case 37:n=0,r=0,s=1;break;case 43:t&&(l=32);default:a[c++]=l}break;case 1:if(i=l,l>=48&&l<=57)n=l-48;else if(l>=65&&l<=70)n=l-65+10;else{if(!(l>=97&&l<=102)){a[c++]=37,a[c++]=l,s=0;break}n=l-97+10}s=2;break;case 2:if(s=0,l>=48&&l<=57)r=l-48;else if(l>=65&&l<=70)r=l-65+10;else{if(!(l>=97&&l<=102)){a[c++]=37,a[c++]=i,a[c++]=l;break}r=l-97+10}a[c++]=16*n+r}}return a.slice(0,c-1)},r.unescape=i;for(var a=new Array(256),s=0;s<256;++s)a[s]="%"+((s<16?"0":"")+s.toString(16)).toUpperCase();r.escape=function(e){"string"!=typeof e&&(e+="");for(var t="",n=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);if(!(33===o||45===o||46===o||95===o||126===o||o>=39&&o<=42||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122))if(r-n>0&&(t+=e.slice(n,r)),o<128)n=r+1,t+=a[o];else if(o<2048)n=r+1,t+=a[192|o>>6]+a[128|63&o];else if(o<55296||o>=57344)n=r+1,t+=a[224|o>>12]+a[128|o>>6&63]+a[128|63&o];else{var i;if(!(++r<e.length))throw new URIError("URI malformed");i=1023&e.charCodeAt(r),n=r+1,t+=a[240|(o=65536+((1023&o)<<10|i))>>18]+a[128|o>>12&63]+a[128|o>>6&63]+a[128|63&o]}}return 0===n?e:n<e.length?t+e.slice(n):t};var u=function(e){return"string"==typeof e?e:"number"==typeof e&&isFinite(e)?""+e:"boolean"==typeof e?e?"true":"false":""};function c(e,t){try{return t(e)}catch(t){return r.unescape(e,!0)}}r.stringify=r.encode=function(e,t,n,o){t=t||"&",n=n||"=";var i=r.escape;if(o&&"function"==typeof o.encodeURIComponent&&(i=o.encodeURIComponent),null!==e&&"object"==typeof e){for(var a=Object.keys(e),s=a.length,c=s-1,l="",p=0;p<s;++p){var f=a[p],h=e[f],d=i(u(f))+n;if(Array.isArray(h)){for(var m=h.length,v=m-1,g=0;g<m;++g)l+=d+i(u(h[g])),g<v&&(l+=t);m&&p<c&&(l+=t)}else l+=d+i(u(h)),p<c&&(l+=t)}return l}return""},r.parse=r.decode=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;"string"!=typeof t&&(t+="");var s=n.length,u=t.length,l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var p=1/0;l>0&&(p=l);var f=r.unescape;o&&"function"==typeof o.decodeURIComponent&&(f=o.decodeURIComponent);for(var h=f!==i,d=[],m=0,v=0,g=0,y="",b="",_=h,w=h,x=0,E=0;E<e.length;++E){var S=e.charCodeAt(E);if(S!==t.charCodeAt(v)){if(v=0,w||(37===S?x=1:x>0&&(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102)?3==++x&&(w=!0):x=0),g<s){if(S===n.charCodeAt(g)){if(++g===s)m<(k=E-g+1)&&(y+=e.slice(m,k)),x=0,m=E+1;continue}g=0,_||(37===S?x=1:x>0&&(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102)?3==++x&&(_=!0):x=0)}43===S&&(g<s?(E-m>0&&(y+=e.slice(m,E)),y+="%20",_=!0):(E-m>0&&(b+=e.slice(m,E)),b+="%20",w=!0),m=E+1)}else if(++v===u){var C,k=E-v+1;if(g<s?m<k&&(y+=e.slice(m,k)):m<k&&(b+=e.slice(m,k)),_&&(y=c(y,f)),w&&(b=c(b,f)),-1===d.indexOf(y))a[y]=b,d[d.length]=y;else(C=a[y])instanceof Array?C[C.length]=b:a[y]=[C,b];if(0==--p)break;_=w=h,x=0,y=b="",m=E+1,v=g=0}}p>0&&(m<e.length||g>0)&&(m<e.length&&(g<s?y+=e.slice(m):v<u&&(b+=e.slice(m))),_&&(y=c(y,f)),w&&(b=c(b,f)),-1===d.indexOf(y)?(a[y]=b,d[d.length]=y):(C=a[y])instanceof Array?C[C.length]=b:a[y]=[C,b]);return a}},function(e,t,n){"use strict";(function(t){
/*!
* @description Recursive object extending
* @author Viacheslav Lotsmanov <[email protected]>
* @license MIT
*
* The MIT License (MIT)
*
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(e){var t=[];return e.forEach(function(e,i){"object"==typeof e&&null!==e?Array.isArray(e)?t[i]=o(e):n(e)?t[i]=r(e):t[i]=a({},e):t[i]=e}),t}function i(e,t){return"__proto__"===t?void 0:e[t]}var a=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,s=arguments[0],u=Array.prototype.slice.call(arguments,1);return u.forEach(function(u){"object"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach(function(c){return t=i(s,c),(e=i(u,c))===s?void 0:"object"!=typeof e||null===e?void(s[c]=e):Array.isArray(e)?void(s[c]=o(e)):n(e)?void(s[c]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(s[c]=a({},e)):void(s[c]=a(t,e))})}),s}}).call(this,n(61).Buffer)},function(e,t,n){e.exports=n(938)},function(e,t,n){n(160),n(99),n(939),n(943),n(944),e.exports=n(22).WeakMap},function(e,t,n){"use strict";var r,o=n(32),i=n(260)(0),a=n(212),s=n(132),u=n(351),c=n(942),l=n(41),p=n(141),f=n(141),h=!o.ActiveXObject&&"ActiveXObject"in o,d=s.getWeak,m=Object.isExtensible,v=c.ufstore,g=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},y={get:function(e){if(l(e)){var t=d(e);return!0===t?v(p(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return c.def(p(this,"WeakMap"),e,t)}},b=e.exports=n(453)("WeakMap",g,y,c,!0,!0);f&&h&&(u((r=c.getConstructor(g,"WeakMap")).prototype,y),s.NEED=!0,i(["delete","has","get","set"],function(e){var t=b.prototype,n=t[e];a(t,e,function(t,o){if(l(t)&&!m(t)){this._f||(this._f=new r);var i=this._f[e](t,o);return"set"==e?this:i}return n.call(this,t,o)})}))},function(e,t,n){var r=n(941);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(41),o=n(215),i=n(34)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){"use strict";var r=n(179),o=n(132).getWeak,i=n(45),a=n(41),s=n(178),u=n(108),c=n(260),l=n(69),p=n(141),f=c(5),h=c(6),d=0,m=function(e){return e._l||(e._l=new v)},v=function(){this.a=[]},g=function(e,t){return f(e.a,function(e){return e[0]===t})};v.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=h(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,i){var c=e(function(e,r){s(e,c,t,"_i"),e._t=t,e._i=d++,e._l=void 0,null!=r&&u(r,n,e[i],e)});return r(c.prototype,{delete:function(e){if(!a(e))return!1;var n=o(e);return!0===n?m(p(this,t)).delete(e):n&&l(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=o(e);return!0===n?m(p(this,t)).has(e):n&&l(n,this._i)}}),c},def:function(e,t,n){var r=o(i(t),!0);return!0===r?m(e).set(t,n):r[e._i]=n,e},ufstore:m}},function(e,t,n){n(454)("WeakMap")},function(e,t,n){n(455)("WeakMap")},function(e,t){var n={};!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return d.iterable&&(t[Symbol.iterator]=function(){return t}),t}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader,n=a(t);return t.readAsArrayBuffer(e),n}function u(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function c(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(d.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(d.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(d.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(d.arrayBuffer&&d.blob&&v(e))this._bodyArrayBuffer=u(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!d.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!g(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=u(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):d.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},d.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=a(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},d.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function l(e,t){var n=(t=t||{}).body;if(e instanceof l){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=function(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function p(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function f(e){var t=new o;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}function h(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new o(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var d={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(d.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=function(e){return e&&DataView.prototype.isPrototypeOf(e)},g=ArrayBuffer.isView||function(e){return e&&m.indexOf(Object.prototype.toString.call(e))>-1};o.prototype.append=function(e,r){e=t(e),r=n(r);var o=this.map[e];this.map[e]=o?o+","+r:r},o.prototype.delete=function(e){delete this.map[t(e)]},o.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},o.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},o.prototype.set=function(e,r){this.map[t(e)]=n(r)},o.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},o.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},o.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},o.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},d.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this,{body:this._bodyInit})},c.call(l.prototype),c.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},h.error=function(){var e=new h(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];h.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new h(null,{status:t,headers:{location:e}})},e.Headers=o,e.Request=l,e.Response=h,e.fetch=function(e,t){return new Promise(function(n,r){var o=new l(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:f(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;n(new h(t,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&d.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}(void 0!==n?n:this),e.exports=n},function(e,t){var n=e.exports=function(e){return new r(e)};function r(e){this.value=e}function o(e,t,n){var r=[],o=[],s=!0;return function e(p){var f=n?i(p):p,h={},d=!0,m={node:f,node_:p,path:[].concat(r),parent:o[o.length-1],parents:o,key:r.slice(-1)[0],isRoot:0===r.length,level:r.length,circular:null,update:function(e,t){m.isRoot||(m.parent.node[m.key]=e),m.node=e,t&&(d=!1)},delete:function(e){delete m.parent.node[m.key],e&&(d=!1)},remove:function(e){u(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],e&&(d=!1)},keys:null,before:function(e){h.before=e},after:function(e){h.after=e},pre:function(e){h.pre=e},post:function(e){h.post=e},stop:function(){s=!1},block:function(){d=!1}};if(!s)return m;function v(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=a(m.node)),m.isLeaf=0==m.keys.length;for(var e=0;e<o.length;e++)if(o[e].node_===p){m.circular=o[e];break}}else m.isLeaf=!0,m.keys=null;m.notLeaf=!m.isLeaf,m.notRoot=!m.isRoot}v();var g=t.call(m,m.node);return void 0!==g&&m.update&&m.update(g),h.before&&h.before.call(m,m.node),d?("object"!=typeof m.node||null===m.node||m.circular||(o.push(m),v(),c(m.keys,function(t,o){r.push(t),h.pre&&h.pre.call(m,m.node[t],t);var i=e(m.node[t]);n&&l.call(m.node,t)&&(m.node[t]=i.node),i.isLast=o==m.keys.length-1,i.isFirst=0==o,h.post&&h.post.call(m,i),r.pop()}),o.pop()),h.after&&h.after.call(m,m.node),m):m}(e).node}function i(e){if("object"==typeof e&&null!==e){var t;if(u(e))t=[];else if("[object Date]"===s(e))t=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===s(e)}(e))t=new RegExp(e);else if(function(e){return"[object Error]"===s(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===s(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===s(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===s(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},r=function(){};r.prototype=n,t=new r}return c(a(e),function(n){t[n]=e[n]}),t}return e}r.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!l.call(t,r)){t=void 0;break}t=t[r]}return t},r.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!l.call(t,r))return!1;t=t[r]}return!0},r.prototype.set=function(e,t){for(var n=this.value,r=0;r<e.length-1;r++){var o=e[r];l.call(n,o)||(n[o]={}),n=n[o]}return n[e[r]]=t,t},r.prototype.map=function(e){return o(this.value,e,!0)},r.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},r.prototype.reduce=function(e,t){var n=1===arguments.length,r=n?this.value:t;return this.forEach(function(t){this.isRoot&&n||(r=e.call(this,r,t))}),r},r.prototype.paths=function(){var e=[];return this.forEach(function(t){e.push(this.path)}),e},r.prototype.nodes=function(){var e=[];return this.forEach(function(t){e.push(this.node)}),e},r.prototype.clone=function(){var e=[],t=[];return function n(r){for(var o=0;o<e.length;o++)if(e[o]===r)return t[o];if("object"==typeof r&&null!==r){var s=i(r);return e.push(r),t.push(s),c(a(r),function(e){s[e]=n(r[e])}),e.pop(),t.pop(),s}return r}(this.value)};var a=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function s(e){return Object.prototype.toString.call(e)}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},c=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};c(a(r.prototype),function(e){n[e]=function(t){var n=[].slice.call(arguments,1),o=new r(t);return o[e].apply(o,n)}});var l=Object.hasOwnProperty||function(e,t){return t in e}},function(e,t,n){var r=n(948),o=n(447)(function(e,t){return null==e?{}:r(e,t)});e.exports=o},function(e,t,n){var r=n(949),o=n(380);e.exports=function(e,t){return r(e,t,function(t,n){return o(e,n)})}},function(e,t,n){var r=n(173),o=n(410),i=n(104);e.exports=function(e,t,n){for(var a=-1,s=t.length,u={};++a<s;){var c=t[a],l=r(e,c);n(l,c)&&o(u,i(c,e),l)}return u}},function(e,t,n){"use strict";
/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},o=t||{},a=e.split(i),u=o.decode||r,c=0;c<a.length;c++){var l=a[c],p=l.indexOf("=");if(!(p<0)){var f=l.substr(0,p).trim(),h=l.substr(++p,l.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),null==n[f]&&(n[f]=s(h,u))}}return n},t.serialize=function(e,t,n){var r=n||{},i=r.encode||o;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!a.test(e))throw new TypeError("argument name is invalid");var s=i(t);if(s&&!a.test(s))throw new TypeError("argument val is invalid");var u=e+"="+s;if(null!=r.maxAge){var c=r.maxAge-0;if(isNaN(c))throw new Error("maxAge should be a Number");u+="; Max-Age="+Math.floor(c)}if(r.domain){if(!a.test(r.domain))throw new TypeError("option domain is invalid");u+="; Domain="+r.domain}if(r.path){if(!a.test(r.path))throw new TypeError("option path is invalid");u+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");u+="; Expires="+r.expires.toUTCString()}r.httpOnly&&(u+="; HttpOnly");r.secure&&(u+="; Secure");if(r.sameSite){var l="string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite;switch(l){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;default:throw new TypeError("option sameSite is invalid")}}return u};var r=decodeURIComponent,o=encodeURIComponent,i=/; */,a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e,t){try{return t(e)}catch(t){return e}}},function(e,t){e.exports=function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<e.length){var o=e.charCodeAt(n+1);if(o>=56320&&o<=57343){var i=1024*(r-55296)+o-56320+65536;t.push(240+Math.floor(i/64/64/64),128+Math.floor(i/64/64)%64,128+Math.floor(i/64)%64,128+i%64),n+=1;continue}}r>=2048?t.push(224+Math.floor(r/64/64),128+Math.floor(r/64)%64,128+r%64):r>=128?t.push(192+Math.floor(r/64),128+r%64):t.push(r)}return t}},function(e,t,n){!function(){var e;function n(e,t){function n(e,t,n){if(!r(e))return n;var o=0,i=0;do{var a=t.exec(e);if(null===a)break;if(!(i<n))break;o+=a[0].length,i++}while(null!==a);return o>=e.length?-1:o}function r(e){return a.test(e)}function o(e,n){null==e&&(e=["[^]"]),null==n&&(n="g");var r=[];return t.forEach(function(e){r.push(e.source)}),r.push(i.source),r=r.concat(e),new RegExp(r.join("|"),n)}e.findCharIndex=function(e,t){if(t>=e.length)return-1;if(!r(e))return t;for(var n=o(),i=0;null!==n.exec(e)&&!(n.lastIndex>t);)i++;return i},e.findByteIndex=function(e,t){return t>=this.length(e)?-1:n(e,o(),t)},e.charAt=function(e,t){var n=this.findByteIndex(e,t);if(n<0||n>=e.length)return"";var r=e.slice(n,n+8),o=a.exec(r);return null===o?r[0]:o[0]},e.charCodeAt=function(e,t){var r=function(e,t){return n(e,new RegExp(i.source,"g"),t)}(e,t);if(r<0)return NaN;var o=e.charCodeAt(r);return 55296<=o&&o<=56319?1024*(o-55296)+(e.charCodeAt(r+1)-56320)+65536:o},e.fromCharCode=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):String.fromCharCode(e)},e.indexOf=function(e,t,n){null==n&&(n=0);var r=this.findByteIndex(e,n),o=e.indexOf(t,r);return o<0?-1:this.findCharIndex(e,o)},e.lastIndexOf=function(e,t,n){var r;if(null==n)r=e.lastIndexOf(t);else{var o=this.findByteIndex(e,n);r=e.lastIndexOf(t,o)}return r<0?-1:this.findCharIndex(e,r)},e.slice=function(e,t,n){var r,o=this.findByteIndex(e,t);return o<0&&(o=e.length),null==n?r=e.length:(r=this.findByteIndex(e,n))<0&&(r=e.length),e.slice(o,r)},e.substr=function(e,t,n){return t<0&&(t=this.length(e)+t),null==n?this.slice(e,t):this.slice(e,t,t+n)},e.substring=e.slice,e.length=function(e){return this.findCharIndex(e,e.length-1)+1},e.stringToCodePoints=function(e){for(var t=[],n=0;n<e.length&&(codePoint=this.charCodeAt(e,n),codePoint);n++)t.push(codePoint);return t},e.codePointsToString=function(e){for(var t=[],n=0;n<e.length;n++)t.push(this.fromCharCode(e[n]));return t.join("")},e.stringToBytes=function(e){for(var t=[],n=0;n<e.length;n++){for(var r=e.charCodeAt(n),o=[];r>0;)o.push(255&r),r>>=8;1==o.length&&o.push(0),t=t.concat(o.reverse())}return t},e.bytesToString=function(e){for(var t=[],n=0;n<e.length;n+=2){var r=e[n]<<8|e[n+1];t.push(String.fromCharCode(r))}return t.join("")},e.stringToCharArray=function(e){var t=[],n=o();do{var r=n.exec(e);if(null===r)break;t.push(r[0])}while(null!==r);return t};var i=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,a=o([],"")}null!==t?e=t:"undefined"!=typeof window&&null!==window&&(void 0!==window.UtfString&&null!==window.UtfString||(window.UtfString={}),e=window.UtfString);e.visual={},n(e,[]),n(e.visual,[/\uD83C[\uDDE6-\uDDFF]\uD83C[\uDDE6-\uDDFF]/])}()},function(e,t,n){var r=n(443),o=1,i=4;e.exports=function(e){return r(e,o|i)}},function(e,t){!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return d.iterable&&(t[Symbol.iterator]=function(){return t}),t}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader,n=a(t);return t.readAsArrayBuffer(e),n}function u(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function c(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(d.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(d.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(d.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(d.arrayBuffer&&d.blob&&v(e))this._bodyArrayBuffer=u(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!d.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!g(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=u(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):d.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},d.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=a(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},d.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function l(e,t){var n=(t=t||{}).body;if(e instanceof l){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=function(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function p(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function f(e){var t=new o;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}function h(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new o(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var d={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(d.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=function(e){return e&&DataView.prototype.isPrototypeOf(e)},g=ArrayBuffer.isView||function(e){return e&&m.indexOf(Object.prototype.toString.call(e))>-1};o.prototype.append=function(e,r){e=t(e),r=n(r);var o=this.map[e];this.map[e]=o?o+","+r:r},o.prototype.delete=function(e){delete this.map[t(e)]},o.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},o.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},o.prototype.set=function(e,r){this.map[t(e)]=n(r)},o.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},o.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},o.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},o.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},d.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this,{body:this._bodyInit})},c.call(l.prototype),c.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},h.error=function(){var e=new h(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];h.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new h(null,{status:t,headers:{location:e}})},e.Headers=o,e.Request=l,e.Response=h,e.fetch=function(e,t){return new Promise(function(n,r){var o=new l(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:f(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;n(new h(t,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&d.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t){e.exports=FormData},function(e,t,n){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},function(e,t,n){"use strict";var r=n(358);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){n(160),n(97),n(99),n(959),n(961),n(964),n(965),e.exports=n(22).Map},function(e,t,n){"use strict";var r=n(960),o=n(141);e.exports=n(453)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(o(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(o(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(47).f,o=n(156),i=n(179),a=n(60),s=n(178),u=n(108),c=n(211),l=n(348),p=n(407),f=n(46),h=n(132).fastKey,d=n(141),m=f?"_s":"size",v=function(e,t){var n,r=h(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,c){var l=e(function(e,r){s(e,l,t,"_i"),e._t=t,e._i=o(null),e._f=void 0,e._l=void 0,e[m]=0,null!=r&&u(r,n,e[c],e)});return i(l.prototype,{clear:function(){for(var e=d(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var n=d(this,t),r=v(n,e);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[m]--}return!!r},forEach:function(e){d(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!v(d(this,t),e)}}),f&&r(l.prototype,"size",{get:function(){return d(this,t)[m]}}),l},def:function(e,t,n){var r,o,i=v(e,t);return i?i.v=n:(e._l=i={i:o=h(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[m]++,"F"!==o&&(e._i[o]=i)),e},getEntry:v,setStrong:function(e,t,n){c(e,t,function(e,n){this._t=d(e,t),this._k=n,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?l(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,l(1))},n?"entries":"values",!n,!0),p(t)}}},function(e,t,n){var r=n(30);r(r.P+r.R,"Map",{toJSON:n(962)("Map")})},function(e,t,n){var r=n(162),o=n(963);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return o(this)}}},function(e,t,n){var r=n(108);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t,n){n(454)("Map")},function(e,t,n){n(455)("Map")},function(e,t,n){"use strict";
/*!
* repeat-string <https://github.com/jonschlinkert/repeat-string>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/var r,o="";e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var n=e.length*t;if(r!==e||void 0===r)r=e,o="";else if(o.length>=n)return o.substr(0,n);for(;n>o.length&&t>1;)1&t&&(o+=e),t>>=1,e+=e;return o=(o+=e).substr(0,n)}},function(e,t,n){"use strict";var r=n(37).assign,o=n(968),i=n(970),a=n(981),s=n(996),u=n(187),c={default:n(1015),full:n(1016),commonmark:n(1017)};function l(e,t,n){this.src=t,this.env=n,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function p(e,t){"string"!=typeof e&&(t=e,e="default"),this.inline=new s,this.block=new a,this.core=new i,this.renderer=new o,this.ruler=new u,this.options={},this.configure(c[e]),this.set(t||{})}p.prototype.set=function(e){r(this.options,e)},p.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enable(e.components[n].rules,!0)})},p.prototype.use=function(e,t){return e(this,t),this},p.prototype.parse=function(e,t){var n=new l(this,e,t);return this.core.process(n),n.tokens},p.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},p.prototype.parseInline=function(e,t){var n=new l(this,e,t);return n.inlineMode=!0,this.core.process(n),n.tokens},p.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=p,e.exports.utils=n(37)},function(e,t,n){"use strict";var r=n(37),o=n(969);function i(){this.rules=r.assign({},o),this.getBreak=o.getBreak}e.exports=i,i.prototype.renderInline=function(e,t,n){for(var r=this.rules,o=e.length,i=0,a="";o--;)a+=r[e[i].type](e,i++,t,n,this);return a},i.prototype.render=function(e,t,n){for(var r=this.rules,o=e.length,i=-1,a="";++i<o;)"inline"===e[i].type?a+=this.renderInline(e[i].children,t,n):a+=r[e[i].type](e,i,t,n,this);return a}},function(e,t,n){"use strict";var r=n(37).has,o=n(37).unescapeMd,i=n(37).replaceEntities,a=n(37).escapeHtml,s={};s.blockquote_open=function(){return"<blockquote>\n"},s.blockquote_close=function(e,t){return"</blockquote>"+u(e,t)},s.code=function(e,t){return e[t].block?"<pre><code>"+a(e[t].content)+"</code></pre>"+u(e,t):"<code>"+a(e[t].content)+"</code>"},s.fence=function(e,t,n,s,c){var l,p,f=e[t],h="",d=n.langPrefix;if(f.params){if(p=(l=f.params.split(/\s+/g)).join(" "),r(c.rules.fence_custom,l[0]))return c.rules.fence_custom[l[0]](e,t,n,s,c);h=' class="'+d+a(i(o(p)))+'"'}return"<pre><code"+h+">"+(n.highlight&&n.highlight.apply(n.highlight,[f.content].concat(l))||a(f.content))+"</code></pre>"+u(e,t)},s.fence_custom={},s.heading_open=function(e,t){return"<h"+e[t].hLevel+">"},s.heading_close=function(e,t){return"</h"+e[t].hLevel+">\n"},s.hr=function(e,t,n){return(n.xhtmlOut?"<hr />":"<hr>")+u(e,t)},s.bullet_list_open=function(){return"<ul>\n"},s.bullet_list_close=function(e,t){return"</ul>"+u(e,t)},s.list_item_open=function(){return"<li>"},s.list_item_close=function(){return"</li>\n"},s.ordered_list_open=function(e,t){var n=e[t];return"<ol"+(n.order>1?' start="'+n.order+'"':"")+">\n"},s.ordered_list_close=function(e,t){return"</ol>"+u(e,t)},s.paragraph_open=function(e,t){return e[t].tight?"":"<p>"},s.paragraph_close=function(e,t){var n=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"</p>")+(n?u(e,t):"")},s.link_open=function(e,t,n){var r=e[t].title?' title="'+a(i(e[t].title))+'"':"",o=n.linkTarget?' target="'+n.linkTarget+'"':"";return'<a href="'+a(e[t].href)+'"'+r+o+">"},s.link_close=function(){return"</a>"},s.image=function(e,t,n){var r=' src="'+a(e[t].src)+'"',s=e[t].title?' title="'+a(i(e[t].title))+'"':"";return"<img"+r+(' alt="'+(e[t].alt?a(i(o(e[t].alt))):"")+'"')+s+(n.xhtmlOut?" /":"")+">"},s.table_open=function(){return"<table>\n"},s.table_close=function(){return"</table>\n"},s.thead_open=function(){return"<thead>\n"},s.thead_close=function(){return"</thead>\n"},s.tbody_open=function(){return"<tbody>\n"},s.tbody_close=function(){return"</tbody>\n"},s.tr_open=function(){return"<tr>"},s.tr_close=function(){return"</tr>\n"},s.th_open=function(e,t){var n=e[t];return"<th"+(n.align?' style="text-align:'+n.align+'"':"")+">"},s.th_close=function(){return"</th>"},s.td_open=function(e,t){var n=e[t];return"<td"+(n.align?' style="text-align:'+n.align+'"':"")+">"},s.td_close=function(){return"</td>"},s.strong_open=function(){return"<strong>"},s.strong_close=function(){return"</strong>"},s.em_open=function(){return"<em>"},s.em_close=function(){return"</em>"},s.del_open=function(){return"<del>"},s.del_close=function(){return"</del>"},s.ins_open=function(){return"<ins>"},s.ins_close=function(){return"</ins>"},s.mark_open=function(){return"<mark>"},s.mark_close=function(){return"</mark>"},s.sub=function(e,t){return"<sub>"+a(e[t].content)+"</sub>"},s.sup=function(e,t){return"<sup>"+a(e[t].content)+"</sup>"},s.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},s.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},s.text=function(e,t){return a(e[t].content)},s.htmlblock=function(e,t){return e[t].content},s.htmltag=function(e,t){return e[t].content},s.abbr_open=function(e,t){return'<abbr title="'+a(i(e[t].title))+'">'},s.abbr_close=function(){return"</abbr>"},s.footnote_ref=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),'<sup class="footnote-ref"><a href="#fn'+n+'" id="'+r+'">['+n+"]</a></sup>"},s.footnote_block_open=function(e,t,n){return(n.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},s.footnote_block_close=function(){return"</ol>\n</section>\n"},s.footnote_open=function(e,t){return'<li id="fn'+Number(e[t].id+1).toString()+'" class="footnote-item">'},s.footnote_close=function(){return"</li>\n"},s.footnote_anchor=function(e,t){var n="fnref"+Number(e[t].id+1).toString();return e[t].subId>0&&(n+=":"+e[t].subId),' <a href="#'+n+'" class="footnote-backref">↩</a>'},s.dl_open=function(){return"<dl>\n"},s.dt_open=function(){return"<dt>"},s.dd_open=function(){return"<dd>"},s.dl_close=function(){return"</dl>\n"},s.dt_close=function(){return"</dt>\n"},s.dd_close=function(){return"</dd>\n"};var u=s.getBreak=function(e,t){return(t=function e(t,n){return++n>=t.length-2?n:"paragraph_open"===t[n].type&&t[n].tight&&"inline"===t[n+1].type&&0===t[n+1].content.length&&"paragraph_close"===t[n+2].type&&t[n+2].tight?e(t,n+2):n}(e,t))<e.length&&"list_item_close"===e[t].type?"":"\n"};e.exports=s},function(e,t,n){"use strict";var r=n(187),o=[["block",n(971)],["abbr",n(972)],["references",n(973)],["inline",n(974)],["footnote_tail",n(975)],["abbr2",n(976)],["replacements",n(977)],["smartquotes",n(978)],["linkify",n(979)]];function i(){this.options={},this.ruler=new r;for(var e=0;e<o.length;e++)this.ruler.push(o[e][0],o[e][1])}i.prototype.process=function(e){var t,n,r;for(t=0,n=(r=this.ruler.getRules("")).length;t<n;t++)r[t](e)},e.exports=i},function(e,t,n){"use strict";e.exports=function(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):e.block.parse(e.src,e.options,e.env,e.tokens)}},function(e,t,n){"use strict";var r=n(261),o=n(188);function i(e,t,n,i){var a,s,u,c,l,p;if(42!==e.charCodeAt(0))return-1;if(91!==e.charCodeAt(1))return-1;if(-1===e.indexOf("]:"))return-1;if(a=new r(e,t,n,i,[]),(s=o(a,1))<0||58!==e.charCodeAt(s+1))return-1;for(c=a.posMax,u=s+2;u<c&&10!==a.src.charCodeAt(u);u++);return l=e.slice(2,s),0===(p=e.slice(s+2,u).trim()).length?-1:(i.abbreviations||(i.abbreviations={}),void 0===i.abbreviations[":"+l]&&(i.abbreviations[":"+l]=p),u)}e.exports=function(e){var t,n,r,o,a=e.tokens;if(!e.inlineMode)for(t=1,n=a.length-1;t<n;t++)if("paragraph_open"===a[t-1].type&&"inline"===a[t].type&&"paragraph_close"===a[t+1].type){for(r=a[t].content;r.length&&!((o=i(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();a[t].content=r,r.length||(a[t-1].tight=!0,a[t+1].tight=!0)}}},function(e,t,n){"use strict";var r=n(261),o=n(188),i=n(458),a=n(460),s=n(461);function u(e,t,n,u){var c,l,p,f,h,d,m,v,g;if(91!==e.charCodeAt(0))return-1;if(-1===e.indexOf("]:"))return-1;if(c=new r(e,t,n,u,[]),(l=o(c,0))<0||58!==e.charCodeAt(l+1))return-1;for(f=c.posMax,p=l+2;p<f&&(32===(h=c.src.charCodeAt(p))||10===h);p++);if(!i(c,p))return-1;for(m=c.linkContent,d=p=c.pos,p+=1;p<f&&(32===(h=c.src.charCodeAt(p))||10===h);p++);for(p<f&&d!==p&&a(c,p)?(v=c.linkContent,p=c.pos):(v="",p=d);p<f&&32===c.src.charCodeAt(p);)p++;return p<f&&10!==c.src.charCodeAt(p)?-1:(g=s(e.slice(1,l)),void 0===u.references[g]&&(u.references[g]={title:v,href:m}),p)}e.exports=function(e){var t,n,r,o,i=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,n=i.length-1;t<n;t++)if("inline"===i[t].type&&"paragraph_open"===i[t-1].type&&"paragraph_close"===i[t+1].type){for(r=i[t].content;r.length&&!((o=u(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();i[t].content=r,r.length||(i[t-1].tight=!0,i[t+1].tight=!0)}}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,o=e.tokens;for(n=0,r=o.length;n<r;n++)"inline"===(t=o[n]).type&&e.inline.parse(t.content,e.options,e.env,t.children)}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,o,i,a,s,u,c,l=0,p=!1,f={};if(e.env.footnotes&&(e.tokens=e.tokens.filter(function(e){return"footnote_reference_open"===e.type?(p=!0,u=[],c=e.label,!1):"footnote_reference_close"===e.type?(p=!1,f[":"+c]=u,!1):(p&&u.push(e),!p)}),e.env.footnotes.list)){for(a=e.env.footnotes.list,e.tokens.push({type:"footnote_block_open",level:l++}),t=0,n=a.length;t<n;t++){for(e.tokens.push({type:"footnote_open",id:t,level:l++}),a[t].tokens?((s=[]).push({type:"paragraph_open",tight:!1,level:l++}),s.push({type:"inline",content:"",level:l,children:a[t].tokens}),s.push({type:"paragraph_close",tight:!1,level:--l})):a[t].label&&(s=f[":"+a[t].label]),e.tokens=e.tokens.concat(s),i="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,o=a[t].count>0?a[t].count:1,r=0;r<o;r++)e.tokens.push({type:"footnote_anchor",id:t,subId:r,level:l});i&&e.tokens.push(i),e.tokens.push({type:"footnote_close",level:--l})}e.tokens.push({type:"footnote_block_close",level:--l})}}},function(e,t,n){"use strict";function r(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}e.exports=function(e){var t,n,o,i,a,s,u,c,l,p,f,h,d=e.tokens;if(e.env.abbreviations)for(e.env.abbrRegExp||(h="(^|["+" \n()[]'\".,!?-".split("").map(r).join("")+"])("+Object.keys(e.env.abbreviations).map(function(e){return e.substr(1)}).sort(function(e,t){return t.length-e.length}).map(r).join("|")+")($|["+" \n()[]'\".,!?-".split("").map(r).join("")+"])",e.env.abbrRegExp=new RegExp(h,"g")),p=e.env.abbrRegExp,n=0,o=d.length;n<o;n++)if("inline"===d[n].type)for(t=(i=d[n].children).length-1;t>=0;t--)if("text"===(a=i[t]).type){for(c=0,s=a.content,p.lastIndex=0,l=a.level,u=[];f=p.exec(s);)p.lastIndex>c&&u.push({type:"text",content:s.slice(c,f.index+f[1].length),level:l}),u.push({type:"abbr_open",title:e.env.abbreviations[":"+f[2]],level:l++}),u.push({type:"text",content:f[2],level:l}),u.push({type:"abbr_close",level:--l}),c=p.lastIndex-f[3].length;u.length&&(c<s.length&&u.push({type:"text",content:s.slice(c),level:l}),d[n].children=i=[].concat(i.slice(0,t),u,i.slice(t+1)))}}},function(e,t,n){"use strict";var r=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,o=/\((c|tm|r|p)\)/gi,i={c:"©",r:"®",p:"§",tm:"™"};e.exports=function(e){var t,n,a,s,u,c;if(e.options.typographer)for(u=e.tokens.length-1;u>=0;u--)if("inline"===e.tokens[u].type)for(t=(s=e.tokens[u].children).length-1;t>=0;t--)"text"===(n=s[t]).type&&(a=n.content,a=(c=a).indexOf("(")<0?c:c.replace(o,function(e,t){return i[t.toLowerCase()]}),r.test(a)&&(a=a.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),n.content=a)}},function(e,t,n){"use strict";var r=/['"]/,o=/['"]/g,i=/[-\s()\[\]]/;function a(e,t){return!(t<0||t>=e.length)&&!i.test(e[t])}function s(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}e.exports=function(e){var t,n,i,u,c,l,p,f,h,d,m,v,g,y,b,_,w;if(e.options.typographer)for(w=[],b=e.tokens.length-1;b>=0;b--)if("inline"===e.tokens[b].type)for(_=e.tokens[b].children,w.length=0,t=0;t<_.length;t++)if("text"===(n=_[t]).type&&!r.test(n.text)){for(p=_[t].level,g=w.length-1;g>=0&&!(w[g].level<=p);g--);w.length=g+1,c=0,l=(i=n.content).length;e:for(;c<l&&(o.lastIndex=c,u=o.exec(i));)if(f=!a(i,u.index-1),c=u.index+1,y="'"===u[0],(h=!a(i,c))||f){if(m=!h,v=!f)for(g=w.length-1;g>=0&&(d=w[g],!(w[g].level<p));g--)if(d.single===y&&w[g].level===p){d=w[g],y?(_[d.token].content=s(_[d.token].content,d.pos,e.options.quotes[2]),n.content=s(n.content,u.index,e.options.quotes[3])):(_[d.token].content=s(_[d.token].content,d.pos,e.options.quotes[0]),n.content=s(n.content,u.index,e.options.quotes[1])),w.length=g;continue e}m?w.push({token:t,pos:u.index,single:y,level:p}):v&&y&&(n.content=s(n.content,u.index,"’"))}else y&&(n.content=s(n.content,u.index,"’"))}}},function(e,t,n){"use strict";var r=n(980),o=/www|@|\:\/\//;function i(e){return/^<\/a\s*>/i.test(e)}function a(){var e=[],t=new r({stripPrefix:!1,url:!0,email:!0,twitter:!1,replaceFn:function(t,n){switch(n.getType()){case"url":e.push({text:n.matchedText,url:n.getUrl()});break;case"email":e.push({text:n.matchedText,url:"mailto:"+n.getEmail().replace(/^mailto:/i,"")})}return!1}});return{links:e,autolinker:t}}e.exports=function(e){var t,n,r,s,u,c,l,p,f,h,d,m,v,g,y=e.tokens,b=null;if(e.options.linkify)for(n=0,r=y.length;n<r;n++)if("inline"===y[n].type)for(d=0,t=(s=y[n].children).length-1;t>=0;t--)if("link_close"!==(u=s[t]).type){if("htmltag"===u.type&&(g=u.content,/^<a[>\s]/i.test(g)&&d>0&&d--,i(u.content)&&d++),!(d>0)&&"text"===u.type&&o.test(u.content)){if(b||(m=(b=a()).links,v=b.autolinker),c=u.content,m.length=0,v.link(c),!m.length)continue;for(l=[],h=u.level,p=0;p<m.length;p++)e.inline.validateLink(m[p].url)&&((f=c.indexOf(m[p].text))&&(h=h,l.push({type:"text",content:c.slice(0,f),level:h})),l.push({type:"link_open",href:m[p].url,title:"",level:h++}),l.push({type:"text",content:m[p].text,level:h}),l.push({type:"link_close",level:--h}),c=c.slice(f+m[p].text.length));c.length&&l.push({type:"text",content:c,level:h}),y[n].children=s=[].concat(s.slice(0,t),l,s.slice(t+1))}}else for(t--;s[t].level!==u.level&&"link_open"!==s[t].type;)t--}},function(e,t,n){var r,o,i;
/*!
* Autolinker.js
* 0.28.1
*
* Copyright(c) 2016 Gregory Jacobs <[email protected]>
* MIT License
*
* https://github.com/gregjacobs/Autolinker.js
*/o=[],void 0===(i="function"==typeof(r=function(){var e,t,n,r,o,i,a,s=function(e){e=e||{},this.version=s.version,this.urls=this.normalizeUrlsCfg(e.urls),this.email="boolean"!=typeof e.email||e.email,this.twitter="boolean"!=typeof e.twitter||e.twitter,this.phone="boolean"!=typeof e.phone||e.phone,this.hashtag=e.hashtag||!1,this.newWindow="boolean"!=typeof e.newWindow||e.newWindow,this.stripPrefix="boolean"!=typeof e.stripPrefix||e.stripPrefix;var t=this.hashtag;if(!1!==t&&"twitter"!==t&&"facebook"!==t&&"instagram"!==t)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(e.truncate),this.className=e.className||"",this.replaceFn=e.replaceFn||null,this.htmlParser=null,this.matchers=null,this.tagBuilder=null};return s.link=function(e,t){return new s(t).link(e)},s.version="0.28.1",s.prototype={constructor:s,normalizeUrlsCfg:function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},normalizeTruncateCfg:function(e){return"number"==typeof e?{length:e,location:"end"}:s.Util.defaults(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},parse:function(e){for(var t=this.getHtmlParser().parse(e),n=0,r=[],o=0,i=t.length;o<i;o++){var a=t[o],s=a.getType();if("element"===s&&"a"===a.getTagName())a.isClosing()?n=Math.max(n-1,0):n++;else if("text"===s&&0===n){var u=this.parseText(a.getText(),a.getOffset());r.push.apply(r,u)}}return r=this.compactMatches(r),r=this.removeUnwantedMatches(r)},compactMatches:function(e){e.sort(function(e,t){return e.getOffset()-t.getOffset()});for(var t=0;t<e.length-1;t++)for(var n=e[t],r=n.getOffset()+n.getMatchedText().length;t+1<e.length&&e[t+1].getOffset()<=r;)e.splice(t+1,1);return e},removeUnwantedMatches:function(e){var t=s.Util.remove;return this.hashtag||t(e,function(e){return"hashtag"===e.getType()}),this.email||t(e,function(e){return"email"===e.getType()}),this.phone||t(e,function(e){return"phone"===e.getType()}),this.twitter||t(e,function(e){return"twitter"===e.getType()}),this.urls.schemeMatches||t(e,function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()}),this.urls.wwwMatches||t(e,function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()}),this.urls.tldMatches||t(e,function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()}),e},parseText:function(e,t){t=t||0;for(var n=this.getMatchers(),r=[],o=0,i=n.length;o<i;o++){for(var a=n[o].parseMatches(e),s=0,u=a.length;s<u;s++)a[s].setOffset(t+a[s].getOffset());r.push.apply(r,a)}return r},link:function(e){if(!e)return"";for(var t=this.parse(e),n=[],r=0,o=0,i=t.length;o<i;o++){var a=t[o];n.push(e.substring(r,a.getOffset())),n.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return n.push(e.substring(r)),n.join("")},createMatchReturnVal:function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this,this,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof s.HtmlTag?t.toAnchorString():e.buildTag().toAnchorString()},getHtmlParser:function(){var e=this.htmlParser;return e||(e=this.htmlParser=new s.htmlParser.HtmlParser),e},getMatchers:function(){if(this.matchers)return this.matchers;var e=s.matcher,t=this.getTagBuilder(),n=[new e.Hashtag({tagBuilder:t,serviceName:this.hashtag}),new e.Email({tagBuilder:t}),new e.Phone({tagBuilder:t}),new e.Twitter({tagBuilder:t}),new e.Url({tagBuilder:t,stripPrefix:this.stripPrefix})];return this.matchers=n},getTagBuilder:function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new s.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e}},s.match={},s.matcher={},s.htmlParser={},s.truncate={},s.Util={abstractMethod:function(){throw"abstract"},trimRegex:/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,assign:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},defaults:function(e,t){for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=t[n]);return e},extend:function(e,t){var n,r=e.prototype,o=function(){};o.prototype=r;var i=(n=t.hasOwnProperty("constructor")?t.constructor:function(){r.constructor.apply(this,arguments)}).prototype=new o;return i.constructor=n,i.superclass=r,delete t.constructor,s.Util.assign(i,t),n},ellipsis:function(e,t,n){return e.length>t&&(n=null==n?"..":n,e=e.substring(0,t-n.length)+n),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},remove:function(e,t){for(var n=e.length-1;n>=0;n--)!0===t(e[n])&&e.splice(n,1)},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],o=0;n=t.exec(e);)r.push(e.substring(o,n.index)),r.push(n[0]),o=n.index+n[0].length;return r.push(e.substring(o)),r},trim:function(e){return e.replace(this.trimRegex,"")}},s.HtmlTag=s.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(e){s.Util.assign(this,e),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){return this.getAttrs()[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(e){var t=this.getAttrs();return s.Util.assign(t,e),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,o=s.Util.indexOf,i=n?n.split(r):[],a=e.split(r);t=a.shift();)-1===o(i,t)&&i.push(t);return this.getAttrs().class=i.join(" "),this},removeClass:function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,o=s.Util.indexOf,i=n?n.split(r):[],a=e.split(r);i.length&&(t=a.shift());){var u=o(i,t);-1!==u&&i.splice(u,1)}return this.getAttrs().class=i.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toAnchorString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")}}),s.RegexLib={alphaNumericCharsStr:a="A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞭꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯෦-෯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꧰-꧹꩐-꩙꯰-꯹0-9",domainNameRegex:new RegExp("["+a+".\\-]*["+a+"\\-]"),tldRegex:/(?:travelersinsurance|sandvikcoromant|kerryproperties|cancerresearch|weatherchannel|kerrylogistics|spreadbetting|international|wolterskluwer|lifeinsurance|construction|pamperedchef|scholarships|versicherung|bridgestone|creditunion|kerryhotels|investments|productions|blackfriday|enterprises|lamborghini|photography|motorcycles|williamhill|playstation|contractors|barclaycard|accountants|redumbrella|engineering|management|telefonica|protection|consulting|tatamotors|creditcard|vlaanderen|schaeffler|associates|properties|foundation|republican|bnpparibas|boehringer|eurovision|extraspace|industries|immobilien|university|technology|volkswagen|healthcare|restaurant|cuisinella|vistaprint|apartments|accountant|travelers|homedepot|institute|vacations|furniture|fresenius|insurance|christmas|bloomberg|solutions|barcelona|firestone|financial|kuokgroup|fairwinds|community|passagens|goldpoint|equipment|lifestyle|yodobashi|aquarelle|marketing|analytics|education|amsterdam|statefarm|melbourne|allfinanz|directory|microsoft|stockholm|montblanc|accenture|lancaster|landrover|everbank|istanbul|graphics|grainger|ipiranga|softbank|attorney|pharmacy|saarland|catering|airforce|yokohama|mortgage|frontier|mutuelle|stcgroup|memorial|pictures|football|symantec|cipriani|ventures|telecity|cityeats|verisign|flsmidth|boutique|cleaning|firmdale|clinique|clothing|redstone|infiniti|deloitte|feedback|services|broadway|plumbing|commbank|training|barclays|exchange|computer|brussels|software|delivery|barefoot|builders|business|bargains|engineer|holdings|download|security|helsinki|lighting|movistar|discount|hdfcbank|supplies|marriott|property|diamonds|capetown|partners|democrat|jpmorgan|bradesco|budapest|rexroth|zuerich|shriram|academy|science|support|youtube|singles|surgery|alibaba|statoil|dentist|schwarz|android|cruises|cricket|digital|markets|starhub|systems|courses|coupons|netbank|country|domains|corsica|network|neustar|realtor|lincoln|limited|schmidt|yamaxun|cooking|contact|auction|spiegel|liaison|leclerc|latrobe|lasalle|abogado|compare|lanxess|exposed|express|company|cologne|college|avianca|lacaixa|fashion|recipes|ferrero|komatsu|storage|wanggou|clubmed|sandvik|fishing|fitness|bauhaus|kitchen|flights|florist|flowers|watches|weather|temasek|samsung|bentley|forsale|channel|theater|frogans|theatre|okinawa|website|tickets|jewelry|gallery|tiffany|iselect|shiksha|brother|organic|wedding|genting|toshiba|origins|philips|hyundai|hotmail|hoteles|hosting|rentals|windows|cartier|bugatti|holiday|careers|whoswho|hitachi|panerai|caravan|reviews|guitars|capital|trading|hamburg|hangout|finance|stream|family|abbott|health|review|travel|report|hermes|hiphop|gratis|career|toyota|hockey|dating|repair|google|social|soccer|reisen|global|otsuka|giving|unicom|casino|photos|center|broker|rocher|orange|bostik|garden|insure|ryukyu|bharti|safety|physio|sakura|oracle|online|jaguar|gallup|piaget|tienda|futbol|pictet|joburg|webcam|berlin|office|juegos|kaufen|chanel|chrome|xihuan|church|tennis|circle|kinder|flickr|bayern|claims|clinic|viajes|nowruz|xperia|norton|yachts|studio|coffee|camera|sanofi|nissan|author|expert|events|comsec|lawyer|tattoo|viking|estate|villas|condos|realty|yandex|energy|emerck|virgin|vision|durban|living|school|coupon|london|taobao|natura|taipei|nagoya|luxury|walter|aramco|sydney|madrid|credit|maison|makeup|schule|market|anquan|direct|design|swatch|suzuki|alsace|vuelos|dental|alipay|voyage|shouji|voting|airtel|mutual|degree|supply|agency|museum|mobily|dealer|monash|select|mormon|active|moscow|racing|datsun|quebec|nissay|rodeo|email|gifts|works|photo|chloe|edeka|cheap|earth|vista|tushu|koeln|glass|shoes|globo|tunes|gmail|nokia|space|kyoto|black|ricoh|seven|lamer|sener|epson|cisco|praxi|trust|citic|crown|shell|lease|green|legal|lexus|ninja|tatar|gripe|nikon|group|video|wales|autos|gucci|party|nexus|guide|linde|adult|parts|amica|lixil|boats|azure|loans|locus|cymru|lotte|lotto|stada|click|poker|quest|dabur|lupin|nadex|paris|faith|dance|canon|place|gives|trade|skype|rocks|mango|cloud|boots|smile|final|swiss|homes|honda|media|horse|cards|deals|watch|bosch|house|pizza|miami|osaka|tours|total|xerox|coach|sucks|style|delta|toray|iinet|tools|money|codes|beats|tokyo|salon|archi|movie|baidu|study|actor|yahoo|store|apple|world|forex|today|bible|tmall|tirol|irish|tires|forum|reise|vegas|vodka|sharp|omega|weber|jetzt|audio|promo|build|bingo|chase|gallo|drive|dubai|rehab|press|solar|sale|beer|bbva|bank|band|auto|sapo|sarl|saxo|audi|asia|arte|arpa|army|yoga|ally|zara|scor|scot|sexy|seat|zero|seek|aero|adac|zone|aarp|maif|meet|meme|menu|surf|mini|mobi|mtpc|porn|desi|star|ltda|name|talk|navy|love|loan|live|link|news|limo|like|spot|life|nico|lidl|lgbt|land|taxi|team|tech|kred|kpmg|sony|song|kiwi|kddi|jprs|jobs|sohu|java|itau|tips|info|immo|icbc|hsbc|town|host|page|toys|here|help|pars|haus|guru|guge|tube|goog|golf|gold|sncf|gmbh|gift|ggee|gent|gbiz|game|vana|pics|fund|ford|ping|pink|fish|film|fast|farm|play|fans|fail|plus|skin|pohl|fage|moda|post|erni|dvag|prod|doha|prof|docs|viva|diet|luxe|site|dell|sina|dclk|show|qpon|date|vote|cyou|voto|read|coop|cool|wang|club|city|chat|cern|cash|reit|rent|casa|cars|care|camp|rest|call|cafe|weir|wien|rich|wiki|buzz|wine|book|bond|room|work|rsvp|shia|ruhr|blue|bing|shaw|bike|safe|xbox|best|pwc|mtn|lds|aig|boo|fyi|nra|nrw|ntt|car|gal|obi|zip|aeg|vin|how|one|ong|onl|dad|ooo|bet|esq|org|htc|bar|uol|ibm|ovh|gdn|ice|icu|uno|gea|ifm|bot|top|wtf|lol|day|pet|eus|wtc|ubs|tvs|aco|ing|ltd|ink|tab|abb|afl|cat|int|pid|pin|bid|cba|gle|com|cbn|ads|man|wed|ceb|gmo|sky|ist|gmx|tui|mba|fan|ski|iwc|app|pro|med|ceo|jcb|jcp|goo|dev|men|aaa|meo|pub|jlc|bom|jll|gop|jmp|mil|got|gov|win|jot|mma|joy|trv|red|cfa|cfd|bio|moe|moi|mom|ren|biz|aws|xin|bbc|dnp|buy|kfh|mov|thd|xyz|fit|kia|rio|rip|kim|dog|vet|nyc|bcg|mtr|bcn|bms|bmw|run|bzh|rwe|tel|stc|axa|kpn|fly|krd|cab|bnl|foo|crs|eat|tci|sap|srl|nec|sas|net|cal|sbs|sfr|sca|scb|csc|edu|new|xxx|hiv|fox|wme|ngo|nhk|vip|sex|frl|lat|yun|law|you|tax|soy|sew|om|ac|hu|se|sc|sg|sh|sb|sa|rw|ru|rs|ro|re|qa|py|si|pw|pt|ps|sj|sk|pr|pn|pm|pl|sl|sm|pk|sn|ph|so|pg|pf|pe|pa|zw|nz|nu|nr|np|no|nl|ni|ng|nf|sr|ne|st|nc|na|mz|my|mx|mw|mv|mu|mt|ms|mr|mq|mp|mo|su|mn|mm|ml|mk|mh|mg|me|sv|md|mc|sx|sy|ma|ly|lv|sz|lu|lt|ls|lr|lk|li|lc|lb|la|tc|kz|td|ky|kw|kr|kp|kn|km|ki|kh|tf|tg|th|kg|ke|jp|jo|jm|je|it|is|ir|tj|tk|tl|tm|iq|tn|to|io|in|im|il|ie|ad|sd|ht|hr|hn|hm|tr|hk|gy|gw|gu|gt|gs|gr|gq|tt|gp|gn|gm|gl|tv|gi|tw|tz|ua|gh|ug|uk|gg|gf|ge|gd|us|uy|uz|va|gb|ga|vc|ve|fr|fo|fm|fk|fj|vg|vi|fi|eu|et|es|er|eg|ee|ec|dz|do|dm|dk|vn|dj|de|cz|cy|cx|cw|vu|cv|cu|cr|co|cn|cm|cl|ck|ci|ch|cg|cf|cd|cc|ca|wf|bz|by|bw|bv|bt|bs|br|bo|bn|bm|bj|bi|ws|bh|bg|bf|be|bd|bb|ba|az|ax|aw|au|at|as|ye|ar|aq|ao|am|al|yt|ai|za|ag|af|ae|zm|id)\b/},s.AnchorTagBuilder=s.Util.extend(Object,{constructor:function(e){s.Util.assign(this,e)},build:function(e){return new s.HtmlTag({tagName:"a",attrs:this.createAttrs(e.getType(),e.getAnchorHref()),innerHtml:this.processAnchorText(e.getAnchorText())})},createAttrs:function(e,t){var n={href:t},r=this.createCssClass(e);return r&&(n.class=r),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),n},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(e){var t=this.truncate;if(!t||!t.length)return e;var n=t.length,r=t.location;return"smart"===r?s.truncate.TruncateSmart(e,n,".."):"middle"===r?s.truncate.TruncateMiddle(e,n,".."):s.truncate.TruncateEnd(e,n,"..")}}),s.htmlParser.HtmlParser=s.Util.extend(Object,{htmlRegex:(o=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,i=/[^\s"'>\/=\x00-\x1F\x7F]+/.source+"(?:\\s*=\\s*"+o.source+")?",new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",i,"|",o.source+")",")*",">",")","|","(?:","<(/)?","(?:",/!--([\s\S]+?)--/.source,"|","(?:","("+/[0-9a-zA-Z][0-9a-zA-Z:]*/.source+")","(?:","(?:\\s+|\\b)",i,")*","\\s*/?",")",")",">",")"].join(""),"gi")),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,n,r=this.htmlRegex,o=0,i=[];null!==(t=r.exec(e));){var a=t[0],s=t[3],u=t[1]||t[4],c=!!t[2],l=t.index,p=e.substring(o,l);p&&(n=this.parseTextAndEntityNodes(o,p),i.push.apply(i,n)),s?i.push(this.createCommentNode(l,a,s)):i.push(this.createElementNode(l,a,u,c)),o=l+a.length}if(o<e.length){var f=e.substring(o);f&&(n=this.parseTextAndEntityNodes(o,f),i.push.apply(i,n))}return i},parseTextAndEntityNodes:function(e,t){for(var n=[],r=s.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex),o=0,i=r.length;o<i;o+=2){var a=r[o],u=r[o+1];a&&(n.push(this.createTextNode(e,a)),e+=a.length),u&&(n.push(this.createEntityNode(e,u)),e+=u.length)}return n},createCommentNode:function(e,t,n){return new s.htmlParser.CommentNode({offset:e,text:t,comment:s.Util.trim(n)})},createElementNode:function(e,t,n,r){return new s.htmlParser.ElementNode({offset:e,text:t,tagName:n.toLowerCase(),closing:r})},createEntityNode:function(e,t){return new s.htmlParser.EntityNode({offset:e,text:t})},createTextNode:function(e,t){return new s.htmlParser.TextNode({offset:e,text:t})}}),s.htmlParser.HtmlNode=s.Util.extend(Object,{offset:void 0,text:void 0,constructor:function(e){if(s.Util.assign(this,e),null==this.offset)throw new Error("`offset` cfg required");if(null==this.text)throw new Error("`text` cfg required")},getType:s.Util.abstractMethod,getOffset:function(){return this.offset},getText:function(){return this.text}}),s.htmlParser.CommentNode=s.Util.extend(s.htmlParser.HtmlNode,{comment:"",getType:function(){return"comment"},getComment:function(){return this.comment}}),s.htmlParser.ElementNode=s.Util.extend(s.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),s.htmlParser.EntityNode=s.Util.extend(s.htmlParser.HtmlNode,{getType:function(){return"entity"}}),s.htmlParser.TextNode=s.Util.extend(s.htmlParser.HtmlNode,{getType:function(){return"text"}}),s.match.Match=s.Util.extend(Object,{constructor:function(e){if(null==e.tagBuilder)throw new Error("`tagBuilder` cfg required");if(null==e.matchedText)throw new Error("`matchedText` cfg required");if(null==e.offset)throw new Error("`offset` cfg required");this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset},getType:s.Util.abstractMethod,getMatchedText:function(){return this.matchedText},setOffset:function(e){this.offset=e},getOffset:function(){return this.offset},getAnchorHref:s.Util.abstractMethod,getAnchorText:s.Util.abstractMethod,buildTag:function(){return this.tagBuilder.build(this)}}),s.match.Email=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),!e.email)throw new Error("`email` cfg required");this.email=e.email},getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),s.match.Hashtag=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),!e.hashtag)throw new Error("`hashtag` cfg required");this.serviceName=e.serviceName,this.hashtag=e.hashtag},getType:function(){return"hashtag"},getServiceName:function(){return this.serviceName},getHashtag:function(){return this.hashtag},getAnchorHref:function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;default:throw new Error("Unknown service name to point hashtag to: ",e)}},getAnchorText:function(){return"#"+this.hashtag}}),s.match.Phone=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),!e.number)throw new Error("`number` cfg required");if(null==e.plusSign)throw new Error("`plusSign` cfg required");this.number=e.number,this.plusSign=e.plusSign},getType:function(){return"phone"},getNumber:function(){return this.number},getAnchorHref:function(){return"tel:"+(this.plusSign?"+":"")+this.number},getAnchorText:function(){return this.matchedText}}),s.match.Twitter=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),!e.twitterHandle)throw new Error("`twitterHandle` cfg required");this.twitterHandle=e.twitterHandle},getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),s.match.Url=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),"scheme"!==e.urlMatchType&&"www"!==e.urlMatchType&&"tld"!==e.urlMatchType)throw new Error('`urlMatchType` cfg must be one of: "scheme", "www", or "tld"');if(!e.url)throw new Error("`url` cfg required");if(null==e.protocolUrlMatch)throw new Error("`protocolUrlMatch` cfg required");if(null==e.protocolRelativeMatch)throw new Error("`protocolRelativeMatch` cfg required");if(null==e.stripPrefix)throw new Error("`stripPrefix` cfg required");this.urlMatchType=e.urlMatchType,this.url=e.url,this.protocolUrlMatch=e.protocolUrlMatch,this.protocolRelativeMatch=e.protocolRelativeMatch,this.stripPrefix=e.stripPrefix},urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrlMatchType:function(){return this.urlMatchType},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){return this.getUrl().replace(/&/g,"&")},getAnchorText:function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),s.matcher.Matcher=s.Util.extend(Object,{constructor:function(e){if(!e.tagBuilder)throw new Error("`tagBuilder` cfg required");this.tagBuilder=e.tagBuilder},parseMatches:s.Util.abstractMethod}),s.matcher.Email=s.Util.extend(s.matcher.Matcher,{matcherRegex:(e=s.RegexLib.alphaNumericCharsStr,t=new RegExp("["+e+"\\-_';:&=+$.,]+@"),n=s.RegexLib.domainNameRegex,r=s.RegexLib.tldRegex,new RegExp([t.source,n.source,"\\.",r.source].join(""),"gi")),parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,o=[];null!==(t=n.exec(e));){var i=t[0];o.push(new s.match.Email({tagBuilder:r,matchedText:i,offset:t.index,email:i}))}return o}}),s.matcher.Hashtag=s.Util.extend(s.matcher.Matcher,{matcherRegex:new RegExp("#[_"+s.RegexLib.alphaNumericCharsStr+"]{1,139}","g"),nonWordCharRegex:new RegExp("[^"+s.RegexLib.alphaNumericCharsStr+"]"),constructor:function(e){s.matcher.Matcher.prototype.constructor.call(this,e),this.serviceName=e.serviceName},parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,o=this.serviceName,i=this.tagBuilder,a=[];null!==(t=n.exec(e));){var u=t.index,c=e.charAt(u-1);if(0===u||r.test(c)){var l=t[0],p=t[0].slice(1);a.push(new s.match.Hashtag({tagBuilder:i,matchedText:l,offset:u,serviceName:o,hashtag:p}))}}return a}}),s.matcher.Phone=s.Util.extend(s.matcher.Matcher,{matcherRegex:/(?:(\+)?\d{1,3}[-\040.])?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]\d{4}/g,parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,o=[];null!==(t=n.exec(e));){var i=t[0],a=i.replace(/\D/g,""),u=!!t[1];o.push(new s.match.Phone({tagBuilder:r,matchedText:i,offset:t.index,number:a,plusSign:u}))}return o}}),s.matcher.Twitter=s.Util.extend(s.matcher.Matcher,{matcherRegex:new RegExp("@[_"+s.RegexLib.alphaNumericCharsStr+"]{1,20}","g"),nonWordCharRegex:new RegExp("[^"+s.RegexLib.alphaNumericCharsStr+"]"),parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,o=this.tagBuilder,i=[];null!==(t=n.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||r.test(u)){var c=t[0],l=t[0].slice(1);i.push(new s.match.Twitter({tagBuilder:o,matchedText:c,offset:a,twitterHandle:l}))}}return i}}),s.matcher.Url=s.Util.extend(s.matcher.Matcher,{matcherRegex:function(){var e=s.RegexLib.domainNameRegex,t=s.RegexLib.tldRegex,n=s.RegexLib.alphaNumericCharsStr,r=new RegExp("["+n+"\\-+&@#/%=~_()|'$*\\[\\]?!:,.;]*["+n+"\\-+&@#/%=~_()|'$*\\[\\]]");return new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]*:(?![A-Za-z][-.+A-Za-z0-9]*:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,e.source,")","|","(","(//)?",/(?:www\.)/.source,e.source,")","|","(","(//)?",e.source+"\\.",t.source,")",")","(?:"+r.source+")?"].join(""),"gi")}(),wordCharRegExp:/\w/,openParensRe:/\(/g,closeParensRe:/\)/g,constructor:function(e){if(s.matcher.Matcher.prototype.constructor.call(this,e),this.stripPrefix=e.stripPrefix,null==this.stripPrefix)throw new Error("`stripPrefix` cfg required")},parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.stripPrefix,o=this.tagBuilder,i=[];null!==(t=n.exec(e));){var a=t[0],u=t[1],c=t[2],l=t[3],p=t[5],f=t.index,h=l||p,d=e.charAt(f-1);if(s.matcher.UrlMatchValidator.isValid(a,u)&&!(f>0&&"@"===d||f>0&&h&&this.wordCharRegExp.test(d))){if(this.matchHasUnbalancedClosingParen(a))a=a.substr(0,a.length-1);else{var m=this.matchHasInvalidCharAfterTld(a,u);m>-1&&(a=a.substr(0,m))}var v=u?"scheme":c?"www":"tld",g=!!u;i.push(new s.match.Url({tagBuilder:o,matchedText:a,offset:f,urlMatchType:v,url:a,protocolUrlMatch:g,protocolRelativeMatch:!!h,stripPrefix:r}))}}return i},matchHasUnbalancedClosingParen:function(e){if(")"===e.charAt(e.length-1)){var t=e.match(this.openParensRe),n=e.match(this.closeParensRe);if((t&&t.length||0)<(n&&n.length||0))return!0}return!1},matchHasInvalidCharAfterTld:function(e,t){if(!e)return-1;var n=0;t&&(n=e.indexOf(":"),e=e.slice(n));var r=/^((.?\/\/)?[A-Za-z0-9\u00C0-\u017F\.\-]*[A-Za-z0-9\u00C0-\u017F\-]\.[A-Za-z]+)/.exec(e);return null===r?-1:(n+=r[1].length,e=e.slice(r[1].length),/^[^.A-Za-z:\/?#]/.test(e)?n:-1)}}),s.matcher.UrlMatchValidator={hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]*:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z\u00C0-\u017F]/,ipRegex:/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,isValid:function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e))},isValidIpAddress:function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return!(!e||!t||this.hasWordCharAfterProtocolRegex.test(e))}},s.truncate.TruncateEnd=function(e,t,n){return s.Util.ellipsis(e,t,n)},s.truncate.TruncateMiddle=function(e,t,n){if(e.length<=t)return e;var r=t-n.length,o="";return r>0&&(o=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+o).substr(0,t)},s.truncate.TruncateSmart=function(e,t,n){var r=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},o=function(e,t){var r=t/2,o=Math.ceil(r),i=-1*Math.floor(r),a="";return i<0&&(a=e.substr(i)),e.substr(0,o)+n+a};if(e.length<=t)return e;var i=t-n.length,a=function(e){var t={},n=e,r=n.match(/^([a-z]+):\/\//i);return r&&(t.scheme=r[1],n=n.substr(r[0].length)),(r=n.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=r[1],n=n.substr(r[0].length)),(r=n.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=r[1],n=n.substr(r[0].length)),(r=n.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=r[1],n=n.substr(r[0].length)),(r=n.match(/^#(.*?)$/i))&&(t.fragment=r[1]),t}(e);if(a.query){var s=a.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);s&&(a.query=a.query.substr(0,s[1].length),e=r(a))}if(e.length<=t)return e;if(a.host&&(a.host=a.host.replace(/^www\./,""),e=r(a)),e.length<=t)return e;var u="";if(a.host&&(u+=a.host),u.length>=i)return a.host.length==t?(a.host.substr(0,t-n.length)+n).substr(0,t):o(u,i).substr(0,t);var c="";if(a.path&&(c+="/"+a.path),a.query&&(c+="?"+a.query),c){if((u+c).length>=i)return(u+c).length==t?(u+c).substr(0,t):(u+o(c,i-u.length)).substr(0,t);u+=c}if(a.fragment){var l="#"+a.fragment;if((u+l).length>=i)return(u+l).length==t?(u+l).substr(0,t):(u+o(l,i-u.length)).substr(0,t);u+=l}if(a.scheme&&a.host){var p=a.scheme+"://";if((u+p).length<i)return(p+u).substr(0,t)}if(u.length<=t)return u;var f="";return i>0&&(f=u.substr(-1*Math.floor(i/2))),(u.substr(0,Math.ceil(i/2))+n+f).substr(0,t)},s})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){"use strict";var r=n(187),o=n(982),i=[["code",n(983)],["fences",n(984),["paragraph","blockquote","list"]],["blockquote",n(985),["paragraph","blockquote","list"]],["hr",n(986),["paragraph","blockquote","list"]],["list",n(987),["paragraph","blockquote"]],["footnote",n(988),["paragraph"]],["heading",n(989),["paragraph","blockquote"]],["lheading",n(990)],["htmlblock",n(991),["paragraph","blockquote"]],["table",n(993),["paragraph"]],["deflist",n(994),["paragraph"]],["paragraph",n(995)]];function a(){this.ruler=new r;for(var e=0;e<i.length;e++)this.ruler.push(i[e][0],i[e][1],{alt:(i[e][2]||[]).slice()})}a.prototype.tokenize=function(e,t,n){for(var r,o=this.ruler.getRules(""),i=o.length,a=t,s=!1;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n))&&!(e.tShift[a]<e.blkIndent);){for(r=0;r<i&&!o[r](e,a,n,!1);r++);if(e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),(a=e.line)<n&&e.isEmpty(a)){if(s=!0,++a<n&&"list"===e.parentType&&e.isEmpty(a))break;e.line=a}}};var s=/[\n\t]/g,u=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,c=/\u00a0/g;a.prototype.parse=function(e,t,n,r){var i,a=0,l=0;if(!e)return[];(e=(e=e.replace(c," ")).replace(u,"\n")).indexOf("\t")>=0&&(e=e.replace(s,function(t,n){var r;return 10===e.charCodeAt(n)?(a=n+1,l=0,t):(r=" ".slice((n-a-l)%4),l=n-a+1,r)})),i=new o(e,this,t,n,r),this.tokenize(i,i.line,i.lineMax)},e.exports=a},function(e,t,n){"use strict";function r(e,t,n,r,o){var i,a,s,u,c,l,p;for(this.src=e,this.parser=t,this.options=n,this.env=r,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",l=0,p=!1,s=u=l=0,c=(a=this.src).length;u<c;u++){if(i=a.charCodeAt(u),!p){if(32===i){l++;continue}p=!0}10!==i&&u!==c-1||(10!==i&&u++,this.bMarks.push(s),this.eMarks.push(u),this.tShift.push(l),p=!1,l=0,s=u+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}r.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},r.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},r.prototype.skipSpaces=function(e){for(var t=this.src.length;e<t&&32===this.src.charCodeAt(e);e++);return e},r.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},r.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},r.prototype.getLines=function(e,t,n,r){var o,i,a,s,u,c=e;if(e>=t)return"";if(c+1===t)return i=this.bMarks[c]+Math.min(this.tShift[c],n),a=r?this.eMarks[c]+1:this.eMarks[c],this.src.slice(i,a);for(s=new Array(t-e),o=0;c<t;c++,o++)(u=this.tShift[c])>n&&(u=n),u<0&&(u=0),i=this.bMarks[c]+u,a=c+1<t||r?this.eMarks[c]+1:this.eMarks[c],s[o]=this.src.slice(i,a);return s.join("")},e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,o;if(e.tShift[t]-e.blkIndent<4)return!1;for(o=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.tShift[r]-e.blkIndent>=4))break;o=++r}return e.line=r,e.tokens.push({type:"code",content:e.getLines(t,o,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s,u,c=!1,l=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(l+3>p)return!1;if(126!==(o=e.src.charCodeAt(l))&&96!==o)return!1;if(u=l,(i=(l=e.skipChars(l,o))-u)<3)return!1;if((a=e.src.slice(l,p).trim()).indexOf("`")>=0)return!1;if(r)return!0;for(s=t;!(++s>=n)&&!((l=u=e.bMarks[s]+e.tShift[s])<(p=e.eMarks[s])&&e.tShift[s]<e.blkIndent);)if(e.src.charCodeAt(l)===o&&!(e.tShift[s]-e.blkIndent>=4||(l=e.skipChars(l,o))-u<i||(l=e.skipSpaces(l))<p)){c=!0;break}return i=e.tShift[t],e.line=s+(c?1:0),e.tokens.push({type:"fence",params:a,content:e.getLines(t+1,s,i,!0),lines:[t,e.line],level:e.level}),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s,u,c,l,p,f,h,d,m=e.bMarks[t]+e.tShift[t],v=e.eMarks[t];if(m>v)return!1;if(62!==e.src.charCodeAt(m++))return!1;if(e.level>=e.options.maxNesting)return!1;if(r)return!0;for(32===e.src.charCodeAt(m)&&m++,u=e.blkIndent,e.blkIndent=0,s=[e.bMarks[t]],e.bMarks[t]=m,i=(m=m<v?e.skipSpaces(m):m)>=v,a=[e.tShift[t]],e.tShift[t]=m-e.bMarks[t],p=e.parser.ruler.getRules("blockquote"),o=t+1;o<n&&!((m=e.bMarks[o]+e.tShift[o])>=(v=e.eMarks[o]));o++)if(62!==e.src.charCodeAt(m++)){if(i)break;for(d=!1,f=0,h=p.length;f<h;f++)if(p[f](e,o,n,!0)){d=!0;break}if(d)break;s.push(e.bMarks[o]),a.push(e.tShift[o]),e.tShift[o]=-1337}else 32===e.src.charCodeAt(m)&&m++,s.push(e.bMarks[o]),e.bMarks[o]=m,i=(m=m<v?e.skipSpaces(m):m)>=v,a.push(e.tShift[o]),e.tShift[o]=m-e.bMarks[o];for(c=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:l=[t,0],level:e.level++}),e.parser.tokenize(e,t,o),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=c,l[1]=e.line,f=0;f<a.length;f++)e.bMarks[f+t]=s[f],e.tShift[f+t]=a[f];return e.blkIndent=u,!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s=e.bMarks[t],u=e.eMarks[t];if((s+=e.tShift[t])>u)return!1;if(42!==(o=e.src.charCodeAt(s++))&&45!==o&&95!==o)return!1;for(i=1;s<u;){if((a=e.src.charCodeAt(s++))!==o&&32!==a)return!1;a===o&&i++}return!(i<3)&&(!!r||(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level}),!0))}},function(e,t,n){"use strict";function r(e,t){var n,r,o;return(r=e.bMarks[t]+e.tShift[t])>=(o=e.eMarks[t])?-1:42!==(n=e.src.charCodeAt(r++))&&45!==n&&43!==n?-1:r<o&&32!==e.src.charCodeAt(r)?-1:r}function o(e,t){var n,r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(r+1>=o)return-1;if((n=e.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=o)return-1;if(!((n=e.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}}return r<o&&32!==e.src.charCodeAt(r)?-1:r}e.exports=function(e,t,n,i){var a,s,u,c,l,p,f,h,d,m,v,g,y,b,_,w,x,E,S,C,k,O=!0;if((h=o(e,t))>=0)g=!0;else{if(!((h=r(e,t))>=0))return!1;g=!1}if(e.level>=e.options.maxNesting)return!1;if(v=e.src.charCodeAt(h-1),i)return!0;for(b=e.tokens.length,g?(f=e.bMarks[t]+e.tShift[t],m=Number(e.src.substr(f,h-f-1)),e.tokens.push({type:"ordered_list_open",order:m,lines:w=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:w=[t,0],level:e.level++}),a=t,_=!1,E=e.parser.ruler.getRules("list");!(!(a<n)||((d=(y=e.skipSpaces(h))>=e.eMarks[a]?1:y-h)>4&&(d=1),d<1&&(d=1),s=h-e.bMarks[a]+d,e.tokens.push({type:"list_item_open",lines:x=[t,0],level:e.level++}),c=e.blkIndent,l=e.tight,u=e.tShift[t],p=e.parentType,e.tShift[t]=y-e.bMarks[t],e.blkIndent=s,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,n,!0),e.tight&&!_||(O=!1),_=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=c,e.tShift[t]=u,e.tight=l,e.parentType=p,e.tokens.push({type:"list_item_close",level:--e.level}),a=t=e.line,x[1]=a,y=e.bMarks[t],a>=n)||e.isEmpty(a)||e.tShift[a]<e.blkIndent);){for(k=!1,S=0,C=E.length;S<C;S++)if(E[S](e,a,n,!0)){k=!0;break}if(k)break;if(g){if((h=o(e,a))<0)break}else if((h=r(e,a))<0)break;if(v!==e.src.charCodeAt(h-1))break}return e.tokens.push({type:g?"ordered_list_close":"bullet_list_close",level:--e.level}),w[1]=a,e.line=a,O&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,b),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s,u,c=e.bMarks[t]+e.tShift[t],l=e.eMarks[t];if(c+4>l)return!1;if(91!==e.src.charCodeAt(c))return!1;if(94!==e.src.charCodeAt(c+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(s=c+2;s<l;s++){if(32===e.src.charCodeAt(s))return!1;if(93===e.src.charCodeAt(s))break}return s!==c+2&&(!(s+1>=l||58!==e.src.charCodeAt(++s))&&(!!r||(s++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),u=e.src.slice(c+2,s-2),e.env.footnotes.refs[":"+u]=-1,e.tokens.push({type:"footnote_reference_open",label:u,level:e.level++}),o=e.bMarks[t],i=e.tShift[t],a=e.parentType,e.tShift[t]=e.skipSpaces(s)-s,e.bMarks[t]=s,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]<e.blkIndent&&(e.tShift[t]+=e.blkIndent,e.bMarks[t]-=e.blkIndent),e.parser.tokenize(e,t,n,!0),e.parentType=a,e.blkIndent-=4,e.tShift[t]=i,e.bMarks[t]=o,e.tokens.push({type:"footnote_reference_close",level:--e.level}),!0)))}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(s>=u)return!1;if(35!==(o=e.src.charCodeAt(s))||s>=u)return!1;for(i=1,o=e.src.charCodeAt(++s);35===o&&s<u&&i<=6;)i++,o=e.src.charCodeAt(++s);return!(i>6||s<u&&32!==o)&&(!!r||(u=e.skipCharsBack(u,32,s),(a=e.skipCharsBack(u,35,s))>s&&32===e.src.charCodeAt(a-1)&&(u=a),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:i,lines:[t,e.line],level:e.level}),s<u&&e.tokens.push({type:"inline",content:e.src.slice(s,u).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:i,level:e.level}),!0))}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,o,i,a=t+1;return!(a>=n)&&(!(e.tShift[a]<e.blkIndent)&&(!(e.tShift[a]-e.blkIndent>3)&&(!((o=e.bMarks[a]+e.tShift[a])>=(i=e.eMarks[a]))&&((45===(r=e.src.charCodeAt(o))||61===r)&&(o=e.skipChars(o,r),!((o=e.skipSpaces(o))<i)&&(o=e.bMarks[t]+e.tShift[t],e.line=a+1,e.tokens.push({type:"heading_open",hLevel:61===r?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(o,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===r?1:2,level:e.level}),!0))))))}},function(e,t,n){"use strict";var r=n(992),o=/^<([a-zA-Z]{1,15})[\s\/>]/,i=/^<\/([a-zA-Z]{1,15})[\s>]/;e.exports=function(e,t,n,a){var s,u,c,l=e.bMarks[t],p=e.eMarks[t],f=e.tShift[t];if(l+=f,!e.options.html)return!1;if(f>3||l+2>=p)return!1;if(60!==e.src.charCodeAt(l))return!1;if(33===(s=e.src.charCodeAt(l+1))||63===s){if(a)return!0}else{if(47!==s&&!function(e){var t=32|e;return t>=97&&t<=122}(s))return!1;if(47===s){if(!(u=e.src.slice(l,p).match(i)))return!1}else if(!(u=e.src.slice(l,p).match(o)))return!1;if(!0!==r[u[1].toLowerCase()])return!1;if(a)return!0}for(c=t+1;c<e.lineMax&&!e.isEmpty(c);)c++;return e.line=c,e.tokens.push({type:"htmlblock",level:e.level,lines:[t,e.line],content:e.getLines(t,c,0,!0)}),!0}},function(e,t,n){"use strict";var r={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach(function(e){r[e]=!0}),e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src.substr(n,r-n)}e.exports=function(e,t,n,o){var i,a,s,u,c,l,p,f,h,d,m;if(t+2>n)return!1;if(c=t+1,e.tShift[c]<e.blkIndent)return!1;if((s=e.bMarks[c]+e.tShift[c])>=e.eMarks[c])return!1;if(124!==(i=e.src.charCodeAt(s))&&45!==i&&58!==i)return!1;if(a=r(e,t+1),!/^[-:| ]+$/.test(a))return!1;if((l=a.split("|"))<=2)return!1;for(f=[],u=0;u<l.length;u++){if(!(h=l[u].trim())){if(0===u||u===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(h))return!1;58===h.charCodeAt(h.length-1)?f.push(58===h.charCodeAt(0)?"center":"right"):58===h.charCodeAt(0)?f.push("left"):f.push("")}if(-1===(a=r(e,t).trim()).indexOf("|"))return!1;if(l=a.replace(/^\||\|$/g,"").split("|"),f.length!==l.length)return!1;if(o)return!0;for(e.tokens.push({type:"table_open",lines:d=[t,0],level:e.level++}),e.tokens.push({type:"thead_open",lines:[t,t+1],level:e.level++}),e.tokens.push({type:"tr_open",lines:[t,t+1],level:e.level++}),u=0;u<l.length;u++)e.tokens.push({type:"th_open",align:f[u],lines:[t,t+1],level:e.level++}),e.tokens.push({type:"inline",content:l[u].trim(),lines:[t,t+1],level:e.level,children:[]}),e.tokens.push({type:"th_close",level:--e.level});for(e.tokens.push({type:"tr_close",level:--e.level}),e.tokens.push({type:"thead_close",level:--e.level}),e.tokens.push({type:"tbody_open",lines:m=[t+2,0],level:e.level++}),c=t+2;c<n&&!(e.tShift[c]<e.blkIndent)&&-1!==(a=r(e,c).trim()).indexOf("|");c++){for(l=a.replace(/^\||\|$/g,"").split("|"),e.tokens.push({type:"tr_open",level:e.level++}),u=0;u<l.length;u++)e.tokens.push({type:"td_open",align:f[u],level:e.level++}),p=l[u].substring(124===l[u].charCodeAt(0)?1:0,124===l[u].charCodeAt(l[u].length-1)?l[u].length-1:l[u].length).trim(),e.tokens.push({type:"inline",content:p,level:e.level,children:[]}),e.tokens.push({type:"td_close",level:--e.level});e.tokens.push({type:"tr_close",level:--e.level})}return e.tokens.push({type:"tbody_close",level:--e.level}),e.tokens.push({type:"table_close",level:--e.level}),d[1]=m[1]=c,e.line=c,!0}},function(e,t,n){"use strict";function r(e,t){var n,r,o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return o>=i?-1:126!==(r=e.src.charCodeAt(o++))&&58!==r?-1:o===(n=e.skipSpaces(o))?-1:n>=i?-1:n}e.exports=function(e,t,n,o){var i,a,s,u,c,l,p,f,h,d,m,v,g,y;if(o)return!(e.ddIndent<0)&&r(e,t)>=0;if(p=t+1,e.isEmpty(p)&&++p>n)return!1;if(e.tShift[p]<e.blkIndent)return!1;if((i=r(e,p))<0)return!1;if(e.level>=e.options.maxNesting)return!1;l=e.tokens.length,e.tokens.push({type:"dl_open",lines:c=[t,0],level:e.level++}),s=t,a=p;e:for(;;){for(y=!0,g=!1,e.tokens.push({type:"dt_open",lines:[s,s],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(s,s+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[s,s],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:u=[p,0],level:e.level++}),v=e.tight,h=e.ddIndent,f=e.blkIndent,m=e.tShift[a],d=e.parentType,e.blkIndent=e.ddIndent=e.tShift[a]+2,e.tShift[a]=i-e.bMarks[a],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,a,n,!0),e.tight&&!g||(y=!1),g=e.line-a>1&&e.isEmpty(e.line-1),e.tShift[a]=m,e.tight=v,e.parentType=d,e.blkIndent=f,e.ddIndent=h,e.tokens.push({type:"dd_close",level:--e.level}),u[1]=p=e.line,p>=n)break e;if(e.tShift[p]<e.blkIndent)break e;if((i=r(e,p))<0)break;a=p}if(p>=n)break;if(s=p,e.isEmpty(s))break;if(e.tShift[s]<e.blkIndent)break;if((a=s+1)>=n)break;if(e.isEmpty(a)&&a++,a>=n)break;if(e.tShift[a]<e.blkIndent)break;if((i=r(e,a))<0)break}return e.tokens.push({type:"dl_close",level:--e.level}),c[1]=p,e.line=p,y&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,l),!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s,u=t+1;if(u<(n=e.lineMax)&&!e.isEmpty(u))for(s=e.parser.ruler.getRules("paragraph");u<n&&!e.isEmpty(u);u++)if(!(e.tShift[u]-e.blkIndent>3)){for(o=!1,i=0,a=s.length;i<a;i++)if(s[i](e,u,n,!0)){o=!0;break}if(o)break}return r=e.getLines(t,u,e.blkIndent,!1).trim(),e.line=u,r.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:r,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}},function(e,t,n){"use strict";var r=n(187),o=n(261),i=n(37),a=[["text",n(997)],["newline",n(998)],["escape",n(999)],["backticks",n(1e3)],["del",n(1001)],["ins",n(1002)],["mark",n(1003)],["emphasis",n(1004)],["sub",n(1005)],["sup",n(1006)],["links",n(1007)],["footnote_inline",n(1008)],["footnote_ref",n(1009)],["autolink",n(1010)],["htmltag",n(1012)],["entity",n(1014)]];function s(){this.ruler=new r;for(var e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1]);this.validateLink=u}function u(e){var t=e.trim().toLowerCase();return-1===(t=i.replaceEntities(t)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(t.split(":")[0])}s.prototype.skipToken=function(e){var t,n,r=this.ruler.getRules(""),o=r.length,i=e.pos;if((n=e.cacheGet(i))>0)e.pos=n;else{for(t=0;t<o;t++)if(r[t](e,!0))return void e.cacheSet(i,e.pos);e.pos++,e.cacheSet(i,e.pos)}},s.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),o=r.length,i=e.posMax;e.pos<i;){for(n=0;n<o&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=i)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},s.prototype.parse=function(e,t,n,r){var i=new o(e,this,t,n,r);this.tokenize(i)},e.exports=s},function(e,t,n){"use strict";function r(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}e.exports=function(e,t){for(var n=e.pos;n<e.posMax&&!r(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o=e.pos;if(10!==e.src.charCodeAt(o))return!1;if(n=e.pending.length-1,r=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(var i=n-2;i>=0;i--)if(32!==e.pending.charCodeAt(i)){e.pending=e.pending.substring(0,i+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(o++;o<r&&32===e.src.charCodeAt(o);)o++;return e.pos=o,!0}},function(e,t,n){"use strict";for(var r=[],o=0;o<256;o++)r.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){r[e.charCodeAt(0)]=1}),e.exports=function(e,t){var n,o=e.pos,i=e.posMax;if(92!==e.src.charCodeAt(o))return!1;if(++o<i){if((n=e.src.charCodeAt(o))<256&&0!==r[n])return t||(e.pending+=e.src[o]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),o++;o<i&&32===e.src.charCodeAt(o);)o++;return e.pos=o,!0}}return t||(e.pending+="\\"),e.pos++,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s=e.pos;if(96!==e.src.charCodeAt(s))return!1;for(n=s,s++,r=e.posMax;s<r&&96===e.src.charCodeAt(s);)s++;for(o=e.src.slice(n,s),i=a=s;-1!==(i=e.src.indexOf("`",a));){for(a=i+1;a<r&&96===e.src.charCodeAt(a);)a++;if(a-i===o.length)return t||e.push({type:"code",content:e.src.slice(s,i).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=a,!0}return t||(e.pending+=o),e.pos+=o.length,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s=e.posMax,u=e.pos;if(126!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(126!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(i=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),126===i)return!1;if(126===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&126===e.src.charCodeAt(r);)r++;if(r>u+3)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,o=1;e.pos+1<s;){if(126===e.src.charCodeAt(e.pos)&&126===e.src.charCodeAt(e.pos+1)&&(i=e.src.charCodeAt(e.pos-1),126!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&126!==i&&(32!==i&&10!==i?o--:32!==a&&10!==a&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s=e.posMax,u=e.pos;if(43!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(43!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(i=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),43===i)return!1;if(43===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&43===e.src.charCodeAt(r);)r++;if(r!==u+2)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,o=1;e.pos+1<s;){if(43===e.src.charCodeAt(e.pos)&&43===e.src.charCodeAt(e.pos+1)&&(i=e.src.charCodeAt(e.pos-1),43!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&43!==i&&(32!==i&&10!==i?o--:32!==a&&10!==a&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s=e.posMax,u=e.pos;if(61!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(61!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(i=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),61===i)return!1;if(61===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&61===e.src.charCodeAt(r);)r++;if(r!==u+2)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,o=1;e.pos+1<s;){if(61===e.src.charCodeAt(e.pos)&&61===e.src.charCodeAt(e.pos+1)&&(i=e.src.charCodeAt(e.pos-1),61!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&61!==i&&(32!==i&&10!==i?o--:32!==a&&10!==a&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";function r(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function o(e,t){var n,o,i,a=t,s=!0,u=!0,c=e.posMax,l=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;a<c&&e.src.charCodeAt(a)===l;)a++;return a>=c&&(s=!1),(i=a-t)>=4?s=u=!1:(32!==(o=a<c?e.src.charCodeAt(a):-1)&&10!==o||(s=!1),32!==n&&10!==n||(u=!1),95===l&&(r(n)&&(s=!1),r(o)&&(u=!1))),{can_open:s,can_close:u,delims:i}}e.exports=function(e,t){var n,r,i,a,s,u,c,l=e.posMax,p=e.pos,f=e.src.charCodeAt(p);if(95!==f&&42!==f)return!1;if(t)return!1;if(n=(c=o(e,p)).delims,!c.can_open)return e.pos+=n,t||(e.pending+=e.src.slice(p,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=p+n,u=[n];e.pos<l;)if(e.src.charCodeAt(e.pos)!==f)e.parser.skipToken(e);else{if(r=(c=o(e,e.pos)).delims,c.can_close){for(a=u.pop(),s=r;a!==s;){if(s<a){u.push(a-s);break}if(s-=a,0===u.length)break;e.pos+=a,a=u.pop()}if(0===u.length){n=a,i=!0;break}e.pos+=r;continue}c.can_open&&u.push(r),e.pos+=r}return i?(e.posMax=e.pos,e.pos=p+n,t||(2!==n&&3!==n||e.push({type:"strong_open",level:e.level++}),1!==n&&3!==n||e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),1!==n&&3!==n||e.push({type:"em_close",level:--e.level}),2!==n&&3!==n||e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+n,e.posMax=l,!0):(e.pos=p,!1)}},function(e,t,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;e.exports=function(e,t){var n,o,i=e.posMax,a=e.pos;if(126!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=i)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<i;){if(126===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(o=e.src.slice(a+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sub",level:e.level,content:o.replace(r,"$1")}),e.pos=e.posMax+1,e.posMax=i,!0):(e.pos=a,!1)}},function(e,t,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;e.exports=function(e,t){var n,o,i=e.posMax,a=e.pos;if(94!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=i)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<i;){if(94===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(o=e.src.slice(a+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sup",level:e.level,content:o.replace(r,"$1")}),e.pos=e.posMax+1,e.posMax=i,!0):(e.pos=a,!1)}},function(e,t,n){"use strict";var r=n(188),o=n(458),i=n(460),a=n(461);e.exports=function(e,t){var n,s,u,c,l,p,f,h,d=!1,m=e.pos,v=e.posMax,g=e.pos,y=e.src.charCodeAt(g);if(33===y&&(d=!0,y=e.src.charCodeAt(++g)),91!==y)return!1;if(e.level>=e.options.maxNesting)return!1;if(n=g+1,(s=r(e,g))<0)return!1;if((p=s+1)<v&&40===e.src.charCodeAt(p)){for(p++;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p>=v)return!1;for(g=p,o(e,p)?(c=e.linkContent,p=e.pos):c="",g=p;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p<v&&g!==p&&i(e,p))for(l=e.linkContent,p=e.pos;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);else l="";if(p>=v||41!==e.src.charCodeAt(p))return e.pos=m,!1;p++}else{if(e.linkLevel>0)return!1;for(;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p<v&&91===e.src.charCodeAt(p)&&(g=p+1,(p=r(e,p))>=0?u=e.src.slice(g,p++):p=g-1),u||(void 0===u&&(p=s+1),u=e.src.slice(n,s)),!(f=e.env.references[a(u)]))return e.pos=m,!1;c=f.href,l=f.title}return t||(e.pos=n,e.posMax=s,d?e.push({type:"image",src:c,title:l,alt:e.src.substr(n,s-n),level:e.level}):(e.push({type:"link_open",href:c,title:l,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=p,e.posMax=v,!0}},function(e,t,n){"use strict";var r=n(188);e.exports=function(e,t){var n,o,i,a,s=e.posMax,u=e.pos;return!(u+2>=s)&&(94===e.src.charCodeAt(u)&&(91===e.src.charCodeAt(u+1)&&(!(e.level>=e.options.maxNesting)&&(n=u+2,!((o=r(e,u+1))<0)&&(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),i=e.env.footnotes.list.length,e.pos=n,e.posMax=o,e.push({type:"footnote_ref",id:i,level:e.level}),e.linkLevel++,a=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[i]={tokens:e.tokens.splice(a)},e.linkLevel--),e.pos=o+1,e.posMax=s,!0)))))}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a=e.posMax,s=e.pos;if(s+3>a)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(s))return!1;if(94!==e.src.charCodeAt(s+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(r=s+2;r<a;r++){if(32===e.src.charCodeAt(r))return!1;if(10===e.src.charCodeAt(r))return!1;if(93===e.src.charCodeAt(r))break}return r!==s+2&&(!(r>=a)&&(r++,n=e.src.slice(s+2,r-1),void 0!==e.env.footnotes.refs[":"+n]&&(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+n]<0?(o=e.env.footnotes.list.length,e.env.footnotes.list[o]={label:n,count:0},e.env.footnotes.refs[":"+n]=o):o=e.env.footnotes.refs[":"+n],i=e.env.footnotes.list[o].count,e.env.footnotes.list[o].count++,e.push({type:"footnote_ref",id:o,subId:i,level:e.level})),e.pos=r,e.posMax=a,!0)))}},function(e,t,n){"use strict";var r=n(1011),o=n(459),i=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,a=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;e.exports=function(e,t){var n,s,u,c,l,p=e.pos;return 60===e.src.charCodeAt(p)&&(!((n=e.src.slice(p)).indexOf(">")<0)&&((s=n.match(a))?!(r.indexOf(s[1].toLowerCase())<0)&&(c=s[0].slice(1,-1),l=o(c),!!e.parser.validateLink(c)&&(t||(e.push({type:"link_open",href:l,level:e.level}),e.push({type:"text",content:c,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=s[0].length,!0)):!!(u=n.match(i))&&(c=u[0].slice(1,-1),l=o("mailto:"+c),!!e.parser.validateLink(l)&&(t||(e.push({type:"link_open",href:l,level:e.level}),e.push({type:"text",content:c,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=u[0].length,!0))))}},function(e,t,n){"use strict";e.exports=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"]},function(e,t,n){"use strict";var r=n(1013).HTML_TAG_RE;e.exports=function(e,t){var n,o,i,a=e.pos;return!!e.options.html&&(i=e.posMax,!(60!==e.src.charCodeAt(a)||a+2>=i)&&(!(33!==(n=e.src.charCodeAt(a+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n))&&(!!(o=e.src.slice(a).match(r))&&(t||e.push({type:"htmltag",content:e.src.slice(a,a+o[0].length),level:e.level}),e.pos+=o[0].length,!0))))}},function(e,t,n){"use strict";function r(e,t){return e=e.source,t=t||"",function n(r,o){return r?(o=o.source||o,e=e.replace(r,o),n):new RegExp(e,t)}}var o=r(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),i=r(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",o)(),a=r(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",i)(),s=r(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",a)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)();e.exports.HTML_TAG_RE=s},function(e,t,n){"use strict";var r=n(457),o=n(37).has,i=n(37).isValidEntityCode,a=n(37).fromCodePoint,s=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,u=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var n,c,l=e.pos,p=e.posMax;if(38!==e.src.charCodeAt(l))return!1;if(l+1<p)if(35===e.src.charCodeAt(l+1)){if(c=e.src.slice(l).match(s))return t||(n="x"===c[1][0].toLowerCase()?parseInt(c[1].slice(1),16):parseInt(c[1],10),e.pending+=i(n)?a(n):a(65533)),e.pos+=c[0].length,!0}else if((c=e.src.slice(l).match(u))&&o(r,c[1]))return t||(e.pending+=r[c[1]]),e.pos+=c[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","linkify","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}}},function(e,t,n){"use strict";e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebounceInput=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(0)),a=s(n(1019));function s(e){return e&&e.__esModule?e:{default:e}}(t.DebounceInput=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){e.persist();var t=n.state.value;n.setState({value:e.target.value},function(){var o=n.state.value;o.length>=n.props.minLength?n.notify(e):t.length>o.length&&n.notify(r({},e,{target:r({},e.target,{value:""})}))})},n.onKeyDown=function(e){var t=n.props.onKeyDown;"Enter"===e.key&&n.forceNotify(e),t&&t(e)},n.onBlur=function(e){var t=n.props.onBlur;n.forceNotify(e),t&&t(e)},n.createNotifier=function(e){if(e<0)n.notify=function(){return null};else if(0===e)n.notify=n.doNotify;else{var t=(0,a.default)(function(e){n.isDebouncing=!1,n.doNotify(e)},e);n.notify=function(e){n.isDebouncing=!0,t(e)},n.flush=function(){return t.flush()},n.cancel=function(){n.isDebouncing=!1,t.cancel()}}},n.doNotify=function(){var e=n.props.onChange;e.apply(void 0,arguments)},n.forceNotify=function(e){if(n.isDebouncing){n.cancel&&n.cancel();var t=n.state.value,o=n.props.minLength;t.length>=o?n.doNotify(e):n.doNotify(r({},e,{target:r({},e.target,{value:t})}))}},n.state={value:e.value||""},n.isDebouncing=!1,n}return 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)}(t,i.default.PureComponent),o(t,[{key:"componentWillMount",value:function(){this.createNotifier(this.props.debounceTimeout)}},{key:"componentWillReceiveProps",value:function(e){var t=e.value,n=e.debounceTimeout;this.isDebouncing||(void 0!==t&&this.state.value!==t&&this.setState({value:t}),n!==this.props.debounceTimeout&&this.createNotifier(n))}},{key:"componentWillUnmount",value:function(){this.flush&&this.flush()}},{key:"render",value:function(){var e=this.props,t=e.element,n=(e.onChange,e.value,e.minLength,e.debounceTimeout,e.forceNotifyByEnter),o=e.forceNotifyOnBlur,a=e.onKeyDown,s=e.onBlur,u=e.inputRef,c=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["element","onChange","value","minLength","debounceTimeout","forceNotifyByEnter","forceNotifyOnBlur","onKeyDown","onBlur","inputRef"]),l=void 0;l=n?{onKeyDown:this.onKeyDown}:a?{onKeyDown:a}:{};var p=void 0;p=o?{onBlur:this.onBlur}:s?{onBlur:s}:{};var f=u?{ref:u}:{};return i.default.createElement(t,r({},c,{onChange:this.onChange,value:this.state.value},l,p,f))}}]),t}()).defaultProps={element:"input",type:"text",onKeyDown:void 0,onBlur:void 0,value:void 0,minLength:0,debounceTimeout:100,forceNotifyByEnter:!0,forceNotifyOnBlur:!0,inputRef:void 0}},function(e,t,n){(function(t){var n="Expected a function",r=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt,l="object"==typeof t&&t&&t.Object===Object&&t,p="object"==typeof self&&self&&self.Object===Object&&self,f=l||p||Function("return this")(),h=Object.prototype.toString,d=Math.max,m=Math.min,v=function(){return f.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&h.call(e)==o}(e))return r;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=s.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):a.test(e)?r:+e}e.exports=function(e,t,r){var o,i,a,s,u,c,l=0,p=!1,f=!1,h=!0;if("function"!=typeof e)throw new TypeError(n);function b(t){var n=o,r=i;return o=i=void 0,l=t,s=e.apply(r,n)}function _(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-l>=a}function w(){var e=v();if(_(e))return x(e);u=setTimeout(w,function(e){var n=t-(e-c);return f?m(n,a-(e-l)):n}(e))}function x(e){return u=void 0,h&&o?b(e):(o=i=void 0,s)}function E(){var e=v(),n=_(e);if(o=arguments,i=this,c=e,n){if(void 0===u)return function(e){return l=e,u=setTimeout(w,t),p?b(e):s}(c);if(f)return u=setTimeout(w,t),b(c)}return void 0===u&&(u=setTimeout(w,t)),s}return t=y(t)||0,g(r)&&(p=!!r.leading,a=(f="maxWait"in r)?d(y(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h),E.cancel=function(){void 0!==u&&clearTimeout(u),l=0,o=c=i=u=void 0},E.flush=function(){return void 0===u?s:x(v())},E}}).call(this,n(42))},function(e,t,n){var r={"./all.js":320,"./auth/actions.js":67,"./auth/index.js":282,"./auth/reducers.js":283,"./auth/selectors.js":284,"./auth/spec-wrap-actions.js":285,"./configs/actions.js":117,"./configs/helpers.js":144,"./configs/index.js":321,"./configs/reducers.js":290,"./configs/selectors.js":289,"./configs/spec-actions.js":288,"./deep-linking/helpers.js":146,"./deep-linking/index.js":291,"./deep-linking/layout.js":292,"./deep-linking/operation-tag-wrapper.jsx":294,"./deep-linking/operation-wrapper.jsx":293,"./download-url.js":287,"./err/actions.js":43,"./err/error-transformers/hook.js":94,"./err/error-transformers/transformers/not-of-type.js":267,"./err/error-transformers/transformers/parameter-oneof.js":268,"./err/index.js":265,"./err/reducers.js":266,"./err/selectors.js":269,"./filter/index.js":295,"./filter/opsFilter.js":296,"./layout/actions.js":74,"./layout/index.js":270,"./layout/reducers.js":271,"./layout/selectors.js":272,"./logs/index.js":279,"./oas3/actions.js":59,"./oas3/auth-extensions/wrap-selectors.js":300,"./oas3/components/callbacks.jsx":303,"./oas3/components/http-auth.jsx":309,"./oas3/components/index.js":302,"./oas3/components/operation-link.jsx":305,"./oas3/components/operation-servers.jsx":310,"./oas3/components/request-body-editor.jsx":308,"./oas3/components/request-body.jsx":304,"./oas3/components/servers-container.jsx":307,"./oas3/components/servers.jsx":306,"./oas3/helpers.jsx":24,"./oas3/index.js":298,"./oas3/reducers.js":319,"./oas3/selectors.js":318,"./oas3/spec-extensions/selectors.js":301,"./oas3/spec-extensions/wrap-selectors.js":299,"./oas3/wrap-components/auth-item.jsx":313,"./oas3/wrap-components/index.js":311,"./oas3/wrap-components/json-schema-string.jsx":317,"./oas3/wrap-components/markdown.jsx":312,"./oas3/wrap-components/model.jsx":316,"./oas3/wrap-components/online-validator-badge.js":315,"./oas3/wrap-components/version-stamp.jsx":314,"./on-complete/index.js":297,"./samples/fn.js":116,"./samples/index.js":278,"./spec/actions.js":29,"./spec/index.js":273,"./spec/reducers.js":274,"./spec/selectors.js":66,"./spec/wrap-actions.js":276,"./swagger-js/configs-wrap-actions.js":281,"./swagger-js/index.js":280,"./util/index.js":286,"./view/index.js":277,"./view/root-injects.jsx":145};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=1020},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"Container",function(){return jt}),n.d(r,"Col",function(){return It}),n.d(r,"Row",function(){return Mt}),n.d(r,"Button",function(){return Nt}),n.d(r,"TextArea",function(){return Rt}),n.d(r,"Input",function(){return Dt}),n.d(r,"Select",function(){return Lt}),n.d(r,"Link",function(){return Ut}),n.d(r,"Collapse",function(){return Ft});var o={};n.r(o),n.d(o,"JsonSchemaForm",function(){return Tn}),n.d(o,"JsonSchema_string",function(){return jn}),n.d(o,"JsonSchema_array",function(){return Pn}),n.d(o,"JsonSchema_boolean",function(){return In}),n.d(o,"JsonSchema_object",function(){return Mn});var i=n(28),a=n.n(i),s=n(17),u=n.n(s),c=n(26),l=n.n(c),p=n(75),f=n.n(p),h=n(14),d=n.n(h),m=n(2),v=n.n(m),g=n(16),y=n.n(g),b=n(4),_=n.n(b),w=n(5),x=n.n(w),E=n(0),S=n.n(E),C=n(120),k=n(1),O=n.n(k),A=n(464),T=n(115),j=n.n(T),P=n(142),I=n.n(P),M=n(43),N=n(18),R=n.n(N),D=n(3),L=function(e){return e};var U=function(){function e(){var t,n,r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_()(this,e),f()(this,{state:{},plugins:[],system:{configs:{},fn:{},components:{},rootInjects:{},statePlugins:{}},boundSystem:{},toolbox:{}},o),this.getSystem=this._getSystem.bind(this),this.store=(t=L,n=Object(k.fromJS)(this.state),r=this.getSystem,function(e,t,n){var r=[Object(D.H)(n)],o=R.a.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||C.compose;return Object(C.createStore)(e,t,o(C.applyMiddleware.apply(void 0,r)))}(t,n,r)),this.buildSystem(!1),this.register(this.plugins)}return x()(e,[{key:"getStore",value:function(){return this.store}},{key:"register",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=q(e,this.getSystem());z(this.system,n),t&&this.buildSystem();var r=F.call(this.system,e,this.getSystem());r&&this.buildSystem()}},{key:"buildSystem",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.getStore().dispatch,n=this.getStore().getState;this.boundSystem=y()({},this.getRootInjects(),this.getWrappedAndBoundActions(t),this.getWrappedAndBoundSelectors(n,this.getSystem),this.getStateThunks(n),this.getFn(),this.getConfigs()),e&&this.rebuildReducer()}},{key:"_getSystem",value:function(){return this.boundSystem}},{key:"getRootInjects",value:function(){return y()({getSystem:this.getSystem,getStore:this.getStore.bind(this),getComponents:this.getComponents.bind(this),getState:this.getStore().getState,getConfigs:this._getConfigs.bind(this),Im:O.a,React:S.a},this.system.rootInjects||{})}},{key:"_getConfigs",value:function(){return this.system.configs}},{key:"getConfigs",value:function(){return{configs:this.system.configs}}},{key:"setConfigs",value:function(e){this.system.configs=e}},{key:"rebuildReducer",value:function(){var e,t,n;this.store.replaceReducer((n=this.system.statePlugins,e=Object(D.w)(n,function(e){return e.reducers}),t=u()(e).reduce(function(t,n){var r;return t[n]=(r=e[n],function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new k.Map,t=arguments.length>1?arguments[1]:void 0;if(!r)return e;var n=r[t.type];if(n){var o=B(n)(e,t);return null===o?e:o}return e}),t},{}),u()(t).length?Object(A.combineReducers)(t):L))}},{key:"getType",value:function(e){var t=e[0].toUpperCase()+e.slice(1);return Object(D.x)(this.system.statePlugins,function(n,r){var o=n[e];if(o)return v()({},r+t,o)})}},{key:"getSelectors",value:function(){return this.getType("selectors")}},{key:"getActions",value:function(){var e=this.getType("actions");return Object(D.w)(e,function(e){return Object(D.x)(e,function(e,t){if(Object(D.p)(e))return v()({},t,e)})})}},{key:"getWrappedAndBoundActions",value:function(e){var t=this,n=this.getBoundActions(e);return Object(D.w)(n,function(e,n){var r=t.system.statePlugins[n.slice(0,-7)].wrapActions;return r?Object(D.w)(e,function(e,n){var o=r[n];return o?(d()(o)||(o=[o]),o.reduce(function(e,n){var r=function(){return n(e,t.getSystem()).apply(void 0,arguments)};if(!Object(D.p)(r))throw new TypeError("wrapActions needs to return a function that returns a new function (ie the wrapped action)");return B(r)},e||Function.prototype)):e}):e})}},{key:"getWrappedAndBoundSelectors",value:function(e,t){var n=this,r=this.getBoundSelectors(e,t);return Object(D.w)(r,function(t,r){var o=[r.slice(0,-9)],i=n.system.statePlugins[o].wrapSelectors;return i?Object(D.w)(t,function(t,r){var a=i[r];return a?(d()(a)||(a=[a]),a.reduce(function(t,r){var i=function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r(t,n.getSystem()).apply(void 0,[e().getIn(o)].concat(a))};if(!Object(D.p)(i))throw new TypeError("wrapSelector needs to return a function that returns a new function (ie the wrapped action)");return i},t||Function.prototype)):t}):t})}},{key:"getStates",value:function(e){return u()(this.system.statePlugins).reduce(function(t,n){return t[n]=e.get(n),t},{})}},{key:"getStateThunks",value:function(e){return u()(this.system.statePlugins).reduce(function(t,n){return t[n]=function(){return e().get(n)},t},{})}},{key:"getFn",value:function(){return{fn:this.system.fn}}},{key:"getComponents",value:function(e){var t=this,n=this.system.components[e];return d()(n)?n.reduce(function(e,n){return n(e,t.getSystem())}):void 0!==e?this.system.components[e]:this.system.components}},{key:"getBoundSelectors",value:function(e,t){return Object(D.w)(this.getSelectors(),function(n,r){var o=[r.slice(0,-9)],i=function(){return e().getIn(o)};return Object(D.w)(n,function(e){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=B(e).apply(null,[i()].concat(r));return"function"==typeof a&&(a=B(a)(t())),a}})})}},{key:"getBoundActions",value:function(e){e=e||this.getStore().dispatch;var t=this.getActions();return Object(D.w)(t,function(t){return Object(C.bindActionCreators)(function e(t){return"function"!=typeof t?Object(D.w)(t,function(t){return e(t)}):function(){var e=null;try{e=t.apply(void 0,arguments)}catch(t){e={type:M.NEW_THROWN_ERR,error:!0,payload:j()(t)}}finally{return e}}}(t),e)})}},{key:"getMapStateToProps",value:function(){var e=this;return function(){return y()({},e.getSystem())}}},{key:"getMapDispatchToProps",value:function(e){var t=this;return function(n){return f()({},t.getWrappedAndBoundActions(n),t.getFn(),e)}}}]),e}();function q(e,t){return Object(D.s)(e)&&!Object(D.o)(e)?I()({},e):Object(D.q)(e)?q(e(t),t):Object(D.o)(e)?e.map(function(e){return q(e,t)}).reduce(z,{}):{}}function F(e,t){var n=this,r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).hasLoaded;return Object(D.s)(e)&&!Object(D.o)(e)&&"function"==typeof e.afterLoad&&(r=!0,B(e.afterLoad).call(this,t)),Object(D.q)(e)?F.call(this,e(t),t,{hasLoaded:r}):Object(D.o)(e)?e.map(function(e){return F.call(n,e,t,{hasLoaded:r})}):r}function z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object(D.s)(e))return{};if(!Object(D.s)(t))return e;t.wrapComponents&&(Object(D.w)(t.wrapComponents,function(n,r){var o=e.components&&e.components[r];o&&d()(o)?(e.components[r]=o.concat([n]),delete t.wrapComponents[r]):o&&(e.components[r]=[o,n],delete t.wrapComponents[r])}),u()(t.wrapComponents).length||delete t.wrapComponents);var n=e.statePlugins;if(Object(D.s)(n))for(var r in n){var o=n[r];if(Object(D.s)(o)&&Object(D.s)(o.wrapActions)){var i=o.wrapActions;for(var a in i){var s=i[a];d()(s)||(s=[s],i[a]=s),t&&t.statePlugins&&t.statePlugins[r]&&t.statePlugins[r].wrapActions&&t.statePlugins[r].wrapActions[a]&&(t.statePlugins[r].wrapActions[a]=i[a].concat(t.statePlugins[r].wrapActions[a]))}}}return f()(e,t)}function B(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).logErrors,n=void 0===t||t;return"function"!=typeof e?e:function(){try{for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e.call.apply(e,[this].concat(r))}catch(e){return n&&console.error(e),null}}}var V=n(265),H=n(270),W=n(273),J=n(277),Y=n(278),K=n(279),G=n(280),$=n(282),Z=n(286),X=n(287),Q=n(321),ee=n(291),te=n(295),ne=n(297),re=n(6),oe=n.n(re),ie=n(7),ae=n.n(ie),se=n(9),ue=n.n(se),ce=n(8),le=n.n(ce),pe=(n(10),n(19),n(53).helpers.opId),fe=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"toggleShown",function(){var e=r.props,t=e.layoutActions,n=e.tag,o=e.operationId,i=e.isShown,a=r.getResolvedSubtree();i||void 0!==a||r.requestResolvedSubtree(),t.show(["operations",n,o],!i)}),v()(ue()(r),"onCancelClick",function(){r.setState({tryItOutEnabled:!r.state.tryItOutEnabled})}),v()(ue()(r),"onTryoutClick",function(){var e=r.props,t=e.specActions,n=e.path,o=e.method;r.setState({tryItOutEnabled:!r.state.tryItOutEnabled}),t.clearValidateParams([n,o])}),v()(ue()(r),"onExecute",function(){r.setState({executeInProgress:!0})}),v()(ue()(r),"getResolvedSubtree",function(){var e=r.props,t=e.specSelectors,n=e.path,o=e.method,i=e.specPath;return i?t.specResolvedSubtree(i.toJS()):t.specResolvedSubtree(["paths",n,o])}),v()(ue()(r),"requestResolvedSubtree",function(){var e=r.props,t=e.specActions,n=e.path,o=e.method,i=e.specPath;return i?t.requestResolvedSubtree(i.toJS()):t.requestResolvedSubtree(["paths",n,o])}),r.state={tryItOutEnabled:!1,executeInProgress:!1},r}return le()(t,e),x()(t,[{key:"mapStateToProps",value:function(e,t){var n=t.op,r=t.layoutSelectors,o=(0,t.getConfigs)(),i=o.docExpansion,a=o.deepLinking,s=o.displayOperationId,u=o.displayRequestDuration,c=o.supportedSubmitMethods,l=r.showSummary(),p=n.getIn(["operation","__originalOperationId"])||n.getIn(["operation","operationId"])||pe(n.get("operation"),t.path,t.method)||n.get("id"),f=["operations",t.tag,p],h=a&&"false"!==a,d=c.indexOf(t.method)>=0&&(void 0===t.allowTryItOut?t.specSelectors.allowTryItOutFor(t.path,t.method):t.allowTryItOut),m=n.getIn(["operation","security"])||t.specSelectors.security();return{operationId:p,isDeepLinkingEnabled:h,showSummary:l,displayOperationId:s,displayRequestDuration:u,allowTryItOut:d,security:m,isAuthorized:t.authSelectors.isAuthorized(m),isShown:r.isShown(f,"full"===i),jumpToKey:"paths.".concat(t.path,".").concat(t.method),response:t.specSelectors.responseFor(t.path,t.method),request:t.specSelectors.requestFor(t.path,t.method)}}},{key:"componentDidMount",value:function(){var e=this.props.isShown,t=this.getResolvedSubtree();e&&void 0===t&&this.requestResolvedSubtree()}},{key:"componentWillReceiveProps",value:function(e){var t=e.response,n=e.isShown,r=this.getResolvedSubtree();t!==this.props.response&&this.setState({executeInProgress:!1}),n&&void 0===r&&this.requestResolvedSubtree()}},{key:"render",value:function(){var e=this.props,t=e.op,n=e.tag,r=e.path,o=e.method,i=e.security,a=e.isAuthorized,s=e.operationId,u=e.showSummary,c=e.isShown,l=e.jumpToKey,p=e.allowTryItOut,f=e.response,h=e.request,d=e.displayOperationId,m=e.displayRequestDuration,v=e.isDeepLinkingEnabled,g=e.specPath,y=e.specSelectors,b=e.specActions,_=e.getComponent,w=e.getConfigs,x=e.layoutSelectors,E=e.layoutActions,C=e.authActions,O=e.authSelectors,A=e.oas3Actions,T=e.oas3Selectors,j=e.fn,P=_("operation"),I=this.getResolvedSubtree()||Object(k.Map)(),M=Object(k.fromJS)({op:I,tag:n,path:r,summary:t.getIn(["operation","summary"])||"",deprecated:I.get("deprecated")||t.getIn(["operation","deprecated"])||!1,method:o,security:i,isAuthorized:a,operationId:s,originalOperationId:I.getIn(["operation","__originalOperationId"]),showSummary:u,isShown:c,jumpToKey:l,allowTryItOut:p,request:h,displayOperationId:d,displayRequestDuration:m,isDeepLinkingEnabled:v,executeInProgress:this.state.executeInProgress,tryItOutEnabled:this.state.tryItOutEnabled});return S.a.createElement(P,{operation:M,response:f,request:h,isShown:c,toggleShown:this.toggleShown,onTryoutClick:this.onTryoutClick,onCancelClick:this.onCancelClick,onExecute:this.onExecute,specPath:g,specActions:b,specSelectors:y,oas3Actions:A,oas3Selectors:T,layoutActions:E,layoutSelectors:x,authActions:C,authSelectors:O,getComponent:_,getConfigs:w,fn:j})}}]),t}(E.PureComponent);v()(fe,"defaultProps",{showSummary:!0,response:null,allowTryItOut:!0,displayOperationId:!1,displayRequestDuration:!1});var he=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"getLayout",value:function(){var e=this.props,t=e.getComponent,n=e.layoutSelectors.current(),r=t(n,!0);return r||function(){return S.a.createElement("h1",null,' No layout defined for "',n,'" ')}}},{key:"render",value:function(){var e=this.getLayout();return S.a.createElement(e,null)}}]),t}(S.a.Component);he.defaultProps={};var de=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"close",function(){n.props.authActions.showDefinitions(!1)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.authSelectors,n=e.authActions,r=e.getComponent,o=e.errSelectors,i=e.specSelectors,a=e.fn.AST,s=void 0===a?{}:a,u=t.shownDefinitions(),c=r("auths");return S.a.createElement("div",{className:"dialog-ux"},S.a.createElement("div",{className:"backdrop-ux"}),S.a.createElement("div",{className:"modal-ux"},S.a.createElement("div",{className:"modal-dialog-ux"},S.a.createElement("div",{className:"modal-ux-inner"},S.a.createElement("div",{className:"modal-ux-header"},S.a.createElement("h3",null,"Available authorizations"),S.a.createElement("button",{type:"button",className:"close-modal",onClick:this.close},S.a.createElement("svg",{width:"20",height:"20"},S.a.createElement("use",{href:"#close",xlinkHref:"#close"})))),S.a.createElement("div",{className:"modal-ux-content"},u.valueSeq().map(function(e,a){return S.a.createElement(c,{key:a,AST:s,definitions:e,getComponent:r,errSelectors:o,authSelectors:t,authActions:n,specSelectors:i})}))))))}}]),t}(S.a.Component),me=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.isAuthorized,n=e.showPopup,r=e.onClick,o=(0,e.getComponent)("authorizationPopup",!0);return S.a.createElement("div",{className:"auth-wrapper"},S.a.createElement("button",{className:t?"btn authorize locked":"btn authorize unlocked",onClick:r},S.a.createElement("span",null,"Authorize"),S.a.createElement("svg",{width:"20",height:"20"},S.a.createElement("use",{href:t?"#locked":"#unlocked",xlinkHref:t?"#locked":"#unlocked"}))),n&&S.a.createElement(o,null))}}]),t}(S.a.Component),ve=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.authActions,n=e.authSelectors,r=e.specSelectors,o=e.getComponent,i=r.securityDefinitions(),a=n.definitionsToAuthorize(),s=o("authorizeBtn");return i?S.a.createElement(s,{onClick:function(){return t.showDefinitions(a)},isAuthorized:!!n.authorized().size,showPopup:!!n.shownDefinitions(),getComponent:o}):null}}]),t}(S.a.Component),ge=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onClick",function(e){e.stopPropagation();var t=n.props.onClick;t&&t()}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props.isAuthorized;return S.a.createElement("button",{className:e?"authorization__btn locked":"authorization__btn unlocked","aria-label":e?"authorization button locked":"authorization button unlocked",onClick:this.onClick},S.a.createElement("svg",{width:"20",height:"20"},S.a.createElement("use",{href:e?"#locked":"#unlocked",xlinkHref:e?"#locked":"#unlocked"})))}}]),t}(S.a.Component),ye=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onAuthChange",function(e){var t=e.name;r.setState(v()({},t,e))}),v()(ue()(r),"submitAuth",function(e){e.preventDefault(),r.props.authActions.authorize(r.state)}),v()(ue()(r),"logoutClick",function(e){e.preventDefault();var t=r.props,n=t.authActions,o=t.definitions.map(function(e,t){return t}).toArray();n.logout(o)}),v()(ue()(r),"close",function(e){e.preventDefault(),r.props.authActions.showDefinitions(!1)}),r.state={},r}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.definitions,r=t.getComponent,o=t.authSelectors,i=t.errSelectors,a=r("AuthItem"),s=r("oauth2",!0),u=r("Button"),c=o.authorized(),l=n.filter(function(e,t){return!!c.get(t)}),p=n.filter(function(e){return"oauth2"!==e.get("type")}),f=n.filter(function(e){return"oauth2"===e.get("type")});return S.a.createElement("div",{className:"auth-container"},!!p.size&&S.a.createElement("form",{onSubmit:this.submitAuth},p.map(function(t,n){return S.a.createElement(a,{key:n,schema:t,name:n,getComponent:r,onAuthChange:e.onAuthChange,authorized:c,errSelectors:i})}).toArray(),S.a.createElement("div",{className:"auth-btn-wrapper"},p.size===l.size?S.a.createElement(u,{className:"btn modal-btn auth",onClick:this.logoutClick},"Logout"):S.a.createElement(u,{type:"submit",className:"btn modal-btn auth authorize"},"Authorize"),S.a.createElement(u,{className:"btn modal-btn auth btn-done",onClick:this.close},"Close"))),f&&f.size?S.a.createElement("div",null,S.a.createElement("div",{className:"scope-def"},S.a.createElement("p",null,"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes."),S.a.createElement("p",null,"API requires the following scopes. Select which ones you want to grant to Swagger UI.")),n.filter(function(e){return"oauth2"===e.get("type")}).map(function(e,t){return S.a.createElement("div",{key:t},S.a.createElement(s,{authorized:c,schema:e,name:t}))}).toArray()):null)}}]),t}(S.a.Component),be=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e,t=this.props,n=t.schema,r=t.name,o=t.getComponent,i=t.onAuthChange,a=t.authorized,s=t.errSelectors,u=o("apiKeyAuth"),c=o("basicAuth"),l=n.get("type");switch(l){case"apiKey":e=S.a.createElement(u,{key:r,schema:n,name:r,errSelectors:s,authorized:a,getComponent:o,onChange:i});break;case"basic":e=S.a.createElement(c,{key:r,schema:n,name:r,errSelectors:s,authorized:a,getComponent:o,onChange:i});break;default:e=S.a.createElement("div",{key:r},"Unknown security definition type ",l)}return S.a.createElement("div",{key:"".concat(r,"-jump")},e)}}]),t}(S.a.Component),_e=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props.error,t=e.get("level"),n=e.get("message"),r=e.get("source");return S.a.createElement("div",{className:"errors",style:{backgroundColor:"#ffeeee",color:"red",margin:"1em"}},S.a.createElement("b",{style:{textTransform:"capitalize",marginRight:"1em"}},r," ",t),S.a.createElement("span",null,n))}}]),t}(S.a.Component),we=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChange",function(e){var t=r.props.onChange,n=e.target.value,o=y()({},r.state,{value:n});r.setState(o),t(o)});var o=r.props,i=o.name,a=o.schema,s=r.getValue();return r.state={name:i,schema:a,value:s},r}return le()(t,e),x()(t,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.errSelectors,o=e.name,i=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),c=n("Markdown"),l=n("JumpToPath",!0),p=this.getValue(),f=r.allErrors().filter(function(e){return e.get("authId")===o});return S.a.createElement("div",null,S.a.createElement("h4",null,S.a.createElement("code",null,o||t.get("name"))," (apiKey)",S.a.createElement(l,{path:["securityDefinitions",o]})),p&&S.a.createElement("h6",null,"Authorized"),S.a.createElement(a,null,S.a.createElement(c,{source:t.get("description")})),S.a.createElement(a,null,S.a.createElement("p",null,"Name: ",S.a.createElement("code",null,t.get("name")))),S.a.createElement(a,null,S.a.createElement("p",null,"In: ",S.a.createElement("code",null,t.get("in")))),S.a.createElement(a,null,S.a.createElement("label",null,"Value:"),p?S.a.createElement("code",null," ****** "):S.a.createElement(s,null,S.a.createElement(i,{type:"text",onChange:this.onChange}))),f.valueSeq().map(function(e,t){return S.a.createElement(u,{error:e,key:t})}))}}]),t}(S.a.Component),xe=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChange",function(e){var t=r.props.onChange,n=e.target,o=n.value,i=n.name,a=r.state.value;a[i]=o,r.setState({value:a}),t(r.state)});var o=r.props,i=o.schema,a=o.name,s=r.getValue().username;return r.state={name:a,schema:i,value:s?{username:s}:{}},r}return le()(t,e),x()(t,[{key:"getValue",value:function(){var e=this.props,t=e.authorized,n=e.name;return t&&t.getIn([n,"value"])||{}}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.name,o=e.errSelectors,i=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),c=n("JumpToPath",!0),l=n("Markdown"),p=this.getValue().username,f=o.allErrors().filter(function(e){return e.get("authId")===r});return S.a.createElement("div",null,S.a.createElement("h4",null,"Basic authorization",S.a.createElement(c,{path:["securityDefinitions",r]})),p&&S.a.createElement("h6",null,"Authorized"),S.a.createElement(a,null,S.a.createElement(l,{source:t.get("description")})),S.a.createElement(a,null,S.a.createElement("label",null,"Username:"),p?S.a.createElement("code",null," ",p," "):S.a.createElement(s,null,S.a.createElement(i,{type:"text",required:"required",name:"username",onChange:this.onChange}))),S.a.createElement(a,null,S.a.createElement("label",null,"Password:"),p?S.a.createElement("code",null," ****** "):S.a.createElement(s,null,S.a.createElement(i,{required:"required",autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),f.valueSeq().map(function(e,t){return S.a.createElement(u,{error:e,key:t})}))}}]),t}(S.a.Component);function Ee(e){var t=e.example,n=e.showValue,r=e.getComponent,o=r("Markdown"),i=r("highlightCode");return t?S.a.createElement("div",{className:"example"},t.get("description")?S.a.createElement("section",{className:"example__section"},S.a.createElement("div",{className:"example__section-header"},"Example Description"),S.a.createElement("p",null,S.a.createElement(o,{source:t.get("description")}))):null,n&&t.has("value")?S.a.createElement("section",{className:"example__section"},S.a.createElement("div",{className:"example__section-header"},"Example Value"),S.a.createElement(i,{value:Object(D.G)(t.get("value"))})):null):null}var Se=n(475),Ce=n.n(Se),ke=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"_onSelect",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.isSyntheticChange,o=void 0!==r&&r;"function"==typeof n.props.onSelect&&n.props.onSelect(e,{isSyntheticChange:o})}),v()(ue()(n),"_onDomSelect",function(e){if("function"==typeof n.props.onSelect){var t=e.target.selectedOptions[0].getAttribute("value");n._onSelect(t,{isSyntheticChange:!1})}}),v()(ue()(n),"getCurrentExample",function(){var e=n.props,t=e.examples,r=e.currentExampleKey,o=t.get(r),i=t.keySeq().first(),a=t.get(i);return o||a||Ce()({})}),n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.onSelect,n=e.examples;if("function"==typeof t){var r=n.first(),o=n.keyOf(r);this._onSelect(o,{isSyntheticChange:!0})}}},{key:"componentWillReceiveProps",value:function(e){var t=e.currentExampleKey,n=e.examples;if(n!==this.props.examples&&!n.has(t)){var r=n.first(),o=n.keyOf(r);this._onSelect(o,{isSyntheticChange:!0})}}},{key:"render",value:function(){var e=this.props,t=e.examples,n=e.currentExampleKey,r=e.isValueModified,o=e.isModifiedValueAvailable,i=e.showLabels;return S.a.createElement("div",{className:"examples-select"},i?S.a.createElement("span",{className:"examples-select__section-label"},"Examples: "):null,S.a.createElement("select",{onChange:this._onDomSelect,value:o&&r?"__MODIFIED__VALUE__":n||""},o?S.a.createElement("option",{value:"__MODIFIED__VALUE__"},"[Modified value]"):null,t.map(function(e,t){return S.a.createElement("option",{key:t,value:t},e.get("summary")||t)}).valueSeq()))}}]),t}(S.a.PureComponent);v()(ke,"defaultProps",{examples:O.a.Map({}),onSelect:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).log.apply(e,["DEBUG: ExamplesSelect was not given an onSelect callback"].concat(n))},currentExampleKey:null,showLabels:!0});var Oe=function(e){return k.List.isList(e)?e:Object(D.G)(e)},Ae=function(e){function t(e){var n;_()(this,t),n=oe()(this,ae()(t).call(this,e)),v()(ue()(n),"_getStateForCurrentNamespace",function(){var e=n.props.currentNamespace;return(n.state[e]||Object(k.Map)()).toObject()}),v()(ue()(n),"_setStateForCurrentNamespace",function(e){var t=n.props.currentNamespace;return n._setStateForNamespace(t,e)}),v()(ue()(n),"_setStateForNamespace",function(e,t){var r=(n.state[e]||Object(k.Map)()).mergeDeep(t);return n.setState(v()({},e,r))}),v()(ue()(n),"_isCurrentUserInputSameAsExampleValue",function(){var e=n.props.currentUserInputValue;return n._getCurrentExampleValue()===e}),v()(ue()(n),"_getValueForExample",function(e,t){var r=(t||n.props).examples;return Oe((r||Object(k.Map)({})).getIn([e,"value"]))}),v()(ue()(n),"_getCurrentExampleValue",function(e){var t=(e||n.props).currentKey;return n._getValueForExample(t,e||n.props)}),v()(ue()(n),"_onExamplesSelect",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.isSyntheticChange,o=n.props,i=o.onSelect,a=o.updateValue,s=o.currentUserInputValue,u=n._getStateForCurrentNamespace(),c=u.lastUserEditedValue,l=n._getValueForExample(e);if("__MODIFIED__VALUE__"===e)return a(Oe(c)),n._setStateForCurrentNamespace({isModifiedValueSelected:!0});if("function"==typeof i){for(var p=arguments.length,f=new Array(p>2?p-2:0),h=2;h<p;h++)f[h-2]=arguments[h];i.apply(void 0,[e,{isSyntheticChange:r}].concat(f))}n._setStateForCurrentNamespace({lastDownstreamValue:l,isModifiedValueSelected:r&&!!s&&s!==l}),r||"function"==typeof a&&a(Oe(l))});var r=n._getCurrentExampleValue();return n.state=v()({},e.currentNamespace,Object(k.Map)({lastUserEditedValue:n.props.currentUserInputValue,lastDownstreamValue:r,isModifiedValueSelected:n.props.currentUserInputValue!==r})),n}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.currentUserInputValue,n=e.examples,r=e.onSelect,o=this._getStateForCurrentNamespace(),i=o.lastUserEditedValue,a=o.lastDownstreamValue,s=this._getValueForExample(e.currentKey,e),u=n.find(function(e){return e.get("value")===t||Object(D.G)(e.get("value"))===t});u?r(n.keyOf(u),{isSyntheticChange:!0}):t!==this.props.currentUserInputValue&&t!==i&&t!==a&&this._setStateForNamespace(e.currentNamespace,{lastUserEditedValue:e.currentUserInputValue,isModifiedValueSelected:t!==s})}},{key:"render",value:function(){var e=this.props,t=e.currentUserInputValue,n=e.examples,r=e.currentKey,o=e.getComponent,i=this._getStateForCurrentNamespace(),a=i.lastDownstreamValue,s=i.lastUserEditedValue,u=i.isModifiedValueSelected,c=o("ExamplesSelect");return S.a.createElement(c,{examples:n,currentExampleKey:r,onSelect:this._onExamplesSelect,isModifiedValueAvailable:!!s&&s!==a,isValueModified:void 0!==t&&u&&t!==this._getCurrentExampleValue()})}}]),t}(S.a.PureComponent);v()(Ae,"defaultProps",{examples:Object(k.Map)({}),currentNamespace:"__DEFAULT__NAMESPACE__",onSelect:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).log.apply(e,["ExamplesSelectValueRetainer: no `onSelect` function was provided"].concat(n))},updateValue:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).log.apply(e,["ExamplesSelectValueRetainer: no `updateValue` function was provided"].concat(n))}});var Te=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"close",function(e){e.preventDefault(),r.props.authActions.showDefinitions(!1)}),v()(ue()(r),"authorize",function(){var e=r.props,t=e.authActions,n=e.errActions,o=e.getConfigs,i=e.authSelectors,a=o(),s=i.getConfigs();n.clear({authId:name,type:"auth",source:"auth"}),function(e){var t=e.auth,n=e.authActions,r=e.errActions,o=e.configs,i=e.authConfigs,a=void 0===i?{}:i,s=t.schema,u=t.scopes,c=t.name,l=t.clientId,p=s.get("flow"),f=[];switch(p){case"password":return void n.authorizePassword(t);case"application":return void n.authorizeApplication(t);case"accessCode":f.push("response_type=code");break;case"implicit":f.push("response_type=token");break;case"clientCredentials":return void n.authorizeApplication(t);case"authorizationCode":f.push("response_type=code")}"string"==typeof l&&f.push("client_id="+encodeURIComponent(l));var h=o.oauth2RedirectUrl;if(void 0!==h){if(f.push("redirect_uri="+encodeURIComponent(h)),d()(u)&&0<u.length){var m=a.scopeSeparator||" ";f.push("scope="+encodeURIComponent(u.join(m)))}var v=Object(D.a)(new Date);f.push("state="+encodeURIComponent(v)),void 0!==a.realm&&f.push("realm="+encodeURIComponent(a.realm));var g=a.additionalQueryStringParams;for(var y in g)void 0!==g[y]&&f.push([y,g[y]].map(encodeURIComponent).join("="));var b,_=s.get("authorizationUrl"),w=[Object(D.D)(_),f.join("&")].join(-1===_.indexOf("?")?"?":"&");b="implicit"===p?n.preAuthorizeImplicit:a.useBasicAuthenticationWithAccessCodeGrant?n.authorizeAccessCodeWithBasicAuthentication:n.authorizeAccessCodeWithFormParams,R.a.swaggerUIRedirectOauth2={auth:t,state:v,redirectUrl:h,callback:b,errCb:r.newAuthErr},R.a.open(w)}else r.newAuthErr({authId:c,source:"validation",level:"error",message:"oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed."})}({auth:r.state,authActions:t,errActions:n,configs:a,authConfigs:s})}),v()(ue()(r),"onScopeChange",function(e){var t=e.target,n=t.checked,o=t.dataset.value;if(n&&-1===r.state.scopes.indexOf(o)){var i=r.state.scopes.concat([o]);r.setState({scopes:i})}else!n&&r.state.scopes.indexOf(o)>-1&&r.setState({scopes:r.state.scopes.filter(function(e){return e!==o})})}),v()(ue()(r),"onInputChange",function(e){var t=e.target,n=t.dataset.name,o=t.value,i=v()({},n,o);r.setState(i)}),v()(ue()(r),"logout",function(e){e.preventDefault();var t=r.props,n=t.authActions,o=t.errActions,i=t.name;o.clear({authId:i,type:"auth",source:"auth"}),n.logout([i])});var o=r.props,i=o.name,a=o.schema,s=o.authorized,u=o.authSelectors,c=s&&s.get(i),l=u.getConfigs()||{},p=c&&c.get("username")||"",f=c&&c.get("clientId")||l.clientId||"",h=c&&c.get("clientSecret")||l.clientSecret||"",m=c&&c.get("passwordType")||"basic";return r.state={appName:l.appName,name:i,schema:a,scopes:[],clientId:f,clientSecret:h,username:p,password:"",passwordType:m},r}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.schema,r=t.getComponent,o=t.authSelectors,i=t.errSelectors,a=t.name,s=t.specSelectors,u=r("Input"),c=r("Row"),l=r("Col"),p=r("Button"),f=r("authError"),h=r("JumpToPath",!0),d=r("Markdown"),m=r("InitializedInput"),v=s.isOAS3,g=v()?"authorizationCode":"accessCode",y=v()?"clientCredentials":"application",b=n.get("flow"),_=n.get("allowedScopes")||n.get("scopes"),w=!!o.authorized().get(a),x=i.allErrors().filter(function(e){return e.get("authId")===a}),E=!x.filter(function(e){return"validation"===e.get("source")}).size,C=n.get("description");return S.a.createElement("div",null,S.a.createElement("h4",null,a," (OAuth2, ",n.get("flow"),") ",S.a.createElement(h,{path:["securityDefinitions",a]})),this.state.appName?S.a.createElement("h5",null,"Application: ",this.state.appName," "):null,C&&S.a.createElement(d,{source:n.get("description")}),w&&S.a.createElement("h6",null,"Authorized"),("implicit"===b||b===g)&&S.a.createElement("p",null,"Authorization URL: ",S.a.createElement("code",null,n.get("authorizationUrl"))),("password"===b||b===g||b===y)&&S.a.createElement("p",null,"Token URL:",S.a.createElement("code",null," ",n.get("tokenUrl"))),S.a.createElement("p",{className:"flow"},"Flow: ",S.a.createElement("code",null,n.get("flow"))),"password"!==b?null:S.a.createElement(c,null,S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"oauth_username"},"username:"),w?S.a.createElement("code",null," ",this.state.username," "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement("input",{id:"oauth_username",type:"text","data-name":"username",onChange:this.onInputChange}))),S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"oauth_password"},"password:"),w?S.a.createElement("code",null," ****** "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement("input",{id:"oauth_password",type:"password","data-name":"password",onChange:this.onInputChange}))),S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"password_type"},"Client credentials location:"),w?S.a.createElement("code",null," ",this.state.passwordType," "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement("select",{id:"password_type","data-name":"passwordType",onChange:this.onInputChange},S.a.createElement("option",{value:"basic"},"Authorization header"),S.a.createElement("option",{value:"request-body"},"Request body"))))),(b===y||"implicit"===b||b===g||"password"===b)&&(!w||w&&this.state.clientId)&&S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"client_id"},"client_id:"),w?S.a.createElement("code",null," ****** "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement(m,{id:"client_id",type:"text",required:"password"===b,initialValue:this.state.clientId,"data-name":"clientId",onChange:this.onInputChange}))),(b===y||b===g||"password"===b)&&S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"client_secret"},"client_secret:"),w?S.a.createElement("code",null," ****** "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement(m,{id:"client_secret",initialValue:this.state.clientSecret,type:"text","data-name":"clientSecret",onChange:this.onInputChange}))),!w&&_&&_.size?S.a.createElement("div",{className:"scopes"},S.a.createElement("h2",null,"Scopes:"),_.map(function(t,n){return S.a.createElement(c,{key:n},S.a.createElement("div",{className:"checkbox"},S.a.createElement(u,{"data-value":n,id:"".concat(n,"-").concat(b,"-checkbox-").concat(e.state.name),disabled:w,type:"checkbox",onChange:e.onScopeChange}),S.a.createElement("label",{htmlFor:"".concat(n,"-").concat(b,"-checkbox-").concat(e.state.name)},S.a.createElement("span",{className:"item"}),S.a.createElement("div",{className:"text"},S.a.createElement("p",{className:"name"},n),S.a.createElement("p",{className:"description"},t)))))}).toArray()):null,x.valueSeq().map(function(e,t){return S.a.createElement(f,{error:e,key:t})}),S.a.createElement("div",{className:"auth-btn-wrapper"},E&&(w?S.a.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.logout},"Logout"):S.a.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.authorize},"Authorize")),S.a.createElement(p,{className:"btn modal-btn auth btn-done",onClick:this.close},"Close")))}}]),t}(S.a.Component),je=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onClick",function(){var e=n.props,t=e.specActions,r=e.path,o=e.method;t.clearResponse(r,o),t.clearRequest(r,o)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("button",{className:"btn btn-clear opblock-control__btn",onClick:this.onClick},"Clear")}}]),t}(E.Component),Pe=function(e){var t=e.headers;return S.a.createElement("div",null,S.a.createElement("h5",null,"Response headers"),S.a.createElement("pre",null,t))},Ie=function(e){var t=e.duration;return S.a.createElement("div",null,S.a.createElement("h5",null,"Request duration"),S.a.createElement("pre",null,t," ms"))},Me=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.response!==e.response||this.props.path!==e.path||this.props.method!==e.method||this.props.displayRequestDuration!==e.displayRequestDuration}},{key:"render",value:function(){var e=this.props,t=e.response,n=e.getComponent,r=e.getConfigs,o=e.displayRequestDuration,i=e.specSelectors,a=e.path,s=e.method,c=r().showMutatedRequest?i.mutatedRequestFor(a,s):i.requestFor(a,s),l=t.get("status"),p=c.get("url"),f=t.get("headers").toJS(),h=t.get("notDocumented"),d=t.get("error"),m=t.get("text"),v=t.get("duration"),g=u()(f),y=f["content-type"]||f["Content-Type"],b=n("curl"),_=n("responseBody"),w=g.map(function(e){return S.a.createElement("span",{className:"headerline",key:e}," ",e,": ",f[e]," ")}),x=0!==w.length;return S.a.createElement("div",null,c&&S.a.createElement(b,{request:c}),p&&S.a.createElement("div",null,S.a.createElement("h4",null,"Request URL"),S.a.createElement("div",{className:"request-url"},S.a.createElement("pre",null,p))),S.a.createElement("h4",null,"Server response"),S.a.createElement("table",{className:"responses-table live-responses-table"},S.a.createElement("thead",null,S.a.createElement("tr",{className:"responses-header"},S.a.createElement("td",{className:"col_header response-col_status"},"Code"),S.a.createElement("td",{className:"col_header response-col_description"},"Details"))),S.a.createElement("tbody",null,S.a.createElement("tr",{className:"response"},S.a.createElement("td",{className:"response-col_status"},l,h?S.a.createElement("div",{className:"response-undocumented"},S.a.createElement("i",null," Undocumented ")):null),S.a.createElement("td",{className:"response-col_description"},d?S.a.createElement("span",null,"".concat(t.get("name"),": ").concat(t.get("message"))):null,m?S.a.createElement(_,{content:m,contentType:y,url:p,headers:f,getComponent:n}):null,x?S.a.createElement(Pe,{headers:w}):null,o&&v?S.a.createElement(Ie,{duration:v}):null)))))}}]),t}(S.a.Component),Ne=n(93),Re=n.n(Ne),De=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"getDefinitionUrl",function(){var e=r.props.specSelectors;return new Re.a(e.url(),R.a.location).toString()});var o=(0,e.getConfigs)().validatorUrl;return r.state={url:r.getDefinitionUrl(),validatorUrl:void 0===o?"https://validator.swagger.io/validator":o},r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){var t=(0,e.getConfigs)().validatorUrl;this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===t?"https://validator.swagger.io/validator":t})}},{key:"render",value:function(){var e=(0,this.props.getConfigs)().spec,t=Object(D.D)(this.state.validatorUrl);return"object"===l()(e)&&u()(e).length?null:!this.state.url||!this.state.validatorUrl||this.state.url.indexOf("localhost")>=0||this.state.url.indexOf("127.0.0.1")>=0?null:S.a.createElement("span",{style:{float:"right"}},S.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"".concat(t,"/debug?url=").concat(encodeURIComponent(this.state.url))},S.a.createElement(Le,{src:"".concat(t,"?url=").concat(encodeURIComponent(this.state.url)),alt:"Online validator badge"})))}}]),t}(S.a.Component),Le=function(e){function t(e){var n;return _()(this,t),(n=oe()(this,ae()(t).call(this,e))).state={loaded:!1,error:!1},n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){var e=this,t=new Image;t.onload=function(){e.setState({loaded:!0})},t.onerror=function(){e.setState({error:!0})},t.src=this.props.src}},{key:"componentWillReceiveProps",value:function(e){var t=this;if(e.src!==this.props.src){var n=new Image;n.onload=function(){t.setState({loaded:!0})},n.onerror=function(){t.setState({error:!0})},n.src=e.src}}},{key:"render",value:function(){return this.state.error?S.a.createElement("img",{alt:"Error"}):this.state.loaded?S.a.createElement("img",{src:this.props.src,alt:this.props.alt}):null}}]),t}(S.a.Component),Ue=["get","put","post","delete","options","head","patch"],qe=Ue.concat(["trace"]),Fe=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=e.layoutSelectors,o=e.layoutActions,i=e.getConfigs,a=e.fn,s=t.taggedOperations(),u=n("OperationContainer",!0),c=n("OperationTag"),l=i().maxDisplayedTags,p=r.currentFilter();return p&&!0!==p&&(s=a.opsFilter(s,p)),l&&!isNaN(l)&&l>=0&&(s=s.slice(0,l)),S.a.createElement("div",null,s.map(function(e,a){var s=e.get("operations");return S.a.createElement(c,{key:"operation-"+a,tagObj:e,tag:a,layoutSelectors:r,layoutActions:o,getConfigs:i,getComponent:n},s.map(function(e){var n=e.get("path"),r=e.get("method"),o=O.a.List(["paths",n,r]);return-1===(t.isOAS3()?qe:Ue).indexOf(r)?null:S.a.createElement(u,{key:"".concat(n,"-").concat(r),specPath:o,op:e,path:n,method:r,tag:a})}).toArray())}).toArray(),s.size<1?S.a.createElement("h3",null," No operations defined in spec! "):null)}}]),t}(S.a.Component),ze=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.tagObj,n=e.tag,r=e.children,o=e.layoutSelectors,i=e.layoutActions,a=e.getConfigs,s=e.getComponent,u=a(),c=u.docExpansion,l=u.deepLinking,p=l&&"false"!==l,f=s("Collapse"),h=s("Markdown"),d=s("DeepLink"),m=s("Link"),v=t.getIn(["tagDetails","description"],null),g=t.getIn(["tagDetails","externalDocs","description"]),y=t.getIn(["tagDetails","externalDocs","url"]),b=["operations-tag",n],_=o.isShown(b,"full"===c||"list"===c);return S.a.createElement("div",{className:_?"opblock-tag-section is-open":"opblock-tag-section"},S.a.createElement("h4",{onClick:function(){return i.show(b,!_)},className:v?"opblock-tag":"opblock-tag no-desc",id:b.map(function(e){return Object(D.f)(e)}).join("-"),"data-tag":n,"data-is-open":_},S.a.createElement(d,{enabled:p,isShown:_,path:Object(D.c)(n),text:n}),v?S.a.createElement("small",null,S.a.createElement(h,{source:v})):S.a.createElement("small",null),S.a.createElement("div",null,g?S.a.createElement("small",null,g,y?": ":null,y?S.a.createElement(m,{href:Object(D.D)(y),onClick:function(e){return e.stopPropagation()},target:"_blank"},y):null):null),S.a.createElement("button",{className:"expand-operation",title:_?"Collapse operation":"Expand operation",onClick:function(){return i.show(b,!_)}},S.a.createElement("svg",{className:"arrow",width:"20",height:"20"},S.a.createElement("use",{href:_?"#large-arrow-down":"#large-arrow",xlinkHref:_?"#large-arrow-down":"#large-arrow"})))),S.a.createElement(f,{isOpened:_},r))}}]),t}(S.a.Component);v()(ze,"defaultProps",{tagObj:O.a.fromJS({}),tag:""});var Be=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specPath,r=e.response,o=e.request,i=e.toggleShown,a=e.onTryoutClick,s=e.onCancelClick,u=e.onExecute,c=e.fn,l=e.getComponent,p=e.getConfigs,f=e.specActions,h=e.specSelectors,d=e.authActions,m=e.authSelectors,v=e.oas3Actions,g=e.oas3Selectors,y=this.props.operation,b=y.toJS(),_=b.deprecated,w=b.isShown,x=b.path,E=b.method,C=b.op,k=b.tag,O=b.operationId,A=b.allowTryItOut,T=b.displayRequestDuration,j=b.tryItOutEnabled,P=b.executeInProgress,I=C.description,M=C.externalDocs,N=C.schemes,R=y.getIn(["op"]),L=R.get("responses"),U=Object(D.l)(R,["parameters"]),q=h.operationScheme(x,E),F=["operations",k,O],z=Object(D.k)(R),B=l("responses"),V=l("parameters"),H=l("execute"),W=l("clear"),J=l("Collapse"),Y=l("Markdown"),K=l("schemes"),G=l("OperationServers"),$=l("OperationExt"),Z=l("OperationSummary"),X=l("Link"),Q=p().showExtensions;if(L&&r&&r.size>0){var ee=!L.get(String(r.get("status")))&&!L.get("default");r=r.set("notDocumented",ee)}var te=[x,E];return S.a.createElement("div",{className:_?"opblock opblock-deprecated":w?"opblock opblock-".concat(E," is-open"):"opblock opblock-".concat(E),id:Object(D.f)(F.join("-"))},S.a.createElement(Z,{operationProps:y,toggleShown:i,getComponent:l,authActions:d,authSelectors:m,specPath:t}),S.a.createElement(J,{isOpened:w},S.a.createElement("div",{className:"opblock-body"},R&&R.size||null===R?null:S.a.createElement("img",{height:"32px",width:"32px",src:n(456),className:"opblock-loading-animation"}),_&&S.a.createElement("h4",{className:"opblock-title_normal"}," Warning: Deprecated"),I&&S.a.createElement("div",{className:"opblock-description-wrapper"},S.a.createElement("div",{className:"opblock-description"},S.a.createElement(Y,{source:I}))),M&&M.url?S.a.createElement("div",{className:"opblock-external-docs-wrapper"},S.a.createElement("h4",{className:"opblock-title_normal"},"Find more details"),S.a.createElement("div",{className:"opblock-external-docs"},S.a.createElement("span",{className:"opblock-external-docs__description"},S.a.createElement(Y,{source:M.description})),S.a.createElement(X,{target:"_blank",className:"opblock-external-docs__link",href:Object(D.D)(M.url)},M.url))):null,R&&R.size?S.a.createElement(V,{parameters:U,specPath:t.push("parameters"),operation:R,onChangeKey:te,onTryoutClick:a,onCancelClick:s,tryItOutEnabled:j,allowTryItOut:A,fn:c,getComponent:l,specActions:f,specSelectors:h,pathMethod:[x,E],getConfigs:p,oas3Actions:v,oas3Selectors:g}):null,j?S.a.createElement(G,{getComponent:l,path:x,method:E,operationServers:R.get("servers"),pathServers:h.paths().getIn([x,"servers"]),getSelectedServer:g.selectedServer,setSelectedServer:v.setSelectedServer,setServerVariableValue:v.setServerVariableValue,getServerVariable:g.serverVariableValue,getEffectiveServerValue:g.serverEffectiveValue}):null,j&&A&&N&&N.size?S.a.createElement("div",{className:"opblock-schemes"},S.a.createElement(K,{schemes:N,path:x,method:E,specActions:f,currentScheme:q})):null,S.a.createElement("div",{className:j&&r&&A?"btn-group":"execute-wrapper"},j&&A?S.a.createElement(H,{operation:R,specActions:f,specSelectors:h,path:x,method:E,onExecute:u}):null,j&&r&&A?S.a.createElement(W,{specActions:f,path:x,method:E}):null),P?S.a.createElement("div",{className:"loading-container"},S.a.createElement("div",{className:"loading"})):null,L?S.a.createElement(B,{responses:L,request:o,tryItOutResponse:r,getComponent:l,getConfigs:p,specSelectors:h,oas3Actions:v,oas3Selectors:g,specActions:f,produces:h.producesOptionsFor([x,E]),producesValue:h.currentProducesFor([x,E]),specPath:t.push("responses"),path:x,method:E,displayRequestDuration:T,fn:c}):null,Q&&z.size?S.a.createElement($,{extensions:z,getComponent:l}):null)))}}]),t}(E.PureComponent);v()(Be,"defaultProps",{operation:null,response:null,request:null,specPath:Object(k.List)(),summary:""});var Ve=n(65),He=n.n(Ve),We=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.toggleShown,n=e.getComponent,r=e.authActions,o=e.authSelectors,i=e.operationProps,a=e.specPath,s=i.toJS(),u=s.summary,c=s.isAuthorized,l=s.method,p=s.op,f=s.showSummary,h=s.operationId,d=s.originalOperationId,m=s.displayOperationId,v=p.summary,g=i.get("security"),y=n("authorizeOperationBtn"),b=n("OperationSummaryMethod"),_=n("OperationSummaryPath"),w=n("JumpToPath",!0);return S.a.createElement("div",{className:"opblock-summary opblock-summary-".concat(l),onClick:t},S.a.createElement(b,{method:l}),S.a.createElement(_,{getComponent:n,operationProps:i,specPath:a}),f?S.a.createElement("div",{className:"opblock-summary-description"},He()(v||u)):null,m&&(d||h)?S.a.createElement("span",{className:"opblock-summary-operation-id"},d||h):null,g&&g.count()?S.a.createElement(y,{isAuthorized:c,onClick:function(){var e=o.definitionsForRequirements(g);r.showDefinitions(e)}}):null,S.a.createElement(w,{path:a}))}}]),t}(E.PureComponent);v()(We,"defaultProps",{operationProps:null,specPath:Object(k.List)(),summary:""});var Je=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props.method;return S.a.createElement("span",{className:"opblock-summary-method"},e.toUpperCase())}}]),t}(E.PureComponent);v()(Je,"defaultProps",{operationProps:null});var Ye=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onCopyCapture",function(e){e.clipboardData.setData("text/plain",n.props.operationProps.get("path")),e.preventDefault()}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.operationProps.toJS(),r=n.deprecated,o=n.isShown,i=n.path,a=n.tag,s=n.operationId,u=n.isDeepLinkingEnabled,c=t("DeepLink");return S.a.createElement("span",{className:r?"opblock-summary-path__deprecated":"opblock-summary-path",onCopyCapture:this.onCopyCapture,"data-path":i},S.a.createElement(c,{enabled:u,isShown:o,path:Object(D.c)("".concat(a,"/").concat(s)),text:i.replace(/\//g,"/")}))}}]),t}(E.PureComponent),Ke=n(13),Ge=n.n(Ke),$e=function(e){var t=e.extensions,n=(0,e.getComponent)("OperationExtRow");return S.a.createElement("div",{className:"opblock-section"},S.a.createElement("div",{className:"opblock-section-header"},S.a.createElement("h4",null,"Extensions")),S.a.createElement("div",{className:"table-container"},S.a.createElement("table",null,S.a.createElement("thead",null,S.a.createElement("tr",null,S.a.createElement("td",{className:"col_header"},"Field"),S.a.createElement("td",{className:"col_header"},"Value"))),S.a.createElement("tbody",null,t.entrySeq().map(function(e){var t=Ge()(e,2),r=t[0],o=t[1];return S.a.createElement(n,{key:"".concat(r,"-").concat(o),xKey:r,xVal:o})})))))},Ze=function(e){var t=e.xKey,n=e.xVal,r=n?n.toJS?n.toJS():n:null;return S.a.createElement("tr",null,S.a.createElement("td",null,t),S.a.createElement("td",null,a()(r)))},Xe=n(476),Qe=n.n(Xe),et=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"initializeComponent",function(e){n.el=e}),v()(ue()(n),"downloadText",function(){Qe()(n.props.value,n.props.fileName||"response.txt")}),v()(ue()(n),"preventYScrollingBeyondElement",function(e){var t=e.target,n=e.nativeEvent.deltaY,r=t.scrollHeight,o=t.offsetHeight,i=t.scrollTop;r>o&&(0===i&&n<0||o+i>=r&&n>0)&&e.preventDefault()}),n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){Object(D.n)(this.el)}},{key:"componentDidUpdate",value:function(){Object(D.n)(this.el)}},{key:"render",value:function(){var e=this.props,t=e.value,n=e.className,r=e.downloadable;return n=n||"",S.a.createElement("div",{className:"highlight-code"},r?S.a.createElement("div",{className:"download-contents",onClick:this.downloadText},"Download"):null,S.a.createElement("pre",{ref:this.initializeComponent,onWheel:this.preventYScrollingBeyondElement,className:n+" microlight"},t))}}]),t}(E.Component),tt=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onChangeProducesWrapper",function(e){return n.props.specActions.changeProducesValue([n.props.path,n.props.method],e)}),v()(ue()(n),"onResponseContentTypeChange",function(e){var t=e.controlsAcceptHeader,r=e.value,o=n.props,i=o.oas3Actions,a=o.path,s=o.method;t&&i.setResponseContentType({value:r,path:a,method:s})}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,n=this.props,r=n.responses,o=n.tryItOutResponse,i=n.getComponent,a=n.getConfigs,s=n.specSelectors,u=n.fn,c=n.producesValue,l=n.displayRequestDuration,p=n.specPath,f=n.path,h=n.method,d=n.oas3Selectors,m=n.oas3Actions,v=Object(D.e)(r),g=i("contentType"),y=i("liveResponse"),b=i("response"),_=this.props.produces&&this.props.produces.size?this.props.produces:t.defaultProps.produces,w=s.isOAS3()?Object(D.i)(r):null;return S.a.createElement("div",{className:"responses-wrapper"},S.a.createElement("div",{className:"opblock-section-header"},S.a.createElement("h4",null,"Responses"),s.isOAS3()?null:S.a.createElement("label",null,S.a.createElement("span",null,"Response content type"),S.a.createElement(g,{value:c,onChange:this.onChangeProducesWrapper,contentTypes:_,className:"execute-content-type"}))),S.a.createElement("div",{className:"responses-inner"},o?S.a.createElement("div",null,S.a.createElement(y,{response:o,getComponent:i,getConfigs:a,specSelectors:s,path:this.props.path,method:this.props.method,displayRequestDuration:l}),S.a.createElement("h4",null,"Responses")):null,S.a.createElement("table",{className:"responses-table"},S.a.createElement("thead",null,S.a.createElement("tr",{className:"responses-header"},S.a.createElement("td",{className:"col_header response-col_status"},"Code"),S.a.createElement("td",{className:"col_header response-col_description"},"Description"),s.isOAS3()?S.a.createElement("td",{className:"col col_header response-col_links"},"Links"):null)),S.a.createElement("tbody",null,r.entrySeq().map(function(t){var n=Ge()(t,2),r=n[0],l=n[1],g=o&&o.get("status")==r?"response_current":"";return S.a.createElement(b,{key:r,path:f,method:h,specPath:p.push(r),isDefault:v===r,fn:u,className:g,code:r,response:l,specSelectors:s,controlsAcceptHeader:l===w,onContentTypeChange:e.onResponseContentTypeChange,contentType:c,getConfigs:a,activeExamplesKey:d.activeExamplesMember(f,h,"responses",r),oas3Actions:m,getComponent:i})}).toArray()))))}}]),t}(S.a.Component);v()(tt,"defaultProps",{tryItOutResponse:null,produces:Object(k.fromJS)(["application/json"]),displayRequestDuration:!1});var nt=n(56),rt=n.n(nt),ot=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"_onContentTypeChange",function(e){var t=r.props,n=t.onContentTypeChange,o=t.controlsAcceptHeader;r.setState({responseContentType:e}),n({value:e,controlsAcceptHeader:o})}),v()(ue()(r),"getTargetExamplesKey",function(){var e=r.props,t=e.response,n=e.contentType,o=e.activeExamplesKey,i=r.state.responseContentType||n,a=t.getIn(["content",i],Object(k.Map)({})).get("examples",null).keySeq().first();return o||a}),r.state={responseContentType:""},r}return le()(t,e),x()(t,[{key:"render",value:function(){var e,t,n,r=this.props,o=r.path,i=r.method,a=r.code,s=r.response,u=r.className,c=r.specPath,l=r.fn,p=r.getComponent,f=r.getConfigs,h=r.specSelectors,d=r.contentType,m=r.controlsAcceptHeader,v=r.oas3Actions,g=l.inferSchema,y=h.isOAS3(),b=s.get("headers"),_=s.get("links"),w=p("headers"),x=p("highlightCode"),E=p("modelExample"),C=p("Markdown"),O=p("operationLink"),A=p("contentType"),T=p("ExamplesSelect"),j=p("Example"),P=this.state.responseContentType||d,I=s.getIn(["content",P],Object(k.Map)({})),M=I.get("examples",null);if(y){var N=I.get("schema");t=N?g(N.toJS()):null,n=N?Object(k.List)(["content",this.state.responseContentType,"schema"]):c}else t=s.get("schema"),n=s.has("schema")?c.push("schema"):c;if(y){var R=I.get("schema",Object(k.Map)({}));if(M){var L=this.getTargetExamplesKey(),U=M.get(L,Object(k.Map)({}));e=Object(D.G)(U.get("value"))}else e=void 0!==I.get("example")?Object(D.G)(I.get("example")):Object(D.m)(R.toJS(),this.state.responseContentType,{includeReadOnly:!0})}else e=s.getIn(["examples",P])?s.getIn(["examples",P]):t?Object(D.m)(t.toJS(),P,{includeReadOnly:!0,includeWriteOnly:!0}):null;var q=function(e,t){return null!=e?S.a.createElement("div",null,S.a.createElement(t,{className:"example",value:Object(D.G)(e)})):null}(e,x);return S.a.createElement("tr",{className:"response "+(u||""),"data-code":a},S.a.createElement("td",{className:"response-col_status"},a),S.a.createElement("td",{className:"response-col_description"},S.a.createElement("div",{className:"response-col_description__inner"},S.a.createElement(C,{source:s.get("description")})),y&&s.get("content")?S.a.createElement("section",{className:"response-controls"},S.a.createElement("div",{className:rt()("response-control-media-type",{"response-control-media-type--accept-controller":m})},S.a.createElement("small",{className:"response-control-media-type__title"},"Media type"),S.a.createElement(A,{value:this.state.responseContentType,contentTypes:s.get("content")?s.get("content").keySeq():Object(k.Seq)(),onChange:this._onContentTypeChange}),m?S.a.createElement("small",{className:"response-control-media-type__accept-message"},"Controls ",S.a.createElement("code",null,"Accept")," header."):null),M?S.a.createElement("div",{className:"response-control-examples"},S.a.createElement("small",{className:"response-control-examples__title"},"Examples"),S.a.createElement(T,{examples:M,currentExampleKey:this.getTargetExamplesKey(),onSelect:function(e){return v.setActiveExamplesMember({name:e,pathMethod:[o,i],contextType:"responses",contextName:a})},showLabels:!1})):null):null,q||t?S.a.createElement(E,{specPath:n,getComponent:p,getConfigs:f,specSelectors:h,schema:Object(D.h)(t),example:q}):null,y&&M?S.a.createElement(j,{example:M.get(this.getTargetExamplesKey(),Object(k.Map)({})),getComponent:p,omitValue:!0}):null,b?S.a.createElement(w,{headers:b,getComponent:p}):null),y?S.a.createElement("td",{className:"response-col_links"},_?_.toSeq().map(function(e,t){return S.a.createElement(O,{key:t,name:t,link:e,getComponent:p})}):S.a.createElement("i",null,"No links")):null)}}]),t}(S.a.Component);v()(ot,"defaultProps",{response:Object(k.fromJS)({}),onContentTypeChange:function(){}});var it=n(477),at=n.n(it),st=n(478),ut=n.n(st),ct=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"state",{parsedContent:null}),v()(ue()(n),"updateParsedContent",function(e){var t=n.props.content;if(e!==t)if(t&&t instanceof Blob){var r=new FileReader;r.onload=function(){n.setState({parsedContent:r.result})},r.readAsText(t)}else n.setState({parsedContent:t.toString()})}),n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){this.updateParsedContent(null)}},{key:"componentDidUpdate",value:function(e){this.updateParsedContent(e.content)}},{key:"render",value:function(){var e,t,n=this.props,r=n.content,o=n.contentType,i=n.url,s=n.headers,u=void 0===s?{}:s,c=n.getComponent,l=this.state.parsedContent,p=c("highlightCode"),f="response_"+(new Date).getTime();if(i=i||"",/^application\/octet-stream/i.test(o)||u["Content-Disposition"]&&/attachment/i.test(u["Content-Disposition"])||u["content-disposition"]&&/attachment/i.test(u["content-disposition"])||u["Content-Description"]&&/File Transfer/i.test(u["Content-Description"])||u["content-description"]&&/File Transfer/i.test(u["content-description"]))if("Blob"in window){var h=o||"text/html",d=r instanceof Blob?r:new Blob([r],{type:h}),m=window.URL.createObjectURL(d),v=[h,i.substr(i.lastIndexOf("/")+1),m].join(":"),g=u["content-disposition"]||u["Content-Disposition"];if(void 0!==g){var y=Object(D.g)(g);null!==y&&(v=y)}t=R.a.navigator&&R.a.navigator.msSaveOrOpenBlob?S.a.createElement("div",null,S.a.createElement("a",{href:m,onClick:function(){return R.a.navigator.msSaveOrOpenBlob(d,v)}},"Download file")):S.a.createElement("div",null,S.a.createElement("a",{href:m,download:v},"Download file"))}else t=S.a.createElement("pre",null,"Download headers detected but your browser does not support downloading binary via XHR (Blob).");else if(/json/i.test(o)){try{e=a()(JSON.parse(r),null," ")}catch(t){e="can't parse JSON. Raw result:\n\n"+r}t=S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".json"),value:e})}else/xml/i.test(o)?(e=at()(r,{textNodesOnSameLine:!0,indentor:" "}),t=S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".xml"),value:e})):t="text/html"===ut()(o)||/text\/plain/.test(o)?S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".html"),value:r}):/^image\//i.test(o)?o.includes("svg")?S.a.createElement("div",null," ",r," "):S.a.createElement("img",{style:{maxWidth:"100%"},src:window.URL.createObjectURL(r)}):/^audio\//i.test(o)?S.a.createElement("pre",null,S.a.createElement("audio",{controls:!0},S.a.createElement("source",{src:i,type:o}))):"string"==typeof r?S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".txt"),value:r}):r.size>0?l?S.a.createElement("div",null,S.a.createElement("p",{className:"i"},"Unrecognized response type; displaying content as text."),S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".txt"),value:l})):S.a.createElement("p",{className:"i"},"Unrecognized response type; unable to display."):null;return t?S.a.createElement("div",null,S.a.createElement("h5",null,"Response body"),t):null}}]),t}(S.a.PureComponent),lt=n(12),pt=n.n(lt),ft=function(e){function t(e){var n;return _()(this,t),n=oe()(this,ae()(t).call(this,e)),v()(ue()(n),"onChange",function(e,t,r){var o=n.props;(0,o.specActions.changeParamByIdentity)(o.onChangeKey,e,t,r)}),v()(ue()(n),"onChangeConsumesWrapper",function(e){var t=n.props;(0,t.specActions.changeConsumesValue)(t.onChangeKey,e)}),v()(ue()(n),"toggleTab",function(e){return"parameters"===e?n.setState({parametersVisible:!0,callbackVisible:!1}):"callbacks"===e?n.setState({callbackVisible:!0,parametersVisible:!1}):void 0}),n.state={callbackVisible:!1,parametersVisible:!0},n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.onTryoutClick,r=t.onCancelClick,o=t.parameters,i=t.allowTryItOut,a=t.tryItOutEnabled,s=t.specPath,u=t.fn,c=t.getComponent,l=t.getConfigs,p=t.specSelectors,f=t.specActions,h=t.pathMethod,d=t.oas3Actions,m=t.oas3Selectors,v=t.operation,g=c("parameterRow"),y=c("TryItOutButton"),b=c("contentType"),_=c("Callbacks",!0),w=c("RequestBody",!0),x=a&&i,E=p.isOAS3(),C=v.get("requestBody");return S.a.createElement("div",{className:"opblock-section"},S.a.createElement("div",{className:"opblock-section-header"},E?S.a.createElement("div",{className:"tab-header"},S.a.createElement("div",{onClick:function(){return e.toggleTab("parameters")},className:"tab-item ".concat(this.state.parametersVisible&&"active")},S.a.createElement("h4",{className:"opblock-title"},S.a.createElement("span",null,"Parameters"))),v.get("callbacks")?S.a.createElement("div",{onClick:function(){return e.toggleTab("callbacks")},className:"tab-item ".concat(this.state.callbackVisible&&"active")},S.a.createElement("h4",{className:"opblock-title"},S.a.createElement("span",null,"Callbacks"))):null):S.a.createElement("div",{className:"tab-header"},S.a.createElement("h4",{className:"opblock-title"},"Parameters")),i?S.a.createElement(y,{enabled:a,onCancelClick:r,onTryoutClick:n}):null),this.state.parametersVisible?S.a.createElement("div",{className:"parameters-container"},o.count()?S.a.createElement("div",{className:"table-container"},S.a.createElement("table",{className:"parameters"},S.a.createElement("thead",null,S.a.createElement("tr",null,S.a.createElement("th",{className:"col_header parameters-col_name"},"Name"),S.a.createElement("th",{className:"col_header parameters-col_description"},"Description"))),S.a.createElement("tbody",null,function(e,t){return e.valueSeq().filter(O.a.Map.isMap).map(t)}(o,function(t,n){return S.a.createElement(g,{fn:u,specPath:s.push(n.toString()),getComponent:c,getConfigs:l,rawParam:t,param:p.parameterWithMetaByIdentity(h,t),key:"".concat(t.get("in"),".").concat(t.get("name")),onChange:e.onChange,onChangeConsumes:e.onChangeConsumesWrapper,specSelectors:p,specActions:f,oas3Actions:d,oas3Selectors:m,pathMethod:h,isExecute:x})}).toArray()))):S.a.createElement("div",{className:"opblock-description-wrapper"},S.a.createElement("p",null,"No parameters"))):null,this.state.callbackVisible?S.a.createElement("div",{className:"callbacks-container opblock-description-wrapper"},S.a.createElement(_,{callbacks:Object(k.Map)(v.get("callbacks")),specPath:s.slice(0,-1).push("callbacks")})):null,E&&C&&this.state.parametersVisible&&S.a.createElement("div",{className:"opblock-section opblock-section-request-body"},S.a.createElement("div",{className:"opblock-section-header"},S.a.createElement("h4",{className:"opblock-title parameter__name ".concat(C.get("required")&&"required")},"Request body"),S.a.createElement("label",null,S.a.createElement(b,{value:m.requestContentType.apply(m,pt()(h)),contentTypes:C.get("content",Object(k.List)()).keySeq(),onChange:function(e){d.setRequestContentType({value:e,pathMethod:h})},className:"body-param-content-type"}))),S.a.createElement("div",{className:"opblock-description-wrapper"},S.a.createElement(w,{specPath:s.slice(0,-1).push("requestBody"),requestBody:C,requestBodyValue:m.requestBodyValue.apply(m,pt()(h)),isExecute:x,activeExamplesKey:m.activeExamplesMember.apply(m,pt()(h).concat(["requestBody","requestBody"])),updateActiveExamplesKey:function(t){e.props.oas3Actions.setActiveExamplesMember({name:t,pathMethod:e.props.pathMethod,contextType:"requestBody",contextName:"requestBody"})},onChange:function(e,t){if(t){var n=m.requestBodyValue.apply(m,pt()(h)),r=k.Map.isMap(n)?n:Object(k.Map)();return d.setRequestBodyValue({pathMethod:h,value:r.setIn(t,e)})}d.setRequestBodyValue({value:e,pathMethod:h})},contentType:m.requestContentType.apply(m,pt()(h))}))))}}]),t}(E.Component);v()(ft,"defaultProps",{onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]});var ht=function(e){var t=e.xKey,n=e.xVal;return S.a.createElement("div",{className:"parameter__extension"},t,": ",String(n))},dt=function(e){var t=e.param,n=e.isIncluded,r=e.onChange,o=e.isDisabled;return t.get("allowEmptyValue")?S.a.createElement("div",{className:rt()("parameter__empty_value_toggle",{disabled:o})},S.a.createElement("input",{type:"checkbox",disabled:o,checked:!o&&n,onChange:function(e){r(e.target.checked)}}),"Send empty value"):null},mt=n(118),vt=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChangeWrapper",function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=r.props,o=n.onChange,i=n.rawParam;return o(i,""===e||e&&0===e.size?null:e,t)}),v()(ue()(r),"_onExampleSelect",function(e){r.props.oas3Actions.setActiveExamplesMember({name:e,pathMethod:r.props.pathMethod,contextType:"parameters",contextName:r.getParamKey()})}),v()(ue()(r),"onChangeIncludeEmpty",function(e){var t=r.props,n=t.specActions,o=t.param,i=t.pathMethod,a=o.get("name"),s=o.get("in");return n.updateEmptyParamInclusion(i,a,s,e)}),v()(ue()(r),"setDefaultValue",function(){var e=r.props,t=e.specSelectors,n=e.pathMethod,o=e.rawParam,i=e.oas3Selectors,a=t.parameterWithMetaByIdentity(n,o)||Object(k.Map)(),s=Object(mt.a)(a,{isOAS3:t.isOAS3()}),u=a.get("content",Object(k.Map)()).keySeq().first(),c=Object(D.m)(s.toJS(),u,{includeWriteOnly:!0});if(a&&void 0===a.get("value")&&"body"!==a.get("in")){var l;if(t.isSwagger2())l=a.get("x-example")||a.getIn(["schema","example"])||s.getIn(["default"]);else if(t.isOAS3()){var p=i.activeExamplesMember.apply(i,pt()(n).concat(["parameters",r.getParamKey()]));l=a.getIn(["examples",p,"value"])||a.getIn(["content",u,"example"])||a.get("example")||s.get("example")||s.get("default")}void 0===l||k.List.isList(l)||(l=Object(D.G)(l)),void 0!==l?r.onChangeWrapper(l):"object"===s.get("type")&&c&&!a.get("examples")&&r.onChangeWrapper(k.List.isList(c)?c:Object(D.G)(c))}}),r.setDefaultValue(),r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){var t,n=e.specSelectors,r=e.pathMethod,o=e.rawParam,i=n.isOAS3(),a=n.parameterWithMetaByIdentity(r,o)||new k.Map;(a=a.isEmpty()?o:a,i)?t=Object(mt.a)(a,{isOAS3:i}).get("enum"):t=a?a.get("enum"):void 0;var s,u=a?a.get("value"):void 0;void 0!==u?s=u:o.get("required")&&t&&t.size&&(s=t.first()),void 0!==s&&s!==u&&this.onChangeWrapper(Object(D.v)(s)),this.setDefaultValue()}},{key:"getParamKey",value:function(){var e=this.props.param;return e?"".concat(e.get("name"),"-").concat(e.get("in")):null}},{key:"render",value:function(){var e=this.props,t=e.param,n=e.rawParam,r=e.getComponent,o=e.getConfigs,i=e.isExecute,a=e.fn,s=e.onChangeConsumes,u=e.specSelectors,c=e.pathMethod,l=e.specPath,p=e.oas3Selectors,f=u.isOAS3(),h=o(),d=h.showExtensions,m=h.showCommonExtensions;if(t||(t=n),!n)return null;var v,g,y,b=r("JsonSchemaForm"),_=r("ParamBody"),w=t.get("in"),x="body"!==w?null:S.a.createElement(_,{getComponent:r,fn:a,param:t,consumes:u.consumesOptionsFor(c),consumesValue:u.contentTypeValues(c).get("requestContentType"),onChange:this.onChangeWrapper,onChangeConsumes:s,isExecute:i,specSelectors:u,pathMethod:c}),E=r("modelExample"),C=r("Markdown"),O=r("ParameterExt"),A=r("ParameterIncludeEmpty"),T=r("ExamplesSelectValueRetainer"),j=r("Example"),P=u.parameterWithMetaByIdentity(c,n)||Object(k.Map)(),I=t.get("format"),M=Object(mt.a)(t,{isOAS3:f}),N=M.get("type"),L="formData"===w,U="FormData"in R.a,q=t.get("required"),F=M.getIn(["items","type"]),z=P?P.get("value"):"",B=m?Object(D.j)(t):null,V=d?Object(D.k)(t):null,H=!1;return void 0!==t&&(v=M.get("items")),void 0!==v?(g=v.get("enum"),y=v.get("default")):g=M.get("enum"),void 0!==g&&g.size>0&&(H=!0),void 0!==t&&(y=M.get("default"),void 0===t.get("example")&&t.get("x-example")),S.a.createElement("tr",{"data-param-name":t.get("name"),"data-param-in":t.get("in")},S.a.createElement("td",{className:"parameters-col_name"},S.a.createElement("div",{className:q?"parameter__name required":"parameter__name"},t.get("name"),q?S.a.createElement("span",{style:{color:"red"}}," *"):null),S.a.createElement("div",{className:"parameter__type"},N,F&&"[".concat(F,"]"),I&&S.a.createElement("span",{className:"prop-format"},"($",I,")")),S.a.createElement("div",{className:"parameter__deprecated"},f&&t.get("deprecated")?"deprecated":null),S.a.createElement("div",{className:"parameter__in"},"(",t.get("in"),")"),m&&B.size?B.map(function(e,t){return S.a.createElement(O,{key:"".concat(t,"-").concat(e),xKey:t,xVal:e})}):null,d&&V.size?V.map(function(e,t){return S.a.createElement(O,{key:"".concat(t,"-").concat(e),xKey:t,xVal:e})}):null),S.a.createElement("td",{className:"parameters-col_description"},t.get("description")?S.a.createElement(C,{source:t.get("description")}):null,!x&&i||!H?null:S.a.createElement(C,{className:"parameter__enum",source:"<i>Available values</i> : "+g.map(function(e){return e}).toArray().join(", ")}),!x&&i||void 0===y?null:S.a.createElement(C,{className:"parameter__default",source:"<i>Default value</i> : "+y}),L&&!U&&S.a.createElement("div",null,"Error: your browser does not support FormData"),f&&t.get("examples")?S.a.createElement("section",{className:"parameter-controls"},S.a.createElement(T,{examples:t.get("examples"),onSelect:this._onExampleSelect,updateValue:this.onChangeWrapper,getComponent:r,defaultToFirstExample:!0,currentKey:p.activeExamplesMember.apply(p,pt()(c).concat(["parameters",this.getParamKey()])),currentUserInputValue:z})):null,x?null:S.a.createElement(b,{fn:a,getComponent:r,value:z,required:q,disabled:!i,description:t.get("description")?"".concat(t.get("name")," - ").concat(t.get("description")):"".concat(t.get("name")),onChange:this.onChangeWrapper,errors:P.get("errors"),schema:M}),x&&M?S.a.createElement(E,{getComponent:r,specPath:l.push("schema"),getConfigs:o,isExecute:i,specSelectors:u,schema:M,example:x}):null,!x&&i?S.a.createElement(A,{onChange:this.onChangeIncludeEmpty,isIncluded:u.parameterInclusionSettingFor(c,t.get("name"),t.get("in")),isDisabled:z&&0!==z.size,param:t}):null,f&&t.get("examples")?S.a.createElement(j,{example:t.getIn(["examples",p.activeExamplesMember.apply(p,pt()(c).concat(["parameters",this.getParamKey()]))]),getComponent:r}):null))}}]),t}(E.Component),gt=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onClick",function(){var e=n.props,t=e.specSelectors,r=e.specActions,o=e.operation,i=e.path,a=e.method;r.validateParams([i,a]),t.validateBeforeExecute([i,a])&&(n.props.onExecute&&n.props.onExecute(),r.execute({operation:o,path:i,method:a}))}),v()(ue()(n),"onChangeProducesWrapper",function(e){return n.props.specActions.changeProducesValue([n.props.path,n.props.method],e)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("button",{className:"btn execute opblock-control__btn",onClick:this.onClick},"Execute")}}]),t}(E.Component),yt={color:"#999",fontStyle:"italic"},bt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.headers,n=e.getComponent,r=n("Property"),o=n("Markdown");return t&&t.size?S.a.createElement("div",{className:"headers-wrapper"},S.a.createElement("h4",{className:"headers__title"},"Headers:"),S.a.createElement("table",{className:"headers"},S.a.createElement("thead",null,S.a.createElement("tr",{className:"header-row"},S.a.createElement("th",{className:"header-col"},"Name"),S.a.createElement("th",{className:"header-col"},"Description"),S.a.createElement("th",{className:"header-col"},"Type"))),S.a.createElement("tbody",null,t.entrySeq().map(function(e){var t=Ge()(e,2),n=t[0],i=t[1];if(!O.a.Map.isMap(i))return null;var a=i.get("description"),s=i.getIn(["schema"])?i.getIn(["schema","type"]):i.getIn(["type"]),u=i.getIn(["schema","example"]);return S.a.createElement("tr",{key:n},S.a.createElement("td",{className:"header-col"},n),S.a.createElement("td",{className:"header-col"},a?S.a.createElement(o,{source:a}):null),S.a.createElement("td",{className:"header-col"},s," ",u?S.a.createElement(r,{propKey:"Example",propVal:u,propStyle:yt}):null))}).toArray()))):null}}]),t}(S.a.Component),_t=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.editorActions,n=e.errSelectors,r=e.layoutSelectors,o=e.layoutActions,i=(0,e.getComponent)("Collapse");if(t&&t.jumpToLine)var a=t.jumpToLine;var s=n.allErrors().filter(function(e){return"thrown"===e.get("type")||"error"===e.get("level")});if(!s||s.count()<1)return null;var u=r.isShown(["errorPane"],!0),c=s.sortBy(function(e){return e.get("line")});return S.a.createElement("pre",{className:"errors-wrapper"},S.a.createElement("hgroup",{className:"error"},S.a.createElement("h4",{className:"errors__title"},"Errors"),S.a.createElement("button",{className:"btn errors__clear-btn",onClick:function(){return o.show(["errorPane"],!u)}},u?"Hide":"Show")),S.a.createElement(i,{isOpened:u,animated:!0},S.a.createElement("div",{className:"errors"},c.map(function(e,t){var n=e.get("type");return"thrown"===n||"auth"===n?S.a.createElement(wt,{key:t,error:e.get("error")||e,jumpToLine:a}):"spec"===n?S.a.createElement(xt,{key:t,error:e,jumpToLine:a}):void 0}))))}}]),t}(S.a.Component),wt=function(e){var t=e.error,n=e.jumpToLine;if(!t)return null;var r=t.get("line");return S.a.createElement("div",{className:"error-wrapper"},t?S.a.createElement("div",null,S.a.createElement("h4",null,t.get("source")&&t.get("level")?Et(t.get("source"))+" "+t.get("level"):"",t.get("path")?S.a.createElement("small",null," at ",t.get("path")):null),S.a.createElement("span",{style:{whiteSpace:"pre-line",maxWidth:"100%"}},t.get("message")),S.a.createElement("div",{style:{"text-decoration":"underline",cursor:"pointer"}},r&&n?S.a.createElement("a",{onClick:n.bind(null,r)},"Jump to line ",r):null)):null)},xt=function(e){var t=e.error,n=e.jumpToLine,r=null;return t.get("path")?r=k.List.isList(t.get("path"))?S.a.createElement("small",null,"at ",t.get("path").join(".")):S.a.createElement("small",null,"at ",t.get("path")):t.get("line")&&!n&&(r=S.a.createElement("small",null,"on line ",t.get("line"))),S.a.createElement("div",{className:"error-wrapper"},t?S.a.createElement("div",null,S.a.createElement("h4",null,Et(t.get("source"))+" "+t.get("level")," ",r),S.a.createElement("span",{style:{whiteSpace:"pre-line"}},t.get("message")),S.a.createElement("div",{style:{"text-decoration":"underline",cursor:"pointer"}},n?S.a.createElement("a",{onClick:n.bind(null,t.get("line"))},"Jump to line ",t.get("line")):null)):null)};function Et(e){return(e||"").split(" ").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(" ")}wt.defaultProps={jumpToLine:null};var St=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onChangeWrapper",function(e){return n.props.onChange(e.target.value)}),n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){this.props.contentTypes&&this.props.onChange(this.props.contentTypes.first())}},{key:"componentWillReceiveProps",value:function(e){e.contentTypes&&e.contentTypes.size&&(e.contentTypes.includes(e.value)||e.onChange(e.contentTypes.first()))}},{key:"render",value:function(){var e=this.props,t=e.contentTypes,n=e.className,r=e.value;return t&&t.size?S.a.createElement("div",{className:"content-type-wrapper "+(n||"")},S.a.createElement("select",{className:"content-type",value:r||"",onChange:this.onChangeWrapper},t.map(function(e){return S.a.createElement("option",{key:e,value:e},e)}).toArray())):null}}]),t}(S.a.Component);v()(St,"defaultProps",{onChange:function(){},value:null,contentTypes:Object(k.fromJS)(["application/json"])});var Ct=n(20),kt=n.n(Ct),Ot=n(38),At=n.n(Ot);function Tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return!!e}).join(" ").trim()}var jt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.fullscreen,n=e.full,r=At()(e,["fullscreen","full"]);if(t)return S.a.createElement("section",r);var o="swagger-container"+(n?"-full":"");return S.a.createElement("section",kt()({},r,{className:Tt(r.className,o)}))}}]),t}(S.a.Component),Pt={mobile:"",tablet:"-tablet",desktop:"-desktop",large:"-hd"},It=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.hide,n=e.keepContents,r=(e.mobile,e.tablet,e.desktop,e.large,At()(e,["hide","keepContents","mobile","tablet","desktop","large"]));if(t&&!n)return S.a.createElement("span",null);var o=[];for(var i in Pt)if(Pt.hasOwnProperty(i)){var a=Pt[i];if(i in this.props){var s=this.props[i];if(s<1){o.push("none"+a);continue}o.push("block"+a),o.push("col-"+s+a)}}var u=Tt.apply(void 0,[r.className].concat(o));return S.a.createElement("section",kt()({},r,{style:{display:t?"none":null},className:u}))}}]),t}(S.a.Component),Mt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("div",kt()({},this.props,{className:Tt(this.props.className,"wrapper")}))}}]),t}(S.a.Component),Nt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("button",kt()({},this.props,{className:Tt(this.props.className,"button")}))}}]),t}(S.a.Component);v()(Nt,"defaultProps",{className:""});var Rt=function(e){return S.a.createElement("textarea",e)},Dt=function(e){return S.a.createElement("input",e)},Lt=function(e){function t(e,n){var r,o;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChange",function(e){var t,n=r.props,o=n.onChange,i=n.multiple,a=[].slice.call(e.target.options);t=i?a.filter(function(e){return e.selected}).map(function(e){return e.value}):e.target.value,r.setState({value:t}),o&&o(t)}),o=e.value?e.value:e.multiple?[""]:"",r.state={value:o},r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.props.value&&this.setState({value:e.value})}},{key:"render",value:function(){var e,t,n=this.props,r=n.allowedValues,o=n.multiple,i=n.allowEmptyValue,a=n.disabled,s=(null===(e=this.state.value)||void 0===e?void 0:null===(t=e.toJS)||void 0===t?void 0:t.call(e))||this.state.value;return S.a.createElement("select",{className:this.props.className,multiple:o,value:s,onChange:this.onChange,disabled:a},i?S.a.createElement("option",{value:""},"--"):null,r.map(function(e,t){return S.a.createElement("option",{key:t,value:String(e)},String(e))}))}}]),t}(S.a.Component);v()(Lt,"defaultProps",{multiple:!1,allowEmptyValue:!0});var Ut=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("a",kt()({},this.props,{rel:"noopener noreferrer",className:Tt(this.props.className,"link")}))}}]),t}(S.a.Component),qt=function(e){var t=e.children;return S.a.createElement("div",{style:{height:"auto",border:"none",margin:0,padding:0}}," ",t," ")},Ft=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"renderNotAnimated",value:function(){return this.props.isOpened?S.a.createElement(qt,null,this.props.children):S.a.createElement("noscript",null)}},{key:"render",value:function(){var e=this.props,t=e.animated,n=e.isOpened,r=e.children;return t?(r=n?r:null,S.a.createElement(qt,null,r)):this.renderNotAnimated()}}]),t}(S.a.Component);v()(Ft,"defaultProps",{isOpened:!1,animated:!1});var zt=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o)))).setTagShown=n._setTagShown.bind(ue()(n)),n}return le()(t,e),x()(t,[{key:"_setTagShown",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"showOp",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.layoutSelectors,r=e.layoutActions,o=e.getComponent,i=t.taggedOperations(),a=o("Collapse");return S.a.createElement("div",null,S.a.createElement("h4",{className:"overview-title"},"Overview"),i.map(function(e,t){var o=e.get("operations"),i=["overview-tags",t],s=n.isShown(i,!0);return S.a.createElement("div",{key:"overview-"+t},S.a.createElement("h4",{onClick:function(){return r.show(i,!s)},className:"link overview-tag"}," ",s?"-":"+",t),S.a.createElement(a,{isOpened:s,animated:!0},o.map(function(e){var t=e.toObject(),o=t.path,i=t.method,a=t.id,s=a,u=n.isShown(["operations",s]);return S.a.createElement(Bt,{key:a,path:o,method:i,id:o+"-"+i,shown:u,showOpId:s,showOpIdPrefix:"operations",href:"#operation-".concat(s),onClick:r.show})}).toArray()))}).toArray(),i.size<1&&S.a.createElement("h3",null," No operations defined in spec! "))}}]),t}(S.a.Component),Bt=function(e){function t(e){var n;return _()(this,t),(n=oe()(this,ae()(t).call(this,e))).onClick=n._onClick.bind(ue()(n)),n}return le()(t,e),x()(t,[{key:"_onClick",value:function(){var e=this.props,t=e.showOpId,n=e.showOpIdPrefix;(0,e.onClick)([n,t],!e.shown)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.method,r=e.shown,o=e.href;return S.a.createElement(Ut,{href:o,style:{fontWeight:r?"bold":"normal"},onClick:this.onClick,className:"block opblock-link"},S.a.createElement("div",null,S.a.createElement("small",{className:"bold-label-".concat(n)},n.toUpperCase()),S.a.createElement("span",{className:"bold-label"},t)))}}]),t}(S.a.Component),Vt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){this.props.initialValue&&(this.inputRef.value=this.props.initialValue)}},{key:"render",value:function(){var e=this,t=this.props,n=(t.value,t.defaultValue,At()(t,["value","defaultValue"]));return S.a.createElement("input",kt()({},n,{ref:function(t){return e.inputRef=t}}))}}]),t}(S.a.Component),Ht=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.host,n=e.basePath;return S.a.createElement("pre",{className:"base-url"},"[ Base URL: ",t,n," ]")}}]),t}(S.a.Component),Wt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.data,n=e.getComponent,r=t.get("name")||"the developer",o=t.get("url"),i=t.get("email"),a=n("Link");return S.a.createElement("div",{className:"info__contact"},o&&S.a.createElement("div",null,S.a.createElement(a,{href:Object(D.D)(o),target:"_blank"},r," - Website")),i&&S.a.createElement(a,{href:Object(D.D)("mailto:".concat(i))},o?"Send email to ".concat(r):"Contact ".concat(r)))}}]),t}(S.a.Component),Jt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.license,n=(0,e.getComponent)("Link"),r=t.get("name")||"License",o=t.get("url");return S.a.createElement("div",{className:"info__license"},o?S.a.createElement(n,{target:"_blank",href:Object(D.D)(o)},r):S.a.createElement("span",null,r))}}]),t}(S.a.Component),Yt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.url,n=(0,e.getComponent)("Link");return S.a.createElement(n,{target:"_blank",href:Object(D.D)(t)},S.a.createElement("span",{className:"url"}," ",t," "))}}]),t}(S.a.PureComponent),Kt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.info,n=e.url,r=e.host,o=e.basePath,i=e.getComponent,a=e.externalDocs,s=t.get("version"),u=t.get("description"),c=t.get("title"),l=t.get("termsOfService"),p=t.get("contact"),f=t.get("license"),h=(a||Object(k.fromJS)({})).toJS(),d=h.url,m=h.description,v=i("Markdown"),g=i("Link"),y=i("VersionStamp"),b=i("InfoUrl"),_=i("InfoBasePath");return S.a.createElement("div",{className:"info"},S.a.createElement("hgroup",{className:"main"},S.a.createElement("h2",{className:"title"},c,s&&S.a.createElement(y,{version:s})),r||o?S.a.createElement(_,{host:r,basePath:o}):null,n&&S.a.createElement(b,{getComponent:i,url:n})),S.a.createElement("div",{className:"description"},S.a.createElement(v,{source:u})),l&&S.a.createElement("div",{className:"info__tos"},S.a.createElement(g,{target:"_blank",href:Object(D.D)(l)},"Terms of service")),p&&p.size?S.a.createElement(Wt,{getComponent:i,data:p}):null,f&&f.size?S.a.createElement(Jt,{getComponent:i,license:f}):null,d?S.a.createElement(g,{className:"info__extdocs",target:"_blank",href:Object(D.D)(d)},m||d):null)}}]),t}(S.a.Component),Gt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=t.info(),o=t.url(),i=t.basePath(),a=t.host(),s=t.externalDocs(),u=n("info");return S.a.createElement("div",null,r&&r.count()?S.a.createElement(u,{info:r,url:o,host:a,basePath:i,externalDocs:s,getComponent:n}):null)}}]),t}(S.a.Component),$t=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return null}}]),t}(S.a.Component),Zt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("div",{className:"footer"})}}]),t}(S.a.Component),Xt=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onFilterChange",function(e){var t=e.target.value;n.props.layoutActions.updateFilter(t)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.layoutSelectors,r=(0,e.getComponent)("Col"),o="loading"===t.loadingStatus(),i="failed"===t.loadingStatus(),a=n.currentFilter(),s={};return i&&(s.color="red"),o&&(s.color="#aaa"),S.a.createElement("div",null,null===a||!1===a?null:S.a.createElement("div",{className:"filter-container"},S.a.createElement(r,{className:"filter wrapper",mobile:12},S.a.createElement("input",{className:"operation-filter-input",placeholder:"Filter by tag",type:"text",onChange:this.onFilterChange,value:!0===a||"true"===a?"":a,disabled:o,style:s}))))}}]),t}(S.a.Component),Qt=Function.prototype,en=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"updateValues",function(e){var t=e.param,n=e.isExecute,o=e.consumesValue,i=void 0===o?"":o,a=/xml/i.test(i),s=/json/i.test(i),u=a?t.get("value_xml"):t.get("value");if(void 0!==u){var c=!u&&s?"{}":u;r.setState({value:c}),r.onChange(c,{isXml:a,isEditBox:n})}else a?r.onChange(r.sample("xml"),{isXml:a,isEditBox:n}):r.onChange(r.sample(),{isEditBox:n})}),v()(ue()(r),"sample",function(e){var t=r.props,n=t.param,o=(0,t.fn.inferSchema)(n.toJS());return Object(D.m)(o,e,{includeWriteOnly:!0})}),v()(ue()(r),"onChange",function(e,t){var n=t.isEditBox,o=t.isXml;r.setState({value:e,isEditBox:n}),r._onChange(e,o)}),v()(ue()(r),"_onChange",function(e,t){(r.props.onChange||Qt)(e,t)}),v()(ue()(r),"handleOnChange",function(e){var t=r.props.consumesValue,n=/xml/i.test(t),o=e.target.value;r.onChange(o,{isXml:n})}),v()(ue()(r),"toggleIsEditBox",function(){return r.setState(function(e){return{isEditBox:!e.isEditBox}})}),r.state={isEditBox:!1,value:""},r}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){this.updateValues.call(this,this.props)}},{key:"componentWillReceiveProps",value:function(e){this.updateValues.call(this,e)}},{key:"render",value:function(){var e=this.props,n=e.onChangeConsumes,r=e.param,o=e.isExecute,i=e.specSelectors,a=e.pathMethod,s=e.getComponent,u=s("Button"),c=s("TextArea"),l=s("highlightCode"),p=s("contentType"),f=(i?i.parameterWithMetaByIdentity(a,r):r).get("errors",Object(k.List)()),h=i.contentTypeValues(a).get("requestContentType"),d=this.props.consumes&&this.props.consumes.size?this.props.consumes:t.defaultProp.consumes,m=this.state,v=m.value,g=m.isEditBox;return S.a.createElement("div",{className:"body-param","data-param-name":r.get("name"),"data-param-in":r.get("in")},g&&o?S.a.createElement(c,{className:"body-param__text"+(f.count()?" invalid":""),value:v,onChange:this.handleOnChange}):v&&S.a.createElement(l,{className:"body-param__example",value:v}),S.a.createElement("div",{className:"body-param-options"},o?S.a.createElement("div",{className:"body-param-edit"},S.a.createElement(u,{className:g?"btn cancel body-param__example-edit":"btn edit body-param__example-edit",onClick:this.toggleIsEditBox},g?"Cancel":"Edit")):null,S.a.createElement("label",{htmlFor:""},S.a.createElement("span",null,"Parameter content type"),S.a.createElement(p,{value:h,contentTypes:d,onChange:n,className:"body-param-content-type"}))))}}]),t}(E.PureComponent);v()(en,"defaultProp",{consumes:Object(k.fromJS)(["application/json"]),param:Object(k.fromJS)({}),onChange:Qt,onChangeConsumes:Qt});var tn=n(90),nn=n.n(tn);var rn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"handleFocus",value:function(e){e.target.select(),document.execCommand("copy")}},{key:"render",value:function(){var e=function(e){var t=[],n="",r=e.get("headers");if(t.push("curl"),t.push("-X",e.get("method")),t.push('"'.concat(e.get("url"),'"')),r&&r.size){var o=!0,i=!1,s=void 0;try{for(var u,c=nn()(e.get("headers").entries());!(o=(u=c.next()).done);o=!0){var l=u.value,p=Ge()(l,2),f=p[0];n=_=p[1],t.push("-H "),t.push('"'.concat(f,": ").concat(_,'"'))}}catch(e){i=!0,s=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw s}}}if(e.get("body"))if("multipart/form-data"===n&&"POST"===e.get("method")){var h=!0,d=!1,m=void 0;try{for(var v,g=nn()(e.get("body").entrySeq());!(h=(v=g.next()).done);h=!0){var y=Ge()(v.value,2),b=y[0],_=y[1];t.push("-F"),_ instanceof R.a.File?t.push('"'.concat(b,"=@").concat(_.name).concat(_.type?";type=".concat(_.type):"",'"')):t.push('"'.concat(b,"=").concat(_,'"'))}}catch(e){d=!0,m=e}finally{try{h||null==g.return||g.return()}finally{if(d)throw m}}}else t.push("-d"),t.push(a()(e.get("body")).replace(/\\n/g,""));return t.join(" ")}(this.props.request);return S.a.createElement("div",null,S.a.createElement("h4",null,"Curl"),S.a.createElement("div",{className:"copy-paste"},S.a.createElement("textarea",{onFocus:this.handleFocus,readOnly:!0,className:"curl",style:{whiteSpace:"normal"},value:e})))}}]),t}(S.a.Component),on=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onChange",function(e){n.setScheme(e.target.value)}),v()(ue()(n),"setScheme",function(e){var t=n.props,r=t.path,o=t.method;t.specActions.setScheme(e,r,o)}),n}return le()(t,e),x()(t,[{key:"componentWillMount",value:function(){var e=this.props.schemes;this.setScheme(e.first())}},{key:"componentWillReceiveProps",value:function(e){this.props.currentScheme&&e.schemes.includes(this.props.currentScheme)||this.setScheme(e.schemes.first())}},{key:"render",value:function(){var e=this.props,t=e.schemes,n=e.currentScheme;return S.a.createElement("label",{htmlFor:"schemes"},S.a.createElement("span",{className:"schemes-title"},"Schemes"),S.a.createElement("select",{onChange:this.onChange,value:n},t.valueSeq().map(function(e){return S.a.createElement("option",{value:e,key:e},e)}).toArray()))}}]),t}(S.a.Component),an=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specActions,n=e.specSelectors,r=e.getComponent,o=n.operationScheme(),i=n.schemes(),a=r("schemes");return i&&i.size?S.a.createElement(a,{currentScheme:o,schemes:i,specActions:t}):null}}]),t}(S.a.Component),sn=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"toggleCollapsed",function(){r.props.onToggle&&r.props.onToggle(r.props.modelName,!r.state.expanded),r.setState({expanded:!r.state.expanded})});var o=r.props,i=o.expanded,a=o.collapsedContent;return r.state={expanded:i,collapsedContent:a||t.defaultProps.collapsedContent},r}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.hideSelfOnExpand,n=e.expanded,r=e.modelName;t&&n&&this.props.onToggle(r,n)}},{key:"componentWillReceiveProps",value:function(e){this.props.expanded!==e.expanded&&this.setState({expanded:e.expanded})}},{key:"render",value:function(){var e=this.props,t=e.title,n=e.classes;return this.state.expanded&&this.props.hideSelfOnExpand?S.a.createElement("span",{className:n||""},this.props.children):S.a.createElement("span",{className:n||""},t&&S.a.createElement("span",{onClick:this.toggleCollapsed,style:{cursor:"pointer"}},t),S.a.createElement("span",{onClick:this.toggleCollapsed,style:{cursor:"pointer"}},S.a.createElement("span",{className:"model-toggle"+(this.state.expanded?"":" collapsed")})),this.state.expanded?this.props.children:this.state.collapsedContent)}}]),t}(E.Component);v()(sn,"defaultProps",{collapsedContent:"{...}",expanded:!1,title:null,onToggle:function(){},hideSelfOnExpand:!1});var un=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"activeTab",function(e){var t=e.target.dataset.name;r.setState({activeTab:t})});var o=r.props,i=o.getConfigs,a=o.isExecute,s=i().defaultModelRendering,u=s;return"example"!==s&&"model"!==s&&(u="example"),a&&(u="example"),r.state={activeTab:u},r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){e.isExecute&&!this.props.isExecute&&this.props.example&&this.setState({activeTab:"example"})}},{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.specSelectors,r=e.schema,o=e.example,i=e.isExecute,a=e.getConfigs,s=e.specPath,u=a().defaultModelExpandDepth,c=t("ModelWrapper"),l=t("highlightCode"),p=n.isOAS3();return S.a.createElement("div",{className:"model-example"},S.a.createElement("ul",{className:"tab"},S.a.createElement("li",{className:"tabitem"+("example"===this.state.activeTab?" active":"")},S.a.createElement("a",{className:"tablinks","data-name":"example",onClick:this.activeTab},i?"Edit Value":"Example Value")),r?S.a.createElement("li",{className:"tabitem"+("model"===this.state.activeTab?" active":"")},S.a.createElement("a",{className:"tablinks"+(i?" inactive":""),"data-name":"model",onClick:this.activeTab},p?"Schema":"Model")):null),S.a.createElement("div",null,"example"===this.state.activeTab?o||S.a.createElement(l,{value:"(no example available)"}):null,"model"===this.state.activeTab&&S.a.createElement(c,{schema:r,getComponent:t,getConfigs:a,specSelectors:n,expandDepth:u,specPath:s})))}}]),t}(S.a.Component),cn=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onToggle",function(e,t){n.props.layoutActions&&n.props.layoutActions.show(["models",e],t)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e,t=this.props,n=t.getComponent,r=t.getConfigs,o=n("Model");return this.props.layoutSelectors&&(e=this.props.layoutSelectors.isShown(["models",this.props.name])),S.a.createElement("div",{className:"model-box"},S.a.createElement(o,kt()({},this.props,{getConfigs:r,expanded:e,depth:1,onToggle:this.onToggle,expandDepth:this.props.expandDepth||0})))}}]),t}(E.Component),ln=n(191),pn=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"getSchemaBasePath",function(){return n.props.specSelectors.isOAS3()?["components","schemas"]:["definitions"]}),v()(ue()(n),"getCollapsedContent",function(){return" "}),v()(ue()(n),"handleToggle",function(e,t){n.props.layoutActions.show(["models",e],t),t&&n.props.specActions.requestResolvedSubtree([].concat(pt()(n.getSchemaBasePath()),[e]))}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.specSelectors,r=t.getComponent,o=t.layoutSelectors,i=t.layoutActions,a=t.getConfigs,s=n.definitions(),u=a(),c=u.docExpansion,l=u.defaultModelsExpandDepth;if(!s.size||l<0)return null;var p=o.isShown("models",l>0&&"none"!==c),f=this.getSchemaBasePath(),h=n.isOAS3(),d=r("ModelWrapper"),m=r("Collapse"),v=r("ModelCollapse"),g=r("JumpToPath");return S.a.createElement("section",{className:p?"models is-open":"models"},S.a.createElement("h4",{onClick:function(){return i.show("models",!p)}},S.a.createElement("span",null,h?"Schemas":"Models"),S.a.createElement("svg",{width:"20",height:"20"},S.a.createElement("use",{xlinkHref:p?"#large-arrow-down":"#large-arrow"}))),S.a.createElement(m,{isOpened:p},s.entrySeq().map(function(t){var s=Ge()(t,1)[0],u=[].concat(pt()(f),[s]),c=n.specResolvedSubtree(u),p=n.specJson().getIn(u),h=k.Map.isMap(c)?c:O.a.Map(),m=k.Map.isMap(p)?p:O.a.Map(),y=h.get("title")||m.get("title")||s,b=o.isShown(["models",s],!1);b&&0===h.size&&m.size>0&&e.props.specActions.requestResolvedSubtree([].concat(pt()(e.getSchemaBasePath()),[s]));var _=O.a.List([].concat(pt()(f),[s])),w=S.a.createElement(d,{name:s,expandDepth:l,schema:h||O.a.Map(),displayName:y,specPath:_,getComponent:r,specSelectors:n,getConfigs:a,layoutSelectors:o,layoutActions:i}),x=S.a.createElement("span",{className:"model-box"},S.a.createElement("span",{className:"model model-title"},y));return S.a.createElement("div",{id:"model-".concat(s),className:"model-container",key:"models-section-".concat(s)},S.a.createElement("span",{className:"models-jump-to-path"},S.a.createElement(g,{specPath:_})),S.a.createElement(v,{classes:"model-box",collapsedContent:e.getCollapsedContent(s),onToggle:e.handleToggle,title:x,displayName:y,modelName:s,hideSelfOnExpand:!0,expanded:l>0&&b},w))}).toArray()))}}]),t}(E.Component),fn=function(e){var t=e.value,n=(0,e.getComponent)("ModelCollapse"),r=S.a.createElement("span",null,"Array [ ",t.count()," ]");return S.a.createElement("span",{className:"prop-enum"},"Enum:",S.a.createElement("br",null),S.a.createElement(n,{collapsedContent:r},"[ ",t.join(", ")," ]"))},hn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.name,r=e.displayName,o=e.isRef,i=e.getComponent,s=e.getConfigs,u=e.depth,c=e.onToggle,l=e.expanded,p=e.specPath,f=At()(e,["schema","name","displayName","isRef","getComponent","getConfigs","depth","onToggle","expanded","specPath"]),h=f.specSelectors,d=f.expandDepth,m=h.isOAS3;if(!t)return null;var v=s().showExtensions,g=t.get("description"),y=t.get("properties"),b=t.get("additionalProperties"),_=t.get("title")||r||n,w=t.get("required"),x=i("JumpToPath",!0),E=i("Markdown"),C=i("Model"),O=i("ModelCollapse"),A=function(){return S.a.createElement("span",{className:"model-jump-to-path"},S.a.createElement(x,{specPath:p}))},T=S.a.createElement("span",null,S.a.createElement("span",null,"{"),"...",S.a.createElement("span",null,"}"),o?S.a.createElement(A,null):""),j=h.isOAS3()?t.get("anyOf"):null,P=h.isOAS3()?t.get("oneOf"):null,I=h.isOAS3()?t.get("not"):null,M=_&&S.a.createElement("span",{className:"model-title"},o&&t.get("$$ref")&&S.a.createElement("span",{className:"model-hint"},t.get("$$ref")),S.a.createElement("span",{className:"model-title__text"},_));return S.a.createElement("span",{className:"model"},S.a.createElement(O,{modelName:n,title:M,onToggle:c,expanded:!!l||u<=d,collapsedContent:T},S.a.createElement("span",{className:"brace-open object"},"{"),o?S.a.createElement(A,null):null,S.a.createElement("span",{className:"inner-object"},S.a.createElement("table",{className:"model"},S.a.createElement("tbody",null,g?S.a.createElement("tr",{style:{color:"#666",fontWeight:"normal"}},S.a.createElement("td",{style:{fontWeight:"bold"}},"description:"),S.a.createElement("td",null,S.a.createElement(E,{source:g}))):null,y&&y.size?y.entrySeq().map(function(e){var t=Ge()(e,2),r=t[0],o=t[1],a=m()&&o.get("deprecated"),c=k.List.isList(w)&&w.contains(r),l={verticalAlign:"top",paddingRight:"0.2em"};return c&&(l.fontWeight="bold"),S.a.createElement("tr",{key:r,className:a&&"deprecated"},S.a.createElement("td",{style:l},r,c&&S.a.createElement("span",{style:{color:"red"}},"*")),S.a.createElement("td",{style:{verticalAlign:"top"}},S.a.createElement(C,kt()({key:"object-".concat(n,"-").concat(r,"_").concat(o)},f,{required:c,getComponent:i,specPath:p.push("properties",r),getConfigs:s,schema:o,depth:u+1}))))}).toArray():null,v?S.a.createElement("tr",null," "):null,v?t.entrySeq().map(function(e){var t=Ge()(e,2),n=t[0],r=t[1];if("x-"===n.slice(0,2)){var o=r?r.toJS?r.toJS():r:null;return S.a.createElement("tr",{key:n,style:{color:"#777"}},S.a.createElement("td",null,n),S.a.createElement("td",{style:{verticalAlign:"top"}},a()(o)))}}).toArray():null,b&&b.size?S.a.createElement("tr",null,S.a.createElement("td",null,"< * >:"),S.a.createElement("td",null,S.a.createElement(C,kt()({},f,{required:!1,getComponent:i,specPath:p.push("additionalProperties"),getConfigs:s,schema:b,depth:u+1})))):null,j?S.a.createElement("tr",null,S.a.createElement("td",null,"anyOf ->"),S.a.createElement("td",null,j.map(function(e,t){return S.a.createElement("div",{key:t},S.a.createElement(C,kt()({},f,{required:!1,getComponent:i,specPath:p.push("anyOf",t),getConfigs:s,schema:e,depth:u+1})))}))):null,P?S.a.createElement("tr",null,S.a.createElement("td",null,"oneOf ->"),S.a.createElement("td",null,P.map(function(e,t){return S.a.createElement("div",{key:t},S.a.createElement(C,kt()({},f,{required:!1,getComponent:i,specPath:p.push("oneOf",t),getConfigs:s,schema:e,depth:u+1})))}))):null,I?S.a.createElement("tr",null,S.a.createElement("td",null,"not ->"),S.a.createElement("td",null,S.a.createElement("div",null,S.a.createElement(C,kt()({},f,{required:!1,getComponent:i,specPath:p.push("not"),getConfigs:s,schema:I,depth:u+1}))))):null))),S.a.createElement("span",{className:"brace-close"},"}")))}}]),t}(E.Component),dn={color:"#999",fontStyle:"italic"},mn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.getConfigs,r=e.schema,o=e.depth,i=e.expandDepth,a=e.name,s=e.displayName,u=e.specPath,c=r.get("description"),l=r.get("items"),p=r.get("title")||s||a,f=r.filter(function(e,t){return-1===["type","items","description","$$ref"].indexOf(t)}),h=t("Markdown"),d=t("ModelCollapse"),m=t("Model"),v=t("Property"),g=p&&S.a.createElement("span",{className:"model-title"},S.a.createElement("span",{className:"model-title__text"},p));return S.a.createElement("span",{className:"model"},S.a.createElement(d,{title:g,expanded:o<=i,collapsedContent:"[...]"},"[",f.size?f.entrySeq().map(function(e){var t=Ge()(e,2),n=t[0],r=t[1];return S.a.createElement(v,{key:"".concat(n,"-").concat(r),propKey:n,propVal:r,propStyle:dn})}):null,c?S.a.createElement(h,{source:c}):f.size?S.a.createElement("div",{className:"markdown"}):null,S.a.createElement("span",null,S.a.createElement(m,kt()({},this.props,{getConfigs:n,specPath:u.push("items"),name:null,schema:l,required:!1,depth:o+1}))),"]"))}}]),t}(E.Component),vn={color:"#6b6b6b",fontStyle:"italic"},gn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.getConfigs,o=e.name,i=e.displayName,a=e.depth,s=r().showExtensions;if(!t||!t.get)return S.a.createElement("div",null);var u=t.get("type"),c=t.get("format"),l=t.get("xml"),p=t.get("enum"),f=t.get("title")||i||o,h=t.get("description"),d=Object(D.k)(t),m=t.filter(function(e,t){return-1===["enum","type","format","description","$$ref"].indexOf(t)}).filterNot(function(e,t){return d.has(t)}),v=n("Markdown"),g=n("EnumModel"),y=n("Property");return S.a.createElement("span",{className:"model"},S.a.createElement("span",{className:"prop"},o&&S.a.createElement("span",{className:"".concat(1===a&&"model-title"," prop-name")},f),S.a.createElement("span",{className:"prop-type"},u),c&&S.a.createElement("span",{className:"prop-format"},"($",c,")"),m.size?m.entrySeq().map(function(e){var t=Ge()(e,2),n=t[0],r=t[1];return S.a.createElement(y,{key:"".concat(n,"-").concat(r),propKey:n,propVal:r,propStyle:vn})}):null,s&&d.size?d.entrySeq().map(function(e){var t=Ge()(e,2),n=t[0],r=t[1];return S.a.createElement(y,{key:"".concat(n,"-").concat(r),propKey:n,propVal:r,propStyle:vn})}):null,h?S.a.createElement(v,{source:h}):null,l&&l.size?S.a.createElement("span",null,S.a.createElement("br",null),S.a.createElement("span",{style:vn},"xml:"),l.entrySeq().map(function(e){var t=Ge()(e,2),n=t[0],r=t[1];return S.a.createElement("span",{key:"".concat(n,"-").concat(r),style:vn},S.a.createElement("br",null)," ",n,": ",String(r))}).toArray()):null,p&&S.a.createElement(g,{value:p,getComponent:n})))}}]),t}(E.Component),yn=function(e){var t=e.propKey,n=e.propVal,r=e.propStyle;return S.a.createElement("span",{style:r},S.a.createElement("br",null),t,": ",String(n))},bn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.onTryoutClick,n=e.onCancelClick,r=e.enabled;return S.a.createElement("div",{className:"try-out"},r?S.a.createElement("button",{className:"btn try-out__btn cancel",onClick:n},"Cancel"):S.a.createElement("button",{className:"btn try-out__btn",onClick:t},"Try it out "))}}]),t}(S.a.Component);v()(bn,"defaultProps",{onTryoutClick:Function.prototype,onCancelClick:Function.prototype,enabled:!1});var _n=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.bypass,n=e.isSwagger2,r=e.isOAS3,o=e.alsoShow;return t?S.a.createElement("div",null,this.props.children):n&&r?S.a.createElement("div",{className:"version-pragma"},o,S.a.createElement("div",{className:"version-pragma__message version-pragma__message--ambiguous"},S.a.createElement("div",null,S.a.createElement("h3",null,"Unable to render this definition"),S.a.createElement("p",null,S.a.createElement("code",null,"swagger")," and ",S.a.createElement("code",null,"openapi")," fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields."),S.a.createElement("p",null,"Supported version fields are ",S.a.createElement("code",null,"swagger: ",'"2.0"')," and those that match ",S.a.createElement("code",null,"openapi: 3.0.n")," (for example, ",S.a.createElement("code",null,"openapi: 3.0.0"),").")))):n||r?S.a.createElement("div",null,this.props.children):S.a.createElement("div",{className:"version-pragma"},o,S.a.createElement("div",{className:"version-pragma__message version-pragma__message--missing"},S.a.createElement("div",null,S.a.createElement("h3",null,"Unable to render this definition"),S.a.createElement("p",null,"The provided definition does not specify a valid version field."),S.a.createElement("p",null,"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are ",S.a.createElement("code",null,"swagger: ",'"2.0"')," and those that match ",S.a.createElement("code",null,"openapi: 3.0.n")," (for example, ",S.a.createElement("code",null,"openapi: 3.0.0"),")."))))}}]),t}(S.a.PureComponent);v()(_n,"defaultProps",{alsoShow:null,children:null,bypass:!1});var wn=function(e){var t=e.version;return S.a.createElement("small",null,S.a.createElement("pre",{className:"version"}," ",t," "))},xn=function(e){var t=e.enabled,n=e.path,r=e.text;return S.a.createElement("a",{className:"nostyle",onClick:t?function(e){return e.preventDefault()}:null,href:t?"#/".concat(n):null},S.a.createElement("span",null,r))},En=function(){return S.a.createElement("div",null,S.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",style:{position:"absolute",width:0,height:0}},S.a.createElement("defs",null,S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"unlocked"},S.a.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"})),S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"locked"},S.a.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z"})),S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"close"},S.a.createElement("path",{d:"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z"})),S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow"},S.a.createElement("path",{d:"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z"})),S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow-down"},S.a.createElement("path",{d:"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z"})),S.a.createElement("symbol",{viewBox:"0 0 24 24",id:"jump-to"},S.a.createElement("path",{d:"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"})),S.a.createElement("symbol",{viewBox:"0 0 24 24",id:"expand"},S.a.createElement("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})))))},Sn=n(192),Cn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.errSelectors,n=e.specSelectors,r=e.getComponent,o=r("SvgAssets"),i=r("InfoContainer",!0),a=r("VersionPragmaFilter"),s=r("operations",!0),u=r("Models",!0),c=r("Row"),l=r("Col"),p=r("errors",!0),f=r("ServersContainer",!0),h=r("SchemesContainer",!0),d=r("AuthorizeBtnContainer",!0),m=r("FilterContainer",!0),v=n.isSwagger2(),g=n.isOAS3(),y=!n.specStr(),b=n.loadingStatus(),_=null;if("loading"===b&&(_=S.a.createElement("div",{className:"info"},S.a.createElement("div",{className:"loading-container"},S.a.createElement("div",{className:"loading"})))),"failed"===b&&(_=S.a.createElement("div",{className:"info"},S.a.createElement("div",{className:"loading-container"},S.a.createElement("h4",{className:"title"},"Failed to load API definition."),S.a.createElement(p,null)))),"failedConfig"===b){var w=t.lastError(),x=w?w.get("message"):"";_=S.a.createElement("div",{className:"info",style:{maxWidth:"880px",marginLeft:"auto",marginRight:"auto",textAlign:"center"}},S.a.createElement("div",{className:"loading-container"},S.a.createElement("h4",{className:"title"},"Failed to load remote configuration."),S.a.createElement("p",null,x)))}if(!_&&y&&(_=S.a.createElement("h4",null,"No API definition provided.")),_)return S.a.createElement("div",{className:"swagger-ui"},S.a.createElement("div",{className:"loading-container"},_));var E=n.servers(),C=n.schemes(),k=E&&E.size,O=C&&C.size,A=!!n.securityDefinitions();return S.a.createElement("div",{className:"swagger-ui"},S.a.createElement(o,null),S.a.createElement(a,{isSwagger2:v,isOAS3:g,alsoShow:S.a.createElement(p,null)},S.a.createElement(p,null),S.a.createElement(c,{className:"information-container"},S.a.createElement(l,{mobile:12},S.a.createElement(i,null))),k||O||A?S.a.createElement("div",{className:"scheme-container"},S.a.createElement(l,{className:"schemes wrapper",mobile:12},k?S.a.createElement(f,null):null,O?S.a.createElement(h,null):null,A?S.a.createElement(d,null):null)):null,S.a.createElement(m,null),S.a.createElement(c,null,S.a.createElement(l,{mobile:12,desktop:12},S.a.createElement(s,null))),S.a.createElement(c,null,S.a.createElement(l,{mobile:12,desktop:12},S.a.createElement(u,null)))))}}]),t}(S.a.Component),kn=n(480),On=n.n(kn),An={value:"",onChange:function(){},schema:{},keyName:"",required:!1,errors:Object(k.List)()},Tn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.dispatchInitialValue,n=e.value,r=e.onChange;t&&r(n)}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.errors,r=e.value,o=e.onChange,i=e.getComponent,a=e.fn,s=e.disabled;t.toJS&&(t=t.toJS());var u=t,c=u.type,l=u.format,p=void 0===l?"":l,f=i(p?"JsonSchema_".concat(c,"_").concat(p):"JsonSchema_".concat(c))||i("JsonSchema_string");return S.a.createElement(f,kt()({},this.props,{errors:n,fn:a,getComponent:i,value:r,onChange:o,schema:t,disabled:s}))}}]),t}(E.Component);v()(Tn,"defaultProps",An);var jn=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onChange",function(e){var t="file"===n.props.schema.type?e.target.files[0]:e.target.value;n.props.onChange(t,n.props.keyName)}),v()(ue()(n),"onEnumChange",function(e){return n.props.onChange(e)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.schema,o=e.errors,i=e.required,a=e.description,s=e.disabled,u=r.enum;if(o=o.toJS?o.toJS():[],u){var c=t("Select");return S.a.createElement(c,{className:o.length?"invalid":"",title:o.length?o:"",allowedValues:u,value:n,allowEmptyValue:!i,disabled:s,onChange:this.onEnumChange})}var l=s||"formData"===r.in&&!("FormData"in window),p=t("Input");return"file"===r.type?S.a.createElement(p,{type:"file",className:o.length?"invalid":"",title:o.length?o:"",onChange:this.onChange,disabled:l}):S.a.createElement(On.a,{type:"password"===r.format?"password":"text",className:o.length?"invalid":"",title:o.length?o:"",value:n,minLength:0,debounceTimeout:350,placeholder:a,onChange:this.onChange,disabled:l})}}]),t}(E.Component);v()(jn,"defaultProps",An);var Pn=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChange",function(){return r.props.onChange(r.state.value)}),v()(ue()(r),"onItemChange",function(e,t){r.setState(function(n){return{value:n.value.set(t,e)}},r.onChange)}),v()(ue()(r),"removeItem",function(e){r.setState(function(t){return{value:t.value.remove(e)}},r.onChange)}),v()(ue()(r),"addItem",function(){r.setState(function(e){return e.value=Nn(e.value),{value:e.value.push("")}},r.onChange)}),v()(ue()(r),"onEnumChange",function(e){r.setState(function(){return{value:e}},r.onChange)}),r.state={value:Nn(e.value)},r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this.setState({value:e.value})}},{key:"render",value:function(){var e=this,t=this.props,n=t.getComponent,r=t.required,o=t.schema,i=t.errors,a=t.fn,s=t.disabled;i=i.toJS?i.toJS():[];var u=a.inferSchema(o.items),c=n("JsonSchemaForm"),l=n("Button"),p=u.enum,f=this.state.value;if(p){var h=n("Select");return S.a.createElement(h,{className:i.length?"invalid":"",title:i.length?i:"",multiple:!0,value:f,disabled:s,allowedValues:p,allowEmptyValue:!r,onChange:this.onEnumChange})}return S.a.createElement("div",{className:"json-schema-array"},!f||!f.count||f.count()<1?null:f.map(function(t,r){var o=y()({},u);if(i.length){var p=i.filter(function(e){return e.index===r});p.length&&(i=[p[0].error+r])}return S.a.createElement("div",{key:r,className:"json-schema-form-item"},S.a.createElement(c,{fn:a,getComponent:n,value:t,onChange:function(t){return e.onItemChange(t,r)},schema:o,disabled:s}),s?null:S.a.createElement(l,{className:"btn btn-sm json-schema-form-item-remove",onClick:function(){return e.removeItem(r)}}," - "))}).toArray(),s?null:S.a.createElement(l,{className:"btn btn-sm json-schema-form-item-add ".concat(i.length?"invalid":null),onClick:this.addItem},"Add item"))}}]),t}(E.PureComponent);v()(Pn,"defaultProps",An);var In=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onEnumChange",function(e){return n.props.onChange(e)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.errors,o=e.schema,i=e.required,a=e.disabled;r=r.toJS?r.toJS():[];var s=t("Select");return S.a.createElement(s,{className:r.length?"invalid":"",title:r.length?r:"",value:String(n),disabled:a,allowedValues:Object(k.fromJS)(o.enum||["true","false"]),allowEmptyValue:!o.enum||!i,onChange:this.onEnumChange})}}]),t}(E.Component);v()(In,"defaultProps",An);var Mn=function(e){function t(){var e;return _()(this,t),e=oe()(this,ae()(t).call(this)),v()(ue()(e),"onChange",function(t){e.props.onChange(t)}),v()(ue()(e),"handleOnChange",function(t){var n=t.target.value;e.onChange(n)}),e}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.errors,o=e.disabled,i=t("TextArea");return S.a.createElement("div",null,S.a.createElement(i,{className:rt()({invalid:r.size}),title:r.size?r.join(", "):"",value:Object(D.G)(n),disabled:o,onChange:this.handleOnChange}))}}]),t}(E.PureComponent);function Nn(e){return k.List.isList(e)?e:Object(k.List)()}v()(Mn,"defaultProps",An);var Rn=function(){var e={components:{App:he,authorizationPopup:de,authorizeBtn:me,AuthorizeBtnContainer:ve,authorizeOperationBtn:ge,auths:ye,AuthItem:be,authError:_e,oauth2:Te,apiKeyAuth:we,basicAuth:xe,clear:je,liveResponse:Me,InitializedInput:Vt,info:Kt,InfoContainer:Gt,JumpToPath:$t,onlineValidatorBadge:De,operations:Fe,operation:Be,OperationSummary:We,OperationSummaryMethod:Je,OperationSummaryPath:Ye,highlightCode:et,responses:tt,response:ot,responseBody:ct,parameters:ft,parameterRow:vt,execute:gt,headers:bt,errors:_t,contentType:St,overview:zt,footer:Zt,FilterContainer:Xt,ParamBody:en,curl:rn,schemes:on,SchemesContainer:an,modelExample:un,ModelWrapper:cn,ModelCollapse:sn,Model:ln.a,Models:pn,EnumModel:fn,ObjectModel:hn,ArrayModel:mn,PrimitiveModel:gn,Property:yn,TryItOutButton:bn,Markdown:Sn.a,BaseLayout:Cn,VersionPragmaFilter:_n,VersionStamp:wn,OperationExt:$e,OperationExtRow:Ze,ParameterExt:ht,ParameterIncludeEmpty:dt,OperationTag:ze,OperationContainer:fe,DeepLink:xn,InfoUrl:Yt,InfoBasePath:Ht,SvgAssets:En,Example:Ee,ExamplesSelect:ke,ExamplesSelectValueRetainer:Ae}},t={components:r},n={components:o};return[Q.default,Z.default,K.default,J.default,W.default,V.default,H.default,Y.default,e,t,G.default,n,$.default,X.default,ee.default,te.default,ne.default]},Dn=n(298);function Ln(){return[Rn,Dn.default]}var Un=n(320);n.d(t,"default",function(){return Hn});var qn=!0,Fn="g5f6ec8ce",zn="3.23.11",Bn="jenins-swagger-oss",Vn="Fri, 20 Sep 2019 20:33:46 GMT";function Hn(e){R.a.versions=R.a.versions||{},R.a.versions.swaggerUi={version:zn,gitRevision:Fn,gitDirty:qn,buildTimestamp:Vn,machine:Bn};var t={dom_id:null,domNode:null,spec:{},url:"",urls:null,layout:"BaseLayout",docExpansion:"list",maxDisplayedTags:null,filter:null,validatorUrl:"https://validator.swagger.io/validator",oauth2RedirectUrl:"".concat(window.location.protocol,"//").concat(window.location.host,"/oauth2-redirect.html"),configs:{},custom:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,requestInterceptor:function(e){return e},responseInterceptor:function(e){return e},showMutatedRequest:!0,defaultModelRendering:"example",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,showCommonExtensions:!1,withCredentials:void 0,supportedSubmitMethods:["get","put","post","delete","options","head","patch","trace"],presets:[Ln],plugins:[],initialState:{},fn:{},components:{}},n=Object(D.B)(),r=e.domNode;delete e.domNode;var o=f()({},t,e,n),i={system:{configs:o.configs},plugins:o.presets,state:f()({layout:{layout:o.layout,filter:o.filter},spec:{spec:"",url:o.url}},o.initialState)};if(o.initialState)for(var s in o.initialState)o.initialState.hasOwnProperty(s)&&void 0===o.initialState[s]&&delete i.state[s];var c=new U(i);c.register([o.plugins,function(){return{fn:o.fn,components:o.components,state:o.state}}]);var p=c.getSystem(),h=function(e){var t=p.specSelectors.getLocalConfig?p.specSelectors.getLocalConfig():{},i=f()({},t,o,e||{},n);if(r&&(i.domNode=r),c.setConfigs(i),p.configsActions.loaded(),null!==e&&(!n.url&&"object"===l()(i.spec)&&u()(i.spec).length?(p.specActions.updateUrl(""),p.specActions.updateLoadingStatus("success"),p.specActions.updateSpec(a()(i.spec))):p.specActions.download&&i.url&&!i.urls&&(p.specActions.updateUrl(i.url),p.specActions.download(i.url))),i.domNode)p.render(i.domNode,"App");else if(i.dom_id){var s=document.querySelector(i.dom_id);p.render(s,"App")}else null===i.dom_id||null===i.domNode||console.error("Skipped rendering: no `dom_id` or `domNode` was specified");return p},d=n.config||o.configUrl;return d&&p.specActions&&p.specActions.getConfigByUrl&&(!p.specActions.getConfigByUrl||p.specActions.getConfigByUrl({url:d,loadRemoteConfig:!0,requestInterceptor:o.requestInterceptor,responseInterceptor:o.responseInterceptor},h))?(p.specActions.getConfigByUrl(d,h),p):h()}Hn.presets={apis:Ln},Hn.plugins=Un.default}]).default});
//# sourceMappingURL=swagger-ui-bundle.js.map |
enrolment-ui/src/modules/ProjectUsers/components/ModalReqForm.js | overture-stack/enrolment | import React from 'react';
import { connect } from 'react-redux';
import { Field, reduxForm } from 'redux-form';
import { Modal } from 'react-bootstrap';
import { RFSelect, rules } from '../../ReduxForm';
import EmailList from './EmailList';
import { toggleModal } from '../redux';
const SuccessMessage = props => {
return (
<div className="success">
<div className="alert alert-success">The Enrolment Request was sent Successfully!</div>
</div>
);
};
const ErrorMessage = props => {
const { error } = props;
return (
<div className="error">
<div className="alert alert-danger" dangerouslySetInnerHTML={{ __html: error }} />
</div>
);
};
const ModalReqForm = props => {
const {
handleSubmit,
pristine,
invalid,
toggleModal,
userEnrolmentForm: { submitSuccess, error },
projects,
} = props;
const projectOptions = projects
.filter(project => project.status === 'Approved')
.map(project => {
return {
text: project.project_name,
value: project.id,
};
});
const closeModal = event => {
event.preventDefault();
toggleModal();
};
return (
<form onSubmit={handleSubmit}>
{submitSuccess ? (
<Modal.Body>
<SuccessMessage />
</Modal.Body>
) : (
<Modal.Body>
<div className="form-group row">
<div className="col-md-4">
<label htmlFor="projectSelector">Project</label>
</div>
<Field
name="project"
component={RFSelect}
bootstrapClass="col-md-6"
options={projectOptions}
defaultOption="Select a Project"
validate={rules.required}
/>
</div>
{pristine ? null : (
<Field
component={EmailList}
label="Users' Email"
name="email"
validate={rules.required}
/>
)}
{error ? <ErrorMessage error={error} /> : null}
</Modal.Body>
)}
<Modal.Footer>
<button className="action-button" onClick={closeModal}>
Close
</button>
{!submitSuccess ? (
<button type="submit" className="action-button" disabled={pristine || invalid}>
Submit
</button>
) : null}
</Modal.Footer>
</form>
);
};
const mapStateToProps = state => {
return {
projects: state.projects.data,
userEnrolmentForm: state.userEnrolmentForm,
};
};
const mapDispatchToProps = dispatch => {
return {
toggleModal: () => dispatch(toggleModal()),
};
};
ModalReqForm.displayName = 'ModalReqForm';
export default connect(
mapStateToProps,
mapDispatchToProps,
)(
reduxForm({
form: 'userRequestForm',
destroyOnUnmount: true,
forceUnregisterOnUnmount: true,
})(ModalReqForm),
);
|
docs/app/Examples/modules/Progress/States/ProgressExampleError.js | aabustamante/Semantic-UI-React | import React from 'react'
import { Progress } from 'semantic-ui-react'
const ProgressExampleError = () => (
<Progress percent={100} error>
There was an error
</Progress>
)
export default ProgressExampleError
|
examples/Transition.js | cesarandreu/react-overlays | import React from 'react';
import Transition from 'react-overlays/Transition';
import Button from 'react-bootstrap/lib/Button';
import injectCss from './injectCss';
const FADE_DURATION = 200;
injectCss(`
.fade {
opacity: 0;
-webkit-transition: opacity ${FADE_DURATION}ms linear;
-o-transition: opacity ${FADE_DURATION}ms linear;
transition: opacity ${FADE_DURATION}ms linear;
}
.in {
opacity: 1;
}
`);
const TransitionExample = React.createClass({
getInitialState(){
return { in: true };
},
toggle(){
return this.setState({ in: !this.state.in });
},
render(){
return (
<div className='transition-example'>
<p>Create your own declarative fade transition</p>
<Transition
in={this.state.in}
timeout={FADE_DURATION}
className='fade'
enteredClassName='in'
enteringClassName='in'
>
<div className='panel panel-default'>
<div className='panel-body'>
Anim pariatur cliche reprehenderit, enim eiusmod high life
accusamus terry richardson ad squid.
Nihil anim keffiyeh helvetica, craft beer labore wes
anderson cred nesciunt sapiente ea proident.
</div>
</div>
</Transition>
<Button bsStyle='primary' onClick={this.toggle}>
dismiss
</Button>
</div>
);
}
});
export default TransitionExample;
|
examples/server/hello-world/src/server/interfaces/server-interface.js | tuantle/hyperflow | 'use strict'; // eslint-disable-line
import { Hf } from 'hyperflow';
import React from 'react';
import ReactComponentInterfaceComposite from 'hyperflow/libs/composites/interfaces/react-component-interface-composite';
import ReactDomServerInterfaceComposite from 'hyperflow/libs/composites/interfaces/react-dom-server-interface-composite';
import { ServerStyleSheets, MuiThemeProvider } from '@material-ui/core/styles';
import EVENT from '../../common/event';
import theme from '../../common/mui-theme';
const styleSheets = new ServerStyleSheets();
const ServerApp = function ({
getChildInterfacedComponents
}) {
const [ App ] = getChildInterfacedComponents(`app-interface`);
return (
styleSheets.collect(
<MuiThemeProvider theme = { theme }>
<App/>
</MuiThemeProvider>
)
);
};
export default Hf.Interface.augment({
composites: [
ReactComponentInterfaceComposite,
ReactDomServerInterfaceComposite
],
$init () {
const intf = this;
intf.register({
component: ServerApp
});
},
setup (done) {
const intf = this;
intf.incoming(`on-component-${intf.name}-render-to-target`).handle((html) => {
const renderedTarget = {
html,
css: styleSheets.toString()
};
return renderedTarget;
}).relay(EVENT.DO.BROADCAST_RENDERED_TARGET);
done();
}
});
|
app/javascript/mastodon/components/dropdown_menu.js | increments/mastodon | import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import IconButton from './icon_button';
import Overlay from 'react-overlays/lib/Overlay';
import Motion from '../features/ui/util/optional_motion';
import spring from 'react-motion/lib/spring';
import detectPassiveEvents from 'detect-passive-events';
const listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;
let id = 0;
class DropdownMenu extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = {
items: PropTypes.array.isRequired,
onClose: PropTypes.func.isRequired,
style: PropTypes.object,
placement: PropTypes.string,
arrowOffsetLeft: PropTypes.string,
arrowOffsetTop: PropTypes.string,
};
static defaultProps = {
style: {},
placement: 'bottom',
};
state = {
mounted: false,
};
handleDocumentClick = e => {
if (this.node && !this.node.contains(e.target)) {
this.props.onClose();
}
}
componentDidMount () {
document.addEventListener('click', this.handleDocumentClick, false);
document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);
this.setState({ mounted: true });
}
componentWillUnmount () {
document.removeEventListener('click', this.handleDocumentClick, false);
document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);
}
setRef = c => {
this.node = c;
}
handleClick = e => {
const i = Number(e.currentTarget.getAttribute('data-index'));
const { action, to } = this.props.items[i];
this.props.onClose();
if (typeof action === 'function') {
e.preventDefault();
action();
} else if (to) {
e.preventDefault();
this.context.router.history.push(to);
}
}
renderItem (option, i) {
if (option === null) {
return <li key={`sep-${i}`} className='dropdown-menu__separator' />;
}
const { text, href = '#' } = option;
return (
<li className='dropdown-menu__item' key={`${text}-${i}`}>
<a href={href} target='_blank' rel='noopener' role='button' tabIndex='0' autoFocus={i === 0} onClick={this.handleClick} data-index={i}>
{text}
</a>
</li>
);
}
render () {
const { items, style, placement, arrowOffsetLeft, arrowOffsetTop } = this.props;
const { mounted } = this.state;
return (
<Motion defaultStyle={{ opacity: 0, scaleX: 0.85, scaleY: 0.75 }} style={{ opacity: spring(1, { damping: 35, stiffness: 400 }), scaleX: spring(1, { damping: 35, stiffness: 400 }), scaleY: spring(1, { damping: 35, stiffness: 400 }) }}>
{({ opacity, scaleX, scaleY }) => (
// It should not be transformed when mounting because the resulting
// size will be used to determine the coordinate of the menu by
// react-overlays
<div className='dropdown-menu' style={{ ...style, opacity: opacity, transform: mounted ? `scale(${scaleX}, ${scaleY})` : null }} ref={this.setRef}>
<div className={`dropdown-menu__arrow ${placement}`} style={{ left: arrowOffsetLeft, top: arrowOffsetTop }} />
<ul>
{items.map((option, i) => this.renderItem(option, i))}
</ul>
</div>
)}
</Motion>
);
}
}
export default class Dropdown extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = {
icon: PropTypes.string.isRequired,
items: PropTypes.array.isRequired,
size: PropTypes.number.isRequired,
title: PropTypes.string,
disabled: PropTypes.bool,
status: ImmutablePropTypes.map,
isUserTouching: PropTypes.func,
isModalOpen: PropTypes.bool.isRequired,
onOpen: PropTypes.func.isRequired,
onClose: PropTypes.func.isRequired,
dropdownPlacement: PropTypes.string,
openDropdownId: PropTypes.number,
};
static defaultProps = {
title: 'Menu',
};
state = {
id: id++,
};
handleClick = ({ target }) => {
if (this.state.id === this.props.openDropdownId) {
this.handleClose();
} else {
const { top } = target.getBoundingClientRect();
const placement = top * 2 < innerHeight ? 'bottom' : 'top';
this.props.onOpen(this.state.id, this.handleItemClick, placement);
}
}
handleClose = () => {
this.props.onClose(this.state.id);
}
handleKeyDown = e => {
switch(e.key) {
case 'Enter':
this.handleClick(e);
break;
case 'Escape':
this.handleClose();
break;
}
}
handleItemClick = e => {
const i = Number(e.currentTarget.getAttribute('data-index'));
const { action, to } = this.props.items[i];
this.handleClose();
if (typeof action === 'function') {
e.preventDefault();
action();
} else if (to) {
e.preventDefault();
this.context.router.history.push(to);
}
}
setTargetRef = c => {
this.target = c;
}
findTarget = () => {
return this.target;
}
render () {
const { icon, items, size, title, disabled, dropdownPlacement, openDropdownId } = this.props;
const open = this.state.id === openDropdownId;
return (
<div onKeyDown={this.handleKeyDown}>
<IconButton
icon={icon}
title={title}
active={open}
disabled={disabled}
size={size}
ref={this.setTargetRef}
onClick={this.handleClick}
/>
<Overlay show={open} placement={dropdownPlacement} target={this.findTarget}>
<DropdownMenu items={items} onClose={this.handleClose} />
</Overlay>
</div>
);
}
}
|
ajax/libs/webshim/1.15.0/dev/shims/moxie/js/moxie-html4.js | jakubfiala/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/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/image/Image.js
/**
* Image.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/image/Image", [
"moxie/core/utils/Basic",
"moxie/core/utils/Dom",
"moxie/core/Exceptions",
"moxie/file/FileReaderSync",
"moxie/xhr/XMLHttpRequest",
"moxie/runtime/Runtime",
"moxie/runtime/RuntimeClient",
"moxie/runtime/Transporter",
"moxie/core/utils/Env",
"moxie/core/EventTarget",
"moxie/file/Blob",
"moxie/file/File",
"moxie/core/utils/Encode"
], function(Basic, Dom, x, FileReaderSync, XMLHttpRequest, Runtime, RuntimeClient, Transporter, Env, EventTarget, Blob, File, Encode) {
/**
Image preloading and manipulation utility. Additionally it provides access to image meta info (Exif, GPS) and raw binary data.
@class Image
@constructor
@extends EventTarget
*/
var dispatches = [
'progress',
/**
Dispatched when loading is complete.
@event load
@param {Object} event
*/
'load',
'error',
/**
Dispatched when resize operation is complete.
@event resize
@param {Object} event
*/
'resize',
/**
Dispatched when visual representation of the image is successfully embedded
into the corresponsing container.
@event embedded
@param {Object} event
*/
'embedded'
];
function Image() {
RuntimeClient.call(this);
Basic.extend(this, {
/**
Unique id of the component
@property uid
@type {String}
*/
uid: Basic.guid('uid_'),
/**
Unique id of the connected runtime, if any.
@property ruid
@type {String}
*/
ruid: null,
/**
Name of the file, that was used to create an image, if available. If not equals to empty string.
@property name
@type {String}
@default ""
*/
name: "",
/**
Size of the image in bytes. Actual value is set only after image is preloaded.
@property size
@type {Number}
@default 0
*/
size: 0,
/**
Width of the image. Actual value is set only after image is preloaded.
@property width
@type {Number}
@default 0
*/
width: 0,
/**
Height of the image. Actual value is set only after image is preloaded.
@property height
@type {Number}
@default 0
*/
height: 0,
/**
Mime type of the image. Currently only image/jpeg and image/png are supported. Actual value is set only after image is preloaded.
@property type
@type {String}
@default ""
*/
type: "",
/**
Holds meta info (Exif, GPS). Is populated only for image/jpeg. Actual value is set only after image is preloaded.
@property meta
@type {Object}
@default {}
*/
meta: {},
/**
Alias for load method, that takes another mOxie.Image object as a source (see load).
@method clone
@param {Image} src Source for the image
@param {Boolean} [exact=false] Whether to activate in-depth clone mode
*/
clone: function() {
this.load.apply(this, arguments);
},
/**
Loads image from various sources. Currently the source for new image can be: mOxie.Image, mOxie.Blob/mOxie.File,
native Blob/File, dataUrl or URL. Depending on the type of the source, arguments - differ. When source is URL,
Image will be downloaded from remote destination and loaded in memory.
@example
var img = new mOxie.Image();
img.onload = function() {
var blob = img.getAsBlob();
var formData = new mOxie.FormData();
formData.append('file', blob);
var xhr = new mOxie.XMLHttpRequest();
xhr.onload = function() {
// upload complete
};
xhr.open('post', 'upload.php');
xhr.send(formData);
};
img.load("http://www.moxiecode.com/images/mox-logo.jpg"); // notice file extension (.jpg)
@method load
@param {Image|Blob|File|String} src Source for the image
@param {Boolean|Object} [mixed]
*/
load: function() {
// this is here because to bind properly we need an uid first, which is created above
this.bind('Load Resize', function() {
_updateInfo.call(this);
}, 999);
this.convertEventPropsToHandlers(dispatches);
_load.apply(this, arguments);
},
/**
Downsizes the image to fit the specified width/height. If crop is supplied, image will be cropped to exact dimensions.
@method downsize
@param {Number} width Resulting width
@param {Number} [height=width] Resulting height (optional, if not supplied will default to width)
@param {Boolean} [crop=false] Whether to crop the image to exact dimensions
@param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize)
*/
downsize: function(opts) {
var defaults = {
width: this.width,
height: this.height,
crop: false,
preserveHeaders: true
};
if (typeof(opts) === 'object') {
opts = Basic.extend(defaults, opts);
} else {
opts = Basic.extend(defaults, {
width: arguments[0],
height: arguments[1],
crop: arguments[2],
preserveHeaders: arguments[3]
});
}
try {
if (!this.size) { // only preloaded image objects can be used as source
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// no way to reliably intercept the crash due to high resolution, so we simply avoid it
if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) {
throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR);
}
this.getRuntime().exec.call(this, 'Image', 'downsize', opts.width, opts.height, opts.crop, opts.preserveHeaders);
} catch(ex) {
// for now simply trigger error event
this.trigger('error', ex.code);
}
},
/**
Alias for downsize(width, height, true). (see downsize)
@method crop
@param {Number} width Resulting width
@param {Number} [height=width] Resulting height (optional, if not supplied will default to width)
@param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize)
*/
crop: function(width, height, preserveHeaders) {
this.downsize(width, height, true, preserveHeaders);
},
getAsCanvas: function() {
if (!Env.can('create_canvas')) {
throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR);
}
var runtime = this.connectRuntime(this.ruid);
return runtime.exec.call(this, 'Image', 'getAsCanvas');
},
/**
Retrieves image in it's current state as mOxie.Blob object. Cannot be run on empty or image in progress (throws
DOMException.INVALID_STATE_ERR).
@method getAsBlob
@param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png
@param {Number} [quality=90] Applicable only together with mime type image/jpeg
@return {Blob} Image as Blob
*/
getAsBlob: function(type, quality) {
if (!this.size) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
if (!type) {
type = 'image/jpeg';
}
if (type === 'image/jpeg' && !quality) {
quality = 90;
}
return this.getRuntime().exec.call(this, 'Image', 'getAsBlob', type, quality);
},
/**
Retrieves image in it's current state as dataURL string. Cannot be run on empty or image in progress (throws
DOMException.INVALID_STATE_ERR).
@method getAsDataURL
@param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png
@param {Number} [quality=90] Applicable only together with mime type image/jpeg
@return {String} Image as dataURL string
*/
getAsDataURL: function(type, quality) {
if (!this.size) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
return this.getRuntime().exec.call(this, 'Image', 'getAsDataURL', type, quality);
},
/**
Retrieves image in it's current state as binary string. Cannot be run on empty or image in progress (throws
DOMException.INVALID_STATE_ERR).
@method getAsBinaryString
@param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png
@param {Number} [quality=90] Applicable only together with mime type image/jpeg
@return {String} Image as binary string
*/
getAsBinaryString: function(type, quality) {
var dataUrl = this.getAsDataURL(type, quality);
return Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7));
},
/**
Embeds a visual representation of the image into the specified node. Depending on the runtime,
it might be a canvas, an img node or a thrid party shim object (Flash or SilverLight - very rare,
can be used in legacy browsers that do not have canvas or proper dataURI support).
@method embed
@param {DOMElement} el DOM element to insert the image object into
@param {Object} [options]
@param {Number} [options.width] The width of an embed (defaults to the image width)
@param {Number} [options.height] The height of an embed (defaults to the image height)
@param {String} [type="image/jpeg"] Mime type
@param {Number} [quality=90] Quality of an embed, if mime type is image/jpeg
@param {Boolean} [crop=false] Whether to crop an embed to the specified dimensions
*/
embed: function(el) {
var self = this
, imgCopy
, type, quality, crop
, options = arguments[1] || {}
, width = this.width
, height = this.height
, runtime // this has to be outside of all the closures to contain proper runtime
;
function onResize() {
// if possible, embed a canvas element directly
if (Env.can('create_canvas')) {
var canvas = imgCopy.getAsCanvas();
if (canvas) {
el.appendChild(canvas);
canvas = null;
imgCopy.destroy();
self.trigger('embedded');
return;
}
}
var dataUrl = imgCopy.getAsDataURL(type, quality);
if (!dataUrl) {
throw new x.ImageError(x.ImageError.WRONG_FORMAT);
}
if (Env.can('use_data_uri_of', dataUrl.length)) {
el.innerHTML = '<img src="' + dataUrl + '" width="' + imgCopy.width + '" height="' + imgCopy.height + '" />';
imgCopy.destroy();
self.trigger('embedded');
} else {
var tr = new Transporter();
tr.bind("TransportingComplete", function() {
runtime = self.connectRuntime(this.result.ruid);
self.bind("Embedded", function() {
// position and size properly
Basic.extend(runtime.getShimContainer().style, {
//position: 'relative',
top: '0px',
left: '0px',
width: imgCopy.width + 'px',
height: imgCopy.height + 'px'
});
// some shims (Flash/SilverLight) reinitialize, if parent element is hidden, reordered or it's
// position type changes (in Gecko), but since we basically need this only in IEs 6/7 and
// sometimes 8 and they do not have this problem, we can comment this for now
/*tr.bind("RuntimeInit", function(e, runtime) {
tr.destroy();
runtime.destroy();
onResize.call(self); // re-feed our image data
});*/
runtime = null;
}, 999);
runtime.exec.call(self, "ImageView", "display", this.result.uid, width, height);
imgCopy.destroy();
});
tr.transport(Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)), type, Basic.extend({}, options, {
required_caps: {
display_media: true
},
runtime_order: 'flash,silverlight',
container: el
}));
}
}
try {
if (!(el = Dom.get(el))) {
throw new x.DOMException(x.DOMException.INVALID_NODE_TYPE_ERR);
}
if (!this.size) { // only preloaded image objects can be used as source
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) {
throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR);
}
type = options.type || this.type || 'image/jpeg';
quality = options.quality || 90;
crop = Basic.typeOf(options.crop) !== 'undefined' ? options.crop : false;
// figure out dimensions for the thumb
if (options.width) {
width = options.width;
height = options.height || width;
} else {
// if container element has measurable dimensions, use them
var dimensions = Dom.getSize(el);
if (dimensions.w && dimensions.h) { // both should be > 0
width = dimensions.w;
height = dimensions.h;
}
}
imgCopy = new Image();
imgCopy.bind("Resize", function() {
onResize.call(self);
});
imgCopy.bind("Load", function() {
imgCopy.downsize(width, height, crop, false);
});
imgCopy.clone(this, false);
return imgCopy;
} catch(ex) {
// for now simply trigger error event
this.trigger('error', ex.code);
}
},
/**
Properly destroys the image and frees resources in use. If any. Recommended way to dispose mOxie.Image object.
@method destroy
*/
destroy: function() {
if (this.ruid) {
this.getRuntime().exec.call(this, 'Image', 'destroy');
this.disconnectRuntime();
}
this.unbindAll();
}
});
function _updateInfo(info) {
if (!info) {
info = this.getRuntime().exec.call(this, 'Image', 'getInfo');
}
this.size = info.size;
this.width = info.width;
this.height = info.height;
this.type = info.type;
this.meta = info.meta;
// update file name, only if empty
if (this.name === '') {
this.name = info.name;
}
}
function _load(src) {
var srcType = Basic.typeOf(src);
try {
// if source is Image
if (src instanceof Image) {
if (!src.size) { // only preloaded image objects can be used as source
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
_loadFromImage.apply(this, arguments);
}
// if source is o.Blob/o.File
else if (src instanceof Blob) {
if (!~Basic.inArray(src.type, ['image/jpeg', 'image/png'])) {
throw new x.ImageError(x.ImageError.WRONG_FORMAT);
}
_loadFromBlob.apply(this, arguments);
}
// if native blob/file
else if (Basic.inArray(srcType, ['blob', 'file']) !== -1) {
_load.call(this, new File(null, src), arguments[1]);
}
// if String
else if (srcType === 'string') {
// if dataUrl String
if (/^data:[^;]*;base64,/.test(src)) {
_load.call(this, new Blob(null, { data: src }), arguments[1]);
}
// else assume Url, either relative or absolute
else {
_loadFromUrl.apply(this, arguments);
}
}
// if source seems to be an img node
else if (srcType === 'node' && src.nodeName.toLowerCase() === 'img') {
_load.call(this, src.src, arguments[1]);
}
else {
throw new x.DOMException(x.DOMException.TYPE_MISMATCH_ERR);
}
} catch(ex) {
// for now simply trigger error event
this.trigger('error', ex.code);
}
}
function _loadFromImage(img, exact) {
var runtime = this.connectRuntime(img.ruid);
this.ruid = runtime.uid;
runtime.exec.call(this, 'Image', 'loadFromImage', img, (Basic.typeOf(exact) === 'undefined' ? true : exact));
}
function _loadFromBlob(blob, options) {
var self = this;
self.name = blob.name || '';
function exec(runtime) {
self.ruid = runtime.uid;
runtime.exec.call(self, 'Image', 'loadFromBlob', blob);
}
if (blob.isDetached()) {
this.bind('RuntimeInit', function(e, runtime) {
exec(runtime);
});
// convert to object representation
if (options && typeof(options.required_caps) === 'string') {
options.required_caps = Runtime.parseCaps(options.required_caps);
}
this.connectRuntime(Basic.extend({
required_caps: {
access_image_binary: true,
resize_image: true
}
}, options));
} else {
exec(this.connectRuntime(blob.ruid));
}
}
function _loadFromUrl(url, options) {
var self = this, xhr;
xhr = new XMLHttpRequest();
xhr.open('get', url);
xhr.responseType = 'blob';
xhr.onprogress = function(e) {
self.trigger(e);
};
xhr.onload = function() {
_loadFromBlob.call(self, xhr.response, true);
};
xhr.onerror = function(e) {
self.trigger(e);
};
xhr.onloadend = function() {
xhr.destroy();
};
xhr.bind('RuntimeError', function(e, err) {
self.trigger('RuntimeError', err);
});
xhr.send(null, options);
}
}
// virtual world will crash on you if image has a resolution higher than this:
Image.MAX_RESIZE_WIDTH = 6500;
Image.MAX_RESIZE_HEIGHT = 6500;
Image.prototype = EventTarget.instance;
return Image;
});
// 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/html5/utils/BinaryReader.js
/**
* BinaryReader.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/utils/BinaryReader
@private
*/
define("moxie/runtime/html5/utils/BinaryReader", [], function() {
return function() {
var II = false, bin;
// Private functions
function read(idx, size) {
var mv = II ? 0 : -8 * (size - 1), sum = 0, i;
for (i = 0; i < size; i++) {
sum |= (bin.charCodeAt(idx + i) << Math.abs(mv + i*8));
}
return sum;
}
function putstr(segment, idx, length) {
length = arguments.length === 3 ? length : bin.length - idx - 1;
bin = bin.substr(0, idx) + segment + bin.substr(length + idx);
}
function write(idx, num, size) {
var str = '', mv = II ? 0 : -8 * (size - 1), i;
for (i = 0; i < size; i++) {
str += String.fromCharCode((num >> Math.abs(mv + i*8)) & 255);
}
putstr(str, idx, size);
}
// Public functions
return {
II: function(order) {
if (order === undefined) {
return II;
} else {
II = order;
}
},
init: function(binData) {
II = false;
bin = binData;
},
SEGMENT: function(idx, length, segment) {
switch (arguments.length) {
case 1:
return bin.substr(idx, bin.length - idx - 1);
case 2:
return bin.substr(idx, length);
case 3:
putstr(segment, idx, length);
break;
default: return bin;
}
},
BYTE: function(idx) {
return read(idx, 1);
},
SHORT: function(idx) {
return read(idx, 2);
},
LONG: function(idx, num) {
if (num === undefined) {
return read(idx, 4);
} else {
write(idx, num, 4);
}
},
SLONG: function(idx) { // 2's complement notation
var num = read(idx, 4);
return (num > 2147483647 ? num - 4294967296 : num);
},
STRING: function(idx, size) {
var str = '';
for (size += idx; idx < size; idx++) {
str += String.fromCharCode(read(idx, 1));
}
return str;
}
};
};
});
// Included from: src/javascript/runtime/html5/image/JPEGHeaders.js
/**
* JPEGHeaders.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/image/JPEGHeaders
@private
*/
define("moxie/runtime/html5/image/JPEGHeaders", [
"moxie/runtime/html5/utils/BinaryReader"
], function(BinaryReader) {
return function JPEGHeaders(data) {
var headers = [], read, idx, marker, length = 0;
read = new BinaryReader();
read.init(data);
// Check if data is jpeg
if (read.SHORT(0) !== 0xFFD8) {
return;
}
idx = 2;
while (idx <= data.length) {
marker = read.SHORT(idx);
// omit RST (restart) markers
if (marker >= 0xFFD0 && marker <= 0xFFD7) {
idx += 2;
continue;
}
// no headers allowed after SOS marker
if (marker === 0xFFDA || marker === 0xFFD9) {
break;
}
length = read.SHORT(idx + 2) + 2;
// APPn marker detected
if (marker >= 0xFFE1 && marker <= 0xFFEF) {
headers.push({
hex: marker,
name: 'APP' + (marker & 0x000F),
start: idx,
length: length,
segment: read.SEGMENT(idx, length)
});
}
idx += length;
}
read.init(null); // free memory
return {
headers: headers,
restore: function(data) {
var max, i;
read.init(data);
idx = read.SHORT(2) == 0xFFE0 ? 4 + read.SHORT(4) : 2;
for (i = 0, max = headers.length; i < max; i++) {
read.SEGMENT(idx, 0, headers[i].segment);
idx += headers[i].length;
}
data = read.SEGMENT();
read.init(null);
return data;
},
strip: function(data) {
var headers, jpegHeaders, i;
jpegHeaders = new JPEGHeaders(data);
headers = jpegHeaders.headers;
jpegHeaders.purge();
read.init(data);
i = headers.length;
while (i--) {
read.SEGMENT(headers[i].start, headers[i].length, '');
}
data = read.SEGMENT();
read.init(null);
return data;
},
get: function(name) {
var array = [];
for (var i = 0, max = headers.length; i < max; i++) {
if (headers[i].name === name.toUpperCase()) {
array.push(headers[i].segment);
}
}
return array;
},
set: function(name, segment) {
var array = [], i, ii, max;
if (typeof(segment) === 'string') {
array.push(segment);
} else {
array = segment;
}
for (i = ii = 0, max = headers.length; i < max; i++) {
if (headers[i].name === name.toUpperCase()) {
headers[i].segment = array[ii];
headers[i].length = array[ii].length;
ii++;
}
if (ii >= array.length) {
break;
}
}
},
purge: function() {
headers = [];
read.init(null);
read = null;
}
};
};
});
// Included from: src/javascript/runtime/html5/image/ExifParser.js
/**
* ExifParser.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/image/ExifParser
@private
*/
define("moxie/runtime/html5/image/ExifParser", [
"moxie/core/utils/Basic",
"moxie/runtime/html5/utils/BinaryReader"
], function(Basic, BinaryReader) {
return function ExifParser() {
// Private ExifParser fields
var data, tags, Tiff, offsets = {}, tagDescs;
data = new BinaryReader();
tags = {
tiff : {
/*
The image orientation viewed in terms of rows and columns.
1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.
2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.
3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side.
4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side.
5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top.
6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top.
7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom.
8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom.
*/
0x0112: 'Orientation',
0x010E: 'ImageDescription',
0x010F: 'Make',
0x0110: 'Model',
0x0131: 'Software',
0x8769: 'ExifIFDPointer',
0x8825: 'GPSInfoIFDPointer'
},
exif : {
0x9000: 'ExifVersion',
0xA001: 'ColorSpace',
0xA002: 'PixelXDimension',
0xA003: 'PixelYDimension',
0x9003: 'DateTimeOriginal',
0x829A: 'ExposureTime',
0x829D: 'FNumber',
0x8827: 'ISOSpeedRatings',
0x9201: 'ShutterSpeedValue',
0x9202: 'ApertureValue' ,
0x9207: 'MeteringMode',
0x9208: 'LightSource',
0x9209: 'Flash',
0x920A: 'FocalLength',
0xA402: 'ExposureMode',
0xA403: 'WhiteBalance',
0xA406: 'SceneCaptureType',
0xA404: 'DigitalZoomRatio',
0xA408: 'Contrast',
0xA409: 'Saturation',
0xA40A: 'Sharpness'
},
gps : {
0x0000: 'GPSVersionID',
0x0001: 'GPSLatitudeRef',
0x0002: 'GPSLatitude',
0x0003: 'GPSLongitudeRef',
0x0004: 'GPSLongitude'
}
};
tagDescs = {
'ColorSpace': {
1: 'sRGB',
0: 'Uncalibrated'
},
'MeteringMode': {
0: 'Unknown',
1: 'Average',
2: 'CenterWeightedAverage',
3: 'Spot',
4: 'MultiSpot',
5: 'Pattern',
6: 'Partial',
255: 'Other'
},
'LightSource': {
1: 'Daylight',
2: 'Fliorescent',
3: 'Tungsten',
4: 'Flash',
9: 'Fine weather',
10: 'Cloudy weather',
11: 'Shade',
12: 'Daylight fluorescent (D 5700 - 7100K)',
13: 'Day white fluorescent (N 4600 -5400K)',
14: 'Cool white fluorescent (W 3900 - 4500K)',
15: 'White fluorescent (WW 3200 - 3700K)',
17: 'Standard light A',
18: 'Standard light B',
19: 'Standard light C',
20: 'D55',
21: 'D65',
22: 'D75',
23: 'D50',
24: 'ISO studio tungsten',
255: 'Other'
},
'Flash': {
0x0000: 'Flash did not fire.',
0x0001: 'Flash fired.',
0x0005: 'Strobe return light not detected.',
0x0007: 'Strobe return light detected.',
0x0009: 'Flash fired, compulsory flash mode',
0x000D: 'Flash fired, compulsory flash mode, return light not detected',
0x000F: 'Flash fired, compulsory flash mode, return light detected',
0x0010: 'Flash did not fire, compulsory flash mode',
0x0018: 'Flash did not fire, auto mode',
0x0019: 'Flash fired, auto mode',
0x001D: 'Flash fired, auto mode, return light not detected',
0x001F: 'Flash fired, auto mode, return light detected',
0x0020: 'No flash function',
0x0041: 'Flash fired, red-eye reduction mode',
0x0045: 'Flash fired, red-eye reduction mode, return light not detected',
0x0047: 'Flash fired, red-eye reduction mode, return light detected',
0x0049: 'Flash fired, compulsory flash mode, red-eye reduction mode',
0x004D: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected',
0x004F: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected',
0x0059: 'Flash fired, auto mode, red-eye reduction mode',
0x005D: 'Flash fired, auto mode, return light not detected, red-eye reduction mode',
0x005F: 'Flash fired, auto mode, return light detected, red-eye reduction mode'
},
'ExposureMode': {
0: 'Auto exposure',
1: 'Manual exposure',
2: 'Auto bracket'
},
'WhiteBalance': {
0: 'Auto white balance',
1: 'Manual white balance'
},
'SceneCaptureType': {
0: 'Standard',
1: 'Landscape',
2: 'Portrait',
3: 'Night scene'
},
'Contrast': {
0: 'Normal',
1: 'Soft',
2: 'Hard'
},
'Saturation': {
0: 'Normal',
1: 'Low saturation',
2: 'High saturation'
},
'Sharpness': {
0: 'Normal',
1: 'Soft',
2: 'Hard'
},
// GPS related
'GPSLatitudeRef': {
N: 'North latitude',
S: 'South latitude'
},
'GPSLongitudeRef': {
E: 'East longitude',
W: 'West longitude'
}
};
function extractTags(IFD_offset, tags2extract) {
var length = data.SHORT(IFD_offset), i, ii,
tag, type, count, tagOffset, offset, value, values = [], hash = {};
for (i = 0; i < length; i++) {
// Set binary reader pointer to beginning of the next tag
offset = tagOffset = IFD_offset + 12 * i + 2;
tag = tags2extract[data.SHORT(offset)];
if (tag === undefined) {
continue; // Not the tag we requested
}
type = data.SHORT(offset+=2);
count = data.LONG(offset+=2);
offset += 4;
values = [];
switch (type) {
case 1: // BYTE
case 7: // UNDEFINED
if (count > 4) {
offset = data.LONG(offset) + offsets.tiffHeader;
}
for (ii = 0; ii < count; ii++) {
values[ii] = data.BYTE(offset + ii);
}
break;
case 2: // STRING
if (count > 4) {
offset = data.LONG(offset) + offsets.tiffHeader;
}
hash[tag] = data.STRING(offset, count - 1);
continue;
case 3: // SHORT
if (count > 2) {
offset = data.LONG(offset) + offsets.tiffHeader;
}
for (ii = 0; ii < count; ii++) {
values[ii] = data.SHORT(offset + ii*2);
}
break;
case 4: // LONG
if (count > 1) {
offset = data.LONG(offset) + offsets.tiffHeader;
}
for (ii = 0; ii < count; ii++) {
values[ii] = data.LONG(offset + ii*4);
}
break;
case 5: // RATIONAL
offset = data.LONG(offset) + offsets.tiffHeader;
for (ii = 0; ii < count; ii++) {
values[ii] = data.LONG(offset + ii*4) / data.LONG(offset + ii*4 + 4);
}
break;
case 9: // SLONG
offset = data.LONG(offset) + offsets.tiffHeader;
for (ii = 0; ii < count; ii++) {
values[ii] = data.SLONG(offset + ii*4);
}
break;
case 10: // SRATIONAL
offset = data.LONG(offset) + offsets.tiffHeader;
for (ii = 0; ii < count; ii++) {
values[ii] = data.SLONG(offset + ii*4) / data.SLONG(offset + ii*4 + 4);
}
break;
default:
continue;
}
value = (count == 1 ? values[0] : values);
if (tagDescs.hasOwnProperty(tag) && typeof value != 'object') {
hash[tag] = tagDescs[tag][value];
} else {
hash[tag] = value;
}
}
return hash;
}
function getIFDOffsets() {
var idx = offsets.tiffHeader;
// Set read order of multi-byte data
data.II(data.SHORT(idx) == 0x4949);
// Check if always present bytes are indeed present
if (data.SHORT(idx+=2) !== 0x002A) {
return false;
}
offsets.IFD0 = offsets.tiffHeader + data.LONG(idx += 2);
Tiff = extractTags(offsets.IFD0, tags.tiff);
if ('ExifIFDPointer' in Tiff) {
offsets.exifIFD = offsets.tiffHeader + Tiff.ExifIFDPointer;
delete Tiff.ExifIFDPointer;
}
if ('GPSInfoIFDPointer' in Tiff) {
offsets.gpsIFD = offsets.tiffHeader + Tiff.GPSInfoIFDPointer;
delete Tiff.GPSInfoIFDPointer;
}
return true;
}
// At the moment only setting of simple (LONG) values, that do not require offset recalculation, is supported
function setTag(ifd, tag, value) {
var offset, length, tagOffset, valueOffset = 0;
// If tag name passed translate into hex key
if (typeof(tag) === 'string') {
var tmpTags = tags[ifd.toLowerCase()];
for (var hex in tmpTags) {
if (tmpTags[hex] === tag) {
tag = hex;
break;
}
}
}
offset = offsets[ifd.toLowerCase() + 'IFD'];
length = data.SHORT(offset);
for (var i = 0; i < length; i++) {
tagOffset = offset + 12 * i + 2;
if (data.SHORT(tagOffset) == tag) {
valueOffset = tagOffset + 8;
break;
}
}
if (!valueOffset) {
return false;
}
data.LONG(valueOffset, value);
return true;
}
// Public functions
return {
init: function(segment) {
// Reset internal data
offsets = {
tiffHeader: 10
};
if (segment === undefined || !segment.length) {
return false;
}
data.init(segment);
// Check if that's APP1 and that it has EXIF
if (data.SHORT(0) === 0xFFE1 && data.STRING(4, 5).toUpperCase() === "EXIF\0") {
return getIFDOffsets();
}
return false;
},
TIFF: function() {
return Tiff;
},
EXIF: function() {
var Exif;
// Populate EXIF hash
Exif = extractTags(offsets.exifIFD, tags.exif);
// Fix formatting of some tags
if (Exif.ExifVersion && Basic.typeOf(Exif.ExifVersion) === 'array') {
for (var i = 0, exifVersion = ''; i < Exif.ExifVersion.length; i++) {
exifVersion += String.fromCharCode(Exif.ExifVersion[i]);
}
Exif.ExifVersion = exifVersion;
}
return Exif;
},
GPS: function() {
var GPS;
GPS = extractTags(offsets.gpsIFD, tags.gps);
// iOS devices (and probably some others) do not put in GPSVersionID tag (why?..)
if (GPS.GPSVersionID && Basic.typeOf(GPS.GPSVersionID) === 'array') {
GPS.GPSVersionID = GPS.GPSVersionID.join('.');
}
return GPS;
},
setExif: function(tag, value) {
// Right now only setting of width/height is possible
if (tag !== 'PixelXDimension' && tag !== 'PixelYDimension') {return false;}
return setTag('exif', tag, value);
},
getBinary: function() {
return data.SEGMENT();
},
purge: function() {
data.init(null);
data = Tiff = null;
offsets = {};
}
};
};
});
// Included from: src/javascript/runtime/html5/image/JPEG.js
/**
* JPEG.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/image/JPEG
@private
*/
define("moxie/runtime/html5/image/JPEG", [
"moxie/core/utils/Basic",
"moxie/core/Exceptions",
"moxie/runtime/html5/image/JPEGHeaders",
"moxie/runtime/html5/utils/BinaryReader",
"moxie/runtime/html5/image/ExifParser"
], function(Basic, x, JPEGHeaders, BinaryReader, ExifParser) {
function JPEG(binstr) {
var _binstr, _br, _hm, _ep, _info, hasExif;
function _getDimensions() {
var idx = 0, marker, length;
// examine all through the end, since some images might have very large APP segments
while (idx <= _binstr.length) {
marker = _br.SHORT(idx += 2);
if (marker >= 0xFFC0 && marker <= 0xFFC3) { // SOFn
idx += 5; // marker (2 bytes) + length (2 bytes) + Sample precision (1 byte)
return {
height: _br.SHORT(idx),
width: _br.SHORT(idx += 2)
};
}
length = _br.SHORT(idx += 2);
idx += length - 2;
}
return null;
}
_binstr = binstr;
_br = new BinaryReader();
_br.init(_binstr);
// check if it is jpeg
if (_br.SHORT(0) !== 0xFFD8) {
throw new x.ImageError(x.ImageError.WRONG_FORMAT);
}
// backup headers
_hm = new JPEGHeaders(binstr);
// extract exif info
_ep = new ExifParser();
hasExif = !!_ep.init(_hm.get('app1')[0]);
// get dimensions
_info = _getDimensions.call(this);
Basic.extend(this, {
type: 'image/jpeg',
size: _binstr.length,
width: _info && _info.width || 0,
height: _info && _info.height || 0,
setExif: function(tag, value) {
if (!hasExif) {
return false; // or throw an exception
}
if (Basic.typeOf(tag) === 'object') {
Basic.each(tag, function(value, tag) {
_ep.setExif(tag, value);
});
} else {
_ep.setExif(tag, value);
}
// update internal headers
_hm.set('app1', _ep.getBinary());
},
writeHeaders: function() {
if (!arguments.length) {
// if no arguments passed, update headers internally
return (_binstr = _hm.restore(_binstr));
}
return _hm.restore(arguments[0]);
},
stripHeaders: function(binstr) {
return _hm.strip(binstr);
},
purge: function() {
_purge.call(this);
}
});
if (hasExif) {
this.meta = {
tiff: _ep.TIFF(),
exif: _ep.EXIF(),
gps: _ep.GPS()
};
}
function _purge() {
if (!_ep || !_hm || !_br) {
return; // ignore any repeating purge requests
}
_ep.purge();
_hm.purge();
_br.init(null);
_binstr = _info = _hm = _ep = _br = null;
}
}
return JPEG;
});
// Included from: src/javascript/runtime/html5/image/PNG.js
/**
* PNG.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/image/PNG
@private
*/
define("moxie/runtime/html5/image/PNG", [
"moxie/core/Exceptions",
"moxie/core/utils/Basic",
"moxie/runtime/html5/utils/BinaryReader"
], function(x, Basic, BinaryReader) {
function PNG(binstr) {
var _binstr, _br, _hm, _ep, _info;
_binstr = binstr;
_br = new BinaryReader();
_br.init(_binstr);
// check if it's png
(function() {
var idx = 0, i = 0
, signature = [0x8950, 0x4E47, 0x0D0A, 0x1A0A]
;
for (i = 0; i < signature.length; i++, idx += 2) {
if (signature[i] != _br.SHORT(idx)) {
throw new x.ImageError(x.ImageError.WRONG_FORMAT);
}
}
}());
function _getDimensions() {
var chunk, idx;
chunk = _getChunkAt.call(this, 8);
if (chunk.type == 'IHDR') {
idx = chunk.start;
return {
width: _br.LONG(idx),
height: _br.LONG(idx += 4)
};
}
return null;
}
function _purge() {
if (!_br) {
return; // ignore any repeating purge requests
}
_br.init(null);
_binstr = _info = _hm = _ep = _br = null;
}
_info = _getDimensions.call(this);
Basic.extend(this, {
type: 'image/png',
size: _binstr.length,
width: _info.width,
height: _info.height,
purge: function() {
_purge.call(this);
}
});
// for PNG we can safely trigger purge automatically, as we do not keep any data for later
_purge.call(this);
function _getChunkAt(idx) {
var length, type, start, CRC;
length = _br.LONG(idx);
type = _br.STRING(idx += 4, 4);
start = idx += 4;
CRC = _br.LONG(idx + length);
return {
length: length,
type: type,
start: start,
CRC: CRC
};
}
}
return PNG;
});
// Included from: src/javascript/runtime/html5/image/ImageInfo.js
/**
* ImageInfo.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/image/ImageInfo
@private
*/
define("moxie/runtime/html5/image/ImageInfo", [
"moxie/core/utils/Basic",
"moxie/core/Exceptions",
"moxie/runtime/html5/image/JPEG",
"moxie/runtime/html5/image/PNG"
], function(Basic, x, JPEG, PNG) {
/**
Optional image investigation tool for HTML5 runtime. Provides the following features:
- ability to distinguish image type (JPEG or PNG) by signature
- ability to extract image width/height directly from it's internals, without preloading in memory (fast)
- ability to extract APP headers from JPEGs (Exif, GPS, etc)
- ability to replace width/height tags in extracted JPEG headers
- ability to restore APP headers, that were for example stripped during image manipulation
@class ImageInfo
@constructor
@param {String} binstr Image source as binary string
*/
return function(binstr) {
var _cs = [JPEG, PNG], _img;
// figure out the format, throw: ImageError.WRONG_FORMAT if not supported
_img = (function() {
for (var i = 0; i < _cs.length; i++) {
try {
return new _cs[i](binstr);
} catch (ex) {
// console.info(ex);
}
}
throw new x.ImageError(x.ImageError.WRONG_FORMAT);
}());
Basic.extend(this, {
/**
Image Mime Type extracted from it's depths
@property type
@type {String}
@default ''
*/
type: '',
/**
Image size in bytes
@property size
@type {Number}
@default 0
*/
size: 0,
/**
Image width extracted from image source
@property width
@type {Number}
@default 0
*/
width: 0,
/**
Image height extracted from image source
@property height
@type {Number}
@default 0
*/
height: 0,
/**
Sets Exif tag. Currently applicable only for width and height tags. Obviously works only with JPEGs.
@method setExif
@param {String} tag Tag to set
@param {Mixed} value Value to assign to the tag
*/
setExif: function() {},
/**
Restores headers to the source.
@method writeHeaders
@param {String} data Image source as binary string
@return {String} Updated binary string
*/
writeHeaders: function(data) {
return data;
},
/**
Strip all headers from the source.
@method stripHeaders
@param {String} data Image source as binary string
@return {String} Updated binary string
*/
stripHeaders: function(data) {
return data;
},
/**
Dispose resources.
@method purge
*/
purge: function() {}
});
Basic.extend(this, _img);
this.purge = function() {
_img.purge();
_img = null;
};
};
});
// Included from: src/javascript/runtime/html5/image/MegaPixel.js
/**
(The MIT License)
Copyright (c) 2012 Shinichi Tomita <[email protected]>;
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.
*/
/**
* Mega pixel image rendering library for iOS6 Safari
*
* Fixes iOS6 Safari's image file rendering issue for large size image (over mega-pixel),
* which causes unexpected subsampling when drawing it in canvas.
* By using this library, you can safely render the image with proper stretching.
*
* Copyright (c) 2012 Shinichi Tomita <[email protected]>
* Released under the MIT license
*/
/**
@class moxie/runtime/html5/image/MegaPixel
@private
*/
define("moxie/runtime/html5/image/MegaPixel", [], function() {
/**
* Rendering image element (with resizing) into the canvas element
*/
function renderImageToCanvas(img, canvas, options) {
var iw = img.naturalWidth, ih = img.naturalHeight;
var width = options.width, height = options.height;
var x = options.x || 0, y = options.y || 0;
var ctx = canvas.getContext('2d');
if (detectSubsampling(img)) {
iw /= 2;
ih /= 2;
}
var d = 1024; // size of tiling canvas
var tmpCanvas = document.createElement('canvas');
tmpCanvas.width = tmpCanvas.height = d;
var tmpCtx = tmpCanvas.getContext('2d');
var vertSquashRatio = detectVerticalSquash(img, iw, ih);
var sy = 0;
while (sy < ih) {
var sh = sy + d > ih ? ih - sy : d;
var sx = 0;
while (sx < iw) {
var sw = sx + d > iw ? iw - sx : d;
tmpCtx.clearRect(0, 0, d, d);
tmpCtx.drawImage(img, -sx, -sy);
var dx = (sx * width / iw + x) << 0;
var dw = Math.ceil(sw * width / iw);
var dy = (sy * height / ih / vertSquashRatio + y) << 0;
var dh = Math.ceil(sh * height / ih / vertSquashRatio);
ctx.drawImage(tmpCanvas, 0, 0, sw, sh, dx, dy, dw, dh);
sx += d;
}
sy += d;
}
tmpCanvas = tmpCtx = null;
}
/**
* Detect subsampling in loaded image.
* In iOS, larger images than 2M pixels may be subsampled in rendering.
*/
function detectSubsampling(img) {
var iw = img.naturalWidth, ih = img.naturalHeight;
if (iw * ih > 1024 * 1024) { // subsampling may happen over megapixel image
var canvas = document.createElement('canvas');
canvas.width = canvas.height = 1;
var ctx = canvas.getContext('2d');
ctx.drawImage(img, -iw + 1, 0);
// subsampled image becomes half smaller in rendering size.
// check alpha channel value to confirm image is covering edge pixel or not.
// if alpha value is 0 image is not covering, hence subsampled.
return ctx.getImageData(0, 0, 1, 1).data[3] === 0;
} else {
return false;
}
}
/**
* Detecting vertical squash in loaded image.
* Fixes a bug which squash image vertically while drawing into canvas for some images.
*/
function detectVerticalSquash(img, iw, ih) {
var canvas = document.createElement('canvas');
canvas.width = 1;
canvas.height = ih;
var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
var data = ctx.getImageData(0, 0, 1, ih).data;
// search image edge pixel position in case it is squashed vertically.
var sy = 0;
var ey = ih;
var py = ih;
while (py > sy) {
var alpha = data[(py - 1) * 4 + 3];
if (alpha === 0) {
ey = py;
} else {
sy = py;
}
py = (ey + sy) >> 1;
}
canvas = null;
var ratio = (py / ih);
return (ratio === 0) ? 1 : ratio;
}
return {
isSubsampled: detectSubsampling,
renderTo: renderImageToCanvas
};
});
// Included from: src/javascript/runtime/html5/image/Image.js
/**
* Image.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/image/Image
@private
*/
define("moxie/runtime/html5/image/Image", [
"moxie/runtime/html5/Runtime",
"moxie/core/utils/Basic",
"moxie/core/Exceptions",
"moxie/core/utils/Encode",
"moxie/file/File",
"moxie/runtime/html5/image/ImageInfo",
"moxie/runtime/html5/image/MegaPixel",
"moxie/core/utils/Mime",
"moxie/core/utils/Env"
], function(extensions, Basic, x, Encode, File, ImageInfo, MegaPixel, Mime, Env) {
function HTML5Image() {
var me = this
, _img, _imgInfo, _canvas, _binStr, _blob
, _modified = false // is set true whenever image is modified
, _preserveHeaders = true
;
Basic.extend(this, {
loadFromBlob: function(blob) {
var comp = this, I = comp.getRuntime()
, asBinary = arguments.length > 1 ? arguments[1] : true
;
if (!I.can('access_binary')) {
throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR);
}
_blob = blob;
if (blob.isDetached()) {
_binStr = blob.getSource();
_preload.call(this, _binStr);
return;
} else {
_readAsDataUrl.call(this, blob.getSource(), function(dataUrl) {
if (asBinary) {
_binStr = _toBinary(dataUrl);
}
_preload.call(comp, dataUrl);
});
}
},
loadFromImage: function(img, exact) {
this.meta = img.meta;
_blob = new File(null, {
name: img.name,
size: img.size,
type: img.type
});
_preload.call(this, exact ? (_binStr = img.getAsBinaryString()) : img.getAsDataURL());
},
getInfo: function() {
var I = this.getRuntime(), info;
if (!_imgInfo && _binStr && I.can('access_image_binary')) {
_imgInfo = new ImageInfo(_binStr);
}
info = {
width: _getImg().width || 0,
height: _getImg().height || 0,
type: _blob.type || Mime.getFileMime(_blob.name),
size: _binStr && _binStr.length || _blob.size || 0,
name: _blob.name || '',
meta: _imgInfo && _imgInfo.meta || this.meta || {}
};
return info;
},
downsize: function() {
_downsize.apply(this, arguments);
},
getAsCanvas: function() {
if (_canvas) {
_canvas.id = this.uid + '_canvas';
}
return _canvas;
},
getAsBlob: function(type, quality) {
if (type !== this.type) {
// if different mime type requested prepare image for conversion
_downsize.call(this, this.width, this.height, false);
}
return new File(null, {
name: _blob.name || '',
type: type,
data: me.getAsBinaryString.call(this, type, quality)
});
},
getAsDataURL: function(type) {
var quality = arguments[1] || 90;
// if image has not been modified, return the source right away
if (!_modified) {
return _img.src;
}
if ('image/jpeg' !== type) {
return _canvas.toDataURL('image/png');
} else {
try {
// older Geckos used to result in an exception on quality argument
return _canvas.toDataURL('image/jpeg', quality/100);
} catch (ex) {
return _canvas.toDataURL('image/jpeg');
}
}
},
getAsBinaryString: function(type, quality) {
// if image has not been modified, return the source right away
if (!_modified) {
// if image was not loaded from binary string
if (!_binStr) {
_binStr = _toBinary(me.getAsDataURL(type, quality));
}
return _binStr;
}
if ('image/jpeg' !== type) {
_binStr = _toBinary(me.getAsDataURL(type, quality));
} else {
var dataUrl;
// if jpeg
if (!quality) {
quality = 90;
}
try {
// older Geckos used to result in an exception on quality argument
dataUrl = _canvas.toDataURL('image/jpeg', quality/100);
} catch (ex) {
dataUrl = _canvas.toDataURL('image/jpeg');
}
_binStr = _toBinary(dataUrl);
if (_imgInfo) {
_binStr = _imgInfo.stripHeaders(_binStr);
if (_preserveHeaders) {
// update dimensions info in exif
if (_imgInfo.meta && _imgInfo.meta.exif) {
_imgInfo.setExif({
PixelXDimension: this.width,
PixelYDimension: this.height
});
}
// re-inject the headers
_binStr = _imgInfo.writeHeaders(_binStr);
}
// will be re-created from fresh on next getInfo call
_imgInfo.purge();
_imgInfo = null;
}
}
_modified = false;
return _binStr;
},
destroy: function() {
me = null;
_purge.call(this);
this.getRuntime().getShim().removeInstance(this.uid);
}
});
function _getImg() {
if (!_canvas && !_img) {
throw new x.ImageError(x.DOMException.INVALID_STATE_ERR);
}
return _canvas || _img;
}
function _toBinary(str) {
return Encode.atob(str.substring(str.indexOf('base64,') + 7));
}
function _toDataUrl(str, type) {
return 'data:' + (type || '') + ';base64,' + Encode.btoa(str);
}
function _preload(str) {
var comp = this;
_img = new Image();
_img.onerror = function() {
_purge.call(this);
comp.trigger('error', x.ImageError.WRONG_FORMAT);
};
_img.onload = function() {
comp.trigger('load');
};
_img.src = /^data:[^;]*;base64,/.test(str) ? str : _toDataUrl(str, _blob.type);
}
function _readAsDataUrl(file, callback) {
var comp = this, fr;
// use FileReader if it's available
if (window.FileReader) {
fr = new FileReader();
fr.onload = function() {
callback(this.result);
};
fr.onerror = function() {
comp.trigger('error', x.ImageError.WRONG_FORMAT);
};
fr.readAsDataURL(file);
} else {
return callback(file.getAsDataURL());
}
}
function _downsize(width, height, crop, preserveHeaders) {
var self = this
, scale
, mathFn
, x = 0
, y = 0
, img
, destWidth
, destHeight
, orientation
;
_preserveHeaders = preserveHeaders; // we will need to check this on export (see getAsBinaryString())
// take into account orientation tag
orientation = (this.meta && this.meta.tiff && this.meta.tiff.Orientation) || 1;
if (Basic.inArray(orientation, [5,6,7,8]) !== -1) { // values that require 90 degree rotation
// swap dimensions
var tmp = width;
width = height;
height = tmp;
}
img = _getImg();
// unify dimensions
if (!crop) {
scale = Math.min(width/img.width, height/img.height);
} else {
// one of the dimensions may exceed the actual image dimensions - we need to take the smallest value
width = Math.min(width, img.width);
height = Math.min(height, img.height);
scale = Math.max(width/img.width, height/img.height);
}
// we only downsize here
if (scale > 1 && !crop && preserveHeaders) {
this.trigger('Resize');
return;
}
// prepare canvas if necessary
if (!_canvas) {
_canvas = document.createElement("canvas");
}
// calculate dimensions of proportionally resized image
destWidth = Math.round(img.width * scale);
destHeight = Math.round(img.height * scale);
// scale image and canvas
if (crop) {
_canvas.width = width;
_canvas.height = height;
// if dimensions of the resulting image still larger than canvas, center it
if (destWidth > width) {
x = Math.round((destWidth - width) / 2);
}
if (destHeight > height) {
y = Math.round((destHeight - height) / 2);
}
} else {
_canvas.width = destWidth;
_canvas.height = destHeight;
}
// rotate if required, according to orientation tag
if (!_preserveHeaders) {
_rotateToOrientaion(_canvas.width, _canvas.height, orientation);
}
_drawToCanvas.call(this, img, _canvas, -x, -y, destWidth, destHeight);
this.width = _canvas.width;
this.height = _canvas.height;
_modified = true;
self.trigger('Resize');
}
function _drawToCanvas(img, canvas, x, y, w, h) {
if (Env.OS === 'iOS') {
// avoid squish bug in iOS6
MegaPixel.renderTo(img, canvas, { width: w, height: h, x: x, y: y });
} else {
var ctx = canvas.getContext('2d');
ctx.drawImage(img, x, y, w, h);
}
}
/**
* Transform canvas coordination according to specified frame size and orientation
* Orientation value is from EXIF tag
* @author Shinichi Tomita <[email protected]>
*/
function _rotateToOrientaion(width, height, orientation) {
switch (orientation) {
case 5:
case 6:
case 7:
case 8:
_canvas.width = height;
_canvas.height = width;
break;
default:
_canvas.width = width;
_canvas.height = height;
}
/**
1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.
2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.
3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side.
4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side.
5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top.
6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top.
7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom.
8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom.
*/
var ctx = _canvas.getContext('2d');
switch (orientation) {
case 2:
// horizontal flip
ctx.translate(width, 0);
ctx.scale(-1, 1);
break;
case 3:
// 180 rotate left
ctx.translate(width, height);
ctx.rotate(Math.PI);
break;
case 4:
// vertical flip
ctx.translate(0, height);
ctx.scale(1, -1);
break;
case 5:
// vertical flip + 90 rotate right
ctx.rotate(0.5 * Math.PI);
ctx.scale(1, -1);
break;
case 6:
// 90 rotate right
ctx.rotate(0.5 * Math.PI);
ctx.translate(0, -height);
break;
case 7:
// horizontal flip + 90 rotate right
ctx.rotate(0.5 * Math.PI);
ctx.translate(width, -height);
ctx.scale(-1, 1);
break;
case 8:
// 90 rotate left
ctx.rotate(-0.5 * Math.PI);
ctx.translate(-width, 0);
break;
}
}
function _purge() {
if (_imgInfo) {
_imgInfo.purge();
_imgInfo = null;
}
_binStr = _img = _canvas = _blob = null;
_modified = false;
}
}
return (extensions.Image = HTML5Image);
});
// Included from: src/javascript/runtime/html4/image/Image.js
/**
* Image.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/image/Image
@private
*/
define("moxie/runtime/html4/image/Image", [
"moxie/runtime/html4/Runtime",
"moxie/runtime/html5/image/Image"
], function(extensions, Image) {
return (extensions.Image = Image);
});
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/image/Image","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);
|
ajax/libs/swagger-ui/3.20.5/swagger-ui-bundle.js | extend1994/cdnjs | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=446)}([function(e,t,n){"use strict";e.exports=n(75)},function(e,t,n){e.exports=n(854)()},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(263),i=(r=o)&&r.__esModule?r:{default:r};t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},function(e,t,n){e.exports={default:n(767),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(45),i=(r=o)&&r.__esModule?r:{default:r};t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){"use strict";t.__esModule=!0;var r=a(n(769)),o=a(n(350)),i=a(n(45));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,i.default)(t)));e.prototype=(0,o.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(r.default?(0,r.default)(e,t):e.__proto__=t)}},function(e,t,n){var r;r=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:J(e)}function r(e){return u(e)?e:Y(e)}function o(e){return s(e)?e:K(e)}function i(e){return a(e)&&!l(e)?e:G(e)}function a(e){return!(!e||!e[f])}function u(e){return!(!e||!e[p])}function s(e){return!(!e||!e[d])}function l(e){return u(e)||s(e)}function c(e){return!(!e||!e[h])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=u,n.isIndexed=s,n.isAssociative=l,n.isOrdered=c,n.Keyed=r,n.Indexed=o,n.Set=i;var f="@@__IMMUTABLE_ITERABLE__@@",p="@@__IMMUTABLE_KEYED__@@",d="@@__IMMUTABLE_INDEXED__@@",h="@@__IMMUTABLE_ORDERED__@@",v=5,m=1<<v,g=m-1,y={},b={value:!1},_={value:!1};function w(e){return e.value=!1,e}function E(e){e&&(e.value=!0)}function x(){}function S(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function C(e){return void 0===e.size&&(e.size=e.__iterate(A)),e.size}function k(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?C(e)+t:t}function A(){return!0}function O(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function P(e,t){return M(e,t,0)}function T(e,t){return M(e,t,t)}function M(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var I=0,j=1,N=2,R="function"==typeof Symbol&&Symbol.iterator,D="@@iterator",L=R||D;function U(e){this.next=e}function q(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function F(){return{value:void 0,done:!0}}function z(e){return!!H(e)}function B(e){return e&&"function"==typeof e.next}function V(e){var t=H(e);return t&&t.call(e)}function H(e){var t=e&&(R&&e[R]||e[D]);if("function"==typeof t)return t}function W(e){return e&&"number"==typeof e.length}function J(e){return null===e||void 0===e?ie():a(e)?e.toSeq():function(e){var t=se(e)||"object"==typeof e&&new te(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function Y(e){return null===e||void 0===e?ie().toKeyedSeq():a(e)?u(e)?e.toSeq():e.fromEntrySeq():ae(e)}function K(e){return null===e||void 0===e?ie():a(e)?u(e)?e.entrySeq():e.toIndexedSeq():ue(e)}function G(e){return(null===e||void 0===e?ie():a(e)?u(e)?e.entrySeq():e:ue(e)).toSetSeq()}U.prototype.toString=function(){return"[Iterator]"},U.KEYS=I,U.VALUES=j,U.ENTRIES=N,U.prototype.inspect=U.prototype.toSource=function(){return this.toString()},U.prototype[L]=function(){return this},t(J,n),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},J.prototype.__iterate=function(e,t){return le(this,e,t,!0)},J.prototype.__iterator=function(e,t){return ce(this,e,t,!0)},t(Y,J),Y.prototype.toKeyedSeq=function(){return this},t(K,J),K.of=function(){return K(arguments)},K.prototype.toIndexedSeq=function(){return this},K.prototype.toString=function(){return this.__toString("Seq [","]")},K.prototype.__iterate=function(e,t){return le(this,e,t,!1)},K.prototype.__iterator=function(e,t){return ce(this,e,t,!1)},t(G,J),G.of=function(){return G(arguments)},G.prototype.toSetSeq=function(){return this},J.isSeq=oe,J.Keyed=Y,J.Set=G,J.Indexed=K;var $,Z,X,Q="@@__IMMUTABLE_SEQ__@@";function ee(e){this._array=e,this.size=e.length}function te(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function ne(e){this._iterable=e,this.size=e.length||e.size}function re(e){this._iterator=e,this._iteratorCache=[]}function oe(e){return!(!e||!e[Q])}function ie(){return $||($=new ee([]))}function ae(e){var t=Array.isArray(e)?new ee(e).fromEntrySeq():B(e)?new re(e).fromEntrySeq():z(e)?new ne(e).fromEntrySeq():"object"==typeof e?new te(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function ue(e){var t=se(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function se(e){return W(e)?new ee(e):B(e)?new re(e):z(e)?new ne(e):void 0}function le(e,t,n,r){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var u=o[n?i-a:a];if(!1===t(u[1],r?u[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function ce(e,t,n,r){var o=e._cache;if(o){var i=o.length-1,a=0;return new U(function(){var e=o[n?i-a:a];return a++>i?{value:void 0,done:!0}:q(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function fe(e,t){return t?function e(t,n,r,o){if(Array.isArray(n))return t.call(o,r,K(n).map(function(r,o){return e(t,r,o,n)}));if(de(n))return t.call(o,r,Y(n).map(function(r,o){return e(t,r,o,n)}));return n}(t,e,"",{"":e}):pe(e)}function pe(e){return Array.isArray(e)?K(e).map(pe).toList():de(e)?Y(e).map(pe).toMap():e}function de(e){return e&&(e.constructor===Object||void 0===e.constructor)}function he(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function ve(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||u(e)!==u(t)||s(e)!==s(t)||c(e)!==c(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!l(e);if(c(e)){var r=e.entries();return t.every(function(e,t){var o=r.next().value;return o&&he(o[1],e)&&(n||he(o[0],t))})&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var f=!0,p=t.__iterate(function(t,r){if(n?!e.has(t):o?!he(t,e.get(r,y)):!he(e.get(r,y),t))return f=!1,!1});return f&&e.size===p}function me(e,t){if(!(this instanceof me))return new me(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(Z)return Z;Z=this}}function ge(e,t){if(!e)throw new Error(t)}function ye(e,t,n){if(!(this instanceof ye))return new ye(e,t,n);if(ge(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(X)return X;X=this}}function be(){throw TypeError("Abstract")}function _e(){}function we(){}function Ee(){}J.prototype[Q]=!0,t(ee,K),ee.prototype.get=function(e,t){return this.has(e)?this._array[k(this,e)]:t},ee.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},ee.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new U(function(){return o>r?{value:void 0,done:!0}:q(e,o,n[t?r-o++:o++])})},t(te,Y),te.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},te.prototype.has=function(e){return this._object.hasOwnProperty(e)},te.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[t?o-i:i];if(!1===e(n[a],a,this))return i+1}return i},te.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,i=0;return new U(function(){var a=r[t?o-i:i];return i++>o?{value:void 0,done:!0}:q(e,a,n[a])})},te.prototype[h]=!0,t(ne,K),ne.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=V(this._iterable),r=0;if(B(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},ne.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=V(this._iterable);if(!B(n))return new U(F);var r=0;return new U(function(){var t=n.next();return t.done?t:q(e,r++,t.value)})},t(re,K),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,i=0;i<o.length;)if(!1===e(o[i],i++,this))return i;for(;!(n=r.next()).done;){var a=n.value;if(o[i]=a,!1===e(a,i++,this))break}return i},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new U(function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return q(e,o,r[o++])})},t(me,K),me.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},me.prototype.get=function(e,t){return this.has(e)?this._value:t},me.prototype.includes=function(e){return he(this._value,e)},me.prototype.slice=function(e,t){var n=this.size;return O(e,t,n)?this:new me(this._value,T(t,n)-P(e,n))},me.prototype.reverse=function(){return this},me.prototype.indexOf=function(e){return he(this._value,e)?0:-1},me.prototype.lastIndexOf=function(e){return he(this._value,e)?this.size:-1},me.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},me.prototype.__iterator=function(e,t){var n=this,r=0;return new U(function(){return r<n.size?q(e,r++,n._value):{value:void 0,done:!0}})},me.prototype.equals=function(e){return e instanceof me?he(this._value,e._value):ve(e)},t(ye,K),ye.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},ye.prototype.get=function(e,t){return this.has(e)?this._start+k(this,e)*this._step:t},ye.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},ye.prototype.slice=function(e,t){return O(e,t,this.size)?this:(e=P(e,this.size),(t=T(t,this.size))<=e?new ye(0,0):new ye(this.get(e,this._end),this.get(t,this._end),this._step))},ye.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},ye.prototype.lastIndexOf=function(e){return this.indexOf(e)},ye.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;i<=n;i++){if(!1===e(o,i,this))return i+1;o+=t?-r:r}return i},ye.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;return new U(function(){var a=o;return o+=t?-r:r,i>n?{value:void 0,done:!0}:q(e,i++,a)})},ye.prototype.equals=function(e){return e instanceof ye?this._start===e._start&&this._end===e._end&&this._step===e._step:ve(this,e)},t(be,n),t(_e,be),t(we,be),t(Ee,be),be.Keyed=_e,be.Indexed=we,be.Set=Ee;var xe="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Se(e){return e>>>1&1073741824|3221225471&e}function Ce(e){if(!1===e||null===e||void 0===e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null===e||void 0===e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return Se(n)}if("string"===t)return e.length>je?function(e){var t=De[e];void 0===t&&(t=ke(e),Re===Ne&&(Re=0,De={}),Re++,De[e]=t);return t}(e):ke(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(Te&&void 0!==(t=Pe.get(e)))return t;if(void 0!==(t=e[Ie]))return t;if(!Oe){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Ie]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}t=++Me,1073741824&Me&&(Me=0);if(Te)Pe.set(e,t);else{if(void 0!==Ae&&!1===Ae(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Oe)Object.defineProperty(e,Ie,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Ie]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Ie]=t}}return t}(e);if("function"==typeof e.toString)return ke(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ke(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Se(t)}var Ae=Object.isExtensible,Oe=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();var Pe,Te="function"==typeof WeakMap;Te&&(Pe=new WeakMap);var Me=0,Ie="__immutablehash__";"function"==typeof Symbol&&(Ie=Symbol(Ie));var je=16,Ne=255,Re=0,De={};function Le(e){ge(e!==1/0,"Cannot perform this action with an infinite size.")}function Ue(e){return null===e||void 0===e?Xe():qe(e)&&!c(e)?e:Xe().withMutations(function(t){var n=r(e);Le(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function qe(e){return!(!e||!e[ze])}t(Ue,_e),Ue.of=function(){var t=e.call(arguments,0);return Xe().withMutations(function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}})},Ue.prototype.toString=function(){return this.__toString("Map {","}")},Ue.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Ue.prototype.set=function(e,t){return Qe(this,e,t)},Ue.prototype.setIn=function(e,t){return this.updateIn(e,y,function(){return t})},Ue.prototype.remove=function(e){return Qe(this,e,y)},Ue.prototype.deleteIn=function(e){return this.updateIn(e,function(){return y})},Ue.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Ue.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=function e(t,n,r,o){var i=t===y;var a=n.next();if(a.done){var u=i?r:t,s=o(u);return s===u?t:s}ge(i||t&&t.set,"invalid keyPath");var l=a.value;var c=i?y:t.get(l,y);var f=e(c,n,r,o);return f===c?t:f===y?t.remove(l):(i?Xe():t).set(l,f)}(this,nn(e),t,n);return r===y?void 0:r},Ue.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Xe()},Ue.prototype.merge=function(){return rt(this,void 0,arguments)},Ue.prototype.mergeWith=function(t){return rt(this,t,e.call(arguments,1))},Ue.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Xe(),function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]})},Ue.prototype.mergeDeep=function(){return rt(this,ot,arguments)},Ue.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return rt(this,it(t),n)},Ue.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Xe(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]})},Ue.prototype.sort=function(e){return Pt(Wt(this,e))},Ue.prototype.sortBy=function(e,t){return Pt(Wt(this,t,e))},Ue.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Ue.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new x)},Ue.prototype.asImmutable=function(){return this.__ensureOwner()},Ue.prototype.wasAltered=function(){return this.__altered},Ue.prototype.__iterator=function(e,t){return new Ke(this,e,t)},Ue.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},Ue.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ze(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Ue.isMap=qe;var Fe,ze="@@__IMMUTABLE_MAP__@@",Be=Ue.prototype;function Ve(e,t){this.ownerID=e,this.entries=t}function He(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function We(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Je(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Ye(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function Ke(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&$e(e._root)}function Ge(e,t){return q(e,t[0],t[1])}function $e(e,t){return{node:e,index:0,__prev:t}}function Ze(e,t,n,r){var o=Object.create(Be);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Xe(){return Fe||(Fe=Ze(0))}function Qe(e,t,n){var r,o;if(e._root){var i=w(b),a=w(_);if(r=et(e._root,e.__ownerID,0,void 0,t,n,i,a),!a.value)return e;o=e.size+(i.value?n===y?-1:1:0)}else{if(n===y)return e;o=1,r=new Ve(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Ze(o,r):Xe()}function et(e,t,n,r,o,i,a,u){return e?e.update(t,n,r,o,i,a,u):i===y?e:(E(u),E(a),new Ye(t,r,[o,i]))}function tt(e){return e.constructor===Ye||e.constructor===Je}function nt(e,t,n,r,o){if(e.keyHash===r)return new Je(t,r,[e.entry,o]);var i,a=(0===n?e.keyHash:e.keyHash>>>n)&g,u=(0===n?r:r>>>n)&g;return new He(t,1<<a|1<<u,a===u?[nt(e,t,n+v,r,o)]:(i=new Ye(t,r,o),a<u?[e,i]:[i,e]))}function rt(e,t,n){for(var o=[],i=0;i<n.length;i++){var u=n[i],s=r(u);a(u)||(s=s.map(function(e){return fe(e)})),o.push(s)}return at(e,t,o)}function ot(e,t,n){return e&&e.mergeDeep&&a(t)?e.mergeDeep(t):he(e,t)?e:t}function it(e){return function(t,n,r){if(t&&t.mergeDeepWith&&a(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return he(t,o)?t:o}}function at(e,t,n){return 0===(n=n.filter(function(e){return 0!==e.size})).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations(function(e){for(var r=t?function(n,r){e.update(r,y,function(e){return e===y?n:t(e,n,r)})}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)}):e.constructor(n[0])}function ut(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function st(e,t,n,r){var o=r?e:S(e);return o[t]=n,o}Be[ze]=!0,Be.delete=Be.remove,Be.removeIn=Be.deleteIn,Ve.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(he(n,o[i][0]))return o[i][1];return r},Ve.prototype.update=function(e,t,n,r,o,i,a){for(var u=o===y,s=this.entries,l=0,c=s.length;l<c&&!he(r,s[l][0]);l++);var f=l<c;if(f?s[l][1]===o:u)return this;if(E(a),(u||!f)&&E(i),!u||1!==s.length){if(!f&&!u&&s.length>=lt)return function(e,t,n,r){e||(e=new x);for(var o=new Ye(e,Ce(n),[n,r]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}(e,s,r,o);var p=e&&e===this.ownerID,d=p?s:S(s);return f?u?l===c-1?d.pop():d[l]=d.pop():d[l]=[r,o]:d.push([r,o]),p?(this.entries=d,this):new Ve(e,d)}},He.prototype.get=function(e,t,n,r){void 0===t&&(t=Ce(n));var o=1<<((0===e?t:t>>>e)&g),i=this.bitmap;return 0==(i&o)?r:this.nodes[ut(i&o-1)].get(e+v,t,n,r)},He.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Ce(r));var u=(0===t?n:n>>>t)&g,s=1<<u,l=this.bitmap,c=0!=(l&s);if(!c&&o===y)return this;var f=ut(l&s-1),p=this.nodes,d=c?p[f]:void 0,h=et(d,e,t+v,n,r,o,i,a);if(h===d)return this;if(!c&&h&&p.length>=ct)return function(e,t,n,r,o){for(var i=0,a=new Array(m),u=0;0!==n;u++,n>>>=1)a[u]=1&n?t[i++]:void 0;return a[r]=o,new We(e,i+1,a)}(e,p,l,u,h);if(c&&!h&&2===p.length&&tt(p[1^f]))return p[1^f];if(c&&h&&1===p.length&&tt(h))return h;var b=e&&e===this.ownerID,_=c?h?l:l^s:l|s,w=c?h?st(p,f,h,b):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),i=0,a=0;a<r;a++)a===t&&(i=1),o[a]=e[a+i];return o}(p,f,b):function(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var i=new Array(o),a=0,u=0;u<o;u++)u===t?(i[u]=n,a=-1):i[u]=e[u+a];return i}(p,f,h,b);return b?(this.bitmap=_,this.nodes=w,this):new He(e,_,w)},We.prototype.get=function(e,t,n,r){void 0===t&&(t=Ce(n));var o=(0===e?t:t>>>e)&g,i=this.nodes[o];return i?i.get(e+v,t,n,r):r},We.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Ce(r));var u=(0===t?n:n>>>t)&g,s=o===y,l=this.nodes,c=l[u];if(s&&!c)return this;var f=et(c,e,t+v,n,r,o,i,a);if(f===c)return this;var p=this.count;if(c){if(!f&&--p<ft)return function(e,t,n,r){for(var o=0,i=0,a=new Array(n),u=0,s=1,l=t.length;u<l;u++,s<<=1){var c=t[u];void 0!==c&&u!==r&&(o|=s,a[i++]=c)}return new He(e,o,a)}(e,l,p,u)}else p++;var d=e&&e===this.ownerID,h=st(l,u,f,d);return d?(this.count=p,this.nodes=h,this):new We(e,p,h)},Je.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(he(n,o[i][0]))return o[i][1];return r},Je.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Ce(r));var u=o===y;if(n!==this.keyHash)return u?this:(E(a),E(i),nt(this,e,t,n,[r,o]));for(var s=this.entries,l=0,c=s.length;l<c&&!he(r,s[l][0]);l++);var f=l<c;if(f?s[l][1]===o:u)return this;if(E(a),(u||!f)&&E(i),u&&2===c)return new Ye(e,this.keyHash,s[1^l]);var p=e&&e===this.ownerID,d=p?s:S(s);return f?u?l===c-1?d.pop():d[l]=d.pop():d[l]=[r,o]:d.push([r,o]),p?(this.entries=d,this):new Je(e,this.keyHash,d)},Ye.prototype.get=function(e,t,n,r){return he(n,this.entry[0])?this.entry[1]:r},Ye.prototype.update=function(e,t,n,r,o,i,a){var u=o===y,s=he(r,this.entry[0]);return(s?o===this.entry[1]:u)?this:(E(a),u?void E(i):s?e&&e===this.ownerID?(this.entry[1]=o,this):new Ye(e,this.keyHash,[r,o]):(E(i),nt(this,e,t,Ce(r),[r,o])))},Ve.prototype.iterate=Je.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},He.prototype.iterate=We.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var i=n[t?o-r:r];if(i&&!1===i.iterate(e,t))return!1}},Ye.prototype.iterate=function(e,t){return e(this.entry)},t(Ke,U),Ke.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return Ge(e,r.entry)}else if(r.entries){if(o<=(n=r.entries.length-1))return Ge(e,r.entries[this._reverse?n-o:o])}else if(o<=(n=r.nodes.length-1)){var i=r.nodes[this._reverse?n-o:o];if(i){if(i.entry)return Ge(e,i.entry);t=this._stack=$e(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var lt=m/4,ct=m/2,ft=m/4;function pt(e){var t=Et();if(null===e||void 0===e)return t;if(dt(e))return e;var n=o(e),r=n.size;return 0===r?t:(Le(r),r>0&&r<m?wt(0,r,v,null,new mt(n.toArray())):t.withMutations(function(e){e.setSize(r),n.forEach(function(t,n){return e.set(n,t)})}))}function dt(e){return!(!e||!e[ht])}t(pt,we),pt.of=function(){return this(arguments)},pt.prototype.toString=function(){return this.__toString("List [","]")},pt.prototype.get=function(e,t){if((e=k(this,e))>=0&&e<this.size){var n=Ct(this,e+=this._origin);return n&&n.array[e&g]}return t},pt.prototype.set=function(e,t){return function(e,t,n){if((t=k(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations(function(e){t<0?kt(e,t).set(0,n):kt(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,o=e._root,i=w(_);t>=Ot(e._capacity)?r=xt(r,e.__ownerID,0,t,n,i):o=xt(o,e.__ownerID,e._level,t,n,i);if(!i.value)return e;if(e.__ownerID)return e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e;return wt(e._origin,e._capacity,e._level,o,r)}(this,e,t)},pt.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},pt.prototype.insert=function(e,t){return this.splice(e,0,t)},pt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=v,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Et()},pt.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(n){kt(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])})},pt.prototype.pop=function(){return kt(this,0,-1)},pt.prototype.unshift=function(){var e=arguments;return this.withMutations(function(t){kt(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])})},pt.prototype.shift=function(){return kt(this,1)},pt.prototype.merge=function(){return At(this,void 0,arguments)},pt.prototype.mergeWith=function(t){return At(this,t,e.call(arguments,1))},pt.prototype.mergeDeep=function(){return At(this,ot,arguments)},pt.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return At(this,it(t),n)},pt.prototype.setSize=function(e){return kt(this,0,e)},pt.prototype.slice=function(e,t){var n=this.size;return O(e,t,n)?this:kt(this,P(e,n),T(t,n))},pt.prototype.__iterator=function(e,t){var n=0,r=_t(this,t);return new U(function(){var t=r();return t===bt?{value:void 0,done:!0}:q(e,n++,t)})},pt.prototype.__iterate=function(e,t){for(var n,r=0,o=_t(this,t);(n=o())!==bt&&!1!==e(n,r++,this););return r},pt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?wt(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},pt.isList=dt;var ht="@@__IMMUTABLE_LIST__@@",vt=pt.prototype;function mt(e,t){this.array=e,this.ownerID=t}vt[ht]=!0,vt.delete=vt.remove,vt.setIn=Be.setIn,vt.deleteIn=vt.removeIn=Be.removeIn,vt.update=Be.update,vt.updateIn=Be.updateIn,vt.mergeIn=Be.mergeIn,vt.mergeDeepIn=Be.mergeDeepIn,vt.withMutations=Be.withMutations,vt.asMutable=Be.asMutable,vt.asImmutable=Be.asImmutable,vt.wasAltered=Be.wasAltered,mt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&g;if(r>=this.array.length)return new mt([],e);var o,i=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-v,n))===a&&i)return this}if(i&&!o)return this;var u=St(this,e);if(!i)for(var s=0;s<r;s++)u.array[s]=void 0;return o&&(u.array[r]=o),u},mt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,o=n-1>>>t&g;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((r=i&&i.removeAfter(e,t-v,n))===i&&o===this.array.length-1)return this}var a=St(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var gt,yt,bt={};function _t(e,t){var n=e._origin,r=e._capacity,o=Ot(r),i=e._tail;return a(e._root,e._level,0);function a(e,u,s){return 0===u?function(e,a){var u=a===o?i&&i.array:e&&e.array,s=a>n?0:n-a,l=r-a;l>m&&(l=m);return function(){if(s===l)return bt;var e=t?--l:s++;return u&&u[e]}}(e,s):function(e,o,i){var u,s=e&&e.array,l=i>n?0:n-i>>o,c=1+(r-i>>o);c>m&&(c=m);return function(){for(;;){if(u){var e=u();if(e!==bt)return e;u=null}if(l===c)return bt;var n=t?--c:l++;u=a(s&&s[n],o-v,i+(n<<o))}}}(e,u,s)}}function wt(e,t,n,r,o,i,a){var u=Object.create(vt);return u.size=t-e,u._origin=e,u._capacity=t,u._level=n,u._root=r,u._tail=o,u.__ownerID=i,u.__hash=a,u.__altered=!1,u}function Et(){return gt||(gt=wt(0,0,v))}function xt(e,t,n,r,o,i){var a,u=r>>>n&g,s=e&&u<e.array.length;if(!s&&void 0===o)return e;if(n>0){var l=e&&e.array[u],c=xt(l,t,n-v,r,o,i);return c===l?e:((a=St(e,t)).array[u]=c,a)}return s&&e.array[u]===o?e:(E(i),a=St(e,t),void 0===o&&u===a.array.length-1?a.array.pop():a.array[u]=o,a)}function St(e,t){return t&&e&&t===e.ownerID?e:new mt(e?e.array.slice():[],t)}function Ct(e,t){if(t>=Ot(e._capacity))return e._tail;if(t<1<<e._level+v){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&g],r-=v;return n}}function kt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new x,o=e._origin,i=e._capacity,a=o+t,u=void 0===n?i:n<0?i+n:o+n;if(a===o&&u===i)return e;if(a>=u)return e.clear();for(var s=e._level,l=e._root,c=0;a+c<0;)l=new mt(l&&l.array.length?[void 0,l]:[],r),c+=1<<(s+=v);c&&(a+=c,o+=c,u+=c,i+=c);for(var f=Ot(i),p=Ot(u);p>=1<<s+v;)l=new mt(l&&l.array.length?[l]:[],r),s+=v;var d=e._tail,h=p<f?Ct(e,u-1):p>f?new mt([],r):d;if(d&&p>f&&a<i&&d.array.length){for(var m=l=St(l,r),y=s;y>v;y-=v){var b=f>>>y&g;m=m.array[b]=St(m.array[b],r)}m.array[f>>>v&g]=d}if(u<i&&(h=h&&h.removeAfter(r,0,u)),a>=p)a-=p,u-=p,s=v,l=null,h=h&&h.removeBefore(r,0,a);else if(a>o||p<f){for(c=0;l;){var _=a>>>s&g;if(_!==p>>>s&g)break;_&&(c+=(1<<s)*_),s-=v,l=l.array[_]}l&&a>o&&(l=l.removeBefore(r,s,a-c)),l&&p<f&&(l=l.removeAfter(r,s,p-c)),c&&(a-=c,u-=c)}return e.__ownerID?(e.size=u-a,e._origin=a,e._capacity=u,e._level=s,e._root=l,e._tail=h,e.__hash=void 0,e.__altered=!0,e):wt(a,u,s,l,h)}function At(e,t,n){for(var r=[],i=0,u=0;u<n.length;u++){var s=n[u],l=o(s);l.size>i&&(i=l.size),a(s)||(l=l.map(function(e){return fe(e)})),r.push(l)}return i>e.size&&(e=e.setSize(i)),at(e,t,r)}function Ot(e){return e<m?0:e-1>>>v<<v}function Pt(e){return null===e||void 0===e?It():Tt(e)?e:It().withMutations(function(t){var n=r(e);Le(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function Tt(e){return qe(e)&&c(e)}function Mt(e,t,n,r){var o=Object.create(Pt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function It(){return yt||(yt=Mt(Xe(),Et()))}function jt(e,t,n){var r,o,i=e._map,a=e._list,u=i.get(t),s=void 0!==u;if(n===y){if(!s)return e;a.size>=m&&a.size>=2*i.size?(r=(o=a.filter(function(e,t){return void 0!==e&&u!==t})).toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=i.remove(t),o=u===a.size-1?a.pop():a.set(u,void 0))}else if(s){if(n===a.get(u)[1])return e;r=i,o=a.set(u,[t,n])}else r=i.set(t,a.size),o=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Mt(r,o)}function Nt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Rt(e){this._iter=e,this.size=e.size}function Dt(e){this._iter=e,this.size=e.size}function Lt(e){this._iter=e,this.size=e.size}function Ut(e){var t=Qt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=en,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===N){var r=e.__iterator(t,n);return new U(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===j?I:j,n)},t}function qt(e,t,n){var r=Qt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var i=e.get(r,y);return i===y?o:t.call(n,i,r,e)},r.__iterateUncached=function(r,o){var i=this;return e.__iterate(function(e,o,a){return!1!==r(t.call(n,e,o,a),o,i)},o)},r.__iteratorUncached=function(r,o){var i=e.__iterator(N,o);return new U(function(){var o=i.next();if(o.done)return o;var a=o.value,u=a[0];return q(r,u,t.call(n,a[1],u,e),o)})},r}function Ft(e,t){var n=Qt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Ut(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=en,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function zt(e,t,n,r){var o=Qt(e);return r&&(o.has=function(r){var o=e.get(r,y);return o!==y&&!!t.call(n,o,r,e)},o.get=function(r,o){var i=e.get(r,y);return i!==y&&t.call(n,i,r,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,u=0;return e.__iterate(function(e,i,s){if(t.call(n,e,i,s))return u++,o(e,r?i:u-1,a)},i),u},o.__iteratorUncached=function(o,i){var a=e.__iterator(N,i),u=0;return new U(function(){for(;;){var i=a.next();if(i.done)return i;var s=i.value,l=s[0],c=s[1];if(t.call(n,c,l,e))return q(o,r?l:u++,c,i)}})},o}function Bt(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=o:n|=0),O(t,n,o))return e;var i=P(t,o),a=T(n,o);if(i!=i||a!=a)return Bt(e.toSeq().cacheResult(),t,n,r);var u,s=a-i;s==s&&(u=s<0?0:s);var l=Qt(e);return l.size=0===u?u:e.size&&u||void 0,!r&&oe(e)&&u>=0&&(l.get=function(t,n){return(t=k(this,t))>=0&&t<u?e.get(t+i,n):n}),l.__iterateUncached=function(t,n){var o=this;if(0===u)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,s=!0,l=0;return e.__iterate(function(e,n){if(!s||!(s=a++<i))return l++,!1!==t(e,r?n:l-1,o)&&l!==u}),l},l.__iteratorUncached=function(t,n){if(0!==u&&n)return this.cacheResult().__iterator(t,n);var o=0!==u&&e.__iterator(t,n),a=0,s=0;return new U(function(){for(;a++<i;)o.next();if(++s>u)return{value:void 0,done:!0};var e=o.next();return r||t===j?e:q(t,s-1,t===I?void 0:e.value[1],e)})},l}function Vt(e,t,n,r){var o=Qt(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var u=!0,s=0;return e.__iterate(function(e,i,l){if(!u||!(u=t.call(n,e,i,l)))return s++,o(e,r?i:s-1,a)}),s},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var u=e.__iterator(N,i),s=!0,l=0;return new U(function(){var e,i,c;do{if((e=u.next()).done)return r||o===j?e:q(o,l++,o===I?void 0:e.value[1],e);var f=e.value;i=f[0],c=f[1],s&&(s=t.call(n,c,i,a))}while(s);return o===N?e:q(o,i,c,e)})},o}function Ht(e,t,n){var r=Qt(e);return r.__iterateUncached=function(r,o){var i=0,u=!1;return function e(s,l){var c=this;s.__iterate(function(o,s){return(!t||l<t)&&a(o)?e(o,l+1):!1===r(o,n?s:i++,c)&&(u=!0),!u},o)}(e,0),i},r.__iteratorUncached=function(r,o){var i=e.__iterator(r,o),u=[],s=0;return new U(function(){for(;i;){var e=i.next();if(!1===e.done){var l=e.value;if(r===N&&(l=l[1]),t&&!(u.length<t)||!a(l))return n?e:q(r,s++,l,e);u.push(i),i=l.__iterator(r,o)}else i=u.pop()}return{value:void 0,done:!0}})},r}function Wt(e,t,n){t||(t=tn);var r=u(e),o=0,i=e.toSeq().map(function(t,r){return[r,t,o++,n?n(t,r,e):t]}).toArray();return i.sort(function(e,n){return t(e[3],n[3])||e[2]-n[2]}).forEach(r?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),r?Y(i):s(e)?K(i):G(i)}function Jt(e,t,n){if(t||(t=tn),n){var r=e.toSeq().map(function(t,r){return[t,n(t,r,e)]}).reduce(function(e,n){return Yt(t,e[1],n[1])?n:e});return r&&r[0]}return e.reduce(function(e,n){return Yt(t,e,n)?n:e})}function Yt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(void 0===n||null===n||n!=n)||r>0}function Kt(e,t,r){var o=Qt(e);return o.size=new ee(r).map(function(e){return e.size}).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(j,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map(function(e){return e=n(e),V(o?e.reverse():e)}),a=0,u=!1;return new U(function(){var n;return u||(n=i.map(function(e){return e.next()}),u=n.some(function(e){return e.done})),u?{value:void 0,done:!0}:q(e,a++,t.apply(null,n.map(function(e){return e.value})))})},o}function Gt(e,t){return oe(e)?t:e.constructor(t)}function $t(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Zt(e){return Le(e.size),C(e)}function Xt(e){return u(e)?r:s(e)?o:i}function Qt(e){return Object.create((u(e)?Y:s(e)?K:G).prototype)}function en(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):J.prototype.cacheResult.call(this)}function tn(e,t){return e>t?1:e<t?-1:0}function nn(e){var t=V(e);if(!t){if(!W(e))throw new TypeError("Expected iterable or array-like: "+e);t=V(n(e))}return t}function rn(e,t){var n,r=function(i){if(i instanceof r)return i;if(!(this instanceof r))return new r(i);if(!n){n=!0;var a=Object.keys(e);!function(e,t){try{t.forEach(function(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){ge(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}.bind(void 0,e))}catch(e){}}(o,a),o.size=a.length,o._name=t,o._keys=a,o._defaultValues=e}this._map=Ue(i)},o=r.prototype=Object.create(on);return o.constructor=r,r}t(Pt,Ue),Pt.of=function(){return this(arguments)},Pt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Pt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Pt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):It()},Pt.prototype.set=function(e,t){return jt(this,e,t)},Pt.prototype.remove=function(e){return jt(this,e,y)},Pt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Pt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Pt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Pt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Mt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Pt.isOrderedMap=Tt,Pt.prototype[h]=!0,Pt.prototype.delete=Pt.prototype.remove,t(Nt,Y),Nt.prototype.get=function(e,t){return this._iter.get(e,t)},Nt.prototype.has=function(e){return this._iter.has(e)},Nt.prototype.valueSeq=function(){return this._iter.valueSeq()},Nt.prototype.reverse=function(){var e=this,t=Ft(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},Nt.prototype.map=function(e,t){var n=this,r=qt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},Nt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Zt(this):0,function(o){return e(o,t?--n:n++,r)}),t)},Nt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(j,t),r=t?Zt(this):0;return new U(function(){var o=n.next();return o.done?o:q(e,t?--r:r++,o.value,o)})},Nt.prototype[h]=!0,t(Rt,K),Rt.prototype.includes=function(e){return this._iter.includes(e)},Rt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},Rt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(j,t),r=0;return new U(function(){var t=n.next();return t.done?t:q(e,r++,t.value,t)})},t(Dt,G),Dt.prototype.has=function(e){return this._iter.includes(e)},Dt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},Dt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(j,t);return new U(function(){var t=n.next();return t.done?t:q(e,t.value,t.value,t)})},t(Lt,Y),Lt.prototype.entrySeq=function(){return this._iter.toSeq()},Lt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){$t(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},Lt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(j,t);return new U(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){$t(r);var o=a(r);return q(e,o?r.get(0):r[0],o?r.get(1):r[1],t)}}})},Rt.prototype.cacheResult=Nt.prototype.cacheResult=Dt.prototype.cacheResult=Lt.prototype.cacheResult=en,t(rn,_e),rn.prototype.toString=function(){return this.__toString(un(this)+" {","}")},rn.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},rn.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},rn.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=an(this,Xe()))},rn.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+un(this));if(this._map&&!this._map.has(e)&&t===this._defaultValues[e])return this;var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:an(this,n)},rn.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:an(this,t)},rn.prototype.wasAltered=function(){return this._map.wasAltered()},rn.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterator(e,t)},rn.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterate(e,t)},rn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?an(this,t,e):(this.__ownerID=e,this._map=t,this)};var on=rn.prototype;function an(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function un(e){return e._name||e.constructor.name||"Record"}function sn(e){return null===e||void 0===e?vn():ln(e)&&!c(e)?e:vn().withMutations(function(t){var n=i(e);Le(n.size),n.forEach(function(e){return t.add(e)})})}function ln(e){return!(!e||!e[fn])}on.delete=on.remove,on.deleteIn=on.removeIn=Be.removeIn,on.merge=Be.merge,on.mergeWith=Be.mergeWith,on.mergeIn=Be.mergeIn,on.mergeDeep=Be.mergeDeep,on.mergeDeepWith=Be.mergeDeepWith,on.mergeDeepIn=Be.mergeDeepIn,on.setIn=Be.setIn,on.update=Be.update,on.updateIn=Be.updateIn,on.withMutations=Be.withMutations,on.asMutable=Be.asMutable,on.asImmutable=Be.asImmutable,t(sn,Ee),sn.of=function(){return this(arguments)},sn.fromKeys=function(e){return this(r(e).keySeq())},sn.prototype.toString=function(){return this.__toString("Set {","}")},sn.prototype.has=function(e){return this._map.has(e)},sn.prototype.add=function(e){return dn(this,this._map.set(e,!0))},sn.prototype.remove=function(e){return dn(this,this._map.remove(e))},sn.prototype.clear=function(){return dn(this,this._map.clear())},sn.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter(function(e){return 0!==e.size})).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach(function(t){return e.add(t)})}):this.constructor(t[0])},sn.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map(function(e){return i(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.every(function(e){return e.includes(n)})||e.remove(n)})})},sn.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map(function(e){return i(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.some(function(e){return e.includes(n)})&&e.remove(n)})})},sn.prototype.merge=function(){return this.union.apply(this,arguments)},sn.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},sn.prototype.sort=function(e){return mn(Wt(this,e))},sn.prototype.sortBy=function(e,t){return mn(Wt(this,t,e))},sn.prototype.wasAltered=function(){return this._map.wasAltered()},sn.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate(function(t,r){return e(r,r,n)},t)},sn.prototype.__iterator=function(e,t){return this._map.map(function(e,t){return t}).__iterator(e,t)},sn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},sn.isSet=ln;var cn,fn="@@__IMMUTABLE_SET__@@",pn=sn.prototype;function dn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function hn(e,t){var n=Object.create(pn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function vn(){return cn||(cn=hn(Xe()))}function mn(e){return null===e||void 0===e?wn():gn(e)?e:wn().withMutations(function(t){var n=i(e);Le(n.size),n.forEach(function(e){return t.add(e)})})}function gn(e){return ln(e)&&c(e)}pn[fn]=!0,pn.delete=pn.remove,pn.mergeDeep=pn.merge,pn.mergeDeepWith=pn.mergeWith,pn.withMutations=Be.withMutations,pn.asMutable=Be.asMutable,pn.asImmutable=Be.asImmutable,pn.__empty=vn,pn.__make=hn,t(mn,sn),mn.of=function(){return this(arguments)},mn.fromKeys=function(e){return this(r(e).keySeq())},mn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},mn.isOrderedSet=gn;var yn,bn=mn.prototype;function _n(e,t){var n=Object.create(bn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function wn(){return yn||(yn=_n(It()))}function En(e){return null===e||void 0===e?On():xn(e)?e:On().unshiftAll(e)}function xn(e){return!(!e||!e[Cn])}bn[h]=!0,bn.__empty=wn,bn.__make=_n,t(En,we),En.of=function(){return this(arguments)},En.prototype.toString=function(){return this.__toString("Stack [","]")},En.prototype.get=function(e,t){var n=this._head;for(e=k(this,e);n&&e--;)n=n.next;return n?n.value:t},En.prototype.peek=function(){return this._head&&this._head.value},En.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):An(e,t)},En.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Le(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):An(t,n)},En.prototype.pop=function(){return this.slice(1)},En.prototype.unshift=function(){return this.push.apply(this,arguments)},En.prototype.unshiftAll=function(e){return this.pushAll(e)},En.prototype.shift=function(){return this.pop.apply(this,arguments)},En.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):On()},En.prototype.slice=function(e,t){if(O(e,t,this.size))return this;var n=P(e,this.size);if(T(t,this.size)!==this.size)return we.prototype.slice.call(this,e,t);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):An(r,o)},En.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?An(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},En.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},En.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new U(function(){if(r){var t=r.value;return r=r.next,q(e,n++,t)}return{value:void 0,done:!0}})},En.isStack=xn;var Sn,Cn="@@__IMMUTABLE_STACK__@@",kn=En.prototype;function An(e,t,n,r){var o=Object.create(kn);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function On(){return Sn||(Sn=An(0))}function Pn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}kn[Cn]=!0,kn.withMutations=Be.withMutations,kn.asMutable=Be.asMutable,kn.asImmutable=Be.asImmutable,kn.wasAltered=Be.wasAltered,n.Iterator=U,Pn(n,{toArray:function(){Le(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new Rt(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new Nt(this,!0)},toMap:function(){return Ue(this.toKeyedSeq())},toObject:function(){Le(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Pt(this.toKeyedSeq())},toOrderedSet:function(){return mn(u(this)?this.valueSeq():this)},toSet:function(){return sn(u(this)?this.valueSeq():this)},toSetSeq:function(){return new Dt(this)},toSeq:function(){return s(this)?this.toIndexedSeq():u(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return En(u(this)?this.valueSeq():this)},toList:function(){return pt(u(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return Gt(this,function(e,t){var n=u(e),o=[e].concat(t).map(function(e){return a(e)?n&&(e=r(e)):e=n?ae(e):ue(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||n&&u(i)||s(e)&&s(i))return i}var l=new ee(o);return n?l=l.toKeyedSeq():s(e)||(l=l.toSetSeq()),(l=l.flatten(!0)).size=o.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),l}(this,e.call(arguments,0)))},includes:function(e){return this.some(function(t){return he(t,e)})},entries:function(){return this.__iterator(N)},every:function(e,t){Le(this.size);var n=!0;return this.__iterate(function(r,o,i){if(!e.call(t,r,o,i))return n=!1,!1}),n},filter:function(e,t){return Gt(this,zt(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return Le(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Le(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(I)},map:function(e,t){return Gt(this,qt(this,e,t))},reduce:function(e,t,n){var r,o;return Le(this.size),arguments.length<2?o=!0:r=t,this.__iterate(function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Gt(this,Ft(this,!0))},slice:function(e,t){return Gt(this,Bt(this,e,t,!0))},some:function(e,t){return!this.every(Nn(e),t)},sort:function(e){return Gt(this,Wt(this,e))},values:function(){return this.__iterator(j)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return C(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Ue().asMutable();return e.__iterate(function(o,i){r.update(t.call(n,o,i,e),0,function(e){return e+1})}),r.asImmutable()}(this,e,t)},equals:function(e){return ve(this,e)},entrySeq:function(){var e=this;if(e._cache)return new ee(e._cache);var t=e.toSeq().map(jn).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Nn(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,o,i){if(e.call(t,n,o,i))return r=[o,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(A)},flatMap:function(e,t){return Gt(this,function(e,t,n){var r=Xt(e);return e.toSeq().map(function(o,i){return r(t.call(n,o,i,e))}).flatten(!0)}(this,e,t))},flatten:function(e){return Gt(this,Ht(this,e,!0))},fromEntrySeq:function(){return new Lt(this)},get:function(e,t){return this.find(function(t,n){return he(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,o=nn(e);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,y):y)===y)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=u(e),o=(c(e)?Pt():Ue()).asMutable();e.__iterate(function(i,a){o.update(t.call(n,i,a,e),function(e){return(e=e||[]).push(r?[a,i]:i),e})});var i=Xt(e);return o.map(function(t){return Gt(e,i(t))})}(this,e,t)},has:function(e){return this.get(e,y)!==y},hasIn:function(e){return this.getIn(e,y)!==y},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey(function(t){return he(t,e)})},keySeq:function(){return this.toSeq().map(In).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Jt(this,e)},maxBy:function(e,t){return Jt(this,t,e)},min:function(e){return Jt(this,e?Rn(e):Un)},minBy:function(e,t){return Jt(this,t?Rn(t):Un,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Gt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Gt(this,Vt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Nn(e),t)},sortBy:function(e,t){return Gt(this,Wt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Gt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Gt(this,function(e,t,n){var r=Qt(e);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return e.__iterate(function(e,o,u){return t.call(n,e,o,u)&&++a&&r(e,o,i)}),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=e.__iterator(N,o),u=!0;return new U(function(){if(!u)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,s=o[0],l=o[1];return t.call(n,l,s,i)?r===N?e:q(r,s,l,e):(u=!1,{value:void 0,done:!0})})},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Nn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=c(e),n=u(e),r=t?1:0;return function(e,t){return t=xe(t,3432918353),t=xe(t<<15|t>>>-15,461845907),t=xe(t<<13|t>>>-13,5),t=xe((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=Se((t=xe(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+qn(Ce(e),Ce(t))|0}:function(e,t){r=r+qn(Ce(e),Ce(t))|0}:t?function(e){r=31*r+Ce(e)|0}:function(e){r=r+Ce(e)|0}),r)}(this))}});var Tn=n.prototype;Tn[f]=!0,Tn[L]=Tn.values,Tn.__toJS=Tn.toArray,Tn.__toStringMapper=Dn,Tn.inspect=Tn.toSource=function(){return this.toString()},Tn.chain=Tn.flatMap,Tn.contains=Tn.includes,Pn(r,{flip:function(){return Gt(this,Ut(this))},mapEntries:function(e,t){var n=this,r=0;return Gt(this,this.toSeq().map(function(o,i){return e.call(t,[i,o],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Gt(this,this.toSeq().flip().map(function(r,o){return e.call(t,r,o,n)}).flip())}});var Mn=r.prototype;function In(e,t){return t}function jn(e,t){return[t,e]}function Nn(e){return function(){return!e.apply(this,arguments)}}function Rn(e){return function(){return-e.apply(this,arguments)}}function Dn(e){return"string"==typeof e?JSON.stringify(e):String(e)}function Ln(){return S(arguments)}function Un(e,t){return e<t?1:e>t?-1:0}function qn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return Mn[p]=!0,Mn[L]=Tn.entries,Mn.__toJS=Tn.toObject,Mn.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Dn(e)},Pn(o,{toKeyedSeq:function(){return new Nt(this,!1)},filter:function(e,t){return Gt(this,zt(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Gt(this,Ft(this,!1))},slice:function(e,t){return Gt(this,Bt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=P(e,e<0?this.count():this.size);var r=this.slice(0,e);return Gt(this,1===n?r:r.concat(S(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Gt(this,Ht(this,e,!1))},get:function(e,t){return(e=k(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=k(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Gt(this,function(e,t){var n=Qt(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var o=this,i=0;return e.__iterate(function(e,r){return(!i||!1!==n(t,i++,o))&&!1!==n(e,i++,o)},r),i},n.__iteratorUncached=function(n,r){var o,i=e.__iterator(j,r),a=0;return new U(function(){return(!o||a%2)&&(o=i.next()).done?o:a%2?q(n,a++,t):q(n,a++,o.value,o)})},n}(this,e))},interleave:function(){var e=[this].concat(S(arguments)),t=Kt(this.toSeq(),K.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Gt(this,n)},keySeq:function(){return ye(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Gt(this,Vt(this,e,t,!1))},zip:function(){return Gt(this,Kt(this,Ln,[this].concat(S(arguments))))},zipWith:function(e){var t=S(arguments);return t[0]=this,Gt(this,Kt(this,e,t))}}),o.prototype[d]=!0,o.prototype[h]=!0,Pn(i,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=Tn.includes,i.prototype.contains=i.prototype.includes,Pn(Y,r.prototype),Pn(K,o.prototype),Pn(G,i.prototype),Pn(_e,r.prototype),Pn(we,o.prototype),Pn(Ee,i.prototype),{Iterable:n,Seq:J,Collection:be,Map:Ue,OrderedMap:Pt,List:pt,Stack:En,Set:sn,OrderedSet:mn,Record:rn,Range:ye,Repeat:me,is:he,fromJS:fe}},e.exports=r()},function(e,t,n){"use strict";var r=function(e){};e.exports=function(e,t,n,o,i,a,u,s){if(r(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,o,i,a,u,s],f=0;(l=new Error(t.replace(/%s/g,function(){return c[f++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.getCommonExtensions=t.getExtensions=t.escapeDeepLinkPath=t.createDeepLinkPath=t.shallowEqualKeys=t.buildFormData=t.sorters=t.btoa=t.serializeSearch=t.parseSearch=t.getSampleSchema=t.validateParam=t.validatePattern=t.validateMinLength=t.validateMaxLength=t.validateGuid=t.validateDateTime=t.validateString=t.validateBoolean=t.validateFile=t.validateInteger=t.validateNumber=t.validateMinimum=t.validateMaximum=t.propChecker=t.memoize=t.isImmutable=void 0;var r=_(n(41)),o=_(n(17)),i=_(n(91)),a=_(n(23)),u=_(n(42)),s=_(n(45));t.isJSONObject=function(e){try{var t=JSON.parse(e);if(t&&"object"===(void 0===t?"undefined":(0,s.default)(t)))return t}catch(e){}return!1},t.objectify=function(e){return S(e)?E(e)?e.toJS():e:{}},t.arrayify=function(e){return e?e.toArray?e.toArray():x(e):[]},t.fromJSOrdered=function e(t){if(E(t))return t;if(t instanceof y.default.File)return t;return S(t)?Array.isArray(t)?l.default.Seq(t).map(e).toList():l.default.OrderedMap(t).map(e):t},t.bindToState=function(e,t){var n={};return(0,u.default)(e).filter(function(t){return"function"==typeof e[t]}).forEach(function(r){return n[r]=e[r].bind(null,t)}),n},t.normalizeArray=x,t.isFn=function(e){return"function"==typeof e},t.isObject=S,t.isFunc=function(e){return"function"==typeof e},t.isArray=function(e){return Array.isArray(e)},t.objMap=function(e,t){return(0,u.default)(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})},t.objReduce=function(e,t){return(0,u.default)(e).reduce(function(n,r){var o=t(e[r],r);return o&&"object"===(void 0===o?"undefined":(0,s.default)(o))&&(0,a.default)(n,o),n},{})},t.systemThunkMiddleware=function(e){return function(t){t.dispatch,t.getState;return function(t){return function(n){return"function"==typeof n?n(e()):t(n)}}}},t.defaultStatusCode=function(e){var t=e.keySeq();return t.contains(w)?w:t.filter(function(e){return"2"===(e+"")[0]}).sort().first()},t.getList=function(e,t){if(!l.default.Iterable.isIterable(e))return l.default.List();var n=e.getIn(Array.isArray(t)?t:[t]);return l.default.List.isList(n)?n:l.default.List()},t.highlight=function(e){var t=document;if(!e)return"";if(e.textContent.length>5e3)return e.textContent;return function(e){for(var n,r,o,i,a,u=e.textContent,s=0,l=u[0],c=1,f=e.innerHTML="",p=0;r=n,n=p<7&&"\\"==n?1:c;){if(c=l,l=u[++s],i=f.length>1,!c||p>8&&"\n"==c||[/\S/.test(c),1,1,!/[$\w]/.test(c),("/"==n||"\n"==n)&&i,'"'==n&&i,"'"==n&&i,u[s-4]+r+n=="--\x3e",r+n=="*/"][p])for(f&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][p?p<3?2:p>6?4:p>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(f):0]),a.appendChild(t.createTextNode(f))),o=p&&p<7?p:o,f="",p=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(c),/[\])]/.test(c),/[$\w]/.test(c),"/"==c&&o<2&&"<"!=n,'"'==c,"'"==c,c+l+u[s+1]+u[s+2]=="\x3c!--",c+l=="/*",c+l=="//","#"==c][--p];);f+=c}}(e)},t.mapToList=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key";var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.Map();if(!l.default.Map.isMap(t)||!t.size)return l.default.List();Array.isArray(n)||(n=[n]);if(n.length<1)return t.merge(r);var a=l.default.List();var u=n[0];var s=!0;var c=!1;var f=void 0;try{for(var p,d=(0,i.default)(t.entries());!(s=(p=d.next()).done);s=!0){var h=p.value,v=(0,o.default)(h,2),m=v[0],g=v[1],y=e(g,n.slice(1),r.set(u,m));a=l.default.List.isList(y)?a.concat(y):a.push(y)}}catch(e){c=!0,f=e}finally{try{!s&&d.return&&d.return()}finally{if(c)throw f}}return a},t.extractFileNameFromContentDispositionHeader=function(e){var t=void 0;if([/filename\*=[^']+'\w*'"([^"]+)";?/i,/filename\*=[^']+'\w*'([^;]+);?/i,/filename="([^;]*);?"/i,/filename=([^;]*);?/i].some(function(n){return null!==(t=n.exec(e))}),null!==t&&t.length>1)try{return decodeURIComponent(t[1])}catch(e){console.error(e)}return null},t.pascalCase=C,t.pascalCaseFilename=function(e){return C(e.replace(/\.[^./]*$/,""))},t.sanitizeUrl=function(e){if("string"!=typeof e||""===e)return"";return(0,c.sanitizeUrl)(e)},t.getAcceptControllingResponse=function(e){if(!l.default.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find(function(e,t){return t.startsWith("2")&&(0,u.default)(e.get("content")||{}).length>0}),n=e.get("default")||l.default.OrderedMap(),r=(n.get("content")||l.default.OrderedMap()).keySeq().toJS().length?n:null;return t||r},t.deeplyStripKey=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("object"!==(void 0===t?"undefined":(0,s.default)(t))||Array.isArray(t)||null===t||!n)return t;var o=(0,a.default)({},t);(0,u.default)(o).forEach(function(t){t===n&&r(o[t],t)?delete o[t]:o[t]=e(o[t],n,r)});return o},t.stringify=function(e){if("string"==typeof e)return e;e.toJS&&(e=e.toJS());if("object"===(void 0===e?"undefined":(0,s.default)(e))&&null!==e)try{return(0,r.default)(e,null,2)}catch(t){return String(e)}return e.toString()},t.numberToString=function(e){if("number"==typeof e)return e.toString();return e};var l=_(n(7)),c=n(572),f=_(n(573)),p=_(n(281)),d=_(n(285)),h=_(n(288)),v=_(n(651)),m=_(n(105)),g=n(194),y=_(n(32)),b=_(n(724));function _(e){return e&&e.__esModule?e:{default:e}}var w="default",E=t.isImmutable=function(e){return l.default.Iterable.isIterable(e)};function x(e){return Array.isArray(e)?e:[e]}function S(e){return!!e&&"object"===(void 0===e?"undefined":(0,s.default)(e))}t.memoize=d.default;function C(e){return(0,p.default)((0,f.default)(e))}t.propChecker=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,u.default)(e).length!==(0,u.default)(t).length||((0,v.default)(e,function(e,n){if(r.includes(n))return!1;var o=t[n];return l.default.Iterable.isIterable(e)?!l.default.is(e,o):("object"!==(void 0===e?"undefined":(0,s.default)(e))||"object"!==(void 0===o?"undefined":(0,s.default)(o)))&&e!==o})||n.some(function(n){return!(0,m.default)(e[n],t[n])}))};var k=t.validateMaximum=function(e,t){if(e>t)return"Value must be less than Maximum"},A=t.validateMinimum=function(e,t){if(e<t)return"Value must be greater than Minimum"},O=t.validateNumber=function(e){if(!/^-?\d+(\.?\d+)?$/.test(e))return"Value must be a number"},P=t.validateInteger=function(e){if(!/^-?\d+$/.test(e))return"Value must be an integer"},T=t.validateFile=function(e){if(e&&!(e instanceof y.default.File))return"Value must be a file"},M=t.validateBoolean=function(e){if("true"!==e&&"false"!==e&&!0!==e&&!1!==e)return"Value must be a boolean"},I=t.validateString=function(e){if(e&&"string"!=typeof e)return"Value must be a string"},j=t.validateDateTime=function(e){if(isNaN(Date.parse(e)))return"Value must be a DateTime"},N=t.validateGuid=function(e){if(e=e.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(e))return"Value must be a Guid"},R=t.validateMaxLength=function(e,t){if(e.length>t)return"Value must be less than MaxLength"},D=t.validateMinLength=function(e,t){if(e.length<t)return"Value must be greater than MinLength"},L=t.validatePattern=function(e,t){if(!new RegExp(t).test(e))return"Value must follow pattern "+t};t.validateParam=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],o=t&&"body"===e.get("in")?e.get("value_xml"):e.get("value"),i=e.get("required"),a=n?e.get("schema"):e;if(!a)return r;var u=a.get("maximum"),c=a.get("minimum"),f=a.get("type"),p=a.get("format"),d=a.get("maxLength"),h=a.get("minLength"),v=a.get("pattern");if(f&&(i||o)){var m="string"===f&&o,g="array"===f&&Array.isArray(o)&&o.length,b="array"===f&&l.default.List.isList(o)&&o.count(),_="file"===f&&o instanceof y.default.File,w="boolean"===f&&(o||!1===o),E="number"===f&&(o||0===o),x="integer"===f&&(o||0===o),S=!1;if(n&&"object"===f)if("object"===(void 0===o?"undefined":(0,s.default)(o)))S=!0;else if("string"==typeof o)try{JSON.parse(o),S=!0}catch(e){return r.push("Parameter string value must be valid JSON"),r}var C=[m,g,b,_,w,E,x,S].some(function(e){return!!e});if(i&&!C)return r.push("Required field is not provided"),r;if(v){var U=L(o,v);U&&r.push(U)}if(d||0===d){var q=R(o,d);q&&r.push(q)}if(h){var F=D(o,h);F&&r.push(F)}if(u||0===u){var z=k(o,u);z&&r.push(z)}if(c||0===c){var B=A(o,c);B&&r.push(B)}if("string"===f){var V=void 0;if(!(V="date-time"===p?j(o):"uuid"===p?N(o):I(o)))return r;r.push(V)}else if("boolean"===f){var H=M(o);if(!H)return r;r.push(H)}else if("number"===f){var W=O(o);if(!W)return r;r.push(W)}else if("integer"===f){var J=P(o);if(!J)return r;r.push(J)}else if("array"===f){var Y;if(!b||!o.count())return r;Y=a.getIn(["items","type"]),o.forEach(function(e,t){var n=void 0;"number"===Y?n=O(e):"integer"===Y?n=P(e):"string"===Y&&(n=I(e)),n&&r.push({index:t,error:n})})}else if("file"===f){var K=T(o);if(!K)return r;r.push(K)}}return r},t.getSampleSchema=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'<?xml version="1.0" encoding="UTF-8"?>\n\x3c!-- XML example cannot be generated --\x3e':null;var o=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=o[1]}return(0,g.memoizedCreateXMLExample)(e,n)}var i=(0,g.memoizedSampleFromSchema)(e,n);return"object"===(void 0===i?"undefined":(0,s.default)(i))?(0,r.default)(i,null,2):i},t.parseSearch=function(){var e={},t=y.default.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=r[1]&&decodeURIComponent(r[1])||"")}return e},t.serializeSearch=function(e){return(0,u.default)(e).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")},t.btoa=function(t){return(t instanceof e?t:new e(t.toString(),"utf-8")).toString("base64")},t.sorters={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},t.buildFormData=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},t.shallowEqualKeys=function(e,t,n){return!!(0,h.default)(n,function(n){return(0,m.default)(e[n],t[n])})};var U=t.createDeepLinkPath=function(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"%20"):""};t.escapeDeepLinkPath=function(e){return(0,b.default)(U(e).replace(/%20/g,"_"))},t.getExtensions=function(e){return e.filter(function(e,t){return/^x-/.test(t)})},t.getCommonExtensions=function(e){return e.filter(function(e,t){return/^pattern|maxLength|minLength|maximum|minimum/.test(t)})}}).call(t,n(54).Buffer)},function(e,t,n){"use strict";var r=n(34);e.exports=r},function(e,t,n){"use strict";e.exports=function(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}},function(e,t,n){"use strict";var r=n(7),o="<<anonymous>>",i={listOf:function(e){return l(e,"List",r.List.isList)},mapOf:function(e,t){return c(e,t,"Map",r.Map.isMap)},orderedMapOf:function(e,t){return c(e,t,"OrderedMap",r.OrderedMap.isOrderedMap)},setOf:function(e){return l(e,"Set",r.Set.isSet)},orderedSetOf:function(e){return l(e,"OrderedSet",r.OrderedSet.isOrderedSet)},stackOf:function(e){return l(e,"Stack",r.Stack.isStack)},iterableOf:function(e){return l(e,"Iterable",r.Iterable.isIterable)},recordOf:function(e){return u(function(t,n,o,i,u){for(var s=arguments.length,l=Array(s>5?s-5:0),c=5;c<s;c++)l[c-5]=arguments[c];var f=t[n];if(!(f instanceof r.Record)){var p=a(f),d=i;return new Error("Invalid "+d+" `"+u+"` of type `"+p+"` supplied to `"+o+"`, expected an Immutable.js Record.")}for(var h in e){var v=e[h];if(v){var m=f.toObject(),g=v.apply(void 0,[m,h,o,i,u+"."+h].concat(l));if(g)return g}}})},shape:p,contains:p,mapContains:function(e){return f(e,"Map",r.Map.isMap)},list:s("List",r.List.isList),map:s("Map",r.Map.isMap),orderedMap:s("OrderedMap",r.OrderedMap.isOrderedMap),set:s("Set",r.Set.isSet),orderedSet:s("OrderedSet",r.OrderedSet.isOrderedSet),stack:s("Stack",r.Stack.isStack),seq:s("Seq",r.Seq.isSeq),record:s("Record",function(e){return e instanceof r.Record}),iterable:s("Iterable",r.Iterable.isIterable)};function a(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof r.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function u(e){function t(t,n,r,i,a,u){for(var s=arguments.length,l=Array(s>6?s-6:0),c=6;c<s;c++)l[c-6]=arguments[c];return u=u||r,i=i||o,null!=n[r]?e.apply(void 0,[n,r,i,a,u].concat(l)):t?new Error("Required "+a+" `"+u+"` was not specified in `"+i+"`."):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function s(e,t){return u(function(n,r,o,i,u){var s=n[r];if(!t(s)){var l=a(s);return new Error("Invalid "+i+" `"+u+"` of type `"+l+"` supplied to `"+o+"`, expected `"+e+"`.")}return null})}function l(e,t,n){return u(function(r,o,i,u,s){for(var l=arguments.length,c=Array(l>5?l-5:0),f=5;f<l;f++)c[f-5]=arguments[f];var p=r[o];if(!n(p)){var d=u,h=a(p);return new Error("Invalid "+d+" `"+s+"` of type `"+h+"` supplied to `"+i+"`, expected an Immutable.js "+t+".")}if("function"!=typeof e)return new Error("Invalid typeChecker supplied to `"+i+"` for propType `"+s+"`, expected a function.");for(var v=p.toArray(),m=0,g=v.length;m<g;m++){var y=e.apply(void 0,[v,m,i,u,s+"["+m+"]"].concat(c));if(y instanceof Error)return y}})}function c(e,t,n,r){return u(function(){for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return l(e,n,r).apply(void 0,i)||t&&(s=t,u(function(e,t,n,r,o){for(var i=arguments.length,a=Array(i>5?i-5:0),u=5;u<i;u++)a[u-5]=arguments[u];var l=e[t];if("function"!=typeof s)return new Error("Invalid keysTypeChecker (optional second argument) supplied to `"+n+"` for propType `"+o+"`, expected a function.");for(var c=l.keySeq().toArray(),f=0,p=c.length;f<p;f++){var d=s.apply(void 0,[c,f,n,r,o+" -> key("+c[f]+")"].concat(a));if(d instanceof Error)return d}})).apply(void 0,i);var s})}function f(e){var t=void 0===arguments[1]?"Iterable":arguments[1],n=void 0===arguments[2]?r.Iterable.isIterable:arguments[2];return u(function(r,o,i,u,s){for(var l=arguments.length,c=Array(l>5?l-5:0),f=5;f<l;f++)c[f-5]=arguments[f];var p=r[o];if(!n(p)){var d=a(p);return new Error("Invalid "+u+" `"+s+"` of type `"+d+"` supplied to `"+i+"`, expected an Immutable.js "+t+".")}var h=p.toObject();for(var v in e){var m=e[v];if(m){var g=m.apply(void 0,[h,v,i,u,s+"."+v].concat(c));if(g)return g}}})}function p(e){return f(e)}e.exports=i},function(e,t,n){"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,u=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var l in n=Object(arguments[s]))o.call(n,l)&&(u[l]=n[l]);if(r){a=r(n);for(var c=0;c<a.length;c++)i.call(n,a[c])&&(u[a[c]]=n[a[c]])}}return u}},function(e,t,n){"use strict";var r=n(11),o=n(87),i=n(351),a=(n(8),o.ID_ATTRIBUTE_NAME),u=i,s="__reactInternalInstance$"+Math.random().toString(36).slice(2);function l(e,t){return 1===e.nodeType&&e.getAttribute(a)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function c(e){for(var t;t=e._renderedComponent;)e=t;return e}function f(e,t){var n=c(e);n._hostNode=t,t[s]=n}function p(e,t){if(!(e._flags&u.hasCachedChildNodes)){var n=e._renderedChildren,o=t.firstChild;e:for(var i in n)if(n.hasOwnProperty(i)){var a=n[i],s=c(a)._domID;if(0!==s){for(;null!==o;o=o.nextSibling)if(l(o,s)){f(a,o);continue e}r("32",s)}}e._flags|=u.hasCachedChildNodes}}function d(e){if(e[s])return e[s];for(var t,n,r=[];!e[s];){if(r.push(e),!e.parentNode)return null;e=e.parentNode}for(;e&&(n=e[s]);e=r.pop())t=n,r.length&&p(n,e);return t}var h={getClosestInstanceFromNode:d,getInstanceFromNode:function(e){var t=d(e);return null!=t&&t._hostNode===e?t:null},getNodeFromInstance:function(e){if(void 0===e._hostNode&&r("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||r("34"),e=e._hostParent;for(;t.length;e=t.pop())p(e,e._hostNode);return e._hostNode},precacheChildNodes:p,precacheNode:f,uncacheNode:function(e){var t=e._hostNode;t&&(delete t[s],e._hostNode=null)}};e.exports=h},function(e,t){var n=e.exports={version:"2.5.5"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";var r=n(107),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];e.exports=function(e,t){var n,a;if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,a={},null!==n&&Object.keys(n).forEach(function(e){n[e].forEach(function(t){a[String(t)]=e})}),a),-1===i.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t,n){"use strict";t.__esModule=!0;var r=i(n(569)),o=i(n(91));function i(e){return e&&e.__esModule?e:{default:e}}t.default=function(){return function(e,t){if(Array.isArray(e))return e;if((0,r.default)(Object(e)))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var u,s=(0,o.default)(e);!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t,n){var r=n(243)("wks"),o=n(168),i=n(33).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){var r=n(163)("wks"),o=n(116),i=n(21).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){var r=n(21),o=n(15),i=n(49),a=n(50),u=n(52),s=function(e,t,n){var l,c,f,p=e&s.F,d=e&s.G,h=e&s.S,v=e&s.P,m=e&s.B,g=e&s.W,y=d?o:o[t]||(o[t]={}),b=y.prototype,_=d?r:h?r[t]:(r[t]||{}).prototype;for(l in d&&(n=t),n)(c=!p&&_&&void 0!==_[l])&&u(y,l)||(f=c?_[l]:n[l],y[l]=d&&"function"!=typeof _[l]?n[l]:m&&c?i(f,r):g&&_[l]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&"function"==typeof f?i(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[l]=f,e&s.R&&b&&!b[l]&&a(b,l,f)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(263),i=(r=o)&&r.__esModule?r:{default:r};t.default=function(e,t,n){return t in e?(0,i.default)(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){e.exports={default:n(534),__esModule:!0}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(23),i=(r=o)&&r.__esModule?r:{default:r};t.default=i.default||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return!!e&&r.call(e,t)}var i=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function a(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function u(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var s=/&([a-z#][a-z0-9]{1,31});/gi,l=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,c=n(417);function f(e,t){var n=0;return o(c,t)?c[t]:35===t.charCodeAt(0)&&l.test(t)&&a(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?u(n):e}var p=/[&<>"]/,d=/[&<>"]/g,h={"&":"&","<":"<",">":">",'"':"""};function v(e){return h[e]}t.assign=function(e){return[].slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=o,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(i,"$1")},t.isValidEntityCode=a,t.fromCodePoint=u,t.replaceEntities=function(e){return e.indexOf("&")<0?e:e.replace(s,f)},t.escapeHtml=function(e){return p.test(e)?e.replace(d,v):e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(33),o=n(60),i=n(58),a=n(73),u=n(120),s=function(e,t,n){var l,c,f,p,d=e&s.F,h=e&s.G,v=e&s.S,m=e&s.P,g=e&s.B,y=h?r:v?r[t]||(r[t]={}):(r[t]||{}).prototype,b=h?o:o[t]||(o[t]={}),_=b.prototype||(b.prototype={});for(l in h&&(n=t),n)f=((c=!d&&y&&void 0!==y[l])?y:n)[l],p=g&&c?u(f,r):m&&"function"==typeof f?u(Function.call,f):f,y&&a(y,l,f,e&s.U),b[l]!=f&&i(b,l,p),m&&_[l]!=f&&(_[l]=f)};r.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t,n){var r=n(29),o=n(101),i=n(53),a=/"/g,u=function(e,t,n,r){var o=String(i(e)),u="<"+t;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,""")+'"'),u+">"+o+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(u),r(r.P+r.F*o(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r,o=n(91),i=(r=o)&&r.__esModule?r:{default:r};e.exports=function(){var e={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return e;try{e=window;var t=!0,n=!1,r=void 0;try{for(var o,a=(0,i.default)(["File","Blob","FormData"]);!(t=(o=a.next()).done);t=!0){var u=o.value;u in window&&(e[u]=window[u])}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}catch(e){console.error(e)}return e}()},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(25));t.isOAS3=a,t.isSwagger2=function(e){var t=e.get("swagger");if("string"!=typeof t)return!1;return t.startsWith("2.0")},t.OAS3ComponentWrapFactory=function(e){return function(t,n){return function(i){if(n&&n.specSelectors&&n.specSelectors.specJson){var u=n.specSelectors.specJson();return a(u)?o.default.createElement(e,(0,r.default)({},i,n,{Ori:t})):o.default.createElement(t,i)}return console.warn("OAS3 wrapper: couldn't get spec"),null}}};var o=i(n(0));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=e.get("openapi");return"string"==typeof t&&(t.startsWith("3.0.")&&t.length>4)}},function(e,t,n){var r=n(28);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(279),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";var r=null;e.exports={debugTool:r}},function(e,t,n){var r=n(36),o=n(239),i=n(158),a=Object.defineProperty;t.f=n(44)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports={default:n(517),__esModule:!0}},function(e,t,n){e.exports={default:n(518),__esModule:!0}},function(e,t,n){"use strict";var r=n(11),o=n(13),i=n(355),a=n(69),u=n(356),s=n(88),l=n(148),c=n(8),f=[],p=0,d=i.getPooled(),h=!1,v=null;function m(){E.ReactReconcileTransaction&&v||r("123")}var g=[{initialize:function(){this.dirtyComponentsLength=f.length},close:function(){this.dirtyComponentsLength!==f.length?(f.splice(0,this.dirtyComponentsLength),w()):f.length=0}},{initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}}];function y(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=i.getPooled(),this.reconcileTransaction=E.ReactReconcileTransaction.getPooled(!0)}function b(e,t){return e._mountOrder-t._mountOrder}function _(e){var t=e.dirtyComponentsLength;t!==f.length&&r("124",t,f.length),f.sort(b),p++;for(var n=0;n<t;n++){var o,i=f[n],a=i._pendingCallbacks;if(i._pendingCallbacks=null,u.logTopLevelRenders){var l=i;i._currentElement.type.isReactTopLevelWrapper&&(l=i._renderedComponent),o="React update: "+l.getName(),console.time(o)}if(s.performUpdateIfNecessary(i,e.reconcileTransaction,p),o&&console.timeEnd(o),a)for(var c=0;c<a.length;c++)e.callbackQueue.enqueue(a[c],i.getPublicInstance())}}o(y.prototype,l,{getTransactionWrappers:function(){return g},destructor:function(){this.dirtyComponentsLength=null,i.release(this.callbackQueue),this.callbackQueue=null,E.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return l.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),a.addPoolingTo(y);var w=function(){for(;f.length||h;){if(f.length){var e=y.getPooled();e.perform(_,null,e),y.release(e)}if(h){h=!1;var t=d;d=i.getPooled(),t.notifyAll(),i.release(t)}}};var E={ReactReconcileTransaction:null,batchedUpdates:function(e,t,n,r,o,i){return m(),v.batchedUpdates(e,t,n,r,o,i)},enqueueUpdate:function e(t){m(),v.isBatchingUpdates?(f.push(t),null==t._updateBatchNumber&&(t._updateBatchNumber=p+1)):v.batchedUpdates(e,t)},flushBatchedUpdates:w,injection:{injectReconcileTransaction:function(e){e||r("126"),E.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e||r("127"),"function"!=typeof e.batchedUpdates&&r("128"),"boolean"!=typeof e.isBatchingUpdates&&r("129"),v=e}},asap:function(e,t){c(v.isBatchingUpdates,"ReactUpdates.asap: Can't enqueue an asap callback in a context whereupdates are not being batched."),d.enqueue(e,t),h=!0}};e.exports=E},function(e,t,n){e.exports=!n(51)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";t.__esModule=!0;var r=a(n(520)),o=a(n(522)),i="function"==typeof o.default&&"symbol"==typeof r.default?function(e){return typeof e}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":typeof e};function a(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof o.default&&"symbol"===i(r.default)?function(e){return void 0===e?"undefined":i(e)}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":void 0===e?"undefined":i(e)}},function(e,t,n){"use strict";e.exports={current:null}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";var r=n(13),o=n(69),i=n(34),a=(n(10),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),u={type:null,target:null,currentTarget:i.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};function s(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var o=this.constructor.Interface;for(var a in o)if(o.hasOwnProperty(a)){0;var u=o[a];u?this[a]=u(n):"target"===a?this.target=r:this[a]=n[a]}var s=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=s?i.thatReturnsTrue:i.thatReturnsFalse,this.isPropagationStopped=i.thatReturnsFalse,this}r(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=i.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=i.thatReturnsTrue)},persist:function(){this.isPersistent=i.thatReturnsTrue},isPersistent:i.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n<a.length;n++)this[a[n]]=null}}),s.Interface=u,s.augmentClass=function(e,t){var n=function(){};n.prototype=this.prototype;var i=new n;r(i,e.prototype),e.prototype=i,e.prototype.constructor=e,e.Interface=r({},this.Interface,t),e.augmentClass=this.augmentClass,o.addPoolingTo(e,o.fourArgumentPooler)},o.addPoolingTo(s,o.fourArgumentPooler),e.exports=s},function(e,t,n){var r=n(94);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(40),o=n(95);e.exports=n(44)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){"use strict";(function(e){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <[email protected]> <http://feross.org>
* @license MIT
*/
var r=n(529),o=n(530),i=n(262);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=s.prototype:(null===e&&(e=new s(t)),e.length=t),e}function s(e,t,n){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);s.TYPED_ARRAY_SUPPORT?(e=t).__proto__=s.prototype:e=p(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!s.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),o=(e=u(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(s.isBuffer(t)){var n=0|d(t.length);return 0===(e=u(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?u(e,0):p(e,t);if("Buffer"===t.type&&i(t.data))return p(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(c(t),e=u(e,t<0?0:0|d(t)),!s.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|d(t.length);e=u(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,o);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,o){var i,a=1,u=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,u/=2,s/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var c=-1;for(i=n;i<u;i++)if(l(e,i)===l(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===s)return c*a}else-1!==c&&(i-=i-c),c=-1}else for(n+s>u&&(n=u-s),i=n;i>=0;i--){for(var f=!0,p=0;p<s;p++)if(l(e,i+p)!==l(t,p)){f=!1;break}if(f)return i}return-1}function y(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var u=parseInt(t.substr(2*a,2),16);if(isNaN(u))return a;e[n+a]=u}return a}function b(e,t,n,r){return B(F(t,e.length-n),e,n,r)}function _(e,t,n,r){return B(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function w(e,t,n,r){return _(e,t,n,r)}function E(e,t,n,r){return B(z(t),e,n,r)}function x(e,t,n,r){return B(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,u,s,l=e[o],c=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(i=e[o+1]))&&(s=(31&l)<<6|63&i)>127&&(c=s);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(s=(15&l)<<12|(63&i)<<6|63&a)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:i=e[o+1],a=e[o+2],u=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(s=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(c=s)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),o+=f}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=k));return n}(r)}t.Buffer=s,t.SlowBuffer=function(e){+e!=e&&(e=0);return s.alloc(+e)},t.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,n){return l(null,e,t,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?u(e,t):void 0!==n?"string"==typeof r?u(e,t).fill(n,r):u(e,t).fill(n):u(e,t)}(null,e,t,n)},s.allocUnsafe=function(e){return f(null,e)},s.allocUnsafeSlow=function(e){return f(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=s.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},s.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?C(this,0,e):function(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},s.prototype.compare=function(e,t,n,r,o){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;for(var i=o-r,a=n-t,u=Math.min(i,a),l=this.slice(r,o),c=e.slice(t,n),f=0;f<u;++f)if(l[f]!==c[f]){i=l[f],a=c[f];break}return i<a?-1:a<i?1:0},s.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},s.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},s.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return w(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function A(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function O(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function P(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=q(e[i]);return o}function T(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function M(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,n,r,o,i){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function j(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function R(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return i||R(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return i||R(e,0,n,8),o.write(e,t,n,r,52,8),n+8}s.prototype.slice=function(e,t){var n,r=this.length;if(e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),s.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=s.prototype;else{var o=t-e;n=new s(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},s.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},s.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},s.prototype.readUInt8=function(e,t){return t||M(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||M(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||M(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},s.prototype.readInt8=function(e,t){return t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||M(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){t||M(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||M(e,4,this.length),o.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||M(e,4,this.length),o.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||M(e,8,this.length),o.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||M(e,8,this.length),o.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||I(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},s.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||I(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);I(this,e,t,n,o-1,-o)}var i=0,a=1,u=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===u&&0!==this[t+i-1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);I(this,e,t,n,o-1,-o)}var i=n-1,a=1,u=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},s.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=s.isBuffer(e)?e:F(new s(e,r).toString()),u=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%u]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function q(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(t,n(31))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,l=[],c=!1,f=-1;function p(){c&&s&&(c=!1,s.length?l=s.concat(l):f=-1,l.length&&d())}function d(){if(!c){var e=u(p);c=!0;for(var t=l.length;t;){for(s=l,l=[];++f<t;)s&&s[f].run();f=-1,t=l.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||c||u(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){"use strict";function r(e,t){return e===t}function o(e){var t=arguments.length<=1||void 0===arguments[1]?r:arguments[1],n=null,o=null;return function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return null!==n&&n.length===i.length&&i.every(function(e,r){return t(e,n[r])})||(o=e.apply(void 0,i)),n=i,o}}function i(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=0,a=r.pop(),u=function(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var n=t.map(function(e){return typeof e}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}(r),s=e.apply(void 0,[function(){return i++,a.apply(void 0,arguments)}].concat(n)),l=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=u.map(function(n){return n.apply(void 0,[e,t].concat(r))});return s.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(i))};return l.resultFunc=a,l.recomputations=function(){return i},l.resetRecomputations=function(){return i=0},l}}t.__esModule=!0,t.defaultMemoize=o,t.createSelectorCreator=i,t.createStructuredSelector=function(e){var t=arguments.length<=1||void 0===arguments[1]?a:arguments[1];if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(e,t,r){return e[n[r]]=t,e},{})})};var a=t.createSelector=i(o)},function(e,t,n){var r=n(117),o=n(244);e.exports=n(100)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(74);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports={version:"2.5.5"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(278);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(77),o=n(575),i=n(576),a="[object Null]",u="[object Undefined]",s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?u:a:s&&s in Object(e)?o(e):i(e)}},function(e,t,n){var r=n(593),o=n(596);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(296),o=n(633),i=n(78);e.exports=function(e){return i(e)?r(e):o(e)}},function(e,t,n){"use strict";var r=n(140),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=f;var i=n(106);i.inherits=n(81);var a=n(306),u=n(197);i.inherits(f,a);for(var s=o(u.prototype),l=0;l<s.length;l++){var c=s[l];f.prototype[c]||(f.prototype[c]=u.prototype[c])}function f(e){if(!(this instanceof f))return new f(e);a.call(this,e),u.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",p)}function p(){this.allowHalfOpen||this._writableState.ended||r.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){"use strict";var r=n(313)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";var r=n(671),o=Math.max;e.exports=function(e){return o(0,r(e))}},function(e,t,n){"use strict"},function(e,t,n){"use strict";var r=n(11),o=(n(8),function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)}),i=function(e){e instanceof this||r("25"),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)},a=o,u={addPoolingTo:function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||a,n.poolSize||(n.poolSize=10),n.release=i,n},oneArgumentPooler:o,twoArgumentPooler:function(e,t){if(this.instancePool.length){var n=this.instancePool.pop();return this.call(n,e,t),n}return new this(e,t)},threeArgumentPooler:function(e,t,n){if(this.instancePool.length){var r=this.instancePool.pop();return this.call(r,e,t,n),r}return new this(e,t,n)},fourArgumentPooler:function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}};e.exports=u},function(e,t){e.exports={}},function(e,t,n){var r=n(155),o=n(156);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(156);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(33),o=n(58),i=n(118),a=n(168)("src"),u=Function.toString,s=(""+u).split("toString");n(60).inspectSource=function(e){return u.call(e)},(e.exports=function(e,t,n,u){var l="function"==typeof n;l&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(l&&(i(n,a)||o(n,a,e[t]?""+e[t]:s.join(String(t)))),e===r?e[t]=n:u?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||u.call(this)})},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){"use strict";var r=n(13),o=n(265),i=n(537),a=n(542),u=n(76),s=n(543),l=n(546),c=n(547),f=n(549),p=u.createElement,d=u.createFactory,h=u.cloneElement,v=r,m=function(e){return e},g={Children:{map:i.map,forEach:i.forEach,count:i.count,toArray:i.toArray,only:f},Component:o.Component,PureComponent:o.PureComponent,createElement:p,cloneElement:h,isValidElement:u.isValidElement,PropTypes:s,createClass:c,createFactory:d,createMixin:m,DOM:a,version:l,__spread:v};e.exports=g},function(e,t,n){"use strict";var r=n(13),o=n(46),i=(n(10),n(267),Object.prototype.hasOwnProperty),a=n(268),u={key:!0,ref:!0,__self:!0,__source:!0};function s(e){return void 0!==e.ref}function l(e){return void 0!==e.key}var c=function(e,t,n,r,o,i,u){var s={$$typeof:a,type:e,key:t,ref:n,props:u,_owner:i};return s};c.createElement=function(e,t,n){var r,a={},f=null,p=null;if(null!=t)for(r in s(t)&&(p=t.ref),l(t)&&(f=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source,t)i.call(t,r)&&!u.hasOwnProperty(r)&&(a[r]=t[r]);var d=arguments.length-2;if(1===d)a.children=n;else if(d>1){for(var h=Array(d),v=0;v<d;v++)h[v]=arguments[v+2];0,a.children=h}if(e&&e.defaultProps){var m=e.defaultProps;for(r in m)void 0===a[r]&&(a[r]=m[r])}return c(e,f,p,0,0,o.current,a)},c.createFactory=function(e){var t=c.createElement.bind(null,e);return t.type=e,t},c.cloneAndReplaceKey=function(e,t){return c(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},c.cloneElement=function(e,t,n){var a,f,p=r({},e.props),d=e.key,h=e.ref,v=(e._self,e._source,e._owner);if(null!=t)for(a in s(t)&&(h=t.ref,v=o.current),l(t)&&(d=""+t.key),e.type&&e.type.defaultProps&&(f=e.type.defaultProps),t)i.call(t,a)&&!u.hasOwnProperty(a)&&(void 0===t[a]&&void 0!==f?p[a]=f[a]:p[a]=t[a]);var m=arguments.length-2;if(1===m)p.children=n;else if(m>1){for(var g=Array(m),y=0;y<m;y++)g[y]=arguments[y+2];p.children=g}return c(e.type,d,h,0,0,v,p)},c.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},e.exports=c},function(e,t,n){var r=n(37).Symbol;e.exports=r},function(e,t,n){var r=n(286),o=n(189);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(24),o=n(192),i=n(641),a=n(61);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},function(e,t,n){var r=n(128),o=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";var r=n(66);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(729),i=(r=o)&&r.__esModule?r:{default:r};t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return(0,i.default)(e)}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},function(e,t,n){"use strict";function r(e){return void 0===e||null===e}e.exports.isNothing=r,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:r(e)?[]:[e]},e.exports.repeat=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},e.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},e.exports.extend=function(e,t){var n,r,o,i;if(t)for(n=0,r=(i=Object.keys(t)).length;n<r;n+=1)e[o=i[n]]=t[o];return e}},function(e,t,n){"use strict";var r=n(85),o=n(107),i=n(16);function a(e,t,n){var r=[];return e.include.forEach(function(e){n=a(e,t,n)}),e[t].forEach(function(e){n.forEach(function(t,n){t.tag===e.tag&&t.kind===e.kind&&r.push(n)}),n.push(e)}),n.filter(function(e,t){return-1===r.indexOf(t)})}function u(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=a(this,"implicit",[]),this.compiledExplicit=a(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(this.compiledImplicit,this.compiledExplicit)}u.DEFAULT=null,u.create=function(){var e,t;switch(arguments.length){case 1:e=u.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new o("Wrong number of arguments for Schema.create function")}if(e=r.toArray(e),t=r.toArray(t),!e.every(function(e){return e instanceof u}))throw new o("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof i}))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new u({include:e,explicit:t})},e.exports=u},function(e,t,n){"use strict";var r=n(11);n(8);function o(e,t){return(e&t)===t}var i={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,injectDOMPropertyConfig:function(e){var t=i,n=e.Properties||{},a=e.DOMAttributeNamespaces||{},s=e.DOMAttributeNames||{},l=e.DOMPropertyNames||{},c=e.DOMMutationMethods||{};for(var f in e.isCustomAttribute&&u._isCustomAttributeFunctions.push(e.isCustomAttribute),n){u.properties.hasOwnProperty(f)&&r("48",f);var p=f.toLowerCase(),d=n[f],h={attributeName:p,attributeNamespace:null,propertyName:f,mutationMethod:null,mustUseProperty:o(d,t.MUST_USE_PROPERTY),hasBooleanValue:o(d,t.HAS_BOOLEAN_VALUE),hasNumericValue:o(d,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:o(d,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:o(d,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(h.hasBooleanValue+h.hasNumericValue+h.hasOverloadedBooleanValue<=1||r("50",f),s.hasOwnProperty(f)){var v=s[f];h.attributeName=v}a.hasOwnProperty(f)&&(h.attributeNamespace=a[f]),l.hasOwnProperty(f)&&(h.propertyName=l[f]),c.hasOwnProperty(f)&&(h.mutationMethod=c[f]),u.properties[f]=h}}},a=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",u={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:a,ATTRIBUTE_NAME_CHAR:a+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<u._isCustomAttributeFunctions.length;t++){if((0,u._isCustomAttributeFunctions[t])(e))return!0}return!1},injection:i};e.exports=u},function(e,t,n){"use strict";var r=n(784);n(39),n(10);function o(){r.attachRefs(this,this._currentElement)}var i={mountComponent:function(e,t,n,r,i,a){var u=e.mountComponent(t,n,r,i,a);return e._currentElement&&null!=e._currentElement.ref&&t.getReactMountReady().enqueue(o,e),u},getHostNode:function(e){return e.getHostNode()},unmountComponent:function(e,t){r.detachRefs(e,e._currentElement),e.unmountComponent(t)},receiveComponent:function(e,t,n,i){var a=e._currentElement;if(t!==a||i!==e._context){0;var u=r.shouldUpdateRefs(a,t);u&&r.detachRefs(e,a),e.receiveComponent(t,n,i),u&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(o,e)}},performUpdateIfNecessary:function(e,t,n){e._updateBatchNumber===n&&e.performUpdateIfNecessary(t)}};e.exports=i},function(e,t,n){"use strict";var r=n(218),o=n(150),i=n(219),a=n(360),u="undefined"!=typeof document&&"number"==typeof document.documentMode||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&/\bEdge\/\d/.test(navigator.userAgent);function s(e){if(u){var t=e.node,n=e.children;if(n.length)for(var r=0;r<n.length;r++)l(t,n[r],null);else null!=e.html?o(t,e.html):null!=e.text&&a(t,e.text)}}var l=i(function(e,t,n){11===t.node.nodeType||1===t.node.nodeType&&"object"===t.node.nodeName.toLowerCase()&&(null==t.node.namespaceURI||t.node.namespaceURI===r.html)?(s(t),e.insertBefore(t.node,n)):(e.insertBefore(t.node,n),s(t))});function c(){return this.node.nodeName}function f(e){return{node:e,children:[],html:null,text:null,toString:c}}f.insertTreeBefore=l,f.replaceChildWithTree=function(e,t){e.parentNode.replaceChild(t.node,e),s(t)},f.queueChild=function(e,t){u?e.children.push(t):e.node.appendChild(t.node)},f.queueHTML=function(e,t){u?e.html=t:o(e.node,t)},f.queueText=function(e,t){u?e.text=t:a(e.node,t)},e.exports=f},function(e,t,n){var r=n(147),o=n(345);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var u=-1,s=t.length;++u<s;){var l=t[u],c=i?i(n[l],e[l],l,n,e):void 0;void 0===c&&(c=e[l]),a?o(n,l,c):r(n,l,c)}return n}},function(e,t,n){e.exports={default:n(448),__esModule:!0}},function(e,t,n){n(449);for(var r=n(21),o=n(50),i=n(70),a=n(19)("toStringTag"),u="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),s=0;s<u.length;s++){var l=u[s],c=r[l],f=c&&c.prototype;f&&!f[a]&&o(f,a,l),i[l]=i.Array}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(240),o=n(164);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(40).f,o=n(52),i=n(19)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){"use strict";var r=n(456)(!0);n(238)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){e.exports=!n(101)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports={}},function(e,t,n){var r=n(119),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){"use strict";e.exports=function(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(t,n(54).Buffer)},function(e,t,n){"use strict";function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=r},function(e,t,n){"use strict";var r=n(86);e.exports=new r({include:[n(341)],implicit:[n(752),n(753)],explicit:[n(754),n(755),n(756),n(757)]})},function(e,t,n){"use strict";var r=n(110),o=n(212),i=n(352),a=n(353),u=(n(10),r.getListener);function s(e,t,n){var r=function(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return u(e,r)}(e,n,t);r&&(n._dispatchListeners=i(n._dispatchListeners,r),n._dispatchInstances=i(n._dispatchInstances,e))}function l(e){e&&e.dispatchConfig.phasedRegistrationNames&&o.traverseTwoPhase(e._targetInst,s,e)}function c(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst,n=t?o.getParentInstance(t):null;o.traverseTwoPhase(n,s,e)}}function f(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=u(e,r);o&&(n._dispatchListeners=i(n._dispatchListeners,o),n._dispatchInstances=i(n._dispatchInstances,e))}}function p(e){e&&e.dispatchConfig.registrationName&&f(e._targetInst,0,e)}var d={accumulateTwoPhaseDispatches:function(e){a(e,l)},accumulateTwoPhaseDispatchesSkipTarget:function(e){a(e,c)},accumulateDirectDispatches:function(e){a(e,p)},accumulateEnterLeaveDispatches:function(e,t,n,r){o.traverseEnterLeave(n,r,f,e,t)}};e.exports=d},function(e,t,n){"use strict";var r=n(11),o=n(211),i=n(212),a=n(213),u=n(352),s=n(353),l=(n(8),{}),c=null,f=function(e,t){e&&(i.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},p=function(e){return f(e,!0)},d=function(e){return f(e,!1)},h=function(e){return"."+e._rootNodeID};var v={injection:{injectEventPluginOrder:o.injectEventPluginOrder,injectEventPluginsByName:o.injectEventPluginsByName},putListener:function(e,t,n){"function"!=typeof n&&r("94",t,typeof n);var i=h(e);(l[t]||(l[t]={}))[i]=n;var a=o.registrationNameModules[t];a&&a.didPutListener&&a.didPutListener(e,t,n)},getListener:function(e,t){var n=l[t];if(function(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||(r=t,"button"!==r&&"input"!==r&&"select"!==r&&"textarea"!==r));default:return!1}var r}(t,e._currentElement.type,e._currentElement.props))return null;var r=h(e);return n&&n[r]},deleteListener:function(e,t){var n=o.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var r=l[t];r&&delete r[h(e)]},deleteAllListeners:function(e){var t=h(e);for(var n in l)if(l.hasOwnProperty(n)&&l[n][t]){var r=o.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(e,n),delete l[n][t]}},extractEvents:function(e,t,n,r){for(var i,a=o.plugins,s=0;s<a.length;s++){var l=a[s];if(l){var c=l.extractEvents(e,t,n,r);c&&(i=u(i,c))}}return i},enqueueEvents:function(e){e&&(c=u(c,e))},processEventQueue:function(e){var t=c;c=null,s(t,e?p:d),c&&r("95"),a.rethrowCaughtError()},__purge:function(){l={}},__getListenerBank:function(){return l}};e.exports=v},function(e,t,n){"use strict";var r=n(48),o=n(214),i={view:function(e){if(e.view)return e.view;var t=o(e);if(t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,i),e.exports=a},function(e,t,n){"use strict";var r={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};e.exports=r},function(e,t,n){var r;
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r))e.push(o.apply(null,r));else if("object"===i)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}void 0!==e&&e.exports?e.exports=o:void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=!0},function(e,t,n){var r=n(161),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(59),o=n(460),i=n(461),a=Object.defineProperty;t.f=n(100)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(121);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(466),o=n(53);e.exports=function(e){return r(o(e))}},function(e,t,n){"use strict";var r=n(58),o=n(73),i=n(101),a=n(53),u=n(18);e.exports=function(e,t,n){var s=u(e),l=n(a,s,""[e]),c=l[0],f=l[1];i(function(){var t={};return t[s]=function(){return 7},7!=""[e](t)})&&(o(String.prototype,e,c),r(RegExp.prototype,s,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){var r=n(116)("meta"),o=n(28),i=n(52),a=n(40).f,u=0,s=Object.isExtensible||function(){return!0},l=!n(51)(function(){return s(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++u,w:{}}})},f=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!s(e))return"F";if(!t)return"E";c(e)}return e[r].i},getWeak:function(e,t){if(!i(e,r)){if(!s(e))return!0;if(!t)return!1;c(e)}return e[r].w},onFreeze:function(e){return l&&f.NEED&&s(e)&&!i(e,r)&&c(e),e}}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CLEAR_BY=t.CLEAR=t.NEW_AUTH_ERR=t.NEW_SPEC_ERR_BATCH=t.NEW_SPEC_ERR=t.NEW_THROWN_ERR_BATCH=t.NEW_THROWN_ERR=void 0,t.newThrownErr=function(e){return{type:a,payload:(0,i.default)(e)}},t.newThrownErrBatch=function(e){return{type:u,payload:e}},t.newSpecErr=function(e){return{type:s,payload:e}},t.newSpecErrBatch=function(e){return{type:l,payload:e}},t.newAuthErr=function(e){return{type:c,payload:e}},t.clear=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:f,payload:e}},t.clearBy=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return{type:p,payload:e}};var r,o=n(180),i=(r=o)&&r.__esModule?r:{default:r};var a=t.NEW_THROWN_ERR="err_new_thrown_err",u=t.NEW_THROWN_ERR_BATCH="err_new_thrown_err_batch",s=t.NEW_SPEC_ERR="err_new_spec_err",l=t.NEW_SPEC_ERR_BATCH="err_new_spec_err_batch",c=t.NEW_AUTH_ERR="err_new_auth_err",f=t.CLEAR="err_clear",p=t.CLEAR_BY="err_clear_by"},function(e,t,n){var r=n(62),o=n(47),i="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||o(e)&&r(e)==i}},function(e,t,n){var r=n(63)(Object,"create");e.exports=r},function(e,t,n){var r=n(601),o=n(602),i=n(603),a=n(604),u=n(605);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=u,e.exports=s},function(e,t,n){var r=n(105);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(607);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(612),o=n(640),i=n(193),a=n(24),u=n(645);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):r(e):u(e)}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var o=typeof e;return!!(t=null==t?n:t)&&("number"==o||"symbol"!=o&&r.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(635),o=n(183),i=n(636),a=n(637),u=n(638),s=n(62),l=n(287),c=l(r),f=l(o),p=l(i),d=l(a),h=l(u),v=s;(r&&"[object DataView]"!=v(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=v(new o)||i&&"[object Promise]"!=v(i.resolve())||a&&"[object Set]"!=v(new a)||u&&"[object WeakMap]"!=v(new u))&&(v=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case c:return"[object DataView]";case f:return"[object Map]";case p:return"[object Promise]";case d:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=v},function(e,t,n){var r=n(139);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},function(e,t,n){var r=n(79),o=n(80);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},function(e,t,n){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,a,u=arguments.length;switch(u){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,r)});case 4:return t.nextTick(function(){e.call(null,n,r,o)});default:for(i=new Array(u-1),a=0;a<i.length;)i[a++]=arguments[a];return t.nextTick(function(){e.apply(null,i)})}}}:e.exports=t}).call(t,n(55))},function(e,t,n){var r=n(54),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),i(o,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";e.exports=n(676)("forEach")},function(e,t,n){"use strict";var r=n(315),o=n(312),i=n(198),a=n(685);(e.exports=function(e,t){var n,i,u,s,l;return arguments.length<2||"string"!=typeof e?(s=t,t=e,e=null):s=arguments[2],null==e?(n=u=!0,i=!1):(n=a.call(e,"c"),i=a.call(e,"e"),u=a.call(e,"w")),l={value:t,configurable:n,enumerable:i,writable:u},s?r(o(s),l):l}).gs=function(e,t,n){var u,s,l,c;return"string"!=typeof e?(l=n,n=t,t=e,e=null):l=arguments[3],null==t?t=void 0:i(t)?null==n?n=void 0:i(n)||(l=n,n=void 0):(l=t,t=n=void 0),null==e?(u=!0,s=!1):(u=a.call(e,"c"),s=a.call(e,"e")),c={get:t,set:n,configurable:u,enumerable:s},l?r(o(l),c):c}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateBeforeExecute=t.canExecuteScheme=t.operationScheme=t.hasHost=t.operationWithMeta=t.parameterWithMeta=t.parameterInclusionSettingFor=t.parameterWithMetaByIdentity=t.allowTryItOutFor=t.mutatedRequestFor=t.requestFor=t.responseFor=t.mutatedRequests=t.requests=t.responses=t.taggedOperations=t.operationsWithTags=t.tagDetails=t.tags=t.operationsWithRootInherited=t.schemes=t.host=t.basePath=t.definitions=t.findDefinition=t.securityDefinitions=t.security=t.produces=t.consumes=t.operations=t.paths=t.semver=t.version=t.externalDocs=t.info=t.isOAS3=t.spec=t.specJsonWithResolvedSubtrees=t.specResolvedSubtree=t.specResolved=t.specJson=t.specSource=t.specStr=t.url=t.lastError=void 0;var r=s(n(17)),o=s(n(83));t.getParameter=function(e,t,n,r){return t=t||[],e.getIn(["meta","paths"].concat((0,o.default)(t),["parameters"]),(0,u.fromJS)([])).find(function(e){return u.Map.isMap(e)&&e.get("name")===n&&e.get("in")===r})||(0,u.Map)()},t.parameterValues=function(e,t,n){return t=t||[],P.apply(void 0,[e].concat((0,o.default)(t))).get("parameters",(0,u.List)()).reduce(function(e,t){var r=n&&"body"===t.get("in")?t.get("value_xml"):t.get("value");return e.set(t.get("in")+"."+t.get("name"),r)},(0,u.fromJS)({}))},t.parametersIncludeIn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(u.List.isList(e))return e.some(function(e){return u.Map.isMap(e)&&e.get("in")===t})},t.parametersIncludeType=T,t.contentTypeValues=function(e,t){t=t||[];var n=d(e).getIn(["paths"].concat((0,o.default)(t)),(0,u.fromJS)({})),r=e.getIn(["meta","paths"].concat((0,o.default)(t)),(0,u.fromJS)({})),i=M(e,t),a=n.get("parameters")||new u.List,s=r.get("consumes_value")?r.get("consumes_value"):T(a,"file")?"multipart/form-data":T(a,"formData")?"application/x-www-form-urlencoded":void 0;return(0,u.fromJS)({requestContentType:s,responseContentType:i})},t.currentProducesFor=M,t.producesOptionsFor=function(e,t){t=t||[];var n=d(e),i=n.getIn(["paths"].concat((0,o.default)(t)),null);if(null===i)return;var a=t,u=(0,r.default)(a,1)[0],s=i.get("produces",null),l=n.getIn(["paths",u,"produces"],null),c=n.getIn(["produces"],null);return s||l||c},t.consumesOptionsFor=function(e,t){t=t||[];var n=d(e),i=n.getIn(["paths"].concat((0,o.default)(t)),null);if(null===i)return;var a=t,u=(0,r.default)(a,1)[0],s=i.get("consumes",null),l=n.getIn(["paths",u,"consumes"],null),c=n.getIn(["consumes"],null);return s||l||c};var i=n(57),a=n(9),u=n(7);function s(e){return e&&e.__esModule?e:{default:e}}var l=["get","put","post","delete","options","head","patch","trace"],c=function(e){return e||(0,u.Map)()},f=(t.lastError=(0,i.createSelector)(c,function(e){return e.get("lastError")}),t.url=(0,i.createSelector)(c,function(e){return e.get("url")}),t.specStr=(0,i.createSelector)(c,function(e){return e.get("spec")||""}),t.specSource=(0,i.createSelector)(c,function(e){return e.get("specSource")||"not-editor"}),t.specJson=(0,i.createSelector)(c,function(e){return e.get("json",(0,u.Map)())})),p=(t.specResolved=(0,i.createSelector)(c,function(e){return e.get("resolved",(0,u.Map)())}),t.specResolvedSubtree=function(e,t){return e.getIn(["resolvedSubtrees"].concat((0,o.default)(t)),void 0)},function e(t,n){return u.Map.isMap(t)&&u.Map.isMap(n)?n.get("$$ref")?n:(0,u.OrderedMap)().mergeWith(e,t,n):n}),d=t.specJsonWithResolvedSubtrees=(0,i.createSelector)(c,function(e){return(0,u.OrderedMap)().mergeWith(p,e.get("json"),e.get("resolvedSubtrees"))}),h=t.spec=function(e){return f(e)},v=(t.isOAS3=(0,i.createSelector)(h,function(){return!1}),t.info=(0,i.createSelector)(h,function(e){return j(e&&e.get("info"))})),m=(t.externalDocs=(0,i.createSelector)(h,function(e){return j(e&&e.get("externalDocs"))}),t.version=(0,i.createSelector)(v,function(e){return e&&e.get("version")})),g=(t.semver=(0,i.createSelector)(m,function(e){return/v?([0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(e).slice(1)}),t.paths=(0,i.createSelector)(d,function(e){return e.get("paths")})),y=t.operations=(0,i.createSelector)(g,function(e){if(!e||e.size<1)return(0,u.List)();var t=(0,u.List)();return e&&e.forEach?(e.forEach(function(e,n){if(!e||!e.forEach)return{};e.forEach(function(e,r){l.indexOf(r)<0||(t=t.push((0,u.fromJS)({path:n,method:r,operation:e,id:r+"-"+n})))})}),t):(0,u.List)()}),b=t.consumes=(0,i.createSelector)(h,function(e){return(0,u.Set)(e.get("consumes"))}),_=t.produces=(0,i.createSelector)(h,function(e){return(0,u.Set)(e.get("produces"))}),w=(t.security=(0,i.createSelector)(h,function(e){return e.get("security",(0,u.List)())}),t.securityDefinitions=(0,i.createSelector)(h,function(e){return e.get("securityDefinitions")}),t.findDefinition=function(e,t){var n=e.getIn(["resolvedSubtrees","definitions",t],null),r=e.getIn(["json","definitions",t],null);return n||r||null},t.definitions=(0,i.createSelector)(h,function(e){var t=e.get("definitions");return u.Map.isMap(t)?t:(0,u.Map)()}),t.basePath=(0,i.createSelector)(h,function(e){return e.get("basePath")}),t.host=(0,i.createSelector)(h,function(e){return e.get("host")}),t.schemes=(0,i.createSelector)(h,function(e){return e.get("schemes",(0,u.Map)())}),t.operationsWithRootInherited=(0,i.createSelector)(y,b,_,function(e,t,n){return e.map(function(e){return e.update("operation",function(e){if(e){if(!u.Map.isMap(e))return;return e.withMutations(function(e){return e.get("consumes")||e.update("consumes",function(e){return(0,u.Set)(e).merge(t)}),e.get("produces")||e.update("produces",function(e){return(0,u.Set)(e).merge(n)}),e})}return(0,u.Map)()})})})),E=t.tags=(0,i.createSelector)(h,function(e){return e.get("tags",(0,u.List)())}),x=t.tagDetails=function(e,t){return(E(e)||(0,u.List)()).filter(u.Map.isMap).find(function(e){return e.get("name")===t},(0,u.Map)())},S=t.operationsWithTags=(0,i.createSelector)(w,E,function(e,t){return e.reduce(function(e,t){var n=(0,u.Set)(t.getIn(["operation","tags"]));return n.count()<1?e.update("default",(0,u.List)(),function(e){return e.push(t)}):n.reduce(function(e,n){return e.update(n,(0,u.List)(),function(e){return e.push(t)})},e)},t.reduce(function(e,t){return e.set(t.get("name"),(0,u.List)())},(0,u.OrderedMap)()))}),C=(t.taggedOperations=function(e){return function(t){var n=(0,t.getConfigs)(),r=n.tagsSorter,o=n.operationsSorter;return S(e).sortBy(function(e,t){return t},function(e,t){var n="function"==typeof r?r:a.sorters.tagsSorter[r];return n?n(e,t):null}).map(function(t,n){var r="function"==typeof o?o:a.sorters.operationsSorter[o],i=r?t.sort(r):t;return(0,u.Map)({tagDetails:x(e,n),operations:i})})}},t.responses=(0,i.createSelector)(c,function(e){return e.get("responses",(0,u.Map)())})),k=t.requests=(0,i.createSelector)(c,function(e){return e.get("requests",(0,u.Map)())}),A=t.mutatedRequests=(0,i.createSelector)(c,function(e){return e.get("mutatedRequests",(0,u.Map)())}),O=(t.responseFor=function(e,t,n){return C(e).getIn([t,n],null)},t.requestFor=function(e,t,n){return k(e).getIn([t,n],null)},t.mutatedRequestFor=function(e,t,n){return A(e).getIn([t,n],null)},t.allowTryItOutFor=function(){return!0},t.parameterWithMetaByIdentity=function(e,t,n){var r=d(e).getIn(["paths"].concat((0,o.default)(t),["parameters"]),(0,u.OrderedMap)()),i=e.getIn(["meta","paths"].concat((0,o.default)(t),["parameters"]),(0,u.OrderedMap)());return r.map(function(e){var t=i.get(n.get("name")+"."+n.get("in")),r=i.get(n.get("name")+"."+n.get("in")+".hash-"+n.hashCode());return(0,u.OrderedMap)().merge(e,t,r)}).find(function(e){return e.get("in")===n.get("in")&&e.get("name")===n.get("name")},(0,u.OrderedMap)())}),P=(t.parameterInclusionSettingFor=function(e,t,n,r){var i=n+"."+r;return e.getIn(["meta","paths"].concat((0,o.default)(t),["parameter_inclusions",i]),!1)},t.parameterWithMeta=function(e,t,n,r){var i=d(e).getIn(["paths"].concat((0,o.default)(t),["parameters"]),(0,u.OrderedMap)()).find(function(e){return e.get("in")===r&&e.get("name")===n},(0,u.OrderedMap)());return O(e,t,i)},t.operationWithMeta=function(e,t,n){var r=d(e).getIn(["paths",t,n],(0,u.OrderedMap)()),o=e.getIn(["meta","paths",t,n],(0,u.OrderedMap)()),i=r.get("parameters",(0,u.List)()).map(function(r){return O(e,[t,n],r)});return(0,u.OrderedMap)().merge(r,o).set("parameters",i)});t.hasHost=(0,i.createSelector)(h,function(e){var t=e.get("host");return"string"==typeof t&&t.length>0&&"/"!==t[0]});function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(u.List.isList(e))return e.some(function(e){return u.Map.isMap(e)&&e.get("type")===t})}function M(e,t){t=t||[];var n=d(e).getIn(["paths"].concat((0,o.default)(t)),null);if(null!==n){var r=e.getIn(["meta","paths"].concat((0,o.default)(t),["produces_value"]),null),i=n.getIn(["produces",0],null);return r||i||"application/json"}}var I=t.operationScheme=function(e,t,n){var r=e.get("url").match(/^([a-z][a-z0-9+\-.]*):/),o=Array.isArray(r)?r[1]:null;return e.getIn(["scheme",t,n])||e.getIn(["scheme","_defaultScheme"])||o||""};t.canExecuteScheme=function(e,t,n){return["http","https"].indexOf(I(e,t,n))>-1},t.validateBeforeExecute=function(e,t){t=t||[];var n=!0;return e.getIn(["meta","paths"].concat((0,o.default)(t),["parameters"]),(0,u.fromJS)([])).forEach(function(e){var t=e.get("errors");t&&t.count()&&(n=!1)}),n};function j(e){return u.Map.isMap(e)?e:new u.Map}},function(e,t,n){var r=n(49),o=n(330),i=n(331),a=n(36),u=n(115),s=n(165),l={},c={};(t=e.exports=function(e,t,n,f,p){var d,h,v,m,g=p?function(){return e}:s(e),y=r(n,f,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(i(g)){for(d=u(e.length);d>b;b++)if((m=t?y(a(h=e[b])[0],h[1]):y(e[b]))===l||m===c)return m}else for(v=g.call(e);!(h=v.next()).done;)if((m=o(v,y,h.value,t))===l||m===c)return m}).BREAK=l,t.RETURN=c},function(e,t,n){"use strict";var r=n(86);e.exports=r.DEFAULT=new r({include:[n(108)],explicit:[n(758),n(759),n(760)]})},function(e,t,n){var r=n(345),o=n(105),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){"use strict";var r=n(11),o=(n(8),{}),i={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,n,o,i,a,u,s){var l,c;this.isInTransaction()&&r("27");try{this._isInTransaction=!0,l=!0,this.initializeAll(0),c=e.call(t,n,o,i,a,u,s),l=!1}finally{try{if(l)try{this.closeAll(0)}catch(e){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return c},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var r=t[n];try{this.wrapperInitData[n]=o,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===o)try{this.initializeAll(n+1)}catch(e){}}}},closeAll:function(e){this.isInTransaction()||r("28");for(var t=this.transactionWrappers,n=e;n<t.length;n++){var i,a=t[n],u=this.wrapperInitData[n];try{i=!0,u!==o&&a.close&&a.close.call(this,u),i=!1}finally{if(i)try{this.closeAll(n+1)}catch(e){}}}this.wrapperInitData.length=0}};e.exports=i},function(e,t,n){"use strict";var r=n(111),o=n(359),i={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:n(216),button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+o.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+o.currentScrollTop}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,i),e.exports=a},function(e,t,n){"use strict";var r,o=n(26),i=n(218),a=/^[ \r\n\t\f]/,u=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,s=n(219)(function(e,t){if(e.namespaceURI!==i.svg||"innerHTML"in e)e.innerHTML=t;else{(r=r||document.createElement("div")).innerHTML="<svg>"+t+"</svg>";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(o.canUseDOM){var l=document.createElement("div");l.innerHTML=" ",""===l.innerHTML&&(s=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&u.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),l=null}e.exports=s},function(e,t,n){"use strict";var r=/["'&<>]/;e.exports=function(e){return"boolean"==typeof e||"number"==typeof e?""+e:function(e){var t,n=""+e,o=r.exec(n);if(!o)return n;var i="",a=0,u=0;for(a=o.index;a<n.length;a++){switch(n.charCodeAt(a)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}u!==a&&(i+=n.substring(u,a)),u=a+1,i+=t}return u!==a?i+n.substring(u,a):i}(e)}},function(e,t,n){"use strict";var r,o=n(13),i=n(211),a=n(805),u=n(359),s=n(806),l=n(215),c={},f=!1,p=0,d={topAbort:"abort",topAnimationEnd:s("animationend")||"animationend",topAnimationIteration:s("animationiteration")||"animationiteration",topAnimationStart:s("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:s("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},h="_reactListenersID"+String(Math.random()).slice(2);var v=o({},a,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(v.handleTopLevel),v.ReactEventListener=e}},setEnabled:function(e){v.ReactEventListener&&v.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!v.ReactEventListener||!v.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,r=function(e){return Object.prototype.hasOwnProperty.call(e,h)||(e[h]=p++,c[e[h]]={}),c[e[h]]}(n),o=i.registrationNameDependencies[e],a=0;a<o.length;a++){var u=o[a];r.hasOwnProperty(u)&&r[u]||("topWheel"===u?l("wheel")?v.ReactEventListener.trapBubbledEvent("topWheel","wheel",n):l("mousewheel")?v.ReactEventListener.trapBubbledEvent("topWheel","mousewheel",n):v.ReactEventListener.trapBubbledEvent("topWheel","DOMMouseScroll",n):"topScroll"===u?l("scroll",!0)?v.ReactEventListener.trapCapturedEvent("topScroll","scroll",n):v.ReactEventListener.trapBubbledEvent("topScroll","scroll",v.ReactEventListener.WINDOW_HANDLE):"topFocus"===u||"topBlur"===u?(l("focus",!0)?(v.ReactEventListener.trapCapturedEvent("topFocus","focus",n),v.ReactEventListener.trapCapturedEvent("topBlur","blur",n)):l("focusin")&&(v.ReactEventListener.trapBubbledEvent("topFocus","focusin",n),v.ReactEventListener.trapBubbledEvent("topBlur","focusout",n)),r.topBlur=!0,r.topFocus=!0):d.hasOwnProperty(u)&&v.ReactEventListener.trapBubbledEvent(u,d[u],n),r[u]=!0)}},trapBubbledEvent:function(e,t,n){return v.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return v.ReactEventListener.trapCapturedEvent(e,t,n)},supportsEventPageXY:function(){if(!document.createEvent)return!1;var e=document.createEvent("MouseEvent");return null!=e&&"pageX"in e},ensureScrollValueMonitoring:function(){if(void 0===r&&(r=v.supportsEventPageXY()),!r&&!f){var e=u.refreshScrollValues;v.ReactEventListener.monitorScrollValue(e),f=!0}}});e.exports=v},function(e,t,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(e){for(var t=this.__rules__.length,n=-1;t--;)if(this.__rules__[++n].name===e)return n;return-1},r.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},r.prototype.at=function(e,t,n){var r=this.__find__(e),o=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=o.alt||[],this.__cache__=null},r.prototype.before=function(e,t,n,r){var o=this.__find__(e),i=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},r.prototype.after=function(e,t,n,r){var o=this.__find__(e),i=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},r.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},r.prototype.enable=function(e,t){e=Array.isArray(e)?e:[e],t&&this.__rules__.forEach(function(e){e.enabled=!1}),e.forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0},this),this.__cache__=null},r.prototype.disable=function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1},this),this.__cache__=null},r.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i=-1,a=e.posMax,u=e.pos,s=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos<a;){if(91===(o=e.src.charCodeAt(e.pos)))n++;else if(93===o&&0===--n){r=!0;break}e.parser.skipToken(e)}return r?(i=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=n-1,e.pos=u,e.isInLabel=s,i}},function(e,t,n){var r=n(93);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(28),o=n(21).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(28);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(50)},function(e,t,n){var r=n(36),o=n(453),i=n(164),a=n(162)("IE_PROTO"),u=function(){},s=function(){var e,t=n(157)("iframe"),r=i.length;for(t.style.display="none",n(241).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),s=e.F;r--;)delete s.prototype[i[r]];return s()};e.exports=Object.create||function(e,t){var n;return null!==e?(u.prototype=r(e),n=new u,u.prototype=null,n[a]=e):n=s(),void 0===t?n:o(n,t)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(163)("keys"),o=n(116);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(21),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(166),o=n(19)("iterator"),i=n(70);e.exports=n(15).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){var r=n(93),o=n(19)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var r=n(99),o=n(18)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(74),o=n(33).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(243)("keys"),o=n(168);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(117).f,o=n(118),i=n(18)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){"use strict";var r=n(121);e.exports.f=function(e){return new function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}(e)}},function(e,t,n){var r=n(257),o=n(53);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(e))}},function(e,t,n){var r=n(18)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){t.f=n(19)},function(e,t,n){var r=n(21),o=n(15),i=n(114),a=n(175),u=n(40).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||u(t,e,{value:a.f(e)})}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){},function(e,t,n){"use strict";(function(t){
/*!
* @description Recursive object extending
* @author Viacheslav Lotsmanov <[email protected]>
* @license MIT
*
* The MIT License (MIT)
*
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(e,t){return"__proto__"===t?void 0:e[t]}var i=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,a=arguments[0];return Array.prototype.slice.call(arguments,1).forEach(function(u){"object"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach(function(s){return t=o(a,s),(e=o(u,s))===a?void 0:"object"!=typeof e||null===e?void(a[s]=e):Array.isArray(e)?void(a[s]=function e(t){var o=[];return t.forEach(function(t,a){"object"==typeof t&&null!==t?Array.isArray(t)?o[a]=e(t):n(t)?o[a]=r(t):o[a]=i({},t):o[a]=t}),o}(e)):n(e)?void(a[s]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(a[s]=i({},e)):void(a[s]=i(t,e))})}),a}}).call(t,n(54).Buffer)},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e?function e(t,n){var r;r=Array.isArray(t)?[]:{};n.push(t);Object.keys(t).forEach(function(o){var i=t[o];"function"!=typeof i&&(i&&"object"==typeof i?-1!==n.indexOf(t[o])?r[o]="[Circular]":r[o]=e(t[o],n.slice(0)):r[o]=i)});"string"==typeof t.name&&(r.name=t.name);"string"==typeof t.message&&(r.message=t.message);"string"==typeof t.stack&&(r.stack=t.stack);return r}(e,[]):"function"==typeof e?"[Function: "+(e.name||"anonymous")+"]":e}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(e){return null===e?"null":void 0===e?"undefined":"object"===(void 0===e?"undefined":r(e))?Array.isArray(e)?"array":"object":void 0===e?"undefined":r(e)}function i(e){return"object"===o(e)?u(e):"array"===o(e)?a(e):e}function a(e){return e.map(i)}function u(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=i(e[n]));return t}function s(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={arrayBehaviour:(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).arrayBehaviour||"replace"},r=t.map(function(e){return e||{}}),i=e||{},l=0;l<r.length;l++)for(var c=r[l],f=Object.keys(c),p=0;p<f.length;p++){var d=f[p],h=c[d],v=o(h),m=o(i[d]);if("object"===v)if("undefined"!==m){var g="object"===m?i[d]:{};i[d]=s({},[g,u(h)],n)}else i[d]=u(h);else if("array"===v)if("array"===m){var y=a(h);i[d]="merge"===n.arrayBehaviour?i[d].concat(y):y}else i[d]=a(h);else i[d]=h}return i}e.exports=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return s(e,n)},e.exports.noMutate=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return s({},t)},e.exports.withOptions=function(e,t,n){return s(e,t,n)}},function(e,t,n){var r=n(590),o=n(606),i=n(608),a=n(609),u=n(610);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=u,e.exports=s},function(e,t,n){var r=n(63)(n(37),"Map");e.exports=r},function(e,t,n){var r=n(130),o=n(614),i=n(615),a=n(616),u=n(617),s=n(618);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=i,l.prototype.get=a,l.prototype.has=u,l.prototype.set=s,e.exports=l},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(628),o=n(295),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,u=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return i.call(e,t)}))}:o;e.exports=u},function(e,t,n){var r=n(630),o=n(47),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!u.call(e,"callee")};e.exports=s},function(e,t,n){(function(e){var r=n(37),o=n(631),i="object"==typeof t&&t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,u=a&&a.exports===i?r.Buffer:void 0,s=(u?u.isBuffer:void 0)||o;e.exports=s}).call(t,n(134)(e))},function(e,t){var n=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(279),o="object"==typeof t&&t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,u=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=u}).call(t,n(134)(e))},function(e,t,n){var r=n(24),o=n(128),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!i.test(e)||null!=t&&e in Object(t)}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.memoizedSampleFromSchema=t.memoizedCreateXMLExample=t.sampleXmlFromSchema=t.inferSchema=t.sampleFromSchema=void 0,t.createXMLExample=p;var r=n(9),o=u(n(657)),i=u(n(670)),a=u(n(181));function u(e){return e&&e.__esModule?e:{default:e}}var s={string:function(){return"string"},string_email:function(){return"[email protected]"},"string_date-time":function(){return(new Date).toISOString()},string_date:function(){return(new Date).toISOString().substring(0,10)},string_uuid:function(){return"3fa85f64-5717-4562-b3fc-2c963f66afa6"},string_hostname:function(){return"example.com"},string_ipv4:function(){return"198.51.100.42"},string_ipv6:function(){return"2001:0db8:5b96:0000:0000:426f:8e17:642a"},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(e){return"boolean"!=typeof e.default||e.default}},l=function(e){var t=e=(0,r.objectify)(e),n=t.type,o=t.format,i=s[n+"_"+o]||s[n];return(0,r.isFunc)(i)?i(e):"Unknown Type: "+e.type},c=t.sampleFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=(0,r.objectify)(t),i=o.type,a=o.example,u=o.properties,s=o.additionalProperties,c=o.items,f=n.includeReadOnly,p=n.includeWriteOnly;if(void 0!==a)return(0,r.deeplyStripKey)(a,"$$ref",function(e){return"string"==typeof e&&e.indexOf("#")>-1});if(!i)if(u)i="object";else{if(!c)return;i="array"}if("object"===i){var d=(0,r.objectify)(u),h={};for(var v in d)d[v]&&d[v].deprecated||d[v]&&d[v].readOnly&&!f||d[v]&&d[v].writeOnly&&!p||(h[v]=e(d[v],n));if(!0===s)h.additionalProp1={};else if(s)for(var m=(0,r.objectify)(s),g=e(m,n),y=1;y<4;y++)h["additionalProp"+y]=g;return h}return"array"===i?Array.isArray(c.anyOf)?c.anyOf.map(function(t){return e(t,n)}):Array.isArray(c.oneOf)?c.oneOf.map(function(t){return e(t,n)}):[e(c,n)]:t.enum?t.default?t.default:(0,r.normalizeArray)(t.enum)[0]:"file"!==i?l(t):void 0},f=(t.inferSchema=function(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},t.sampleXmlFromSchema=function e(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,a.default)({},(0,r.objectify)(t)),u=i.type,s=i.properties,c=i.additionalProperties,f=i.items,p=i.example,d=o.includeReadOnly,h=o.includeWriteOnly,v=i.default,m={},g={},y=t.xml,b=y.name,_=y.prefix,w=y.namespace,E=i.enum,x=void 0;if(!u)if(s||c)u="object";else{if(!f)return;u="array"}(b=b||"notagname",n=(_?_+":":"")+b,w)&&(g[_?"xmlns:"+_:"xmlns"]=w);if("array"===u&&f){if(f.xml=f.xml||y||{},f.xml.name=f.xml.name||y.name,y.wrapped)return m[n]=[],Array.isArray(p)?p.forEach(function(t){f.example=t,m[n].push(e(f,o))}):Array.isArray(v)?v.forEach(function(t){f.default=t,m[n].push(e(f,o))}):m[n]=[e(f,o)],g&&m[n].push({_attr:g}),m;var S=[];return Array.isArray(p)?(p.forEach(function(t){f.example=t,S.push(e(f,o))}),S):Array.isArray(v)?(v.forEach(function(t){f.default=t,S.push(e(f,o))}),S):e(f,o)}if("object"===u){var C=(0,r.objectify)(s);for(var k in m[n]=[],p=p||{},C)if(C.hasOwnProperty(k)&&(!C[k].readOnly||d)&&(!C[k].writeOnly||h))if(C[k].xml=C[k].xml||{},C[k].xml.attribute){var A=Array.isArray(C[k].enum)&&C[k].enum[0],O=C[k].example,P=C[k].default;g[C[k].xml.name||k]=void 0!==O&&O||void 0!==p[k]&&p[k]||void 0!==P&&P||A||l(C[k])}else{C[k].xml.name=C[k].xml.name||k,void 0===C[k].example&&void 0!==p[k]&&(C[k].example=p[k]);var T=e(C[k]);Array.isArray(T)?m[n]=m[n].concat(T):m[n].push(T)}return!0===c?m[n].push({additionalProp:"Anything can be here"}):c&&m[n].push({additionalProp:l(c)}),g&&m[n].push({_attr:g}),m}return x=void 0!==p?p:void 0!==v?v:Array.isArray(E)?E[0]:l(t),m[n]=g?[{_attr:g},x]:x,m});function p(e,t){var n=f(e,t);if(n)return(0,o.default)(n,{declaration:!0,indent:"\t"})}t.memoizedCreateXMLExample=(0,i.default)(p),t.memoizedSampleFromSchema=(0,i.default)(c)},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function o(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,a,u,s,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(i(n=this._events[e]))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:u=Array.prototype.slice.call(arguments,1),n.apply(this,u)}else if(o(n))for(u=Array.prototype.slice.call(arguments,1),a=(l=n.slice()).length,s=0;s<a;s++)l[s].apply(this,u);return!0},n.prototype.addListener=function(e,t){var a;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(a=i(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&a>0&&this._events[e].length>a&&(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()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function o(){this.removeListener(e,o),n||(n=!0,t.apply(this,arguments))}return o.listener=t,this.on(e,o),this},n.prototype.removeListener=function(e,t){var n,i,a,u;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(n=this._events[e]).length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(u=a;u-- >0;)if(n[u]===t||n[u].listener&&n[u].listener===t){i=u;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;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(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){(t=e.exports=n(306)).Stream=t,t.Readable=t,t.Writable=n(197),t.Duplex=n(65),t.Transform=n(311),t.PassThrough=n(665)},function(e,t,n){"use strict";(function(t,r,o){var i=n(140);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var u,s=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;y.WritableState=g;var l=n(106);l.inherits=n(81);var c={deprecate:n(664)},f=n(307),p=n(141).Buffer,d=o.Uint8Array||function(){};var h,v=n(308);function m(){}function g(e,t){u=u||n(65),e=e||{};var r=t instanceof u;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,l=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}(e,n,r,t,o);else{var a=E(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?s(_,e,n,a,o):_(e,n,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(u=u||n(65),!(h.call(y,this)||this instanceof u))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function _(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var u=0,s=!0;n;)o[u]=n,n.isBuf||(s=!1),n=n.next,u+=1;o.allBuffers=s,b(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,f=n.callback;if(b(e,t,!1,t.objectMode?1:l.length,l,c,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)})}function S(e,t){var n=E(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(x,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}l.inherits(y,f),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):h=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,n){var r,o=this._writableState,a=!1,u=!o.objectMode&&(r=e,p.isBuffer(r)||r instanceof d);return u&&!p.isBuffer(e)&&(e=function(e){return p.from(e)}(e)),"function"==typeof t&&(n=t,t=null),u?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=m),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(u||function(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=p.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var u=t.objectMode?1:r.length;t.length+=u;var s=t.length<t.highWaterMark;s||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,u,r,o,i);return s}(this,o,u,e,t,n)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=v.destroy,y.prototype._undestroy=v.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(t,n(55),n(309).setImmediate,n(31))},function(e,t,n){"use strict";e.exports=function(e){return"function"==typeof e}},function(e,t,n){"use strict";e.exports=n(691)()?Array.from:n(692)},function(e,t,n){"use strict";var r=n(705),o=n(67),i=n(82),a=Array.prototype.indexOf,u=Object.prototype.hasOwnProperty,s=Math.abs,l=Math.floor;e.exports=function(e){var t,n,c,f;if(!r(e))return a.apply(this,arguments);for(n=o(i(this).length),c=arguments[1],t=c=isNaN(c)?0:c>=0?l(c):o(this.length)-l(s(c));t<n;++t)if(u.call(this,t)&&(f=this[t],r(f)))return t;return-1}},function(e,t,n){"use strict";(function(t,n){var r,o;r=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},o=function(e){var t,n,o=document.createTextNode(""),i=0;return new e(function(){var e;if(t)n&&(t=n.concat(t));else{if(!n)return;t=n}if(n=t,t=null,"function"==typeof n)return e=n,n=null,void e();for(o.data=i=++i%2;n;)e=n.shift(),n.length||(n=null),e()}).observe(o,{characterData:!0}),function(e){r(e),t?"function"==typeof t?t=[t,e]:t.push(e):(t=e,o.data=i=++i%2)}},e.exports=function(){if("object"==typeof t&&t&&"function"==typeof t.nextTick)return t.nextTick;if("object"==typeof document&&document){if("function"==typeof MutationObserver)return o(MutationObserver);if("function"==typeof WebKitMutationObserver)return o(WebKitMutationObserver)}return"function"==typeof n?function(e){n(r(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(r(e),0)}:null}()}).call(t,n(55),n(309).setImmediate)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHOW=t.UPDATE_MODE=t.UPDATE_FILTER=t.UPDATE_LAYOUT=void 0,t.updateLayout=function(e){return{type:o,payload:e}},t.updateFilter=function(e){return{type:i,payload:e}},t.show=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=(0,r.normalizeArray)(e),{type:u,payload:{thing:e,shown:t}}},t.changeMode=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=(0,r.normalizeArray)(e),{type:a,payload:{thing:e,mode:t}}};var r=n(9),o=t.UPDATE_LAYOUT="layout_update_layout",i=t.UPDATE_FILTER="layout_update_filter",a=t.UPDATE_MODE="layout_update_mode",u=t.SHOW="layout_show"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.executeRequest=t.logRequest=t.setMutatedRequest=t.setRequest=t.setResponse=t.updateEmptyParamInclusion=t.validateParams=t.invalidateResolvedSubtreeCache=t.updateResolvedSubtree=t.requestResolvedSubtree=t.resolveSpec=t.parseToJson=t.SET_SCHEME=t.UPDATE_RESOLVED_SUBTREE=t.UPDATE_RESOLVED=t.UPDATE_OPERATION_META_VALUE=t.CLEAR_VALIDATE_PARAMS=t.CLEAR_REQUEST=t.CLEAR_RESPONSE=t.LOG_REQUEST=t.SET_MUTATED_REQUEST=t.SET_REQUEST=t.SET_RESPONSE=t.VALIDATE_PARAMS=t.UPDATE_EMPTY_PARAM_INCLUSION=t.UPDATE_PARAM=t.UPDATE_JSON=t.UPDATE_URL=t.UPDATE_SPEC=void 0;var r=b(n(25)),o=b(n(84)),i=b(n(23)),a=b(n(42)),u=b(n(204)),s=b(n(339)),l=b(n(340)),c=b(n(45));t.updateSpec=function(e){var t=L(e).replace(/\t/g," ");if("string"==typeof e)return{type:_,payload:t}},t.updateResolved=function(e){return{type:N,payload:e}},t.updateUrl=function(e){return{type:w,payload:e}},t.updateJsonSpec=function(e){return{type:E,payload:e}},t.changeParam=function(e,t,n,r,o){return{type:x,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:o}}},t.changeParamByIdentity=function(e,t,n,r){return{type:x,payload:{path:e,param:t,value:n,isXml:r}}},t.clearValidateParams=function(e){return{type:I,payload:{pathMethod:e}}},t.changeConsumesValue=function(e,t){return{type:j,payload:{path:e,value:t,key:"consumes_value"}}},t.changeProducesValue=function(e,t){return{type:j,payload:{path:e,value:t,key:"produces_value"}}},t.clearResponse=function(e,t){return{type:T,payload:{path:e,method:t}}},t.clearRequest=function(e,t){return{type:M,payload:{path:e,method:t}}},t.setScheme=function(e,t,n){return{type:D,payload:{scheme:e,path:t,method:n}}};var f=b(n(208)),p=n(7),d=b(n(210)),h=b(n(180)),v=b(n(343)),m=b(n(764)),g=b(n(766)),y=n(9);function b(e){return e&&e.__esModule?e:{default:e}}var _=t.UPDATE_SPEC="spec_update_spec",w=t.UPDATE_URL="spec_update_url",E=t.UPDATE_JSON="spec_update_json",x=t.UPDATE_PARAM="spec_update_param",S=t.UPDATE_EMPTY_PARAM_INCLUSION="spec_update_empty_param_inclusion",C=t.VALIDATE_PARAMS="spec_validate_param",k=t.SET_RESPONSE="spec_set_response",A=t.SET_REQUEST="spec_set_request",O=t.SET_MUTATED_REQUEST="spec_set_mutated_request",P=t.LOG_REQUEST="spec_log_request",T=t.CLEAR_RESPONSE="spec_clear_response",M=t.CLEAR_REQUEST="spec_clear_request",I=t.CLEAR_VALIDATE_PARAMS="spec_clear_validate_param",j=t.UPDATE_OPERATION_META_VALUE="spec_update_operation_meta_value",N=t.UPDATE_RESOLVED="spec_update_resolved",R=t.UPDATE_RESOLVED_SUBTREE="spec_update_resolved_subtree",D=t.SET_SCHEME="set_scheme",L=function(e){return(0,v.default)(e)?e:""};t.parseToJson=function(e){return function(t){var n=t.specActions,r=t.specSelectors,o=t.errActions,i=r.specStr,a=null;try{e=e||i(),o.clear({source:"parser"}),a=f.default.safeLoad(e)}catch(e){return console.error(e),o.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return a&&"object"===(void 0===a?"undefined":(0,c.default)(a))?n.updateJsonSpec(a):{}}};var U=!1,q=(t.resolveSpec=function(e,t){return function(n){var r=n.specActions,o=n.specSelectors,i=n.errActions,a=n.fn,u=a.fetch,s=a.resolve,l=a.AST,c=void 0===l?{}:l,f=n.getConfigs;U||(console.warn("specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!"),U=!0);var p=f(),d=p.modelPropertyMacro,h=p.parameterMacro,v=p.requestInterceptor,m=p.responseInterceptor;void 0===e&&(e=o.specJson()),void 0===t&&(t=o.url());var g=c.getLineNumberForPath?c.getLineNumberForPath:function(){},y=o.specStr();return s({fetch:u,spec:e,baseDoc:t,modelPropertyMacro:d,parameterMacro:h,requestInterceptor:v,responseInterceptor:m}).then(function(e){var t=e.spec,n=e.errors;if(i.clear({type:"thrown"}),Array.isArray(n)&&n.length>0){var o=n.map(function(e){return console.error(e),e.line=e.fullPath?g(y,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",Object.defineProperty(e,"message",{enumerable:!0,value:e.message}),e});i.newThrownErrBatch(o)}return r.updateResolved(t)})}},[]),F=(0,m.default)((0,l.default)(s.default.mark(function e(){var t,n,r,o,i,a,c,f,d,h,v,m,y,b,_,w,E;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=q.system){e.next=4;break}return console.error("debResolveSubtrees: don't have a system to operate on, aborting."),e.abrupt("return");case 4:if(n=t.errActions,r=t.errSelectors,o=t.fn,i=o.resolveSubtree,a=o.AST,c=void 0===a?{}:a,f=t.specSelectors,d=t.specActions,i){e.next=8;break}return console.error("Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing."),e.abrupt("return");case 8:return h=c.getLineNumberForPath?c.getLineNumberForPath:function(){},v=f.specStr(),m=t.getConfigs(),y=m.modelPropertyMacro,b=m.parameterMacro,_=m.requestInterceptor,w=m.responseInterceptor,e.prev=11,e.next=14,q.reduce(function(){var e=(0,l.default)(s.default.mark(function e(t,o){var a,u,l,c,p,d,m;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return a=e.sent,u=a.resultMap,l=a.specWithCurrentSubtrees,e.next=7,i(l,o,{baseDoc:f.url(),modelPropertyMacro:y,parameterMacro:b,requestInterceptor:_,responseInterceptor:w});case 7:return c=e.sent,p=c.errors,d=c.spec,r.allErrors().size&&n.clear({type:"thrown"}),Array.isArray(p)&&p.length>0&&(m=p.map(function(e){return e.line=e.fullPath?h(v,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",Object.defineProperty(e,"message",{enumerable:!0,value:e.message}),e}),n.newThrownErrBatch(m)),(0,g.default)(u,o,d),(0,g.default)(l,o,d),e.abrupt("return",{resultMap:u,specWithCurrentSubtrees:l});case 15:case"end":return e.stop()}},e,void 0)}));return function(t,n){return e.apply(this,arguments)}}(),u.default.resolve({resultMap:(f.specResolvedSubtree([])||(0,p.Map)()).toJS(),specWithCurrentSubtrees:f.specJson().toJS()}));case 14:E=e.sent,delete q.system,q=[],e.next=22;break;case 19:e.prev=19,e.t0=e.catch(11),console.error(e.t0);case 22:d.updateResolvedSubtree([],E.resultMap);case 23:case"end":return e.stop()}},e,void 0,[[11,19]])})),35);t.requestResolvedSubtree=function(e){return function(t){q.push(e),q.system=t,F()}};t.updateResolvedSubtree=function(e,t){return{type:R,payload:{path:e,value:t}}},t.invalidateResolvedSubtreeCache=function(){return{type:R,payload:{path:[],value:(0,p.Map)()}}},t.validateParams=function(e,t){return{type:C,payload:{pathMethod:e,isOAS3:t}}},t.updateEmptyParamInclusion=function(e,t,n,r){return{type:S,payload:{pathMethod:e,paramName:t,paramIn:n,includeEmptyValue:r}}};t.setResponse=function(e,t,n){return{payload:{path:e,method:t,res:n},type:k}},t.setRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:A}},t.setMutatedRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:O}},t.logRequest=function(e){return{payload:e,type:P}},t.executeRequest=function(e){return function(t){var n=t.fn,r=t.specActions,o=t.specSelectors,u=t.getConfigs,s=t.oas3Selectors,l=e.pathName,c=e.method,f=e.operation,p=u(),v=p.requestInterceptor,m=p.responseInterceptor,g=f.toJS();if(g&&g.parameters&&g.parameters.length&&g.parameters.filter(function(e){return e&&!0===e.allowEmptyValue}).forEach(function(t){if(o.parameterInclusionSettingFor([l,c],t.name,t.in)){e.parameters=e.parameters||{};var n=e.parameters[t.name];(!n||n&&0===n.size)&&(e.parameters[t.name]="")}}),e.contextUrl=(0,d.default)(o.url()).toString(),g&&g.operationId?e.operationId=g.operationId:g&&l&&c&&(e.operationId=n.opId(g,l,c)),o.isOAS3()){var b=l+":"+c;e.server=s.selectedServer(b)||s.selectedServer();var _=s.serverVariables({server:e.server,namespace:b}).toJS(),w=s.serverVariables({server:e.server}).toJS();e.serverVariables=(0,a.default)(_).length?_:w,e.requestContentType=s.requestContentType(l,c),e.responseContentType=s.responseContentType(l,c)||"*/*";var E=s.requestBodyValue(l,c);(0,y.isJSONObject)(E)?e.requestBody=JSON.parse(E):E&&E.toJS?e.requestBody=E.toJS():e.requestBody=E}var x=(0,i.default)({},e);x=n.buildRequest(x),r.setRequest(e.pathName,e.method,x);e.requestInterceptor=function(t){var n=v.apply(this,[t]),o=(0,i.default)({},n);return r.setMutatedRequest(e.pathName,e.method,o),n},e.responseInterceptor=m;var S=Date.now();return n.execute(e).then(function(t){t.duration=Date.now()-S,r.setResponse(e.pathName,e.method,t)}).catch(function(t){return r.setResponse(e.pathName,e.method,{error:!0,err:(0,h.default)(t)})})}};t.execute=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,i=(0,o.default)(e,["path","method"]);return function(e){var o=e.fn.fetch,a=e.specSelectors,u=e.specActions,s=a.specJsonWithResolvedSubtrees().toJS(),l=a.operationScheme(t,n),c=a.contentTypeValues([t,n]).toJS(),f=c.requestContentType,p=c.responseContentType,d=/xml/i.test(f),h=a.parameterValues([t,n],d).toJS();return u.executeRequest((0,r.default)({},i,{fetch:o,spec:s,pathName:t,method:n,parameters:h,requestContentType:f,scheme:l,responseContentType:p}))}}},function(e,t,n){e.exports={default:n(733),__esModule:!0}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){"use strict";var r=n(94);e.exports.f=function(e){return new function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}(e)}},function(e,t,n){var r=n(50);e.exports=function(e,t,n){for(var o in t)n&&e[o]?e[o]=t[o]:r(e,o,t[o]);return e}},function(e,t,n){"use strict";var r=n(742);e.exports=r},function(e,t,n){"use strict";var r=n(86);e.exports=new r({explicit:[n(745),n(746),n(747)]})},function(e,t,n){"use strict";(function(t){var r=n(762),o=n(763),i=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],s={hash:1,query:1};function l(e){var n,r={},o=typeof(e=e||t.location||{});if("blob:"===e.protocol)r=new f(unescape(e.pathname),{});else if("string"===o)for(n in r=new f(e,{}),s)delete r[n];else if("object"===o){for(n in e)n in s||(r[n]=e[n]);void 0===r.slashes&&(r.slashes=a.test(e.href))}return r}function c(e){var t=i.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function f(e,t,n){if(!(this instanceof f))return new f(e,t,n);var i,a,s,p,d,h,v=u.slice(),m=typeof t,g=this,y=0;for("object"!==m&&"string"!==m&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),t=l(t),i=!(a=c(e||"")).protocol&&!a.slashes,g.slashes=a.slashes||i&&t.slashes,g.protocol=a.protocol||t.protocol||"",e=a.rest,a.slashes||(v[2]=[/(.*)/,"pathname"]);y<v.length;y++)s=(p=v[y])[0],h=p[1],s!=s?g[h]=e:"string"==typeof s?~(d=e.indexOf(s))&&("number"==typeof p[2]?(g[h]=e.slice(0,d),e=e.slice(d+p[2])):(g[h]=e.slice(d),e=e.slice(0,d))):(d=s.exec(e))&&(g[h]=d[1],e=e.slice(0,d.index)),g[h]=g[h]||i&&p[3]&&t[h]||"",p[4]&&(g[h]=g[h].toLowerCase());n&&(g.query=n(g.query)),i&&t.slashes&&"/"!==g.pathname.charAt(0)&&(""!==g.pathname||""!==t.pathname)&&(g.pathname=function(e,t){for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],i=!1,a=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),a++):a&&(0===r&&(i=!0),n.splice(r,1),a--);return i&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(g.pathname,t.pathname)),r(g.port,g.protocol)||(g.host=g.hostname,g.port=""),g.username=g.password="",g.auth&&(p=g.auth.split(":"),g.username=p[0]||"",g.password=p[1]||""),g.origin=g.protocol&&g.host&&"file:"!==g.protocol?g.protocol+"//"+g.host:"null",g.href=g.toString()}f.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),i[e]=t;break;case"port":i[e]=t,r(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,/:\d+$/.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var a="pathname"===e?"/":"#";i[e]=t.charAt(0)!==a?a+t:t}else i[e]=t;break;default:i[e]=t}for(var s=0;s<u.length;s++){var l=u[s];l[4]&&(i[l[1]]=i[l[1]].toLowerCase())}return i.origin=i.protocol&&i.host&&"file:"!==i.protocol?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var i=r+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},f.extractProtocol=c,f.location=l,f.qs=o,e.exports=f}).call(t,n(31))},function(e,t,n){"use strict";var r=n(11),o=(n(8),null),i={};function a(){if(o)for(var e in i){var t=i[e],n=o.indexOf(e);if(n>-1||r("96",e),!l.plugins[n]){t.extractEvents||r("97",e),l.plugins[n]=t;var a=t.eventTypes;for(var s in a)u(a[s],t,s)||r("98",s,e)}}}function u(e,t,n){l.eventNameDispatchConfigs.hasOwnProperty(n)&&r("99",n),l.eventNameDispatchConfigs[n]=e;var o=e.phasedRegistrationNames;if(o){for(var i in o){if(o.hasOwnProperty(i))s(o[i],t,n)}return!0}return!!e.registrationName&&(s(e.registrationName,t,n),!0)}function s(e,t,n){l.registrationNameModules[e]&&r("100",e),l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){o&&r("101"),o=Array.prototype.slice.call(e),a()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];i.hasOwnProperty(n)&&i[n]===o||(i[n]&&r("102",n),i[n]=o,t=!0)}t&&a()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var o=l.registrationNameModules[n[r]];if(o)return o}}return null},_resetEventPlugins:function(){for(var e in o=null,i)i.hasOwnProperty(e)&&delete i[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=l.registrationNameModules;for(var a in r)r.hasOwnProperty(a)&&delete r[a]}};e.exports=l},function(e,t,n){"use strict";var r,o,i=n(11),a=n(213);n(8),n(10);function u(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=s.getNodeFromInstance(r),t?a.invokeGuardedCallbackWithCatch(o,n,e):a.invokeGuardedCallback(o,n,e),e.currentTarget=null}var s={isEndish:function(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e},isMoveish:function(e){return"topMouseMove"===e||"topTouchMove"===e},isStartish:function(e){return"topMouseDown"===e||"topTouchStart"===e},executeDirectDispatch:function(e){var t=e._dispatchListeners,n=e._dispatchInstances;Array.isArray(t)&&i("103"),e.currentTarget=t?s.getNodeFromInstance(n):null;var r=t?t(e):null;return e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,r},executeDispatchesInOrder:function(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)u(e,t,n[o],r[o]);else n&&u(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null},executeDispatchesInOrderStopAtTrue:function(e){var t=function(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}(e);return e._dispatchInstances=null,e._dispatchListeners=null,t},hasDispatches:function(e){return!!e._dispatchListeners},getInstanceFromNode:function(e){return r.getInstanceFromNode(e)},getNodeFromInstance:function(e){return r.getNodeFromInstance(e)},isAncestor:function(e,t){return o.isAncestor(e,t)},getLowestCommonAncestor:function(e,t){return o.getLowestCommonAncestor(e,t)},getParentInstance:function(e){return o.getParentInstance(e)},traverseTwoPhase:function(e,t,n){return o.traverseTwoPhase(e,t,n)},traverseEnterLeave:function(e,t,n,r,i){return o.traverseEnterLeave(e,t,n,r,i)},injection:{injectComponentTree:function(e){r=e},injectTreeTraversal:function(e){o=e}}};e.exports=s},function(e,t,n){"use strict";var r=null;function o(e,t,n){try{t(n)}catch(e){null===r&&(r=e)}}var i={invokeGuardedCallback:o,invokeGuardedCallbackWithCatch:o,rethrowCaughtError:function(){if(r){var e=r;throw r=null,e}}};e.exports=i},function(e,t,n){"use strict";e.exports=function(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}},function(e,t,n){"use strict";var r,o=n(26);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""))
/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/,e.exports=function(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i="function"==typeof a[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},function(e,t,n){"use strict";var r={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o(e){var t=this.nativeEvent;if(t.getModifierState)return t.getModifierState(e);var n=r[e];return!!n&&!!t[n]}e.exports=function(e){return o}},function(e,t,n){"use strict";var r=n(89),o=n(790),i=(n(14),n(39),n(219)),a=n(150),u=n(360);function s(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}var l=i(function(e,t,n){e.insertBefore(t,n)});function c(e,t,n){r.insertTreeBefore(e,t,n)}function f(e,t,n){Array.isArray(t)?function(e,t,n,r){var o=t;for(;;){var i=o.nextSibling;if(l(e,o,r),o===n)break;o=i}}(e,t[0],t[1],n):l(e,t,n)}function p(e,t){if(Array.isArray(t)){var n=t[1];d(e,t=t[0],n),e.removeChild(n)}e.removeChild(t)}function d(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}var h=o.dangerouslyReplaceNodeWithMarkup;var v={dangerouslyReplaceNodeWithMarkup:h,replaceDelimitedText:function(e,t,n){var r=e.parentNode,o=e.nextSibling;o===t?n&&l(r,document.createTextNode(n),o):n?(u(o,n),d(r,o,t)):d(r,e,t)},processUpdates:function(e,t){for(var n=0;n<t.length;n++){var r=t[n];switch(r.type){case"INSERT_MARKUP":c(e,r.content,s(e,r.afterNode));break;case"MOVE_EXISTING":f(e,r.fromNode,s(e,r.afterNode));break;case"SET_MARKUP":a(e,r.content);break;case"TEXT_CONTENT":u(e,r.content);break;case"REMOVE_NODE":p(e,r.fromNode)}}}};e.exports=v},function(e,t,n){"use strict";e.exports={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}},function(e,t,n){"use strict";e.exports=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}},function(e,t,n){"use strict";var r=n(11),o=n(808),i=n(269)(n(75).isValidElement),a=(n(8),n(10),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0});function u(e){null!=e.checkedLink&&null!=e.valueLink&&r("87")}function s(e){u(e),(null!=e.value||null!=e.onChange)&&r("88")}function l(e){u(e),(null!=e.checked||null!=e.onChange)&&r("89")}var c={value:function(e,t,n){return!e[t]||a[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:i.func},f={};function p(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var d={checkPropTypes:function(e,t,n){for(var r in c){if(c.hasOwnProperty(r))var i=c[r](t,r,e,"prop",null,o);if(i instanceof Error&&!(i.message in f)){f[i.message]=!0;p(n)}}},getValue:function(e){return e.valueLink?(s(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(l(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(s(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(l(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};e.exports=d},function(e,t,n){"use strict";var r=n(11),o=(n(8),!1),i={replaceNodeWithMarkup:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){o&&r("104"),i.replaceNodeWithMarkup=e.replaceNodeWithMarkup,i.processChildrenUpdates=e.processChildrenUpdates,o=!0}}};e.exports=i},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}e.exports=function(e,t){if(o(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var a=0;a<n.length;a++)if(!r.call(t,n[a])||!o(e[n[a]],t[n[a]]))return!1;return!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n=null===e||!1===e,r=null===t||!1===t;if(n||r)return n===r;var o=typeof e,i=typeof t;return"string"===o||"number"===o?"string"===i||"number"===i:"object"===i&&e.type===t.type&&e.key===t.key}},function(e,t,n){"use strict";var r={escape:function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})},unescape:function(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}};e.exports=r},function(e,t,n){"use strict";var r=n(11),o=(n(46),n(112)),i=(n(39),n(43));n(8),n(10);function a(e){i.enqueueUpdate(e)}function u(e){var t=typeof e;if("object"!==t)return t;var n=e.constructor&&e.constructor.name||t,r=Object.keys(e);return r.length>0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}function s(e,t){var n=o.get(e);return n||null}var l={isMounted:function(e){var t=o.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){l.validateCallback(t,n);var r=s(e);if(!r)return null;r._pendingCallbacks?r._pendingCallbacks.push(t):r._pendingCallbacks=[t],a(r)},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],a(e)},enqueueForceUpdate:function(e){var t=s(e);t&&(t._pendingForceUpdate=!0,a(t))},enqueueReplaceState:function(e,t,n){var r=s(e);r&&(r._pendingStateQueue=[t],r._pendingReplaceState=!0,void 0!==n&&null!==n&&(l.validateCallback(n,"replaceState"),r._pendingCallbacks?r._pendingCallbacks.push(n):r._pendingCallbacks=[n]),a(r))},enqueueSetState:function(e,t){var n=s(e);n&&((n._pendingStateQueue||(n._pendingStateQueue=[])).push(t),a(n))},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,a(e)},validateCallback:function(e,t){e&&"function"!=typeof e&&r("122",t,u(e))}};e.exports=l},function(e,t,n){"use strict";n(13);var r=n(34),o=(n(10),r);e.exports=o},function(e,t,n){"use strict";e.exports=function(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,t>=32||13===t?t:0}},function(e,t,n){var r=n(62),o=n(229),i=n(47),a="[object Object]",u=Function.prototype,s=Object.prototype,l=u.toString,c=s.hasOwnProperty,f=l.call(Object);e.exports=function(e){if(!i(e)||r(e)!=a)return!1;var t=o(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==f}},function(e,t,n){var r=n(298)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(292);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t){var n=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},r=Object.prototype.hasOwnProperty;
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017 Joachim Wester
* MIT license
*/function o(e,t){return r.call(e,t)}function i(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);t=[];for(var r in e)o(e,r)&&t.push(r);return t}function a(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function u(e,t){var n;for(var r in e)if(o(e,r)){if(e[r]===t)return a(r)+"/";if("object"==typeof e[r]&&""!=(n=u(e[r],t)))return a(r)+"/"+n}return""}t.hasOwnProperty=o,t._objectKeys=i,t._deepClone=function(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}},t.isInteger=function(e){for(var t,n=0,r=e.length;n<r;){if(!((t=e.charCodeAt(n))>=48&&t<=57))return!1;n++}return!0},t.escapePathComponent=a,t.unescapePathComponent=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},t._getPathRecursive=u,t.getPath=function(e,t){if(e===t)return"/";var n=u(e,t);if(""===n)throw new Error("Object not found in root");return"/"+n},t.hasUndefined=function e(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var n=0,r=t.length;n<r;n++)if(e(t[n]))return!0}else if("object"==typeof t){var o=i(t),a=o.length;for(n=0;n<a;n++)if(e(t[o[n]]))return!0}return!1};var s=function(e){function t(t,n,r,o,i){e.call(this,t),this.message=t,this.name=n,this.index=r,this.operation=o,this.tree=i}return n(t,e),t}(Error);t.PatchError=s},function(e,t,n){var r=n(49),o=n(155),i=n(72),a=n(115),u=n(917);e.exports=function(e,t){var n=1==e,s=2==e,l=3==e,c=4==e,f=6==e,p=5==e||f,d=t||u;return function(t,u,h){for(var v,m,g=i(t),y=o(g),b=r(u,h,3),_=a(y.length),w=0,E=n?d(t,_):s?d(t,0):void 0;_>w;w++)if((p||w in y)&&(m=b(v=y[w],w,g),e))if(n)E[w]=m;else if(m)switch(e){case 3:return!0;case 5:return v;case 6:return w;case 2:E.push(v)}else if(c)return!1;return f?-1:l||c?c:E}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authorizeRequest=t.authorizeAccessCodeWithBasicAuthentication=t.authorizeAccessCodeWithFormParams=t.authorizeApplication=t.authorizePassword=t.preAuthorizeImplicit=t.CONFIGURE_AUTH=t.VALIDATE=t.AUTHORIZE_OAUTH2=t.PRE_AUTHORIZE_OAUTH2=t.LOGOUT=t.AUTHORIZE=t.SHOW_AUTH_POPUP=void 0;var r=l(n(45)),o=l(n(23)),i=l(n(41));t.showDefinitions=function(e){return{type:c,payload:e}},t.authorize=function(e){return{type:f,payload:e}},t.logout=function(e){return{type:p,payload:e}},t.authorizeOauth2=function(e){return{type:d,payload:e}},t.configureAuth=function(e){return{type:h,payload:e}};var a=l(n(210)),u=l(n(32)),s=n(9);function l(e){return e&&e.__esModule?e:{default:e}}var c=t.SHOW_AUTH_POPUP="show_popup",f=t.AUTHORIZE="authorize",p=t.LOGOUT="logout",d=(t.PRE_AUTHORIZE_OAUTH2="pre_authorize_oauth2",t.AUTHORIZE_OAUTH2="authorize_oauth2"),h=(t.VALIDATE="validate",t.CONFIGURE_AUTH="configure_auth");t.preAuthorizeImplicit=function(e){return function(t){var n=t.authActions,r=t.errActions,o=e.auth,a=e.token,s=e.isValid,l=o.schema,c=o.name,f=l.get("flow");delete u.default.swaggerUIRedirectOauth2,"accessCode"===f||s||r.newAuthErr({authId:c,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),a.error?r.newAuthErr({authId:c,source:"auth",level:"error",message:(0,i.default)(a)}):n.authorizeOauth2({auth:o,token:a})}};t.authorizePassword=function(e){return function(t){var n=t.authActions,r=e.schema,i=e.name,a=e.username,u=e.password,l=e.passwordType,c=e.clientId,f=e.clientSecret,p={grant_type:"password",scope:e.scopes.join(" "),username:a,password:u},d={};switch(l){case"request-body":!function(e,t,n){t&&(0,o.default)(e,{client_id:t});n&&(0,o.default)(e,{client_secret:n})}(p,c,f);break;case"basic":d.Authorization="Basic "+(0,s.btoa)(c+":"+f);break;default:console.warn("Warning: invalid passwordType "+l+" was passed, not including client id and secret")}return n.authorizeRequest({body:(0,s.buildFormData)(p),url:r.get("tokenUrl"),name:i,headers:d,query:{},auth:e})}};t.authorizeApplication=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.scopes,i=e.name,a=e.clientId,u=e.clientSecret,l={Authorization:"Basic "+(0,s.btoa)(a+":"+u)},c={grant_type:"client_credentials",scope:o.join(" ")};return n.authorizeRequest({body:(0,s.buildFormData)(c),name:i,url:r.get("tokenUrl"),auth:e,headers:l})}},t.authorizeAccessCodeWithFormParams=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,i=t.name,a=t.clientId,u=t.clientSecret,l={grant_type:"authorization_code",code:t.code,client_id:a,client_secret:u,redirect_uri:n};return r.authorizeRequest({body:(0,s.buildFormData)(l),name:i,url:o.get("tokenUrl"),auth:t})}},t.authorizeAccessCodeWithBasicAuthentication=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,i=t.name,a=t.clientId,u=t.clientSecret,l={Authorization:"Basic "+(0,s.btoa)(a+":"+u)},c={grant_type:"authorization_code",code:t.code,client_id:a,redirect_uri:n};return r.authorizeRequest({body:(0,s.buildFormData)(c),name:i,url:o.get("tokenUrl"),auth:t,headers:l})}},t.authorizeRequest=function(e){return function(t){var n=t.fn,u=t.getConfigs,s=t.authActions,l=t.errActions,c=t.oas3Selectors,f=t.specSelectors,p=t.authSelectors,d=e.body,h=e.query,v=void 0===h?{}:h,m=e.headers,g=void 0===m?{}:m,y=e.name,b=e.url,_=e.auth,w=(p.getConfigs()||{}).additionalQueryStringParams,E=void 0;E=f.isOAS3()?(0,a.default)(b,c.selectedServer(),!0):(0,a.default)(b,f.url(),!0),"object"===(void 0===w?"undefined":(0,r.default)(w))&&(E.query=(0,o.default)({},E.query,w));var x=E.toString(),S=(0,o.default)({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded"},g);n.fetch({url:x,method:"post",headers:S,query:v,body:d,requestInterceptor:u().requestInterceptor,responseInterceptor:u().responseInterceptor}).then(function(e){var t=JSON.parse(e.data),n=t&&(t.error||""),r=t&&(t.parseError||"");e.ok?n||r?l.newAuthErr({authId:y,level:"error",source:"auth",message:(0,i.default)(t)}):s.authorizeOauth2({auth:_,token:t}):l.newAuthErr({authId:y,level:"error",source:"auth",message:e.statusText})}).catch(function(e){var t=new Error(e).message;if(e.response&&e.response.data){var n=e.response.data;try{var r="string"==typeof n?JSON.parse(n):n;r.error&&(t+=", error: "+r.error),r.error_description&&(t+=", description: "+r.error_description)}catch(e){}}l.newAuthErr({authId:y,level:"error",source:"auth",message:t})})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseYamlConfig=void 0;var r,o=n(208),i=(r=o)&&r.__esModule?r:{default:r};t.parseYamlConfig=function(e,t){try{return i.default.safeLoad(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loaded=t.TOGGLE_CONFIGS=t.UPDATE_CONFIGS=void 0;var r,o=n(22),i=(r=o)&&r.__esModule?r:{default:r};t.update=function(e,t){return{type:a,payload:(0,i.default)({},e,t)}},t.toggle=function(e){return{type:u,payload:e}};var a=t.UPDATE_CONFIGS="configs_update",u=t.TOGGLE_CONFIGS="configs_toggle";t.loaded=function(){return function(){}}},function(e,t,n){"use strict";function r(e,t,n,r,o){this.src=e,this.env=r,this.options=n,this.parser=t,this.tokens=o,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}r.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},r.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},r.prototype.cacheSet=function(e,t){for(var n=this.cache.length;n<=e;n++)this.cache.push(0);this.cache[e]=t},r.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0},e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSelectedServer=function(e,t){return{type:r,payload:{selectedServerUrl:e,namespace:t}}},t.setRequestBodyValue=function(e){var t=e.value,n=e.pathMethod;return{type:o,payload:{value:t,pathMethod:n}}},t.setRequestContentType=function(e){var t=e.value,n=e.pathMethod;return{type:i,payload:{value:t,pathMethod:n}}},t.setResponseContentType=function(e){var t=e.value,n=e.path,r=e.method;return{type:a,payload:{value:t,path:n,method:r}}},t.setServerVariableValue=function(e){var t=e.server,n=e.namespace,r=e.key,o=e.val;return{type:u,payload:{server:t,namespace:n,key:r,val:o}}};var r=t.UPDATE_SELECTED_SERVER="oas3_set_servers",o=t.UPDATE_REQUEST_BODY_VALUE="oas3_set_request_body_value",i=t.UPDATE_REQUEST_CONTENT_TYPE="oas3_set_request_content_type",a=t.UPDATE_RESPONSE_CONTENT_TYPE="oas3_set_response_content_type",u=t.UPDATE_SERVER_VARIABLE_VALUE="oas3_set_server_variable_value"},function(e,t,n){"use strict";var r=n(114),o=n(20),i=n(159),a=n(50),u=n(70),s=n(452),l=n(97),c=n(242),f=n(19)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,m,g){s(n,t,h);var y,b,_,w=function(e){if(!p&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},E=t+" Iterator",x="values"==v,S=!1,C=e.prototype,k=C[f]||C["@@iterator"]||v&&C[v],A=k||w(v),O=v?x?w("entries"):A:void 0,P="Array"==t&&C.entries||k;if(P&&(_=c(P.call(new e)))!==Object.prototype&&_.next&&(l(_,E,!0),r||"function"==typeof _[f]||a(_,f,d)),x&&k&&"values"!==k.name&&(S=!0,A=function(){return k.call(this)}),r&&!g||!p&&!S&&C[f]||a(C,f,A),u[t]=A,u[E]=d,v)if(y={values:x?A:w("values"),keys:m?A:w("keys"),entries:O},g)for(b in y)b in C||i(C,b,y[b]);else o(o.P+o.F*(p||S),t,y);return y}},function(e,t,n){e.exports=!n(44)&&!n(51)(function(){return 7!=Object.defineProperty(n(157)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(52),o=n(71),i=n(454)(!1),a=n(162)("IE_PROTO");e.exports=function(e,t){var n,u=o(e),s=0,l=[];for(n in u)n!=a&&r(u,n)&&l.push(n);for(;t.length>s;)r(u,n=t[s++])&&(~i(l,n)||l.push(n));return l}},function(e,t,n){var r=n(21).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(52),o=n(72),i=n(162)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(33),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){"use strict";var r=n(246)(!0);n(247)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var r=n(119),o=n(53);e.exports=function(e){return function(t,n){var i,a,u=String(o(t)),s=r(n),l=u.length;return s<0||s>=l?e?"":void 0:(i=u.charCodeAt(s))<55296||i>56319||s+1===l||(a=u.charCodeAt(s+1))<56320||a>57343?e?u.charAt(s):i:e?u.slice(s,s+2):a-56320+(i-55296<<10)+65536}}},function(e,t,n){"use strict";var r=n(248),o=n(29),i=n(73),a=n(58),u=n(102),s=n(462),l=n(171),c=n(468),f=n(18)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,m,g){s(n,t,h);var y,b,_,w=function(e){if(!p&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},E=t+" Iterator",x="values"==v,S=!1,C=e.prototype,k=C[f]||C["@@iterator"]||v&&C[v],A=k||w(v),O=v?x?w("entries"):A:void 0,P="Array"==t&&C.entries||k;if(P&&(_=c(P.call(new e)))!==Object.prototype&&_.next&&(l(_,E,!0),r||"function"==typeof _[f]||a(_,f,d)),x&&k&&"values"!==k.name&&(S=!0,A=function(){return k.call(this)}),r&&!g||!p&&!S&&C[f]||a(C,f,A),u[t]=A,u[E]=d,v)if(y={values:x?A:w("values"),keys:m?A:w("keys"),entries:O},g)for(b in y)b in C||i(C,b,y[b]);else o(o.P+o.F*(p||S),t,y);return y}},function(e,t){e.exports=!1},function(e,t,n){var r=n(465),o=n(251);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(119),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(33).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(59),o=n(121),i=n(18)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[i])?t:o(n)}},function(e,t,n){var r,o,i,a=n(120),u=n(480),s=n(252),l=n(169),c=n(33),f=c.process,p=c.setImmediate,d=c.clearImmediate,h=c.MessageChannel,v=c.Dispatch,m=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};p&&d||(p=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++m]=function(){u("function"==typeof e?e:Function(e),t)},r(m),m},d=function(e){delete g[e]},"process"==n(99)(f)?r=function(e){f.nextTick(a(y,e,1))}:v&&v.now?r=function(e){v.now(a(y,e,1))}:h?(i=(o=new h).port2,o.port1.onmessage=b,r=a(i.postMessage,i,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",b,!1)):r="onreadystatechange"in l("script")?function(e){s.appendChild(l("script")).onreadystatechange=function(){s.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:p,clear:d}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(59),o=n(74),i=n(172);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var r=n(74),o=n(99),i=n(18)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(20),o=n(15),i=n(51);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",a)}},function(e,t,n){var r=n(93);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(240),o=n(164).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){var r=n(125),o=n(95),i=n(71),a=n(158),u=n(52),s=n(239),l=Object.getOwnPropertyDescriptor;t.f=n(44)?l:function(e,t){if(e=i(e),t=a(t,!0),s)try{return l(e,t)}catch(e){}if(u(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){e.exports={default:n(532),__esModule:!0}},function(e,t,n){"use strict";var r=n(96),o=n(177),i=n(125),a=n(72),u=n(155),s=Object.assign;e.exports=!s||n(51)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=s({},e)[n]||Object.keys(s({},t)).join("")!=r})?function(e,t){for(var n=a(e),s=arguments.length,l=1,c=o.f,f=i.f;s>l;)for(var p,d=u(arguments[l++]),h=c?r(d).concat(c(d)):r(d),v=h.length,m=0;v>m;)f.call(d,p=h[m++])&&(n[p]=d[p]);return n}:s},function(e,t,n){"use strict";var r=n(104),o=n(13),i=n(266),a=(n(267),n(126));n(8),n(536);function u(e,t,n){this.props=e,this.context=t,this.refs=a,this.updater=n||i}function s(e,t,n){this.props=e,this.context=t,this.refs=a,this.updater=n||i}function l(){}u.prototype.isReactComponent={},u.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&r("85"),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},u.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")},l.prototype=u.prototype,s.prototype=new l,s.prototype.constructor=s,o(s.prototype,u.prototype),s.prototype.isPureReactComponent=!0,e.exports={Component:u,PureComponent:s}},function(e,t,n){"use strict";n(10);var r={isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){},enqueueReplaceState:function(e,t){},enqueueSetState:function(e,t){}};e.exports=r},function(e,t,n){"use strict";var r=!1;e.exports=r},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r=n(544);e.exports=function(e){return r(e,!1)}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(272),o=n(561),i=n(562),a=n(563),u=n(276);n(275);n.d(t,"createStore",function(){return r.b}),n.d(t,"combineReducers",function(){return o.a}),n.d(t,"bindActionCreators",function(){return i.a}),n.d(t,"applyMiddleware",function(){return a.a}),n.d(t,"compose",function(){return u.a})},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),t.b=function e(t,n,a){var u;"function"==typeof n&&void 0===a&&(a=n,n=void 0);if(void 0!==a){if("function"!=typeof a)throw new Error("Expected the enhancer to be a function.");return a(e)(t,n)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var s=t;var l=n;var c=[];var f=c;var p=!1;function d(){f===c&&(f=c.slice())}function h(){return l}function v(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return d(),f.push(e),function(){if(t){t=!1,d();var n=f.indexOf(e);f.splice(n,1)}}}function m(e){if(!r.a(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(p)throw new Error("Reducers may not dispatch actions.");try{p=!0,l=s(l,e)}finally{p=!1}for(var t=c=f,n=0;n<t.length;n++){var o=t[n];o()}return e}m({type:i.INIT});return u={dispatch:m,subscribe:v,getState:h,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");s=e,m({type:i.INIT})}},u[o.a]=function(){var e,t=v;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(h())}n();var r=t(n);return{unsubscribe:r}}})[o.a]=function(){return this},e},u};var r=n(273),o=n(558),i={INIT:"@@redux/INIT"}},function(e,t,n){"use strict";var r=n(550),o=n(555),i=n(557),a="[object Object]",u=Function.prototype,s=Object.prototype,l=u.toString,c=s.hasOwnProperty,f=l.call(Object);t.a=function(e){if(!i.a(e)||r.a(e)!=a)return!1;var t=o.a(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==f}},function(e,t,n){"use strict";var r=n(551).a.Symbol;t.a=r},function(e,t,n){"use strict"},function(e,t,n){"use strict";t.a=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return function(e){return e};if(1===t.length)return t[0];return t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e&&"@@redux/INIT"===e.type?"initialState argument passed to createStore":"previous state received by the reducer"},e.exports=t.default},function(e,t,n){var r=n(77),o=n(280),i=n(24),a=n(128),u=1/0,s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-u?"-0":n}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(t,n(31))},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},function(e,t,n){var r=n(577)("toUpperCase");e.exports=r},function(e,t){e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}},function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},function(e,t){e.exports=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}},function(e,t,n){var r=n(182),o="Expected a function";function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},function(e,t,n){var r=n(62),o=n(38),i="[object AsyncFunction]",a="[object Function]",u="[object GeneratorFunction]",s="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=r(e);return t==a||t==u||t==i||t==s}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(611)(n(648));e.exports=r},function(e,t,n){var r=n(619),o=n(47);e.exports=function e(t,n,i,a,u){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,u))}},function(e,t,n){var r=n(620),o=n(291),i=n(623),a=1,u=2;e.exports=function(e,t,n,s,l,c){var f=n&a,p=e.length,d=t.length;if(p!=d&&!(f&&d>p))return!1;var h=c.get(e);if(h&&c.get(t))return h==t;var v=-1,m=!0,g=n&u?new r:void 0;for(c.set(e,t),c.set(t,e);++v<p;){var y=e[v],b=t[v];if(s)var _=f?s(b,y,v,t,e,c):s(y,b,v,e,t,c);if(void 0!==_){if(_)continue;m=!1;break}if(g){if(!o(t,function(e,t){if(!i(g,t)&&(y===e||l(y,e,n,s,c)))return g.push(t)})){m=!1;break}}else if(y!==b&&!l(y,b,n,s,c)){m=!1;break}}return c.delete(e),c.delete(t),m}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t,n){var r=n(37).Uint8Array;e.exports=r},function(e,t,n){var r=n(294),o=n(186),i=n(64);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(185),o=n(24);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(629),o=n(187),i=n(24),a=n(188),u=n(135),s=n(297),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),c=!n&&o(e),f=!n&&!c&&a(e),p=!n&&!c&&!f&&s(e),d=n||c||f||p,h=d?r(e.length,String):[],v=h.length;for(var m in e)!t&&!l.call(e,m)||d&&("length"==m||f&&("offset"==m||"parent"==m)||p&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||u(m,v))||h.push(m);return h}},function(e,t,n){var r=n(632),o=n(190),i=n(191),a=i&&i.isTypedArray,u=a?o(a):r;e.exports=u},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(38);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},function(e,t,n){var r=n(643),o=n(644);e.exports=function(e,t){return null!=e&&o(e,t,r)}},function(e,t,n){var r=n(650);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t,n){var r=n(38),o=n(128),i=NaN,a=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return i;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=s.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):u.test(e)?i:+e}},function(e,t,n){var r=n(653),o=n(656)(r);e.exports=o},function(e,t,n){var r=n(105),o=n(78),i=n(135),a=n(38);e.exports=function(e,t,n){if(!a(n))return!1;var u=typeof t;return!!("number"==u?o(n)&&i(t,n.length):"string"==u&&t in n)&&r(n[t],e)}},function(e,t,n){"use strict";(function(t,r){var o=n(140);e.exports=b;var i,a=n(262);b.ReadableState=y;n(195).EventEmitter;var u=function(e,t){return e.listeners(t).length},s=n(307),l=n(141).Buffer,c=t.Uint8Array||function(){};var f=n(106);f.inherits=n(81);var p=n(660),d=void 0;d=p&&p.debuglog?p.debuglog("stream"):function(){};var h,v=n(661),m=n(308);f.inherits(b,s);var g=["error","close","destroy","pause","resume"];function y(e,t){i=i||n(65),e=e||{};var r=t instanceof i;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,a=e.readableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(a||0===a)?a:u,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new v,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.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=n(310).StringDecoder),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function b(e){if(i=i||n(65),!(this instanceof b))return new b(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function _(e,t,n,r,o){var i,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,S(e)}(e,a)):(o||(i=function(e,t){var n;r=t,l.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),i?e.emit("error",i):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):k(e,a)):w(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function w(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&S(e)),k(e,t)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),b.prototype.destroy=m.destroy,b.prototype._undestroy=m.undestroy,b.prototype._destroy=function(e,t){this.push(null),t(e)},b.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=l.from(e,t),t=""),n=!0),_(this,e,t,!1,n)},b.prototype.unshift=function(e){return _(this,e,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(e){return h||(h=n(310).StringDecoder),this._readableState.decoder=new h(e),this._readableState.encoding=e,this};var E=8388608;function x(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(C,e):C(e))}function C(e){d("emit readable"),e.emit("readable"),T(e)}function k(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(A,e,t))}function A(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(d("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function O(e){d("readable nexttick read 0"),e.read(0)}function P(e,t){t.reading||(d("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),T(e),t.flowing&&!t.reading&&e.read(0)}function T(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function M(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,o=n.data;e-=o.length;for(;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=l.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(j,t,e))}function j(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function N(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}b.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):S(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&I(this),null;var r,o=t.needReadable;return d("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",o=!0),t.ended||t.reading?d("reading or ended",o=!1):o&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=x(n,t))),null===(r=e>0?M(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&I(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var s=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:b;function l(t,r){d("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,d("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",m),e.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",b),n.removeListener("data",v),p=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){d("onend"),e.end()}i.endEmitted?o.nextTick(s):n.once("end",s),e.on("unpipe",l);var f=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&u(e,"data")&&(t.flowing=!0,T(e))}}(n);e.on("drain",f);var p=!1;var h=!1;function v(t){d("ondata"),h=!1,!1!==e.write(t)||h||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==N(i.pipes,e))&&!p&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function m(t){d("onerror",t),b(),e.removeListener("error",m),0===u(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){d("onfinish"),e.removeListener("close",g),b()}function b(){d("unpipe"),n.unpipe(e)}return n.on("data",v),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",m),e.once("close",g),e.once("finish",y),e.emit("pipe",n),i.flowing||(d("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,n);return this}var a=N(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},b.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&S(this):o.nextTick(O,this))}return n},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(P,e,t))}(this,e)),this},b.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",function(){if(d("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(d("wrapped data"),n.decoder&&(o=n.decoder.write(o)),!n.objectMode||null!==o&&void 0!==o)&&((n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause())))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<g.length;i++)e.on(g[i],this.emit.bind(this,g[i]));return this._read=function(t){d("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=M}).call(t,n(31),n(55))},function(e,t,n){e.exports=n(195).EventEmitter},function(e,t,n){"use strict";var r=n(140);function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(663),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(t,n(31))},function(e,t,n){"use strict";var r=n(141).Buffer,o=r.isEncoding||function(e){switch((e=""+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}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=s,this.end=l,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var o=a(t[r]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--r<n||-2===o)return 0;if((o=a(t[r]))>=0)return o>0&&(e.lastNeed=o-2),o;if(--r<n||-2===o)return 0;if((o=a(t[r]))>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=i;var r=n(65),o=n(106);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e),this._transformState={afterTransform:function(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",a)}function a(){var e=this;"function"==typeof this._flush?this._flush(function(t,n){u(e,t,n)}):u(this,null,null)}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}o.inherits=n(81),o.inherits(i,r),i.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},i.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},i.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},i.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},i.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){"use strict";var r=n(66),o=Array.prototype.forEach,i=Object.create;e.exports=function(e){var t=i(null);return o.call(arguments,function(e){r(e)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(e),t)}),t}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var r=n(67);e.exports=function(e,t,n){var o;return isNaN(e)?(o=t)>=0?n&&o?o-1:o:1:!1!==e&&r(e)}},function(e,t,n){"use strict";e.exports=n(679)()?Object.assign:n(680)},function(e,t,n){"use strict";var r,o,i,a,u,s=n(67),l=function(e,t){return t};try{Object.defineProperty(l,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(e){}1===l.length?(r={configurable:!0,writable:!1,enumerable:!1},o=Object.defineProperty,e.exports=function(e,t){return t=s(t),e.length===t?e:(r.value=t,o(e,"length",r))}):(a=n(317),u=[],i=function(e){var t,n=0;if(u[e])return u[e];for(t=[];e--;)t.push("a"+(++n).toString(36));return new Function("fn","return function ("+t.join(", ")+") { return fn.apply(this, arguments); };")},e.exports=function(e,t){var n;if(t=s(t),e.length===t)return e;n=i(t)(e);try{a(n,e)}catch(e){}return n})},function(e,t,n){"use strict";var r=n(82),o=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols;e.exports=function(e,t){var n,s=Object(r(t));if(e=Object(r(e)),a(s).forEach(function(r){try{o(e,r,i(t,r))}catch(e){n=e}}),"function"==typeof u&&u(s).forEach(function(r){try{o(e,r,i(t,r))}catch(e){n=e}}),void 0!==n)throw n;return e}},function(e,t,n){"use strict";var r=n(56),o=n(142),i=Function.prototype.call;e.exports=function(e,t){var n={},a=arguments[2];return r(t),o(e,function(e,r,o,u){n[r]=i.call(t,a,e,r,o,u)}),n}},function(e,t){e.exports=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{statePlugins:{err:{reducers:(0,i.default)(e),actions:a,selectors:u}}}};var r,o=n(321),i=(r=o)&&r.__esModule?r:{default:r},a=s(n(127)),u=s(n(326));function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(22)),o=s(n(23));t.default=function(e){var t;return t={},(0,r.default)(t,i.NEW_THROWN_ERR,function(t,n){var r=n.payload,i=(0,o.default)(l,r,{type:"thrown"});return t.update("errors",function(e){return(e||(0,a.List)()).push((0,a.fromJS)(i))}).update("errors",function(t){return(0,u.default)(t,e.getSystem())})}),(0,r.default)(t,i.NEW_THROWN_ERR_BATCH,function(t,n){var r=n.payload;return r=r.map(function(e){return(0,a.fromJS)((0,o.default)(l,e,{type:"thrown"}))}),t.update("errors",function(e){return(e||(0,a.List)()).concat((0,a.fromJS)(r))}).update("errors",function(t){return(0,u.default)(t,e.getSystem())})}),(0,r.default)(t,i.NEW_SPEC_ERR,function(t,n){var r=n.payload,o=(0,a.fromJS)(r);return o=o.set("type","spec"),t.update("errors",function(e){return(e||(0,a.List)()).push((0,a.fromJS)(o)).sortBy(function(e){return e.get("line")})}).update("errors",function(t){return(0,u.default)(t,e.getSystem())})}),(0,r.default)(t,i.NEW_SPEC_ERR_BATCH,function(t,n){var r=n.payload;return r=r.map(function(e){return(0,a.fromJS)((0,o.default)(l,e,{type:"spec"}))}),t.update("errors",function(e){return(e||(0,a.List)()).concat((0,a.fromJS)(r))}).update("errors",function(t){return(0,u.default)(t,e.getSystem())})}),(0,r.default)(t,i.NEW_AUTH_ERR,function(t,n){var r=n.payload,i=(0,a.fromJS)((0,o.default)({},r));return i=i.set("type","auth"),t.update("errors",function(e){return(e||(0,a.List)()).push((0,a.fromJS)(i))}).update("errors",function(t){return(0,u.default)(t,e.getSystem())})}),(0,r.default)(t,i.CLEAR,function(e,t){var n=t.payload;if(!n||!e.get("errors"))return e;var r=e.get("errors").filter(function(e){return e.keySeq().every(function(t){var r=e.get(t),o=n[t];return!o||r!==o})});return e.merge({errors:r})}),(0,r.default)(t,i.CLEAR_BY,function(e,t){var n=t.payload;if(!n||"function"!=typeof n)return e;var r=e.get("errors").filter(function(e){return n(e)});return e.merge({errors:r})}),t};var i=n(127),a=n(7),u=s(n(322));function s(e){return e&&e.__esModule?e:{default:e}}var l={line:0,level:"error",message:"Unknown error"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n={jsSpec:t.specSelectors.specJson().toJS()};return(0,i.default)(u,function(e,t){try{var r=t.transform(e,n);return r.filter(function(e){return!!e})}catch(t){return console.error("Transformer error:",t),e}},e).filter(function(e){return!!e}).map(function(e){return!e.get("line")&&e.get("path"),e})};var r,o=n(727),i=(r=o)&&r.__esModule?r:{default:r};function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var u=[a(n(323)),a(n(324)),a(n(325))]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transform=function(e){return e.map(function(e){var t=e.get("message").indexOf("is not of a type(s)");if(t>-1){var n=e.get("message").slice(t+"is not of a type(s)".length).split(",");return e.set("message",e.get("message").slice(0,t)+function(e){return e.reduce(function(e,t,n,r){return n===r.length-1&&r.length>1?e+"or "+t:r[n+1]&&r.length>2?e+t+", ":r[n+1]?e+t+" ":e+t},"should be a")}(n))}return e})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transform=function(e,t){t.jsSpec;return e};var r,o=n(138);(r=o)&&r.__esModule,n(7)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transform=function(e){return e.map(function(e){return"schema"===e.get("type")?e.set("message",(t=e.get("message"),n="instance\\.",t.replace(new RegExp(n,"g"),""))):e;var t,n})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastError=t.allErrors=void 0;var r=n(7),o=n(57),i=t.allErrors=(0,o.createSelector)(function(e){return e},function(e){return e.get("errors",(0,r.List)())});t.lastError=(0,o.createSelector)(i,function(e){return e.last()})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{statePlugins:{layout:{reducers:i.default,actions:a,selectors:u}}}};var r,o=n(328),i=(r=o)&&r.__esModule?r:{default:r},a=s(n(202)),u=s(n(329));function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,i=n(22),a=(r=i)&&r.__esModule?r:{default:r},u=n(7),s=n(202);t.default=(o={},(0,a.default)(o,s.UPDATE_LAYOUT,function(e,t){return e.set("layout",t.payload)}),(0,a.default)(o,s.UPDATE_FILTER,function(e,t){return e.set("filter",t.payload)}),(0,a.default)(o,s.SHOW,function(e,t){var n=t.payload.shown,r=(0,u.fromJS)(t.payload.thing);return e.update("shown",(0,u.fromJS)({}),function(e){return e.set(r,n)})}),(0,a.default)(o,s.UPDATE_MODE,function(e,t){var n=t.payload.thing,r=t.payload.mode;return e.setIn(["modes"].concat(n),(r||"")+"")}),o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.showSummary=t.whatMode=t.isShown=t.currentFilter=t.current=void 0;var r,o=n(83),i=(r=o)&&r.__esModule?r:{default:r},a=n(57),u=n(9),s=n(7);t.current=function(e){return e.get("layout")},t.currentFilter=function(e){return e.get("filter")};var l=t.isShown=function(e,t,n){return t=(0,u.normalizeArray)(t),e.get("shown",(0,s.fromJS)({})).get((0,s.fromJS)(t),n)};t.whatMode=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t=(0,u.normalizeArray)(t),e.getIn(["modes"].concat((0,i.default)(t)),n)},t.showSummary=(0,a.createSelector)(function(e){return e},function(e){return!l(e,"editor")})},function(e,t,n){var r=n(36);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(70),o=n(19)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){var r=n(19)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{statePlugins:{spec:{wrapActions:s,reducers:i.default,actions:a,selectors:u}}}};var r,o=n(334),i=(r=o)&&r.__esModule?r:{default:r},a=l(n(203)),u=l(n(144)),s=l(n(347));function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=p(n(22)),i=p(n(23)),a=p(n(83)),u=n(7),s=n(9),l=p(n(32)),c=n(144),f=n(203);function p(e){return e&&e.__esModule?e:{default:e}}t.default=(r={},(0,o.default)(r,f.UPDATE_SPEC,function(e,t){return"string"==typeof t.payload?e.set("spec",t.payload):e}),(0,o.default)(r,f.UPDATE_URL,function(e,t){return e.set("url",t.payload+"")}),(0,o.default)(r,f.UPDATE_JSON,function(e,t){return e.set("json",(0,s.fromJSOrdered)(t.payload))}),(0,o.default)(r,f.UPDATE_RESOLVED,function(e,t){return e.setIn(["resolved"],(0,s.fromJSOrdered)(t.payload))}),(0,o.default)(r,f.UPDATE_RESOLVED_SUBTREE,function(e,t){var n=t.payload,r=n.value,o=n.path;return e.setIn(["resolvedSubtrees"].concat((0,a.default)(o)),(0,s.fromJSOrdered)(r))}),(0,o.default)(r,f.UPDATE_PARAM,function(e,t){var n=t.payload,r=n.path,o=n.paramName,i=n.paramIn,u=n.param,s=n.value,l=n.isXml,c=void 0;c=u&&u.hashCode&&!i&&!o?u.get("name")+"."+u.get("in")+".hash-"+u.hashCode():o+"."+i;var f=l?"value_xml":"value";return e.setIn(["meta","paths"].concat((0,a.default)(r),["parameters",c,f]),s)}),(0,o.default)(r,f.UPDATE_EMPTY_PARAM_INCLUSION,function(e,t){var n=t.payload,r=n.pathMethod,o=n.paramName,i=n.paramIn,u=n.includeEmptyValue;if(!o||!i)return console.warn("Warning: UPDATE_EMPTY_PARAM_INCLUSION could not generate a paramKey."),e;var s=o+"."+i;return e.setIn(["meta","paths"].concat((0,a.default)(r),["parameter_inclusions",s]),u)}),(0,o.default)(r,f.VALIDATE_PARAMS,function(e,t){var n=t.payload,r=n.pathMethod,o=n.isOAS3,i=e.getIn(["meta","paths"].concat((0,a.default)(r)),(0,u.fromJS)({})),l=/xml/i.test(i.get("consumes_value")),f=c.operationWithMeta.apply(void 0,[e].concat((0,a.default)(r)));return e.updateIn(["meta","paths"].concat((0,a.default)(r),["parameters"]),(0,u.fromJS)({}),function(e){return f.get("parameters",(0,u.List)()).reduce(function(e,t){var n=(0,s.validateParam)(t,l,o);return e.setIn([t.get("name")+"."+t.get("in"),"errors"],(0,u.fromJS)(n))},e)})}),(0,o.default)(r,f.CLEAR_VALIDATE_PARAMS,function(e,t){var n=t.payload.pathMethod;return e.updateIn(["meta","paths"].concat((0,a.default)(n),["parameters"]),(0,u.fromJS)([]),function(e){return e.map(function(e){return e.set("errors",(0,u.fromJS)([]))})})}),(0,o.default)(r,f.SET_RESPONSE,function(e,t){var n=t.payload,r=n.res,o=n.path,a=n.method,u=void 0;(u=r.error?(0,i.default)({error:!0,name:r.err.name,message:r.err.message,statusCode:r.err.statusCode},r.err.response):r).headers=u.headers||{};var c=e.setIn(["responses",o,a],(0,s.fromJSOrdered)(u));return l.default.Blob&&r.data instanceof l.default.Blob&&(c=c.setIn(["responses",o,a,"text"],r.data)),c}),(0,o.default)(r,f.SET_REQUEST,function(e,t){var n=t.payload,r=n.req,o=n.path,i=n.method;return e.setIn(["requests",o,i],(0,s.fromJSOrdered)(r))}),(0,o.default)(r,f.SET_MUTATED_REQUEST,function(e,t){var n=t.payload,r=n.req,o=n.path,i=n.method;return e.setIn(["mutatedRequests",o,i],(0,s.fromJSOrdered)(r))}),(0,o.default)(r,f.UPDATE_OPERATION_META_VALUE,function(e,t){var n=t.payload,r=n.path,o=n.value,i=n.key,s=["paths"].concat((0,a.default)(r)),l=["meta","paths"].concat((0,a.default)(r));return e.getIn(["json"].concat((0,a.default)(s)))||e.getIn(["resolved"].concat((0,a.default)(s)))||e.getIn(["resolvedSubtrees"].concat((0,a.default)(s)))?e.setIn([].concat((0,a.default)(l),[i]),(0,u.fromJS)(o)):e}),(0,o.default)(r,f.CLEAR_RESPONSE,function(e,t){var n=t.payload,r=n.path,o=n.method;return e.deleteIn(["responses",r,o])}),(0,o.default)(r,f.CLEAR_REQUEST,function(e,t){var n=t.payload,r=n.path,o=n.method;return e.deleteIn(["requests",r,o])}),(0,o.default)(r,f.SET_SCHEME,function(e,t){var n=t.payload,r=n.scheme,o=n.path,i=n.method;return o&&i?e.setIn(["scheme",o,i],r):o||i?void 0:e.setIn(["scheme","_defaultScheme"],r)}),r)},function(e,t,n){var r=n(36),o=n(94),i=n(19)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[i])?t:o(n)}},function(e,t,n){var r,o,i,a=n(49),u=n(735),s=n(241),l=n(157),c=n(21),f=c.process,p=c.setImmediate,d=c.clearImmediate,h=c.MessageChannel,v=c.Dispatch,m=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};p&&d||(p=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++m]=function(){u("function"==typeof e?e:Function(e),t)},r(m),m},d=function(e){delete g[e]},"process"==n(93)(f)?r=function(e){f.nextTick(a(y,e,1))}:v&&v.now?r=function(e){v.now(a(y,e,1))}:h?(i=(o=new h).port2,o.port1.onmessage=b,r=a(i.postMessage,i,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",b,!1)):r="onreadystatechange"in l("script")?function(e){s.appendChild(l("script")).onreadystatechange=function(){s.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:p,clear:d}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(36),o=n(28),i=n(206);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){e.exports=n(740)},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(204),i=(r=o)&&r.__esModule?r:{default:r};t.default=function(e){return function(){var t=e.apply(this,arguments);return new i.default(function(e,n){return function r(o,a){try{var u=t[o](a),s=u.value}catch(e){return void n(e)}if(!u.done)return i.default.resolve(s).then(function(e){r("next",e)},function(e){r("throw",e)});e(s)}("next")})}}},function(e,t,n){"use strict";var r=n(86);e.exports=new r({include:[n(342)]})},function(e,t,n){"use strict";var r=n(86);e.exports=new r({include:[n(209)],implicit:[n(748),n(749),n(750),n(751)]})},function(e,t,n){var r=n(62),o=n(24),i=n(47),a="[object String]";e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&r(e)==a}},function(e,t,n){var r=n(147),o=n(79),i=n(135),a=n(38),u=n(80);e.exports=function(e,t,n,s){if(!a(e))return e;for(var l=-1,c=(t=o(t,e)).length,f=c-1,p=e;null!=p&&++l<c;){var d=u(t[l]),h=n;if(l!=f){var v=p[d];void 0===(h=s?s(v,d,p):void 0)&&(h=a(v)?v:i(t[l+1])?[]:{})}r(p,d,h),p=p[d]}return e}},function(e,t,n){var r=n(346);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(63),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateParams=t.executeRequest=t.updateJsonSpec=t.updateSpec=void 0;var r=i(n(42)),o=i(n(138));function i(e){return e&&e.__esModule?e:{default:e}}t.updateSpec=function(e,t){var n=t.specActions;return function(){e.apply(void 0,arguments),n.parseToJson.apply(n,arguments)}},t.updateJsonSpec=function(e,t){var n=t.specActions;return function(){for(var t=arguments.length,i=Array(t),a=0;a<t;a++)i[a]=arguments[a];e.apply(void 0,i),n.invalidateResolvedSubtreeCache();var u=i[0],s=(0,o.default)(u,["paths"])||{};(0,r.default)(s).forEach(function(e){(0,o.default)(s,[e]).$ref&&n.requestResolvedSubtree(["paths",e])}),n.requestResolvedSubtree(["components","securitySchemes"])}},t.executeRequest=function(e,t){var n=t.specActions;return function(t){return n.logRequest(t),e(t)}},t.validateParams=function(e,t){var n=t.specSelectors;return function(t){return e(t,n.isOAS3())}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.getComponents,n=e.getStore,i=e.getSystem,a=r.getComponent,u=r.render,s=r.makeMappedContainer,l=(0,o.memoize)(a.bind(null,i,n,t));return{rootInjects:{getComponent:l,makeMappedContainer:(0,o.memoize)(s.bind(null,i,n,l,t)),render:u.bind(null,i,n,a,t)}}};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(349)),o=n(9)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getComponent=t.render=t.makeMappedContainer=void 0;var r=g(n(45)),o=g(n(42)),i=g(n(23)),a=g(n(25)),u=g(n(4)),s=g(n(2)),l=g(n(3)),c=g(n(5)),f=g(n(6)),p=n(0),d=g(p),h=g(n(775)),v=n(852),m=g(n(860));function g(e){return e&&e.__esModule?e:{default:e}}var y=function(e,t,n){var r=function(e,t){return function(n){function r(){return(0,s.default)(this,r),(0,c.default)(this,(r.__proto__||(0,u.default)(r)).apply(this,arguments))}return(0,f.default)(r,n),(0,l.default)(r,[{key:"render",value:function(){return d.default.createElement(t,(0,a.default)({},e(),this.props,this.context))}}]),r}(p.Component)}(e,t),o=(0,v.connect)(function(n,r){var o=(0,i.default)({},r,e());return(t.prototype.mapStateToProps||function(e){return{state:e}})(n,o)})(r);return n?function(e,t){return function(n){function r(){return(0,s.default)(this,r),(0,c.default)(this,(r.__proto__||(0,u.default)(r)).apply(this,arguments))}return(0,f.default)(r,n),(0,l.default)(r,[{key:"render",value:function(){return d.default.createElement(v.Provider,{store:e},d.default.createElement(t,(0,a.default)({},this.props,this.context)))}}]),r}(p.Component)}(n,o):o},b=function(e,t,n,r){for(var o in t){var i=t[o];"function"==typeof i&&i(n[o],r[o],e())}},_=(t.makeMappedContainer=function(e,t,n,r,i,a){return function(t){function r(t,n){(0,s.default)(this,r);var o=(0,c.default)(this,(r.__proto__||(0,u.default)(r)).call(this,t,n));return b(e,a,t,{}),o}return(0,f.default)(r,t),(0,l.default)(r,[{key:"componentWillReceiveProps",value:function(t){b(e,a,t,this.props)}},{key:"render",value:function(){var e=(0,m.default)(this.props,a?(0,o.default)(a):[]),t=n(i,"root");return d.default.createElement(t,e)}}]),r}(p.Component)},t.render=function(e,t,n,r,o){var i=n(e,t,r,"App","root");h.default.render(d.default.createElement(i,null),o)},function(e){var t=e.name;return d.default.createElement("div",{style:{padding:"1em",color:"#aaa"}},"😱 ",d.default.createElement("i",null,"Could not render ","t"===t?"this component":t,", see the console."))}),w=function(e){var t=function(e){return!(e.prototype&&e.prototype.isReactComponent)}(e)?function(e){return function(t){function n(){return(0,s.default)(this,n),(0,c.default)(this,(n.__proto__||(0,u.default)(n)).apply(this,arguments))}return(0,f.default)(n,t),(0,l.default)(n,[{key:"render",value:function(){return e(this.props)}}]),n}(p.Component)}(e):e,n=t.prototype.render;return t.prototype.render=function(){try{for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];return n.apply(this,r)}catch(e){return console.error(e),d.default.createElement(_,{error:e,name:t.name})}},t};t.getComponent=function(e,t,n,o,i){if("string"!=typeof o)throw new TypeError("Need a string, to fetch a component. Was given a "+(void 0===o?"undefined":(0,r.default)(o)));var a=n(o);return a?i?"root"===i?y(e,a,t()):y(e,w(a)):w(a):(e().log.warn("Could not find component",o),null)}},function(e,t,n){e.exports={default:n(773),__esModule:!0}},function(e,t,n){"use strict";e.exports={hasCachedChildNodes:1}},function(e,t,n){"use strict";var r=n(11);n(8);e.exports=function(e,t){return null==t&&r("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}},function(e,t,n){"use strict";e.exports=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}},function(e,t,n){"use strict";var r=n(26),o=null;e.exports=function(){return!o&&r.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}},function(e,t,n){"use strict";var r=n(11);var o=n(69),i=(n(8),function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._callbacks=null,this._contexts=null,this._arg=t}return e.prototype.enqueue=function(e,t){this._callbacks=this._callbacks||[],this._callbacks.push(e),this._contexts=this._contexts||[],this._contexts.push(t)},e.prototype.notifyAll=function(){var e=this._callbacks,t=this._contexts,n=this._arg;if(e&&t){e.length!==t.length&&r("24"),this._callbacks=null,this._contexts=null;for(var o=0;o<e.length;o++)e[o].call(t[o],n);e.length=0,t.length=0}},e.prototype.checkpoint=function(){return this._callbacks?this._callbacks.length:0},e.prototype.rollback=function(e){this._callbacks&&this._contexts&&(this._callbacks.length=e,this._contexts.length=e)},e.prototype.reset=function(){this._callbacks=null,this._contexts=null},e.prototype.destructor=function(){this.reset()},e}());e.exports=o.addPoolingTo(i)},function(e,t,n){"use strict";e.exports={logTopLevelRenders:!1}},function(e,t,n){"use strict";var r=n(14);function o(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===t||"radio"===t)}function i(e){return e._wrapperState.valueTracker}var a={_getTrackerFromNode:function(e){return i(r.getInstanceFromNode(e))},track:function(e){if(!i(e)){var t=r.getNodeFromInstance(e),n=o(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),u=""+t[n];t.hasOwnProperty(n)||"function"!=typeof a.get||"function"!=typeof a.set||(Object.defineProperty(t,n,{enumerable:a.enumerable,configurable:!0,get:function(){return a.get.call(this)},set:function(e){u=""+e,a.set.call(this,e)}}),function(e,t){e._wrapperState.valueTracker=t}(e,{getValue:function(){return u},setValue:function(e){u=""+e},stopTracking:function(){!function(e){e._wrapperState.valueTracker=null}(e),delete t[n]}}))}},updateValueIfChanged:function(e){if(!e)return!1;var t=i(e);if(!t)return a.track(e),!0;var n,u,s=t.getValue(),l=((n=r.getNodeFromInstance(e))&&(u=o(n)?""+n.checked:n.value),u);return l!==s&&(t.setValue(l),!0)},stopTracking:function(e){var t=i(e);t&&t.stopTracking()}};e.exports=a},function(e,t,n){"use strict";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=function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!r[e.type]:"textarea"===t}},function(e,t,n){"use strict";var r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};e.exports=r},function(e,t,n){"use strict";var r=n(26),o=n(151),i=n(150),a=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){3!==e.nodeType?i(e,o(t)):e.nodeValue=t})),e.exports=a},function(e,t,n){"use strict";e.exports=function(e){try{e.focus()}catch(e){}}},function(e,t,n){"use strict";var r={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};var o=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){o.forEach(function(t){r[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(t,e)]=r[e]})});var i={isUnitlessNumber:r,shorthandPropertyExpansions:{background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!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},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}}};e.exports=i},function(e,t,n){"use strict";var r=n(87),o=(n(14),n(39),n(804)),i=(n(10),new RegExp("^["+r.ATTRIBUTE_NAME_START_CHAR+"]["+r.ATTRIBUTE_NAME_CHAR+"]*$")),a={},u={};function s(e){return!!u.hasOwnProperty(e)||!a.hasOwnProperty(e)&&(i.test(e)?(u[e]=!0,!0):(a[e]=!0,!1))}function l(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&!1===t}var c={createMarkupForID:function(e){return r.ID_ATTRIBUTE_NAME+"="+o(e)},setAttributeForID:function(e,t){e.setAttribute(r.ID_ATTRIBUTE_NAME,t)},createMarkupForRoot:function(){return r.ROOT_ATTRIBUTE_NAME+'=""'},setAttributeForRoot:function(e){e.setAttribute(r.ROOT_ATTRIBUTE_NAME,"")},createMarkupForProperty:function(e,t){var n=r.properties.hasOwnProperty(e)?r.properties[e]:null;if(n){if(l(n,t))return"";var i=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&!0===t?i+'=""':i+"="+o(t)}return r.isCustomAttribute(e)?null==t?"":e+"="+o(t):null},createMarkupForCustomAttribute:function(e,t){return s(e)&&null!=t?e+"="+o(t):""},setValueForProperty:function(e,t,n){var o=r.properties.hasOwnProperty(t)?r.properties[t]:null;if(o){var i=o.mutationMethod;if(i)i(e,n);else{if(l(o,n))return void this.deleteValueForProperty(e,t);if(o.mustUseProperty)e[o.propertyName]=n;else{var a=o.attributeName,u=o.attributeNamespace;u?e.setAttributeNS(u,a,""+n):o.hasBooleanValue||o.hasOverloadedBooleanValue&&!0===n?e.setAttribute(a,""):e.setAttribute(a,""+n)}}}else if(r.isCustomAttribute(t))return void c.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){s(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForAttribute:function(e,t){e.removeAttribute(t)},deleteValueForProperty:function(e,t){var n=r.properties.hasOwnProperty(t)?r.properties[t]:null;if(n){var o=n.mutationMethod;if(o)o(e,void 0);else if(n.mustUseProperty){var i=n.propertyName;n.hasBooleanValue?e[i]=!1:e[i]=""}else e.removeAttribute(n.attributeName)}else r.isCustomAttribute(t)&&e.removeAttribute(t)}};e.exports=c},function(e,t,n){"use strict";var r=n(13),o=n(220),i=n(14),a=n(43),u=(n(10),!1);function s(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=o.getValue(e);null!=t&&l(this,Boolean(e.multiple),t)}}function l(e,t,n){var r,o,a=i.getNodeFromInstance(e).options;if(t){for(r={},o=0;o<n.length;o++)r[""+n[o]]=!0;for(o=0;o<a.length;o++){var u=r.hasOwnProperty(a[o].value);a[o].selected!==u&&(a[o].selected=u)}}else{for(r=""+n,o=0;o<a.length;o++)if(a[o].value===r)return void(a[o].selected=!0);a.length&&(a[0].selected=!0)}}var c={getHostProps:function(e,t){return r({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){var n=o.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=n?n:t.defaultValue,listeners:null,onChange:function(e){var t=this._currentElement.props,n=o.executeOnChange(t,e);this._rootNodeID&&(this._wrapperState.pendingUpdate=!0);return a.asap(s,this),n}.bind(e),wasMultiple:Boolean(t.multiple)},void 0===t.value||void 0===t.defaultValue||u||(u=!0)},getSelectValueContext:function(e){return e._wrapperState.initialValue},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var n=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var r=o.getValue(t);null!=r?(e._wrapperState.pendingUpdate=!1,l(e,Boolean(t.multiple),r)):n!==Boolean(t.multiple)&&(null!=t.defaultValue?l(e,Boolean(t.multiple),t.defaultValue):l(e,Boolean(t.multiple),t.multiple?[]:""))}};e.exports=c},function(e,t,n){"use strict";var r=n(11),o=n(13),i=n(813),a=n(367),u=n(368),s=(n(814),n(8),n(10),function(e){this.construct(e)});function l(e,t){var n;if(null===e||!1===e)n=a.create(l);else if("object"==typeof e){var o=e,i=o.type;if("function"!=typeof i&&"string"!=typeof i){var c="";0,c+=function(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}(o._owner),r("130",null==i?i:typeof i,c)}"string"==typeof o.type?n=u.createInternalComponent(o):!function(e){return"function"==typeof e&&void 0!==e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}(o.type)?n=new s(o):(n=new o.type(o)).getHostNode||(n.getHostNode=n.getNativeNode)}else"string"==typeof e||"number"==typeof e?n=u.createInstanceForText(e):r("131",typeof e);return n._mountIndex=0,n._mountImage=null,n}o(s.prototype,i,{_instantiateReactComponent:l}),e.exports=l},function(e,t,n){"use strict";var r=n(11),o=n(75),i=(n(8),{HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||!1===e?i.EMPTY:o.isValidElement(e)?"function"==typeof e.type?i.COMPOSITE:i.HOST:void r("26",e)}});e.exports=i},function(e,t,n){"use strict";var r,o={injectEmptyComponentFactory:function(e){r=e}},i={create:function(e){return r(e)}};i.injection=o,e.exports=i},function(e,t,n){"use strict";var r=n(11),o=(n(8),null),i=null;var a={createInternalComponent:function(e){return o||r("111",e.type),new o(e)},createInstanceForText:function(e){return new i(e)},isTextComponent:function(e){return e instanceof i},injection:{injectGenericComponentClass:function(e){o=e},injectTextComponentClass:function(e){i=e}}};e.exports=a},function(e,t,n){"use strict";var r=n(11),o=(n(46),n(815)),i=n(816),a=(n(8),n(224)),u=(n(10),"."),s=":";function l(e,t){return e&&"object"==typeof e&&null!=e.key?a.escape(e.key):t.toString(36)}e.exports=function(e,t,n){return null==e?0:function e(t,n,c,f){var p,d=typeof t;if("undefined"!==d&&"boolean"!==d||(t=null),null===t||"string"===d||"number"===d||"object"===d&&t.$$typeof===o)return c(f,t,""===n?u+l(t,0):n),1;var h=0,v=""===n?u:n+s;if(Array.isArray(t))for(var m=0;m<t.length;m++)h+=e(p=t[m],v+l(p,m),c,f);else{var g=i(t);if(g){var y,b=g.call(t);if(g!==t.entries)for(var _=0;!(y=b.next()).done;)h+=e(p=y.value,v+l(p,_++),c,f);else for(;!(y=b.next()).done;){var w=y.value;w&&(h+=e(p=w[1],v+a.escape(w[0])+s+l(p,0),c,f))}}else if("object"===d){var E="",x=String(t);r("31","[object Object]"===x?"object with keys {"+Object.keys(t).join(", ")+"}":x,E)}}return h}(e,"",t,n)}},function(e,t,n){"use strict";var r,o,i,a,u,s,l,c=n(104),f=n(46);n(8),n(10);function p(e){var t=Function.prototype.toString,n=Object.prototype.hasOwnProperty,r=RegExp("^"+t.call(n).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");try{var o=t.call(e);return r.test(o)}catch(e){return!1}}if("function"==typeof Array.from&&"function"==typeof Map&&p(Map)&&null!=Map.prototype&&"function"==typeof Map.prototype.keys&&p(Map.prototype.keys)&&"function"==typeof Set&&p(Set)&&null!=Set.prototype&&"function"==typeof Set.prototype.keys&&p(Set.prototype.keys)){var d=new Map,h=new Set;r=function(e,t){d.set(e,t)},o=function(e){return d.get(e)},i=function(e){d.delete(e)},a=function(){return Array.from(d.keys())},u=function(e){h.add(e)},s=function(e){h.delete(e)},l=function(){return Array.from(h.keys())}}else{var v={},m={},g=function(e){return"."+e},y=function(e){return parseInt(e.substr(1),10)};r=function(e,t){var n=g(e);v[n]=t},o=function(e){var t=g(e);return v[t]},i=function(e){var t=g(e);delete v[t]},a=function(){return Object.keys(v).map(y)},u=function(e){var t=g(e);m[t]=!0},s=function(e){var t=g(e);delete m[t]},l=function(){return Object.keys(m).map(y)}}var b=[];function _(e){var t=o(e);if(t){var n=t.childIDs;i(e),n.forEach(_)}}function w(e,t,n){return"\n in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":n?" (created by "+n+")":"")}function E(e){return null==e?"#empty":"string"==typeof e||"number"==typeof e?"#text":"string"==typeof e.type?e.type:e.type.displayName||e.type.name||"Unknown"}function x(e){var t,n=S.getDisplayName(e),r=S.getElement(e),o=S.getOwnerID(e);return o&&(t=S.getDisplayName(o)),w(n,r&&r._source,t)}var S={onSetChildren:function(e,t){var n=o(e);n||c("144"),n.childIDs=t;for(var r=0;r<t.length;r++){var i=t[r],a=o(i);a||c("140"),null==a.childIDs&&"object"==typeof a.element&&null!=a.element&&c("141"),a.isMounted||c("71"),null==a.parentID&&(a.parentID=e),a.parentID!==e&&c("142",i,a.parentID,e)}},onBeforeMountComponent:function(e,t,n){r(e,{element:t,parentID:n,text:null,childIDs:[],isMounted:!1,updateCount:0})},onBeforeUpdateComponent:function(e,t){var n=o(e);n&&n.isMounted&&(n.element=t)},onMountComponent:function(e){var t=o(e);t||c("144"),t.isMounted=!0,0===t.parentID&&u(e)},onUpdateComponent:function(e){var t=o(e);t&&t.isMounted&&t.updateCount++},onUnmountComponent:function(e){var t=o(e);t&&(t.isMounted=!1,0===t.parentID&&s(e));b.push(e)},purgeUnmountedComponents:function(){if(!S._preventPurging){for(var e=0;e<b.length;e++){_(b[e])}b.length=0}},isMounted:function(e){var t=o(e);return!!t&&t.isMounted},getCurrentStackAddendum:function(e){var t="";if(e){var n=E(e),r=e._owner;t+=w(n,e._source,r&&r.getName())}var o=f.current,i=o&&o._debugID;return t+=S.getStackAddendumByID(i)},getStackAddendumByID:function(e){for(var t="";e;)t+=x(e),e=S.getParentID(e);return t},getChildIDs:function(e){var t=o(e);return t?t.childIDs:[]},getDisplayName:function(e){var t=S.getElement(e);return t?E(t):null},getElement:function(e){var t=o(e);return t?t.element:null},getOwnerID:function(e){var t=S.getElement(e);return t&&t._owner?t._owner._debugID:null},getParentID:function(e){var t=o(e);return t?t.parentID:null},getSource:function(e){var t=o(e),n=t?t.element:null;return null!=n?n._source:null},getText:function(e){var t=S.getElement(e);return"string"==typeof t?t:"number"==typeof t?""+t:null},getUpdateCount:function(e){var t=o(e);return t?t.updateCount:0},getRootIDs:l,getRegisteredIDs:a,pushNonStandardWarningStack:function(e,t){if("function"==typeof console.reactStack){var n=[],r=f.current,o=r&&r._debugID;try{for(e&&n.push({name:o?S.getDisplayName(o):null,fileName:t?t.fileName:null,lineNumber:t?t.lineNumber:null});o;){var i=S.getElement(o),a=S.getParentID(o),u=S.getOwnerID(o),s=u?S.getDisplayName(u):null,l=i&&i._source;n.push({name:s,fileName:l?l.fileName:null,lineNumber:l?l.lineNumber:null}),o=a}}catch(e){}console.reactStack(n)}},popNonStandardWarningStack:function(){"function"==typeof console.reactStackEnd&&console.reactStackEnd()}};e.exports=S},function(e,t,n){"use strict";var r=n(34),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=o},function(e,t,n){"use strict";var r=n(828),o=n(830),i=n(361),a=n(373);var u={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=a();return{focusedElem:e,selectionRange:u.hasSelectionCapabilities(e)?u.getSelection(e):null}},restoreSelection:function(e){var t,n=a(),r=e.focusedElem,s=e.selectionRange;n!==r&&(t=r,o(document.documentElement,t))&&(u.hasSelectionCapabilities(r)&&u.setSelection(r,s),i(r))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,o=t.end;if(void 0===o&&(o=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(o,e.value.length);else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",o-n),i.select()}else r.setOffsets(e,t)}};e.exports=u},function(e,t,n){"use strict";e.exports=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}},function(e,t,n){"use strict";var r=n(11),o=n(89),i=n(87),a=n(75),u=n(152),s=(n(46),n(14)),l=n(845),c=n(846),f=n(356),p=n(112),d=(n(39),n(847)),h=n(88),v=n(225),m=n(43),g=n(126),y=n(365),b=(n(8),n(150)),_=n(223),w=(n(10),i.ID_ATTRIBUTE_NAME),E=i.ROOT_ATTRIBUTE_NAME,x=1,S=9,C=11,k={};function A(e){return e?e.nodeType===S?e.documentElement:e.firstChild:null}function O(e){return e.getAttribute&&e.getAttribute(w)||""}function P(e,t,n,r,o){var i;if(f.logTopLevelRenders){var a=e._currentElement.props.child.type;i="React mount: "+("string"==typeof a?a:a.displayName||a.name),console.time(i)}var u=h.mountComponent(e,n,null,l(e,t),o,0);i&&console.timeEnd(i),e._renderedComponent._topLevelWrapper=e,L._mountImageIntoNode(u,t,e,r,n)}function T(e,t,n,r){var o=m.ReactReconcileTransaction.getPooled(!n&&c.useCreateElement);o.perform(P,null,e,t,o,n,r),m.ReactReconcileTransaction.release(o)}function M(e,t,n){for(0,h.unmountComponent(e,n),t.nodeType===S&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function I(e){var t=A(e);if(t){var n=s.getInstanceFromNode(t);return!(!n||!n._hostParent)}}function j(e){return!(!e||e.nodeType!==x&&e.nodeType!==S&&e.nodeType!==C)}function N(e){var t=function(e){var t=A(e),n=t&&s.getInstanceFromNode(t);return n&&!n._hostParent?n:null}(e);return t?t._hostContainerInfo._topLevelWrapper:null}var R=1,D=function(){this.rootID=R++};D.prototype.isReactComponent={},D.prototype.render=function(){return this.props.child},D.isReactTopLevelWrapper=!0;var L={TopLevelWrapper:D,_instancesByReactRootID:k,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r,o){return L.scrollMonitor(r,function(){v.enqueueElementInternal(e,t,n),o&&v.enqueueCallbackInternal(e,o)}),e},_renderNewRootComponent:function(e,t,n,o){j(t)||r("37"),u.ensureScrollValueMonitoring();var i=y(e,!1);m.batchedUpdates(T,i,t,n,o);var a=i._instance.rootID;return k[a]=i,i},renderSubtreeIntoContainer:function(e,t,n,o){return null!=e&&p.has(e)||r("38"),L._renderSubtreeIntoContainer(e,t,n,o)},_renderSubtreeIntoContainer:function(e,t,n,o){v.validateCallback(o,"ReactDOM.render"),a.isValidElement(t)||r("39","string"==typeof t?" Instead of passing a string like 'div', pass React.createElement('div') or <div />.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or <Foo />.":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var i,u=a.createElement(D,{child:t});if(e){var s=p.get(e);i=s._processChildContext(s._context)}else i=g;var l=N(n);if(l){var c=l._currentElement.props.child;if(_(c,t)){var f=l._renderedComponent.getPublicInstance(),d=o&&function(){o.call(f)};return L._updateRootComponent(l,u,i,n,d),f}L.unmountComponentAtNode(n)}var h=A(n),m=h&&!!O(h),y=I(n),b=m&&!l&&!y,w=L._renderNewRootComponent(u,n,b,i)._renderedComponent.getPublicInstance();return o&&o.call(w),w},render:function(e,t,n){return L._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){j(e)||r("40");var t=N(e);if(!t){I(e),1===e.nodeType&&e.hasAttribute(E);return!1}return delete k[t._instance.rootID],m.batchedUpdates(M,t,e,!1),!0},_mountImageIntoNode:function(e,t,n,i,a){if(j(t)||r("41"),i){var u=A(t);if(d.canReuseMarkup(e,u))return void s.precacheNode(n,u);var l=u.getAttribute(d.CHECKSUM_ATTR_NAME);u.removeAttribute(d.CHECKSUM_ATTR_NAME);var c=u.outerHTML;u.setAttribute(d.CHECKSUM_ATTR_NAME,l);var f=e,p=function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}(f,c),h=" (client) "+f.substring(p-20,p+20)+"\n (server) "+c.substring(p-20,p+20);t.nodeType===S&&r("42",h)}if(t.nodeType===S&&r("43"),a.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);o.insertTreeBefore(t,e,null)}else b(t,e),s.precacheNode(n,t.firstChild)}};e.exports=L},function(e,t,n){"use strict";var r=n(366);e.exports=function(e){for(var t;(t=e._renderedNodeType)===r.COMPOSITE;)e=e._renderedComponent;return t===r.HOST?e._renderedComponent:t===r.EMPTY?null:void 0}},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(1),i=(r=o)&&r.__esModule?r:{default:r};t.default=i.default.shape({subscribe:i.default.func.isRequired,dispatch:i.default.func.isRequired,getState:i.default.func.isRequired})},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}},function(e,t,n){var r=n(184),o=n(861),i=n(147),a=n(862),u=n(863),s=n(866),l=n(867),c=n(868),f=n(869),p=n(293),d=n(381),h=n(137),v=n(870),m=n(871),g=n(876),y=n(24),b=n(188),_=n(878),w=n(38),E=n(880),x=n(64),S=1,C=2,k=4,A="[object Arguments]",O="[object Function]",P="[object GeneratorFunction]",T="[object Object]",M={};M[A]=M["[object Array]"]=M["[object ArrayBuffer]"]=M["[object DataView]"]=M["[object Boolean]"]=M["[object Date]"]=M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Map]"]=M["[object Number]"]=M[T]=M["[object RegExp]"]=M["[object Set]"]=M["[object String]"]=M["[object Symbol]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M["[object Error]"]=M[O]=M["[object WeakMap]"]=!1,e.exports=function e(t,n,I,j,N,R){var D,L=n&S,U=n&C,q=n&k;if(I&&(D=N?I(t,j,N,R):I(t)),void 0!==D)return D;if(!w(t))return t;var F=y(t);if(F){if(D=v(t),!L)return l(t,D)}else{var z=h(t),B=z==O||z==P;if(b(t))return s(t,L);if(z==T||z==A||B&&!N){if(D=U||B?{}:g(t),!L)return U?f(t,u(D,t)):c(t,a(D,t))}else{if(!M[z])return N?t:{};D=m(t,z,L)}}R||(R=new r);var V=R.get(t);if(V)return V;if(R.set(t,D),E(t))return t.forEach(function(r){D.add(e(r,n,I,r,t,R))}),D;if(_(t))return t.forEach(function(r,o){D.set(o,e(r,n,I,o,t,R))}),D;var H=q?U?d:p:U?keysIn:x,W=F?void 0:H(t);return o(W||t,function(r,o){W&&(r=t[o=r]),i(D,o,e(r,n,I,o,t,R))}),D}},function(e,t,n){var r=n(296),o=n(864),i=n(78);e.exports=function(e){return i(e)?r(e,!0):o(e)}},function(e,t,n){var r=n(185),o=n(229),i=n(186),a=n(295),u=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=u},function(e,t,n){var r=n(294),o=n(380),i=n(379);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(886),o=n(383),i=n(384);e.exports=function(e){return i(o(e,void 0,r),e+"")}},function(e,t,n){var r=n(889),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,u=o(i.length-t,0),s=Array(u);++a<u;)s[a]=i[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=i[a];return l[t]=n(s),r(e,this,l)}}},function(e,t,n){var r=n(890),o=n(892)(r);e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{fn:r}};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(194))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t={debug:0,info:1,log:2,warn:3,error:4},n=function(e){return t[e]||-1},r=e.configs.logLevel,o=n(r);function i(e){for(var t,r=arguments.length,i=Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];n(e)>=o&&(t=console)[e].apply(t,i)}return i.warn=i.bind(null,"warn"),i.error=i.bind(null,"error"),i.info=i.bind(null,"info"),i.debug=i.bind(null,"debug"),{rootInjects:{log:i}}}},function(e,t,n){"use strict";var r,o=n(388),i=(r=o)&&r.__esModule?r:{default:r};e.exports=function(e){var t=e.configs,n=e.getConfigs;return{fn:{fetch:i.default.makeHttp(t.preFetch,t.postFetch),buildRequest:i.default.buildRequest,execute:i.default.execute,resolve:i.default.resolve,resolveSubtree:function(e,t,r){for(var o=arguments.length,a=Array(o>3?o-3:0),u=3;u<o;u++)a[u-3]=arguments[u];if(void 0===r){var s=n();r={modelPropertyMacro:s.modelPropertyMacro,parameterMacro:s.parameterMacro,requestInterceptor:s.requestInterceptor,responseInterceptor:s.responseInterceptor}}return i.default.resolveSubtree.apply(i.default,[e,t,r].concat(a))},serializeRes:i.default.serializeRes,opId:i.default.helpers.opId}}}},function(e,t,n){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=23)}([function(e,t){e.exports=n(42)},function(e,t){e.exports=n(45)},function(e,t){e.exports=n(23)},function(e,t){e.exports=n(25)},function(e,t){e.exports=n(339)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).v2OperationIdCompatibilityMode;return e&&"object"===(void 0===e?"undefined":(0,c.default)(e))?(e.operationId||"").replace(/\s/g,"").length?h(e.operationId):i(t,n,{v2OperationIdCompatibilityMode:r}):null}function i(e,t){if((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).v2OperationIdCompatibilityMode){var n=(t.toLowerCase()+"_"+e).replace(/[\s!@#$%^&*()_+=[{\]};:<>|.\/?,\\'""-]/g,"_");return(n=n||e.substring(1)+"_"+t).replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return""+d(t)+h(e)}function a(e,t){return d(t)+"-"+e}function u(e,t){return s(e,t,!0)||null}function s(e,t,n){if(!e||"object"!==(void 0===e?"undefined":(0,c.default)(e))||!e.paths||"object"!==(0,c.default)(e.paths))return null;var r=e.paths;for(var o in r)for(var i in r[o])if("PARAMETERS"!==i.toUpperCase()){var a=r[o][i];if(a&&"object"===(void 0===a?"undefined":(0,c.default)(a))){var u={spec:e,pathName:o,method:i.toUpperCase(),operation:a},s=t(u);if(n&&s)return u}}}Object.defineProperty(t,"__esModule",{value:!0});var l=r(n(18)),c=r(n(1));t.isOAS3=function(e){var t=e.openapi;return!!t&&(0,p.default)(t,"3")},t.isSwagger2=function(e){var t=e.swagger;return!!t&&(0,p.default)(t,"2")},t.opId=o,t.idFromPathMethod=i,t.legacyIdFromPathMethod=a,t.getOperationRaw=function(e,t){return e&&e.paths?u(e,function(e){var n=e.pathName,r=e.method,i=e.operation;if(!i||"object"!==(void 0===i?"undefined":(0,c.default)(i)))return!1;var u=i.operationId;return[o(i,n,r),a(n,r),u].some(function(e){return e&&e===t})}):null},t.findOperation=u,t.eachOperation=s,t.normalizeSwagger=function(e){var t=e.spec,n=t.paths,r={};if(!n||t.$$normalized)return e;for(var i in n){var a=n[i];if((0,f.default)(a)){var u=a.parameters;for(var s in a)!function(e){var n=a[e];if(!(0,f.default)(n))return"continue";var s=o(n,i,e);if(s){r[s]?r[s].push(n):r[s]=[n];var c=r[s];if(c.length>1)c.forEach(function(e,t){e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId=""+s+(t+1)});else if(void 0!==n.operationId){var p=c[0];p.__originalOperationId=p.__originalOperationId||n.operationId,p.operationId=s}}if("parameters"!==e){var d=[],h={};for(var v in t)"produces"!==v&&"consumes"!==v&&"security"!==v||(h[v]=t[v],d.push(h));if(u&&(h.parameters=u,d.push(h)),d.length){var m=!0,g=!1,y=void 0;try{for(var b,_=(0,l.default)(d);!(m=(b=_.next()).done);m=!0){var w=b.value;for(var E in w)if(n[E]){if("parameters"===E){var x=!0,S=!1,C=void 0;try{for(var k,A=(0,l.default)(w[E]);!(x=(k=A.next()).done);x=!0)!function(){var e=k.value;n[E].some(function(t){return t.name&&t.name===e.name||t.$ref&&t.$ref===e.$ref||t.$$ref&&t.$$ref===e.$$ref||t===e})||n[E].push(e)}()}catch(e){S=!0,C=e}finally{try{!x&&A.return&&A.return()}finally{if(S)throw C}}}}else n[E]=w[E]}}catch(e){g=!0,y=e}finally{try{!m&&_.return&&_.return()}finally{if(g)throw y}}}}}(s)}}return t.$$normalized=!0,e};var f=r(n(47)),p=r(n(14)),d=function(e){return String.prototype.toLowerCase.call(e)},h=function(e){return e.replace(/[^\w]/gi,"_")}},function(e,t){e.exports=n(893)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).loadSpec,r=void 0!==n&&n,o={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:i(e.headers)},a=o.headers["content-type"],u=r||_(a);return(u?e.text:e.blob||e.buffer).call(e).then(function(e){if(o.text=e,o.data=e,u)try{var t=function(e,t){return"application/json"===t?JSON.parse(e):g.default.safeLoad(e)}(e,a);o.body=t,o.obj=t}catch(e){o.parseError=e}return o})}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return"function"==typeof e.forEach?(e.forEach(function(e,n){void 0!==t[n]?(t[n]=Array.isArray(t[n])?t[n]:[t[n]],t[n].push(e)):t[n]=e}),t):t}function a(e,t){return t||"undefined"==typeof navigator||(t=navigator),t&&"ReactNative"===t.product?!(!e||"object"!==(void 0===e?"undefined":(0,h.default)(e))||"string"!=typeof e.uri):"undefined"!=typeof File?e instanceof File:null!==e&&"object"===(void 0===e?"undefined":(0,h.default)(e))&&"function"==typeof e.pipe}function u(e,t){var n=e.collectionFormat,r=e.allowEmptyValue,o="object"===(void 0===e?"undefined":(0,h.default)(e))?e.value:e;if(void 0===o&&r)return"";if(a(o)||"boolean"==typeof o)return o;var i=encodeURIComponent;return t&&(i=(0,y.default)(o)?function(e){return e}:function(e){return(0,p.default)(e)}),"object"!==(void 0===o?"undefined":(0,h.default)(o))||Array.isArray(o)?Array.isArray(o)?Array.isArray(o)&&!n?o.map(i).join(","):"multi"===n?o.map(i):o.map(i).join({csv:",",ssv:"%20",tsv:"%09",pipes:"|"}[n]):i(o):""}function s(e){var t=(0,f.default)(e).reduce(function(t,n){var r=e[n],o=!!r.skipEncoding,i=o?n:encodeURIComponent(n),a=function(e){return e&&"object"===(void 0===e?"undefined":(0,h.default)(e))}(r)&&!Array.isArray(r);return t[i]=u(a?r:{value:r},o),t},{});return m.default.stringify(t,{encode:!1,indices:!1})||""}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.url,r=void 0===t?"":t,o=e.query,i=e.form;if(i){var l=(0,f.default)(i).some(function(e){return a(i[e].value)}),p=e.headers["content-type"]||e.headers["Content-Type"];if(l||/multipart\/form-data/i.test(p)){var d=n(30);e.body=new d,(0,f.default)(i).forEach(function(t){e.body.append(t,u(i[t],!0))})}else e.body=s(i);delete e.form}if(o){var h=r.split("?"),v=(0,c.default)(h,2),g=v[0],y=v[1],b="";if(y){var _=m.default.parse(y);(0,f.default)(o).forEach(function(e){return delete _[e]}),b=m.default.stringify(_,{encode:!0})}var w=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(function(e){return e}).join("&");return r?"?"+r:""}(b,s(o));e.url=g+w,delete e.query}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldDownloadAsText=t.self=void 0;var c=r(n(26)),f=r(n(0)),p=r(n(8)),d=r(n(4)),h=r(n(1)),v=r(n(11));t.serializeRes=o,t.serializeHeaders=i,t.isFile=a,t.encodeFormOrQuery=s,t.mergeInQueryOrForm=l,t.makeHttp=function(e,t,n){return n=n||function(e){return e},t=t||function(e){return e},function(r){return"string"==typeof r&&(r={url:r}),b.mergeInQueryOrForm(r),r=t(r),n(e(r))}},n(27);var m=r(n(28)),g=r(n(15)),y=r(n(29)),b=t.self={serializeRes:o,mergeInQueryOrForm:l};t.default=function(){var e=(0,v.default)(d.default.mark(function e(t){var n,r,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("object"===(void 0===t?"undefined":(0,h.default)(t))&&(t=(a=t).url),a.headers=a.headers||{},b.mergeInQueryOrForm(a),!a.requestInterceptor){e.next=10;break}return e.next=6,a.requestInterceptor(a);case 6:if(e.t0=e.sent,e.t0){e.next=9;break}e.t0=a;case 9:a=e.t0;case 10:return n=a.headers["content-type"]||a.headers["Content-Type"],/multipart\/form-data/i.test(n)&&(delete a.headers["content-type"],delete a.headers["Content-Type"]),r=void 0,e.prev=13,e.next=16,(a.userFetch||fetch)(a.url,a);case 16:return r=e.sent,e.next=19,b.serializeRes(r,t,a);case 19:if(r=e.sent,!a.responseInterceptor){e.next=27;break}return e.next=23,a.responseInterceptor(r);case 23:if(e.t1=e.sent,e.t1){e.next=26;break}e.t1=r;case 26:r=e.t1;case 27:e.next=37;break;case 29:if(e.prev=29,e.t2=e.catch(13),r){e.next=33;break}throw e.t2;case 33:throw(o=new Error(r.statusText)).statusCode=o.status=r.status,o.responseError=e.t2,o;case 37:if(r.ok){e.next=42;break}throw(i=new Error(r.statusText)).statusCode=i.status=r.status,i.response=r,i;case 42:return e.abrupt("return",r);case 43:case"end":return e.stop()}},e,this,[[13,29]])}));return function(t){return e.apply(this,arguments)}}();var _=t.shouldDownloadAsText=function(){return/(json|xml|yaml|text)\b/.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}},function(e,t){e.exports=n(41)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return Array.isArray(e)?e.length<1?"":"/"+e.map(function(e){return(e+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/"):e}function i(e,t,n){return{op:"replace",path:e,value:t,meta:n}}function a(e,t,n){return f(c(e.filter(m).map(function(e){return t(e.value,n,e.path)})||[]))}function u(e,t,n){return n=n||[],Array.isArray(e)?e.map(function(e,r){return u(e,t,n.concat(r))}):p(e)?(0,w.default)(e).map(function(r){return u(e[r],t,n.concat(r))}):t(e,n[n.length-1],n)}function s(e,t,n){var r=[];if((n=n||[]).length>0){var o=t(e,n[n.length-1],n);o&&(r=r.concat(o))}if(Array.isArray(e)){var i=e.map(function(e,r){return s(e,t,n.concat(r))});i&&(r=r.concat(i))}else if(p(e)){var a=(0,w.default)(e).map(function(r){return s(e[r],t,n.concat(r))});a&&(r=r.concat(a))}return c(r)}function l(e){return Array.isArray(e)?e:[e]}function c(e){var t;return(t=[]).concat.apply(t,(0,_.default)(e.map(function(e){return Array.isArray(e)?c(e):e})))}function f(e){return e.filter(function(e){return void 0!==e})}function p(e){return e&&"object"===(void 0===e?"undefined":(0,b.default)(e))}function d(e){return e&&"function"==typeof e}function h(e){if(g(e)){var t=e.op;return"add"===t||"remove"===t||"replace"===t}return!1}function v(e){return h(e)||g(e)&&"mutation"===e.type}function m(e){return v(e)&&("add"===e.op||"replace"===e.op||"merge"===e.op||"mergeDeep"===e.op)}function g(e){return e&&"object"===(void 0===e?"undefined":(0,b.default)(e))}function y(e,t){try{return S.default.getValueByPointer(e,t)}catch(e){return console.error(e),{}}}Object.defineProperty(t,"__esModule",{value:!0});var b=r(n(1)),_=r(n(34)),w=r(n(0)),E=r(n(35)),x=r(n(2)),S=r(n(36)),C=r(n(4)),k=r(n(37)),A=r(n(38));t.default={add:function(e,t){return{op:"add",path:e,value:t}},replace:i,remove:function(e,t){return{op:"remove",path:e}},merge:function(e,t){return{type:"mutation",op:"merge",path:e,value:t}},mergeDeep:function(e,t){return{type:"mutation",op:"mergeDeep",path:e,value:t}},context:function(e,t){return{type:"context",path:e,value:t}},getIn:function(e,t){return t.reduce(function(e,t){return void 0!==t&&e?e[t]:e},e)},applyPatch:function(e,t,n){if(n=n||{},"merge"===(t=(0,x.default)({},t,{path:t.path&&o(t.path)})).op){var r=y(e,t.path);(0,x.default)(r,t.value),S.default.applyPatch(e,[i(t.path,r)])}else if("mergeDeep"===t.op){var a=y(e,t.path);for(var u in t.value){var s=t.value[u],l=Array.isArray(s);if(l){var c=a[u]||[];a[u]=c.concat(s)}else if(p(s)&&!l){var f=(0,x.default)({},a[u]);for(var d in s){if(Object.prototype.hasOwnProperty.call(f,d)){f=(0,k.default)((0,A.default)({},f),s);break}(0,x.default)(f,(0,E.default)({},d,s[d]))}a[u]=f}else a[u]=s}}else if("add"===t.op&&""===t.path&&p(t.value)){var h=(0,w.default)(t.value).reduce(function(e,n){return e.push({op:"add",path:"/"+o(n),value:t.value[n]}),e},[]);S.default.applyPatch(e,h)}else if("replace"===t.op&&""===t.path){var v=t.value;n.allowMetaPatches&&t.meta&&m(t)&&(Array.isArray(t.value)||p(t.value))&&(v=(0,x.default)({},v,t.meta)),e=v}else if(S.default.applyPatch(e,[t]),n.allowMetaPatches&&t.meta&&m(t)&&(Array.isArray(t.value)||p(t.value))){var g=y(e,t.path),b=(0,x.default)({},g,t.meta);S.default.applyPatch(e,[i(t.path,b)])}return e},parentPathMatch:function(e,t){if(!Array.isArray(t))return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0},flatten:c,fullyNormalizeArray:function(e){return f(c(l(e)))},normalizeArray:l,isPromise:function(e){return p(e)&&d(e.then)},forEachNew:function(e,t){try{return a(e,s,t)}catch(e){return e}},forEachNewPrimitive:function(e,t){try{return a(e,u,t)}catch(e){return e}},isJsonPatch:h,isContextPatch:function(e){return g(e)&&"context"===e.type},isPatch:g,isMutation:v,isAdditiveMutation:m,isGenerator:function(e){return C.default.isGeneratorFunction(e)},isFunction:d,isObject:p,isError:function(e){return e instanceof Error}},e.exports=t.default},function(e,t){e.exports=n(896)},function(e,t){e.exports=n(340)},function(e,t){e.exports=n(138)},function(e,t){e.exports=n(902)},function(e,t){e.exports=n(903)},function(e,t){e.exports=n(208)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.requestInterceptor,r=t.responseInterceptor,o=e.withCredentials?"include":"same-origin";return function(t){return e({url:t,loadSpec:!0,requestInterceptor:n,responseInterceptor:r,headers:{Accept:"application/json"},credentials:o}).then(function(e){return e.body})}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4)),a=r(n(11));t.makeFetchJSON=o,t.clearCache=function(){s.plugins.refs.clearCache()},t.default=function(e){function t(e){var t=this;E&&(s.plugins.refs.docCache[E]=e),s.plugins.refs.fetchJSON=o(w,{requestInterceptor:y,responseInterceptor:b});var n=[s.plugins.refs];return"function"==typeof g&&n.push(s.plugins.parameters),"function"==typeof m&&n.push(s.plugins.properties),"strict"!==p&&n.push(s.plugins.allOf),(0,l.default)({spec:e,context:{baseDoc:E},plugins:n,allowMetaPatches:h,pathDiscriminator:v,parameterMacro:g,modelPropertyMacro:m}).then(_?function(){var e=(0,a.default)(i.default.mark(function e(n){return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n);case 1:case"end":return e.stop()}},e,t)}));return function(t){return e.apply(this,arguments)}}():c.normalizeSwagger)}var n=e.fetch,r=e.spec,f=e.url,p=e.mode,d=e.allowMetaPatches,h=void 0===d||d,v=e.pathDiscriminator,m=e.modelPropertyMacro,g=e.parameterMacro,y=e.requestInterceptor,b=e.responseInterceptor,_=e.skipNormalization,w=e.http,E=e.baseDoc;return E=E||f,w=n||w||u.default,r?t(r):o(w,{requestInterceptor:y,responseInterceptor:b})(E).then(t)};var u=r(n(7)),s=n(31),l=r(s),c=n(5)},function(e,t){e.exports=n(204)},function(e,t){e.exports=n(91)},function(e,t){e.exports=n(2)},function(e,t){e.exports=n(3)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){function n(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack;for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];this.message=n[0],t&&t.apply(this,n)}return n.prototype=new Error,n.prototype.name=e,n.prototype.constructor=n,n},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFreelyNamed=function(e){var t=e[e.length-1],n=e[e.length-2],u=e.join("/");return r.indexOf(t)>-1&&-1===o.indexOf(n)||i.indexOf(u)>-1||a.some(function(e){return u.indexOf(e)>-1})};var r=["properties"],o=["properties"],i=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],a=["schema/example"]},function(e,t,n){e.exports=n(24)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e?n.url=e:n=e,!(this instanceof o))return new o(n);(0,a.default)(this,n);var r=this.resolve().then(function(){return t.disableInterfaces||(0,a.default)(t,o.makeApisTagOperation(t)),t});return r.client=this,r}Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3)),a=r((r(n(25)),n(6))),u=r(n(14)),s=r(n(10)),l=n(7),c=r(l),f=n(16),p=r(f),d=r(n(48)),h=n(49),v=n(51),m=n(5);o.http=c.default,o.makeHttp=l.makeHttp.bind(null,o.http),o.resolve=p.default,o.resolveSubtree=d.default,o.execute=v.execute,o.serializeRes=l.serializeRes,o.serializeHeaders=l.serializeHeaders,o.clearCache=f.clearCache,o.parameterBuilders=v.PARAMETER_BUILDERS,o.makeApisTagOperation=h.makeApisTagOperation,o.buildRequest=v.buildRequest,o.helpers={opId:m.opId},o.prototype={http:c.default,execute:function(e){return this.applyDefaults(),o.execute((0,i.default)({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:"string"==typeof this.url?this.url:void 0},e))},resolve:function(){var e=this;return o.resolve({spec:this.spec,url:this.url,allowMetaPatches:this.allowMetaPatches,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null}).then(function(t){return e.originalSpec=e.spec,e.spec=t.spec,e.errors=t.errors,e})}},o.prototype.applyDefaults=function(){var e=this.spec,t=this.url;if(t&&(0,u.default)(t,"http")){var n=s.default.parse(t);e.host||(e.host=n.host),e.schemes||(e.schemes=[n.protocol.replace(":","")]),e.basePath||(e.basePath="/")}},t.default=o,e.exports=t.default},function(e,t){e.exports=n(905)},function(e,t){e.exports=n(17)},function(e,t){e.exports=n(906)},function(e,t){e.exports=n(907)},function(e,t){e.exports=n(343)},function(e,t){e.exports=n(910)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.plugins=t.SpecMap=void 0;var o=r(n(8)),i=r(n(1)),a=r(n(17)),u=r(n(4)),s=r(n(0)),l=r(n(18)),c=r(n(32)),f=r(n(2)),p=r(n(19)),d=r(n(20));t.default=function(e){return new w(e).dispatch()};var h=r(n(33)),v=r(n(9)),m=r(n(39)),g=r(n(43)),y=r(n(44)),b=r(n(45)),_=r(n(46)),w=function(){function e(t){(0,p.default)(this,e),(0,f.default)(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new _.default,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:(0,f.default)((0,c.default)(this),v.default),allowMetaPatches:!1},t),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=this.plugins.map(this.wrapPlugin.bind(this)).filter(v.default.isFunction),this.patches.push(v.default.add([],this.spec)),this.patches.push(v.default.context([],this.context)),this.updatePatches(this.patches)}return(0,d.default)(e,[{key:"debug",value:function(e){if(this.debugLevel===e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console).log.apply(t,r)}}},{key:"verbose",value:function(e){if("verbose"===this.debugLevel){for(var t,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console).log.apply(t,["["+e+"] "].concat(r))}}},{key:"wrapPlugin",value:function(e,t){var n=this.pathDiscriminator,r=null,o=void 0;return e[this.pluginProp]?(r=e,o=e[this.pluginProp]):v.default.isFunction(e)?o=e:v.default.isObject(e)&&(o=function(e){var t=function(e,t){return!Array.isArray(e)||e.every(function(e,n){return e===t[n]})};return u.default.mark(function r(o,i){var a,c,f,p,d,h,m,g,y;return u.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:y=function r(o,f,p){var d,h,m,g,y,b,_,w,E,x,S,C,k,A,O,P;return u.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(v.default.isObject(o)){a.next=6;break}if(e.key!==f[f.length-1]){a.next=4;break}return a.next=4,e.plugin(o,e.key,f,i);case 4:a.next=48;break;case 6:d=f.length-1,h=f[d],m=f.indexOf("properties"),g="properties"===h&&d===m,y=i.allowMetaPatches&&c[o.$$ref],b=!0,_=!1,w=void 0,a.prev=14,E=(0,l.default)((0,s.default)(o));case 16:if(b=(x=E.next()).done){a.next=34;break}if(S=x.value,C=o[S],k=f.concat(S),A=v.default.isObject(C),O=o.$$ref,y){a.next=26;break}if(!A){a.next=26;break}return i.allowMetaPatches&&O&&(c[O]=!0),a.delegateYield(r(C,k,p),"t0",26);case 26:if(g||S!==e.key){a.next=31;break}if(P=t(n,f),n&&!P){a.next=31;break}return a.next=31,e.plugin(C,S,k,i,p);case 31:b=!0,a.next=16;break;case 34:a.next=40;break;case 36:a.prev=36,a.t1=a.catch(14),_=!0,w=a.t1;case 40:a.prev=40,a.prev=41,!b&&E.return&&E.return();case 43:if(a.prev=43,!_){a.next=46;break}throw w;case 46:return a.finish(43);case 47:return a.finish(40);case 48:case"end":return a.stop()}},a,this,[[14,36,40,48],[41,,43,47]])},a=u.default.mark(y),c={},f=!0,p=!1,d=void 0,r.prev=6,h=(0,l.default)(o.filter(v.default.isAdditiveMutation));case 8:if(f=(m=h.next()).done){r.next=14;break}return g=m.value,r.delegateYield(y(g.value,g.path,g),"t0",11);case 11:f=!0,r.next=8;break;case 14:r.next=20;break;case 16:r.prev=16,r.t1=r.catch(6),p=!0,d=r.t1;case 20:r.prev=20,r.prev=21,!f&&h.return&&h.return();case 23:if(r.prev=23,!p){r.next=26;break}throw d;case 26:return r.finish(23);case 27:return r.finish(20);case 28:case"end":return r.stop()}},r,this,[[6,16,20,28],[21,,23,27]])})}(e)),(0,f.default)(o.bind(r),{pluginName:e.name||t,isGenerator:v.default.isGenerator(o)})}},{key:"nextPlugin",value:function(){var e=this;return(0,h.default)(this.wrappedPlugins,function(t){return e.getMutationsForPlugin(t).length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0)return a.default.race(this.promisedPatches.map(function(e){return e.value}))}},{key:"getPluginHistory",value:function(e){var t=this.getPluginName(e);return this.pluginHistory[t]||[]}},{key:"getPluginRunCount",value:function(e){return this.getPluginHistory(e).length}},{key:"getPluginHistoryTip",value:function(e){var t=this.getPluginHistory(e);return t&&t[t.length-1]||{}}},{key:"getPluginMutationIndex",value:function(e){var t=this.getPluginHistoryTip(e).mutationIndex;return"number"!=typeof t?-1:t}},{key:"getPluginName",value:function(e){return e.pluginName}},{key:"updatePluginHistory",value:function(e,t){var n=this.getPluginName(e);(this.pluginHistory[n]=this.pluginHistory[n]||[]).push(t)}},{key:"updatePatches",value:function(e,t){var n=this;v.default.normalizeArray(e).forEach(function(e){if(e instanceof Error)n.errors.push(e);else try{if(!v.default.isObject(e))return void n.debug("updatePatches","Got a non-object patch",e);if(n.showDebug&&n.allPatches.push(e),v.default.isPromise(e.value))return n.promisedPatches.push(e),void n.promisedPatchThen(e);if(v.default.isContextPatch(e))return void n.setContext(e.path,e.value);if(v.default.isMutation(e))return void n.updateMutations(e)}catch(e){console.error(e),n.errors.push(e)}})}},{key:"updateMutations",value:function(e){"object"===(0,i.default)(e.value)&&!Array.isArray(e.value)&&this.allowMetaPatches&&(e.value=(0,f.default)({},e.value));var t=v.default.applyPatch(this.state,e,{allowMetaPatches:this.allowMetaPatches});t&&(this.mutations.push(e),this.state=t)}},{key:"removePromisedPatch",value:function(e){var t=this.promisedPatches.indexOf(e);t<0?this.debug("Tried to remove a promisedPatch that isn't there!"):this.promisedPatches.splice(t,1)}},{key:"promisedPatchThen",value:function(e){var t=this;return e.value=e.value.then(function(n){var r=(0,f.default)({},e,{value:n});t.removePromisedPatch(e),t.updatePatches(r)}).catch(function(n){t.removePromisedPatch(e),t.updatePatches(n)})}},{key:"getMutations",value:function(e,t){return e=e||0,"number"!=typeof t&&(t=this.mutations.length),this.mutations.slice(e,t)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(e){var t=this.getPluginMutationIndex(e);return this.getMutations(t+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getPatchesOfType",value:function(e,t){return e.filter(t)}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(e){return v.default.getIn(this.state,e)}},{key:"_getContext",value:function(e){return this.contextTree.get(e)}},{key:"setContext",value:function(e,t){return this.contextTree.set(e,t)}},{key:"_hasRun",value:function(e){return this.getPluginRunCount(this.getCurrentPlugin())>(e||0)}},{key:"_clone",value:function(e){return JSON.parse((0,o.default)(e))}},{key:"dispatch",value:function(){function e(e){e&&(e=v.default.fullyNormalizeArray(e),n.updatePatches(e,r))}var t=this,n=this,r=this.nextPlugin();if(!r){var o=this.nextPromisedPatch();if(o)return o.then(function(){return t.dispatch()}).catch(function(){return t.dispatch()});var i={spec:this.state,errors:this.errors};return this.showDebug&&(i.patches=this.allPatches),a.default.resolve(i)}if(n.pluginCount=n.pluginCount||{},n.pluginCount[r]=(n.pluginCount[r]||0)+1,n.pluginCount[r]>100)return a.default.resolve({spec:n.state,errors:n.errors.concat(new Error("We've reached a hard limit of 100 plugin runs"))});if(r!==this.currentPlugin&&this.promisedPatches.length){var u=this.promisedPatches.map(function(e){return e.value});return a.default.all(u.map(function(e){return e.then(Function,Function)})).then(function(){return t.dispatch()})}return function(){n.currentPlugin=r;var t=n.getCurrentMutations(),o=n.mutations.length-1;try{if(r.isGenerator){var i=!0,a=!1,u=void 0;try{for(var s,p=(0,l.default)(r(t,n.getLib()));!(i=(s=p.next()).done);i=!0)e(s.value)}catch(e){a=!0,u=e}finally{try{!i&&p.return&&p.return()}finally{if(a)throw u}}}else e(r(t,n.getLib()))}catch(t){console.error(t),e([(0,f.default)((0,c.default)(t),{plugin:r})])}finally{n.updatePluginHistory(r,{mutationIndex:o})}return n.dispatch()}()}}]),e}(),E={refs:m.default,allOf:g.default,parameters:y.default,properties:b.default};t.SpecMap=w,t.plugins=E},function(e,t){e.exports=n(350)},function(e,t){e.exports=n(288)},function(e,t){e.exports=n(83)},function(e,t){e.exports=n(22)},function(e,t){e.exports=n(911)},function(e,t){e.exports=n(179)},function(e,t){e.exports=n(181)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!A.test(e)){if(!t)throw new O("Tried to resolve a relative URL, without having a basePath. path: '"+e+"' basePath: '"+t+"'");return x.default.resolve(t,e)}return e}function i(e,t){var n;return n=e&&e.response&&e.response.body?e.response.body.code+" "+e.response.body.message:e.message,new O("Could not resolve reference: "+n,t,e)}function a(e){return(e+"").split("#")}function u(e,t){var n=P[e];if(n&&!S.default.isPromise(n))try{var r=l(t,n);return(0,b.default)(g.default.resolve(r),{__value:r})}catch(e){return g.default.reject(e)}return s(e).then(function(e){return l(t,e)})}function s(e){var t=P[e];return t?S.default.isPromise(t)?t:g.default.resolve(t):(P[e]=I.fetchJSON(e).then(function(t){return P[e]=t,t}),P[e])}function l(e,t){var n=c(e);if(n.length<1)return t;var r=S.default.getIn(t,n);if(void 0===r)throw new O("Could not resolve pointer: "+e+" does not exist in document",{pointer:e});return r}function c(e){if("string"!=typeof e)throw new TypeError("Expected a string, got a "+(void 0===e?"undefined":(0,v.default)(e)));return"/"===e[0]&&(e=e.substr(1)),""===e?[]:e.split("/").map(f)}function f(e){return"string"!=typeof e?e:E.default.unescape(e.replace(/~1/g,"/").replace(/~0/g,"~"))}function p(e){return E.default.escape(e.replace(/~/g,"~0").replace(/\//g,"~1"))}function d(e,t){if(j(t))return!0;var n=e.charAt(t.length),r=t.slice(-1);return 0===e.indexOf(t)&&(!n||"/"===n||"#"===n)&&"#"!==r}function h(e,t,n,r){var o=T.get(r);o||(o={},T.set(r,o));var i=function(e){return 0===e.length?"":"/"+e.map(p).join("/")}(n),a=(t||"<specmap-base>")+"#"+e;if(t==r.contextTree.get([]).baseDoc&&d(i,e))return!0;var u="";if(n.some(function(e){return u=u+"/"+p(e),o[u]&&o[u].some(function(e){return d(e,a)||d(a,e)})}))return!0;o[i]=(o[i]||[]).concat(a)}Object.defineProperty(t,"__esModule",{value:!0});var v=r(n(1)),m=r(n(0)),g=r(n(17)),y=r(n(40)),b=r(n(2)),_=n(41),w=r(n(15)),E=r(n(42)),x=r(n(10)),S=r(n(9)),C=r(n(21)),k=n(22),A=new RegExp("^([a-z]+://|//)","i"),O=(0,C.default)("JSONRefError",function(e,t,n){this.originalError=n,(0,b.default)(this,t||{})}),P={},T=new y.default,M={key:"$ref",plugin:function(e,t,n,r){var s=n.slice(0,-1);if(!(0,k.isFreelyNamed)(s)){var l=r.getContext(n).baseDoc;if("string"!=typeof e)return new O("$ref: must be a string (JSON-Ref)",{$ref:e,baseDoc:l,fullPath:n});var f=a(e),p=f[0],d=f[1]||"",v=void 0;try{v=l||p?o(p,l):null}catch(t){return i(t,{pointer:d,$ref:e,basePath:v,fullPath:n})}var g=void 0,y=void 0;if(!h(d,v,s,r)){if(null==v?(y=c(d),void 0===(g=r.get(y))&&(g=new O("Could not resolve reference: "+e,{pointer:d,$ref:e,baseDoc:l,fullPath:n}))):g=null!=(g=u(v,d)).__value?g.__value:g.catch(function(t){throw i(t,{pointer:d,$ref:e,baseDoc:l,fullPath:n})}),g instanceof Error)return[S.default.remove(n),g];var b=S.default.replace(s,g,{$$ref:e});if(v&&v!==l)return[b,S.default.context(s,{baseDoc:v})];try{if(!function(e,t){var n=[e];return t.path.reduce(function(e,t){return n.push(e[t]),e[t]},e),function e(t){return S.default.isObject(t)&&(n.indexOf(t)>=0||(0,m.default)(t).some(function(n){return e(t[n])}))}(t.value)}(r.state,b))return b}catch(e){return null}}}}},I=(0,b.default)(M,{docCache:P,absoluteify:o,clearCache:function(e){void 0!==e?delete P[e]:(0,m.default)(P).forEach(function(e){delete P[e]})},JSONRefError:O,wrapError:i,getDoc:s,split:a,extractFromDoc:u,fetchJSON:function(e){return(0,_.fetch)(e,{headers:{Accept:"application/json, application/yaml"},loadSpec:!0}).then(function(e){return e.text()}).then(function(e){return w.default.safeLoad(e)})},extract:l,jsonPointerToArray:c,unescapeJsonPointerToken:f});t.default=I;var j=function(e){return!e||"/"===e||"#"===e};e.exports=t.default},function(e,t){e.exports=n(914)},function(e,t){e.exports=n(925)},function(e,t){e.exports=n(926)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return e&&e.__esModule?e:{default:e}}(n(2)),o=n(22);t.default={key:"allOf",plugin:function(e,t,n,i,a){if(!a.meta||!a.meta.$$ref){var u=n.slice(0,-1);if(!(0,o.isFreelyNamed)(u)){if(!Array.isArray(e)){var s=new TypeError("allOf must be an array");return s.fullPath=n,s}var l=!1,c=a.value;u.forEach(function(e){c&&(c=c[e])}),delete(c=(0,r.default)({},c)).allOf;var f=[i.replace(u,{})].concat(e.map(function(e,t){if(!i.isObject(e)){if(l)return null;l=!0;var r=new TypeError("Elements in allOf must be objects");return r.fullPath=n,r}return i.mergeDeep(u,e)}));return f.push(i.mergeDeep(u,c)),c.$$ref||f.push(i.remove([].concat(u,"$$ref"))),f}}}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(2)),i=r(n(9));t.default={key:"parameters",plugin:function(e,t,n,r,a){if(Array.isArray(e)&&e.length){var u=(0,o.default)([],e),s=n.slice(0,-1),l=(0,o.default)({},i.default.getIn(r.spec,s));return e.forEach(function(e,t){try{u[t].default=r.parameterMacro(l,e)}catch(e){var o=new Error(e);return o.fullPath=n,o}}),i.default.replace(n,u)}return i.default.replace(n,e)}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(2)),i=r(n(9));t.default={key:"properties",plugin:function(e,t,n,r){var a=(0,o.default)({},e);for(var u in e)try{a[u].default=r.modelPropertyMacro(a[u])}catch(e){var s=new Error(e);return s.fullPath=n,s}return i.default.replace(n,a)}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return i({children:{}},e,t)}function i(e,t,n){return e.value=t||{},e.protoValue=n?(0,u.default)({},n.protoValue,e.value):e.value,(0,a.default)(e.children).forEach(function(t){var n=e.children[t];e.children[t]=i(n,n.value,e)}),e}Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),u=r(n(3)),s=r(n(19)),l=r(n(20)),c=function(){function e(t){(0,s.default)(this,e),this.root=o(t||{})}return(0,l.default)(e,[{key:"set",value:function(e,t){var n=this.getParent(e,!0);if(n){var r=e[e.length-1],a=n.children;a[r]?i(a[r],t,n):a[r]=o(t,n)}else i(this.root,t,null)}},{key:"get",value:function(e){if((e=e||[]).length<1)return this.root.value;for(var t=this.root,n=void 0,r=void 0,o=0;o<e.length&&(r=e[o],(n=t.children)[r]);o++)t=n[r];return t&&t.protoValue}},{key:"getParent",value:function(e,t){return!e||e.length<1?null:e.length<2?this.root:e.slice(0,-1).reduce(function(e,n){if(!e)return e;var r=e.children;return!r[n]&&t&&(r[n]=o(null,e)),r[n]},this.root)}}]),e}();t.default=c,e.exports=t.default},function(e,t){e.exports=n(38)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(4)),i=r(n(3)),a=r(n(11)),u=r(n(12)),s=r(n(16)),l=n(5);t.default=function(){var e=(0,a.default)(o.default.mark(function e(t,n){var r,a,c,f,p,d,h,v,m,g,y=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=y.returnEntireTree,a=y.baseDoc,c=y.requestInterceptor,f=y.responseInterceptor,p=y.parameterMacro,d=y.modelPropertyMacro,h={pathDiscriminator:n,baseDoc:a,requestInterceptor:c,responseInterceptor:f,parameterMacro:p,modelPropertyMacro:d},v=(0,l.normalizeSwagger)({spec:t}),m=v.spec,e.next=5,(0,s.default)((0,i.default)({},h,{spec:m,allowMetaPatches:!0,skipNormalization:!0}));case 5:return g=e.sent,!r&&Array.isArray(n)&&n.length&&(g.spec=(0,u.default)(g.spec,n)||null),e.abrupt("return",g);case 8:case"end":return e.stop()}},e,this)}));return function(t,n){return e.apply(this,arguments)}}(),e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=t.pathName,r=t.method,o=t.operationId;return function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.execute((0,a.default)({spec:e.spec},(0,u.default)(e,"requestInterceptor","responseInterceptor","userFetch"),{pathName:n,method:r,parameters:t,operationId:o},i))}}}function i(e){var t=e.spec,n=e.cb,r=void 0===n?l:n,o=e.defaultTag,i=void 0===o?"default":o,a=e.v2OperationIdCompatibilityMode,u={},f={};return(0,s.eachOperation)(t,function(e){var n=e.pathName,o=e.method,l=e.operation;(l.tags?c(l.tags):[i]).forEach(function(e){if("string"==typeof e){var i=f[e]=f[e]||{},c=(0,s.opId)(l,n,o,{v2OperationIdCompatibilityMode:a}),p=r({spec:t,pathName:n,method:o,operation:l,operationId:c});if(u[c])u[c]++,i[""+c+u[c]]=p;else if(void 0!==i[c]){var d=u[c]||1;u[c]=d+1,i[""+c+u[c]]=p;var h=i[c];delete i[c],i[""+c+d]=h}else i[c]=p}})}),f}Object.defineProperty(t,"__esModule",{value:!0}),t.self=void 0;var a=r(n(3));t.makeExecute=o,t.makeApisTagOperationsOperationExecute=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=f.makeExecute(e),n=f.mapTagOperations({v2OperationIdCompatibilityMode:e.v2OperationIdCompatibilityMode,spec:e.spec,cb:t}),r={};for(var o in n)for(var i in r[o]={operations:{}},n[o])r[o].operations[i]={execute:n[o][i]};return{apis:r}},t.makeApisTagOperation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=f.makeExecute(e);return{apis:f.mapTagOperations({v2OperationIdCompatibilityMode:e.v2OperationIdCompatibilityMode,spec:e.spec,cb:t})}},t.mapTagOperations=i;var u=r(n(50)),s=n(5),l=function(){return null},c=function(e){return Array.isArray(e)?e:[e]},f=t.self={mapTagOperations:i,makeExecute:o}},function(e,t){e.exports=n(927)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.spec,n=e.operationId,r=(e.securities,e.requestContentType,e.responseContentType),o=e.scheme,a=e.requestInterceptor,s=e.responseInterceptor,c=e.contextUrl,f=e.userFetch,p=(e.requestBody,e.server),d=e.serverVariables,h=e.http,g=e.parameters,y=e.parameterBuilders,O=(0,x.isOAS3)(t);y||(y=O?_.default:b.default);var P={url:"",credentials:h&&h.withCredentials?"include":"same-origin",headers:{},cookies:{}};a&&(P.requestInterceptor=a),s&&(P.responseInterceptor=s),f&&(P.userFetch=f);var T=(0,x.getOperationRaw)(t,n);if(!T)throw new C("Operation "+n+" not found");var M=T.operation,I=void 0===M?{}:M,j=T.method,N=T.pathName;if(P.url+=i({spec:t,scheme:o,contextUrl:c,server:p,serverVariables:d,pathName:N,method:j}),!n)return delete P.cookies,P;P.url+=N,P.method=(""+j).toUpperCase(),g=g||{};var R=t.paths[N]||{};r&&(P.headers.accept=r);var D=A([].concat(S(I.parameters)).concat(S(R.parameters)));D.forEach(function(e){var n=y[e.in],r=void 0;if("body"===e.in&&e.schema&&e.schema.properties&&(r=g),void 0===(r=e&&e.name&&g[e.name])?r=e&&e.name&&g[e.in+"."+e.name]:k(e.name,D).length>1&&console.warn("Parameter '"+e.name+"' is ambiguous because the defined spec has more than one parameter with the name: '"+e.name+"' and the passed-in parameter values did not define an 'in' value."),null!==r){if(void 0!==e.default&&void 0===r&&(r=e.default),void 0===r&&e.required&&!e.allowEmptyValue)throw new Error("Required parameter "+e.name+" is not provided");if(O&&e.schema&&"object"===e.schema.type&&"string"==typeof r)try{r=JSON.parse(r)}catch(e){throw new Error("Could not parse object parameter value string as JSON")}n&&n({req:P,parameter:e,value:r,operation:I,spec:t})}});var L=(0,u.default)({},e,{operation:I});if((P=O?(0,w.default)(L,P):(0,E.default)(L,P)).cookies&&(0,l.default)(P.cookies).length){var U=(0,l.default)(P.cookies).reduce(function(e,t){var n=P.cookies[t];return e+(e?"&":"")+v.default.serialize(t,n)},"");P.headers.Cookie=U}return P.cookies&&delete P.cookies,(0,m.mergeInQueryOrForm)(P),P}function i(e){return(0,x.isOAS3)(e.spec)?function(e){var t=e.spec,n=e.pathName,r=e.method,o=e.server,i=e.contextUrl,a=e.serverVariables,u=void 0===a?{}:a,s=(0,f.default)(t,["paths",n,(r||"").toLowerCase(),"servers"])||(0,f.default)(t,["paths",n,"servers"])||(0,f.default)(t,["servers"]),l="",c=null;if(o&&s&&s.length){var p=s.map(function(e){return e.url});p.indexOf(o)>-1&&(l=o,c=s[p.indexOf(o)])}!l&&s&&s.length&&(l=s[0].url,c=s[0]),l.indexOf("{")>-1&&function(e){for(var t=[],n=/{([^}]+)}/g,r=void 0;r=n.exec(e);)t.push(r[1]);return t}(l).forEach(function(e){if(c.variables&&c.variables[e]){var t=c.variables[e],n=u[e]||t.default,r=new RegExp("{"+e+"}","g");l=l.replace(r,n)}});return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=h.default.parse(e),r=h.default.parse(t),o=P(n.protocol)||P(r.protocol)||"",i=n.host||r.host,a=n.pathname||"",u=void 0;return"/"===(u=o&&i?o+"://"+(i+a):a)[u.length-1]?u.slice(0,-1):u}(l,i)}(e):function(e){var t=e.spec,n=e.scheme,r=e.contextUrl,o=void 0===r?"":r,i=h.default.parse(o),a=Array.isArray(t.schemes)?t.schemes[0]:null,u=n||a||P(i.protocol)||"http",s=t.host||i.host||"",l=t.basePath||"",c=void 0;return"/"===(c=u&&s?u+"://"+(s+l):l)[c.length-1]?c.slice(0,-1):c}(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.self=void 0;var a=r(n(8)),u=r(n(3)),s=r(n(52)),l=r(n(0)),c=r(n(2));t.execute=function(e){var t=e.http,n=e.fetch,r=e.spec,o=e.operationId,i=e.pathName,l=e.method,c=e.parameters,f=e.securities,h=(0,s.default)(e,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),v=t||n||g.default;i&&l&&!o&&(o=(0,x.legacyIdFromPathMethod)(i,l));var m=O.buildRequest((0,u.default)({spec:r,operationId:o,parameters:c,securities:f,http:v},h));return m.body&&((0,p.default)(m.body)||(0,d.default)(m.body))&&(m.body=(0,a.default)(m.body)),v(m)},t.buildRequest=o,t.baseUrl=i;var f=r((r(n(6)),n(12))),p=r(n(53)),d=r(n(54)),h=r((r(n(13)),n(10))),v=r(n(55)),m=n(7),g=r(m),y=r(n(21)),b=r(n(56)),_=r(n(57)),w=r(n(62)),E=r(n(64)),x=n(5),S=function(e){return Array.isArray(e)?e:[]},C=(0,y.default)("OperationNotFoundError",function(e,t,n){this.originalError=n,(0,c.default)(this,t||{})}),k=function(e,t){return t.filter(function(t){return t.name===e})},A=function(e){var t={};e.forEach(function(e){t[e.in]||(t[e.in]={}),t[e.in][e.name]=e});var n=[];return(0,l.default)(t).forEach(function(e){(0,l.default)(t[e]).forEach(function(r){n.push(t[e][r])})}),n},O=t.self={buildRequest:o},P=function(e){return e?e.replace(/\W/g,""):null}},function(e,t){e.exports=n(84)},function(e,t){e.exports=n(228)},function(e,t){e.exports=n(24)},function(e,t){e.exports=n(930)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={body:function(e){var t=e.req,n=e.value;t.body=n},header:function(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{},void 0!==r&&(t.headers[n.name]=r)},query:function(e){var t=e.req,n=e.value,r=e.parameter;if(t.query=t.query||{},!1===n&&"boolean"===r.type&&(n="false"),0===n&&["number","integer"].indexOf(r.type)>-1&&(n="0"),n)t.query[r.name]={collectionFormat:r.collectionFormat,value:n};else if(r.allowEmptyValue&&void 0!==n){var o=r.name;t.query[o]=t.query[o]||{},t.query[o].allowEmptyValue=!0}},path:function(e){var t=e.req,n=e.value,r=e.parameter;t.url=t.url.replace("{"+r.name+"}",encodeURIComponent(n))},formData:function(e){var t=e.req,n=e.value,r=e.parameter;(n||r.allowEmptyValue)&&(t.form=t.form||{},t.form[r.name]={value:n,allowEmptyValue:r.allowEmptyValue,collectionFormat:r.collectionFormat})}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(0)),i=r(n(1)),a=r(n(58));t.default={path:function(e){var t=e.req,n=e.value,r=e.parameter,o=r.name,i=r.style,u=r.explode,s=(0,a.default)({key:r.name,value:n,style:i||"simple",explode:u||!1,escape:!0});t.url=t.url.replace("{"+o+"}",s)},query:function(e){var t=e.req,n=e.value,r=e.parameter;if(t.query=t.query||{},!1===n&&(n="false"),0===n&&(n="0"),n){var u=void 0===n?"undefined":(0,i.default)(n);"deepObject"===r.style?(0,o.default)(n).forEach(function(e){var o=n[e];t.query[r.name+"["+e+"]"]={value:(0,a.default)({key:e,value:o,style:"deepObject",escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}}):"object"!==u||Array.isArray(n)||"form"!==r.style&&r.style||!r.explode&&void 0!==r.explode?t.query[r.name]={value:(0,a.default)({key:r.name,value:n,style:r.style||"form",explode:void 0===r.explode||r.explode,escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}:(0,o.default)(n).forEach(function(e){var o=n[e];t.query[e]={value:(0,a.default)({key:e,value:o,style:r.style||"form",escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}})}else if(r.allowEmptyValue&&void 0!==n){var s=r.name;t.query[s]=t.query[s]||{},t.query[s].allowEmptyValue=!0}},header:function(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{},u.indexOf(n.name.toLowerCase())>-1||void 0!==r&&(t.headers[n.name]=(0,a.default)({key:n.name,value:r,style:n.style||"simple",explode:void 0!==n.explode&&n.explode,escape:!1}))},cookie:function(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{};var o=void 0===r?"undefined":(0,i.default)(r);if("undefined"!==o){var u="object"===o&&!Array.isArray(r)&&n.explode?"":n.name+"=";t.headers.Cookie=u+(0,a.default)({key:n.name,value:r,escape:!1,style:n.style||"form",explode:void 0!==n.explode&&n.explode})}}};var u=["accept","authorization","content-type"];e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).escape,n=arguments[2];return"number"==typeof e&&(e=e.toString()),"string"==typeof e&&e.length&&t?n?JSON.parse(e):(0,s.stringToCharArray)(e).map(function(e){return c(e)?e:l(e)&&"unsafe"===t?e:((0,u.default)(e)||[]).map(function(e){return("0"+e.toString(16).toUpperCase()).slice(-2)}).map(function(e){return"%"+e}).join("")}).join(""):e}Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(0)),a=r(n(1));t.encodeDisallowedCharacters=o,t.default=function(e){var t=e.value;return Array.isArray(t)?function(e){var t=e.key,n=e.value,r=e.style,i=e.explode,a=e.escape,u=function(e){return o(e,{escape:a})};if("simple"===r)return n.map(function(e){return u(e)}).join(",");if("label"===r)return"."+n.map(function(e){return u(e)}).join(".");if("matrix"===r)return n.map(function(e){return u(e)}).reduce(function(e,n){return!e||i?(e||"")+";"+t+"="+n:e+","+n},"");if("form"===r){var s=i?"&"+t+"=":",";return n.map(function(e){return u(e)}).join(s)}if("spaceDelimited"===r){var l=i?t+"=":"";return n.map(function(e){return u(e)}).join(" "+l)}if("pipeDelimited"===r){var c=i?t+"=":"";return n.map(function(e){return u(e)}).join("|"+c)}}(e):"object"===(void 0===t?"undefined":(0,a.default)(t))?function(e){var t=e.key,n=e.value,r=e.style,a=e.explode,u=e.escape,s=function(e){return o(e,{escape:u})},l=(0,i.default)(n);return"simple"===r?l.reduce(function(e,t){var r=s(n[t]);return(e?e+",":"")+t+(a?"=":",")+r},""):"label"===r?l.reduce(function(e,t){var r=s(n[t]);return(e?e+".":".")+t+(a?"=":".")+r},""):"matrix"===r&&a?l.reduce(function(e,t){var r=s(n[t]);return(e?e+";":";")+t+"="+r},""):"matrix"===r?l.reduce(function(e,r){var o=s(n[r]);return(e?e+",":";"+t+"=")+r+","+o},""):"form"===r?l.reduce(function(e,t){var r=s(n[t]);return(e?e+(a?"&":","):"")+t+(a?"=":",")+r},""):void 0}(e):function(e){var t=e.key,n=e.value,r=e.style,i=e.escape,a=function(e){return o(e,{escape:i})};return"simple"===r?a(n):"label"===r?"."+a(n):"matrix"===r?";"+t+"="+a(n):"form"===r?a(n):"deepObject"===r?a(n):void 0}(e)};var u=r((r(n(59)),n(60))),s=n(61),l=function(e){return":/?#[]@!$&'()*+,;=".indexOf(e)>-1},c=function(e){return/^[a-z0-9\-._~]+$/i.test(e)}},function(e,t){e.exports=n(931)},function(e,t){e.exports=n(932)},function(e,t){e.exports=n(933)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,o=e.operation,i=void 0===o?{}:o,a=e.spec,f=(0,s.default)({},t),p=r.authorized,d=void 0===p?{}:p,h=i.security||a.security||[],v=d&&!!(0,u.default)(d).length,m=(0,l.default)(a,["components","securitySchemes"])||{};return f.headers=f.headers||{},f.query=f.query||{},(0,u.default)(r).length&&v&&h&&(!Array.isArray(i.security)||i.security.length)?(h.forEach(function(e,t){for(var n in e){var r=d[n],o=m[n];if(r){var i=r.value||r,a=o.type;if(r)if("apiKey"===a)"query"===o.in&&(f.query[o.name]=i),"header"===o.in&&(f.headers[o.name]=i),"cookie"===o.in&&(f.cookies[o.name]=i);else if("http"===a){if("basic"===o.scheme){var u=i.username,s=i.password,l=(0,c.default)(u+":"+s);f.headers.Authorization="Basic "+l}"bearer"===o.scheme&&(f.headers.Authorization="Bearer "+i)}else if("oauth2"===a){var p=r.token||{},h=p.access_token,v=p.token_type;v&&"bearer"!==v.toLowerCase()||(v="Bearer"),f.headers.Authorization=v+" "+h}}}}),f):t}Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(8)),a=r(n(1)),u=r(n(0));t.default=function(e,t){var n=e.operation,r=e.requestBody,s=e.securities,l=e.spec,c=e.attachContentTypeForEmptyPayload,p=e.requestContentType;t=o({request:t,securities:s,operation:n,spec:l});var d=n.requestBody||{},h=(0,u.default)(d.content||{}),v=p&&h.indexOf(p)>-1;if(r||c){if(p&&v)t.headers["Content-Type"]=p;else if(!p){var m=h[0];m&&(t.headers["Content-Type"]=m,p=m)}}else p&&v&&(t.headers["Content-Type"]=p);return r&&(p?h.indexOf(p)>-1&&("application/x-www-form-urlencoded"===p||0===p.indexOf("multipart/")?"object"===(void 0===r?"undefined":(0,a.default)(r))?(t.form={},(0,u.default)(r).forEach(function(e){var n,o=r[e],u=void 0;"undefined"!=typeof File&&(u=o instanceof File),"undefined"!=typeof Blob&&(u=u||o instanceof Blob),void 0!==f.Buffer&&(u=u||f.Buffer.isBuffer(o)),n="object"!==(void 0===o?"undefined":(0,a.default)(o))||u?o:Array.isArray(o)?o.toString():(0,i.default)(o),t.form[e]={value:n}})):t.form=r:t.body=r):t.body=r),t},t.applySecurities=o;var s=r(n(6)),l=r(n(12)),c=r(n(13)),f=n(63)},function(e,t){e.exports=n(54)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,o=e.operation,s=void 0===o?{}:o,l=e.spec,c=(0,u.default)({},t),f=r.authorized,p=void 0===f?{}:f,d=r.specSecurity,h=void 0===d?[]:d,v=s.security||h,m=p&&!!(0,i.default)(p).length,g=l.securityDefinitions;return c.headers=c.headers||{},c.query=c.query||{},(0,i.default)(r).length&&m&&v&&(!Array.isArray(s.security)||s.security.length)?(v.forEach(function(e,t){for(var n in e){var r=p[n];if(r){var o=r.token,i=r.value||r,u=g[n],s=u.type,l=u["x-tokenName"]||"access_token",f=o&&o[l],d=o&&o.token_type;if(r)if("apiKey"===s){var h="query"===u.in?"query":"headers";c[h]=c[h]||{},c[h][u.name]=i}else"basic"===s?i.header?c.headers.authorization=i.header:(i.base64=(0,a.default)(i.username+":"+i.password),c.headers.authorization="Basic "+i.base64):"oauth2"===s&&f&&(d=d&&"bearer"!==d.toLowerCase()?d:"Bearer",c.headers.authorization=d+" "+f)}}}),c):t}Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(0));t.default=function(e,t){var n=e.spec,r=e.operation,i=e.securities,a=e.requestContentType,u=e.attachContentTypeForEmptyPayload;if((t=o({request:t,securities:i,operation:r,spec:n})).body||t.form||u)a?t.headers["Content-Type"]=a:Array.isArray(r.consumes)?t.headers["Content-Type"]=r.consumes[0]:Array.isArray(n.consumes)?t.headers["Content-Type"]=n.consumes[0]:r.parameters&&r.parameters.filter(function(e){return"file"===e.type}).length?t.headers["Content-Type"]="multipart/form-data":r.parameters&&r.parameters.filter(function(e){return"formData"===e.in}).length&&(t.headers["Content-Type"]="application/x-www-form-urlencoded");else if(a){var s=r.parameters&&r.parameters.filter(function(e){return"body"===e.in}).length>0,l=r.parameters&&r.parameters.filter(function(e){return"formData"===e.in}).length>0;(s||l)&&(t.headers["Content-Type"]=a)}return t},t.applySecurities=o;var a=r(n(13)),u=r(n(6));r(n(7))}])},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},t.merge=function(e,n,o){if(!n)return e;if("object"!=typeof n){if(Array.isArray(e))e.push(n);else{if("object"!=typeof e)return[e,n];(o.plainObjects||o.allowPrototypes||!r.call(Object.prototype,n))&&(e[n]=!0)}return e}if("object"!=typeof e)return[e].concat(n);var i=e;return Array.isArray(e)&&!Array.isArray(n)&&(i=t.arrayToObject(e,o)),Array.isArray(e)&&Array.isArray(n)?(n.forEach(function(n,i){r.call(e,i)?e[i]&&"object"==typeof e[i]?e[i]=t.merge(e[i],n,o):e.push(n):e[i]=n}),e):Object.keys(n).reduce(function(e,i){var a=n[i];return r.call(e,i)?e[i]=t.merge(e[i],a,o):e[i]=a,e},i)},t.assign=function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:String(e),n="",r=0;r<t.length;++r){var i=t.charCodeAt(r);45===i||46===i||95===i||126===i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?n+=t.charAt(r):i<128?n+=o[i]:i<2048?n+=o[192|i>>6]+o[128|63&i]:i<55296||i>=57344?n+=o[224|i>>12]+o[128|i>>6&63]+o[128|63&i]:(r+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(r)),n+=o[240|i>>18]+o[128|i>>12&63]+o[128|i>>6&63]+o[128|63&i])}return n},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],i=o.obj[o.prop],a=Object.keys(i),u=0;u<a.length;++u){var s=a[u],l=i[s];"object"==typeof l&&null!==l&&-1===n.indexOf(l)&&(t.push({obj:i,prop:s}),n.push(l))}return function(e){for(var t;e.length;){var n=e.pop();if(t=n.obj[n.prop],Array.isArray(t)){for(var r=[],o=0;o<t.length;++o)void 0!==t[o]&&r.push(t[o]);n.obj[n.prop]=r}}return t}(t)},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!==e&&void 0!==e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){var r=Array.prototype.slice,o=n(912),i=n(913),a=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:function(e,t,n){var l,c;if(u(e)||u(t))return!1;if(e.prototype!==t.prototype)return!1;if(i(e))return!!i(t)&&(e=r.call(e),t=r.call(t),a(e,t,n));if(s(e)){if(!s(t))return!1;if(e.length!==t.length)return!1;for(l=0;l<e.length;l++)if(e[l]!==t[l])return!1;return!0}try{var f=o(e),p=o(t)}catch(e){return!1}if(f.length!=p.length)return!1;for(f.sort(),p.sort(),l=f.length-1;l>=0;l--)if(f[l]!=p[l])return!1;for(l=f.length-1;l>=0;l--)if(c=f[l],!a(e[c],t[c],n))return!1;return typeof e==typeof t}(e,t,n))};function u(e){return null===e||void 0===e}function s(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}},function(e,t,n){var r={strict:!0},o=n(391),i=function(e,t){return o(e,t,r)},a=n(231);t.JsonPatchError=a.PatchError,t.deepClone=a._deepClone;var u={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=l(n,this.path);r&&(r=a._deepClone(r));var o=c(n,{op:"remove",path:this.from}).removed;return c(n,{op:"add",path:this.path,value:o}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=l(n,this.from);return c(n,{op:"add",path:this.path,value:a._deepClone(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:i(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},s={add:function(e,t,n){return a.isInteger(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:u.move,copy:u.copy,test:u.test,_get:u._get};function l(e,t){if(""==t)return e;var n={op:"_get",path:t};return c(e,n),n.value}function c(e,n,r,o){if(void 0===r&&(r=!1),void 0===o&&(o=!0),r&&("function"==typeof r?r(n,0,e,n.path):p(n,0)),""===n.path){var c={newDocument:e};if("add"===n.op)return c.newDocument=n.value,c;if("replace"===n.op)return c.newDocument=n.value,c.removed=e,c;if("move"===n.op||"copy"===n.op)return c.newDocument=l(e,n.from),"move"===n.op&&(c.removed=e),c;if("test"===n.op){if(c.test=i(e,n.value),!1===c.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",0,n,e);return c.newDocument=e,c}if("remove"===n.op)return c.removed=e,c.newDocument=null,c;if("_get"===n.op)return n.value=e,c;if(r)throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",0,n,e);return c}o||(e=a._deepClone(e));var f=(n.path||"").split("/"),d=e,h=1,v=f.length,m=void 0,g=void 0,y=void 0;for(y="function"==typeof r?r:p;;){if(g=f[h],r&&void 0===m&&(void 0===d[g]?m=f.slice(0,h).join("/"):h==v-1&&(m=n.path),void 0!==m&&y(n,0,e,m)),h++,Array.isArray(d)){if("-"===g)g=d.length;else{if(r&&!a.isInteger(g))throw new t.JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",0,n.path,n);a.isInteger(g)&&(g=~~g)}if(h>=v){if(r&&"add"===n.op&&g>d.length)throw new t.JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",0,n.path,n);if(!1===(c=s[n.op].call(n,d,g,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",0,n,e);return c}}else if(g&&-1!=g.indexOf("~")&&(g=a.unescapePathComponent(g)),h>=v){if(!1===(c=u[n.op].call(n,d,g,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",0,n,e);return c}d=d[g]}}function f(e,n,r,o){if(void 0===o&&(o=!0),r&&!Array.isArray(n))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");o||(e=a._deepClone(e));for(var i=new Array(n.length),u=0,s=n.length;u<s;u++)i[u]=c(e,n[u],r),e=i[u].newDocument;return i.newDocument=e,i}function p(e,n,r,o){if("object"!=typeof e||null===e||Array.isArray(e))throw new t.JsonPatchError("Operation is not an object","OPERATION_NOT_AN_OBJECT",n,e,r);if(!u[e.op])throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",n,e,r);if("string"!=typeof e.path)throw new t.JsonPatchError("Operation `path` property is not a string","OPERATION_PATH_INVALID",n,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new t.JsonPatchError('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",n,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new t.JsonPatchError("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",n,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",n,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&a.hasUndefined(e.value))throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",n,e,r);if(r)if("add"==e.op){var i=e.path.split("/").length,s=o.split("/").length;if(i!==s+1&&i!==s)throw new t.JsonPatchError("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",n,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==o)throw new t.JsonPatchError("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",n,e,r)}else if("move"===e.op||"copy"===e.op){var l=d([{op:"_get",path:e.from,value:void 0}],r);if(l&&"OPERATION_PATH_UNRESOLVABLE"===l.name)throw new t.JsonPatchError("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",n,e,r)}}function d(e,n,r){try{if(!Array.isArray(e))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(n)f(a._deepClone(n),a._deepClone(e),r||!0);else{r=r||p;for(var o=0;o<e.length;o++)r(e[o],o,n,void 0)}}catch(e){if(e instanceof t.JsonPatchError)return e;throw e}}t.getValueByPointer=l,t.applyOperation=c,t.applyPatch=f,t.applyReducer=function(e,n){var r=c(e,n);if(!1===r.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",0,n,e);return r.newDocument},t.validator=p,t.validate=d},function(e,t,n){var r=n(28);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(22));t.default=function(){return{afterLoad:function(e){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=e.authActions.configureAuth,this.rootInjects.preauthorizeApiKey=f.bind(null,e),this.rootInjects.preauthorizeBasic=c.bind(null,e)},statePlugins:{auth:{reducers:o.default,actions:i,selectors:a},spec:{wrapActions:u}}}},t.preauthorizeBasic=c,t.preauthorizeApiKey=f;var o=l(n(395)),i=s(n(233)),a=s(n(396)),u=s(n(397));function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t,n,o){var i=e.authActions.authorize,a=e.specSelectors,u=a.specJson,s=(0,a.isOAS3)()?["components","securitySchemes"]:["securityDefinitions"],l=u().getIn([].concat(s,[t]));return l?i((0,r.default)({},t,{value:{username:n,password:o},schema:l.toJS()})):null}function f(e,t,n){var o=e.authActions.authorize,i=e.specSelectors,a=i.specJson,u=(0,i.isOAS3)()?["components","securitySchemes"]:["securityDefinitions"],s=a().getIn([].concat(u,[t]));return s?o((0,r.default)({},t,{value:n,schema:s.toJS()})):null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=c(n(22)),i=c(n(23)),a=c(n(17)),u=n(7),s=n(9),l=n(233);function c(e){return e&&e.__esModule?e:{default:e}}t.default=(r={},(0,o.default)(r,l.SHOW_AUTH_POPUP,function(e,t){var n=t.payload;return e.set("showDefinitions",n)}),(0,o.default)(r,l.AUTHORIZE,function(e,t){var n=t.payload,r=(0,u.fromJS)(n),o=e.get("authorized")||(0,u.Map)();return r.entrySeq().forEach(function(e){var t=(0,a.default)(e,2),n=t[0],r=t[1],i=r.getIn(["schema","type"]);if("apiKey"===i||"http"===i)o=o.set(n,r);else if("basic"===i){var u=r.getIn(["value","username"]),l=r.getIn(["value","password"]);o=(o=o.setIn([n,"value"],{username:u,header:"Basic "+(0,s.btoa)(u+":"+l)})).setIn([n,"schema"],r.get("schema"))}}),e.set("authorized",o)}),(0,o.default)(r,l.AUTHORIZE_OAUTH2,function(e,t){var n=t.payload,r=n.auth,o=n.token,a=void 0;return r.token=(0,i.default)({},o),a=(0,u.fromJS)(r),e.setIn(["authorized",a.get("name")],a)}),(0,o.default)(r,l.LOGOUT,function(e,t){var n=t.payload,r=e.get("authorized").withMutations(function(e){n.forEach(function(t){e.delete(t)})});return e.set("authorized",r)}),(0,o.default)(r,l.CONFIGURE_AUTH,function(e,t){var n=t.payload;return e.set("configs",n)}),r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getConfigs=t.isAuthorized=t.authorized=t.definitionsForRequirements=t.getDefinitionsByNames=t.definitionsToAuthorize=t.shownDefinitions=void 0;var r=u(n(42)),o=u(n(17)),i=n(57),a=n(7);function u(e){return e&&e.__esModule?e:{default:e}}var s=function(e){return e};t.shownDefinitions=(0,i.createSelector)(s,function(e){return e.get("showDefinitions")}),t.definitionsToAuthorize=(0,i.createSelector)(s,function(){return function(e){var t=e.specSelectors.securityDefinitions()||(0,a.Map)({}),n=(0,a.List)();return t.entrySeq().forEach(function(e){var t=(0,o.default)(e,2),r=t[0],i=t[1],u=(0,a.Map)();u=u.set(r,i),n=n.push(u)}),n}}),t.getDefinitionsByNames=function(e,t){return function(e){var n=e.specSelectors;console.warn("WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.");var r=n.securityDefinitions(),i=(0,a.List)();return t.valueSeq().forEach(function(e){var t=(0,a.Map)();e.entrySeq().forEach(function(e){var n=(0,o.default)(e,2),i=n[0],a=n[1],u=r.get(i),s=void 0;"oauth2"===u.get("type")&&a.size&&((s=u.get("scopes")).keySeq().forEach(function(e){a.contains(e)||(s=s.delete(e))}),u=u.set("allowedScopes",s)),t=t.set(i,u)}),i=i.push(t)}),i}},t.definitionsForRequirements=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,a.List)();return function(e){return(e.authSelectors.definitionsToAuthorize()||(0,a.List)()).filter(function(e){return t.some(function(t){return t.get(e.keySeq().first())})})}},t.authorized=(0,i.createSelector)(s,function(e){return e.get("authorized")||(0,a.Map)()}),t.isAuthorized=function(e,t){return function(e){var n=e.authSelectors.authorized();return a.List.isList(t)?!!t.toJS().filter(function(e){return-1===(0,r.default)(e).map(function(e){return!!n.get(e)}).indexOf(!1)}).length:null}},t.getConfigs=(0,i.createSelector)(s,function(e){return e.get("configs")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.execute=void 0;var r,o=n(25),i=(r=o)&&r.__esModule?r:{default:r};t.execute=function(e,t){var n=t.authSelectors,r=t.specSelectors;return function(t){var o=t.path,a=t.method,u=t.operation,s=t.extras,l={authorized:n.authorized()&&n.authorized().toJS(),definitions:r.securityDefinitions()&&r.securityDefinitions().toJS(),specSecurity:r.security()&&r.security().toJS()};return e((0,i.default)({path:o,method:a,operation:u,securities:l},s))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{fn:{shallowEqualKeys:r.shallowEqualKeys}}};var r=n(9)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(41)),o=s(n(23));t.default=function(e){var t=e.fn,n={download:function(e){return function(n){var r=n.errActions,i=n.specSelectors,a=n.specActions,s=n.getConfigs,l=t.fetch,c=s();function f(t){if(t instanceof Error||t.status>=400)return a.updateLoadingStatus("failed"),r.newThrownErr((0,o.default)(new Error((t.message||t.statusText)+" "+e),{source:"fetch"})),void(!t.status&&t instanceof Error&&function(){try{var t=void 0;if("URL"in u.default?t=new URL(e):(t=document.createElement("a")).href=e,"https:"!==t.protocol&&"https:"===u.default.location.protocol){var n=(0,o.default)(new Error("Possible mixed-content issue? The page was loaded over https:// but a "+t.protocol+"// URL was specified. Check that you are not attempting to load mixed content."),{source:"fetch"});return void r.newThrownErr(n)}if(t.origin!==u.default.location.origin){var i=(0,o.default)(new Error("Possible cross-origin (CORS) issue? The URL origin ("+t.origin+") does not match the page ("+u.default.location.origin+"). Check the server returns the correct 'Access-Control-Allow-*' headers."),{source:"fetch"});r.newThrownErr(i)}}catch(e){return}}());a.updateLoadingStatus("success"),a.updateSpec(t.text),i.url()!==e&&a.updateUrl(e)}e=e||i.url(),a.updateLoadingStatus("loading"),r.clear({source:"fetch"}),l({url:e,loadSpec:!0,requestInterceptor:c.requestInterceptor||function(e){return e},responseInterceptor:c.responseInterceptor||function(e){return e},credentials:"same-origin",headers:{Accept:"application/json,*/*"}}).then(f,f)}},updateLoadingStatus:function(e){var t=[null,"loading","failed","success","failedConfig"];return-1===t.indexOf(e)&&console.error("Error: "+e+" is not one of "+(0,r.default)(t)),{type:"spec_update_loading_status",payload:e}}},s={loadingStatus:(0,i.createSelector)(function(e){return e||(0,a.Map)()},function(e){return e.get("loadingStatus")||null})};return{statePlugins:{spec:{actions:n,reducers:{spec_update_loading_status:function(e,t){return"string"==typeof t.payload?e.set("loadingStatus",t.payload):e}},selectors:s}}}};var i=n(57),a=n(7),u=s(n(32));function s(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{statePlugins:{spec:{actions:a,selectors:f},configs:{reducers:s.default,actions:i,selectors:u}}}};var r=c(n(934)),o=n(234),i=l(n(235)),a=l(n(401)),u=l(n(402)),s=c(n(403));function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function c(e){return e&&e.__esModule?e:{default:e}}var f={getLocalConfig:function(){return(0,o.parseYamlConfig)(r.default)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getConfigByUrl=t.downloadConfig=void 0;var r=n(234);t.downloadConfig=function(e){return function(t){return(0,t.fn.fetch)(e)}},t.getConfigByUrl=function(e,t){return function(n){var o=n.specActions;if(e)return o.downloadConfig(e).then(i,i);function i(n){n instanceof Error||n.status>=400?(o.updateLoadingStatus("failedConfig"),o.updateLoadingStatus("failedConfig"),o.updateUrl(""),console.error(n.statusText+" "+e.url),t(null)):t((0,r.parseYamlConfig)(n.text))}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.get=function(e,t){return e.getIn(Array.isArray(t)?t:[t])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,i=n(22),a=(r=i)&&r.__esModule?r:{default:r},u=n(7),s=n(235);t.default=(o={},(0,a.default)(o,s.UPDATE_CONFIGS,function(e,t){return e.merge((0,u.fromJS)(t.payload))}),(0,a.default)(o,s.TOGGLE_CONFIGS,function(e,t){var n=t.payload,r=e.get(n);return e.set(n,!r)}),o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return[r.default,{statePlugins:{configs:{wrapActions:{loaded:function(e,t){return function(){e.apply(void 0,arguments);var n=decodeURIComponent(window.location.hash);t.layoutActions.parseDeepLinkHash(n)}}}}},wrapComponents:{operation:o.default,OperationTag:i.default}}]};var r=a(n(405)),o=a(n(407)),i=a(n(408));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearScrollTo=t.scrollToElement=t.readyToScroll=t.parseDeepLinkHash=t.scrollTo=t.show=void 0;var r,o=f(n(22)),i=f(n(17)),a=n(406),u=f(n(935)),s=n(9),l=n(7),c=f(l);function f(e){return e&&e.__esModule?e:{default:e}}var p=t.show=function(e,t){var n=t.getConfigs,r=t.layoutSelectors;return function(){for(var t=arguments.length,o=Array(t),u=0;u<t;u++)o[u]=arguments[u];if(e.apply(void 0,o),n().deepLinking)try{var l=o[0],c=o[1];l=Array.isArray(l)?l:[l];var f=r.urlHashArrayFromIsShownKey(l);if(!f.length)return;var p=(0,i.default)(f,2),d=p[0],h=p[1];if(!c)return(0,a.setHash)("/");2===f.length?(0,a.setHash)((0,s.createDeepLinkPath)("/"+encodeURIComponent(d)+"/"+encodeURIComponent(h))):1===f.length&&(0,a.setHash)((0,s.createDeepLinkPath)("/"+encodeURIComponent(d)))}catch(e){console.error(e)}}},d=t.scrollTo=function(e){return{type:"layout_scroll_to",payload:Array.isArray(e)?e:[e]}},h=t.parseDeepLinkHash=function(e){return function(t){var n=t.layoutActions,r=t.layoutSelectors;if((0,t.getConfigs)().deepLinking&&e){var o=e.slice(1);"!"===o[0]&&(o=o.slice(1)),"/"===o[0]&&(o=o.slice(1));var a=o.split("/").map(function(e){return e||""}),u=r.isShownKeyFromUrlHashArray(a),s=(0,i.default)(u,3),l=s[0],c=s[1],f=void 0===c?"":c,p=s[2],d=void 0===p?"":p;if("operations"===l){var h=r.isShownKeyFromUrlHashArray([f]);f.indexOf("_")>-1&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),n.show(h.map(function(e){return e.replace(/_/g," ")}),!0)),n.show(h,!0)}(f.indexOf("_")>-1||d.indexOf("_")>-1)&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),n.show(u.map(function(e){return e.replace(/_/g," ")}),!0)),n.show(u,!0),n.scrollTo(u)}}},v=t.readyToScroll=function(e,t){return function(n){var r=n.layoutSelectors.getScrollToKey();c.default.is(r,(0,l.fromJS)(e))&&(n.layoutActions.scrollToElement(t),n.layoutActions.clearScrollTo())}},m=t.scrollToElement=function(e,t){return function(n){try{t=t||n.fn.getScrollParent(e),u.default.createScroller(t).to(e)}catch(e){console.error(e)}}},g=t.clearScrollTo=function(){return{type:"layout_clear_scroll"}};t.default={fn:{getScrollParent:function(e,t){var n=document.documentElement,r=getComputedStyle(e),o="absolute"===r.position,i=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===r.position)return n;for(var a=e;a=a.parentElement;)if(r=getComputedStyle(a),(!o||"static"!==r.position)&&i.test(r.overflow+r.overflowY+r.overflowX))return a;return n}},statePlugins:{layout:{actions:{scrollToElement:m,scrollTo:d,clearScrollTo:g,readyToScroll:v,parseDeepLinkHash:h},selectors:{getScrollToKey:function(e){return e.get("scrollToKey")},isShownKeyFromUrlHashArray:function(e,t){var n=(0,i.default)(t,2),r=n[0],o=n[1];return o?["operations",r,o]:r?["operations-tag",r]:[]},urlHashArrayFromIsShownKey:function(e,t){var n=(0,i.default)(t,3),r=n[0],o=n[1],a=n[2];return"operations"==r?[o,a]:"operations-tag"==r?[o]:[]}},reducers:(r={},(0,o.default)(r,"layout_scroll_to",function(e,t){return e.set("scrollToKey",c.default.fromJS(t.payload))}),(0,o.default)(r,"layout_clear_scroll",function(e){return e.delete("scrollToKey")}),r),wrapActions:{show:p}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.setHash=function(e){return e?history.pushState(null,null,"#"+e):window.location.hash=""}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(12));function l(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){return function(n){function l(){var e,n,i,u;(0,o.default)(this,l);for(var s=arguments.length,c=Array(s),f=0;f<s;f++)c[f]=arguments[f];return n=i=(0,a.default)(this,(e=l.__proto__||(0,r.default)(l)).call.apply(e,[this].concat(c))),i.onLoad=function(e){var n=i.props.operation.toObject(),r=["operations",n.tag,n.operationId];t.layoutActions.readyToScroll(r,e)},u=n,(0,a.default)(i,u)}return(0,u.default)(l,n),(0,i.default)(l,[{key:"render",value:function(){return s.default.createElement("span",{ref:this.onLoad},s.default.createElement(e,this.props))}}]),l}(s.default.Component)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));n(1);function l(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){return function(n){function l(){var e,n,i,u;(0,o.default)(this,l);for(var s=arguments.length,c=Array(s),f=0;f<s;f++)c[f]=arguments[f];return n=i=(0,a.default)(this,(e=l.__proto__||(0,r.default)(l)).call.apply(e,[this].concat(c))),i.onLoad=function(e){var n=["operations-tag",i.props.tag];t.layoutActions.readyToScroll(n,e)},u=n,(0,a.default)(i,u)}return(0,u.default)(l,n),(0,i.default)(l,[{key:"render",value:function(){return s.default.createElement("span",{ref:this.onLoad},s.default.createElement(e,this.props))}}]),l}(s.default.Component)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{fn:{opsFilter:i.default}}};var r,o=n(410),i=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return e.filter(function(e,n){return-1!==n.indexOf(t)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{statePlugins:{spec:{wrapActions:{updateSpec:function(e){return function(){return r=!0,e.apply(void 0,arguments)}},updateJsonSpec:function(e,t){return function(){var n=t.getConfigs().onComplete;return r&&"function"==typeof n&&(setTimeout(n,0),r=!1),e.apply(void 0,arguments)}}}}}}};var r=!1},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwcHgiICBoZWlnaHQ9IjIwMHB4IiAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiIGNsYXNzPSJsZHMtcm9sbGluZyIgc3R5bGU9ImJhY2tncm91bmQtaW1hZ2U6IG5vbmU7IGJhY2tncm91bmQtcG9zaXRpb246IGluaXRpYWwgaW5pdGlhbDsgYmFja2dyb3VuZC1yZXBlYXQ6IGluaXRpYWwgaW5pdGlhbDsiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIGZpbGw9Im5vbmUiIG5nLWF0dHItc3Ryb2tlPSJ7e2NvbmZpZy5jb2xvcn19IiBuZy1hdHRyLXN0cm9rZS13aWR0aD0ie3tjb25maWcud2lkdGh9fSIgbmctYXR0ci1yPSJ7e2NvbmZpZy5yYWRpdXN9fSIgbmctYXR0ci1zdHJva2UtZGFzaGFycmF5PSJ7e2NvbmZpZy5kYXNoYXJyYXl9fSIgc3Ryb2tlPSIjNTU1NTU1IiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij48YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgY2FsY01vZGU9ImxpbmVhciIgdmFsdWVzPSIwIDUwIDUwOzM2MCA1MCA1MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49IjBzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlVHJhbnNmb3JtPjwvY2lyY2xlPjwvc3ZnPgo="},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collapse=t.Link=t.Select=t.Input=t.TextArea=t.Button=t.Row=t.Col=t.Container=void 0;var r=f(n(25)),o=f(n(84)),i=f(n(4)),a=f(n(2)),u=f(n(3)),s=f(n(5)),l=f(n(6)),c=f(n(0));f(n(1));function f(e){return e&&e.__esModule?e:{default:e}}function p(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return!!e}).join(" ").trim()}t.Container=function(e){function t(){return(0,a.default)(this,t),(0,s.default)(this,(t.__proto__||(0,i.default)(t)).apply(this,arguments))}return(0,l.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e=this.props,t=e.fullscreen,n=e.full,i=(0,o.default)(e,["fullscreen","full"]);if(t)return c.default.createElement("section",i);var a="swagger-container"+(n?"-full":"");return c.default.createElement("section",(0,r.default)({},i,{className:p(i.className,a)}))}}]),t}(c.default.Component);var d={mobile:"",tablet:"-tablet",desktop:"-desktop",large:"-hd"};t.Col=function(e){function t(){return(0,a.default)(this,t),(0,s.default)(this,(t.__proto__||(0,i.default)(t)).apply(this,arguments))}return(0,l.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e=this.props,t=e.hide,n=e.keepContents,i=(e.mobile,e.tablet,e.desktop,e.large,(0,o.default)(e,["hide","keepContents","mobile","tablet","desktop","large"]));if(t&&!n)return c.default.createElement("span",null);var a=[];for(var u in d)if(d.hasOwnProperty(u)){var s=d[u];if(u in this.props){var l=this.props[u];if(l<1){a.push("none"+s);continue}a.push("block"+s),a.push("col-"+l+s)}}var f=p.apply(void 0,[i.className].concat(a));return c.default.createElement("section",(0,r.default)({},i,{style:{display:t?"none":null},className:f}))}}]),t}(c.default.Component),t.Row=function(e){function t(){return(0,a.default)(this,t),(0,s.default)(this,(t.__proto__||(0,i.default)(t)).apply(this,arguments))}return(0,l.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){return c.default.createElement("div",(0,r.default)({},this.props,{className:p(this.props.className,"wrapper")}))}}]),t}(c.default.Component);(t.Button=function(e){function t(){return(0,a.default)(this,t),(0,s.default)(this,(t.__proto__||(0,i.default)(t)).apply(this,arguments))}return(0,l.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){return c.default.createElement("button",(0,r.default)({},this.props,{className:p(this.props.className,"button")}))}}]),t}(c.default.Component)).defaultProps={className:""};t.TextArea=function(e){return c.default.createElement("textarea",e)},t.Input=function(e){return c.default.createElement("input",e)};(t.Select=function(e){function t(e,n){(0,a.default)(this,t);var r=(0,s.default)(this,(t.__proto__||(0,i.default)(t)).call(this,e,n));h.call(r);var o=void 0;return o=e.value?e.value:e.multiple?[""]:"",r.state={value:o},r}return(0,l.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e=this.props,t=e.allowedValues,n=e.multiple,r=e.allowEmptyValue,o=this.state.value.toJS?this.state.value.toJS():this.state.value;return c.default.createElement("select",{className:this.props.className,multiple:n,value:o,onChange:this.onChange},r?c.default.createElement("option",{value:""},"--"):null,t.map(function(e,t){return c.default.createElement("option",{key:t,value:String(e)},String(e))}))}}]),t}(c.default.Component)).defaultProps={multiple:!1,allowEmptyValue:!0};var h=function(){var e=this;this.onChange=function(t){var n=e.props,r=n.onChange,o=n.multiple,i=[].slice.call(t.target.options),a=void 0;a=o?i.filter(function(e){return e.selected}).map(function(e){return e.value}):t.target.value,e.setState({value:a}),r&&r(a)}},v=(t.Link=function(e){function t(){return(0,a.default)(this,t),(0,s.default)(this,(t.__proto__||(0,i.default)(t)).apply(this,arguments))}return(0,l.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){return c.default.createElement("a",(0,r.default)({},this.props,{rel:"noopener noreferrer",className:p(this.props.className,"link")}))}}]),t}(c.default.Component),function(e){var t=e.children;return c.default.createElement("div",{style:{height:"auto",border:"none",margin:0,padding:0}}," ",t," ")});(t.Collapse=function(e){function t(){return(0,a.default)(this,t),(0,s.default)(this,(t.__proto__||(0,i.default)(t)).apply(this,arguments))}return(0,l.default)(t,e),(0,u.default)(t,[{key:"renderNotAnimated",value:function(){return this.props.isOpened?c.default.createElement(v,null,this.props.children):c.default.createElement("noscript",null)}},{key:"render",value:function(){var e=this.props,t=e.animated,n=e.isOpened,r=e.children;return t?(r=n?r:null,c.default.createElement(v,null,r)):this.renderNotAnimated()}}]),t}(c.default.Component)).defaultProps={isOpened:!1,animated:!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(25)),o=d(n(4)),i=d(n(2)),a=d(n(3)),u=d(n(5)),s=d(n(6)),l=d(n(0)),c=d(n(990)),f=d(n(12)),p=d(n(1));function d(e){return e&&e.__esModule?e:{default:e}}var h=function(e){function t(){var e,n,r,a;(0,i.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=r=(0,u.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(l))),r.getModelName=function(e){return-1!==e.indexOf("#/definitions/")?e.replace(/^.*#\/definitions\//,""):-1!==e.indexOf("#/components/schemas/")?e.replace("#/components/schemas/",""):void 0},r.getRefSchema=function(e){return r.props.specSelectors.findDefinition(e)},a=n,(0,u.default)(r,a)}return(0,s.default)(t,e),(0,a.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,o=e.getConfigs,i=e.specSelectors,a=e.schema,u=e.required,s=e.name,c=e.isRef,f=e.specPath,p=e.displayName,d=t("ObjectModel"),h=t("ArrayModel"),v=t("PrimitiveModel"),m="object",g=a&&a.get("$$ref");if(!s&&g&&(s=this.getModelName(g)),!a&&g&&(a=this.getRefSchema(s)),!a)return l.default.createElement("span",{className:"model model-title"},l.default.createElement("span",{className:"model-title__text"},p||s),l.default.createElement("img",{src:n(412),height:"20px",width:"20px",style:{marginLeft:"1em",position:"relative",bottom:"0px"}}));var y=i.isOAS3()&&a.get("deprecated");switch(c=void 0!==c?c:!!g,m=a&&a.get("type")||m){case"object":return l.default.createElement(d,(0,r.default)({className:"object"},this.props,{specPath:f,getConfigs:o,schema:a,name:s,deprecated:y,isRef:c}));case"array":return l.default.createElement(h,(0,r.default)({className:"array"},this.props,{getConfigs:o,schema:a,name:s,deprecated:y,required:u}));case"string":case"number":case"integer":case"boolean":default:return l.default.createElement(v,(0,r.default)({},this.props,{getComponent:t,getConfigs:o,schema:a,name:s,deprecated:y,required:u}))}}}]),t}(c.default);h.propTypes={schema:f.default.orderedMap.isRequired,getComponent:p.default.func.isRequired,getConfigs:p.default.func.isRequired,specSelectors:p.default.object.isRequired,name:p.default.string,displayName:p.default.string,isRef:p.default.bool,required:p.default.bool,expandDepth:p.default.number,depth:p.default.number,specPath:f.default.list.isRequired},t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizer=l;var r=u(n(0)),o=(u(n(1)),u(n(416))),i=u(n(1053)),a=u(n(113));function u(e){return e&&e.__esModule?e:{default:e}}i.default.addHook("beforeSanitizeElements",function(e){return e.href&&e.setAttribute("rel","noopener noreferrer"),e});var s=function(e){return/^[A-Z\s0-9!?\.]+$/gi.test(e)};function l(e){return i.default.sanitize(e,{ADD_ATTR:["target"]})}t.default=function(e){var t=e.source,n=e.className,i=void 0===n?"":n;if(s(t))return r.default.createElement("div",{className:"markdown"},t);var u=new o.default({html:!0,typographer:!0,breaks:!0,linkify:!0,linkTarget:"_blank"}).render(t),c=l(u);return t&&u&&c?r.default.createElement("div",{className:(0,a.default)(i,"markdown"),dangerouslySetInnerHTML:{__html:c}}):null}},function(e,t,n){"use strict";e.exports=n(1002)},function(e,t,n){"use strict";e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",GT:">",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}},function(e,t,n){"use strict";var r=n(419),o=n(27).unescapeMd;e.exports=function(e,t){var n,i,a,u=t,s=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;t<s;){if(10===(n=e.src.charCodeAt(t)))return!1;if(62===n)return a=r(o(e.src.slice(u+1,t))),!!e.parser.validateLink(a)&&(e.pos=t+1,e.linkContent=a,!0);92===n&&t+1<s?t+=2:t++}return!1}for(i=0;t<s&&32!==(n=e.src.charCodeAt(t))&&!(n>8&&n<14);)if(92===n&&t+1<s)t+=2;else{if(40===n&&++i>1)break;if(41===n&&--i<0)break;t++}return u!==t&&(a=o(e.src.slice(u,t)),!!e.parser.validateLink(a)&&(e.linkContent=a,e.pos=t,!0))}},function(e,t,n){"use strict";var r=n(27).replaceEntities;e.exports=function(e){var t=r(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}},function(e,t,n){"use strict";var r=n(27).unescapeMd;e.exports=function(e,t){var n,o=t,i=e.posMax,a=e.src.charCodeAt(t);if(34!==a&&39!==a&&40!==a)return!1;for(t++,40===a&&(a=41);t<i;){if((n=e.src.charCodeAt(t))===a)return e.pos=t+1,e.linkContent=r(e.src.slice(o+1,t)),!0;92===n&&t+1<i?t+=2:t++}return!1}},function(e,t,n){"use strict";e.exports=function(e){return e.trim().replace(/\s+/g," ").toUpperCase()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{components:a.default,wrapComponents:u.default,statePlugins:{spec:{wrapSelectors:r,selectors:i},auth:{wrapSelectors:o},oas3:{actions:s,reducers:c.default,selectors:l}}}};var r=p(n(423)),o=p(n(424)),i=p(n(425)),a=f(n(426)),u=f(n(435)),s=p(n(237)),l=p(n(443)),c=f(n(444));function f(e){return e&&e.__esModule?e:{default:e}}function p(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSwagger2=t.isOAS3=t.servers=t.schemes=t.produces=t.consumes=t.basePath=t.host=t.securityDefinitions=t.hasHost=t.definitions=void 0;var r=n(57),o=n(144),i=n(7),a=n(35);function u(e){return function(t,n){return function(){var r=n.getSystem().specSelectors.specJson();return(0,a.isOAS3)(r)?e.apply(void 0,arguments):t.apply(void 0,arguments)}}}var s=function(e){return e||(0,i.Map)()},l=u((0,r.createSelector)(function(){return null})),c=(0,r.createSelector)(s,function(e){return e.get("json",(0,i.Map)())}),f=(0,r.createSelector)(s,function(e){return e.get("resolved",(0,i.Map)())}),p=function(e){var t=f(e);return t.count()<1&&(t=c(e)),t};t.definitions=u((0,r.createSelector)(p,function(e){var t=e.getIn(["components","schemas"]);return i.Map.isMap(t)?t:(0,i.Map)()})),t.hasHost=u(function(e){return p(e).hasIn(["servers",0])}),t.securityDefinitions=u((0,r.createSelector)(o.specJsonWithResolvedSubtrees,function(e){return e.getIn(["components","securitySchemes"])||null})),t.host=l,t.basePath=l,t.consumes=l,t.produces=l,t.schemes=l,t.servers=u((0,r.createSelector)(p,function(e){return e.getIn(["servers"])||(0,i.Map)()})),t.isOAS3=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return(0,a.isOAS3)(i.Map.isMap(e)?e:(0,i.Map)())}},t.isSwagger2=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return(0,a.isSwagger2)(i.Map.isMap(e)?e:(0,i.Map)())}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.definitionsToAuthorize=void 0;var r=s(n(22)),o=s(n(17)),i=n(57),a=n(7),u=n(35);function s(e){return e&&e.__esModule?e:{default:e}}var l;t.definitionsToAuthorize=(l=(0,i.createSelector)(function(e){return e},function(e){return e.specSelectors.securityDefinitions()},function(e,t){var n=(0,a.List)();return t?(t.entrySeq().forEach(function(e){var t=(0,o.default)(e,2),i=t[0],u=t[1],s=u.get("type");"oauth2"===s&&u.get("flows").entrySeq().forEach(function(e){var t=(0,o.default)(e,2),s=t[0],l=t[1],c=(0,a.fromJS)({flow:s,authorizationUrl:l.get("authorizationUrl"),tokenUrl:l.get("tokenUrl"),scopes:l.get("scopes"),type:u.get("type")});n=n.push(new a.Map((0,r.default)({},i,c.filter(function(e){return void 0!==e}))))}),"http"!==s&&"apiKey"!==s||(n=n.push(new a.Map((0,r.default)({},i,u))))}),n):n}),function(e,t){return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];var a=t.getSystem().specSelectors.specJson();return(0,u.isOAS3)(a)?l.apply(void 0,[t].concat(o)):e.apply(void 0,o)}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSwagger2=t.servers=void 0;var r=n(57),o=n(7),i=n(35);var a,u=function(e){return e||(0,o.Map)()},s=(0,r.createSelector)(u,function(e){return e.get("json",(0,o.Map)())}),l=(0,r.createSelector)(u,function(e){return e.get("resolved",(0,o.Map)())});t.servers=(a=(0,r.createSelector)(function(e){var t=l(e);return t.count()<1&&(t=s(e)),t},function(e){return e.getIn(["servers"])||(0,o.Map)()}),function(){return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=e.getSystem().specSelectors.specJson();return(0,i.isOAS3)(o)?a.apply(void 0,n):null}}),t.isSwagger2=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return(0,i.isSwagger2)(e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(427)),o=f(n(428)),i=f(n(429)),a=f(n(430)),u=f(n(431)),s=f(n(432)),l=f(n(433)),c=f(n(434));function f(e){return e&&e.__esModule?e:{default:e}}t.default={Callbacks:r.default,HttpAuth:l.default,RequestBody:o.default,Servers:a.default,ServersContainer:u.default,RequestBodyEditor:s.default,OperationServers:c.default,operationLink:i.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(25)),o=a(n(0)),i=(a(n(1)),a(n(12)),n(7));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.callbacks,n=e.getComponent,a=e.specPath,u=n("OperationContainer",!0);if(!t)return o.default.createElement("span",null,"No callbacks");var s=t.map(function(t,n){return o.default.createElement("div",{key:n},o.default.createElement("h2",null,n),t.map(function(t,s){return"$$ref"===s?null:o.default.createElement("div",{key:s},t.map(function(t,l){if("$$ref"===l)return null;var c=(0,i.fromJS)({operation:t});return o.default.createElement(u,(0,r.default)({},e,{op:c,key:l,tag:"",method:l,path:s,specPath:a.push(n,s,l),allowTryItOut:!1}))}))}))});return o.default.createElement("div",null,s)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),o=(a(n(1)),a(n(12)),n(7)),i=n(9);function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.requestBody,n=e.requestBodyValue,a=e.getComponent,u=e.getConfigs,s=e.specSelectors,l=e.fn,c=e.contentType,f=e.isExecute,p=e.specPath,d=e.onChange,h=a("Markdown"),v=a("modelExample"),m=a("RequestBodyEditor"),g=u().showCommonExtensions,y=t&&t.get("description")||null,b=t&&t.get("content")||new o.OrderedMap;c=c||b.keySeq().first();var _=b.get(c);if(!_)return null;var w="object"===_.getIn(["schema","type"]);if("application/octet-stream"===c||0===c.indexOf("image/")||0===c.indexOf("audio/")||0===c.indexOf("video/")){var E=a("Input");return f?r.default.createElement(E,{type:"file",onChange:function(e){d(e.target.files[0])}}):r.default.createElement("i",null,"Example values are not available for ",r.default.createElement("code",null,"application/octet-stream")," media types.")}if(w&&("application/x-www-form-urlencoded"===c||0===c.indexOf("multipart/"))){var x=a("JsonSchemaForm"),S=a("ParameterExt"),C=t.getIn(["content",c,"schema"],(0,o.OrderedMap)()),k=C.getIn(["properties"],(0,o.OrderedMap)());return n=o.Map.isMap(n)?n:(0,o.OrderedMap)(),r.default.createElement("div",{className:"table-container"},y&&r.default.createElement(h,{source:y}),r.default.createElement("table",null,r.default.createElement("tbody",null,k.map(function(e,t){var u=g?(0,i.getCommonExtensions)(e):null,s=C.get("required",(0,o.List)()).includes(t),c=e.get("type"),p=e.get("format"),v=e.get("description"),m=n.get(t),y=e.get("default")||e.get("example")||"";""===y&&"object"===c&&(y=(0,i.getSampleSchema)(e,!1,{includeWriteOnly:!0}));var b="string"===c&&("binary"===p||"base64"===p);return r.default.createElement("tr",{key:t,className:"parameters"},r.default.createElement("td",{className:"col parameters-col_name"},r.default.createElement("div",{className:s?"parameter__name required":"parameter__name"},t,s?r.default.createElement("span",{style:{color:"red"}}," *"):null),r.default.createElement("div",{className:"parameter__type"},c,p&&r.default.createElement("span",{className:"prop-format"},"($",p,")"),g&&u.size?u.map(function(e,t){return r.default.createElement(S,{key:t+"-"+e,xKey:t,xVal:e})}):null),r.default.createElement("div",{className:"parameter__deprecated"},e.get("deprecated")?"deprecated":null)),r.default.createElement("td",{className:"col parameters-col_description"},r.default.createElement(h,{source:v}),f?r.default.createElement("div",null,r.default.createElement(x,{fn:l,dispatchInitialValue:!b,schema:e,description:t,getComponent:a,value:void 0===m?y:m,onChange:function(e){d(e,[t])}})):null))}))))}return r.default.createElement("div",null,y&&r.default.createElement(h,{source:y}),r.default.createElement(v,{getComponent:a,getConfigs:u,specSelectors:s,expandDepth:1,isExecute:f,schema:_.get("schema"),specPath:p.push("content",c),example:r.default.createElement(m,{requestBody:t,onChange:d,mediaType:c,getComponent:a,isExecute:f,specSelectors:s})}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(41)),o=f(n(4)),i=f(n(2)),a=f(n(3)),u=f(n(5)),s=f(n(6)),l=n(0),c=f(l);f(n(1)),f(n(12));function f(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,s.default)(t,e),(0,a.default)(t,[{key:"render",value:function(){var e=this.props,t=e.link,n=e.name,o=(0,e.getComponent)("Markdown"),i=t.get("operationId")||t.get("operationRef"),a=t.get("parameters")&&t.get("parameters").toJS(),u=t.get("description");return c.default.createElement("div",{style:{marginBottom:"1.5em"}},c.default.createElement("div",{style:{marginBottom:".5em"}},c.default.createElement("b",null,c.default.createElement("code",null,n)),u?c.default.createElement(o,{source:u}):null),c.default.createElement("pre",null,"Operation `",i,"`",c.default.createElement("br",null),c.default.createElement("br",null),"Parameters ",function(e,t){if("string"!=typeof t)return"";return t.split("\n").map(function(t,n){return n>0?Array(e+1).join(" ")+t:t}).join("\n")}(0,(0,r.default)(a,null,2))||"{}",c.default.createElement("br",null)))}}]),t}(l.Component);t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(4)),o=c(n(2)),i=c(n(3)),a=c(n(5)),u=c(n(6)),s=c(n(0)),l=n(7);c(n(1)),c(n(12));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){var e,n,i,u;(0,o.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=i=(0,a.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),i.onServerChange=function(e){i.setServer(e.target.value)},i.onServerVariableValueChange=function(e){var t=i.props,n=t.setServerVariableValue,r=t.currentServer,o=e.target.getAttribute("data-variable"),a=e.target.value;"function"==typeof n&&n({server:r,key:o,val:a})},i.setServer=function(e){(0,i.props.setSelectedServer)(e)},u=n,(0,a.default)(i,u)}return(0,u.default)(t,e),(0,i.default)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.servers;e.currentServer||this.setServer(t.first().get("url"))}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.servers,r=t.setServerVariableValue,o=t.getServerVariable;if(this.props.currentServer!==e.currentServer){var i=n.find(function(t){return t.get("url")===e.currentServer});if(!i)return this.setServer(n.first().get("url"));(i.get("variables")||(0,l.OrderedMap)()).map(function(t,n){o(e.currentServer,n)||r({server:e.currentServer,key:n,val:t.get("default")||""})})}}},{key:"render",value:function(){var e=this,t=this.props,n=t.servers,r=t.currentServer,o=t.getServerVariable,i=t.getEffectiveServerValue,a=(n.find(function(e){return e.get("url")===r})||(0,l.OrderedMap)()).get("variables")||(0,l.OrderedMap)(),u=0!==a.size;return s.default.createElement("div",{className:"servers"},s.default.createElement("label",{htmlFor:"servers"},s.default.createElement("select",{onChange:this.onServerChange},n.valueSeq().map(function(e){return s.default.createElement("option",{value:e.get("url"),key:e.get("url")},e.get("url"),e.get("description")&&" - "+e.get("description"))}).toArray())),u?s.default.createElement("div",null,s.default.createElement("div",{className:"computed-url"},"Computed URL:",s.default.createElement("code",null,i(r))),s.default.createElement("h4",null,"Server variables"),s.default.createElement("table",null,s.default.createElement("tbody",null,a.map(function(t,n){return s.default.createElement("tr",{key:n},s.default.createElement("td",null,n),s.default.createElement("td",null,t.get("enum")?s.default.createElement("select",{"data-variable":n,onChange:e.onServerVariableValueChange},t.get("enum").map(function(e){return s.default.createElement("option",{selected:e===o(r,n),key:e,value:e},e)})):s.default.createElement("input",{type:"text",value:o(r,n)||"",onChange:e.onServerVariableValueChange,"data-variable":n})))})))):null)}}]),t}(s.default.Component);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.oas3Selectors,r=e.oas3Actions,o=e.getComponent,i=t.servers(),a=o("Servers");return i&&i.size?s.default.createElement("div",null,s.default.createElement("span",{className:"servers-title"},"Servers"),s.default.createElement(a,{servers:i,currentServer:n.selectedServer(),setSelectedServer:r.setSelectedServer,setServerVariableValue:r.setServerVariableValue,getServerVariable:n.serverVariableValue,getEffectiveServerValue:n.serverEffectiveValue})):null}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(4)),o=p(n(2)),i=p(n(3)),a=p(n(5)),u=p(n(6)),s=n(0),l=p(s),c=(p(n(1)),n(7)),f=n(9);function p(e){return e&&e.__esModule?e:{default:e}}var d=Function.prototype,h=function(e){function t(e,n){(0,o.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,r.default)(t)).call(this,e,n));return i.setValueToSample=function(e){i.onChange(i.sample(e))},i.resetValueToSample=function(e){i.setState({userDidModify:!1}),i.setValueToSample(e)},i.sample=function(e){var t=i.props,n=t.requestBody,r=t.mediaType,o=n.getIn(["content",e||r]),a=o.get("schema").toJS();return(void 0!==o.get("example")?(0,f.stringify)(o.get("example")):null)||(0,f.getSampleSchema)(a,e||r,{includeWriteOnly:!0})},i.onChange=function(e){i.setState({value:e}),i.props.onChange(e)},i.handleOnChange=function(e){var t=i.props.mediaType,n=/json/i.test(t)?e.target.value.trim():e.target.value;i.setState({userDidModify:!0}),i.onChange(n)},i.toggleIsEditBox=function(){return i.setState(function(e){return{isEditBox:!e.isEditBox}})},i.state={isEditBox:!1,userDidModify:!1,value:""},i}return(0,u.default)(t,e),(0,i.default)(t,[{key:"componentDidMount",value:function(){this.setValueToSample.call(this)}},{key:"componentWillReceiveProps",value:function(e){this.props.mediaType!==e.mediaType&&this.setValueToSample(e.mediaType),!this.props.isExecute&&e.isExecute&&this.setState({isEditBox:!0})}},{key:"componentDidUpdate",value:function(e){this.props.requestBody!==e.requestBody&&this.setValueToSample(this.props.mediaType)}},{key:"render",value:function(){var e=this,t=this.props,n=t.isExecute,r=t.getComponent,o=t.mediaType,i=r("Button"),a=r("TextArea"),u=r("highlightCode"),s=this.state,c=s.value,f=s.isEditBox,p=s.userDidModify;return l.default.createElement("div",{className:"body-param"},f&&n?l.default.createElement(a,{className:"body-param__text",value:c,onChange:this.handleOnChange}):c&&l.default.createElement(u,{className:"body-param__example",value:c}),l.default.createElement("div",{className:"body-param-options"},l.default.createElement("div",{className:"body-param-edit"},n?l.default.createElement(i,{className:f?"btn cancel body-param__example-edit":"btn edit body-param__example-edit",onClick:this.toggleIsEditBox},f?"Cancel":"Edit"):null,p&&l.default.createElement(i,{className:"btn ml3",onClick:function(){e.resetValueToSample(o)}},"Reset"))))}}]),t}(s.PureComponent);h.defaultProps={mediaType:"application/json",requestBody:(0,c.fromJS)({}),onChange:d},t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(23)),o=c(n(4)),i=c(n(2)),a=c(n(3)),u=c(n(5)),s=c(n(6)),l=c(n(0));c(n(1));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(e,n){(0,i.default)(this,t);var r=(0,u.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));p.call(r);var a=r.props,s=a.name,l=a.schema,c=r.getValue();return r.state={name:s,schema:l,value:c},r}return(0,s.default)(t,e),(0,a.default)(t,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.errSelectors,o=e.name,i=n("Input"),a=n("Row"),u=n("Col"),s=n("authError"),c=n("Markdown"),f=n("JumpToPath",!0),p=(t.get("scheme")||"").toLowerCase(),d=this.getValue(),h=r.allErrors().filter(function(e){return e.get("authId")===o});if("basic"===p){var v=d?d.get("username"):null;return l.default.createElement("div",null,l.default.createElement("h4",null,l.default.createElement("code",null,o||t.get("name"))," (http, Basic)",l.default.createElement(f,{path:["securityDefinitions",o]})),v&&l.default.createElement("h6",null,"Authorized"),l.default.createElement(a,null,l.default.createElement(c,{source:t.get("description")})),l.default.createElement(a,null,l.default.createElement("label",null,"Username:"),v?l.default.createElement("code",null," ",v," "):l.default.createElement(u,null,l.default.createElement(i,{type:"text",required:"required",name:"username",onChange:this.onChange}))),l.default.createElement(a,null,l.default.createElement("label",null,"Password:"),v?l.default.createElement("code",null," ****** "):l.default.createElement(u,null,l.default.createElement(i,{required:"required",autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),h.valueSeq().map(function(e,t){return l.default.createElement(s,{error:e,key:t})}))}return"bearer"===p?l.default.createElement("div",null,l.default.createElement("h4",null,l.default.createElement("code",null,o||t.get("name"))," (http, Bearer)",l.default.createElement(f,{path:["securityDefinitions",o]})),d&&l.default.createElement("h6",null,"Authorized"),l.default.createElement(a,null,l.default.createElement(c,{source:t.get("description")})),l.default.createElement(a,null,l.default.createElement("label",null,"Value:"),d?l.default.createElement("code",null," ****** "):l.default.createElement(u,null,l.default.createElement(i,{type:"text",onChange:this.onChange}))),h.valueSeq().map(function(e,t){return l.default.createElement(s,{error:e,key:t})})):l.default.createElement("div",null,l.default.createElement("em",null,l.default.createElement("b",null,o)," HTTP authentication: unsupported scheme ","'"+p+"'"))}}]),t}(l.default.Component),p=function(){var e=this;this.onChange=function(t){var n=e.props.onChange,o=t.target,i=o.value,a=o.name,u=(0,r.default)({},e.state.value);a?u[a]=i:u=i,e.setState({value:u},function(){return n(e.state)})}};t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(25)),o=c(n(4)),i=c(n(2)),a=c(n(3)),u=c(n(5)),s=c(n(6)),l=c(n(0));c(n(1)),c(n(12));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){var e,n,a,s;(0,i.default)(this,t);for(var l=arguments.length,c=Array(l),f=0;f<l;f++)c[f]=arguments[f];return n=a=(0,u.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(c))),a.setSelectedServer=function(e){var t=a.props,n=t.path,r=t.method;return a.forceUpdate(),a.props.setSelectedServer(e,n+":"+r)},a.setServerVariableValue=function(e){var t=a.props,n=t.path,o=t.method;return a.forceUpdate(),a.props.setServerVariableValue((0,r.default)({},e,{namespace:n+":"+o}))},a.getSelectedServer=function(){var e=a.props,t=e.path,n=e.method;return a.props.getSelectedServer(t+":"+n)},a.getServerVariable=function(e,t){var n=a.props,r=n.path,o=n.method;return a.props.getServerVariable({namespace:r+":"+o,server:e},t)},a.getEffectiveServerValue=function(e){var t=a.props,n=t.path,r=t.method;return a.props.getEffectiveServerValue({server:e,namespace:n+":"+r})},s=n,(0,u.default)(a,s)}return(0,s.default)(t,e),(0,a.default)(t,[{key:"render",value:function(){var e=this.props,t=e.operationServers,n=e.pathServers,r=e.getComponent;if(!t&&!n)return null;var o=r("Servers"),i=t||n,a=t?"operation":"path";return l.default.createElement("div",{className:"opblock-section operation-servers"},l.default.createElement("div",{className:"opblock-section-header"},l.default.createElement("div",{className:"tab-header"},l.default.createElement("h4",{className:"opblock-title"},"Servers"))),l.default.createElement("div",{className:"opblock-description-wrapper"},l.default.createElement("h4",{className:"message"},"These ",a,"-level options override the global server options."),l.default.createElement(o,{servers:i,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}]),t}(l.default.Component);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(436)),o=c(n(437)),i=c(n(438)),a=c(n(439)),u=c(n(440)),s=c(n(441)),l=c(n(442));function c(e){return e&&e.__esModule?e:{default:e}}t.default={Markdown:r.default,AuthItem:o.default,parameters:i.default,JsonSchema_string:l.default,VersionStamp:a.default,model:s.default,onlineValidatorBadge:u.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Markdown=void 0;var r=s(n(0)),o=(s(n(1)),s(n(113))),i=s(n(416)),a=n(35),u=n(415);function s(e){return e&&e.__esModule?e:{default:e}}var l=new i.default("commonmark");l.set({linkTarget:"_blank"});var c=t.Markdown=function(e){var t=e.source,n=e.className,i=void 0===n?"":n;if(t){var a=l.render(t),s=(0,u.sanitizer)(a),c=void 0;return"string"==typeof s&&(c=s.trim()),r.default.createElement("div",{dangerouslySetInnerHTML:{__html:c},className:(0,o.default)(i,"renderedMarkdown")})}return null};t.default=(0,a.OAS3ComponentWrapFactory)(c)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(84)),o=a(n(0)),i=n(35);function a(e){return e&&e.__esModule?e:{default:e}}t.default=(0,i.OAS3ComponentWrapFactory)(function(e){var t=e.Ori,n=(0,r.default)(e,["Ori"]),i=n.schema,a=n.getComponent,u=n.errSelectors,s=n.authorized,l=n.onAuthChange,c=n.name,f=a("HttpAuth");return"http"===i.get("type")?o.default.createElement(f,{key:c,schema:i,name:c,errSelectors:u,authorized:s,getComponent:a,onChange:l}):o.default.createElement(t,n)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(83)),o=h(n(4)),i=h(n(2)),a=h(n(3)),u=h(n(5)),s=h(n(6)),l=n(0),c=h(l),f=(h(n(1)),n(7)),p=h(f),d=(h(n(12)),n(35));function h(e){return e&&e.__esModule?e:{default:e}}var v=function(e){function t(e){(0,i.default)(this,t);var n=(0,u.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e));return n.onChange=function(e,t,r){var o=n.props;(0,o.specActions.changeParamByIdentity)(o.onChangeKey,e,t,r)},n.onChangeConsumesWrapper=function(e){var t=n.props;(0,t.specActions.changeConsumesValue)(t.onChangeKey,e)},n.toggleTab=function(e){return"parameters"===e?n.setState({parametersVisible:!0,callbackVisible:!1}):"callbacks"===e?n.setState({callbackVisible:!0,parametersVisible:!1}):void 0},n.state={callbackVisible:!1,parametersVisible:!0},n}return(0,s.default)(t,e),(0,a.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.onTryoutClick,o=t.onCancelClick,i=t.parameters,a=t.allowTryItOut,u=t.tryItOutEnabled,s=t.fn,l=t.getComponent,d=t.getConfigs,h=t.specSelectors,v=t.specActions,m=t.oas3Actions,g=t.oas3Selectors,y=t.pathMethod,b=t.specPath,_=t.operation,w=l("parameterRow"),E=l("TryItOutButton"),x=l("contentType"),S=l("Callbacks",!0),C=l("RequestBody",!0),k=u&&a,A=h.isOAS3,O=_.get("requestBody"),P=b.slice(0,-1).push("requestBody");return c.default.createElement("div",{className:"opblock-section"},c.default.createElement("div",{className:"opblock-section-header"},c.default.createElement("div",{className:"tab-header"},c.default.createElement("div",{onClick:function(){return e.toggleTab("parameters")},className:"tab-item "+(this.state.parametersVisible&&"active")},c.default.createElement("h4",{className:"opblock-title"},c.default.createElement("span",null,"Parameters"))),_.get("callbacks")?c.default.createElement("div",{onClick:function(){return e.toggleTab("callbacks")},className:"tab-item "+(this.state.callbackVisible&&"active")},c.default.createElement("h4",{className:"opblock-title"},c.default.createElement("span",null,"Callbacks"))):null),a?c.default.createElement(E,{enabled:u,onCancelClick:o,onTryoutClick:n}):null),this.state.parametersVisible?c.default.createElement("div",{className:"parameters-container"},i.count()?c.default.createElement("div",{className:"table-container"},c.default.createElement("table",{className:"parameters"},c.default.createElement("thead",null,c.default.createElement("tr",null,c.default.createElement("th",{className:"col col_header parameters-col_name"},"Name"),c.default.createElement("th",{className:"col col_header parameters-col_description"},"Description"))),c.default.createElement("tbody",null,function(e,t){return e.valueSeq().filter(p.default.Map.isMap).map(t)}(i,function(t,n){return c.default.createElement(w,{fn:s,getComponent:l,specPath:b.push(n),getConfigs:d,rawParam:t,param:h.parameterWithMetaByIdentity(y,t),key:t.get("name"),onChange:e.onChange,onChangeConsumes:e.onChangeConsumesWrapper,specSelectors:h,specActions:v,pathMethod:y,isExecute:k})}).toArray()))):c.default.createElement("div",{className:"opblock-description-wrapper"},c.default.createElement("p",null,"No parameters"))):"",this.state.callbackVisible?c.default.createElement("div",{className:"callbacks-container opblock-description-wrapper"},c.default.createElement(S,{callbacks:(0,f.Map)(_.get("callbacks")),specPath:b.slice(0,-1).push("callbacks")})):"",A()&&O&&this.state.parametersVisible&&c.default.createElement("div",{className:"opblock-section"},c.default.createElement("div",{className:"opblock-section-header"},c.default.createElement("h4",{className:"opblock-title parameter__name "+(O.get("required")&&"required")},"Request body"),c.default.createElement("label",null,c.default.createElement(x,{value:g.requestContentType.apply(g,(0,r.default)(y)),contentTypes:O.get("content",(0,f.List)()).keySeq(),onChange:function(e){m.setRequestContentType({value:e,pathMethod:y})},className:"body-param-content-type"}))),c.default.createElement("div",{className:"opblock-description-wrapper"},c.default.createElement(C,{specPath:P,requestBody:O,requestBodyValue:g.requestBodyValue.apply(g,(0,r.default)(y))||(0,f.Map)(),isExecute:k,onChange:function(e,t){if(t){var n=g.requestBodyValue.apply(g,(0,r.default)(y)),o=f.Map.isMap(n)?n:(0,f.Map)();return m.setRequestBodyValue({pathMethod:y,value:o.setIn(t,e)})}m.setRequestBodyValue({value:e,pathMethod:y})},contentType:g.requestContentType.apply(g,(0,r.default)(y))}))))}}]),t}(l.Component);v.defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[]},t.default=(0,d.OAS3ComponentWrapFactory)(v)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r},a=n(35);t.default=(0,a.OAS3ComponentWrapFactory)(function(e){var t=e.Ori;return i.default.createElement("span",null,i.default.createElement(t,e),i.default.createElement("small",{style:{backgroundColor:"#89bf04"}},i.default.createElement("pre",{className:"version"},"OAS3")))})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(35);t.default=(0,r.OAS3ComponentWrapFactory)(function(){return null})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(25)),o=d(n(4)),i=d(n(2)),a=d(n(3)),u=d(n(5)),s=d(n(6)),l=n(0),c=d(l),f=(d(n(1)),n(35)),p=n(414);function d(e){return e&&e.__esModule?e:{default:e}}var h=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,s.default)(t,e),(0,a.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getConfigs,n=["model-box"],o=null;return!0===e.schema.get("deprecated")&&(n.push("deprecated"),o=c.default.createElement("span",{className:"model-deprecated-warning"},"Deprecated:")),c.default.createElement("div",{className:n.join(" ")},o,c.default.createElement(p.Model,(0,r.default)({},this.props,{getConfigs:t,depth:1,expandDepth:this.props.expandDepth||0})))}}]),t}(l.Component);t.default=(0,f.OAS3ComponentWrapFactory)(h)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(84)),o=a(n(0)),i=n(35);function a(e){return e&&e.__esModule?e:{default:e}}t.default=(0,i.OAS3ComponentWrapFactory)(function(e){var t=e.Ori,n=(0,r.default)(e,["Ori"]),i=n.schema,a=n.getComponent,u=n.errors,s=n.onChange,l=i.type,c=i.format,f=a("Input");return"string"!==l||"binary"!==c&&"base64"!==c?o.default.createElement(t,n):o.default.createElement(f,{type:"file",className:u.length?"invalid":"",title:u.length?u:"",onChange:function(e){s(e.target.files[0])},disabled:t.isDisabled})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serverEffectiveValue=t.serverVariables=t.serverVariableValue=t.responseContentType=t.requestContentType=t.requestBodyValue=t.selectedServer=void 0;var r=n(7),o=n(35);function i(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(t){var r=t.getSystem().specSelectors.specJson();return(0,o.isOAS3)(r)?e.apply(void 0,n):null}}}t.selectedServer=i(function(e,t){var n=t?[t,"selectedServer"]:["selectedServer"];return e.getIn(n)||""}),t.requestBodyValue=i(function(e,t,n){return e.getIn(["requestData",t,n,"bodyValue"])||null}),t.requestContentType=i(function(e,t,n){return e.getIn(["requestData",t,n,"requestContentType"])||null}),t.responseContentType=i(function(e,t,n){return e.getIn(["requestData",t,n,"responseContentType"])||null}),t.serverVariableValue=i(function(e,t,n){var r=void 0;if("string"!=typeof t){var o=t.server,i=t.namespace;r=i?[i,"serverVariableValues",o,n]:["serverVariableValues",o,n]}else{r=["serverVariableValues",t,n]}return e.getIn(r)||null}),t.serverVariables=i(function(e,t){var n=void 0;if("string"!=typeof t){var o=t.server,i=t.namespace;n=i?[i,"serverVariableValues",o]:["serverVariableValues",o]}else{n=["serverVariableValues",t]}return e.getIn(n)||(0,r.OrderedMap)()}),t.serverEffectiveValue=i(function(e,t){var n,o;if("string"!=typeof t){var i=t.server,a=t.namespace;o=i,n=a?e.getIn([a,"serverVariableValues",o]):e.getIn(["serverVariableValues",o])}else o=t,n=e.getIn(["serverVariableValues",o]);var u=o;return(n=n||(0,r.OrderedMap)()).map(function(e,t){u=u.replace(new RegExp("{"+t+"}","g"),e)}),u})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=u(n(22)),i=u(n(17)),a=n(237);function u(e){return e&&e.__esModule?e:{default:e}}t.default=(r={},(0,o.default)(r,a.UPDATE_SELECTED_SERVER,function(e,t){var n=t.payload,r=n.selectedServerUrl,o=n.namespace,i=o?[o,"selectedServer"]:["selectedServer"];return e.setIn(i,r)}),(0,o.default)(r,a.UPDATE_REQUEST_BODY_VALUE,function(e,t){var n=t.payload,r=n.value,o=n.pathMethod,a=(0,i.default)(o,2),u=a[0],s=a[1];return e.setIn(["requestData",u,s,"bodyValue"],r)}),(0,o.default)(r,a.UPDATE_REQUEST_CONTENT_TYPE,function(e,t){var n=t.payload,r=n.value,o=n.pathMethod,a=(0,i.default)(o,2),u=a[0],s=a[1];return e.setIn(["requestData",u,s,"requestContentType"],r)}),(0,o.default)(r,a.UPDATE_RESPONSE_CONTENT_TYPE,function(e,t){var n=t.payload,r=n.value,o=n.path,i=n.method;return e.setIn(["requestData",o,i,"responseContentType"],r)}),(0,o.default)(r,a.UPDATE_SERVER_VARIABLE_VALUE,function(e,t){var n=t.payload,r=n.server,o=n.namespace,i=n.key,a=n.val,u=o?[o,"serverVariableValues",r,i]:["serverVariableValues",r,i];return e.setIn(u,a)}),r)},function(e,t,n){"use strict";var r=n(9),o=n(1059);o.keys().forEach(function(t){if("./index.js"!==t){var n=o(t);e.exports[(0,r.pascalCaseFilename)(t)]=n.default?n.default:n}})},function(e,t,n){n(447),e.exports=n(516)},function(e,t,n){"use strict";var r,o=n(32);void 0===((r=o)&&r.__esModule?r:{default:r}).default.Promise&&n(458),String.prototype.startsWith||n(487)},function(e,t,n){n(92),n(98),e.exports=n(457)},function(e,t,n){"use strict";var r=n(450),o=n(451),i=n(70),a=n(71);e.exports=n(238)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r=n(160),o=n(95),i=n(97),a={};n(50)(a,n(19)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(40),o=n(36),i=n(96);e.exports=n(44)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),u=a.length,s=0;u>s;)r.f(e,n=a[s++],t[n]);return e}},function(e,t,n){var r=n(71),o=n(115),i=n(455);e.exports=function(e){return function(t,n,a){var u,s=r(t),l=o(s.length),c=i(a,l);if(e&&n!=n){for(;l>c;)if((u=s[c++])!=u)return!0}else for(;l>c;c++)if((e||c in s)&&s[c]===n)return e||c||0;return!e&&-1}}},function(e,t,n){var r=n(161),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(161),o=n(156);e.exports=function(e){return function(t,n){var i,a,u=String(o(t)),s=r(n),l=u.length;return s<0||s>=l?e?"":void 0:(i=u.charCodeAt(s))<55296||i>56319||s+1===l||(a=u.charCodeAt(s+1))<56320||a>57343?e?u.charAt(s):i:e?u.slice(s,s+2):a-56320+(i-55296<<10)+65536}}},function(e,t,n){var r=n(36),o=n(165);e.exports=n(15).getIterator=function(e){var t=o(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t,n){n(459),n(245),n(470),n(474),n(485),n(486),e.exports=n(60).Promise},function(e,t,n){"use strict";var r=n(167),o={};o[n(18)("toStringTag")]="z",o+""!="[object z]"&&n(73)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){e.exports=!n(100)&&!n(101)(function(){return 7!=Object.defineProperty(n(169)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(74);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){"use strict";var r=n(463),o=n(244),i=n(171),a={};n(58)(a,n(18)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(59),o=n(464),i=n(251),a=n(170)("IE_PROTO"),u=function(){},s=function(){var e,t=n(169)("iframe"),r=i.length;for(t.style.display="none",n(252).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),s=e.F;r--;)delete s.prototype[i[r]];return s()};e.exports=Object.create||function(e,t){var n;return null!==e?(u.prototype=r(e),n=new u,u.prototype=null,n[a]=e):n=s(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(117),o=n(59),i=n(249);e.exports=n(100)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),u=a.length,s=0;u>s;)r.f(e,n=a[s++],t[n]);return e}},function(e,t,n){var r=n(118),o=n(122),i=n(467)(!1),a=n(170)("IE_PROTO");e.exports=function(e,t){var n,u=o(e),s=0,l=[];for(n in u)n!=a&&r(u,n)&&l.push(n);for(;t.length>s;)r(u,n=t[s++])&&(~i(l,n)||l.push(n));return l}},function(e,t,n){var r=n(99);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(122),o=n(103),i=n(250);e.exports=function(e){return function(t,n,a){var u,s=r(t),l=o(s.length),c=i(a,l);if(e&&n!=n){for(;l>c;)if((u=s[c++])!=u)return!0}else for(;l>c;c++)if((e||c in s)&&s[c]===n)return e||c||0;return!e&&-1}}},function(e,t,n){var r=n(118),o=n(469),i=n(170)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(53);e.exports=function(e){return Object(r(e))}},function(e,t,n){for(var r=n(471),o=n(249),i=n(73),a=n(33),u=n(58),s=n(102),l=n(18),c=l("iterator"),f=l("toStringTag"),p=s.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=o(d),v=0;v<h.length;v++){var m,g=h[v],y=d[g],b=a[g],_=b&&b.prototype;if(_&&(_[c]||u(_,c,p),_[f]||u(_,f,g),s[g]=p,y))for(m in r)_[m]||i(_,m,r[m],!0)}},function(e,t,n){"use strict";var r=n(472),o=n(473),i=n(102),a=n(122);e.exports=n(247)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(18)("unscopables"),o=Array.prototype;void 0==o[r]&&n(58)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r,o,i,a,u=n(248),s=n(33),l=n(120),c=n(167),f=n(29),p=n(74),d=n(121),h=n(475),v=n(476),m=n(253),g=n(254).set,y=n(481)(),b=n(172),_=n(255),w=n(256),E=s.TypeError,x=s.process,S=s.Promise,C="process"==c(x),k=function(){},A=o=b.f,O=!!function(){try{var e=S.resolve(1),t=(e.constructor={})[n(18)("species")]=function(e){e(k,k)};return(C||"function"==typeof PromiseRejectionEvent)&&e.then(k)instanceof t}catch(e){}}(),P=function(e){var t;return!(!p(e)||"function"!=typeof(t=e.then))&&t},T=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,u=o?t.ok:t.fail,s=t.resolve,l=t.reject,c=t.domain;try{u?(o||(2==e._h&&j(e),e._h=1),!0===u?n=r:(c&&c.enter(),n=u(r),c&&(c.exit(),a=!0)),n===t.promise?l(E("Promise-chain cycle")):(i=P(n))?i.call(n,s,l):s(n)):l(r)}catch(e){c&&!a&&c.exit(),l(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&M(e)})}},M=function(e){g.call(s,function(){var t,n,r,o=e._v,i=I(e);if(i&&(t=_(function(){C?x.emit("unhandledRejection",o,e):(n=s.onunhandledrejection)?n({promise:e,reason:o}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=C||I(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},I=function(e){return 1!==e._h&&0===(e._a||e._c).length},j=function(e){g.call(s,function(){var t;C?x.emit("rejectionHandled",e):(t=s.onrejectionhandled)&&t({promise:e,reason:e._v})})},N=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),T(t,!0))},R=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw E("Promise can't be resolved itself");(t=P(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,l(R,r,1),l(N,r,1))}catch(e){N.call(r,e)}}):(n._v=e,n._s=1,T(n,!1))}catch(e){N.call({_w:n,_d:!1},e)}}};O||(S=function(e){h(this,S,"Promise","_h"),d(e),r.call(this);try{e(l(R,this,1),l(N,this,1))}catch(e){N.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(482)(S.prototype,{then:function(e,t){var n=A(m(this,S));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=C?x.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&T(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=l(R,e,1),this.reject=l(N,e,1)},b.f=A=function(e){return e===S||e===a?new i(e):o(e)}),f(f.G+f.W+f.F*!O,{Promise:S}),n(171)(S,"Promise"),n(483)("Promise"),a=n(60).Promise,f(f.S+f.F*!O,"Promise",{reject:function(e){var t=A(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(u||!O),"Promise",{resolve:function(e){return w(u&&this===a?S:this,e)}}),f(f.S+f.F*!(O&&n(484)(function(e){S.all(e).catch(k)})),"Promise",{all:function(e){var t=this,n=A(t),r=n.resolve,o=n.reject,i=_(function(){var n=[],i=0,a=1;v(e,!1,function(e){var u=i++,s=!1;n.push(void 0),a++,t.resolve(e).then(function(e){s||(s=!0,n[u]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=A(t),r=n.reject,o=_(function(){v(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(120),o=n(477),i=n(478),a=n(59),u=n(103),s=n(479),l={},c={};(t=e.exports=function(e,t,n,f,p){var d,h,v,m,g=p?function(){return e}:s(e),y=r(n,f,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(i(g)){for(d=u(e.length);d>b;b++)if((m=t?y(a(h=e[b])[0],h[1]):y(e[b]))===l||m===c)return m}else for(v=g.call(e);!(h=v.next()).done;)if((m=o(v,y,h.value,t))===l||m===c)return m}).BREAK=l,t.RETURN=c},function(e,t,n){var r=n(59);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(102),o=n(18)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){var r=n(167),o=n(18)("iterator"),i=n(102);e.exports=n(60).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(33),o=n(254).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,s="process"==n(99)(a);e.exports=function(){var e,t,n,l=function(){var r,o;for(s&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(s)n=function(){a.nextTick(l)};else if(!i||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var c=u.resolve();n=function(){c.then(l)}}else n=function(){o.call(r,l)};else{var f=!0,p=document.createTextNode("");new i(l).observe(p,{characterData:!0}),n=function(){p.data=f=!f}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t,n){var r=n(73);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},function(e,t,n){"use strict";var r=n(33),o=n(117),i=n(100),a=n(18)("species");e.exports=function(e){var t=r[e];i&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(18)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(29),o=n(60),i=n(33),a=n(253),u=n(256);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,o.Promise||i.Promise),n="function"==typeof e;return this.then(n?function(n){return u(t,e()).then(function(){return n})}:e,n?function(n){return u(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(29),o=n(172),i=n(255);r(r.S,"Promise",{try:function(e){var t=o.f(this),n=i(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){n(488),n(489),n(490),n(245),n(493),n(494),n(495),n(496),n(498),n(499),n(500),n(501),n(502),n(503),n(504),n(505),n(506),n(507),n(508),n(509),n(510),n(511),n(512),n(513),n(514),n(515),e.exports=n(60).String},function(e,t,n){var r=n(29),o=n(250),i=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],o(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?i(t):i(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(29),o=n(122),i=n(103);r(r.S,"String",{raw:function(e){for(var t=o(e.raw),n=i(t.length),r=arguments.length,a=[],u=0;n>u;)a.push(String(t[u++])),u<r&&a.push(String(arguments[u]));return a.join("")}})},function(e,t,n){"use strict";n(491)("trim",function(e){return function(){return e(this,3)}})},function(e,t,n){var r=n(29),o=n(53),i=n(101),a=n(492),u="["+a+"]",s=RegExp("^"+u+u+"*"),l=RegExp(u+u+"*$"),c=function(e,t,n){var o={},u=i(function(){return!!a[e]()||"
"!="
"[e]()}),s=o[e]=u?t(f):a[e];n&&(o[n]=s),r(r.P+r.F*u,"String",o)},f=c.trim=function(e,t){return e=String(o(e)),1&t&&(e=e.replace(s,"")),2&t&&(e=e.replace(l,"")),e};e.exports=c},function(e,t){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(e,t,n){"use strict";var r=n(29),o=n(246)(!1);r(r.P,"String",{codePointAt:function(e){return o(this,e)}})},function(e,t,n){"use strict";var r=n(29),o=n(103),i=n(173),a="".endsWith;r(r.P+r.F*n(174)("endsWith"),"String",{endsWith:function(e){var t=i(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(t.length),u=void 0===n?r:Math.min(o(n),r),s=String(e);return a?a.call(t,s,u):t.slice(u-s.length,u)===s}})},function(e,t,n){"use strict";var r=n(29),o=n(173);r(r.P+r.F*n(174)("includes"),"String",{includes:function(e){return!!~o(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(29);r(r.P,"String",{repeat:n(497)})},function(e,t,n){"use strict";var r=n(119),o=n(53);e.exports=function(e){var t=String(o(this)),n="",i=r(e);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n}},function(e,t,n){"use strict";var r=n(29),o=n(103),i=n(173),a="".startsWith;r(r.P+r.F*n(174)("startsWith"),"String",{startsWith:function(e){var t=i(this,e,"startsWith"),n=o(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(30)("anchor",function(e){return function(t){return e(this,"a","name",t)}})},function(e,t,n){"use strict";n(30)("big",function(e){return function(){return e(this,"big","","")}})},function(e,t,n){"use strict";n(30)("blink",function(e){return function(){return e(this,"blink","","")}})},function(e,t,n){"use strict";n(30)("bold",function(e){return function(){return e(this,"b","","")}})},function(e,t,n){"use strict";n(30)("fixed",function(e){return function(){return e(this,"tt","","")}})},function(e,t,n){"use strict";n(30)("fontcolor",function(e){return function(t){return e(this,"font","color",t)}})},function(e,t,n){"use strict";n(30)("fontsize",function(e){return function(t){return e(this,"font","size",t)}})},function(e,t,n){"use strict";n(30)("italics",function(e){return function(){return e(this,"i","","")}})},function(e,t,n){"use strict";n(30)("link",function(e){return function(t){return e(this,"a","href",t)}})},function(e,t,n){"use strict";n(30)("small",function(e){return function(){return e(this,"small","","")}})},function(e,t,n){"use strict";n(30)("strike",function(e){return function(){return e(this,"strike","","")}})},function(e,t,n){"use strict";n(30)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";n(30)("sup",function(e){return function(){return e(this,"sup","","")}})},function(e,t,n){n(123)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),o=void 0==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(123)("replace",2,function(e,t,n){return[function(r,o){"use strict";var i=e(this),a=void 0==r?void 0:r[t];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},n]})},function(e,t,n){n(123)("search",1,function(e,t,n){return[function(n){"use strict";var r=e(this),o=void 0==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(123)("split",2,function(e,t,r){"use strict";var o=n(257),i=r,a=[].push;if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length){var u=void 0===/()??/.exec("")[1];r=function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!o(e))return i.call(n,e,t);var r,s,l,c,f,p=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,v=void 0===t?4294967295:t>>>0,m=new RegExp(e.source,d+"g");for(u||(r=new RegExp("^"+m.source+"$(?!\\s)",d));(s=m.exec(n))&&!((l=s.index+s[0].length)>h&&(p.push(n.slice(h,s.index)),!u&&s.length>1&&s[0].replace(r,function(){for(f=1;f<arguments.length-2;f++)void 0===arguments[f]&&(s[f]=void 0)}),s.length>1&&s.index<n.length&&a.apply(p,s.slice(1)),c=s[0].length,h=l,p.length>=v));)m.lastIndex===s.index&&m.lastIndex++;return h===n.length?!c&&m.test("")||p.push(""):p.push(n.slice(h)),p.length>v?p.slice(0,v):p}}else"0".split(void 0,0).length&&(r=function(e,t){return void 0===e&&0===t?[]:i.call(this,e,t)});return[function(n,o){var i=e(this),a=void 0==n?void 0:n[t];return void 0!==a?a.call(n,i,o):r.call(String(i),n,o)},r]})},function(e,t,n){"use strict";var r=p(n(41)),o=p(n(42)),i=p(n(45)),a=p(n(179)),u=p(n(531)),s=p(n(32)),l=p(n(725)),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(445)),f=n(9);function p(e){return e&&e.__esModule?e:{default:e}}var d=!0,h="g315819b2",v="3.20.5",m="jenins-swagger-oss",g="Sat, 12 Jan 2019 07:08:24 GMT";e.exports=function(e){s.default.versions=s.default.versions||{},s.default.versions.swaggerUi={version:v,gitRevision:h,gitDirty:d,buildTimestamp:g,machine:m};var t={dom_id:null,domNode:null,spec:{},url:"",urls:null,layout:"BaseLayout",docExpansion:"list",maxDisplayedTags:null,filter:null,validatorUrl:"https://online.swagger.io/validator",oauth2RedirectUrl:window.location.protocol+"//"+window.location.host+"/oauth2-redirect.html",configs:{},custom:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,requestInterceptor:function(e){return e},responseInterceptor:function(e){return e},showMutatedRequest:!0,defaultModelRendering:"example",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,showCommonExtensions:!1,supportedSubmitMethods:["get","put","post","delete","options","head","patch","trace"],presets:[l.default],plugins:[],initialState:{},fn:{},components:{}},n=(0,f.parseSearch)(),c=e.domNode;delete e.domNode;var p=(0,a.default)({},t,e,n),y={system:{configs:p.configs},plugins:p.presets,state:(0,a.default)({layout:{layout:p.layout,filter:p.filter},spec:{spec:"",url:p.url}},p.initialState)};if(p.initialState)for(var b in p.initialState)p.initialState.hasOwnProperty(b)&&void 0===p.initialState[b]&&delete y.state[b];var _=new u.default(y);_.register([p.plugins,function(){return{fn:p.fn,components:p.components,state:p.state}}]);var w=_.getSystem(),E=function(e){var t=w.specSelectors.getLocalConfig?w.specSelectors.getLocalConfig():{},u=(0,a.default)({},t,p,e||{},n);if(c&&(u.domNode=c),_.setConfigs(u),w.configsActions.loaded(),null!==e&&(!n.url&&"object"===(0,i.default)(u.spec)&&(0,o.default)(u.spec).length?(w.specActions.updateUrl(""),w.specActions.updateLoadingStatus("success"),w.specActions.updateSpec((0,r.default)(u.spec))):w.specActions.download&&u.url&&(w.specActions.updateUrl(u.url),w.specActions.download(u.url))),u.domNode)w.render(u.domNode,"App");else if(u.dom_id){var s=document.querySelector(u.dom_id);w.render(s,"App")}else null===u.dom_id||null===u.domNode||console.error("Skipped rendering: no `dom_id` or `domNode` was specified");return w},x=n.config||p.configUrl;return x&&w.specActions&&w.specActions.getConfigByUrl&&(!w.specActions.getConfigByUrl||w.specActions.getConfigByUrl({url:x,loadRemoteConfig:!0,requestInterceptor:p.requestInterceptor,responseInterceptor:p.responseInterceptor},E))?(w.specActions.getConfigByUrl(x,E),w):E()},e.exports.presets={apis:l.default},e.exports.plugins=c},function(e,t,n){var r=n(15),o=r.JSON||(r.JSON={stringify:JSON.stringify});e.exports=function(e){return o.stringify.apply(o,arguments)}},function(e,t,n){n(519),e.exports=n(15).Object.keys},function(e,t,n){var r=n(72),o=n(96);n(258)("keys",function(){return function(e){return o(r(e))}})},function(e,t,n){e.exports={default:n(521),__esModule:!0}},function(e,t,n){n(98),n(92),e.exports=n(175).f("iterator")},function(e,t,n){e.exports={default:n(523),__esModule:!0}},function(e,t,n){n(524),n(178),n(527),n(528),e.exports=n(15).Symbol},function(e,t,n){"use strict";var r=n(21),o=n(52),i=n(44),a=n(20),u=n(159),s=n(124).KEY,l=n(51),c=n(163),f=n(97),p=n(116),d=n(19),h=n(175),v=n(176),m=n(525),g=n(259),y=n(36),b=n(28),_=n(71),w=n(158),E=n(95),x=n(160),S=n(526),C=n(261),k=n(40),A=n(96),O=C.f,P=k.f,T=S.f,M=r.Symbol,I=r.JSON,j=I&&I.stringify,N=d("_hidden"),R=d("toPrimitive"),D={}.propertyIsEnumerable,L=c("symbol-registry"),U=c("symbols"),q=c("op-symbols"),F=Object.prototype,z="function"==typeof M,B=r.QObject,V=!B||!B.prototype||!B.prototype.findChild,H=i&&l(function(){return 7!=x(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=O(F,t);r&&delete F[t],P(e,t,n),r&&e!==F&&P(F,t,r)}:P,W=function(e){var t=U[e]=x(M.prototype);return t._k=e,t},J=z&&"symbol"==typeof M.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof M},Y=function(e,t,n){return e===F&&Y(q,t,n),y(e),t=w(t,!0),y(n),o(U,t)?(n.enumerable?(o(e,N)&&e[N][t]&&(e[N][t]=!1),n=x(n,{enumerable:E(0,!1)})):(o(e,N)||P(e,N,E(1,{})),e[N][t]=!0),H(e,t,n)):P(e,t,n)},K=function(e,t){y(e);for(var n,r=m(t=_(t)),o=0,i=r.length;i>o;)Y(e,n=r[o++],t[n]);return e},G=function(e){var t=D.call(this,e=w(e,!0));return!(this===F&&o(U,e)&&!o(q,e))&&(!(t||!o(this,e)||!o(U,e)||o(this,N)&&this[N][e])||t)},$=function(e,t){if(e=_(e),t=w(t,!0),e!==F||!o(U,t)||o(q,t)){var n=O(e,t);return!n||!o(U,t)||o(e,N)&&e[N][t]||(n.enumerable=!0),n}},Z=function(e){for(var t,n=T(_(e)),r=[],i=0;n.length>i;)o(U,t=n[i++])||t==N||t==s||r.push(t);return r},X=function(e){for(var t,n=e===F,r=T(n?q:_(e)),i=[],a=0;r.length>a;)!o(U,t=r[a++])||n&&!o(F,t)||i.push(U[t]);return i};z||(u((M=function(){if(this instanceof M)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),t=function(n){this===F&&t.call(q,n),o(this,N)&&o(this[N],e)&&(this[N][e]=!1),H(this,e,E(1,n))};return i&&V&&H(F,e,{configurable:!0,set:t}),W(e)}).prototype,"toString",function(){return this._k}),C.f=$,k.f=Y,n(260).f=S.f=Z,n(125).f=G,n(177).f=X,i&&!n(114)&&u(F,"propertyIsEnumerable",G,!0),h.f=function(e){return W(d(e))}),a(a.G+a.W+a.F*!z,{Symbol:M});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Q.length>ee;)d(Q[ee++]);for(var te=A(d.store),ne=0;te.length>ne;)v(te[ne++]);a(a.S+a.F*!z,"Symbol",{for:function(e){return o(L,e+="")?L[e]:L[e]=M(e)},keyFor:function(e){if(!J(e))throw TypeError(e+" is not a symbol!");for(var t in L)if(L[t]===e)return t},useSetter:function(){V=!0},useSimple:function(){V=!1}}),a(a.S+a.F*!z,"Object",{create:function(e,t){return void 0===t?x(e):K(x(e),t)},defineProperty:Y,defineProperties:K,getOwnPropertyDescriptor:$,getOwnPropertyNames:Z,getOwnPropertySymbols:X}),I&&a(a.S+a.F*(!z||l(function(){var e=M();return"[null]"!=j([e])||"{}"!=j({a:e})||"{}"!=j(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=t=r[1],(b(t)||void 0!==e)&&!J(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!J(t))return t}),r[1]=t,j.apply(I,r)}}),M.prototype[R]||n(50)(M.prototype,R,M.prototype.valueOf),f(M,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},function(e,t,n){var r=n(96),o=n(177),i=n(125);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var a,u=n(e),s=i.f,l=0;u.length>l;)s.call(e,a=u[l++])&&t.push(a);return t}},function(e,t,n){var r=n(71),o=n(260).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(r(e))}},function(e,t,n){n(176)("asyncIterator")},function(e,t,n){n(176)("observable")},function(e,t,n){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=l(e),r=n[0],a=n[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,r,a)),s=0,c=a>0?r-4:r,f=0;f<c;f+=4)t=o[e.charCodeAt(f)]<<18|o[e.charCodeAt(f+1)]<<12|o[e.charCodeAt(f+2)]<<6|o[e.charCodeAt(f+3)],u[s++]=t>>16&255,u[s++]=t>>8&255,u[s++]=255&t;2===a&&(t=o[e.charCodeAt(f)]<<2|o[e.charCodeAt(f+1)]>>4,u[s++]=255&t);1===a&&(t=o[e.charCodeAt(f)]<<10|o[e.charCodeAt(f+1)]<<4|o[e.charCodeAt(f+2)]>>2,u[s++]=t>>8&255,u[s++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,u=n-o;a<u;a+=16383)i.push(c(e,a,a+16383>u?u:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u<s;++u)r[u]=a[u],o[a.charCodeAt(u)]=u;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var o,i,a=[],u=t;u<n;u+=3)o=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(255&e[u+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,u=8*o-r-1,s=(1<<u)-1,l=s>>1,c=-7,f=n?o-1:0,p=n?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-c)-1,d>>=-c,c+=u;c>0;i=256*i+e[t+f],f+=p,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=p,c-=8);if(0===i)i=1-l;else{if(i===s)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=l}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,u,s,l=8*i-o-1,c=(1<<l)-1,f=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+f>=1?p/s:p*Math.pow(2,1-f))*s>=2&&(a++,s/=2),a+f>=c?(u=0,a=c):a+f>=1?(u=(t*s-1)*Math.pow(2,o),a+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&u,d+=h,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;e[n+d]=255&a,d+=h,a/=256,l-=8);e[n+d-h]|=128*v}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=b(n(42)),o=b(n(22)),i=b(n(23)),a=b(n(2)),u=b(n(3)),s=b(n(0)),l=n(271),c=n(7),f=b(c),p=b(n(179)),d=n(564),h=b(n(180)),v=b(n(181)),m=n(127),g=b(n(32)),y=n(9);function b(e){return e&&e.__esModule?e:{default:e}}var _=function(e){return e};var w=function(){function e(){var t,n,r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,a.default)(this,e),(0,p.default)(this,{state:{},plugins:[],system:{configs:{},fn:{},components:{},rootInjects:{},statePlugins:{}},boundSystem:{},toolbox:{}},o),this.getSystem=this._getSystem.bind(this),this.store=(t=_,n=(0,c.fromJS)(this.state),r=this.getSystem,function(e,t,n){var r=[(0,y.systemThunkMiddleware)(n)],o=g.default.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||l.compose;return(0,l.createStore)(e,t,o(l.applyMiddleware.apply(void 0,r)))}(t,n,r)),this.buildSystem(!1),this.register(this.plugins)}return(0,u.default)(e,[{key:"getStore",value:function(){return this.store}},{key:"register",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=function e(t,n){if((0,y.isObject)(t)&&!(0,y.isArray)(t))return(0,v.default)({},t);if((0,y.isFunc)(t))return e(t(n),n);if((0,y.isArray)(t))return t.map(function(t){return e(t,n)}).reduce(E,{});return{}}(e,this.getSystem());E(this.system,n),t&&this.buildSystem(),function e(t,n){var r=this;var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.hasLoaded;var a=i;(0,y.isObject)(t)&&!(0,y.isArray)(t)&&"function"==typeof t.afterLoad&&(a=!0,x(t.afterLoad).call(this,n));if((0,y.isFunc)(t))return e.call(this,t(n),n,{hasLoaded:a});if((0,y.isArray)(t))return t.map(function(t){return e.call(r,t,n,{hasLoaded:a})});return a}.call(this.system,e,this.getSystem())&&this.buildSystem()}},{key:"buildSystem",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.getStore().dispatch,n=this.getStore().getState;this.boundSystem=(0,i.default)({},this.getRootInjects(),this.getWrappedAndBoundActions(t),this.getWrappedAndBoundSelectors(n,this.getSystem),this.getStateThunks(n),this.getFn(),this.getConfigs()),e&&this.rebuildReducer()}},{key:"_getSystem",value:function(){return this.boundSystem}},{key:"getRootInjects",value:function(){return(0,i.default)({getSystem:this.getSystem,getStore:this.getStore.bind(this),getComponents:this.getComponents.bind(this),getState:this.getStore().getState,getConfigs:this._getConfigs.bind(this),Im:f.default,React:s.default},this.system.rootInjects||{})}},{key:"_getConfigs",value:function(){return this.system.configs}},{key:"getConfigs",value:function(){return{configs:this.system.configs}}},{key:"setConfigs",value:function(e){this.system.configs=e}},{key:"rebuildReducer",value:function(){var e,t,n;this.store.replaceReducer((n=this.system.statePlugins,e=(0,y.objMap)(n,function(e){return e.reducers}),t=(0,r.default)(e).reduce(function(t,n){var r;return t[n]=(r=e[n],function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new c.Map,t=arguments[1];if(!r)return e;var n=r[t.type];if(n){var o=x(n)(e,t);return null===o?e:o}return e}),t},{}),(0,r.default)(t).length?(0,d.combineReducers)(t):_))}},{key:"getType",value:function(e){var t=e[0].toUpperCase()+e.slice(1);return(0,y.objReduce)(this.system.statePlugins,function(n,r){var i=n[e];if(i)return(0,o.default)({},r+t,i)})}},{key:"getSelectors",value:function(){return this.getType("selectors")}},{key:"getActions",value:function(){var e=this.getType("actions");return(0,y.objMap)(e,function(e){return(0,y.objReduce)(e,function(e,t){if((0,y.isFn)(e))return(0,o.default)({},t,e)})})}},{key:"getWrappedAndBoundActions",value:function(e){var t=this,n=this.getBoundActions(e);return(0,y.objMap)(n,function(e,n){var r=t.system.statePlugins[n.slice(0,-7)].wrapActions;return r?(0,y.objMap)(e,function(e,n){var o=r[n];return o?(Array.isArray(o)||(o=[o]),o.reduce(function(e,n){var r=function(){return n(e,t.getSystem()).apply(void 0,arguments)};if(!(0,y.isFn)(r))throw new TypeError("wrapActions needs to return a function that returns a new function (ie the wrapped action)");return x(r)},e||Function.prototype)):e}):e})}},{key:"getWrappedAndBoundSelectors",value:function(e,t){var n=this,r=this.getBoundSelectors(e,t);return(0,y.objMap)(r,function(t,r){var o=[r.slice(0,-9)],i=n.system.statePlugins[o].wrapSelectors;return i?(0,y.objMap)(t,function(t,r){var a=i[r];return a?(Array.isArray(a)||(a=[a]),a.reduce(function(t,r){var i=function(){for(var i=arguments.length,a=Array(i),u=0;u<i;u++)a[u]=arguments[u];return r(t,n.getSystem()).apply(void 0,[e().getIn(o)].concat(a))};if(!(0,y.isFn)(i))throw new TypeError("wrapSelector needs to return a function that returns a new function (ie the wrapped action)");return i},t||Function.prototype)):t}):t})}},{key:"getStates",value:function(e){return(0,r.default)(this.system.statePlugins).reduce(function(t,n){return t[n]=e.get(n),t},{})}},{key:"getStateThunks",value:function(e){return(0,r.default)(this.system.statePlugins).reduce(function(t,n){return t[n]=function(){return e().get(n)},t},{})}},{key:"getFn",value:function(){return{fn:this.system.fn}}},{key:"getComponents",value:function(e){var t=this,n=this.system.components[e];return Array.isArray(n)?n.reduce(function(e,n){return n(e,t.getSystem())}):void 0!==e?this.system.components[e]:this.system.components}},{key:"getBoundSelectors",value:function(e,t){return(0,y.objMap)(this.getSelectors(),function(n,r){var o=[r.slice(0,-9)];return(0,y.objMap)(n,function(n){return function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];var u=x(n).apply(null,[e().getIn(o)].concat(i));return"function"==typeof u&&(u=x(u)(t())),u}})})}},{key:"getBoundActions",value:function(e){e=e||this.getStore().dispatch;var t=this.getActions();return(0,y.objMap)(t,function(t){return(0,l.bindActionCreators)(function e(t){return"function"!=typeof t?(0,y.objMap)(t,function(t){return e(t)}):function(){var e=null;try{e=t.apply(void 0,arguments)}catch(t){e={type:m.NEW_THROWN_ERR,error:!0,payload:(0,h.default)(t)}}finally{return e}}}(t),e)})}},{key:"getMapStateToProps",value:function(){var e=this;return function(){return(0,i.default)({},e.getSystem())}}},{key:"getMapDispatchToProps",value:function(e){var t=this;return function(n){return(0,p.default)({},t.getWrappedAndBoundActions(n),t.getFn(),e)}}}]),e}();function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,y.isObject)(e))return{};if(!(0,y.isObject)(t))return e;t.wrapComponents&&((0,y.objMap)(t.wrapComponents,function(n,r){var o=e.components&&e.components[r];o&&Array.isArray(o)?(e.components[r]=o.concat([n]),delete t.wrapComponents[r]):o&&(e.components[r]=[o,n],delete t.wrapComponents[r])}),(0,r.default)(t.wrapComponents).length||delete t.wrapComponents);var n=e.statePlugins;if((0,y.isObject)(n))for(var o in n){var i=n[o];if((0,y.isObject)(i)&&(0,y.isObject)(i.wrapActions)){var a=i.wrapActions;for(var u in a){var s=a[u];Array.isArray(s)||(s=[s],a[u]=s),t&&t.statePlugins&&t.statePlugins[o]&&t.statePlugins[o].wrapActions&&t.statePlugins[o].wrapActions[u]&&(t.statePlugins[o].wrapActions[u]=a[u].concat(t.statePlugins[o].wrapActions[u]))}}}return(0,p.default)(e,t)}function x(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).logErrors,n=void 0===t||t;return"function"!=typeof e?e:function(){try{for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return e.call.apply(e,[this].concat(r))}catch(e){return n&&console.error(e),null}}}t.default=w},function(e,t,n){n(533);var r=n(15).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},function(e,t,n){var r=n(20);r(r.S+r.F*!n(44),"Object",{defineProperty:n(40).f})},function(e,t,n){n(535),e.exports=n(15).Object.assign},function(e,t,n){var r=n(20);r(r.S+r.F,"Object",{assign:n(264)})},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";var r=n(538),o=n(76),i=n(34),a=n(539),u=r.twoArgumentPooler,s=r.fourArgumentPooler,l=/\/+/g;function c(e){return(""+e).replace(l,"$&/")}function f(e,t){this.func=e,this.context=t,this.count=0}function p(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function d(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function h(e,t,n){var r=e.result,a=e.keyPrefix,u=e.func,s=e.context,l=u.call(s,t,e.count++);Array.isArray(l)?v(l,r,n,i.thatReturnsArgument):null!=l&&(o.isValidElement(l)&&(l=o.cloneAndReplaceKey(l,a+(!l.key||t&&t.key===l.key?"":c(l.key)+"/")+n)),r.push(l))}function v(e,t,n,r,o){var i="";null!=n&&(i=c(n)+"/");var u=d.getPooled(t,i,r,o);a(e,h,u),d.release(u)}function m(e,t,n){return null}f.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},r.addPoolingTo(f,u),d.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},r.addPoolingTo(d,s);var g={forEach:function(e,t,n){if(null==e)return e;var r=f.getPooled(t,n);a(e,p,r),f.release(r)},map:function(e,t,n){if(null==e)return e;var r=[];return v(e,r,null,t,n),r},mapIntoWithKeyPrefixInternal:v,count:function(e,t){return a(e,m,null)},toArray:function(e){var t=[];return v(e,t,null,i.thatReturnsArgument),t}};e.exports=g},function(e,t,n){"use strict";var r=n(104),o=(n(8),function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)}),i=function(e){e instanceof this||r("25"),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)},a=o,u={addPoolingTo:function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||a,n.poolSize||(n.poolSize=10),n.release=i,n},oneArgumentPooler:o,twoArgumentPooler:function(e,t){if(this.instancePool.length){var n=this.instancePool.pop();return this.call(n,e,t),n}return new this(e,t)},threeArgumentPooler:function(e,t,n){if(this.instancePool.length){var r=this.instancePool.pop();return this.call(r,e,t,n),r}return new this(e,t,n)},fourArgumentPooler:function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}};e.exports=u},function(e,t,n){"use strict";var r=n(104),o=(n(46),n(268)),i=n(540),a=(n(8),n(541)),u=(n(10),"."),s=":";function l(e,t){return e&&"object"==typeof e&&null!=e.key?a.escape(e.key):t.toString(36)}e.exports=function(e,t,n){return null==e?0:function e(t,n,c,f){var p,d=typeof t;if("undefined"!==d&&"boolean"!==d||(t=null),null===t||"string"===d||"number"===d||"object"===d&&t.$$typeof===o)return c(f,t,""===n?u+l(t,0):n),1;var h=0,v=""===n?u:n+s;if(Array.isArray(t))for(var m=0;m<t.length;m++)h+=e(p=t[m],v+l(p,m),c,f);else{var g=i(t);if(g){var y,b=g.call(t);if(g!==t.entries)for(var _=0;!(y=b.next()).done;)h+=e(p=y.value,v+l(p,_++),c,f);else for(;!(y=b.next()).done;){var w=y.value;w&&(h+=e(p=w[1],v+a.escape(w[0])+s+l(p,0),c,f))}}else if("object"===d){var E="",x=String(t);r("31","[object Object]"===x?"object with keys {"+Object.keys(t).join(", ")+"}":x,E)}}return h}(e,"",t,n)}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=function(e){var t=e&&(r&&e[r]||e[o]);if("function"==typeof t)return t}},function(e,t,n){"use strict";var r={escape:function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})},unescape:function(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}};e.exports=r},function(e,t,n){"use strict";var r=n(76).createFactory,o={a:r("a"),abbr:r("abbr"),address:r("address"),area:r("area"),article:r("article"),aside:r("aside"),audio:r("audio"),b:r("b"),base:r("base"),bdi:r("bdi"),bdo:r("bdo"),big:r("big"),blockquote:r("blockquote"),body:r("body"),br:r("br"),button:r("button"),canvas:r("canvas"),caption:r("caption"),cite:r("cite"),code:r("code"),col:r("col"),colgroup:r("colgroup"),data:r("data"),datalist:r("datalist"),dd:r("dd"),del:r("del"),details:r("details"),dfn:r("dfn"),dialog:r("dialog"),div:r("div"),dl:r("dl"),dt:r("dt"),em:r("em"),embed:r("embed"),fieldset:r("fieldset"),figcaption:r("figcaption"),figure:r("figure"),footer:r("footer"),form:r("form"),h1:r("h1"),h2:r("h2"),h3:r("h3"),h4:r("h4"),h5:r("h5"),h6:r("h6"),head:r("head"),header:r("header"),hgroup:r("hgroup"),hr:r("hr"),html:r("html"),i:r("i"),iframe:r("iframe"),img:r("img"),input:r("input"),ins:r("ins"),kbd:r("kbd"),keygen:r("keygen"),label:r("label"),legend:r("legend"),li:r("li"),link:r("link"),main:r("main"),map:r("map"),mark:r("mark"),menu:r("menu"),menuitem:r("menuitem"),meta:r("meta"),meter:r("meter"),nav:r("nav"),noscript:r("noscript"),object:r("object"),ol:r("ol"),optgroup:r("optgroup"),option:r("option"),output:r("output"),p:r("p"),param:r("param"),picture:r("picture"),pre:r("pre"),progress:r("progress"),q:r("q"),rp:r("rp"),rt:r("rt"),ruby:r("ruby"),s:r("s"),samp:r("samp"),script:r("script"),section:r("section"),select:r("select"),small:r("small"),source:r("source"),span:r("span"),strong:r("strong"),style:r("style"),sub:r("sub"),summary:r("summary"),sup:r("sup"),table:r("table"),tbody:r("tbody"),td:r("td"),textarea:r("textarea"),tfoot:r("tfoot"),th:r("th"),thead:r("thead"),time:r("time"),title:r("title"),tr:r("tr"),track:r("track"),u:r("u"),ul:r("ul"),var:r("var"),video:r("video"),wbr:r("wbr"),circle:r("circle"),clipPath:r("clipPath"),defs:r("defs"),ellipse:r("ellipse"),g:r("g"),image:r("image"),line:r("line"),linearGradient:r("linearGradient"),mask:r("mask"),path:r("path"),pattern:r("pattern"),polygon:r("polygon"),polyline:r("polyline"),radialGradient:r("radialGradient"),rect:r("rect"),stop:r("stop"),svg:r("svg"),text:r("text"),tspan:r("tspan")};e.exports=o},function(e,t,n){"use strict";var r=n(76).isValidElement,o=n(269);e.exports=o(r)},function(e,t,n){"use strict";var r=n(34),o=n(8),i=n(10),a=n(13),u=n(270),s=n(545);e.exports=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l="@@iterator";var c="<<anonymous>>",f={array:v("array"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:h(r.thatReturnsNull),arrayOf:function(e){return h(function(t,n,r,o,i){if("function"!=typeof e)return new d("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){var s=g(a);return new d("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+r+"`, expected an array.")}for(var l=0;l<a.length;l++){var c=e(a,l,r,o,i+"["+l+"]",u);if(c instanceof Error)return c}return null})},element:function(){return h(function(t,n,r,o,i){var a=t[n];if(!e(a)){var u=g(a);return new d("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected a single ReactElement.")}return null})}(),instanceOf:function(e){return h(function(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||c,u=function(e){if(!e.constructor||!e.constructor.name)return c;return e.constructor.name}(t[n]);return new d("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null})},node:function(){return h(function(e,t,n,r,o){if(!m(e[t]))return new d("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.");return null})}(),objectOf:function(e){return h(function(t,n,r,o,i){if("function"!=typeof e)return new d("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=t[n],s=g(a);if("object"!==s)return new d("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+r+"`, expected an object.");for(var l in a)if(a.hasOwnProperty(l)){var c=e(a,l,r,o,i+"."+l,u);if(c instanceof Error)return c}return null})},oneOf:function(e){if(!Array.isArray(e))return r.thatReturnsNull;return h(function(t,n,r,o,i){for(var a=t[n],u=0;u<e.length;u++)if(p(a,e[u]))return null;var s=JSON.stringify(e);return new d("Invalid "+o+" `"+i+"` of value `"+a+"` supplied to `"+r+"`, expected one of "+s+".")})},oneOfType:function(e){if(!Array.isArray(e))return r.thatReturnsNull;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return i(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",b(n),t),r.thatReturnsNull}return h(function(t,n,r,o,i){for(var a=0;a<e.length;a++){var s=e[a];if(null==s(t,n,r,o,i,u))return null}return new d("Invalid "+o+" `"+i+"` supplied to `"+r+"`.")})},shape:function(e){return h(function(t,n,r,o,i){var a=t[n],s=g(a);if("object"!==s)return new d("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+r+"`, expected `object`.");for(var l in e){var c=e[l];if(c){var f=c(a,l,r,o,i+"."+l,u);if(f)return f}}return null})},exact:function(e){return h(function(t,n,r,o,i){var s=t[n],l=g(s);if("object"!==l)return new d("Invalid "+o+" `"+i+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");var c=a({},t[n],e);for(var f in c){var p=e[f];if(!p)return new d("Invalid "+o+" `"+i+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=p(s,f,r,o,i+"."+f,u);if(h)return h}return null})}};function p(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){this.message=e,this.stack=""}function h(e){function n(n,r,i,a,s,l,f){(a=a||c,l=l||i,f!==u)&&(t&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"));return null==r[i]?n?null===r[i]?new d("The "+s+" `"+l+"` is marked as required in `"+a+"`, but its value is `null`."):new d("The "+s+" `"+l+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(r,i,a,s,l)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function v(e){return h(function(t,n,r,o,i,a){var u=t[n];return g(u)!==e?new d("Invalid "+o+" `"+i+"` of type `"+y(u)+"` supplied to `"+r+"`, expected `"+e+"`."):null})}function m(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(m);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e[l]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!m(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!m(a[1]))return!1}return!0;default:return!1}}function g(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}(t,e)?"symbol":t}function y(e){if(void 0===e||null===e)return""+e;var t=g(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function b(e){var t=y(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return d.prototype=Error.prototype,f.checkPropTypes=s,f.PropTypes=f,f}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o){}},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r=n(265).Component,o=n(76).isValidElement,i=n(266),a=n(548);e.exports=a(r,o,i)},function(e,t,n){"use strict";var r=n(13),o=n(126),i=n(8),a="mixins";e.exports=function(e,t,n){var u=[],s={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},l={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},c={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)p(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=r({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=r({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=h(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=r({},e.propTypes,t)},statics:function(e,t){!function(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in c;i(!o,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var a=n in e;if(a){var u=l.hasOwnProperty(n)?l[n]:null;return i("DEFINE_MANY_MERGED"===u,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),void(e[n]=h(e[n],r))}e[n]=r}}}(e,t)},autobind:function(){}};function f(e,t){var n=s.hasOwnProperty(t)?s[t]:null;b.hasOwnProperty(t)&&i("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&i("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){i("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),i(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,o=r.__reactAutoBindPairs;for(var u in n.hasOwnProperty(a)&&c.mixins(e,n.mixins),n)if(n.hasOwnProperty(u)&&u!==a){var l=n[u],p=r.hasOwnProperty(u);if(f(p,u),c.hasOwnProperty(u))c[u](e,l);else{var d=s.hasOwnProperty(u);if("function"!=typeof l||d||p||!1===n.autobind)if(p){var m=s[u];i(d&&("DEFINE_MANY_MERGED"===m||"DEFINE_MANY"===m),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",m,u),"DEFINE_MANY_MERGED"===m?r[u]=h(r[u],l):"DEFINE_MANY"===m&&(r[u]=v(r[u],l))}else r[u]=l;else o.push(u,l),r[u]=l}}}}function d(e,t){for(var n in i(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."),t)t.hasOwnProperty(n)&&(i(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function h(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return d(o,n),d(o,r),o}}function v(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function m(e,t){var n=t.bind(e);return n}var g={componentDidMount:function(){this.__isMounted=!0}},y={componentWillUnmount:function(){this.__isMounted=!1}},b={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},_=function(){};return r(_.prototype,e.prototype,b),function(e){var t=function(e,r,a){this.__reactAutoBindPairs.length&&function(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=m(e,o)}}(this),this.props=e,this.context=r,this.refs=o,this.updater=a||n,this.state=null;var u=this.getInitialState?this.getInitialState():null;i("object"==typeof u&&!Array.isArray(u),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=u};for(var r in t.prototype=new _,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],u.forEach(p.bind(null,t)),p(t,g),p(t,e),p(t,y),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),i(t.prototype.render,"createClass(...): Class specification must implement a `render` method."),s)t.prototype[r]||(t.prototype[r]=null);return t}}},function(e,t,n){"use strict";var r=n(104),o=n(76);n(8);e.exports=function(e){return o.isValidElement(e)||r("143"),e}},function(e,t,n){"use strict";var r=n(274),o=n(553),i=n(554),a="[object Null]",u="[object Undefined]",s=r.a?r.a.toStringTag:void 0;t.a=function(e){return null==e?void 0===e?u:a:s&&s in Object(e)?o.a(e):i.a(e)}},function(e,t,n){"use strict";var r=n(552),o="object"==typeof self&&self&&self.Object===Object&&self,i=r.a||o||Function("return this")();t.a=i},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(t,n(31))},function(e,t,n){"use strict";var r=n(274),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r.a?r.a.toStringTag:void 0;t.a=function(e){var t=i.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[u]=n:delete e[u]),o}},function(e,t,n){"use strict";var r=Object.prototype.toString;t.a=function(e){return r.call(e)}},function(e,t,n){"use strict";var r=n(556).a(Object.getPrototypeOf,Object);t.a=r},function(e,t,n){"use strict";t.a=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){"use strict";t.a=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";(function(e,r){var o,i=n(560);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var a=i.a(o);t.a=a}).call(t,n(31),n(559)(e))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";t.a=function(e){var t,n=e.Symbol;"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable";return t}},function(e,t,n){"use strict";t.a=function(e){for(var t=Object.keys(e),n={},i=0;i<t.length;i++){var a=t[i];0,"function"==typeof e[a]&&(n[a]=e[a])}var u=Object.keys(n);0;var s=void 0;try{!function(e){Object.keys(e).forEach(function(t){var n=e[t],o=n(void 0,{type:r.a.INIT});if(void 0===o)throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");var i="@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".");if(void 0===n(void 0,{type:i}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+r.a.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(n)}catch(e){s=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(s)throw s;for(var r=!1,i={},a=0;a<u.length;a++){var l=u[a],c=n[l],f=e[l],p=c(f,t);if(void 0===p){var d=o(l,t);throw new Error(d)}i[l]=p,r=r||p!==f}return r?i:e}};var r=n(272);n(273),n(275);function o(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}},function(e,t,n){"use strict";function r(e,t){return function(){return t(e.apply(void 0,arguments))}}t.a=function(e,t){if("function"==typeof e)return r(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),o={},i=0;i<n.length;i++){var a=n[i],u=e[a];"function"==typeof u&&(o[a]=r(u,t))}return o}},function(e,t,n){"use strict";t.a=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,i,a){var u=e(n,i,a),s=u.dispatch,l=[],c={getState:u.getState,dispatch:function(e){return s(e)}};return l=t.map(function(e){return e(c)}),s=r.a.apply(void 0,l)(u.dispatch),o({},u,{dispatch:s})}}};var r=n(276),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineReducers=void 0;var r,o=n(565),i=(r=o)&&r.__esModule?r:{default:r};t.combineReducers=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(7),i=(r=o)&&r.__esModule?r:{default:r},a=n(566);t.default=function(e){var t=Object.keys(e);return function(){var n=arguments.length<=0||void 0===arguments[0]?i.default.Map():arguments[0],r=arguments[1];return n.withMutations(function(n){t.forEach(function(t){var o=(0,e[t])(n.get(t),r);(0,a.validateNextState)(o,t,r),n.set(t,o)})})}},e.exports=t.default},function(e,t,n){"use strict";"create index";Object.defineProperty(t,"__esModule",{value:!0}),t.validateNextState=t.getUnexpectedInvocationParameterMessage=t.getStateName=void 0;var r=a(n(277)),o=a(n(567)),i=a(n(568));function a(e){return e&&e.__esModule?e:{default:e}}t.getStateName=r.default,t.getUnexpectedInvocationParameterMessage=o.default,t.validateNextState=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(7)),o=i(n(277));function i(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){var i=Object.keys(t);if(!i.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";var a=(0,o.default)(n);if(!r.default.Iterable.isIterable(e))return"The "+a+' is of unexpected type. Expected argument to be an instance of Immutable.Iterable with the following properties: "'+i.join('", "')+'".';var u=e.keySeq().toArray().filter(function(e){return!t.hasOwnProperty(e)});return u.length>0?"Unexpected "+(1===u.length?"property":"properties")+' "'+u.join('", "')+'" found in '+a+'. Expected to find one of the known reducer property names instead: "'+i.join('", "')+'". Unexpected properties will be ignored.':null},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(void 0===e)throw new Error('Reducer "'+t+'" returned undefined when handling "'+n.type+'" action. To ignore an action, you must explicitly return the previous state.');return null},e.exports=t.default},function(e,t,n){e.exports={default:n(570),__esModule:!0}},function(e,t,n){n(92),n(98),e.exports=n(571)},function(e,t,n){var r=n(166),o=n(19)("iterator"),i=n(70);e.exports=n(15).isIterable=function(e){var t=Object(e);return void 0!==t[o]||"@@iterator"in t||i.hasOwnProperty(r(t))}},function(e,t,n){"use strict";var r=/^(%20|\s)*(javascript|data)/im,o=/[^\x20-\x7E]/gim,i=/^([^:]+):/gm,a=[".","/"];e.exports={sanitizeUrl:function(e){var t,n,u=e.replace(o,"");return function(e){return a.indexOf(e[0])>-1}(u)?u:(n=u.match(i))?(t=n[0],r.test(t)?"about:blank":u):"about:blank"}}},function(e,t,n){var r=n(574),o=n(582)(function(e,t,n){return t=t.toLowerCase(),e+(n?r(t):t)});e.exports=o},function(e,t,n){var r=n(61),o=n(281);e.exports=function(e){return o(r(e).toLowerCase())}},function(e,t,n){var r=n(77),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[u]=n:delete e[u]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(578),o=n(283),i=n(579),a=n(61);e.exports=function(e){return function(t){t=a(t);var n=o(t)?i(t):void 0,u=n?n[0]:t.charAt(0),s=n?r(n,1).join(""):t.slice(1);return u[e]()+s}}},function(e,t,n){var r=n(282);e.exports=function(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:r(e,t,n)}},function(e,t,n){var r=n(580),o=n(283),i=n(581);e.exports=function(e){return o(e)?i(e):r(e)}},function(e,t){e.exports=function(e){return e.split("")}},function(e,t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+r+"|"+o+")"+"?",l="[\\ufe0e\\ufe0f]?"+s+("(?:\\u200d(?:"+[i,a,u].join("|")+")[\\ufe0e\\ufe0f]?"+s+")*"),c="(?:"+[i+r+"?",r,a,u,n].join("|")+")",f=RegExp(o+"(?="+o+")|"+c+l,"g");e.exports=function(e){return e.match(f)||[]}},function(e,t,n){var r=n(284),o=n(583),i=n(586),a=RegExp("['’]","g");e.exports=function(e){return function(t){return r(i(o(t).replace(a,"")),e,"")}}},function(e,t,n){var r=n(584),o=n(61),i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=o(e))&&e.replace(i,r).replace(a,"")}},function(e,t,n){var r=n(585)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t,n){var r=n(587),o=n(588),i=n(61),a=n(589);e.exports=function(e,t,n){return e=i(e),void 0===(t=n?void 0:t)?o(e)?a(e):r(e):e.match(t)||[]}},function(e,t){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(n)||[]}},function(e,t){var n=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return n.test(e)}},function(e,t){var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",r="["+n+"]",o="\\d+",i="[\\u2700-\\u27bf]",a="[a-z\\xdf-\\xf6\\xf8-\\xff]",u="[^\\ud800-\\udfff"+n+o+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",l="[\\ud800-\\udbff][\\udc00-\\udfff]",c="[A-Z\\xc0-\\xd6\\xd8-\\xde]",f="(?:"+a+"|"+u+")",p="(?:"+c+"|"+u+")",d="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",h="[\\ufe0e\\ufe0f]?"+d+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",s,l].join("|")+")[\\ufe0e\\ufe0f]?"+d+")*"),v="(?:"+[i,s,l].join("|")+")"+h,m=RegExp([c+"?"+a+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[r,c,"$"].join("|")+")",p+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[r,c+f,"$"].join("|")+")",c+"?"+f+"+(?:['’](?:d|ll|m|re|s|t|ve))?",c+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",o,v].join("|"),"g");e.exports=function(e){return e.match(m)||[]}},function(e,t,n){var r=n(591),o=n(130),i=n(183);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(e,t,n){var r=n(592),o=n(597),i=n(598),a=n(599),u=n(600);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=u,e.exports=s},function(e,t,n){var r=n(129);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t,n){var r=n(286),o=n(594),i=n(38),a=n(287),u=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,c=s.toString,f=l.hasOwnProperty,p=RegExp("^"+c.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?p:u).test(a(e))}},function(e,t,n){var r,o=n(595),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},function(e,t,n){var r=n(37)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(129),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return n===o?void 0:n}return i.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(129),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(129),o="__lodash_hash_undefined__";e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?o:t,this}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(131),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},function(e,t,n){var r=n(131);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(131);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(131);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(132);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(132);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(132);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(132);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(133),o=n(78),i=n(64);e.exports=function(e){return function(t,n,a){var u=Object(t);if(!o(t)){var s=r(n,3);t=i(t),n=function(e){return s(u[e],e,u)}}var l=e(t,n,a);return l>-1?u[s?t[l]:l]:void 0}}},function(e,t,n){var r=n(613),o=n(639),i=n(300);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(184),o=n(289),i=1,a=2;e.exports=function(e,t,n,u){var s=n.length,l=s,c=!u;if(null==e)return!l;for(e=Object(e);s--;){var f=n[s];if(c&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++s<l;){var p=(f=n[s])[0],d=e[p],h=f[1];if(c&&f[2]){if(void 0===d&&!(p in e))return!1}else{var v=new r;if(u)var m=u(d,h,p,e,t,v);if(!(void 0===m?o(h,d,i|a,u,v):m))return!1}}return!0}},function(e,t,n){var r=n(130);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(130),o=n(183),i=n(182),a=200;e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var u=n.__data__;if(!o||u.length<a-1)return u.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(u)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(184),o=n(290),i=n(624),a=n(627),u=n(137),s=n(24),l=n(188),c=n(297),f=1,p="[object Arguments]",d="[object Array]",h="[object Object]",v=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,m,g,y){var b=s(e),_=s(t),w=b?d:u(e),E=_?d:u(t),x=(w=w==p?h:w)==h,S=(E=E==p?h:E)==h,C=w==E;if(C&&l(e)){if(!l(t))return!1;b=!0,x=!1}if(C&&!x)return y||(y=new r),b||c(e)?o(e,t,n,m,g,y):i(e,t,w,n,m,g,y);if(!(n&f)){var k=x&&v.call(e,"__wrapped__"),A=S&&v.call(t,"__wrapped__");if(k||A){var O=k?e.value():e,P=A?t.value():t;return y||(y=new r),g(O,P,n,m,y)}}return!!C&&(y||(y=new r),a(e,t,n,m,g,y))}},function(e,t,n){var r=n(182),o=n(621),i=n(622);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},function(e,t){var n="__lodash_hash_undefined__";e.exports=function(e){return this.__data__.set(e,n),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(77),o=n(292),i=n(105),a=n(290),u=n(625),s=n(626),l=1,c=2,f="[object Boolean]",p="[object Date]",d="[object Error]",h="[object Map]",v="[object Number]",m="[object RegExp]",g="[object Set]",y="[object String]",b="[object Symbol]",_="[object ArrayBuffer]",w="[object DataView]",E=r?r.prototype:void 0,x=E?E.valueOf:void 0;e.exports=function(e,t,n,r,E,S,C){switch(n){case w:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!S(new o(e),new o(t)));case f:case p:case v:return i(+e,+t);case d:return e.name==t.name&&e.message==t.message;case m:case y:return e==t+"";case h:var k=u;case g:var A=r&l;if(k||(k=s),e.size!=t.size&&!A)return!1;var O=C.get(e);if(O)return O==t;r|=c,C.set(e,t);var P=a(k(e),k(t),r,E,S,C);return C.delete(e),P;case b:if(x)return x.call(e)==x.call(t)}return!1}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},function(e,t,n){var r=n(293),o=1,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,u,s){var l=n&o,c=r(e),f=c.length;if(f!=r(t).length&&!l)return!1;for(var p=f;p--;){var d=c[p];if(!(l?d in t:i.call(t,d)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var v=!0;s.set(e,t),s.set(t,e);for(var m=l;++p<f;){var g=e[d=c[p]],y=t[d];if(a)var b=l?a(y,g,d,t,e,s):a(g,y,d,e,t,s);if(!(void 0===b?g===y||u(g,y,n,a,s):b)){v=!1;break}m||(m="constructor"==d)}if(v&&!m){var _=e.constructor,w=t.constructor;_!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof _&&_ instanceof _&&"function"==typeof w&&w instanceof w)&&(v=!1)}return s.delete(e),s.delete(t),v}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(62),o=n(47),i="[object Arguments]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(62),o=n(189),i=n(47),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},function(e,t,n){var r=n(136),o=n(634),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(298)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(63)(n(37),"DataView");e.exports=r},function(e,t,n){var r=n(63)(n(37),"Promise");e.exports=r},function(e,t,n){var r=n(63)(n(37),"Set");e.exports=r},function(e,t,n){var r=n(63)(n(37),"WeakMap");e.exports=r},function(e,t,n){var r=n(299),o=n(64);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,r(a)]}return t}},function(e,t,n){var r=n(289),o=n(138),i=n(301),a=n(192),u=n(299),s=n(300),l=n(80),c=1,f=2;e.exports=function(e,t){return a(e)&&u(t)?s(l(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?i(n,e):r(t,a,c|f)}}},function(e,t,n){var r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,i=n(642)(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(r,function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)}),t});e.exports=i},function(e,t,n){var r=n(285),o=500;e.exports=function(e){var t=r(e,function(e){return n.size===o&&n.clear(),e}),n=t.cache;return t}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(79),o=n(187),i=n(24),a=n(135),u=n(189),s=n(80);e.exports=function(e,t,n){for(var l=-1,c=(t=r(t,e)).length,f=!1;++l<c;){var p=s(t[l]);if(!(f=null!=e&&n(e,p)))break;e=e[p]}return f||++l!=c?f:!!(c=null==e?0:e.length)&&u(c)&&a(p,c)&&(i(e)||o(e))}},function(e,t,n){var r=n(646),o=n(647),i=n(192),a=n(80);e.exports=function(e){return i(e)?r(a(e)):o(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(139);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(649),o=n(133),i=n(302),a=Math.max;e.exports=function(e,t,n){var u=null==e?0:e.length;if(!u)return-1;var s=null==n?0:i(n);return s<0&&(s=a(u+s,0)),r(e,o(t,3),s)}},function(e,t){e.exports=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},function(e,t,n){var r=n(303),o=1/0,i=1.7976931348623157e308;e.exports=function(e){return e?(e=r(e))===o||e===-o?(e<0?-1:1)*i:e==e?e:0:0===e?e:0}},function(e,t,n){var r=n(291),o=n(133),i=n(652),a=n(24),u=n(305);e.exports=function(e,t,n){var s=a(e)?r:i;return n&&u(e,t,n)&&(t=void 0),s(e,o(t,3))}},function(e,t,n){var r=n(304);e.exports=function(e,t){var n;return r(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}},function(e,t,n){var r=n(654),o=n(64);e.exports=function(e,t){return e&&r(e,t,o)}},function(e,t,n){var r=n(655)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),u=a.length;u--;){var s=a[e?u:++o];if(!1===n(i[s],s,i))break}return t}}},function(e,t,n){var r=n(78);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var i=n.length,a=t?i:-1,u=Object(n);(t?a--:++a<i)&&!1!==o(u[a],a,u););return n}}},function(e,t,n){(function(t){var r=n(658),o=n(659).Stream,i=" ";function a(e,t,n){n=n||0;var o,i,u=(o=t,new Array(n||0).join(o||"")),s=e;if("object"==typeof e&&((s=e[i=Object.keys(e)[0]])&&s._elem))return s._elem.name=i,s._elem.icount=n,s._elem.indent=t,s._elem.indents=u,s._elem.interrupt=s,s._elem;var l,c=[],f=[];function p(e){Object.keys(e).forEach(function(t){c.push(function(e,t){return e+'="'+r(t)+'"'}(t,e[t]))})}switch(typeof s){case"object":if(null===s)break;s._attr&&p(s._attr),s._cdata&&f.push(("<![CDATA["+s._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),s.forEach&&(l=!1,f.push(""),s.forEach(function(e){"object"==typeof e?"_attr"==Object.keys(e)[0]?p(e._attr):f.push(a(e,t,n+1)):(f.pop(),l=!0,f.push(r(e)))}),l||f.push(""));break;default:f.push(r(s))}return{name:i,interrupt:!1,attributes:c,content:f,icount:n,indents:u,indent:t}}function u(e,t,n){if("object"!=typeof t)return e(!1,t);var r=t.interrupt?1:t.content.length;function o(){for(;t.content.length;){var o=t.content.shift();if(void 0!==o){if(i(o))return;u(e,o)}}e(!1,(r>1?t.indents:"")+(t.name?"</"+t.name+">":"")+(t.indent&&!n?"\n":"")),n&&n()}function i(t){return!!t.interrupt&&(t.interrupt.append=e,t.interrupt.end=o,t.interrupt=!1,e(!0),!0)}if(e(!1,t.indents+(t.name?"<"+t.name:"")+(t.attributes.length?" "+t.attributes.join(" "):"")+(r?t.name?">":"":t.name?"/>":"")+(t.indent&&r>1?"\n":"")),!r)return e(!1,t.indent?"\n":"");i(t)||o()}e.exports=function(e,n){"object"!=typeof n&&(n={indent:n});var r,s,l=n.stream?new o:null,c="",f=!1,p=n.indent?!0===n.indent?i:n.indent:"",d=!0;function h(e){d?t.nextTick(e):e()}function v(e,t){if(void 0!==t&&(c+=t),e&&!f&&(l=l||new o,f=!0),e&&f){var n=c;h(function(){l.emit("data",n)}),c=""}}function m(e,t){u(v,a(e,p,p?1:0),t)}function g(){if(l){var e=c;h(function(){l.emit("data",e),l.emit("end"),l.readable=!1,l.emit("close")})}}return h(function(){d=!1}),n.declaration&&(r=n.declaration,s={version:"1.0",encoding:r.encoding||"UTF-8"},r.standalone&&(s.standalone=r.standalone),m({"?xml":{_attr:s}}),c=c.replace("/>","?>")),e&&e.forEach?e.forEach(function(t,n){var r;n+1===e.length&&(r=g),m(t,r)}):m(e,g),l?(l.readable=!0,l):c},e.exports.element=e.exports.Element=function(){var e={_elem:a(Array.prototype.slice.call(arguments)),push:function(e){if(!this.append)throw new Error("not assigned to a parent!");var t=this,n=this._elem.indent;u(this.append,a(e,n,this._elem.icount+(n?1:0)),function(){t.append(!0)})},close:function(e){void 0!==e&&this.push(e),this.end&&this.end()}};return e}}).call(t,n(55))},function(e,t){var n={"&":"&",'"':""","'":"'","<":"<",">":">"};e.exports=function(e){return e&&e.replace?e.replace(/([&"<>'])/g,function(e,t){return n[t]}):e}},function(e,t,n){e.exports=o;var r=n(195).EventEmitter;function o(){r.call(this)}n(81)(o,r),o.Readable=n(196),o.Writable=n(666),o.Duplex=n(667),o.Transform=n(668),o.PassThrough=n(669),o.Stream=o,o.prototype.pipe=function(e,t){var n=this;function o(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",u),n.on("close",s));var a=!1;function u(){a||(a=!0,e.end())}function s(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",o),e.removeListener("drain",i),n.removeListener("end",u),n.removeListener("close",s),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",l),e.on("error",l),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},function(e,t){},function(e,t,n){"use strict";var r=n(141).Buffer,o=n(662);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,u=0;a;)t=a.data,n=i,o=u,t.copy(n,o),u+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,u,s=1,l={},c=!1,f=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){h(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(a="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&h(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),r=function(t){e.postMessage(a+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return l[s]=o,r(s),s++},p.clearImmediate=d}function d(e){delete l[e]}function h(e){if(c)setTimeout(h,0,e);else{var t=l[e];if(t){c=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{d(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(t,n(31),n(55))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(t,n(31))},function(e,t,n){"use strict";e.exports=i;var r=n(311),o=n(106);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(81),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(197)},function(e,t,n){e.exports=n(65)},function(e,t,n){e.exports=n(196).Transform},function(e,t,n){e.exports=n(196).PassThrough},function(e,t,n){"use strict";var r=n(312),o=n(314),i=n(675);e.exports=function(e){var t,a=r(arguments[1]);return a.normalizer||0!==(t=a.length=o(a.length,e.length,a.async))&&(a.primitive?!1===t?a.normalizer=n(702):t>1&&(a.normalizer=n(703)(t)):a.normalizer=!1===t?n(704)():1===t?n(708)():n(709)(t)),a.async&&n(710),a.promise&&n(711),a.dispose&&n(717),a.maxAge&&n(718),a.max&&n(721),a.refCounter&&n(723),i(e,a)}},function(e,t,n){"use strict";var r=n(672),o=Math.abs,i=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?r(e)*i(o(e)):e}},function(e,t,n){"use strict";e.exports=n(673)()?Math.sign:n(674)},function(e,t,n){"use strict";e.exports=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}},function(e,t,n){"use strict";e.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},function(e,t,n){"use strict";var r=n(56),o=n(142),i=n(68),a=n(677),u=n(314);e.exports=function e(t){var n,s,l;if(r(t),(n=Object(arguments[1])).async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(t,"__memoized__")&&!n.force?t:(s=u(n.length,t.length,n.async&&i.async),l=a(t,s,n),o(i,function(e,t){n[t]&&e(n[t],l,n)}),e.__profiler__&&e.__profiler__(l),l.updateEnv(),l.memoized)}},function(e,t,n){"use strict";var r=n(56),o=n(82),i=Function.prototype.bind,a=Function.prototype.call,u=Object.keys,s=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(n,l){var c,f=arguments[2],p=arguments[3];return n=Object(o(n)),r(l),c=u(n),p&&c.sort("function"==typeof p?i.call(p,n):void 0),"function"!=typeof e&&(e=c[e]),a.call(e,c,function(e,r){return s.call(n,e)?a.call(l,f,n[e],e,n,r):t})}}},function(e,t,n){"use strict";var r=n(678),o=n(316),i=n(143),a=n(688).methods,u=n(689),s=n(701),l=Function.prototype.apply,c=Function.prototype.call,f=Object.create,p=Object.defineProperties,d=a.on,h=a.emit;e.exports=function(e,t,n){var a,v,m,g,y,b,_,w,E,x,S,C,k,A,O,P=f(null);return v=!1!==t?t:isNaN(e.length)?1:e.length,n.normalizer&&(x=s(n.normalizer),m=x.get,g=x.set,y=x.delete,b=x.clear),null!=n.resolvers&&(O=u(n.resolvers)),A=m?o(function(t){var n,o,i=arguments;if(O&&(i=O(i)),null!==(n=m(i))&&hasOwnProperty.call(P,n))return S&&a.emit("get",n,i,this),P[n];if(o=1===i.length?c.call(e,this,i[0]):l.call(e,this,i),null===n){if(null!==(n=m(i)))throw r("Circular invocation","CIRCULAR_INVOCATION");n=g(i)}else if(hasOwnProperty.call(P,n))throw r("Circular invocation","CIRCULAR_INVOCATION");return P[n]=o,C&&a.emit("set",n,null,o),o},v):0===t?function(){var t;if(hasOwnProperty.call(P,"data"))return S&&a.emit("get","data",arguments,this),P.data;if(t=arguments.length?l.call(e,this,arguments):c.call(e,this),hasOwnProperty.call(P,"data"))throw r("Circular invocation","CIRCULAR_INVOCATION");return P.data=t,C&&a.emit("set","data",null,t),t}:function(t){var n,o,i=arguments;if(O&&(i=O(arguments)),o=String(i[0]),hasOwnProperty.call(P,o))return S&&a.emit("get",o,i,this),P[o];if(n=1===i.length?c.call(e,this,i[0]):l.call(e,this,i),hasOwnProperty.call(P,o))throw r("Circular invocation","CIRCULAR_INVOCATION");return P[o]=n,C&&a.emit("set",o,null,n),n},a={original:e,memoized:A,profileName:n.profileName,get:function(e){return O&&(e=O(e)),m?m(e):String(e[0])},has:function(e){return hasOwnProperty.call(P,e)},delete:function(e){var t;hasOwnProperty.call(P,e)&&(y&&y(e),t=P[e],delete P[e],k&&a.emit("delete",e,t))},clear:function(){var e=P;b&&b(),P=f(null),a.emit("clear",e)},on:function(e,t){return"get"===e?S=!0:"set"===e?C=!0:"delete"===e&&(k=!0),d.call(this,e,t)},emit:h,updateEnv:function(){e=a.original}},_=m?o(function(e){var t,n=arguments;O&&(n=O(n)),null!==(t=m(n))&&a.delete(t)},v):0===t?function(){return a.delete("data")}:function(e){return O&&(e=O(arguments)[0]),a.delete(e)},w=o(function(){var e,n=arguments;return 0===t?P.data:(O&&(n=O(n)),e=m?m(n):String(n[0]),P[e])}),E=o(function(){var e,n=arguments;return 0===t?a.has("data"):(O&&(n=O(n)),null!==(e=m?m(n):String(n[0]))&&a.has(e))}),p(A,{__memoized__:i(!0),delete:i(_),clear:i(a.clear),_get:i(w),_has:i(E)}),a}},function(e,t,n){"use strict";var r=n(315),o=n(684),i=n(66),a=Error.captureStackTrace;t=e.exports=function(e){var n=new Error(e),u=arguments[1],s=arguments[2];return i(s)||o(u)&&(s=u,u=null),i(s)&&r(n,s),i(u)&&(n.code=u),a&&a(n,t),n}},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var r=n(681),o=n(82),i=Math.max;e.exports=function(e,t){var n,a,u,s=i(arguments.length,2);for(e=Object(o(e)),u=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},a=1;a<s;++a)t=arguments[a],r(t).forEach(u);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(682)()?Object.keys:n(683)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var r=n(66),o=Object.keys;e.exports=function(e){return o(r(e)?Object(e):e)}},function(e,t,n){"use strict";var r=n(66),o={function:!0,object:!0};e.exports=function(e){return r(e)&&o[typeof e]||!1}},function(e,t,n){"use strict";e.exports=n(686)()?String.prototype.contains:n(687)},function(e,t,n){"use strict";var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(e,t,n){"use strict";var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";var r,o,i,a,u,s,l,c=n(143),f=n(56),p=Function.prototype.apply,d=Function.prototype.call,h=Object.create,v=Object.defineProperty,m=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};u={on:r=function(e,t){var n;return f(t),g.call(this,"__ee__")?n=this.__ee__:(n=y.value=h(null),v(this,"__ee__",y),y.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},once:o=function(e,t){var n,o;return f(t),o=this,r.call(this,e,n=function(){i.call(o,e,n),p.call(t,this,arguments)}),n.__eeOnceListener__=t,this},off:i=function(e,t){var n,r,o,i;if(f(t),!g.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(i=0;o=r[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===r.length?n[e]=r[i?0:1]:r.splice(i,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},emit:a=function(e){var t,n,r,o,i;if(g.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)p.call(r,this,i)}else switch(arguments.length){case 1:d.call(o,this);break;case 2:d.call(o,this,arguments[1]);break;case 3:d.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];p.call(o,this,i)}}},s={on:c(r),once:c(o),off:c(i),emit:c(a)},l=m({},s),e.exports=t=function(e){return null==e?h(l):m(Object(e),s)},t.methods=u},function(e,t,n){"use strict";var r,o=n(690),i=n(66),a=n(56),u=Array.prototype.slice;r=function(e){return this.map(function(t,n){return t?t(e[n]):e[n]}).concat(u.call(e,this.length))},e.exports=function(e){return(e=o(e)).forEach(function(e){i(e)&&a(e)}),r.bind(e)}},function(e,t,n){"use strict";var r=n(199),o=Array.isArray;e.exports=function(e){return o(e)?e:r(e)}},function(e,t,n){"use strict";e.exports=function(){var e,t,n=Array.from;return"function"==typeof n&&(t=n(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}},function(e,t,n){"use strict";var r=n(693).iterator,o=n(698),i=n(699),a=n(67),u=n(56),s=n(82),l=n(66),c=n(700),f=Array.isArray,p=Function.prototype.call,d={configurable:!0,enumerable:!0,writable:!0,value:null},h=Object.defineProperty;e.exports=function(e){var t,n,v,m,g,y,b,_,w,E,x=arguments[1],S=arguments[2];if(e=Object(s(e)),l(x)&&u(x),this&&this!==Array&&i(this))t=this;else{if(!x){if(o(e))return 1!==(g=e.length)?Array.apply(null,e):((m=new Array(1))[0]=e[0],m);if(f(e)){for(m=new Array(g=e.length),n=0;n<g;++n)m[n]=e[n];return m}}m=[]}if(!f(e))if(void 0!==(w=e[r])){for(b=u(w).call(e),t&&(m=new t),_=b.next(),n=0;!_.done;)E=x?p.call(x,S,_.value,n):_.value,t?(d.value=E,h(m,n,d)):m[n]=E,_=b.next(),++n;g=n}else if(c(e)){for(g=e.length,t&&(m=new t),n=0,v=0;n<g;++n)E=e[n],n+1<g&&(y=E.charCodeAt(0))>=55296&&y<=56319&&(E+=e[++n]),E=x?p.call(x,S,E,v):E,t?(d.value=E,h(m,v,d)):m[v]=E,++v;g=v}if(void 0===g)for(g=a(e.length),t&&(m=new t(g)),n=0;n<g;++n)E=x?p.call(x,S,e[n],n):e[n],t?(d.value=E,h(m,n,d)):m[n]=E;return t&&(d.value=null,m.length=g),m}},function(e,t,n){"use strict";e.exports=n(694)()?Symbol:n(695)},function(e,t,n){"use strict";var r={object:!0,symbol:!0};e.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{String(e)}catch(e){return!1}return!!r[typeof Symbol.iterator]&&(!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag])}},function(e,t,n){"use strict";var r,o,i,a,u=n(143),s=n(696),l=Object.create,c=Object.defineProperties,f=Object.defineProperty,p=Object.prototype,d=l(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),a=!0}catch(e){}}var h,v=(h=l(null),function(e){for(var t,n,r=0;h[e+(r||"")];)++r;return h[e+=r||""]=!0,f(p,t="@@"+e,u.gs(null,function(e){n||(n=!0,f(this,t,u(e)),n=!1)})),t});i=function(e){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return o(e)},e.exports=o=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return a?r(t):(n=l(i.prototype),t=void 0===t?"":String(t),c(n,{__description__:u("",t),__name__:u("",v(t))}))},c(o,{for:u(function(e){return d[e]?d[e]:d[e]=o(String(e))}),keyFor:u(function(e){var t;for(t in s(e),d)if(d[t]===e)return t}),hasInstance:u("",r&&r.hasInstance||o("hasInstance")),isConcatSpreadable:u("",r&&r.isConcatSpreadable||o("isConcatSpreadable")),iterator:u("",r&&r.iterator||o("iterator")),match:u("",r&&r.match||o("match")),replace:u("",r&&r.replace||o("replace")),search:u("",r&&r.search||o("search")),species:u("",r&&r.species||o("species")),split:u("",r&&r.split||o("split")),toPrimitive:u("",r&&r.toPrimitive||o("toPrimitive")),toStringTag:u("",r&&r.toStringTag||o("toStringTag")),unscopables:u("",r&&r.unscopables||o("unscopables"))}),c(i.prototype,{constructor:u(o),toString:u("",function(){return this.__name__})}),c(o.prototype,{toString:u(function(){return"Symbol ("+s(this).__description__+")"}),valueOf:u(function(){return s(this)})}),f(o.prototype,o.toPrimitive,u("",function(){var e=s(this);return"symbol"==typeof e?e:e.toString()})),f(o.prototype,o.toStringTag,u("c","Symbol")),f(i.prototype,o.toStringTag,u("c",o.prototype[o.toStringTag])),f(i.prototype,o.toPrimitive,u("c",o.prototype[o.toPrimitive]))},function(e,t,n){"use strict";var r=n(697);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}},function(e,t,n){"use strict";e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call(function(){return arguments}());e.exports=function(e){return r.call(e)===o}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call(n(313));e.exports=function(e){return"function"==typeof e&&r.call(e)===o}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===o)||!1}},function(e,t,n){"use strict";var r=n(56);e.exports=function(e){var t;return"function"==typeof e?{set:e,get:e}:(t={get:r(e.get)},void 0!==e.set?(t.set=r(e.set),e.delete&&(t.delete=r(e.delete)),e.clear&&(t.clear=r(e.clear)),t):(t.set=t.get,t))}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r=e.length;if(!r)return"";for(t=String(e[n=0]);--r;)t+=""+e[++n];return t}},function(e,t,n){"use strict";e.exports=function(e){return e?function(t){for(var n=String(t[0]),r=0,o=e;--o;)n+=""+t[++r];return n}:function(){return""}}},function(e,t,n){"use strict";var r=n(200),o=Object.create;e.exports=function(){var e=0,t=[],n=o(null);return{get:function(e){var n,o=0,i=t,a=e.length;if(0===a)return i[a]||null;if(i=i[a]){for(;o<a-1;){if(-1===(n=r.call(i[0],e[o])))return null;i=i[1][n],++o}return-1===(n=r.call(i[0],e[o]))?null:i[1][n]||null}return null},set:function(o){var i,a=0,u=t,s=o.length;if(0===s)u[s]=++e;else{for(u[s]||(u[s]=[[],[]]),u=u[s];a<s-1;)-1===(i=r.call(u[0],o[a]))&&(i=u[0].push(o[a])-1,u[1].push([[],[]])),u=u[1][i],++a;-1===(i=r.call(u[0],o[a]))&&(i=u[0].push(o[a])-1),u[1][i]=++e}return n[e]=o,e},delete:function(e){var o,i=0,a=t,u=n[e],s=u.length,l=[];if(0===s)delete a[s];else if(a=a[s]){for(;i<s-1;){if(-1===(o=r.call(a[0],u[i])))return;l.push(a,o),a=a[1][o],++i}if(-1===(o=r.call(a[0],u[i])))return;for(e=a[1][o],a[0].splice(o,1),a[1].splice(o,1);!a[0].length&&l.length;)o=l.pop(),(a=l.pop())[0].splice(o,1),a[1].splice(o,1)}delete n[e]},clear:function(){t=[],n=o(null)}}}},function(e,t,n){"use strict";e.exports=n(706)()?Number.isNaN:n(707)},function(e,t,n){"use strict";e.exports=function(){var e=Number.isNaN;return"function"==typeof e&&(!e({})&&e(NaN)&&!e(34))}},function(e,t,n){"use strict";e.exports=function(e){return e!=e}},function(e,t,n){"use strict";var r=n(200);e.exports=function(){var e=0,t=[],n=[];return{get:function(e){var o=r.call(t,e[0]);return-1===o?null:n[o]},set:function(r){return t.push(r[0]),n.push(++e),e},delete:function(e){var o=r.call(n,e);-1!==o&&(t.splice(o,1),n.splice(o,1))},clear:function(){t=[],n=[]}}}},function(e,t,n){"use strict";var r=n(200),o=Object.create;e.exports=function(e){var t=0,n=[[],[]],i=o(null);return{get:function(t){for(var o,i=0,a=n;i<e-1;){if(-1===(o=r.call(a[0],t[i])))return null;a=a[1][o],++i}return-1===(o=r.call(a[0],t[i]))?null:a[1][o]||null},set:function(o){for(var a,u=0,s=n;u<e-1;)-1===(a=r.call(s[0],o[u]))&&(a=s[0].push(o[u])-1,s[1].push([[],[]])),s=s[1][a],++u;return-1===(a=r.call(s[0],o[u]))&&(a=s[0].push(o[u])-1),s[1][a]=++t,i[t]=o,t},delete:function(t){for(var o,a=0,u=n,s=[],l=i[t];a<e-1;){if(-1===(o=r.call(u[0],l[a])))return;s.push(u,o),u=u[1][o],++a}if(-1!==(o=r.call(u[0],l[a]))){for(t=u[1][o],u[0].splice(o,1),u[1].splice(o,1);!u[0].length&&s.length;)o=s.pop(),(u=s.pop())[0].splice(o,1),u[1].splice(o,1);delete i[t]}},clear:function(){n=[[],[]],i=o(null)}}}},function(e,t,n){"use strict";var r=n(199),o=n(318),i=n(317),a=n(316),u=n(201),s=Array.prototype.slice,l=Function.prototype.apply,c=Object.create;n(68).async=function(e,t){var n,f,p,d=c(null),h=c(null),v=t.memoized,m=t.original;t.memoized=a(function(e){var t=arguments,r=t[t.length-1];return"function"==typeof r&&(n=r,t=s.call(t,0,-1)),v.apply(f=this,p=t)},v);try{i(t.memoized,v)}catch(e){}t.on("get",function(e){var r,o,i;if(n){if(d[e])return"function"==typeof d[e]?d[e]=[d[e],n]:d[e].push(n),void(n=null);r=n,o=f,i=p,n=f=p=null,u(function(){var a;hasOwnProperty.call(h,e)?(a=h[e],t.emit("getasync",e,i,o),l.call(r,a.context,a.args)):(n=r,f=o,p=i,v.apply(o,i))})}}),t.original=function(){var e,o,i,a;return n?(e=r(arguments),o=function e(n){var o,i,s=e.id;if(null!=s){if(delete e.id,o=d[s],delete d[s],o)return i=r(arguments),t.has(s)&&(n?t.delete(s):(h[s]={context:this,args:i},t.emit("setasync",s,"function"==typeof o?1:o.length))),"function"==typeof o?a=l.call(o,this,i):o.forEach(function(e){a=l.call(e,this,i)},this),a}else u(l.bind(e,this,arguments))},i=n,n=f=p=null,e.push(o),a=l.call(m,this,e),o.cb=i,n=o,a):l.call(m,this,arguments)},t.on("set",function(e){n?(d[e]?"function"==typeof d[e]?d[e]=[d[e],n.cb]:d[e].push(n.cb):d[e]=n.cb,delete n.cb,n.id=e,n=null):t.delete(e)}),t.on("delete",function(e){var n;hasOwnProperty.call(d,e)||h[e]&&(n=h[e],delete h[e],t.emit("deleteasync",e,s.call(n.args,1)))}),t.on("clear",function(){var e=h;h=c(null),t.emit("clearasync",o(e,function(e){return s.call(e.args,1)}))})}},function(e,t,n){"use strict";var r=n(318),o=n(712),i=n(713),a=n(715),u=n(319),s=n(201),l=Object.create,c=o("then","then:finally","done","done:finally");n(68).promise=function(e,t){var n=l(null),o=l(null),f=l(null);if(!0===e)e=null;else if(e=i(e),!c[e])throw new TypeError("'"+a(e)+"' is not valid promise mode");t.on("set",function(r,i,a){var l=!1;if(!u(a))return o[r]=a,void t.emit("setasync",r,1);n[r]=1,f[r]=a;var c=function(e){var i=n[r];if(l)throw new Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");i&&(delete n[r],o[r]=e,t.emit("setasync",r,i))},p=function(){l=!0,n[r]&&(delete n[r],delete f[r],t.delete(r))},d=e;if(d||(d="then"),"then"===d)a.then(function(e){s(c.bind(this,e))},function(){s(p)});else if("done"===d){if("function"!=typeof a.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");a.done(c,p)}else if("done:finally"===d){if("function"!=typeof a.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof a.finally)throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");a.done(c),a.finally(p)}}),t.on("get",function(e,r,o){var i;if(n[e])++n[e];else{i=f[e];var a=function(){t.emit("getasync",e,r,o)};u(i)?"function"==typeof i.done?i.done(a):i.then(function(){s(a)}):a()}}),t.on("delete",function(e){if(delete f[e],n[e])delete n[e];else if(hasOwnProperty.call(o,e)){var r=o[e];delete o[e],t.emit("deleteasync",e,[r])}}),t.on("clear",function(){var e=o;o=l(null),n=l(null),f=l(null),t.emit("clearasync",r(e,function(e){return[e]}))})}},function(e,t,n){"use strict";var r=Array.prototype.forEach,o=Object.create;e.exports=function(e){var t=o(null);return r.call(arguments,function(e){t[e]=!0}),t}},function(e,t,n){"use strict";var r=n(82),o=n(714);e.exports=function(e){return o(r(e))}},function(e,t,n){"use strict";var r=n(198);e.exports=function(e){try{return e&&r(e.toString)?e.toString():String(e)}catch(e){throw new TypeError("Passed argument cannot be stringifed")}}},function(e,t,n){"use strict";var r=n(716),o=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=r(e);return t.length>100&&(t=t.slice(0,99)+"…"),t=t.replace(o,function(e){return JSON.stringify(e).slice(1,-1)})}},function(e,t,n){"use strict";var r=n(198);e.exports=function(e){try{return e&&r(e.toString)?e.toString():String(e)}catch(e){return"[Non-coercible (to string) value]"}}},function(e,t,n){"use strict";var r=n(56),o=n(142),i=n(68),a=Function.prototype.apply;i.dispose=function(e,t,n){var u;if(r(e),n.async&&i.async||n.promise&&i.promise)return t.on("deleteasync",u=function(t,n){a.call(e,null,n)}),void t.on("clearasync",function(e){o(e,function(e,t){u(t,e)})});t.on("delete",u=function(t,n){e(n)}),t.on("clear",function(e){o(e,function(e,t){u(t,e)})})}},function(e,t,n){"use strict";var r=n(199),o=n(142),i=n(201),a=n(319),u=n(719),s=n(68),l=Function.prototype,c=Math.max,f=Math.min,p=Object.create;s.maxAge=function(e,t,n){var d,h,v,m;(e=u(e))&&(d=p(null),h=n.async&&s.async||n.promise&&s.promise?"async":"",t.on("set"+h,function(n){d[n]=setTimeout(function(){t.delete(n)},e),"function"==typeof d[n].unref&&d[n].unref(),m&&(m[n]&&"nextTick"!==m[n]&&clearTimeout(m[n]),m[n]=setTimeout(function(){delete m[n]},v),"function"==typeof m[n].unref&&m[n].unref())}),t.on("delete"+h,function(e){clearTimeout(d[e]),delete d[e],m&&("nextTick"!==m[e]&&clearTimeout(m[e]),delete m[e])}),n.preFetch&&(v=!0===n.preFetch||isNaN(n.preFetch)?.333:c(f(Number(n.preFetch),1),0))&&(m={},v=(1-v)*e,t.on("get"+h,function(e,o,u){m[e]||(m[e]="nextTick",i(function(){var i;"nextTick"===m[e]&&(delete m[e],t.delete(e),n.async&&(o=r(o)).push(l),i=t.memoized.apply(u,o),n.promise&&a(i)&&("function"==typeof i.done?i.done(l,l):i.then(l,l)))}))})),t.on("clear"+h,function(){o(d,function(e){clearTimeout(e)}),d={},m&&(o(m,function(e){"nextTick"!==e&&clearTimeout(e)}),m={})}))}},function(e,t,n){"use strict";var r=n(67),o=n(720);e.exports=function(e){if((e=r(e))>o)throw new TypeError(e+" exceeds maximum possible timeout");return e}},function(e,t,n){"use strict";e.exports=2147483647},function(e,t,n){"use strict";var r=n(67),o=n(722),i=n(68);i.max=function(e,t,n){var a,u,s;(e=r(e))&&(u=o(e),a=n.async&&i.async||n.promise&&i.promise?"async":"",t.on("set"+a,s=function(e){void 0!==(e=u.hit(e))&&t.delete(e)}),t.on("get"+a,s),t.on("delete"+a,u.delete),t.on("clear"+a,u.clear))}},function(e,t,n){"use strict";var r=n(67),o=Object.create,i=Object.prototype.hasOwnProperty;e.exports=function(e){var t,n=0,a=1,u=o(null),s=o(null),l=0;return e=r(e),{hit:function(r){var o=s[r],c=++l;if(u[c]=r,s[r]=c,!o){if(++n<=e)return;return r=u[a],t(r),r}if(delete u[o],a===o)for(;!i.call(u,++a);)continue},delete:t=function(e){var t=s[e];if(t&&(delete u[t],delete s[e],--n,a===t)){if(!n)return l=0,void(a=1);for(;!i.call(u,++a);)continue}},clear:function(){n=0,a=1,u=o(null),s=o(null),l=0}}}},function(e,t,n){"use strict";var r=n(143),o=n(68),i=Object.create,a=Object.defineProperties;o.refCounter=function(e,t,n){var u,s;u=i(null),s=n.async&&o.async||n.promise&&o.promise?"async":"",t.on("set"+s,function(e,t){u[e]=t||1}),t.on("get"+s,function(e){++u[e]}),t.on("delete"+s,function(e){delete u[e]}),t.on("clear"+s,function(){u={}}),a(t.memoized,{deleteRef:r(function(){var e=t.get(arguments);return null===e?null:u[e]?!--u[e]&&(t.delete(e),!0):null}),getRefCount:r(function(){var e=t.get(arguments);return null===e?0:u[e]?u[e]:0})})}},function(e,t,n){(function(t){var n,r;n=void 0!==t?t:this,r=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),r=n.length,o=-1,i="",a=n.charCodeAt(0);++o<r;)0!=(t=n.charCodeAt(o))?i+=t>=1&&t<=31||127==t||0==o&&t>=48&&t<=57||1==o&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":(0!=o||1!=r||45!=t)&&(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?n.charAt(o):"\\"+n.charAt(o):i+="�";return i};return e.CSS||(e.CSS={}),e.CSS.escape=t,t},e.exports=r(n)}).call(t,n(31))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return[r.default,o.default]};var r=i(n(726)),o=i(n(422));function i(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e={components:{App:y.default,authorizationPopup:b.default,authorizeBtn:_.default,AuthorizeBtnContainer:w.default,authorizeOperationBtn:E.default,auths:x.default,AuthItem:S.default,authError:C.default,oauth2:O.default,apiKeyAuth:k.default,basicAuth:A.default,clear:P.default,liveResponse:T.default,info:ee.default,InfoContainer:te.default,JumpToPath:ne.default,onlineValidatorBadge:M.default,operations:I.default,operation:N.default,OperationSummary:R.default,OperationSummaryMethod:D.default,OperationSummaryPath:L.default,highlightCode:F.default,responses:z.default,response:B.default,responseBody:V.default,parameters:H.default,parameterRow:Y.default,execute:K.default,headers:G.default,errors:$.default,contentType:Z.default,overview:X.default,footer:re.default,FilterContainer:oe.default,ParamBody:ie.default,curl:ae.default,schemes:ue.default,SchemesContainer:se.default,modelExample:ce.default,ModelWrapper:fe.default,ModelCollapse:le.default,Model:pe.default,Models:de.default,EnumModel:he.default,ObjectModel:ve.default,ArrayModel:me.default,PrimitiveModel:ge.default,Property:ye.default,TryItOutButton:be.default,Markdown:Se.default,BaseLayout:Ce.default,VersionPragmaFilter:_e.default,VersionStamp:we.default,OperationExt:U.default,OperationExtRow:q.default,ParameterExt:W.default,ParameterIncludeEmpty:J.default,OperationTag:j.default,OperationContainer:g.default,DeepLink:Ee.default,InfoUrl:Q.InfoUrl,InfoBasePath:Q.InfoBasePath,SvgAssets:xe.default}},t={components:ke},n={components:Ae};return[d.default,f.default,s.default,a.default,i.default,r.default,o.default,u.default,e,t,l.default,n,c.default,p.default,h.default,v.default,m.default]};var r=Pe(n(320)),o=Pe(n(327)),i=Pe(n(333)),a=Pe(n(348)),u=Pe(n(385)),s=Pe(n(386)),l=Pe(n(387)),c=Pe(n(394)),f=Pe(n(398)),p=Pe(n(399)),d=Pe(n(400)),h=Pe(n(404)),v=Pe(n(409)),m=Pe(n(411)),g=Pe(n(936)),y=Pe(n(937)),b=Pe(n(938)),_=Pe(n(939)),w=Pe(n(940)),E=Pe(n(941)),x=Pe(n(942)),S=Pe(n(943)),C=Pe(n(944)),k=Pe(n(945)),A=Pe(n(946)),O=Pe(n(947)),P=Pe(n(949)),T=Pe(n(950)),M=Pe(n(951)),I=Pe(n(952)),j=Pe(n(953)),N=Pe(n(954)),R=Pe(n(955)),D=Pe(n(956)),L=Pe(n(957)),U=Pe(n(958)),q=Pe(n(959)),F=Pe(n(960)),z=Pe(n(962)),B=Pe(n(963)),V=Pe(n(964)),H=Pe(n(968)),W=Pe(n(969)),J=Pe(n(970)),Y=Pe(n(971)),K=Pe(n(972)),G=Pe(n(973)),$=Pe(n(974)),Z=Pe(n(975)),X=Pe(n(976)),Q=n(977),ee=Pe(Q),te=Pe(n(978)),ne=Pe(n(979)),re=Pe(n(980)),oe=Pe(n(981)),ie=Pe(n(982)),ae=Pe(n(983)),ue=Pe(n(985)),se=Pe(n(986)),le=Pe(n(987)),ce=Pe(n(988)),fe=Pe(n(989)),pe=Pe(n(414)),de=Pe(n(991)),he=Pe(n(992)),ve=Pe(n(993)),me=Pe(n(994)),ge=Pe(n(995)),ye=Pe(n(996)),be=Pe(n(997)),_e=Pe(n(998)),we=Pe(n(999)),Ee=Pe(n(1e3)),xe=Pe(n(1001)),Se=Pe(n(415)),Ce=Pe(n(1054)),ke=Oe(n(413)),Ae=Oe(n(1055));function Oe(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function Pe(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){var r=n(284),o=n(304),i=n(133),a=n(728),u=n(24);e.exports=function(e,t,n){var s=u(e)?r:a,l=arguments.length<3;return s(e,i(t,4),n,l,o)}},function(e,t){e.exports=function(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}},function(e,t,n){e.exports={default:n(730),__esModule:!0}},function(e,t,n){n(98),n(731),e.exports=n(15).Array.from},function(e,t,n){"use strict";var r=n(49),o=n(20),i=n(72),a=n(330),u=n(331),s=n(115),l=n(732),c=n(165);o(o.S+o.F*!n(332)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,o,f,p=i(e),d="function"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,m=void 0!==v,g=0,y=c(p);if(m&&(v=r(v,h>2?arguments[2]:void 0,2)),void 0==y||d==Array&&u(y))for(n=new d(t=s(p.length));t>g;g++)l(n,g,m?v(p[g],g):p[g]);else for(f=y.call(p),n=new d;!(o=f.next()).done;g++)l(n,g,m?a(f,v,[o.value,g],!0):o.value);return n.length=g,n}})},function(e,t,n){"use strict";var r=n(40),o=n(95);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},function(e,t,n){n(178),n(98),n(92),n(734),n(738),n(739),e.exports=n(15).Promise},function(e,t,n){"use strict";var r,o,i,a,u=n(114),s=n(21),l=n(49),c=n(166),f=n(20),p=n(28),d=n(94),h=n(205),v=n(145),m=n(335),g=n(336).set,y=n(736)(),b=n(206),_=n(337),w=n(338),E=s.TypeError,x=s.process,S=s.Promise,C="process"==c(x),k=function(){},A=o=b.f,O=!!function(){try{var e=S.resolve(1),t=(e.constructor={})[n(19)("species")]=function(e){e(k,k)};return(C||"function"==typeof PromiseRejectionEvent)&&e.then(k)instanceof t}catch(e){}}(),P=function(e){var t;return!(!p(e)||"function"!=typeof(t=e.then))&&t},T=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,u=o?t.ok:t.fail,s=t.resolve,l=t.reject,c=t.domain;try{u?(o||(2==e._h&&j(e),e._h=1),!0===u?n=r:(c&&c.enter(),n=u(r),c&&(c.exit(),a=!0)),n===t.promise?l(E("Promise-chain cycle")):(i=P(n))?i.call(n,s,l):s(n)):l(r)}catch(e){c&&!a&&c.exit(),l(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&M(e)})}},M=function(e){g.call(s,function(){var t,n,r,o=e._v,i=I(e);if(i&&(t=_(function(){C?x.emit("unhandledRejection",o,e):(n=s.onunhandledrejection)?n({promise:e,reason:o}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=C||I(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},I=function(e){return 1!==e._h&&0===(e._a||e._c).length},j=function(e){g.call(s,function(){var t;C?x.emit("rejectionHandled",e):(t=s.onrejectionhandled)&&t({promise:e,reason:e._v})})},N=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),T(t,!0))},R=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw E("Promise can't be resolved itself");(t=P(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,l(R,r,1),l(N,r,1))}catch(e){N.call(r,e)}}):(n._v=e,n._s=1,T(n,!1))}catch(e){N.call({_w:n,_d:!1},e)}}};O||(S=function(e){h(this,S,"Promise","_h"),d(e),r.call(this);try{e(l(R,this,1),l(N,this,1))}catch(e){N.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(207)(S.prototype,{then:function(e,t){var n=A(m(this,S));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=C?x.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&T(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=l(R,e,1),this.reject=l(N,e,1)},b.f=A=function(e){return e===S||e===a?new i(e):o(e)}),f(f.G+f.W+f.F*!O,{Promise:S}),n(97)(S,"Promise"),n(737)("Promise"),a=n(15).Promise,f(f.S+f.F*!O,"Promise",{reject:function(e){var t=A(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(u||!O),"Promise",{resolve:function(e){return w(u&&this===a?S:this,e)}}),f(f.S+f.F*!(O&&n(332)(function(e){S.all(e).catch(k)})),"Promise",{all:function(e){var t=this,n=A(t),r=n.resolve,o=n.reject,i=_(function(){var n=[],i=0,a=1;v(e,!1,function(e){var u=i++,s=!1;n.push(void 0),a++,t.resolve(e).then(function(e){s||(s=!0,n[u]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=A(t),r=n.reject,o=_(function(){v(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(21),o=n(336).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,s="process"==n(93)(a);e.exports=function(){var e,t,n,l=function(){var r,o;for(s&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(s)n=function(){a.nextTick(l)};else if(!i||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var c=u.resolve();n=function(){c.then(l)}}else n=function(){o.call(r,l)};else{var f=!0,p=document.createTextNode("");new i(l).observe(p,{characterData:!0}),n=function(){p.data=f=!f}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t,n){"use strict";var r=n(21),o=n(15),i=n(40),a=n(44),u=n(19)("species");e.exports=function(e){var t="function"==typeof o[e]?o[e]:r[e];a&&t&&!t[u]&&i.f(t,u,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(20),o=n(15),i=n(21),a=n(335),u=n(338);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,o.Promise||i.Promise),n="function"==typeof e;return this.then(n?function(n){return u(t,e()).then(function(){return n})}:e,n?function(n){return u(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(20),o=n(206),i=n(337);r(r.S,"Promise",{try:function(e){var t=o.f(this),n=i(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){var r=function(){return this}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(741),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag",l="object"==typeof e,c=t.regeneratorRuntime;if(c)l&&(e.exports=c);else{(c=t.regeneratorRuntime=l?e.exports:{}).wrap=_;var f="suspendedStart",p="suspendedYield",d="executing",h="completed",v={},m={};m[a]=function(){return this};var g=Object.getPrototypeOf,y=g&&g(g(M([])));y&&y!==r&&o.call(y,a)&&(m=y);var b=S.prototype=E.prototype=Object.create(m);x.prototype=b.constructor=S,S.constructor=x,S[s]=x.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(b),e},c.awrap=function(e){return{__await:e}},C(k.prototype),k.prototype[u]=function(){return this},c.AsyncIterator=k,c.async=function(e,t,n,r){var o=new k(_(e,t,n,r));return c.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},C(b),b[s]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},c.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},c.values=M,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,o){return u.type="throw",u.arg=e,t.next=r,o&&(t.method="next",t.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:M(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function _(e,t,n,r){var o=t&&t.prototype instanceof E?t:E,i=Object.create(o.prototype),a=new T(r||[]);return i._invoke=function(e,t,n){var r=f;return function(o,i){if(r===d)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return I()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=A(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var s=w(e,t,n);if("normal"===s.type){if(r=n.done?h:p,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=h,n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function w(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function E(){}function x(){}function S(){}function C(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function k(e){var t;this._invoke=function(n,r){function i(){return new Promise(function(t,i){!function t(n,r,i,a){var u=w(e[n],e,r);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&o.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,i,a)},function(e){t("throw",e,i,a)}):Promise.resolve(l).then(function(e){s.value=e,i(s)},a)}a(u.arg)}(n,r,t,i)})}return t=t?t.then(i,i):i()}}function A(e,t){var r=e.iterator[t.method];if(r===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,A(e,t),"throw"===t.method))return v;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=w(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,v;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,v):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(o.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=n,t.done=!0,t};return i.next=i}}return{next:I}}function I(){return{value:n,done:!0}}}(function(){return this}()||Function("return this")())},function(e,t,n){"use strict";var r=n(743),o=n(761);function i(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}e.exports.Type=n(16),e.exports.Schema=n(86),e.exports.FAILSAFE_SCHEMA=n(209),e.exports.JSON_SCHEMA=n(342),e.exports.CORE_SCHEMA=n(341),e.exports.DEFAULT_SAFE_SCHEMA=n(108),e.exports.DEFAULT_FULL_SCHEMA=n(146),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.safeLoad=r.safeLoad,e.exports.safeLoadAll=r.safeLoadAll,e.exports.dump=o.dump,e.exports.safeDump=o.safeDump,e.exports.YAMLException=n(107),e.exports.MINIMAL_SCHEMA=n(209),e.exports.SAFE_SCHEMA=n(108),e.exports.DEFAULT_SCHEMA=n(146),e.exports.scan=i("scan"),e.exports.parse=i("parse"),e.exports.compose=i("compose"),e.exports.addConstructor=i("addConstructor")},function(e,t,n){"use strict";var r=n(85),o=n(107),i=n(744),a=n(108),u=n(146),s=Object.prototype.hasOwnProperty,l=1,c=2,f=3,p=4,d=1,h=2,v=3,m=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g=/[\x85\u2028\u2029]/,y=/[,\[\]\{\}]/,b=/^(?:!|!!|![a-z\-]+!)$/i,_=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function w(e){return 10===e||13===e}function E(e){return 9===e||32===e}function x(e){return 9===e||32===e||10===e||13===e}function S(e){return 44===e||91===e||93===e||123===e||125===e}function C(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function k(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e?"\t":9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function A(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var O=new Array(256),P=new Array(256),T=0;T<256;T++)O[T]=k(T)?1:0,P[T]=k(T);function M(e,t){return new o(t,new i(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function I(e,t){throw M(e,t)}function j(e,t){e.onWarning&&e.onWarning.call(null,M(e,t))}var N={YAML:function(e,t,n){var r,o,i;null!==e.version&&I(e,"duplication of %YAML directive"),1!==n.length&&I(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&I(e,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),i=parseInt(r[2],10),1!==o&&I(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=i<2,1!==i&&2!==i&&j(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,o;2!==n.length&&I(e,"TAG directive accepts exactly two arguments"),r=n[0],o=n[1],b.test(r)||I(e,"ill-formed tag handle (first argument) of the TAG directive"),s.call(e.tagMap,r)&&I(e,'there is a previously declared suffix for "'+r+'" tag handle'),_.test(o)||I(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=o}};function R(e,t,n,r){var o,i,a,u;if(t<n){if(u=e.input.slice(t,n),r)for(o=0,i=u.length;o<i;o+=1)9===(a=u.charCodeAt(o))||32<=a&&a<=1114111||I(e,"expected valid JSON character");else m.test(u)&&I(e,"the stream contains non-printable characters");e.result+=u}}function D(e,t,n,o){var i,a,u,l;for(r.isObject(n)||I(e,"cannot merge mappings; the provided source object is unacceptable"),u=0,l=(i=Object.keys(n)).length;u<l;u+=1)a=i[u],s.call(t,a)||(t[a]=n[a],o[a]=!0)}function L(e,t,n,r,o,i,a,u){var l,c;if(o=String(o),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(i))for(l=0,c=i.length;l<c;l+=1)D(e,t,i[l],n);else D(e,t,i,n);else e.json||s.call(n,o)||!s.call(t,o)||(e.line=a||e.line,e.position=u||e.position,I(e,"duplicated mapping key")),t[o]=i,delete n[o];return t}function U(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):I(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function q(e,t,n){for(var r=0,o=e.input.charCodeAt(e.position);0!==o;){for(;E(o);)o=e.input.charCodeAt(++e.position);if(t&&35===o)do{o=e.input.charCodeAt(++e.position)}while(10!==o&&13!==o&&0!==o);if(!w(o))break;for(U(e),o=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&j(e,"deficient indentation"),r}function F(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!x(t)))}function z(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}function B(e,t){var n,r,o=e.tag,i=e.anchor,a=[],u=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),r=e.input.charCodeAt(e.position);0!==r&&45===r&&x(e.input.charCodeAt(e.position+1));)if(u=!0,e.position++,q(e,!0,-1)&&e.lineIndent<=t)a.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,W(e,t,f,!1,!0),a.push(e.result),q(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)I(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!u&&(e.tag=o,e.anchor=i,e.kind="sequence",e.result=a,!0)}function V(e){var t,n,r,o,i=!1,a=!1;if(33!==(o=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&I(e,"duplication of a tag property"),60===(o=e.input.charCodeAt(++e.position))?(i=!0,o=e.input.charCodeAt(++e.position)):33===o?(a=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",t=e.position,i){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&62!==o);e.position<e.length?(r=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):I(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==o&&!x(o);)33===o&&(a?I(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),b.test(n)||I(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),y.test(r)&&I(e,"tag suffix cannot contain flow indicator characters")}return r&&!_.test(r)&&I(e,"tag name cannot contain such characters: "+r),i?e.tag=r:s.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:I(e,'undeclared tag handle "'+n+'"'),!0}function H(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&I(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!x(n)&&!S(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&I(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function W(e,t,n,o,i){var a,u,m,g,y,b,_,k,T=1,M=!1,j=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=u=m=p===n||f===n,o&&q(e,!0,-1)&&(M=!0,e.lineIndent>t?T=1:e.lineIndent===t?T=0:e.lineIndent<t&&(T=-1)),1===T)for(;V(e)||H(e);)q(e,!0,-1)?(M=!0,m=a,e.lineIndent>t?T=1:e.lineIndent===t?T=0:e.lineIndent<t&&(T=-1)):m=!1;if(m&&(m=M||i),1!==T&&p!==n||(_=l===n||c===n?t:t+1,k=e.position-e.lineStart,1===T?m&&(B(e,k)||function(e,t,n){var r,o,i,a,u,s=e.tag,l=e.anchor,f={},d={},h=null,v=null,m=null,g=!1,y=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=f),u=e.input.charCodeAt(e.position);0!==u;){if(r=e.input.charCodeAt(e.position+1),i=e.line,a=e.position,63!==u&&58!==u||!x(r)){if(!W(e,n,c,!1,!0))break;if(e.line===i){for(u=e.input.charCodeAt(e.position);E(u);)u=e.input.charCodeAt(++e.position);if(58===u)x(u=e.input.charCodeAt(++e.position))||I(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(L(e,f,d,h,v,null),h=v=m=null),y=!0,g=!1,o=!1,h=e.tag,v=e.result;else{if(!y)return e.tag=s,e.anchor=l,!0;I(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return e.tag=s,e.anchor=l,!0;I(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===u?(g&&(L(e,f,d,h,v,null),h=v=m=null),y=!0,g=!0,o=!0):g?(g=!1,o=!0):I(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,u=r;if((e.line===i||e.lineIndent>t)&&(W(e,t,p,!0,o)&&(g?v=e.result:m=e.result),g||(L(e,f,d,h,v,m,i,a),h=v=m=null),q(e,!0,-1),u=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==u)I(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return g&&L(e,f,d,h,v,null),y&&(e.tag=s,e.anchor=l,e.kind="mapping",e.result=f),y}(e,k,_))||function(e,t){var n,r,o,i,a,u,s,c,f,p,d=!0,h=e.tag,v=e.anchor,m={};if(91===(p=e.input.charCodeAt(e.position)))o=93,u=!1,r=[];else{if(123!==p)return!1;o=125,u=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),p=e.input.charCodeAt(++e.position);0!==p;){if(q(e,!0,t),(p=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=h,e.anchor=v,e.kind=u?"mapping":"sequence",e.result=r,!0;d||I(e,"missed comma between flow collection entries"),c=s=f=null,i=a=!1,63===p&&x(e.input.charCodeAt(e.position+1))&&(i=a=!0,e.position++,q(e,!0,t)),n=e.line,W(e,t,l,!1,!0),c=e.tag,s=e.result,q(e,!0,t),p=e.input.charCodeAt(e.position),!a&&e.line!==n||58!==p||(i=!0,p=e.input.charCodeAt(++e.position),q(e,!0,t),W(e,t,l,!1,!0),f=e.result),u?L(e,r,m,c,s,f):i?r.push(L(e,null,m,c,s,f)):r.push(s),q(e,!0,t),44===(p=e.input.charCodeAt(e.position))?(d=!0,p=e.input.charCodeAt(++e.position)):d=!1}I(e,"unexpected end of the stream within a flow collection")}(e,_)?j=!0:(u&&function(e,t){var n,o,i,a,u,s=d,l=!1,c=!1,f=t,p=0,m=!1;if(124===(a=e.input.charCodeAt(e.position)))o=!1;else{if(62!==a)return!1;o=!0}for(e.kind="scalar",e.result="";0!==a;)if(43===(a=e.input.charCodeAt(++e.position))||45===a)d===s?s=43===a?v:h:I(e,"repeat of a chomping mode identifier");else{if(!((i=48<=(u=a)&&u<=57?u-48:-1)>=0))break;0===i?I(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?I(e,"repeat of an indentation width identifier"):(f=t+i-1,c=!0)}if(E(a)){do{a=e.input.charCodeAt(++e.position)}while(E(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!w(a)&&0!==a)}for(;0!==a;){for(U(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!c||e.lineIndent<f)&&32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>f&&(f=e.lineIndent),w(a))p++;else{if(e.lineIndent<f){s===v?e.result+=r.repeat("\n",l?1+p:p):s===d&&l&&(e.result+="\n");break}for(o?E(a)?(m=!0,e.result+=r.repeat("\n",l?1+p:p)):m?(m=!1,e.result+=r.repeat("\n",p+1)):0===p?l&&(e.result+=" "):e.result+=r.repeat("\n",p):e.result+=r.repeat("\n",l?1+p:p),l=!0,c=!0,p=0,n=e.position;!w(a)&&0!==a;)a=e.input.charCodeAt(++e.position);R(e,n,e.position,!1)}}return!0}(e,_)||function(e,t){var n,r,o;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(R(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,o=e.position}else w(n)?(R(e,r,o,!0),z(e,q(e,!1,t)),r=o=e.position):e.position===e.lineStart&&F(e)?I(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);I(e,"unexpected end of the stream within a single quoted scalar")}(e,_)||function(e,t){var n,r,o,i,a,u,s;if(34!==(u=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(u=e.input.charCodeAt(e.position));){if(34===u)return R(e,n,e.position,!0),e.position++,!0;if(92===u){if(R(e,n,e.position,!0),w(u=e.input.charCodeAt(++e.position)))q(e,!1,t);else if(u<256&&O[u])e.result+=P[u],e.position++;else if((a=120===(s=u)?2:117===s?4:85===s?8:0)>0){for(o=a,i=0;o>0;o--)(a=C(u=e.input.charCodeAt(++e.position)))>=0?i=(i<<4)+a:I(e,"expected hexadecimal character");e.result+=A(i),e.position++}else I(e,"unknown escape sequence");n=r=e.position}else w(u)?(R(e,n,r,!0),z(e,q(e,!1,t)),n=r=e.position):e.position===e.lineStart&&F(e)?I(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}I(e,"unexpected end of the stream within a double quoted scalar")}(e,_)?j=!0:!function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!x(r)&&!S(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&I(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||I(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],q(e,!0,-1),!0}(e)?function(e,t,n){var r,o,i,a,u,s,l,c,f=e.kind,p=e.result;if(x(c=e.input.charCodeAt(e.position))||S(c)||35===c||38===c||42===c||33===c||124===c||62===c||39===c||34===c||37===c||64===c||96===c)return!1;if((63===c||45===c)&&(x(r=e.input.charCodeAt(e.position+1))||n&&S(r)))return!1;for(e.kind="scalar",e.result="",o=i=e.position,a=!1;0!==c;){if(58===c){if(x(r=e.input.charCodeAt(e.position+1))||n&&S(r))break}else if(35===c){if(x(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&F(e)||n&&S(c))break;if(w(c)){if(u=e.line,s=e.lineStart,l=e.lineIndent,q(e,!1,-1),e.lineIndent>=t){a=!0,c=e.input.charCodeAt(e.position);continue}e.position=i,e.line=u,e.lineStart=s,e.lineIndent=l;break}}a&&(R(e,o,i,!1),z(e,e.line-u),o=i=e.position,a=!1),E(c)||(i=e.position+1),c=e.input.charCodeAt(++e.position)}return R(e,o,i,!1),!!e.result||(e.kind=f,e.result=p,!1)}(e,_,l===n)&&(j=!0,null===e.tag&&(e.tag="?")):(j=!0,null===e.tag&&null===e.anchor||I(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===T&&(j=m&&B(e,k))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(g=0,y=e.implicitTypes.length;g<y;g+=1)if((b=e.implicitTypes[g]).resolve(e.result)){e.result=b.construct(e.result),e.tag=b.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else s.call(e.typeMap[e.kind||"fallback"],e.tag)?(b=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&b.kind!==e.kind&&I(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result)?(e.result=b.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):I(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):I(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||j}function J(e){var t,n,r,o,i=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(o=e.input.charCodeAt(e.position))&&(q(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==o));){for(a=!0,o=e.input.charCodeAt(++e.position),t=e.position;0!==o&&!x(o);)o=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&I(e,"directive name must not be less than one character in length");0!==o;){for(;E(o);)o=e.input.charCodeAt(++e.position);if(35===o){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&!w(o));break}if(w(o))break;for(t=e.position;0!==o&&!x(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==o&&U(e),s.call(N,n)?N[n](e,n,r):j(e,'unknown document directive "'+n+'"')}q(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,q(e,!0,-1)):a&&I(e,"directives end mark is expected"),W(e,e.lineIndent-1,p,!1,!0),q(e,!0,-1),e.checkLineBreaks&&g.test(e.input.slice(i,e.position))&&j(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&F(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,q(e,!0,-1)):e.position<e.length-1&&I(e,"end of the stream or a document separator is expected")}function Y(e,t){e=String(e),t=t||{},0!==e.length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new function(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||u,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}(e,t);for(n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)J(n);return n.documents}function K(e,t,n){var r,o,i=Y(e,n);if("function"!=typeof t)return i;for(r=0,o=i.length;r<o;r+=1)t(i[r])}function G(e,t){var n=Y(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new o("expected a single document in the stream, but found more")}}e.exports.loadAll=K,e.exports.load=G,e.exports.safeLoadAll=function(e,t,n){if("function"!=typeof t)return K(e,r.extend({schema:a},n));K(e,t,r.extend({schema:a},n))},e.exports.safeLoad=function(e,t){return G(e,r.extend({schema:a},t))}},function(e,t,n){"use strict";var r=n(85);function o(e,t,n,r,o){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=o}o.prototype.getSnippet=function(e,t){var n,o,i,a,u;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",o=this.position;o>0&&-1==="\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(o-1));)if(o-=1,this.position-o>t/2-1){n=" ... ",o+=5;break}for(i="",a=this.position;a<this.buffer.length&&-1==="\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(a));)if((a+=1)-this.position>t/2-1){i=" ... ",a-=5;break}return u=this.buffer.slice(o,a),r.repeat(" ",e)+n+u+i+"\n"+r.repeat(" ",e+this.position-o+n.length)+"^"},o.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},e.exports=o},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(85),o=n(16);function i(e){return 48<=e&&e<=55}function a(e){return 48<=e&&e<=57}e.exports=new o("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,o=0,u=!1;if(!r)return!1;if("-"!==(t=e[o])&&"+"!==t||(t=e[++o]),"0"===t){if(o+1===r)return!0;if("b"===(t=e[++o])){for(o++;o<r;o++)if("_"!==(t=e[o])){if("0"!==t&&"1"!==t)return!1;u=!0}return u&&"_"!==t}if("x"===t){for(o++;o<r;o++)if("_"!==(t=e[o])){if(!(48<=(n=e.charCodeAt(o))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;u=!0}return u&&"_"!==t}for(;o<r;o++)if("_"!==(t=e[o])){if(!i(e.charCodeAt(o)))return!1;u=!0}return u&&"_"!==t}if("_"===t)return!1;for(;o<r;o++)if("_"!==(t=e[o])){if(":"===t)break;if(!a(e.charCodeAt(o)))return!1;u=!0}return!(!u||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(o)))},construct:function(e){var t,n,r=e,o=1,i=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(t=r[0])&&"+"!==t||("-"===t&&(o=-1),t=(r=r.slice(1))[0]),"0"===r?0:"0"===t?"b"===r[1]?o*parseInt(r.slice(2),2):"x"===r[1]?o*parseInt(r,16):o*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(e){i.unshift(parseInt(e,10))}),r=0,n=1,i.forEach(function(e){r+=e*n,n*=60}),o*r):o*parseInt(r,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!r.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(e,t,n){"use strict";var r=n(85),o=n(16),i=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var a=/^[-+]?[0-9]+e/;e.exports=new o("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!i.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,r,o;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,o=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(e){o.unshift(parseFloat(e,10))}),t=0,r=1,o.forEach(function(e){t+=e*r,r*=60}),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||r.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(e))return"-0.0";return n=e.toString(10),a.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(16),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==o.exec(e)||null!==i.exec(e))},construct:function(e){var t,n,r,a,u,s,l,c,f=0,p=null;if(null===(t=o.exec(e))&&(t=i.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(n,r,a));if(u=+t[4],s=+t[5],l=+t[6],t[7]){for(f=t[7].slice(0,3);f.length<3;)f+="0";f=+f}return t[9]&&(p=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(p=-p)),c=new Date(Date.UTC(n,r,a,u,s,l,f)),p&&c.setTime(c.getTime()-p),c},instanceOf:Date,represent:function(e){return e.toISOString()}})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},function(e,t,n){"use strict";var r;try{r=n(54).Buffer}catch(e){}var o=n(16),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new o("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,o=e.length,a=i;for(n=0;n<o;n++)if(!((t=a.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,o=e.replace(/[\r\n=]/g,""),a=o.length,u=i,s=0,l=[];for(t=0;t<a;t++)t%4==0&&t&&(l.push(s>>16&255),l.push(s>>8&255),l.push(255&s)),s=s<<6|u.indexOf(o.charAt(t));return 0==(n=a%4*6)?(l.push(s>>16&255),l.push(s>>8&255),l.push(255&s)):18===n?(l.push(s>>10&255),l.push(s>>2&255)):12===n&&l.push(s>>4&255),r?r.from?r.from(l):new r(l):l},predicate:function(e){return r&&r.isBuffer(e)},represent:function(e){var t,n,r="",o=0,a=e.length,u=i;for(t=0;t<a;t++)t%3==0&&t&&(r+=u[o>>18&63],r+=u[o>>12&63],r+=u[o>>6&63],r+=u[63&o]),o=(o<<8)+e[t];return 0==(n=a%3)?(r+=u[o>>18&63],r+=u[o>>12&63],r+=u[o>>6&63],r+=u[63&o]):2===n?(r+=u[o>>10&63],r+=u[o>>4&63],r+=u[o<<2&63],r+=u[64]):1===n&&(r+=u[o>>2&63],r+=u[o<<4&63],r+=u[64],r+=u[64]),r}})},function(e,t,n){"use strict";var r=n(16),o=Object.prototype.hasOwnProperty,i=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,a,u,s=[],l=e;for(t=0,n=l.length;t<n;t+=1){if(r=l[t],u=!1,"[object Object]"!==i.call(r))return!1;for(a in r)if(o.call(r,a)){if(u)return!1;u=!0}if(!u)return!1;if(-1!==s.indexOf(a))return!1;s.push(a)}return!0},construct:function(e){return null!==e?e:[]}})},function(e,t,n){"use strict";var r=n(16),o=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,a,u=e;for(a=new Array(u.length),t=0,n=u.length;t<n;t+=1){if(r=u[t],"[object Object]"!==o.call(r))return!1;if(1!==(i=Object.keys(r)).length)return!1;a[t]=[i[0],r[i[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,o,i,a=e;for(i=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],o=Object.keys(r),i[t]=[o[0],r[o[0]]];return i}})},function(e,t,n){"use strict";var r=n(16),o=Object.prototype.hasOwnProperty;e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(o.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}})},function(e,t,n){"use strict";var r;"undefined"!=typeof window&&(r=window.esprima);var o=n(16);e.exports=new o("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",n=r.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(e){return!1}},construct:function(e){var t,n="("+e+")",o=r.parse(n,{range:!0}),i=[];if("Program"!==o.type||1!==o.body.length||"ExpressionStatement"!==o.body[0].type||"ArrowFunctionExpression"!==o.body[0].expression.type&&"FunctionExpression"!==o.body[0].expression.type)throw new Error("Failed to resolve function");return o.body[0].expression.params.forEach(function(e){i.push(e.name)}),t=o.body[0].expression.body.range,"BlockStatement"===o.body[0].expression.body.type?new Function(i,n.slice(t[0]+1,t[1]-1)):new Function(i,"return "+n.slice(t[0],t[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}})},function(e,t,n){"use strict";var r=n(85),o=n(107),i=n(146),a=n(108),u=Object.prototype.toString,s=Object.prototype.hasOwnProperty,l=9,c=10,f=32,p=33,d=34,h=35,v=37,m=38,g=39,y=42,b=44,_=45,w=58,E=62,x=63,S=64,C=91,k=93,A=96,O=123,P=124,T=125,M={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},I=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function j(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else{if(!(e<=4294967295))throw new o("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+r.repeat("0",i-t.length)+t}function N(e){this.schema=e.schema||i,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=r.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,o,i,a,u,l;if(null===t)return{};for(n={},o=0,i=(r=Object.keys(t)).length;o<i;o+=1)a=r[o],u=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(l=e.compiledTypeMap.fallback[a])&&s.call(l.styleAliases,u)&&(u=l.styleAliases[u]),n[a]=u;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function R(e,t){for(var n,o=r.repeat(" ",t),i=0,a=-1,u="",s=e.length;i<s;)-1===(a=e.indexOf("\n",i))?(n=e.slice(i),i=s):(n=e.slice(i,a+1),i=a+1),n.length&&"\n"!==n&&(u+=o),u+=n;return u}function D(e,t){return"\n"+r.repeat(" ",e.indent*t)}function L(e){return e===f||e===l}function U(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function q(e){return U(e)&&65279!==e&&e!==b&&e!==C&&e!==k&&e!==O&&e!==T&&e!==w&&e!==h}function F(e){return/^\n* /.test(e)}var z=1,B=2,V=3,H=4,W=5;function J(e,t,n,r,o){var i,a,u,s=!1,l=!1,f=-1!==r,M=-1,I=U(u=e.charCodeAt(0))&&65279!==u&&!L(u)&&u!==_&&u!==x&&u!==w&&u!==b&&u!==C&&u!==k&&u!==O&&u!==T&&u!==h&&u!==m&&u!==y&&u!==p&&u!==P&&u!==E&&u!==g&&u!==d&&u!==v&&u!==S&&u!==A&&!L(e.charCodeAt(e.length-1));if(t)for(i=0;i<e.length;i++){if(!U(a=e.charCodeAt(i)))return W;I=I&&q(a)}else{for(i=0;i<e.length;i++){if((a=e.charCodeAt(i))===c)s=!0,f&&(l=l||i-M-1>r&&" "!==e[M+1],M=i);else if(!U(a))return W;I=I&&q(a)}l=l||f&&i-M-1>r&&" "!==e[M+1]}return s||l?n>9&&F(e)?W:l?H:V:I&&!o(e)?z:B}function Y(e,t,n,r){e.dump=function(){if(0===t.length)return"''";if(!e.noCompatMode&&-1!==I.indexOf(t))return"'"+t+"'";var i=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),u=r||e.flowLevel>-1&&n>=e.flowLevel;switch(J(t,u,e.indent,a,function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)})){case z:return t;case B:return"'"+t.replace(/'/g,"''")+"'";case V:return"|"+K(t,e.indent)+G(R(t,i));case H:return">"+K(t,e.indent)+G(R(function(e,t){var n,r,o=/(\n+)([^\n]*)/g,i=(u=e.indexOf("\n"),u=-1!==u?u:e.length,o.lastIndex=u,$(e.slice(0,u),t)),a="\n"===e[0]||" "===e[0];var u;for(;r=o.exec(e);){var s=r[1],l=r[2];n=" "===l[0],i+=s+(a||n||""===l?"":"\n")+$(l,t),a=n}return i}(t,a),i));case W:return'"'+function(e){for(var t,n,r,o="",i=0;i<e.length;i++)(t=e.charCodeAt(i))>=55296&&t<=56319&&(n=e.charCodeAt(i+1))>=56320&&n<=57343?(o+=j(1024*(t-55296)+n-56320+65536),i++):(r=M[t],o+=!r&&U(t)?e[i]:r||j(t));return o}(t)+'"';default:throw new o("impossible error: invalid scalar style")}}()}function K(e,t){var n=F(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function G(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function $(e,t){if(""===e||" "===e[0])return e;for(var n,r,o=/ [^ ]/g,i=0,a=0,u=0,s="";n=o.exec(e);)(u=n.index)-i>t&&(r=a>i?a:u,s+="\n"+e.slice(i,r),i=r+1),a=u;return s+="\n",e.length-i>t&&a>i?s+=e.slice(i,a)+"\n"+e.slice(a+1):s+=e.slice(i),s.slice(1)}function Z(e,t,n){var r,i,a,l,c,f;for(a=0,l=(i=n?e.explicitTypes:e.implicitTypes).length;a<l;a+=1)if(((c=i[a]).instanceOf||c.predicate)&&(!c.instanceOf||"object"==typeof t&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(e.tag=n?c.tag:"?",c.represent){if(f=e.styleMap[c.tag]||c.defaultStyle,"[object Function]"===u.call(c.represent))r=c.represent(t,f);else{if(!s.call(c.represent,f))throw new o("!<"+c.tag+'> tag resolver accepts not "'+f+'" style');r=c.represent[f](t,f)}e.dump=r}return!0}return!1}function X(e,t,n,r,i,a){e.tag=null,e.dump=n,Z(e,n,!1)||Z(e,n,!0);var s=u.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var l,f,p="[object Object]"===s||"[object Array]"===s;if(p&&(f=-1!==(l=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||f||2!==e.indent&&t>0)&&(i=!1),f&&e.usedDuplicates[l])e.dump="*ref_"+l;else{if(p&&f&&!e.usedDuplicates[l]&&(e.usedDuplicates[l]=!0),"[object Object]"===s)r&&0!==Object.keys(e.dump).length?(!function(e,t,n,r){var i,a,u,s,l,f,p="",d=e.tag,h=Object.keys(n);if(!0===e.sortKeys)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new o("sortKeys must be a boolean or a function");for(i=0,a=h.length;i<a;i+=1)f="",r&&0===i||(f+=D(e,t)),s=n[u=h[i]],X(e,t+1,u,!0,!0,!0)&&((l=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&c===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,l&&(f+=D(e,t)),X(e,t+1,s,!0,l)&&(e.dump&&c===e.dump.charCodeAt(0)?f+=":":f+=": ",p+=f+=e.dump));e.tag=d,e.dump=p||"{}"}(e,t,e.dump,i),f&&(e.dump="&ref_"+l+e.dump)):(!function(e,t,n){var r,o,i,a,u,s="",l=e.tag,c=Object.keys(n);for(r=0,o=c.length;r<o;r+=1)u=e.condenseFlow?'"':"",0!==r&&(u+=", "),a=n[i=c[r]],X(e,t,i,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),X(e,t,a,!1,!1)&&(s+=u+=e.dump));e.tag=l,e.dump="{"+s+"}"}(e,t,e.dump),f&&(e.dump="&ref_"+l+" "+e.dump));else if("[object Array]"===s)r&&0!==e.dump.length?(!function(e,t,n,r){var o,i,a="",u=e.tag;for(o=0,i=n.length;o<i;o+=1)X(e,t+1,n[o],!0,!0)&&(r&&0===o||(a+=D(e,t)),e.dump&&c===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=u,e.dump=a||"[]"}(e,t,e.dump,i),f&&(e.dump="&ref_"+l+e.dump)):(!function(e,t,n){var r,o,i="",a=e.tag;for(r=0,o=n.length;r<o;r+=1)X(e,t,n[r],!1,!1)&&(0!==r&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=a,e.dump="["+i+"]"}(e,t,e.dump),f&&(e.dump="&ref_"+l+" "+e.dump));else{if("[object String]"!==s){if(e.skipInvalid)return!1;throw new o("unacceptable kind of an object to dump "+s)}"?"!==e.tag&&Y(e,e.dump,t,a)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function Q(e,t){var n,r,o=[],i=[];for(function e(t,n,r){var o,i,a;if(null!==t&&"object"==typeof t)if(-1!==(i=n.indexOf(t)))-1===r.indexOf(i)&&r.push(i);else if(n.push(t),Array.isArray(t))for(i=0,a=t.length;i<a;i+=1)e(t[i],n,r);else for(o=Object.keys(t),i=0,a=o.length;i<a;i+=1)e(t[o[i]],n,r)}(e,o,i),n=0,r=i.length;n<r;n+=1)t.duplicates.push(o[i[n]]);t.usedDuplicates=new Array(r)}function ee(e,t){var n=new N(t=t||{});return n.noRefs||Q(e,n),X(n,0,e,!0,!0)?n.dump+"\n":""}e.exports.dump=ee,e.exports.safeDump=function(e,t){return ee(e,r.extend({schema:a},t))}},function(e,t,n){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e){return decodeURIComponent(e.replace(/\+/g," "))}t.stringify=function(e,t){t=t||"";var n=[];for(var o in"string"!=typeof t&&(t="?"),e)r.call(e,o)&&n.push(encodeURIComponent(o)+"="+encodeURIComponent(e[o]));return n.length?t+n.join("&"):""},t.parse=function(e){for(var t,n=/([^=?&]+)=?([^&]*)/g,r={};t=n.exec(e);){var i=o(t[1]),a=o(t[2]);i in r||(r[i]=a)}return r}},function(e,t,n){var r=n(38),o=n(765),i=n(303),a="Expected a function",u=Math.max,s=Math.min;e.exports=function(e,t,n){var l,c,f,p,d,h,v=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError(a);function b(t){var n=l,r=c;return l=c=void 0,v=t,p=e.apply(r,n)}function _(e){var n=e-h;return void 0===h||n>=t||n<0||g&&e-v>=f}function w(){var e=o();if(_(e))return E(e);d=setTimeout(w,function(e){var n=t-(e-h);return g?s(n,f-(e-v)):n}(e))}function E(e){return d=void 0,y&&l?b(e):(l=c=void 0,p)}function x(){var e=o(),n=_(e);if(l=arguments,c=this,h=e,n){if(void 0===d)return function(e){return v=e,d=setTimeout(w,t),m?b(e):p}(h);if(g)return d=setTimeout(w,t),b(h)}return void 0===d&&(d=setTimeout(w,t)),p}return t=i(t)||0,r(n)&&(m=!!n.leading,f=(g="maxWait"in n)?u(i(n.maxWait)||0,t):f,y="trailing"in n?!!n.trailing:y),x.cancel=function(){void 0!==d&&clearTimeout(d),v=0,l=h=c=d=void 0},x.flush=function(){return void 0===d?p:E(o())},x}},function(e,t,n){var r=n(37);e.exports=function(){return r.Date.now()}},function(e,t,n){var r=n(344);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},function(e,t,n){n(768),e.exports=n(15).Object.getPrototypeOf},function(e,t,n){var r=n(72),o=n(242);n(258)("getPrototypeOf",function(){return function(e){return o(r(e))}})},function(e,t,n){e.exports={default:n(770),__esModule:!0}},function(e,t,n){n(771),e.exports=n(15).Object.setPrototypeOf},function(e,t,n){var r=n(20);r(r.S,"Object",{setPrototypeOf:n(772).set})},function(e,t,n){var r=n(28),o=n(36),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(49)(Function.call,n(261).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},function(e,t,n){n(774);var r=n(15).Object;e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){var r=n(20);r(r.S,"Object",{create:n(160)})},function(e,t,n){"use strict";e.exports=n(776)},function(e,t,n){"use strict";var r=n(14),o=n(777),i=n(374),a=n(88),u=n(43),s=n(849),l=n(850),c=n(375),f=n(851);n(10);o.inject();var p={findDOMNode:l,render:i.render,unmountComponentAtNode:i.unmountComponentAtNode,version:s,unstable_batchedUpdates:u.batchedUpdates,unstable_renderSubtreeIntoContainer:f};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ComponentTree:{getClosestInstanceFromNode:r.getClosestInstanceFromNode,getNodeFromInstance:function(e){return e._renderedComponent&&(e=c(e)),e?r.getNodeFromInstance(e):null}},Mount:i,Reconciler:a}),e.exports=p},function(e,t,n){"use strict";var r=n(778),o=n(779),i=n(783),a=n(786),u=n(787),s=n(788),l=n(789),c=n(795),f=n(14),p=n(820),d=n(821),h=n(822),v=n(823),m=n(824),g=n(826),y=n(827),b=n(833),_=n(834),w=n(835),E=!1;e.exports={inject:function(){E||(E=!0,g.EventEmitter.injectReactEventListener(m),g.EventPluginHub.injectEventPluginOrder(a),g.EventPluginUtils.injectComponentTree(f),g.EventPluginUtils.injectTreeTraversal(d),g.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:u,ChangeEventPlugin:i,SelectEventPlugin:_,BeforeInputEventPlugin:o}),g.HostComponent.injectGenericComponentClass(c),g.HostComponent.injectTextComponentClass(h),g.DOMProperty.injectDOMPropertyConfig(r),g.DOMProperty.injectDOMPropertyConfig(s),g.DOMProperty.injectDOMPropertyConfig(b),g.EmptyComponent.injectEmptyComponentFactory(function(e){return new p(e)}),g.Updates.injectReconcileTransaction(y),g.Updates.injectBatchingStrategy(v),g.Component.injectEnvironment(l))}}},function(e,t,n){"use strict";e.exports={Properties:{"aria-current":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},DOMAttributeNames:{},DOMPropertyNames:{}}},function(e,t,n){"use strict";var r=n(109),o=n(26),i=n(780),a=n(781),u=n(782),s=[9,13,27,32],l=229,c=o.canUseDOM&&"CompositionEvent"in window,f=null;o.canUseDOM&&"documentMode"in document&&(f=document.documentMode);var p,d=o.canUseDOM&&"TextEvent"in window&&!f&&!("object"==typeof(p=window.opera)&&"function"==typeof p.version&&parseInt(p.version(),10)<=12),h=o.canUseDOM&&(!c||f&&f>8&&f<=11);var v=32,m=String.fromCharCode(v),g={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},y=!1;function b(e,t){switch(e){case"topKeyUp":return-1!==s.indexOf(t.keyCode);case"topKeyDown":return t.keyCode!==l;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function _(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}var w=null;function E(e,t,n,o){var u,s;if(c?u=function(e){switch(e){case"topCompositionStart":return g.compositionStart;case"topCompositionEnd":return g.compositionEnd;case"topCompositionUpdate":return g.compositionUpdate}}(e):w?b(e,n)&&(u=g.compositionEnd):function(e,t){return"topKeyDown"===e&&t.keyCode===l}(e,n)&&(u=g.compositionStart),!u)return null;h&&(w||u!==g.compositionStart?u===g.compositionEnd&&w&&(s=w.getData()):w=i.getPooled(o));var f=a.getPooled(u,t,n,o);if(s)f.data=s;else{var p=_(n);null!==p&&(f.data=p)}return r.accumulateTwoPhaseDispatches(f),f}function x(e,t,n,o){var a;if(!(a=d?function(e,t){switch(e){case"topCompositionEnd":return _(t);case"topKeyPress":return t.which!==v?null:(y=!0,m);case"topTextInput":var n=t.data;return n===m&&y?null:n;default:return null}}(e,n):function(e,t){if(w){if("topCompositionEnd"===e||!c&&b(e,t)){var n=w.getData();return i.release(w),w=null,n}return null}switch(e){case"topPaste":return null;case"topKeyPress":return t.which&&!function(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}(t)?String.fromCharCode(t.which):null;case"topCompositionEnd":return h?null:t.data;default:return null}}(e,n)))return null;var s=u.getPooled(g.beforeInput,t,n,o);return s.data=a,r.accumulateTwoPhaseDispatches(s),s}var S={eventTypes:g,extractEvents:function(e,t,n,r){return[E(e,t,n,r),x(e,t,n,r)]}};e.exports=S},function(e,t,n){"use strict";var r=n(13),o=n(69),i=n(354);function a(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}r(a.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[i()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);var u=t>1?1-t:void 0;return this._fallbackText=o.slice(e,u),this._fallbackText}}),o.addPoolingTo(a),e.exports=a},function(e,t,n){"use strict";var r=n(48);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{data:null}),e.exports=o},function(e,t,n){"use strict";var r=n(48);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{data:null}),e.exports=o},function(e,t,n){"use strict";var r=n(110),o=n(109),i=n(26),a=n(14),u=n(43),s=n(48),l=n(357),c=n(214),f=n(215),p=n(358),d={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}};function h(e,t,n){var r=s.getPooled(d.change,e,t,n);return r.type="change",o.accumulateTwoPhaseDispatches(r),r}var v=null,m=null;var g=!1;function y(e){var t=h(m,e,c(e));u.batchedUpdates(b,t)}function b(e){r.enqueueEvents(e),r.processEventQueue(!1)}function _(){v&&(v.detachEvent("onchange",y),v=null,m=null)}function w(e,t){var n=l.updateValueIfChanged(e),r=!0===t.simulated&&M._allowSimulatedPassThrough;if(n||r)return e}function E(e,t){if("topChange"===e)return t}function x(e,t,n){"topFocus"===e?(_(),function(e,t){m=t,(v=e).attachEvent("onchange",y)}(t,n)):"topBlur"===e&&_()}i.canUseDOM&&(g=f("change")&&(!document.documentMode||document.documentMode>8));var S=!1;function C(){v&&(v.detachEvent("onpropertychange",k),v=null,m=null)}function k(e){"value"===e.propertyName&&w(m,e)&&y(e)}function A(e,t,n){"topFocus"===e?(C(),function(e,t){m=t,(v=e).attachEvent("onpropertychange",k)}(t,n)):"topBlur"===e&&C()}function O(e,t,n){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return w(m,n)}function P(e,t,n){if("topClick"===e)return w(t,n)}function T(e,t,n){if("topInput"===e||"topChange"===e)return w(t,n)}i.canUseDOM&&(S=f("input")&&(!document.documentMode||document.documentMode>9));var M={eventTypes:d,_allowSimulatedPassThrough:!0,_isInputEventSupported:S,extractEvents:function(e,t,n,r){var o,i,u,s,l=t?a.getNodeFromInstance(t):window;if("select"===(s=(u=l).nodeName&&u.nodeName.toLowerCase())||"input"===s&&"file"===u.type?g?o=E:i=x:p(l)?S?o=T:(o=O,i=A):function(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}(l)&&(o=P),o){var c=o(e,t,n);if(c)return h(c,n,r)}i&&i(e,l,t),"topBlur"===e&&function(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var r=""+t.value;t.getAttribute("value")!==r&&t.setAttribute("value",r)}}}(t,l)}};e.exports=M},function(e,t,n){"use strict";var r=n(785),o={};o.attachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&function(e,t,n){"function"==typeof e?e(t.getPublicInstance()):r.addComponentAsRefTo(t,e,n)}(n,e,t._owner)}},o.shouldUpdateRefs=function(e,t){var n=null,r=null;null!==e&&"object"==typeof e&&(n=e.ref,r=e._owner);var o=null,i=null;return null!==t&&"object"==typeof t&&(o=t.ref,i=t._owner),n!==o||"string"==typeof o&&i!==r},o.detachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&function(e,t,n){"function"==typeof e?e(null):r.removeComponentAsRefFrom(t,e,n)}(n,e,t._owner)}},e.exports=o},function(e,t,n){"use strict";var r=n(11);n(8);function o(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)}var i={addComponentAsRefTo:function(e,t,n){o(n)||r("119"),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){o(n)||r("120");var i=n.getPublicInstance();i&&i.refs[t]===e.getPublicInstance()&&n.detachRef(t)}};e.exports=i},function(e,t,n){"use strict";e.exports=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"]},function(e,t,n){"use strict";var r=n(109),o=n(14),i=n(149),a={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},u={eventTypes:a,extractEvents:function(e,t,n,u){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var s,l,c;if(u.window===u)s=u;else{var f=u.ownerDocument;s=f?f.defaultView||f.parentWindow:window}if("topMouseOut"===e){l=t;var p=n.relatedTarget||n.toElement;c=p?o.getClosestInstanceFromNode(p):null}else l=null,c=t;if(l===c)return null;var d=null==l?s:o.getNodeFromInstance(l),h=null==c?s:o.getNodeFromInstance(c),v=i.getPooled(a.mouseLeave,l,n,u);v.type="mouseleave",v.target=d,v.relatedTarget=h;var m=i.getPooled(a.mouseEnter,c,n,u);return m.type="mouseenter",m.target=h,m.relatedTarget=d,r.accumulateEnterLeaveDispatches(v,m,l,c),[v,m]}};e.exports=u},function(e,t,n){"use strict";var r=n(87),o=r.injection.MUST_USE_PROPERTY,i=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_NUMERIC_VALUE,u=r.injection.HAS_POSITIVE_NUMERIC_VALUE,s=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,l={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:i,allowTransparency:0,alt:0,as:0,async:i,autoComplete:0,autoPlay:i,capture:i,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|i,cite:0,classID:0,className:0,cols:u,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:i,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:i,defer:i,dir:0,disabled:i,download:s,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:i,formTarget:0,frameBorder:0,headers:0,height:0,hidden:i,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:i,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|i,muted:o|i,name:0,nonce:0,noValidate:i,open:i,optimum:0,pattern:0,placeholder:0,playsInline:i,poster:0,preload:0,profile:0,radioGroup:0,readOnly:i,referrerPolicy:0,rel:0,required:i,reversed:i,role:0,rows:u,rowSpan:a,sandbox:0,scope:0,scoped:i,scrolling:0,seamless:i,selected:o|i,shape:0,size:u,sizes:0,span:u,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:a,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:i,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}};e.exports=l},function(e,t,n){"use strict";var r=n(217),o={processChildrenUpdates:n(794).dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};e.exports=o},function(e,t,n){"use strict";var r=n(11),o=n(89),i=n(26),a=n(791),u=n(34),s=(n(8),{dangerouslyReplaceNodeWithMarkup:function(e,t){if(i.canUseDOM||r("56"),t||r("57"),"HTML"===e.nodeName&&r("58"),"string"==typeof t){var n=a(t,u)[0];e.parentNode.replaceChild(n,e)}else o.replaceChildWithTree(e,t)}});e.exports=s},function(e,t,n){"use strict";var r=n(26),o=n(792),i=n(793),a=n(8),u=r.canUseDOM?document.createElement("div"):null,s=/^\s*<(\w+)/;e.exports=function(e,t){var n=u;u||a(!1);var r=function(e){var t=e.match(s);return t&&t[1].toLowerCase()}(e),l=r&&i(r);if(l){n.innerHTML=l[1]+e+l[2];for(var c=l[0];c--;)n=n.lastChild}else n.innerHTML=e;var f=n.getElementsByTagName("script");f.length&&(t||a(!1),o(f).forEach(t));for(var p=Array.from(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return p}},function(e,t,n){"use strict";var r=n(8);e.exports=function(e){return function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}(e)?Array.isArray(e)?e.slice():function(e){var t=e.length;if((Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e)&&r(!1),"number"!=typeof t&&r(!1),0===t||t-1 in e||r(!1),"function"==typeof e.callee&&r(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var n=Array(t),o=0;o<t;o++)n[o]=e[o];return n}(e):[e]}},function(e,t,n){"use strict";var r=n(26),o=n(8),i=r.canUseDOM?document.createElement("div"):null,a={},u=[1,'<select multiple="true">',"</select>"],s=[1,"<table>","</table>"],l=[3,"<table><tbody><tr>","</tr></tbody></table>"],c=[1,'<svg xmlns="http://www.w3.org/2000/svg">',"</svg>"],f={"*":[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:u,option:u,caption:s,colgroup:s,tbody:s,tfoot:s,thead:s,td:l,th:l};["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach(function(e){f[e]=c,a[e]=!0}),e.exports=function(e){return i||o(!1),f.hasOwnProperty(e)||(e="*"),a.hasOwnProperty(e)||(i.innerHTML="*"===e?"<link />":"<"+e+"></"+e+">",a[e]=!i.firstChild),a[e]?f[e]:null}},function(e,t,n){"use strict";var r=n(217),o=n(14),i={dangerouslyProcessChildrenUpdates:function(e,t){var n=o.getNodeFromInstance(e);r.processUpdates(n,t)}};e.exports=i},function(e,t,n){"use strict";var r=n(11),o=n(13),i=n(796),a=n(797),u=n(89),s=n(218),l=n(87),c=n(363),f=n(110),p=n(211),d=n(152),h=n(351),v=n(14),m=n(807),g=n(809),y=n(364),b=n(810),_=(n(39),n(811)),w=n(818),E=(n(34),n(151)),x=(n(8),n(215),n(222),n(357)),S=(n(226),n(10),h),C=f.deleteListener,k=v.getNodeFromInstance,A=d.listenTo,O=p.registrationNameModules,P={string:!0,number:!0},T="__html",M={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},I=11;function j(e){if(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" This DOM node was rendered by `"+n+"`."}}return""}function N(e,t){t&&(J[e._tag]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&r("137",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&r("60"),"object"==typeof t.dangerouslySetInnerHTML&&T in t.dangerouslySetInnerHTML||r("61")),null!=t.style&&"object"!=typeof t.style&&r("62",j(e)))}function R(e,t,n,r){if(!(r instanceof w)){0;var o=e._hostContainerInfo,i=o._node&&o._node.nodeType===I?o._node:o._ownerDocument;A(t,i),r.getReactMountReady().enqueue(D,{inst:e,registrationName:t,listener:n})}}function D(){f.putListener(this.inst,this.registrationName,this.listener)}function L(){m.postMountWrapper(this)}function U(){b.postMountWrapper(this)}function q(){g.postMountWrapper(this)}var F={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"};function z(){x.track(this)}function B(){this._rootNodeID||r("63");var e=k(this);switch(e||r("64"),this._tag){case"iframe":case"object":this._wrapperState.listeners=[d.trapBubbledEvent("topLoad","load",e)];break;case"video":case"audio":for(var t in this._wrapperState.listeners=[],F)F.hasOwnProperty(t)&&this._wrapperState.listeners.push(d.trapBubbledEvent(t,F[t],e));break;case"source":this._wrapperState.listeners=[d.trapBubbledEvent("topError","error",e)];break;case"img":this._wrapperState.listeners=[d.trapBubbledEvent("topError","error",e),d.trapBubbledEvent("topLoad","load",e)];break;case"form":this._wrapperState.listeners=[d.trapBubbledEvent("topReset","reset",e),d.trapBubbledEvent("topSubmit","submit",e)];break;case"input":case"select":case"textarea":this._wrapperState.listeners=[d.trapBubbledEvent("topInvalid","invalid",e)]}}function V(){y.postUpdateWrapper(this)}var H={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},W={listing:!0,pre:!0,textarea:!0},J=o({menuitem:!0},H),Y=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,K={},G={}.hasOwnProperty;function $(e,t){return e.indexOf("-")>=0||null!=t.is}var Z=1;function X(e){var t=e.type;!function(e){G.call(K,e)||(Y.test(e)||r("65",e),K[e]=!0)}(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}X.displayName="ReactDOMComponent",X.Mixin={mountComponent:function(e,t,n,r){this._rootNodeID=Z++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var o,a,l,f=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(B,this);break;case"input":m.mountWrapper(this,f,t),f=m.getHostProps(this,f),e.getReactMountReady().enqueue(z,this),e.getReactMountReady().enqueue(B,this);break;case"option":g.mountWrapper(this,f,t),f=g.getHostProps(this,f);break;case"select":y.mountWrapper(this,f,t),f=y.getHostProps(this,f),e.getReactMountReady().enqueue(B,this);break;case"textarea":b.mountWrapper(this,f,t),f=b.getHostProps(this,f),e.getReactMountReady().enqueue(z,this),e.getReactMountReady().enqueue(B,this)}if(N(this,f),null!=t?(o=t._namespaceURI,a=t._tag):n._tag&&(o=n._namespaceURI,a=n._tag),(null==o||o===s.svg&&"foreignobject"===a)&&(o=s.html),o===s.html&&("svg"===this._tag?o=s.svg:"math"===this._tag&&(o=s.mathml)),this._namespaceURI=o,e.useCreateElement){var p,d=n._ownerDocument;if(o===s.html)if("script"===this._tag){var h=d.createElement("div"),_=this._currentElement.type;h.innerHTML="<"+_+"></"+_+">",p=h.removeChild(h.firstChild)}else p=f.is?d.createElement(this._currentElement.type,f.is):d.createElement(this._currentElement.type);else p=d.createElementNS(o,this._currentElement.type);v.precacheNode(this,p),this._flags|=S.hasCachedChildNodes,this._hostParent||c.setAttributeForRoot(p),this._updateDOMProperties(null,f,e);var w=u(p);this._createInitialChildren(e,f,r,w),l=w}else{var E=this._createOpenTagMarkupAndPutListeners(e,f),x=this._createContentMarkup(e,f,r);l=!x&&H[this._tag]?E+"/>":E+">"+x+"</"+this._currentElement.type+">"}switch(this._tag){case"input":e.getReactMountReady().enqueue(L,this),f.autoFocus&&e.getReactMountReady().enqueue(i.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(U,this),f.autoFocus&&e.getReactMountReady().enqueue(i.focusDOMComponent,this);break;case"select":case"button":f.autoFocus&&e.getReactMountReady().enqueue(i.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(q,this)}return l},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(O.hasOwnProperty(r))i&&R(this,r,i,e);else{"style"===r&&(i&&(i=this._previousStyleCopy=o({},t.style)),i=a.createMarkupForStyles(i,this));var u=null;null!=this._tag&&$(this._tag,t)?M.hasOwnProperty(r)||(u=c.createMarkupForCustomAttribute(r,i)):u=c.createMarkupForProperty(r,i),u&&(n+=" "+u)}}return e.renderToStaticMarkup?n:(this._hostParent||(n+=" "+c.createMarkupForRoot()),n+=" "+c.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var i=P[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)r=E(i);else if(null!=a){r=this.mountChildren(a,e,n).join("")}}return W[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&u.queueHTML(r,o.__html);else{var i=P[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)""!==i&&u.queueText(r,i);else if(null!=a)for(var s=this.mountChildren(a,e,n),l=0;l<s.length;l++)u.queueChild(r,s[l])}},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){var o=t.props,i=this._currentElement.props;switch(this._tag){case"input":o=m.getHostProps(this,o),i=m.getHostProps(this,i);break;case"option":o=g.getHostProps(this,o),i=g.getHostProps(this,i);break;case"select":o=y.getHostProps(this,o),i=y.getHostProps(this,i);break;case"textarea":o=b.getHostProps(this,o),i=b.getHostProps(this,i)}switch(N(this,i),this._updateDOMProperties(o,i,e),this._updateDOMChildren(o,i,e,r),this._tag){case"input":m.updateWrapper(this),x.updateValueIfChanged(this);break;case"textarea":b.updateWrapper(this);break;case"select":e.getReactMountReady().enqueue(V,this)}},_updateDOMProperties:function(e,t,n){var r,i,u;for(r in e)if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&null!=e[r])if("style"===r){var s=this._previousStyleCopy;for(i in s)s.hasOwnProperty(i)&&((u=u||{})[i]="");this._previousStyleCopy=null}else O.hasOwnProperty(r)?e[r]&&C(this,r):$(this._tag,e)?M.hasOwnProperty(r)||c.deleteValueForAttribute(k(this),r):(l.properties[r]||l.isCustomAttribute(r))&&c.deleteValueForProperty(k(this),r);for(r in t){var f=t[r],p="style"===r?this._previousStyleCopy:null!=e?e[r]:void 0;if(t.hasOwnProperty(r)&&f!==p&&(null!=f||null!=p))if("style"===r)if(f?f=this._previousStyleCopy=o({},f):this._previousStyleCopy=null,p){for(i in p)!p.hasOwnProperty(i)||f&&f.hasOwnProperty(i)||((u=u||{})[i]="");for(i in f)f.hasOwnProperty(i)&&p[i]!==f[i]&&((u=u||{})[i]=f[i])}else u=f;else if(O.hasOwnProperty(r))f?R(this,r,f,n):p&&C(this,r);else if($(this._tag,t))M.hasOwnProperty(r)||c.setValueForAttribute(k(this),r,f);else if(l.properties[r]||l.isCustomAttribute(r)){var d=k(this);null!=f?c.setValueForProperty(d,r,f):c.deleteValueForProperty(d,r)}}u&&a.setValueForStyles(k(this),u,this)},_updateDOMChildren:function(e,t,n,r){var o=P[typeof e.children]?e.children:null,i=P[typeof t.children]?t.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,u=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,s=null!=o?null:e.children,l=null!=i?null:t.children,c=null!=o||null!=a,f=null!=i||null!=u;null!=s&&null==l?this.updateChildren(null,n,r):c&&!f&&this.updateTextContent(""),null!=i?o!==i&&this.updateTextContent(""+i):null!=u?a!==u&&this.updateMarkup(""+u):null!=l&&this.updateChildren(l,n,r)},getHostNode:function(){return k(this)},unmountComponent:function(e){switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":var t=this._wrapperState.listeners;if(t)for(var n=0;n<t.length;n++)t[n].remove();break;case"input":case"textarea":x.stopTracking(this);break;case"html":case"head":case"body":r("66",this._tag)}this.unmountChildren(e),v.uncacheNode(this),f.deleteAllListeners(this),this._rootNodeID=0,this._domID=0,this._wrapperState=null},getPublicInstance:function(){return k(this)}},o(X.prototype,X.Mixin,_.Mixin),e.exports=X},function(e,t,n){"use strict";var r=n(14),o=n(361),i={focusDOMComponent:function(){o(r.getNodeFromInstance(this))}};e.exports=i},function(e,t,n){"use strict";var r=n(362),o=n(26),i=(n(39),n(798),n(800)),a=n(801),u=n(803),s=(n(10),u(function(e){return a(e)})),l=!1,c="cssFloat";if(o.canUseDOM){var f=document.createElement("div").style;try{f.font=""}catch(e){l=!0}void 0===document.documentElement.style.cssFloat&&(c="styleFloat")}var p={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=0===r.indexOf("--"),a=e[r];0,null!=a&&(n+=s(r)+":",n+=i(r,a,t,o)+";")}return n||null},setValueForStyles:function(e,t,n){var o=e.style;for(var a in t)if(t.hasOwnProperty(a)){var u=0===a.indexOf("--");0;var s=i(a,t[a],n,u);if("float"!==a&&"cssFloat"!==a||(a=c),u)o.setProperty(a,s);else if(s)o[a]=s;else{var f=l&&r.shorthandPropertyExpansions[a];if(f)for(var p in f)o[p]="";else o[a]=""}}}};e.exports=p},function(e,t,n){"use strict";var r=n(799),o=/^-ms-/;e.exports=function(e){return r(e.replace(o,"ms-"))}},function(e,t,n){"use strict";var r=/-(.)/g;e.exports=function(e){return e.replace(r,function(e,t){return t.toUpperCase()})}},function(e,t,n){"use strict";var r=n(362),o=(n(10),r.isUnitlessNumber);e.exports=function(e,t,n,r){if(null==t||"boolean"==typeof t||""===t)return"";var i=isNaN(t);return r||i||0===t||o.hasOwnProperty(e)&&o[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}},function(e,t,n){"use strict";var r=n(802),o=/^ms-/;e.exports=function(e){return r(e).replace(o,"-ms-")}},function(e,t,n){"use strict";var r=/([A-Z])/g;e.exports=function(e){return e.replace(r,"-$1").toLowerCase()}},function(e,t,n){"use strict";e.exports=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}},function(e,t,n){"use strict";var r=n(151);e.exports=function(e){return'"'+r(e)+'"'}},function(e,t,n){"use strict";var r=n(110);var o={handleTopLevel:function(e,t,n,o){!function(e){r.enqueueEvents(e),r.processEventQueue(!1)}(r.extractEvents(e,t,n,o))}};e.exports=o},function(e,t,n){"use strict";var r=n(26);function o(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}var i={animationend:o("Animation","AnimationEnd"),animationiteration:o("Animation","AnimationIteration"),animationstart:o("Animation","AnimationStart"),transitionend:o("Transition","TransitionEnd")},a={},u={};r.canUseDOM&&(u=document.createElement("div").style,"AnimationEvent"in window||(delete i.animationend.animation,delete i.animationiteration.animation,delete i.animationstart.animation),"TransitionEvent"in window||delete i.transitionend.transition),e.exports=function(e){if(a[e])return a[e];if(!i[e])return e;var t=i[e];for(var n in t)if(t.hasOwnProperty(n)&&n in u)return a[e]=t[n];return""}},function(e,t,n){"use strict";var r=n(11),o=n(13),i=n(363),a=n(220),u=n(14),s=n(43);n(8),n(10);function l(){this._rootNodeID&&f.updateWrapper(this)}function c(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}var f={getHostProps:function(e,t){var n=a.getValue(t),r=a.getChecked(t);return o({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,listeners:null,onChange:function(e){var t=this._currentElement.props,n=a.executeOnChange(t,e);s.asap(l,this);var o=t.name;if("radio"===t.type&&null!=o){for(var i=u.getNodeFromInstance(this),c=i;c.parentNode;)c=c.parentNode;for(var f=c.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),p=0;p<f.length;p++){var d=f[p];if(d!==i&&d.form===i.form){var h=u.getInstanceFromNode(d);h||r("90"),s.asap(l,h)}}}return n}.bind(e),controlled:c(t)}},updateWrapper:function(e){var t=e._currentElement.props,n=t.checked;null!=n&&i.setValueForProperty(u.getNodeFromInstance(e),"checked",n||!1);var r=u.getNodeFromInstance(e),o=a.getValue(t);if(null!=o)if(0===o&&""===r.value)r.value="0";else if("number"===t.type){var s=parseFloat(r.value,10)||0;(o!=s||o==s&&r.value!=o)&&(r.value=""+o)}else r.value!==""+o&&(r.value=""+o);else null==t.value&&null!=t.defaultValue&&r.defaultValue!==""+t.defaultValue&&(r.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(r.defaultChecked=!!t.defaultChecked)},postMountWrapper:function(e){var t=e._currentElement.props,n=u.getNodeFromInstance(e);switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":n.value="",n.value=n.defaultValue;break;default:n.value=n.value}var r=n.name;""!==r&&(n.name=""),n.defaultChecked=!n.defaultChecked,n.defaultChecked=!n.defaultChecked,""!==r&&(n.name=r)}};e.exports=f},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=n(13),o=n(75),i=n(14),a=n(364),u=(n(10),!1);function s(e){var t="";return o.Children.forEach(e,function(e){null!=e&&("string"==typeof e||"number"==typeof e?t+=e:u||(u=!0))}),t}var l={mountWrapper:function(e,t,n){var r=null;if(null!=n){var o=n;"optgroup"===o._tag&&(o=o._hostParent),null!=o&&"select"===o._tag&&(r=a.getSelectValueContext(o))}var i,u=null;if(null!=r)if(i=null!=t.value?t.value+"":s(t.children),u=!1,Array.isArray(r)){for(var l=0;l<r.length;l++)if(""+r[l]===i){u=!0;break}}else u=""+r===i;e._wrapperState={selected:u}},postMountWrapper:function(e){var t=e._currentElement.props;null!=t.value&&i.getNodeFromInstance(e).setAttribute("value",t.value)},getHostProps:function(e,t){var n=r({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(n.selected=e._wrapperState.selected);var o=s(t.children);return o&&(n.children=o),n}};e.exports=l},function(e,t,n){"use strict";var r=n(11),o=n(13),i=n(220),a=n(14),u=n(43);n(8),n(10);function s(){this._rootNodeID&&l.updateWrapper(this)}var l={getHostProps:function(e,t){return null!=t.dangerouslySetInnerHTML&&r("91"),o({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=i.getValue(t),o=n;if(null==n){var a=t.defaultValue,l=t.children;null!=l&&(null!=a&&r("92"),Array.isArray(l)&&(l.length<=1||r("93"),l=l[0]),a=""+l),null==a&&(a=""),o=a}e._wrapperState={initialValue:""+o,listeners:null,onChange:function(e){var t=this._currentElement.props,n=i.executeOnChange(t,e);return u.asap(s,this),n}.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=a.getNodeFromInstance(e),r=i.getValue(t);if(null!=r){var o=""+r;o!==n.value&&(n.value=o),null==t.defaultValue&&(n.defaultValue=o)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=a.getNodeFromInstance(e),n=t.textContent;n===e._wrapperState.initialValue&&(t.value=n)}};e.exports=l},function(e,t,n){"use strict";var r=n(11),o=n(221),i=(n(112),n(39),n(46),n(88)),a=n(812),u=(n(34),n(817));n(8);function s(e,t){return t&&(e=e||[]).push(t),e}function l(e,t){o.processChildrenUpdates(e,t)}var c={Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return a.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,o,i){var s,l=0;return s=u(t,l),a.updateChildren(e,s,n,r,o,this,this._hostContainerInfo,i,l),s},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var o=[],a=0;for(var u in r)if(r.hasOwnProperty(u)){var s=r[u],l=0;0;var c=i.mountComponent(s,t,this,this._hostContainerInfo,n,l);s._mountIndex=a++,o.push(c)}return o},updateTextContent:function(e){var t,n=this._renderedChildren;for(var o in a.unmountChildren(n,!1),n)n.hasOwnProperty(o)&&r("118");l(this,[(t=e,{type:"TEXT_CONTENT",content:t,fromIndex:null,fromNode:null,toIndex:null,afterNode:null})])},updateMarkup:function(e){var t,n=this._renderedChildren;for(var o in a.unmountChildren(n,!1),n)n.hasOwnProperty(o)&&r("118");l(this,[(t=e,{type:"SET_MARKUP",content:t,fromIndex:null,fromNode:null,toIndex:null,afterNode:null})])},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,o={},a=[],u=this._reconcilerUpdateChildren(r,e,a,o,t,n);if(u||r){var c,f=null,p=0,d=0,h=0,v=null;for(c in u)if(u.hasOwnProperty(c)){var m=r&&r[c],g=u[c];m===g?(f=s(f,this.moveChild(m,v,p,d)),d=Math.max(m._mountIndex,d),m._mountIndex=p):(m&&(d=Math.max(m._mountIndex,d)),f=s(f,this._mountChildAtIndex(g,a[h],v,p,t,n)),h++),p++,v=i.getHostNode(g)}for(c in o)o.hasOwnProperty(c)&&(f=s(f,this._unmountChild(r[c],o[c])));f&&l(this,f),this._renderedChildren=u}},unmountChildren:function(e){var t=this._renderedChildren;a.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex<r)return function(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:i.getHostNode(e),toIndex:n,afterNode:t}}(e,t,n)},createChild:function(e,t,n){return function(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}(n,t,e._mountIndex)},removeChild:function(e,t){return function(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}(e,t)},_mountChildAtIndex:function(e,t,n,r,o,i){return e._mountIndex=r,this.createChild(e,n,t)},_unmountChild:function(e,t){var n=this.removeChild(e,t);return e._mountIndex=null,n}}};e.exports=c},function(e,t,n){"use strict";(function(t){var r=n(88),o=n(365),i=(n(224),n(223)),a=n(369);n(10);function u(e,t,n,r){var i=void 0===e[n];null!=t&&i&&(e[n]=o(t,!0))}void 0!==t&&Object({NODE_ENV:"production",WEBPACK_INLINE_STYLES:!1});var s={instantiateChildren:function(e,t,n,r){if(null==e)return null;var o={};return a(e,u,o),o},updateChildren:function(e,t,n,a,u,s,l,c,f){if(t||e){var p,d;for(p in t)if(t.hasOwnProperty(p)){var h=(d=e&&e[p])&&d._currentElement,v=t[p];if(null!=d&&i(h,v))r.receiveComponent(d,v,u,c),t[p]=d;else{d&&(a[p]=r.getHostNode(d),r.unmountComponent(d,!1));var m=o(v,!0);t[p]=m;var g=r.mountComponent(m,u,s,l,c,f);n.push(g)}}for(p in e)!e.hasOwnProperty(p)||t&&t.hasOwnProperty(p)||(d=e[p],a[p]=r.getHostNode(d),r.unmountComponent(d,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];r.unmountComponent(o,t)}}};e.exports=s}).call(t,n(55))},function(e,t,n){"use strict";var r=n(11),o=n(13),i=n(75),a=n(221),u=n(46),s=n(213),l=n(112),c=(n(39),n(366)),f=n(88),p=n(126),d=(n(8),n(222)),h=n(223),v=(n(10),0),m=1,g=2;function y(e){}function b(e,t){0}y.prototype.render=function(){var e=l.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return b(e,t),t};var _=1,w={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1},mountComponent:function(e,t,n,o){this._context=o,this._mountOrder=_++,this._hostParent=t,this._hostContainerInfo=n;var a,u=this._currentElement.props,s=this._processContext(o),c=this._currentElement.type,f=e.getUpdateQueue(),d=function(e){return!(!e.prototype||!e.prototype.isReactComponent)}(c),h=this._constructComponent(d,u,s,f);d||null!=h&&null!=h.render?!function(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}(c)?this._compositeType=v:this._compositeType=m:(a=h,b(),null===h||!1===h||i.isValidElement(h)||r("105",c.displayName||c.name||"Component"),h=new y(c),this._compositeType=g),h.props=u,h.context=s,h.refs=p,h.updater=f,this._instance=h,l.set(h,this);var w,E=h.state;return void 0===E&&(h.state=E=null),("object"!=typeof E||Array.isArray(E))&&r("106",this.getName()||"ReactCompositeComponent"),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,w=h.unstable_handleError?this.performInitialMountWithErrorHandling(a,t,n,e,o):this.performInitialMount(a,t,n,e,o),h.componentDidMount&&e.getReactMountReady().enqueue(h.componentDidMount,h),w},_constructComponent:function(e,t,n,r){return this._constructComponentWithoutOwner(e,t,n,r)},_constructComponentWithoutOwner:function(e,t,n,r){var o=this._currentElement.type;return e?new o(t,n,r):o(t,n,r)},performInitialMountWithErrorHandling:function(e,t,n,r,o){var i,a=r.checkpoint();try{i=this.performInitialMount(e,t,n,r,o)}catch(u){r.rollback(a),this._instance.unstable_handleError(u),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),a=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(a),i=this.performInitialMount(e,t,n,r,o)}return i},performInitialMount:function(e,t,n,r,o){var i=this._instance,a=0;i.componentWillMount&&(i.componentWillMount(),this._pendingStateQueue&&(i.state=this._processPendingState(i.props,i.context))),void 0===e&&(e=this._renderValidatedComponent());var u=c.getType(e);this._renderedNodeType=u;var s=this._instantiateReactComponent(e,u!==c.EMPTY);return this._renderedComponent=s,f.mountComponent(s,r,t,n,this._processChildContext(o),a)},getHostNode:function(){return f.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var n=this.getName()+".componentWillUnmount()";s.invokeGuardedCallback(n,t.componentWillUnmount.bind(t))}else t.componentWillUnmount();this._renderedComponent&&(f.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,l.remove(t)}},_maskContext:function(e){var t=this._currentElement.type.contextTypes;if(!t)return p;var n={};for(var r in t)n[r]=e[r];return n},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t,n=this._currentElement.type,i=this._instance;if(i.getChildContext&&(t=i.getChildContext()),t){for(var a in"object"!=typeof n.childContextTypes&&r("107",this.getName()||"ReactCompositeComponent"),t)a in n.childContextTypes||r("108",this.getName()||"ReactCompositeComponent",a);return o({},e,t)}return e},_checkContextTypes:function(e,t,n){0},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?f.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,n,o,i){var a=this._instance;null==a&&r("136",this.getName()||"ReactCompositeComponent");var u,s=!1;this._context===i?u=a.context:(u=this._processContext(i),s=!0);var l=t.props,c=n.props;t!==n&&(s=!0),s&&a.componentWillReceiveProps&&a.componentWillReceiveProps(c,u);var f=this._processPendingState(c,u),p=!0;this._pendingForceUpdate||(a.shouldComponentUpdate?p=a.shouldComponentUpdate(c,f,u):this._compositeType===m&&(p=!d(l,c)||!d(a.state,f))),this._updateBatchNumber=null,p?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,c,f,u,e,i)):(this._currentElement=n,this._context=i,a.props=c,a.state=f,a.context=u)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,i=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(i&&1===r.length)return r[0];for(var a=o({},i?r[0]:n.state),u=i?1:0;u<r.length;u++){var s=r[u];o(a,"function"==typeof s?s.call(n,a,e,t):s)}return a},_performComponentUpdate:function(e,t,n,r,o,i){var a,u,s,l=this._instance,c=Boolean(l.componentDidUpdate);c&&(a=l.props,u=l.state,s=l.context),l.componentWillUpdate&&l.componentWillUpdate(t,n,r),this._currentElement=e,this._context=i,l.props=t,l.state=n,l.context=r,this._updateRenderedComponent(o,i),c&&o.getReactMountReady().enqueue(l.componentDidUpdate.bind(l,a,u,s),l)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,r=n._currentElement,o=this._renderValidatedComponent(),i=0;if(h(r,o))f.receiveComponent(n,o,e,this._processChildContext(t));else{var a=f.getHostNode(n);f.unmountComponent(n,!1);var u=c.getType(o);this._renderedNodeType=u;var s=this._instantiateReactComponent(o,u!==c.EMPTY);this._renderedComponent=s;var l=f.mountComponent(s,e,this._hostParent,this._hostContainerInfo,this._processChildContext(t),i);this._replaceNodeWithMarkup(a,l,n)}},_replaceNodeWithMarkup:function(e,t,n){a.replaceNodeWithMarkup(e,t,n)},_renderValidatedComponentWithoutOwnerOrContext:function(){var e=this._instance;return e.render()},_renderValidatedComponent:function(){var e;if(this._compositeType!==g){u.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{u.current=null}}else e=this._renderValidatedComponentWithoutOwnerOrContext();return null===e||!1===e||i.isValidElement(e)||r("109",this.getName()||"ReactCompositeComponent"),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n&&r("110");var o=t.getPublicInstance();(n.refs===p?n.refs={}:n.refs)[e]=o},detachRef:function(e){delete this.getPublicInstance().refs[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return this._compositeType===g?null:e},_instantiateReactComponent:null};e.exports=w},function(e,t,n){"use strict";var r=1;e.exports=function(){return r++}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=function(e){var t=e&&(r&&e[r]||e[o]);if("function"==typeof t)return t}},function(e,t,n){"use strict";(function(t){n(224);var r=n(369);n(10);function o(e,t,n,r){if(e&&"object"==typeof e){var o=e,i=void 0===o[n];0,i&&null!=t&&(o[n]=t)}}void 0!==t&&Object({NODE_ENV:"production",WEBPACK_INLINE_STYLES:!1}),e.exports=function(e,t){if(null==e)return e;var n={};return r(e,o,n),n}}).call(t,n(55))},function(e,t,n){"use strict";var r=n(13),o=n(69),i=n(148),a=(n(39),n(819)),u=[];var s={enqueue:function(){}};function l(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1,this.updateQueue=new a(this)}var c={getTransactionWrappers:function(){return u},getReactMountReady:function(){return s},getUpdateQueue:function(){return this.updateQueue},destructor:function(){},checkpoint:function(){},rollback:function(){}};r(l.prototype,i,c),o.addPoolingTo(l),e.exports=l},function(e,t,n){"use strict";var r=n(225);n(10);var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.transaction=t}return e.prototype.isMounted=function(e){return!1},e.prototype.enqueueCallback=function(e,t,n){this.transaction.isInTransaction()&&r.enqueueCallback(e,t,n)},e.prototype.enqueueForceUpdate=function(e){this.transaction.isInTransaction()&&r.enqueueForceUpdate(e)},e.prototype.enqueueReplaceState=function(e,t){this.transaction.isInTransaction()&&r.enqueueReplaceState(e,t)},e.prototype.enqueueSetState=function(e,t){this.transaction.isInTransaction()&&r.enqueueSetState(e,t)},e}();e.exports=o},function(e,t,n){"use strict";var r=n(13),o=n(89),i=n(14),a=function(e){this._currentElement=null,this._hostNode=null,this._hostParent=null,this._hostContainerInfo=null,this._domID=0};r(a.prototype,{mountComponent:function(e,t,n,r){var a=n._idCounter++;this._domID=a,this._hostParent=t,this._hostContainerInfo=n;var u=" react-empty: "+this._domID+" ";if(e.useCreateElement){var s=n._ownerDocument.createComment(u);return i.precacheNode(this,s),o(s)}return e.renderToStaticMarkup?"":"\x3c!--"+u+"--\x3e"},receiveComponent:function(){},getHostNode:function(){return i.getNodeFromInstance(this)},unmountComponent:function(){i.uncacheNode(this)}}),e.exports=a},function(e,t,n){"use strict";var r=n(11);n(8);function o(e,t){"_hostNode"in e||r("33"),"_hostNode"in t||r("33");for(var n=0,o=e;o;o=o._hostParent)n++;for(var i=0,a=t;a;a=a._hostParent)i++;for(;n-i>0;)e=e._hostParent,n--;for(;i-n>0;)t=t._hostParent,i--;for(var u=n;u--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}e.exports={isAncestor:function(e,t){"_hostNode"in e||r("35"),"_hostNode"in t||r("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1},getLowestCommonAncestor:o,getParentInstance:function(e){return"_hostNode"in e||r("36"),e._hostParent},traverseTwoPhase:function(e,t,n){for(var r,o=[];e;)o.push(e),e=e._hostParent;for(r=o.length;r-- >0;)t(o[r],"captured",n);for(r=0;r<o.length;r++)t(o[r],"bubbled",n)},traverseEnterLeave:function(e,t,n,r,i){for(var a=e&&t?o(e,t):null,u=[];e&&e!==a;)u.push(e),e=e._hostParent;for(var s,l=[];t&&t!==a;)l.push(t),t=t._hostParent;for(s=0;s<u.length;s++)n(u[s],"bubbled",r);for(s=l.length;s-- >0;)n(l[s],"captured",i)}}},function(e,t,n){"use strict";var r=n(11),o=n(13),i=n(217),a=n(89),u=n(14),s=n(151),l=(n(8),n(226),function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});o(l.prototype,{mountComponent:function(e,t,n,r){var o=n._idCounter++,i=" react-text: "+o+" ";if(this._domID=o,this._hostParent=t,e.useCreateElement){var l=n._ownerDocument,c=l.createComment(i),f=l.createComment(" /react-text "),p=a(l.createDocumentFragment());return a.queueChild(p,a(c)),this._stringText&&a.queueChild(p,a(l.createTextNode(this._stringText))),a.queueChild(p,a(f)),u.precacheNode(this,c),this._closingComment=f,p}var d=s(this._stringText);return e.renderToStaticMarkup?d:"\x3c!--"+i+"--\x3e"+d+"\x3c!-- /react-text --\x3e"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();i.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=u.getNodeFromInstance(this).nextSibling;;){if(null==t&&r("67",this._domID),8===t.nodeType&&" /react-text "===t.nodeValue){this._closingComment=t;break}t=t.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,u.uncacheNode(this)}}),e.exports=l},function(e,t,n){"use strict";var r=n(13),o=n(43),i=n(148),a=n(34),u={initialize:a,close:function(){f.isBatchingUpdates=!1}},s=[{initialize:a,close:o.flushBatchedUpdates.bind(o)},u];function l(){this.reinitializeTransaction()}r(l.prototype,i,{getTransactionWrappers:function(){return s}});var c=new l,f={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o,i){var a=f.isBatchingUpdates;return f.isBatchingUpdates=!0,a?e(t,n,r,o,i):c.perform(e,null,t,n,r,o,i)}};e.exports=f},function(e,t,n){"use strict";var r=n(13),o=n(371),i=n(26),a=n(69),u=n(14),s=n(43),l=n(214),c=n(825);function f(e){for(;e._hostParent;)e=e._hostParent;var t=u.getNodeFromInstance(e).parentNode;return u.getClosestInstanceFromNode(t)}function p(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function d(e){var t=l(e.nativeEvent),n=u.getClosestInstanceFromNode(t),r=n;do{e.ancestors.push(r),r=r&&f(r)}while(r);for(var o=0;o<e.ancestors.length;o++)n=e.ancestors[o],h._handleTopLevel(e.topLevelType,n,e.nativeEvent,l(e.nativeEvent))}r(p.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),a.addPoolingTo(p,a.twoArgumentPooler);var h={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:i.canUseDOM?window:null,setHandleTopLevel:function(e){h._handleTopLevel=e},setEnabled:function(e){h._enabled=!!e},isEnabled:function(){return h._enabled},trapBubbledEvent:function(e,t,n){return n?o.listen(n,t,h.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){return n?o.capture(n,t,h.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=function(e){e(c(window))}.bind(null,e);o.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(h._enabled){var n=p.getPooled(e,t);try{s.batchedUpdates(d,n)}finally{p.release(n)}}}};e.exports=h},function(e,t,n){"use strict";e.exports=function(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}},function(e,t,n){"use strict";var r=n(87),o=n(110),i=n(212),a=n(221),u=n(367),s=n(152),l=n(368),c=n(43),f={Component:a.injection,DOMProperty:r.injection,EmptyComponent:u.injection,EventPluginHub:o.injection,EventPluginUtils:i.injection,EventEmitter:s.injection,HostComponent:l.injection,Updates:c.injection};e.exports=f},function(e,t,n){"use strict";var r=n(13),o=n(355),i=n(69),a=n(152),u=n(372),s=(n(39),n(148)),l=n(225),c=[{initialize:u.getSelectionInformation,close:u.restoreSelection},{initialize:function(){var e=a.isEnabled();return a.setEnabled(!1),e},close:function(e){a.setEnabled(e)}},{initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}}];function f(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=o.getPooled(null),this.useCreateElement=e}var p={getTransactionWrappers:function(){return c},getReactMountReady:function(){return this.reactMountReady},getUpdateQueue:function(){return l},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null}};r(f.prototype,s,p),i.addPoolingTo(f),e.exports=f},function(e,t,n){"use strict";var r=n(26),o=n(829),i=n(354);function a(e,t,n,r){return e===n&&t===r}var u=r.canUseDOM&&"selection"in document&&!("getSelection"in window),s={getOffsets:u?function(e){var t=document.selection.createRange(),n=t.text.length,r=t.duplicate();r.moveToElementText(e),r.setEndPoint("EndToStart",t);var o=r.text.length;return{start:o,end:o+n}}:function(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,r=t.anchorOffset,o=t.focusNode,i=t.focusOffset,u=t.getRangeAt(0);try{u.startContainer.nodeType,u.endContainer.nodeType}catch(e){return null}var s=a(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)?0:u.toString().length,l=u.cloneRange();l.selectNodeContents(e),l.setEnd(u.startContainer,u.startOffset);var c=a(l.startContainer,l.startOffset,l.endContainer,l.endOffset)?0:l.toString().length,f=c+s,p=document.createRange();p.setStart(n,r),p.setEnd(o,i);var d=p.collapsed;return{start:d?f:c,end:d?c:f}},setOffsets:u?function(e,t){var n,r,o=document.selection.createRange().duplicate();void 0===t.end?r=n=t.start:t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}:function(e,t){if(window.getSelection){var n=window.getSelection(),r=e[i()].length,a=Math.min(t.start,r),u=void 0===t.end?a:Math.min(t.end,r);if(!n.extend&&a>u){var s=u;u=a,a=s}var l=o(e,a),c=o(e,u);if(l&&c){var f=document.createRange();f.setStart(l.node,l.offset),n.removeAllRanges(),a>u?(n.addRange(f),n.extend(c.node,c.offset)):(f.setEnd(c.node,c.offset),n.addRange(f))}}}};e.exports=s},function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function o(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}e.exports=function(e,t){for(var n=r(e),i=0,a=0;n;){if(3===n.nodeType){if(a=i+n.textContent.length,i<=t&&a>=t)return{node:n,offset:t-i};i=a}n=r(o(n))}}},function(e,t,n){"use strict";var r=n(831);e.exports=function e(t,n){return!(!t||!n)&&(t===n||!r(t)&&(r(n)?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}},function(e,t,n){"use strict";var r=n(832);e.exports=function(e){return r(e)&&3==e.nodeType}},function(e,t,n){"use strict";e.exports=function(e){var t=(e?e.ownerDocument||e:document).defaultView||window;return!(!e||!("function"==typeof t.Node?e instanceof t.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}},function(e,t,n){"use strict";var r="http://www.w3.org/1999/xlink",o="http://www.w3.org/XML/1998/namespace",i={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},a={Properties:{},DOMAttributeNamespaces:{xlinkActuate:r,xlinkArcrole:r,xlinkHref:r,xlinkRole:r,xlinkShow:r,xlinkTitle:r,xlinkType:r,xmlBase:o,xmlLang:o,xmlSpace:o},DOMAttributeNames:{}};Object.keys(i).forEach(function(e){a.Properties[e]=0,i[e]&&(a.DOMAttributeNames[e]=i[e])}),e.exports=a},function(e,t,n){"use strict";var r=n(109),o=n(26),i=n(14),a=n(372),u=n(48),s=n(373),l=n(358),c=n(222),f=o.canUseDOM&&"documentMode"in document&&document.documentMode<=11,p={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:["topBlur","topContextMenu","topFocus","topKeyDown","topKeyUp","topMouseDown","topMouseUp","topSelectionChange"]}},d=null,h=null,v=null,m=!1,g=!1;function y(e,t){if(m||null==d||d!==s())return null;var n=function(e){if("selectionStart"in e&&a.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}(d);if(!v||!c(v,n)){v=n;var o=u.getPooled(p.select,h,e,t);return o.type="select",o.target=d,r.accumulateTwoPhaseDispatches(o),o}return null}var b={eventTypes:p,extractEvents:function(e,t,n,r){if(!g)return null;var o=t?i.getNodeFromInstance(t):window;switch(e){case"topFocus":(l(o)||"true"===o.contentEditable)&&(d=o,h=t,v=null);break;case"topBlur":d=null,h=null,v=null;break;case"topMouseDown":m=!0;break;case"topContextMenu":case"topMouseUp":return m=!1,y(n,r);case"topSelectionChange":if(f)break;case"topKeyDown":case"topKeyUp":return y(n,r)}return null},didPutListener:function(e,t,n){"onSelect"===t&&(g=!0)}};e.exports=b},function(e,t,n){"use strict";var r=n(11),o=n(371),i=n(109),a=n(14),u=n(836),s=n(837),l=n(48),c=n(838),f=n(839),p=n(149),d=n(841),h=n(842),v=n(843),m=n(111),g=n(844),y=n(34),b=n(227),_=(n(8),{}),w={};["abort","animationEnd","animationIteration","animationStart","blur","canPlay","canPlayThrough","click","contextMenu","copy","cut","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","focus","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","progress","rateChange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchMove","touchStart","transitionEnd","volumeChange","waiting","wheel"].forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t,r="top"+t,o={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[r]};_[e]=o,w[r]=o});var E={};function x(e){return"."+e._rootNodeID}function S(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}var C={eventTypes:_,extractEvents:function(e,t,n,o){var a,y=w[e];if(!y)return null;switch(e){case"topAbort":case"topCanPlay":case"topCanPlayThrough":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topVolumeChange":case"topWaiting":a=l;break;case"topKeyPress":if(0===b(n))return null;case"topKeyDown":case"topKeyUp":a=f;break;case"topBlur":case"topFocus":a=c;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":a=p;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":a=d;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":a=h;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":a=u;break;case"topTransitionEnd":a=v;break;case"topScroll":a=m;break;case"topWheel":a=g;break;case"topCopy":case"topCut":case"topPaste":a=s}a||r("86",e);var _=a.getPooled(y,t,n,o);return i.accumulateTwoPhaseDispatches(_),_},didPutListener:function(e,t,n){if("onClick"===t&&!S(e._tag)){var r=x(e),i=a.getNodeFromInstance(e);E[r]||(E[r]=o.listen(i,"click",y))}},willDeleteListener:function(e,t){if("onClick"===t&&!S(e._tag)){var n=x(e);E[n].remove(),delete E[n]}}};e.exports=C},function(e,t,n){"use strict";var r=n(48);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{animationName:null,elapsedTime:null,pseudoElement:null}),e.exports=o},function(e,t,n){"use strict";var r=n(48),o={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};function i(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(i,o),e.exports=i},function(e,t,n){"use strict";var r=n(111);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{relatedTarget:null}),e.exports=o},function(e,t,n){"use strict";var r=n(111),o=n(227),i={key:n(840),location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:n(216),charCode:function(e){return"keypress"===e.type?o(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?o(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,i),e.exports=a},function(e,t,n){"use strict";var r=n(227),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=function(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=r(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?i[e.keyCode]||"Unidentified":""}},function(e,t,n){"use strict";var r=n(149);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{dataTransfer:null}),e.exports=o},function(e,t,n){"use strict";var r=n(111),o={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:n(216)};function i(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(i,o),e.exports=i},function(e,t,n){"use strict";var r=n(48);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{propertyName:null,elapsedTime:null,pseudoElement:null}),e.exports=o},function(e,t,n){"use strict";var r=n(149);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),e.exports=o},function(e,t,n){"use strict";n(226);var r=9;e.exports=function(e,t){var n={_topLevelWrapper:e,_idCounter:1,_ownerDocument:t?t.nodeType===r?t:t.ownerDocument:null,_node:t,_tag:t?t.nodeName.toLowerCase():null,_namespaceURI:t?t.namespaceURI:null};return n}},function(e,t,n){"use strict";e.exports={useCreateElement:!0,useFiber:!1}},function(e,t,n){"use strict";var r=n(848),o=/\/?>/,i=/^<\!\-\-/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return i.test(e)?e:e.replace(o," "+a.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(a.CHECKSUM_ATTR_NAME);return n=n&&parseInt(n,10),r(e)===n}};e.exports=a},function(e,t,n){"use strict";var r=65521;e.exports=function(e){for(var t=1,n=0,o=0,i=e.length,a=-4&i;o<a;){for(var u=Math.min(o+4096,a);o<u;o+=4)n+=(t+=e.charCodeAt(o))+(t+=e.charCodeAt(o+1))+(t+=e.charCodeAt(o+2))+(t+=e.charCodeAt(o+3));t%=r,n%=r}for(;o<i;o++)n+=t+=e.charCodeAt(o);return(t%=r)|(n%=r)<<16}},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r=n(11),o=(n(46),n(14)),i=n(112),a=n(375);n(8),n(10);e.exports=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=i.get(e);if(t)return(t=a(t))?o.getNodeFromInstance(t):null;"function"==typeof e.render?r("44"):r("45",Object.keys(e))}},function(e,t,n){"use strict";var r=n(374);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){"use strict";t.__esModule=!0,t.connect=t.Provider=void 0;var r=i(n(853)),o=i(n(855));function i(e){return e&&e.__esModule?e:{default:e}}t.Provider=r.default,t.connect=o.default},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(0),o=a(n(1)),i=a(n(376));a(n(377));function a(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(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}(this,e.call(this,n,r));return o.store=n.store,o}return 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)}(t,e),t.prototype.getChildContext=function(){return{store:this.store}},t.prototype.render=function(){return r.Children.only(this.props.children)},t}(r.Component);t.default=u,u.propTypes={store:i.default.isRequired,children:o.default.element.isRequired},u.childContextTypes={store:i.default.isRequired}},function(e,t,n){"use strict";var r=n(34),o=n(8),i=n(270);e.exports=function(){function e(e,t,n,r,a,u){u!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(e,t,n){var c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},m=Boolean(e),g=e||f,y=void 0;y="function"==typeof t?t:t?(0,u.default)(t):p;var b=n||d,_=c.pure,w=void 0===_||_,E=c.withRef,x=void 0!==E&&E,S=w&&b!==d,C=v++;return function(e){var t="Connect("+function(e){return e.displayName||e.name||"Component"}(e)+")";var n=function(n){function i(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var o=function(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}(this,n.call(this,e,r));o.version=C,o.store=e.store||r.store,(0,l.default)(o.store,'Could not find "store" in either the context or props of "'+t+'". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "'+t+'".');var a=o.store.getState();return o.state={storeState:a},o.clearCache(),o}return 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)}(i,n),i.prototype.shouldComponentUpdate=function(){return!w||this.haveOwnPropsChanged||this.hasStoreStateChanged},i.prototype.computeStateProps=function(e,t){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,t);var n=e.getState(),r=this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(n,t):this.finalMapStateToProps(n);return r},i.prototype.configureFinalMapState=function(e,t){var n=g(e.getState(),t),r="function"==typeof n;return this.finalMapStateToProps=r?n:g,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,r?this.computeStateProps(e,t):n},i.prototype.computeDispatchProps=function(e,t){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,t);var n=e.dispatch,r=this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(n,t):this.finalMapDispatchToProps(n);return r},i.prototype.configureFinalMapDispatch=function(e,t){var n=y(e.dispatch,t),r="function"==typeof n;return this.finalMapDispatchToProps=r?n:y,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,r?this.computeDispatchProps(e,t):n},i.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return(!this.stateProps||!(0,a.default)(e,this.stateProps))&&(this.stateProps=e,!0)},i.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return(!this.dispatchProps||!(0,a.default)(e,this.dispatchProps))&&(this.dispatchProps=e,!0)},i.prototype.updateMergedPropsIfNeeded=function(){var e=function(e,t,n){var r=b(e,t,n);0;return r}(this.stateProps,this.dispatchProps,this.props);return!(this.mergedProps&&S&&(0,a.default)(e,this.mergedProps))&&(this.mergedProps=e,!0)},i.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},i.prototype.trySubscribe=function(){m&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},i.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},i.prototype.componentDidMount=function(){this.trySubscribe()},i.prototype.componentWillReceiveProps=function(e){w&&(0,a.default)(e,this.props)||(this.haveOwnPropsChanged=!0)},i.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},i.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},i.prototype.handleChange=function(){if(this.unsubscribe){var e=this.store.getState(),t=this.state.storeState;if(!w||t!==e){if(w&&!this.doStatePropsDependOnOwnProps){var n=function(e,t){try{return e.apply(t)}catch(e){return h.value=e,h}}(this.updateStatePropsIfNeeded,this);if(!n)return;n===h&&(this.statePropsPrecalculationError=h.value),this.haveStatePropsBeenPrecalculated=!0}this.hasStoreStateChanged=!0,this.setState({storeState:e})}}},i.prototype.getWrappedInstance=function(){return(0,l.default)(x,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},i.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,i=this.haveStatePropsBeenPrecalculated,a=this.statePropsPrecalculationError,u=this.renderedElement;if(this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,a)throw a;var s=!0,l=!0;w&&u&&(s=n||t&&this.doStatePropsDependOnOwnProps,l=t&&this.doDispatchPropsDependOnOwnProps);var c=!1,f=!1;i?c=!0:s&&(c=this.updateStatePropsIfNeeded()),l&&(f=this.updateDispatchPropsIfNeeded());return!(!!(c||f||t)&&this.updateMergedPropsIfNeeded())&&u?u:(this.renderedElement=x?(0,o.createElement)(e,r({},this.mergedProps,{ref:"wrappedInstance"})):(0,o.createElement)(e,this.mergedProps),this.renderedElement)},i}(o.Component);return n.displayName=t,n.WrappedComponent=e,n.contextTypes={store:i.default},n.propTypes={store:i.default},(0,s.default)(n,e)}};var o=n(0),i=c(n(376)),a=c(n(856)),u=c(n(857)),s=(c(n(377)),c(n(228)),c(n(858))),l=c(n(859));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){return{}},p=function(e){return{dispatch:e}},d=function(e,t,n){return r({},n,e,t)};var h={value:null};var v=0},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<n.length;i++)if(!o.call(t,n[i])||e[n[i]]!==t[n[i]])return!1;return!0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){return function(t){return(0,r.bindActionCreators)(e,t)}};var r=n(271)},function(e,t,n){var r;r=function(){"use strict";var e={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},t={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n=Object.defineProperty,r=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,i=Object.getOwnPropertyDescriptor,a=Object.getPrototypeOf,u=a&&a(Object);return function s(l,c,f){if("string"!=typeof c){if(u){var p=a(c);p&&p!==u&&s(l,p,f)}var d=r(c);o&&(d=d.concat(o(c)));for(var h=0;h<d.length;++h){var v=d[h];if(!(e[v]||t[v]||f&&f[v])){var m=i(c,v);try{n(l,v,m)}catch(e){}}}return l}return l}},e.exports=r()},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,u){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,u],c=0;(s=new Error(t.replace(/%s/g,function(){return l[c++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}}},function(e,t,n){var r=n(280),o=n(378),i=n(882),a=n(79),u=n(90),s=n(885),l=n(382),c=n(381),f=l(function(e,t){var n={};if(null==e)return n;var l=!1;t=r(t,function(t){return t=a(t,e),l||(l=t.length>1),t}),u(e,c(e),n),l&&(n=o(n,7,s));for(var f=t.length;f--;)i(n,t[f]);return n});e.exports=f},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},function(e,t,n){var r=n(90),o=n(64);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(90),o=n(379);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(38),o=n(136),i=n(865),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var u in e)("constructor"!=u||!t&&a.call(e,u))&&n.push(u);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t,n){(function(e){var r=n(37),o="object"==typeof t&&t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,u=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=u?u(n):new e.constructor(n);return e.copy(r),r}}).call(t,n(134)(e))},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(90),o=n(186);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t,n){var r=n(90),o=n(380);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},function(e,t,n){var r=n(230),o=n(872),i=n(873),a=n(874),u=n(875),s="[object Boolean]",l="[object Date]",c="[object Map]",f="[object Number]",p="[object RegExp]",d="[object Set]",h="[object String]",v="[object Symbol]",m="[object ArrayBuffer]",g="[object DataView]",y="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",w="[object Int16Array]",E="[object Int32Array]",x="[object Uint8Array]",S="[object Uint8ClampedArray]",C="[object Uint16Array]",k="[object Uint32Array]";e.exports=function(e,t,n){var A=e.constructor;switch(t){case m:return r(e);case s:case l:return new A(+e);case g:return o(e,n);case y:case b:case _:case w:case E:case x:case S:case C:case k:return u(e,n);case c:return new A;case f:case h:return new A(e);case p:return i(e);case d:return new A;case v:return a(e)}}},function(e,t,n){var r=n(230);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},function(e,t){var n=/\w*$/;e.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}},function(e,t,n){var r=n(77),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},function(e,t,n){var r=n(230);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},function(e,t,n){var r=n(877),o=n(229),i=n(136);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},function(e,t,n){var r=n(38),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},function(e,t,n){var r=n(879),o=n(190),i=n(191),a=i&&i.isMap,u=a?o(a):r;e.exports=u},function(e,t,n){var r=n(137),o=n(47),i="[object Map]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t,n){var r=n(881),o=n(190),i=n(191),a=i&&i.isSet,u=a?o(a):r;e.exports=u},function(e,t,n){var r=n(137),o=n(47),i="[object Set]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t,n){var r=n(79),o=n(883),i=n(884),a=n(80);e.exports=function(e,t){return t=r(t,e),null==(e=i(e,t))||delete e[a(o(t))]}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){var r=n(139),o=n(282);e.exports=function(e,t){return t.length<2?e:r(e,o(t,0,-1))}},function(e,t,n){var r=n(228);e.exports=function(e){return r(e)?void 0:e}},function(e,t,n){var r=n(887);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},function(e,t,n){var r=n(185),o=n(888);e.exports=function e(t,n,i,a,u){var s=-1,l=t.length;for(i||(i=o),u||(u=[]);++s<l;){var c=t[s];n>0&&i(c)?n>1?e(c,n-1,i,a,u):r(u,c):a||(u[u.length]=c)}return u}},function(e,t,n){var r=n(77),o=n(187),i=n(24),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},function(e,t){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},function(e,t,n){var r=n(891),o=n(346),i=n(193),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){var n=800,r=16,o=Date.now;e.exports=function(e){var t=0,i=0;return function(){var a=o(),u=r-(a-i);if(i=a,u>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){var r=n(147),o=n(90),i=n(894),a=n(78),u=n(136),s=n(64),l=Object.prototype.hasOwnProperty,c=i(function(e,t){if(u(t)||a(t))o(t,s(t),e);else for(var n in t)l.call(t,n)&&r(e,n,t[n])});e.exports=c},function(e,t,n){var r=n(895),o=n(305);e.exports=function(e){return r(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,u=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,u&&o(n[0],n[1],u)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}},function(e,t,n){var r=n(193),o=n(383),i=n(384);e.exports=function(e,t){return i(o(e,t,r),e+"")}},function(e,t,n){"use strict";var r=n(897),o=n(898);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=b(e));return e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var a=/^([a-z0-9.+-]+:)/i,u=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),f=["%","/","?",";","#"].concat(c),p=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(899);function b(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),u=-1!==i&&i<e.indexOf("#")?"?":"#",l=e.split(u);l[0]=l[0].replace(/\\/g,"/");var b=e=l.join(u);if(b=b.trim(),!n&&1===e.split("#").length){var _=s.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=a.exec(b);if(w){var E=(w=w[0]).toLowerCase();this.protocol=E,b=b.substr(w.length)}if(n||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var x="//"===b.substr(0,2);!x||w&&m[w]||(b=b.substr(2),this.slashes=!0)}if(!m[w]&&(x||w&&!g[w])){for(var S,C,k=-1,A=0;A<p.length;A++){-1!==(O=b.indexOf(p[A]))&&(-1===k||O<k)&&(k=O)}-1!==(C=-1===k?b.lastIndexOf("@"):b.lastIndexOf("@",k))&&(S=b.slice(0,C),b=b.slice(C+1),this.auth=decodeURIComponent(S)),k=-1;for(A=0;A<f.length;A++){var O;-1!==(O=b.indexOf(f[A]))&&(-1===k||O<k)&&(k=O)}-1===k&&(k=b.length),this.host=b.slice(0,k),b=b.slice(k),this.parseHost(),this.hostname=this.hostname||"";var P="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!P)for(var T=this.hostname.split(/\./),M=(A=0,T.length);A<M;A++){var I=T[A];if(I&&!I.match(d)){for(var j="",N=0,R=I.length;N<R;N++)I.charCodeAt(N)>127?j+="x":j+=I[N];if(!j.match(d)){var D=T.slice(0,A),L=T.slice(A+1),U=I.match(h);U&&(D.push(U[1]),L.unshift(U[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=r.toASCII(this.hostname));var q=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+q,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!v[E])for(A=0,M=c.length;A<M;A++){var z=c[A];if(-1!==b.indexOf(z)){var B=encodeURIComponent(z);B===z&&(B=escape(z)),b=b.split(z).join(B)}}var V=b.indexOf("#");-1!==V&&(this.hash=b.substr(V),b=b.slice(0,V));var H=b.indexOf("?");if(-1!==H?(this.search=b.substr(H),this.query=b.substr(H+1),t&&(this.query=y.parse(this.query)),b=b.slice(0,H)):t&&(this.search="",this.query={}),b&&(this.pathname=b),g[E]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){q=this.pathname||"";var W=this.search||"";this.path=q+W}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,a="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(a=y.stringify(this.query));var u=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),u&&"?"!==u.charAt(0)&&(u="?"+u),t+i+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(u=u.replace("#","%23"))+r},i.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,r=Object.keys(this),a=0;a<r.length;a++){var u=r[a];n[u]=this[u]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),l=0;l<s.length;l++){var c=s[l];"protocol"!==c&&(n[c]=e[c])}return g[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!g[e.protocol]){for(var f=Object.keys(e),p=0;p<f.length;p++){var d=f[p];n[d]=e[d]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||m[e.protocol])n.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),n.pathname=h.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var v=n.pathname||"",y=n.search||"";n.path=v+y}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=_||b||n.host&&e.pathname,E=w,x=n.pathname&&n.pathname.split("/")||[],S=(h=e.pathname&&e.pathname.split("/")||[],n.protocol&&!g[n.protocol]);if(S&&(n.hostname="",n.port=null,n.host&&(""===x[0]?x[0]=n.host:x.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),w=w&&(""===h[0]||""===x[0])),_)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,x=h;else if(h.length)x||(x=[]),x.pop(),x=x.concat(h),n.search=e.search,n.query=e.query;else if(!o.isNullOrUndefined(e.search)){if(S)n.hostname=n.host=x.shift(),(P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=P.shift(),n.host=n.hostname=P.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=x.slice(-1)[0],k=(n.host||e.host||x.length>1)&&("."===C||".."===C)||""===C,A=0,O=x.length;O>=0;O--)"."===(C=x[O])?x.splice(O,1):".."===C?(x.splice(O,1),A++):A&&(x.splice(O,1),A--);if(!w&&!E)for(;A--;A)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),k&&"/"!==x.join("/").substr(-1)&&x.push("");var P,T=""===x[0]||x[0]&&"/"===x[0].charAt(0);S&&(n.hostname=n.host=T?"":x.length?x.shift():"",(P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=P.shift(),n.host=n.hostname=P.shift()));return(w=w||n.host&&x.length)&&!T&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=u.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){(function(e,r){var o;/*! https://mths.be/punycode v1.3.2 by @mathias */!function(i){"object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType;var a="object"==typeof r&&r;a.global!==a&&a.window!==a&&a.self;var u,s=2147483647,l=36,c=1,f=26,p=38,d=700,h=72,v=128,m="-",g=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=l-c,E=Math.floor,x=String.fromCharCode;function S(e){throw RangeError(_[e])}function C(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function k(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+C((e=e.replace(b,".")).split("."),t).join(".")}function A(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function O(e){return C(e,function(e){var t="";return e>65535&&(t+=x((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=x(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function T(e,t,n){var r=0;for(e=n?E(e/d):e>>1,e+=E(e/t);e>w*f>>1;r+=l)e=E(e/w);return E(r+(w+1)*e/(e+p))}function M(e){var t,n,r,o,i,a,u,p,d,g,y,b=[],_=e.length,w=0,x=v,C=h;for((n=e.lastIndexOf(m))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&S("not-basic"),b.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<_;){for(i=w,a=1,u=l;o>=_&&S("invalid-input"),((p=(y=e.charCodeAt(o++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||p>E((s-w)/a))&&S("overflow"),w+=p*a,!(p<(d=u<=C?c:u>=C+f?f:u-C));u+=l)a>E(s/(g=l-d))&&S("overflow"),a*=g;C=T(w-i,t=b.length+1,0==i),E(w/t)>s-x&&S("overflow"),x+=E(w/t),w%=t,b.splice(w++,0,x)}return O(b)}function I(e){var t,n,r,o,i,a,u,p,d,g,y,b,_,w,C,k=[];for(b=(e=A(e)).length,t=v,n=0,i=h,a=0;a<b;++a)(y=e[a])<128&&k.push(x(y));for(r=o=k.length,o&&k.push(m);r<b;){for(u=s,a=0;a<b;++a)(y=e[a])>=t&&y<u&&(u=y);for(u-t>E((s-n)/(_=r+1))&&S("overflow"),n+=(u-t)*_,t=u,a=0;a<b;++a)if((y=e[a])<t&&++n>s&&S("overflow"),y==t){for(p=n,d=l;!(p<(g=d<=i?c:d>=i+f?f:d-i));d+=l)C=p-g,w=l-g,k.push(x(P(g+C%w,0))),p=E(C/w);k.push(x(P(p,0))),i=T(n,_,r==o),n=0,++r}++n,++t}return k.join("")}u={version:"1.3.2",ucs2:{decode:A,encode:O},decode:M,encode:I,toASCII:function(e){return k(e,function(e){return y.test(e)?"xn--"+I(e):e})},toUnicode:function(e){return k(e,function(e){return g.test(e)?M(e.slice(4).toLowerCase()):e})}},void 0===(o=function(){return u}.call(t,n,t,e))||(e.exports=o)}()}).call(t,n(134)(e),n(31))},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(900),t.encode=t.stringify=n(901)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var u=/\+/g;e=e.split(t);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var l=e.length;s>0&&l>s&&(l=s);for(var c=0;c<l;++c){var f,p,d,h,v=e[c].replace(u,"%20"),m=v.indexOf(n);m>=0?(f=v.substr(0,m),p=v.substr(m+1)):(f=v,p=""),d=decodeURIComponent(f),h=decodeURIComponent(p),r(a,d)?o(a[d])?a[d].push(h):a[d]=[a[d],h]:a[d]=h}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,u){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(a(e),function(a){var u=encodeURIComponent(r(a))+n;return o(e[a])?i(e[a],function(e){return u+encodeURIComponent(r(e))}).join(t):u+encodeURIComponent(r(e[a]))}).join(t):u?encodeURIComponent(r(u))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){(function(t){!function(){"use strict";e.exports=function(e){return(e instanceof t?e:new t(e.toString(),"binary")).toString("base64")}}()}).call(t,n(54).Buffer)},function(e,t,n){var r=n(904),o=n(278),i=n(302),a=n(61);e.exports=function(e,t,n){return e=a(e),n=null==n?0:r(i(n),0,e.length),t=o(t),e.slice(n,n+t.length)==t}},function(e,t){e.exports=function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}},function(e,t,n){var r=n(378),o=1,i=4;e.exports=function(e){return r(e,o|i)}},function(e,t){!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return h.iterable&&(t[Symbol.iterator]=function(){return t}),t}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function u(e){var t=new FileReader,n=a(t);return t.readAsArrayBuffer(e),n}function s(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(h.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(h.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(h.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(h.arrayBuffer&&h.blob&&m(e))this._bodyArrayBuffer=s(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!h.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!g(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=s(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):h.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},h.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=a(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},h.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}function c(e,t){var n=(t=t||{}).body;if(e instanceof c){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=function(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function p(e){var t=new o;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}function d(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new o(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var h={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(h.arrayBuffer)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=function(e){return e&&DataView.prototype.isPrototypeOf(e)},g=ArrayBuffer.isView||function(e){return e&&v.indexOf(Object.prototype.toString.call(e))>-1};o.prototype.append=function(e,r){e=t(e),r=n(r);var o=this.map[e];this.map[e]=o?o+","+r:r},o.prototype.delete=function(e){delete this.map[t(e)]},o.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},o.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},o.prototype.set=function(e,r){this.map[t(e)]=n(r)},o.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},o.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},o.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},o.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},h.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];c.prototype.clone=function(){return new c(this,{body:this._bodyInit})},l.call(c.prototype),l.call(d.prototype),d.prototype.clone=function(){return new d(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},d.error=function(){var e=new d(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];d.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new d(null,{status:t,headers:{location:e}})},e.Headers=o,e.Request=c,e.Response=d,e.fetch=function(e,t){return new Promise(function(n,r){var o=new c(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:p(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;n(new d(t,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&h.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t,n){"use strict";var r=n(908),o=n(909),i=n(390);e.exports={formats:i,parse:o,stringify:r}},function(e,t,n){"use strict";var r=n(389),o=n(390),i={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,u={delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},s=function e(t,n,o,i,a,s,l,c,f,p,d,h){var v=t;if("function"==typeof l)v=l(n,v);else if(v instanceof Date)v=p(v);else if(null===v){if(i)return s&&!h?s(n,u.encoder):n;v=""}if("string"==typeof v||"number"==typeof v||"boolean"==typeof v||r.isBuffer(v))return s?[d(h?n:s(n,u.encoder))+"="+d(s(v,u.encoder))]:[d(n)+"="+d(String(v))];var m,g=[];if(void 0===v)return g;if(Array.isArray(l))m=l;else{var y=Object.keys(v);m=c?y.sort(c):y}for(var b=0;b<m.length;++b){var _=m[b];a&&null===v[_]||(g=Array.isArray(v)?g.concat(e(v[_],o(n,_),o,i,a,s,l,c,f,p,d,h)):g.concat(e(v[_],n+(f?"."+_:"["+_+"]"),o,i,a,s,l,c,f,p,d,h)))}return g};e.exports=function(e,t){var n=e,a=t?r.assign({},t):{};if(null!==a.encoder&&void 0!==a.encoder&&"function"!=typeof a.encoder)throw new TypeError("Encoder has to be a function.");var l=void 0===a.delimiter?u.delimiter:a.delimiter,c="boolean"==typeof a.strictNullHandling?a.strictNullHandling:u.strictNullHandling,f="boolean"==typeof a.skipNulls?a.skipNulls:u.skipNulls,p="boolean"==typeof a.encode?a.encode:u.encode,d="function"==typeof a.encoder?a.encoder:u.encoder,h="function"==typeof a.sort?a.sort:null,v=void 0!==a.allowDots&&a.allowDots,m="function"==typeof a.serializeDate?a.serializeDate:u.serializeDate,g="boolean"==typeof a.encodeValuesOnly?a.encodeValuesOnly:u.encodeValuesOnly;if(void 0===a.format)a.format=o.default;else if(!Object.prototype.hasOwnProperty.call(o.formatters,a.format))throw new TypeError("Unknown format option provided.");var y,b,_=o.formatters[a.format];"function"==typeof a.filter?n=(b=a.filter)("",n):Array.isArray(a.filter)&&(y=b=a.filter);var w,E=[];if("object"!=typeof n||null===n)return"";w=a.arrayFormat in i?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var x=i[w];y||(y=Object.keys(n)),h&&y.sort(h);for(var S=0;S<y.length;++S){var C=y[S];f&&null===n[C]||(E=E.concat(s(n[C],C,x,c,f,p?d:null,b,h,v,m,_,g)))}var k=E.join(l),A=!0===a.addQueryPrefix?"?":"";return k.length>0?A+k:""}},function(e,t,n){"use strict";var r=n(389),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:r.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),u=a?r.slice(0,a.index):r,s=[];if(u){if(!n.plainObjects&&o.call(Object.prototype,u)&&!n.allowPrototypes)return;s.push(u)}for(var l=0;null!==(a=i.exec(r))&&l<n.depth;){if(l+=1,!n.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;s.push(a[1])}return a&&s.push("["+r.slice(a.index)+"]"),function(e,t,n){for(var r=t,o=e.length-1;o>=0;--o){var i,a=e[o];if("[]"===a)i=(i=[]).concat(r);else{i=n.plainObjects?Object.create(null):{};var u="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,s=parseInt(u,10);!isNaN(s)&&a!==u&&String(s)===u&&s>=0&&n.parseArrays&&s<=n.arrayLimit?(i=[])[s]=r:i[u]=r}r=i}return r}(s,t,n)}};e.exports=function(e,t){var n=t?r.assign({},t):{};if(null!==n.decoder&&void 0!==n.decoder&&"function"!=typeof n.decoder)throw new TypeError("Decoder has to be a function.");if(n.ignoreQueryPrefix=!0===n.ignoreQueryPrefix,n.delimiter="string"==typeof n.delimiter||r.isRegExp(n.delimiter)?n.delimiter:i.delimiter,n.depth="number"==typeof n.depth?n.depth:i.depth,n.arrayLimit="number"==typeof n.arrayLimit?n.arrayLimit:i.arrayLimit,n.parseArrays=!1!==n.parseArrays,n.decoder="function"==typeof n.decoder?n.decoder:i.decoder,n.allowDots="boolean"==typeof n.allowDots?n.allowDots:i.allowDots,n.plainObjects="boolean"==typeof n.plainObjects?n.plainObjects:i.plainObjects,n.allowPrototypes="boolean"==typeof n.allowPrototypes?n.allowPrototypes:i.allowPrototypes,n.parameterLimit="number"==typeof n.parameterLimit?n.parameterLimit:i.parameterLimit,n.strictNullHandling="boolean"==typeof n.strictNullHandling?n.strictNullHandling:i.strictNullHandling,""===e||null===e||void 0===e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){for(var n={},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,u=r.split(t.delimiter,a),s=0;s<u.length;++s){var l,c,f=u[s],p=f.indexOf("]="),d=-1===p?f.indexOf("="):p+1;-1===d?(l=t.decoder(f,i.decoder),c=t.strictNullHandling?null:""):(l=t.decoder(f.slice(0,d),i.decoder),c=t.decoder(f.slice(d+1),i.decoder)),o.call(n,l)?n[l]=[].concat(n[l]).concat(c):n[l]=c}return n}(e,n):e,s=n.plainObjects?Object.create(null):{},l=Object.keys(u),c=0;c<l.length;++c){var f=l[c],p=a(f,u[f],n);s=r.merge(s,p,n)}return r.compact(s)}},function(e,t){e.exports=FormData},function(e,t,n){n(391);var r=n(231),o=n(392),i=n(392);t.applyOperation=i.applyOperation,t.applyPatch=i.applyPatch,t.applyReducer=i.applyReducer,t.getValueByPointer=i.getValueByPointer,t.validate=i.validate,t.validator=i.validator;var a=n(231);t.JsonPatchError=a.PatchError,t.deepClone=a._deepClone,t.escapePathComponent=a.escapePathComponent,t.unescapePathComponent=a.unescapePathComponent;var u=new WeakMap,s=function(){return function(e){this.observers=new Map,this.obj=e}}(),l=function(){return function(e,t){this.callback=e,this.observer=t}}();function c(e){var t=u.get(e.object);f(t.value,e.object,e.patches,""),e.patches.length&&o.applyPatch(t.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function f(e,t,n,o){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var i=r._objectKeys(t),a=r._objectKeys(e),u=!1,s=a.length-1;s>=0;s--){var l=e[p=a[s]];if(!r.hasOwnProperty(t,p)||void 0===t[p]&&void 0!==l&&!1===Array.isArray(t))n.push({op:"remove",path:o+"/"+r.escapePathComponent(p)}),u=!0;else{var c=t[p];"object"==typeof l&&null!=l&&"object"==typeof c&&null!=c?f(l,c,n,o+"/"+r.escapePathComponent(p)):l!==c&&(!0,n.push({op:"replace",path:o+"/"+r.escapePathComponent(p),value:r._deepClone(c)}))}}if(u||i.length!=a.length)for(s=0;s<i.length;s++){var p=i[s];r.hasOwnProperty(e,p)||void 0===t[p]||n.push({op:"add",path:o+"/"+r.escapePathComponent(p),value:r._deepClone(t[p])})}}}t.unobserve=function(e,t){t.unobserve()},t.observe=function(e,t){var n,o=function(e){return u.get(e)}(e);if(o){var i=function(e,t){return e.observers.get(t)}(o,t);n=i&&i.observer}else o=new s(e),u.set(e,o);if(n)return n;if(n={},o.value=r._deepClone(e),t){n.callback=t,n.next=null;var a=function(){c(n)},f=function(){clearTimeout(n.next),n.next=setTimeout(a)};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mouseup",f),window.addEventListener("keyup",f),window.addEventListener("mousedown",f),window.addEventListener("keydown",f),window.addEventListener("change",f)):(document.documentElement.attachEvent("onmouseup",f),document.documentElement.attachEvent("onkeyup",f),document.documentElement.attachEvent("onmousedown",f),document.documentElement.attachEvent("onkeydown",f),document.documentElement.attachEvent("onchange",f)))}return n.patches=[],n.object=e,n.unobserve=function(){c(n),clearTimeout(n.next),function(e,t){e.observers.delete(t.callback)}(o,n),"undefined"!=typeof window&&(window.removeEventListener?(window.removeEventListener("mouseup",f),window.removeEventListener("keyup",f),window.removeEventListener("mousedown",f),window.removeEventListener("keydown",f)):(document.documentElement.detachEvent("onmouseup",f),document.documentElement.detachEvent("onkeyup",f),document.documentElement.detachEvent("onmousedown",f),document.documentElement.detachEvent("onkeydown",f)))},o.observers.set(t,new l(t,n)),n},t.generate=c,t.compare=function(e,t){var n=[];return f(e,t,n,""),n}},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}(e.exports="function"==typeof Object.keys?Object.keys:n).shim=n},function(e,t){var n="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function r(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}(t=e.exports=n?r:o).supported=r,t.unsupported=o},function(e,t,n){e.exports={default:n(915),__esModule:!0}},function(e,t,n){n(178),n(92),n(916),n(921),n(923),e.exports=n(15).WeakMap},function(e,t,n){"use strict";var r,o=n(232)(0),i=n(159),a=n(124),u=n(264),s=n(919),l=n(28),c=n(51),f=n(393),p=a.getWeak,d=Object.isExtensible,h=s.ufstore,v={},m=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},g={get:function(e){if(l(e)){var t=p(e);return!0===t?h(f(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return s.def(f(this,"WeakMap"),e,t)}},y=e.exports=n(920)("WeakMap",m,g,s,!0,!0);c(function(){return 7!=(new y).set((Object.freeze||Object)(v),7).get(v)})&&(u((r=s.getConstructor(m,"WeakMap")).prototype,g),a.NEED=!0,o(["delete","has","get","set"],function(e){var t=y.prototype,n=t[e];i(t,e,function(t,o){if(l(t)&&!d(t)){this._f||(this._f=new r);var i=this._f[e](t,o);return"set"==e?this:i}return n.call(this,t,o)})}))},function(e,t,n){var r=n(918);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(28),o=n(259),i=n(19)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){"use strict";var r=n(207),o=n(124).getWeak,i=n(36),a=n(28),u=n(205),s=n(145),l=n(232),c=n(52),f=n(393),p=l(5),d=l(6),h=0,v=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},g=function(e,t){return p(e.a,function(e){return e[0]===t})};m.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=d(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,i){var l=e(function(e,r){u(e,l,t,"_i"),e._t=t,e._i=h++,e._l=void 0,void 0!=r&&s(r,n,e[i],e)});return r(l.prototype,{delete:function(e){if(!a(e))return!1;var n=o(e);return!0===n?v(f(this,t)).delete(e):n&&c(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=o(e);return!0===n?v(f(this,t)).has(e):n&&c(n,this._i)}}),l},def:function(e,t,n){var r=o(i(t),!0);return!0===r?v(e).set(t,n):r[e._i]=n,e},ufstore:v}},function(e,t,n){"use strict";var r=n(21),o=n(20),i=n(124),a=n(51),u=n(50),s=n(207),l=n(145),c=n(205),f=n(28),p=n(97),d=n(40).f,h=n(232)(0),v=n(44);e.exports=function(e,t,n,m,g,y){var b=r[e],_=b,w=g?"set":"add",E=_&&_.prototype,x={};return v&&"function"==typeof _&&(y||E.forEach&&!a(function(){(new _).entries().next()}))?(_=t(function(t,n){c(t,_,e,"_c"),t._c=new b,void 0!=n&&l(n,g,t[w],t)}),h("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in E&&(!y||"clear"!=e)&&u(_.prototype,e,function(n,r){if(c(this,_,e),!t&&y&&!f(n))return"get"==e&&void 0;var o=this._c[e](0===n?0:n,r);return t?this:o})}),y||d(_.prototype,"size",{get:function(){return this._c.size}})):(_=m.getConstructor(t,e,g,w),s(_.prototype,n),i.NEED=!0),p(_,e),x[e]=_,o(o.G+o.W+o.F,x),y||m.setStrong(_,e,g),_}},function(e,t,n){n(922)("WeakMap")},function(e,t,n){"use strict";var r=n(20);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){n(924)("WeakMap")},function(e,t,n){"use strict";var r=n(20),o=n(94),i=n(49),a=n(145);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,u,s=arguments[1];return o(this),(t=void 0!==s)&&o(s),void 0==e?new this:(n=[],t?(r=0,u=i(s,arguments[2],2),a(e,!1,function(e){n.push(u(e,r++))})):a(e,!1,n.push,n),new this(n))}})}},function(e,t){var n={};!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return h.iterable&&(t[Symbol.iterator]=function(){return t}),t}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function u(e){var t=new FileReader,n=a(t);return t.readAsArrayBuffer(e),n}function s(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(h.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(h.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(h.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(h.arrayBuffer&&h.blob&&m(e))this._bodyArrayBuffer=s(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!h.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!g(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=s(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):h.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},h.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=a(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},h.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}function c(e,t){var n=(t=t||{}).body;if(e instanceof c){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=function(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function p(e){var t=new o;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}function d(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new o(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var h={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(h.arrayBuffer)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=function(e){return e&&DataView.prototype.isPrototypeOf(e)},g=ArrayBuffer.isView||function(e){return e&&v.indexOf(Object.prototype.toString.call(e))>-1};o.prototype.append=function(e,r){e=t(e),r=n(r);var o=this.map[e];this.map[e]=o?o+","+r:r},o.prototype.delete=function(e){delete this.map[t(e)]},o.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},o.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},o.prototype.set=function(e,r){this.map[t(e)]=n(r)},o.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},o.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},o.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},o.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},h.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];c.prototype.clone=function(){return new c(this,{body:this._bodyInit})},l.call(c.prototype),l.call(d.prototype),d.prototype.clone=function(){return new d(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},d.error=function(){var e=new d(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];d.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new d(null,{status:t,headers:{location:e}})},e.Headers=o,e.Request=c,e.Response=d,e.fetch=function(e,t){return new Promise(function(n,r){var o=new c(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:p(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;n(new d(t,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&h.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}(void 0!==n?n:this),e.exports=n},function(e,t,n){"use strict";var r=t,o=n(54).Buffer;function i(e,t){try{return decodeURIComponent(e)}catch(n){return r.unescapeBuffer(e,t).toString()}}r.unescapeBuffer=function(e,t){for(var n,r,i,a=new o(e.length),u=0,s=0,l=0;s<=e.length;s++){var c=s<e.length?e.charCodeAt(s):NaN;switch(u){case 0:switch(c){case 37:n=0,r=0,u=1;break;case 43:t&&(c=32);default:a[l++]=c}break;case 1:if(i=c,c>=48&&c<=57)n=c-48;else if(c>=65&&c<=70)n=c-65+10;else{if(!(c>=97&&c<=102)){a[l++]=37,a[l++]=c,u=0;break}n=c-97+10}u=2;break;case 2:if(u=0,c>=48&&c<=57)r=c-48;else if(c>=65&&c<=70)r=c-65+10;else{if(!(c>=97&&c<=102)){a[l++]=37,a[l++]=i,a[l++]=c;break}r=c-97+10}a[l++]=16*n+r}}return a.slice(0,l-1)},r.unescape=i;for(var a=new Array(256),u=0;u<256;++u)a[u]="%"+((u<16?"0":"")+u.toString(16)).toUpperCase();r.escape=function(e){"string"!=typeof e&&(e+="");for(var t="",n=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);if(!(33===o||45===o||46===o||95===o||126===o||o>=39&&o<=42||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122))if(r-n>0&&(t+=e.slice(n,r)),o<128)n=r+1,t+=a[o];else if(o<2048)n=r+1,t+=a[192|o>>6]+a[128|63&o];else if(o<55296||o>=57344)n=r+1,t+=a[224|o>>12]+a[128|o>>6&63]+a[128|63&o];else{var i;if(!(++r<e.length))throw new URIError("URI malformed");i=1023&e.charCodeAt(r),n=r+1,t+=a[240|(o=65536+((1023&o)<<10|i))>>18]+a[128|o>>12&63]+a[128|o>>6&63]+a[128|63&o]}}return 0===n?e:n<e.length?t+e.slice(n):t};var s=function(e){return"string"==typeof e?e:"number"==typeof e&&isFinite(e)?""+e:"boolean"==typeof e?e?"true":"false":""};function l(e,t){try{return t(e)}catch(t){return r.unescape(e,!0)}}r.stringify=r.encode=function(e,t,n,o){t=t||"&",n=n||"=";var i=r.escape;if(o&&"function"==typeof o.encodeURIComponent&&(i=o.encodeURIComponent),null!==e&&"object"==typeof e){for(var a=Object.keys(e),u=a.length,l=u-1,c="",f=0;f<u;++f){var p=a[f],d=e[p],h=i(s(p))+n;if(Array.isArray(d)){for(var v=d.length,m=v-1,g=0;g<v;++g)c+=h+i(s(d[g])),g<m&&(c+=t);v&&f<l&&(c+=t)}else c+=h+i(s(d)),f<l&&(c+=t)}return c}return""},r.parse=r.decode=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;"string"!=typeof t&&(t+="");var u=n.length,s=t.length,c=1e3;o&&"number"==typeof o.maxKeys&&(c=o.maxKeys);var f=1/0;c>0&&(f=c);var p=r.unescape;o&&"function"==typeof o.decodeURIComponent&&(p=o.decodeURIComponent);for(var d=p!==i,h=[],v=0,m=0,g=0,y="",b="",_=d,w=d,E=0,x=0;x<e.length;++x){var S=e.charCodeAt(x);if(S!==t.charCodeAt(m)){if(m=0,w||(37===S?E=1:E>0&&(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102)?3==++E&&(w=!0):E=0),g<u){if(S===n.charCodeAt(g)){if(++g===u)v<(k=x-g+1)&&(y+=e.slice(v,k)),E=0,v=x+1;continue}g=0,_||(37===S?E=1:E>0&&(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102)?3==++E&&(_=!0):E=0)}43===S&&(g<u?(x-v>0&&(y+=e.slice(v,x)),y+="%20",_=!0):(x-v>0&&(b+=e.slice(v,x)),b+="%20",w=!0),v=x+1)}else if(++m===s){var C,k=x-m+1;if(g<u?v<k&&(y+=e.slice(v,k)):v<k&&(b+=e.slice(v,k)),_&&(y=l(y,p)),w&&(b=l(b,p)),-1===h.indexOf(y))a[y]=b,h[h.length]=y;else(C=a[y])instanceof Array?C[C.length]=b:a[y]=[C,b];if(0==--f)break;_=w=d,E=0,y=b="",v=x+1,m=g=0}}f>0&&(v<e.length||g>0)&&(v<e.length&&(g<u?y+=e.slice(v):m<s&&(b+=e.slice(v))),_&&(y=l(y,p)),w&&(b=l(b,p)),-1===h.indexOf(y)?(a[y]=b,h[h.length]=y):(C=a[y])instanceof Array?C[C.length]=b:a[y]=[C,b]);return a}},function(e,t,n){var r=n(928),o=n(382)(function(e,t){return null==e?{}:r(e,t)});e.exports=o},function(e,t,n){var r=n(929),o=n(301);e.exports=function(e,t){return r(e,t,function(t,n){return o(e,n)})}},function(e,t,n){var r=n(139),o=n(344),i=n(79);e.exports=function(e,t,n){for(var a=-1,u=t.length,s={};++a<u;){var l=t[a],c=r(e,l);n(c,l)&&o(s,i(l,e),c)}return s}},function(e,t,n){"use strict";
/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},o=t||{},a=e.split(i),s=o.decode||r,l=0;l<a.length;l++){var c=a[l],f=c.indexOf("=");if(!(f<0)){var p=c.substr(0,f).trim(),d=c.substr(++f,c.length).trim();'"'==d[0]&&(d=d.slice(1,-1)),void 0==n[p]&&(n[p]=u(d,s))}}return n},t.serialize=function(e,t,n){var r=n||{},i=r.encode||o;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!a.test(e))throw new TypeError("argument name is invalid");var u=i(t);if(u&&!a.test(u))throw new TypeError("argument val is invalid");var s=e+"="+u;if(null!=r.maxAge){var l=r.maxAge-0;if(isNaN(l))throw new Error("maxAge should be a Number");s+="; Max-Age="+Math.floor(l)}if(r.domain){if(!a.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!a.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");s+="; Expires="+r.expires.toUTCString()}r.httpOnly&&(s+="; HttpOnly");r.secure&&(s+="; Secure");if(r.sameSite){var c="string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite;switch(c){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;default:throw new TypeError("option sameSite is invalid")}}return s};var r=decodeURIComponent,o=encodeURIComponent,i=/; */,a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function u(e,t){try{return t(e)}catch(t){return e}}},function(e,t,n){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},function(e,t){e.exports=function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<e.length){var o=e.charCodeAt(n+1);if(o>=56320&&o<=57343){var i=1024*(r-55296)+o-56320+65536;t.push(240+Math.floor(i/64/64/64),128+Math.floor(i/64/64)%64,128+Math.floor(i/64)%64,128+i%64),n+=1;continue}}r>=2048?t.push(224+Math.floor(r/64/64),128+Math.floor(r/64)%64,128+r%64):r>=128?t.push(192+Math.floor(r/64),128+r%64):t.push(r)}return t}},function(e,t){!function(){var e;function n(e,t){function n(e,t,n){if(!r(e))return n;var o=0,i=0;do{var a=t.exec(e);if(null===a)break;if(!(i<n))break;o+=a[0].length,i++}while(null!==a);return o>=e.length?-1:o}function r(e){return a.test(e)}function o(e,n){void 0==e&&(e=["[^]"]),void 0==n&&(n="g");var r=[];return t.forEach(function(e){r.push(e.source)}),r.push(i.source),r=r.concat(e),new RegExp(r.join("|"),n)}e.findCharIndex=function(e,t){if(t>=e.length)return-1;if(!r(e))return t;for(var n=o(),i=0;null!==n.exec(e)&&!(n.lastIndex>t);)i++;return i},e.findByteIndex=function(e,t){return t>=this.length(e)?-1:n(e,o(),t)},e.charAt=function(e,t){var n=this.findByteIndex(e,t);if(n<0||n>=e.length)return"";var r=e.slice(n,n+8),o=a.exec(r);return null===o?r[0]:o[0]},e.charCodeAt=function(e,t){var r=function(e,t){return n(e,new RegExp(i.source,"g"),t)}(e,t);if(r<0)return NaN;var o=e.charCodeAt(r);return 55296<=o&&o<=56319?1024*(o-55296)+(e.charCodeAt(r+1)-56320)+65536:o},e.fromCharCode=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):String.fromCharCode(e)},e.indexOf=function(e,t,n){void 0!==n&&null!==n||(n=0);var r=this.findByteIndex(e,n),o=e.indexOf(t,r);return o<0?-1:this.findCharIndex(e,o)},e.lastIndexOf=function(e,t,n){var r;if(void 0===n||null===n)r=e.lastIndexOf(t);else{var o=this.findByteIndex(e,n);r=e.lastIndexOf(t,o)}return r<0?-1:this.findCharIndex(e,r)},e.slice=function(e,t,n){var r,o=this.findByteIndex(e,t);return o<0&&(o=e.length),void 0===n||null===n?r=e.length:(r=this.findByteIndex(e,n))<0&&(r=e.length),e.slice(o,r)},e.substr=function(e,t,n){return t<0&&(t=this.length(e)+t),void 0===n||null===n?this.slice(e,t):this.slice(e,t,t+n)},e.substring=e.slice,e.length=function(e){return this.findCharIndex(e,e.length-1)+1},e.stringToCodePoints=function(e){for(var t=[],n=0;n<e.length&&(codePoint=this.charCodeAt(e,n),codePoint);n++)t.push(codePoint);return t},e.codePointsToString=function(e){for(var t=[],n=0;n<e.length;n++)t.push(this.fromCharCode(e[n]));return t.join("")},e.stringToBytes=function(e){for(var t=[],n=0;n<e.length;n++){for(var r=e.charCodeAt(n),o=[];r>0;)o.push(255&r),r>>=8;1==o.length&&o.push(0),t=t.concat(o.reverse())}return t},e.bytesToString=function(e){for(var t=[],n=0;n<e.length;n+=2){var r=e[n]<<8|e[n+1];t.push(String.fromCharCode(r))}return t.join("")},e.stringToCharArray=function(e){var t=[],n=o();do{var r=n.exec(e);if(null===r)break;t.push(r[0])}while(null!==r);return t};var i=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,a=o([],"")}void 0!==t&&null!==t?e=t:"undefined"!=typeof window&&null!==window&&(void 0!==window.UtfString&&null!==window.UtfString||(window.UtfString={}),e=window.UtfString);e.visual={},n(e,[]),n(e.visual,[/\uD83C[\uDDE6-\uDDFF]\uD83C[\uDDE6-\uDDFF]/])}()},function(e,t){e.exports='---\nurl: "https://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://online.swagger.io/validator"'},function(e,t,n){var r,o,i;o=[],r=function(){"use strict";var e=function(e){return e&&"getComputedStyle"in window&&"smooth"===window.getComputedStyle(e)["scroll-behavior"]};if("undefined"==typeof window||!("document"in window))return{};var t=function(t,n,r){var o;n=n||999,r||0===r||(r=9);var i=function(e){o=e},a=function(){clearTimeout(o),i(0)},u=function(e){return Math.max(0,t.getTopOf(e)-r)},s=function(r,o,u){if(a(),0===o||o&&o<0||e(t.body))t.toY(r),u&&u();else{var s=t.getY(),l=Math.max(0,r)-s,c=(new Date).getTime();o=o||Math.min(Math.abs(l),n),function e(){i(setTimeout(function(){var n=Math.min(1,((new Date).getTime()-c)/o),r=Math.max(0,Math.floor(s+l*(n<.5?2*n*n:n*(4-2*n)-1)));t.toY(r),n<1&&t.getHeight()+r<t.body.scrollHeight?e():(setTimeout(a,99),u&&u())},9))}()}},l=function(e,t,n){s(u(e),t,n)};return{setup:function(e,t){return(0===e||e)&&(n=e),(0===t||t)&&(r=t),{defaultDuration:n,edgeOffset:r}},to:l,toY:s,intoView:function(e,n,o){var i=e.getBoundingClientRect().height,a=t.getTopOf(e)+i,c=t.getHeight(),f=t.getY(),p=f+c;u(e)<f||i+r>c?l(e,n,o):a+r>p?s(a-c+r,n,o):o&&o()},center:function(e,n,r,o){s(Math.max(0,t.getTopOf(e)-t.getHeight()/2+(r||e.getBoundingClientRect().height/2)),n,o)},stop:a,moving:function(){return!!o},getY:t.getY,getTopOf:t.getTopOf}},n=document.documentElement,r=function(){return window.scrollY||n.scrollTop},o=t({body:document.scrollingElement||document.body,toY:function(e){window.scrollTo(0,e)},getY:r,getHeight:function(){return window.innerHeight||n.clientHeight},getTopOf:function(e){return e.getBoundingClientRect().top+r()-n.offsetTop}});if(o.createScroller=function(e,r,o){return t({body:e,toY:function(t){e.scrollTop=t},getY:function(){return e.scrollTop},getHeight:function(){return Math.min(e.clientHeight,window.innerHeight||n.clientHeight)},getTopOf:function(e){return e.offsetTop}},r,o)},"addEventListener"in window&&!window.noZensmooth&&!e(document.body)){var i="history"in window&&"pushState"in history,a=i&&"scrollRestoration"in history;a&&(history.scrollRestoration="auto"),window.addEventListener("load",function(){a&&(setTimeout(function(){history.scrollRestoration="manual"},9),window.addEventListener("popstate",function(e){e.state&&"zenscrollY"in e.state&&o.toY(e.state.zenscrollY)},!1)),window.location.hash&&setTimeout(function(){var e=o.setup().edgeOffset;if(e){var t=document.getElementById(window.location.href.split("#")[1]);if(t){var n=Math.max(0,o.getTopOf(t)-e),r=o.getY()-n;0<=r&&r<9&&window.scrollTo(0,n)}}},9)},!1);var u=new RegExp("(^|\\s)noZensmooth(\\s|$)");window.addEventListener("click",function(e){for(var t=e.target;t&&"A"!==t.tagName;)t=t.parentNode;if(!(!t||1!==e.which||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)){if(a){var n=history.state&&"object"==typeof history.state?history.state:{};n.zenscrollY=o.getY();try{history.replaceState(n,"")}catch(e){}}var r=t.getAttribute("href")||"";if(0===r.indexOf("#")&&!u.test(t.className)){var s=0,l=document.getElementById(r.substring(1));if("#"!==r){if(!l)return;s=o.getTopOf(l)}e.preventDefault();var c=function(){window.location=r},f=o.setup().edgeOffset;f&&(s=Math.max(0,s-f),i&&(c=function(){history.pushState({},"",r)})),o.toY(s,null,c)}}},!1)}return o}(),void 0===(i="function"==typeof r?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(4)),o=p(n(2)),i=p(n(3)),a=p(n(5)),u=p(n(6)),s=n(0),l=p(s),c=(p(n(1)),p(n(12)),n(388)),f=n(7);function p(e){return e&&e.__esModule?e:{default:e}}var d=c.helpers.opId,h=function(e){function t(e,n){(0,o.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,r.default)(t)).call(this,e,n));return i.toggleShown=function(){var e=i.props,t=e.layoutActions,n=e.tag,r=e.operationId,o=e.isShown,a=i.getResolvedSubtree();o||void 0!==a||i.requestResolvedSubtree(),t.show(["operations",n,r],!o)},i.onCancelClick=function(){i.setState({tryItOutEnabled:!i.state.tryItOutEnabled})},i.onTryoutClick=function(){var e=i.props,t=e.specActions,n=e.path,r=e.method;i.setState({tryItOutEnabled:!i.state.tryItOutEnabled}),t.clearValidateParams([n,r])},i.onExecute=function(){i.setState({executeInProgress:!0})},i.getResolvedSubtree=function(){var e=i.props,t=e.specSelectors,n=e.path,r=e.method,o=e.specPath;return o?t.specResolvedSubtree(o.toJS()):t.specResolvedSubtree(["paths",n,r])},i.requestResolvedSubtree=function(){var e=i.props,t=e.specActions,n=e.path,r=e.method,o=e.specPath;return o?t.requestResolvedSubtree(o.toJS()):t.requestResolvedSubtree(["paths",n,r])},i.state={tryItOutEnabled:!1,executeInProgress:!1},i}return(0,u.default)(t,e),(0,i.default)(t,[{key:"mapStateToProps",value:function(e,t){var n=t.op,r=t.layoutSelectors,o=(0,t.getConfigs)(),i=o.docExpansion,a=o.deepLinking,u=o.displayOperationId,s=o.displayRequestDuration,l=o.supportedSubmitMethods,c=r.showSummary(),f=n.getIn(["operation","__originalOperationId"])||n.getIn(["operation","operationId"])||d(n.get("operation"),t.path,t.method)||n.get("id"),p=["operations",t.tag,f],h=a&&"false"!==a,v=l.indexOf(t.method)>=0&&(void 0===t.allowTryItOut?t.specSelectors.allowTryItOutFor(t.path,t.method):t.allowTryItOut),m=n.getIn(["operation","security"])||t.specSelectors.security();return{operationId:f,isDeepLinkingEnabled:h,showSummary:c,displayOperationId:u,displayRequestDuration:s,allowTryItOut:v,security:m,isAuthorized:t.authSelectors.isAuthorized(m),isShown:r.isShown(p,"full"===i),jumpToKey:"paths."+t.path+"."+t.method,response:t.specSelectors.responseFor(t.path,t.method),request:t.specSelectors.requestFor(t.path,t.method)}}},{key:"componentDidMount",value:function(){var e=this.props.isShown,t=this.getResolvedSubtree();e&&void 0===t&&this.requestResolvedSubtree()}},{key:"componentWillReceiveProps",value:function(e){var t=e.response,n=e.isShown,r=this.getResolvedSubtree();t!==this.props.response&&this.setState({executeInProgress:!1}),n&&void 0===r&&this.requestResolvedSubtree()}},{key:"render",value:function(){var e=this.props,t=e.op,n=e.tag,r=e.path,o=e.method,i=e.security,a=e.isAuthorized,u=e.operationId,s=e.showSummary,c=e.isShown,p=e.jumpToKey,d=e.allowTryItOut,h=e.response,v=e.request,m=e.displayOperationId,g=e.displayRequestDuration,y=e.isDeepLinkingEnabled,b=e.specPath,_=e.specSelectors,w=e.specActions,E=e.getComponent,x=e.getConfigs,S=e.layoutSelectors,C=e.layoutActions,k=e.authActions,A=e.authSelectors,O=e.oas3Actions,P=e.oas3Selectors,T=e.fn,M=E("operation"),I=this.getResolvedSubtree()||(0,f.Map)(),j=(0,f.fromJS)({op:I,tag:n,path:r,summary:t.getIn(["operation","summary"])||"",deprecated:I.get("deprecated")||t.getIn(["operation","deprecated"])||!1,method:o,security:i,isAuthorized:a,operationId:u,originalOperationId:I.getIn(["operation","__originalOperationId"]),showSummary:s,isShown:c,jumpToKey:p,allowTryItOut:d,request:v,displayOperationId:m,displayRequestDuration:g,isDeepLinkingEnabled:y,executeInProgress:this.state.executeInProgress,tryItOutEnabled:this.state.tryItOutEnabled});return l.default.createElement(M,{operation:j,response:h,request:v,isShown:c,toggleShown:this.toggleShown,onTryoutClick:this.onTryoutClick,onCancelClick:this.onCancelClick,onExecute:this.onExecute,specPath:b,specActions:w,specSelectors:_,oas3Actions:O,oas3Selectors:P,layoutActions:C,layoutSelectors:S,authActions:k,authSelectors:A,getComponent:E,getConfigs:x,fn:T})}}]),t}(s.PureComponent);h.defaultProps={showSummary:!0,response:null,allowTryItOut:!0,displayOperationId:!1,displayRequestDuration:!1},t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"getLayout",value:function(){var e=this.props,t=e.getComponent,n=e.layoutSelectors.current(),r=t(n,!0);return r||function(){return s.default.createElement("h1",null,' No layout defined for "',n,'" ')}}},{key:"render",value:function(){var e=this.getLayout();return s.default.createElement(e,null)}}]),t}(s.default.Component);t.default=c,c.defaultProps={}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){var e,n,i,u;(0,o.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=i=(0,a.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),i.close=function(){i.props.authActions.showDefinitions(!1)},u=n,(0,a.default)(i,u)}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.authSelectors,n=e.authActions,r=e.getComponent,o=e.errSelectors,i=e.specSelectors,a=e.fn.AST,u=void 0===a?{}:a,l=t.shownDefinitions(),c=r("auths");return s.default.createElement("div",{className:"dialog-ux"},s.default.createElement("div",{className:"backdrop-ux"}),s.default.createElement("div",{className:"modal-ux"},s.default.createElement("div",{className:"modal-dialog-ux"},s.default.createElement("div",{className:"modal-ux-inner"},s.default.createElement("div",{className:"modal-ux-header"},s.default.createElement("h3",null,"Available authorizations"),s.default.createElement("button",{type:"button",className:"close-modal",onClick:this.close},s.default.createElement("svg",{width:"20",height:"20"},s.default.createElement("use",{href:"#close",xlinkHref:"#close"})))),s.default.createElement("div",{className:"modal-ux-content"},l.valueSeq().map(function(e,a){return s.default.createElement(c,{key:a,AST:u,definitions:e,getComponent:r,errSelectors:o,authSelectors:t,authActions:n,specSelectors:i})}))))))}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.isAuthorized,n=e.showPopup,r=e.onClick,o=(0,e.getComponent)("authorizationPopup",!0);return s.default.createElement("div",{className:"auth-wrapper"},s.default.createElement("button",{className:t?"btn authorize locked":"btn authorize unlocked",onClick:r},s.default.createElement("span",null,"Authorize"),s.default.createElement("svg",{width:"20",height:"20"},s.default.createElement("use",{href:t?"#locked":"#unlocked",xlinkHref:t?"#locked":"#unlocked"}))),n&&s.default.createElement(o,null))}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.authActions,n=e.authSelectors,r=e.specSelectors,o=e.getComponent,i=r.securityDefinitions(),a=n.definitionsToAuthorize(),u=o("authorizeBtn");return i?s.default.createElement(u,{onClick:function(){return t.showDefinitions(a)},isAuthorized:!!n.authorized().size,showPopup:!!n.shownDefinitions(),getComponent:o}):null}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){var e,n,i,u;(0,o.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=i=(0,a.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),i.onClick=function(e){e.stopPropagation();var t=i.props.onClick;t&&t()},u=n,(0,a.default)(i,u)}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props.isAuthorized;return s.default.createElement("button",{className:e?"authorization__btn locked":"authorization__btn unlocked","aria-label":e?"authorization button locked":"authorization button unlocked",onClick:this.onClick},s.default.createElement("svg",{width:"20",height:"20"},s.default.createElement("use",{href:e?"#locked":"#unlocked",xlinkHref:e?"#locked":"#unlocked"})))}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(22)),o=c(n(4)),i=c(n(2)),a=c(n(3)),u=c(n(5)),s=c(n(6)),l=c(n(0));c(n(1)),c(n(12));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(e,n){(0,i.default)(this,t);var a=(0,u.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));return a.onAuthChange=function(e){var t=e.name;a.setState((0,r.default)({},t,e))},a.submitAuth=function(e){e.preventDefault(),a.props.authActions.authorize(a.state)},a.logoutClick=function(e){e.preventDefault();var t=a.props,n=t.authActions,r=t.definitions.map(function(e,t){return t}).toArray();n.logout(r)},a.close=function(e){e.preventDefault(),a.props.authActions.showDefinitions(!1)},a.state={},a}return(0,s.default)(t,e),(0,a.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.definitions,r=t.getComponent,o=t.authSelectors,i=t.errSelectors,a=r("AuthItem"),u=r("oauth2",!0),s=r("Button"),c=o.authorized(),f=n.filter(function(e,t){return!!c.get(t)}),p=n.filter(function(e){return"oauth2"!==e.get("type")}),d=n.filter(function(e){return"oauth2"===e.get("type")});return l.default.createElement("div",{className:"auth-container"},!!p.size&&l.default.createElement("form",{onSubmit:this.submitAuth},p.map(function(t,n){return l.default.createElement(a,{key:n,schema:t,name:n,getComponent:r,onAuthChange:e.onAuthChange,authorized:c,errSelectors:i})}).toArray(),l.default.createElement("div",{className:"auth-btn-wrapper"},p.size===f.size?l.default.createElement(s,{className:"btn modal-btn auth",onClick:this.logoutClick},"Logout"):l.default.createElement(s,{type:"submit",className:"btn modal-btn auth authorize"},"Authorize"),l.default.createElement(s,{className:"btn modal-btn auth btn-done",onClick:this.close},"Close"))),d&&d.size?l.default.createElement("div",null,l.default.createElement("div",{className:"scope-def"},l.default.createElement("p",null,"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes."),l.default.createElement("p",null,"API requires the following scopes. Select which ones you want to grant to Swagger UI.")),n.filter(function(e){return"oauth2"===e.get("type")}).map(function(e,t){return l.default.createElement("div",{key:t},l.default.createElement(u,{authorized:c,schema:e,name:t}))}).toArray()):null)}}]),t}(l.default.Component);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1)),l(n(12));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.name,r=e.getComponent,o=e.onAuthChange,i=e.authorized,a=e.errSelectors,u=r("apiKeyAuth"),l=r("basicAuth"),c=void 0,f=t.get("type");switch(f){case"apiKey":c=s.default.createElement(u,{key:n,schema:t,name:n,errSelectors:a,authorized:i,getComponent:r,onChange:o});break;case"basic":c=s.default.createElement(l,{key:n,schema:t,name:n,errSelectors:a,authorized:i,getComponent:r,onChange:o});break;default:c=s.default.createElement("div",{key:n},"Unknown security definition type ",f)}return s.default.createElement("div",{key:n+"-jump"},c)}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props.error,t=e.get("level"),n=e.get("message"),r=e.get("source");return s.default.createElement("div",{className:"errors",style:{backgroundColor:"#ffeeee",color:"red",margin:"1em"}},s.default.createElement("b",{style:{textTransform:"capitalize",marginRight:"1em"}},r," ",t),s.default.createElement("span",null,n))}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(23)),o=c(n(4)),i=c(n(2)),a=c(n(3)),u=c(n(5)),s=c(n(6)),l=c(n(0));c(n(1));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(e,n){(0,i.default)(this,t);var r=(0,u.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));p.call(r);var a=r.props,s=a.name,l=a.schema,c=r.getValue();return r.state={name:s,schema:l,value:c},r}return(0,s.default)(t,e),(0,a.default)(t,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.errSelectors,o=e.name,i=n("Input"),a=n("Row"),u=n("Col"),s=n("authError"),c=n("Markdown"),f=n("JumpToPath",!0),p=this.getValue(),d=r.allErrors().filter(function(e){return e.get("authId")===o});return l.default.createElement("div",null,l.default.createElement("h4",null,l.default.createElement("code",null,o||t.get("name"))," (apiKey)",l.default.createElement(f,{path:["securityDefinitions",o]})),p&&l.default.createElement("h6",null,"Authorized"),l.default.createElement(a,null,l.default.createElement(c,{source:t.get("description")})),l.default.createElement(a,null,l.default.createElement("p",null,"Name: ",l.default.createElement("code",null,t.get("name")))),l.default.createElement(a,null,l.default.createElement("p",null,"In: ",l.default.createElement("code",null,t.get("in")))),l.default.createElement(a,null,l.default.createElement("label",null,"Value:"),p?l.default.createElement("code",null," ****** "):l.default.createElement(u,null,l.default.createElement(i,{type:"text",onChange:this.onChange}))),d.valueSeq().map(function(e,t){return l.default.createElement(s,{error:e,key:t})}))}}]),t}(l.default.Component),p=function(){var e=this;this.onChange=function(t){var n=e.props.onChange,o=t.target.value,i=(0,r.default)({},e.state,{value:o});e.setState(i),n(i)}};t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1)),l(n(12));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e,n){(0,o.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,r.default)(t)).call(this,e,n));f.call(i);var u=i.props,s=u.schema,l=u.name,c=i.getValue().username;return i.state={name:l,schema:s,value:c?{username:c}:{}},i}return(0,u.default)(t,e),(0,i.default)(t,[{key:"getValue",value:function(){var e=this.props,t=e.authorized,n=e.name;return t&&t.getIn([n,"value"])||{}}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.name,o=e.errSelectors,i=n("Input"),a=n("Row"),u=n("Col"),l=n("authError"),c=n("JumpToPath",!0),f=n("Markdown"),p=this.getValue().username,d=o.allErrors().filter(function(e){return e.get("authId")===r});return s.default.createElement("div",null,s.default.createElement("h4",null,"Basic authorization",s.default.createElement(c,{path:["securityDefinitions",r]})),p&&s.default.createElement("h6",null,"Authorized"),s.default.createElement(a,null,s.default.createElement(f,{source:t.get("description")})),s.default.createElement(a,null,s.default.createElement("label",null,"Username:"),p?s.default.createElement("code",null," ",p," "):s.default.createElement(u,null,s.default.createElement(i,{type:"text",required:"required",name:"username",onChange:this.onChange}))),s.default.createElement(a,null,s.default.createElement("label",null,"Password:"),p?s.default.createElement("code",null," ****** "):s.default.createElement(u,null,s.default.createElement(i,{required:"required",autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),d.valueSeq().map(function(e,t){return s.default.createElement(l,{error:e,key:t})}))}}]),t}(s.default.Component),f=function(){var e=this;this.onChange=function(t){var n=e.props.onChange,r=t.target,o=r.value,i=r.name,a=e.state.value;a[i]=o,e.setState({value:a}),n(e.state)}};t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(22)),o=f(n(4)),i=f(n(2)),a=f(n(3)),u=f(n(5)),s=f(n(6)),l=f(n(0)),c=(f(n(1)),f(n(948)));function f(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(e,n){(0,i.default)(this,t);var r=(0,u.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));d.call(r);var a=r.props,s=a.name,l=a.schema,c=a.authorized,f=a.authSelectors,p=c&&c.get(s),h=f.getConfigs()||{},v=p&&p.get("username")||"",m=p&&p.get("clientId")||h.clientId||"",g=p&&p.get("clientSecret")||h.clientSecret||"",y=p&&p.get("passwordType")||"basic";return r.state={appName:h.appName,name:s,schema:l,scopes:[],clientId:m,clientSecret:g,username:v,password:"",passwordType:y},r}return(0,s.default)(t,e),(0,a.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.schema,r=t.getComponent,o=t.authSelectors,i=t.errSelectors,a=t.name,u=t.specSelectors,s=r("Input"),c=r("Row"),f=r("Col"),p=r("Button"),d=r("authError"),h=r("JumpToPath",!0),v=r("Markdown"),m=u.isOAS3,g=m()?"authorizationCode":"accessCode",y=m()?"clientCredentials":"application",b=n.get("flow"),_=n.get("allowedScopes")||n.get("scopes"),w=!!o.authorized().get(a),E=i.allErrors().filter(function(e){return e.get("authId")===a}),x=!E.filter(function(e){return"validation"===e.get("source")}).size,S=n.get("description");return l.default.createElement("div",null,l.default.createElement("h4",null,a," (OAuth2, ",n.get("flow"),") ",l.default.createElement(h,{path:["securityDefinitions",a]})),this.state.appName?l.default.createElement("h5",null,"Application: ",this.state.appName," "):null,S&&l.default.createElement(v,{source:n.get("description")}),w&&l.default.createElement("h6",null,"Authorized"),("implicit"===b||b===g)&&l.default.createElement("p",null,"Authorization URL: ",l.default.createElement("code",null,n.get("authorizationUrl"))),("password"===b||b===g||b===y)&&l.default.createElement("p",null,"Token URL:",l.default.createElement("code",null," ",n.get("tokenUrl"))),l.default.createElement("p",{className:"flow"},"Flow: ",l.default.createElement("code",null,n.get("flow"))),"password"!==b?null:l.default.createElement(c,null,l.default.createElement(c,null,l.default.createElement("label",{htmlFor:"oauth_username"},"username:"),w?l.default.createElement("code",null," ",this.state.username," "):l.default.createElement(f,{tablet:10,desktop:10},l.default.createElement("input",{id:"oauth_username",type:"text","data-name":"username",onChange:this.onInputChange}))),l.default.createElement(c,null,l.default.createElement("label",{htmlFor:"oauth_password"},"password:"),w?l.default.createElement("code",null," ****** "):l.default.createElement(f,{tablet:10,desktop:10},l.default.createElement("input",{id:"oauth_password",type:"password","data-name":"password",onChange:this.onInputChange}))),l.default.createElement(c,null,l.default.createElement("label",{htmlFor:"password_type"},"Client credentials location:"),w?l.default.createElement("code",null," ",this.state.passwordType," "):l.default.createElement(f,{tablet:10,desktop:10},l.default.createElement("select",{id:"password_type","data-name":"passwordType",onChange:this.onInputChange},l.default.createElement("option",{value:"basic"},"Authorization header"),l.default.createElement("option",{value:"request-body"},"Request body"))))),(b===y||"implicit"===b||b===g||"password"===b)&&(!w||w&&this.state.clientId)&&l.default.createElement(c,null,l.default.createElement("label",{htmlFor:"client_id"},"client_id:"),w?l.default.createElement("code",null," ****** "):l.default.createElement(f,{tablet:10,desktop:10},l.default.createElement("input",{id:"client_id",type:"text",required:"password"===b,value:this.state.clientId,"data-name":"clientId",onChange:this.onInputChange}))),(b===y||b===g||"password"===b)&&l.default.createElement(c,null,l.default.createElement("label",{htmlFor:"client_secret"},"client_secret:"),w?l.default.createElement("code",null," ****** "):l.default.createElement(f,{tablet:10,desktop:10},l.default.createElement("input",{id:"client_secret",value:this.state.clientSecret,type:"text","data-name":"clientSecret",onChange:this.onInputChange}))),!w&&_&&_.size?l.default.createElement("div",{className:"scopes"},l.default.createElement("h2",null,"Scopes:"),_.map(function(t,n){return l.default.createElement(c,{key:n},l.default.createElement("div",{className:"checkbox"},l.default.createElement(s,{"data-value":n,id:n+"-"+b+"-checkbox-"+e.state.name,disabled:w,type:"checkbox",onChange:e.onScopeChange}),l.default.createElement("label",{htmlFor:n+"-"+b+"-checkbox-"+e.state.name},l.default.createElement("span",{className:"item"}),l.default.createElement("div",{className:"text"},l.default.createElement("p",{className:"name"},n),l.default.createElement("p",{className:"description"},t)))))}).toArray()):null,E.valueSeq().map(function(e,t){return l.default.createElement(d,{error:e,key:t})}),l.default.createElement("div",{className:"auth-btn-wrapper"},x&&(w?l.default.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.logout},"Logout"):l.default.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.authorize},"Authorize")),l.default.createElement(p,{className:"btn modal-btn auth btn-done",onClick:this.close},"Close")))}}]),t}(l.default.Component),d=function(){var e=this;this.close=function(t){t.preventDefault(),e.props.authActions.showDefinitions(!1)},this.authorize=function(){var t=e.props,n=t.authActions,r=t.errActions,o=t.getConfigs,i=t.authSelectors,a=o(),u=i.getConfigs();r.clear({authId:name,type:"auth",source:"auth"}),(0,c.default)({auth:e.state,authActions:n,errActions:r,configs:a,authConfigs:u})},this.onScopeChange=function(t){var n=t.target,r=n.checked,o=n.dataset.value;if(r&&-1===e.state.scopes.indexOf(o)){var i=e.state.scopes.concat([o]);e.setState({scopes:i})}else!r&&e.state.scopes.indexOf(o)>-1&&e.setState({scopes:e.state.scopes.filter(function(e){return e!==o})})},this.onInputChange=function(t){var n=t.target,o=n.dataset.name,i=n.value,a=(0,r.default)({},o,i);e.setState(a)},this.logout=function(t){t.preventDefault();var n=e.props,r=n.authActions,o=n.errActions,i=n.name;o.clear({authId:i,type:"auth",source:"auth"}),r.logout([i])}};t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.auth,n=e.authActions,r=e.errActions,o=e.configs,u=e.authConfigs,s=void 0===u?{}:u,l=t.schema,c=t.scopes,f=t.name,p=t.clientId,d=l.get("flow"),h=[];switch(d){case"password":return void n.authorizePassword(t);case"application":return void n.authorizeApplication(t);case"accessCode":h.push("response_type=code");break;case"implicit":h.push("response_type=token");break;case"clientCredentials":return void n.authorizeApplication(t);case"authorizationCode":h.push("response_type=code")}"string"==typeof p&&h.push("client_id="+encodeURIComponent(p));var v=o.oauth2RedirectUrl;if(void 0===v)return void r.newAuthErr({authId:f,source:"validation",level:"error",message:"oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed."});if(h.push("redirect_uri="+encodeURIComponent(v)),Array.isArray(c)&&0<c.length){var m=s.scopeSeparator||" ";h.push("scope="+encodeURIComponent(c.join(m)))}var g=(0,a.btoa)(new Date);h.push("state="+encodeURIComponent(g)),void 0!==s.realm&&h.push("realm="+encodeURIComponent(s.realm));var y=s.additionalQueryStringParams;for(var b in y)void 0!==y[b]&&h.push([b,y[b]].map(encodeURIComponent).join("="));var _=l.get("authorizationUrl"),w=[_,h.join("&")].join(-1===_.indexOf("?")?"?":"&"),E=void 0;E="implicit"===d?n.preAuthorizeImplicit:s.useBasicAuthenticationWithAccessCodeGrant?n.authorizeAccessCodeWithBasicAuthentication:n.authorizeAccessCodeWithFormParams;i.default.swaggerUIRedirectOauth2={auth:t,state:g,redirectUrl:v,callback:E,errCb:r.newAuthErr},i.default.open(w)};var r,o=n(32),i=(r=o)&&r.__esModule?r:{default:r},a=n(9)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(4)),o=c(n(2)),i=c(n(3)),a=c(n(5)),u=c(n(6)),s=n(0),l=c(s);c(n(1));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){var e,n,i,u;(0,o.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=i=(0,a.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),i.onClick=function(){var e=i.props,t=e.specActions,n=e.path,r=e.method;t.clearResponse(n,r),t.clearRequest(n,r)},u=n,(0,a.default)(i,u)}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){return l.default.createElement("button",{className:"btn btn-clear opblock-control__btn",onClick:this.onClick},"Clear")}}]),t}(s.Component);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(42)),o=c(n(4)),i=c(n(2)),a=c(n(3)),u=c(n(5)),s=c(n(6)),l=c(n(0));c(n(1)),c(n(12)),n(7);function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){var t=e.headers;return l.default.createElement("div",null,l.default.createElement("h5",null,"Response headers"),l.default.createElement("pre",null,t))},p=function(e){var t=e.duration;return l.default.createElement("div",null,l.default.createElement("h5",null,"Request duration"),l.default.createElement("pre",null,t," ms"))},d=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,s.default)(t,e),(0,a.default)(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.response!==e.response||this.props.path!==e.path||this.props.method!==e.method||this.props.displayRequestDuration!==e.displayRequestDuration}},{key:"render",value:function(){var e=this.props,t=e.response,n=e.getComponent,o=e.getConfigs,i=e.displayRequestDuration,a=e.specSelectors,u=e.path,s=e.method,c=o().showMutatedRequest?a.mutatedRequestFor(u,s):a.requestFor(u,s),d=t.get("status"),h=c.get("url"),v=t.get("headers").toJS(),m=t.get("notDocumented"),g=t.get("error"),y=t.get("text"),b=t.get("duration"),_=(0,r.default)(v),w=v["content-type"]||v["Content-Type"],E=n("curl"),x=n("responseBody"),S=_.map(function(e){return l.default.createElement("span",{className:"headerline",key:e}," ",e,": ",v[e]," ")}),C=0!==S.length;return l.default.createElement("div",null,c&&l.default.createElement(E,{request:c}),h&&l.default.createElement("div",null,l.default.createElement("h4",null,"Request URL"),l.default.createElement("div",{className:"request-url"},l.default.createElement("pre",null,h))),l.default.createElement("h4",null,"Server response"),l.default.createElement("table",{className:"responses-table live-responses-table"},l.default.createElement("thead",null,l.default.createElement("tr",{className:"responses-header"},l.default.createElement("td",{className:"col col_header response-col_status"},"Code"),l.default.createElement("td",{className:"col col_header response-col_description"},"Details"))),l.default.createElement("tbody",null,l.default.createElement("tr",{className:"response"},l.default.createElement("td",{className:"col response-col_status"},d,m?l.default.createElement("div",{className:"response-undocumented"},l.default.createElement("i",null," Undocumented ")):null),l.default.createElement("td",{className:"col response-col_description"},g?l.default.createElement("span",null,t.get("name")+": "+t.get("message")):null,y?l.default.createElement(x,{content:y,contentType:w,url:h,headers:v,getComponent:n}):null,C?l.default.createElement(f,{headers:S}):null,i&&b?l.default.createElement(p,{duration:b}):null)))))}}]),t}(l.default.Component);t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(42)),o=h(n(45)),i=h(n(4)),a=h(n(2)),u=h(n(3)),s=h(n(5)),l=h(n(6)),c=h(n(0)),f=h(n(210)),p=(h(n(1)),n(9)),d=h(n(32));function h(e){return e&&e.__esModule?e:{default:e}}var v=function(e){function t(e,n){(0,a.default)(this,t);var r=(0,s.default)(this,(t.__proto__||(0,i.default)(t)).call(this,e,n));r.getDefinitionUrl=function(){var e=r.props.specSelectors;return new f.default(e.url(),d.default.location).toString()};var o=(0,e.getConfigs)().validatorUrl;return r.state={url:r.getDefinitionUrl(),validatorUrl:void 0===o?"https://online.swagger.io/validator":o},r}return(0,l.default)(t,e),(0,u.default)(t,[{key:"componentWillReceiveProps",value:function(e){var t=(0,e.getConfigs)().validatorUrl;this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===t?"https://online.swagger.io/validator":t})}},{key:"render",value:function(){var e=(0,this.props.getConfigs)().spec,t=(0,p.sanitizeUrl)(this.state.validatorUrl);return"object"===(void 0===e?"undefined":(0,o.default)(e))&&(0,r.default)(e).length?null:!this.state.url||!this.state.validatorUrl||this.state.url.indexOf("localhost")>=0||this.state.url.indexOf("127.0.0.1")>=0?null:c.default.createElement("span",{style:{float:"right"}},c.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:t+"/debug?url="+encodeURIComponent(this.state.url)},c.default.createElement(m,{src:t+"?url="+encodeURIComponent(this.state.url),alt:"Online validator badge"})))}}]),t}(c.default.Component);t.default=v;var m=function(e){function t(e){(0,a.default)(this,t);var n=(0,s.default)(this,(t.__proto__||(0,i.default)(t)).call(this,e));return n.state={loaded:!1,error:!1},n}return(0,l.default)(t,e),(0,u.default)(t,[{key:"componentDidMount",value:function(){var e=this,t=new Image;t.onload=function(){e.setState({loaded:!0})},t.onerror=function(){e.setState({error:!0})},t.src=this.props.src}},{key:"componentWillReceiveProps",value:function(e){var t=this;if(e.src!==this.props.src){var n=new Image;n.onload=function(){t.setState({loaded:!0})},n.onerror=function(){t.setState({error:!0})},n.src=e.src}}},{key:"render",value:function(){return this.state.error?c.default.createElement("img",{alt:"Error"}):this.state.loaded?c.default.createElement("img",{src:this.props.src,alt:this.props.alt}):null}}]),t}(c.default.Component)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(4)),o=c(n(2)),i=c(n(3)),a=c(n(5)),u=c(n(6)),s=c(n(0)),l=(c(n(1)),c(n(7)));function c(e){return e&&e.__esModule?e:{default:e}}var f=["get","put","post","delete","options","head","patch"],p=f.concat(["trace"]),d=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=e.layoutSelectors,o=e.layoutActions,i=e.getConfigs,a=e.fn,u=t.taggedOperations(),c=n("OperationContainer",!0),d=n("OperationTag"),h=i().maxDisplayedTags,v=r.currentFilter();return v&&!0!==v&&(u=a.opsFilter(u,v)),h&&!isNaN(h)&&h>=0&&(u=u.slice(0,h)),s.default.createElement("div",null,u.map(function(e,a){var u=e.get("operations");return s.default.createElement(d,{key:"operation-"+a,tagObj:e,tag:a,layoutSelectors:r,layoutActions:o,getConfigs:i,getComponent:n},u.map(function(e){var n=e.get("path"),r=e.get("method"),o=l.default.List(["paths",n,r]);return-1===(t.isOAS3()?p:f).indexOf(r)?null:s.default.createElement(c,{key:n+"-"+r,specPath:o,op:e,path:n,method:r,tag:a})}).toArray())}).toArray(),u.size<1?s.default.createElement("h3",null," No operations defined in spec! "):null)}}]),t}(s.default.Component);t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(4)),o=f(n(2)),i=f(n(3)),a=f(n(5)),u=f(n(6)),s=f(n(0)),l=(f(n(1)),f(n(12)),f(n(7))),c=n(9);function f(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.tagObj,n=e.tag,r=e.children,o=e.layoutSelectors,i=e.layoutActions,a=e.getConfigs,u=e.getComponent,l=a(),f=l.docExpansion,p=l.deepLinking,d=p&&"false"!==p,h=u("Collapse"),v=u("Markdown"),m=u("DeepLink"),g=u("Link"),y=t.getIn(["tagDetails","description"],null),b=t.getIn(["tagDetails","externalDocs","description"]),_=t.getIn(["tagDetails","externalDocs","url"]),w=["operations-tag",n],E=o.isShown(w,"full"===f||"list"===f);return s.default.createElement("div",{className:E?"opblock-tag-section is-open":"opblock-tag-section"},s.default.createElement("h4",{onClick:function(){return i.show(w,!E)},className:y?"opblock-tag":"opblock-tag no-desc",id:w.map(function(e){return(0,c.escapeDeepLinkPath)(e)}).join("-"),"data-tag":n,"data-is-open":E},s.default.createElement(m,{enabled:d,isShown:E,path:(0,c.createDeepLinkPath)(n),text:n}),y?s.default.createElement("small",null,s.default.createElement(v,{source:y})):s.default.createElement("small",null),s.default.createElement("div",null,b?s.default.createElement("small",null,b,_?": ":null,_?s.default.createElement(g,{href:(0,c.sanitizeUrl)(_),onClick:function(e){return e.stopPropagation()},target:"_blank"},_):null):null),s.default.createElement("button",{className:"expand-operation",title:E?"Collapse operation":"Expand operation",onClick:function(){return i.show(w,!E)}},s.default.createElement("svg",{className:"arrow",width:"20",height:"20"},s.default.createElement("use",{href:E?"#large-arrow-down":"#large-arrow",xlinkHref:E?"#large-arrow-down":"#large-arrow"})))),s.default.createElement(h,{isOpened:E},r))}}]),t}(s.default.Component);p.defaultProps={tagObj:l.default.fromJS({}),tag:""},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(4)),o=p(n(2)),i=p(n(3)),a=p(n(5)),u=p(n(6)),s=n(0),l=p(s),c=(p(n(1)),n(9)),f=n(7);p(n(12));function p(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specPath,r=e.response,o=e.request,i=e.toggleShown,a=e.onTryoutClick,u=e.onCancelClick,s=e.onExecute,f=e.fn,p=e.getComponent,d=e.getConfigs,h=e.specActions,v=e.specSelectors,m=e.authActions,g=e.authSelectors,y=e.oas3Actions,b=e.oas3Selectors,_=this.props.operation,w=_.toJS(),E=w.deprecated,x=w.isShown,S=w.path,C=w.method,k=w.op,A=w.tag,O=w.operationId,P=w.allowTryItOut,T=w.displayRequestDuration,M=w.tryItOutEnabled,I=w.executeInProgress,j=k.description,N=k.externalDocs,R=k.schemes,D=_.getIn(["op"]),L=D.get("responses"),U=(0,c.getList)(D,["parameters"]),q=v.operationScheme(S,C),F=["operations",A,O],z=(0,c.getExtensions)(D),B=p("responses"),V=p("parameters"),H=p("execute"),W=p("clear"),J=p("Collapse"),Y=p("Markdown"),K=p("schemes"),G=p("OperationServers"),$=p("OperationExt"),Z=p("OperationSummary"),X=p("Link"),Q=d().showExtensions;if(L&&r&&r.size>0){var ee=!L.get(String(r.get("status")))&&!L.get("default");r=r.set("notDocumented",ee)}var te=[S,C];return l.default.createElement("div",{className:E?"opblock opblock-deprecated":x?"opblock opblock-"+C+" is-open":"opblock opblock-"+C,id:(0,c.escapeDeepLinkPath)(F.join("-"))},l.default.createElement(Z,{operationProps:_,toggleShown:i,getComponent:p,authActions:m,authSelectors:g,specPath:t}),l.default.createElement(J,{isOpened:x},l.default.createElement("div",{className:"opblock-body"},D&&D.size||null===D?null:l.default.createElement("img",{height:"32px",width:"32px",src:n(412),className:"opblock-loading-animation"}),E&&l.default.createElement("h4",{className:"opblock-title_normal"}," Warning: Deprecated"),j&&l.default.createElement("div",{className:"opblock-description-wrapper"},l.default.createElement("div",{className:"opblock-description"},l.default.createElement(Y,{source:j}))),N&&N.url?l.default.createElement("div",{className:"opblock-external-docs-wrapper"},l.default.createElement("h4",{className:"opblock-title_normal"},"Find more details"),l.default.createElement("div",{className:"opblock-external-docs"},l.default.createElement("span",{className:"opblock-external-docs__description"},l.default.createElement(Y,{source:N.description})),l.default.createElement(X,{target:"_blank",className:"opblock-external-docs__link",href:(0,c.sanitizeUrl)(N.url)},N.url))):null,D&&D.size?l.default.createElement(V,{parameters:U,specPath:t.push("parameters"),operation:D,onChangeKey:te,onTryoutClick:a,onCancelClick:u,tryItOutEnabled:M,allowTryItOut:P,fn:f,getComponent:p,specActions:h,specSelectors:v,pathMethod:[S,C],getConfigs:d}):null,M?l.default.createElement(G,{getComponent:p,path:S,method:C,operationServers:D.get("servers"),pathServers:v.paths().getIn([S,"servers"]),getSelectedServer:b.selectedServer,setSelectedServer:y.setSelectedServer,setServerVariableValue:y.setServerVariableValue,getServerVariable:b.serverVariableValue,getEffectiveServerValue:b.serverEffectiveValue}):null,M&&P&&R&&R.size?l.default.createElement("div",{className:"opblock-schemes"},l.default.createElement(K,{schemes:R,path:S,method:C,specActions:h,currentScheme:q})):null,l.default.createElement("div",{className:M&&r&&P?"btn-group":"execute-wrapper"},M&&P?l.default.createElement(H,{operation:D,specActions:h,specSelectors:v,path:S,method:C,onExecute:s}):null,M&&r&&P?l.default.createElement(W,{specActions:h,path:S,method:C}):null),I?l.default.createElement("div",{className:"loading-container"},l.default.createElement("div",{className:"loading"})):null,L?l.default.createElement(B,{responses:L,request:o,tryItOutResponse:r,getComponent:p,getConfigs:d,specSelectors:v,oas3Actions:y,specActions:h,produces:v.producesOptionsFor([S,C]),producesValue:v.currentProducesFor([S,C]),specPath:t.push("responses"),path:S,method:C,displayRequestDuration:T,fn:f}):null,Q&&z.size?l.default.createElement($,{extensions:z,getComponent:p}):null)))}}]),t}(s.PureComponent);d.defaultProps={operation:null,response:null,request:null,specPath:(0,f.List)(),summary:""},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(4)),o=f(n(2)),i=f(n(3)),a=f(n(5)),u=f(n(6)),s=n(0),l=f(s),c=(f(n(1)),n(7));f(n(12));function f(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.toggleShown,n=e.getComponent,r=e.authActions,o=e.authSelectors,i=e.operationProps,a=e.specPath,u=i.toJS(),s=u.summary,c=u.isAuthorized,f=u.method,p=u.op,d=u.showSummary,h=u.operationId,v=u.originalOperationId,m=u.displayOperationId,g=p.summary,y=i.get("security"),b=n("authorizeOperationBtn"),_=n("OperationSummaryMethod"),w=n("OperationSummaryPath"),E=n("JumpToPath",!0);return l.default.createElement("div",{className:"opblock-summary opblock-summary-"+f,onClick:t},l.default.createElement(_,{method:f}),l.default.createElement(w,{getComponent:n,operationProps:i,specPath:a}),d?l.default.createElement("div",{className:"opblock-summary-description"},g||s):null,m&&(v||h)?l.default.createElement("span",{className:"opblock-summary-operation-id"},v||h):null,y&&y.count()?l.default.createElement(b,{isAuthorized:c,onClick:function(){var e=o.definitionsForRequirements(y);r.showDefinitions(e)}}):null,l.default.createElement(E,{path:a}))}}]),t}(s.PureComponent);p.defaultProps={operationProps:null,specPath:(0,c.List)(),summary:""},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(4)),o=c(n(2)),i=c(n(3)),a=c(n(5)),u=c(n(6)),s=n(0),l=c(s);c(n(1)),n(7);function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props.method;return l.default.createElement("span",{className:"opblock-summary-method"},e.toUpperCase())}}]),t}(s.PureComponent);f.defaultProps={operationProps:null},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(4)),o=f(n(2)),i=f(n(3)),a=f(n(5)),u=f(n(6)),s=n(0),l=f(s),c=(f(n(1)),n(7),n(9));f(n(12));function f(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.operationProps.toJS(),r=n.deprecated,o=n.isShown,i=n.path,a=n.tag,u=n.operationId,s=n.isDeepLinkingEnabled,f=t("DeepLink");return l.default.createElement("span",{className:r?"opblock-summary-path__deprecated":"opblock-summary-path"},l.default.createElement(f,{enabled:s,isShown:o,path:(0,c.createDeepLinkPath)(a+"/"+u),text:i}))}}]),t}(s.PureComponent);t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OperationExt=void 0;var r=i(n(17)),o=i(n(0));i(n(1));function i(e){return e&&e.__esModule?e:{default:e}}var a=t.OperationExt=function(e){var t=e.extensions,n=(0,e.getComponent)("OperationExtRow");return o.default.createElement("div",{className:"opblock-section"},o.default.createElement("div",{className:"opblock-section-header"},o.default.createElement("h4",null,"Extensions")),o.default.createElement("div",{className:"table-container"},o.default.createElement("table",null,o.default.createElement("thead",null,o.default.createElement("tr",null,o.default.createElement("td",{className:"col col_header"},"Field"),o.default.createElement("td",{className:"col col_header"},"Value"))),o.default.createElement("tbody",null,t.entrySeq().map(function(e){var t=(0,r.default)(e,2),i=t[0],a=t[1];return o.default.createElement(n,{key:i+"-"+a,xKey:i,xVal:a})})))))};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OperationExtRow=void 0;var r=i(n(41)),o=i(n(0));i(n(1));function i(e){return e&&e.__esModule?e:{default:e}}var a=t.OperationExtRow=function(e){var t=e.xKey,n=e.xVal,i=n?n.toJS?n.toJS():n:null;return o.default.createElement("tr",null,o.default.createElement("td",null,t),o.default.createElement("td",null,(0,r.default)(i)))};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(4)),o=p(n(2)),i=p(n(3)),a=p(n(5)),u=p(n(6)),s=n(0),l=p(s),c=(p(n(1)),n(9)),f=p(n(961));function p(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(){var e,n,i,u;(0,o.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=i=(0,a.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),i.initializeComponent=function(e){i.el=e},i.downloadText=function(){(0,f.default)(i.props.value,i.props.fileName||"response.txt")},i.preventYScrollingBeyondElement=function(e){var t=e.target,n=e.nativeEvent.deltaY,r=t.scrollHeight,o=t.offsetHeight,i=t.scrollTop;r>o&&(0===i&&n<0||o+i>=r&&n>0)&&e.preventDefault()},u=n,(0,a.default)(i,u)}return(0,u.default)(t,e),(0,i.default)(t,[{key:"componentDidMount",value:function(){(0,c.highlight)(this.el)}},{key:"componentDidUpdate",value:function(){(0,c.highlight)(this.el)}},{key:"render",value:function(){var e=this.props,t=e.value,n=e.className,r=e.downloadable;return n=n||"",l.default.createElement("div",{className:"highlight-code"},r?l.default.createElement("div",{className:"download-contents",onClick:this.downloadText},"Download"):null,l.default.createElement("pre",{ref:this.initializeComponent,onWheel:this.preventYScrollingBeyondElement,className:n+" microlight"},t))}}]),t}(s.Component);t.default=d},function(e,t){e.exports=function(e,t,n){var r=new Blob([e],{type:n||"application/octet-stream"});if(void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(r,t);else{var o=window.URL.createObjectURL(r),i=document.createElement("a");i.style.display="none",i.href=o,i.setAttribute("download",t),void 0===i.download&&i.setAttribute("target","_blank"),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(o)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(17)),o=p(n(4)),i=p(n(2)),a=p(n(3)),u=p(n(5)),s=p(n(6)),l=p(n(0)),c=n(7),f=(p(n(1)),p(n(12)),n(9));function p(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(){var e,n,r,a;(0,i.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=r=(0,u.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(l))),r.onChangeProducesWrapper=function(e){return r.props.specActions.changeProducesValue([r.props.path,r.props.method],e)},r.onResponseContentTypeChange=function(e){var t=e.controlsAcceptHeader,n=e.value,o=r.props,i=o.oas3Actions,a=o.path,u=o.method;t&&i.setResponseContentType({value:n,path:a,method:u})},a=n,(0,u.default)(r,a)}return(0,s.default)(t,e),(0,a.default)(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.tryItOutResponse!==e.tryItOutResponse||this.props.responses!==e.responses||this.props.produces!==e.produces||this.props.producesValue!==e.producesValue||this.props.displayRequestDuration!==e.displayRequestDuration||this.props.path!==e.path||this.props.method!==e.method}},{key:"render",value:function(){var e=this,n=this.props,o=n.responses,i=n.tryItOutResponse,a=n.getComponent,u=n.getConfigs,s=n.specSelectors,c=n.fn,p=n.producesValue,d=n.displayRequestDuration,h=n.specPath,v=(0,f.defaultStatusCode)(o),m=a("contentType"),g=a("liveResponse"),y=a("response"),b=this.props.produces&&this.props.produces.size?this.props.produces:t.defaultProps.produces,_=s.isOAS3()?(0,f.getAcceptControllingResponse)(o):null;return l.default.createElement("div",{className:"responses-wrapper"},l.default.createElement("div",{className:"opblock-section-header"},l.default.createElement("h4",null,"Responses"),s.isOAS3()?null:l.default.createElement("label",null,l.default.createElement("span",null,"Response content type"),l.default.createElement(m,{value:p,onChange:this.onChangeProducesWrapper,contentTypes:b,className:"execute-content-type"}))),l.default.createElement("div",{className:"responses-inner"},i?l.default.createElement("div",null,l.default.createElement(g,{response:i,getComponent:a,getConfigs:u,specSelectors:s,path:this.props.path,method:this.props.method,displayRequestDuration:d}),l.default.createElement("h4",null,"Responses")):null,l.default.createElement("table",{className:"responses-table"},l.default.createElement("thead",null,l.default.createElement("tr",{className:"responses-header"},l.default.createElement("td",{className:"col col_header response-col_status"},"Code"),l.default.createElement("td",{className:"col col_header response-col_description"},"Description"),s.isOAS3()?l.default.createElement("td",{className:"col col_header response-col_links"},"Links"):null)),l.default.createElement("tbody",null,o.entrySeq().map(function(t){var n=(0,r.default)(t,2),o=n[0],f=n[1],d=i&&i.get("status")==o?"response_current":"";return l.default.createElement(y,{key:o,specPath:h.push(o),isDefault:v===o,fn:c,className:d,code:o,response:f,specSelectors:s,controlsAcceptHeader:f===_,onContentTypeChange:e.onResponseContentTypeChange,contentType:p,getConfigs:u,getComponent:a})}).toArray()))))}}]),t}(l.default.Component);d.defaultProps={tryItOutResponse:null,produces:(0,c.fromJS)(["application/json"]),displayRequestDuration:!1},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(4)),o=d(n(2)),i=d(n(3)),a=d(n(5)),u=d(n(6)),s=d(n(17)),l=d(n(0)),c=(d(n(1)),d(n(12)),d(n(113))),f=n(7),p=n(9);function d(e){return e&&e.__esModule?e:{default:e}}var h=function(e){function t(e,n){(0,o.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,r.default)(t)).call(this,e,n));return i._onContentTypeChange=function(e){var t=i.props,n=t.onContentTypeChange,r=t.controlsAcceptHeader;i.setState({responseContentType:e}),n({value:e,controlsAcceptHeader:r})},i.state={responseContentType:""},i}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e,t,n,r,o=this.props,i=o.code,a=o.response,u=o.className,d=o.specPath,h=o.fn,v=o.getComponent,m=o.getConfigs,g=o.specSelectors,y=o.contentType,b=o.controlsAcceptHeader,_=h.inferSchema,w=g.isOAS3,E=a.get("headers"),x=a.get("examples"),S=a.get("links"),C=v("headers"),k=v("highlightCode"),A=v("modelExample"),O=v("Markdown"),P=v("operationLink"),T=v("contentType"),M=this.state.responseContentType||y;if(w()){var I=a.getIn(["content",M],(0,f.Map)({})),j=I.get("schema",(0,f.Map)({}));t=void 0!==I.get("example")?(0,p.stringify)(I.get("example")):(0,p.getSampleSchema)(j.toJS(),this.state.responseContentType,{includeReadOnly:!0}),e=j?t:null,n=j?_(j.toJS()):null,r=j?(0,f.List)(["content",this.state.responseContentType,"schema"]):d}else n=_(a.toJS()),r=a.has("schema")?d.push("schema"):d,e=n?(0,p.getSampleSchema)(n,M,{includeReadOnly:!0,includeWriteOnly:!0}):null;x&&(x=x.map(function(e){return e.set?e.set("$$ref",void 0):e}));var N=function(e,t,n){return t&&t.size?t.entrySeq().map(function(e){var t=(0,s.default)(e,2),r=t[0],o=t[1],i=(0,p.stringify)(o);return l.default.createElement("div",{key:r},l.default.createElement("h5",null,r),l.default.createElement(n,{className:"example",value:i}))}).toArray():e?l.default.createElement("div",null,l.default.createElement(n,{className:"example",value:e})):null}(e,x,k);return l.default.createElement("tr",{className:"response "+(u||""),"data-code":i},l.default.createElement("td",{className:"col response-col_status"},i),l.default.createElement("td",{className:"col response-col_description"},l.default.createElement("div",{className:"response-col_description__inner"},l.default.createElement(O,{source:a.get("description")})),w?l.default.createElement("div",{className:(0,c.default)("response-content-type",{"controls-accept-header":b})},l.default.createElement(T,{value:this.state.responseContentType,contentTypes:a.get("content")?a.get("content").keySeq():(0,f.Seq)(),onChange:this._onContentTypeChange}),b?l.default.createElement("small",null,"Controls ",l.default.createElement("code",null,"Accept")," header."):null):null,N?l.default.createElement(A,{specPath:r,getComponent:v,getConfigs:m,specSelectors:g,schema:(0,p.fromJSOrdered)(n),example:N}):null,E?l.default.createElement(C,{headers:E,getComponent:v}):null),g.isOAS3()?l.default.createElement("td",{className:"col response-col_links"},S?S.toSeq().map(function(e,t){return l.default.createElement(P,{key:t,name:t,link:e,getComponent:v})}):l.default.createElement("i",null,"No links")):null)}}]),t}(l.default.Component);h.defaultProps={response:(0,f.fromJS)({}),onContentTypeChange:function(){}},t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(41)),o=h(n(4)),i=h(n(2)),a=h(n(3)),u=h(n(5)),s=h(n(6)),l=h(n(0)),c=(h(n(1)),h(n(965))),f=h(n(967)),p=n(9),d=h(n(32));function h(e){return e&&e.__esModule?e:{default:e}}var v=function(e){function t(){var e,n,r,a;(0,i.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=r=(0,u.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(l))),r.state={parsedContent:null},r.updateParsedContent=function(e){var t=r.props.content;if(e!==t)if(t&&t instanceof Blob){var n=new FileReader;n.onload=function(){r.setState({parsedContent:n.result})},n.readAsText(t)}else r.setState({parsedContent:t.toString()})},a=n,(0,u.default)(r,a)}return(0,s.default)(t,e),(0,a.default)(t,[{key:"componentDidMount",value:function(){this.updateParsedContent(null)}},{key:"componentDidUpdate",value:function(e){this.updateParsedContent(e.content)}},{key:"render",value:function(){var e=this.props,t=e.content,n=e.contentType,o=e.url,i=e.headers,a=void 0===i?{}:i,u=e.getComponent,s=this.state.parsedContent,h=u("highlightCode"),v="response_"+(new Date).getTime(),m=void 0,g=void 0;if(o=o||"",/^application\/octet-stream/i.test(n)||a["Content-Disposition"]&&/attachment/i.test(a["Content-Disposition"])||a["content-disposition"]&&/attachment/i.test(a["content-disposition"])||a["Content-Description"]&&/File Transfer/i.test(a["Content-Description"])||a["content-description"]&&/File Transfer/i.test(a["content-description"]))if("Blob"in window){var y=n||"text/html",b=t instanceof Blob?t:new Blob([t],{type:y}),_=window.URL.createObjectURL(b),w=[y,o.substr(o.lastIndexOf("/")+1),_].join(":"),E=a["content-disposition"]||a["Content-Disposition"];if(void 0!==E){var x=(0,p.extractFileNameFromContentDispositionHeader)(E);null!==x&&(w=x)}g=d.default.navigator&&d.default.navigator.msSaveOrOpenBlob?l.default.createElement("div",null,l.default.createElement("a",{href:_,onClick:function(){return d.default.navigator.msSaveOrOpenBlob(b,w)}},"Download file")):l.default.createElement("div",null,l.default.createElement("a",{href:_,download:w},"Download file"))}else g=l.default.createElement("pre",null,"Download headers detected but your browser does not support downloading binary via XHR (Blob).");else if(/json/i.test(n)){try{m=(0,r.default)(JSON.parse(t),null," ")}catch(e){m="can't parse JSON. Raw result:\n\n"+t}g=l.default.createElement(h,{downloadable:!0,fileName:v+".json",value:m})}else/xml/i.test(n)?(m=(0,c.default)(t,{textNodesOnSameLine:!0,indentor:" "}),g=l.default.createElement(h,{downloadable:!0,fileName:v+".xml",value:m})):g="text/html"===(0,f.default)(n)||/text\/plain/.test(n)?l.default.createElement(h,{downloadable:!0,fileName:v+".html",value:t}):/^image\//i.test(n)?n.includes("svg")?l.default.createElement("div",null," ",t," "):l.default.createElement("img",{style:{maxWidth:"100%"},src:window.URL.createObjectURL(t)}):/^audio\//i.test(n)?l.default.createElement("pre",null,l.default.createElement("audio",{controls:!0},l.default.createElement("source",{src:o,type:n}))):"string"==typeof t?l.default.createElement(h,{downloadable:!0,fileName:v+".txt",value:t}):t.size>0?s?l.default.createElement("div",null,l.default.createElement("p",{className:"i"},"Unrecognized response type; displaying content as text."),l.default.createElement(h,{downloadable:!0,fileName:v+".txt",value:s})):l.default.createElement("p",{className:"i"},"Unrecognized response type; unable to display."):null;return g?l.default.createElement("div",null,l.default.createElement("h5",null,"Response body"),g):null}}]),t}(l.default.PureComponent);t.default=v},function(e,t,n){"use strict";var r=n(966),o=function(e){return e.split(/(<\/?[^>]+>)/g).filter(function(e){return""!==e.trim()})},i=function(e){return/<\/+[^>]+>/.test(e)},a=function(e){return/<[^>]+\/>/.test(e)},u=function(e){return function(e){return/<[^>!]+>/.test(e)}(e)&&!i(e)&&!a(e)};e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.indentor,s=t.textNodesOnSameLine,l=0,c=[];n=n||" ";var f,p=(f=e,o(f).map(function(e){return{value:e,type:(t=e,i(t)?"ClosingTag":u(t)?"OpeningTag":a(t)?"SelfClosingTag":"Text")};var t})).map(function(e,t,o){var i=e.value,a=e.type;"ClosingTag"===a&&l--;var u=r(n,l),f=u+i;if("OpeningTag"===a&&l++,s){var p=o[t-1],d=o[t-2];"ClosingTag"===a&&"Text"===p.type&&"OpeningTag"===d.type&&(f=""+u+d.value+p.value+i,c.push(t-2,t-1))}return f});return c.forEach(function(e){return p[e]=null}),p.filter(function(e){return!!e}).join("\n")}},function(e,t,n){"use strict";
/*!
* repeat-string <https://github.com/jonschlinkert/repeat-string>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/var r,o="";e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var n=e.length*t;if(r!==e||void 0===r)r=e,o="";else if(o.length>=n)return o.substr(0,n);for(;n>o.length&&t>1;)1&t&&(o+=e),t>>=1,e+=e;return o=(o+=e).substr(0,n)}},function(e,t,n){var r=n(61);e.exports=function(e){return r(e).toLowerCase()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(4)),o=f(n(2)),i=f(n(3)),a=f(n(5)),u=f(n(6)),s=n(0),l=f(s),c=(f(n(1)),f(n(12)),f(n(7)));function f(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(){var e,n,i,u;(0,o.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=i=(0,a.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),i.onChange=function(e,t,n){var r=i.props;(0,r.specActions.changeParamByIdentity)(r.onChangeKey,e,t,n)},i.onChangeConsumesWrapper=function(e){var t=i.props;(0,t.specActions.changeConsumesValue)(t.onChangeKey,e)},u=n,(0,a.default)(i,u)}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.onTryoutClick,r=t.onCancelClick,o=t.parameters,i=t.allowTryItOut,a=t.tryItOutEnabled,u=t.specPath,s=t.fn,f=t.getComponent,p=t.getConfigs,d=t.specSelectors,h=t.specActions,v=t.pathMethod,m=f("parameterRow"),g=f("TryItOutButton"),y=a&&i;return l.default.createElement("div",{className:"opblock-section"},l.default.createElement("div",{className:"opblock-section-header"},l.default.createElement("div",{className:"tab-header"},l.default.createElement("h4",{className:"opblock-title"},"Parameters")),i?l.default.createElement(g,{enabled:a,onCancelClick:r,onTryoutClick:n}):null),o.count()?l.default.createElement("div",{className:"table-container"},l.default.createElement("table",{className:"parameters"},l.default.createElement("thead",null,l.default.createElement("tr",null,l.default.createElement("th",{className:"col col_header parameters-col_name"},"Name"),l.default.createElement("th",{className:"col col_header parameters-col_description"},"Description"))),l.default.createElement("tbody",null,function(e,t){return e.valueSeq().filter(c.default.Map.isMap).map(t)}(o,function(t,n){return l.default.createElement(m,{fn:s,specPath:u.push(n.toString()),getComponent:f,getConfigs:p,rawParam:t,param:d.parameterWithMetaByIdentity(v,t),key:t.get("in")+"."+t.get("name"),onChange:e.onChange,onChangeConsumes:e.onChangeConsumesWrapper,specSelectors:d,specActions:h,pathMethod:v,isExecute:y})}).toArray()))):l.default.createElement("div",{className:"opblock-description-wrapper"},l.default.createElement("p",null,"No parameters")))}}]),t}(s.Component);p.defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParameterExt=void 0;var r=o(n(0));o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}var i=t.ParameterExt=function(e){var t=e.xKey,n=e.xVal;return r.default.createElement("div",{className:"parameter__extension"},t,": ",String(n))};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParameterIncludeEmpty=void 0;var r=i(n(0)),o=i(n(113));i(n(1)),i(n(12));function i(e){return e&&e.__esModule?e:{default:e}}var a=t.ParameterIncludeEmpty=function(e){var t=e.param,n=e.isIncluded,i=e.onChange,a=e.isDisabled;return t.get("allowEmptyValue")?r.default.createElement("div",{className:(0,o.default)("parameter__empty_value_toggle",{disabled:a})},r.default.createElement("input",{type:"checkbox",disabled:a,checked:!a&&n,onChange:function(e){i(e.target.checked)}}),"Send empty value"):null};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(4)),o=d(n(2)),i=d(n(3)),a=d(n(5)),u=d(n(6)),s=n(0),l=d(s),c=n(7),f=(d(n(1)),d(n(12)),d(n(32))),p=n(9);function d(e){return e&&e.__esModule?e:{default:e}}var h=function(e){function t(e,n){(0,o.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,r.default)(t)).call(this,e,n));return i.onChangeWrapper=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=i.props;return(0,n.onChange)(n.rawParam,""===e||e&&0===e.size?null:e,t)},i.onChangeIncludeEmpty=function(e){var t=i.props,n=t.specActions,r=t.param,o=t.pathMethod,a=r.get("name"),u=r.get("in");return n.updateEmptyParamInclusion(o,a,u,e)},i.setDefaultValue=function(){var e=i.props,t=e.specSelectors,n=e.pathMethod,r=e.rawParam,o=t.parameterWithMetaByIdentity(n,r);if(o&&void 0===o.get("value")&&"body"!==o.get("in")){var a=void 0;t.isSwagger2()?a=o.get("x-example")||o.getIn(["default"])||o.getIn(["schema","example"])||o.getIn(["schema","default"]):t.isOAS3()&&(a=o.get("example")||o.getIn(["schema","example"])||o.getIn(["schema","default"])),void 0!==a&&i.onChangeWrapper((0,p.numberToString)(a))}},i.setDefaultValue(),i}return(0,u.default)(t,e),(0,i.default)(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.specSelectors,n=e.pathMethod,r=e.rawParam,o=t.isOAS3,i=t.parameterWithMetaByIdentity(n,r)||new c.Map;i=i.isEmpty()?r:i;var a=void 0;o()?a=(i.get("schema")||(0,c.Map)()).get("enum"):a=i?i.get("enum"):void 0;var u=i?i.get("value"):void 0,s=void 0;void 0!==u?s=u:r.get("required")&&a&&a.size&&(s=a.first()),void 0!==s&&s!==u&&this.onChangeWrapper((0,p.numberToString)(s)),this.setDefaultValue()}},{key:"render",value:function(){var e=this.props,t=e.param,n=e.rawParam,r=e.getComponent,o=e.getConfigs,i=e.isExecute,a=e.fn,u=e.onChangeConsumes,s=e.specSelectors,c=e.pathMethod,d=e.specPath,h=s.isOAS3,v=o(),m=v.showExtensions,g=v.showCommonExtensions;t||(t=n);var y=r("JsonSchemaForm"),b=r("ParamBody"),_=t.get("in"),w="body"!==_?null:l.default.createElement(b,{getComponent:r,fn:a,param:t,consumes:s.consumesOptionsFor(c),consumesValue:s.contentTypeValues(c).get("requestContentType"),onChange:this.onChangeWrapper,onChangeConsumes:u,isExecute:i,specSelectors:s,pathMethod:c}),E=r("modelExample"),x=r("Markdown"),S=r("ParameterExt"),C=r("ParameterIncludeEmpty"),k=s.parameterWithMetaByIdentity(c,n),A=t.get("format"),O=h&&h()?t.get("schema"):t,P=O.get("type"),T="formData"===_,M="FormData"in f.default,I=t.get("required"),j=O.getIn(["items","type"]),N=k?k.get("value"):"",R=g?(0,p.getCommonExtensions)(t):null,D=m?(0,p.getExtensions)(t):null,L=void 0,U=void 0,q=void 0,F=!1;return void 0!==t&&(L=O.get("items")),void 0!==L?(U=L.get("enum"),q=L.get("default")):U=O.get("enum"),void 0!==U&&U.size>0&&(F=!0),void 0!==t&&(q=O.get("default"),void 0===t.get("example")&&t.get("x-example")),l.default.createElement("tr",{"data-param-name":t.get("name"),"data-param-in":t.get("in")},l.default.createElement("td",{className:"col parameters-col_name"},l.default.createElement("div",{className:I?"parameter__name required":"parameter__name"},t.get("name"),I?l.default.createElement("span",{style:{color:"red"}}," *"):null),l.default.createElement("div",{className:"parameter__type"},P,j&&"["+j+"]",A&&l.default.createElement("span",{className:"prop-format"},"($",A,")")),l.default.createElement("div",{className:"parameter__deprecated"},h&&h()&&t.get("deprecated")?"deprecated":null),l.default.createElement("div",{className:"parameter__in"},"(",t.get("in"),")"),g&&R.size?R.map(function(e,t){return l.default.createElement(S,{key:t+"-"+e,xKey:t,xVal:e})}):null,m&&D.size?D.map(function(e,t){return l.default.createElement(S,{key:t+"-"+e,xKey:t,xVal:e})}):null),l.default.createElement("td",{className:"col parameters-col_description"},t.get("description")?l.default.createElement(x,{source:t.get("description")}):null,!w&&i||!F?null:l.default.createElement(x,{className:"parameter__enum",source:"<i>Available values</i> : "+U.map(function(e){return e}).toArray().join(", ")}),!w&&i||void 0===q?null:l.default.createElement(x,{className:"parameter__default",source:"<i>Default value</i> : "+q}),T&&!M&&l.default.createElement("div",null,"Error: your browser does not support FormData"),w||!i?null:l.default.createElement(y,{fn:a,getComponent:r,value:N,required:I,description:t.get("description")?t.get("name")+" - "+t.get("description"):""+t.get("name"),onChange:this.onChangeWrapper,errors:k.get("errors"),schema:O}),w&&O?l.default.createElement(E,{getComponent:r,specPath:d.push("schema"),getConfigs:o,isExecute:i,specSelectors:s,schema:t.get("schema"),example:w}):null,!w&&i?l.default.createElement(C,{onChange:this.onChangeIncludeEmpty,isIncluded:s.parameterInclusionSettingFor(c,t.get("name"),t.get("in")),isDisabled:N&&0!==N.size,param:t}):null))}}]),t}(s.Component);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(4)),o=c(n(2)),i=c(n(3)),a=c(n(5)),u=c(n(6)),s=n(0),l=c(s);c(n(1));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){var e,n,i,u;(0,o.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=i=(0,a.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),i.onClick=function(){var e=i.props,t=e.specSelectors,n=e.specActions,r=e.operation,o=e.path,a=e.method;n.validateParams([o,a]),t.validateBeforeExecute([o,a])&&(i.props.onExecute&&i.props.onExecute(),n.execute({operation:r,path:o,method:a}))},i.onChangeProducesWrapper=function(e){return i.props.specActions.changeProducesValue([i.props.path,i.props.method],e)},u=n,(0,a.default)(i,u)}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){return l.default.createElement("button",{className:"btn execute opblock-control__btn",onClick:this.onClick},"Execute")}}]),t}(s.Component);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(17)),o=f(n(4)),i=f(n(2)),a=f(n(3)),u=f(n(5)),s=f(n(6)),l=f(n(0)),c=(f(n(1)),f(n(7)));function f(e){return e&&e.__esModule?e:{default:e}}var p={color:"#999",fontStyle:"italic"},d=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,s.default)(t,e),(0,a.default)(t,[{key:"render",value:function(){var e=this.props,t=e.headers,n=e.getComponent,o=n("Property"),i=n("Markdown");return t&&t.size?l.default.createElement("div",{className:"headers-wrapper"},l.default.createElement("h4",{className:"headers__title"},"Headers:"),l.default.createElement("table",{className:"headers"},l.default.createElement("thead",null,l.default.createElement("tr",{className:"header-row"},l.default.createElement("th",{className:"header-col"},"Name"),l.default.createElement("th",{className:"header-col"},"Description"),l.default.createElement("th",{className:"header-col"},"Type"))),l.default.createElement("tbody",null,t.entrySeq().map(function(e){var t=(0,r.default)(e,2),n=t[0],a=t[1];if(!c.default.Map.isMap(a))return null;var u=a.get("description"),s=a.getIn(["schema"])?a.getIn(["schema","type"]):a.getIn(["type"]),f=a.getIn(["schema","example"]);return l.default.createElement("tr",{key:n},l.default.createElement("td",{className:"header-col"},n),l.default.createElement("td",{className:"header-col"},u?l.default.createElement(i,{source:u}):null),l.default.createElement("td",{className:"header-col"},s," ",f?l.default.createElement(o,{propKey:"Example",propVal:f,propStyle:p}):null))}).toArray()))):null}}]),t}(l.default.Component);t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(4)),o=c(n(2)),i=c(n(3)),a=c(n(5)),u=c(n(6)),s=c(n(0)),l=(c(n(1)),n(7));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.editorActions,n=e.errSelectors,r=e.layoutSelectors,o=e.layoutActions,i=(0,e.getComponent)("Collapse");if(t&&t.jumpToLine)var a=t.jumpToLine;var u=n.allErrors().filter(function(e){return"thrown"===e.get("type")||"error"===e.get("level")});if(!u||u.count()<1)return null;var l=r.isShown(["errorPane"],!0),c=u.sortBy(function(e){return e.get("line")});return s.default.createElement("pre",{className:"errors-wrapper"},s.default.createElement("hgroup",{className:"error"},s.default.createElement("h4",{className:"errors__title"},"Errors"),s.default.createElement("button",{className:"btn errors__clear-btn",onClick:function(){return o.show(["errorPane"],!l)}},l?"Hide":"Show")),s.default.createElement(i,{isOpened:l,animated:!0},s.default.createElement("div",{className:"errors"},c.map(function(e,t){var n=e.get("type");return"thrown"===n||"auth"===n?s.default.createElement(p,{key:t,error:e.get("error")||e,jumpToLine:a}):"spec"===n?s.default.createElement(d,{key:t,error:e,jumpToLine:a}):void 0}))))}}]),t}(s.default.Component);t.default=f;var p=function(e){var t=e.error,n=e.jumpToLine;if(!t)return null;var r=t.get("line");return s.default.createElement("div",{className:"error-wrapper"},t?s.default.createElement("div",null,s.default.createElement("h4",null,t.get("source")&&t.get("level")?h(t.get("source"))+" "+t.get("level"):"",t.get("path")?s.default.createElement("small",null," at ",t.get("path")):null),s.default.createElement("span",{style:{whiteSpace:"pre-line",maxWidth:"100%"}},t.get("message")),s.default.createElement("div",{style:{"text-decoration":"underline",cursor:"pointer"}},r&&n?s.default.createElement("a",{onClick:n.bind(null,r)},"Jump to line ",r):null)):null)},d=function(e){var t=e.error,n=e.jumpToLine,r=null;return t.get("path")?r=l.List.isList(t.get("path"))?s.default.createElement("small",null,"at ",t.get("path").join(".")):s.default.createElement("small",null,"at ",t.get("path")):t.get("line")&&!n&&(r=s.default.createElement("small",null,"on line ",t.get("line"))),s.default.createElement("div",{className:"error-wrapper"},t?s.default.createElement("div",null,s.default.createElement("h4",null,h(t.get("source"))+" "+t.get("level")," ",r),s.default.createElement("span",{style:{whiteSpace:"pre-line"}},t.get("message")),s.default.createElement("div",{style:{"text-decoration":"underline",cursor:"pointer"}},n?s.default.createElement("a",{onClick:n.bind(null,t.get("line"))},"Jump to line ",t.get("line")):null)):null)};function h(e){return(e||"").split(" ").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(" ")}p.defaultProps={jumpToLine:null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(4)),o=c(n(2)),i=c(n(3)),a=c(n(5)),u=c(n(6)),s=c(n(0)),l=(c(n(1)),c(n(12)),n(7));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){var e,n,i,u;(0,o.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=i=(0,a.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),i.onChangeWrapper=function(e){return i.props.onChange(e.target.value)},u=n,(0,a.default)(i,u)}return(0,u.default)(t,e),(0,i.default)(t,[{key:"componentDidMount",value:function(){this.props.contentTypes&&this.props.onChange(this.props.contentTypes.first())}},{key:"componentWillReceiveProps",value:function(e){e.contentTypes&&e.contentTypes.size&&(e.contentTypes.includes(e.value)||e.onChange(e.contentTypes.first()))}},{key:"render",value:function(){var e=this.props,t=e.contentTypes,n=e.className,r=e.value;return t&&t.size?s.default.createElement("div",{className:"content-type-wrapper "+(n||"")},s.default.createElement("select",{className:"content-type",value:r||"",onChange:this.onChangeWrapper},t.map(function(e){return s.default.createElement("option",{key:e,value:e},e)}).toArray())):null}}]),t}(s.default.Component);f.defaultProps={onChange:function(){},value:null,contentTypes:(0,l.fromJS)(["application/json"])},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OperationLink=void 0;var r=c(n(4)),o=c(n(2)),i=c(n(3)),a=c(n(5)),u=c(n(6)),s=c(n(0)),l=(c(n(1)),n(413));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){var e;(0,o.default)(this,t);for(var n=arguments.length,i=Array(n),u=0;u<n;u++)i[u]=arguments[u];var s=(0,a.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(i)));return s.setTagShown=s._setTagShown.bind(s),s}return(0,u.default)(t,e),(0,i.default)(t,[{key:"_setTagShown",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"showOp",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.layoutSelectors,r=e.layoutActions,o=e.getComponent,i=t.taggedOperations(),a=o("Collapse");return s.default.createElement("div",null,s.default.createElement("h4",{className:"overview-title"},"Overview"),i.map(function(e,t){var o=e.get("operations"),i=["overview-tags",t],u=n.isShown(i,!0);return s.default.createElement("div",{key:"overview-"+t},s.default.createElement("h4",{onClick:function(){return r.show(i,!u)},className:"link overview-tag"}," ",u?"-":"+",t),s.default.createElement(a,{isOpened:u,animated:!0},o.map(function(e){var t=e.toObject(),o=t.path,i=t.method,a=t.id,u=a,l=n.isShown(["operations",u]);return s.default.createElement(p,{key:a,path:o,method:i,id:o+"-"+i,shown:l,showOpId:u,showOpIdPrefix:"operations",href:"#operation-"+u,onClick:r.show})}).toArray()))}).toArray(),i.size<1&&s.default.createElement("h3",null," No operations defined in spec! "))}}]),t}(s.default.Component);t.default=f;var p=t.OperationLink=function(e){function t(e){(0,o.default)(this,t);var n=(0,a.default)(this,(t.__proto__||(0,r.default)(t)).call(this,e));return n.onClick=n._onClick.bind(n),n}return(0,u.default)(t,e),(0,i.default)(t,[{key:"_onClick",value:function(){var e=this.props,t=e.showOpId,n=e.showOpIdPrefix;(0,e.onClick)([n,t],!e.shown)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.method,r=e.shown,o=e.href;return s.default.createElement(l.Link,{href:o,style:{fontWeight:r?"bold":"normal"},onClick:this.onClick,className:"block opblock-link"},s.default.createElement("div",null,s.default.createElement("small",{className:"bold-label-"+n},n.toUpperCase()),s.default.createElement("span",{className:"bold-label"},t)))}}]),t}(s.default.Component)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfoUrl=t.InfoBasePath=void 0;var r=f(n(4)),o=f(n(2)),i=f(n(3)),a=f(n(5)),u=f(n(6)),s=f(n(0)),l=(f(n(1)),n(7)),c=(f(n(12)),n(9));function f(e){return e&&e.__esModule?e:{default:e}}t.InfoBasePath=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.host,n=e.basePath;return s.default.createElement("pre",{className:"base-url"},"[ Base URL: ",t,n," ]")}}]),t}(s.default.Component);var p=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.data,n=e.getComponent,r=t.get("name")||"the developer",o=t.get("url"),i=t.get("email"),a=n("Link");return s.default.createElement("div",{className:"info__contact"},o&&s.default.createElement("div",null,s.default.createElement(a,{href:(0,c.sanitizeUrl)(o),target:"_blank"},r," - Website")),i&&s.default.createElement(a,{href:(0,c.sanitizeUrl)("mailto:"+i)},o?"Send email to "+r:"Contact "+r))}}]),t}(s.default.Component),d=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.license,n=(0,e.getComponent)("Link"),r=t.get("name")||"License",o=t.get("url");return s.default.createElement("div",{className:"info__license"},o?s.default.createElement(n,{target:"_blank",href:(0,c.sanitizeUrl)(o)},r):s.default.createElement("span",null,r))}}]),t}(s.default.Component),h=(t.InfoUrl=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.url,n=(0,e.getComponent)("Link");return s.default.createElement(n,{target:"_blank",href:(0,c.sanitizeUrl)(t)},s.default.createElement("span",{className:"url"}," ",t," "))}}]),t}(s.default.PureComponent),function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.info,n=e.url,r=e.host,o=e.basePath,i=e.getComponent,a=e.externalDocs,u=t.get("version"),f=t.get("description"),h=t.get("title"),v=t.get("termsOfService"),m=t.get("contact"),g=t.get("license"),y=(a||(0,l.fromJS)({})).toJS(),b=y.url,_=y.description,w=i("Markdown"),E=i("Link"),x=i("VersionStamp"),S=i("InfoUrl"),C=i("InfoBasePath");return s.default.createElement("div",{className:"info"},s.default.createElement("hgroup",{className:"main"},s.default.createElement("h2",{className:"title"},h,u&&s.default.createElement(x,{version:u})),r||o?s.default.createElement(C,{host:r,basePath:o}):null,n&&s.default.createElement(S,{getComponent:i,url:n})),s.default.createElement("div",{className:"description"},s.default.createElement(w,{source:f})),v&&s.default.createElement("div",{className:"info__tos"},s.default.createElement(E,{target:"_blank",href:(0,c.sanitizeUrl)(v)},"Terms of service")),m&&m.size?s.default.createElement(p,{getComponent:i,data:m}):null,g&&g.size?s.default.createElement(d,{getComponent:i,license:g}):null,b?s.default.createElement(E,{className:"info__extdocs",target:"_blank",href:(0,c.sanitizeUrl)(b)},_||b):null)}}]),t}(s.default.Component));t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=t.info(),o=t.url(),i=t.basePath(),a=t.host(),u=t.externalDocs(),l=n("info");return s.default.createElement("div",null,r&&r.count()?s.default.createElement(l,{info:r,url:o,host:a,basePath:i,externalDocs:u,getComponent:n}):null)}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(4)),o=s(n(2)),i=s(n(3)),a=s(n(5)),u=s(n(6));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){return null}}]),t}(s(n(0)).default.Component);t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){return s.default.createElement("div",{className:"footer"})}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){var e,n,i,u;(0,o.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=i=(0,a.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),i.onFilterChange=function(e){var t=e.target.value;i.props.layoutActions.updateFilter(t)},u=n,(0,a.default)(i,u)}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.layoutSelectors,r=(0,e.getComponent)("Col"),o="loading"===t.loadingStatus(),i="failed"===t.loadingStatus(),a=n.currentFilter(),u={};return i&&(u.color="red"),o&&(u.color="#aaa"),s.default.createElement("div",null,null===a||!1===a?null:s.default.createElement("div",{className:"filter-container"},s.default.createElement(r,{className:"filter wrapper",mobile:12},s.default.createElement("input",{className:"operation-filter-input",placeholder:"Filter by tag",type:"text",onChange:this.onFilterChange,value:!0===a||"true"===a?"":a,disabled:o,style:u}))))}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(4)),o=p(n(2)),i=p(n(3)),a=p(n(5)),u=p(n(6)),s=n(0),l=p(s),c=(p(n(1)),n(7)),f=n(9);function p(e){return e&&e.__esModule?e:{default:e}}var d=Function.prototype,h=function(e){function t(e,n){(0,o.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,r.default)(t)).call(this,e,n));return v.call(i),i.state={isEditBox:!1,value:""},i}return(0,u.default)(t,e),(0,i.default)(t,[{key:"componentDidMount",value:function(){this.updateValues.call(this,this.props)}},{key:"componentWillReceiveProps",value:function(e){this.updateValues.call(this,e)}},{key:"render",value:function(){var e=this.props,n=e.onChangeConsumes,r=e.param,o=e.isExecute,i=e.specSelectors,a=e.pathMethod,u=e.getComponent,s=u("Button"),f=u("TextArea"),p=u("highlightCode"),d=u("contentType"),h=(i?i.parameterWithMetaByIdentity(a,r):r).get("errors",(0,c.List)()),v=i.contentTypeValues(a).get("requestContentType"),m=this.props.consumes&&this.props.consumes.size?this.props.consumes:t.defaultProp.consumes,g=this.state,y=g.value,b=g.isEditBox;return l.default.createElement("div",{className:"body-param","data-param-name":r.get("name"),"data-param-in":r.get("in")},b&&o?l.default.createElement(f,{className:"body-param__text"+(h.count()?" invalid":""),value:y,onChange:this.handleOnChange}):y&&l.default.createElement(p,{className:"body-param__example",value:y}),l.default.createElement("div",{className:"body-param-options"},o?l.default.createElement("div",{className:"body-param-edit"},l.default.createElement(s,{className:b?"btn cancel body-param__example-edit":"btn edit body-param__example-edit",onClick:this.toggleIsEditBox},b?"Cancel":"Edit")):null,l.default.createElement("label",{htmlFor:""},l.default.createElement("span",null,"Parameter content type"),l.default.createElement(d,{value:v,contentTypes:m,onChange:n,className:"body-param-content-type"}))))}}]),t}(s.PureComponent);h.defaultProp={consumes:(0,c.fromJS)(["application/json"]),param:(0,c.fromJS)({}),onChange:d,onChangeConsumes:d};var v=function(){var e=this;this.updateValues=function(t){var n=t.param,r=t.isExecute,o=t.consumesValue,i=void 0===o?"":o,a=/xml/i.test(i),u=/json/i.test(i),s=a?n.get("value_xml"):n.get("value");if(void 0!==s){var l=!s&&u?"{}":s;e.setState({value:l}),e.onChange(l,{isXml:a,isEditBox:r})}else a?e.onChange(e.sample("xml"),{isXml:a,isEditBox:r}):e.onChange(e.sample(),{isEditBox:r})},this.sample=function(t){var n=e.props,r=n.param,o=(0,n.fn.inferSchema)(r.toJS());return(0,f.getSampleSchema)(o,t,{includeWriteOnly:!0})},this.onChange=function(t,n){var r=n.isEditBox,o=n.isXml;e.setState({value:t,isEditBox:r}),e._onChange(t,o)},this._onChange=function(t,n){(e.props.onChange||d)(t,n)},this.handleOnChange=function(t){var n=e.props.consumesValue,r=/json/i.test(n),o=/xml/i.test(n),i=r?t.target.value.trim():t.target.value;e.onChange(i,{isXml:o})},this.toggleIsEditBox=function(){return e.setState(function(e){return{isEditBox:!e.isEditBox}})}};t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(4)),o=c(n(2)),i=c(n(3)),a=c(n(5)),u=c(n(6)),s=c(n(0)),l=(c(n(1)),c(n(984)));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"handleFocus",value:function(e){e.target.select(),document.execCommand("copy")}},{key:"render",value:function(){var e=this.props.request,t=(0,l.default)(e);return s.default.createElement("div",null,s.default.createElement("h4",null,"Curl"),s.default.createElement("div",{className:"copy-paste"},s.default.createElement("textarea",{onFocus:this.handleFocus,readOnly:"true",className:"curl",style:{whiteSpace:"normal"},value:t})))}}]),t}(s.default.Component);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(41)),o=u(n(17)),i=u(n(91));t.default=function(e){var t=[],n="",u=e.get("headers");if(t.push("curl"),t.push("-X",e.get("method")),t.push('"'+e.get("url")+'"'),u&&u.size){var s=!0,l=!1,c=void 0;try{for(var f,p=(0,i.default)(e.get("headers").entries());!(s=(f=p.next()).done);s=!0){var d=f.value,h=(0,o.default)(d,2),v=h[0],m=h[1];n=m,t.push("-H "),t.push('"'+v+": "+m+'"')}}catch(e){l=!0,c=e}finally{try{!s&&p.return&&p.return()}finally{if(l)throw c}}}if(e.get("body"))if("multipart/form-data"===n&&"POST"===e.get("method")){var g=!0,y=!1,b=void 0;try{for(var _,w=(0,i.default)(e.get("body").entrySeq());!(g=(_=w.next()).done);g=!0){var E=(0,o.default)(_.value,2),x=E[0],m=E[1];t.push("-F"),m instanceof a.default.File?t.push('"'+x+"=@"+m.name+(m.type?";type="+m.type:"")+'"'):t.push('"'+x+"="+m+'"')}}catch(e){y=!0,b=e}finally{try{!g&&w.return&&w.return()}finally{if(y)throw b}}}else t.push("-d"),t.push((0,r.default)(e.get("body")).replace(/\\n/g,""));return t.join(" ")};var a=u(n(32));function u(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){var e,n,i,u;(0,o.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=i=(0,a.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),i.onChange=function(e){i.setScheme(e.target.value)},i.setScheme=function(e){var t=i.props,n=t.path,r=t.method;t.specActions.setScheme(e,n,r)},u=n,(0,a.default)(i,u)}return(0,u.default)(t,e),(0,i.default)(t,[{key:"componentWillMount",value:function(){var e=this.props.schemes;this.setScheme(e.first())}},{key:"componentWillReceiveProps",value:function(e){this.props.currentScheme&&e.schemes.includes(this.props.currentScheme)||this.setScheme(e.schemes.first())}},{key:"render",value:function(){var e=this.props,t=e.schemes,n=e.currentScheme;return s.default.createElement("label",{htmlFor:"schemes"},s.default.createElement("span",{className:"schemes-title"},"Schemes"),s.default.createElement("select",{onChange:this.onChange,value:n},t.valueSeq().map(function(e){return s.default.createElement("option",{value:e,key:e},e)}).toArray()))}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specActions,n=e.specSelectors,r=e.getComponent,o=n.operationScheme(),i=n.schemes(),a=r("schemes");return i&&i.size?s.default.createElement(a,{currentScheme:o,schemes:i,specActions:t}):null}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(4)),o=c(n(2)),i=c(n(3)),a=c(n(5)),u=c(n(6)),s=n(0),l=c(s);c(n(1));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(e,n){(0,o.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,r.default)(t)).call(this,e,n));i.toggleCollapsed=function(){i.props.onToggle&&i.props.onToggle(i.props.modelName,!i.state.expanded),i.setState({expanded:!i.state.expanded})};var u=i.props,s=u.expanded,l=u.collapsedContent;return i.state={expanded:s,collapsedContent:l||t.defaultProps.collapsedContent},i}return(0,u.default)(t,e),(0,i.default)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.hideSelfOnExpand,n=e.expanded,r=e.modelName;t&&n&&this.props.onToggle(r,n)}},{key:"componentWillReceiveProps",value:function(e){this.props.expanded!==e.expanded&&this.setState({expanded:e.expanded})}},{key:"render",value:function(){var e=this.props,t=e.title,n=e.classes;return this.state.expanded&&this.props.hideSelfOnExpand?l.default.createElement("span",{className:n||""},this.props.children):l.default.createElement("span",{className:n||""},t&&l.default.createElement("span",{onClick:this.toggleCollapsed,style:{cursor:"pointer"}},t),l.default.createElement("span",{onClick:this.toggleCollapsed,style:{cursor:"pointer"}},l.default.createElement("span",{className:"model-toggle"+(this.state.expanded?"":" collapsed")})),this.state.expanded?this.props.children:this.state.collapsedContent)}}]),t}(s.Component);f.defaultProps={collapsedContent:"{...}",expanded:!1,title:null,onToggle:function(){},hideSelfOnExpand:!1},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1)),l(n(12));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e,n){(0,o.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,r.default)(t)).call(this,e,n));i.activeTab=function(e){var t=e.target.dataset.name;i.setState({activeTab:t})};var u=i.props,s=u.getConfigs,l=u.isExecute,c=s().defaultModelRendering;return"example"!==c&&"model"!==c&&(c="example"),i.state={activeTab:l?"example":c},i}return(0,u.default)(t,e),(0,i.default)(t,[{key:"componentWillReceiveProps",value:function(e){e.isExecute&&e.isExecute!==this.props.isExecute&&this.setState({activeTab:"example"})}},{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.specSelectors,r=e.schema,o=e.example,i=e.isExecute,a=e.getConfigs,u=e.specPath,l=a().defaultModelExpandDepth,c=t("ModelWrapper"),f=n.isOAS3();return s.default.createElement("div",null,s.default.createElement("ul",{className:"tab"},s.default.createElement("li",{className:"tabitem"+("example"===this.state.activeTab?" active":"")},s.default.createElement("a",{className:"tablinks","data-name":"example",onClick:this.activeTab},i?"Edit Value":"Example Value")),r?s.default.createElement("li",{className:"tabitem"+("model"===this.state.activeTab?" active":"")},s.default.createElement("a",{className:"tablinks"+(i?" inactive":""),"data-name":"model",onClick:this.activeTab},f?"Schema":"Model")):null),s.default.createElement("div",null,"example"===this.state.activeTab&&o,"model"===this.state.activeTab&&s.default.createElement(c,{schema:r,getComponent:t,getConfigs:a,specSelectors:n,expandDepth:l,specPath:u})))}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(25)),o=f(n(4)),i=f(n(2)),a=f(n(3)),u=f(n(5)),s=f(n(6)),l=n(0),c=f(l);f(n(1));function f(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(){var e,n,r,a;(0,i.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=r=(0,u.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(l))),r.onToggle=function(e,t){r.props.layoutActions&&r.props.layoutActions.show(["models",e],t)},a=n,(0,u.default)(r,a)}return(0,s.default)(t,e),(0,a.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.getConfigs,o=t("Model"),i=void 0;return this.props.layoutSelectors&&(i=this.props.layoutSelectors.isShown(["models",this.props.name])),c.default.createElement("div",{className:"model-box"},c.default.createElement(o,(0,r.default)({},this.props,{getConfigs:n,expanded:i,depth:1,onToggle:this.onToggle,expandDepth:this.props.expandDepth||0})))}}]),t}(l.Component);t.default=p},function(e,t,n){(function(e,t,n){"use strict";t=t&&"default"in t?t.default:t;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(e){function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),function(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}(this,(i.__proto__||Object.getPrototypeOf(i)).apply(this,arguments))}return 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)}(i,t.Component),o(i,[{key:"shouldComponentUpdate",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.state||{};return!(this.updateOnProps||Object.keys(r({},e,this.props))).every(function(r){return n.is(e[r],t.props[r])})||!(this.updateOnStates||Object.keys(r({},o,i))).every(function(e){return n.is(o[e],i[e])})}}]),i}();e.ImmutablePureComponent=i,e.default=i,Object.defineProperty(e,"__esModule",{value:!0})})(t,n(0),n(7))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(17)),o=h(n(83)),i=h(n(4)),a=h(n(2)),u=h(n(3)),s=h(n(5)),l=h(n(6)),c=n(0),f=h(c),p=n(7),d=h(p);h(n(1));function h(e){return e&&e.__esModule?e:{default:e}}var v=function(e){function t(){var e,n,r,u;(0,a.default)(this,t);for(var l=arguments.length,c=Array(l),f=0;f<l;f++)c[f]=arguments[f];return n=r=(0,s.default)(this,(e=t.__proto__||(0,i.default)(t)).call.apply(e,[this].concat(c))),r.getSchemaBasePath=function(){return r.props.specSelectors.isOAS3()?["components","schemas"]:["definitions"]},r.getCollapsedContent=function(){return" "},r.handleToggle=function(e,t){r.props.layoutActions.show(["models",e],t),t&&r.props.specActions.requestResolvedSubtree([].concat((0,o.default)(r.getSchemaBasePath()),[e]))},u=n,(0,s.default)(r,u)}return(0,l.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.specSelectors,i=t.getComponent,a=t.layoutSelectors,u=t.layoutActions,s=t.getConfigs,l=n.definitions(),c=s(),h=c.docExpansion,v=c.defaultModelsExpandDepth;if(!l.size||v<0)return null;var m=a.isShown("models",v>0&&"none"!==h),g=this.getSchemaBasePath(),y=n.isOAS3(),b=i("ModelWrapper"),_=i("Collapse"),w=i("ModelCollapse"),E=i("JumpToPath");return f.default.createElement("section",{className:m?"models is-open":"models"},f.default.createElement("h4",{onClick:function(){return u.show("models",!m)}},f.default.createElement("span",null,y?"Schemas":"Models"),f.default.createElement("svg",{width:"20",height:"20"},f.default.createElement("use",{xlinkHref:m?"#large-arrow-down":"#large-arrow"}))),f.default.createElement(_,{isOpened:m},l.entrySeq().map(function(t){var l=(0,r.default)(t,1)[0],c=[].concat((0,o.default)(g),[l]),h=n.specResolvedSubtree(c),m=n.specJson().getIn(c),y=p.Map.isMap(h)?h:d.default.Map(),_=p.Map.isMap(m)?m:d.default.Map(),x=y.get("title")||_.get("title")||l;a.isShown(["models",l],!1)&&0===y.size&&_.size>0&&e.props.specActions.requestResolvedSubtree([].concat((0,o.default)(e.getSchemaBasePath()),[l]));var S=d.default.List([].concat((0,o.default)(g),[l])),C=f.default.createElement(b,{name:l,expandDepth:v,schema:y||d.default.Map(),displayName:x,specPath:S,getComponent:i,specSelectors:n,getConfigs:s,layoutSelectors:a,layoutActions:u}),k=f.default.createElement("span",{className:"model-box"},f.default.createElement("span",{className:"model model-title"},x));return f.default.createElement("div",{id:"model-"+l,className:"model-container",key:"models-section-"+l},f.default.createElement("span",{className:"models-jump-to-path"},f.default.createElement(E,{specPath:S})),f.default.createElement(w,{classes:"model-box",collapsedContent:e.getCollapsedContent(l),onToggle:e.handleToggle,title:k,displayName:x,modelName:l,hideSelfOnExpand:!0,expanded:v>1},C))}).toArray()))}}]),t}(c.Component);t.default=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0));o(n(12));function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.value,n=(0,e.getComponent)("ModelCollapse"),o=r.default.createElement("span",null,"Array [ ",t.count()," ]");return r.default.createElement("span",{className:"prop-enum"},"Enum:",r.default.createElement("br",null),r.default.createElement(n,{collapsedContent:o},"[ ",t.join(", ")," ]"))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=v(n(41)),o=v(n(25)),i=v(n(17)),a=v(n(84)),u=v(n(4)),s=v(n(2)),l=v(n(3)),c=v(n(5)),f=v(n(6)),p=n(0),d=v(p),h=(v(n(1)),n(7));v(n(12));function v(e){return e&&e.__esModule?e:{default:e}}var m=function(e){function t(){return(0,s.default)(this,t),(0,c.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,f.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.name,u=e.displayName,s=e.isRef,l=e.getComponent,c=e.getConfigs,f=e.depth,p=e.onToggle,v=e.expanded,m=e.specPath,g=(0,a.default)(e,["schema","name","displayName","isRef","getComponent","getConfigs","depth","onToggle","expanded","specPath"]),y=g.specSelectors,b=g.expandDepth,_=y.isOAS3;if(!t)return null;var w=c().showExtensions,E=t.get("description"),x=t.get("properties"),S=t.get("additionalProperties"),C=t.get("title")||u||n,k=t.get("required"),A=l("JumpToPath",!0),O=l("Markdown"),P=l("Model"),T=l("ModelCollapse"),M=function(){return d.default.createElement("span",{className:"model-jump-to-path"},d.default.createElement(A,{specPath:m}))},I=d.default.createElement("span",null,d.default.createElement("span",null,"{"),"...",d.default.createElement("span",null,"}"),s?d.default.createElement(M,null):""),j=y.isOAS3()?t.get("anyOf"):null,N=y.isOAS3()?t.get("oneOf"):null,R=y.isOAS3()?t.get("not"):null,D=C&&d.default.createElement("span",{className:"model-title"},s&&t.get("$$ref")&&d.default.createElement("span",{className:"model-hint"},t.get("$$ref")),d.default.createElement("span",{className:"model-title__text"},C));return d.default.createElement("span",{className:"model"},d.default.createElement(T,{modelName:n,title:D,onToggle:p,expanded:!!v||f<=b,collapsedContent:I},d.default.createElement("span",{className:"brace-open object"},"{"),s?d.default.createElement(M,null):null,d.default.createElement("span",{className:"inner-object"},d.default.createElement("table",{className:"model"},d.default.createElement("tbody",null,E?d.default.createElement("tr",{style:{color:"#666",fontStyle:"italic"}},d.default.createElement("td",null,"description:"),d.default.createElement("td",null,d.default.createElement(O,{source:E}))):null,x&&x.size?x.entrySeq().map(function(e){var t=(0,i.default)(e,2),r=t[0],a=t[1],u=_()&&a.get("deprecated"),s=h.List.isList(k)&&k.contains(r),p={verticalAlign:"top",paddingRight:"0.2em"};return s&&(p.fontWeight="bold"),d.default.createElement("tr",{key:r,className:u&&"deprecated"},d.default.createElement("td",{style:p},r,s&&d.default.createElement("span",{style:{color:"red"}},"*")),d.default.createElement("td",{style:{verticalAlign:"top"}},d.default.createElement(P,(0,o.default)({key:"object-"+n+"-"+r+"_"+a},g,{required:s,getComponent:l,specPath:m.push("properties",r),getConfigs:c,schema:a,depth:f+1}))))}).toArray():null,w?d.default.createElement("tr",null," "):null,w?t.entrySeq().map(function(e){var t=(0,i.default)(e,2),n=t[0],o=t[1];if("x-"===n.slice(0,2)){var a=o?o.toJS?o.toJS():o:null;return d.default.createElement("tr",{key:n,style:{color:"#777"}},d.default.createElement("td",null,n),d.default.createElement("td",{style:{verticalAlign:"top"}},(0,r.default)(a)))}}).toArray():null,S&&S.size?d.default.createElement("tr",null,d.default.createElement("td",null,"< * >:"),d.default.createElement("td",null,d.default.createElement(P,(0,o.default)({},g,{required:!1,getComponent:l,specPath:m.push("additionalProperties"),getConfigs:c,schema:S,depth:f+1})))):null,j?d.default.createElement("tr",null,d.default.createElement("td",null,"anyOf ->"),d.default.createElement("td",null,j.map(function(e,t){return d.default.createElement("div",{key:t},d.default.createElement(P,(0,o.default)({},g,{required:!1,getComponent:l,specPath:m.push("anyOf",t),getConfigs:c,schema:e,depth:f+1})))}))):null,N?d.default.createElement("tr",null,d.default.createElement("td",null,"oneOf ->"),d.default.createElement("td",null,N.map(function(e,t){return d.default.createElement("div",{key:t},d.default.createElement(P,(0,o.default)({},g,{required:!1,getComponent:l,specPath:m.push("oneOf",t),getConfigs:c,schema:e,depth:f+1})))}))):null,R?d.default.createElement("tr",null,d.default.createElement("td",null,"not ->"),d.default.createElement("td",null,d.default.createElement("div",null,d.default.createElement(P,(0,o.default)({},g,{required:!1,getComponent:l,specPath:m.push("not"),getConfigs:c,schema:R,depth:f+1}))))):null))),d.default.createElement("span",{className:"brace-close"},"}")))}}]),t}(p.Component);t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(25)),o=p(n(17)),i=p(n(4)),a=p(n(2)),u=p(n(3)),s=p(n(5)),l=p(n(6)),c=n(0),f=p(c);p(n(1)),p(n(12));function p(e){return e&&e.__esModule?e:{default:e}}var d={color:"#999",fontStyle:"italic"},h=function(e){function t(){return(0,a.default)(this,t),(0,s.default)(this,(t.__proto__||(0,i.default)(t)).apply(this,arguments))}return(0,l.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.getConfigs,i=e.schema,a=e.depth,u=e.expandDepth,s=e.name,l=e.displayName,c=e.specPath,p=i.get("description"),h=i.get("items"),v=i.get("title")||l||s,m=i.filter(function(e,t){return-1===["type","items","description","$$ref"].indexOf(t)}),g=t("Markdown"),y=t("ModelCollapse"),b=t("Model"),_=t("Property"),w=v&&f.default.createElement("span",{className:"model-title"},f.default.createElement("span",{className:"model-title__text"},v));return f.default.createElement("span",{className:"model"},f.default.createElement(y,{title:w,expanded:a<=u,collapsedContent:"[...]"},"[",m.size?m.entrySeq().map(function(e){var t=(0,o.default)(e,2),n=t[0],r=t[1];return f.default.createElement(_,{key:n+"-"+r,propKey:n,propVal:r,propStyle:d})}):null,p?f.default.createElement(g,{source:p}):m.size?f.default.createElement("div",{className:"markdown"}):null,f.default.createElement("span",null,f.default.createElement(b,(0,r.default)({},this.props,{getConfigs:n,specPath:c.push("items"),name:null,schema:h,required:!1,depth:a+1}))),"]"))}}]),t}(c.Component);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(17)),o=p(n(4)),i=p(n(2)),a=p(n(3)),u=p(n(5)),s=p(n(6)),l=n(0),c=p(l),f=(p(n(1)),n(9));function p(e){return e&&e.__esModule?e:{default:e}}var d={color:"#6b6b6b",fontStyle:"italic"},h=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,s.default)(t,e),(0,a.default)(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,o=e.getConfigs,i=e.name,a=e.displayName,u=e.depth,s=o().showExtensions;if(!t||!t.get)return c.default.createElement("div",null);var l=t.get("type"),p=t.get("format"),h=t.get("xml"),v=t.get("enum"),m=t.get("title")||a||i,g=t.get("description"),y=(0,f.getExtensions)(t),b=t.filter(function(e,t){return-1===["enum","type","format","description","$$ref"].indexOf(t)}).filterNot(function(e,t){return y.has(t)}),_=n("Markdown"),w=n("EnumModel"),E=n("Property");return c.default.createElement("span",{className:"model"},c.default.createElement("span",{className:"prop"},i&&c.default.createElement("span",{className:(1===u&&"model-title")+" prop-name"},m),c.default.createElement("span",{className:"prop-type"},l),p&&c.default.createElement("span",{className:"prop-format"},"($",p,")"),b.size?b.entrySeq().map(function(e){var t=(0,r.default)(e,2),n=t[0],o=t[1];return c.default.createElement(E,{key:n+"-"+o,propKey:n,propVal:o,propStyle:d})}):null,s&&y.size?y.entrySeq().map(function(e){var t=(0,r.default)(e,2),n=t[0],o=t[1];return c.default.createElement(E,{key:n+"-"+o,propKey:n,propVal:o,propStyle:d})}):null,g?c.default.createElement(_,{source:g}):null,h&&h.size?c.default.createElement("span",null,c.default.createElement("br",null),c.default.createElement("span",{style:d},"xml:"),h.entrySeq().map(function(e){var t=(0,r.default)(e,2),n=t[0],o=t[1];return c.default.createElement("span",{key:n+"-"+o,style:d},c.default.createElement("br",null)," ",n,": ",String(o))}).toArray()):null,v&&c.default.createElement(w,{value:v,getComponent:n})))}}]),t}(l.Component);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Property=void 0;var r=o(n(0));o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}var i=t.Property=function(e){var t=e.propKey,n=e.propVal,o=e.propStyle;return r.default.createElement("span",{style:o},r.default.createElement("br",null),t,": ",String(n))};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.onTryoutClick,n=e.onCancelClick,r=e.enabled;return s.default.createElement("div",{className:"try-out"},r?s.default.createElement("button",{className:"btn try-out__btn cancel",onClick:n},"Cancel"):s.default.createElement("button",{className:"btn try-out__btn",onClick:t},"Try it out "))}}]),t}(s.default.Component);c.defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,enabled:!1},t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.bypass,n=e.isSwagger2,r=e.isOAS3,o=e.alsoShow;return t?s.default.createElement("div",null,this.props.children):n&&r?s.default.createElement("div",{className:"version-pragma"},o,s.default.createElement("div",{className:"version-pragma__message version-pragma__message--ambiguous"},s.default.createElement("div",null,s.default.createElement("h3",null,"Unable to render this definition"),s.default.createElement("p",null,s.default.createElement("code",null,"swagger")," and ",s.default.createElement("code",null,"openapi")," fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields."),s.default.createElement("p",null,"Supported version fields are ",s.default.createElement("code",null,"swagger: ",'"2.0"')," and those that match ",s.default.createElement("code",null,"openapi: 3.0.n")," (for example, ",s.default.createElement("code",null,"openapi: 3.0.0"),").")))):n||r?s.default.createElement("div",null,this.props.children):s.default.createElement("div",{className:"version-pragma"},o,s.default.createElement("div",{className:"version-pragma__message version-pragma__message--missing"},s.default.createElement("div",null,s.default.createElement("h3",null,"Unable to render this definition"),s.default.createElement("p",null,"The provided definition does not specify a valid version field."),s.default.createElement("p",null,"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are ",s.default.createElement("code",null,"swagger: ",'"2.0"')," and those that match ",s.default.createElement("code",null,"openapi: 3.0.n")," (for example, ",s.default.createElement("code",null,"openapi: 3.0.0"),")."))))}}]),t}(s.default.PureComponent);c.defaultProps={alsoShow:null,children:null,bypass:!1},t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0));o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.version;return r.default.createElement("small",null,r.default.createElement("pre",{className:"version"}," ",t," "))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeepLink=void 0;var r=o(n(0));o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}var i=t.DeepLink=function(e){var t=e.enabled,n=e.path,o=e.text;return r.default.createElement("a",{className:"nostyle",onClick:t?function(e){return e.preventDefault()}:null,href:t?"#/"+n:null},r.default.createElement("span",null,o))};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r};t.default=function(){return i.default.createElement("div",null,i.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",style:{position:"absolute",width:0,height:0}},i.default.createElement("defs",null,i.default.createElement("symbol",{viewBox:"0 0 20 20",id:"unlocked"},i.default.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"})),i.default.createElement("symbol",{viewBox:"0 0 20 20",id:"locked"},i.default.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z"})),i.default.createElement("symbol",{viewBox:"0 0 20 20",id:"close"},i.default.createElement("path",{d:"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z"})),i.default.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow"},i.default.createElement("path",{d:"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z"})),i.default.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow-down"},i.default.createElement("path",{d:"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z"})),i.default.createElement("symbol",{viewBox:"0 0 24 24",id:"jump-to"},i.default.createElement("path",{d:"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"})),i.default.createElement("symbol",{viewBox:"0 0 24 24",id:"expand"},i.default.createElement("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})))))}},function(e,t,n){"use strict";var r=n(27).assign,o=n(1003),i=n(1005),a=n(1016),u=n(1031),s=n(153),l={default:n(1050),full:n(1051),commonmark:n(1052)};function c(e,t,n){this.src=t,this.env=n,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function f(e,t){"string"!=typeof e&&(t=e,e="default"),this.inline=new u,this.block=new a,this.core=new i,this.renderer=new o,this.ruler=new s,this.options={},this.configure(l[e]),this.set(t||{})}f.prototype.set=function(e){r(this.options,e)},f.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enable(e.components[n].rules,!0)})},f.prototype.use=function(e,t){return e(this,t),this},f.prototype.parse=function(e,t){var n=new c(this,e,t);return this.core.process(n),n.tokens},f.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},f.prototype.parseInline=function(e,t){var n=new c(this,e,t);return n.inlineMode=!0,this.core.process(n),n.tokens},f.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=f,e.exports.utils=n(27)},function(e,t,n){"use strict";var r=n(27),o=n(1004);function i(){this.rules=r.assign({},o),this.getBreak=o.getBreak}e.exports=i,i.prototype.renderInline=function(e,t,n){for(var r=this.rules,o=e.length,i=0,a="";o--;)a+=r[e[i].type](e,i++,t,n,this);return a},i.prototype.render=function(e,t,n){for(var r=this.rules,o=e.length,i=-1,a="";++i<o;)"inline"===e[i].type?a+=this.renderInline(e[i].children,t,n):a+=r[e[i].type](e,i,t,n,this);return a}},function(e,t,n){"use strict";var r=n(27).has,o=n(27).unescapeMd,i=n(27).replaceEntities,a=n(27).escapeHtml,u={};u.blockquote_open=function(){return"<blockquote>\n"},u.blockquote_close=function(e,t){return"</blockquote>"+s(e,t)},u.code=function(e,t){return e[t].block?"<pre><code>"+a(e[t].content)+"</code></pre>"+s(e,t):"<code>"+a(e[t].content)+"</code>"},u.fence=function(e,t,n,u,l){var c,f,p=e[t],d="",h=n.langPrefix;if(p.params){if(f=(c=p.params.split(/\s+/g)).join(" "),r(l.rules.fence_custom,c[0]))return l.rules.fence_custom[c[0]](e,t,n,u,l);d=' class="'+h+a(i(o(f)))+'"'}return"<pre><code"+d+">"+(n.highlight&&n.highlight.apply(n.highlight,[p.content].concat(c))||a(p.content))+"</code></pre>"+s(e,t)},u.fence_custom={},u.heading_open=function(e,t){return"<h"+e[t].hLevel+">"},u.heading_close=function(e,t){return"</h"+e[t].hLevel+">\n"},u.hr=function(e,t,n){return(n.xhtmlOut?"<hr />":"<hr>")+s(e,t)},u.bullet_list_open=function(){return"<ul>\n"},u.bullet_list_close=function(e,t){return"</ul>"+s(e,t)},u.list_item_open=function(){return"<li>"},u.list_item_close=function(){return"</li>\n"},u.ordered_list_open=function(e,t){var n=e[t];return"<ol"+(n.order>1?' start="'+n.order+'"':"")+">\n"},u.ordered_list_close=function(e,t){return"</ol>"+s(e,t)},u.paragraph_open=function(e,t){return e[t].tight?"":"<p>"},u.paragraph_close=function(e,t){var n=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"</p>")+(n?s(e,t):"")},u.link_open=function(e,t,n){var r=e[t].title?' title="'+a(i(e[t].title))+'"':"",o=n.linkTarget?' target="'+n.linkTarget+'"':"";return'<a href="'+a(e[t].href)+'"'+r+o+">"},u.link_close=function(){return"</a>"},u.image=function(e,t,n){var r=' src="'+a(e[t].src)+'"',u=e[t].title?' title="'+a(i(e[t].title))+'"':"";return"<img"+r+(' alt="'+(e[t].alt?a(i(o(e[t].alt))):"")+'"')+u+(n.xhtmlOut?" /":"")+">"},u.table_open=function(){return"<table>\n"},u.table_close=function(){return"</table>\n"},u.thead_open=function(){return"<thead>\n"},u.thead_close=function(){return"</thead>\n"},u.tbody_open=function(){return"<tbody>\n"},u.tbody_close=function(){return"</tbody>\n"},u.tr_open=function(){return"<tr>"},u.tr_close=function(){return"</tr>\n"},u.th_open=function(e,t){var n=e[t];return"<th"+(n.align?' style="text-align:'+n.align+'"':"")+">"},u.th_close=function(){return"</th>"},u.td_open=function(e,t){var n=e[t];return"<td"+(n.align?' style="text-align:'+n.align+'"':"")+">"},u.td_close=function(){return"</td>"},u.strong_open=function(){return"<strong>"},u.strong_close=function(){return"</strong>"},u.em_open=function(){return"<em>"},u.em_close=function(){return"</em>"},u.del_open=function(){return"<del>"},u.del_close=function(){return"</del>"},u.ins_open=function(){return"<ins>"},u.ins_close=function(){return"</ins>"},u.mark_open=function(){return"<mark>"},u.mark_close=function(){return"</mark>"},u.sub=function(e,t){return"<sub>"+a(e[t].content)+"</sub>"},u.sup=function(e,t){return"<sup>"+a(e[t].content)+"</sup>"},u.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},u.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},u.text=function(e,t){return a(e[t].content)},u.htmlblock=function(e,t){return e[t].content},u.htmltag=function(e,t){return e[t].content},u.abbr_open=function(e,t){return'<abbr title="'+a(i(e[t].title))+'">'},u.abbr_close=function(){return"</abbr>"},u.footnote_ref=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),'<sup class="footnote-ref"><a href="#fn'+n+'" id="'+r+'">['+n+"]</a></sup>"},u.footnote_block_open=function(e,t,n){return(n.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},u.footnote_block_close=function(){return"</ol>\n</section>\n"},u.footnote_open=function(e,t){return'<li id="fn'+Number(e[t].id+1).toString()+'" class="footnote-item">'},u.footnote_close=function(){return"</li>\n"},u.footnote_anchor=function(e,t){var n="fnref"+Number(e[t].id+1).toString();return e[t].subId>0&&(n+=":"+e[t].subId),' <a href="#'+n+'" class="footnote-backref">↩</a>'},u.dl_open=function(){return"<dl>\n"},u.dt_open=function(){return"<dt>"},u.dd_open=function(){return"<dd>"},u.dl_close=function(){return"</dl>\n"},u.dt_close=function(){return"</dt>\n"},u.dd_close=function(){return"</dd>\n"};var s=u.getBreak=function(e,t){return(t=function e(t,n){return++n>=t.length-2?n:"paragraph_open"===t[n].type&&t[n].tight&&"inline"===t[n+1].type&&0===t[n+1].content.length&&"paragraph_close"===t[n+2].type&&t[n+2].tight?e(t,n+2):n}(e,t))<e.length&&"list_item_close"===e[t].type?"":"\n"};e.exports=u},function(e,t,n){"use strict";var r=n(153),o=[["block",n(1006)],["abbr",n(1007)],["references",n(1008)],["inline",n(1009)],["footnote_tail",n(1010)],["abbr2",n(1011)],["replacements",n(1012)],["smartquotes",n(1013)],["linkify",n(1014)]];function i(){this.options={},this.ruler=new r;for(var e=0;e<o.length;e++)this.ruler.push(o[e][0],o[e][1])}i.prototype.process=function(e){var t,n,r;for(t=0,n=(r=this.ruler.getRules("")).length;t<n;t++)r[t](e)},e.exports=i},function(e,t,n){"use strict";e.exports=function(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):e.block.parse(e.src,e.options,e.env,e.tokens)}},function(e,t,n){"use strict";var r=n(236),o=n(154);function i(e,t,n,i){var a,u,s,l,c,f;if(42!==e.charCodeAt(0))return-1;if(91!==e.charCodeAt(1))return-1;if(-1===e.indexOf("]:"))return-1;if(a=new r(e,t,n,i,[]),(u=o(a,1))<0||58!==e.charCodeAt(u+1))return-1;for(l=a.posMax,s=u+2;s<l&&10!==a.src.charCodeAt(s);s++);return c=e.slice(2,u),0===(f=e.slice(u+2,s).trim()).length?-1:(i.abbreviations||(i.abbreviations={}),void 0===i.abbreviations[":"+c]&&(i.abbreviations[":"+c]=f),s)}e.exports=function(e){var t,n,r,o,a=e.tokens;if(!e.inlineMode)for(t=1,n=a.length-1;t<n;t++)if("paragraph_open"===a[t-1].type&&"inline"===a[t].type&&"paragraph_close"===a[t+1].type){for(r=a[t].content;r.length&&!((o=i(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();a[t].content=r,r.length||(a[t-1].tight=!0,a[t+1].tight=!0)}}},function(e,t,n){"use strict";var r=n(236),o=n(154),i=n(418),a=n(420),u=n(421);function s(e,t,n,s){var l,c,f,p,d,h,v,m,g;if(91!==e.charCodeAt(0))return-1;if(-1===e.indexOf("]:"))return-1;if(l=new r(e,t,n,s,[]),(c=o(l,0))<0||58!==e.charCodeAt(c+1))return-1;for(p=l.posMax,f=c+2;f<p&&(32===(d=l.src.charCodeAt(f))||10===d);f++);if(!i(l,f))return-1;for(v=l.linkContent,h=f=l.pos,f+=1;f<p&&(32===(d=l.src.charCodeAt(f))||10===d);f++);for(f<p&&h!==f&&a(l,f)?(m=l.linkContent,f=l.pos):(m="",f=h);f<p&&32===l.src.charCodeAt(f);)f++;return f<p&&10!==l.src.charCodeAt(f)?-1:(g=u(e.slice(1,c)),void 0===s.references[g]&&(s.references[g]={title:m,href:v}),f)}e.exports=function(e){var t,n,r,o,i=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,n=i.length-1;t<n;t++)if("inline"===i[t].type&&"paragraph_open"===i[t-1].type&&"paragraph_close"===i[t+1].type){for(r=i[t].content;r.length&&!((o=s(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();i[t].content=r,r.length||(i[t-1].tight=!0,i[t+1].tight=!0)}}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,o=e.tokens;for(n=0,r=o.length;n<r;n++)"inline"===(t=o[n]).type&&e.inline.parse(t.content,e.options,e.env,t.children)}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,o,i,a,u,s,l,c=0,f=!1,p={};if(e.env.footnotes&&(e.tokens=e.tokens.filter(function(e){return"footnote_reference_open"===e.type?(f=!0,s=[],l=e.label,!1):"footnote_reference_close"===e.type?(f=!1,p[":"+l]=s,!1):(f&&s.push(e),!f)}),e.env.footnotes.list)){for(a=e.env.footnotes.list,e.tokens.push({type:"footnote_block_open",level:c++}),t=0,n=a.length;t<n;t++){for(e.tokens.push({type:"footnote_open",id:t,level:c++}),a[t].tokens?((u=[]).push({type:"paragraph_open",tight:!1,level:c++}),u.push({type:"inline",content:"",level:c,children:a[t].tokens}),u.push({type:"paragraph_close",tight:!1,level:--c})):a[t].label&&(u=p[":"+a[t].label]),e.tokens=e.tokens.concat(u),i="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,o=a[t].count>0?a[t].count:1,r=0;r<o;r++)e.tokens.push({type:"footnote_anchor",id:t,subId:r,level:c});i&&e.tokens.push(i),e.tokens.push({type:"footnote_close",level:--c})}e.tokens.push({type:"footnote_block_close",level:--c})}}},function(e,t,n){"use strict";function r(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}e.exports=function(e){var t,n,o,i,a,u,s,l,c,f,p,d,h=e.tokens;if(e.env.abbreviations)for(e.env.abbrRegExp||(d="(^|["+" \n()[]'\".,!?-".split("").map(r).join("")+"])("+Object.keys(e.env.abbreviations).map(function(e){return e.substr(1)}).sort(function(e,t){return t.length-e.length}).map(r).join("|")+")($|["+" \n()[]'\".,!?-".split("").map(r).join("")+"])",e.env.abbrRegExp=new RegExp(d,"g")),f=e.env.abbrRegExp,n=0,o=h.length;n<o;n++)if("inline"===h[n].type)for(t=(i=h[n].children).length-1;t>=0;t--)if("text"===(a=i[t]).type){for(l=0,u=a.content,f.lastIndex=0,c=a.level,s=[];p=f.exec(u);)f.lastIndex>l&&s.push({type:"text",content:u.slice(l,p.index+p[1].length),level:c}),s.push({type:"abbr_open",title:e.env.abbreviations[":"+p[2]],level:c++}),s.push({type:"text",content:p[2],level:c}),s.push({type:"abbr_close",level:--c}),l=f.lastIndex-p[3].length;s.length&&(l<u.length&&s.push({type:"text",content:u.slice(l),level:c}),h[n].children=i=[].concat(i.slice(0,t),s,i.slice(t+1)))}}},function(e,t,n){"use strict";var r=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,o=/\((c|tm|r|p)\)/gi,i={c:"©",r:"®",p:"§",tm:"™"};e.exports=function(e){var t,n,a,u,s,l;if(e.options.typographer)for(s=e.tokens.length-1;s>=0;s--)if("inline"===e.tokens[s].type)for(t=(u=e.tokens[s].children).length-1;t>=0;t--)"text"===(n=u[t]).type&&(a=n.content,a=(l=a).indexOf("(")<0?l:l.replace(o,function(e,t){return i[t.toLowerCase()]}),r.test(a)&&(a=a.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),n.content=a)}},function(e,t,n){"use strict";var r=/['"]/,o=/['"]/g,i=/[-\s()\[\]]/;function a(e,t){return!(t<0||t>=e.length)&&!i.test(e[t])}function u(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}e.exports=function(e){var t,n,i,s,l,c,f,p,d,h,v,m,g,y,b,_,w;if(e.options.typographer)for(w=[],b=e.tokens.length-1;b>=0;b--)if("inline"===e.tokens[b].type)for(_=e.tokens[b].children,w.length=0,t=0;t<_.length;t++)if("text"===(n=_[t]).type&&!r.test(n.text)){for(f=_[t].level,g=w.length-1;g>=0&&!(w[g].level<=f);g--);w.length=g+1,l=0,c=(i=n.content).length;e:for(;l<c&&(o.lastIndex=l,s=o.exec(i));)if(p=!a(i,s.index-1),l=s.index+1,y="'"===s[0],(d=!a(i,l))||p){if(v=!d,m=!p)for(g=w.length-1;g>=0&&(h=w[g],!(w[g].level<f));g--)if(h.single===y&&w[g].level===f){h=w[g],y?(_[h.token].content=u(_[h.token].content,h.pos,e.options.quotes[2]),n.content=u(n.content,s.index,e.options.quotes[3])):(_[h.token].content=u(_[h.token].content,h.pos,e.options.quotes[0]),n.content=u(n.content,s.index,e.options.quotes[1])),w.length=g;continue e}v?w.push({token:t,pos:s.index,single:y,level:f}):m&&y&&(n.content=u(n.content,s.index,"’"))}else y&&(n.content=u(n.content,s.index,"’"))}}},function(e,t,n){"use strict";var r=n(1015),o=/www|@|\:\/\//;function i(e){return/^<\/a\s*>/i.test(e)}function a(){var e=[],t=new r({stripPrefix:!1,url:!0,email:!0,twitter:!1,replaceFn:function(t,n){switch(n.getType()){case"url":e.push({text:n.matchedText,url:n.getUrl()});break;case"email":e.push({text:n.matchedText,url:"mailto:"+n.getEmail().replace(/^mailto:/i,"")})}return!1}});return{links:e,autolinker:t}}e.exports=function(e){var t,n,r,u,s,l,c,f,p,d,h,v,m,g,y=e.tokens,b=null;if(e.options.linkify)for(n=0,r=y.length;n<r;n++)if("inline"===y[n].type)for(h=0,t=(u=y[n].children).length-1;t>=0;t--)if("link_close"!==(s=u[t]).type){if("htmltag"===s.type&&(g=s.content,/^<a[>\s]/i.test(g)&&h>0&&h--,i(s.content)&&h++),!(h>0)&&"text"===s.type&&o.test(s.content)){if(b||(v=(b=a()).links,m=b.autolinker),l=s.content,v.length=0,m.link(l),!v.length)continue;for(c=[],d=s.level,f=0;f<v.length;f++)e.inline.validateLink(v[f].url)&&((p=l.indexOf(v[f].text))&&(d=d,c.push({type:"text",content:l.slice(0,p),level:d})),c.push({type:"link_open",href:v[f].url,title:"",level:d++}),c.push({type:"text",content:v[f].text,level:d}),c.push({type:"link_close",level:--d}),l=l.slice(p+v[f].text.length));l.length&&c.push({type:"text",content:l,level:d}),y[n].children=u=[].concat(u.slice(0,t),c,u.slice(t+1))}}else for(t--;u[t].level!==s.level&&"link_open"!==u[t].type;)t--}},function(e,t,n){var r,o,i;o=this,i=function(){
/*!
* Autolinker.js
* 0.15.3
*
* Copyright(c) 2015 Gregory Jacobs <[email protected]>
* MIT Licensed. http://www.opensource.org/licenses/mit-license.php
*
* https://github.com/gregjacobs/Autolinker.js
*/
var e,t,n,r,o=function(e){o.Util.assign(this,e)};return o.prototype={constructor:o,urls:!0,email:!0,twitter:!0,newWindow:!0,stripPrefix:!0,truncate:void 0,className:"",htmlParser:void 0,matchParser:void 0,tagBuilder:void 0,link:function(e){for(var t=this.getHtmlParser().parse(e),n=0,r=[],o=0,i=t.length;o<i;o++){var a=t[o],u=a.getType(),s=a.getText();if("element"===u)"a"===a.getTagName()&&(a.isClosing()?n=Math.max(n-1,0):n++),r.push(s);else if("entity"===u)r.push(s);else if(0===n){var l=this.linkifyStr(s);r.push(l)}else r.push(s)}return r.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this,this,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof o.HtmlTag?t.toString():this.getTagBuilder().build(e).toString()},getHtmlParser:function(){var e=this.htmlParser;return e||(e=this.htmlParser=new o.htmlParser.HtmlParser),e},getMatchParser:function(){var e=this.matchParser;return e||(e=this.matchParser=new o.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,stripPrefix:this.stripPrefix})),e},getTagBuilder:function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new o.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e}},o.link=function(e,t){return new o(t).link(e)},o.match={},o.htmlParser={},o.matchParser={},o.Util={abstractMethod:function(){throw"abstract"},assign:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},extend:function(e,t){var n,r=e.prototype,i=function(){};i.prototype=r;var a=(n=t.hasOwnProperty("constructor")?t.constructor:function(){r.constructor.apply(this,arguments)}).prototype=new i;return a.constructor=n,a.superclass=r,delete t.constructor,o.Util.assign(a,t),n},ellipsis:function(e,t,n){return e.length>t&&(n=null==n?"..":n,e=e.substring(0,t-n.length)+n),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],o=0;n=t.exec(e);)r.push(e.substring(o,n.index)),r.push(n[0]),o=n.index+n[0].length;return r.push(e.substring(o)),r}},o.HtmlTag=o.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(e){o.Util.assign(this,e),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){return this.getAttrs()[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(e){var t=this.getAttrs();return o.Util.assign(t,e),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=o.Util.indexOf,a=n?n.split(r):[],u=e.split(r);t=u.shift();)-1===i(a,t)&&a.push(t);return this.getAttrs().class=a.join(" "),this},removeClass:function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=o.Util.indexOf,a=n?n.split(r):[],u=e.split(r);a.length&&(t=u.shift());){var s=i(a,t);-1!==s&&a.splice(s,1)}return this.getAttrs().class=a.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")}}),o.AnchorTagBuilder=o.Util.extend(Object,{constructor:function(e){o.Util.assign(this,e)},build:function(e){return new o.HtmlTag({tagName:"a",attrs:this.createAttrs(e.getType(),e.getAnchorHref()),innerHtml:this.processAnchorText(e.getAnchorText())})},createAttrs:function(e,t){var n={href:t},r=this.createCssClass(e);return r&&(n.class=r),this.newWindow&&(n.target="_blank"),n},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(e){return o.Util.ellipsis(e,this.truncate||Number.POSITIVE_INFINITY)}}),o.htmlParser.HtmlParser=o.Util.extend(Object,{htmlRegex:(e=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,t=/[^\s\0"'>\/=\x01-\x1F\x7F]+/.source+"(?:\\s*=\\s*"+e.source+")?",new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",t,"|",e.source+")",")*",">",")","|","(?:","<(/)?","("+/[0-9a-zA-Z][0-9a-zA-Z:]*/.source+")","(?:","\\s+",t,")*","\\s*/?",">",")"].join(""),"gi")),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,n,r=this.htmlRegex,o=0,i=[];null!==(t=r.exec(e));){var a=t[0],u=t[1]||t[3],s=!!t[2],l=e.substring(o,t.index);l&&(n=this.parseTextAndEntityNodes(l),i.push.apply(i,n)),i.push(this.createElementNode(a,u,s)),o=t.index+a.length}if(o<e.length){var c=e.substring(o);c&&(n=this.parseTextAndEntityNodes(c),i.push.apply(i,n))}return i},parseTextAndEntityNodes:function(e){for(var t=[],n=o.Util.splitAndCapture(e,this.htmlCharacterEntitiesRegex),r=0,i=n.length;r<i;r+=2){var a=n[r],u=n[r+1];a&&t.push(this.createTextNode(a)),u&&t.push(this.createEntityNode(u))}return t},createElementNode:function(e,t,n){return new o.htmlParser.ElementNode({text:e,tagName:t.toLowerCase(),closing:n})},createEntityNode:function(e){return new o.htmlParser.EntityNode({text:e})},createTextNode:function(e){return new o.htmlParser.TextNode({text:e})}}),o.htmlParser.HtmlNode=o.Util.extend(Object,{text:"",constructor:function(e){o.Util.assign(this,e)},getType:o.Util.abstractMethod,getText:function(){return this.text}}),o.htmlParser.ElementNode=o.Util.extend(o.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),o.htmlParser.EntityNode=o.Util.extend(o.htmlParser.HtmlNode,{getType:function(){return"entity"}}),o.htmlParser.TextNode=o.Util.extend(o.htmlParser.HtmlNode,{getType:function(){return"text"}}),o.matchParser.MatchParser=o.Util.extend(Object,{urls:!0,email:!0,twitter:!0,stripPrefix:!0,matcherRegex:(n=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,r=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,new RegExp(["(",/(^|[^\w])@(\w{1,15})/.source,")","|","(",/(?:[\-;:&=\+\$,\w\.]+@)/.source,n.source,r.source,")","|","(","(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,n.source,")","|","(?:","(.?//)?",/(?:www\.)/.source,n.source,")","|","(?:","(.?//)?",n.source,r.source,")",")","(?:"+/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/.source+")?",")"].join(""),"gi")),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(e){o.Util.assign(this,e),this.matchValidator=new o.MatchValidator},replace:function(e,t,n){var r=this;return e.replace(this.matcherRegex,function(e,o,i,a,u,s,l,c,f){var p=r.processCandidateMatch(e,o,i,a,u,s,l,c,f);if(p){var d=t.call(n,p.match);return p.prefixStr+d+p.suffixStr}return e})},processCandidateMatch:function(e,t,n,r,i,a,u,s,l){var c,f=s||l,p="",d="";if(t&&!this.twitter||i&&!this.email||a&&!this.urls||!this.matchValidator.isValidMatch(a,u,f))return null;if(this.matchHasUnbalancedClosingParen(e)&&(e=e.substr(0,e.length-1),d=")"),i)c=new o.match.Email({matchedText:e,email:i});else if(t)n&&(p=n,e=e.slice(1)),c=new o.match.Twitter({matchedText:e,twitterHandle:r});else{if(f){var h=f.match(this.charBeforeProtocolRelMatchRegex)[1]||"";h&&(p=h,e=e.slice(1))}c=new o.match.Url({matchedText:e,url:e,protocolUrlMatch:!!u,protocolRelativeMatch:!!f,stripPrefix:this.stripPrefix})}return{prefixStr:p,suffixStr:d,match:c}},matchHasUnbalancedClosingParen:function(e){if(")"===e.charAt(e.length-1)){var t=e.match(/\(/g),n=e.match(/\)/g);if((t&&t.length||0)<(n&&n.length||0))return!0}return!1}}),o.MatchValidator=o.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,n){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(n))},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return!(!e||!t)&&!this.hasWordCharAfterProtocolRegex.test(e)},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),o.match.Match=o.Util.extend(Object,{constructor:function(e){o.Util.assign(this,e)},getType:o.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:o.Util.abstractMethod,getAnchorText:o.Util.abstractMethod}),o.match.Email=o.Util.extend(o.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),o.match.Twitter=o.Util.extend(o.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),o.match.Url=o.Util.extend(o.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){return this.getUrl().replace(/&/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),o},void 0===(r=function(){return o.Autolinker=i()}.apply(t,[]))||(e.exports=r)},function(e,t,n){"use strict";var r=n(153),o=n(1017),i=[["code",n(1018)],["fences",n(1019),["paragraph","blockquote","list"]],["blockquote",n(1020),["paragraph","blockquote","list"]],["hr",n(1021),["paragraph","blockquote","list"]],["list",n(1022),["paragraph","blockquote"]],["footnote",n(1023),["paragraph"]],["heading",n(1024),["paragraph","blockquote"]],["lheading",n(1025)],["htmlblock",n(1026),["paragraph","blockquote"]],["table",n(1028),["paragraph"]],["deflist",n(1029),["paragraph"]],["paragraph",n(1030)]];function a(){this.ruler=new r;for(var e=0;e<i.length;e++)this.ruler.push(i[e][0],i[e][1],{alt:(i[e][2]||[]).slice()})}a.prototype.tokenize=function(e,t,n){for(var r,o=this.ruler.getRules(""),i=o.length,a=t,u=!1;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n))&&!(e.tShift[a]<e.blkIndent);){for(r=0;r<i&&!o[r](e,a,n,!1);r++);if(e.tight=!u,e.isEmpty(e.line-1)&&(u=!0),(a=e.line)<n&&e.isEmpty(a)){if(u=!0,++a<n&&"list"===e.parentType&&e.isEmpty(a))break;e.line=a}}};var u=/[\n\t]/g,s=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,l=/\u00a0/g;a.prototype.parse=function(e,t,n,r){var i,a=0,c=0;if(!e)return[];(e=(e=e.replace(l," ")).replace(s,"\n")).indexOf("\t")>=0&&(e=e.replace(u,function(t,n){var r;return 10===e.charCodeAt(n)?(a=n+1,c=0,t):(r=" ".slice((n-a-c)%4),c=n-a+1,r)})),i=new o(e,this,t,n,r),this.tokenize(i,i.line,i.lineMax)},e.exports=a},function(e,t,n){"use strict";function r(e,t,n,r,o){var i,a,u,s,l,c,f;for(this.src=e,this.parser=t,this.options=n,this.env=r,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",c=0,f=!1,u=s=c=0,l=(a=this.src).length;s<l;s++){if(i=a.charCodeAt(s),!f){if(32===i){c++;continue}f=!0}10!==i&&s!==l-1||(10!==i&&s++,this.bMarks.push(u),this.eMarks.push(s),this.tShift.push(c),f=!1,c=0,u=s+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}r.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},r.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},r.prototype.skipSpaces=function(e){for(var t=this.src.length;e<t&&32===this.src.charCodeAt(e);e++);return e},r.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},r.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},r.prototype.getLines=function(e,t,n,r){var o,i,a,u,s,l=e;if(e>=t)return"";if(l+1===t)return i=this.bMarks[l]+Math.min(this.tShift[l],n),a=r?this.eMarks[l]+1:this.eMarks[l],this.src.slice(i,a);for(u=new Array(t-e),o=0;l<t;l++,o++)(s=this.tShift[l])>n&&(s=n),s<0&&(s=0),i=this.bMarks[l]+s,a=l+1<t||r?this.eMarks[l]+1:this.eMarks[l],u[o]=this.src.slice(i,a);return u.join("")},e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,o;if(e.tShift[t]-e.blkIndent<4)return!1;for(o=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.tShift[r]-e.blkIndent>=4))break;o=++r}return e.line=r,e.tokens.push({type:"code",content:e.getLines(t,o,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,u,s,l=!1,c=e.bMarks[t]+e.tShift[t],f=e.eMarks[t];if(c+3>f)return!1;if(126!==(o=e.src.charCodeAt(c))&&96!==o)return!1;if(s=c,(i=(c=e.skipChars(c,o))-s)<3)return!1;if((a=e.src.slice(c,f).trim()).indexOf("`")>=0)return!1;if(r)return!0;for(u=t;!(++u>=n)&&!((c=s=e.bMarks[u]+e.tShift[u])<(f=e.eMarks[u])&&e.tShift[u]<e.blkIndent);)if(e.src.charCodeAt(c)===o&&!(e.tShift[u]-e.blkIndent>=4||(c=e.skipChars(c,o))-s<i||(c=e.skipSpaces(c))<f)){l=!0;break}return i=e.tShift[t],e.line=u+(l?1:0),e.tokens.push({type:"fence",params:a,content:e.getLines(t+1,u,i,!0),lines:[t,e.line],level:e.level}),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,u,s,l,c,f,p,d,h,v=e.bMarks[t]+e.tShift[t],m=e.eMarks[t];if(v>m)return!1;if(62!==e.src.charCodeAt(v++))return!1;if(e.level>=e.options.maxNesting)return!1;if(r)return!0;for(32===e.src.charCodeAt(v)&&v++,s=e.blkIndent,e.blkIndent=0,u=[e.bMarks[t]],e.bMarks[t]=v,i=(v=v<m?e.skipSpaces(v):v)>=m,a=[e.tShift[t]],e.tShift[t]=v-e.bMarks[t],f=e.parser.ruler.getRules("blockquote"),o=t+1;o<n&&!((v=e.bMarks[o]+e.tShift[o])>=(m=e.eMarks[o]));o++)if(62!==e.src.charCodeAt(v++)){if(i)break;for(h=!1,p=0,d=f.length;p<d;p++)if(f[p](e,o,n,!0)){h=!0;break}if(h)break;u.push(e.bMarks[o]),a.push(e.tShift[o]),e.tShift[o]=-1337}else 32===e.src.charCodeAt(v)&&v++,u.push(e.bMarks[o]),e.bMarks[o]=v,i=(v=v<m?e.skipSpaces(v):v)>=m,a.push(e.tShift[o]),e.tShift[o]=v-e.bMarks[o];for(l=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:c=[t,0],level:e.level++}),e.parser.tokenize(e,t,o),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=l,c[1]=e.line,p=0;p<a.length;p++)e.bMarks[p+t]=u[p],e.tShift[p+t]=a[p];return e.blkIndent=s,!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,u=e.bMarks[t],s=e.eMarks[t];if((u+=e.tShift[t])>s)return!1;if(42!==(o=e.src.charCodeAt(u++))&&45!==o&&95!==o)return!1;for(i=1;u<s;){if((a=e.src.charCodeAt(u++))!==o&&32!==a)return!1;a===o&&i++}return!(i<3)&&(!!r||(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level}),!0))}},function(e,t,n){"use strict";function r(e,t){var n,r,o;return(r=e.bMarks[t]+e.tShift[t])>=(o=e.eMarks[t])?-1:42!==(n=e.src.charCodeAt(r++))&&45!==n&&43!==n?-1:r<o&&32!==e.src.charCodeAt(r)?-1:r}function o(e,t){var n,r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(r+1>=o)return-1;if((n=e.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=o)return-1;if(!((n=e.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}}return r<o&&32!==e.src.charCodeAt(r)?-1:r}e.exports=function(e,t,n,i){var a,u,s,l,c,f,p,d,h,v,m,g,y,b,_,w,E,x,S,C,k,A=!0;if((d=o(e,t))>=0)g=!0;else{if(!((d=r(e,t))>=0))return!1;g=!1}if(e.level>=e.options.maxNesting)return!1;if(m=e.src.charCodeAt(d-1),i)return!0;for(b=e.tokens.length,g?(p=e.bMarks[t]+e.tShift[t],v=Number(e.src.substr(p,d-p-1)),e.tokens.push({type:"ordered_list_open",order:v,lines:w=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:w=[t,0],level:e.level++}),a=t,_=!1,x=e.parser.ruler.getRules("list");!(!(a<n)||((h=(y=e.skipSpaces(d))>=e.eMarks[a]?1:y-d)>4&&(h=1),h<1&&(h=1),u=d-e.bMarks[a]+h,e.tokens.push({type:"list_item_open",lines:E=[t,0],level:e.level++}),l=e.blkIndent,c=e.tight,s=e.tShift[t],f=e.parentType,e.tShift[t]=y-e.bMarks[t],e.blkIndent=u,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,n,!0),e.tight&&!_||(A=!1),_=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=l,e.tShift[t]=s,e.tight=c,e.parentType=f,e.tokens.push({type:"list_item_close",level:--e.level}),a=t=e.line,E[1]=a,y=e.bMarks[t],a>=n)||e.isEmpty(a)||e.tShift[a]<e.blkIndent);){for(k=!1,S=0,C=x.length;S<C;S++)if(x[S](e,a,n,!0)){k=!0;break}if(k)break;if(g){if((d=o(e,a))<0)break}else if((d=r(e,a))<0)break;if(m!==e.src.charCodeAt(d-1))break}return e.tokens.push({type:g?"ordered_list_close":"bullet_list_close",level:--e.level}),w[1]=a,e.line=a,A&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,b),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,u,s,l=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(l+4>c)return!1;if(91!==e.src.charCodeAt(l))return!1;if(94!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(u=l+2;u<c;u++){if(32===e.src.charCodeAt(u))return!1;if(93===e.src.charCodeAt(u))break}return u!==l+2&&(!(u+1>=c||58!==e.src.charCodeAt(++u))&&(!!r||(u++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),s=e.src.slice(l+2,u-2),e.env.footnotes.refs[":"+s]=-1,e.tokens.push({type:"footnote_reference_open",label:s,level:e.level++}),o=e.bMarks[t],i=e.tShift[t],a=e.parentType,e.tShift[t]=e.skipSpaces(u)-u,e.bMarks[t]=u,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]<e.blkIndent&&(e.tShift[t]+=e.blkIndent,e.bMarks[t]-=e.blkIndent),e.parser.tokenize(e,t,n,!0),e.parentType=a,e.blkIndent-=4,e.tShift[t]=i,e.bMarks[t]=o,e.tokens.push({type:"footnote_reference_close",level:--e.level}),!0)))}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,u=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(u>=s)return!1;if(35!==(o=e.src.charCodeAt(u))||u>=s)return!1;for(i=1,o=e.src.charCodeAt(++u);35===o&&u<s&&i<=6;)i++,o=e.src.charCodeAt(++u);return!(i>6||u<s&&32!==o)&&(!!r||(s=e.skipCharsBack(s,32,u),(a=e.skipCharsBack(s,35,u))>u&&32===e.src.charCodeAt(a-1)&&(s=a),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:i,lines:[t,e.line],level:e.level}),u<s&&e.tokens.push({type:"inline",content:e.src.slice(u,s).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:i,level:e.level}),!0))}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,o,i,a=t+1;return!(a>=n)&&(!(e.tShift[a]<e.blkIndent)&&(!(e.tShift[a]-e.blkIndent>3)&&(!((o=e.bMarks[a]+e.tShift[a])>=(i=e.eMarks[a]))&&((45===(r=e.src.charCodeAt(o))||61===r)&&(o=e.skipChars(o,r),!((o=e.skipSpaces(o))<i)&&(o=e.bMarks[t]+e.tShift[t],e.line=a+1,e.tokens.push({type:"heading_open",hLevel:61===r?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(o,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===r?1:2,level:e.level}),!0))))))}},function(e,t,n){"use strict";var r=n(1027),o=/^<([a-zA-Z]{1,15})[\s\/>]/,i=/^<\/([a-zA-Z]{1,15})[\s>]/;e.exports=function(e,t,n,a){var u,s,l,c=e.bMarks[t],f=e.eMarks[t],p=e.tShift[t];if(c+=p,!e.options.html)return!1;if(p>3||c+2>=f)return!1;if(60!==e.src.charCodeAt(c))return!1;if(33===(u=e.src.charCodeAt(c+1))||63===u){if(a)return!0}else{if(47!==u&&!function(e){var t=32|e;return t>=97&&t<=122}(u))return!1;if(47===u){if(!(s=e.src.slice(c,f).match(i)))return!1}else if(!(s=e.src.slice(c,f).match(o)))return!1;if(!0!==r[s[1].toLowerCase()])return!1;if(a)return!0}for(l=t+1;l<e.lineMax&&!e.isEmpty(l);)l++;return e.line=l,e.tokens.push({type:"htmlblock",level:e.level,lines:[t,e.line],content:e.getLines(t,l,0,!0)}),!0}},function(e,t,n){"use strict";var r={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach(function(e){r[e]=!0}),e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src.substr(n,r-n)}e.exports=function(e,t,n,o){var i,a,u,s,l,c,f,p,d,h,v;if(t+2>n)return!1;if(l=t+1,e.tShift[l]<e.blkIndent)return!1;if((u=e.bMarks[l]+e.tShift[l])>=e.eMarks[l])return!1;if(124!==(i=e.src.charCodeAt(u))&&45!==i&&58!==i)return!1;if(a=r(e,t+1),!/^[-:| ]+$/.test(a))return!1;if((c=a.split("|"))<=2)return!1;for(p=[],s=0;s<c.length;s++){if(!(d=c[s].trim())){if(0===s||s===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(d))return!1;58===d.charCodeAt(d.length-1)?p.push(58===d.charCodeAt(0)?"center":"right"):58===d.charCodeAt(0)?p.push("left"):p.push("")}if(-1===(a=r(e,t).trim()).indexOf("|"))return!1;if(c=a.replace(/^\||\|$/g,"").split("|"),p.length!==c.length)return!1;if(o)return!0;for(e.tokens.push({type:"table_open",lines:h=[t,0],level:e.level++}),e.tokens.push({type:"thead_open",lines:[t,t+1],level:e.level++}),e.tokens.push({type:"tr_open",lines:[t,t+1],level:e.level++}),s=0;s<c.length;s++)e.tokens.push({type:"th_open",align:p[s],lines:[t,t+1],level:e.level++}),e.tokens.push({type:"inline",content:c[s].trim(),lines:[t,t+1],level:e.level,children:[]}),e.tokens.push({type:"th_close",level:--e.level});for(e.tokens.push({type:"tr_close",level:--e.level}),e.tokens.push({type:"thead_close",level:--e.level}),e.tokens.push({type:"tbody_open",lines:v=[t+2,0],level:e.level++}),l=t+2;l<n&&!(e.tShift[l]<e.blkIndent)&&-1!==(a=r(e,l).trim()).indexOf("|");l++){for(c=a.replace(/^\||\|$/g,"").split("|"),e.tokens.push({type:"tr_open",level:e.level++}),s=0;s<c.length;s++)e.tokens.push({type:"td_open",align:p[s],level:e.level++}),f=c[s].substring(124===c[s].charCodeAt(0)?1:0,124===c[s].charCodeAt(c[s].length-1)?c[s].length-1:c[s].length).trim(),e.tokens.push({type:"inline",content:f,level:e.level,children:[]}),e.tokens.push({type:"td_close",level:--e.level});e.tokens.push({type:"tr_close",level:--e.level})}return e.tokens.push({type:"tbody_close",level:--e.level}),e.tokens.push({type:"table_close",level:--e.level}),h[1]=v[1]=l,e.line=l,!0}},function(e,t,n){"use strict";function r(e,t){var n,r,o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return o>=i?-1:126!==(r=e.src.charCodeAt(o++))&&58!==r?-1:o===(n=e.skipSpaces(o))?-1:n>=i?-1:n}e.exports=function(e,t,n,o){var i,a,u,s,l,c,f,p,d,h,v,m,g,y;if(o)return!(e.ddIndent<0)&&r(e,t)>=0;if(f=t+1,e.isEmpty(f)&&++f>n)return!1;if(e.tShift[f]<e.blkIndent)return!1;if((i=r(e,f))<0)return!1;if(e.level>=e.options.maxNesting)return!1;c=e.tokens.length,e.tokens.push({type:"dl_open",lines:l=[t,0],level:e.level++}),u=t,a=f;e:for(;;){for(y=!0,g=!1,e.tokens.push({type:"dt_open",lines:[u,u],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(u,u+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[u,u],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:s=[f,0],level:e.level++}),m=e.tight,d=e.ddIndent,p=e.blkIndent,v=e.tShift[a],h=e.parentType,e.blkIndent=e.ddIndent=e.tShift[a]+2,e.tShift[a]=i-e.bMarks[a],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,a,n,!0),e.tight&&!g||(y=!1),g=e.line-a>1&&e.isEmpty(e.line-1),e.tShift[a]=v,e.tight=m,e.parentType=h,e.blkIndent=p,e.ddIndent=d,e.tokens.push({type:"dd_close",level:--e.level}),s[1]=f=e.line,f>=n)break e;if(e.tShift[f]<e.blkIndent)break e;if((i=r(e,f))<0)break;a=f}if(f>=n)break;if(u=f,e.isEmpty(u))break;if(e.tShift[u]<e.blkIndent)break;if((a=u+1)>=n)break;if(e.isEmpty(a)&&a++,a>=n)break;if(e.tShift[a]<e.blkIndent)break;if((i=r(e,a))<0)break}return e.tokens.push({type:"dl_close",level:--e.level}),l[1]=f,e.line=f,y&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,c),!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,u,s=t+1;if(s<(n=e.lineMax)&&!e.isEmpty(s))for(u=e.parser.ruler.getRules("paragraph");s<n&&!e.isEmpty(s);s++)if(!(e.tShift[s]-e.blkIndent>3)){for(o=!1,i=0,a=u.length;i<a;i++)if(u[i](e,s,n,!0)){o=!0;break}if(o)break}return r=e.getLines(t,s,e.blkIndent,!1).trim(),e.line=s,r.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:r,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}},function(e,t,n){"use strict";var r=n(153),o=n(236),i=n(27),a=[["text",n(1032)],["newline",n(1033)],["escape",n(1034)],["backticks",n(1035)],["del",n(1036)],["ins",n(1037)],["mark",n(1038)],["emphasis",n(1039)],["sub",n(1040)],["sup",n(1041)],["links",n(1042)],["footnote_inline",n(1043)],["footnote_ref",n(1044)],["autolink",n(1045)],["htmltag",n(1047)],["entity",n(1049)]];function u(){this.ruler=new r;for(var e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1]);this.validateLink=s}function s(e){var t=e.trim().toLowerCase();return-1===(t=i.replaceEntities(t)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(t.split(":")[0])}u.prototype.skipToken=function(e){var t,n,r=this.ruler.getRules(""),o=r.length,i=e.pos;if((n=e.cacheGet(i))>0)e.pos=n;else{for(t=0;t<o;t++)if(r[t](e,!0))return void e.cacheSet(i,e.pos);e.pos++,e.cacheSet(i,e.pos)}},u.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),o=r.length,i=e.posMax;e.pos<i;){for(n=0;n<o&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=i)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},u.prototype.parse=function(e,t,n,r){var i=new o(e,this,t,n,r);this.tokenize(i)},e.exports=u},function(e,t,n){"use strict";function r(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}e.exports=function(e,t){for(var n=e.pos;n<e.posMax&&!r(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o=e.pos;if(10!==e.src.charCodeAt(o))return!1;if(n=e.pending.length-1,r=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(var i=n-2;i>=0;i--)if(32!==e.pending.charCodeAt(i)){e.pending=e.pending.substring(0,i+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(o++;o<r&&32===e.src.charCodeAt(o);)o++;return e.pos=o,!0}},function(e,t,n){"use strict";for(var r=[],o=0;o<256;o++)r.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){r[e.charCodeAt(0)]=1}),e.exports=function(e,t){var n,o=e.pos,i=e.posMax;if(92!==e.src.charCodeAt(o))return!1;if(++o<i){if((n=e.src.charCodeAt(o))<256&&0!==r[n])return t||(e.pending+=e.src[o]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),o++;o<i&&32===e.src.charCodeAt(o);)o++;return e.pos=o,!0}}return t||(e.pending+="\\"),e.pos++,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,u=e.pos;if(96!==e.src.charCodeAt(u))return!1;for(n=u,u++,r=e.posMax;u<r&&96===e.src.charCodeAt(u);)u++;for(o=e.src.slice(n,u),i=a=u;-1!==(i=e.src.indexOf("`",a));){for(a=i+1;a<r&&96===e.src.charCodeAt(a);)a++;if(a-i===o.length)return t||e.push({type:"code",content:e.src.slice(u,i).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=a,!0}return t||(e.pending+=o),e.pos+=o.length,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,u=e.posMax,s=e.pos;if(126!==e.src.charCodeAt(s))return!1;if(t)return!1;if(s+4>=u)return!1;if(126!==e.src.charCodeAt(s+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(i=s>0?e.src.charCodeAt(s-1):-1,a=e.src.charCodeAt(s+2),126===i)return!1;if(126===a)return!1;if(32===a||10===a)return!1;for(r=s+2;r<u&&126===e.src.charCodeAt(r);)r++;if(r>s+3)return e.pos+=r-s,t||(e.pending+=e.src.slice(s,r)),!0;for(e.pos=s+2,o=1;e.pos+1<u;){if(126===e.src.charCodeAt(e.pos)&&126===e.src.charCodeAt(e.pos+1)&&(i=e.src.charCodeAt(e.pos-1),126!==(a=e.pos+2<u?e.src.charCodeAt(e.pos+2):-1)&&126!==i&&(32!==i&&10!==i?o--:32!==a&&10!==a&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=s+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=u,!0):(e.pos=s,!1)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,u=e.posMax,s=e.pos;if(43!==e.src.charCodeAt(s))return!1;if(t)return!1;if(s+4>=u)return!1;if(43!==e.src.charCodeAt(s+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(i=s>0?e.src.charCodeAt(s-1):-1,a=e.src.charCodeAt(s+2),43===i)return!1;if(43===a)return!1;if(32===a||10===a)return!1;for(r=s+2;r<u&&43===e.src.charCodeAt(r);)r++;if(r!==s+2)return e.pos+=r-s,t||(e.pending+=e.src.slice(s,r)),!0;for(e.pos=s+2,o=1;e.pos+1<u;){if(43===e.src.charCodeAt(e.pos)&&43===e.src.charCodeAt(e.pos+1)&&(i=e.src.charCodeAt(e.pos-1),43!==(a=e.pos+2<u?e.src.charCodeAt(e.pos+2):-1)&&43!==i&&(32!==i&&10!==i?o--:32!==a&&10!==a&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=s+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=u,!0):(e.pos=s,!1)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,u=e.posMax,s=e.pos;if(61!==e.src.charCodeAt(s))return!1;if(t)return!1;if(s+4>=u)return!1;if(61!==e.src.charCodeAt(s+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(i=s>0?e.src.charCodeAt(s-1):-1,a=e.src.charCodeAt(s+2),61===i)return!1;if(61===a)return!1;if(32===a||10===a)return!1;for(r=s+2;r<u&&61===e.src.charCodeAt(r);)r++;if(r!==s+2)return e.pos+=r-s,t||(e.pending+=e.src.slice(s,r)),!0;for(e.pos=s+2,o=1;e.pos+1<u;){if(61===e.src.charCodeAt(e.pos)&&61===e.src.charCodeAt(e.pos+1)&&(i=e.src.charCodeAt(e.pos-1),61!==(a=e.pos+2<u?e.src.charCodeAt(e.pos+2):-1)&&61!==i&&(32!==i&&10!==i?o--:32!==a&&10!==a&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=s+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=u,!0):(e.pos=s,!1)}},function(e,t,n){"use strict";function r(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function o(e,t){var n,o,i,a=t,u=!0,s=!0,l=e.posMax,c=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;a<l&&e.src.charCodeAt(a)===c;)a++;return a>=l&&(u=!1),(i=a-t)>=4?u=s=!1:(32!==(o=a<l?e.src.charCodeAt(a):-1)&&10!==o||(u=!1),32!==n&&10!==n||(s=!1),95===c&&(r(n)&&(u=!1),r(o)&&(s=!1))),{can_open:u,can_close:s,delims:i}}e.exports=function(e,t){var n,r,i,a,u,s,l,c=e.posMax,f=e.pos,p=e.src.charCodeAt(f);if(95!==p&&42!==p)return!1;if(t)return!1;if(n=(l=o(e,f)).delims,!l.can_open)return e.pos+=n,t||(e.pending+=e.src.slice(f,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=f+n,s=[n];e.pos<c;)if(e.src.charCodeAt(e.pos)!==p)e.parser.skipToken(e);else{if(r=(l=o(e,e.pos)).delims,l.can_close){for(a=s.pop(),u=r;a!==u;){if(u<a){s.push(a-u);break}if(u-=a,0===s.length)break;e.pos+=a,a=s.pop()}if(0===s.length){n=a,i=!0;break}e.pos+=r;continue}l.can_open&&s.push(r),e.pos+=r}return i?(e.posMax=e.pos,e.pos=f+n,t||(2!==n&&3!==n||e.push({type:"strong_open",level:e.level++}),1!==n&&3!==n||e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),1!==n&&3!==n||e.push({type:"em_close",level:--e.level}),2!==n&&3!==n||e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+n,e.posMax=c,!0):(e.pos=f,!1)}},function(e,t,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;e.exports=function(e,t){var n,o,i=e.posMax,a=e.pos;if(126!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=i)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<i;){if(126===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(o=e.src.slice(a+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sub",level:e.level,content:o.replace(r,"$1")}),e.pos=e.posMax+1,e.posMax=i,!0):(e.pos=a,!1)}},function(e,t,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;e.exports=function(e,t){var n,o,i=e.posMax,a=e.pos;if(94!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=i)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<i;){if(94===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(o=e.src.slice(a+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sup",level:e.level,content:o.replace(r,"$1")}),e.pos=e.posMax+1,e.posMax=i,!0):(e.pos=a,!1)}},function(e,t,n){"use strict";var r=n(154),o=n(418),i=n(420),a=n(421);e.exports=function(e,t){var n,u,s,l,c,f,p,d,h=!1,v=e.pos,m=e.posMax,g=e.pos,y=e.src.charCodeAt(g);if(33===y&&(h=!0,y=e.src.charCodeAt(++g)),91!==y)return!1;if(e.level>=e.options.maxNesting)return!1;if(n=g+1,(u=r(e,g))<0)return!1;if((f=u+1)<m&&40===e.src.charCodeAt(f)){for(f++;f<m&&(32===(d=e.src.charCodeAt(f))||10===d);f++);if(f>=m)return!1;for(g=f,o(e,f)?(l=e.linkContent,f=e.pos):l="",g=f;f<m&&(32===(d=e.src.charCodeAt(f))||10===d);f++);if(f<m&&g!==f&&i(e,f))for(c=e.linkContent,f=e.pos;f<m&&(32===(d=e.src.charCodeAt(f))||10===d);f++);else c="";if(f>=m||41!==e.src.charCodeAt(f))return e.pos=v,!1;f++}else{if(e.linkLevel>0)return!1;for(;f<m&&(32===(d=e.src.charCodeAt(f))||10===d);f++);if(f<m&&91===e.src.charCodeAt(f)&&(g=f+1,(f=r(e,f))>=0?s=e.src.slice(g,f++):f=g-1),s||(void 0===s&&(f=u+1),s=e.src.slice(n,u)),!(p=e.env.references[a(s)]))return e.pos=v,!1;l=p.href,c=p.title}return t||(e.pos=n,e.posMax=u,h?e.push({type:"image",src:l,title:c,alt:e.src.substr(n,u-n),level:e.level}):(e.push({type:"link_open",href:l,title:c,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=f,e.posMax=m,!0}},function(e,t,n){"use strict";var r=n(154);e.exports=function(e,t){var n,o,i,a,u=e.posMax,s=e.pos;return!(s+2>=u)&&(94===e.src.charCodeAt(s)&&(91===e.src.charCodeAt(s+1)&&(!(e.level>=e.options.maxNesting)&&(n=s+2,!((o=r(e,s+1))<0)&&(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),i=e.env.footnotes.list.length,e.pos=n,e.posMax=o,e.push({type:"footnote_ref",id:i,level:e.level}),e.linkLevel++,a=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[i]={tokens:e.tokens.splice(a)},e.linkLevel--),e.pos=o+1,e.posMax=u,!0)))))}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a=e.posMax,u=e.pos;if(u+3>a)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(u))return!1;if(94!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(r=u+2;r<a;r++){if(32===e.src.charCodeAt(r))return!1;if(10===e.src.charCodeAt(r))return!1;if(93===e.src.charCodeAt(r))break}return r!==u+2&&(!(r>=a)&&(r++,n=e.src.slice(u+2,r-1),void 0!==e.env.footnotes.refs[":"+n]&&(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+n]<0?(o=e.env.footnotes.list.length,e.env.footnotes.list[o]={label:n,count:0},e.env.footnotes.refs[":"+n]=o):o=e.env.footnotes.refs[":"+n],i=e.env.footnotes.list[o].count,e.env.footnotes.list[o].count++,e.push({type:"footnote_ref",id:o,subId:i,level:e.level})),e.pos=r,e.posMax=a,!0)))}},function(e,t,n){"use strict";var r=n(1046),o=n(419),i=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,a=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;e.exports=function(e,t){var n,u,s,l,c,f=e.pos;return 60===e.src.charCodeAt(f)&&(!((n=e.src.slice(f)).indexOf(">")<0)&&((u=n.match(a))?!(r.indexOf(u[1].toLowerCase())<0)&&(l=u[0].slice(1,-1),c=o(l),!!e.parser.validateLink(l)&&(t||(e.push({type:"link_open",href:c,level:e.level}),e.push({type:"text",content:l,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=u[0].length,!0)):!!(s=n.match(i))&&(l=s[0].slice(1,-1),c=o("mailto:"+l),!!e.parser.validateLink(c)&&(t||(e.push({type:"link_open",href:c,level:e.level}),e.push({type:"text",content:l,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=s[0].length,!0))))}},function(e,t,n){"use strict";e.exports=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"]},function(e,t,n){"use strict";var r=n(1048).HTML_TAG_RE;e.exports=function(e,t){var n,o,i,a=e.pos;return!!e.options.html&&(i=e.posMax,!(60!==e.src.charCodeAt(a)||a+2>=i)&&(!(33!==(n=e.src.charCodeAt(a+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n))&&(!!(o=e.src.slice(a).match(r))&&(t||e.push({type:"htmltag",content:e.src.slice(a,a+o[0].length),level:e.level}),e.pos+=o[0].length,!0))))}},function(e,t,n){"use strict";function r(e,t){return e=e.source,t=t||"",function n(r,o){return r?(o=o.source||o,e=e.replace(r,o),n):new RegExp(e,t)}}var o=r(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),i=r(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",o)(),a=r(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",i)(),u=r(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",a)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!--([^-]+|[-][^-]+)*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[([^\]]+|\][^\]]|\]\][^>])*\]\]>/)();e.exports.HTML_TAG_RE=u},function(e,t,n){"use strict";var r=n(417),o=n(27).has,i=n(27).isValidEntityCode,a=n(27).fromCodePoint,u=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,s=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var n,l,c=e.pos,f=e.posMax;if(38!==e.src.charCodeAt(c))return!1;if(c+1<f)if(35===e.src.charCodeAt(c+1)){if(l=e.src.slice(c).match(u))return t||(n="x"===l[1][0].toLowerCase()?parseInt(l[1].slice(1),16):parseInt(l[1],10),e.pending+=i(n)?a(n):a(65533)),e.pos+=l[0].length,!0}else if((l=e.src.slice(c).match(s))&&o(r,l[1]))return t||(e.pending+=r[l[1]]),e.pos+=l[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","linkify","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}}},function(e,t,n){"use strict";e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}},function(e,t,n){var r;r=function(){"use strict";var e=["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"],t=["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"],n=["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"],r=["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmuliscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mpspace","msqrt","mystyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"],o=["#text"],i=["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","coords","crossorigin","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","integrity","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns"],a=["accent-height","accumulate","additivive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"],u=["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"],s=["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"];function l(e,t){for(var n=t.length;n--;)"string"==typeof t[n]&&(t[n]=t[n].toLowerCase()),e[t[n]]=!0;return e}function c(e){var t={},n=void 0;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}var f=/\{\{[\s\S]*|[\s\S]*\}\}/gm,p=/<%[\s\S]*|[\s\S]*%>/gm,d=/^data-[\-\w.\u00B7-\uFFFF]/,h=/^aria-[\-\w]+$/,v=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,m=/^(?:\w+script|data):/i,g=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function b(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var _=function(){return"undefined"==typeof window?null:window};return function w(){var E=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_(),x=function(e){return w(e)};if(x.version="1.0.4",x.removed=[],!E||!E.document||9!==E.document.nodeType)return x.isSupported=!1,x;var S=E.document,C=!1,k=!1,A=E.document,O=E.DocumentFragment,P=E.HTMLTemplateElement,T=E.Node,M=E.NodeFilter,I=E.NamedNodeMap,j=void 0===I?E.NamedNodeMap||E.MozNamedAttrMap:I,N=E.Text,R=E.Comment,D=E.DOMParser,L=E.XMLHttpRequest,U=void 0===L?E.XMLHttpRequest:L,q=E.encodeURI,F=void 0===q?E.encodeURI:q;if("function"==typeof P){var z=A.createElement("template");z.content&&z.content.ownerDocument&&(A=z.content.ownerDocument)}var B=A,V=B.implementation,H=B.createNodeIterator,W=B.getElementsByTagName,J=B.createDocumentFragment,Y=S.importNode,K={};x.isSupported=V&&void 0!==V.createHTMLDocument&&9!==A.documentMode;var G=f,$=p,Z=d,X=h,Q=m,ee=g,te=v,ne=null,re=l({},[].concat(b(e),b(t),b(n),b(r),b(o))),oe=null,ie=l({},[].concat(b(i),b(a),b(u),b(s))),ae=null,ue=null,se=!0,le=!0,ce=!1,fe=!1,pe=!1,de=!1,he=!1,ve=!1,me=!1,ge=!1,ye=!1,be=!0,_e=!0,we={},Ee=l({},["audio","head","math","script","style","template","svg","video"]),xe=l({},["audio","video","img","source","image"]),Se=l({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Ce=null,ke=A.createElement("form"),Ae=function(f){"object"!==(void 0===f?"undefined":y(f))&&(f={}),ne="ALLOWED_TAGS"in f?l({},f.ALLOWED_TAGS):re,oe="ALLOWED_ATTR"in f?l({},f.ALLOWED_ATTR):ie,ae="FORBID_TAGS"in f?l({},f.FORBID_TAGS):{},ue="FORBID_ATTR"in f?l({},f.FORBID_ATTR):{},we="USE_PROFILES"in f&&f.USE_PROFILES,se=!1!==f.ALLOW_ARIA_ATTR,le=!1!==f.ALLOW_DATA_ATTR,ce=f.ALLOW_UNKNOWN_PROTOCOLS||!1,fe=f.SAFE_FOR_JQUERY||!1,pe=f.SAFE_FOR_TEMPLATES||!1,de=f.WHOLE_DOCUMENT||!1,me=f.RETURN_DOM||!1,ge=f.RETURN_DOM_FRAGMENT||!1,ye=f.RETURN_DOM_IMPORT||!1,ve=f.FORCE_BODY||!1,be=!1!==f.SANITIZE_DOM,_e=!1!==f.KEEP_CONTENT,te=f.ALLOWED_URI_REGEXP||te,pe&&(le=!1),ge&&(me=!0),we&&(ne=l({},[].concat(b(o))),oe=[],!0===we.html&&(l(ne,e),l(oe,i)),!0===we.svg&&(l(ne,t),l(oe,a),l(oe,s)),!0===we.svgFilters&&(l(ne,n),l(oe,a),l(oe,s)),!0===we.mathMl&&(l(ne,r),l(oe,u),l(oe,s))),f.ADD_TAGS&&(ne===re&&(ne=c(ne)),l(ne,f.ADD_TAGS)),f.ADD_ATTR&&(oe===ie&&(oe=c(oe)),l(oe,f.ADD_ATTR)),f.ADD_URI_SAFE_ATTR&&l(Se,f.ADD_URI_SAFE_ATTR),_e&&(ne["#text"]=!0),Object&&"freeze"in Object&&Object.freeze(f),Ce=f},Oe=function(e){x.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=""}},Pe=function(e,t){try{x.removed.push({attribute:t.getAttributeNode(e),from:t})}catch(e){x.removed.push({attribute:null,from:t})}t.removeAttribute(e)},Te=function(e){var t=void 0,n=void 0;if(ve&&(e="<remove></remove>"+e),k){try{e=F(e)}catch(e){}var r=new U;r.responseType="document",r.open("GET","data:text/html;charset=utf-8,"+e,!1),r.send(null),t=r.response}if(C)try{t=(new D).parseFromString(e,"text/html")}catch(e){}return t&&t.documentElement||((n=(t=V.createHTMLDocument("")).body).parentNode.removeChild(n.parentNode.firstElementChild),n.outerHTML=e),W.call(t,de?"html":"body")[0]};x.isSupported&&function(){var e=Te('<svg><g onload="this.parentNode.remove()"></g></svg>');e.querySelector("svg")||(k=!0);try{(e=Te('<svg><p><style><img src="</style><img src=x onerror=alert(1)//">')).querySelector("svg img")&&(C=!0)}catch(e){}}();var Me=function(e){return H.call(e.ownerDocument||e,e,M.SHOW_ELEMENT|M.SHOW_COMMENT|M.SHOW_TEXT,function(){return M.FILTER_ACCEPT},!1)},Ie=function(e){return"object"===(void 0===T?"undefined":y(T))?e instanceof T:e&&"object"===(void 0===e?"undefined":y(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},je=function(e,t,n){K[e]&&K[e].forEach(function(e){e.call(x,t,n,Ce)})},Ne=function(e){var t,n=void 0;if(je("beforeSanitizeElements",e,null),!((t=e)instanceof N||t instanceof R||"string"==typeof t.nodeName&&"string"==typeof t.textContent&&"function"==typeof t.removeChild&&t.attributes instanceof j&&"function"==typeof t.removeAttribute&&"function"==typeof t.setAttribute))return Oe(e),!0;var r=e.nodeName.toLowerCase();if(je("uponSanitizeElement",e,{tagName:r,allowedTags:ne}),!ne[r]||ae[r]){if(_e&&!Ee[r]&&"function"==typeof e.insertAdjacentHTML)try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(e){}return Oe(e),!0}return!fe||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(x.removed.push({element:e.cloneNode()}),e.innerHTML=e.textContent.replace(/</g,"<")),pe&&3===e.nodeType&&(n=(n=(n=e.textContent).replace(G," ")).replace($," "),e.textContent!==n&&(x.removed.push({element:e.cloneNode()}),e.textContent=n)),je("afterSanitizeElements",e,null),!1},Re=function(e){var t=void 0,n=void 0,r=void 0,o=void 0,i=void 0,a=void 0,u=void 0;if(je("beforeSanitizeAttributes",e,null),a=e.attributes){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe};for(u=a.length;u--;){if(n=(t=a[u]).name,r=t.value.trim(),o=n.toLowerCase(),s.attrName=o,s.attrValue=r,s.keepAttr=!0,je("uponSanitizeAttribute",e,s),r=s.attrValue,"name"===o&&"IMG"===e.nodeName&&a.id)i=a.id,a=Array.prototype.slice.apply(a),Pe("id",e),Pe(n,e),a.indexOf(i)>u&&e.setAttribute("id",i.value);else{if("INPUT"===e.nodeName&&"type"===o&&"file"===r&&(oe[o]||!ue[o]))continue;"id"===n&&e.setAttribute(n,""),Pe(n,e)}if(s.keepAttr&&(!be||"id"!==o&&"name"!==o||!(r in A||r in ke))){if(pe&&(r=(r=r.replace(G," ")).replace($," ")),le&&Z.test(o));else if(se&&X.test(o));else{if(!oe[o]||ue[o])continue;if(Se[o]);else if(te.test(r.replace(ee,"")));else if("src"!==o&&"xlink:href"!==o||0!==r.indexOf("data:")||!xe[e.nodeName.toLowerCase()])if(ce&&!Q.test(r.replace(ee,"")));else if(r)continue}try{e.setAttribute(n,r),x.removed.pop()}catch(e){}}}je("afterSanitizeAttributes",e,null)}},De=function e(t){var n=void 0,r=Me(t);for(je("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)je("uponSanitizeShadowNode",n,null),Ne(n)||(n.content instanceof O&&e(n.content),Re(n));je("afterSanitizeShadowDOM",t,null)};return x.sanitize=function(e,t){var n=void 0,r=void 0,o=void 0,i=void 0,a=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!Ie(e)){if("function"!=typeof e.toString)throw new TypeError("toString is not a function");if("string"!=typeof(e=e.toString()))throw new TypeError("dirty is not a string, aborting")}if(!x.isSupported){if("object"===y(E.toStaticHTML)||"function"==typeof E.toStaticHTML){if("string"==typeof e)return E.toStaticHTML(e);if(Ie(e))return E.toStaticHTML(e.outerHTML)}return e}if(he||Ae(t),x.removed=[],e instanceof T)1===(r=(n=Te("\x3c!--\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===r.nodeName?n=r:n.appendChild(r);else{if(!me&&!de&&-1===e.indexOf("<"))return e;if(!(n=Te(e)))return me?null:""}ve&&Oe(n.firstChild);for(var u=Me(n);o=u.nextNode();)3===o.nodeType&&o===i||Ne(o)||(o.content instanceof O&&De(o.content),Re(o),i=o);if(me){if(ge)for(a=J.call(n.ownerDocument);n.firstChild;)a.appendChild(n.firstChild);else a=n;return ye&&(a=Y.call(S,a,!0)),a}return de?n.outerHTML:n.innerHTML},x.setConfig=function(e){Ae(e),he=!0},x.clearConfig=function(){Ce=null,he=!1},x.addHook=function(e,t){"function"==typeof t&&(K[e]=K[e]||[],K[e].push(t))},x.removeHook=function(e){K[e]&&K[e].pop()},x.removeHooks=function(e){K[e]&&(K[e]=[])},x.removeAllHooks=function(){K={}},x}()},e.exports=r()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(4)),o=l(n(2)),i=l(n(3)),a=l(n(5)),u=l(n(6)),s=l(n(0));l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||(0,r.default)(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=n("SvgAssets"),o=n("InfoContainer",!0),i=n("VersionPragmaFilter"),a=n("operations",!0),u=n("Models",!0),l=n("Row"),c=n("Col"),f=n("errors",!0),p=n("ServersContainer",!0),d=n("SchemesContainer",!0),h=n("AuthorizeBtnContainer",!0),v=n("FilterContainer",!0),m=t.isSwagger2(),g=t.isOAS3();if(!t.specStr()){var y=void 0;return y="loading"===t.loadingStatus()?s.default.createElement("div",{className:"loading"}):s.default.createElement("h4",null,"No API definition provided."),s.default.createElement("div",{className:"swagger-ui"},s.default.createElement("div",{className:"loading-container"},y))}var b=t.servers(),_=t.schemes(),w=b&&b.size,E=_&&_.size,x=!!t.securityDefinitions();return s.default.createElement("div",{className:"swagger-ui"},s.default.createElement(r,null),s.default.createElement(i,{isSwagger2:m,isOAS3:g,alsoShow:s.default.createElement(f,null)},s.default.createElement(f,null),s.default.createElement(l,{className:"information-container"},s.default.createElement(c,{mobile:12},s.default.createElement(o,null))),w||E||x?s.default.createElement("div",{className:"scheme-container"},s.default.createElement(c,{className:"schemes wrapper",mobile:12},w?s.default.createElement(p,null):null,E?s.default.createElement(d,null):null,x?s.default.createElement(h,null):null)):null,s.default.createElement(v,null),s.default.createElement(l,null,s.default.createElement(c,{mobile:12,desktop:12},s.default.createElement(a,null))),s.default.createElement(l,null,s.default.createElement(c,{mobile:12,desktop:12},s.default.createElement(u,null)))))}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonSchema_object=t.JsonSchema_boolean=t.JsonSchema_array=t.JsonSchema_string=t.JsonSchemaForm=void 0;var r=y(n(23)),o=y(n(25)),i=y(n(4)),a=y(n(2)),u=y(n(3)),s=y(n(5)),l=y(n(6)),c=n(0),f=y(c),p=y(n(1)),d=n(7),h=y(n(113)),v=y(n(12)),m=y(n(1056)),g=n(9);function y(e){return e&&e.__esModule?e:{default:e}}p.default.func.isRequired,p.default.any,p.default.func,p.default.any,p.default.object.isRequired,p.default.object,v.default.list,p.default.bool,p.default.bool,p.default.any;var b={value:"",onChange:function(){},schema:{},keyName:"",required:!1,errors:(0,d.List)()};function _(e){return d.List.isList(e)?e:(0,d.List)()}(t.JsonSchemaForm=function(e){function t(){return(0,a.default)(this,t),(0,s.default)(this,(t.__proto__||(0,i.default)(t)).apply(this,arguments))}return(0,l.default)(t,e),(0,u.default)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.dispatchInitialValue,n=e.value,r=e.onChange;t&&r(n)}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.errors,r=e.value,i=e.onChange,a=e.getComponent,u=e.fn;t.toJS&&(t=t.toJS());var s=t,l=s.type,c=s.format,p=void 0===c?"":c,d=a(p?"JsonSchema_"+l+"_"+p:"JsonSchema_"+l)||a("JsonSchema_string");return f.default.createElement(d,(0,o.default)({},this.props,{errors:n,fn:u,getComponent:a,value:r,onChange:i,schema:t}))}}]),t}(c.Component)).defaultProps=b,(t.JsonSchema_string=function(e){function t(){var e,n,r,o;(0,a.default)(this,t);for(var u=arguments.length,l=Array(u),c=0;c<u;c++)l[c]=arguments[c];return n=r=(0,s.default)(this,(e=t.__proto__||(0,i.default)(t)).call.apply(e,[this].concat(l))),r.onChange=function(e){var t="file"===r.props.schema.type?e.target.files[0]:e.target.value;r.props.onChange(t,r.props.keyName)},r.onEnumChange=function(e){return r.props.onChange(e)},o=n,(0,s.default)(r,o)}return(0,l.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.schema,o=e.errors,i=e.required,a=e.description,u=r.enum;if(o=o.toJS?o.toJS():[],u){var s=t("Select");return f.default.createElement(s,{className:o.length?"invalid":"",title:o.length?o:"",allowedValues:u,value:n,allowEmptyValue:!i,onChange:this.onEnumChange})}var l="formData"===r.in&&!("FormData"in window),c=t("Input");return"file"===r.type?f.default.createElement(c,{type:"file",className:o.length?"invalid":"",title:o.length?o:"",onChange:this.onChange,disabled:l}):f.default.createElement(m.default,{type:"password"===r.format?"password":"text",className:o.length?"invalid":"",title:o.length?o:"",value:n,minLength:0,debounceTimeout:350,placeholder:a,onChange:this.onChange,disabled:l})}}]),t}(c.Component)).defaultProps=b,(t.JsonSchema_array=function(e){function t(e,n){(0,a.default)(this,t);var r=(0,s.default)(this,(t.__proto__||(0,i.default)(t)).call(this,e,n));return r.onChange=function(){return r.props.onChange(r.state.value)},r.onItemChange=function(e,t){r.setState(function(n){return{value:n.value.set(t,e)}},r.onChange)},r.removeItem=function(e){r.setState(function(t){return{value:t.value.remove(e)}},r.onChange)},r.addItem=function(){r.setState(function(e){return e.value=_(e.value),{value:e.value.push("")}},r.onChange)},r.onEnumChange=function(e){r.setState(function(){return{value:e}},r.onChange)},r.state={value:_(e.value)},r}return(0,l.default)(t,e),(0,u.default)(t,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this.setState({value:e.value})}},{key:"render",value:function(){var e=this,t=this.props,n=t.getComponent,o=t.required,i=t.schema,a=t.errors,u=t.fn;a=a.toJS?a.toJS():[];var s=u.inferSchema(i.items),l=n("JsonSchemaForm"),c=n("Button"),p=s.enum,d=this.state.value;if(p){var h=n("Select");return f.default.createElement(h,{className:a.length?"invalid":"",title:a.length?a:"",multiple:!0,value:d,allowedValues:p,allowEmptyValue:!o,onChange:this.onEnumChange})}return f.default.createElement("div",null,!d||!d.count||d.count()<1?null:d.map(function(t,o){var i=(0,r.default)({},s);if(a.length){var p=a.filter(function(e){return e.index===o});p.length&&(a=[p[0].error+o])}return f.default.createElement("div",{key:o,className:"json-schema-form-item"},f.default.createElement(l,{fn:u,getComponent:n,value:t,onChange:function(t){return e.onItemChange(t,o)},schema:i}),f.default.createElement(c,{className:"btn btn-sm json-schema-form-item-remove",onClick:function(){return e.removeItem(o)}}," - "))}).toArray(),f.default.createElement(c,{className:"btn btn-sm json-schema-form-item-add "+(a.length?"invalid":null),onClick:this.addItem}," Add item "))}}]),t}(c.PureComponent)).defaultProps=b,(t.JsonSchema_boolean=function(e){function t(){var e,n,r,o;(0,a.default)(this,t);for(var u=arguments.length,l=Array(u),c=0;c<u;c++)l[c]=arguments[c];return n=r=(0,s.default)(this,(e=t.__proto__||(0,i.default)(t)).call.apply(e,[this].concat(l))),r.onEnumChange=function(e){return r.props.onChange(e)},o=n,(0,s.default)(r,o)}return(0,l.default)(t,e),(0,u.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.errors,o=e.schema,i=e.required;r=r.toJS?r.toJS():[];var a=t("Select");return f.default.createElement(a,{className:r.length?"invalid":"",title:r.length?r:"",value:String(n),allowedValues:(0,d.fromJS)(o.enum||["true","false"]),allowEmptyValue:!o.enum||!i,onChange:this.onEnumChange})}}]),t}(c.Component)).defaultProps=b,(t.JsonSchema_object=function(e){function t(){(0,a.default)(this,t);var e=(0,s.default)(this,(t.__proto__||(0,i.default)(t)).call(this));return e.resetValueToSample=function(){e.onChange((0,g.getSampleSchema)(e.props.schema))},e.onChange=function(t){e.props.onChange(t)},e.handleOnChange=function(t){var n=t.target.value;e.onChange(n)},e}return(0,l.default)(t,e),(0,u.default)(t,[{key:"componentDidMount",value:function(){!this.props.value&&this.props.schema&&this.resetValueToSample()}},{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.errors,o=t("TextArea");return f.default.createElement("div",null,f.default.createElement(o,{className:(0,h.default)({invalid:r.size}),title:r.size?r.join(", "):"",value:n,onChange:this.handleOnChange}))}}]),t}(c.PureComponent)).defaultProps=b},function(e,t,n){"use strict";var r=n(1057).DebounceInput;r.DebounceInput=r,e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebounceInput=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=u(n(0)),a=u(n(1058));function u(e){return e&&e.__esModule?e:{default:e}}(t.DebounceInput=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){e.persist();var t=n.state.value;n.setState({value:e.target.value},function(){var o=n.state.value;o.length>=n.props.minLength?n.notify(e):t.length>o.length&&n.notify(r({},e,{target:r({},e.target,{value:""})}))})},n.onKeyDown=function(e){var t=n.props.onKeyDown;"Enter"===e.key&&n.forceNotify(e),t&&t(e)},n.onBlur=function(e){var t=n.props.onBlur;n.forceNotify(e),t&&t(e)},n.createNotifier=function(e){if(e<0)n.notify=function(){return null};else if(0===e)n.notify=n.doNotify;else{var t=(0,a.default)(function(e){n.isDebouncing=!1,n.doNotify(e)},e);n.notify=function(e){n.isDebouncing=!0,t(e)},n.flush=function(){return t.flush()},n.cancel=function(){n.isDebouncing=!1,t.cancel()}}},n.doNotify=function(){n.props.onChange.apply(void 0,arguments)},n.forceNotify=function(e){if(n.isDebouncing){n.cancel&&n.cancel();var t=n.state.value,o=n.props.minLength;t.length>=o?n.doNotify(e):n.doNotify(r({},e,{target:r({},e.target,{value:t})}))}},n.state={value:e.value||""},n.isDebouncing=!1,n}return 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)}(t,i.default.PureComponent),o(t,[{key:"componentWillMount",value:function(){this.createNotifier(this.props.debounceTimeout)}},{key:"componentWillReceiveProps",value:function(e){var t=e.value,n=e.debounceTimeout;this.isDebouncing||(void 0!==t&&this.state.value!==t&&this.setState({value:t}),n!==this.props.debounceTimeout&&this.createNotifier(n))}},{key:"componentWillUnmount",value:function(){this.flush&&this.flush()}},{key:"render",value:function(){var e=this.props,t=e.element,n=(e.onChange,e.value,e.minLength,e.debounceTimeout,e.forceNotifyByEnter),o=e.forceNotifyOnBlur,a=e.onKeyDown,u=e.onBlur,s=e.inputRef,l=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["element","onChange","value","minLength","debounceTimeout","forceNotifyByEnter","forceNotifyOnBlur","onKeyDown","onBlur","inputRef"]),c=void 0;c=n?{onKeyDown:this.onKeyDown}:a?{onKeyDown:a}:{};var f=void 0;f=o?{onBlur:this.onBlur}:u?{onBlur:u}:{};var p=s?{ref:s}:{};return i.default.createElement(t,r({},l,{onChange:this.onChange,value:this.state.value},c,f,p))}}]),t}()).defaultProps={element:"input",type:"text",onKeyDown:void 0,onBlur:void 0,value:void 0,minLength:0,debounceTimeout:100,forceNotifyByEnter:!0,forceNotifyOnBlur:!0,inputRef:void 0}},function(e,t,n){(function(t){var n="Expected a function",r=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof t&&t&&t.Object===Object&&t,f="object"==typeof self&&self&&self.Object===Object&&self,p=c||f||Function("return this")(),d=Object.prototype.toString,h=Math.max,v=Math.min,m=function(){return p.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&d.call(e)==o}(e))return r;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=u.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):a.test(e)?r:+e}e.exports=function(e,t,r){var o,i,a,u,s,l,c=0,f=!1,p=!1,d=!0;if("function"!=typeof e)throw new TypeError(n);function b(t){var n=o,r=i;return o=i=void 0,c=t,u=e.apply(r,n)}function _(e){var n=e-l;return void 0===l||n>=t||n<0||p&&e-c>=a}function w(){var e=m();if(_(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-l);return p?v(n,a-(e-c)):n}(e))}function E(e){return s=void 0,d&&o?b(e):(o=i=void 0,u)}function x(){var e=m(),n=_(e);if(o=arguments,i=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(w,t),f?b(e):u}(l);if(p)return s=setTimeout(w,t),b(l)}return void 0===s&&(s=setTimeout(w,t)),u}return t=y(t)||0,g(r)&&(f=!!r.leading,a=(p="maxWait"in r)?h(y(r.maxWait)||0,t):a,d="trailing"in r?!!r.trailing:d),x.cancel=function(){void 0!==s&&clearTimeout(s),c=0,o=l=i=s=void 0},x.flush=function(){return void 0===s?u:E(m())},x}}).call(t,n(31))},function(e,t,n){var r={"./all.js":445,"./auth/actions.js":233,"./auth/index.js":394,"./auth/reducers.js":395,"./auth/selectors.js":396,"./auth/spec-wrap-actions.js":397,"./configs/actions.js":235,"./configs/helpers.js":234,"./configs/index.js":400,"./configs/reducers.js":403,"./configs/selectors.js":402,"./configs/spec-actions.js":401,"./deep-linking/helpers.js":406,"./deep-linking/index.js":404,"./deep-linking/layout.js":405,"./deep-linking/operation-tag-wrapper.jsx":408,"./deep-linking/operation-wrapper.jsx":407,"./download-url.js":399,"./err/actions.js":127,"./err/error-transformers/hook.js":322,"./err/error-transformers/transformers/not-of-type.js":323,"./err/error-transformers/transformers/parameter-oneof.js":324,"./err/error-transformers/transformers/strip-instance.js":325,"./err/index.js":320,"./err/reducers.js":321,"./err/selectors.js":326,"./filter/index.js":409,"./filter/opsFilter.js":410,"./layout/actions.js":202,"./layout/index.js":327,"./layout/reducers.js":328,"./layout/selectors.js":329,"./logs/index.js":386,"./oas3/actions.js":237,"./oas3/auth-extensions/wrap-selectors.js":424,"./oas3/components/callbacks.jsx":427,"./oas3/components/http-auth.jsx":433,"./oas3/components/index.js":426,"./oas3/components/operation-link.jsx":429,"./oas3/components/operation-servers.jsx":434,"./oas3/components/request-body-editor.jsx":432,"./oas3/components/request-body.jsx":428,"./oas3/components/servers-container.jsx":431,"./oas3/components/servers.jsx":430,"./oas3/helpers.jsx":35,"./oas3/index.js":422,"./oas3/reducers.js":444,"./oas3/selectors.js":443,"./oas3/spec-extensions/selectors.js":425,"./oas3/spec-extensions/wrap-selectors.js":423,"./oas3/wrap-components/auth-item.jsx":437,"./oas3/wrap-components/index.js":435,"./oas3/wrap-components/json-schema-string.jsx":442,"./oas3/wrap-components/markdown.jsx":436,"./oas3/wrap-components/model.jsx":441,"./oas3/wrap-components/online-validator-badge.js":440,"./oas3/wrap-components/parameters.jsx":438,"./oas3/wrap-components/version-stamp.jsx":439,"./on-complete/index.js":411,"./samples/fn.js":194,"./samples/index.js":385,"./spec/actions.js":203,"./spec/index.js":333,"./spec/reducers.js":334,"./spec/selectors.js":144,"./spec/wrap-actions.js":347,"./swagger-js/index.js":387,"./util/index.js":398,"./view/index.js":348,"./view/root-injects.jsx":349};function o(e){return n(i(e))}function i(e){var t=r[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=1059}])});
//# sourceMappingURL=swagger-ui-bundle.js.map |
packages/react/src/inputs/Input.js | wq/wq.app | import React from 'react';
import { Field, ErrorMessage } from 'formik';
import PropTypes from 'prop-types';
const HTML5_INPUT_TYPES = {
// Map XForm field types to <input type>
barcode: false,
file: 'file',
binary: 'file', // wq.db <1.3
date: 'date',
dateTime: 'datetime-local',
decimal: 'number',
geopoint: false,
geoshape: false,
geotrace: false,
int: 'number',
select: false,
select1: false,
string: 'text',
time: 'time',
// String subtypes
password: 'password',
email: 'email',
phone: 'tel',
text: false,
note: false
};
export function useHtmlInput({ name, type, ['wq:length']: length }) {
return {
name,
type: HTML5_INPUT_TYPES[type] || 'text',
maxLength: length && +length
};
}
export default function Input(props) {
const inputProps = useHtmlInput(props),
{ name, label } = props;
return (
<div style={{ marginBottom: '0.5em' }}>
<div style={{ display: 'flex' }}>
<label htmlFor={name} style={{ width: '25%' }}>
{label}
</label>
<Field style={{ flex: 1 }} {...inputProps} />
</div>
<ErrorMessage name={name} />
</div>
);
}
Input.propTypes = {
name: PropTypes.string,
type: PropTypes.string,
label: PropTypes.string
};
|
ceephax/components/navigation/index.js | mrceephax/ceephax.com.frontend | import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { NAVIGATION_ITEMS } from 'ceephax/config';
class Navigation extends React.Component {
render() {
const nav = NAVIGATION_ITEMS.map((value, index) => (
<li key={index}>
<Link to={value.href}>{value.name}</Link>
</li>
));
return (
<div className="top-bar">
<div className="container-fluid">
<div className="row middle-xs">
<div className="col-xs-1">
<div className="box">
<Link to="/">
<img src="/images/icon.svg" />
</Link>
</div>
</div>
<div className="col-xs-11">
<ul>{nav}</ul>
</div>
</div>
</div>
</div>
);
}
}
export default Navigation;
|
client/app/SocialMediaButtons/components/ButtonsCombined_test.js | initiatived21/d21 | import React from 'react'
import FontAwesome from 'react-fontawesome'
import { shallow, mount } from 'enzyme'
import sinon from 'sinon'
import FacebookButton from './FacebookButton'
import TwitterButton from './TwitterButton'
import GoogleplusButton from './GoogleplusButton'
import LinkedinButton from './LinkedinButton'
import XingButton from './XingButton'
describe('Social media button', function() {
var tests = [
{
component: FacebookButton,
componentName: 'FacebookButton',
expectedUrl: 'https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fwww.example.com'
},
{
component: TwitterButton,
componentName: 'TwitterButton',
expectedUrlRegex: /^https:\/\/twitter\.com\/intent\/tweet\?text=[0-9a-z%]*&url=http%3A%2F%2Fwww\.example\.com$/
},
{
component: GoogleplusButton,
componentName: 'GoogleplusButton',
expectedUrl: 'https://plus.google.com/share?url=http%3A%2F%2Fwww.example.com'
},
{
component: LinkedinButton,
componentName: 'LinkedinButton',
expectedUrl: 'https://www.linkedin.com/cws/share?url=http%3A%2F%2Fwww.example.com'
},
{
component: XingButton,
componentName: 'XingButton',
expectedUrl: 'https://www.xing.com/social_plugins/share?url=http%3A%2F%2Fwww.example.com'
}
]
tests.forEach(function(test) {
describe(`<${test.componentName} />`, function() {
it('should render', function() {
const wrapper = shallow(React.createElement(test.component,
{ url: '', handleClick: () => null }))
wrapper.find('li').length.should.equal(1)
wrapper.find('a').length.should.equal(1)
wrapper.find(FontAwesome).length.should.equal(1)
})
it('should link to the correct URL', function() {
const wrapper = shallow(React.createElement(test.component,
{ url: 'http://www.example.com', handleClick: () => null }))
const href = wrapper.find('a').at(0).props().href
if (test.expectedUrl) {
href.should.equal(test.expectedUrl)
}
else if (test.expectedUrlRegex) {
href.should.match(test.expectedUrlRegex)
}
})
it('should call the click handler if clicked', function() {
const onButtonClick = sinon.spy()
const wrapper = mount(React.createElement(test.component,
{ url: '', handleClick: onButtonClick }))
wrapper.find('a').simulate('click')
onButtonClick.calledOnce.should.be.true
})
})
})
})
|
src/ui/Flex.js | builden/react-electron-boilerplate | import React, { Component } from 'react';
import Box from './Box';
class Flex extends Component {
render() {
return <Box flex {...this.props} />;
}
}
export default Flex;
|
src/frontend/components/Settings/index.js | jsonnull/aleamancer | // @flow
import React from 'react'
import Page from 'frontend/components/Page'
import Heading from 'frontend/components/Heading'
import Label from 'frontend/components/Label'
import Name from './Name'
import Avatar from './Avatar'
import { Row } from './styles'
import type { DBProfile } from 'common/types'
type Props = {
isLoading: boolean,
hasError: boolean,
currentUser: {
profile: DBProfile
},
setUsername: (name: string) => void,
updateUserAvatar: (avatar: string) => void
}
const Settings = (props: Props) => {
const { isLoading } = props
if (isLoading) {
return null
}
const { username, avatar } = props.currentUser.profile
const { setUsername, updateUserAvatar } = props
return (
<Page>
<Heading>Settings</Heading>
<Row>
<Label>Display Name</Label>
<Name name={username} saveDisplayName={setUsername} />
</Row>
<Row>
<Label>Avatar</Label>
<Avatar avatar={avatar} updateUserAvatar={updateUserAvatar} />
</Row>
</Page>
)
}
export default Settings
|
ajax/libs/cyclejs-core/1.0.1/cycle.js | Piicksarn/cdnjs | (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Cycle = f()}})(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){
// shim for using process in browser
var process = module.exports = {};
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = setTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
currentQueue[queueIndex].run();
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
clearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
setTimeout(drainQueue, 0);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
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');
};
// TODO(shtylman)
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
},{}],2:[function(require,module,exports){
(function (process,global){
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
;(function (undefined) {
var objectTypes = {
'boolean': false,
'function': true,
'object': true,
'number': false,
'string': false,
'undefined': false
};
var root = (objectTypes[typeof window] && window) || this,
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = objectTypes[typeof global] && global;
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
root = freeGlobal;
}
var Rx = {
internals: {},
config: {
Promise: root.Promise
},
helpers: { }
};
// Defaults
var noop = Rx.helpers.noop = function () { },
notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
identity = Rx.helpers.identity = function (x) { return x; },
pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
just = Rx.helpers.just = function (value) { return function () { return value; }; },
defaultNow = Rx.helpers.defaultNow = Date.now,
defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); },
defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); },
defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); },
defaultError = Rx.helpers.defaultError = function (err) { throw err; },
isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; },
asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); },
not = Rx.helpers.not = function (a) { return !a; },
isFunction = Rx.helpers.isFunction = (function () {
var isFn = function (value) {
return typeof value == 'function' || false;
}
// fallback for older versions of Chrome and Safari
if (isFn(/x/)) {
isFn = function(value) {
return typeof value == 'function' && toString.call(value) == '[object Function]';
};
}
return isFn;
}());
function cloneArray(arr) { for(var a = [], i = 0, len = arr.length; i < len; i++) { a.push(arr[i]); } return a;}
Rx.config.longStackSupport = false;
var hasStacks = false;
try {
throw new Error();
} catch (e) {
hasStacks = !!e.stack;
}
// All code after this point will be filtered from stack traces reported by RxJS
var rStartingLine = captureLine(), rFileName;
var STACK_JUMP_SEPARATOR = "From previous event:";
function makeStackTraceLong(error, observable) {
// If possible, transform the error stack trace by removing Node and RxJS
// cruft, then concatenating with the stack trace of `observable`.
if (hasStacks &&
observable.stack &&
typeof error === "object" &&
error !== null &&
error.stack &&
error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
) {
var stacks = [];
for (var o = observable; !!o; o = o.source) {
if (o.stack) {
stacks.unshift(o.stack);
}
}
stacks.unshift(error.stack);
var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
error.stack = filterStackString(concatedStacks);
}
}
function filterStackString(stackString) {
var lines = stackString.split("\n"),
desiredLines = [];
for (var i = 0, len = lines.length; i < len; i++) {
var line = lines[i];
if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
desiredLines.push(line);
}
}
return desiredLines.join("\n");
}
function isInternalFrame(stackLine) {
var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
if (!fileNameAndLineNumber) {
return false;
}
var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1];
return fileName === rFileName &&
lineNumber >= rStartingLine &&
lineNumber <= rEndingLine;
}
function isNodeFrame(stackLine) {
return stackLine.indexOf("(module.js:") !== -1 ||
stackLine.indexOf("(node.js:") !== -1;
}
function captureLine() {
if (!hasStacks) { return; }
try {
throw new Error();
} catch (e) {
var lines = e.stack.split("\n");
var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
if (!fileNameAndLineNumber) { return; }
rFileName = fileNameAndLineNumber[0];
return fileNameAndLineNumber[1];
}
}
function getFileNameAndLineNumber(stackLine) {
// Named functions: "at functionName (filename:lineNumber:columnNumber)"
var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
if (attempt1) { return [attempt1[1], Number(attempt1[2])]; }
// Anonymous functions: "at filename:lineNumber:columnNumber"
var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
if (attempt2) { return [attempt2[1], Number(attempt2[2])]; }
// Firefox style: "function@filename:lineNumber or @filename:lineNumber"
var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
if (attempt3) { return [attempt3[1], Number(attempt3[2])]; }
}
var EmptyError = Rx.EmptyError = function() {
this.message = 'Sequence contains no elements.';
Error.call(this);
};
EmptyError.prototype = Error.prototype;
var ObjectDisposedError = Rx.ObjectDisposedError = function() {
this.message = 'Object has been disposed';
Error.call(this);
};
ObjectDisposedError.prototype = Error.prototype;
var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () {
this.message = 'Argument out of range';
Error.call(this);
};
ArgumentOutOfRangeError.prototype = Error.prototype;
var NotSupportedError = Rx.NotSupportedError = function (message) {
this.message = message || 'This operation is not supported';
Error.call(this);
};
NotSupportedError.prototype = Error.prototype;
var NotImplementedError = Rx.NotImplementedError = function (message) {
this.message = message || 'This operation is not implemented';
Error.call(this);
};
NotImplementedError.prototype = Error.prototype;
var notImplemented = Rx.helpers.notImplemented = function () {
throw new NotImplementedError();
};
var notSupported = Rx.helpers.notSupported = function () {
throw new NotSupportedError();
};
// Shim in iterator support
var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
'_es6shim_iterator_';
// Bug for mozilla version
if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
$iterator$ = '@@iterator';
}
var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined };
var isIterable = Rx.helpers.isIterable = function (o) {
return o[$iterator$] !== undefined;
}
var isArrayLike = Rx.helpers.isArrayLike = function (o) {
return o && o.length !== undefined;
}
Rx.helpers.iterator = $iterator$;
var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) {
if (typeof thisArg === 'undefined') { return func; }
switch(argCount) {
case 0:
return function() {
return func.call(thisArg)
};
case 1:
return function(arg) {
return func.call(thisArg, arg);
}
case 2:
return function(value, index) {
return func.call(thisArg, value, index);
};
case 3:
return function(value, index, collection) {
return func.call(thisArg, value, index, collection);
};
}
return function() {
return func.apply(thisArg, arguments);
};
};
/** Used to determine if values are of the language type Object */
var dontEnums = ['toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'],
dontEnumsLength = dontEnums.length;
/** `Object#toString` result shortcuts */
var argsClass = '[object Arguments]',
arrayClass = '[object Array]',
boolClass = '[object Boolean]',
dateClass = '[object Date]',
errorClass = '[object Error]',
funcClass = '[object Function]',
numberClass = '[object Number]',
objectClass = '[object Object]',
regexpClass = '[object RegExp]',
stringClass = '[object String]';
var toString = Object.prototype.toString,
hasOwnProperty = Object.prototype.hasOwnProperty,
supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
supportNodeClass,
errorProto = Error.prototype,
objectProto = Object.prototype,
stringProto = String.prototype,
propertyIsEnumerable = objectProto.propertyIsEnumerable;
try {
supportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
} catch (e) {
supportNodeClass = true;
}
var nonEnumProps = {};
nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true };
nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true };
nonEnumProps[objectClass] = { 'constructor': true };
var support = {};
(function () {
var ctor = function() { this.x = 1; },
props = [];
ctor.prototype = { 'valueOf': 1, 'y': 1 };
for (var key in new ctor) { props.push(key); }
for (key in arguments) { }
// Detect if `name` or `message` properties of `Error.prototype` are enumerable by default.
support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name');
// Detect if `prototype` properties are enumerable by default.
support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype');
// Detect if `arguments` object indexes are non-enumerable
support.nonEnumArgs = key != 0;
// Detect if properties shadowing those on `Object.prototype` are non-enumerable.
support.nonEnumShadows = !/valueOf/.test(props);
}(1));
var isObject = Rx.internals.isObject = function(value) {
var type = typeof value;
return value && (type == 'function' || type == 'object') || false;
};
function keysIn(object) {
var result = [];
if (!isObject(object)) {
return result;
}
if (support.nonEnumArgs && object.length && isArguments(object)) {
object = slice.call(object);
}
var skipProto = support.enumPrototypes && typeof object == 'function',
skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error);
for (var key in object) {
if (!(skipProto && key == 'prototype') &&
!(skipErrorProps && (key == 'message' || key == 'name'))) {
result.push(key);
}
}
if (support.nonEnumShadows && object !== objectProto) {
var ctor = object.constructor,
index = -1,
length = dontEnumsLength;
if (object === (ctor && ctor.prototype)) {
var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
nonEnum = nonEnumProps[className];
}
while (++index < length) {
key = dontEnums[index];
if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) {
result.push(key);
}
}
}
return result;
}
function internalFor(object, callback, keysFunc) {
var index = -1,
props = keysFunc(object),
length = props.length;
while (++index < length) {
var key = props[index];
if (callback(object[key], key, object) === false) {
break;
}
}
return object;
}
function internalForIn(object, callback) {
return internalFor(object, callback, keysIn);
}
function isNode(value) {
// IE < 9 presents DOM nodes as `Object` objects except they have `toString`
// methods that are `typeof` "string" and still can coerce nodes to strings
return typeof value.toString != 'function' && typeof (value + '') == 'string';
}
var isArguments = function(value) {
return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
}
// fallback for browsers that can't detect `arguments` objects by [[Class]]
if (!supportsArgsClass) {
isArguments = function(value) {
return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
};
}
var isEqual = Rx.internals.isEqual = function (x, y) {
return deepEquals(x, y, [], []);
};
/** @private
* Used for deep comparison
**/
function deepEquals(a, b, stackA, stackB) {
// exit early for identical values
if (a === b) {
// treat `+0` vs. `-0` as not equal
return a !== 0 || (1 / a == 1 / b);
}
var type = typeof a,
otherType = typeof b;
// exit early for unlike primitive values
if (a === a && (a == null || b == null ||
(type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
return false;
}
// compare [[Class]] names
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:
// coerce dates and booleans to numbers, dates to milliseconds and booleans
// to `1` or `0` treating invalid dates coerced to `NaN` as not equal
return +a == +b;
case numberClass:
// treat `NaN` vs. `NaN` as equal
return (a != +a) ?
b != +b :
// but treat `-0` vs. `+0` as not equal
(a == 0 ? (1 / a == 1 / b) : a == +b);
case regexpClass:
case stringClass:
// coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
// treat string primitives and their corresponding object instances as equal
return a == String(b);
}
var isArr = className == arrayClass;
if (!isArr) {
// exit for functions and DOM nodes
if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) {
return false;
}
// in older versions of Opera, `arguments` objects have `Array` constructors
var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor,
ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
// non `Object` object instances with different constructors are not equal
if (ctorA != ctorB &&
!(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) &&
!(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
('constructor' in a && 'constructor' in b)
) {
return false;
}
}
// assume cyclic structures are equal
// the algorithm for detecting cyclic structures is adapted from ES 5.1
// section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
var initedStack = !stackA;
stackA || (stackA = []);
stackB || (stackB = []);
var length = stackA.length;
while (length--) {
if (stackA[length] == a) {
return stackB[length] == b;
}
}
var size = 0;
var result = true;
// add `a` and `b` to the stack of traversed objects
stackA.push(a);
stackB.push(b);
// recursively compare objects and arrays (susceptible to call stack limits)
if (isArr) {
// compare lengths to determine if a deep comparison is necessary
length = a.length;
size = b.length;
result = size == length;
if (result) {
// deep compare the contents, ignoring non-numeric properties
while (size--) {
var index = length,
value = b[size];
if (!(result = deepEquals(a[size], value, stackA, stackB))) {
break;
}
}
}
}
else {
// deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`
// which, in this case, is more costly
internalForIn(b, function(value, key, b) {
if (hasOwnProperty.call(b, key)) {
// count the number of properties.
size++;
// deep compare each property value.
return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB));
}
});
if (result) {
// ensure both objects have the same number of properties
internalForIn(a, function(value, key, a) {
if (hasOwnProperty.call(a, key)) {
// `size` will be `-1` if `a` has more properties than `b`
return (result = --size > -1);
}
});
}
}
stackA.pop();
stackB.pop();
return result;
}
var hasProp = {}.hasOwnProperty,
slice = Array.prototype.slice;
var inherits = this.inherits = Rx.internals.inherits = function (child, parent) {
function __() { this.constructor = child; }
__.prototype = parent.prototype;
child.prototype = new __();
};
var addProperties = Rx.internals.addProperties = function (obj) {
for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
for (var idx = 0, ln = sources.length; idx < ln; idx++) {
var source = sources[idx];
for (var prop in source) {
obj[prop] = source[prop];
}
}
};
// Rx Utils
var addRef = Rx.internals.addRef = function (xs, r) {
return new AnonymousObservable(function (observer) {
return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer));
});
};
function arrayInitialize(count, factory) {
var a = new Array(count);
for (var i = 0; i < count; i++) {
a[i] = factory();
}
return a;
}
var errorObj = {e: {}};
var tryCatchTarget;
function tryCatcher() {
try {
return tryCatchTarget.apply(this, arguments);
} catch (e) {
errorObj.e = e;
return errorObj;
}
}
function tryCatch(fn) {
if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
tryCatchTarget = fn;
return tryCatcher;
}
function thrower(e) {
throw e;
}
// Collections
function IndexedItem(id, value) {
this.id = id;
this.value = value;
}
IndexedItem.prototype.compareTo = function (other) {
var c = this.value.compareTo(other.value);
c === 0 && (c = this.id - other.id);
return c;
};
// Priority Queue for Scheduling
var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) {
this.items = new Array(capacity);
this.length = 0;
};
var priorityProto = PriorityQueue.prototype;
priorityProto.isHigherPriority = function (left, right) {
return this.items[left].compareTo(this.items[right]) < 0;
};
priorityProto.percolate = function (index) {
if (index >= this.length || index < 0) { return; }
var parent = index - 1 >> 1;
if (parent < 0 || parent === index) { return; }
if (this.isHigherPriority(index, parent)) {
var temp = this.items[index];
this.items[index] = this.items[parent];
this.items[parent] = temp;
this.percolate(parent);
}
};
priorityProto.heapify = function (index) {
+index || (index = 0);
if (index >= this.length || index < 0) { return; }
var left = 2 * index + 1,
right = 2 * index + 2,
first = index;
if (left < this.length && this.isHigherPriority(left, first)) {
first = left;
}
if (right < this.length && this.isHigherPriority(right, first)) {
first = right;
}
if (first !== index) {
var temp = this.items[index];
this.items[index] = this.items[first];
this.items[first] = temp;
this.heapify(first);
}
};
priorityProto.peek = function () { return this.items[0].value; };
priorityProto.removeAt = function (index) {
this.items[index] = this.items[--this.length];
this.items[this.length] = undefined;
this.heapify();
};
priorityProto.dequeue = function () {
var result = this.peek();
this.removeAt(0);
return result;
};
priorityProto.enqueue = function (item) {
var index = this.length++;
this.items[index] = new IndexedItem(PriorityQueue.count++, item);
this.percolate(index);
};
priorityProto.remove = function (item) {
for (var i = 0; i < this.length; i++) {
if (this.items[i].value === item) {
this.removeAt(i);
return true;
}
}
return false;
};
PriorityQueue.count = 0;
/**
* Represents a group of disposable resources that are disposed together.
* @constructor
*/
var CompositeDisposable = Rx.CompositeDisposable = function () {
var args = [], i, len;
if (Array.isArray(arguments[0])) {
args = arguments[0];
len = args.length;
} else {
len = arguments.length;
args = new Array(len);
for(i = 0; i < len; i++) { args[i] = arguments[i]; }
}
for(i = 0; i < len; i++) {
if (!isDisposable(args[i])) { throw new TypeError('Not a disposable'); }
}
this.disposables = args;
this.isDisposed = false;
this.length = args.length;
};
var CompositeDisposablePrototype = CompositeDisposable.prototype;
/**
* Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
* @param {Mixed} item Disposable to add.
*/
CompositeDisposablePrototype.add = function (item) {
if (this.isDisposed) {
item.dispose();
} else {
this.disposables.push(item);
this.length++;
}
};
/**
* Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
* @param {Mixed} item Disposable to remove.
* @returns {Boolean} true if found; false otherwise.
*/
CompositeDisposablePrototype.remove = function (item) {
var shouldDispose = false;
if (!this.isDisposed) {
var idx = this.disposables.indexOf(item);
if (idx !== -1) {
shouldDispose = true;
this.disposables.splice(idx, 1);
this.length--;
item.dispose();
}
}
return shouldDispose;
};
/**
* Disposes all disposables in the group and removes them from the group.
*/
CompositeDisposablePrototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var len = this.disposables.length, currentDisposables = new Array(len);
for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; }
this.disposables = [];
this.length = 0;
for (i = 0; i < len; i++) {
currentDisposables[i].dispose();
}
}
};
/**
* Provides a set of static methods for creating Disposables.
* @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
*/
var Disposable = Rx.Disposable = function (action) {
this.isDisposed = false;
this.action = action || noop;
};
/** Performs the task of cleaning up resources. */
Disposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.action();
this.isDisposed = true;
}
};
/**
* Creates a disposable object that invokes the specified action when disposed.
* @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
* @return {Disposable} The disposable object that runs the given action upon disposal.
*/
var disposableCreate = Disposable.create = function (action) { return new Disposable(action); };
/**
* Gets the disposable that does nothing when disposed.
*/
var disposableEmpty = Disposable.empty = { dispose: noop };
/**
* Validates whether the given object is a disposable
* @param {Object} Object to test whether it has a dispose method
* @returns {Boolean} true if a disposable object, else false.
*/
var isDisposable = Disposable.isDisposable = function (d) {
return d && isFunction(d.dispose);
};
var checkDisposed = Disposable.checkDisposed = function (disposable) {
if (disposable.isDisposed) { throw new ObjectDisposedError(); }
};
// Single assignment
var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () {
this.isDisposed = false;
this.current = null;
};
SingleAssignmentDisposable.prototype.getDisposable = function () {
return this.current;
};
SingleAssignmentDisposable.prototype.setDisposable = function (value) {
if (this.current) { throw new Error('Disposable has already been assigned'); }
var shouldDispose = this.isDisposed;
!shouldDispose && (this.current = value);
shouldDispose && value && value.dispose();
};
SingleAssignmentDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var old = this.current;
this.current = null;
}
old && old.dispose();
};
// Multiple assignment disposable
var SerialDisposable = Rx.SerialDisposable = function () {
this.isDisposed = false;
this.current = null;
};
SerialDisposable.prototype.getDisposable = function () {
return this.current;
};
SerialDisposable.prototype.setDisposable = function (value) {
var shouldDispose = this.isDisposed;
if (!shouldDispose) {
var old = this.current;
this.current = value;
}
old && old.dispose();
shouldDispose && value && value.dispose();
};
SerialDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var old = this.current;
this.current = null;
}
old && old.dispose();
};
/**
* Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
*/
var RefCountDisposable = Rx.RefCountDisposable = (function () {
function InnerDisposable(disposable) {
this.disposable = disposable;
this.disposable.count++;
this.isInnerDisposed = false;
}
InnerDisposable.prototype.dispose = function () {
if (!this.disposable.isDisposed && !this.isInnerDisposed) {
this.isInnerDisposed = true;
this.disposable.count--;
if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) {
this.disposable.isDisposed = true;
this.disposable.underlyingDisposable.dispose();
}
}
};
/**
* Initializes a new instance of the RefCountDisposable with the specified disposable.
* @constructor
* @param {Disposable} disposable Underlying disposable.
*/
function RefCountDisposable(disposable) {
this.underlyingDisposable = disposable;
this.isDisposed = false;
this.isPrimaryDisposed = false;
this.count = 0;
}
/**
* Disposes the underlying disposable only when all dependent disposables have been disposed
*/
RefCountDisposable.prototype.dispose = function () {
if (!this.isDisposed && !this.isPrimaryDisposed) {
this.isPrimaryDisposed = true;
if (this.count === 0) {
this.isDisposed = true;
this.underlyingDisposable.dispose();
}
}
};
/**
* Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
* @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.
*/
RefCountDisposable.prototype.getDisposable = function () {
return this.isDisposed ? disposableEmpty : new InnerDisposable(this);
};
return RefCountDisposable;
})();
function ScheduledDisposable(scheduler, disposable) {
this.scheduler = scheduler;
this.disposable = disposable;
this.isDisposed = false;
}
function scheduleItem(s, self) {
if (!self.isDisposed) {
self.isDisposed = true;
self.disposable.dispose();
}
}
ScheduledDisposable.prototype.dispose = function () {
this.scheduler.scheduleWithState(this, scheduleItem);
};
var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
this.scheduler = scheduler;
this.state = state;
this.action = action;
this.dueTime = dueTime;
this.comparer = comparer || defaultSubComparer;
this.disposable = new SingleAssignmentDisposable();
}
ScheduledItem.prototype.invoke = function () {
this.disposable.setDisposable(this.invokeCore());
};
ScheduledItem.prototype.compareTo = function (other) {
return this.comparer(this.dueTime, other.dueTime);
};
ScheduledItem.prototype.isCancelled = function () {
return this.disposable.isDisposed;
};
ScheduledItem.prototype.invokeCore = function () {
return this.action(this.scheduler, this.state);
};
/** Provides a set of static properties to access commonly used schedulers. */
var Scheduler = Rx.Scheduler = (function () {
function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) {
this.now = now;
this._schedule = schedule;
this._scheduleRelative = scheduleRelative;
this._scheduleAbsolute = scheduleAbsolute;
}
/** Determines whether the given object is a scheduler */
Scheduler.isScheduler = function (s) {
return s instanceof Scheduler;
}
function invokeAction(scheduler, action) {
action();
return disposableEmpty;
}
var schedulerProto = Scheduler.prototype;
/**
* Schedules an action to be executed.
* @param {Function} action Action to execute.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.schedule = function (action) {
return this._schedule(action, invokeAction);
};
/**
* Schedules an action to be executed.
* @param state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithState = function (state, action) {
return this._schedule(state, action);
};
/**
* Schedules an action to be executed after the specified relative due time.
* @param {Function} action Action to execute.
* @param {Number} dueTime Relative time after which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithRelative = function (dueTime, action) {
return this._scheduleRelative(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed after dueTime.
* @param state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @param {Number} dueTime Relative time after which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) {
return this._scheduleRelative(state, dueTime, action);
};
/**
* Schedules an action to be executed at the specified absolute due time.
* @param {Function} action Action to execute.
* @param {Number} dueTime Absolute time at which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithAbsolute = function (dueTime, action) {
return this._scheduleAbsolute(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed at dueTime.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @param {Number}dueTime Absolute time at which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) {
return this._scheduleAbsolute(state, dueTime, action);
};
/** Gets the current time according to the local machine's system clock. */
Scheduler.now = defaultNow;
/**
* Normalizes the specified TimeSpan value to a positive value.
* @param {Number} timeSpan The time span value to normalize.
* @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0
*/
Scheduler.normalize = function (timeSpan) {
timeSpan < 0 && (timeSpan = 0);
return timeSpan;
};
return Scheduler;
}());
var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler;
(function (schedulerProto) {
function invokeRecImmediate(scheduler, pair) {
var state = pair[0], action = pair[1], group = new CompositeDisposable();
function recursiveAction(state1) {
action(state1, function (state2) {
var isAdded = false, isDone = false,
d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
if (isAdded) {
group.remove(d);
} else {
isDone = true;
}
recursiveAction(state3);
return disposableEmpty;
});
if (!isDone) {
group.add(d);
isAdded = true;
}
});
}
recursiveAction(state);
return group;
}
function invokeRecDate(scheduler, pair, method) {
var state = pair[0], action = pair[1], group = new CompositeDisposable();
function recursiveAction(state1) {
action(state1, function (state2, dueTime1) {
var isAdded = false, isDone = false,
d = scheduler[method](state2, dueTime1, function (scheduler1, state3) {
if (isAdded) {
group.remove(d);
} else {
isDone = true;
}
recursiveAction(state3);
return disposableEmpty;
});
if (!isDone) {
group.add(d);
isAdded = true;
}
});
};
recursiveAction(state);
return group;
}
function scheduleInnerRecursive(action, self) {
action(function(dt) { self(action, dt); });
}
/**
* Schedules an action to be executed recursively.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursive = function (action) {
return this.scheduleRecursiveWithState(action, scheduleInnerRecursive);
};
/**
* Schedules an action to be executed recursively.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithState = function (state, action) {
return this.scheduleWithState([state, action], invokeRecImmediate);
};
/**
* Schedules an action to be executed recursively after a specified relative due time.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time.
* @param {Number}dueTime Relative time after which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) {
return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive);
};
/**
* Schedules an action to be executed recursively after a specified relative due time.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
* @param {Number}dueTime Relative time after which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
return this._scheduleRelative([state, action], dueTime, function (s, p) {
return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
});
};
/**
* Schedules an action to be executed recursively at a specified absolute due time.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time.
* @param {Number}dueTime Absolute time at which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) {
return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive);
};
/**
* Schedules an action to be executed recursively at a specified absolute due time.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
* @param {Number}dueTime Absolute time at which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
return this._scheduleAbsolute([state, action], dueTime, function (s, p) {
return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
});
};
}(Scheduler.prototype));
(function (schedulerProto) {
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
Scheduler.prototype.schedulePeriodic = function (period, action) {
return this.schedulePeriodicWithState(null, period, action);
};
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Mixed} state Initial state passed to the action upon the first iteration.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed, potentially updating the state.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) {
if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); }
period = normalizeTime(period);
var s = state, id = root.setInterval(function () { s = action(s); }, period);
return disposableCreate(function () { root.clearInterval(id); });
};
}(Scheduler.prototype));
(function (schedulerProto) {
/**
* Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions.
* @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false.
* @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling.
*/
schedulerProto.catchError = schedulerProto['catch'] = function (handler) {
return new CatchScheduler(this, handler);
};
}(Scheduler.prototype));
var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
function tick(command, recurse) {
recurse(0, this._period);
try {
this._state = this._action(this._state);
} catch (e) {
this._cancel.dispose();
throw e;
}
}
function SchedulePeriodicRecursive(scheduler, state, period, action) {
this._scheduler = scheduler;
this._state = state;
this._period = period;
this._action = action;
}
SchedulePeriodicRecursive.prototype.start = function () {
var d = new SingleAssignmentDisposable();
this._cancel = d;
d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
return d;
};
return SchedulePeriodicRecursive;
}());
/** Gets a scheduler that schedules work immediately on the current thread. */
var immediateScheduler = Scheduler.immediate = (function () {
function scheduleNow(state, action) { return action(this, state); }
return new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
}());
/**
* Gets a scheduler that schedules work as soon as possible on the current thread.
*/
var currentThreadScheduler = Scheduler.currentThread = (function () {
var queue;
function runTrampoline () {
while (queue.length > 0) {
var item = queue.dequeue();
!item.isCancelled() && item.invoke();
}
}
function scheduleNow(state, action) {
var si = new ScheduledItem(this, state, action, this.now());
if (!queue) {
queue = new PriorityQueue(4);
queue.enqueue(si);
var result = tryCatch(runTrampoline)();
queue = null;
if (result === errorObj) { return thrower(result.e); }
} else {
queue.enqueue(si);
}
return si.disposable;
}
var currentScheduler = new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
currentScheduler.scheduleRequired = function () { return !queue; };
return currentScheduler;
}());
var scheduleMethod, clearMethod;
var localTimer = (function () {
var localSetTimeout, localClearTimeout = noop;
if (!!root.setTimeout) {
localSetTimeout = root.setTimeout;
localClearTimeout = root.clearTimeout;
} else if (!!root.WScript) {
localSetTimeout = function (fn, time) {
root.WScript.Sleep(time);
fn();
};
} else {
throw new NotSupportedError();
}
return {
setTimeout: localSetTimeout,
clearTimeout: localClearTimeout
};
}());
var localSetTimeout = localTimer.setTimeout,
localClearTimeout = localTimer.clearTimeout;
(function () {
var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false;
clearMethod = function (handle) {
delete tasksByHandle[handle];
};
function runTask(handle) {
if (currentlyRunning) {
localSetTimeout(function () { runTask(handle) }, 0);
} else {
var task = tasksByHandle[handle];
if (task) {
currentlyRunning = true;
var result = tryCatch(task)();
clearMethod(handle);
currentlyRunning = false;
if (result === errorObj) { return thrower(result.e); }
}
}
}
var reNative = RegExp('^' +
String(toString)
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
.replace(/toString| for [^\]]+/g, '.*?') + '$'
);
var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
!reNative.test(setImmediate) && setImmediate;
function postMessageSupported () {
// Ensure not in a worker
if (!root.postMessage || root.importScripts) { return false; }
var isAsync = false, oldHandler = root.onmessage;
// Test for async
root.onmessage = function () { isAsync = true; };
root.postMessage('', '*');
root.onmessage = oldHandler;
return isAsync;
}
// Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout
if (isFunction(setImmediate)) {
scheduleMethod = function (action) {
var id = nextHandle++;
tasksByHandle[id] = action;
setImmediate(function () { runTask(id); });
return id;
};
} else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
scheduleMethod = function (action) {
var id = nextHandle++;
tasksByHandle[id] = action;
process.nextTick(function () { runTask(id); });
return id;
};
} else if (postMessageSupported()) {
var MSG_PREFIX = 'ms.rx.schedule' + Math.random();
function onGlobalPostMessage(event) {
// Only if we're a match to avoid any other global events
if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
runTask(event.data.substring(MSG_PREFIX.length));
}
}
if (root.addEventListener) {
root.addEventListener('message', onGlobalPostMessage, false);
} else if (root.attachEvent) {
root.attachEvent('onmessage', onGlobalPostMessage);
} else {
root.onmessage = onGlobalPostMessage;
}
scheduleMethod = function (action) {
var id = nextHandle++;
tasksByHandle[id] = action;
root.postMessage(MSG_PREFIX + currentId, '*');
return id;
};
} else if (!!root.MessageChannel) {
var channel = new root.MessageChannel();
channel.port1.onmessage = function (e) { runTask(e.data); };
scheduleMethod = function (action) {
var id = nextHandle++;
tasksByHandle[id] = action;
channel.port2.postMessage(id);
return id;
};
} else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
scheduleMethod = function (action) {
var scriptElement = root.document.createElement('script');
var id = nextHandle++;
tasksByHandle[id] = action;
scriptElement.onreadystatechange = function () {
runTask(id);
scriptElement.onreadystatechange = null;
scriptElement.parentNode.removeChild(scriptElement);
scriptElement = null;
};
root.document.documentElement.appendChild(scriptElement);
return id;
};
} else {
scheduleMethod = function (action) {
var id = nextHandle++;
tasksByHandle[id] = action;
localSetTimeout(function () {
runTask(id);
}, 0);
return id;
};
}
}());
/**
* Gets a scheduler that schedules work via a timed callback based upon platform.
*/
var timeoutScheduler = Scheduler.timeout = Scheduler['default'] = (function () {
function scheduleNow(state, action) {
var scheduler = this, disposable = new SingleAssignmentDisposable();
var id = scheduleMethod(function () {
!disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
});
return new CompositeDisposable(disposable, disposableCreate(function () {
clearMethod(id);
}));
}
function scheduleRelative(state, dueTime, action) {
var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable();
if (dt === 0) { return scheduler.scheduleWithState(state, action); }
var id = localSetTimeout(function () {
!disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
}, dt);
return new CompositeDisposable(disposable, disposableCreate(function () {
localClearTimeout(id);
}));
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
}
return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
})();
var CatchScheduler = (function (__super__) {
function scheduleNow(state, action) {
return this._scheduler.scheduleWithState(state, this._wrap(action));
}
function scheduleRelative(state, dueTime, action) {
return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action));
}
function scheduleAbsolute(state, dueTime, action) {
return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action));
}
inherits(CatchScheduler, __super__);
function CatchScheduler(scheduler, handler) {
this._scheduler = scheduler;
this._handler = handler;
this._recursiveOriginal = null;
this._recursiveWrapper = null;
__super__.call(this, this._scheduler.now.bind(this._scheduler), scheduleNow, scheduleRelative, scheduleAbsolute);
}
CatchScheduler.prototype._clone = function (scheduler) {
return new CatchScheduler(scheduler, this._handler);
};
CatchScheduler.prototype._wrap = function (action) {
var parent = this;
return function (self, state) {
try {
return action(parent._getRecursiveWrapper(self), state);
} catch (e) {
if (!parent._handler(e)) { throw e; }
return disposableEmpty;
}
};
};
CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) {
if (this._recursiveOriginal !== scheduler) {
this._recursiveOriginal = scheduler;
var wrapper = this._clone(scheduler);
wrapper._recursiveOriginal = scheduler;
wrapper._recursiveWrapper = wrapper;
this._recursiveWrapper = wrapper;
}
return this._recursiveWrapper;
};
CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) {
var self = this, failed = false, d = new SingleAssignmentDisposable();
d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) {
if (failed) { return null; }
try {
return action(state1);
} catch (e) {
failed = true;
if (!self._handler(e)) { throw e; }
d.dispose();
return null;
}
}));
return d;
};
return CatchScheduler;
}(Scheduler));
/**
* Represents a notification to an observer.
*/
var Notification = Rx.Notification = (function () {
function Notification(kind, value, exception, accept, acceptObservable, toString) {
this.kind = kind;
this.value = value;
this.exception = exception;
this._accept = accept;
this._acceptObservable = acceptObservable;
this.toString = toString;
}
/**
* Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
*
* @memberOf Notification
* @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
* @param {Function} onError Delegate to invoke for an OnError notification.
* @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
* @returns {Any} Result produced by the observation.
*/
Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) {
return observerOrOnNext && typeof observerOrOnNext === 'object' ?
this._acceptObservable(observerOrOnNext) :
this._accept(observerOrOnNext, onError, onCompleted);
};
/**
* Returns an observable sequence with a single notification.
*
* @memberOf Notifications
* @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
* @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
*/
Notification.prototype.toObservable = function (scheduler) {
var self = this;
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.scheduleWithState(self, function (_, notification) {
notification._acceptObservable(observer);
notification.kind === 'N' && observer.onCompleted();
});
});
};
return Notification;
})();
/**
* Creates an object that represents an OnNext notification to an observer.
* @param {Any} value The value contained in the notification.
* @returns {Notification} The OnNext notification containing the value.
*/
var notificationCreateOnNext = Notification.createOnNext = (function () {
function _accept(onNext) { return onNext(this.value); }
function _acceptObservable(observer) { return observer.onNext(this.value); }
function toString() { return 'OnNext(' + this.value + ')'; }
return function (value) {
return new Notification('N', value, null, _accept, _acceptObservable, toString);
};
}());
/**
* Creates an object that represents an OnError notification to an observer.
* @param {Any} error The exception contained in the notification.
* @returns {Notification} The OnError notification containing the exception.
*/
var notificationCreateOnError = Notification.createOnError = (function () {
function _accept (onNext, onError) { return onError(this.exception); }
function _acceptObservable(observer) { return observer.onError(this.exception); }
function toString () { return 'OnError(' + this.exception + ')'; }
return function (e) {
return new Notification('E', null, e, _accept, _acceptObservable, toString);
};
}());
/**
* Creates an object that represents an OnCompleted notification to an observer.
* @returns {Notification} The OnCompleted notification.
*/
var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
function _accept (onNext, onError, onCompleted) { return onCompleted(); }
function _acceptObservable(observer) { return observer.onCompleted(); }
function toString () { return 'OnCompleted()'; }
return function () {
return new Notification('C', null, null, _accept, _acceptObservable, toString);
};
}());
/**
* Supports push-style iteration over an observable sequence.
*/
var Observer = Rx.Observer = function () { };
/**
* Creates a notification callback from an observer.
* @returns The action that forwards its input notification to the underlying observer.
*/
Observer.prototype.toNotifier = function () {
var observer = this;
return function (n) { return n.accept(observer); };
};
/**
* Hides the identity of an observer.
* @returns An observer that hides the identity of the specified observer.
*/
Observer.prototype.asObserver = function () {
return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this));
};
/**
* Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods.
* If a violation is detected, an Error is thrown from the offending observer method call.
* @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer.
*/
Observer.prototype.checked = function () { return new CheckedObserver(this); };
/**
* Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions.
* @param {Function} [onNext] Observer's OnNext action implementation.
* @param {Function} [onError] Observer's OnError action implementation.
* @param {Function} [onCompleted] Observer's OnCompleted action implementation.
* @returns {Observer} The observer object implemented using the given actions.
*/
var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
onNext || (onNext = noop);
onError || (onError = defaultError);
onCompleted || (onCompleted = noop);
return new AnonymousObserver(onNext, onError, onCompleted);
};
/**
* Creates an observer from a notification callback.
*
* @static
* @memberOf Observer
* @param {Function} handler Action that handles a notification.
* @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
*/
Observer.fromNotifier = function (handler, thisArg) {
return new AnonymousObserver(function (x) {
return handler.call(thisArg, notificationCreateOnNext(x));
}, function (e) {
return handler.call(thisArg, notificationCreateOnError(e));
}, function () {
return handler.call(thisArg, notificationCreateOnCompleted());
});
};
/**
* Schedules the invocation of observer methods on the given scheduler.
* @param {Scheduler} scheduler Scheduler to schedule observer messages on.
* @returns {Observer} Observer whose messages are scheduled on the given scheduler.
*/
Observer.prototype.notifyOn = function (scheduler) {
return new ObserveOnObserver(scheduler, this);
};
Observer.prototype.makeSafe = function(disposable) {
return new AnonymousSafeObserver(this._onNext, this._onError, this._onCompleted, disposable);
};
/**
* Abstract base class for implementations of the Observer class.
* This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
*/
var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) {
inherits(AbstractObserver, __super__);
/**
* Creates a new observer in a non-stopped state.
*/
function AbstractObserver() {
this.isStopped = false;
__super__.call(this);
}
// Must be implemented by other observers
AbstractObserver.prototype.next = notImplemented;
AbstractObserver.prototype.error = notImplemented;
AbstractObserver.prototype.completed = notImplemented;
/**
* Notifies the observer of a new element in the sequence.
* @param {Any} value Next element in the sequence.
*/
AbstractObserver.prototype.onNext = function (value) {
if (!this.isStopped) { this.next(value); }
};
/**
* Notifies the observer that an exception has occurred.
* @param {Any} error The error that has occurred.
*/
AbstractObserver.prototype.onError = function (error) {
if (!this.isStopped) {
this.isStopped = true;
this.error(error);
}
};
/**
* Notifies the observer of the end of the sequence.
*/
AbstractObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.completed();
}
};
/**
* Disposes the observer, causing it to transition to the stopped state.
*/
AbstractObserver.prototype.dispose = function () {
this.isStopped = true;
};
AbstractObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.error(e);
return true;
}
return false;
};
return AbstractObserver;
}(Observer));
/**
* Class to create an Observer instance from delegate-based implementations of the on* methods.
*/
var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) {
inherits(AnonymousObserver, __super__);
/**
* Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
* @param {Any} onNext Observer's OnNext action implementation.
* @param {Any} onError Observer's OnError action implementation.
* @param {Any} onCompleted Observer's OnCompleted action implementation.
*/
function AnonymousObserver(onNext, onError, onCompleted) {
__super__.call(this);
this._onNext = onNext;
this._onError = onError;
this._onCompleted = onCompleted;
}
/**
* Calls the onNext action.
* @param {Any} value Next element in the sequence.
*/
AnonymousObserver.prototype.next = function (value) {
this._onNext(value);
};
/**
* Calls the onError action.
* @param {Any} error The error that has occurred.
*/
AnonymousObserver.prototype.error = function (error) {
this._onError(error);
};
/**
* Calls the onCompleted action.
*/
AnonymousObserver.prototype.completed = function () {
this._onCompleted();
};
return AnonymousObserver;
}(AbstractObserver));
var CheckedObserver = (function (__super__) {
inherits(CheckedObserver, __super__);
function CheckedObserver(observer) {
__super__.call(this);
this._observer = observer;
this._state = 0; // 0 - idle, 1 - busy, 2 - done
}
var CheckedObserverPrototype = CheckedObserver.prototype;
CheckedObserverPrototype.onNext = function (value) {
this.checkAccess();
var res = tryCatch(this._observer.onNext).call(this._observer, value);
this._state = 0;
res === errorObj && thrower(res.e);
};
CheckedObserverPrototype.onError = function (err) {
this.checkAccess();
var res = tryCatch(this._observer.onError).call(this._observer, err);
this._state = 2;
res === errorObj && thrower(res.e);
};
CheckedObserverPrototype.onCompleted = function () {
this.checkAccess();
var res = tryCatch(this._observer.onCompleted).call(this._observer);
this._state = 2;
res === errorObj && thrower(res.e);
};
CheckedObserverPrototype.checkAccess = function () {
if (this._state === 1) { throw new Error('Re-entrancy detected'); }
if (this._state === 2) { throw new Error('Observer completed'); }
if (this._state === 0) { this._state = 1; }
};
return CheckedObserver;
}(Observer));
var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
inherits(ScheduledObserver, __super__);
function ScheduledObserver(scheduler, observer) {
__super__.call(this);
this.scheduler = scheduler;
this.observer = observer;
this.isAcquired = false;
this.hasFaulted = false;
this.queue = [];
this.disposable = new SerialDisposable();
}
ScheduledObserver.prototype.next = function (value) {
var self = this;
this.queue.push(function () { self.observer.onNext(value); });
};
ScheduledObserver.prototype.error = function (e) {
var self = this;
this.queue.push(function () { self.observer.onError(e); });
};
ScheduledObserver.prototype.completed = function () {
var self = this;
this.queue.push(function () { self.observer.onCompleted(); });
};
ScheduledObserver.prototype.ensureActive = function () {
var isOwner = false, parent = this;
if (!this.hasFaulted && this.queue.length > 0) {
isOwner = !this.isAcquired;
this.isAcquired = true;
}
if (isOwner) {
this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) {
var work;
if (parent.queue.length > 0) {
work = parent.queue.shift();
} else {
parent.isAcquired = false;
return;
}
try {
work();
} catch (ex) {
parent.queue = [];
parent.hasFaulted = true;
throw ex;
}
self();
}));
}
};
ScheduledObserver.prototype.dispose = function () {
__super__.prototype.dispose.call(this);
this.disposable.dispose();
};
return ScheduledObserver;
}(AbstractObserver));
var ObserveOnObserver = (function (__super__) {
inherits(ObserveOnObserver, __super__);
function ObserveOnObserver(scheduler, observer, cancel) {
__super__.call(this, scheduler, observer);
this._cancel = cancel;
}
ObserveOnObserver.prototype.next = function (value) {
__super__.prototype.next.call(this, value);
this.ensureActive();
};
ObserveOnObserver.prototype.error = function (e) {
__super__.prototype.error.call(this, e);
this.ensureActive();
};
ObserveOnObserver.prototype.completed = function () {
__super__.prototype.completed.call(this);
this.ensureActive();
};
ObserveOnObserver.prototype.dispose = function () {
__super__.prototype.dispose.call(this);
this._cancel && this._cancel.dispose();
this._cancel = null;
};
return ObserveOnObserver;
})(ScheduledObserver);
var observableProto;
/**
* Represents a push-style collection.
*/
var Observable = Rx.Observable = (function () {
function Observable(subscribe) {
if (Rx.config.longStackSupport && hasStacks) {
try {
throw new Error();
} catch (e) {
this.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
}
var self = this;
this._subscribe = function (observer) {
var oldOnError = observer.onError.bind(observer);
observer.onError = function (err) {
makeStackTraceLong(err, self);
oldOnError(err);
};
return subscribe.call(self, observer);
};
} else {
this._subscribe = subscribe;
}
}
observableProto = Observable.prototype;
/**
* Subscribes an observer to the observable sequence.
* @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
* @returns {Diposable} A disposable handling the subscriptions and unsubscriptions.
*/
observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) {
return this._subscribe(typeof observerOrOnNext === 'object' ?
observerOrOnNext :
observerCreate(observerOrOnNext, onError, onCompleted));
};
/**
* Subscribes to the next value in the sequence with an optional "this" argument.
* @param {Function} onNext The function to invoke on each element in the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
*/
observableProto.subscribeOnNext = function (onNext, thisArg) {
return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext));
};
/**
* Subscribes to an exceptional condition in the sequence with an optional "this" argument.
* @param {Function} onError The function to invoke upon exceptional termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
*/
observableProto.subscribeOnError = function (onError, thisArg) {
return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError));
};
/**
* Subscribes to the next value in the sequence with an optional "this" argument.
* @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
*/
observableProto.subscribeOnCompleted = function (onCompleted, thisArg) {
return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted));
};
return Observable;
})();
var ObservableBase = Rx.ObservableBase = (function (__super__) {
inherits(ObservableBase, __super__);
function fixSubscriber(subscriber) {
return subscriber && isFunction(subscriber.dispose) ? subscriber :
isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
}
function setDisposable(s, state) {
var ado = state[0], self = state[1];
var sub = tryCatch(self.subscribeCore).call(self, ado);
if (sub === errorObj) {
if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
}
ado.setDisposable(fixSubscriber(sub));
}
function subscribe(observer) {
var ado = new AutoDetachObserver(observer), state = [ado, this];
if (currentThreadScheduler.scheduleRequired()) {
currentThreadScheduler.scheduleWithState(state, setDisposable);
} else {
setDisposable(null, state);
}
return ado;
}
function ObservableBase() {
__super__.call(this, subscribe);
}
ObservableBase.prototype.subscribeCore = notImplemented;
return ObservableBase;
}(Observable));
var Enumerable = Rx.internals.Enumerable = function () { };
var ConcatEnumerableObservable = (function(__super__) {
inherits(ConcatEnumerableObservable, __super__);
function ConcatEnumerableObservable(sources) {
this.sources = sources;
__super__.call(this);
}
ConcatEnumerableObservable.prototype.subscribeCore = function (o) {
var isDisposed, subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursiveWithState(this.sources[$iterator$](), function (e, self) {
if (isDisposed) { return; }
var currentItem = tryCatch(e.next).call(e);
if (currentItem === errorObj) { return o.onError(currentItem.e); }
if (currentItem.done) {
return o.onCompleted();
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(currentValue.subscribe(new InnerObserver(o, self, e)));
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
};
function InnerObserver(o, s, e) {
this.o = o;
this.s = s;
this.e = e;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.o.onNext(x); } };
InnerObserver.prototype.onError = function (err) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(err);
}
};
InnerObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.s(this.e);
}
};
InnerObserver.prototype.dispose = function () { this.isStopped = true; };
InnerObserver.prototype.fail = function (err) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(err);
return true;
}
return false;
};
return ConcatEnumerableObservable;
}(ObservableBase));
Enumerable.prototype.concat = function () {
return new ConcatEnumerableObservable(this);
};
var CatchErrorObservable = (function(__super__) {
inherits(CatchErrorObservable, __super__);
function CatchErrorObservable(sources) {
this.sources = sources;
__super__.call(this);
}
CatchErrorObservable.prototype.subscribeCore = function (o) {
var e = this.sources[$iterator$]();
var isDisposed, subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursiveWithState(null, function (lastException, self) {
if (isDisposed) { return; }
var currentItem = tryCatch(e.next).call(e);
if (currentItem === errorObj) { return o.onError(currentItem.e); }
if (currentItem.done) {
return lastException !== null ? o.onError(lastException) : o.onCompleted();
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(currentValue.subscribe(
function(x) { o.onNext(x); },
self,
function() { o.onCompleted(); }));
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
};
return CatchErrorObservable;
}(ObservableBase));
Enumerable.prototype.catchError = function () {
return new CatchErrorObservable(this);
};
Enumerable.prototype.catchErrorWhen = function (notificationHandler) {
var sources = this;
return new AnonymousObservable(function (o) {
var exceptions = new Subject(),
notifier = new Subject(),
handled = notificationHandler(exceptions),
notificationDisposable = handled.subscribe(notifier);
var e = sources[$iterator$]();
var isDisposed,
lastException,
subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
if (isDisposed) { return; }
var currentItem = tryCatch(e.next).call(e);
if (currentItem === errorObj) { return o.onError(currentItem.e); }
if (currentItem.done) {
if (lastException) {
o.onError(lastException);
} else {
o.onCompleted();
}
return;
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var outer = new SingleAssignmentDisposable();
var inner = new SingleAssignmentDisposable();
subscription.setDisposable(new CompositeDisposable(inner, outer));
outer.setDisposable(currentValue.subscribe(
function(x) { o.onNext(x); },
function (exn) {
inner.setDisposable(notifier.subscribe(self, function(ex) {
o.onError(ex);
}, function() {
o.onCompleted();
}));
exceptions.onNext(exn);
},
function() { o.onCompleted(); }));
});
return new CompositeDisposable(notificationDisposable, subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
});
};
var RepeatEnumerable = (function (__super__) {
inherits(RepeatEnumerable, __super__);
function RepeatEnumerable(v, c) {
this.v = v;
this.c = c == null ? -1 : c;
}
RepeatEnumerable.prototype[$iterator$] = function () {
return new RepeatEnumerator(this);
};
function RepeatEnumerator(p) {
this.v = p.v;
this.l = p.c;
}
RepeatEnumerator.prototype.next = function () {
if (this.l === 0) { return doneEnumerator; }
if (this.l > 0) { this.l--; }
return { done: false, value: this.v };
};
return RepeatEnumerable;
}(Enumerable));
var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
return new RepeatEnumerable(value, repeatCount);
};
var OfEnumerable = (function(__super__) {
inherits(OfEnumerable, __super__);
function OfEnumerable(s, fn, thisArg) {
this.s = s;
this.fn = fn ? bindCallback(fn, thisArg, 3) : null;
}
OfEnumerable.prototype[$iterator$] = function () {
return new OfEnumerator(this);
};
function OfEnumerator(p) {
this.i = -1;
this.s = p.s;
this.l = this.s.length;
this.fn = p.fn;
}
OfEnumerator.prototype.next = function () {
return ++this.i < this.l ?
{ done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } :
doneEnumerator;
};
return OfEnumerable;
}(Enumerable));
var enumerableOf = Enumerable.of = function (source, selector, thisArg) {
return new OfEnumerable(source, selector, thisArg);
};
/**
* Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
*
* This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects
* that require to be run on a scheduler, use subscribeOn.
*
* @param {Scheduler} scheduler Scheduler to notify observers on.
* @returns {Observable} The source sequence whose observations happen on the specified scheduler.
*/
observableProto.observeOn = function (scheduler) {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(new ObserveOnObserver(scheduler, observer));
}, source);
};
/**
* Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used;
* see the remarks section for more information on the distinction between subscribeOn and observeOn.
* This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer
* callbacks on a scheduler, use observeOn.
* @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on.
* @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
*/
observableProto.subscribeOn = function (scheduler) {
var source = this;
return new AnonymousObservable(function (observer) {
var m = new SingleAssignmentDisposable(), d = new SerialDisposable();
d.setDisposable(m);
m.setDisposable(scheduler.schedule(function () {
d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer)));
}));
return d;
}, source);
};
var FromPromiseObservable = (function(__super__) {
inherits(FromPromiseObservable, __super__);
function FromPromiseObservable(p) {
this.p = p;
__super__.call(this);
}
FromPromiseObservable.prototype.subscribeCore = function(o) {
this.p.then(function (data) {
o.onNext(data);
o.onCompleted();
}, function (err) { o.onError(err); });
return disposableEmpty;
};
return FromPromiseObservable;
}(ObservableBase));
/**
* Converts a Promise to an Observable sequence
* @param {Promise} An ES6 Compliant promise.
* @returns {Observable} An Observable sequence which wraps the existing promise success and failure.
*/
var observableFromPromise = Observable.fromPromise = function (promise) {
return new FromPromiseObservable(promise);
};
/*
* Converts an existing observable sequence to an ES6 Compatible Promise
* @example
* var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
*
* // With config
* Rx.config.Promise = RSVP.Promise;
* var promise = Rx.Observable.return(42).toPromise();
* @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
* @returns {Promise} An ES6 compatible promise with the last value from the observable sequence.
*/
observableProto.toPromise = function (promiseCtor) {
promiseCtor || (promiseCtor = Rx.config.Promise);
if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); }
var source = this;
return new promiseCtor(function (resolve, reject) {
// No cancellation can be done
var value, hasValue = false;
source.subscribe(function (v) {
value = v;
hasValue = true;
}, reject, function () {
hasValue && resolve(value);
});
});
};
var ToArrayObservable = (function(__super__) {
inherits(ToArrayObservable, __super__);
function ToArrayObservable(source) {
this.source = source;
__super__.call(this);
}
ToArrayObservable.prototype.subscribeCore = function(o) {
return this.source.subscribe(new InnerObserver(o));
};
function InnerObserver(o) {
this.o = o;
this.a = [];
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.a.push(x); } };
InnerObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
}
};
InnerObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.o.onNext(this.a);
this.o.onCompleted();
}
};
InnerObserver.prototype.dispose = function () { this.isStopped = true; }
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return ToArrayObservable;
}(ObservableBase));
/**
* Creates an array from an observable sequence.
* @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence.
*/
observableProto.toArray = function () {
return new ToArrayObservable(this);
};
/**
* Creates an observable sequence from a specified subscribe method implementation.
* @example
* var res = Rx.Observable.create(function (observer) { return function () { } );
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
* var res = Rx.Observable.create(function (observer) { } );
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
*/
Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
return new AnonymousObservable(subscribe, parent);
};
/**
* Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
*
* @example
* var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
* @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise.
* @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
*/
var observableDefer = Observable.defer = function (observableFactory) {
return new AnonymousObservable(function (observer) {
var result;
try {
result = observableFactory();
} catch (e) {
return observableThrow(e).subscribe(observer);
}
isPromise(result) && (result = observableFromPromise(result));
return result.subscribe(observer);
});
};
var EmptyObservable = (function(__super__) {
inherits(EmptyObservable, __super__);
function EmptyObservable(scheduler) {
this.scheduler = scheduler;
__super__.call(this);
}
EmptyObservable.prototype.subscribeCore = function (observer) {
var sink = new EmptySink(observer, this);
return sink.run();
};
function EmptySink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
function scheduleItem(s, state) {
state.onCompleted();
}
EmptySink.prototype.run = function () {
return this.parent.scheduler.scheduleWithState(this.observer, scheduleItem);
};
return EmptyObservable;
}(ObservableBase));
/**
* Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
*
* @example
* var res = Rx.Observable.empty();
* var res = Rx.Observable.empty(Rx.Scheduler.timeout);
* @param {Scheduler} [scheduler] Scheduler to send the termination call on.
* @returns {Observable} An observable sequence with no elements.
*/
var observableEmpty = Observable.empty = function (scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new EmptyObservable(scheduler);
};
var FromObservable = (function(__super__) {
inherits(FromObservable, __super__);
function FromObservable(iterable, mapper, scheduler) {
this.iterable = iterable;
this.mapper = mapper;
this.scheduler = scheduler;
__super__.call(this);
}
FromObservable.prototype.subscribeCore = function (observer) {
var sink = new FromSink(observer, this);
return sink.run();
};
return FromObservable;
}(ObservableBase));
var FromSink = (function () {
function FromSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
FromSink.prototype.run = function () {
var list = Object(this.parent.iterable),
it = getIterable(list),
observer = this.observer,
mapper = this.parent.mapper;
function loopRecursive(i, recurse) {
try {
var next = it.next();
} catch (e) {
return observer.onError(e);
}
if (next.done) {
return observer.onCompleted();
}
var result = next.value;
if (mapper) {
try {
result = mapper(result, i);
} catch (e) {
return observer.onError(e);
}
}
observer.onNext(result);
recurse(i + 1);
}
return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
};
return FromSink;
}());
var maxSafeInteger = Math.pow(2, 53) - 1;
function StringIterable(str) {
this._s = s;
}
StringIterable.prototype[$iterator$] = function () {
return new StringIterator(this._s);
};
function StringIterator(str) {
this._s = s;
this._l = s.length;
this._i = 0;
}
StringIterator.prototype[$iterator$] = function () {
return this;
};
StringIterator.prototype.next = function () {
return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator;
};
function ArrayIterable(a) {
this._a = a;
}
ArrayIterable.prototype[$iterator$] = function () {
return new ArrayIterator(this._a);
};
function ArrayIterator(a) {
this._a = a;
this._l = toLength(a);
this._i = 0;
}
ArrayIterator.prototype[$iterator$] = function () {
return this;
};
ArrayIterator.prototype.next = function () {
return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator;
};
function numberIsFinite(value) {
return typeof value === 'number' && root.isFinite(value);
}
function isNan(n) {
return n !== n;
}
function getIterable(o) {
var i = o[$iterator$], it;
if (!i && typeof o === 'string') {
it = new StringIterable(o);
return it[$iterator$]();
}
if (!i && o.length !== undefined) {
it = new ArrayIterable(o);
return it[$iterator$]();
}
if (!i) { throw new TypeError('Object is not iterable'); }
return o[$iterator$]();
}
function sign(value) {
var number = +value;
if (number === 0) { return number; }
if (isNaN(number)) { return number; }
return number < 0 ? -1 : 1;
}
function toLength(o) {
var len = +o.length;
if (isNaN(len)) { return 0; }
if (len === 0 || !numberIsFinite(len)) { return len; }
len = sign(len) * Math.floor(Math.abs(len));
if (len <= 0) { return 0; }
if (len > maxSafeInteger) { return maxSafeInteger; }
return len;
}
/**
* This method creates a new Observable sequence from an array-like or iterable object.
* @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence.
* @param {Function} [mapFn] Map function to call on every element of the array.
* @param {Any} [thisArg] The context to use calling the mapFn if provided.
* @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
*/
var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) {
if (iterable == null) {
throw new Error('iterable cannot be null.')
}
if (mapFn && !isFunction(mapFn)) {
throw new Error('mapFn when provided must be a function');
}
if (mapFn) {
var mapper = bindCallback(mapFn, thisArg, 2);
}
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new FromObservable(iterable, mapper, scheduler);
}
var FromArrayObservable = (function(__super__) {
inherits(FromArrayObservable, __super__);
function FromArrayObservable(args, scheduler) {
this.args = args;
this.scheduler = scheduler;
__super__.call(this);
}
FromArrayObservable.prototype.subscribeCore = function (observer) {
var sink = new FromArraySink(observer, this);
return sink.run();
};
return FromArrayObservable;
}(ObservableBase));
function FromArraySink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
FromArraySink.prototype.run = function () {
var observer = this.observer, args = this.parent.args, len = args.length;
function loopRecursive(i, recurse) {
if (i < len) {
observer.onNext(args[i]);
recurse(i + 1);
} else {
observer.onCompleted();
}
}
return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
};
/**
* Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
* @deprecated use Observable.from or Observable.of
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
* @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
*/
var observableFromArray = Observable.fromArray = function (array, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new FromArrayObservable(array, scheduler)
};
/**
* Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
*
* @example
* var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; });
* var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout);
* @param {Mixed} initialState Initial state.
* @param {Function} condition Condition to terminate generation (upon returning false).
* @param {Function} iterate Iteration step function.
* @param {Function} resultSelector Selector function for results produced in the sequence.
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread.
* @returns {Observable} The generated sequence.
*/
Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (o) {
var first = true;
return scheduler.scheduleRecursiveWithState(initialState, function (state, self) {
var hasResult, result;
try {
if (first) {
first = false;
} else {
state = iterate(state);
}
hasResult = condition(state);
hasResult && (result = resultSelector(state));
} catch (e) {
return o.onError(e);
}
if (hasResult) {
o.onNext(result);
self(state);
} else {
o.onCompleted();
}
});
});
};
function observableOf (scheduler, array) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new FromArrayObservable(array, scheduler);
}
/**
* This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
* @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
*/
Observable.of = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
return new FromArrayObservable(args, currentThreadScheduler);
};
/**
* This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
* @param {Scheduler} scheduler A scheduler to use for scheduling the arguments.
* @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
*/
Observable.ofWithScheduler = function (scheduler) {
var len = arguments.length, args = new Array(len - 1);
for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; }
return new FromArrayObservable(args, scheduler);
};
/**
* Creates an Observable sequence from changes to an array using Array.observe.
* @param {Array} array An array to observe changes.
* @returns {Observable} An observable sequence containing changes to an array from Array.observe.
*/
Observable.ofArrayChanges = function(array) {
if (!Array.isArray(array)) { throw new TypeError('Array.observe only accepts arrays.'); }
if (typeof Array.observe !== 'function' && typeof Array.unobserve !== 'function') { throw new TypeError('Array.observe is not supported on your platform') }
return new AnonymousObservable(function(observer) {
function observerFn(changes) {
for(var i = 0, len = changes.length; i < len; i++) {
observer.onNext(changes[i]);
}
}
Array.observe(array, observerFn);
return function () {
Array.unobserve(array, observerFn);
};
});
};
/**
* Creates an Observable sequence from changes to an object using Object.observe.
* @param {Object} obj An object to observe changes.
* @returns {Observable} An observable sequence containing changes to an object from Object.observe.
*/
Observable.ofObjectChanges = function(obj) {
if (obj == null) { throw new TypeError('object must not be null or undefined.'); }
if (typeof Object.observe !== 'function' && typeof Object.unobserve !== 'function') { throw new TypeError('Object.observe is not supported on your platform') }
return new AnonymousObservable(function(observer) {
function observerFn(changes) {
for(var i = 0, len = changes.length; i < len; i++) {
observer.onNext(changes[i]);
}
}
Object.observe(obj, observerFn);
return function () {
Object.unobserve(obj, observerFn);
};
});
};
var NeverObservable = (function(__super__) {
inherits(NeverObservable, __super__);
function NeverObservable() {
__super__.call(this);
}
NeverObservable.prototype.subscribeCore = function (observer) {
return disposableEmpty;
};
return NeverObservable;
}(ObservableBase));
/**
* Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
* @returns {Observable} An observable sequence whose observers will never get called.
*/
var observableNever = Observable.never = function () {
return new NeverObservable();
};
var PairsObservable = (function(__super__) {
inherits(PairsObservable, __super__);
function PairsObservable(obj, scheduler) {
this.obj = obj;
this.keys = Object.keys(obj);
this.scheduler = scheduler;
__super__.call(this);
}
PairsObservable.prototype.subscribeCore = function (observer) {
var sink = new PairsSink(observer, this);
return sink.run();
};
return PairsObservable;
}(ObservableBase));
function PairsSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
PairsSink.prototype.run = function () {
var observer = this.observer, obj = this.parent.obj, keys = this.parent.keys, len = keys.length;
function loopRecursive(i, recurse) {
if (i < len) {
var key = keys[i];
observer.onNext([key, obj[key]]);
recurse(i + 1);
} else {
observer.onCompleted();
}
}
return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
};
/**
* Convert an object into an observable sequence of [key, value] pairs.
* @param {Object} obj The object to inspect.
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
* @returns {Observable} An observable sequence of [key, value] pairs from the object.
*/
Observable.pairs = function (obj, scheduler) {
scheduler || (scheduler = currentThreadScheduler);
return new PairsObservable(obj, scheduler);
};
var RangeObservable = (function(__super__) {
inherits(RangeObservable, __super__);
function RangeObservable(start, count, scheduler) {
this.start = start;
this.rangeCount = count;
this.scheduler = scheduler;
__super__.call(this);
}
RangeObservable.prototype.subscribeCore = function (observer) {
var sink = new RangeSink(observer, this);
return sink.run();
};
return RangeObservable;
}(ObservableBase));
var RangeSink = (function () {
function RangeSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
RangeSink.prototype.run = function () {
var start = this.parent.start, count = this.parent.rangeCount, observer = this.observer;
function loopRecursive(i, recurse) {
if (i < count) {
observer.onNext(start + i);
recurse(i + 1);
} else {
observer.onCompleted();
}
}
return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
};
return RangeSink;
}());
/**
* Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
* @param {Number} start The value of the first integer in the sequence.
* @param {Number} count The number of sequential integers to generate.
* @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread.
* @returns {Observable} An observable sequence that contains a range of sequential integral numbers.
*/
Observable.range = function (start, count, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new RangeObservable(start, count, scheduler);
};
var RepeatObservable = (function(__super__) {
inherits(RepeatObservable, __super__);
function RepeatObservable(value, repeatCount, scheduler) {
this.value = value;
this.repeatCount = repeatCount == null ? -1 : repeatCount;
this.scheduler = scheduler;
__super__.call(this);
}
RepeatObservable.prototype.subscribeCore = function (observer) {
var sink = new RepeatSink(observer, this);
return sink.run();
};
return RepeatObservable;
}(ObservableBase));
function RepeatSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
RepeatSink.prototype.run = function () {
var observer = this.observer, value = this.parent.value;
function loopRecursive(i, recurse) {
if (i === -1 || i > 0) {
observer.onNext(value);
i > 0 && i--;
}
if (i === 0) { return observer.onCompleted(); }
recurse(i);
}
return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount, loopRecursive);
};
/**
* Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
* @param {Mixed} value Element to repeat.
* @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
* @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence that repeats the given element the specified number of times.
*/
Observable.repeat = function (value, repeatCount, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new RepeatObservable(value, repeatCount, scheduler);
};
var JustObservable = (function(__super__) {
inherits(JustObservable, __super__);
function JustObservable(value, scheduler) {
this.value = value;
this.scheduler = scheduler;
__super__.call(this);
}
JustObservable.prototype.subscribeCore = function (observer) {
var sink = new JustSink(observer, this);
return sink.run();
};
function JustSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
function scheduleItem(s, state) {
var value = state[0], observer = state[1];
observer.onNext(value);
observer.onCompleted();
}
JustSink.prototype.run = function () {
return this.parent.scheduler.scheduleWithState([this.parent.value, this.observer], scheduleItem);
};
return JustObservable;
}(ObservableBase));
/**
* Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
* There is an alias called 'just' or browsers <IE9.
* @param {Mixed} value Single element in the resulting observable sequence.
* @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence containing the single specified element.
*/
var observableReturn = Observable['return'] = Observable.just = Observable.returnValue = function (value, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new JustObservable(value, scheduler);
};
var ThrowObservable = (function(__super__) {
inherits(ThrowObservable, __super__);
function ThrowObservable(error, scheduler) {
this.error = error;
this.scheduler = scheduler;
__super__.call(this);
}
ThrowObservable.prototype.subscribeCore = function (o) {
var sink = new ThrowSink(o, this);
return sink.run();
};
function ThrowSink(o, p) {
this.o = o;
this.p = p;
}
function scheduleItem(s, state) {
var e = state[0], o = state[1];
o.onError(e);
}
ThrowSink.prototype.run = function () {
return this.p.scheduler.scheduleWithState([this.p.error, this.o], scheduleItem);
};
return ThrowObservable;
}(ObservableBase));
/**
* Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
* There is an alias to this method called 'throwError' for browsers <IE9.
* @param {Mixed} error An object used for the sequence's termination.
* @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
*/
var observableThrow = Observable['throw'] = Observable.throwError = Observable.throwException = function (error, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new ThrowObservable(error, scheduler);
};
/**
* Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime.
* @param {Function} resourceFactory Factory function to obtain a resource object.
* @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource.
* @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object.
*/
Observable.using = function (resourceFactory, observableFactory) {
return new AnonymousObservable(function (observer) {
var disposable = disposableEmpty, resource, source;
try {
resource = resourceFactory();
resource && (disposable = resource);
source = observableFactory(resource);
} catch (exception) {
return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable);
}
return new CompositeDisposable(source.subscribe(observer), disposable);
});
};
/**
* Propagates the observable sequence or Promise that reacts first.
* @param {Observable} rightSource Second observable sequence or Promise.
* @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first.
*/
observableProto.amb = function (rightSource) {
var leftSource = this;
return new AnonymousObservable(function (observer) {
var choice,
leftChoice = 'L', rightChoice = 'R',
leftSubscription = new SingleAssignmentDisposable(),
rightSubscription = new SingleAssignmentDisposable();
isPromise(rightSource) && (rightSource = observableFromPromise(rightSource));
function choiceL() {
if (!choice) {
choice = leftChoice;
rightSubscription.dispose();
}
}
function choiceR() {
if (!choice) {
choice = rightChoice;
leftSubscription.dispose();
}
}
leftSubscription.setDisposable(leftSource.subscribe(function (left) {
choiceL();
choice === leftChoice && observer.onNext(left);
}, function (err) {
choiceL();
choice === leftChoice && observer.onError(err);
}, function () {
choiceL();
choice === leftChoice && observer.onCompleted();
}));
rightSubscription.setDisposable(rightSource.subscribe(function (right) {
choiceR();
choice === rightChoice && observer.onNext(right);
}, function (err) {
choiceR();
choice === rightChoice && observer.onError(err);
}, function () {
choiceR();
choice === rightChoice && observer.onCompleted();
}));
return new CompositeDisposable(leftSubscription, rightSubscription);
});
};
/**
* Propagates the observable sequence or Promise that reacts first.
*
* @example
* var = Rx.Observable.amb(xs, ys, zs);
* @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
*/
Observable.amb = function () {
var acc = observableNever(), items = [];
if (Array.isArray(arguments[0])) {
items = arguments[0];
} else {
for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
}
function func(previous, current) {
return previous.amb(current);
}
for (var i = 0, len = items.length; i < len; i++) {
acc = func(acc, items[i]);
}
return acc;
};
function observableCatchHandler(source, handler) {
return new AnonymousObservable(function (o) {
var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable();
subscription.setDisposable(d1);
d1.setDisposable(source.subscribe(function (x) { o.onNext(x); }, function (e) {
try {
var result = handler(e);
} catch (ex) {
return o.onError(ex);
}
isPromise(result) && (result = observableFromPromise(result));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(result.subscribe(o));
}, function (x) { o.onCompleted(x); }));
return subscription;
}, source);
}
/**
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
* @example
* 1 - xs.catchException(ys)
* 2 - xs.catchException(function (ex) { return ys(ex); })
* @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
* @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
*/
observableProto['catch'] = observableProto.catchError = observableProto.catchException = function (handlerOrSecond) {
return typeof handlerOrSecond === 'function' ?
observableCatchHandler(this, handlerOrSecond) :
observableCatch([this, handlerOrSecond]);
};
/**
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
* @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs.
* @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
*/
var observableCatch = Observable.catchError = Observable['catch'] = Observable.catchException = function () {
var items = [];
if (Array.isArray(arguments[0])) {
items = arguments[0];
} else {
for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
}
return enumerableOf(items).catchError();
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
* This can be in the form of an argument list of observables or an array.
*
* @example
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
observableProto.combineLatest = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
if (Array.isArray(args[0])) {
args[0].unshift(this);
} else {
args.unshift(this);
}
return combineLatest.apply(this, args);
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
*
* @example
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
var combineLatest = Observable.combineLatest = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
var resultSelector = args.pop();
Array.isArray(args[0]) && (args = args[0]);
return new AnonymousObservable(function (o) {
var n = args.length,
falseFactory = function () { return false; },
hasValue = arrayInitialize(n, falseFactory),
hasValueAll = false,
isDone = arrayInitialize(n, falseFactory),
values = new Array(n);
function next(i) {
hasValue[i] = true;
if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
try {
var res = resultSelector.apply(null, values);
} catch (e) {
return o.onError(e);
}
o.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
o.onCompleted();
}
}
function done (i) {
isDone[i] = true;
isDone.every(identity) && o.onCompleted();
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var source = args[i], sad = new SingleAssignmentDisposable();
isPromise(source) && (source = observableFromPromise(source));
sad.setDisposable(source.subscribe(function (x) {
values[i] = x;
next(i);
},
function(e) { o.onError(e); },
function () { done(i); }
));
subscriptions[i] = sad;
}(idx));
}
return new CompositeDisposable(subscriptions);
}, this);
};
/**
* Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
*/
observableProto.concat = function () {
for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
args.unshift(this);
return observableConcat.apply(null, args);
};
var ConcatObservable = (function(__super__) {
inherits(ConcatObservable, __super__);
function ConcatObservable(sources) {
this.sources = sources;
__super__.call(this);
}
ConcatObservable.prototype.subscribeCore = function(o) {
var sink = new ConcatSink(this.sources, o);
return sink.run();
};
function ConcatSink(sources, o) {
this.sources = sources;
this.o = o;
}
ConcatSink.prototype.run = function () {
var isDisposed, subscription = new SerialDisposable(), sources = this.sources, length = sources.length, o = this.o;
var cancelable = immediateScheduler.scheduleRecursiveWithState(0, function (i, self) {
if (isDisposed) { return; }
if (i === length) {
return o.onCompleted();
}
// Check if promise
var currentValue = sources[i];
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(currentValue.subscribe(
function (x) { o.onNext(x); },
function (e) { o.onError(e); },
function () { self(i + 1); }
));
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
};
return ConcatObservable;
}(ObservableBase));
/**
* Concatenates all the observable sequences.
* @param {Array | Arguments} args Arguments or an array to concat to the observable sequence.
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
*/
var observableConcat = Observable.concat = function () {
var args;
if (Array.isArray(arguments[0])) {
args = arguments[0];
} else {
args = new Array(arguments.length);
for(var i = 0, len = arguments.length; i < len; i++) { args[i] = arguments[i]; }
}
return new ConcatObservable(args);
};
/**
* Concatenates an observable sequence of observable sequences.
* @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
*/
observableProto.concatAll = observableProto.concatObservable = function () {
return this.merge(1);
};
var MergeObservable = (function (__super__) {
inherits(MergeObservable, __super__);
function MergeObservable(source, maxConcurrent) {
this.source = source;
this.maxConcurrent = maxConcurrent;
__super__.call(this);
}
MergeObservable.prototype.subscribeCore = function(observer) {
var g = new CompositeDisposable();
g.add(this.source.subscribe(new MergeObserver(observer, this.maxConcurrent, g)));
return g;
};
return MergeObservable;
}(ObservableBase));
var MergeObserver = (function () {
function MergeObserver(o, max, g) {
this.o = o;
this.max = max;
this.g = g;
this.done = false;
this.q = [];
this.activeCount = 0;
this.isStopped = false;
}
MergeObserver.prototype.handleSubscribe = function (xs) {
var sad = new SingleAssignmentDisposable();
this.g.add(sad);
isPromise(xs) && (xs = observableFromPromise(xs));
sad.setDisposable(xs.subscribe(new InnerObserver(this, sad)));
};
MergeObserver.prototype.onNext = function (innerSource) {
if (this.isStopped) { return; }
if(this.activeCount < this.max) {
this.activeCount++;
this.handleSubscribe(innerSource);
} else {
this.q.push(innerSource);
}
};
MergeObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
}
};
MergeObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.done = true;
this.activeCount === 0 && this.o.onCompleted();
}
};
MergeObserver.prototype.dispose = function() { this.isStopped = true; };
MergeObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
function InnerObserver(parent, sad) {
this.parent = parent;
this.sad = sad;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.parent.o.onNext(x); } };
InnerObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
}
};
InnerObserver.prototype.onCompleted = function () {
if(!this.isStopped) {
this.isStopped = true;
var parent = this.parent;
parent.g.remove(this.sad);
if (parent.q.length > 0) {
parent.handleSubscribe(parent.q.shift());
} else {
parent.activeCount--;
parent.done && parent.activeCount === 0 && parent.o.onCompleted();
}
}
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
return true;
}
return false;
};
return MergeObserver;
}());
/**
* Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
* Or merges two observable sequences into a single observable sequence.
*
* @example
* 1 - merged = sources.merge(1);
* 2 - merged = source.merge(otherSource);
* @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
*/
observableProto.merge = function (maxConcurrentOrOther) {
return typeof maxConcurrentOrOther !== 'number' ?
observableMerge(this, maxConcurrentOrOther) :
new MergeObservable(this, maxConcurrentOrOther);
};
/**
* Merges all the observable sequences into a single observable sequence.
* The scheduler is optional and if not specified, the immediate scheduler is used.
* @returns {Observable} The observable sequence that merges the elements of the observable sequences.
*/
var observableMerge = Observable.merge = function () {
var scheduler, sources = [], i, len = arguments.length;
if (!arguments[0]) {
scheduler = immediateScheduler;
for(i = 1; i < len; i++) { sources.push(arguments[i]); }
} else if (isScheduler(arguments[0])) {
scheduler = arguments[0];
for(i = 1; i < len; i++) { sources.push(arguments[i]); }
} else {
scheduler = immediateScheduler;
for(i = 0; i < len; i++) { sources.push(arguments[i]); }
}
if (Array.isArray(sources[0])) {
sources = sources[0];
}
return observableOf(scheduler, sources).mergeAll();
};
var MergeAllObservable = (function (__super__) {
inherits(MergeAllObservable, __super__);
function MergeAllObservable(source) {
this.source = source;
__super__.call(this);
}
MergeAllObservable.prototype.subscribeCore = function (observer) {
var g = new CompositeDisposable(), m = new SingleAssignmentDisposable();
g.add(m);
m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g)));
return g;
};
function MergeAllObserver(o, g) {
this.o = o;
this.g = g;
this.isStopped = false;
this.done = false;
}
MergeAllObserver.prototype.onNext = function(innerSource) {
if(this.isStopped) { return; }
var sad = new SingleAssignmentDisposable();
this.g.add(sad);
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
sad.setDisposable(innerSource.subscribe(new InnerObserver(this, this.g, sad)));
};
MergeAllObserver.prototype.onError = function (e) {
if(!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
}
};
MergeAllObserver.prototype.onCompleted = function () {
if(!this.isStopped) {
this.isStopped = true;
this.done = true;
this.g.length === 1 && this.o.onCompleted();
}
};
MergeAllObserver.prototype.dispose = function() { this.isStopped = true; };
MergeAllObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
function InnerObserver(parent, g, sad) {
this.parent = parent;
this.g = g;
this.sad = sad;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } };
InnerObserver.prototype.onError = function (e) {
if(!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
}
};
InnerObserver.prototype.onCompleted = function () {
if(!this.isStopped) {
var parent = this.parent;
this.isStopped = true;
parent.g.remove(this.sad);
parent.done && parent.g.length === 1 && parent.o.onCompleted();
}
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
return true;
}
return false;
};
return MergeAllObservable;
}(ObservableBase));
/**
* Merges an observable sequence of observable sequences into an observable sequence.
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
*/
observableProto.mergeAll = observableProto.mergeObservable = function () {
return new MergeAllObservable(this);
};
var CompositeError = Rx.CompositeError = function(errors) {
this.name = "NotImplementedError";
this.innerErrors = errors;
this.message = 'This contains multiple errors. Check the innerErrors';
Error.call(this);
}
CompositeError.prototype = Error.prototype;
/**
* Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
* receive all successfully emitted items from all of the source Observables without being interrupted by
* an error notification from one of them.
*
* This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
* error via the Observer's onError, mergeDelayError will refrain from propagating that
* error notification until all of the merged Observables have finished emitting items.
* @param {Array | Arguments} args Arguments or an array to merge.
* @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
*/
Observable.mergeDelayError = function() {
var args;
if (Array.isArray(arguments[0])) {
args = arguments[0];
} else {
var len = arguments.length;
args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
}
var source = observableOf(null, args);
return new AnonymousObservable(function (o) {
var group = new CompositeDisposable(),
m = new SingleAssignmentDisposable(),
isStopped = false,
errors = [];
function setCompletion() {
if (errors.length === 0) {
o.onCompleted();
} else if (errors.length === 1) {
o.onError(errors[0]);
} else {
o.onError(new CompositeError(errors));
}
}
group.add(m);
m.setDisposable(source.subscribe(
function (innerSource) {
var innerSubscription = new SingleAssignmentDisposable();
group.add(innerSubscription);
// Check for promises support
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
innerSubscription.setDisposable(innerSource.subscribe(
function (x) { o.onNext(x); },
function (e) {
errors.push(e);
group.remove(innerSubscription);
isStopped && group.length === 1 && setCompletion();
},
function () {
group.remove(innerSubscription);
isStopped && group.length === 1 && setCompletion();
}));
},
function (e) {
errors.push(e);
isStopped = true;
group.length === 1 && setCompletion();
},
function () {
isStopped = true;
group.length === 1 && setCompletion();
}));
return group;
});
};
/**
* Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
* @param {Observable} second Second observable sequence used to produce results after the first sequence terminates.
* @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally.
*/
observableProto.onErrorResumeNext = function (second) {
if (!second) { throw new Error('Second observable is required'); }
return onErrorResumeNext([this, second]);
};
/**
* Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
*
* @example
* 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs);
* 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]);
* @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.
*/
var onErrorResumeNext = Observable.onErrorResumeNext = function () {
var sources = [];
if (Array.isArray(arguments[0])) {
sources = arguments[0];
} else {
for(var i = 0, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
}
return new AnonymousObservable(function (observer) {
var pos = 0, subscription = new SerialDisposable(),
cancelable = immediateScheduler.scheduleRecursive(function (self) {
var current, d;
if (pos < sources.length) {
current = sources[pos++];
isPromise(current) && (current = observableFromPromise(current));
d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(current.subscribe(observer.onNext.bind(observer), self, self));
} else {
observer.onCompleted();
}
});
return new CompositeDisposable(subscription, cancelable);
});
};
/**
* Returns the values from the source observable sequence only after the other observable sequence produces a value.
* @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence.
* @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.
*/
observableProto.skipUntil = function (other) {
var source = this;
return new AnonymousObservable(function (o) {
var isOpen = false;
var disposables = new CompositeDisposable(source.subscribe(function (left) {
isOpen && o.onNext(left);
}, function (e) { o.onError(e); }, function () {
isOpen && o.onCompleted();
}));
isPromise(other) && (other = observableFromPromise(other));
var rightSubscription = new SingleAssignmentDisposable();
disposables.add(rightSubscription);
rightSubscription.setDisposable(other.subscribe(function () {
isOpen = true;
rightSubscription.dispose();
}, function (e) { o.onError(e); }, function () {
rightSubscription.dispose();
}));
return disposables;
}, source);
};
var SwitchObservable = (function(__super__) {
inherits(SwitchObservable, __super__);
function SwitchObservable(source) {
this.source = source;
__super__.call(this);
}
SwitchObservable.prototype.subscribeCore = function (o) {
var inner = new SerialDisposable(), s = this.source.subscribe(new SwitchObserver(o, inner));
return new CompositeDisposable(s, inner);
};
function SwitchObserver(o, inner) {
this.o = o;
this.inner = inner;
this.stopped = false;
this.latest = 0;
this.hasLatest = false;
this.isStopped = false;
}
SwitchObserver.prototype.onNext = function (innerSource) {
if (this.isStopped) { return; }
var d = new SingleAssignmentDisposable(), id = ++this.latest;
this.hasLatest = true;
this.inner.setDisposable(d);
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
d.setDisposable(innerSource.subscribe(new InnerObserver(this, id)));
};
SwitchObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
}
};
SwitchObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.stopped = true;
!this.hasLatest && this.o.onCompleted();
}
};
SwitchObserver.prototype.dispose = function () { this.isStopped = true; };
SwitchObserver.prototype.fail = function (e) {
if(!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
function InnerObserver(parent, id) {
this.parent = parent;
this.id = id;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) {
if (this.isStopped) { return; }
this.parent.latest === this.id && this.parent.o.onNext(x);
};
InnerObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.parent.latest === this.id && this.parent.o.onError(e);
}
};
InnerObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
if (this.parent.latest === this.id) {
this.parent.hasLatest = false;
this.parent.isStopped && this.parent.o.onCompleted();
}
}
};
InnerObserver.prototype.dispose = function () { this.isStopped = true; }
InnerObserver.prototype.fail = function (e) {
if(!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
return true;
}
return false;
};
return SwitchObservable;
}(ObservableBase));
/**
* Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
* @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
*/
observableProto['switch'] = observableProto.switchLatest = function () {
return new SwitchObservable(this);
};
var TakeUntilObservable = (function(__super__) {
inherits(TakeUntilObservable, __super__);
function TakeUntilObservable(source, other) {
this.source = source;
this.other = isPromise(other) ? observableFromPromise(other) : other;
__super__.call(this);
}
TakeUntilObservable.prototype.subscribeCore = function(o) {
return new CompositeDisposable(
this.source.subscribe(o),
this.other.subscribe(new InnerObserver(o))
);
};
function InnerObserver(o) {
this.o = o;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) {
if (this.isStopped) { return; }
this.o.onCompleted();
};
InnerObserver.prototype.onError = function (err) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(err);
}
};
InnerObserver.prototype.onCompleted = function () {
!this.isStopped && (this.isStopped = true);
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return TakeUntilObservable;
}(ObservableBase));
/**
* Returns the values from the source observable sequence until the other observable sequence produces a value.
* @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence.
* @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
*/
observableProto.takeUntil = function (other) {
return new TakeUntilObservable(this, other);
};
function falseFactory() { return false; }
/**
* Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element.
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
observableProto.withLatestFrom = function () {
var len = arguments.length, args = new Array(len)
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
var resultSelector = args.pop(), source = this;
Array.isArray(args[0]) && (args = args[0]);
return new AnonymousObservable(function (observer) {
var n = args.length,
hasValue = arrayInitialize(n, falseFactory),
hasValueAll = false,
values = new Array(n);
var subscriptions = new Array(n + 1);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var other = args[i], sad = new SingleAssignmentDisposable();
isPromise(other) && (other = observableFromPromise(other));
sad.setDisposable(other.subscribe(function (x) {
values[i] = x;
hasValue[i] = true;
hasValueAll = hasValue.every(identity);
}, function (e) { observer.onError(e); }, noop));
subscriptions[i] = sad;
}(idx));
}
var sad = new SingleAssignmentDisposable();
sad.setDisposable(source.subscribe(function (x) {
var allValues = [x].concat(values);
if (!hasValueAll) { return; }
var res = tryCatch(resultSelector).apply(null, allValues);
if (res === errorObj) { return observer.onError(res.e); }
observer.onNext(res);
}, function (e) { observer.onError(e); }, function () {
observer.onCompleted();
}));
subscriptions[n] = sad;
return new CompositeDisposable(subscriptions);
}, this);
};
function zipArray(second, resultSelector) {
var first = this;
return new AnonymousObservable(function (o) {
var index = 0, len = second.length;
return first.subscribe(function (left) {
if (index < len) {
var right = second[index++], res = tryCatch(resultSelector)(left, right);
if (res === errorObj) { return o.onError(res.e); }
o.onNext(res);
} else {
o.onCompleted();
}
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, first);
}
function falseFactory() { return false; }
function emptyArrayFactory() { return []; }
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index.
* The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args.
* @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function.
*/
observableProto.zip = function () {
if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); }
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
var parent = this, resultSelector = args.pop();
args.unshift(parent);
return new AnonymousObservable(function (o) {
var n = args.length,
queues = arrayInitialize(n, emptyArrayFactory),
isDone = arrayInitialize(n, falseFactory);
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var source = args[i], sad = new SingleAssignmentDisposable();
isPromise(source) && (source = observableFromPromise(source));
sad.setDisposable(source.subscribe(function (x) {
queues[i].push(x);
if (queues.every(function (x) { return x.length > 0; })) {
var queuedValues = queues.map(function (x) { return x.shift(); }),
res = tryCatch(resultSelector).apply(parent, queuedValues);
if (res === errorObj) { return o.onError(res.e); }
o.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
o.onCompleted();
}
}, function (e) { o.onError(e); }, function () {
isDone[i] = true;
isDone.every(identity) && o.onCompleted();
}));
subscriptions[i] = sad;
})(idx);
}
return new CompositeDisposable(subscriptions);
}, parent);
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
* @param arguments Observable sources.
* @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources.
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
Observable.zip = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
var first = args.shift();
return first.zip.apply(first, args);
};
function falseFactory() { return false; }
function arrayFactory() { return []; }
/**
* Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
* @param arguments Observable sources.
* @returns {Observable} An observable sequence containing lists of elements at corresponding indexes.
*/
Observable.zipArray = function () {
var sources;
if (Array.isArray(arguments[0])) {
sources = arguments[0];
} else {
var len = arguments.length;
sources = new Array(len);
for(var i = 0; i < len; i++) { sources[i] = arguments[i]; }
}
return new AnonymousObservable(function (o) {
var n = sources.length,
queues = arrayInitialize(n, arrayFactory),
isDone = arrayInitialize(n, falseFactory);
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
subscriptions[i] = new SingleAssignmentDisposable();
subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
queues[i].push(x);
if (queues.every(function (x) { return x.length > 0; })) {
var res = queues.map(function (x) { return x.shift(); });
o.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
return o.onCompleted();
}
}, function (e) { o.onError(e); }, function () {
isDone[i] = true;
isDone.every(identity) && o.onCompleted();
}));
})(idx);
}
return new CompositeDisposable(subscriptions);
});
};
/**
* Hides the identity of an observable sequence.
* @returns {Observable} An observable sequence that hides the identity of the source sequence.
*/
observableProto.asObservable = function () {
var source = this;
return new AnonymousObservable(function (o) { return source.subscribe(o); }, source);
};
/**
* Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
*
* @example
* var res = xs.bufferWithCount(10);
* var res = xs.bufferWithCount(10, 1);
* @param {Number} count Length of each buffer.
* @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count.
* @returns {Observable} An observable sequence of buffers.
*/
observableProto.bufferWithCount = function (count, skip) {
if (typeof skip !== 'number') {
skip = count;
}
return this.windowWithCount(count, skip).selectMany(function (x) {
return x.toArray();
}).where(function (x) {
return x.length > 0;
});
};
/**
* Dematerializes the explicit notification values of an observable sequence as implicit notifications.
* @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
*/
observableProto.dematerialize = function () {
var source = this;
return new AnonymousObservable(function (o) {
return source.subscribe(function (x) { return x.accept(o); }, function(e) { o.onError(e); }, function () { o.onCompleted(); });
}, this);
};
/**
* Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
*
* var obs = observable.distinctUntilChanged();
* var obs = observable.distinctUntilChanged(function (x) { return x.id; });
* var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
*
* @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
* @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
* @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
*/
observableProto.distinctUntilChanged = function (keySelector, comparer) {
var source = this;
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (o) {
var hasCurrentKey = false, currentKey;
return source.subscribe(function (value) {
var key = value;
if (keySelector) {
key = tryCatch(keySelector)(value);
if (key === errorObj) { return o.onError(key.e); }
}
if (hasCurrentKey) {
var comparerEquals = tryCatch(comparer)(currentKey, key);
if (comparerEquals === errorObj) { return o.onError(comparerEquals.e); }
}
if (!hasCurrentKey || !comparerEquals) {
hasCurrentKey = true;
currentKey = key;
o.onNext(value);
}
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, this);
};
var TapObservable = (function(__super__) {
inherits(TapObservable,__super__);
function TapObservable(source, observerOrOnNext, onError, onCompleted) {
this.source = source;
this.t = !observerOrOnNext || isFunction(observerOrOnNext) ?
observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
observerOrOnNext;
__super__.call(this);
}
TapObservable.prototype.subscribeCore = function(o) {
return this.source.subscribe(new InnerObserver(o, this.t));
};
function InnerObserver(o, t) {
this.o = o;
this.t = t;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function(x) {
if (this.isStopped) { return; }
var res = tryCatch(this.t.onNext).call(this.t, x);
if (res === errorObj) { this.o.onError(res.e); }
this.o.onNext(x);
};
InnerObserver.prototype.onError = function(err) {
if (!this.isStopped) {
this.isStopped = true;
var res = tryCatch(this.t.onError).call(this.t, err);
if (res === errorObj) { return this.o.onError(res.e); }
this.o.onError(err);
}
};
InnerObserver.prototype.onCompleted = function() {
if (!this.isStopped) {
this.isStopped = true;
var res = tryCatch(this.t.onCompleted).call(this.t);
if (res === errorObj) { return this.o.onError(res.e); }
this.o.onCompleted();
}
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return TapObservable;
}(ObservableBase));
/**
* Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
* @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an o.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
return new TapObservable(this, observerOrOnNext, onError, onCompleted);
};
/**
* Invokes an action for each element in the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
* @param {Function} onNext Action to invoke for each element in the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) {
return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext);
};
/**
* Invokes an action upon exceptional termination of the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
* @param {Function} onError Action to invoke upon exceptional termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) {
return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError);
};
/**
* Invokes an action upon graceful termination of the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
* @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) {
return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted);
};
/**
* Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
* @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
* @returns {Observable} Source sequence with the action-invoking termination behavior applied.
*/
observableProto['finally'] = observableProto.ensure = function (action) {
var source = this;
return new AnonymousObservable(function (observer) {
var subscription;
try {
subscription = source.subscribe(observer);
} catch (e) {
action();
throw e;
}
return disposableCreate(function () {
try {
subscription.dispose();
} catch (e) {
throw e;
} finally {
action();
}
});
}, this);
};
/**
* @deprecated use #finally or #ensure instead.
*/
observableProto.finallyAction = function (action) {
//deprecate('finallyAction', 'finally or ensure');
return this.ensure(action);
};
var IgnoreElementsObservable = (function(__super__) {
inherits(IgnoreElementsObservable, __super__);
function IgnoreElementsObservable(source) {
this.source = source;
__super__.call(this);
}
IgnoreElementsObservable.prototype.subscribeCore = function (o) {
return this.source.subscribe(new InnerObserver(o));
};
function InnerObserver(o) {
this.o = o;
this.isStopped = false;
}
InnerObserver.prototype.onNext = noop;
InnerObserver.prototype.onError = function (err) {
if(!this.isStopped) {
this.isStopped = true;
this.o.onError(err);
}
};
InnerObserver.prototype.onCompleted = function () {
if(!this.isStopped) {
this.isStopped = true;
this.o.onCompleted();
}
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.observer.onError(e);
return true;
}
return false;
};
return IgnoreElementsObservable;
}(ObservableBase));
/**
* Ignores all elements in an observable sequence leaving only the termination messages.
* @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
*/
observableProto.ignoreElements = function () {
return new IgnoreElementsObservable(this);
};
/**
* Materializes the implicit notifications of an observable sequence as explicit notification values.
* @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
*/
observableProto.materialize = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(function (value) {
observer.onNext(notificationCreateOnNext(value));
}, function (e) {
observer.onNext(notificationCreateOnError(e));
observer.onCompleted();
}, function () {
observer.onNext(notificationCreateOnCompleted());
observer.onCompleted();
});
}, source);
};
/**
* Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.
* @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.
* @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly.
*/
observableProto.repeat = function (repeatCount) {
return enumerableRepeat(this, repeatCount).concat();
};
/**
* Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely.
* Note if you encounter an error and want it to retry once, then you must use .retry(2);
*
* @example
* var res = retried = retry.repeat();
* var res = retried = retry.repeat(2);
* @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely.
* @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
*/
observableProto.retry = function (retryCount) {
return enumerableRepeat(this, retryCount).catchError();
};
/**
* Repeats the source observable sequence upon error each time the notifier emits or until it successfully terminates.
* if the notifier completes, the observable sequence completes.
*
* @example
* var timer = Observable.timer(500);
* var source = observable.retryWhen(timer);
* @param {Observable} [notifier] An observable that triggers the retries or completes the observable with onNext or onCompleted respectively.
* @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
*/
observableProto.retryWhen = function (notifier) {
return enumerableRepeat(this).catchErrorWhen(notifier);
};
var ScanObservable = (function(__super__) {
inherits(ScanObservable, __super__);
function ScanObservable(source, accumulator, hasSeed, seed) {
this.source = source;
this.accumulator = accumulator;
this.hasSeed = hasSeed;
this.seed = seed;
__super__.call(this);
}
ScanObservable.prototype.subscribeCore = function(observer) {
return this.source.subscribe(new ScanObserver(observer,this));
};
return ScanObservable;
}(ObservableBase));
function ScanObserver(observer, parent) {
this.observer = observer;
this.accumulator = parent.accumulator;
this.hasSeed = parent.hasSeed;
this.seed = parent.seed;
this.hasAccumulation = false;
this.accumulation = null;
this.hasValue = false;
this.isStopped = false;
}
ScanObserver.prototype.onNext = function (x) {
if (this.isStopped) { return; }
!this.hasValue && (this.hasValue = true);
try {
if (this.hasAccumulation) {
this.accumulation = this.accumulator(this.accumulation, x);
} else {
this.accumulation = this.hasSeed ? this.accumulator(this.seed, x) : x;
this.hasAccumulation = true;
}
} catch (e) {
return this.observer.onError(e);
}
this.observer.onNext(this.accumulation);
};
ScanObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.observer.onError(e);
}
};
ScanObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
!this.hasValue && this.hasSeed && this.observer.onNext(this.seed);
this.observer.onCompleted();
}
};
ScanObserver.prototype.dispose = function() { this.isStopped = true; };
ScanObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.observer.onError(e);
return true;
}
return false;
};
/**
* Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
* For aggregation behavior with no intermediate results, see Observable.aggregate.
* @param {Mixed} [seed] The initial accumulator value.
* @param {Function} accumulator An accumulator function to be invoked on each element.
* @returns {Observable} An observable sequence containing the accumulated values.
*/
observableProto.scan = function () {
var hasSeed = false, seed, accumulator, source = this;
if (arguments.length === 2) {
hasSeed = true;
seed = arguments[0];
accumulator = arguments[1];
} else {
accumulator = arguments[0];
}
return new ScanObservable(this, accumulator, hasSeed, seed);
};
/**
* Bypasses a specified number of elements at the end of an observable sequence.
* @description
* This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are
* received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.
* @param count Number of elements to bypass at the end of the source sequence.
* @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
*/
observableProto.skipLast = function (count) {
if (count < 0) { throw new ArgumentOutOfRangeError(); }
var source = this;
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
q.length > count && o.onNext(q.shift());
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
/**
* Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.
* @example
* var res = source.startWith(1, 2, 3);
* var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3);
* @param {Arguments} args The specified values to prepend to the observable sequence
* @returns {Observable} The source sequence prepended with the specified values.
*/
observableProto.startWith = function () {
var values, scheduler, start = 0;
if (!!arguments.length && isScheduler(arguments[0])) {
scheduler = arguments[0];
start = 1;
} else {
scheduler = immediateScheduler;
}
for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
return enumerableOf([observableFromArray(args, scheduler), this]).concat();
};
/**
* Returns a specified number of contiguous elements from the end of an observable sequence.
* @description
* This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of
* the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
* @param {Number} count Number of elements to take from the end of the source sequence.
* @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
*/
observableProto.takeLast = function (count) {
if (count < 0) { throw new ArgumentOutOfRangeError(); }
var source = this;
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
q.length > count && q.shift();
}, function (e) { o.onError(e); }, function () {
while (q.length > 0) { o.onNext(q.shift()); }
o.onCompleted();
});
}, source);
};
/**
* Returns an array with the specified number of contiguous elements from the end of an observable sequence.
*
* @description
* This operator accumulates a buffer with a length enough to store count elements. Upon completion of the
* source sequence, this buffer is produced on the result sequence.
* @param {Number} count Number of elements to take from the end of the source sequence.
* @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence.
*/
observableProto.takeLastBuffer = function (count) {
var source = this;
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
q.length > count && q.shift();
}, function (e) { o.onError(e); }, function () {
o.onNext(q);
o.onCompleted();
});
}, source);
};
/**
* Projects each element of an observable sequence into zero or more windows which are produced based on element count information.
*
* var res = xs.windowWithCount(10);
* var res = xs.windowWithCount(10, 1);
* @param {Number} count Length of each window.
* @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count.
* @returns {Observable} An observable sequence of windows.
*/
observableProto.windowWithCount = function (count, skip) {
var source = this;
+count || (count = 0);
Math.abs(count) === Infinity && (count = 0);
if (count <= 0) { throw new ArgumentOutOfRangeError(); }
skip == null && (skip = count);
+skip || (skip = 0);
Math.abs(skip) === Infinity && (skip = 0);
if (skip <= 0) { throw new ArgumentOutOfRangeError(); }
return new AnonymousObservable(function (observer) {
var m = new SingleAssignmentDisposable(),
refCountDisposable = new RefCountDisposable(m),
n = 0,
q = [];
function createWindow () {
var s = new Subject();
q.push(s);
observer.onNext(addRef(s, refCountDisposable));
}
createWindow();
m.setDisposable(source.subscribe(
function (x) {
for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
var c = n - count + 1;
c >= 0 && c % skip === 0 && q.shift().onCompleted();
++n % skip === 0 && createWindow();
},
function (e) {
while (q.length > 0) { q.shift().onError(e); }
observer.onError(e);
},
function () {
while (q.length > 0) { q.shift().onCompleted(); }
observer.onCompleted();
}
));
return refCountDisposable;
}, source);
};
function concatMap(source, selector, thisArg) {
var selectorFunc = bindCallback(selector, thisArg, 3);
return source.map(function (x, i) {
var result = selectorFunc(x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
return result;
}).concatAll();
}
/**
* One of the Following:
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
*
* @example
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
* Or:
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
*
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
* Or:
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
*
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
* source sequence onto which could be either an observable or Promise.
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
if (isFunction(selector) && isFunction(resultSelector)) {
return this.concatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
(isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
return selectorResult.map(function (y, i2) {
return resultSelector(x, y, i, i2);
});
});
}
return isFunction(selector) ?
concatMap(this, selector, thisArg) :
concatMap(this, function () { return selector; });
};
/**
* Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence.
* @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
* @param {Function} onError A transform function to apply when an error occurs in the source sequence.
* @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
* @param {Any} [thisArg] An optional "this" to use to invoke each transform.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
*/
observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) {
var source = this,
onNextFunc = bindCallback(onNext, thisArg, 2),
onErrorFunc = bindCallback(onError, thisArg, 1),
onCompletedFunc = bindCallback(onCompleted, thisArg, 0);
return new AnonymousObservable(function (observer) {
var index = 0;
return source.subscribe(
function (x) {
var result;
try {
result = onNextFunc(x, index++);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
},
function (err) {
var result;
try {
result = onErrorFunc(err);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
observer.onCompleted();
},
function () {
var result;
try {
result = onCompletedFunc();
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
observer.onCompleted();
});
}, this).concatAll();
};
/**
* Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty.
*
* var res = obs = xs.defaultIfEmpty();
* 2 - obs = xs.defaultIfEmpty(false);
*
* @memberOf Observable#
* @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null.
* @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself.
*/
observableProto.defaultIfEmpty = function (defaultValue) {
var source = this;
defaultValue === undefined && (defaultValue = null);
return new AnonymousObservable(function (observer) {
var found = false;
return source.subscribe(function (x) {
found = true;
observer.onNext(x);
},
function (e) { observer.onError(e); },
function () {
!found && observer.onNext(defaultValue);
observer.onCompleted();
});
}, source);
};
// Swap out for Array.findIndex
function arrayIndexOfComparer(array, item, comparer) {
for (var i = 0, len = array.length; i < len; i++) {
if (comparer(array[i], item)) { return i; }
}
return -1;
}
function HashSet(comparer) {
this.comparer = comparer;
this.set = [];
}
HashSet.prototype.push = function(value) {
var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1;
retValue && this.set.push(value);
return retValue;
};
/**
* Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer.
* Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
*
* @example
* var res = obs = xs.distinct();
* 2 - obs = xs.distinct(function (x) { return x.id; });
* 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; });
* @param {Function} [keySelector] A function to compute the comparison key for each element.
* @param {Function} [comparer] Used to compare items in the collection.
* @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence.
*/
observableProto.distinct = function (keySelector, comparer) {
var source = this;
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (o) {
var hashSet = new HashSet(comparer);
return source.subscribe(function (x) {
var key = x;
if (keySelector) {
try {
key = keySelector(x);
} catch (e) {
o.onError(e);
return;
}
}
hashSet.push(key) && o.onNext(x);
},
function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, this);
};
/**
* Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
*
* @example
* var res = observable.groupBy(function (x) { return x.id; });
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; });
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); });
* @param {Function} keySelector A function to extract the key for each element.
* @param {Function} [elementSelector] A function to map each source element to an element in an observable group.
* @param {Function} [comparer] Used to determine whether the objects are equal.
* @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
*/
observableProto.groupBy = function (keySelector, elementSelector, comparer) {
return this.groupByUntil(keySelector, elementSelector, observableNever, comparer);
};
/**
* Groups the elements of an observable sequence according to a specified key selector function.
* A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same
* key value as a reclaimed group occurs, the group will be reborn with a new lifetime request.
*
* @example
* var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); });
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); });
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); });
* @param {Function} keySelector A function to extract the key for each element.
* @param {Function} durationSelector A function to signal the expiration of a group.
* @param {Function} [comparer] Used to compare objects. When not specified, the default comparer is used.
* @returns {Observable}
* A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
* If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered.
*
*/
observableProto.groupByUntil = function (keySelector, elementSelector, durationSelector, comparer) {
var source = this;
elementSelector || (elementSelector = identity);
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (observer) {
function handleError(e) { return function (item) { item.onError(e); }; }
var map = new Dictionary(0, comparer),
groupDisposable = new CompositeDisposable(),
refCountDisposable = new RefCountDisposable(groupDisposable);
groupDisposable.add(source.subscribe(function (x) {
var key;
try {
key = keySelector(x);
} catch (e) {
map.getValues().forEach(handleError(e));
observer.onError(e);
return;
}
var fireNewMapEntry = false,
writer = map.tryGetValue(key);
if (!writer) {
writer = new Subject();
map.set(key, writer);
fireNewMapEntry = true;
}
if (fireNewMapEntry) {
var group = new GroupedObservable(key, writer, refCountDisposable),
durationGroup = new GroupedObservable(key, writer);
try {
duration = durationSelector(durationGroup);
} catch (e) {
map.getValues().forEach(handleError(e));
observer.onError(e);
return;
}
observer.onNext(group);
var md = new SingleAssignmentDisposable();
groupDisposable.add(md);
var expire = function () {
map.remove(key) && writer.onCompleted();
groupDisposable.remove(md);
};
md.setDisposable(duration.take(1).subscribe(
noop,
function (exn) {
map.getValues().forEach(handleError(exn));
observer.onError(exn);
},
expire)
);
}
var element;
try {
element = elementSelector(x);
} catch (e) {
map.getValues().forEach(handleError(e));
observer.onError(e);
return;
}
writer.onNext(element);
}, function (ex) {
map.getValues().forEach(handleError(ex));
observer.onError(ex);
}, function () {
map.getValues().forEach(function (item) { item.onCompleted(); });
observer.onCompleted();
}));
return refCountDisposable;
}, source);
};
var MapObservable = (function (__super__) {
inherits(MapObservable, __super__);
function MapObservable(source, selector, thisArg) {
this.source = source;
this.selector = bindCallback(selector, thisArg, 3);
__super__.call(this);
}
function innerMap(selector, self) {
return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }
}
MapObservable.prototype.internalMap = function (selector, thisArg) {
return new MapObservable(this.source, innerMap(selector, this), thisArg);
};
MapObservable.prototype.subscribeCore = function (o) {
return this.source.subscribe(new InnerObserver(o, this.selector, this));
};
function InnerObserver(o, selector, source) {
this.o = o;
this.selector = selector;
this.source = source;
this.i = 0;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function(x) {
if (this.isStopped) { return; }
var result = tryCatch(this.selector)(x, this.i++, this.source);
if (result === errorObj) {
return this.o.onError(result.e);
}
this.o.onNext(result);
};
InnerObserver.prototype.onError = function (e) {
if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
};
InnerObserver.prototype.onCompleted = function () {
if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return MapObservable;
}(ObservableBase));
/**
* Projects each element of an observable sequence into a new form by incorporating the element's index.
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
*/
observableProto.map = observableProto.select = function (selector, thisArg) {
var selectorFn = typeof selector === 'function' ? selector : function () { return selector; };
return this instanceof MapObservable ?
this.internalMap(selectorFn, thisArg) :
new MapObservable(this, selectorFn, thisArg);
};
/**
* Retrieves the value of a specified nested property from all elements in
* the Observable sequence.
* @param {Arguments} arguments The nested properties to pluck.
* @returns {Observable} Returns a new Observable sequence of property values.
*/
observableProto.pluck = function () {
var args = arguments, len = arguments.length;
if (len === 0) { throw new Error('List of properties cannot be empty.'); }
return this.map(function (x) {
var currentProp = x;
for (var i = 0; i < len; i++) {
var p = currentProp[args[i]];
if (typeof p !== 'undefined') {
currentProp = p;
} else {
return undefined;
}
}
return currentProp;
});
};
function flatMap(source, selector, thisArg) {
var selectorFunc = bindCallback(selector, thisArg, 3);
return source.map(function (x, i) {
var result = selectorFunc(x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
return result;
}).mergeAll();
}
/**
* One of the Following:
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
*
* @example
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
* Or:
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
*
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
* Or:
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
*
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
if (isFunction(selector) && isFunction(resultSelector)) {
return this.flatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
(isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
return selectorResult.map(function (y, i2) {
return resultSelector(x, y, i, i2);
});
}, thisArg);
}
return isFunction(selector) ?
flatMap(this, selector, thisArg) :
flatMap(this, function () { return selector; });
};
/**
* Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
* @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
* @param {Function} onError A transform function to apply when an error occurs in the source sequence.
* @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
* @param {Any} [thisArg] An optional "this" to use to invoke each transform.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
*/
observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) {
var source = this;
return new AnonymousObservable(function (observer) {
var index = 0;
return source.subscribe(
function (x) {
var result;
try {
result = onNext.call(thisArg, x, index++);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
},
function (err) {
var result;
try {
result = onError.call(thisArg, err);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
observer.onCompleted();
},
function () {
var result;
try {
result = onCompleted.call(thisArg);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
observer.onCompleted();
});
}, source).mergeAll();
};
/**
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
*/
observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) {
return this.select(selector, thisArg).switchLatest();
};
var SkipObservable = (function(__super__) {
inherits(SkipObservable, __super__);
function SkipObservable(source, count) {
this.source = source;
this.skipCount = count;
__super__.call(this);
}
SkipObservable.prototype.subscribeCore = function (o) {
return this.source.subscribe(new InnerObserver(o, this.skipCount));
};
function InnerObserver(o, c) {
this.c = c;
this.r = c;
this.o = o;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) {
if (this.isStopped) { return; }
if (this.r <= 0) {
this.o.onNext(x);
} else {
this.r--;
}
};
InnerObserver.prototype.onError = function(e) {
if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
};
InnerObserver.prototype.onCompleted = function() {
if (!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function(e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return SkipObservable;
}(ObservableBase));
/**
* Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
* @param {Number} count The number of elements to skip before returning the remaining elements.
* @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
*/
observableProto.skip = function (count) {
if (count < 0) { throw new ArgumentOutOfRangeError(); }
return new SkipObservable(this, count);
};
/**
* Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
* The element's index is used in the logic of the predicate function.
*
* var res = source.skipWhile(function (value) { return value < 10; });
* var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
*/
observableProto.skipWhile = function (predicate, thisArg) {
var source = this,
callback = bindCallback(predicate, thisArg, 3);
return new AnonymousObservable(function (o) {
var i = 0, running = false;
return source.subscribe(function (x) {
if (!running) {
try {
running = !callback(x, i++, source);
} catch (e) {
o.onError(e);
return;
}
}
running && o.onNext(x);
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
/**
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
*
* var res = source.take(5);
* var res = source.take(0, Rx.Scheduler.timeout);
* @param {Number} count The number of elements to return.
* @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
* @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
*/
observableProto.take = function (count, scheduler) {
if (count < 0) { throw new ArgumentOutOfRangeError(); }
if (count === 0) { return observableEmpty(scheduler); }
var source = this;
return new AnonymousObservable(function (o) {
var remaining = count;
return source.subscribe(function (x) {
if (remaining-- > 0) {
o.onNext(x);
remaining <= 0 && o.onCompleted();
}
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
/**
* Returns elements from an observable sequence as long as a specified condition is true.
* The element's index is used in the logic of the predicate function.
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
*/
observableProto.takeWhile = function (predicate, thisArg) {
var source = this,
callback = bindCallback(predicate, thisArg, 3);
return new AnonymousObservable(function (o) {
var i = 0, running = true;
return source.subscribe(function (x) {
if (running) {
try {
running = callback(x, i++, source);
} catch (e) {
o.onError(e);
return;
}
if (running) {
o.onNext(x);
} else {
o.onCompleted();
}
}
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
var FilterObservable = (function (__super__) {
inherits(FilterObservable, __super__);
function FilterObservable(source, predicate, thisArg) {
this.source = source;
this.predicate = bindCallback(predicate, thisArg, 3);
__super__.call(this);
}
FilterObservable.prototype.subscribeCore = function (o) {
return this.source.subscribe(new InnerObserver(o, this.predicate, this));
};
function innerPredicate(predicate, self) {
return function(x, i, o) { return self.predicate(x, i, o) && predicate.call(this, x, i, o); }
}
FilterObservable.prototype.internalFilter = function(predicate, thisArg) {
return new FilterObservable(this.source, innerPredicate(predicate, this), thisArg);
};
function InnerObserver(o, predicate, source) {
this.o = o;
this.predicate = predicate;
this.source = source;
this.i = 0;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function(x) {
if (this.isStopped) { return; }
var shouldYield = tryCatch(this.predicate)(x, this.i++, this.source);
if (shouldYield === errorObj) {
return this.o.onError(shouldYield.e);
}
shouldYield && this.o.onNext(x);
};
InnerObserver.prototype.onError = function (e) {
if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
};
InnerObserver.prototype.onCompleted = function () {
if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return FilterObservable;
}(ObservableBase));
/**
* Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
* @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
*/
observableProto.filter = observableProto.where = function (predicate, thisArg) {
return this instanceof FilterObservable ? this.internalFilter(predicate, thisArg) :
new FilterObservable(this, predicate, thisArg);
};
function extremaBy(source, keySelector, comparer) {
return new AnonymousObservable(function (o) {
var hasValue = false, lastKey = null, list = [];
return source.subscribe(function (x) {
var comparison, key;
try {
key = keySelector(x);
} catch (ex) {
o.onError(ex);
return;
}
comparison = 0;
if (!hasValue) {
hasValue = true;
lastKey = key;
} else {
try {
comparison = comparer(key, lastKey);
} catch (ex1) {
o.onError(ex1);
return;
}
}
if (comparison > 0) {
lastKey = key;
list = [];
}
if (comparison >= 0) { list.push(x); }
}, function (e) { o.onError(e); }, function () {
o.onNext(list);
o.onCompleted();
});
}, source);
}
function firstOnly(x) {
if (x.length === 0) { throw new EmptyError(); }
return x[0];
}
/**
* Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value.
* For aggregation behavior with incremental intermediate results, see Observable.scan.
* @deprecated Use #reduce instead
* @param {Mixed} [seed] The initial accumulator value.
* @param {Function} accumulator An accumulator function to be invoked on each element.
* @returns {Observable} An observable sequence containing a single element with the final accumulator value.
*/
observableProto.aggregate = function () {
var hasSeed = false, accumulator, seed, source = this;
if (arguments.length === 2) {
hasSeed = true;
seed = arguments[0];
accumulator = arguments[1];
} else {
accumulator = arguments[0];
}
return new AnonymousObservable(function (o) {
var hasAccumulation, accumulation, hasValue;
return source.subscribe (
function (x) {
!hasValue && (hasValue = true);
try {
if (hasAccumulation) {
accumulation = accumulator(accumulation, x);
} else {
accumulation = hasSeed ? accumulator(seed, x) : x;
hasAccumulation = true;
}
} catch (e) {
return o.onError(e);
}
},
function (e) { o.onError(e); },
function () {
hasValue && o.onNext(accumulation);
!hasValue && hasSeed && o.onNext(seed);
!hasValue && !hasSeed && o.onError(new EmptyError());
o.onCompleted();
}
);
}, source);
};
var ReduceObservable = (function(__super__) {
inherits(ReduceObservable, __super__);
function ReduceObservable(source, acc, hasSeed, seed) {
this.source = source;
this.acc = acc;
this.hasSeed = hasSeed;
this.seed = seed;
__super__.call(this);
}
ReduceObservable.prototype.subscribeCore = function(observer) {
return this.source.subscribe(new InnerObserver(observer,this));
};
function InnerObserver(o, parent) {
this.o = o;
this.acc = parent.acc;
this.hasSeed = parent.hasSeed;
this.seed = parent.seed;
this.hasAccumulation = false;
this.result = null;
this.hasValue = false;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) {
if (this.isStopped) { return; }
!this.hasValue && (this.hasValue = true);
if (this.hasAccumulation) {
this.result = tryCatch(this.acc)(this.result, x);
} else {
this.result = this.hasSeed ? tryCatch(this.acc)(this.seed, x) : x;
this.hasAccumulation = true;
}
if (this.result === errorObj) { this.o.onError(this.result.e); }
};
InnerObserver.prototype.onError = function (e) {
if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
};
InnerObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.hasValue && this.o.onNext(this.result);
!this.hasValue && this.hasSeed && this.o.onNext(this.seed);
!this.hasValue && !this.hasSeed && this.o.onError(new EmptyError());
this.o.onCompleted();
}
};
InnerObserver.prototype.dispose = function () { this.isStopped = true; };
InnerObserver.prototype.fail = function(e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return ReduceObservable;
}(ObservableBase));
/**
* Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value.
* For aggregation behavior with incremental intermediate results, see Observable.scan.
* @param {Function} accumulator An accumulator function to be invoked on each element.
* @param {Any} [seed] The initial accumulator value.
* @returns {Observable} An observable sequence containing a single element with the final accumulator value.
*/
observableProto.reduce = function (accumulator) {
var hasSeed = false;
if (arguments.length === 2) {
hasSeed = true;
var seed = arguments[1];
}
return new ReduceObservable(this, accumulator, hasSeed, seed);
};
/**
* Determines whether any element of an observable sequence satisfies a condition if present, else if any items are in the sequence.
* @param {Function} [predicate] A function to test each element for a condition.
* @returns {Observable} An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate if given, else if any items are in the sequence.
*/
observableProto.some = function (predicate, thisArg) {
var source = this;
return predicate ?
source.filter(predicate, thisArg).some() :
new AnonymousObservable(function (observer) {
return source.subscribe(function () {
observer.onNext(true);
observer.onCompleted();
}, function (e) { observer.onError(e); }, function () {
observer.onNext(false);
observer.onCompleted();
});
}, source);
};
/** @deprecated use #some instead */
observableProto.any = function () {
//deprecate('any', 'some');
return this.some.apply(this, arguments);
};
/**
* Determines whether an observable sequence is empty.
* @returns {Observable} An observable sequence containing a single element determining whether the source sequence is empty.
*/
observableProto.isEmpty = function () {
return this.any().map(not);
};
/**
* Determines whether all elements of an observable sequence satisfy a condition.
* @param {Function} [predicate] A function to test each element for a condition.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate.
*/
observableProto.every = function (predicate, thisArg) {
return this.filter(function (v) { return !predicate(v); }, thisArg).some().map(not);
};
/** @deprecated use #every instead */
observableProto.all = function () {
//deprecate('all', 'every');
return this.every.apply(this, arguments);
};
/**
* Determines whether an observable sequence includes a specified element with an optional equality comparer.
* @param searchElement The value to locate in the source sequence.
* @param {Number} [fromIndex] An equality comparer to compare elements.
* @returns {Observable} An observable sequence containing a single element determining whether the source sequence includes an element that has the specified value from the given index.
*/
observableProto.includes = function (searchElement, fromIndex) {
var source = this;
function comparer(a, b) {
return (a === 0 && b === 0) || (a === b || (isNaN(a) && isNaN(b)));
}
return new AnonymousObservable(function (o) {
var i = 0, n = +fromIndex || 0;
Math.abs(n) === Infinity && (n = 0);
if (n < 0) {
o.onNext(false);
o.onCompleted();
return disposableEmpty;
}
return source.subscribe(
function (x) {
if (i++ >= n && comparer(x, searchElement)) {
o.onNext(true);
o.onCompleted();
}
},
function (e) { o.onError(e); },
function () {
o.onNext(false);
o.onCompleted();
});
}, this);
};
/**
* @deprecated use #includes instead.
*/
observableProto.contains = function (searchElement, fromIndex) {
//deprecate('contains', 'includes');
observableProto.includes(searchElement, fromIndex);
};
/**
* Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items.
* @example
* res = source.count();
* res = source.count(function (x) { return x > 3; });
* @param {Function} [predicate]A function to test each element for a condition.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function if provided, else the count of items in the sequence.
*/
observableProto.count = function (predicate, thisArg) {
return predicate ?
this.filter(predicate, thisArg).count() :
this.reduce(function (count) { return count + 1; }, 0);
};
/**
* Returns the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
* @param {Any} searchElement Element to locate in the array.
* @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0.
* @returns {Observable} And observable sequence containing the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
*/
observableProto.indexOf = function(searchElement, fromIndex) {
var source = this;
return new AnonymousObservable(function (o) {
var i = 0, n = +fromIndex || 0;
Math.abs(n) === Infinity && (n = 0);
if (n < 0) {
o.onNext(-1);
o.onCompleted();
return disposableEmpty;
}
return source.subscribe(
function (x) {
if (i >= n && x === searchElement) {
o.onNext(i);
o.onCompleted();
}
i++;
},
function (e) { o.onError(e); },
function () {
o.onNext(-1);
o.onCompleted();
});
}, source);
};
/**
* Computes the sum of a sequence of values that are obtained by invoking an optional transform function on each element of the input sequence, else if not specified computes the sum on each item in the sequence.
* @param {Function} [selector] A transform function to apply to each element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence containing a single element with the sum of the values in the source sequence.
*/
observableProto.sum = function (keySelector, thisArg) {
return keySelector && isFunction(keySelector) ?
this.map(keySelector, thisArg).sum() :
this.reduce(function (prev, curr) { return prev + curr; }, 0);
};
/**
* Returns the elements in an observable sequence with the minimum key value according to the specified comparer.
* @example
* var res = source.minBy(function (x) { return x.value; });
* var res = source.minBy(function (x) { return x.value; }, function (x, y) { return x - y; });
* @param {Function} keySelector Key selector function.
* @param {Function} [comparer] Comparer used to compare key values.
* @returns {Observable} An observable sequence containing a list of zero or more elements that have a minimum key value.
*/
observableProto.minBy = function (keySelector, comparer) {
comparer || (comparer = defaultSubComparer);
return extremaBy(this, keySelector, function (x, y) { return comparer(x, y) * -1; });
};
/**
* Returns the minimum element in an observable sequence according to the optional comparer else a default greater than less than check.
* @example
* var res = source.min();
* var res = source.min(function (x, y) { return x.value - y.value; });
* @param {Function} [comparer] Comparer used to compare elements.
* @returns {Observable} An observable sequence containing a single element with the minimum element in the source sequence.
*/
observableProto.min = function (comparer) {
return this.minBy(identity, comparer).map(function (x) { return firstOnly(x); });
};
/**
* Returns the elements in an observable sequence with the maximum key value according to the specified comparer.
* @example
* var res = source.maxBy(function (x) { return x.value; });
* var res = source.maxBy(function (x) { return x.value; }, function (x, y) { return x - y;; });
* @param {Function} keySelector Key selector function.
* @param {Function} [comparer] Comparer used to compare key values.
* @returns {Observable} An observable sequence containing a list of zero or more elements that have a maximum key value.
*/
observableProto.maxBy = function (keySelector, comparer) {
comparer || (comparer = defaultSubComparer);
return extremaBy(this, keySelector, comparer);
};
/**
* Returns the maximum value in an observable sequence according to the specified comparer.
* @example
* var res = source.max();
* var res = source.max(function (x, y) { return x.value - y.value; });
* @param {Function} [comparer] Comparer used to compare elements.
* @returns {Observable} An observable sequence containing a single element with the maximum element in the source sequence.
*/
observableProto.max = function (comparer) {
return this.maxBy(identity, comparer).map(function (x) { return firstOnly(x); });
};
/**
* Computes the average of an observable sequence of values that are in the sequence or obtained by invoking a transform function on each element of the input sequence if present.
* @param {Function} [selector] A transform function to apply to each element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence containing a single element with the average of the sequence of values.
*/
observableProto.average = function (keySelector, thisArg) {
return keySelector && isFunction(keySelector) ?
this.map(keySelector, thisArg).average() :
this.reduce(function (prev, cur) {
return {
sum: prev.sum + cur,
count: prev.count + 1
};
}, {sum: 0, count: 0 }).map(function (s) {
if (s.count === 0) { throw new EmptyError(); }
return s.sum / s.count;
});
};
/**
* Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer.
*
* @example
* var res = res = source.sequenceEqual([1,2,3]);
* var res = res = source.sequenceEqual([{ value: 42 }], function (x, y) { return x.value === y.value; });
* 3 - res = source.sequenceEqual(Rx.Observable.returnValue(42));
* 4 - res = source.sequenceEqual(Rx.Observable.returnValue({ value: 42 }), function (x, y) { return x.value === y.value; });
* @param {Observable} second Second observable sequence or array to compare.
* @param {Function} [comparer] Comparer used to compare elements of both sequences.
* @returns {Observable} An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer.
*/
observableProto.sequenceEqual = function (second, comparer) {
var first = this;
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (o) {
var donel = false, doner = false, ql = [], qr = [];
var subscription1 = first.subscribe(function (x) {
var equal, v;
if (qr.length > 0) {
v = qr.shift();
try {
equal = comparer(v, x);
} catch (e) {
o.onError(e);
return;
}
if (!equal) {
o.onNext(false);
o.onCompleted();
}
} else if (doner) {
o.onNext(false);
o.onCompleted();
} else {
ql.push(x);
}
}, function(e) { o.onError(e); }, function () {
donel = true;
if (ql.length === 0) {
if (qr.length > 0) {
o.onNext(false);
o.onCompleted();
} else if (doner) {
o.onNext(true);
o.onCompleted();
}
}
});
(isArrayLike(second) || isIterable(second)) && (second = observableFrom(second));
isPromise(second) && (second = observableFromPromise(second));
var subscription2 = second.subscribe(function (x) {
var equal;
if (ql.length > 0) {
var v = ql.shift();
try {
equal = comparer(v, x);
} catch (exception) {
o.onError(exception);
return;
}
if (!equal) {
o.onNext(false);
o.onCompleted();
}
} else if (donel) {
o.onNext(false);
o.onCompleted();
} else {
qr.push(x);
}
}, function(e) { o.onError(e); }, function () {
doner = true;
if (qr.length === 0) {
if (ql.length > 0) {
o.onNext(false);
o.onCompleted();
} else if (donel) {
o.onNext(true);
o.onCompleted();
}
}
});
return new CompositeDisposable(subscription1, subscription2);
}, first);
};
function elementAtOrDefault(source, index, hasDefault, defaultValue) {
if (index < 0) { throw new ArgumentOutOfRangeError(); }
return new AnonymousObservable(function (o) {
var i = index;
return source.subscribe(function (x) {
if (i-- === 0) {
o.onNext(x);
o.onCompleted();
}
}, function (e) { o.onError(e); }, function () {
if (!hasDefault) {
o.onError(new ArgumentOutOfRangeError());
} else {
o.onNext(defaultValue);
o.onCompleted();
}
});
}, source);
}
/**
* Returns the element at a specified index in a sequence.
* @example
* var res = source.elementAt(5);
* @param {Number} index The zero-based index of the element to retrieve.
* @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence.
*/
observableProto.elementAt = function (index) {
return elementAtOrDefault(this, index, false);
};
/**
* Returns the element at a specified index in a sequence or a default value if the index is out of range.
* @example
* var res = source.elementAtOrDefault(5);
* var res = source.elementAtOrDefault(5, 0);
* @param {Number} index The zero-based index of the element to retrieve.
* @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
* @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence, or a default value if the index is outside the bounds of the source sequence.
*/
observableProto.elementAtOrDefault = function (index, defaultValue) {
return elementAtOrDefault(this, index, true, defaultValue);
};
function singleOrDefaultAsync(source, hasDefault, defaultValue) {
return new AnonymousObservable(function (o) {
var value = defaultValue, seenValue = false;
return source.subscribe(function (x) {
if (seenValue) {
o.onError(new Error('Sequence contains more than one element'));
} else {
value = x;
seenValue = true;
}
}, function (e) { o.onError(e); }, function () {
if (!seenValue && !hasDefault) {
o.onError(new EmptyError());
} else {
o.onNext(value);
o.onCompleted();
}
});
}, source);
}
/**
* Returns the only element of an observable sequence that satisfies the condition in the optional predicate, and reports an exception if there is not exactly one element in the observable sequence.
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate.
*/
observableProto.single = function (predicate, thisArg) {
return predicate && isFunction(predicate) ?
this.where(predicate, thisArg).single() :
singleOrDefaultAsync(this, false);
};
/**
* Returns the only element of an observable sequence that matches the predicate, or a default value if no such element exists; this method reports an exception if there is more than one element in the observable sequence.
* @example
* var res = res = source.singleOrDefault();
* var res = res = source.singleOrDefault(function (x) { return x === 42; });
* res = source.singleOrDefault(function (x) { return x === 42; }, 0);
* res = source.singleOrDefault(null, 0);
* @memberOf Observable#
* @param {Function} predicate A predicate function to evaluate for elements in the source sequence.
* @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
*/
observableProto.singleOrDefault = function (predicate, defaultValue, thisArg) {
return predicate && isFunction(predicate) ?
this.filter(predicate, thisArg).singleOrDefault(null, defaultValue) :
singleOrDefaultAsync(this, true, defaultValue);
};
function firstOrDefaultAsync(source, hasDefault, defaultValue) {
return new AnonymousObservable(function (o) {
return source.subscribe(function (x) {
o.onNext(x);
o.onCompleted();
}, function (e) { o.onError(e); }, function () {
if (!hasDefault) {
o.onError(new EmptyError());
} else {
o.onNext(defaultValue);
o.onCompleted();
}
});
}, source);
}
/**
* Returns the first element of an observable sequence that satisfies the condition in the predicate if present else the first item in the sequence.
* @example
* var res = res = source.first();
* var res = res = source.first(function (x) { return x > 3; });
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate if provided, else the first item in the sequence.
*/
observableProto.first = function (predicate, thisArg) {
return predicate ?
this.where(predicate, thisArg).first() :
firstOrDefaultAsync(this, false);
};
/**
* Returns the first element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
* @param {Any} [defaultValue] The default value if no such element exists. If not specified, defaults to null.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
*/
observableProto.firstOrDefault = function (predicate, defaultValue, thisArg) {
return predicate ?
this.where(predicate).firstOrDefault(null, defaultValue) :
firstOrDefaultAsync(this, true, defaultValue);
};
function lastOrDefaultAsync(source, hasDefault, defaultValue) {
return new AnonymousObservable(function (o) {
var value = defaultValue, seenValue = false;
return source.subscribe(function (x) {
value = x;
seenValue = true;
}, function (e) { o.onError(e); }, function () {
if (!seenValue && !hasDefault) {
o.onError(new EmptyError());
} else {
o.onNext(value);
o.onCompleted();
}
});
}, source);
}
/**
* Returns the last element of an observable sequence that satisfies the condition in the predicate if specified, else the last element.
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate.
*/
observableProto.last = function (predicate, thisArg) {
return predicate ?
this.where(predicate, thisArg).last() :
lastOrDefaultAsync(this, false);
};
/**
* Returns the last element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
* @param [defaultValue] The default value if no such element exists. If not specified, defaults to null.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
*/
observableProto.lastOrDefault = function (predicate, defaultValue, thisArg) {
return predicate ?
this.where(predicate, thisArg).lastOrDefault(null, defaultValue) :
lastOrDefaultAsync(this, true, defaultValue);
};
function findValue (source, predicate, thisArg, yieldIndex) {
var callback = bindCallback(predicate, thisArg, 3);
return new AnonymousObservable(function (o) {
var i = 0;
return source.subscribe(function (x) {
var shouldRun;
try {
shouldRun = callback(x, i, source);
} catch (e) {
o.onError(e);
return;
}
if (shouldRun) {
o.onNext(yieldIndex ? i : x);
o.onCompleted();
} else {
i++;
}
}, function (e) { o.onError(e); }, function () {
o.onNext(yieldIndex ? -1 : undefined);
o.onCompleted();
});
}, source);
}
/**
* Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire Observable sequence.
* @param {Function} predicate The predicate that defines the conditions of the element to search for.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} An Observable sequence with the first element that matches the conditions defined by the specified predicate, if found; otherwise, undefined.
*/
observableProto.find = function (predicate, thisArg) {
return findValue(this, predicate, thisArg, false);
};
/**
* Searches for an element that matches the conditions defined by the specified predicate, and returns
* an Observable sequence with the zero-based index of the first occurrence within the entire Observable sequence.
* @param {Function} predicate The predicate that defines the conditions of the element to search for.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} An Observable sequence with the zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.
*/
observableProto.findIndex = function (predicate, thisArg) {
return findValue(this, predicate, thisArg, true);
};
/**
* Converts the observable sequence to a Set if it exists.
* @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence.
*/
observableProto.toSet = function () {
if (typeof root.Set === 'undefined') { throw new TypeError(); }
var source = this;
return new AnonymousObservable(function (o) {
var s = new root.Set();
return source.subscribe(
function (x) { s.add(x); },
function (e) { o.onError(e); },
function () {
o.onNext(s);
o.onCompleted();
});
}, source);
};
/**
* Converts the observable sequence to a Map if it exists.
* @param {Function} keySelector A function which produces the key for the Map.
* @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence.
* @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
*/
observableProto.toMap = function (keySelector, elementSelector) {
if (typeof root.Map === 'undefined') { throw new TypeError(); }
var source = this;
return new AnonymousObservable(function (o) {
var m = new root.Map();
return source.subscribe(
function (x) {
var key;
try {
key = keySelector(x);
} catch (e) {
o.onError(e);
return;
}
var element = x;
if (elementSelector) {
try {
element = elementSelector(x);
} catch (e) {
o.onError(e);
return;
}
}
m.set(key, element);
},
function (e) { o.onError(e); },
function () {
o.onNext(m);
o.onCompleted();
});
}, source);
};
var fnString = 'function',
throwString = 'throw',
isObject = Rx.internals.isObject;
function toThunk(obj, ctx) {
if (Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
if (isGeneratorFunction(obj)) { return observableSpawn(obj.call(ctx)); }
if (isGenerator(obj)) { return observableSpawn(obj); }
if (isObservable(obj)) { return observableToThunk(obj); }
if (isPromise(obj)) { return promiseToThunk(obj); }
if (typeof obj === fnString) { return obj; }
if (isObject(obj) || Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
return obj;
}
function objectToThunk(obj) {
var ctx = this;
return function (done) {
var keys = Object.keys(obj),
pending = keys.length,
results = new obj.constructor(),
finished;
if (!pending) {
timeoutScheduler.schedule(function () { done(null, results); });
return;
}
for (var i = 0, len = keys.length; i < len; i++) {
run(obj[keys[i]], keys[i]);
}
function run(fn, key) {
if (finished) { return; }
try {
fn = toThunk(fn, ctx);
if (typeof fn !== fnString) {
results[key] = fn;
return --pending || done(null, results);
}
fn.call(ctx, function(err, res) {
if (finished) { return; }
if (err) {
finished = true;
return done(err);
}
results[key] = res;
--pending || done(null, results);
});
} catch (e) {
finished = true;
done(e);
}
}
}
}
function observableToThunk(observable) {
return function (fn) {
var value, hasValue = false;
observable.subscribe(
function (v) {
value = v;
hasValue = true;
},
fn,
function () {
hasValue && fn(null, value);
});
}
}
function promiseToThunk(promise) {
return function(fn) {
promise.then(function(res) {
fn(null, res);
}, fn);
}
}
function isObservable(obj) {
return obj && typeof obj.subscribe === fnString;
}
function isGeneratorFunction(obj) {
return obj && obj.constructor && obj.constructor.name === 'GeneratorFunction';
}
function isGenerator(obj) {
return obj && typeof obj.next === fnString && typeof obj[throwString] === fnString;
}
/*
* Spawns a generator function which allows for Promises, Observable sequences, Arrays, Objects, Generators and functions.
* @param {Function} The spawning function.
* @returns {Function} a function which has a done continuation.
*/
var observableSpawn = Rx.spawn = function (fn) {
var isGenFun = isGeneratorFunction(fn);
return function (done) {
var ctx = this,
gen = fn;
if (isGenFun) {
for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
var len = args.length,
hasCallback = len && typeof args[len - 1] === fnString;
done = hasCallback ? args.pop() : handleError;
gen = fn.apply(this, args);
} else {
done = done || handleError;
}
next();
function exit(err, res) {
timeoutScheduler.schedule(done.bind(ctx, err, res));
}
function next(err, res) {
var ret;
// multiple args
if (arguments.length > 2) {
for(var res = [], i = 1, len = arguments.length; i < len; i++) { res.push(arguments[i]); }
}
if (err) {
try {
ret = gen[throwString](err);
} catch (e) {
return exit(e);
}
}
if (!err) {
try {
ret = gen.next(res);
} catch (e) {
return exit(e);
}
}
if (ret.done) {
return exit(null, ret.value);
}
ret.value = toThunk(ret.value, ctx);
if (typeof ret.value === fnString) {
var called = false;
try {
ret.value.call(ctx, function() {
if (called) {
return;
}
called = true;
next.apply(ctx, arguments);
});
} catch (e) {
timeoutScheduler.schedule(function () {
if (called) {
return;
}
called = true;
next.call(ctx, e);
});
}
return;
}
// Not supported
next(new TypeError('Rx.spawn only supports a function, Promise, Observable, Object or Array.'));
}
}
};
function handleError(err) {
if (!err) { return; }
timeoutScheduler.schedule(function() {
throw err;
});
}
/**
* Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
*
* @example
* var res = Rx.Observable.start(function () { console.log('hello'); });
* var res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout);
* var res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console);
*
* @param {Function} func Function to run asynchronously.
* @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
* @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @returns {Observable} An observable sequence exposing the function's result value, or an exception.
*
* Remarks
* * The function is called immediately, not during the subscription of the resulting sequence.
* * Multiple subscriptions to the resulting sequence can observe the function's result.
*/
Observable.start = function (func, context, scheduler) {
return observableToAsync(func, context, scheduler)();
};
/**
* Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler.
* @param {Function} function Function to convert to an asynchronous function.
* @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @returns {Function} Asynchronous function.
*/
var observableToAsync = Observable.toAsync = function (func, context, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return function () {
var args = arguments,
subject = new AsyncSubject();
scheduler.schedule(function () {
var result;
try {
result = func.apply(context, args);
} catch (e) {
subject.onError(e);
return;
}
subject.onNext(result);
subject.onCompleted();
});
return subject.asObservable();
};
};
/**
* Converts a callback function to an observable sequence.
*
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
*/
Observable.fromCallback = function (func, context, selector) {
return function () {
var len = arguments.length, args = new Array(len)
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
return new AnonymousObservable(function (observer) {
function handler() {
var len = arguments.length, results = new Array(len);
for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
if (selector) {
try {
results = selector.apply(context, results);
} catch (e) {
return observer.onError(e);
}
observer.onNext(results);
} else {
if (results.length <= 1) {
observer.onNext.apply(observer, results);
} else {
observer.onNext(results);
}
}
observer.onCompleted();
}
args.push(handler);
func.apply(context, args);
}).publishLast().refCount();
};
};
/**
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
* @param {Function} func The function to call
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
*/
Observable.fromNodeCallback = function (func, context, selector) {
return function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
return new AnonymousObservable(function (observer) {
function handler(err) {
if (err) {
observer.onError(err);
return;
}
var len = arguments.length, results = [];
for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; }
if (selector) {
try {
results = selector.apply(context, results);
} catch (e) {
return observer.onError(e);
}
observer.onNext(results);
} else {
if (results.length <= 1) {
observer.onNext.apply(observer, results);
} else {
observer.onNext(results);
}
}
observer.onCompleted();
}
args.push(handler);
func.apply(context, args);
}).publishLast().refCount();
};
};
function createListener (element, name, handler) {
if (element.addEventListener) {
element.addEventListener(name, handler, false);
return disposableCreate(function () {
element.removeEventListener(name, handler, false);
});
}
throw new Error('No listener found');
}
function createEventListener (el, eventName, handler) {
var disposables = new CompositeDisposable();
// Asume NodeList or HTMLCollection
var toStr = Object.prototype.toString;
if (toStr.call(el) === '[object NodeList]' || toStr.call(el) === '[object HTMLCollection]') {
for (var i = 0, len = el.length; i < len; i++) {
disposables.add(createEventListener(el.item(i), eventName, handler));
}
} else if (el) {
disposables.add(createListener(el, eventName, handler));
}
return disposables;
}
/**
* Configuration option to determine whether to use native events only
*/
Rx.config.useNativeEvents = false;
/**
* Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
*
* @example
* var source = Rx.Observable.fromEvent(element, 'mouseup');
*
* @param {Object} element The DOMElement or NodeList to attach a listener.
* @param {String} eventName The event name to attach the observable sequence.
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @returns {Observable} An observable sequence of events from the specified element and the specified event.
*/
Observable.fromEvent = function (element, eventName, selector) {
// Node.js specific
if (element.addListener) {
return fromEventPattern(
function (h) { element.addListener(eventName, h); },
function (h) { element.removeListener(eventName, h); },
selector);
}
// Use only if non-native events are allowed
if (!Rx.config.useNativeEvents) {
// Handles jq, Angular.js, Zepto, Marionette, Ember.js
if (typeof element.on === 'function' && typeof element.off === 'function') {
return fromEventPattern(
function (h) { element.on(eventName, h); },
function (h) { element.off(eventName, h); },
selector);
}
}
return new AnonymousObservable(function (observer) {
return createEventListener(
element,
eventName,
function handler (e) {
var results = e;
if (selector) {
try {
results = selector(arguments);
} catch (err) {
return observer.onError(err);
}
}
observer.onNext(results);
});
}).publish().refCount();
};
/**
* Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.
* @param {Function} addHandler The function to add a handler to the emitter.
* @param {Function} [removeHandler] The optional function to remove a handler from an emitter.
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @returns {Observable} An observable sequence which wraps an event from an event emitter
*/
var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
return new AnonymousObservable(function (observer) {
function innerHandler (e) {
var result = e;
if (selector) {
try {
result = selector(arguments);
} catch (err) {
return observer.onError(err);
}
}
observer.onNext(result);
}
var returnValue = addHandler(innerHandler);
return disposableCreate(function () {
if (removeHandler) {
removeHandler(innerHandler, returnValue);
}
});
}).publish().refCount();
};
/**
* Invokes the asynchronous function, surfacing the result through an observable sequence.
* @param {Function} functionAsync Asynchronous function which returns a Promise to run.
* @returns {Observable} An observable sequence exposing the function's result value, or an exception.
*/
Observable.startAsync = function (functionAsync) {
var promise;
try {
promise = functionAsync();
} catch (e) {
return observableThrow(e);
}
return observableFromPromise(promise);
}
var PausableObservable = (function (__super__) {
inherits(PausableObservable, __super__);
function subscribe(observer) {
var conn = this.source.publish(),
subscription = conn.subscribe(observer),
connection = disposableEmpty;
var pausable = this.pauser.distinctUntilChanged().subscribe(function (b) {
if (b) {
connection = conn.connect();
} else {
connection.dispose();
connection = disposableEmpty;
}
});
return new CompositeDisposable(subscription, connection, pausable);
}
function PausableObservable(source, pauser) {
this.source = source;
this.controller = new Subject();
if (pauser && pauser.subscribe) {
this.pauser = this.controller.merge(pauser);
} else {
this.pauser = this.controller;
}
__super__.call(this, subscribe, source);
}
PausableObservable.prototype.pause = function () {
this.controller.onNext(false);
};
PausableObservable.prototype.resume = function () {
this.controller.onNext(true);
};
return PausableObservable;
}(Observable));
/**
* Pauses the underlying observable sequence based upon the observable sequence which yields true/false.
* @example
* var pauser = new Rx.Subject();
* var source = Rx.Observable.interval(100).pausable(pauser);
* @param {Observable} pauser The observable sequence used to pause the underlying sequence.
* @returns {Observable} The observable sequence which is paused based upon the pauser.
*/
observableProto.pausable = function (pauser) {
return new PausableObservable(this, pauser);
};
function combineLatestSource(source, subject, resultSelector) {
return new AnonymousObservable(function (o) {
var hasValue = [false, false],
hasValueAll = false,
isDone = false,
values = new Array(2),
err;
function next(x, i) {
values[i] = x
hasValue[i] = true;
if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
if (err) { return o.onError(err); }
var res = tryCatch(resultSelector).apply(null, values);
if (res === errorObj) { return o.onError(res.e); }
o.onNext(res);
}
isDone && values[1] && o.onCompleted();
}
return new CompositeDisposable(
source.subscribe(
function (x) {
next(x, 0);
},
function (e) {
if (values[1]) {
o.onError(e);
} else {
err = e;
}
},
function () {
isDone = true;
values[1] && o.onCompleted();
}),
subject.subscribe(
function (x) {
next(x, 1);
},
function (e) { o.onError(e); },
function () {
isDone = true;
next(true, 1);
})
);
}, source);
}
var PausableBufferedObservable = (function (__super__) {
inherits(PausableBufferedObservable, __super__);
function subscribe(o) {
var q = [], previousShouldFire;
function drainQueue() { while (q.length > 0) { o.onNext(q.shift()); } }
var subscription =
combineLatestSource(
this.source,
this.pauser.distinctUntilChanged().startWith(false),
function (data, shouldFire) {
return { data: data, shouldFire: shouldFire };
})
.subscribe(
function (results) {
if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) {
previousShouldFire = results.shouldFire;
// change in shouldFire
if (results.shouldFire) { drainQueue(); }
} else {
previousShouldFire = results.shouldFire;
// new data
if (results.shouldFire) {
o.onNext(results.data);
} else {
q.push(results.data);
}
}
},
function (err) {
drainQueue();
o.onError(err);
},
function () {
drainQueue();
o.onCompleted();
}
);
return subscription;
}
function PausableBufferedObservable(source, pauser) {
this.source = source;
this.controller = new Subject();
if (pauser && pauser.subscribe) {
this.pauser = this.controller.merge(pauser);
} else {
this.pauser = this.controller;
}
__super__.call(this, subscribe, source);
}
PausableBufferedObservable.prototype.pause = function () {
this.controller.onNext(false);
};
PausableBufferedObservable.prototype.resume = function () {
this.controller.onNext(true);
};
return PausableBufferedObservable;
}(Observable));
/**
* Pauses the underlying observable sequence based upon the observable sequence which yields true/false,
* and yields the values that were buffered while paused.
* @example
* var pauser = new Rx.Subject();
* var source = Rx.Observable.interval(100).pausableBuffered(pauser);
* @param {Observable} pauser The observable sequence used to pause the underlying sequence.
* @returns {Observable} The observable sequence which is paused based upon the pauser.
*/
observableProto.pausableBuffered = function (subject) {
return new PausableBufferedObservable(this, subject);
};
var ControlledObservable = (function (__super__) {
inherits(ControlledObservable, __super__);
function subscribe (observer) {
return this.source.subscribe(observer);
}
function ControlledObservable (source, enableQueue, scheduler) {
__super__.call(this, subscribe, source);
this.subject = new ControlledSubject(enableQueue, scheduler);
this.source = source.multicast(this.subject).refCount();
}
ControlledObservable.prototype.request = function (numberOfItems) {
return this.subject.request(numberOfItems == null ? -1 : numberOfItems);
};
return ControlledObservable;
}(Observable));
var ControlledSubject = (function (__super__) {
function subscribe (observer) {
return this.subject.subscribe(observer);
}
inherits(ControlledSubject, __super__);
function ControlledSubject(enableQueue, scheduler) {
enableQueue == null && (enableQueue = true);
__super__.call(this, subscribe);
this.subject = new Subject();
this.enableQueue = enableQueue;
this.queue = enableQueue ? [] : null;
this.requestedCount = 0;
this.requestedDisposable = disposableEmpty;
this.error = null;
this.hasFailed = false;
this.hasCompleted = false;
this.scheduler = scheduler || currentThreadScheduler;
}
addProperties(ControlledSubject.prototype, Observer, {
onCompleted: function () {
this.hasCompleted = true;
if (!this.enableQueue || this.queue.length === 0) {
this.subject.onCompleted();
} else {
this.queue.push(Notification.createOnCompleted());
}
},
onError: function (error) {
this.hasFailed = true;
this.error = error;
if (!this.enableQueue || this.queue.length === 0) {
this.subject.onError(error);
} else {
this.queue.push(Notification.createOnError(error));
}
},
onNext: function (value) {
var hasRequested = false;
if (this.requestedCount === 0) {
this.enableQueue && this.queue.push(Notification.createOnNext(value));
} else {
(this.requestedCount !== -1 && this.requestedCount-- === 0) && this.disposeCurrentRequest();
hasRequested = true;
}
hasRequested && this.subject.onNext(value);
},
_processRequest: function (numberOfItems) {
if (this.enableQueue) {
while ((this.queue.length >= numberOfItems && numberOfItems > 0) ||
(this.queue.length > 0 && this.queue[0].kind !== 'N')) {
var first = this.queue.shift();
first.accept(this.subject);
if (first.kind === 'N') {
numberOfItems--;
} else {
this.disposeCurrentRequest();
this.queue = [];
}
}
return { numberOfItems : numberOfItems, returnValue: this.queue.length !== 0};
}
return { numberOfItems: numberOfItems, returnValue: false };
},
request: function (number) {
this.disposeCurrentRequest();
var self = this;
this.requestedDisposable = this.scheduler.scheduleWithState(number,
function(s, i) {
var r = self._processRequest(i), remaining = r.numberOfItems;
if (!r.returnValue) {
self.requestedCount = remaining;
self.requestedDisposable = disposableCreate(function () {
self.requestedCount = 0;
});
}
});
return this.requestedDisposable;
},
disposeCurrentRequest: function () {
this.requestedDisposable.dispose();
this.requestedDisposable = disposableEmpty;
}
});
return ControlledSubject;
}(Observable));
/**
* Attaches a controller to the observable sequence with the ability to queue.
* @example
* var source = Rx.Observable.interval(100).controlled();
* source.request(3); // Reads 3 values
* @param {bool} enableQueue truthy value to determine if values should be queued pending the next request
* @param {Scheduler} scheduler determines how the requests will be scheduled
* @returns {Observable} The observable sequence which only propagates values on request.
*/
observableProto.controlled = function (enableQueue, scheduler) {
if (enableQueue && isScheduler(enableQueue)) {
scheduler = enableQueue;
enableQueue = true;
}
if (enableQueue == null) { enableQueue = true; }
return new ControlledObservable(this, enableQueue, scheduler);
};
var StopAndWaitObservable = (function (__super__) {
function subscribe (observer) {
this.subscription = this.source.subscribe(new StopAndWaitObserver(observer, this, this.subscription));
var self = this;
timeoutScheduler.schedule(function () { self.source.request(1); });
return this.subscription;
}
inherits(StopAndWaitObservable, __super__);
function StopAndWaitObservable (source) {
__super__.call(this, subscribe, source);
this.source = source;
}
var StopAndWaitObserver = (function (__sub__) {
inherits(StopAndWaitObserver, __sub__);
function StopAndWaitObserver (observer, observable, cancel) {
__sub__.call(this);
this.observer = observer;
this.observable = observable;
this.cancel = cancel;
}
var stopAndWaitObserverProto = StopAndWaitObserver.prototype;
stopAndWaitObserverProto.completed = function () {
this.observer.onCompleted();
this.dispose();
};
stopAndWaitObserverProto.error = function (error) {
this.observer.onError(error);
this.dispose();
}
stopAndWaitObserverProto.next = function (value) {
this.observer.onNext(value);
var self = this;
timeoutScheduler.schedule(function () {
self.observable.source.request(1);
});
};
stopAndWaitObserverProto.dispose = function () {
this.observer = null;
if (this.cancel) {
this.cancel.dispose();
this.cancel = null;
}
__sub__.prototype.dispose.call(this);
};
return StopAndWaitObserver;
}(AbstractObserver));
return StopAndWaitObservable;
}(Observable));
/**
* Attaches a stop and wait observable to the current observable.
* @returns {Observable} A stop and wait observable.
*/
ControlledObservable.prototype.stopAndWait = function () {
return new StopAndWaitObservable(this);
};
var WindowedObservable = (function (__super__) {
function subscribe (observer) {
this.subscription = this.source.subscribe(new WindowedObserver(observer, this, this.subscription));
var self = this;
timeoutScheduler.schedule(function () {
self.source.request(self.windowSize);
});
return this.subscription;
}
inherits(WindowedObservable, __super__);
function WindowedObservable(source, windowSize) {
__super__.call(this, subscribe, source);
this.source = source;
this.windowSize = windowSize;
}
var WindowedObserver = (function (__sub__) {
inherits(WindowedObserver, __sub__);
function WindowedObserver(observer, observable, cancel) {
this.observer = observer;
this.observable = observable;
this.cancel = cancel;
this.received = 0;
}
var windowedObserverPrototype = WindowedObserver.prototype;
windowedObserverPrototype.completed = function () {
this.observer.onCompleted();
this.dispose();
};
windowedObserverPrototype.error = function (error) {
this.observer.onError(error);
this.dispose();
};
windowedObserverPrototype.next = function (value) {
this.observer.onNext(value);
this.received = ++this.received % this.observable.windowSize;
if (this.received === 0) {
var self = this;
timeoutScheduler.schedule(function () {
self.observable.source.request(self.observable.windowSize);
});
}
};
windowedObserverPrototype.dispose = function () {
this.observer = null;
if (this.cancel) {
this.cancel.dispose();
this.cancel = null;
}
__sub__.prototype.dispose.call(this);
};
return WindowedObserver;
}(AbstractObserver));
return WindowedObservable;
}(Observable));
/**
* Creates a sliding windowed observable based upon the window size.
* @param {Number} windowSize The number of items in the window
* @returns {Observable} A windowed observable based upon the window size.
*/
ControlledObservable.prototype.windowed = function (windowSize) {
return new WindowedObservable(this, windowSize);
};
/**
* Pipes the existing Observable sequence into a Node.js Stream.
* @param {Stream} dest The destination Node.js stream.
* @returns {Stream} The destination stream.
*/
observableProto.pipe = function (dest) {
var source = this.pausableBuffered();
function onDrain() {
source.resume();
}
dest.addListener('drain', onDrain);
source.subscribe(
function (x) {
!dest.write(String(x)) && source.pause();
},
function (err) {
dest.emit('error', err);
},
function () {
// Hack check because STDIO is not closable
!dest._isStdio && dest.end();
dest.removeListener('drain', onDrain);
});
source.resume();
return dest;
};
/**
* Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each
* subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's
* invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay.
*
* @example
* 1 - res = source.multicast(observable);
* 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; });
*
* @param {Function|Subject} subjectOrSubjectSelector
* Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function.
* Or:
* Subject to push source elements into.
*
* @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.multicast = function (subjectOrSubjectSelector, selector) {
var source = this;
return typeof subjectOrSubjectSelector === 'function' ?
new AnonymousObservable(function (observer) {
var connectable = source.multicast(subjectOrSubjectSelector());
return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect());
}, source) :
new ConnectableObservable(source, subjectOrSubjectSelector);
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence.
* This operator is a specialization of Multicast using a regular Subject.
*
* @example
* var resres = source.publish();
* var res = source.publish(function (x) { return x; });
*
* @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.publish = function (selector) {
return selector && isFunction(selector) ?
this.multicast(function () { return new Subject(); }, selector) :
this.multicast(new Subject());
};
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence.
* This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
*/
observableProto.share = function () {
return this.publish().refCount();
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification.
* This operator is a specialization of Multicast using a AsyncSubject.
*
* @example
* var res = source.publishLast();
* var res = source.publishLast(function (x) { return x; });
*
* @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.publishLast = function (selector) {
return selector && isFunction(selector) ?
this.multicast(function () { return new AsyncSubject(); }, selector) :
this.multicast(new AsyncSubject());
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue.
* This operator is a specialization of Multicast using a BehaviorSubject.
*
* @example
* var res = source.publishValue(42);
* var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42);
*
* @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
* @param {Mixed} initialValue Initial value received by observers upon subscription.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.publishValue = function (initialValueOrSelector, initialValue) {
return arguments.length === 2 ?
this.multicast(function () {
return new BehaviorSubject(initialValue);
}, initialValueOrSelector) :
this.multicast(new BehaviorSubject(initialValueOrSelector));
};
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue.
* This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
* @param {Mixed} initialValue Initial value received by observers upon subscription.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
*/
observableProto.shareValue = function (initialValue) {
return this.publishValue(initialValue).refCount();
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
* This operator is a specialization of Multicast using a ReplaySubject.
*
* @example
* var res = source.replay(null, 3);
* var res = source.replay(null, 3, 500);
* var res = source.replay(null, 3, 500, scheduler);
* var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler);
*
* @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy.
* @param bufferSize [Optional] Maximum element count of the replay buffer.
* @param windowSize [Optional] Maximum time length of the replay buffer.
* @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.replay = function (selector, bufferSize, windowSize, scheduler) {
return selector && isFunction(selector) ?
this.multicast(function () { return new ReplaySubject(bufferSize, windowSize, scheduler); }, selector) :
this.multicast(new ReplaySubject(bufferSize, windowSize, scheduler));
};
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
* This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
*
* @example
* var res = source.shareReplay(3);
* var res = source.shareReplay(3, 500);
* var res = source.shareReplay(3, 500, scheduler);
*
* @param bufferSize [Optional] Maximum element count of the replay buffer.
* @param window [Optional] Maximum time length of the replay buffer.
* @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
*/
observableProto.shareReplay = function (bufferSize, windowSize, scheduler) {
return this.replay(null, bufferSize, windowSize, scheduler).refCount();
};
var InnerSubscription = function (subject, observer) {
this.subject = subject;
this.observer = observer;
};
InnerSubscription.prototype.dispose = function () {
if (!this.subject.isDisposed && this.observer !== null) {
var idx = this.subject.observers.indexOf(this.observer);
this.subject.observers.splice(idx, 1);
this.observer = null;
}
};
/**
* Represents a value that changes over time.
* Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
*/
var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) {
function subscribe(observer) {
checkDisposed(this);
if (!this.isStopped) {
this.observers.push(observer);
observer.onNext(this.value);
return new InnerSubscription(this, observer);
}
if (this.hasError) {
observer.onError(this.error);
} else {
observer.onCompleted();
}
return disposableEmpty;
}
inherits(BehaviorSubject, __super__);
/**
* Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value.
* @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet.
*/
function BehaviorSubject(value) {
__super__.call(this, subscribe);
this.value = value,
this.observers = [],
this.isDisposed = false,
this.isStopped = false,
this.hasError = false;
}
addProperties(BehaviorSubject.prototype, Observer, {
/**
* Gets the current value or throws an exception.
* Value is frozen after onCompleted is called.
* After onError is called always throws the specified exception.
* An exception is always thrown after dispose is called.
* @returns {Mixed} The initial value passed to the constructor until onNext is called; after which, the last value passed to onNext.
*/
getValue: function () {
checkDisposed(this);
if (this.hasError) {
throw this.error;
}
return this.value;
},
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () { return this.observers.length > 0; },
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
checkDisposed(this);
if (this.isStopped) { return; }
this.isStopped = true;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onCompleted();
}
this.observers.length = 0;
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (error) {
checkDisposed(this);
if (this.isStopped) { return; }
this.isStopped = true;
this.hasError = true;
this.error = error;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onError(error);
}
this.observers.length = 0;
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
checkDisposed(this);
if (this.isStopped) { return; }
this.value = value;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onNext(value);
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
this.value = null;
this.exception = null;
}
});
return BehaviorSubject;
}(Observable));
/**
* Represents an object that is both an observable sequence as well as an observer.
* Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
*/
var ReplaySubject = Rx.ReplaySubject = (function (__super__) {
var maxSafeInteger = Math.pow(2, 53) - 1;
function createRemovableDisposable(subject, observer) {
return disposableCreate(function () {
observer.dispose();
!subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1);
});
}
function subscribe(observer) {
var so = new ScheduledObserver(this.scheduler, observer),
subscription = createRemovableDisposable(this, so);
checkDisposed(this);
this._trim(this.scheduler.now());
this.observers.push(so);
for (var i = 0, len = this.q.length; i < len; i++) {
so.onNext(this.q[i].value);
}
if (this.hasError) {
so.onError(this.error);
} else if (this.isStopped) {
so.onCompleted();
}
so.ensureActive();
return subscription;
}
inherits(ReplaySubject, __super__);
/**
* Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler.
* @param {Number} [bufferSize] Maximum element count of the replay buffer.
* @param {Number} [windowSize] Maximum time length of the replay buffer.
* @param {Scheduler} [scheduler] Scheduler the observers are invoked on.
*/
function ReplaySubject(bufferSize, windowSize, scheduler) {
this.bufferSize = bufferSize == null ? maxSafeInteger : bufferSize;
this.windowSize = windowSize == null ? maxSafeInteger : windowSize;
this.scheduler = scheduler || currentThreadScheduler;
this.q = [];
this.observers = [];
this.isStopped = false;
this.isDisposed = false;
this.hasError = false;
this.error = null;
__super__.call(this, subscribe);
}
addProperties(ReplaySubject.prototype, Observer.prototype, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
return this.observers.length > 0;
},
_trim: function (now) {
while (this.q.length > this.bufferSize) {
this.q.shift();
}
while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) {
this.q.shift();
}
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
checkDisposed(this);
if (this.isStopped) { return; }
var now = this.scheduler.now();
this.q.push({ interval: now, value: value });
this._trim(now);
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
var observer = os[i];
observer.onNext(value);
observer.ensureActive();
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (error) {
checkDisposed(this);
if (this.isStopped) { return; }
this.isStopped = true;
this.error = error;
this.hasError = true;
var now = this.scheduler.now();
this._trim(now);
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
var observer = os[i];
observer.onError(error);
observer.ensureActive();
}
this.observers.length = 0;
},
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
checkDisposed(this);
if (this.isStopped) { return; }
this.isStopped = true;
var now = this.scheduler.now();
this._trim(now);
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
var observer = os[i];
observer.onCompleted();
observer.ensureActive();
}
this.observers.length = 0;
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
}
});
return ReplaySubject;
}(Observable));
var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) {
inherits(ConnectableObservable, __super__);
function ConnectableObservable(source, subject) {
var hasSubscription = false,
subscription,
sourceObservable = source.asObservable();
this.connect = function () {
if (!hasSubscription) {
hasSubscription = true;
subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () {
hasSubscription = false;
}));
}
return subscription;
};
__super__.call(this, function (o) { return subject.subscribe(o); });
}
ConnectableObservable.prototype.refCount = function () {
var connectableSubscription, count = 0, source = this;
return new AnonymousObservable(function (observer) {
var shouldConnect = ++count === 1,
subscription = source.subscribe(observer);
shouldConnect && (connectableSubscription = source.connect());
return function () {
subscription.dispose();
--count === 0 && connectableSubscription.dispose();
};
});
};
return ConnectableObservable;
}(Observable));
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence. This observable sequence
* can be resubscribed to, even if all prior subscriptions have ended. (unlike `.publish().refCount()`)
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source.
*/
observableProto.singleInstance = function() {
var source = this, hasObservable = false, observable;
function getObservable() {
if (!hasObservable) {
hasObservable = true;
observable = source.finally(function() { hasObservable = false; }).publish().refCount();
}
return observable;
};
return new AnonymousObservable(function(o) {
return getObservable().subscribe(o);
});
};
var Dictionary = (function () {
var primes = [1, 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859, 134217689, 268435399, 536870909, 1073741789, 2147483647],
noSuchkey = "no such key",
duplicatekey = "duplicate key";
function isPrime(candidate) {
if ((candidate & 1) === 0) { return candidate === 2; }
var num1 = Math.sqrt(candidate),
num2 = 3;
while (num2 <= num1) {
if (candidate % num2 === 0) { return false; }
num2 += 2;
}
return true;
}
function getPrime(min) {
var index, num, candidate;
for (index = 0; index < primes.length; ++index) {
num = primes[index];
if (num >= min) { return num; }
}
candidate = min | 1;
while (candidate < primes[primes.length - 1]) {
if (isPrime(candidate)) { return candidate; }
candidate += 2;
}
return min;
}
function stringHashFn(str) {
var hash = 757602046;
if (!str.length) { return hash; }
for (var i = 0, len = str.length; i < len; i++) {
var character = str.charCodeAt(i);
hash = ((hash << 5) - hash) + character;
hash = hash & hash;
}
return hash;
}
function numberHashFn(key) {
var c2 = 0x27d4eb2d;
key = (key ^ 61) ^ (key >>> 16);
key = key + (key << 3);
key = key ^ (key >>> 4);
key = key * c2;
key = key ^ (key >>> 15);
return key;
}
var getHashCode = (function () {
var uniqueIdCounter = 0;
return function (obj) {
if (obj == null) { throw new Error(noSuchkey); }
// Check for built-ins before tacking on our own for any object
if (typeof obj === 'string') { return stringHashFn(obj); }
if (typeof obj === 'number') { return numberHashFn(obj); }
if (typeof obj === 'boolean') { return obj === true ? 1 : 0; }
if (obj instanceof Date) { return numberHashFn(obj.valueOf()); }
if (obj instanceof RegExp) { return stringHashFn(obj.toString()); }
if (typeof obj.valueOf === 'function') {
// Hack check for valueOf
var valueOf = obj.valueOf();
if (typeof valueOf === 'number') { return numberHashFn(valueOf); }
if (typeof valueOf === 'string') { return stringHashFn(valueOf); }
}
if (obj.hashCode) { return obj.hashCode(); }
var id = 17 * uniqueIdCounter++;
obj.hashCode = function () { return id; };
return id;
};
}());
function newEntry() {
return { key: null, value: null, next: 0, hashCode: 0 };
}
function Dictionary(capacity, comparer) {
if (capacity < 0) { throw new ArgumentOutOfRangeError(); }
if (capacity > 0) { this._initialize(capacity); }
this.comparer = comparer || defaultComparer;
this.freeCount = 0;
this.size = 0;
this.freeList = -1;
}
var dictionaryProto = Dictionary.prototype;
dictionaryProto._initialize = function (capacity) {
var prime = getPrime(capacity), i;
this.buckets = new Array(prime);
this.entries = new Array(prime);
for (i = 0; i < prime; i++) {
this.buckets[i] = -1;
this.entries[i] = newEntry();
}
this.freeList = -1;
};
dictionaryProto.add = function (key, value) {
this._insert(key, value, true);
};
dictionaryProto._insert = function (key, value, add) {
if (!this.buckets) { this._initialize(0); }
var index3,
num = getHashCode(key) & 2147483647,
index1 = num % this.buckets.length;
for (var index2 = this.buckets[index1]; index2 >= 0; index2 = this.entries[index2].next) {
if (this.entries[index2].hashCode === num && this.comparer(this.entries[index2].key, key)) {
if (add) { throw new Error(duplicatekey); }
this.entries[index2].value = value;
return;
}
}
if (this.freeCount > 0) {
index3 = this.freeList;
this.freeList = this.entries[index3].next;
--this.freeCount;
} else {
if (this.size === this.entries.length) {
this._resize();
index1 = num % this.buckets.length;
}
index3 = this.size;
++this.size;
}
this.entries[index3].hashCode = num;
this.entries[index3].next = this.buckets[index1];
this.entries[index3].key = key;
this.entries[index3].value = value;
this.buckets[index1] = index3;
};
dictionaryProto._resize = function () {
var prime = getPrime(this.size * 2),
numArray = new Array(prime);
for (index = 0; index < numArray.length; ++index) { numArray[index] = -1; }
var entryArray = new Array(prime);
for (index = 0; index < this.size; ++index) { entryArray[index] = this.entries[index]; }
for (var index = this.size; index < prime; ++index) { entryArray[index] = newEntry(); }
for (var index1 = 0; index1 < this.size; ++index1) {
var index2 = entryArray[index1].hashCode % prime;
entryArray[index1].next = numArray[index2];
numArray[index2] = index1;
}
this.buckets = numArray;
this.entries = entryArray;
};
dictionaryProto.remove = function (key) {
if (this.buckets) {
var num = getHashCode(key) & 2147483647,
index1 = num % this.buckets.length,
index2 = -1;
for (var index3 = this.buckets[index1]; index3 >= 0; index3 = this.entries[index3].next) {
if (this.entries[index3].hashCode === num && this.comparer(this.entries[index3].key, key)) {
if (index2 < 0) {
this.buckets[index1] = this.entries[index3].next;
} else {
this.entries[index2].next = this.entries[index3].next;
}
this.entries[index3].hashCode = -1;
this.entries[index3].next = this.freeList;
this.entries[index3].key = null;
this.entries[index3].value = null;
this.freeList = index3;
++this.freeCount;
return true;
} else {
index2 = index3;
}
}
}
return false;
};
dictionaryProto.clear = function () {
var index, len;
if (this.size <= 0) { return; }
for (index = 0, len = this.buckets.length; index < len; ++index) {
this.buckets[index] = -1;
}
for (index = 0; index < this.size; ++index) {
this.entries[index] = newEntry();
}
this.freeList = -1;
this.size = 0;
};
dictionaryProto._findEntry = function (key) {
if (this.buckets) {
var num = getHashCode(key) & 2147483647;
for (var index = this.buckets[num % this.buckets.length]; index >= 0; index = this.entries[index].next) {
if (this.entries[index].hashCode === num && this.comparer(this.entries[index].key, key)) {
return index;
}
}
}
return -1;
};
dictionaryProto.count = function () {
return this.size - this.freeCount;
};
dictionaryProto.tryGetValue = function (key) {
var entry = this._findEntry(key);
return entry >= 0 ?
this.entries[entry].value :
undefined;
};
dictionaryProto.getValues = function () {
var index = 0, results = [];
if (this.entries) {
for (var index1 = 0; index1 < this.size; index1++) {
if (this.entries[index1].hashCode >= 0) {
results[index++] = this.entries[index1].value;
}
}
}
return results;
};
dictionaryProto.get = function (key) {
var entry = this._findEntry(key);
if (entry >= 0) { return this.entries[entry].value; }
throw new Error(noSuchkey);
};
dictionaryProto.set = function (key, value) {
this._insert(key, value, false);
};
dictionaryProto.containskey = function (key) {
return this._findEntry(key) >= 0;
};
return Dictionary;
}());
/**
* Correlates the elements of two sequences based on overlapping durations.
*
* @param {Observable} right The right observable sequence to join elements for.
* @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap.
* @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap.
* @param {Function} resultSelector A function invoked to compute a result element for any two overlapping elements of the left and right observable sequences. The parameters passed to the function correspond with the elements from the left and right source sequences for which overlap occurs.
* @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration.
*/
observableProto.join = function (right, leftDurationSelector, rightDurationSelector, resultSelector) {
var left = this;
return new AnonymousObservable(function (observer) {
var group = new CompositeDisposable();
var leftDone = false, rightDone = false;
var leftId = 0, rightId = 0;
var leftMap = new Dictionary(), rightMap = new Dictionary();
group.add(left.subscribe(
function (value) {
var id = leftId++;
var md = new SingleAssignmentDisposable();
leftMap.add(id, value);
group.add(md);
var expire = function () {
leftMap.remove(id) && leftMap.count() === 0 && leftDone && observer.onCompleted();
group.remove(md);
};
var duration;
try {
duration = leftDurationSelector(value);
} catch (e) {
observer.onError(e);
return;
}
md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire));
rightMap.getValues().forEach(function (v) {
var result;
try {
result = resultSelector(value, v);
} catch (exn) {
observer.onError(exn);
return;
}
observer.onNext(result);
});
},
observer.onError.bind(observer),
function () {
leftDone = true;
(rightDone || leftMap.count() === 0) && observer.onCompleted();
})
);
group.add(right.subscribe(
function (value) {
var id = rightId++;
var md = new SingleAssignmentDisposable();
rightMap.add(id, value);
group.add(md);
var expire = function () {
rightMap.remove(id) && rightMap.count() === 0 && rightDone && observer.onCompleted();
group.remove(md);
};
var duration;
try {
duration = rightDurationSelector(value);
} catch (e) {
observer.onError(e);
return;
}
md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire));
leftMap.getValues().forEach(function (v) {
var result;
try {
result = resultSelector(v, value);
} catch (exn) {
observer.onError(exn);
return;
}
observer.onNext(result);
});
},
observer.onError.bind(observer),
function () {
rightDone = true;
(leftDone || rightMap.count() === 0) && observer.onCompleted();
})
);
return group;
}, left);
};
/**
* Correlates the elements of two sequences based on overlapping durations, and groups the results.
*
* @param {Observable} right The right observable sequence to join elements for.
* @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap.
* @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap.
* @param {Function} resultSelector A function invoked to compute a result element for any element of the left sequence with overlapping elements from the right observable sequence. The first parameter passed to the function is an element of the left sequence. The second parameter passed to the function is an observable sequence with elements from the right sequence that overlap with the left sequence's element.
* @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration.
*/
observableProto.groupJoin = function (right, leftDurationSelector, rightDurationSelector, resultSelector) {
var left = this;
return new AnonymousObservable(function (observer) {
var group = new CompositeDisposable();
var r = new RefCountDisposable(group);
var leftMap = new Dictionary(), rightMap = new Dictionary();
var leftId = 0, rightId = 0;
function handleError(e) { return function (v) { v.onError(e); }; };
group.add(left.subscribe(
function (value) {
var s = new Subject();
var id = leftId++;
leftMap.add(id, s);
var result;
try {
result = resultSelector(value, addRef(s, r));
} catch (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
return;
}
observer.onNext(result);
rightMap.getValues().forEach(function (v) { s.onNext(v); });
var md = new SingleAssignmentDisposable();
group.add(md);
var expire = function () {
leftMap.remove(id) && s.onCompleted();
group.remove(md);
};
var duration;
try {
duration = leftDurationSelector(value);
} catch (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
return;
}
md.setDisposable(duration.take(1).subscribe(
noop,
function (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
},
expire)
);
},
function (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
},
observer.onCompleted.bind(observer))
);
group.add(right.subscribe(
function (value) {
var id = rightId++;
rightMap.add(id, value);
var md = new SingleAssignmentDisposable();
group.add(md);
var expire = function () {
rightMap.remove(id);
group.remove(md);
};
var duration;
try {
duration = rightDurationSelector(value);
} catch (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
return;
}
md.setDisposable(duration.take(1).subscribe(
noop,
function (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
},
expire)
);
leftMap.getValues().forEach(function (v) { v.onNext(value); });
},
function (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
})
);
return r;
}, left);
};
/**
* Projects each element of an observable sequence into zero or more buffers.
*
* @param {Mixed} bufferOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
* @param {Function} [bufferClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
* @returns {Observable} An observable sequence of windows.
*/
observableProto.buffer = function (bufferOpeningsOrClosingSelector, bufferClosingSelector) {
return this.window.apply(this, arguments).selectMany(function (x) { return x.toArray(); });
};
/**
* Projects each element of an observable sequence into zero or more windows.
*
* @param {Mixed} windowOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
* @param {Function} [windowClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
* @returns {Observable} An observable sequence of windows.
*/
observableProto.window = function (windowOpeningsOrClosingSelector, windowClosingSelector) {
if (arguments.length === 1 && typeof arguments[0] !== 'function') {
return observableWindowWithBoundaries.call(this, windowOpeningsOrClosingSelector);
}
return typeof windowOpeningsOrClosingSelector === 'function' ?
observableWindowWithClosingSelector.call(this, windowOpeningsOrClosingSelector) :
observableWindowWithOpenings.call(this, windowOpeningsOrClosingSelector, windowClosingSelector);
};
function observableWindowWithOpenings(windowOpenings, windowClosingSelector) {
return windowOpenings.groupJoin(this, windowClosingSelector, observableEmpty, function (_, win) {
return win;
});
}
function observableWindowWithBoundaries(windowBoundaries) {
var source = this;
return new AnonymousObservable(function (observer) {
var win = new Subject(),
d = new CompositeDisposable(),
r = new RefCountDisposable(d);
observer.onNext(addRef(win, r));
d.add(source.subscribe(function (x) {
win.onNext(x);
}, function (err) {
win.onError(err);
observer.onError(err);
}, function () {
win.onCompleted();
observer.onCompleted();
}));
isPromise(windowBoundaries) && (windowBoundaries = observableFromPromise(windowBoundaries));
d.add(windowBoundaries.subscribe(function (w) {
win.onCompleted();
win = new Subject();
observer.onNext(addRef(win, r));
}, function (err) {
win.onError(err);
observer.onError(err);
}, function () {
win.onCompleted();
observer.onCompleted();
}));
return r;
}, source);
}
function observableWindowWithClosingSelector(windowClosingSelector) {
var source = this;
return new AnonymousObservable(function (observer) {
var m = new SerialDisposable(),
d = new CompositeDisposable(m),
r = new RefCountDisposable(d),
win = new Subject();
observer.onNext(addRef(win, r));
d.add(source.subscribe(function (x) {
win.onNext(x);
}, function (err) {
win.onError(err);
observer.onError(err);
}, function () {
win.onCompleted();
observer.onCompleted();
}));
function createWindowClose () {
var windowClose;
try {
windowClose = windowClosingSelector();
} catch (e) {
observer.onError(e);
return;
}
isPromise(windowClose) && (windowClose = observableFromPromise(windowClose));
var m1 = new SingleAssignmentDisposable();
m.setDisposable(m1);
m1.setDisposable(windowClose.take(1).subscribe(noop, function (err) {
win.onError(err);
observer.onError(err);
}, function () {
win.onCompleted();
win = new Subject();
observer.onNext(addRef(win, r));
createWindowClose();
}));
}
createWindowClose();
return r;
}, source);
}
/**
* Returns a new observable that triggers on the second and subsequent triggerings of the input observable.
* The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair.
* The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs.
* @returns {Observable} An observable that triggers on successive pairs of observations from the input observable as an array.
*/
observableProto.pairwise = function () {
var source = this;
return new AnonymousObservable(function (observer) {
var previous, hasPrevious = false;
return source.subscribe(
function (x) {
if (hasPrevious) {
observer.onNext([previous, x]);
} else {
hasPrevious = true;
}
previous = x;
},
observer.onError.bind(observer),
observer.onCompleted.bind(observer));
}, source);
};
/**
* Returns two observables which partition the observations of the source by the given function.
* The first will trigger observations for those values for which the predicate returns true.
* The second will trigger observations for those values where the predicate returns false.
* The predicate is executed once for each subscribed observer.
* Both also propagate all error observations arising from the source and each completes
* when the source completes.
* @param {Function} predicate
* The function to determine which output Observable will trigger a particular observation.
* @returns {Array}
* An array of observables. The first triggers when the predicate returns true,
* and the second triggers when the predicate returns false.
*/
observableProto.partition = function(predicate, thisArg) {
return [
this.filter(predicate, thisArg),
this.filter(function (x, i, o) { return !predicate.call(thisArg, x, i, o); })
];
};
var WhileEnumerable = (function(__super__) {
inherits(WhileEnumerable, __super__);
function WhileEnumerable(c, s) {
this.c = c;
this.s = s;
}
WhileEnumerable.prototype[$iterator$] = function () {
var self = this;
return {
next: function () {
return self.c() ?
{ done: false, value: self.s } :
{ done: true, value: void 0 };
}
};
};
return WhileEnumerable;
}(Enumerable));
function enumerableWhile(condition, source) {
return new WhileEnumerable(condition, source);
}
/**
* Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions.
* This operator allows for a fluent style of writing queries that use the same sequence multiple times.
*
* @param {Function} selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.letBind = observableProto['let'] = function (func) {
return func(this);
};
/**
* Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers <IE9
*
* @example
* 1 - res = Rx.Observable.if(condition, obs1);
* 2 - res = Rx.Observable.if(condition, obs1, obs2);
* 3 - res = Rx.Observable.if(condition, obs1, scheduler);
* @param {Function} condition The condition which determines if the thenSource or elseSource will be run.
* @param {Observable} thenSource The observable sequence or Promise that will be run if the condition function returns true.
* @param {Observable} [elseSource] The observable sequence or Promise that will be run if the condition function returns false. If this is not provided, it defaults to Rx.Observabe.Empty with the specified scheduler.
* @returns {Observable} An observable sequence which is either the thenSource or elseSource.
*/
Observable['if'] = Observable.ifThen = function (condition, thenSource, elseSourceOrScheduler) {
return observableDefer(function () {
elseSourceOrScheduler || (elseSourceOrScheduler = observableEmpty());
isPromise(thenSource) && (thenSource = observableFromPromise(thenSource));
isPromise(elseSourceOrScheduler) && (elseSourceOrScheduler = observableFromPromise(elseSourceOrScheduler));
// Assume a scheduler for empty only
typeof elseSourceOrScheduler.now === 'function' && (elseSourceOrScheduler = observableEmpty(elseSourceOrScheduler));
return condition() ? thenSource : elseSourceOrScheduler;
});
};
/**
* Concatenates the observable sequences obtained by running the specified result selector for each element in source.
* There is an alias for this method called 'forIn' for browsers <IE9
* @param {Array} sources An array of values to turn into an observable sequence.
* @param {Function} resultSelector A function to apply to each item in the sources array to turn it into an observable sequence.
* @returns {Observable} An observable sequence from the concatenated observable sequences.
*/
Observable['for'] = Observable.forIn = function (sources, resultSelector, thisArg) {
return enumerableOf(sources, resultSelector, thisArg).concat();
};
/**
* Repeats source as long as condition holds emulating a while loop.
* There is an alias for this method called 'whileDo' for browsers <IE9
*
* @param {Function} condition The condition which determines if the source will be repeated.
* @param {Observable} source The observable sequence that will be run if the condition function returns true.
* @returns {Observable} An observable sequence which is repeated as long as the condition holds.
*/
var observableWhileDo = Observable['while'] = Observable.whileDo = function (condition, source) {
isPromise(source) && (source = observableFromPromise(source));
return enumerableWhile(condition, source).concat();
};
/**
* Repeats source as long as condition holds emulating a do while loop.
*
* @param {Function} condition The condition which determines if the source will be repeated.
* @param {Observable} source The observable sequence that will be run if the condition function returns true.
* @returns {Observable} An observable sequence which is repeated as long as the condition holds.
*/
observableProto.doWhile = function (condition) {
return observableConcat([this, observableWhileDo(condition, this)]);
};
/**
* Uses selector to determine which source in sources to use.
* There is an alias 'switchCase' for browsers <IE9.
*
* @example
* 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 });
* 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, obs0);
* 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, scheduler);
*
* @param {Function} selector The function which extracts the value for to test in a case statement.
* @param {Array} sources A object which has keys which correspond to the case statement labels.
* @param {Observable} [elseSource] The observable sequence or Promise that will be run if the sources are not matched. If this is not provided, it defaults to Rx.Observabe.empty with the specified scheduler.
*
* @returns {Observable} An observable sequence which is determined by a case statement.
*/
Observable['case'] = Observable.switchCase = function (selector, sources, defaultSourceOrScheduler) {
return observableDefer(function () {
isPromise(defaultSourceOrScheduler) && (defaultSourceOrScheduler = observableFromPromise(defaultSourceOrScheduler));
defaultSourceOrScheduler || (defaultSourceOrScheduler = observableEmpty());
typeof defaultSourceOrScheduler.now === 'function' && (defaultSourceOrScheduler = observableEmpty(defaultSourceOrScheduler));
var result = sources[selector()];
isPromise(result) && (result = observableFromPromise(result));
return result || defaultSourceOrScheduler;
});
};
/**
* Expands an observable sequence by recursively invoking selector.
*
* @param {Function} selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again.
* @param {Scheduler} [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler.
* @returns {Observable} An observable sequence containing all the elements produced by the recursive expansion.
*/
observableProto.expand = function (selector, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
var source = this;
return new AnonymousObservable(function (observer) {
var q = [],
m = new SerialDisposable(),
d = new CompositeDisposable(m),
activeCount = 0,
isAcquired = false;
var ensureActive = function () {
var isOwner = false;
if (q.length > 0) {
isOwner = !isAcquired;
isAcquired = true;
}
if (isOwner) {
m.setDisposable(scheduler.scheduleRecursive(function (self) {
var work;
if (q.length > 0) {
work = q.shift();
} else {
isAcquired = false;
return;
}
var m1 = new SingleAssignmentDisposable();
d.add(m1);
m1.setDisposable(work.subscribe(function (x) {
observer.onNext(x);
var result = null;
try {
result = selector(x);
} catch (e) {
observer.onError(e);
}
q.push(result);
activeCount++;
ensureActive();
}, observer.onError.bind(observer), function () {
d.remove(m1);
activeCount--;
if (activeCount === 0) {
observer.onCompleted();
}
}));
self();
}));
}
};
q.push(source);
activeCount++;
ensureActive();
return d;
}, this);
};
/**
* Runs all observable sequences in parallel and collect their last elements.
*
* @example
* 1 - res = Rx.Observable.forkJoin([obs1, obs2]);
* 1 - res = Rx.Observable.forkJoin(obs1, obs2, ...);
* @returns {Observable} An observable sequence with an array collecting the last elements of all the input sequences.
*/
Observable.forkJoin = function () {
var allSources = [];
if (Array.isArray(arguments[0])) {
allSources = arguments[0];
} else {
for(var i = 0, len = arguments.length; i < len; i++) { allSources.push(arguments[i]); }
}
return new AnonymousObservable(function (subscriber) {
var count = allSources.length;
if (count === 0) {
subscriber.onCompleted();
return disposableEmpty;
}
var group = new CompositeDisposable(),
finished = false,
hasResults = new Array(count),
hasCompleted = new Array(count),
results = new Array(count);
for (var idx = 0; idx < count; idx++) {
(function (i) {
var source = allSources[i];
isPromise(source) && (source = observableFromPromise(source));
group.add(
source.subscribe(
function (value) {
if (!finished) {
hasResults[i] = true;
results[i] = value;
}
},
function (e) {
finished = true;
subscriber.onError(e);
group.dispose();
},
function () {
if (!finished) {
if (!hasResults[i]) {
subscriber.onCompleted();
return;
}
hasCompleted[i] = true;
for (var ix = 0; ix < count; ix++) {
if (!hasCompleted[ix]) { return; }
}
finished = true;
subscriber.onNext(results);
subscriber.onCompleted();
}
}));
})(idx);
}
return group;
});
};
/**
* Runs two observable sequences in parallel and combines their last elemenets.
*
* @param {Observable} second Second observable sequence.
* @param {Function} resultSelector Result selector function to invoke with the last elements of both sequences.
* @returns {Observable} An observable sequence with the result of calling the selector function with the last elements of both input sequences.
*/
observableProto.forkJoin = function (second, resultSelector) {
var first = this;
return new AnonymousObservable(function (observer) {
var leftStopped = false, rightStopped = false,
hasLeft = false, hasRight = false,
lastLeft, lastRight,
leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable();
isPromise(second) && (second = observableFromPromise(second));
leftSubscription.setDisposable(
first.subscribe(function (left) {
hasLeft = true;
lastLeft = left;
}, function (err) {
rightSubscription.dispose();
observer.onError(err);
}, function () {
leftStopped = true;
if (rightStopped) {
if (!hasLeft) {
observer.onCompleted();
} else if (!hasRight) {
observer.onCompleted();
} else {
var result;
try {
result = resultSelector(lastLeft, lastRight);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
observer.onCompleted();
}
}
})
);
rightSubscription.setDisposable(
second.subscribe(function (right) {
hasRight = true;
lastRight = right;
}, function (err) {
leftSubscription.dispose();
observer.onError(err);
}, function () {
rightStopped = true;
if (leftStopped) {
if (!hasLeft) {
observer.onCompleted();
} else if (!hasRight) {
observer.onCompleted();
} else {
var result;
try {
result = resultSelector(lastLeft, lastRight);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
observer.onCompleted();
}
}
})
);
return new CompositeDisposable(leftSubscription, rightSubscription);
}, first);
};
/**
* Comonadic bind operator.
* @param {Function} selector A transform function to apply to each element.
* @param {Object} scheduler Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler.
* @returns {Observable} An observable sequence which results from the comonadic bind operation.
*/
observableProto.manySelect = observableProto.extend = function (selector, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
var source = this;
return observableDefer(function () {
var chain;
return source
.map(function (x) {
var curr = new ChainObservable(x);
chain && chain.onNext(x);
chain = curr;
return curr;
})
.tap(
noop,
function (e) { chain && chain.onError(e); },
function () { chain && chain.onCompleted(); }
)
.observeOn(scheduler)
.map(selector);
}, source);
};
var ChainObservable = (function (__super__) {
function subscribe (observer) {
var self = this, g = new CompositeDisposable();
g.add(currentThreadScheduler.schedule(function () {
observer.onNext(self.head);
g.add(self.tail.mergeAll().subscribe(observer));
}));
return g;
}
inherits(ChainObservable, __super__);
function ChainObservable(head) {
__super__.call(this, subscribe);
this.head = head;
this.tail = new AsyncSubject();
}
addProperties(ChainObservable.prototype, Observer, {
onCompleted: function () {
this.onNext(Observable.empty());
},
onError: function (e) {
this.onNext(Observable.throwError(e));
},
onNext: function (v) {
this.tail.onNext(v);
this.tail.onCompleted();
}
});
return ChainObservable;
}(Observable));
/** @private */
var Map = root.Map || (function () {
function Map() {
this._keys = [];
this._values = [];
}
Map.prototype.get = function (key) {
var i = this._keys.indexOf(key);
return i !== -1 ? this._values[i] : undefined;
};
Map.prototype.set = function (key, value) {
var i = this._keys.indexOf(key);
i !== -1 && (this._values[i] = value);
this._values[this._keys.push(key) - 1] = value;
};
Map.prototype.forEach = function (callback, thisArg) {
for (var i = 0, len = this._keys.length; i < len; i++) {
callback.call(thisArg, this._values[i], this._keys[i]);
}
};
return Map;
}());
/**
* @constructor
* Represents a join pattern over observable sequences.
*/
function Pattern(patterns) {
this.patterns = patterns;
}
/**
* Creates a pattern that matches the current plan matches and when the specified observable sequences has an available value.
* @param other Observable sequence to match in addition to the current pattern.
* @return {Pattern} Pattern object that matches when all observable sequences in the pattern have an available value.
*/
Pattern.prototype.and = function (other) {
return new Pattern(this.patterns.concat(other));
};
/**
* Matches when all observable sequences in the pattern (specified using a chain of and operators) have an available value and projects the values.
* @param {Function} selector Selector that will be invoked with available values from the source sequences, in the same order of the sequences in the pattern.
* @return {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator.
*/
Pattern.prototype.thenDo = function (selector) {
return new Plan(this, selector);
};
function Plan(expression, selector) {
this.expression = expression;
this.selector = selector;
}
Plan.prototype.activate = function (externalSubscriptions, observer, deactivate) {
var self = this;
var joinObservers = [];
for (var i = 0, len = this.expression.patterns.length; i < len; i++) {
joinObservers.push(planCreateObserver(externalSubscriptions, this.expression.patterns[i], observer.onError.bind(observer)));
}
var activePlan = new ActivePlan(joinObservers, function () {
var result;
try {
result = self.selector.apply(self, arguments);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
}, function () {
for (var j = 0, jlen = joinObservers.length; j < jlen; j++) {
joinObservers[j].removeActivePlan(activePlan);
}
deactivate(activePlan);
});
for (i = 0, len = joinObservers.length; i < len; i++) {
joinObservers[i].addActivePlan(activePlan);
}
return activePlan;
};
function planCreateObserver(externalSubscriptions, observable, onError) {
var entry = externalSubscriptions.get(observable);
if (!entry) {
var observer = new JoinObserver(observable, onError);
externalSubscriptions.set(observable, observer);
return observer;
}
return entry;
}
function ActivePlan(joinObserverArray, onNext, onCompleted) {
this.joinObserverArray = joinObserverArray;
this.onNext = onNext;
this.onCompleted = onCompleted;
this.joinObservers = new Map();
for (var i = 0, len = this.joinObserverArray.length; i < len; i++) {
var joinObserver = this.joinObserverArray[i];
this.joinObservers.set(joinObserver, joinObserver);
}
}
ActivePlan.prototype.dequeue = function () {
this.joinObservers.forEach(function (v) { v.queue.shift(); });
};
ActivePlan.prototype.match = function () {
var i, len, hasValues = true;
for (i = 0, len = this.joinObserverArray.length; i < len; i++) {
if (this.joinObserverArray[i].queue.length === 0) {
hasValues = false;
break;
}
}
if (hasValues) {
var firstValues = [],
isCompleted = false;
for (i = 0, len = this.joinObserverArray.length; i < len; i++) {
firstValues.push(this.joinObserverArray[i].queue[0]);
this.joinObserverArray[i].queue[0].kind === 'C' && (isCompleted = true);
}
if (isCompleted) {
this.onCompleted();
} else {
this.dequeue();
var values = [];
for (i = 0, len = firstValues.length; i < firstValues.length; i++) {
values.push(firstValues[i].value);
}
this.onNext.apply(this, values);
}
}
};
var JoinObserver = (function (__super__) {
inherits(JoinObserver, __super__);
function JoinObserver(source, onError) {
__super__.call(this);
this.source = source;
this.onError = onError;
this.queue = [];
this.activePlans = [];
this.subscription = new SingleAssignmentDisposable();
this.isDisposed = false;
}
var JoinObserverPrototype = JoinObserver.prototype;
JoinObserverPrototype.next = function (notification) {
if (!this.isDisposed) {
if (notification.kind === 'E') {
return this.onError(notification.exception);
}
this.queue.push(notification);
var activePlans = this.activePlans.slice(0);
for (var i = 0, len = activePlans.length; i < len; i++) {
activePlans[i].match();
}
}
};
JoinObserverPrototype.error = noop;
JoinObserverPrototype.completed = noop;
JoinObserverPrototype.addActivePlan = function (activePlan) {
this.activePlans.push(activePlan);
};
JoinObserverPrototype.subscribe = function () {
this.subscription.setDisposable(this.source.materialize().subscribe(this));
};
JoinObserverPrototype.removeActivePlan = function (activePlan) {
this.activePlans.splice(this.activePlans.indexOf(activePlan), 1);
this.activePlans.length === 0 && this.dispose();
};
JoinObserverPrototype.dispose = function () {
__super__.prototype.dispose.call(this);
if (!this.isDisposed) {
this.isDisposed = true;
this.subscription.dispose();
}
};
return JoinObserver;
} (AbstractObserver));
/**
* Creates a pattern that matches when both observable sequences have an available value.
*
* @param right Observable sequence to match with the current sequence.
* @return {Pattern} Pattern object that matches when both observable sequences have an available value.
*/
observableProto.and = function (right) {
return new Pattern([this, right]);
};
/**
* Matches when the observable sequence has an available value and projects the value.
*
* @param {Function} selector Selector that will be invoked for values in the source sequence.
* @returns {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator.
*/
observableProto.thenDo = function (selector) {
return new Pattern([this]).thenDo(selector);
};
/**
* Joins together the results from several patterns.
*
* @param plans A series of plans (specified as an Array of as a series of arguments) created by use of the Then operator on patterns.
* @returns {Observable} Observable sequence with the results form matching several patterns.
*/
Observable.when = function () {
var len = arguments.length, plans;
if (Array.isArray(arguments[0])) {
plans = arguments[0];
} else {
plans = new Array(len);
for(var i = 0; i < len; i++) { plans[i] = arguments[i]; }
}
return new AnonymousObservable(function (o) {
var activePlans = [],
externalSubscriptions = new Map();
var outObserver = observerCreate(
function (x) { o.onNext(x); },
function (err) {
externalSubscriptions.forEach(function (v) { v.onError(err); });
o.onError(err);
},
function (x) { o.onCompleted(); }
);
try {
for (var i = 0, len = plans.length; i < len; i++) {
activePlans.push(plans[i].activate(externalSubscriptions, outObserver, function (activePlan) {
var idx = activePlans.indexOf(activePlan);
activePlans.splice(idx, 1);
activePlans.length === 0 && o.onCompleted();
}));
}
} catch (e) {
observableThrow(e).subscribe(o);
}
var group = new CompositeDisposable();
externalSubscriptions.forEach(function (joinObserver) {
joinObserver.subscribe();
group.add(joinObserver);
});
return group;
});
};
function observableTimerDate(dueTime, scheduler) {
return new AnonymousObservable(function (observer) {
return scheduler.scheduleWithAbsolute(dueTime, function () {
observer.onNext(0);
observer.onCompleted();
});
});
}
function observableTimerDateAndPeriod(dueTime, period, scheduler) {
return new AnonymousObservable(function (observer) {
var d = dueTime, p = normalizeTime(period);
return scheduler.scheduleRecursiveWithAbsoluteAndState(0, d, function (count, self) {
if (p > 0) {
var now = scheduler.now();
d = d + p;
d <= now && (d = now + p);
}
observer.onNext(count);
self(count + 1, d);
});
});
}
function observableTimerTimeSpan(dueTime, scheduler) {
return new AnonymousObservable(function (observer) {
return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () {
observer.onNext(0);
observer.onCompleted();
});
});
}
function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) {
return dueTime === period ?
new AnonymousObservable(function (observer) {
return scheduler.schedulePeriodicWithState(0, period, function (count) {
observer.onNext(count);
return count + 1;
});
}) :
observableDefer(function () {
return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler);
});
}
/**
* Returns an observable sequence that produces a value after each period.
*
* @example
* 1 - res = Rx.Observable.interval(1000);
* 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout);
*
* @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds).
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used.
* @returns {Observable} An observable sequence that produces a value after each period.
*/
var observableinterval = Observable.interval = function (period, scheduler) {
return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler);
};
/**
* Returns an observable sequence that produces a value after dueTime has elapsed and then after each period.
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value.
* @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period.
*/
var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) {
var period;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') {
period = periodOrScheduler;
} else if (isScheduler(periodOrScheduler)) {
scheduler = periodOrScheduler;
}
if (dueTime instanceof Date && period === undefined) {
return observableTimerDate(dueTime.getTime(), scheduler);
}
if (dueTime instanceof Date && period !== undefined) {
period = periodOrScheduler;
return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler);
}
return period === undefined ?
observableTimerTimeSpan(dueTime, scheduler) :
observableTimerTimeSpanAndPeriod(dueTime, period, scheduler);
};
function observableDelayTimeSpan(source, dueTime, scheduler) {
return new AnonymousObservable(function (observer) {
var active = false,
cancelable = new SerialDisposable(),
exception = null,
q = [],
running = false,
subscription;
subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) {
var d, shouldRun;
if (notification.value.kind === 'E') {
q = [];
q.push(notification);
exception = notification.value.exception;
shouldRun = !running;
} else {
q.push({ value: notification.value, timestamp: notification.timestamp + dueTime });
shouldRun = !active;
active = true;
}
if (shouldRun) {
if (exception !== null) {
observer.onError(exception);
} else {
d = new SingleAssignmentDisposable();
cancelable.setDisposable(d);
d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) {
var e, recurseDueTime, result, shouldRecurse;
if (exception !== null) {
return;
}
running = true;
do {
result = null;
if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) {
result = q.shift().value;
}
if (result !== null) {
result.accept(observer);
}
} while (result !== null);
shouldRecurse = false;
recurseDueTime = 0;
if (q.length > 0) {
shouldRecurse = true;
recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now());
} else {
active = false;
}
e = exception;
running = false;
if (e !== null) {
observer.onError(e);
} else if (shouldRecurse) {
self(recurseDueTime);
}
}));
}
}
});
return new CompositeDisposable(subscription, cancelable);
}, source);
}
function observableDelayDate(source, dueTime, scheduler) {
return observableDefer(function () {
return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler);
});
}
/**
* Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved.
*
* @example
* 1 - res = Rx.Observable.delay(new Date());
* 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout);
*
* 3 - res = Rx.Observable.delay(5000);
* 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout);
* @memberOf Observable#
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence.
* @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} Time-shifted sequence.
*/
observableProto.delay = function (dueTime, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return dueTime instanceof Date ?
observableDelayDate(this, dueTime.getTime(), scheduler) :
observableDelayTimeSpan(this, dueTime, scheduler);
};
/**
* Ignores values from an observable sequence which are followed by another value before dueTime.
* @param {Number} dueTime Duration of the debounce period for each value (specified as an integer denoting milliseconds).
* @param {Scheduler} [scheduler] Scheduler to run the debounce timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} The debounced sequence.
*/
observableProto.debounce = observableProto.throttleWithTimeout = function (dueTime, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var source = this;
return new AnonymousObservable(function (observer) {
var cancelable = new SerialDisposable(), hasvalue = false, value, id = 0;
var subscription = source.subscribe(
function (x) {
hasvalue = true;
value = x;
id++;
var currentId = id,
d = new SingleAssignmentDisposable();
cancelable.setDisposable(d);
d.setDisposable(scheduler.scheduleWithRelative(dueTime, function () {
hasvalue && id === currentId && observer.onNext(value);
hasvalue = false;
}));
},
function (e) {
cancelable.dispose();
observer.onError(e);
hasvalue = false;
id++;
},
function () {
cancelable.dispose();
hasvalue && observer.onNext(value);
observer.onCompleted();
hasvalue = false;
id++;
});
return new CompositeDisposable(subscription, cancelable);
}, this);
};
/**
* @deprecated use #debounce or #throttleWithTimeout instead.
*/
observableProto.throttle = function(dueTime, scheduler) {
//deprecate('throttle', 'debounce or throttleWithTimeout');
return this.debounce(dueTime, scheduler);
};
/**
* Projects each element of an observable sequence into zero or more windows which are produced based on timing information.
* @param {Number} timeSpan Length of each window (specified as an integer denoting milliseconds).
* @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive windows (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent windows.
* @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence of windows.
*/
observableProto.windowWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) {
var source = this, timeShift;
timeShiftOrScheduler == null && (timeShift = timeSpan);
isScheduler(scheduler) || (scheduler = timeoutScheduler);
if (typeof timeShiftOrScheduler === 'number') {
timeShift = timeShiftOrScheduler;
} else if (isScheduler(timeShiftOrScheduler)) {
timeShift = timeSpan;
scheduler = timeShiftOrScheduler;
}
return new AnonymousObservable(function (observer) {
var groupDisposable,
nextShift = timeShift,
nextSpan = timeSpan,
q = [],
refCountDisposable,
timerD = new SerialDisposable(),
totalTime = 0;
groupDisposable = new CompositeDisposable(timerD),
refCountDisposable = new RefCountDisposable(groupDisposable);
function createTimer () {
var m = new SingleAssignmentDisposable(),
isSpan = false,
isShift = false;
timerD.setDisposable(m);
if (nextSpan === nextShift) {
isSpan = true;
isShift = true;
} else if (nextSpan < nextShift) {
isSpan = true;
} else {
isShift = true;
}
var newTotalTime = isSpan ? nextSpan : nextShift,
ts = newTotalTime - totalTime;
totalTime = newTotalTime;
if (isSpan) {
nextSpan += timeShift;
}
if (isShift) {
nextShift += timeShift;
}
m.setDisposable(scheduler.scheduleWithRelative(ts, function () {
if (isShift) {
var s = new Subject();
q.push(s);
observer.onNext(addRef(s, refCountDisposable));
}
isSpan && q.shift().onCompleted();
createTimer();
}));
};
q.push(new Subject());
observer.onNext(addRef(q[0], refCountDisposable));
createTimer();
groupDisposable.add(source.subscribe(
function (x) {
for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
},
function (e) {
for (var i = 0, len = q.length; i < len; i++) { q[i].onError(e); }
observer.onError(e);
},
function () {
for (var i = 0, len = q.length; i < len; i++) { q[i].onCompleted(); }
observer.onCompleted();
}
));
return refCountDisposable;
}, source);
};
/**
* Projects each element of an observable sequence into a window that is completed when either it's full or a given amount of time has elapsed.
* @param {Number} timeSpan Maximum time length of a window.
* @param {Number} count Maximum element count of a window.
* @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence of windows.
*/
observableProto.windowWithTimeOrCount = function (timeSpan, count, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var timerD = new SerialDisposable(),
groupDisposable = new CompositeDisposable(timerD),
refCountDisposable = new RefCountDisposable(groupDisposable),
n = 0,
windowId = 0,
s = new Subject();
function createTimer(id) {
var m = new SingleAssignmentDisposable();
timerD.setDisposable(m);
m.setDisposable(scheduler.scheduleWithRelative(timeSpan, function () {
if (id !== windowId) { return; }
n = 0;
var newId = ++windowId;
s.onCompleted();
s = new Subject();
observer.onNext(addRef(s, refCountDisposable));
createTimer(newId);
}));
}
observer.onNext(addRef(s, refCountDisposable));
createTimer(0);
groupDisposable.add(source.subscribe(
function (x) {
var newId = 0, newWindow = false;
s.onNext(x);
if (++n === count) {
newWindow = true;
n = 0;
newId = ++windowId;
s.onCompleted();
s = new Subject();
observer.onNext(addRef(s, refCountDisposable));
}
newWindow && createTimer(newId);
},
function (e) {
s.onError(e);
observer.onError(e);
}, function () {
s.onCompleted();
observer.onCompleted();
}
));
return refCountDisposable;
}, source);
};
/**
* Projects each element of an observable sequence into zero or more buffers which are produced based on timing information.
*
* @example
* 1 - res = xs.bufferWithTime(1000, scheduler); // non-overlapping segments of 1 second
* 2 - res = xs.bufferWithTime(1000, 500, scheduler; // segments of 1 second with time shift 0.5 seconds
*
* @param {Number} timeSpan Length of each buffer (specified as an integer denoting milliseconds).
* @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive buffers (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent buffers.
* @param {Scheduler} [scheduler] Scheduler to run buffer timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence of buffers.
*/
observableProto.bufferWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) {
return this.windowWithTime.apply(this, arguments).selectMany(function (x) { return x.toArray(); });
};
/**
* Projects each element of an observable sequence into a buffer that is completed when either it's full or a given amount of time has elapsed.
*
* @example
* 1 - res = source.bufferWithTimeOrCount(5000, 50); // 5s or 50 items in an array
* 2 - res = source.bufferWithTimeOrCount(5000, 50, scheduler); // 5s or 50 items in an array
*
* @param {Number} timeSpan Maximum time length of a buffer.
* @param {Number} count Maximum element count of a buffer.
* @param {Scheduler} [scheduler] Scheduler to run bufferin timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence of buffers.
*/
observableProto.bufferWithTimeOrCount = function (timeSpan, count, scheduler) {
return this.windowWithTimeOrCount(timeSpan, count, scheduler).selectMany(function (x) {
return x.toArray();
});
};
/**
* Records the time interval between consecutive values in an observable sequence.
*
* @example
* 1 - res = source.timeInterval();
* 2 - res = source.timeInterval(Rx.Scheduler.timeout);
*
* @param [scheduler] Scheduler used to compute time intervals. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence with time interval information on values.
*/
observableProto.timeInterval = function (scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return observableDefer(function () {
var last = scheduler.now();
return source.map(function (x) {
var now = scheduler.now(), span = now - last;
last = now;
return { value: x, interval: span };
});
});
};
/**
* Records the timestamp for each value in an observable sequence.
*
* @example
* 1 - res = source.timestamp(); // produces { value: x, timestamp: ts }
* 2 - res = source.timestamp(Rx.Scheduler.default);
*
* @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the default scheduler is used.
* @returns {Observable} An observable sequence with timestamp information on values.
*/
observableProto.timestamp = function (scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return this.map(function (x) {
return { value: x, timestamp: scheduler.now() };
});
};
function sampleObservable(source, sampler) {
return new AnonymousObservable(function (o) {
var atEnd = false, value, hasValue = false;
function sampleSubscribe() {
if (hasValue) {
hasValue = false;
o.onNext(value);
}
atEnd && o.onCompleted();
}
var sourceSubscription = new SingleAssignmentDisposable();
sourceSubscription.setDisposable(source.subscribe(
function (newValue) {
hasValue = true;
value = newValue;
},
function (e) { o.onError(e); },
function () {
atEnd = true;
sourceSubscription.dispose();
}
));
return new CompositeDisposable(
sourceSubscription,
sampler.subscribe(sampleSubscribe, function (e) { o.onError(e); }, sampleSubscribe)
);
}, source);
}
/**
* Samples the observable sequence at each interval.
*
* @example
* 1 - res = source.sample(sampleObservable); // Sampler tick sequence
* 2 - res = source.sample(5000); // 5 seconds
* 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds
*
* @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable.
* @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used.
* @returns {Observable} Sampled observable sequence.
*/
observableProto.sample = observableProto.throttleLatest = function (intervalOrSampler, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return typeof intervalOrSampler === 'number' ?
sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) :
sampleObservable(this, intervalOrSampler);
};
/**
* Returns the source observable sequence or the other observable sequence if dueTime elapses.
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs.
* @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used.
* @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
*/
observableProto.timeout = function (dueTime, other, scheduler) {
(other == null || typeof other === 'string') && (other = observableThrow(new Error(other || 'Timeout')));
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var source = this, schedulerMethod = dueTime instanceof Date ?
'scheduleWithAbsolute' :
'scheduleWithRelative';
return new AnonymousObservable(function (observer) {
var id = 0,
original = new SingleAssignmentDisposable(),
subscription = new SerialDisposable(),
switched = false,
timer = new SerialDisposable();
subscription.setDisposable(original);
function createTimer() {
var myId = id;
timer.setDisposable(scheduler[schedulerMethod](dueTime, function () {
if (id === myId) {
isPromise(other) && (other = observableFromPromise(other));
subscription.setDisposable(other.subscribe(observer));
}
}));
}
createTimer();
original.setDisposable(source.subscribe(function (x) {
if (!switched) {
id++;
observer.onNext(x);
createTimer();
}
}, function (e) {
if (!switched) {
id++;
observer.onError(e);
}
}, function () {
if (!switched) {
id++;
observer.onCompleted();
}
}));
return new CompositeDisposable(subscription, timer);
}, source);
};
/**
* Generates an observable sequence by iterating a state from an initial state until the condition fails.
*
* @example
* res = source.generateWithAbsoluteTime(0,
* function (x) { return return true; },
* function (x) { return x + 1; },
* function (x) { return x; },
* function (x) { return new Date(); }
* });
*
* @param {Mixed} initialState Initial state.
* @param {Function} condition Condition to terminate generation (upon returning false).
* @param {Function} iterate Iteration step function.
* @param {Function} resultSelector Selector function for results produced in the sequence.
* @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning Date values.
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
* @returns {Observable} The generated sequence.
*/
Observable.generateWithAbsoluteTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var first = true,
hasResult = false;
return scheduler.scheduleRecursiveWithAbsoluteAndState(initialState, scheduler.now(), function (state, self) {
hasResult && observer.onNext(state);
try {
if (first) {
first = false;
} else {
state = iterate(state);
}
hasResult = condition(state);
if (hasResult) {
var result = resultSelector(state);
var time = timeSelector(state);
}
} catch (e) {
observer.onError(e);
return;
}
if (hasResult) {
self(result, time);
} else {
observer.onCompleted();
}
});
});
};
/**
* Generates an observable sequence by iterating a state from an initial state until the condition fails.
*
* @example
* res = source.generateWithRelativeTime(0,
* function (x) { return return true; },
* function (x) { return x + 1; },
* function (x) { return x; },
* function (x) { return 500; }
* );
*
* @param {Mixed} initialState Initial state.
* @param {Function} condition Condition to terminate generation (upon returning false).
* @param {Function} iterate Iteration step function.
* @param {Function} resultSelector Selector function for results produced in the sequence.
* @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning integer values denoting milliseconds.
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
* @returns {Observable} The generated sequence.
*/
Observable.generateWithRelativeTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var first = true,
hasResult = false;
return scheduler.scheduleRecursiveWithRelativeAndState(initialState, 0, function (state, self) {
hasResult && observer.onNext(state);
try {
if (first) {
first = false;
} else {
state = iterate(state);
}
hasResult = condition(state);
if (hasResult) {
var result = resultSelector(state);
var time = timeSelector(state);
}
} catch (e) {
observer.onError(e);
return;
}
if (hasResult) {
self(result, time);
} else {
observer.onCompleted();
}
});
});
};
/**
* Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers.
*
* @example
* 1 - res = source.delaySubscription(5000); // 5s
* 2 - res = source.delaySubscription(5000, Rx.Scheduler.default); // 5 seconds
*
* @param {Number} dueTime Relative or absolute time shift of the subscription.
* @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used.
* @returns {Observable} Time-shifted sequence.
*/
observableProto.delaySubscription = function (dueTime, scheduler) {
var scheduleMethod = dueTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative';
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (o) {
var d = new SerialDisposable();
d.setDisposable(scheduler[scheduleMethod](dueTime, function() {
d.setDisposable(source.subscribe(o));
}));
return d;
}, this);
};
/**
* Time shifts the observable sequence based on a subscription delay and a delay selector function for each element.
*
* @example
* 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only
* 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector
*
* @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source.
* @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element.
* @returns {Observable} Time-shifted sequence.
*/
observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) {
var source = this, subDelay, selector;
if (isFunction(subscriptionDelay)) {
selector = subscriptionDelay;
} else {
subDelay = subscriptionDelay;
selector = delayDurationSelector;
}
return new AnonymousObservable(function (observer) {
var delays = new CompositeDisposable(), atEnd = false, subscription = new SerialDisposable();
function start() {
subscription.setDisposable(source.subscribe(
function (x) {
var delay = tryCatch(selector)(x);
if (delay === errorObj) { return observer.onError(delay.e); }
var d = new SingleAssignmentDisposable();
delays.add(d);
d.setDisposable(delay.subscribe(
function () {
observer.onNext(x);
delays.remove(d);
done();
},
function (e) { observer.onError(e); },
function () {
observer.onNext(x);
delays.remove(d);
done();
}
))
},
function (e) { observer.onError(e); },
function () {
atEnd = true;
subscription.dispose();
done();
}
))
}
function done () {
atEnd && delays.length === 0 && observer.onCompleted();
}
if (!subDelay) {
start();
} else {
subscription.setDisposable(subDelay.subscribe(start, function (e) { observer.onError(e); }, start));
}
return new CompositeDisposable(subscription, delays);
}, this);
};
/**
* Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled.
* @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never().
* @param {Function} timeoutDurationSelector Selector to retrieve an observable sequence that represents the timeout between the current element and the next element.
* @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException().
* @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
*/
observableProto.timeoutWithSelector = function (firstTimeout, timeoutdurationSelector, other) {
if (arguments.length === 1) {
timeoutdurationSelector = firstTimeout;
firstTimeout = observableNever();
}
other || (other = observableThrow(new Error('Timeout')));
var source = this;
return new AnonymousObservable(function (observer) {
var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable();
subscription.setDisposable(original);
var id = 0, switched = false;
function setTimer(timeout) {
var myId = id;
function timerWins () {
return id === myId;
}
var d = new SingleAssignmentDisposable();
timer.setDisposable(d);
d.setDisposable(timeout.subscribe(function () {
timerWins() && subscription.setDisposable(other.subscribe(observer));
d.dispose();
}, function (e) {
timerWins() && observer.onError(e);
}, function () {
timerWins() && subscription.setDisposable(other.subscribe(observer));
}));
};
setTimer(firstTimeout);
function observerWins() {
var res = !switched;
if (res) { id++; }
return res;
}
original.setDisposable(source.subscribe(function (x) {
if (observerWins()) {
observer.onNext(x);
var timeout;
try {
timeout = timeoutdurationSelector(x);
} catch (e) {
observer.onError(e);
return;
}
setTimer(isPromise(timeout) ? observableFromPromise(timeout) : timeout);
}
}, function (e) {
observerWins() && observer.onError(e);
}, function () {
observerWins() && observer.onCompleted();
}));
return new CompositeDisposable(subscription, timer);
}, source);
};
/**
* Ignores values from an observable sequence which are followed by another value within a computed throttle duration.
* @param {Function} durationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element.
* @returns {Observable} The debounced sequence.
*/
observableProto.debounceWithSelector = function (durationSelector) {
var source = this;
return new AnonymousObservable(function (observer) {
var value, hasValue = false, cancelable = new SerialDisposable(), id = 0;
var subscription = source.subscribe(function (x) {
var throttle;
try {
throttle = durationSelector(x);
} catch (e) {
observer.onError(e);
return;
}
isPromise(throttle) && (throttle = observableFromPromise(throttle));
hasValue = true;
value = x;
id++;
var currentid = id, d = new SingleAssignmentDisposable();
cancelable.setDisposable(d);
d.setDisposable(throttle.subscribe(function () {
hasValue && id === currentid && observer.onNext(value);
hasValue = false;
d.dispose();
}, observer.onError.bind(observer), function () {
hasValue && id === currentid && observer.onNext(value);
hasValue = false;
d.dispose();
}));
}, function (e) {
cancelable.dispose();
observer.onError(e);
hasValue = false;
id++;
}, function () {
cancelable.dispose();
hasValue && observer.onNext(value);
observer.onCompleted();
hasValue = false;
id++;
});
return new CompositeDisposable(subscription, cancelable);
}, source);
};
/**
* @deprecated use #debounceWithSelector instead.
*/
observableProto.throttleWithSelector = function (durationSelector) {
//deprecate('throttleWithSelector', 'debounceWithSelector');
return this.debounceWithSelector(durationSelector);
};
/**
* Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
*
* 1 - res = source.skipLastWithTime(5000);
* 2 - res = source.skipLastWithTime(5000, scheduler);
*
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for skipping elements from the end of the sequence.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout
* @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence.
*/
observableProto.skipLastWithTime = function (duration, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var source = this;
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
var now = scheduler.now();
q.push({ interval: now, value: x });
while (q.length > 0 && now - q[0].interval >= duration) {
o.onNext(q.shift().value);
}
}, function (e) { o.onError(e); }, function () {
var now = scheduler.now();
while (q.length > 0 && now - q[0].interval >= duration) {
o.onNext(q.shift().value);
}
o.onCompleted();
});
}, source);
};
/**
* Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements.
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for taking elements from the end of the sequence.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence.
*/
observableProto.takeLastWithTime = function (duration, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
var now = scheduler.now();
q.push({ interval: now, value: x });
while (q.length > 0 && now - q[0].interval >= duration) {
q.shift();
}
}, function (e) { o.onError(e); }, function () {
var now = scheduler.now();
while (q.length > 0) {
var next = q.shift();
if (now - next.interval <= duration) { o.onNext(next.value); }
}
o.onCompleted();
});
}, source);
};
/**
* Returns an array with the elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for taking elements from the end of the sequence.
* @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence containing a single array with the elements taken during the specified duration from the end of the source sequence.
*/
observableProto.takeLastBufferWithTime = function (duration, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
var now = scheduler.now();
q.push({ interval: now, value: x });
while (q.length > 0 && now - q[0].interval >= duration) {
q.shift();
}
}, function (e) { o.onError(e); }, function () {
var now = scheduler.now(), res = [];
while (q.length > 0) {
var next = q.shift();
now - next.interval <= duration && res.push(next.value);
}
o.onNext(res);
o.onCompleted();
});
}, source);
};
/**
* Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
*
* @example
* 1 - res = source.takeWithTime(5000, [optional scheduler]);
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for taking elements from the start of the sequence.
* @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence.
*/
observableProto.takeWithTime = function (duration, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (o) {
return new CompositeDisposable(scheduler.scheduleWithRelative(duration, function () { o.onCompleted(); }), source.subscribe(o));
}, source);
};
/**
* Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
*
* @example
* 1 - res = source.skipWithTime(5000, [optional scheduler]);
*
* @description
* Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence.
* This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded
* may not execute immediately, despite the zero due time.
*
* Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration.
* @param {Number} duration Duration for skipping elements from the start of the sequence.
* @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence.
*/
observableProto.skipWithTime = function (duration, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var open = false;
return new CompositeDisposable(
scheduler.scheduleWithRelative(duration, function () { open = true; }),
source.subscribe(function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)));
}, source);
};
/**
* Skips elements from the observable source sequence until the specified start time, using the specified scheduler to run timers.
* Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the start time.
*
* @examples
* 1 - res = source.skipUntilWithTime(new Date(), [scheduler]);
* 2 - res = source.skipUntilWithTime(5000, [scheduler]);
* @param {Date|Number} startTime Time to start taking elements from the source sequence. If this value is less than or equal to Date(), no elements will be skipped.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements skipped until the specified start time.
*/
observableProto.skipUntilWithTime = function (startTime, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var source = this, schedulerMethod = startTime instanceof Date ?
'scheduleWithAbsolute' :
'scheduleWithRelative';
return new AnonymousObservable(function (o) {
var open = false;
return new CompositeDisposable(
scheduler[schedulerMethod](startTime, function () { open = true; }),
source.subscribe(
function (x) { open && o.onNext(x); },
function (e) { o.onError(e); }, function () { o.onCompleted(); }));
}, source);
};
/**
* Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers.
* @param {Number | Date} endTime Time to stop taking elements from the source sequence. If this value is less than or equal to new Date(), the result stream will complete immediately.
* @param {Scheduler} [scheduler] Scheduler to run the timer on.
* @returns {Observable} An observable sequence with the elements taken until the specified end time.
*/
observableProto.takeUntilWithTime = function (endTime, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var source = this, schedulerMethod = endTime instanceof Date ?
'scheduleWithAbsolute' :
'scheduleWithRelative';
return new AnonymousObservable(function (o) {
return new CompositeDisposable(
scheduler[schedulerMethod](endTime, function () { o.onCompleted(); }),
source.subscribe(o));
}, source);
};
/**
* Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration.
* @param {Number} windowDuration time to wait before emitting another item after emitting the last item
* @param {Scheduler} [scheduler] the Scheduler to use internally to manage the timers that handle timeout for each item. If not provided, defaults to Scheduler.timeout.
* @returns {Observable} An Observable that performs the throttle operation.
*/
observableProto.throttleFirst = function (windowDuration, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var duration = +windowDuration || 0;
if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); }
var source = this;
return new AnonymousObservable(function (o) {
var lastOnNext = 0;
return source.subscribe(
function (x) {
var now = scheduler.now();
if (lastOnNext === 0 || now - lastOnNext >= duration) {
lastOnNext = now;
o.onNext(x);
}
},function (e) { o.onError(e); }, function () { o.onCompleted(); }
);
}, source);
};
/**
* Executes a transducer to transform the observable sequence
* @param {Transducer} transducer A transducer to execute
* @returns {Observable} An Observable sequence containing the results from the transducer.
*/
observableProto.transduce = function(transducer) {
var source = this;
function transformForObserver(o) {
return {
'@@transducer/init': function() {
return o;
},
'@@transducer/step': function(obs, input) {
return obs.onNext(input);
},
'@@transducer/result': function(obs) {
return obs.onCompleted();
}
};
}
return new AnonymousObservable(function(o) {
var xform = transducer(transformForObserver(o));
return source.subscribe(
function(v) {
try {
xform['@@transducer/step'](o, v);
} catch (e) {
o.onError(e);
}
},
function (e) { o.onError(e); },
function() { xform['@@transducer/result'](o); }
);
}, source);
};
/*
* Performs a exclusive waiting for the first to finish before subscribing to another observable.
* Observables that come in between subscriptions will be dropped on the floor.
* @returns {Observable} A exclusive observable with only the results that happen when subscribed.
*/
observableProto.exclusive = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var hasCurrent = false,
isStopped = false,
m = new SingleAssignmentDisposable(),
g = new CompositeDisposable();
g.add(m);
m.setDisposable(sources.subscribe(
function (innerSource) {
if (!hasCurrent) {
hasCurrent = true;
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
var innerSubscription = new SingleAssignmentDisposable();
g.add(innerSubscription);
innerSubscription.setDisposable(innerSource.subscribe(
observer.onNext.bind(observer),
observer.onError.bind(observer),
function () {
g.remove(innerSubscription);
hasCurrent = false;
if (isStopped && g.length === 1) {
observer.onCompleted();
}
}));
}
},
observer.onError.bind(observer),
function () {
isStopped = true;
if (!hasCurrent && g.length === 1) {
observer.onCompleted();
}
}));
return g;
}, this);
};
/*
* Performs a exclusive map waiting for the first to finish before subscribing to another observable.
* Observables that come in between subscriptions will be dropped on the floor.
* @param {Function} selector Selector to invoke for every item in the current subscription.
* @param {Any} [thisArg] An optional context to invoke with the selector parameter.
* @returns {Observable} An exclusive observable with only the results that happen when subscribed.
*/
observableProto.exclusiveMap = function (selector, thisArg) {
var sources = this,
selectorFunc = bindCallback(selector, thisArg, 3);
return new AnonymousObservable(function (observer) {
var index = 0,
hasCurrent = false,
isStopped = true,
m = new SingleAssignmentDisposable(),
g = new CompositeDisposable();
g.add(m);
m.setDisposable(sources.subscribe(
function (innerSource) {
if (!hasCurrent) {
hasCurrent = true;
innerSubscription = new SingleAssignmentDisposable();
g.add(innerSubscription);
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
innerSubscription.setDisposable(innerSource.subscribe(
function (x) {
var result;
try {
result = selectorFunc(x, index++, innerSource);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
},
function (e) { observer.onError(e); },
function () {
g.remove(innerSubscription);
hasCurrent = false;
if (isStopped && g.length === 1) {
observer.onCompleted();
}
}));
}
},
function (e) { observer.onError(e); },
function () {
isStopped = true;
if (g.length === 1 && !hasCurrent) {
observer.onCompleted();
}
}));
return g;
}, this);
};
/** Provides a set of extension methods for virtual time scheduling. */
Rx.VirtualTimeScheduler = (function (__super__) {
function localNow() {
return this.toDateTimeOffset(this.clock);
}
function scheduleNow(state, action) {
return this.scheduleAbsoluteWithState(state, this.clock, action);
}
function scheduleRelative(state, dueTime, action) {
return this.scheduleRelativeWithState(state, this.toRelative(dueTime), action);
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleRelativeWithState(state, this.toRelative(dueTime - this.now()), action);
}
function invokeAction(scheduler, action) {
action();
return disposableEmpty;
}
inherits(VirtualTimeScheduler, __super__);
/**
* Creates a new virtual time scheduler with the specified initial clock value and absolute time comparer.
*
* @constructor
* @param {Number} initialClock Initial value for the clock.
* @param {Function} comparer Comparer to determine causality of events based on absolute time.
*/
function VirtualTimeScheduler(initialClock, comparer) {
this.clock = initialClock;
this.comparer = comparer;
this.isEnabled = false;
this.queue = new PriorityQueue(1024);
__super__.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute);
}
var VirtualTimeSchedulerPrototype = VirtualTimeScheduler.prototype;
/**
* Adds a relative time value to an absolute time value.
* @param {Number} absolute Absolute virtual time value.
* @param {Number} relative Relative virtual time value to add.
* @return {Number} Resulting absolute virtual time sum value.
*/
VirtualTimeSchedulerPrototype.add = notImplemented;
/**
* Converts an absolute time to a number
* @param {Any} The absolute time.
* @returns {Number} The absolute time in ms
*/
VirtualTimeSchedulerPrototype.toDateTimeOffset = notImplemented;
/**
* Converts the TimeSpan value to a relative virtual time value.
* @param {Number} timeSpan TimeSpan value to convert.
* @return {Number} Corresponding relative virtual time value.
*/
VirtualTimeSchedulerPrototype.toRelative = notImplemented;
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be emulated using recursive scheduling.
* @param {Mixed} state Initial state passed to the action upon the first iteration.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed, potentially updating the state.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
VirtualTimeSchedulerPrototype.schedulePeriodicWithState = function (state, period, action) {
var s = new SchedulePeriodicRecursive(this, state, period, action);
return s.start();
};
/**
* Schedules an action to be executed after dueTime.
* @param {Mixed} state State passed to the action to be executed.
* @param {Number} dueTime Relative time after which to execute the action.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
VirtualTimeSchedulerPrototype.scheduleRelativeWithState = function (state, dueTime, action) {
var runAt = this.add(this.clock, dueTime);
return this.scheduleAbsoluteWithState(state, runAt, action);
};
/**
* Schedules an action to be executed at dueTime.
* @param {Number} dueTime Relative time after which to execute the action.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
VirtualTimeSchedulerPrototype.scheduleRelative = function (dueTime, action) {
return this.scheduleRelativeWithState(action, dueTime, invokeAction);
};
/**
* Starts the virtual time scheduler.
*/
VirtualTimeSchedulerPrototype.start = function () {
if (!this.isEnabled) {
this.isEnabled = true;
do {
var next = this.getNext();
if (next !== null) {
this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime);
next.invoke();
} else {
this.isEnabled = false;
}
} while (this.isEnabled);
}
};
/**
* Stops the virtual time scheduler.
*/
VirtualTimeSchedulerPrototype.stop = function () {
this.isEnabled = false;
};
/**
* Advances the scheduler's clock to the specified time, running all work till that point.
* @param {Number} time Absolute time to advance the scheduler's clock to.
*/
VirtualTimeSchedulerPrototype.advanceTo = function (time) {
var dueToClock = this.comparer(this.clock, time);
if (this.comparer(this.clock, time) > 0) { throw new ArgumentOutOfRangeError(); }
if (dueToClock === 0) { return; }
if (!this.isEnabled) {
this.isEnabled = true;
do {
var next = this.getNext();
if (next !== null && this.comparer(next.dueTime, time) <= 0) {
this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime);
next.invoke();
} else {
this.isEnabled = false;
}
} while (this.isEnabled);
this.clock = time;
}
};
/**
* Advances the scheduler's clock by the specified relative time, running all work scheduled for that timespan.
* @param {Number} time Relative time to advance the scheduler's clock by.
*/
VirtualTimeSchedulerPrototype.advanceBy = function (time) {
var dt = this.add(this.clock, time),
dueToClock = this.comparer(this.clock, dt);
if (dueToClock > 0) { throw new ArgumentOutOfRangeError(); }
if (dueToClock === 0) { return; }
this.advanceTo(dt);
};
/**
* Advances the scheduler's clock by the specified relative time.
* @param {Number} time Relative time to advance the scheduler's clock by.
*/
VirtualTimeSchedulerPrototype.sleep = function (time) {
var dt = this.add(this.clock, time);
if (this.comparer(this.clock, dt) >= 0) { throw new ArgumentOutOfRangeError(); }
this.clock = dt;
};
/**
* Gets the next scheduled item to be executed.
* @returns {ScheduledItem} The next scheduled item.
*/
VirtualTimeSchedulerPrototype.getNext = function () {
while (this.queue.length > 0) {
var next = this.queue.peek();
if (next.isCancelled()) {
this.queue.dequeue();
} else {
return next;
}
}
return null;
};
/**
* Schedules an action to be executed at dueTime.
* @param {Scheduler} scheduler Scheduler to execute the action on.
* @param {Number} dueTime Absolute time at which to execute the action.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
VirtualTimeSchedulerPrototype.scheduleAbsolute = function (dueTime, action) {
return this.scheduleAbsoluteWithState(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed at dueTime.
* @param {Mixed} state State passed to the action to be executed.
* @param {Number} dueTime Absolute time at which to execute the action.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
VirtualTimeSchedulerPrototype.scheduleAbsoluteWithState = function (state, dueTime, action) {
var self = this;
function run(scheduler, state1) {
self.queue.remove(si);
return action(scheduler, state1);
}
var si = new ScheduledItem(this, state, run, dueTime, this.comparer);
this.queue.enqueue(si);
return si.disposable;
};
return VirtualTimeScheduler;
}(Scheduler));
/** Provides a virtual time scheduler that uses Date for absolute time and number for relative time. */
Rx.HistoricalScheduler = (function (__super__) {
inherits(HistoricalScheduler, __super__);
/**
* Creates a new historical scheduler with the specified initial clock value.
* @constructor
* @param {Number} initialClock Initial value for the clock.
* @param {Function} comparer Comparer to determine causality of events based on absolute time.
*/
function HistoricalScheduler(initialClock, comparer) {
var clock = initialClock == null ? 0 : initialClock;
var cmp = comparer || defaultSubComparer;
__super__.call(this, clock, cmp);
}
var HistoricalSchedulerProto = HistoricalScheduler.prototype;
/**
* Adds a relative time value to an absolute time value.
* @param {Number} absolute Absolute virtual time value.
* @param {Number} relative Relative virtual time value to add.
* @return {Number} Resulting absolute virtual time sum value.
*/
HistoricalSchedulerProto.add = function (absolute, relative) {
return absolute + relative;
};
HistoricalSchedulerProto.toDateTimeOffset = function (absolute) {
return new Date(absolute).getTime();
};
/**
* Converts the TimeSpan value to a relative virtual time value.
* @memberOf HistoricalScheduler
* @param {Number} timeSpan TimeSpan value to convert.
* @return {Number} Corresponding relative virtual time value.
*/
HistoricalSchedulerProto.toRelative = function (timeSpan) {
return timeSpan;
};
return HistoricalScheduler;
}(Rx.VirtualTimeScheduler));
var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
inherits(AnonymousObservable, __super__);
// Fix subscriber to check for undefined or function returned to decorate as Disposable
function fixSubscriber(subscriber) {
return subscriber && isFunction(subscriber.dispose) ? subscriber :
isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
}
function setDisposable(s, state) {
var ado = state[0], subscribe = state[1];
var sub = tryCatch(subscribe)(ado);
if (sub === errorObj) {
if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
}
ado.setDisposable(fixSubscriber(sub));
}
function AnonymousObservable(subscribe, parent) {
this.source = parent;
function s(observer) {
var ado = new AutoDetachObserver(observer), state = [ado, subscribe];
if (currentThreadScheduler.scheduleRequired()) {
currentThreadScheduler.scheduleWithState(state, setDisposable);
} else {
setDisposable(null, state);
}
return ado;
}
__super__.call(this, s);
}
return AnonymousObservable;
}(Observable));
var AutoDetachObserver = (function (__super__) {
inherits(AutoDetachObserver, __super__);
function AutoDetachObserver(observer) {
__super__.call(this);
this.observer = observer;
this.m = new SingleAssignmentDisposable();
}
var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
AutoDetachObserverPrototype.next = function (value) {
var result = tryCatch(this.observer.onNext).call(this.observer, value);
if (result === errorObj) {
this.dispose();
thrower(result.e);
}
};
AutoDetachObserverPrototype.error = function (err) {
var result = tryCatch(this.observer.onError).call(this.observer, err);
this.dispose();
result === errorObj && thrower(result.e);
};
AutoDetachObserverPrototype.completed = function () {
var result = tryCatch(this.observer.onCompleted).call(this.observer);
this.dispose();
result === errorObj && thrower(result.e);
};
AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); };
AutoDetachObserverPrototype.dispose = function () {
__super__.prototype.dispose.call(this);
this.m.dispose();
};
return AutoDetachObserver;
}(AbstractObserver));
var GroupedObservable = (function (__super__) {
inherits(GroupedObservable, __super__);
function subscribe(observer) {
return this.underlyingObservable.subscribe(observer);
}
function GroupedObservable(key, underlyingObservable, mergedDisposable) {
__super__.call(this, subscribe);
this.key = key;
this.underlyingObservable = !mergedDisposable ?
underlyingObservable :
new AnonymousObservable(function (observer) {
return new CompositeDisposable(mergedDisposable.getDisposable(), underlyingObservable.subscribe(observer));
});
}
return GroupedObservable;
}(Observable));
/**
* Represents an object that is both an observable sequence as well as an observer.
* Each notification is broadcasted to all subscribed observers.
*/
var Subject = Rx.Subject = (function (__super__) {
function subscribe(observer) {
checkDisposed(this);
if (!this.isStopped) {
this.observers.push(observer);
return new InnerSubscription(this, observer);
}
if (this.hasError) {
observer.onError(this.error);
return disposableEmpty;
}
observer.onCompleted();
return disposableEmpty;
}
inherits(Subject, __super__);
/**
* Creates a subject.
*/
function Subject() {
__super__.call(this, subscribe);
this.isDisposed = false,
this.isStopped = false,
this.observers = [];
this.hasError = false;
}
addProperties(Subject.prototype, Observer.prototype, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () { return this.observers.length > 0; },
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
checkDisposed(this);
if (!this.isStopped) {
this.isStopped = true;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onCompleted();
}
this.observers.length = 0;
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (error) {
checkDisposed(this);
if (!this.isStopped) {
this.isStopped = true;
this.error = error;
this.hasError = true;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onError(error);
}
this.observers.length = 0;
}
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
checkDisposed(this);
if (!this.isStopped) {
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onNext(value);
}
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
}
});
/**
* Creates a subject from the specified observer and observable.
* @param {Observer} observer The observer used to send messages to the subject.
* @param {Observable} observable The observable used to subscribe to messages sent from the subject.
* @returns {Subject} Subject implemented using the given observer and observable.
*/
Subject.create = function (observer, observable) {
return new AnonymousSubject(observer, observable);
};
return Subject;
}(Observable));
/**
* Represents the result of an asynchronous operation.
* The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
*/
var AsyncSubject = Rx.AsyncSubject = (function (__super__) {
function subscribe(observer) {
checkDisposed(this);
if (!this.isStopped) {
this.observers.push(observer);
return new InnerSubscription(this, observer);
}
if (this.hasError) {
observer.onError(this.error);
} else if (this.hasValue) {
observer.onNext(this.value);
observer.onCompleted();
} else {
observer.onCompleted();
}
return disposableEmpty;
}
inherits(AsyncSubject, __super__);
/**
* Creates a subject that can only receive one value and that value is cached for all future observations.
* @constructor
*/
function AsyncSubject() {
__super__.call(this, subscribe);
this.isDisposed = false;
this.isStopped = false;
this.hasValue = false;
this.observers = [];
this.hasError = false;
}
addProperties(AsyncSubject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
checkDisposed(this);
return this.observers.length > 0;
},
/**
* Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
*/
onCompleted: function () {
var i, len;
checkDisposed(this);
if (!this.isStopped) {
this.isStopped = true;
var os = cloneArray(this.observers), len = os.length;
if (this.hasValue) {
for (i = 0; i < len; i++) {
var o = os[i];
o.onNext(this.value);
o.onCompleted();
}
} else {
for (i = 0; i < len; i++) {
os[i].onCompleted();
}
}
this.observers.length = 0;
}
},
/**
* Notifies all subscribed observers about the error.
* @param {Mixed} error The Error to send to all observers.
*/
onError: function (error) {
checkDisposed(this);
if (!this.isStopped) {
this.isStopped = true;
this.hasError = true;
this.error = error;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onError(error);
}
this.observers.length = 0;
}
},
/**
* Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers.
* @param {Mixed} value The value to store in the subject.
*/
onNext: function (value) {
checkDisposed(this);
if (this.isStopped) { return; }
this.value = value;
this.hasValue = true;
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
this.exception = null;
this.value = null;
}
});
return AsyncSubject;
}(Observable));
var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) {
inherits(AnonymousSubject, __super__);
function subscribe(observer) {
return this.observable.subscribe(observer);
}
function AnonymousSubject(observer, observable) {
this.observer = observer;
this.observable = observable;
__super__.call(this, subscribe);
}
addProperties(AnonymousSubject.prototype, Observer.prototype, {
onCompleted: function () {
this.observer.onCompleted();
},
onError: function (error) {
this.observer.onError(error);
},
onNext: function (value) {
this.observer.onNext(value);
}
});
return AnonymousSubject;
}(Observable));
/**
* Used to pause and resume streams.
*/
Rx.Pauser = (function (__super__) {
inherits(Pauser, __super__);
function Pauser() {
__super__.call(this);
}
/**
* Pauses the underlying sequence.
*/
Pauser.prototype.pause = function () { this.onNext(false); };
/**
* Resumes the underlying sequence.
*/
Pauser.prototype.resume = function () { this.onNext(true); };
return Pauser;
}(Subject));
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
root.Rx = Rx;
define(function() {
return Rx;
});
} else if (freeExports && freeModule) {
// in Node.js or RingoJS
if (moduleExports) {
(freeModule.exports = Rx).Rx = Rx;
} else {
freeExports.Rx = Rx;
}
} else {
// in a browser or Rhino
root.Rx = Rx;
}
// All code before this point will be filtered from stack traces.
var rEndingLine = captureLine();
}.call(this));
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"_process":1}],3:[function(require,module,exports){
'use strict';
var Rx = require('rx');
function makeRequestProxies(drivers) {
var requestProxies = {};
for (var _name in drivers) {
if (drivers.hasOwnProperty(_name)) {
requestProxies[_name] = new Rx.ReplaySubject(1);
}
}
return requestProxies;
}
function callDrivers(drivers, requestProxies) {
var responses = {};
for (var _name2 in drivers) {
if (drivers.hasOwnProperty(_name2)) {
responses[_name2] = drivers[_name2](requestProxies[_name2], _name2);
}
}
return responses;
}
function makeDispose(requestProxies, rawResponses) {
return function dispose() {
for (var x in requestProxies) {
if (requestProxies.hasOwnProperty(x)) {
requestProxies[x].dispose();
}
}
for (var _name3 in rawResponses) {
if (rawResponses.hasOwnProperty(_name3) && typeof rawResponses[_name3].dispose === 'function') {
rawResponses[_name3].dispose();
}
}
};
}
function makeAppInput(requestProxies, rawResponses) {
Object.defineProperty(rawResponses, 'dispose', {
enumerable: false,
value: makeDispose(requestProxies, rawResponses)
});
return rawResponses;
}
function replicateMany(original, imitators) {
for (var _name4 in original) {
if (original.hasOwnProperty(_name4)) {
if (imitators.hasOwnProperty(_name4) && !imitators[_name4].isDisposed) {
original[_name4].subscribe(imitators[_name4].asObserver());
}
}
}
}
function isObjectEmpty(obj) {
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
return false;
}
}
return true;
}
function run(main, drivers) {
if (typeof main !== 'function') {
throw new Error('First argument given to Cycle.run() must be the `main` ' + 'function.');
}
if (typeof drivers !== 'object' || drivers === null) {
throw new Error('Second argument given to Cycle.run() must be an object ' + 'with driver functions as properties.');
}
if (isObjectEmpty(drivers)) {
throw new Error('Second argument given to Cycle.run() must be an object ' + 'with at least one driver function declared as a property.');
}
var requestProxies = makeRequestProxies(drivers);
var rawResponses = callDrivers(drivers, requestProxies);
var responses = makeAppInput(requestProxies, rawResponses);
var requests = main(responses);
setTimeout(function () {
return replicateMany(requests, requestProxies);
}, 1);
return [requests, responses];
}
var Cycle = {
/**
* Takes an `main` function and circularly connects it to the given collection
* of driver functions.
*
* The `main` function expects a collection of "driver response" Observables
* as input, and should return a collection of "driver request" Observables.
* A "collection of Observables" is a JavaScript object where
* keys match the driver names registered by the `drivers` object, and values
* are Observables or a collection of Observables.
*
* @param {Function} main a function that takes `responses` as input
* and outputs a collection of `requests` Observables.
* @param {Object} drivers an object where keys are driver names and values
* are driver functions.
* @return {Array} an array where the first object is the collection of driver
* requests, and the second object is the collection of driver responses, that
* can be used for debugging or testing.
* @function run
*/
run: run,
/**
* A shortcut to the root object of
* [RxJS](https://github.com/Reactive-Extensions/RxJS).
* @name Rx
*/
Rx: Rx
};
module.exports = Cycle;
},{"rx":2}]},{},[3])(3)
}); |
examples/todomvc/index.js | abossard/redux | import 'babel-core/polyfill';
import React from 'react';
import { Provider } from 'react-redux';
import App from './containers/App';
import configureStore from './store/configureStore';
import 'todomvc-app-css/index.css';
const store = configureStore();
React.render(
<Provider store={store}>
{() => <App />}
</Provider>,
document.getElementById('root')
);
|
app/javascript/mastodon/components/__tests__/avatar-test.js | imas/mastodon | import React from 'react';
import renderer from 'react-test-renderer';
import { fromJS } from 'immutable';
import Avatar from '../avatar';
describe('<Avatar />', () => {
const account = fromJS({
username: 'alice',
acct: 'alice',
display_name: 'Alice',
avatar: '/animated/alice.gif',
avatar_static: '/static/alice.jpg',
});
const size = 100;
describe('Autoplay', () => {
it('renders a animated avatar', () => {
const component = renderer.create(<Avatar account={account} animate size={size} />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
});
describe('Still', () => {
it('renders a still avatar', () => {
const component = renderer.create(<Avatar account={account} size={size} />);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
});
// TODO add autoplay test if possible
});
|
app/containers/Root.js | soosgit/vessel | // @flow
import React from 'react';
import { Provider } from 'react-intl-redux';
import { ConnectedRouter } from 'react-router-redux';
import Routes from '../routes';
type RootType = {
store: {},
history: {}
};
export default function Root({ store, history }: RootType) {
return (
<Provider store={store}>
<ConnectedRouter history={history}>
<Routes />
</ConnectedRouter>
</Provider>
);
}
|
node_modules/enzyme/src/version.js | kaizensauce/campari-app | import React from 'react';
export const VERSION = React.version;
export const REACT013 = VERSION.slice(0, 4) === '0.13';
export const REACT014 = VERSION.slice(0, 4) === '0.14';
export const REACT15 = VERSION.slice(0, 3) === '15.';
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.