Skip to content

Instantly share code, notes, and snippets.

@sese
Last active June 27, 2016 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sese/56e7c772173d98195e555edf0d5e67a0 to your computer and use it in GitHub Desktop.
Save sese/56e7c772173d98195e555edf0d5e67a0 to your computer and use it in GitHub Desktop.
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
var AmpersandState = require("ampersand-state");
var Person = AmpersandState.extend({
props: {
firstName: 'string',
lastName: 'string'
},
session: {
signedIn: ['boolean', true, false],
},
derived: {
fullName: {
deps: ['firstName', 'lastName'],
fn: function () {
return this.firstName + ' ' + this.lastName;
}
}
}
});
var pers = new Person({
firstName: "Sergiu",
lastName: "Neamt"
});
console.log(pers.serialize(["attribute"]));
setTimeout(function(){require=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 window!=="undefined"){window.ampersand=window.ampersand||{};window.ampersand["ampersand-events"]=window.ampersand["ampersand-events"]||[];window.ampersand["ampersand-events"].push("2.0.2")}var runOnce=require("lodash/once");var keys=require("lodash/keys");var isEmpty=require("lodash/isEmpty");var assign=require("lodash/assign");var forEach=require("lodash/forEach");var slice=Array.prototype.slice;var utils=require("./libs/utils");var Events={on:function(name,callback,context){if(!utils.eventsApi(this,"on",name,[callback,context])||!callback)return this;this._events||(this._events={});var events=this._events[name]||(this._events[name]=[]);events.push({callback:callback,context:context,ctx:context||this});return this},once:function(name,callback,context){if(!utils.eventsApi(this,"once",name,[callback,context])||!callback)return this;var self=this;var once=runOnce(function(){self.off(name,once);callback.apply(this,arguments)});once._callback=callback;return this.on(name,once,context)},off:function(name,callback,context){var retain,ev,events,names,i,l,j,k;if(!this._events||!utils.eventsApi(this,"off",name,[callback,context]))return this;if(!name&&!callback&&!context){this._events=void 0;return this}names=name?[name]:keys(this._events);for(i=0,l=names.length;i<l;i++){name=names[i];if(events=this._events[name]){this._events[name]=retain=[];if(callback||context){for(j=0,k=events.length;j<k;j++){ev=events[j];if(callback&&callback!==ev.callback&&callback!==ev.callback._callback||context&&context!==ev.context){retain.push(ev)}}}if(!retain.length)delete this._events[name]}}return this},trigger:function(name){if(!this._events)return this;var args=slice.call(arguments,1);if(!utils.eventsApi(this,"trigger",name,args))return this;var events=this._events[name];var allEvents=this._events.all;if(events)utils.triggerEvents(events,args);if(allEvents)utils.triggerEvents(allEvents,arguments);return this},stopListening:function(obj,name,callback){var listeningTo=this._listeningTo;if(!listeningTo)return this;var remove=!name&&!callback;if(!callback&&typeof name==="object")callback=this;if(obj)(listeningTo={})[obj._listenId]=obj;var self=this;forEach(listeningTo,function(item,id){item.off(name,callback,self);if(remove||isEmpty(item._events))delete self._listeningTo[id]});return this},createEmitter:function(obj){return assign(obj||{},Events)},listenTo:utils.createListenMethod("on"),listenToOnce:utils.createListenMethod("once"),listenToAndRun:function(obj,name,callback){this.listenTo.apply(this,arguments);if(!callback&&typeof name==="object")callback=this;callback.apply(this);return this}};Events.bind=Events.on;Events.unbind=Events.off;Events.removeListener=Events.off;Events.removeAllListeners=Events.off;Events.emit=Events.trigger;module.exports=Events},{"./libs/utils":2,"lodash/assign":148,"lodash/forEach":153,"lodash/isEmpty":166,"lodash/keys":175,"lodash/once":181}],2:[function(require,module,exports){var uniqueId=require("lodash/uniqueId");var eventSplitter=/\s+/;exports.triggerEvents=function triggerEvents(events,args){var ev;var i=-1;var l=events.length;var a1=args[0];var a2=args[1];var a3=args[2];switch(args.length){case 0:while(++i<l)(ev=events[i]).callback.call(ev.ctx);return;case 1:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1);return;case 2:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1,a2);return;case 3:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1,a2,a3);return;default:while(++i<l)(ev=events[i]).callback.apply(ev.ctx,args);return}};exports.eventsApi=function eventsApi(obj,action,name,rest){if(!name)return true;if(typeof name==="object"){for(var key in name){obj[action].apply(obj,[key,name[key]].concat(rest))}return false}if(eventSplitter.test(name)){var names=name.split(eventSplitter);for(var i=0,l=names.length;i<l;i++){obj[action].apply(obj,[names[i]].concat(rest))}return false}return true};exports.createListenMethod=function createListenMethod(implementation){return function listenMethod(obj,name,callback){if(!obj){throw new Error("Trying to listenTo event: '"+name+"' but the target object is undefined")}var listeningTo=this._listeningTo||(this._listeningTo={});var id=obj._listenId||(obj._listenId=uniqueId("l"));listeningTo[id]=obj;if(!callback&&typeof name==="object")callback=this;if(typeof obj[implementation]!=="function"){throw new Error("Trying to listenTo event: '"+name+"' on object: "+obj.toString()+" but it does not have an 'on' method so is unbindable")}obj[implementation](name,callback,this);return this}}},{"lodash/uniqueId":192}],3:[function(require,module,exports){module.exports=function arrayNext(array,currentItem){var len=array.length;var newIndex=array.indexOf(currentItem)+1;if(newIndex>len-1)newIndex=0;return array[newIndex]}},{}],4:[function(require,module,exports){var slice=Array.prototype.slice;function KeyTreeStore(options){options=options||{};if(typeof options!=="object"){throw new TypeError("Options must be an object")}var DEFAULT_SEPARATOR=".";this.storage={};this.separator=options.separator||DEFAULT_SEPARATOR}KeyTreeStore.prototype.add=function(keypath,obj){var arr=this.storage[keypath]||(this.storage[keypath]=[]);arr.push(obj)};KeyTreeStore.prototype.remove=function(obj){var path,arr;for(path in this.storage){arr=this.storage[path];arr.some(function(item,index){if(item===obj){arr.splice(index,1);return true}})}};KeyTreeStore.prototype.get=function(keypath){var res=[];var key;for(key in this.storage){if(!keypath||keypath===key||key.indexOf(keypath+this.separator)===0){res=res.concat(this.storage[key])}}return res};KeyTreeStore.prototype.getGrouped=function(keypath){var res={};var key;for(key in this.storage){if(!keypath||keypath===key||key.indexOf(keypath+this.separator)===0){res[key]=slice.call(this.storage[key])}}return res};KeyTreeStore.prototype.getAll=function(keypath){var res={};var key;for(key in this.storage){if(keypath===key||key.indexOf(keypath+this.separator)===0){res[key]=slice.call(this.storage[key])}}return res};KeyTreeStore.prototype.run=function(keypath,context){var args=slice.call(arguments,2);this.get(keypath).forEach(function(fn){fn.apply(context||this,args)})};module.exports=KeyTreeStore},{}],5:[function(require,module,exports){var getNative=require("./_getNative"),root=require("./_root");var DataView=getNative(root,"DataView");module.exports=DataView},{"./_getNative":91,"./_root":134}],6:[function(require,module,exports){var hashClear=require("./_hashClear"),hashDelete=require("./_hashDelete"),hashGet=require("./_hashGet"),hashHas=require("./_hashHas"),hashSet=require("./_hashSet");function Hash(entries){var index=-1,length=entries?entries.length:0;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1])}}Hash.prototype.clear=hashClear;Hash.prototype["delete"]=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;module.exports=Hash},{"./_hashClear":98,"./_hashDelete":99,"./_hashGet":100,"./_hashHas":101,"./_hashSet":102}],7:[function(require,module,exports){var baseCreate=require("./_baseCreate"),baseLodash=require("./_baseLodash");var MAX_ARRAY_LENGTH=4294967295;function LazyWrapper(value){this.__wrapped__=value;this.__actions__=[];this.__dir__=1;this.__filtered__=false;this.__iteratees__=[];this.__takeCount__=MAX_ARRAY_LENGTH;this.__views__=[]}LazyWrapper.prototype=baseCreate(baseLodash.prototype);LazyWrapper.prototype.constructor=LazyWrapper;module.exports=LazyWrapper},{"./_baseCreate":30,"./_baseLodash":48}],8:[function(require,module,exports){var listCacheClear=require("./_listCacheClear"),listCacheDelete=require("./_listCacheDelete"),listCacheGet=require("./_listCacheGet"),listCacheHas=require("./_listCacheHas"),listCacheSet=require("./_listCacheSet");function ListCache(entries){var index=-1,length=entries?entries.length:0;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1])}}ListCache.prototype.clear=listCacheClear;ListCache.prototype["delete"]=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;module.exports=ListCache},{"./_listCacheClear":116,"./_listCacheDelete":117,"./_listCacheGet":118,"./_listCacheHas":119,"./_listCacheSet":120}],9:[function(require,module,exports){var baseCreate=require("./_baseCreate"),baseLodash=require("./_baseLodash");function LodashWrapper(value,chainAll){this.__wrapped__=value;this.__actions__=[];this.__chain__=!!chainAll;this.__index__=0;this.__values__=undefined}LodashWrapper.prototype=baseCreate(baseLodash.prototype);LodashWrapper.prototype.constructor=LodashWrapper;module.exports=LodashWrapper},{"./_baseCreate":30,"./_baseLodash":48}],10:[function(require,module,exports){var getNative=require("./_getNative"),root=require("./_root");var Map=getNative(root,"Map");module.exports=Map},{"./_getNative":91,"./_root":134}],11:[function(require,module,exports){var mapCacheClear=require("./_mapCacheClear"),mapCacheDelete=require("./_mapCacheDelete"),mapCacheGet=require("./_mapCacheGet"),mapCacheHas=require("./_mapCacheHas"),mapCacheSet=require("./_mapCacheSet");function MapCache(entries){var index=-1,length=entries?entries.length:0;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1])}}MapCache.prototype.clear=mapCacheClear;MapCache.prototype["delete"]=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;module.exports=MapCache},{"./_mapCacheClear":121,"./_mapCacheDelete":122,"./_mapCacheGet":123,"./_mapCacheHas":124,"./_mapCacheSet":125}],12:[function(require,module,exports){var getNative=require("./_getNative"),root=require("./_root");var Promise=getNative(root,"Promise");module.exports=Promise},{"./_getNative":91,"./_root":134}],13:[function(require,module,exports){var root=require("./_root");var Reflect=root.Reflect;module.exports=Reflect},{"./_root":134}],14:[function(require,module,exports){var getNative=require("./_getNative"),root=require("./_root");var Set=getNative(root,"Set");module.exports=Set},{"./_getNative":91,"./_root":134}],15:[function(require,module,exports){var MapCache=require("./_MapCache"),setCacheAdd=require("./_setCacheAdd"),setCacheHas=require("./_setCacheHas");function SetCache(values){var index=-1,length=values?values.length:0;this.__data__=new MapCache;while(++index<length){this.add(values[index])}}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd;SetCache.prototype.has=setCacheHas;module.exports=SetCache},{"./_MapCache":11,"./_setCacheAdd":135,"./_setCacheHas":136}],16:[function(require,module,exports){var ListCache=require("./_ListCache"),stackClear=require("./_stackClear"),stackDelete=require("./_stackDelete"),stackGet=require("./_stackGet"),stackHas=require("./_stackHas"),stackSet=require("./_stackSet");function Stack(entries){this.__data__=new ListCache(entries)}Stack.prototype.clear=stackClear;Stack.prototype["delete"]=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;module.exports=Stack},{"./_ListCache":8,"./_stackClear":139,"./_stackDelete":140,"./_stackGet":141,"./_stackHas":142,"./_stackSet":143}],17:[function(require,module,exports){var root=require("./_root");var Symbol=root.Symbol;module.exports=Symbol},{"./_root":134}],18:[function(require,module,exports){var root=require("./_root");var Uint8Array=root.Uint8Array;module.exports=Uint8Array},{"./_root":134}],19:[function(require,module,exports){var getNative=require("./_getNative"),root=require("./_root");var WeakMap=getNative(root,"WeakMap");module.exports=WeakMap},{"./_getNative":91,"./_root":134}],20:[function(require,module,exports){function apply(func,thisArg,args){var length=args.length;switch(length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}module.exports=apply},{}],21:[function(require,module,exports){function arrayEach(array,iteratee){var index=-1,length=array?array.length:0;while(++index<length){if(iteratee(array[index],index,array)===false){break}}return array}module.exports=arrayEach},{}],22:[function(require,module,exports){var baseIndexOf=require("./_baseIndexOf");function arrayIncludes(array,value){var length=array?array.length:0;return!!length&&baseIndexOf(array,value,0)>-1}module.exports=arrayIncludes},{"./_baseIndexOf":40}],23:[function(require,module,exports){function arrayIncludesWith(array,value,comparator){var index=-1,length=array?array.length:0;while(++index<length){if(comparator(value,array[index])){return true}}return false}module.exports=arrayIncludesWith},{}],24:[function(require,module,exports){function arrayMap(array,iteratee){var index=-1,length=array?array.length:0,result=Array(length);while(++index<length){result[index]=iteratee(array[index],index,array)}return result}module.exports=arrayMap},{}],25:[function(require,module,exports){function arrayPush(array,values){var index=-1,length=values.length,offset=array.length;while(++index<length){array[offset+index]=values[index]}return array}module.exports=arrayPush},{}],26:[function(require,module,exports){function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=array?array.length:0;if(initAccum&&length){accumulator=array[++index]}while(++index<length){accumulator=iteratee(accumulator,array[index],index,array)}return accumulator}module.exports=arrayReduce},{}],27:[function(require,module,exports){function arraySome(array,predicate){var index=-1,length=array?array.length:0;while(++index<length){if(predicate(array[index],index,array)){return true}}return false}module.exports=arraySome},{}],28:[function(require,module,exports){var eq=require("./eq");var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;function assignValue(object,key,value){var objValue=object[key];if(!(hasOwnProperty.call(object,key)&&eq(objValue,value))||value===undefined&&!(key in object)){object[key]=value}}module.exports=assignValue},{"./eq":151}],29:[function(require,module,exports){var eq=require("./eq");function assocIndexOf(array,key){var length=array.length;while(length--){if(eq(array[length][0],key)){return length}}return-1}module.exports=assocIndexOf},{"./eq":151}],30:[function(require,module,exports){var isObject=require("./isObject");var objectCreate=Object.create;function baseCreate(proto){return isObject(proto)?objectCreate(proto):{}}module.exports=baseCreate},{"./isObject":170}],31:[function(require,module,exports){var SetCache=require("./_SetCache"),arrayIncludes=require("./_arrayIncludes"),arrayIncludesWith=require("./_arrayIncludesWith"),arrayMap=require("./_arrayMap"),baseUnary=require("./_baseUnary"),cacheHas=require("./_cacheHas");var LARGE_ARRAY_SIZE=200;function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=true,length=array.length,result=[],valuesLength=values.length;if(!length){return result}if(iteratee){values=arrayMap(values,baseUnary(iteratee))}if(comparator){includes=arrayIncludesWith;isCommon=false}else if(values.length>=LARGE_ARRAY_SIZE){includes=cacheHas;isCommon=false;values=new SetCache(values)}outer:while(++index<length){var value=array[index],computed=iteratee?iteratee(value):value;value=comparator||value!==0?value:0;if(isCommon&&computed===computed){var valuesIndex=valuesLength;while(valuesIndex--){if(values[valuesIndex]===computed){continue outer}}result.push(value)}else if(!includes(values,computed,comparator)){result.push(value)}}return result}module.exports=baseDifference},{"./_SetCache":15,"./_arrayIncludes":22,"./_arrayIncludesWith":23,"./_arrayMap":24,"./_baseUnary":57,"./_cacheHas":60}],32:[function(require,module,exports){var baseForOwn=require("./_baseForOwn"),createBaseEach=require("./_createBaseEach");var baseEach=createBaseEach(baseForOwn);module.exports=baseEach},{"./_baseForOwn":35,"./_createBaseEach":70}],33:[function(require,module,exports){var arrayPush=require("./_arrayPush"),isFlattenable=require("./_isFlattenable");function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;predicate||(predicate=isFlattenable);result||(result=[]);while(++index<length){var value=array[index];if(depth>0&&predicate(value)){if(depth>1){baseFlatten(value,depth-1,predicate,isStrict,result)}else{arrayPush(result,value)}}else if(!isStrict){result[result.length]=value}}return result}module.exports=baseFlatten},{"./_arrayPush":25,"./_isFlattenable":105}],34:[function(require,module,exports){var createBaseFor=require("./_createBaseFor");var baseFor=createBaseFor();module.exports=baseFor},{"./_createBaseFor":71}],35:[function(require,module,exports){var baseFor=require("./_baseFor"),keys=require("./keys");function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}module.exports=baseForOwn},{"./_baseFor":34,"./keys":175}],36:[function(require,module,exports){var castPath=require("./_castPath"),isKey=require("./_isKey"),toKey=require("./_toKey");function baseGet(object,path){path=isKey(path,object)?[path]:castPath(path);var index=0,length=path.length;while(object!=null&&index<length){object=object[toKey(path[index++])]}return index&&index==length?object:undefined}module.exports=baseGet},{"./_castPath":61,"./_isKey":109,"./_toKey":145}],37:[function(require,module,exports){var arrayPush=require("./_arrayPush"),isArray=require("./isArray");function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}module.exports=baseGetAllKeys},{"./_arrayPush":25,"./isArray":161}],38:[function(require,module,exports){var getPrototype=require("./_getPrototype");var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;function baseHas(object,key){return object!=null&&(hasOwnProperty.call(object,key)||typeof object=="object"&&key in object&&getPrototype(object)===null)}module.exports=baseHas},{"./_getPrototype":92}],39:[function(require,module,exports){function baseHasIn(object,key){return object!=null&&key in Object(object)}module.exports=baseHasIn},{}],40:[function(require,module,exports){var indexOfNaN=require("./_indexOfNaN");function baseIndexOf(array,value,fromIndex){if(value!==value){return indexOfNaN(array,fromIndex)}var index=fromIndex-1,length=array.length;while(++index<length){if(array[index]===value){return index}}return-1}module.exports=baseIndexOf},{"./_indexOfNaN":104}],41:[function(require,module,exports){var baseIsEqualDeep=require("./_baseIsEqualDeep"),isObject=require("./isObject"),isObjectLike=require("./isObjectLike");function baseIsEqual(value,other,customizer,bitmask,stack){if(value===other){return true}if(value==null||other==null||!isObject(value)&&!isObjectLike(other)){return value!==value&&other!==other}return baseIsEqualDeep(value,other,baseIsEqual,customizer,bitmask,stack)}module.exports=baseIsEqual},{"./_baseIsEqualDeep":42,"./isObject":170,"./isObjectLike":171}],42:[function(require,module,exports){var Stack=require("./_Stack"),equalArrays=require("./_equalArrays"),equalByTag=require("./_equalByTag"),equalObjects=require("./_equalObjects"),getTag=require("./_getTag"),isArray=require("./isArray"),isHostObject=require("./_isHostObject"),isTypedArray=require("./isTypedArray");var PARTIAL_COMPARE_FLAG=2;var argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]";var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;function baseIsEqualDeep(object,other,equalFunc,customizer,bitmask,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=arrayTag,othTag=arrayTag;if(!objIsArr){objTag=getTag(object);objTag=objTag==argsTag?objectTag:objTag}if(!othIsArr){othTag=getTag(other);othTag=othTag==argsTag?objectTag:othTag}var objIsObj=objTag==objectTag&&!isHostObject(object),othIsObj=othTag==objectTag&&!isHostObject(other),isSameTag=objTag==othTag;if(isSameTag&&!objIsObj){stack||(stack=new Stack);return objIsArr||isTypedArray(object)?equalArrays(object,other,equalFunc,customizer,bitmask,stack):equalByTag(object,other,objTag,equalFunc,customizer,bitmask,stack)}if(!(bitmask&PARTIAL_COMPARE_FLAG)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;stack||(stack=new Stack);return equalFunc(objUnwrapped,othUnwrapped,customizer,bitmask,stack)}}if(!isSameTag){return false}stack||(stack=new Stack);return equalObjects(object,other,equalFunc,customizer,bitmask,stack)}module.exports=baseIsEqualDeep},{"./_Stack":16,"./_equalArrays":80,"./_equalByTag":81,"./_equalObjects":82,"./_getTag":95,"./_isHostObject":106,"./isArray":161,"./isTypedArray":174}],43:[function(require,module,exports){var Stack=require("./_Stack"),baseIsEqual=require("./_baseIsEqual");var UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2;function baseIsMatch(object,source,matchData,customizer){var index=matchData.length,length=index,noCustomizer=!customizer;if(object==null){return!length}object=Object(object);while(index--){var data=matchData[index];if(noCustomizer&&data[2]?data[1]!==object[data[0]]:!(data[0]in object)){return false}}while(++index<length){data=matchData[index];var key=data[0],objValue=object[key],srcValue=data[1];if(noCustomizer&&data[2]){if(objValue===undefined&&!(key in object)){return false}}else{var stack=new Stack;if(customizer){var result=customizer(objValue,srcValue,key,object,source,stack)}if(!(result===undefined?baseIsEqual(srcValue,objValue,customizer,UNORDERED_COMPARE_FLAG|PARTIAL_COMPARE_FLAG,stack):result)){return false}}}return true}module.exports=baseIsMatch},{"./_Stack":16,"./_baseIsEqual":41}],44:[function(require,module,exports){var isFunction=require("./isFunction"),isHostObject=require("./_isHostObject"),isMasked=require("./_isMasked"),isObject=require("./isObject"),toSource=require("./_toSource");var reRegExpChar=/[\\^$.*+?()[\]{}|]/g;var reIsHostCtor=/^\[object .+?Constructor\]$/;var objectProto=Object.prototype;var funcToString=Function.prototype.toString;var hasOwnProperty=objectProto.hasOwnProperty;var reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(value){if(!isObject(value)||isMasked(value)){return false}var pattern=isFunction(value)||isHostObject(value)?reIsNative:reIsHostCtor;return pattern.test(toSource(value))}module.exports=baseIsNative},{"./_isHostObject":106,"./_isMasked":112,"./_toSource":146,"./isFunction":168,"./isObject":170}],45:[function(require,module,exports){var baseMatches=require("./_baseMatches"),baseMatchesProperty=require("./_baseMatchesProperty"),identity=require("./identity"),isArray=require("./isArray"),property=require("./property");function baseIteratee(value){if(typeof value=="function"){return value}if(value==null){return identity}if(typeof value=="object"){return isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value)}return property(value)}module.exports=baseIteratee},{"./_baseMatches":49,"./_baseMatchesProperty":50,"./identity":158,"./isArray":161,"./property":182}],46:[function(require,module,exports){var nativeKeys=Object.keys;function baseKeys(object){return nativeKeys(Object(object))}module.exports=baseKeys},{}],47:[function(require,module,exports){var Reflect=require("./_Reflect"),iteratorToArray=require("./_iteratorToArray");var objectProto=Object.prototype;var enumerate=Reflect?Reflect.enumerate:undefined,propertyIsEnumerable=objectProto.propertyIsEnumerable;function baseKeysIn(object){object=object==null?object:Object(object);var result=[];for(var key in object){result.push(key)}return result}if(enumerate&&!propertyIsEnumerable.call({valueOf:1},"valueOf")){baseKeysIn=function(object){return iteratorToArray(enumerate(object))}}module.exports=baseKeysIn},{"./_Reflect":13,"./_iteratorToArray":115}],48:[function(require,module,exports){function baseLodash(){}module.exports=baseLodash},{}],49:[function(require,module,exports){var baseIsMatch=require("./_baseIsMatch"),getMatchData=require("./_getMatchData"),matchesStrictComparable=require("./_matchesStrictComparable");function baseMatches(source){var matchData=getMatchData(source);if(matchData.length==1&&matchData[0][2]){return matchesStrictComparable(matchData[0][0],matchData[0][1])}return function(object){return object===source||baseIsMatch(object,source,matchData)}}module.exports=baseMatches},{"./_baseIsMatch":43,"./_getMatchData":90,"./_matchesStrictComparable":127}],50:[function(require,module,exports){var baseIsEqual=require("./_baseIsEqual"),get=require("./get"),hasIn=require("./hasIn"),isKey=require("./_isKey"),isStrictComparable=require("./_isStrictComparable"),matchesStrictComparable=require("./_matchesStrictComparable"),toKey=require("./_toKey");var UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2;function baseMatchesProperty(path,srcValue){if(isKey(path)&&isStrictComparable(srcValue)){return matchesStrictComparable(toKey(path),srcValue)}return function(object){var objValue=get(object,path);return objValue===undefined&&objValue===srcValue?hasIn(object,path):baseIsEqual(srcValue,objValue,undefined,UNORDERED_COMPARE_FLAG|PARTIAL_COMPARE_FLAG)}}module.exports=baseMatchesProperty},{"./_baseIsEqual":41,"./_isKey":109,"./_isStrictComparable":114,"./_matchesStrictComparable":127,"./_toKey":145,"./get":155,"./hasIn":157}],51:[function(require,module,exports){var arrayReduce=require("./_arrayReduce");function basePick(object,props){object=Object(object);return arrayReduce(props,function(result,key){if(key in object){result[key]=object[key]}return result},{})}module.exports=basePick},{"./_arrayReduce":26}],52:[function(require,module,exports){function baseProperty(key){return function(object){return object==null?undefined:object[key]}}module.exports=baseProperty},{}],53:[function(require,module,exports){var baseGet=require("./_baseGet");function basePropertyDeep(path){return function(object){return baseGet(object,path)}}module.exports=basePropertyDeep},{"./_baseGet":36}],54:[function(require,module,exports){var identity=require("./identity"),metaMap=require("./_metaMap");var baseSetData=!metaMap?identity:function(func,data){metaMap.set(func,data);return func};module.exports=baseSetData},{"./_metaMap":129,"./identity":158}],55:[function(require,module,exports){function baseTimes(n,iteratee){var index=-1,result=Array(n);while(++index<n){result[index]=iteratee(index)}return result}module.exports=baseTimes},{}],56:[function(require,module,exports){var Symbol=require("./_Symbol"),isSymbol=require("./isSymbol");var INFINITY=1/0;var symbolProto=Symbol?Symbol.prototype:undefined,symbolToString=symbolProto?symbolProto.toString:undefined;function baseToString(value){if(typeof value=="string"){return value}if(isSymbol(value)){return symbolToString?symbolToString.call(value):""}var result=value+"";return result=="0"&&1/value==-INFINITY?"-0":result}module.exports=baseToString},{"./_Symbol":17,"./isSymbol":173}],57:[function(require,module,exports){function baseUnary(func){return function(value){return func(value)}}module.exports=baseUnary},{}],58:[function(require,module,exports){var SetCache=require("./_SetCache"),arrayIncludes=require("./_arrayIncludes"),arrayIncludesWith=require("./_arrayIncludesWith"),cacheHas=require("./_cacheHas"),createSet=require("./_createSet"),setToArray=require("./_setToArray");var LARGE_ARRAY_SIZE=200;function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=true,result=[],seen=result;if(comparator){isCommon=false;includes=arrayIncludesWith}else if(length>=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set){return setToArray(set)}isCommon=false;includes=cacheHas;seen=new SetCache}else{seen=iteratee?[]:result}outer:while(++index<length){var value=array[index],computed=iteratee?iteratee(value):value;value=comparator||value!==0?value:0;if(isCommon&&computed===computed){var seenIndex=seen.length;while(seenIndex--){if(seen[seenIndex]===computed){continue outer}}if(iteratee){seen.push(computed)}result.push(value)}else if(!includes(seen,computed,comparator)){if(seen!==result){seen.push(computed)}result.push(value)}}return result}module.exports=baseUniq},{"./_SetCache":15,"./_arrayIncludes":22,"./_arrayIncludesWith":23,"./_cacheHas":60,"./_createSet":78,"./_setToArray":138}],59:[function(require,module,exports){var arrayMap=require("./_arrayMap");function baseValues(object,props){return arrayMap(props,function(key){return object[key]})}module.exports=baseValues},{"./_arrayMap":24}],60:[function(require,module,exports){function cacheHas(cache,key){return cache.has(key)}module.exports=cacheHas},{}],61:[function(require,module,exports){var isArray=require("./isArray"),stringToPath=require("./_stringToPath");function castPath(value){return isArray(value)?value:stringToPath(value)}module.exports=castPath},{"./_stringToPath":144,"./isArray":161}],62:[function(require,module,exports){function checkGlobal(value){return value&&value.Object===Object?value:null}module.exports=checkGlobal},{}],63:[function(require,module,exports){var nativeMax=Math.max;function composeArgs(args,partials,holders,isCurried){var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;while(++leftIndex<leftLength){result[leftIndex]=partials[leftIndex]}while(++argsIndex<holdersLength){if(isUncurried||argsIndex<argsLength){result[holders[argsIndex]]=args[argsIndex]}}while(rangeLength--){result[leftIndex++]=args[argsIndex++]}return result}module.exports=composeArgs},{}],64:[function(require,module,exports){var nativeMax=Math.max;function composeArgsRight(args,partials,holders,isCurried){var argsIndex=-1,argsLength=args.length,holdersIndex=-1,holdersLength=holders.length,rightIndex=-1,rightLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(rangeLength+rightLength),isUncurried=!isCurried;while(++argsIndex<rangeLength){result[argsIndex]=args[argsIndex]}var offset=argsIndex;while(++rightIndex<rightLength){result[offset+rightIndex]=partials[rightIndex]}while(++holdersIndex<holdersLength){if(isUncurried||argsIndex<argsLength){result[offset+holders[holdersIndex]]=args[argsIndex++]}}return result}module.exports=composeArgsRight},{}],65:[function(require,module,exports){function copyArray(source,array){var index=-1,length=source.length;array||(array=Array(length));while(++index<length){array[index]=source[index]}return array}module.exports=copyArray},{}],66:[function(require,module,exports){var assignValue=require("./_assignValue");function copyObject(source,props,object,customizer){object||(object={});var index=-1,length=props.length;while(++index<length){var key=props[index];var newValue=customizer?customizer(object[key],source[key],key,object,source):source[key];assignValue(object,key,newValue)}return object}module.exports=copyObject},{"./_assignValue":28}],67:[function(require,module,exports){var root=require("./_root");var coreJsData=root["__core-js_shared__"];module.exports=coreJsData},{"./_root":134}],68:[function(require,module,exports){function countHolders(array,placeholder){
var length=array.length,result=0;while(length--){if(array[length]===placeholder){result++}}return result}module.exports=countHolders},{}],69:[function(require,module,exports){var isIterateeCall=require("./_isIterateeCall"),rest=require("./rest");function createAssigner(assigner){return rest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;customizer=assigner.length>3&&typeof customizer=="function"?(length--,customizer):undefined;if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined:customizer;length=1}object=Object(object);while(++index<length){var source=sources[index];if(source){assigner(object,source,index,customizer)}}return object})}module.exports=createAssigner},{"./_isIterateeCall":108,"./rest":183}],70:[function(require,module,exports){var isArrayLike=require("./isArrayLike");function createBaseEach(eachFunc,fromRight){return function(collection,iteratee){if(collection==null){return collection}if(!isArrayLike(collection)){return eachFunc(collection,iteratee)}var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);while(fromRight?index--:++index<length){if(iteratee(iterable[index],index,iterable)===false){break}}return collection}}module.exports=createBaseEach},{"./isArrayLike":162}],71:[function(require,module,exports){function createBaseFor(fromRight){return function(object,iteratee,keysFunc){var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;while(length--){var key=props[fromRight?length:++index];if(iteratee(iterable[key],key,iterable)===false){break}}return object}}module.exports=createBaseFor},{}],72:[function(require,module,exports){var createCtorWrapper=require("./_createCtorWrapper"),root=require("./_root");var BIND_FLAG=1;function createBaseWrapper(func,bitmask,thisArg){var isBind=bitmask&BIND_FLAG,Ctor=createCtorWrapper(func);function wrapper(){var fn=this&&this!==root&&this instanceof wrapper?Ctor:func;return fn.apply(isBind?thisArg:this,arguments)}return wrapper}module.exports=createBaseWrapper},{"./_createCtorWrapper":73,"./_root":134}],73:[function(require,module,exports){var baseCreate=require("./_baseCreate"),isObject=require("./isObject");function createCtorWrapper(Ctor){return function(){var args=arguments;switch(args.length){case 0:return new Ctor;case 1:return new Ctor(args[0]);case 2:return new Ctor(args[0],args[1]);case 3:return new Ctor(args[0],args[1],args[2]);case 4:return new Ctor(args[0],args[1],args[2],args[3]);case 5:return new Ctor(args[0],args[1],args[2],args[3],args[4]);case 6:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5]);case 7:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5],args[6])}var thisBinding=baseCreate(Ctor.prototype),result=Ctor.apply(thisBinding,args);return isObject(result)?result:thisBinding}}module.exports=createCtorWrapper},{"./_baseCreate":30,"./isObject":170}],74:[function(require,module,exports){var apply=require("./_apply"),createCtorWrapper=require("./_createCtorWrapper"),createHybridWrapper=require("./_createHybridWrapper"),createRecurryWrapper=require("./_createRecurryWrapper"),getHolder=require("./_getHolder"),replaceHolders=require("./_replaceHolders"),root=require("./_root");function createCurryWrapper(func,bitmask,arity){var Ctor=createCtorWrapper(func);function wrapper(){var length=arguments.length,args=Array(length),index=length,placeholder=getHolder(wrapper);while(index--){args[index]=arguments[index]}var holders=length<3&&args[0]!==placeholder&&args[length-1]!==placeholder?[]:replaceHolders(args,placeholder);length-=holders.length;if(length<arity){return createRecurryWrapper(func,bitmask,createHybridWrapper,wrapper.placeholder,undefined,args,holders,undefined,undefined,arity-length)}var fn=this&&this!==root&&this instanceof wrapper?Ctor:func;return apply(fn,this,args)}return wrapper}module.exports=createCurryWrapper},{"./_apply":20,"./_createCtorWrapper":73,"./_createHybridWrapper":75,"./_createRecurryWrapper":77,"./_getHolder":87,"./_replaceHolders":133,"./_root":134}],75:[function(require,module,exports){var composeArgs=require("./_composeArgs"),composeArgsRight=require("./_composeArgsRight"),countHolders=require("./_countHolders"),createCtorWrapper=require("./_createCtorWrapper"),createRecurryWrapper=require("./_createRecurryWrapper"),getHolder=require("./_getHolder"),reorder=require("./_reorder"),replaceHolders=require("./_replaceHolders"),root=require("./_root");var BIND_FLAG=1,BIND_KEY_FLAG=2,CURRY_FLAG=8,CURRY_RIGHT_FLAG=16,ARY_FLAG=128,FLIP_FLAG=512;function createHybridWrapper(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){var isAry=bitmask&ARY_FLAG,isBind=bitmask&BIND_FLAG,isBindKey=bitmask&BIND_KEY_FLAG,isCurried=bitmask&(CURRY_FLAG|CURRY_RIGHT_FLAG),isFlip=bitmask&FLIP_FLAG,Ctor=isBindKey?undefined:createCtorWrapper(func);function wrapper(){var length=arguments.length,args=Array(length),index=length;while(index--){args[index]=arguments[index]}if(isCurried){var placeholder=getHolder(wrapper),holdersCount=countHolders(args,placeholder)}if(partials){args=composeArgs(args,partials,holders,isCurried)}if(partialsRight){args=composeArgsRight(args,partialsRight,holdersRight,isCurried)}length-=holdersCount;if(isCurried&&length<arity){var newHolders=replaceHolders(args,placeholder);return createRecurryWrapper(func,bitmask,createHybridWrapper,wrapper.placeholder,thisArg,args,newHolders,argPos,ary,arity-length)}var thisBinding=isBind?thisArg:this,fn=isBindKey?thisBinding[func]:func;length=args.length;if(argPos){args=reorder(args,argPos)}else if(isFlip&&length>1){args.reverse()}if(isAry&&ary<length){args.length=ary}if(this&&this!==root&&this instanceof wrapper){fn=Ctor||createCtorWrapper(fn)}return fn.apply(thisBinding,args)}return wrapper}module.exports=createHybridWrapper},{"./_composeArgs":63,"./_composeArgsRight":64,"./_countHolders":68,"./_createCtorWrapper":73,"./_createRecurryWrapper":77,"./_getHolder":87,"./_reorder":132,"./_replaceHolders":133,"./_root":134}],76:[function(require,module,exports){var apply=require("./_apply"),createCtorWrapper=require("./_createCtorWrapper"),root=require("./_root");var BIND_FLAG=1;function createPartialWrapper(func,bitmask,thisArg,partials){var isBind=bitmask&BIND_FLAG,Ctor=createCtorWrapper(func);function wrapper(){var argsIndex=-1,argsLength=arguments.length,leftIndex=-1,leftLength=partials.length,args=Array(leftLength+argsLength),fn=this&&this!==root&&this instanceof wrapper?Ctor:func;while(++leftIndex<leftLength){args[leftIndex]=partials[leftIndex]}while(argsLength--){args[leftIndex++]=arguments[++argsIndex]}return apply(fn,isBind?thisArg:this,args)}return wrapper}module.exports=createPartialWrapper},{"./_apply":20,"./_createCtorWrapper":73,"./_root":134}],77:[function(require,module,exports){var isLaziable=require("./_isLaziable"),setData=require("./_setData");var BIND_FLAG=1,BIND_KEY_FLAG=2,CURRY_BOUND_FLAG=4,CURRY_FLAG=8,PARTIAL_FLAG=32,PARTIAL_RIGHT_FLAG=64;function createRecurryWrapper(func,bitmask,wrapFunc,placeholder,thisArg,partials,holders,argPos,ary,arity){var isCurry=bitmask&CURRY_FLAG,newHolders=isCurry?holders:undefined,newHoldersRight=isCurry?undefined:holders,newPartials=isCurry?partials:undefined,newPartialsRight=isCurry?undefined:partials;bitmask|=isCurry?PARTIAL_FLAG:PARTIAL_RIGHT_FLAG;bitmask&=~(isCurry?PARTIAL_RIGHT_FLAG:PARTIAL_FLAG);if(!(bitmask&CURRY_BOUND_FLAG)){bitmask&=~(BIND_FLAG|BIND_KEY_FLAG)}var newData=[func,bitmask,thisArg,newPartials,newHolders,newPartialsRight,newHoldersRight,argPos,ary,arity];var result=wrapFunc.apply(undefined,newData);if(isLaziable(func)){setData(result,newData)}result.placeholder=placeholder;return result}module.exports=createRecurryWrapper},{"./_isLaziable":111,"./_setData":137}],78:[function(require,module,exports){var Set=require("./_Set"),noop=require("./noop"),setToArray=require("./_setToArray");var INFINITY=1/0;var createSet=!(Set&&1/setToArray(new Set([,-0]))[1]==INFINITY)?noop:function(values){return new Set(values)};module.exports=createSet},{"./_Set":14,"./_setToArray":138,"./noop":178}],79:[function(require,module,exports){var baseSetData=require("./_baseSetData"),createBaseWrapper=require("./_createBaseWrapper"),createCurryWrapper=require("./_createCurryWrapper"),createHybridWrapper=require("./_createHybridWrapper"),createPartialWrapper=require("./_createPartialWrapper"),getData=require("./_getData"),mergeData=require("./_mergeData"),setData=require("./_setData"),toInteger=require("./toInteger");var FUNC_ERROR_TEXT="Expected a function";var BIND_FLAG=1,BIND_KEY_FLAG=2,CURRY_FLAG=8,CURRY_RIGHT_FLAG=16,PARTIAL_FLAG=32,PARTIAL_RIGHT_FLAG=64;var nativeMax=Math.max;function createWrapper(func,bitmask,thisArg,partials,holders,argPos,ary,arity){var isBindKey=bitmask&BIND_KEY_FLAG;if(!isBindKey&&typeof func!="function"){throw new TypeError(FUNC_ERROR_TEXT)}var length=partials?partials.length:0;if(!length){bitmask&=~(PARTIAL_FLAG|PARTIAL_RIGHT_FLAG);partials=holders=undefined}ary=ary===undefined?ary:nativeMax(toInteger(ary),0);arity=arity===undefined?arity:toInteger(arity);length-=holders?holders.length:0;if(bitmask&PARTIAL_RIGHT_FLAG){var partialsRight=partials,holdersRight=holders;partials=holders=undefined}var data=isBindKey?undefined:getData(func);var newData=[func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity];if(data){mergeData(newData,data)}func=newData[0];bitmask=newData[1];thisArg=newData[2];partials=newData[3];holders=newData[4];arity=newData[9]=newData[9]==null?isBindKey?0:func.length:nativeMax(newData[9]-length,0);if(!arity&&bitmask&(CURRY_FLAG|CURRY_RIGHT_FLAG)){bitmask&=~(CURRY_FLAG|CURRY_RIGHT_FLAG)}if(!bitmask||bitmask==BIND_FLAG){var result=createBaseWrapper(func,bitmask,thisArg)}else if(bitmask==CURRY_FLAG||bitmask==CURRY_RIGHT_FLAG){result=createCurryWrapper(func,bitmask,arity)}else if((bitmask==PARTIAL_FLAG||bitmask==(BIND_FLAG|PARTIAL_FLAG))&&!holders.length){result=createPartialWrapper(func,bitmask,thisArg,partials)}else{result=createHybridWrapper.apply(undefined,newData)}var setter=data?baseSetData:setData;return setter(result,newData)}module.exports=createWrapper},{"./_baseSetData":54,"./_createBaseWrapper":72,"./_createCurryWrapper":74,"./_createHybridWrapper":75,"./_createPartialWrapper":76,"./_getData":85,"./_mergeData":128,"./_setData":137,"./toInteger":188}],80:[function(require,module,exports){var SetCache=require("./_SetCache"),arraySome=require("./_arraySome");var UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2;function equalArrays(array,other,equalFunc,customizer,bitmask,stack){var isPartial=bitmask&PARTIAL_COMPARE_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength)){return false}var stacked=stack.get(array);if(stacked){return stacked==other}var index=-1,result=true,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:undefined;stack.set(array,other);while(++index<arrLength){var arrValue=array[index],othValue=other[index];if(customizer){var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack)}if(compared!==undefined){if(compared){continue}result=false;break}if(seen){if(!arraySome(other,function(othValue,othIndex){if(!seen.has(othIndex)&&(arrValue===othValue||equalFunc(arrValue,othValue,customizer,bitmask,stack))){return seen.add(othIndex)}})){result=false;break}}else if(!(arrValue===othValue||equalFunc(arrValue,othValue,customizer,bitmask,stack))){result=false;break}}stack["delete"](array);return result}module.exports=equalArrays},{"./_SetCache":15,"./_arraySome":27}],81:[function(require,module,exports){var Symbol=require("./_Symbol"),Uint8Array=require("./_Uint8Array"),equalArrays=require("./_equalArrays"),mapToArray=require("./_mapToArray"),setToArray=require("./_setToArray");var UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2;var boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",mapTag="[object Map]",numberTag="[object Number]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]";var arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]";var symbolProto=Symbol?Symbol.prototype:undefined,symbolValueOf=symbolProto?symbolProto.valueOf:undefined;function equalByTag(object,other,tag,equalFunc,customizer,bitmask,stack){switch(tag){case dataViewTag:if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset){return false}object=object.buffer;other=other.buffer;case arrayBufferTag:if(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other))){return false}return true;case boolTag:case dateTag:return+object==+other;case errorTag:return object.name==other.name&&object.message==other.message;case numberTag:return object!=+object?other!=+other:object==+other;case regexpTag:case stringTag:return object==other+"";case mapTag:var convert=mapToArray;case setTag:var isPartial=bitmask&PARTIAL_COMPARE_FLAG;convert||(convert=setToArray);if(object.size!=other.size&&!isPartial){return false}var stacked=stack.get(object);if(stacked){return stacked==other}bitmask|=UNORDERED_COMPARE_FLAG;stack.set(object,other);return equalArrays(convert(object),convert(other),equalFunc,customizer,bitmask,stack);case symbolTag:if(symbolValueOf){return symbolValueOf.call(object)==symbolValueOf.call(other)}}return false}module.exports=equalByTag},{"./_Symbol":17,"./_Uint8Array":18,"./_equalArrays":80,"./_mapToArray":126,"./_setToArray":138}],82:[function(require,module,exports){var baseHas=require("./_baseHas"),keys=require("./keys");var PARTIAL_COMPARE_FLAG=2;function equalObjects(object,other,equalFunc,customizer,bitmask,stack){var isPartial=bitmask&PARTIAL_COMPARE_FLAG,objProps=keys(object),objLength=objProps.length,othProps=keys(other),othLength=othProps.length;if(objLength!=othLength&&!isPartial){return false}var index=objLength;while(index--){var key=objProps[index];if(!(isPartial?key in other:baseHas(other,key))){return false}}var stacked=stack.get(object);if(stacked){return stacked==other}var result=true;stack.set(object,other);var skipCtor=isPartial;while(++index<objLength){key=objProps[index];var objValue=object[key],othValue=other[key];if(customizer){var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack)}if(!(compared===undefined?objValue===othValue||equalFunc(objValue,othValue,customizer,bitmask,stack):compared)){result=false;break}skipCtor||(skipCtor=key=="constructor")}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;if(objCtor!=othCtor&&("constructor"in object&&"constructor"in other)&&!(typeof objCtor=="function"&&objCtor instanceof objCtor&&typeof othCtor=="function"&&othCtor instanceof othCtor)){result=false}}stack["delete"](object);return result}module.exports=equalObjects},{"./_baseHas":38,"./keys":175}],83:[function(require,module,exports){var htmlEscapes={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"};function escapeHtmlChar(chr){return htmlEscapes[chr]}module.exports=escapeHtmlChar},{}],84:[function(require,module,exports){var baseGetAllKeys=require("./_baseGetAllKeys"),getSymbolsIn=require("./_getSymbolsIn"),keysIn=require("./keysIn");function getAllKeysIn(object){return baseGetAllKeys(object,keysIn,getSymbolsIn)}module.exports=getAllKeysIn},{"./_baseGetAllKeys":37,"./_getSymbolsIn":94,"./keysIn":176}],85:[function(require,module,exports){var metaMap=require("./_metaMap"),noop=require("./noop");var getData=!metaMap?noop:function(func){return metaMap.get(func)};module.exports=getData},{"./_metaMap":129,"./noop":178}],86:[function(require,module,exports){var realNames=require("./_realNames");var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;function getFuncName(func){var result=func.name+"",array=realNames[result],length=hasOwnProperty.call(realNames,result)?array.length:0;while(length--){var data=array[length],otherFunc=data.func;if(otherFunc==null||otherFunc==func){return data.name}}return result}module.exports=getFuncName},{"./_realNames":131}],87:[function(require,module,exports){function getHolder(func){var object=func;return object.placeholder}module.exports=getHolder},{}],88:[function(require,module,exports){var baseProperty=require("./_baseProperty");var getLength=baseProperty("length");module.exports=getLength},{"./_baseProperty":52}],89:[function(require,module,exports){var isKeyable=require("./_isKeyable");function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data[typeof key=="string"?"string":"hash"]:data.map}module.exports=getMapData},{"./_isKeyable":110}],90:[function(require,module,exports){var isStrictComparable=require("./_isStrictComparable"),keys=require("./keys");function getMatchData(object){var result=keys(object),length=result.length;while(length--){var key=result[length],value=object[key];result[length]=[key,value,isStrictComparable(value)]}return result}module.exports=getMatchData},{"./_isStrictComparable":114,"./keys":175}],91:[function(require,module,exports){var baseIsNative=require("./_baseIsNative"),getValue=require("./_getValue");function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:undefined}module.exports=getNative},{"./_baseIsNative":44,"./_getValue":96}],92:[function(require,module,exports){var nativeGetPrototype=Object.getPrototypeOf;function getPrototype(value){return nativeGetPrototype(Object(value))}module.exports=getPrototype},{}],93:[function(require,module,exports){var stubArray=require("./stubArray");var getOwnPropertySymbols=Object.getOwnPropertySymbols;function getSymbols(object){return getOwnPropertySymbols(Object(object))}if(!getOwnPropertySymbols){getSymbols=stubArray}module.exports=getSymbols},{"./stubArray":185}],94:[function(require,module,exports){var arrayPush=require("./_arrayPush"),getPrototype=require("./_getPrototype"),getSymbols=require("./_getSymbols");var getOwnPropertySymbols=Object.getOwnPropertySymbols;var getSymbolsIn=!getOwnPropertySymbols?getSymbols:function(object){var result=[];while(object){arrayPush(result,getSymbols(object));object=getPrototype(object)}return result};module.exports=getSymbolsIn},{"./_arrayPush":25,"./_getPrototype":92,"./_getSymbols":93}],95:[function(require,module,exports){var DataView=require("./_DataView"),Map=require("./_Map"),Promise=require("./_Promise"),Set=require("./_Set"),WeakMap=require("./_WeakMap"),toSource=require("./_toSource");var mapTag="[object Map]",objectTag="[object Object]",promiseTag="[object Promise]",setTag="[object Set]",weakMapTag="[object WeakMap]";var dataViewTag="[object DataView]";var objectProto=Object.prototype;var objectToString=objectProto.toString;var dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap);function getTag(value){return objectToString.call(value)}if(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&getTag(Promise.resolve())!=promiseTag||Set&&getTag(new Set)!=setTag||WeakMap&&getTag(new WeakMap)!=weakMapTag){getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:undefined,ctorString=Ctor?toSource(Ctor):undefined;if(ctorString){switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}}return result}}module.exports=getTag},{"./_DataView":5,"./_Map":10,"./_Promise":12,"./_Set":14,"./_WeakMap":19,"./_toSource":146}],96:[function(require,module,exports){function getValue(object,key){return object==null?undefined:object[key]}module.exports=getValue},{}],97:[function(require,module,exports){var castPath=require("./_castPath"),isArguments=require("./isArguments"),isArray=require("./isArray"),isIndex=require("./_isIndex"),isKey=require("./_isKey"),isLength=require("./isLength"),isString=require("./isString"),toKey=require("./_toKey");function hasPath(object,path,hasFunc){path=isKey(path,object)?[path]:castPath(path);var result,index=-1,length=path.length;while(++index<length){var key=toKey(path[index]);if(!(result=object!=null&&hasFunc(object,key))){break}object=object[key]}if(result){return result}var length=object?object.length:0;return!!length&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isString(object)||isArguments(object))}module.exports=hasPath},{"./_castPath":61,"./_isIndex":107,"./_isKey":109,"./_toKey":145,"./isArguments":160,"./isArray":161,"./isLength":169,"./isString":172}],98:[function(require,module,exports){var nativeCreate=require("./_nativeCreate");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}module.exports=hashClear},{"./_nativeCreate":130}],99:[function(require,module,exports){function hashDelete(key){return this.has(key)&&delete this.__data__[key]}module.exports=hashDelete},{}],100:[function(require,module,exports){var nativeCreate=require("./_nativeCreate");var HASH_UNDEFINED="__lodash_hash_undefined__";var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?undefined:result}return hasOwnProperty.call(data,key)?data[key]:undefined}module.exports=hashGet},{"./_nativeCreate":130}],101:[function(require,module,exports){var nativeCreate=require("./_nativeCreate");var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;function hashHas(key){var data=this.__data__;return nativeCreate?data[key]!==undefined:hasOwnProperty.call(data,key)}module.exports=hashHas},{"./_nativeCreate":130}],102:[function(require,module,exports){var nativeCreate=require("./_nativeCreate");var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(key,value){var data=this.__data__;data[key]=nativeCreate&&value===undefined?HASH_UNDEFINED:value;return this}module.exports=hashSet},{"./_nativeCreate":130}],103:[function(require,module,exports){var baseTimes=require("./_baseTimes"),isArguments=require("./isArguments"),isArray=require("./isArray"),isLength=require("./isLength"),isString=require("./isString");function indexKeys(object){var length=object?object.length:undefined;if(isLength(length)&&(isArray(object)||isString(object)||isArguments(object))){return baseTimes(length,String)}return null}module.exports=indexKeys},{"./_baseTimes":55,"./isArguments":160,"./isArray":161,"./isLength":169,"./isString":172}],104:[function(require,module,exports){function indexOfNaN(array,fromIndex,fromRight){var length=array.length,index=fromIndex+(fromRight?1:-1);while(fromRight?index--:++index<length){var other=array[index];if(other!==other){return index}}return-1}module.exports=indexOfNaN},{}],105:[function(require,module,exports){var isArguments=require("./isArguments"),isArray=require("./isArray");function isFlattenable(value){return isArray(value)||isArguments(value)}module.exports=isFlattenable},{"./isArguments":160,"./isArray":161}],106:[function(require,module,exports){function isHostObject(value){var result=false;if(value!=null&&typeof value.toString!="function"){try{result=!!(value+"")}catch(e){}}return result}module.exports=isHostObject},{}],107:[function(require,module,exports){var MAX_SAFE_INTEGER=9007199254740991;var reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(value,length){length=length==null?MAX_SAFE_INTEGER:length;return!!length&&(typeof value=="number"||reIsUint.test(value))&&(value>-1&&value%1==0&&value<length)}module.exports=isIndex},{}],108:[function(require,module,exports){var eq=require("./eq"),isArrayLike=require("./isArrayLike"),isIndex=require("./_isIndex"),isObject=require("./isObject");function isIterateeCall(value,index,object){if(!isObject(object)){return false}var type=typeof index;if(type=="number"?isArrayLike(object)&&isIndex(index,object.length):type=="string"&&index in object){return eq(object[index],value)}return false}module.exports=isIterateeCall},{"./_isIndex":107,"./eq":151,"./isArrayLike":162,"./isObject":170}],109:[function(require,module,exports){var isArray=require("./isArray"),isSymbol=require("./isSymbol");var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(value,object){if(isArray(value)){return false}var type=typeof value;if(type=="number"||type=="symbol"||type=="boolean"||value==null||isSymbol(value)){return true}return reIsPlainProp.test(value)||!reIsDeepProp.test(value)||object!=null&&value in Object(object)}module.exports=isKey},{"./isArray":161,"./isSymbol":173}],110:[function(require,module,exports){function isKeyable(value){var type=typeof value;return type=="string"||type=="number"||type=="symbol"||type=="boolean"?value!=="__proto__":value===null}module.exports=isKeyable},{}],111:[function(require,module,exports){var LazyWrapper=require("./_LazyWrapper"),getData=require("./_getData"),getFuncName=require("./_getFuncName"),lodash=require("./wrapperLodash");function isLaziable(func){var funcName=getFuncName(func),other=lodash[funcName];if(typeof other!="function"||!(funcName in LazyWrapper.prototype)){return false}if(func===other){return true}var data=getData(other);return!!data&&func===data[0]}module.exports=isLaziable},{"./_LazyWrapper":7,"./_getData":85,"./_getFuncName":86,"./wrapperLodash":194}],112:[function(require,module,exports){var coreJsData=require("./_coreJsData");var maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}();function isMasked(func){return!!maskSrcKey&&maskSrcKey in func}module.exports=isMasked},{"./_coreJsData":67}],113:[function(require,module,exports){var objectProto=Object.prototype;function isPrototype(value){var Ctor=value&&value.constructor,proto=typeof Ctor=="function"&&Ctor.prototype||objectProto;return value===proto}module.exports=isPrototype},{}],114:[function(require,module,exports){var isObject=require("./isObject");function isStrictComparable(value){return value===value&&!isObject(value)}module.exports=isStrictComparable},{"./isObject":170}],115:[function(require,module,exports){function iteratorToArray(iterator){var data,result=[];while(!(data=iterator.next()).done){result.push(data.value)}return result}module.exports=iteratorToArray},{}],116:[function(require,module,exports){function listCacheClear(){this.__data__=[]}module.exports=listCacheClear},{}],117:[function(require,module,exports){var assocIndexOf=require("./_assocIndexOf");var arrayProto=Array.prototype;var splice=arrayProto.splice;function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){return false}var lastIndex=data.length-1;if(index==lastIndex){data.pop()}else{splice.call(data,index,1)}return true}module.exports=listCacheDelete},{"./_assocIndexOf":29}],118:[function(require,module,exports){var assocIndexOf=require("./_assocIndexOf");function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?undefined:data[index][1]}module.exports=listCacheGet},{"./_assocIndexOf":29}],119:[function(require,module,exports){var assocIndexOf=require("./_assocIndexOf");function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1}module.exports=listCacheHas},{"./_assocIndexOf":29}],120:[function(require,module,exports){var assocIndexOf=require("./_assocIndexOf");function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){data.push([key,value])}else{data[index][1]=value}return this}module.exports=listCacheSet},{"./_assocIndexOf":29}],121:[function(require,module,exports){var Hash=require("./_Hash"),ListCache=require("./_ListCache"),Map=require("./_Map");function mapCacheClear(){this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}module.exports=mapCacheClear},{"./_Hash":6,"./_ListCache":8,"./_Map":10}],122:[function(require,module,exports){var getMapData=require("./_getMapData");function mapCacheDelete(key){return getMapData(this,key)["delete"](key)}module.exports=mapCacheDelete},{"./_getMapData":89}],123:[function(require,module,exports){var getMapData=require("./_getMapData");function mapCacheGet(key){return getMapData(this,key).get(key)}module.exports=mapCacheGet},{"./_getMapData":89}],124:[function(require,module,exports){var getMapData=require("./_getMapData");function mapCacheHas(key){return getMapData(this,key).has(key)}module.exports=mapCacheHas},{"./_getMapData":89}],125:[function(require,module,exports){var getMapData=require("./_getMapData");function mapCacheSet(key,value){getMapData(this,key).set(key,value);return this}module.exports=mapCacheSet},{"./_getMapData":89}],126:[function(require,module,exports){function mapToArray(map){var index=-1,result=Array(map.size);map.forEach(function(value,key){result[++index]=[key,value]});return result}module.exports=mapToArray},{}],127:[function(require,module,exports){function matchesStrictComparable(key,srcValue){return function(object){if(object==null){return false}return object[key]===srcValue&&(srcValue!==undefined||key in Object(object))}}module.exports=matchesStrictComparable},{}],128:[function(require,module,exports){var composeArgs=require("./_composeArgs"),composeArgsRight=require("./_composeArgsRight"),replaceHolders=require("./_replaceHolders");var PLACEHOLDER="__lodash_placeholder__";var BIND_FLAG=1,BIND_KEY_FLAG=2,CURRY_BOUND_FLAG=4,CURRY_FLAG=8,ARY_FLAG=128,REARG_FLAG=256;var nativeMin=Math.min;function mergeData(data,source){var bitmask=data[1],srcBitmask=source[1],newBitmask=bitmask|srcBitmask,isCommon=newBitmask<(BIND_FLAG|BIND_KEY_FLAG|ARY_FLAG);var isCombo=srcBitmask==ARY_FLAG&&bitmask==CURRY_FLAG||srcBitmask==ARY_FLAG&&bitmask==REARG_FLAG&&data[7].length<=source[8]||srcBitmask==(ARY_FLAG|REARG_FLAG)&&source[7].length<=source[8]&&bitmask==CURRY_FLAG;if(!(isCommon||isCombo)){return data}if(srcBitmask&BIND_FLAG){data[2]=source[2];newBitmask|=bitmask&BIND_FLAG?0:CURRY_BOUND_FLAG}var value=source[3];if(value){var partials=data[3];data[3]=partials?composeArgs(partials,value,source[4]):value;data[4]=partials?replaceHolders(data[3],PLACEHOLDER):source[4]}value=source[5];if(value){partials=data[5];data[5]=partials?composeArgsRight(partials,value,source[6]):value;data[6]=partials?replaceHolders(data[5],PLACEHOLDER):source[6]}value=source[7];if(value){data[7]=value}if(srcBitmask&ARY_FLAG){data[8]=data[8]==null?source[8]:nativeMin(data[8],source[8])}if(data[9]==null){data[9]=source[9]}data[0]=source[0];data[1]=newBitmask;return data}module.exports=mergeData},{"./_composeArgs":63,"./_composeArgsRight":64,"./_replaceHolders":133}],129:[function(require,module,exports){var WeakMap=require("./_WeakMap");var metaMap=WeakMap&&new WeakMap;module.exports=metaMap},{"./_WeakMap":19}],130:[function(require,module,exports){var getNative=require("./_getNative");var nativeCreate=getNative(Object,"create");module.exports=nativeCreate},{"./_getNative":91}],131:[function(require,module,exports){var realNames={};module.exports=realNames},{}],132:[function(require,module,exports){var copyArray=require("./_copyArray"),isIndex=require("./_isIndex");var nativeMin=Math.min;function reorder(array,indexes){var arrLength=array.length,length=nativeMin(indexes.length,arrLength),oldArray=copyArray(array);while(length--){var index=indexes[length];array[length]=isIndex(index,arrLength)?oldArray[index]:undefined}return array}module.exports=reorder},{"./_copyArray":65,"./_isIndex":107}],133:[function(require,module,exports){var PLACEHOLDER="__lodash_placeholder__";function replaceHolders(array,placeholder){var index=-1,length=array.length,resIndex=0,result=[];while(++index<length){var value=array[index];if(value===placeholder||value===PLACEHOLDER){array[index]=PLACEHOLDER;
result[resIndex++]=index}}return result}module.exports=replaceHolders},{}],134:[function(require,module,exports){(function(global){var checkGlobal=require("./_checkGlobal");var freeGlobal=checkGlobal(typeof global=="object"&&global);var freeSelf=checkGlobal(typeof self=="object"&&self);var thisGlobal=checkGlobal(typeof this=="object"&&this);var root=freeGlobal||freeSelf||thisGlobal||Function("return this")();module.exports=root}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./_checkGlobal":62}],135:[function(require,module,exports){var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd(value){this.__data__.set(value,HASH_UNDEFINED);return this}module.exports=setCacheAdd},{}],136:[function(require,module,exports){function setCacheHas(value){return this.__data__.has(value)}module.exports=setCacheHas},{}],137:[function(require,module,exports){var baseSetData=require("./_baseSetData"),now=require("./now");var HOT_COUNT=150,HOT_SPAN=16;var setData=function(){var count=0,lastCalled=0;return function(key,value){var stamp=now(),remaining=HOT_SPAN-(stamp-lastCalled);lastCalled=stamp;if(remaining>0){if(++count>=HOT_COUNT){return key}}else{count=0}return baseSetData(key,value)}}();module.exports=setData},{"./_baseSetData":54,"./now":179}],138:[function(require,module,exports){function setToArray(set){var index=-1,result=Array(set.size);set.forEach(function(value){result[++index]=value});return result}module.exports=setToArray},{}],139:[function(require,module,exports){var ListCache=require("./_ListCache");function stackClear(){this.__data__=new ListCache}module.exports=stackClear},{"./_ListCache":8}],140:[function(require,module,exports){function stackDelete(key){return this.__data__["delete"](key)}module.exports=stackDelete},{}],141:[function(require,module,exports){function stackGet(key){return this.__data__.get(key)}module.exports=stackGet},{}],142:[function(require,module,exports){function stackHas(key){return this.__data__.has(key)}module.exports=stackHas},{}],143:[function(require,module,exports){var ListCache=require("./_ListCache"),MapCache=require("./_MapCache");var LARGE_ARRAY_SIZE=200;function stackSet(key,value){var cache=this.__data__;if(cache instanceof ListCache&&cache.__data__.length==LARGE_ARRAY_SIZE){cache=this.__data__=new MapCache(cache.__data__)}cache.set(key,value);return this}module.exports=stackSet},{"./_ListCache":8,"./_MapCache":11}],144:[function(require,module,exports){var memoize=require("./memoize"),toString=require("./toString");var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g;var reEscapeChar=/\\(\\)?/g;var stringToPath=memoize(function(string){var result=[];toString(string).replace(rePropName,function(match,number,quote,string){result.push(quote?string.replace(reEscapeChar,"$1"):number||match)});return result});module.exports=stringToPath},{"./memoize":177,"./toString":190}],145:[function(require,module,exports){var isSymbol=require("./isSymbol");var INFINITY=1/0;function toKey(value){if(typeof value=="string"||isSymbol(value)){return value}var result=value+"";return result=="0"&&1/value==-INFINITY?"-0":result}module.exports=toKey},{"./isSymbol":173}],146:[function(require,module,exports){var funcToString=Function.prototype.toString;function toSource(func){if(func!=null){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}module.exports=toSource},{}],147:[function(require,module,exports){var LazyWrapper=require("./_LazyWrapper"),LodashWrapper=require("./_LodashWrapper"),copyArray=require("./_copyArray");function wrapperClone(wrapper){if(wrapper instanceof LazyWrapper){return wrapper.clone()}var result=new LodashWrapper(wrapper.__wrapped__,wrapper.__chain__);result.__actions__=copyArray(wrapper.__actions__);result.__index__=wrapper.__index__;result.__values__=wrapper.__values__;return result}module.exports=wrapperClone},{"./_LazyWrapper":7,"./_LodashWrapper":9,"./_copyArray":65}],148:[function(require,module,exports){var assignValue=require("./_assignValue"),copyObject=require("./_copyObject"),createAssigner=require("./_createAssigner"),isArrayLike=require("./isArrayLike"),isPrototype=require("./_isPrototype"),keys=require("./keys");var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var propertyIsEnumerable=objectProto.propertyIsEnumerable;var nonEnumShadows=!propertyIsEnumerable.call({valueOf:1},"valueOf");var assign=createAssigner(function(object,source){if(nonEnumShadows||isPrototype(source)||isArrayLike(source)){copyObject(source,keys(source),object);return}for(var key in source){if(hasOwnProperty.call(source,key)){assignValue(object,key,source[key])}}});module.exports=assign},{"./_assignValue":28,"./_copyObject":66,"./_createAssigner":69,"./_isPrototype":113,"./isArrayLike":162,"./keys":175}],149:[function(require,module,exports){var toInteger=require("./toInteger");var FUNC_ERROR_TEXT="Expected a function";function before(n,func){var result;if(typeof func!="function"){throw new TypeError(FUNC_ERROR_TEXT)}n=toInteger(n);return function(){if(--n>0){result=func.apply(this,arguments)}if(n<=1){func=undefined}return result}}module.exports=before},{"./toInteger":188}],150:[function(require,module,exports){var createWrapper=require("./_createWrapper"),getHolder=require("./_getHolder"),replaceHolders=require("./_replaceHolders"),rest=require("./rest");var BIND_FLAG=1,PARTIAL_FLAG=32;var bind=rest(function(func,thisArg,partials){var bitmask=BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=PARTIAL_FLAG}return createWrapper(func,bitmask,thisArg,partials,holders)});bind.placeholder={};module.exports=bind},{"./_createWrapper":79,"./_getHolder":87,"./_replaceHolders":133,"./rest":183}],151:[function(require,module,exports){function eq(value,other){return value===other||value!==value&&other!==other}module.exports=eq},{}],152:[function(require,module,exports){var escapeHtmlChar=require("./_escapeHtmlChar"),toString=require("./toString");var reUnescapedHtml=/[&<>"'`]/g,reHasUnescapedHtml=RegExp(reUnescapedHtml.source);function escape(string){string=toString(string);return string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string}module.exports=escape},{"./_escapeHtmlChar":83,"./toString":190}],153:[function(require,module,exports){var arrayEach=require("./_arrayEach"),baseEach=require("./_baseEach"),baseIteratee=require("./_baseIteratee"),isArray=require("./isArray");function forEach(collection,iteratee){var func=isArray(collection)?arrayEach:baseEach;return func(collection,baseIteratee(iteratee,3))}module.exports=forEach},{"./_arrayEach":21,"./_baseEach":32,"./_baseIteratee":45,"./isArray":161}],154:[function(require,module,exports){var baseForOwn=require("./_baseForOwn"),baseIteratee=require("./_baseIteratee");function forOwn(object,iteratee){return object&&baseForOwn(object,baseIteratee(iteratee,3))}module.exports=forOwn},{"./_baseForOwn":35,"./_baseIteratee":45}],155:[function(require,module,exports){var baseGet=require("./_baseGet");function get(object,path,defaultValue){var result=object==null?undefined:baseGet(object,path);return result===undefined?defaultValue:result}module.exports=get},{"./_baseGet":36}],156:[function(require,module,exports){var baseHas=require("./_baseHas"),hasPath=require("./_hasPath");function has(object,path){return object!=null&&hasPath(object,path,baseHas)}module.exports=has},{"./_baseHas":38,"./_hasPath":97}],157:[function(require,module,exports){var baseHasIn=require("./_baseHasIn"),hasPath=require("./_hasPath");function hasIn(object,path){return object!=null&&hasPath(object,path,baseHasIn)}module.exports=hasIn},{"./_baseHasIn":39,"./_hasPath":97}],158:[function(require,module,exports){function identity(value){return value}module.exports=identity},{}],159:[function(require,module,exports){var baseIndexOf=require("./_baseIndexOf"),isArrayLike=require("./isArrayLike"),isString=require("./isString"),toInteger=require("./toInteger"),values=require("./values");var nativeMax=Math.max;function includes(collection,value,fromIndex,guard){collection=isArrayLike(collection)?collection:values(collection);fromIndex=fromIndex&&!guard?toInteger(fromIndex):0;var length=collection.length;if(fromIndex<0){fromIndex=nativeMax(length+fromIndex,0)}return isString(collection)?fromIndex<=length&&collection.indexOf(value,fromIndex)>-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1}module.exports=includes},{"./_baseIndexOf":40,"./isArrayLike":162,"./isString":172,"./toInteger":188,"./values":193}],160:[function(require,module,exports){var isArrayLikeObject=require("./isArrayLikeObject");var argsTag="[object Arguments]";var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var objectToString=objectProto.toString;var propertyIsEnumerable=objectProto.propertyIsEnumerable;function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}module.exports=isArguments},{"./isArrayLikeObject":163}],161:[function(require,module,exports){var isArray=Array.isArray;module.exports=isArray},{}],162:[function(require,module,exports){var getLength=require("./_getLength"),isFunction=require("./isFunction"),isLength=require("./isLength");function isArrayLike(value){return value!=null&&isLength(getLength(value))&&!isFunction(value)}module.exports=isArrayLike},{"./_getLength":88,"./isFunction":168,"./isLength":169}],163:[function(require,module,exports){var isArrayLike=require("./isArrayLike"),isObjectLike=require("./isObjectLike");function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}module.exports=isArrayLikeObject},{"./isArrayLike":162,"./isObjectLike":171}],164:[function(require,module,exports){var root=require("./_root"),stubFalse=require("./stubFalse");var freeExports=typeof exports=="object"&&exports;var freeModule=freeExports&&typeof module=="object"&&module;var moduleExports=freeModule&&freeModule.exports===freeExports;var Buffer=moduleExports?root.Buffer:undefined;var isBuffer=!Buffer?stubFalse:function(value){return value instanceof Buffer};module.exports=isBuffer},{"./_root":134,"./stubFalse":186}],165:[function(require,module,exports){var isObjectLike=require("./isObjectLike");var dateTag="[object Date]";var objectProto=Object.prototype;var objectToString=objectProto.toString;function isDate(value){return isObjectLike(value)&&objectToString.call(value)==dateTag}module.exports=isDate},{"./isObjectLike":171}],166:[function(require,module,exports){var getTag=require("./_getTag"),isArguments=require("./isArguments"),isArray=require("./isArray"),isArrayLike=require("./isArrayLike"),isBuffer=require("./isBuffer"),isFunction=require("./isFunction"),isObjectLike=require("./isObjectLike"),isString=require("./isString"),keys=require("./keys");var mapTag="[object Map]",setTag="[object Set]";var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var propertyIsEnumerable=objectProto.propertyIsEnumerable;var nonEnumShadows=!propertyIsEnumerable.call({valueOf:1},"valueOf");function isEmpty(value){if(isArrayLike(value)&&(isArray(value)||isString(value)||isFunction(value.splice)||isArguments(value)||isBuffer(value))){return!value.length}if(isObjectLike(value)){var tag=getTag(value);if(tag==mapTag||tag==setTag){return!value.size}}for(var key in value){if(hasOwnProperty.call(value,key)){return false}}return!(nonEnumShadows&&keys(value).length)}module.exports=isEmpty},{"./_getTag":95,"./isArguments":160,"./isArray":161,"./isArrayLike":162,"./isBuffer":164,"./isFunction":168,"./isObjectLike":171,"./isString":172,"./keys":175}],167:[function(require,module,exports){var baseIsEqual=require("./_baseIsEqual");function isEqual(value,other){return baseIsEqual(value,other)}module.exports=isEqual},{"./_baseIsEqual":41}],168:[function(require,module,exports){var isObject=require("./isObject");var funcTag="[object Function]",genTag="[object GeneratorFunction]";var objectProto=Object.prototype;var objectToString=objectProto.toString;function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}module.exports=isFunction},{"./isObject":170}],169:[function(require,module,exports){var MAX_SAFE_INTEGER=9007199254740991;function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}module.exports=isLength},{}],170:[function(require,module,exports){function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}module.exports=isObject},{}],171:[function(require,module,exports){function isObjectLike(value){return!!value&&typeof value=="object"}module.exports=isObjectLike},{}],172:[function(require,module,exports){var isArray=require("./isArray"),isObjectLike=require("./isObjectLike");var stringTag="[object String]";var objectProto=Object.prototype;var objectToString=objectProto.toString;function isString(value){return typeof value=="string"||!isArray(value)&&isObjectLike(value)&&objectToString.call(value)==stringTag}module.exports=isString},{"./isArray":161,"./isObjectLike":171}],173:[function(require,module,exports){var isObjectLike=require("./isObjectLike");var symbolTag="[object Symbol]";var objectProto=Object.prototype;var objectToString=objectProto.toString;function isSymbol(value){return typeof value=="symbol"||isObjectLike(value)&&objectToString.call(value)==symbolTag}module.exports=isSymbol},{"./isObjectLike":171}],174:[function(require,module,exports){var isLength=require("./isLength"),isObjectLike=require("./isObjectLike");var argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]";var arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]";var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;var objectProto=Object.prototype;var objectToString=objectProto.toString;function isTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[objectToString.call(value)]}module.exports=isTypedArray},{"./isLength":169,"./isObjectLike":171}],175:[function(require,module,exports){var baseHas=require("./_baseHas"),baseKeys=require("./_baseKeys"),indexKeys=require("./_indexKeys"),isArrayLike=require("./isArrayLike"),isIndex=require("./_isIndex"),isPrototype=require("./_isPrototype");function keys(object){var isProto=isPrototype(object);if(!(isProto||isArrayLike(object))){return baseKeys(object)}var indexes=indexKeys(object),skipIndexes=!!indexes,result=indexes||[],length=result.length;for(var key in object){if(baseHas(object,key)&&!(skipIndexes&&(key=="length"||isIndex(key,length)))&&!(isProto&&key=="constructor")){result.push(key)}}return result}module.exports=keys},{"./_baseHas":38,"./_baseKeys":46,"./_indexKeys":103,"./_isIndex":107,"./_isPrototype":113,"./isArrayLike":162}],176:[function(require,module,exports){var baseKeysIn=require("./_baseKeysIn"),indexKeys=require("./_indexKeys"),isIndex=require("./_isIndex"),isPrototype=require("./_isPrototype");var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;function keysIn(object){var index=-1,isProto=isPrototype(object),props=baseKeysIn(object),propsLength=props.length,indexes=indexKeys(object),skipIndexes=!!indexes,result=indexes||[],length=result.length;while(++index<propsLength){var key=props[index];if(!(skipIndexes&&(key=="length"||isIndex(key,length)))&&!(key=="constructor"&&(isProto||!hasOwnProperty.call(object,key)))){result.push(key)}}return result}module.exports=keysIn},{"./_baseKeysIn":47,"./_indexKeys":103,"./_isIndex":107,"./_isPrototype":113}],177:[function(require,module,exports){var MapCache=require("./_MapCache");var FUNC_ERROR_TEXT="Expected a function";function memoize(func,resolver){if(typeof func!="function"||resolver&&typeof resolver!="function"){throw new TypeError(FUNC_ERROR_TEXT)}var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key)){return cache.get(key)}var result=func.apply(this,args);memoized.cache=cache.set(key,result);return result};memoized.cache=new(memoize.Cache||MapCache);return memoized}memoize.Cache=MapCache;module.exports=memoize},{"./_MapCache":11}],178:[function(require,module,exports){function noop(){}module.exports=noop},{}],179:[function(require,module,exports){function now(){return Date.now()}module.exports=now},{}],180:[function(require,module,exports){var arrayMap=require("./_arrayMap"),baseDifference=require("./_baseDifference"),baseFlatten=require("./_baseFlatten"),basePick=require("./_basePick"),getAllKeysIn=require("./_getAllKeysIn"),rest=require("./rest"),toKey=require("./_toKey");var omit=rest(function(object,props){if(object==null){return{}}props=arrayMap(baseFlatten(props,1),toKey);return basePick(object,baseDifference(getAllKeysIn(object),props))});module.exports=omit},{"./_arrayMap":24,"./_baseDifference":31,"./_baseFlatten":33,"./_basePick":51,"./_getAllKeysIn":84,"./_toKey":145,"./rest":183}],181:[function(require,module,exports){var before=require("./before");function once(func){return before(2,func)}module.exports=once},{"./before":149}],182:[function(require,module,exports){var baseProperty=require("./_baseProperty"),basePropertyDeep=require("./_basePropertyDeep"),isKey=require("./_isKey"),toKey=require("./_toKey");function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}module.exports=property},{"./_baseProperty":52,"./_basePropertyDeep":53,"./_isKey":109,"./_toKey":145}],183:[function(require,module,exports){var apply=require("./_apply"),toInteger=require("./toInteger");var FUNC_ERROR_TEXT="Expected a function";var nativeMax=Math.max;function rest(func,start){if(typeof func!="function"){throw new TypeError(FUNC_ERROR_TEXT)}start=nativeMax(start===undefined?func.length-1:toInteger(start),0);return function(){var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);while(++index<length){array[index]=args[start+index]}switch(start){case 0:return func.call(this,array);case 1:return func.call(this,args[0],array);case 2:return func.call(this,args[0],args[1],array)}var otherArgs=Array(start+1);index=-1;while(++index<start){otherArgs[index]=args[index]}otherArgs[start]=array;return apply(func,this,otherArgs)}}module.exports=rest},{"./_apply":20,"./toInteger":188}],184:[function(require,module,exports){var castPath=require("./_castPath"),isFunction=require("./isFunction"),isKey=require("./_isKey"),toKey=require("./_toKey");function result(object,path,defaultValue){path=isKey(path,object)?[path]:castPath(path);var index=-1,length=path.length;if(!length){object=undefined;length=1}while(++index<length){var value=object==null?undefined:object[toKey(path[index])];if(value===undefined){index=length;value=defaultValue}object=isFunction(value)?value.call(object):value}return object}module.exports=result},{"./_castPath":61,"./_isKey":109,"./_toKey":145,"./isFunction":168}],185:[function(require,module,exports){function stubArray(){return[]}module.exports=stubArray},{}],186:[function(require,module,exports){function stubFalse(){return false}module.exports=stubFalse},{}],187:[function(require,module,exports){var toNumber=require("./toNumber");var INFINITY=1/0,MAX_INTEGER=1.7976931348623157e308;function toFinite(value){if(!value){return value===0?value:0}value=toNumber(value);if(value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER}return value===value?value:0}module.exports=toFinite},{"./toNumber":189}],188:[function(require,module,exports){var toFinite=require("./toFinite");function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}module.exports=toInteger},{"./toFinite":187}],189:[function(require,module,exports){var isFunction=require("./isFunction"),isObject=require("./isObject"),isSymbol=require("./isSymbol");var NAN=0/0;var reTrim=/^\s+|\s+$/g;var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;var reIsBinary=/^0b[01]+$/i;var reIsOctal=/^0o[0-7]+$/i;var freeParseInt=parseInt;function toNumber(value){if(typeof value=="number"){return value}if(isSymbol(value)){return NAN}if(isObject(value)){var other=isFunction(value.valueOf)?value.valueOf():value;value=isObject(other)?other+"":other}if(typeof value!="string"){return value===0?value:+value}value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}module.exports=toNumber},{"./isFunction":168,"./isObject":170,"./isSymbol":173}],190:[function(require,module,exports){var baseToString=require("./_baseToString");function toString(value){return value==null?"":baseToString(value)}module.exports=toString},{"./_baseToString":56}],191:[function(require,module,exports){var baseFlatten=require("./_baseFlatten"),baseUniq=require("./_baseUniq"),isArrayLikeObject=require("./isArrayLikeObject"),rest=require("./rest");var union=rest(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,true))});module.exports=union},{"./_baseFlatten":33,"./_baseUniq":58,"./isArrayLikeObject":163,"./rest":183}],192:[function(require,module,exports){var toString=require("./toString");var idCounter=0;function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id}module.exports=uniqueId},{"./toString":190}],193:[function(require,module,exports){var baseValues=require("./_baseValues"),keys=require("./keys");function values(object){return object?baseValues(object,keys(object)):[]}module.exports=values},{"./_baseValues":59,"./keys":175}],194:[function(require,module,exports){var LazyWrapper=require("./_LazyWrapper"),LodashWrapper=require("./_LodashWrapper"),baseLodash=require("./_baseLodash"),isArray=require("./isArray"),isObjectLike=require("./isObjectLike"),wrapperClone=require("./_wrapperClone");var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;function lodash(value){if(isObjectLike(value)&&!isArray(value)&&!(value instanceof LazyWrapper)){if(value instanceof LodashWrapper){return value}if(hasOwnProperty.call(value,"__wrapped__")){return wrapperClone(value)}}return new LodashWrapper(value)}lodash.prototype=baseLodash.prototype;lodash.prototype.constructor=lodash;module.exports=lodash},{"./_LazyWrapper":7,"./_LodashWrapper":9,"./_baseLodash":48,"./_wrapperClone":147,"./isArray":161,"./isObjectLike":171}],"ampersand-state":[function(require,module,exports){"use strict";if(typeof window!=="undefined"){window.ampersand=window.ampersand||{};window.ampersand["ampersand-state"]=window.ampersand["ampersand-state"]||[];window.ampersand["ampersand-state"].push("5.0.2")}var uniqueId=require("lodash/uniqueId");var assign=require("lodash/assign");var cloneObj=function(obj){return assign({},obj)};var omit=require("lodash/omit");var escape=require("lodash/escape");var forOwn=require("lodash/forOwn");var includes=require("lodash/includes");var isString=require("lodash/isString");var isObject=require("lodash/isObject");var isDate=require("lodash/isDate");var isFunction=require("lodash/isFunction");var _isEqual=require("lodash/isEqual");var has=require("lodash/has");var result=require("lodash/result");var bind=require("lodash/bind");var union=require("lodash/union");var Events=require("ampersand-events");var KeyTree=require("key-tree-store");var arrayNext=require("array-next");var changeRE=/^change:/;var noop=function(){};function Base(attrs,options){options||(options={});this.cid||(this.cid=uniqueId("state"));this._events={};this._values={};this._eventBubblingHandlerCache={};this._definition=Object.create(this._definition);if(options.parse)attrs=this.parse(attrs,options);this.parent=options.parent;this.collection=options.collection;this._keyTree=new KeyTree;this._initCollections();this._initChildren();this._cache={};this._previousAttributes={};if(attrs)this.set(attrs,assign({silent:true,initial:true},options));this._changed={};if(this._derived)this._initDerived();if(options.init!==false)this.initialize.apply(this,arguments)}assign(Base.prototype,Events,{extraProperties:"ignore",idAttribute:"id",namespaceAttribute:"namespace",typeAttribute:"modelType",initialize:function(){return this},getId:function(){return this[this.idAttribute]},getNamespace:function(){return this[this.namespaceAttribute]},getType:function(){return this[this.typeAttribute]},isNew:function(){return this.getId()==null},escape:function(attr){return escape(this.get(attr))},isValid:function(options){return this._validate({},assign(options||{},{validate:true}))},parse:function(resp,options){return resp},serialize:function(options){var attrOpts=assign({props:true},options);var res=this.getAttributes(attrOpts,true);forOwn(this._children,bind(function(value,key){res[key]=this[key].serialize()},this));forOwn(this._collections,bind(function(value,key){res[key]=this[key].serialize()},this));return res},set:function(key,value,options){var self=this;var extraProperties=this.extraProperties;var wasChanging,changeEvents,newType,newVal,def,cast,err,attr,attrs,dataType,silent,unset,currentVal,initial,hasChanged,isEqual,onChange;if(isObject(key)||key===null){attrs=key;options=value}else{attrs={};attrs[key]=value}options=options||{};if(!this._validate(attrs,options))return false;unset=options.unset;silent=options.silent;initial=options.initial;wasChanging=this._changing;this._changing=true;changeEvents=[];if(initial){this._previousAttributes={}}else if(!wasChanging){this._previousAttributes=this.attributes;this._changed={}}for(var i=0,keys=Object.keys(attrs),len=keys.length;i<len;i++){attr=keys[i];newVal=attrs[attr];newType=typeof newVal;currentVal=this._values[attr];def=this._definition[attr];if(!def){if(this._children[attr]||this._collections[attr]){if(!isObject(newVal)){newVal={}}this[attr].set(newVal,options);continue}else if(extraProperties==="ignore"){continue}else if(extraProperties==="reject"){throw new TypeError('No "'+attr+'" property defined on '+(this.type||"this")+' model and extraProperties not set to "ignore" or "allow"')}else if(extraProperties==="allow"){def=this._createPropertyDefinition(attr,"any")}else if(extraProperties){throw new TypeError('Invalid value for extraProperties: "'+extraProperties+'"')}}isEqual=this._getCompareForType(def.type);onChange=this._getOnChangeForType(def.type);dataType=this._dataTypes[def.type];if(dataType&&dataType.set){cast=dataType.set(newVal);newVal=cast.val;newType=cast.type}if(def.test){err=def.test.call(this,newVal,newType);if(err){throw new TypeError("Property '"+attr+"' failed validation with error: "+err)}}if(newVal===undefined&&def.required){throw new TypeError("Required property '"+attr+"' must be of type "+def.type+". Tried to set "+newVal)}if(newVal===null&&def.required&&!def.allowNull){throw new TypeError("Property '"+attr+"' must be of type "+def.type+" (cannot be null). Tried to set "+newVal)}if(def.type&&def.type!=="any"&&def.type!==newType&&newVal!==null&&newVal!==undefined){throw new TypeError("Property '"+attr+"' must be of type "+def.type+". Tried to set "+newVal)}if(def.values&&!includes(def.values,newVal)){var defaultValue=result(def,"default");if(unset&&defaultValue!==undefined){newVal=defaultValue}else if(!unset||unset&&newVal!==undefined){throw new TypeError("Property '"+attr+"' must be one of values: "+def.values.join(", ")+". Tried to set "+newVal)}}hasChanged=initial||!isEqual(currentVal,newVal,attr);if(def.setOnce&&currentVal!==undefined&&hasChanged){throw new TypeError("Property '"+attr+"' can only be set once.")}if(hasChanged){onChange(newVal,currentVal,attr);if(!initial){this._changed[attr]=newVal;this._previousAttributes[attr]=currentVal;if(unset){delete this._values[attr]}if(!silent){changeEvents.push({prev:currentVal,val:newVal,key:attr})}}if(!unset){this._values[attr]=newVal}}else{delete this._changed[attr]}}if(changeEvents.length)this._pending=true;changeEvents.forEach(function(change){self.trigger("change:"+change.key,self,change.val,options)});if(wasChanging)return this;while(this._pending){this._pending=false;this.trigger("change",this,options)}this._pending=false;this._changing=false;return this},get:function(attr){return this[attr]},toggle:function(property){var def=this._definition[property];if(def.type==="boolean"){this[property]=!this[property]}else if(def&&def.values){this[property]=arrayNext(def.values,this[property])}else{throw new TypeError("Can only toggle properties that are type `boolean` or have `values` array.")}return this},previousAttributes:function(){return cloneObj(this._previousAttributes)},hasChanged:function(attr){if(attr==null)return!!Object.keys(this._changed).length;if(has(this._derived,attr)){return this._derived[attr].depList.some(function(dep){return this.hasChanged(dep)},this)}return has(this._changed,attr)},changedAttributes:function(diff){if(!diff)return this.hasChanged()?cloneObj(this._changed):false;var val,changed=false;var old=this._changing?this._previousAttributes:this.attributes;var def,isEqual;for(var attr in diff){def=this._definition[attr];if(!def)continue;isEqual=this._getCompareForType(def.type);if(isEqual(old[attr],val=diff[attr]))continue;(changed||(changed={}))[attr]=val}return changed},toJSON:function(){return this.serialize()},unset:function(attrs,options){var self=this;attrs=Array.isArray(attrs)?attrs:[attrs];attrs.forEach(function(key){var def=self._definition[key];if(!def)return;var val;if(def.required){val=result(def,"default");return self.set(key,val,options)}else{return self.set(key,val,assign({},options,{unset:true}))}})},clear:function(options){var self=this;Object.keys(this.attributes).forEach(function(key){self.unset(key,options)});return this},previous:function(attr){if(attr==null||!Object.keys(this._previousAttributes).length)return null;return this._previousAttributes[attr]},_getDefaultForType:function(type){var dataType=this._dataTypes[type];return dataType&&dataType["default"]},_getCompareForType:function(type){var dataType=this._dataTypes[type];if(dataType&&dataType.compare)return bind(dataType.compare,this);return _isEqual},_getOnChangeForType:function(type){var dataType=this._dataTypes[type];if(dataType&&dataType.onChange)return bind(dataType.onChange,this);return noop},_validate:function(attrs,options){if(!options.validate||!this.validate)return true;attrs=assign({},this.attributes,attrs);var error=this.validationError=this.validate(attrs,options)||null;if(!error)return true;this.trigger("invalid",this,error,assign(options||{},{validationError:error}));return false},_createPropertyDefinition:function(name,desc,isSession){return createPropertyDefinition(this,name,desc,isSession)},_ensureValidType:function(type){
return includes(["string","number","boolean","array","object","date","state","any"].concat(Object.keys(this._dataTypes)),type)?type:undefined},getAttributes:function(options,raw){options=assign({session:false,props:false,derived:false},options||{});var res={};var val,def;for(var item in this._definition){def=this._definition[item];if(options.session&&def.session||options.props&&!def.session){val=raw?this._values[item]:this[item];if(raw&&val&&isFunction(val.serialize))val=val.serialize();if(typeof val==="undefined")val=result(def,"default");if(typeof val!=="undefined")res[item]=val}}if(options.derived){for(var derivedItem in this._derived)res[derivedItem]=this[derivedItem]}return res},_initDerived:function(){var self=this;forOwn(this._derived,function(value,name){var def=self._derived[name];def.deps=def.depList;var update=function(options){options=options||{};var newVal=def.fn.call(self);if(self._cache[name]!==newVal||!def.cache){if(def.cache){self._previousAttributes[name]=self._cache[name]}self._cache[name]=newVal;self.trigger("change:"+name,self,self._cache[name])}};def.deps.forEach(function(propString){self._keyTree.add(propString,update)})});this.on("all",function(eventName){if(changeRE.test(eventName)){self._keyTree.get(eventName.split(":")[1]).forEach(function(fn){fn()})}},this)},_getDerivedProperty:function(name,flushCache){if(this._derived[name].cache){if(flushCache||!this._cache.hasOwnProperty(name)){this._cache[name]=this._derived[name].fn.apply(this)}return this._cache[name]}else{return this._derived[name].fn.apply(this)}},_initCollections:function(){var coll;if(!this._collections)return;for(coll in this._collections){this._safeSet(coll,new this._collections[coll](null,{parent:this}))}},_initChildren:function(){var child;if(!this._children)return;for(child in this._children){this._safeSet(child,new this._children[child]({},{parent:this}));this.listenTo(this[child],"all",this._getCachedEventBubblingHandler(child))}},_getCachedEventBubblingHandler:function(propertyName){if(!this._eventBubblingHandlerCache[propertyName]){this._eventBubblingHandlerCache[propertyName]=bind(function(name,model,newValue){if(changeRE.test(name)){this.trigger("change:"+propertyName+"."+name.split(":")[1],model,newValue)}else if(name==="change"){this.trigger("change",this)}},this)}return this._eventBubblingHandlerCache[propertyName]},_verifyRequired:function(){var attrs=this.attributes;for(var def in this._definition){if(this._definition[def].required&&typeof attrs[def]==="undefined"){return false}}return true},_safeSet:function safeSet(property,value){if(property in this){throw new Error("Encountered namespace collision while setting instance property `"+property+"`")}this[property]=value;return this}});Object.defineProperties(Base.prototype,{attributes:{get:function(){return this.getAttributes({props:true,session:true})}},all:{get:function(){return this.getAttributes({session:true,props:true,derived:true})}},isState:{get:function(){return true},set:function(){}}});function createPropertyDefinition(object,name,desc,isSession){var def=object._definition[name]={};var type,descArray;if(isString(desc)){type=object._ensureValidType(desc);if(type)def.type=type}else{if(Array.isArray(desc)){descArray=desc;desc={type:descArray[0],required:descArray[1],"default":descArray[2]}}type=object._ensureValidType(desc.type);if(type)def.type=type;if(desc.required)def.required=true;if(desc["default"]&&typeof desc["default"]==="object"){throw new TypeError("The default value for "+name+" cannot be an object/array, must be a value or a function which returns a value/object/array")}def["default"]=desc["default"];def.allowNull=desc.allowNull?desc.allowNull:false;if(desc.setOnce)def.setOnce=true;if(def.required&&def["default"]===undefined&&!def.setOnce)def["default"]=object._getDefaultForType(type);def.test=desc.test;def.values=desc.values}if(isSession)def.session=true;if(!type){type=isString(desc)?desc:desc.type;console.warn("Invalid data type of `"+type+"` for `"+name+"` property. Use one of the default types or define your own")}Object.defineProperty(object,name,{set:function(val){this.set(name,val)},get:function(){if(!this._values){throw Error('You may be trying to `extend` a state object with "'+name+'" which has been defined in `props` on the object being extended')}var value=this._values[name];var typeDef=this._dataTypes[def.type];if(typeof value!=="undefined"){if(typeDef&&typeDef.get){value=typeDef.get(value)}return value}var defaultValue=result(def,"default");this._values[name]=defaultValue;if(typeof defaultValue!=="undefined"){var onChange=this._getOnChangeForType(def.type);onChange(defaultValue,value,name)}return defaultValue}});return def}function createDerivedProperty(modelProto,name,definition){var def=modelProto._derived[name]={fn:isFunction(definition)?definition:definition.fn,cache:definition.cache!==false,depList:definition.deps||[]};def.depList.forEach(function(dep){modelProto._deps[dep]=union(modelProto._deps[dep]||[],[name])});Object.defineProperty(modelProto,name,{get:function(){return this._getDerivedProperty(name)},set:function(){throw new TypeError("`"+name+"` is a derived property, it can't be set directly.")}})}var dataTypes={string:{"default":function(){return""}},date:{set:function(newVal){var newType;if(newVal==null){newType=typeof null}else if(!isDate(newVal)){var err=null;var dateVal=new Date(newVal).valueOf();if(isNaN(dateVal)){dateVal=new Date(parseInt(newVal,10)).valueOf();if(isNaN(dateVal))err=true}newVal=dateVal;newType="date";if(err){newType=typeof newVal}}else{newType="date";newVal=newVal.valueOf()}return{val:newVal,type:newType}},get:function(val){if(val==null){return val}return new Date(val)},"default":function(){return new Date}},array:{set:function(newVal){return{val:newVal,type:Array.isArray(newVal)?"array":typeof newVal}},"default":function(){return[]}},object:{set:function(newVal){var newType=typeof newVal;if(newType!=="object"&&newVal===undefined){newVal=null;newType="object"}return{val:newVal,type:newType}},"default":function(){return{}}},state:{set:function(newVal){var isInstance=newVal instanceof Base||newVal&&newVal.isState;if(isInstance){return{val:newVal,type:"state"}}else{return{val:newVal,type:typeof newVal}}},compare:function(currentVal,newVal){return currentVal===newVal},onChange:function(newVal,previousVal,attributeName){if(previousVal){this.stopListening(previousVal,"all",this._getCachedEventBubblingHandler(attributeName))}if(newVal!=null){this.listenTo(newVal,"all",this._getCachedEventBubblingHandler(attributeName))}}}};function extend(protoProps){var parent=this;var child;if(protoProps&&protoProps.hasOwnProperty("constructor")){child=protoProps.constructor}else{child=function(){return parent.apply(this,arguments)}}assign(child,parent);var Surrogate=function(){this.constructor=child};Surrogate.prototype=parent.prototype;child.prototype=new Surrogate;child.prototype._derived=assign({},parent.prototype._derived);child.prototype._deps=assign({},parent.prototype._deps);child.prototype._definition=assign({},parent.prototype._definition);child.prototype._collections=assign({},parent.prototype._collections);child.prototype._children=assign({},parent.prototype._children);child.prototype._dataTypes=assign({},parent.prototype._dataTypes||dataTypes);if(protoProps){var omitFromExtend=["dataTypes","props","session","derived","collections","children"];for(var i=0;i<arguments.length;i++){var def=arguments[i];if(def.dataTypes){forOwn(def.dataTypes,function(def,name){child.prototype._dataTypes[name]=def})}if(def.props){forOwn(def.props,function(def,name){createPropertyDefinition(child.prototype,name,def)})}if(def.session){forOwn(def.session,function(def,name){createPropertyDefinition(child.prototype,name,def,true)})}if(def.derived){forOwn(def.derived,function(def,name){createDerivedProperty(child.prototype,name,def)})}if(def.collections){forOwn(def.collections,function(constructor,name){child.prototype._collections[name]=constructor})}if(def.children){forOwn(def.children,function(constructor,name){child.prototype._children[name]=constructor})}assign(child.prototype,omit(def,omitFromExtend))}}child.__super__=parent.prototype;return child}Base.extend=extend;module.exports=Base},{"ampersand-events":1,"array-next":3,"key-tree-store":4,"lodash/assign":148,"lodash/bind":150,"lodash/escape":152,"lodash/forOwn":154,"lodash/has":156,"lodash/includes":159,"lodash/isDate":165,"lodash/isEqual":167,"lodash/isFunction":168,"lodash/isObject":170,"lodash/isString":172,"lodash/omit":180,"lodash/result":184,"lodash/union":191,"lodash/uniqueId":192}]},{},[]);var AmpersandState=require("ampersand-state");var Person=AmpersandState.extend({props:{firstName:"string",lastName:"string"},session:{signedIn:["boolean",true,false]},derived:{fullName:{deps:["firstName","lastName"],fn:function(){return this.firstName+" "+this.lastName}}}});var pers=new Person({firstName:"Sergiu",lastName:"Neamt"});console.log(pers.serialize(["attribute"]))},0);
{
"name": "requirebin-sketch",
"version": "1.0.0",
"dependencies": {
"ampersand-state": "5.0.2"
}
}
<!-- contents of this file will be placed inside the <body> -->
<!-- contents of this file will be placed inside the <head> -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment