Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alt

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alt - npm Package Compare versions

Comparing version 0.17.5 to 0.17.6

7

CHANGELOG.md
# Changelog
## 0.17.6
### Added
* Can dispatch FSA actions directly through alt.dispatch. [commit](https://github.com/goatslacker/alt/commit/243828c)
## 0.17.5

@@ -4,0 +11,0 @@

4

dist/alt-with-addons.min.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react/addons")):"function"==typeof define&&define.amd?define(["react","react/addons"],e):"object"==typeof exports?exports.Alt=e(require("react"),require("react/addons")):t.Alt=e(t.react,t["react/addons"])}(this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(20)},function(t,e){"use strict";function n(t){var e=t.constructor;return!!t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&s(e)&&(e instanceof e||"AltStore"===t.type)}function r(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}function i(t,e){e.forEach(function(e){Object.keys(Object(e)).forEach(function(n){t(n,e[n])})})}function o(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return i(function(e,n){return t[e]=n},n),t}Object.defineProperty(e,"__esModule",{value:!0}),e.isPojo=n,e.isPromise=r,e.eachObject=i,e.assign=o;var s=function(t){return"function"==typeof t};e.isFunction=s},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e){var n=e?v:y,r=e?t.prototype:t;return Object.getOwnPropertyNames(r).reduce(function(t,e){return-1!==n.indexOf(e)?t:(t[e]=r[e],t)},{})}function o(t){"undefined"!=typeof console&&console.warn(new ReferenceError(t))}function s(t,e){for(var n=0,r=e;Object.hasOwnProperty.call(t,r);)r=e+String(++n);return r}function a(t){return t.replace(/[a-z]([A-Z])/g,function(t){return t[0]+"_"+t[1].toLowerCase()}).toUpperCase()}function c(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];this.dispatch(n.length?[t].concat(n):t)}function u(t,e,n,r){return{type:e,payload:n,meta:p({dispatchId:t},r),id:t,action:e,data:n,details:r}}function f(t,e,n,r){var i=e.dispatch(n);if(void 0===i)return null;var o=e.id,s=o,a=o,c={id:o,namespace:s,name:a},f=function(t){return r.dispatch(o,t,c)};return d.isFunction(i)?i(f,r):r.dispatcher.dispatch(u(t,o,i,c))}function l(){}Object.defineProperty(e,"__esModule",{value:!0});var p=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.getInternalMethods=i,e.warn=o,e.uid=s,e.formatAsConstant=a,e.dispatchIdentity=c,e.fsa=u,e.dispatch=f;var h=n(1),d=r(h),y=Object.getOwnPropertyNames(l),v=Object.getOwnPropertyNames(l.prototype)},function(t,e){"use strict";function n(){var t=[],e=function(e){var n=t.indexOf(e);n>=0&&t.splice(n,1)},n=function(n){t.push(n);var r=function(){return e(n)};return{dispose:r}},r=function(e){t.forEach(function(t){return t(e)})};return{subscribe:n,push:r,unsubscribe:e}}t.exports=n},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n,r,i){var o=f.uid(t._actionsRegistry,e+"."+n);t._actionsRegistry[o]=1;var s={id:o,namespace:e,name:n},a=new l(t,o,r,i,s),u=function(e){return t.dispatch(o,e,s)},p=function(){a.dispatched=!1;var e=a._dispatch.apply(a,arguments);return a.dispatched||void 0===e||c.isPromise(e)||(c.isFunction(e)?e(u,t):u(e)),e};p.defer=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];setTimeout(function(){a._dispatch.apply(null,e)})},p.id=o,p.data=s;var h=t.actions[e],d=f.uid(h,n);return h[d]=p,p}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e["default"]=o;var a=n(1),c=r(a),u=n(2),f=r(u),l=function(){function t(e,n,r,o,s){i(this,t),this.id=n,this._dispatch=r.bind(this),this.actions=o,this.actionDetails=s,this.alt=e}return s(t,[{key:"dispatch",value:function(t){this.dispatched=!0,this.alt.dispatch(this.id,t,this.actionDetails)}}]),t}();t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var c=Function.prototype.bind,u=function(t,e,n){for(var r=!0;r;){var i=t,o=e,s=n;a=u=c=void 0,r=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var c=a.get;return void 0===c?void 0:c.call(s)}var u=Object.getPrototypeOf(i);if(null===u)return void 0;t=u,e=o,n=s,r=!0}},f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=n(10),p=n(9),h=i(p),d=n(1),y=i(d),v=n(8),g=i(v),b=n(2),m=i(b),_=n(4),w=r(_),O=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];a(this,t),this.config=e,this.serialize=e.serialize||JSON.stringify,this.deserialize=e.deserialize||JSON.parse,this.dispatcher=e.dispatcher||new l.Dispatcher,this.batchingFunction=e.batchingFunction||function(t){return t()},this.actions={global:{}},this.stores={},this.storeTransforms=e.storeTransforms||[],this.trapAsync=!1,this._actionsRegistry={},this._initSnapshot={},this._lastSnapshot={}}return f(t,[{key:"dispatch",value:function(t,e,n){var r=this;this.batchingFunction(function(){var i=Math.random().toString(18).substr(2,16);return t.id&&t.dispatch?m.dispatch(i,t,e,r):r.dispatcher.dispatch(m.fsa(i,t,e,n))})}},{key:"createUnsavedStore",value:function(t){var e=t.displayName||"";g.createStoreConfig(this.config,t);for(var n=g.transformStore(this.storeTransforms,t),r=arguments.length,i=Array(r>1?r-1:0),o=1;r>o;o++)i[o-1]=arguments[o];return y.isFunction(n)?g.createStoreFromClass.apply(g,[this,n,e].concat(i)):g.createStoreFromObject(this,n,e)}},{key:"createStore",value:function(t,e){var n=e||t.displayName||t.name||"";g.createStoreConfig(this.config,t);var r=g.transformStore(this.storeTransforms,t);(this.stores[n]||!n)&&(this.stores[n]?m.warn("A store named "+n+" already exists, double check your store names or pass in your own custom identifier for each store"):m.warn("Store name was not specified"),n=m.uid(this.stores,n));for(var i=arguments.length,o=Array(i>2?i-2:0),s=2;i>s;s++)o[s-2]=arguments[s];var a=y.isFunction(r)?g.createStoreFromClass.apply(g,[this,r,n].concat(o)):g.createStoreFromObject(this,r,n);return this.stores[n]=a,h.saveInitialSnapshot(this,n),a}},{key:"generateActions",value:function(){for(var t={name:"global"},e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return this.createActions(n.reduce(function(t,e){return t[e]=m.dispatchIdentity,t},t))}},{key:"createAction",value:function(t,e,n){return w["default"](this,"global",t,e,n)}},{key:"createActions",value:function(t){var e=arguments,n=this,r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i={},l=m.uid(this._actionsRegistry,t.displayName||t.name||"Unknown");if(y.isFunction(t)){var p,h,d;!function(){y.assign(i,m.getInternalMethods(t,!0));var n=function(t){function e(){a(this,e);for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];u(Object.getPrototypeOf(e.prototype),"constructor",this).apply(this,n)}return s(e,t),f(e,[{key:"generateActions",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];e.forEach(function(t){i[t]=m.dispatchIdentity})}}]),e}(t);for(p=e.length,h=Array(p>2?p-2:0),d=2;p>d;d++)h[d-2]=e[d];y.assign(i,new(c.apply(n,[null].concat(o(h)))))}()}else y.assign(i,t);return this.actions[l]=this.actions[l]||{},y.eachObject(function(t,e){if(y.isFunction(e)){r[t]=w["default"](n,l,t,e,r);var i=m.formatAsConstant(t);r[i]=r[t].id}},[i]),r}},{key:"takeSnapshot",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=h.snapshot(this,e);return y.assign(this._lastSnapshot,r),this.serialize(r)}},{key:"rollback",value:function(){h.setAppState(this,this.serialize(this._lastSnapshot),function(t){t.lifecycle("rollback"),t.emitChange()})}},{key:"recycle",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=e.length?h.filterSnapshots(this,this._initSnapshot,e):this._initSnapshot;h.setAppState(this,this.serialize(r),function(t){t.lifecycle("init"),t.emitChange()})}},{key:"flush",value:function(){var t=this.serialize(h.snapshot(this));return this.recycle(),t}},{key:"bootstrap",value:function(t){h.setAppState(this,t,function(t,e){t.lifecycle("bootstrap",e),t.emitChange()})}},{key:"prepare",value:function(t,e){var n={};if(!t.displayName)throw new ReferenceError("Store provided does not have a name");return n[t.displayName]=e,this.serialize(n)}},{key:"addActions",value:function(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];this.actions[t]=Array.isArray(e)?this.generateActions.apply(this,e):this.createActions.apply(this,[e].concat(r))}},{key:"addStore",value:function(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];this.createStore.apply(this,[e,t].concat(r))}},{key:"getActions",value:function(t){return this.actions[t]}},{key:"getStore",value:function(t){return this.stores[t]}}],[{key:"debug",value:function(t,e){var n="alt.js.org";return"undefined"!=typeof window&&(window[n]=window[n]||[],window[n].push({name:t,alt:e})),e}}]),t}();e["default"]=O,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(1),c=i(a),u=n(3),f=r(u),l=function(){function t(e,n,r,i){var s=this;o(this,t);var a=n.lifecycleEvents;this.transmitter=f["default"](),this.lifecycle=function(t,e){a[t]&&a[t].push(e)},this.state=r,this.alt=e,this.preventDefault=!1,this.displayName=n.displayName,this.boundListeners=n.boundListeners,this.StoreModel=i,this.reduce=n.reduce||function(t){return t};var u=n.output||function(t){return t};this.emitChange=function(){return s.transmitter.push(u(s.state))};var l=function(t,e){try{return t()}catch(r){if(n.handlesOwnErrors)return s.lifecycle("error",{error:r,payload:e,state:s.state}),!1;throw r}};c.assign(this,n.publicMethods),this.dispatchToken=e.dispatcher.register(function(t){s.preventDefault=!1,s.lifecycle("beforeEach",{payload:t,state:s.state});var e=n.actionListeners[t.action];if(e||n.otherwise){var r=void 0;r=e?l(function(){return e.filter(Boolean).every(function(e){return e.call(n,t.data,t.action)!==!1})},t):l(function(){return n.otherwise(t.data,t.action)},t),r===!1||s.preventDefault||s.emitChange()}n.reduce&&(l(function(){var e=n.reduce(s.state,t);void 0!==e&&(s.state=e)},t),s.preventDefault||s.emitChange()),s.lifecycle("afterEach",{payload:t,state:s.state})}),this.lifecycle("init")}return s(t,[{key:"listen",value:function(t){var e=this;if(!c.isFunction(t))throw new TypeError("listen expects a function");return this.transmitter.subscribe(t),function(){return e.unlisten(t)}}},{key:"unlisten",value:function(t){this.lifecycle("unlisten"),this.transmitter.unsubscribe(t)}},{key:"getState",value:function(){return this.StoreModel.config.getState.call(this,this.state)}}]),t}();e["default"]=l,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=i(o),a=n(1),c=r(a),u={waitFor:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(!e.length)throw new ReferenceError("Dispatch tokens not provided");var r=e;1===e.length&&(r=Array.isArray(e[0])?e[0]:e);var i=r.map(function(t){return t.dispatchToken||t});this.dispatcher.waitFor(i)},exportAsync:function(t){this.registerAsync(t)},registerAsync:function(t){var e=this,n=0,r=c.isFunction(t)?t(this.alt):t,i=Object.keys(r).reduce(function(t,i){var o=r[i],s=c.isFunction(o)?o(e):o,a=["success","error","loading"];return a.forEach(function(t){if(s[t]&&!s[t].id)throw new Error(t+" handler must be an action function")}),t[i]=function(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];var o=e.getInstance().getState(),a=s.local&&s.local.apply(s,[o].concat(r)),c=s.shouldFetch?s.shouldFetch.apply(s,[o].concat(r)):null==a,u=s.interceptResponse||function(t){return t},f=function(t,i){return function(o){var s=function(){if(n-=1,t(u(o,t,r)),i)throw o};return e.alt.trapAsync?function(){return s()}:s()}};return c?(n+=1,s.loading&&s.loading(u(null,s.loading,r)),s.remote.apply(s,[o].concat(r)).then(f(s.success),f(s.error,1))):(e.emitChange(),a)},t},{});this.exportPublicMethods(i),this.exportPublicMethods({isLoading:function(){return n>0}})},exportPublicMethods:function(t){var e=this;c.eachObject(function(t,n){if(!c.isFunction(n))throw new TypeError("exportPublicMethods expects a function");e.publicMethods[t]=n},[t])},emitChange:function(){this.getInstance().emitChange()},on:function(t,e){"error"===t&&(this.handlesOwnErrors=!0);var n=this.lifecycleEvents[t]||s["default"]();return this.lifecycleEvents[t]=n,n.subscribe(e.bind(this))},bindAction:function(t,e){if(!t)throw new ReferenceError("Invalid action reference passed in");if(!c.isFunction(e))throw new TypeError("bindAction expects a function");if(e.length>1)throw new TypeError("Action handler in store "+this.displayName+" for "+((t.id||t).toString()+" was defined with ")+"two parameters. Only a single parameter is passed through the dispatcher, did you mean to pass in an Object instead?");var n=t.id?t.id:t;this.actionListeners[n]=this.actionListeners[n]||[],this.actionListeners[n].push(e.bind(this)),this.boundListeners.push(n)},bindActions:function(t){var e=this;c.eachObject(function(t,n){var r=/./,i=t.replace(r,function(t){return"on"+t[0].toUpperCase()});if(e[t]&&e[i])throw new ReferenceError("You have multiple action handlers bound to an action: "+(t+" and "+i));var o=e[t]||e[i];o&&e.bindAction(n,o)},[t])},bindListeners:function(t){var e=this;c.eachObject(function(t,n){var r=e[t];if(!r)throw new ReferenceError(t+" defined but does not exist in "+e.displayName);Array.isArray(n)?n.forEach(function(t){e.bindAction(t,r)}):e.bindAction(n,r)},[t])}};e["default"]=u,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e,n){if(n){var r=e.StoreModel.config,i=b.isFunction(n)?n(e.state):n;e.state=r.setState.call(t,e.state,i),t.alt.dispatcher.isDispatching()||t.emitChange()}}function c(t,e,n,r){return b.assign(t,O["default"],{displayName:n,alt:e,dispatcher:e.dispatcher,preventDefault:function(){this.getInstance().preventDefault=!0},boundListeners:[],lifecycleEvents:{},actionListeners:{},publicMethods:{},handlesOwnErrors:!1},r)}function u(t,e){e.config=b.assign({getState:function(t){return Array.isArray(t)?t.slice():b.isPojo(t)?b.assign({},t):t},setState:function(t,e){return b.isPojo(e)?b.assign(t,e):e}},t,e.config)}function f(t,e){return t.reduce(function(t,e){return e(t)},e)}function l(t,e,n){var r=void 0,i=c({},t,n,b.assign({getInstance:function(){return r},setState:function(t){a(this,r,t)}},e));return i.bindListeners&&O["default"].bindListeners.call(i,i.bindListeners),i.observe&&O["default"].bindListeners.call(i,i.observe(t)),i.lifecycle&&b.eachObject(function(t,e){O["default"].on.call(i,t,e)},[i.lifecycle]),r=b.assign(new _["default"](t,i,void 0!==i.state?i.state:{},e),i.publicMethods,{displayName:n})}function p(t,e,n){var r=void 0,i=e.config,u=function(t){function e(){o(this,e);for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];d(Object.getPrototypeOf(e.prototype),"constructor",this).apply(this,n)}return s(e,t),e}(e);c(u.prototype,t,n,{type:"AltStore",getInstance:function(){return r},setState:function(t){a(this,r,t)}});for(var f=arguments.length,l=Array(f>3?f-3:0),p=3;f>p;p++)l[p-3]=arguments[p];var y=new(h.apply(u,[null].concat(l)));return i.bindListeners&&y.bindListeners(i.bindListeners),i.datasource&&y.registerAsync(i.datasource),r=b.assign(new _["default"](t,y,void 0!==y.state?y.state:y,e),v.getInternalMethods(e),i.publicMethods,{displayName:n})}Object.defineProperty(e,"__esModule",{value:!0});var h=Function.prototype.bind,d=function(t,e,n){for(var r=!0;r;){var i=t,o=e,s=n;a=u=c=void 0,r=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var c=a.get;return void 0===c?void 0:c.call(s)}var u=Object.getPrototypeOf(i);if(null===u)return void 0;t=u,e=o,n=s,r=!0}};e.createStoreConfig=u,e.transformStore=f,e.createStoreFromObject=l,e.createStoreFromClass=p;var y=n(2),v=i(y),g=n(1),b=i(g),m=n(6),_=r(m),w=n(7),O=r(w)},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e,n){var r=t.deserialize(e);u.eachObject(function(e,i){var o=t.stores[e];o&&!function(){var t=o.StoreModel.config,s=o.state;t.onDeserialize&&(r[e]=t.onDeserialize(i)||i),u.isPojo(s)?(u.eachObject(function(t){return delete s[t]},[s]),u.assign(s,r[e])):o.state=r[e],n(o,o.state)}()},[r])}function o(t){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e.length?e:Object.keys(t.stores);return n.reduce(function(e,n){var r=n.displayName||n,i=t.stores[r],o=i.StoreModel.config;i.lifecycle("snapshot");var s=o.onSerialize&&o.onSerialize(i.state);return e[r]=s?s:i.getState(),e},{})}function s(t,e){var n=t.deserialize(t.serialize(t.stores[e].state));t._initSnapshot[e]=n,t._lastSnapshot[e]=n}function a(t,e,n){return n.reduce(function(t,n){var r=n.displayName||n;if(!e[r])throw new ReferenceError(r+" is not a valid store");return t[r]=e[r],t},{})}Object.defineProperty(e,"__esModule",{value:!0}),e.setAppState=i,e.snapshot=o,e.saveInitialSnapshot=s,e.filterSnapshots=a;var c=n(1),u=r(c)},function(t,e,n){t.exports.Dispatcher=n(11)},function(t,e,n){"use strict";function r(){this.$Dispatcher_callbacks={},this.$Dispatcher_isPending={},this.$Dispatcher_isHandled={},this.$Dispatcher_isDispatching=!1,this.$Dispatcher_pendingPayload=null}var i=n(12),o=1,s="ID_";r.prototype.register=function(t){var e=s+o++;return this.$Dispatcher_callbacks[e]=t,e},r.prototype.unregister=function(t){i(this.$Dispatcher_callbacks[t],"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t),delete this.$Dispatcher_callbacks[t]},r.prototype.waitFor=function(t){i(this.$Dispatcher_isDispatching,"Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];this.$Dispatcher_isPending[n]?i(this.$Dispatcher_isHandled[n],"Dispatcher.waitFor(...): Circular dependency detected while waiting for `%s`.",n):(i(this.$Dispatcher_callbacks[n],"Dispatcher.waitFor(...): `%s` does not map to a registered callback.",n),this.$Dispatcher_invokeCallback(n))}},r.prototype.dispatch=function(t){i(!this.$Dispatcher_isDispatching,"Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."),this.$Dispatcher_startDispatching(t);try{for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]||this.$Dispatcher_invokeCallback(e)}finally{this.$Dispatcher_stopDispatching()}},r.prototype.isDispatching=function(){return this.$Dispatcher_isDispatching},r.prototype.$Dispatcher_invokeCallback=function(t){this.$Dispatcher_isPending[t]=!0,this.$Dispatcher_callbacks[t](this.$Dispatcher_pendingPayload),this.$Dispatcher_isHandled[t]=!0},r.prototype.$Dispatcher_startDispatching=function(t){for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]=!1,this.$Dispatcher_isHandled[e]=!1;this.$Dispatcher_pendingPayload=t,this.$Dispatcher_isDispatching=!0},r.prototype.$Dispatcher_stopDispatching=function(){this.$Dispatcher_pendingPayload=null,this.$Dispatcher_isDispatching=!1},t.exports=r},function(t,e){"use strict";var n=function(t,e,n,r,i,o,s,a){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,a],f=0;c=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return u[f++]}))}throw c.framesToPop=1,c}};t.exports=n},function(t,e){"use strict";function n(){var t=this;this.dispatcher.register(function(e){var n=Object.keys(t.alt.stores).reduce(function(e,n){return e.push(t.alt.stores[n].dispatchToken),e},[]);t.waitFor(n),t.setState({payload:e}),t.emitChange()})}function r(t){return t.FinalStore?t.FinalStore:t.FinalStore=t.createUnsavedStore(n)}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=r,t.exports=e["default"]},function(t,e){"use strict";function n(t){var e=t.constructor;return!!t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&s(e)&&(e instanceof e||"AltStore"===t.type)}function r(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}function i(t,e){e.forEach(function(e){Object.keys(Object(e)).forEach(function(n){t(n,e[n])})})}function o(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return i(function(e,n){return t[e]=n},n),t}Object.defineProperty(e,"__esModule",{value:!0}),e.isPojo=n,e.isPromise=r,e.eachObject=i,e.assign=o;var s=function(t){return"function"==typeof t};e.isFunction=s},function(e,n){e.exports=t},function(t,e,n){"use strict";t.exports=n(17)},function(t,e,n){"use strict";var r=n(28),i=n(18),o=n(14).assign,s=r.createClass(o({displayName:"AltContainer",render:function(){return this.altRender("div")}},i(r)));t.exports=s},function(t,e,n){"use strict";function r(t){return t}function i(t,e){return"function"==typeof t?t(e).value:t.getState()}function o(t,e){return"function"==typeof t?t(e):t}function s(t){var e=t.addons.cloneWithProps;return{contextTypes:{flux:t.PropTypes.object},childContextTypes:{flux:t.PropTypes.object},getChildContext:function(){var t=this.props.flux||this.context.flux;return t?{flux:t}:{}},getInitialState:function(){if(this.props.stores&&this.props.store)throw new ReferenceError("Cannot define both store and stores");return this.reduceState(this.props)},componentWillReceiveProps:function(t){this.destroySubscriptions(),this.setState(this.reduceState(t)),this.registerStores(t)},componentDidMount:function(){this.registerStores(this.props),this.props.onMount&&this.props.onMount(this.props,this.context)},componentWillUnmount:function(){this.destroySubscriptions()},registerStores:function(t){var e=t.stores;a.create(this),t.store?this.addSubscription(t.store):t.stores&&(Array.isArray(e)?e.forEach(function(t){this.addSubscription(t)},this):Object.keys(e).forEach(function(t){this.addSubscription(e[t])},this))},destroySubscriptions:function(){a.destroy(this)},getStateFromStores:function(t){var e=t.stores;return t.store?i(t.store,t):t.stores?Array.isArray(e)?void 0:Object.keys(e).reduce(function(n,r){return n[r]=i(e[r],t),n},{}):{}},getStateFromActions:function(t){return t.actions?o(t.actions,t):{}},getInjected:function(t){return t.inject?Object.keys(t.inject).reduce(function(e,n){return e[n]=o(t.inject[n],t),e},{}):{}},reduceState:function(t){return c({},this.getStateFromStores(t),this.getStateFromActions(t),this.getInjected(t))},addSubscription:function(t){"function"==typeof t?a.add(this,t(this.props).store,this.altSetState):a.add(this,t,this.altSetState)},altSetState:function(){this.setState(this.reduceState(this.props))},getProps:function(){var t=this.props.flux||this.context.flux,e="function"==typeof this.props.transform?this.props.transform:r;return e(c(t?{flux:t}:{},this.state))},shouldComponentUpdate:function(){return this.props.shouldComponentUpdate?this.props.shouldComponentUpdate(this.getProps()):!0},altRender:function(n){var r=this.props.children;return"function"==typeof this.props.render?this.props.render(this.getProps()):this.props.component?t.createElement(this.props.component,this.getProps()):Array.isArray(r)?t.createElement(n,null,r.map(function(t,n){return e(t,c({key:n},this.getProps()))},this)):r?e(r,this.getProps()):t.createElement(n,this.getProps())}}}var a=n(19),c=n(14).assign;t.exports=s},function(t,e){"use strict";var n={create:function(t){t._AltMixinRegistry=t._AltMixinRegistry||[]},add:function(t,e,n){t._AltMixinRegistry.push(e.listen(n))},destroy:function(t){t._AltMixinRegistry.forEach(function(t){t()}),t._AltMixinRegistry=[]},listeners:function(t){return t._AltMixinRegistry}};t.exports=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(5),o=r(i),s=n(21),a=r(s),c=n(22),u=r(c),f=n(23),l=r(f),p=n(24),h=r(p),d=n(26),y=r(d),v=n(25),g=r(v),b=n(13),m=r(b),_=n(27),w=r(_),O=n(16),S=r(O);o["default"].addons={ActionListeners:a["default"],AltContainer:S["default"],AltManager:u["default"],DispatcherRecorder:l["default"],atomic:h["default"],chromeDebug:g["default"],connectToStores:y["default"],makeFinalStore:m["default"],withAltContext:w["default"]},e["default"]=o["default"],t.exports=e["default"]},function(t,e){"use strict";function n(t){this.dispatcher=t.dispatcher,this.listeners={}}Object.defineProperty(e,"__esModule",{value:!0}),n.prototype.addActionListener=function(t,e){var n=this.dispatcher.register(function(n){t===n.action&&e(n.data,n.details)});return this.listeners[n]=!0,n},n.prototype.removeActionListener=function(t){delete this.listeners[t],this.dispatcher.unregister(t)},n.prototype.removeAllActionListeners=function(){Object.keys(this.listeners).forEach(this.removeActionListener.bind(this)),this.listeners={}},e["default"]=n,t.exports=e["default"]},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(e){n(this,t),this.Alt=e,this.alts={}}return r(t,[{key:"create",value:function(t){if(this.get(t))throw new ReferenceError("Alt key "+t+" already exists");if("string"!=typeof t)throw new TypeError("altKey must be a string");return this.alts[t]=new this.Alt,this.alts[t]}},{key:"get",value:function(t){return this.alts[t]}},{key:"all",value:function(){return this.alts}},{key:"findWhere",value:function(t){var e={};for(var n in this.alts)null!==t.exec(n)&&(e[n]=this.alts[n]);return e}},{key:"delete",value:function(t){return this.get(t)?(delete this.alts[t],!0):!1}},{key:"getOrCreate",value:function(t){var e=this.get(t);return e?e:this.create(t)}}]),t}();e["default"]=i,t.exports=e["default"]},function(t,e){"use strict";function n(t){var e=arguments.length<=1||void 0===arguments[1]?1/0:arguments[1];this.alt=t,this.events=[],this.dispatchToken=null,this.maxEvents=e}Object.defineProperty(e,"__esModule",{value:!0}),n.prototype.record=function(){var t=this;return this.dispatchToken?!1:(this.dispatchToken=this.alt.dispatcher.register(function(e){t.events.length<t.maxEvents&&t.events.push(e)}),!0)},n.prototype.stop=function(){this.alt.dispatcher.unregister(this.dispatchToken),this.dispatchToken=null},n.prototype.clear=function(){this.events=[]},n.prototype.replay=function(t,e){var n=this.alt;void 0===t&&this.events.forEach(function(t){n.dispatch(t.action,t.data)});for(var r=function(e,r){return function(){setTimeout(function(){n.dispatch(e.action,e.data),r()},t)}},i=e||function(){},o=this.events.length-1;o>=0;){var s=this.events[o];i=r(s,i),o-=1}i()},n.prototype.serializeEvents=function(){var t=this.events.map(function(t){return{id:t.id,action:t.action,data:t.data||{}}});return JSON.stringify(t)},n.prototype.loadEvents=function(t){var e=JSON.parse(t);return this.events=e.map(function(t){return{action:t.action,data:t.data}}),e},e["default"]=n,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){var n=function(e){function n(){i(this,n),u(Object.getPrototypeOf(n.prototype),"constructor",this).call(this),this.on("error",function(){return t.rollback()})}return o(n,e),n}(e);return n.displayName=e.displayName||e.name,n}function a(t,e){return e.lifecycle=e.lifecycle||{},e.lifecycle.error=function(){t.rollback()},e}function c(t){var e=l["default"](t);return e.listen(function(){return t.takeSnapshot()}),function(e){return p.isFunction(e)?s(t,e):a(t,e)}}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t,e,n){for(var r=!0;r;){var i=t,o=e,s=n;a=u=c=void 0,r=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var c=a.get;return void 0===c?void 0:c.call(s)}var u=Object.getPrototypeOf(i);if(null===u)return void 0;t=u,e=o,n=s,r=!0}};e["default"]=c;var f=n(13),l=r(f),p=n(1);t.exports=e["default"]},function(t,e){"use strict";function n(t){return"undefined"!=typeof window&&(window["alt.js.org"]=t),t}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e=arguments.length<=1||void 0===arguments[1]?t:arguments[1];return function(){if(!a.isFunction(t.getStores))throw new Error("connectToStores() expects the wrapped component to have a static getStores() method");
if(!a.isFunction(t.getPropsFromStores))throw new Error("connectToStores() expects the wrapped component to have a static getPropsFromStores() method");var n=s["default"].createClass({displayName:"Stateful"+(e.displayName||e.name||"Container"),getInitialState:function(){return t.getPropsFromStores(this.props,this.context)},componentWillReceiveProps:function(e){this.setState(t.getPropsFromStores(e,this.context))},componentDidMount:function(){var e=this,n=t.getStores(this.props,this.context);this.storeListeners=n.map(function(t){return t.listen(e.onChange)}),t.componentDidConnect&&t.componentDidConnect(this.props,this.context)},componentWillUnmount:function(){this.storeListeners.forEach(function(t){return t()})},onChange:function(){this.setState(t.getPropsFromStores(this.props,this.context))},render:function(){return s["default"].createElement(e,a.assign({},this.props,this.state))}});return e.contextTypes&&(n.contextTypes=e.contextTypes),n}()}Object.defineProperty(e,"__esModule",{value:!0});var o=n(15),s=r(o),a=n(1);e["default"]=i,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return function(e){return s["default"].createClass({childContextTypes:{flux:s["default"].PropTypes.object},getChildContext:function(){return{flux:t}},render:function(){return s["default"].createElement(e,this.props)}})}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var o=n(15),s=r(o);t.exports=e["default"]},function(t,n){t.exports=e}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react/addons")):"function"==typeof define&&define.amd?define(["react","react/addons"],e):"object"==typeof exports?exports.Alt=e(require("react"),require("react/addons")):t.Alt=e(t.react,t["react/addons"])}(this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(20)},function(t,e){"use strict";function n(t){var e=t.constructor;return!!t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&s(e)&&(e instanceof e||"AltStore"===t.type)}function r(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}function i(t,e){e.forEach(function(e){Object.keys(Object(e)).forEach(function(n){t(n,e[n])})})}function o(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return i(function(e,n){return t[e]=n},n),t}Object.defineProperty(e,"__esModule",{value:!0}),e.isPojo=n,e.isPromise=r,e.eachObject=i,e.assign=o;var s=function(t){return"function"==typeof t};e.isFunction=s},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e){var n=e?v:y,r=e?t.prototype:t;return Object.getOwnPropertyNames(r).reduce(function(t,e){return-1!==n.indexOf(e)?t:(t[e]=r[e],t)},{})}function o(t){"undefined"!=typeof console&&console.warn(new ReferenceError(t))}function s(t,e){for(var n=0,r=e;Object.hasOwnProperty.call(t,r);)r=e+String(++n);return r}function a(t){return t.replace(/[a-z]([A-Z])/g,function(t){return t[0]+"_"+t[1].toLowerCase()}).toUpperCase()}function c(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];this.dispatch(n.length?[t].concat(n):t)}function u(t,e,n,r){return{type:e,payload:n,meta:p({dispatchId:t},r),id:t,action:e,data:n,details:r}}function f(t,e,n,r){var i=e.dispatch(n);if(void 0===i)return null;var o=e.id,s=o,a=o,c={id:o,namespace:s,name:a},f=function(t){return r.dispatch(o,t,c)};return d.isFunction(i)?i(f,r):r.dispatcher.dispatch(u(t,o,i,c))}function l(){}Object.defineProperty(e,"__esModule",{value:!0});var p=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.getInternalMethods=i,e.warn=o,e.uid=s,e.formatAsConstant=a,e.dispatchIdentity=c,e.fsa=u,e.dispatch=f;var h=n(1),d=r(h),y=Object.getOwnPropertyNames(l),v=Object.getOwnPropertyNames(l.prototype)},function(t,e){"use strict";function n(){var t=[],e=function(e){var n=t.indexOf(e);n>=0&&t.splice(n,1)},n=function(n){t.push(n);var r=function(){return e(n)};return{dispose:r}},r=function(e){t.forEach(function(t){return t(e)})};return{subscribe:n,push:r,unsubscribe:e}}t.exports=n},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n,r,i){var o=f.uid(t._actionsRegistry,e+"."+n);t._actionsRegistry[o]=1;var s={id:o,namespace:e,name:n},a=new l(t,o,r,i,s),u=function(e){return t.dispatch(o,e,s)},p=function(){a.dispatched=!1;var e=a._dispatch.apply(a,arguments);return a.dispatched||void 0===e||c.isPromise(e)||(c.isFunction(e)?e(u,t):u(e)),e};p.defer=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];setTimeout(function(){a._dispatch.apply(null,e)})},p.id=o,p.data=s;var h=t.actions[e],d=f.uid(h,n);return h[d]=p,p}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e["default"]=o;var a=n(1),c=r(a),u=n(2),f=r(u),l=function(){function t(e,n,r,o,s){i(this,t),this.id=n,this._dispatch=r.bind(this),this.actions=o,this.actionDetails=s,this.alt=e}return s(t,[{key:"dispatch",value:function(t){this.dispatched=!0,this.alt.dispatch(this.id,t,this.actionDetails)}}]),t}();t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var c=Function.prototype.bind,u=function(t,e,n){for(var r=!0;r;){var i=t,o=e,s=n;a=u=c=void 0,r=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var c=a.get;return void 0===c?void 0:c.call(s)}var u=Object.getPrototypeOf(i);if(null===u)return void 0;t=u,e=o,n=s,r=!0}},f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=n(10),p=n(9),h=i(p),d=n(1),y=i(d),v=n(8),g=i(v),m=n(2),b=i(m),_=n(4),w=r(_),O=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];a(this,t),this.config=e,this.serialize=e.serialize||JSON.stringify,this.deserialize=e.deserialize||JSON.parse,this.dispatcher=e.dispatcher||new l.Dispatcher,this.batchingFunction=e.batchingFunction||function(t){return t()},this.actions={global:{}},this.stores={},this.storeTransforms=e.storeTransforms||[],this.trapAsync=!1,this._actionsRegistry={},this._initSnapshot={},this._lastSnapshot={}}return f(t,[{key:"dispatch",value:function(t,e,n){var r=this;this.batchingFunction(function(){var i=Math.random().toString(18).substr(2,16);if(t.type&&t.payload){var o={id:t.type,namespace:t.type,name:t.type};return r.dispatcher.dispatch(b.fsa(i,t.type,t.payload,o))}return t.id&&t.dispatch?b.dispatch(i,t,e,r):r.dispatcher.dispatch(b.fsa(i,t,e,n))})}},{key:"createUnsavedStore",value:function(t){var e=t.displayName||"";g.createStoreConfig(this.config,t);for(var n=g.transformStore(this.storeTransforms,t),r=arguments.length,i=Array(r>1?r-1:0),o=1;r>o;o++)i[o-1]=arguments[o];return y.isFunction(n)?g.createStoreFromClass.apply(g,[this,n,e].concat(i)):g.createStoreFromObject(this,n,e)}},{key:"createStore",value:function(t,e){var n=e||t.displayName||t.name||"";g.createStoreConfig(this.config,t);var r=g.transformStore(this.storeTransforms,t);(this.stores[n]||!n)&&(this.stores[n]?b.warn("A store named "+n+" already exists, double check your store names or pass in your own custom identifier for each store"):b.warn("Store name was not specified"),n=b.uid(this.stores,n));for(var i=arguments.length,o=Array(i>2?i-2:0),s=2;i>s;s++)o[s-2]=arguments[s];var a=y.isFunction(r)?g.createStoreFromClass.apply(g,[this,r,n].concat(o)):g.createStoreFromObject(this,r,n);return this.stores[n]=a,h.saveInitialSnapshot(this,n),a}},{key:"generateActions",value:function(){for(var t={name:"global"},e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return this.createActions(n.reduce(function(t,e){return t[e]=b.dispatchIdentity,t},t))}},{key:"createAction",value:function(t,e,n){return w["default"](this,"global",t,e,n)}},{key:"createActions",value:function(t){var e=arguments,n=this,r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i={},l=b.uid(this._actionsRegistry,t.displayName||t.name||"Unknown");if(y.isFunction(t)){var p,h,d;!function(){y.assign(i,b.getInternalMethods(t,!0));var n=function(t){function e(){a(this,e);for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];u(Object.getPrototypeOf(e.prototype),"constructor",this).apply(this,n)}return s(e,t),f(e,[{key:"generateActions",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];e.forEach(function(t){i[t]=b.dispatchIdentity})}}]),e}(t);for(p=e.length,h=Array(p>2?p-2:0),d=2;p>d;d++)h[d-2]=e[d];y.assign(i,new(c.apply(n,[null].concat(o(h)))))}()}else y.assign(i,t);return this.actions[l]=this.actions[l]||{},y.eachObject(function(t,e){if(y.isFunction(e)){r[t]=w["default"](n,l,t,e,r);var i=b.formatAsConstant(t);r[i]=r[t].id}},[i]),r}},{key:"takeSnapshot",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=h.snapshot(this,e);return y.assign(this._lastSnapshot,r),this.serialize(r)}},{key:"rollback",value:function(){h.setAppState(this,this.serialize(this._lastSnapshot),function(t){t.lifecycle("rollback"),t.emitChange()})}},{key:"recycle",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=e.length?h.filterSnapshots(this,this._initSnapshot,e):this._initSnapshot;h.setAppState(this,this.serialize(r),function(t){t.lifecycle("init"),t.emitChange()})}},{key:"flush",value:function(){var t=this.serialize(h.snapshot(this));return this.recycle(),t}},{key:"bootstrap",value:function(t){h.setAppState(this,t,function(t,e){t.lifecycle("bootstrap",e),t.emitChange()})}},{key:"prepare",value:function(t,e){var n={};if(!t.displayName)throw new ReferenceError("Store provided does not have a name");return n[t.displayName]=e,this.serialize(n)}},{key:"addActions",value:function(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];this.actions[t]=Array.isArray(e)?this.generateActions.apply(this,e):this.createActions.apply(this,[e].concat(r))}},{key:"addStore",value:function(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];this.createStore.apply(this,[e,t].concat(r))}},{key:"getActions",value:function(t){return this.actions[t]}},{key:"getStore",value:function(t){return this.stores[t]}}],[{key:"debug",value:function(t,e){var n="alt.js.org";return"undefined"!=typeof window&&(window[n]=window[n]||[],window[n].push({name:t,alt:e})),e}}]),t}();e["default"]=O,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(1),c=i(a),u=n(3),f=r(u),l=function(){function t(e,n,r,i){var s=this;o(this,t);var a=n.lifecycleEvents;this.transmitter=f["default"](),this.lifecycle=function(t,e){a[t]&&a[t].push(e)},this.state=r,this.alt=e,this.preventDefault=!1,this.displayName=n.displayName,this.boundListeners=n.boundListeners,this.StoreModel=i,this.reduce=n.reduce||function(t){return t};var u=n.output||function(t){return t};this.emitChange=function(){return s.transmitter.push(u(s.state))};var l=function(t,e){try{return t()}catch(r){if(n.handlesOwnErrors)return s.lifecycle("error",{error:r,payload:e,state:s.state}),!1;throw r}};c.assign(this,n.publicMethods),this.dispatchToken=e.dispatcher.register(function(t){s.preventDefault=!1,s.lifecycle("beforeEach",{payload:t,state:s.state});var e=n.actionListeners[t.action];if(e||n.otherwise){var r=void 0;r=e?l(function(){return e.filter(Boolean).every(function(e){return e.call(n,t.data,t.action)!==!1})},t):l(function(){return n.otherwise(t.data,t.action)},t),r===!1||s.preventDefault||s.emitChange()}n.reduce&&(l(function(){var e=n.reduce(s.state,t);void 0!==e&&(s.state=e)},t),s.preventDefault||s.emitChange()),s.lifecycle("afterEach",{payload:t,state:s.state})}),this.lifecycle("init")}return s(t,[{key:"listen",value:function(t){var e=this;if(!c.isFunction(t))throw new TypeError("listen expects a function");return this.transmitter.subscribe(t),function(){return e.unlisten(t)}}},{key:"unlisten",value:function(t){this.lifecycle("unlisten"),this.transmitter.unsubscribe(t)}},{key:"getState",value:function(){return this.StoreModel.config.getState.call(this,this.state)}}]),t}();e["default"]=l,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=i(o),a=n(1),c=r(a),u={waitFor:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(!e.length)throw new ReferenceError("Dispatch tokens not provided");var r=e;1===e.length&&(r=Array.isArray(e[0])?e[0]:e);var i=r.map(function(t){return t.dispatchToken||t});this.dispatcher.waitFor(i)},exportAsync:function(t){this.registerAsync(t)},registerAsync:function(t){var e=this,n=0,r=c.isFunction(t)?t(this.alt):t,i=Object.keys(r).reduce(function(t,i){var o=r[i],s=c.isFunction(o)?o(e):o,a=["success","error","loading"];return a.forEach(function(t){if(s[t]&&!s[t].id)throw new Error(t+" handler must be an action function")}),t[i]=function(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];var o=e.getInstance().getState(),a=s.local&&s.local.apply(s,[o].concat(r)),c=s.shouldFetch?s.shouldFetch.apply(s,[o].concat(r)):null==a,u=s.interceptResponse||function(t){return t},f=function(t,i){return function(o){var s=function(){if(n-=1,t(u(o,t,r)),i)throw o};return e.alt.trapAsync?function(){return s()}:s()}};return c?(n+=1,s.loading&&s.loading(u(null,s.loading,r)),s.remote.apply(s,[o].concat(r)).then(f(s.success),f(s.error,1))):(e.emitChange(),a)},t},{});this.exportPublicMethods(i),this.exportPublicMethods({isLoading:function(){return n>0}})},exportPublicMethods:function(t){var e=this;c.eachObject(function(t,n){if(!c.isFunction(n))throw new TypeError("exportPublicMethods expects a function");e.publicMethods[t]=n},[t])},emitChange:function(){this.getInstance().emitChange()},on:function(t,e){"error"===t&&(this.handlesOwnErrors=!0);var n=this.lifecycleEvents[t]||s["default"]();return this.lifecycleEvents[t]=n,n.subscribe(e.bind(this))},bindAction:function(t,e){if(!t)throw new ReferenceError("Invalid action reference passed in");if(!c.isFunction(e))throw new TypeError("bindAction expects a function");if(e.length>1)throw new TypeError("Action handler in store "+this.displayName+" for "+((t.id||t).toString()+" was defined with ")+"two parameters. Only a single parameter is passed through the dispatcher, did you mean to pass in an Object instead?");var n=t.id?t.id:t;this.actionListeners[n]=this.actionListeners[n]||[],this.actionListeners[n].push(e.bind(this)),this.boundListeners.push(n)},bindActions:function(t){var e=this;c.eachObject(function(t,n){var r=/./,i=t.replace(r,function(t){return"on"+t[0].toUpperCase()});if(e[t]&&e[i])throw new ReferenceError("You have multiple action handlers bound to an action: "+(t+" and "+i));var o=e[t]||e[i];o&&e.bindAction(n,o)},[t])},bindListeners:function(t){var e=this;c.eachObject(function(t,n){var r=e[t];if(!r)throw new ReferenceError(t+" defined but does not exist in "+e.displayName);Array.isArray(n)?n.forEach(function(t){e.bindAction(t,r)}):e.bindAction(n,r)},[t])}};e["default"]=u,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e,n){if(n){var r=e.StoreModel.config,i=m.isFunction(n)?n(e.state):n;e.state=r.setState.call(t,e.state,i),t.alt.dispatcher.isDispatching()||t.emitChange()}}function c(t,e,n,r){return m.assign(t,O["default"],{displayName:n,alt:e,dispatcher:e.dispatcher,preventDefault:function(){this.getInstance().preventDefault=!0},boundListeners:[],lifecycleEvents:{},actionListeners:{},publicMethods:{},handlesOwnErrors:!1},r)}function u(t,e){e.config=m.assign({getState:function(t){return Array.isArray(t)?t.slice():m.isPojo(t)?m.assign({},t):t},setState:function(t,e){return m.isPojo(e)?m.assign(t,e):e}},t,e.config)}function f(t,e){return t.reduce(function(t,e){return e(t)},e)}function l(t,e,n){var r=void 0,i=c({},t,n,m.assign({getInstance:function(){return r},setState:function(t){a(this,r,t)}},e));return i.bindListeners&&O["default"].bindListeners.call(i,i.bindListeners),i.observe&&O["default"].bindListeners.call(i,i.observe(t)),i.lifecycle&&m.eachObject(function(t,e){O["default"].on.call(i,t,e)},[i.lifecycle]),r=m.assign(new _["default"](t,i,void 0!==i.state?i.state:{},e),i.publicMethods,{displayName:n})}function p(t,e,n){var r=void 0,i=e.config,u=function(t){function e(){o(this,e);for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];d(Object.getPrototypeOf(e.prototype),"constructor",this).apply(this,n)}return s(e,t),e}(e);c(u.prototype,t,n,{type:"AltStore",getInstance:function(){return r},setState:function(t){a(this,r,t)}});for(var f=arguments.length,l=Array(f>3?f-3:0),p=3;f>p;p++)l[p-3]=arguments[p];var y=new(h.apply(u,[null].concat(l)));return i.bindListeners&&y.bindListeners(i.bindListeners),i.datasource&&y.registerAsync(i.datasource),r=m.assign(new _["default"](t,y,void 0!==y.state?y.state:y,e),v.getInternalMethods(e),i.publicMethods,{displayName:n})}Object.defineProperty(e,"__esModule",{value:!0});var h=Function.prototype.bind,d=function(t,e,n){for(var r=!0;r;){var i=t,o=e,s=n;a=u=c=void 0,r=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var c=a.get;return void 0===c?void 0:c.call(s)}var u=Object.getPrototypeOf(i);if(null===u)return void 0;t=u,e=o,n=s,r=!0}};e.createStoreConfig=u,e.transformStore=f,e.createStoreFromObject=l,e.createStoreFromClass=p;var y=n(2),v=i(y),g=n(1),m=i(g),b=n(6),_=r(b),w=n(7),O=r(w)},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e,n){var r=t.deserialize(e);u.eachObject(function(e,i){var o=t.stores[e];o&&!function(){var t=o.StoreModel.config,s=o.state;t.onDeserialize&&(r[e]=t.onDeserialize(i)||i),u.isPojo(s)?(u.eachObject(function(t){return delete s[t]},[s]),u.assign(s,r[e])):o.state=r[e],n(o,o.state)}()},[r])}function o(t){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e.length?e:Object.keys(t.stores);return n.reduce(function(e,n){var r=n.displayName||n,i=t.stores[r],o=i.StoreModel.config;i.lifecycle("snapshot");var s=o.onSerialize&&o.onSerialize(i.state);return e[r]=s?s:i.getState(),e},{})}function s(t,e){var n=t.deserialize(t.serialize(t.stores[e].state));t._initSnapshot[e]=n,t._lastSnapshot[e]=n}function a(t,e,n){return n.reduce(function(t,n){var r=n.displayName||n;if(!e[r])throw new ReferenceError(r+" is not a valid store");return t[r]=e[r],t},{})}Object.defineProperty(e,"__esModule",{value:!0}),e.setAppState=i,e.snapshot=o,e.saveInitialSnapshot=s,e.filterSnapshots=a;var c=n(1),u=r(c)},function(t,e,n){t.exports.Dispatcher=n(11)},function(t,e,n){"use strict";function r(){this.$Dispatcher_callbacks={},this.$Dispatcher_isPending={},this.$Dispatcher_isHandled={},this.$Dispatcher_isDispatching=!1,this.$Dispatcher_pendingPayload=null}var i=n(12),o=1,s="ID_";r.prototype.register=function(t){var e=s+o++;return this.$Dispatcher_callbacks[e]=t,e},r.prototype.unregister=function(t){i(this.$Dispatcher_callbacks[t],"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t),delete this.$Dispatcher_callbacks[t]},r.prototype.waitFor=function(t){i(this.$Dispatcher_isDispatching,"Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];this.$Dispatcher_isPending[n]?i(this.$Dispatcher_isHandled[n],"Dispatcher.waitFor(...): Circular dependency detected while waiting for `%s`.",n):(i(this.$Dispatcher_callbacks[n],"Dispatcher.waitFor(...): `%s` does not map to a registered callback.",n),this.$Dispatcher_invokeCallback(n))}},r.prototype.dispatch=function(t){i(!this.$Dispatcher_isDispatching,"Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."),this.$Dispatcher_startDispatching(t);try{for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]||this.$Dispatcher_invokeCallback(e)}finally{this.$Dispatcher_stopDispatching()}},r.prototype.isDispatching=function(){return this.$Dispatcher_isDispatching},r.prototype.$Dispatcher_invokeCallback=function(t){this.$Dispatcher_isPending[t]=!0,this.$Dispatcher_callbacks[t](this.$Dispatcher_pendingPayload),this.$Dispatcher_isHandled[t]=!0},r.prototype.$Dispatcher_startDispatching=function(t){for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]=!1,this.$Dispatcher_isHandled[e]=!1;this.$Dispatcher_pendingPayload=t,this.$Dispatcher_isDispatching=!0},r.prototype.$Dispatcher_stopDispatching=function(){this.$Dispatcher_pendingPayload=null,this.$Dispatcher_isDispatching=!1},t.exports=r},function(t,e){"use strict";var n=function(t,e,n,r,i,o,s,a){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,a],f=0;c=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return u[f++]}))}throw c.framesToPop=1,c}};t.exports=n},function(t,e){"use strict";function n(){var t=this;this.dispatcher.register(function(e){var n=Object.keys(t.alt.stores).reduce(function(e,n){return e.push(t.alt.stores[n].dispatchToken),e},[]);t.waitFor(n),t.setState({payload:e}),t.emitChange()})}function r(t){return t.FinalStore?t.FinalStore:t.FinalStore=t.createUnsavedStore(n)}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=r,t.exports=e["default"]},function(t,e){"use strict";function n(t){var e=t.constructor;return!!t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&s(e)&&(e instanceof e||"AltStore"===t.type)}function r(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}function i(t,e){e.forEach(function(e){Object.keys(Object(e)).forEach(function(n){t(n,e[n])})})}function o(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return i(function(e,n){return t[e]=n},n),t}Object.defineProperty(e,"__esModule",{value:!0}),e.isPojo=n,e.isPromise=r,e.eachObject=i,e.assign=o;var s=function(t){return"function"==typeof t};e.isFunction=s},function(e,n){e.exports=t},function(t,e,n){"use strict";t.exports=n(17)},function(t,e,n){"use strict";var r=n(28),i=n(18),o=n(14).assign,s=r.createClass(o({displayName:"AltContainer",render:function(){return this.altRender("div")}},i(r)));t.exports=s},function(t,e,n){"use strict";function r(t){return t}function i(t,e){return"function"==typeof t?t(e).value:t.getState()}function o(t,e){return"function"==typeof t?t(e):t}function s(t){var e=t.addons.cloneWithProps;return{contextTypes:{flux:t.PropTypes.object},childContextTypes:{flux:t.PropTypes.object},getChildContext:function(){var t=this.props.flux||this.context.flux;return t?{flux:t}:{}},getInitialState:function(){if(this.props.stores&&this.props.store)throw new ReferenceError("Cannot define both store and stores");return this.reduceState(this.props)},componentWillReceiveProps:function(t){this.destroySubscriptions(),this.setState(this.reduceState(t)),this.registerStores(t)},componentDidMount:function(){this.registerStores(this.props),this.props.onMount&&this.props.onMount(this.props,this.context)},componentWillUnmount:function(){this.destroySubscriptions()},registerStores:function(t){var e=t.stores;a.create(this),t.store?this.addSubscription(t.store):t.stores&&(Array.isArray(e)?e.forEach(function(t){this.addSubscription(t)},this):Object.keys(e).forEach(function(t){this.addSubscription(e[t])},this))},destroySubscriptions:function(){a.destroy(this)},getStateFromStores:function(t){var e=t.stores;return t.store?i(t.store,t):t.stores?Array.isArray(e)?void 0:Object.keys(e).reduce(function(n,r){return n[r]=i(e[r],t),n},{}):{}},getStateFromActions:function(t){return t.actions?o(t.actions,t):{}},getInjected:function(t){return t.inject?Object.keys(t.inject).reduce(function(e,n){return e[n]=o(t.inject[n],t),e},{}):{}},reduceState:function(t){return c({},this.getStateFromStores(t),this.getStateFromActions(t),this.getInjected(t))},addSubscription:function(t){"function"==typeof t?a.add(this,t(this.props).store,this.altSetState):a.add(this,t,this.altSetState)},altSetState:function(){this.setState(this.reduceState(this.props))},getProps:function(){var t=this.props.flux||this.context.flux,e="function"==typeof this.props.transform?this.props.transform:r;return e(c(t?{flux:t}:{},this.state))},shouldComponentUpdate:function(){return this.props.shouldComponentUpdate?this.props.shouldComponentUpdate(this.getProps()):!0},altRender:function(n){var r=this.props.children;return"function"==typeof this.props.render?this.props.render(this.getProps()):this.props.component?t.createElement(this.props.component,this.getProps()):Array.isArray(r)?t.createElement(n,null,r.map(function(t,n){return e(t,c({key:n},this.getProps()))},this)):r?e(r,this.getProps()):t.createElement(n,this.getProps())}}}var a=n(19),c=n(14).assign;t.exports=s},function(t,e){"use strict";var n={create:function(t){t._AltMixinRegistry=t._AltMixinRegistry||[]},add:function(t,e,n){t._AltMixinRegistry.push(e.listen(n))},destroy:function(t){t._AltMixinRegistry.forEach(function(t){t()}),t._AltMixinRegistry=[]},listeners:function(t){return t._AltMixinRegistry}};t.exports=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(5),o=r(i),s=n(21),a=r(s),c=n(22),u=r(c),f=n(23),l=r(f),p=n(24),h=r(p),d=n(26),y=r(d),v=n(25),g=r(v),m=n(13),b=r(m),_=n(27),w=r(_),O=n(16),S=r(O);o["default"].addons={ActionListeners:a["default"],AltContainer:S["default"],AltManager:u["default"],DispatcherRecorder:l["default"],atomic:h["default"],chromeDebug:g["default"],connectToStores:y["default"],makeFinalStore:b["default"],withAltContext:w["default"]},e["default"]=o["default"],t.exports=e["default"]},function(t,e){"use strict";function n(t){this.dispatcher=t.dispatcher,this.listeners={}}Object.defineProperty(e,"__esModule",{value:!0}),n.prototype.addActionListener=function(t,e){var n=this.dispatcher.register(function(n){t===n.action&&e(n.data,n.details)});return this.listeners[n]=!0,n},n.prototype.removeActionListener=function(t){delete this.listeners[t],this.dispatcher.unregister(t)},n.prototype.removeAllActionListeners=function(){Object.keys(this.listeners).forEach(this.removeActionListener.bind(this)),this.listeners={}},e["default"]=n,t.exports=e["default"]},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(e){n(this,t),this.Alt=e,this.alts={}}return r(t,[{key:"create",value:function(t){if(this.get(t))throw new ReferenceError("Alt key "+t+" already exists");if("string"!=typeof t)throw new TypeError("altKey must be a string");return this.alts[t]=new this.Alt,this.alts[t]}},{key:"get",value:function(t){return this.alts[t]}},{key:"all",value:function(){return this.alts}},{key:"findWhere",value:function(t){var e={};for(var n in this.alts)null!==t.exec(n)&&(e[n]=this.alts[n]);return e}},{key:"delete",value:function(t){return this.get(t)?(delete this.alts[t],!0):!1}},{key:"getOrCreate",value:function(t){var e=this.get(t);return e?e:this.create(t)}}]),t}();e["default"]=i,t.exports=e["default"]},function(t,e){"use strict";function n(t){var e=arguments.length<=1||void 0===arguments[1]?1/0:arguments[1];this.alt=t,this.events=[],this.dispatchToken=null,this.maxEvents=e}Object.defineProperty(e,"__esModule",{value:!0}),n.prototype.record=function(){var t=this;return this.dispatchToken?!1:(this.dispatchToken=this.alt.dispatcher.register(function(e){t.events.length<t.maxEvents&&t.events.push(e)}),!0)},n.prototype.stop=function(){this.alt.dispatcher.unregister(this.dispatchToken),this.dispatchToken=null},n.prototype.clear=function(){this.events=[]},n.prototype.replay=function(t,e){var n=this.alt;void 0===t&&this.events.forEach(function(t){n.dispatch(t.action,t.data)});for(var r=function(e,r){return function(){setTimeout(function(){n.dispatch(e.action,e.data),r()},t)}},i=e||function(){},o=this.events.length-1;o>=0;){var s=this.events[o];i=r(s,i),o-=1}i()},n.prototype.serializeEvents=function(){var t=this.events.map(function(t){return{id:t.id,action:t.action,data:t.data||{}}});return JSON.stringify(t)},n.prototype.loadEvents=function(t){var e=JSON.parse(t);return this.events=e.map(function(t){return{action:t.action,data:t.data}}),e},e["default"]=n,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){var n=function(e){function n(){i(this,n),u(Object.getPrototypeOf(n.prototype),"constructor",this).call(this),this.on("error",function(){return t.rollback()})}return o(n,e),n}(e);return n.displayName=e.displayName||e.name,n}function a(t,e){return e.lifecycle=e.lifecycle||{},e.lifecycle.error=function(){t.rollback()},e}function c(t){var e=l["default"](t);return e.listen(function(){return t.takeSnapshot()}),function(e){return p.isFunction(e)?s(t,e):a(t,e)}}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t,e,n){for(var r=!0;r;){var i=t,o=e,s=n;a=u=c=void 0,r=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var c=a.get;return void 0===c?void 0:c.call(s)}var u=Object.getPrototypeOf(i);if(null===u)return void 0;t=u,e=o,n=s,r=!0}};e["default"]=c;var f=n(13),l=r(f),p=n(1);t.exports=e["default"]},function(t,e){"use strict";function n(t){return"undefined"!=typeof window&&(window["alt.js.org"]=t),t}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e=arguments.length<=1||void 0===arguments[1]?t:arguments[1];return function(){
if(!a.isFunction(t.getStores))throw new Error("connectToStores() expects the wrapped component to have a static getStores() method");if(!a.isFunction(t.getPropsFromStores))throw new Error("connectToStores() expects the wrapped component to have a static getPropsFromStores() method");var n=s["default"].createClass({displayName:"Stateful"+(e.displayName||e.name||"Container"),getInitialState:function(){return t.getPropsFromStores(this.props,this.context)},componentWillReceiveProps:function(e){this.setState(t.getPropsFromStores(e,this.context))},componentDidMount:function(){var e=this,n=t.getStores(this.props,this.context);this.storeListeners=n.map(function(t){return t.listen(e.onChange)}),t.componentDidConnect&&t.componentDidConnect(this.props,this.context)},componentWillUnmount:function(){this.storeListeners.forEach(function(t){return t()})},onChange:function(){this.setState(t.getPropsFromStores(this.props,this.context))},render:function(){return s["default"].createElement(e,a.assign({},this.props,this.state))}});return e.contextTypes&&(n.contextTypes=e.contextTypes),n}()}Object.defineProperty(e,"__esModule",{value:!0});var o=n(15),s=r(o),a=n(1);e["default"]=i,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return function(e){return s["default"].createClass({childContextTypes:{flux:s["default"].PropTypes.object},getChildContext:function(){return{flux:t}},render:function(){return s["default"].createElement(e,this.props)}})}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var o=n(15),s=r(o);t.exports=e["default"]},function(t,n){t.exports=e}])});

@@ -138,2 +138,12 @@ (function webpackUniversalModuleDefinition(root, factory) {

// support straight dispatching of FSA-style actions
if (action.type && action.payload) {
var fsaDetails = {
id: action.type,
namespace: action.type,
name: action.type
};
return _this.dispatcher.dispatch(utils.fsa(id, action.type, action.payload, fsaDetails));
}
if (action.id && action.dispatch) {

@@ -140,0 +150,0 @@ return utils.dispatch(id, action, data, _this);

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Alt=e():t.Alt=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(5)},function(t,e){"use strict";function n(t){var e=t.constructor;return!!t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&s(e)&&(e instanceof e||"AltStore"===t.type)}function r(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}function i(t,e){e.forEach(function(e){Object.keys(Object(e)).forEach(function(n){t(n,e[n])})})}function o(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return i(function(e,n){return t[e]=n},n),t}Object.defineProperty(e,"__esModule",{value:!0}),e.isPojo=n,e.isPromise=r,e.eachObject=i,e.assign=o;var s=function(t){return"function"==typeof t};e.isFunction=s},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e){var n=e?v:y,r=e?t.prototype:t;return Object.getOwnPropertyNames(r).reduce(function(t,e){return-1!==n.indexOf(e)?t:(t[e]=r[e],t)},{})}function o(t){"undefined"!=typeof console&&console.warn(new ReferenceError(t))}function s(t,e){for(var n=0,r=e;Object.hasOwnProperty.call(t,r);)r=e+String(++n);return r}function a(t){return t.replace(/[a-z]([A-Z])/g,function(t){return t[0]+"_"+t[1].toLowerCase()}).toUpperCase()}function c(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];this.dispatch(n.length?[t].concat(n):t)}function u(t,e,n,r){return{type:e,payload:n,meta:p({dispatchId:t},r),id:t,action:e,data:n,details:r}}function l(t,e,n,r){var i=e.dispatch(n);if(void 0===i)return null;var o=e.id,s=o,a=o,c={id:o,namespace:s,name:a},l=function(t){return r.dispatch(o,t,c)};return d.isFunction(i)?i(l,r):r.dispatcher.dispatch(u(t,o,i,c))}function f(){}Object.defineProperty(e,"__esModule",{value:!0});var p=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.getInternalMethods=i,e.warn=o,e.uid=s,e.formatAsConstant=a,e.dispatchIdentity=c,e.fsa=u,e.dispatch=l;var h=n(1),d=r(h),y=Object.getOwnPropertyNames(f),v=Object.getOwnPropertyNames(f.prototype)},function(t,e){"use strict";function n(){var t=[],e=function(e){var n=t.indexOf(e);n>=0&&t.splice(n,1)},n=function(n){t.push(n);var r=function(){return e(n)};return{dispose:r}},r=function(e){t.forEach(function(t){return t(e)})};return{subscribe:n,push:r,unsubscribe:e}}t.exports=n},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n,r,i){var o=l.uid(t._actionsRegistry,e+"."+n);t._actionsRegistry[o]=1;var s={id:o,namespace:e,name:n},a=new f(t,o,r,i,s),u=function(e){return t.dispatch(o,e,s)},p=function(){a.dispatched=!1;var e=a._dispatch.apply(a,arguments);return a.dispatched||void 0===e||c.isPromise(e)||(c.isFunction(e)?e(u,t):u(e)),e};p.defer=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];setTimeout(function(){a._dispatch.apply(null,e)})},p.id=o,p.data=s;var h=t.actions[e],d=l.uid(h,n);return h[d]=p,p}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e["default"]=o;var a=n(1),c=r(a),u=n(2),l=r(u),f=function(){function t(e,n,r,o,s){i(this,t),this.id=n,this._dispatch=r.bind(this),this.actions=o,this.actionDetails=s,this.alt=e}return s(t,[{key:"dispatch",value:function(t){this.dispatched=!0,this.alt.dispatch(this.id,t,this.actionDetails)}}]),t}();t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var c=Function.prototype.bind,u=function(t,e,n){for(var r=!0;r;){var i=t,o=e,s=n;a=u=c=void 0,r=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var c=a.get;return void 0===c?void 0:c.call(s)}var u=Object.getPrototypeOf(i);if(null===u)return void 0;t=u,e=o,n=s,r=!0}},l=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(10),p=n(9),h=i(p),d=n(1),y=i(d),v=n(8),g=i(v),b=n(2),m=i(b),_=n(4),w=r(_),O=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];a(this,t),this.config=e,this.serialize=e.serialize||JSON.stringify,this.deserialize=e.deserialize||JSON.parse,this.dispatcher=e.dispatcher||new f.Dispatcher,this.batchingFunction=e.batchingFunction||function(t){return t()},this.actions={global:{}},this.stores={},this.storeTransforms=e.storeTransforms||[],this.trapAsync=!1,this._actionsRegistry={},this._initSnapshot={},this._lastSnapshot={}}return l(t,[{key:"dispatch",value:function(t,e,n){var r=this;this.batchingFunction(function(){var i=Math.random().toString(18).substr(2,16);return t.id&&t.dispatch?m.dispatch(i,t,e,r):r.dispatcher.dispatch(m.fsa(i,t,e,n))})}},{key:"createUnsavedStore",value:function(t){var e=t.displayName||"";g.createStoreConfig(this.config,t);for(var n=g.transformStore(this.storeTransforms,t),r=arguments.length,i=Array(r>1?r-1:0),o=1;r>o;o++)i[o-1]=arguments[o];return y.isFunction(n)?g.createStoreFromClass.apply(g,[this,n,e].concat(i)):g.createStoreFromObject(this,n,e)}},{key:"createStore",value:function(t,e){var n=e||t.displayName||t.name||"";g.createStoreConfig(this.config,t);var r=g.transformStore(this.storeTransforms,t);(this.stores[n]||!n)&&(this.stores[n]?m.warn("A store named "+n+" already exists, double check your store names or pass in your own custom identifier for each store"):m.warn("Store name was not specified"),n=m.uid(this.stores,n));for(var i=arguments.length,o=Array(i>2?i-2:0),s=2;i>s;s++)o[s-2]=arguments[s];var a=y.isFunction(r)?g.createStoreFromClass.apply(g,[this,r,n].concat(o)):g.createStoreFromObject(this,r,n);return this.stores[n]=a,h.saveInitialSnapshot(this,n),a}},{key:"generateActions",value:function(){for(var t={name:"global"},e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return this.createActions(n.reduce(function(t,e){return t[e]=m.dispatchIdentity,t},t))}},{key:"createAction",value:function(t,e,n){return w["default"](this,"global",t,e,n)}},{key:"createActions",value:function(t){var e=arguments,n=this,r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i={},f=m.uid(this._actionsRegistry,t.displayName||t.name||"Unknown");if(y.isFunction(t)){var p,h,d;!function(){y.assign(i,m.getInternalMethods(t,!0));var n=function(t){function e(){a(this,e);for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];u(Object.getPrototypeOf(e.prototype),"constructor",this).apply(this,n)}return s(e,t),l(e,[{key:"generateActions",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];e.forEach(function(t){i[t]=m.dispatchIdentity})}}]),e}(t);for(p=e.length,h=Array(p>2?p-2:0),d=2;p>d;d++)h[d-2]=e[d];y.assign(i,new(c.apply(n,[null].concat(o(h)))))}()}else y.assign(i,t);return this.actions[f]=this.actions[f]||{},y.eachObject(function(t,e){if(y.isFunction(e)){r[t]=w["default"](n,f,t,e,r);var i=m.formatAsConstant(t);r[i]=r[t].id}},[i]),r}},{key:"takeSnapshot",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=h.snapshot(this,e);return y.assign(this._lastSnapshot,r),this.serialize(r)}},{key:"rollback",value:function(){h.setAppState(this,this.serialize(this._lastSnapshot),function(t){t.lifecycle("rollback"),t.emitChange()})}},{key:"recycle",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=e.length?h.filterSnapshots(this,this._initSnapshot,e):this._initSnapshot;h.setAppState(this,this.serialize(r),function(t){t.lifecycle("init"),t.emitChange()})}},{key:"flush",value:function(){var t=this.serialize(h.snapshot(this));return this.recycle(),t}},{key:"bootstrap",value:function(t){h.setAppState(this,t,function(t,e){t.lifecycle("bootstrap",e),t.emitChange()})}},{key:"prepare",value:function(t,e){var n={};if(!t.displayName)throw new ReferenceError("Store provided does not have a name");return n[t.displayName]=e,this.serialize(n)}},{key:"addActions",value:function(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];this.actions[t]=Array.isArray(e)?this.generateActions.apply(this,e):this.createActions.apply(this,[e].concat(r))}},{key:"addStore",value:function(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];this.createStore.apply(this,[e,t].concat(r))}},{key:"getActions",value:function(t){return this.actions[t]}},{key:"getStore",value:function(t){return this.stores[t]}}],[{key:"debug",value:function(t,e){var n="alt.js.org";return"undefined"!=typeof window&&(window[n]=window[n]||[],window[n].push({name:t,alt:e})),e}}]),t}();e["default"]=O,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(1),c=i(a),u=n(3),l=r(u),f=function(){function t(e,n,r,i){var s=this;o(this,t);var a=n.lifecycleEvents;this.transmitter=l["default"](),this.lifecycle=function(t,e){a[t]&&a[t].push(e)},this.state=r,this.alt=e,this.preventDefault=!1,this.displayName=n.displayName,this.boundListeners=n.boundListeners,this.StoreModel=i,this.reduce=n.reduce||function(t){return t};var u=n.output||function(t){return t};this.emitChange=function(){return s.transmitter.push(u(s.state))};var f=function(t,e){try{return t()}catch(r){if(n.handlesOwnErrors)return s.lifecycle("error",{error:r,payload:e,state:s.state}),!1;throw r}};c.assign(this,n.publicMethods),this.dispatchToken=e.dispatcher.register(function(t){s.preventDefault=!1,s.lifecycle("beforeEach",{payload:t,state:s.state});var e=n.actionListeners[t.action];if(e||n.otherwise){var r=void 0;r=e?f(function(){return e.filter(Boolean).every(function(e){return e.call(n,t.data,t.action)!==!1})},t):f(function(){return n.otherwise(t.data,t.action)},t),r===!1||s.preventDefault||s.emitChange()}n.reduce&&(f(function(){var e=n.reduce(s.state,t);void 0!==e&&(s.state=e)},t),s.preventDefault||s.emitChange()),s.lifecycle("afterEach",{payload:t,state:s.state})}),this.lifecycle("init")}return s(t,[{key:"listen",value:function(t){var e=this;if(!c.isFunction(t))throw new TypeError("listen expects a function");return this.transmitter.subscribe(t),function(){return e.unlisten(t)}}},{key:"unlisten",value:function(t){this.lifecycle("unlisten"),this.transmitter.unsubscribe(t)}},{key:"getState",value:function(){return this.StoreModel.config.getState.call(this,this.state)}}]),t}();e["default"]=f,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=i(o),a=n(1),c=r(a),u={waitFor:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(!e.length)throw new ReferenceError("Dispatch tokens not provided");var r=e;1===e.length&&(r=Array.isArray(e[0])?e[0]:e);var i=r.map(function(t){return t.dispatchToken||t});this.dispatcher.waitFor(i)},exportAsync:function(t){this.registerAsync(t)},registerAsync:function(t){var e=this,n=0,r=c.isFunction(t)?t(this.alt):t,i=Object.keys(r).reduce(function(t,i){var o=r[i],s=c.isFunction(o)?o(e):o,a=["success","error","loading"];return a.forEach(function(t){if(s[t]&&!s[t].id)throw new Error(t+" handler must be an action function")}),t[i]=function(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];var o=e.getInstance().getState(),a=s.local&&s.local.apply(s,[o].concat(r)),c=s.shouldFetch?s.shouldFetch.apply(s,[o].concat(r)):null==a,u=s.interceptResponse||function(t){return t},l=function(t,i){return function(o){var s=function(){if(n-=1,t(u(o,t,r)),i)throw o};return e.alt.trapAsync?function(){return s()}:s()}};return c?(n+=1,s.loading&&s.loading(u(null,s.loading,r)),s.remote.apply(s,[o].concat(r)).then(l(s.success),l(s.error,1))):(e.emitChange(),a)},t},{});this.exportPublicMethods(i),this.exportPublicMethods({isLoading:function(){return n>0}})},exportPublicMethods:function(t){var e=this;c.eachObject(function(t,n){if(!c.isFunction(n))throw new TypeError("exportPublicMethods expects a function");e.publicMethods[t]=n},[t])},emitChange:function(){this.getInstance().emitChange()},on:function(t,e){"error"===t&&(this.handlesOwnErrors=!0);var n=this.lifecycleEvents[t]||s["default"]();return this.lifecycleEvents[t]=n,n.subscribe(e.bind(this))},bindAction:function(t,e){if(!t)throw new ReferenceError("Invalid action reference passed in");if(!c.isFunction(e))throw new TypeError("bindAction expects a function");if(e.length>1)throw new TypeError("Action handler in store "+this.displayName+" for "+((t.id||t).toString()+" was defined with ")+"two parameters. Only a single parameter is passed through the dispatcher, did you mean to pass in an Object instead?");var n=t.id?t.id:t;this.actionListeners[n]=this.actionListeners[n]||[],this.actionListeners[n].push(e.bind(this)),this.boundListeners.push(n)},bindActions:function(t){var e=this;c.eachObject(function(t,n){var r=/./,i=t.replace(r,function(t){return"on"+t[0].toUpperCase()});if(e[t]&&e[i])throw new ReferenceError("You have multiple action handlers bound to an action: "+(t+" and "+i));var o=e[t]||e[i];o&&e.bindAction(n,o)},[t])},bindListeners:function(t){var e=this;c.eachObject(function(t,n){var r=e[t];if(!r)throw new ReferenceError(t+" defined but does not exist in "+e.displayName);Array.isArray(n)?n.forEach(function(t){e.bindAction(t,r)}):e.bindAction(n,r)},[t])}};e["default"]=u,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e,n){if(n){var r=e.StoreModel.config,i=b.isFunction(n)?n(e.state):n;e.state=r.setState.call(t,e.state,i),t.alt.dispatcher.isDispatching()||t.emitChange()}}function c(t,e,n,r){return b.assign(t,O["default"],{displayName:n,alt:e,dispatcher:e.dispatcher,preventDefault:function(){this.getInstance().preventDefault=!0},boundListeners:[],lifecycleEvents:{},actionListeners:{},publicMethods:{},handlesOwnErrors:!1},r)}function u(t,e){e.config=b.assign({getState:function(t){return Array.isArray(t)?t.slice():b.isPojo(t)?b.assign({},t):t},setState:function(t,e){return b.isPojo(e)?b.assign(t,e):e}},t,e.config)}function l(t,e){return t.reduce(function(t,e){return e(t)},e)}function f(t,e,n){var r=void 0,i=c({},t,n,b.assign({getInstance:function(){return r},setState:function(t){a(this,r,t)}},e));return i.bindListeners&&O["default"].bindListeners.call(i,i.bindListeners),i.observe&&O["default"].bindListeners.call(i,i.observe(t)),i.lifecycle&&b.eachObject(function(t,e){O["default"].on.call(i,t,e)},[i.lifecycle]),r=b.assign(new _["default"](t,i,void 0!==i.state?i.state:{},e),i.publicMethods,{displayName:n})}function p(t,e,n){var r=void 0,i=e.config,u=function(t){function e(){o(this,e);for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];d(Object.getPrototypeOf(e.prototype),"constructor",this).apply(this,n)}return s(e,t),e}(e);c(u.prototype,t,n,{type:"AltStore",getInstance:function(){return r},setState:function(t){a(this,r,t)}});for(var l=arguments.length,f=Array(l>3?l-3:0),p=3;l>p;p++)f[p-3]=arguments[p];var y=new(h.apply(u,[null].concat(f)));return i.bindListeners&&y.bindListeners(i.bindListeners),i.datasource&&y.registerAsync(i.datasource),r=b.assign(new _["default"](t,y,void 0!==y.state?y.state:y,e),v.getInternalMethods(e),i.publicMethods,{displayName:n})}Object.defineProperty(e,"__esModule",{value:!0});var h=Function.prototype.bind,d=function(t,e,n){for(var r=!0;r;){var i=t,o=e,s=n;a=u=c=void 0,r=!1,null===i&&(i=Function.prototype);var a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var c=a.get;return void 0===c?void 0:c.call(s)}var u=Object.getPrototypeOf(i);if(null===u)return void 0;t=u,e=o,n=s,r=!0}};e.createStoreConfig=u,e.transformStore=l,e.createStoreFromObject=f,e.createStoreFromClass=p;var y=n(2),v=i(y),g=n(1),b=i(g),m=n(6),_=r(m),w=n(7),O=r(w)},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e,n){var r=t.deserialize(e);u.eachObject(function(e,i){var o=t.stores[e];o&&!function(){var t=o.StoreModel.config,s=o.state;t.onDeserialize&&(r[e]=t.onDeserialize(i)||i),u.isPojo(s)?(u.eachObject(function(t){return delete s[t]},[s]),u.assign(s,r[e])):o.state=r[e],n(o,o.state)}()},[r])}function o(t){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e.length?e:Object.keys(t.stores);return n.reduce(function(e,n){var r=n.displayName||n,i=t.stores[r],o=i.StoreModel.config;i.lifecycle("snapshot");var s=o.onSerialize&&o.onSerialize(i.state);return e[r]=s?s:i.getState(),e},{})}function s(t,e){var n=t.deserialize(t.serialize(t.stores[e].state));t._initSnapshot[e]=n,t._lastSnapshot[e]=n}function a(t,e,n){return n.reduce(function(t,n){var r=n.displayName||n;if(!e[r])throw new ReferenceError(r+" is not a valid store");return t[r]=e[r],t},{})}Object.defineProperty(e,"__esModule",{value:!0}),e.setAppState=i,e.snapshot=o,e.saveInitialSnapshot=s,e.filterSnapshots=a;var c=n(1),u=r(c)},function(t,e,n){t.exports.Dispatcher=n(11)},function(t,e,n){"use strict";function r(){this.$Dispatcher_callbacks={},this.$Dispatcher_isPending={},this.$Dispatcher_isHandled={},this.$Dispatcher_isDispatching=!1,this.$Dispatcher_pendingPayload=null}var i=n(12),o=1,s="ID_";r.prototype.register=function(t){var e=s+o++;return this.$Dispatcher_callbacks[e]=t,e},r.prototype.unregister=function(t){i(this.$Dispatcher_callbacks[t],"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t),delete this.$Dispatcher_callbacks[t]},r.prototype.waitFor=function(t){i(this.$Dispatcher_isDispatching,"Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];this.$Dispatcher_isPending[n]?i(this.$Dispatcher_isHandled[n],"Dispatcher.waitFor(...): Circular dependency detected while waiting for `%s`.",n):(i(this.$Dispatcher_callbacks[n],"Dispatcher.waitFor(...): `%s` does not map to a registered callback.",n),this.$Dispatcher_invokeCallback(n))}},r.prototype.dispatch=function(t){i(!this.$Dispatcher_isDispatching,"Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."),this.$Dispatcher_startDispatching(t);try{for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]||this.$Dispatcher_invokeCallback(e)}finally{this.$Dispatcher_stopDispatching()}},r.prototype.isDispatching=function(){return this.$Dispatcher_isDispatching},r.prototype.$Dispatcher_invokeCallback=function(t){this.$Dispatcher_isPending[t]=!0,this.$Dispatcher_callbacks[t](this.$Dispatcher_pendingPayload),this.$Dispatcher_isHandled[t]=!0},r.prototype.$Dispatcher_startDispatching=function(t){for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]=!1,this.$Dispatcher_isHandled[e]=!1;this.$Dispatcher_pendingPayload=t,this.$Dispatcher_isDispatching=!0},r.prototype.$Dispatcher_stopDispatching=function(){this.$Dispatcher_pendingPayload=null,this.$Dispatcher_isDispatching=!1},t.exports=r},function(t,e){"use strict";var n=function(t,e,n,r,i,o,s,a){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,a],l=0;c=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return u[l++]}))}throw c.framesToPop=1,c}};t.exports=n}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Alt=e():t.Alt=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(5)},function(t,e){"use strict";function n(t){var e=t.constructor;return!!t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&a(e)&&(e instanceof e||"AltStore"===t.type)}function r(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}function i(t,e){e.forEach(function(e){Object.keys(Object(e)).forEach(function(n){t(n,e[n])})})}function o(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return i(function(e,n){return t[e]=n},n),t}Object.defineProperty(e,"__esModule",{value:!0}),e.isPojo=n,e.isPromise=r,e.eachObject=i,e.assign=o;var a=function(t){return"function"==typeof t};e.isFunction=a},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e){var n=e?v:y,r=e?t.prototype:t;return Object.getOwnPropertyNames(r).reduce(function(t,e){return-1!==n.indexOf(e)?t:(t[e]=r[e],t)},{})}function o(t){"undefined"!=typeof console&&console.warn(new ReferenceError(t))}function a(t,e){for(var n=0,r=e;Object.hasOwnProperty.call(t,r);)r=e+String(++n);return r}function s(t){return t.replace(/[a-z]([A-Z])/g,function(t){return t[0]+"_"+t[1].toLowerCase()}).toUpperCase()}function c(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];this.dispatch(n.length?[t].concat(n):t)}function u(t,e,n,r){return{type:e,payload:n,meta:p({dispatchId:t},r),id:t,action:e,data:n,details:r}}function l(t,e,n,r){var i=e.dispatch(n);if(void 0===i)return null;var o=e.id,a=o,s=o,c={id:o,namespace:a,name:s},l=function(t){return r.dispatch(o,t,c)};return d.isFunction(i)?i(l,r):r.dispatcher.dispatch(u(t,o,i,c))}function f(){}Object.defineProperty(e,"__esModule",{value:!0});var p=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.getInternalMethods=i,e.warn=o,e.uid=a,e.formatAsConstant=s,e.dispatchIdentity=c,e.fsa=u,e.dispatch=l;var h=n(1),d=r(h),y=Object.getOwnPropertyNames(f),v=Object.getOwnPropertyNames(f.prototype)},function(t,e){"use strict";function n(){var t=[],e=function(e){var n=t.indexOf(e);n>=0&&t.splice(n,1)},n=function(n){t.push(n);var r=function(){return e(n)};return{dispose:r}},r=function(e){t.forEach(function(t){return t(e)})};return{subscribe:n,push:r,unsubscribe:e}}t.exports=n},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n,r,i){var o=l.uid(t._actionsRegistry,e+"."+n);t._actionsRegistry[o]=1;var a={id:o,namespace:e,name:n},s=new f(t,o,r,i,a),u=function(e){return t.dispatch(o,e,a)},p=function(){s.dispatched=!1;var e=s._dispatch.apply(s,arguments);return s.dispatched||void 0===e||c.isPromise(e)||(c.isFunction(e)?e(u,t):u(e)),e};p.defer=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];setTimeout(function(){s._dispatch.apply(null,e)})},p.id=o,p.data=a;var h=t.actions[e],d=l.uid(h,n);return h[d]=p,p}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e["default"]=o;var s=n(1),c=r(s),u=n(2),l=r(u),f=function(){function t(e,n,r,o,a){i(this,t),this.id=n,this._dispatch=r.bind(this),this.actions=o,this.actionDetails=a,this.alt=e}return a(t,[{key:"dispatch",value:function(t){this.dispatched=!0,this.alt.dispatch(this.id,t,this.actionDetails)}}]),t}();t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var c=Function.prototype.bind,u=function(t,e,n){for(var r=!0;r;){var i=t,o=e,a=n;s=u=c=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var c=s.get;return void 0===c?void 0:c.call(a)}var u=Object.getPrototypeOf(i);if(null===u)return void 0;t=u,e=o,n=a,r=!0}},l=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=n(10),p=n(9),h=i(p),d=n(1),y=i(d),v=n(8),g=i(v),b=n(2),m=i(b),_=n(4),w=r(_),O=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];s(this,t),this.config=e,this.serialize=e.serialize||JSON.stringify,this.deserialize=e.deserialize||JSON.parse,this.dispatcher=e.dispatcher||new f.Dispatcher,this.batchingFunction=e.batchingFunction||function(t){return t()},this.actions={global:{}},this.stores={},this.storeTransforms=e.storeTransforms||[],this.trapAsync=!1,this._actionsRegistry={},this._initSnapshot={},this._lastSnapshot={}}return l(t,[{key:"dispatch",value:function(t,e,n){var r=this;this.batchingFunction(function(){var i=Math.random().toString(18).substr(2,16);if(t.type&&t.payload){var o={id:t.type,namespace:t.type,name:t.type};return r.dispatcher.dispatch(m.fsa(i,t.type,t.payload,o))}return t.id&&t.dispatch?m.dispatch(i,t,e,r):r.dispatcher.dispatch(m.fsa(i,t,e,n))})}},{key:"createUnsavedStore",value:function(t){var e=t.displayName||"";g.createStoreConfig(this.config,t);for(var n=g.transformStore(this.storeTransforms,t),r=arguments.length,i=Array(r>1?r-1:0),o=1;r>o;o++)i[o-1]=arguments[o];return y.isFunction(n)?g.createStoreFromClass.apply(g,[this,n,e].concat(i)):g.createStoreFromObject(this,n,e)}},{key:"createStore",value:function(t,e){var n=e||t.displayName||t.name||"";g.createStoreConfig(this.config,t);var r=g.transformStore(this.storeTransforms,t);(this.stores[n]||!n)&&(this.stores[n]?m.warn("A store named "+n+" already exists, double check your store names or pass in your own custom identifier for each store"):m.warn("Store name was not specified"),n=m.uid(this.stores,n));for(var i=arguments.length,o=Array(i>2?i-2:0),a=2;i>a;a++)o[a-2]=arguments[a];var s=y.isFunction(r)?g.createStoreFromClass.apply(g,[this,r,n].concat(o)):g.createStoreFromObject(this,r,n);return this.stores[n]=s,h.saveInitialSnapshot(this,n),s}},{key:"generateActions",value:function(){for(var t={name:"global"},e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return this.createActions(n.reduce(function(t,e){return t[e]=m.dispatchIdentity,t},t))}},{key:"createAction",value:function(t,e,n){return w["default"](this,"global",t,e,n)}},{key:"createActions",value:function(t){var e=arguments,n=this,r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i={},f=m.uid(this._actionsRegistry,t.displayName||t.name||"Unknown");if(y.isFunction(t)){var p,h,d;!function(){y.assign(i,m.getInternalMethods(t,!0));var n=function(t){function e(){s(this,e);for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];u(Object.getPrototypeOf(e.prototype),"constructor",this).apply(this,n)}return a(e,t),l(e,[{key:"generateActions",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];e.forEach(function(t){i[t]=m.dispatchIdentity})}}]),e}(t);for(p=e.length,h=Array(p>2?p-2:0),d=2;p>d;d++)h[d-2]=e[d];y.assign(i,new(c.apply(n,[null].concat(o(h)))))}()}else y.assign(i,t);return this.actions[f]=this.actions[f]||{},y.eachObject(function(t,e){if(y.isFunction(e)){r[t]=w["default"](n,f,t,e,r);var i=m.formatAsConstant(t);r[i]=r[t].id}},[i]),r}},{key:"takeSnapshot",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=h.snapshot(this,e);return y.assign(this._lastSnapshot,r),this.serialize(r)}},{key:"rollback",value:function(){h.setAppState(this,this.serialize(this._lastSnapshot),function(t){t.lifecycle("rollback"),t.emitChange()})}},{key:"recycle",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=e.length?h.filterSnapshots(this,this._initSnapshot,e):this._initSnapshot;h.setAppState(this,this.serialize(r),function(t){t.lifecycle("init"),t.emitChange()})}},{key:"flush",value:function(){var t=this.serialize(h.snapshot(this));return this.recycle(),t}},{key:"bootstrap",value:function(t){h.setAppState(this,t,function(t,e){t.lifecycle("bootstrap",e),t.emitChange()})}},{key:"prepare",value:function(t,e){var n={};if(!t.displayName)throw new ReferenceError("Store provided does not have a name");return n[t.displayName]=e,this.serialize(n)}},{key:"addActions",value:function(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];this.actions[t]=Array.isArray(e)?this.generateActions.apply(this,e):this.createActions.apply(this,[e].concat(r))}},{key:"addStore",value:function(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];this.createStore.apply(this,[e,t].concat(r))}},{key:"getActions",value:function(t){return this.actions[t]}},{key:"getStore",value:function(t){return this.stores[t]}}],[{key:"debug",value:function(t,e){var n="alt.js.org";return"undefined"!=typeof window&&(window[n]=window[n]||[],window[n].push({name:t,alt:e})),e}}]),t}();e["default"]=O,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(1),c=i(s),u=n(3),l=r(u),f=function(){function t(e,n,r,i){var a=this;o(this,t);var s=n.lifecycleEvents;this.transmitter=l["default"](),this.lifecycle=function(t,e){s[t]&&s[t].push(e)},this.state=r,this.alt=e,this.preventDefault=!1,this.displayName=n.displayName,this.boundListeners=n.boundListeners,this.StoreModel=i,this.reduce=n.reduce||function(t){return t};var u=n.output||function(t){return t};this.emitChange=function(){return a.transmitter.push(u(a.state))};var f=function(t,e){try{return t()}catch(r){if(n.handlesOwnErrors)return a.lifecycle("error",{error:r,payload:e,state:a.state}),!1;throw r}};c.assign(this,n.publicMethods),this.dispatchToken=e.dispatcher.register(function(t){a.preventDefault=!1,a.lifecycle("beforeEach",{payload:t,state:a.state});var e=n.actionListeners[t.action];if(e||n.otherwise){var r=void 0;r=e?f(function(){return e.filter(Boolean).every(function(e){return e.call(n,t.data,t.action)!==!1})},t):f(function(){return n.otherwise(t.data,t.action)},t),r===!1||a.preventDefault||a.emitChange()}n.reduce&&(f(function(){var e=n.reduce(a.state,t);void 0!==e&&(a.state=e)},t),a.preventDefault||a.emitChange()),a.lifecycle("afterEach",{payload:t,state:a.state})}),this.lifecycle("init")}return a(t,[{key:"listen",value:function(t){var e=this;if(!c.isFunction(t))throw new TypeError("listen expects a function");return this.transmitter.subscribe(t),function(){return e.unlisten(t)}}},{key:"unlisten",value:function(t){this.lifecycle("unlisten"),this.transmitter.unsubscribe(t)}},{key:"getState",value:function(){return this.StoreModel.config.getState.call(this,this.state)}}]),t}();e["default"]=f,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),a=i(o),s=n(1),c=r(s),u={waitFor:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(!e.length)throw new ReferenceError("Dispatch tokens not provided");var r=e;1===e.length&&(r=Array.isArray(e[0])?e[0]:e);var i=r.map(function(t){return t.dispatchToken||t});this.dispatcher.waitFor(i)},exportAsync:function(t){this.registerAsync(t)},registerAsync:function(t){var e=this,n=0,r=c.isFunction(t)?t(this.alt):t,i=Object.keys(r).reduce(function(t,i){var o=r[i],a=c.isFunction(o)?o(e):o,s=["success","error","loading"];return s.forEach(function(t){if(a[t]&&!a[t].id)throw new Error(t+" handler must be an action function")}),t[i]=function(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];var o=e.getInstance().getState(),s=a.local&&a.local.apply(a,[o].concat(r)),c=a.shouldFetch?a.shouldFetch.apply(a,[o].concat(r)):null==s,u=a.interceptResponse||function(t){return t},l=function(t,i){return function(o){var a=function(){if(n-=1,t(u(o,t,r)),i)throw o};return e.alt.trapAsync?function(){return a()}:a()}};return c?(n+=1,a.loading&&a.loading(u(null,a.loading,r)),a.remote.apply(a,[o].concat(r)).then(l(a.success),l(a.error,1))):(e.emitChange(),s)},t},{});this.exportPublicMethods(i),this.exportPublicMethods({isLoading:function(){return n>0}})},exportPublicMethods:function(t){var e=this;c.eachObject(function(t,n){if(!c.isFunction(n))throw new TypeError("exportPublicMethods expects a function");e.publicMethods[t]=n},[t])},emitChange:function(){this.getInstance().emitChange()},on:function(t,e){"error"===t&&(this.handlesOwnErrors=!0);var n=this.lifecycleEvents[t]||a["default"]();return this.lifecycleEvents[t]=n,n.subscribe(e.bind(this))},bindAction:function(t,e){if(!t)throw new ReferenceError("Invalid action reference passed in");if(!c.isFunction(e))throw new TypeError("bindAction expects a function");if(e.length>1)throw new TypeError("Action handler in store "+this.displayName+" for "+((t.id||t).toString()+" was defined with ")+"two parameters. Only a single parameter is passed through the dispatcher, did you mean to pass in an Object instead?");var n=t.id?t.id:t;this.actionListeners[n]=this.actionListeners[n]||[],this.actionListeners[n].push(e.bind(this)),this.boundListeners.push(n)},bindActions:function(t){var e=this;c.eachObject(function(t,n){var r=/./,i=t.replace(r,function(t){return"on"+t[0].toUpperCase()});if(e[t]&&e[i])throw new ReferenceError("You have multiple action handlers bound to an action: "+(t+" and "+i));var o=e[t]||e[i];o&&e.bindAction(n,o)},[t])},bindListeners:function(t){var e=this;c.eachObject(function(t,n){var r=e[t];if(!r)throw new ReferenceError(t+" defined but does not exist in "+e.displayName);Array.isArray(n)?n.forEach(function(t){e.bindAction(t,r)}):e.bindAction(n,r)},[t])}};e["default"]=u,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e,n){if(n){var r=e.StoreModel.config,i=b.isFunction(n)?n(e.state):n;e.state=r.setState.call(t,e.state,i),t.alt.dispatcher.isDispatching()||t.emitChange()}}function c(t,e,n,r){return b.assign(t,O["default"],{displayName:n,alt:e,dispatcher:e.dispatcher,preventDefault:function(){this.getInstance().preventDefault=!0},boundListeners:[],lifecycleEvents:{},actionListeners:{},publicMethods:{},handlesOwnErrors:!1},r)}function u(t,e){e.config=b.assign({getState:function(t){return Array.isArray(t)?t.slice():b.isPojo(t)?b.assign({},t):t},setState:function(t,e){return b.isPojo(e)?b.assign(t,e):e}},t,e.config)}function l(t,e){return t.reduce(function(t,e){return e(t)},e)}function f(t,e,n){var r=void 0,i=c({},t,n,b.assign({getInstance:function(){return r},setState:function(t){s(this,r,t)}},e));return i.bindListeners&&O["default"].bindListeners.call(i,i.bindListeners),i.observe&&O["default"].bindListeners.call(i,i.observe(t)),i.lifecycle&&b.eachObject(function(t,e){O["default"].on.call(i,t,e)},[i.lifecycle]),r=b.assign(new _["default"](t,i,void 0!==i.state?i.state:{},e),i.publicMethods,{displayName:n})}function p(t,e,n){var r=void 0,i=e.config,u=function(t){function e(){o(this,e);for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];d(Object.getPrototypeOf(e.prototype),"constructor",this).apply(this,n)}return a(e,t),e}(e);c(u.prototype,t,n,{type:"AltStore",getInstance:function(){return r},setState:function(t){s(this,r,t)}});for(var l=arguments.length,f=Array(l>3?l-3:0),p=3;l>p;p++)f[p-3]=arguments[p];var y=new(h.apply(u,[null].concat(f)));return i.bindListeners&&y.bindListeners(i.bindListeners),i.datasource&&y.registerAsync(i.datasource),r=b.assign(new _["default"](t,y,void 0!==y.state?y.state:y,e),v.getInternalMethods(e),i.publicMethods,{displayName:n})}Object.defineProperty(e,"__esModule",{value:!0});var h=Function.prototype.bind,d=function(t,e,n){for(var r=!0;r;){var i=t,o=e,a=n;s=u=c=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var c=s.get;return void 0===c?void 0:c.call(a)}var u=Object.getPrototypeOf(i);if(null===u)return void 0;t=u,e=o,n=a,r=!0}};e.createStoreConfig=u,e.transformStore=l,e.createStoreFromObject=f,e.createStoreFromClass=p;var y=n(2),v=i(y),g=n(1),b=i(g),m=n(6),_=r(m),w=n(7),O=r(w)},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e,n){var r=t.deserialize(e);u.eachObject(function(e,i){var o=t.stores[e];o&&!function(){var t=o.StoreModel.config,a=o.state;t.onDeserialize&&(r[e]=t.onDeserialize(i)||i),u.isPojo(a)?(u.eachObject(function(t){return delete a[t]},[a]),u.assign(a,r[e])):o.state=r[e],n(o,o.state)}()},[r])}function o(t){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e.length?e:Object.keys(t.stores);return n.reduce(function(e,n){var r=n.displayName||n,i=t.stores[r],o=i.StoreModel.config;i.lifecycle("snapshot");var a=o.onSerialize&&o.onSerialize(i.state);return e[r]=a?a:i.getState(),e},{})}function a(t,e){var n=t.deserialize(t.serialize(t.stores[e].state));t._initSnapshot[e]=n,t._lastSnapshot[e]=n}function s(t,e,n){return n.reduce(function(t,n){var r=n.displayName||n;if(!e[r])throw new ReferenceError(r+" is not a valid store");return t[r]=e[r],t},{})}Object.defineProperty(e,"__esModule",{value:!0}),e.setAppState=i,e.snapshot=o,e.saveInitialSnapshot=a,e.filterSnapshots=s;var c=n(1),u=r(c)},function(t,e,n){t.exports.Dispatcher=n(11)},function(t,e,n){"use strict";function r(){this.$Dispatcher_callbacks={},this.$Dispatcher_isPending={},this.$Dispatcher_isHandled={},this.$Dispatcher_isDispatching=!1,this.$Dispatcher_pendingPayload=null}var i=n(12),o=1,a="ID_";r.prototype.register=function(t){var e=a+o++;return this.$Dispatcher_callbacks[e]=t,e},r.prototype.unregister=function(t){i(this.$Dispatcher_callbacks[t],"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t),delete this.$Dispatcher_callbacks[t]},r.prototype.waitFor=function(t){i(this.$Dispatcher_isDispatching,"Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];this.$Dispatcher_isPending[n]?i(this.$Dispatcher_isHandled[n],"Dispatcher.waitFor(...): Circular dependency detected while waiting for `%s`.",n):(i(this.$Dispatcher_callbacks[n],"Dispatcher.waitFor(...): `%s` does not map to a registered callback.",n),this.$Dispatcher_invokeCallback(n))}},r.prototype.dispatch=function(t){i(!this.$Dispatcher_isDispatching,"Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."),this.$Dispatcher_startDispatching(t);try{for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]||this.$Dispatcher_invokeCallback(e)}finally{this.$Dispatcher_stopDispatching()}},r.prototype.isDispatching=function(){return this.$Dispatcher_isDispatching},r.prototype.$Dispatcher_invokeCallback=function(t){this.$Dispatcher_isPending[t]=!0,this.$Dispatcher_callbacks[t](this.$Dispatcher_pendingPayload),this.$Dispatcher_isHandled[t]=!0},r.prototype.$Dispatcher_startDispatching=function(t){for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]=!1,this.$Dispatcher_isHandled[e]=!1;this.$Dispatcher_pendingPayload=t,this.$Dispatcher_isDispatching=!0},r.prototype.$Dispatcher_stopDispatching=function(){this.$Dispatcher_pendingPayload=null,this.$Dispatcher_isDispatching=!1},t.exports=r},function(t,e){"use strict";var n=function(t,e,n,r,i,o,a,s){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,a,s],l=0;c=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return u[l++]}))}throw c.framesToPop=1,c}};t.exports=n}])});

@@ -75,2 +75,12 @@ /* global window */

// support straight dispatching of FSA-style actions
if (action.type && action.payload) {
var fsaDetails = {
id: action.type,
namespace: action.type,
name: action.type
};
return _this.dispatcher.dispatch(utils.fsa(id, action.type, action.payload, fsaDetails));
}
if (action.id && action.dispatch) {

@@ -77,0 +87,0 @@ return utils.dispatch(id, action, data, _this);

{
"name": "alt",
"version": "0.17.5",
"version": "0.17.6",
"description": "A flux implementation",

@@ -5,0 +5,0 @@ "main": "lib",

@@ -1487,3 +1487,3 @@ import Alt from '../'

'is fsa'(done) {
alt.dispatcher.register((x) => {
const res = alt.dispatcher.register((x) => {
assert.isDefined(x.type, 'there is a type')

@@ -1496,2 +1496,4 @@ assert.isDefined(x.payload, 'there is a payload')

alt.dispatcher.unregister(res)
done()

@@ -1502,4 +1504,20 @@ })

},
'can dispatch fsa'(done) {
const res = alt.dispatcher.register((x) => {
assert.isDefined(x.type, 'there is a type')
assert(x.type === 'owl')
assert.isDefined(x.payload, 'there is a payload')
assert(x.payload === 'Tawny')
assert.isString(x.meta.dispatchId, 'meta contains a unique dispatch id')
alt.dispatcher.unregister(res)
done()
})
alt.dispatch({ type: 'owl', payload: 'Tawny' })
},
}
export default tests

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc