(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.Morearty=e()}})(function(){var e,t,n;return function r(e,t,n){function i(s,u){if(!t[s]){if(!e[s]){var o=typeof require=="function"&&require;if(!u&&o)return o(s,!0);if(a)return a(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return i(n?n:t)},l,l.exports,r,e,t,n)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s0?e.getIn(t):e};var h,v;h=function(e){return typeof e==="string"?c(e):i.undefinedOrNull(e)?[]:e};v=function(e){switch(typeof e){case"string":return e;case"number":return e.toString();default:return i.undefinedOrNull(e)?"":e.join(l)}};var g,p,m,b,_;g=function(e,t,n){return e.updateIn(t,s,function(e){return e===s?n():n(e)})};p=function(e,t,n){var r=u(e);var a=i.joinPaths(e._path,t);var s=g(r,a,n);o(e,s);if(r.hasIn(a)){return a}else{return a.slice(0,a.length-1)}};m=function(e,t){var n=i.joinPaths(e._path,t);var a=u(e);var s=n.length;switch(s){case 0:throw new Error("Cannot delete root value");default:var f=n.slice(0,s-1);if(a.has(f[0])||s===1){var l=a.updateIn(f,function(e){var t=n[s-1];if(e instanceof r.List){return e.splice(t,1)}else{return e&&e.remove(t)}});o(e,l)}return f}};b=function(e,t,n){if(i.undefinedOrNull(n)){return t}else{if(n instanceof r.Iterable&&t instanceof r.Iterable){return e?t.mergeDeep(n):n.mergeDeep(t)}else{return e?n:t}}};_=function(e){return e instanceof r.Iterable?e.clear():null};var y=function(e,t,n,r,i){return{currentBackingValue:e,currentBackingMeta:n,previousBackingValue:t,previousBackingMeta:r,metaMetaChanged:i||false}};var w=function(){return Math.random().toString(36).substr(2,9)};var M,C,E,I,B,S;M=function(e,t,n,r,s){var u=s.currentBackingValue;var o=s.previousBackingValue;var f=s.currentBackingMeta;var l=s.previousBackingMeta;i.getPropertyValues(t).forEach(function(e){if(!e.disabled){var t=h(n);var i=u!==o&&u.getIn(t)!==o.getIn(t);var c=s.metaMetaChanged||l&&f!==l&&f.getIn(t)!==l.getIn(t);if(i||c){e.cb(new a(r,t,i,c,s))}}})};C=function(e,t,n){var r=e._sharedInternals.listeners;var i=r[""];if(i){M(e,i,f,t,n)}};E=function(e,t){return e.indexOf(t)===0};I=function(e,t){return t===""||e===t||E(t,e+l)||E(e,t+l)};B=function(e,t,n){var r=e._sharedInternals.listeners;Object.keys(r).filter(i.identity).forEach(function(i){if(I(i,v(t))){M(e,r[i],i,t,n)}})};S=function(e,t,n){C(e,t,n);B(e,t,n)};var P,R;P=function(e,t){e._sharedInternals.metaBindingListenerId=t.addListener(function(n){var r=n.getPath();var i=r.slice(0,r.length-1);var a=u(e);var s=!n.isValueChanged();var o=s?u(t):n.getPreviousValue();S(e,i,y(a,a,u(t),o,s))})};R=function(e,t){var n=t.removeListener(e._sharedInternals.metaBindingListenerId);e._sharedInternals.metaBinding=null;e._sharedInternals.metaBindingListenerId=null;return n};var k,V;k=function(e,t){return i.find(i.getPropertyValues(e._sharedInternals.listeners),function(e){return!!e[t]})};V=function(e,t,n){var r=k(e,t);if(r){r[t].disabled=n}};var O,A;O=function(e,t,n){var r=u(e);var i=p(e,h(t),n);var a=u(e.meta());S(e,i,y(u(e),r,a,a))};A=function(e,t){var n=u(e);var r=m(e,h(t));var i=u(e.meta());S(e,r,y(u(e),n,i,i))};var L=function(e,t){this._path=e||f;this._sharedInternals=t||{};if(!this._sharedInternals.listeners){this._sharedInternals.listeners={}}if(!this._sharedInternals.cache){this._sharedInternals.cache={}}};L.init=function(e,t){var n=new L(f,{backingValue:e||r.Map(),metaBinding:t});if(t){P(n,t)}return n};L.asArrayPath=function(e){return h(e)};L.asStringPath=function(e){return v(e)};L.META_NODE=i.META_NODE;var U={getPath:function(){return this._path},withBackingValue:function(e){var t={};i.assign(t,this._sharedInternals);t.backingValue=e;return new L(this._path,t)},isChanged:function(e,t){var n=this.get();var r=e?e.getIn(this._path):undefined;return t?!t(n,r):!(n===r||i.undefinedOrNull(n)&&i.undefinedOrNull(r))},isRelative:function(e){return this._sharedInternals===e._sharedInternals&&this._sharedInternals.backingValue===e._sharedInternals.backingValue},meta:function(e){if(!this._sharedInternals.metaBinding){var t=L.init(r.Map());P(this,t);this._sharedInternals.metaBinding=t}var n=e?i.joinPaths([i.META_NODE],h(e)):[i.META_NODE];var a=this.getPath();var s=a.length>0?i.joinPaths(a,n):n;return this._sharedInternals.metaBinding.sub(s)},unlinkMeta:function(){var e=this._sharedInternals.metaBinding;return e?R(this,e):false},get:function(e){return d(u(this),i.joinPaths(this._path,h(e)))},toJS:function(e){var t=this.sub(e).get();return t instanceof r.Iterable?t.toJS():t},sub:function(e){var t=h(e);var n=i.joinPaths(this._path,t);if(n.length>0){var r=v(n);var a=this._sharedInternals.cache[r];if(a){return a}else{var s=new L(n,this._sharedInternals);this._sharedInternals.cache[r]=s;return s}}else{return this}},update:function(e,t){var n=i.resolveArgs(arguments,"?subpath","f");O(this,n.subpath,n.f);return this},set:function(e,t){var n=i.resolveArgs(arguments,"?subpath","newValue");O(this,n.subpath,i.constantly(n.newValue));return this},remove:function(e){A(this,e);return this},merge:function(e,t,n){var r=i.resolveArgs(arguments,function(e){return i.canRepresentSubpath(e)?"subpath":null},"?preserve","newValue");O(this,r.subpath,b.bind(null,r.preserve,r.newValue));return this},clear:function(e){var t=h(e);if(!i.undefinedOrNull(this.get(t))){O(this,t,_)}return this},addListener:function(e,t){var n=i.resolveArgs(arguments,function(e){return i.canRepresentSubpath(e)?"subpath":null},"cb");var r=w();var a=v(i.joinPaths(this._path,h(n.subpath||"")));var s=this._sharedInternals.listeners[a];var u={cb:n.cb,disabled:false};if(s){s[r]=u}else{var o={};o[r]=u;this._sharedInternals.listeners[a]=o}return r},addOnceListener:function(e,t){var n=i.resolveArgs(arguments,function(e){return i.canRepresentSubpath(e)?"subpath":null},"cb");var r=this;var a=r.addListener(n.subpath,function(){r.removeListener(a);n.cb()});return a},enableListener:function(e){V(this,e,false);return this},disableListener:function(e){V(this,e,true);return this},withDisabledListener:function(e,t){var n=k(this,e);if(n){var r=n[e];r.disabled=true;i.afterComplete(t,function(){r.disabled=false})}else{t()}return this},removeListener:function(e){var t=k(this,e);return t?delete t[e]:false},atomically:function(e){return new x(this,e)}};U["delete"]=U.remove;L.prototype=U;var x=function(e,t){this._binding=e;this._queuedUpdates=[];this._finishedUpdates=[];this._committed=false;this._cancelled=false;this._hasChanges=false;this._hasMetaChanges=false;if(t){var n=this;t.then(i.identity,function(){if(!n.isCancelled()){n.cancel()}})}};x.prototype=function(){var e=Object.freeze({UPDATE:"update",DELETE:"delete"});var t,n;t=function(e,t){if(!e._hasChanges){e._hasChanges=t.isRelative(e._binding)}if(!e._hasMetaChanges){e._hasMetaChanges=!t.isRelative(e._binding)}};n=function(e){return e._hasChanges||e._hasMetaChanges};var r,a,s,o,f;r=function(n,r,i,a){t(n,r);n._queuedUpdates.push({binding:r,update:i,subpath:a,type:e.UPDATE})};a=function(n,r,i){t(n,r);n._queuedUpdates.push({binding:r,subpath:i,type:e.DELETE})};s=function(e,t){var n=e.length,r=t.length;return n===r&&(n===1||e[n-2]===t[n-2])};o=function(e){if(e.length<2){return e}else{var t=e.sort();var n=t[0],r=v(n);var i=[n];for(var a=1;a0){var n=e._binding.atomically();for(var r=t.length;r-->0;){var i=t[r];var a=i.binding,s=i.affectedPath;var u=a.getPath().length===s.length?s:s.slice(a.getPath().length);n.set(a,u,i.previousBackingValue.getIn(s))}n.commit()}e._finishedUpdates=null};var c=function(e){if(e.isCommitted()){l(e)}e._cancelled=true};var d={update:function(e,t,n){var a=i.resolveArgs(arguments,function(e){return e instanceof L?"binding":null},"?subpath","f");r(this,a.binding||this._binding,a.f,h(a.subpath));return this},set:function(e,t,n){var r=i.resolveArgs(arguments,function(e){return e instanceof L?"binding":null},"?subpath","newValue");return this.update(r.binding,r.subpath,i.constantly(r.newValue))},remove:function(e,t){var n=i.resolveArgs(arguments,function(e){return e instanceof L?"binding":null},"?subpath");a(this,n.binding||this._binding,h(n.subpath));return this},merge:function(e,t,n,r){var a=i.resolveArgs(arguments,function(e){return e instanceof L?"binding":null},function(e){return i.canRepresentSubpath(e)?"subpath":null},function(e){return typeof e==="boolean"?"preserve":null},"newValue");return this.update(a.binding,a.subpath,b.bind(null,a.preserve,a.newValue))},clear:function(e,t){var n=i.resolveArgs(arguments,function(e){return e instanceof L?"binding":null},"?subpath");r(this,n.binding||this._binding,_,h(n.subpath));return this},commit:function(e){if(!this.isCommitted()){if(!this.isCancelled()&&n(this)){var t=e||{};var r=this._binding;var i=r.meta();var a=null,s=null;if(t.notify!==false){a=u(r);s=u(i)}this._finishedUpdates=f(this);var l=this._finishedUpdates.map(function(e){return e.affectedPath});if(t.notify!==false){var c=o(l);var d=y(u(r),a,u(i),s);C(r,c[0],d);c.forEach(function(e){B(r,e,d)})}}return this}else{throw new Error("Morearty: transaction already committed")}},cancel:function(){if(!this.isCancelled()){c(this)}else{throw new Error("Morearty: transaction already cancelled")}},isCommitted:function(){return this._committed},isCancelled:function(){return this._cancelled}};d["delete"]=d.remove;return d}();t.exports=L}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./ChangesDescriptor":3,"./Util":7}],3:[function(e,t,n){var r=e("./Util");var i=function(e,t,n,i,a){this._path=e;this._listenerPath=t;this._metaPath=r.joinPaths(t,[r.META_NODE]);this._valueChanged=n;this._metaChanged=i;this._currentBackingValue=a.currentBackingValue;this._previousBackingValue=a.previousBackingValue;this._currentBackingMeta=a.currentBackingMeta;this._previousBackingMeta=a.previousBackingMeta};i.prototype={getPath:function(){var e=this._listenerPath.length;return e===this._path.length?[]:this._path.slice(e)},isValueChanged:function(){return this._valueChanged},isMetaChanged:function(){return this._metaChanged},getCurrentValue:function(){return this._currentBackingValue.getIn(this._listenerPath)},getPreviousValue:function(){return this._previousBackingValue.getIn(this._listenerPath)},getCurrentMeta:function(){return this._currentBackingMeta?this._currentBackingMeta.getIn(this._metaPath):null},getPreviousMeta:function(){return this._previousBackingMeta?this._previousBackingMeta.getIn(this._metaPath):null},getPreviousBackingValue:function(){return this._previousBackingValue},getPreviousBackingMeta:function(){return this._previousBackingMeta||null}};t.exports=i},{"./Util":7}],4:[function(e,t,n){(function(n){var r=e("./Util");var i=typeof window!=="undefined"?window["React"]:typeof n!=="undefined"?n["React"]:null;var a=function(){if(i)return i.DOM;else{throw new Error("Morearty: global variable React not found")}}();var s=function(e,t){return i.createClass({displayName:t,getInitialState:function(){return{value:this.props.value}},onChange:function(e){var t=this.props.onChange;if(t){t(e);this.setState({value:e.target.value})}},componentWillReceiveProps:function(e){this.setState({value:e.value})},render:function(){var t=r.assign({},this.props,{value:this.state.value,onChange:this.onChange,children:this.props.children});return e(t)}})};var u={input:s(a.input,"input"),textarea:s(a.textarea,"textarea"),option:s(a.option,"option")};t.exports=u}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./Util":7}],5:[function(e,t,n){(function(n){var r=typeof window!=="undefined"?window["Immutable"]:typeof n!=="undefined"?n["Immutable"]:null;var i=e("./Binding");var a,s,u,o,f,l,c;a=function(e){return e.meta("history")};s=function(e){e.set(r.fromJS({listenerId:null,undo:[],redo:[]}))};u=function(e){var t=e.get("listenerId");e.withDisabledListener(t,function(){e.atomically().set("undo",r.List.of()).set("redo",r.List.of()).commit()})};o=function(e,t){var n=a(e);var r=n.get("listenerId");e.removeListener(r);n.atomically().set(null).commit({notify:t})};f=function(e,t){var n=e.addListener([],function(n){if(n.isValueChanged()){t.atomically().update(function(t){var a=n.getPath();var s=n.getPreviousValue(),u=e.get();return t.update("undo",function(e){var t=i.asArrayPath(a);return e&&e.unshift(r.Map({newValue:t.length?u.getIn(t):u,oldValue:t.length?s&&s.getIn(t):s,path:a}))}).set("redo",r.List.of())}).commit({notify:false})}});t.atomically().set("listenerId",n).commit({notify:false})};l=function(e,t,n,r){r.withDisabledListener(n,function(){r.set(e,t)})};c=function(e,t,n,r,i){var a=t.get();if(!a.isEmpty()){var s=a.get(0);t.atomically().remove(0).update(n,function(e){return e.unshift(s)}).commit({notify:false});l(s.get("path"),s.get(i),r,e);return true}else{return false}};var d={init:function(e){var t=a(e);s(t);f(e,t)},clear:function(e){var t=a(e);u(t)},destroy:function(e,t){var n=t||{};o(e,n.notify)},hasUndo:function(e){var t=a(e);var n=t.get("undo");return!!n&&!n.isEmpty()},hasRedo:function(e){var t=a(e);var n=t.get("redo");return!!n&&!n.isEmpty()},undo:function(e){var t=a(e);var n=t.get("listenerId");var r=t.sub("undo");var i=t.sub("redo");return c(e,r,i,n,"oldValue")},redo:function(e){var t=a(e);var n=t.get("listenerId");var r=t.sub("undo");var i=t.sub("redo");return c(e,i,r,n,"newValue")}};t.exports=d}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./Binding":2}],6:[function(e,t,n){(function(n){var r=typeof window!=="undefined"?window["Immutable"]:typeof n!=="undefined"?n["Immutable"]:null;var i=e("./Util");var a=e("./Binding");var s=e("./History");var u=e("./util/Callback");var o=Object.freeze({OVERWRITE:"overwrite",OVERWRITE_EMPTY:"overwrite-empty",MERGE_PRESERVE:"merge-preserve",MERGE_REPLACE:"merge-replace"});var f,l,c;f=function(e,t){var n=e.binding;return t?n[t]:n};l=function(e,t,n,r){return e._stateChanged&&n!==t.get()||e._metaChanged&&e._metaBinding.sub(t.getPath()).isChanged(r)};c=function(e,t,n,r,s){if(!t)return false;else{var u=e.getMoreartyContext();if(t instanceof a){return t!==n||l(u,t,r,s)}else{if(u._stateChanged||u._metaChanged){var o=Object.keys(t);return!!i.find(o,function(e){var i=t[e];return i&&(i!==n[e]||l(u,i,r[e],s))})}else{return false}}}};var d,h,v;d=function(e,t,n){return t[e]!==n[e]};h=function(e){var t=0;for(var n in e)++t;return t};v=function(e,t){var n=t||{},r=e.props||{};if(h(n)!==h(r)){return true}else{for(var i in n){if(i!=="binding"&&d(i,n,r))return true}return false}};var g=function(e,t,n){var a=n.atomically();if(typeof e==="function"){a=a.update(function(n){return e(n,t)})}else{switch(e){case o.OVERWRITE:a=a.set(t);break;case o.OVERWRITE_EMPTY:a=a.update(function(e){var n=i.undefinedOrNull(e)||e instanceof r.Iterable&&e.isEmpty();return n?t:e});break;case o.MERGE_PRESERVE:a=a.merge(true,t);break;case o.MERGE_REPLACE:a=a.merge(false,t);break;default:throw new Error("Invalid merge strategy: "+e)}}a.commit({notify:false})};var p=function(e){var t=typeof window!=="undefined"&&window.requestAnimationFrame;var n=function(e){setTimeout(e,1e3/60)};if(e._options.requestAnimationFrameEnabled){if(t)return t;else{console.warn("Morearty: requestAnimationFrame is not available, will render using setTimeout");return n}}else{return n}};var m,b,_,y;m=function(e,t,n){if(typeof e[t]==="function"){var i=e[t]();if(i){var s=f(e.props);var u=typeof e.getMergeStrategy==="function"?e.getMergeStrategy():o.MERGE_PRESERVE;var l=i instanceof r.Iterable;if(s instanceof a){var c=l?i:i["default"];g(u,c,n(s))}else{var d=Object.keys(s);var h=d.length===1?d[0]:"default";var v=typeof u==="string"?u:u[h];if(l){g(v,i,n(s[h]))}else{d.forEach(function(e){if(i[e]){g(v,i[e],n(s[e]))}})}}}}};b=function(e){m(e,"getDefaultState",i.identity)};_=function(e){m(e,"getDefaultMetaState",function(e){return e.meta()})};y=function(e){var t=e.props.binding;if(t){var n=e.getMoreartyContext();e._previousMetaState=n&&n.getCurrentMeta();if(t instanceof a){e._previousState=t.get()}else{e._previousState={};Object.keys(e.props.binding).forEach(function(t){e._previousState[t]=e.props.binding[t]&&e.props.binding[t].get()})}}else{e._previousState=null;e._previousMetaState=null}};var w,M,C,E;w=function(e,t){e._componentQueue[t.componentQueueId]=t};M=function(e,t){delete e._componentQueue[t.componentQueueId]};C=function(e){return e?++e._lastComponentQueueId:0};E=function(e,t){if(!e._observedListenerRemovers){e._observedListenerRemovers=[]}var n=t.addListener(function(){w(e.getMoreartyContext(),e)});e._observedListenerRemovers.push(function(){t.removeListener(n)})};t.exports=function(e,t){var n=function(e,t,n){this._initialMetaState=t.get();this._previousMetaState=null;this._metaBinding=t;this._metaChanged=false;this._initialState=e.get();this._previousState=null;this._stateBinding=e;this._stateChanged=false;this._options=n;this._renderQueued=false;this._fullUpdateQueued=false;this._fullUpdateInProgress=false;this._componentQueue=[];this._lastComponentQueueId=0};var l={getBinding:function(){return this._stateBinding},getMetaBinding:function(){return this._metaBinding},getCurrentState:function(){return this.getBinding().get()},getPreviousState:function(){return this._previousState},getCurrentMeta:function(){var e=this.getMetaBinding();return e?e.get():undefined},getPreviousMeta:function(){return this._previousMetaState},copy:function(e){return new n(this._stateBinding.sub(e),this._metaBinding.sub(e),this._options)},resetState:function(e,t){var n=i.resolveArgs(arguments,function(e){return i.canRepresentSubpath(e)?"subpath":null},"?options");var r=n.subpath?a.asArrayPath(n.subpath):[];var s=this.getBinding().atomically();s.set(r,this._initialState.getIn(r));var u=n.options||{};if(u.resetMeta!==false){s.set(this.getMetaBinding(),r,this._initialMetaState.getIn(r))}s.commit({notify:u.notify})},replaceState:function(e,t,n){var a=i.resolveArgs(arguments,"newState",function(e){return e instanceof r.Map?"newMetaState":null},"?options");var s=a.options||{};var u=this.getBinding().atomically();u.set(e);if(a.newMetaState)u.set(this.getMetaBinding(),a.newMetaState);u.commit({notify:s.notify})},isChanged:function(e,t,n){var a=i.resolveArgs(arguments,"binding",function(e){return i.canRepresentSubpath(e)?"subpath":null},"?compare");return a.binding.sub(a.subpath).isChanged(this._previousState,a.compare||r.is)},init:function(e){var t=this;var n=false;var r=[];var a=function(){var e,n;if(r.length===1){var a=r[0];e=a.stateChanged;n=a.metaChanged;if(e)t._previousState=a.previousState;if(n)t._previousMetaState=a.previousMetaState}else{var s=i.find(r,function(e){return e.stateChanged});var u=i.find(r,function(e){return e.metaChanged});e=!!s;n=!!u;if(e)t._previousState=s.previousState;if(n)t._previousMetaState=u.previousMetaState}t._stateChanged=e;t._metaChanged=n;r=[]};var s=function(e,t){if(e.isMounted()){e.forceUpdate(t)}};var u=function(e){try{e()}catch(r){if(t._options.stopOnRenderError){n=true}console.error("Morearty: render error. "+(n?"Will exit on next render attempt.":"Continuing."));console.error("Error details: %s",r.message,r.stack)}};var o=function(){a();t._renderQueued=false;u(function(){if(t._fullUpdateQueued){t._fullUpdateInProgress=true;s(e,function(){t._fullUpdateQueued=false;t._fullUpdateInProgress=false})}else{s(e);t._componentQueue.forEach(function(e){s(e);y(e)});t._componentQueue=[]}})};if(!t._options.renderOnce){var f=p(t);var l=t._stateBinding.addListener(function(e){if(n){t._stateBinding.removeListener(l)}else{var i=e.isValueChanged(),a=e.isMetaChanged();if(i||a){r.push({stateChanged:i,metaChanged:a,previousState:(i||null)&&e.getPreviousBackingValue(),previousMetaState:(a||null)&&e.getPreviousBackingMeta()});if(!t._renderQueued){t._renderQueued=true;f(o)}}}})}u(e.forceUpdate.bind(e))},queueFullUpdate:function(){this._fullUpdateQueued=true},bootstrap:function(t,r){var a=this;var s=r||{};s.morearty=a;return e.createClass({displayName:"Bootstrap",childContextTypes:{morearty:e.PropTypes.instanceOf(n).isRequired},getChildContext:function(){return s},componentWillMount:function(){a.init(this)},render:function(){var n=i.assign({},{binding:a.getBinding()},this.props);return e.createFactory(t)(n)}})}};n.prototype=l;return{Binding:a,History:s,Util:i,Callback:u,DOM:t,MergeStrategy:o,Mixin:{contextTypes:{morearty:e.PropTypes.instanceOf(n).isRequired},getMoreartyContext:function(){return this.context.morearty},getBinding:function(e){return f(this.props,e)},getDefaultBinding:function(){var e=f(this.props);if(e){if(e instanceof a){return e}else if(typeof e==="object"){var t=Object.keys(e);return t.length===1?e[t[0]]:e["default"]}}else{return this.observedBindings&&this.observedBindings[0]}},getPreviousState:function(e){var t=this.getMoreartyContext();return f(this.props,e).withBackingValue(t._previousState).get()},observeBinding:function(e,t){if(!this.observedBindings){this.observedBindings=[]}var n=e.getPath();if(!i.find(this.observedBindings,function(e){return e.getPath()===n})){this.observedBindings.push(e);E(this,e)}return t?t(e.get()):undefined},componentWillMount:function(){this.componentQueueId=C(this.getMoreartyContext());y(this);b(this);_(this);if(this.observedBindings){this.observedBindings.forEach(E.bind(null,this))}},shouldComponentUpdate:function(e,t,n){var r=this;var i=r.getMoreartyContext();var a=r._previousState;var s=r._previousMetaState;y(r);var u=function(){return i._fullUpdateInProgress||c(r,f(e),f(r.props),a,s)||v(r,e)};var o=r.shouldComponentUpdateOverride;return o?o(u,e,t,n):u()},addBindingListener:function(e,t,n){var r=i.resolveArgs(arguments,function(e){return e instanceof a?"binding":null},function(e){return i.canRepresentSubpath(e)?"subpath":null},"cb");if(!this._bindingListenerRemovers){this._bindingListenerRemovers=[]}var s=r.binding||this.getDefaultBinding();if(!s){return console.warn("Morearty: cannot attach binding listener to a component without default binding")}var u=s.addListener(r.subpath,r.cb);this._bindingListenerRemovers.push(function(){s.removeListener(u)});return u},componentDidUpdate:function(){M(this.getMoreartyContext(),this)},componentWillUnmount:function(){if(this._observedListenerRemovers){this._observedListenerRemovers.forEach(function(e){e()});this._observedListenerRemovers=[]}if(this._bindingListenerRemovers){this._bindingListenerRemovers.forEach(function(e){e()});this._bindingListenerRemovers=[]}}},createContext:function(e){var t,i,s;if(arguments.length<=1){var u=e||{};t=u.initialState;i=u.initialMetaState;s=u.options}else{console.warn("Passing multiple arguments to createContext is deprecated. Use single object form instead.");t=arguments[0];i=arguments[1];s=arguments[2]}var o=function(e){return e instanceof r.Iterable?e:r.fromJS(e)};var f=o(t||{});var l=o(i||{});var c=a.init(l);var d=a.init(f,c);var h=s||{};return new n(d,c,{requestAnimationFrameEnabled:h.requestAnimationFrameEnabled!==false,renderOnce:h.renderOnce||false,stopOnRenderError:h.stopOnRenderError||false})}}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./Binding":2,"./History":5,"./Util":7,"./util/Callback":8}],7:[function(e,t,n){var r,i,a;r=function(e){return typeof e==="string"&&e.charAt(0)!=="?"};i=function(e,t){var n=t(e[0]);for(var r=1;r1){var s=Array.isArray(t)?t:Array.prototype.slice.call(arguments,1);var u,o;var f;if(r(s[0])||!(f=i(s,r))){u=s;o=e}else{var l=Array.isArray(e)?e:Array.prototype.slice.call(e);u=a(s,f);o=a(l,l.length-(s.length-f))}for(var c=0,d=0;c