text: !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={};e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){(function(t){var e=n(2),r=n(14),i=n(4),o=n(8);t.React=e,t.ReactDOMServer=r,t.createReactClass=i,t.PropTypes=o}).call(e,function(){return this}())},function(t){"use strict";function e(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function n(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=n()?Object.assign:function(t){for(var n,a,s=e(t),u=1;u<arguments.length;u++){for(var c in n=Object(arguments[u]))i.call(n,c)&&(s[c]=n[c]);if(r){a=r(n);for(var l=0;l<a.length;l++)o.call(n,a[l])&&(s[a[l]]=n[a[l]])}}return s}},function(t,e,n){"use strict";t.exports=n(10)},function(t,e,n){"use strict";function r(t){return t}function i(t,e,n){function i(t,e){var n=g.hasOwnProperty(e)?g[e]:null;x.hasOwnProperty(e)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",e),t&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",e)}function c(t,n){if(n){s("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!e(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=t.prototype,o=r.__reactAutoBindPairs;for(var a in n.hasOwnProperty(u)&&b.mixins(t,n.mixins),n)if(n.hasOwnProperty(a)&&a!==u){var c=n[a],l=r.hasOwnProperty(a);if(i(l,a),b.hasOwnProperty(a))b[a](t,c);else{var h=g.hasOwnProperty(a);if("function"==typeof c&&!h&&!l&&!1!==n.autobind)o.push(a,c),r[a]=c;else if(l){var d=g[a];s(h&&("DEFINE_MANY_MERGED"===d||"DEFINE_MANY"===d),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",d,a),"DEFINE_MANY_MERGED"===d?r[a]=p(r[a],c):"DEFINE_MANY"===d&&(r[a]=f(r[a],c))}else r[a]=c}}}}function l(t,e){if(e)for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){if(s(!(n in b),'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n),n in t){var i=_.hasOwnProperty(n)?_[n]:null;return s("DEFINE_MANY_MERGED"===i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),void(t[n]=p(t[n],r))}t[n]=r}}}function h(t,e){for(var n in s(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."),e)e.hasOwnProperty(n)&&(s(void 0===t[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),t[n]=e[n]);return t}function p(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var i={};return h(i,n),h(i,r),i}}function f(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function d(t,e){return e.bind(t)}function m(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t[r]=d(t,i)}}function y(t){var e=r(function(t,r,i){this.__reactAutoBindPairs.length&&m(this),this.props=t,this.context=r,this.refs=a,this.updater=i||n,this.state=null;var o=this.getInitialState?this.getInitialState():null;s("object"==typeof o&&!Array.isArray(o),"%s.getInitialState(): must return an object or null",e.displayName||"ReactCompositeComponent"),this.state=o});for(var i in e.prototype=new R,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],v.forEach(c.bind(null,e)),c(e,E),c(e,t),c(e,w),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),s(e.prototype.render,"createClass(...): Class specification must implement a `render` method."),g)e.prototype[i]||(e.prototype[i]=null);return e}var v=[],g={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},_={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},b={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)c(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=o({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=o({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=p(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=o({},t.propTypes,e)},statics:function(t,e){l(t,e)},autobind:function(){}},E={componentDidMount:function(){this.__isMounted=!0}},w={componentWillUnmount:function(){this.__isMounted=!1}},x={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e)},isMounted:function(){return!!this.__isMounted}},R=function(){};return o(R.prototype,t.prototype,x),y}var o=n(1),a=n(5),s=n(6),u="mixins";t.exports=i},function(t,e,n){"use strict";var r=n(2),i=n(3);if(void 0===r)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var o=(new r.Component).updater;t.exports=i(r.Component,r.isValidElement,o)},function(t){"use strict";var e={};t.exports=e},function(t){"use strict";function e(t,e,r,i,o,a,s,u){if(n(e),!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 l=[r,i,o,a,s,u],h=0;(c=new Error(e.replace(/%s/g,function(){return l[h++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}var n=function(){};t.exports=e},function(t,e,n){"use strict";function r(){}function i(){}var o=n(9);i.resetWarningCache=r,t.exports=function(){function t(t,e,n,r,i,a){if(a!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},function(t,e,n){t.exports=n(7)()},function(t){"use strict";var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=e},function(t,e,n){
  /** @license React v16.9.0
  	 * react.production.min.js
  	 *
  	 * Copyright (c) Facebook, Inc. and its affiliates.
  	 *
  	 * This source code is licensed under the MIT license found in the
  	 * LICENSE file in the root directory of this source tree.
  	 */
  "use strict";function r(t){for(var e=t.message,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r]);return t.message="Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",t}function i(t,e,n){this.props=t,this.context=e,this.refs=j,this.updater=n||P}function o(){}function a(t,e,n){this.props=t,this.context=e,this.refs=j,this.updater=n||P}function s(t,e,n){var r=void 0,i={},o=null,a=null;if(null!=e)for(r in void 0!==e.ref&&(a=e.ref),void 0!==e.key&&(o=""+e.key),e)$.call(e,r)&&!H.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(1===s)i.children=n;else if(1<s){for(var u=Array(s),c=0;c<s;c++)u[c]=arguments[c+2];i.children=u}if(t&&t.defaultProps)for(r in s=t.defaultProps)void 0===i[r]&&(i[r]=s[r]);return{$$typeof:w,type:t,key:o,ref:a,props:i,_owner:B.current}}function u(t,e){return{$$typeof:w,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function c(t){return"object"==typeof t&&null!==t&&t.$$typeof===w}function l(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,function(t){return e[t]})}function h(t,e,n,r){if(W.length){var i=W.pop();return i.result=t,i.keyPrefix=e,i.func=n,i.context=r,i.count=0,i}return{result:t,keyPrefix:e,func:n,context:r,count:0}}function p(t){t.result=null,t.keyPrefix=null,t.func=null,t.context=null,t.count=0,10>W.length&&W.push(t)}function f(t,e,n,i){var o=typeof t;"undefined"!==o&&"boolean"!==o||(t=null);var a=!1;if(null===t)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case w:case x:a=!0}}if(a)return n(i,t,""===e?"."+m(t,0):e),1;if(a=0,e=""===e?".":e+":",Array.isArray(t))for(var s=0;s<t.length;s++){var u=e+m(o=t[s],s);a+=f(o,u,n,i)}else if(null===t||"object"!=typeof t?u=null:u="function"==typeof(u=I&&t[I]||t["@@iterator"])?u:null,"function"==typeof u)for(t=u.call(t),s=0;!(o=t.next()).done;)a+=f(o=o.value,u=e+m(o,s++),n,i);else if("object"===o)throw n=""+t,r(Error(31),"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,"");return a}function d(t,e,n){return null==t?0:f(t,"",e,n)}function m(t,e){return"object"==typeof t&&null!==t&&null!=t.key?l(t.key):e.toString(36)}function y(t,e){t.func.call(t.context,e,t.count++)}function v(t,e,n){var r=t.result,i=t.keyPrefix;t=t.func.call(t.context,e,t.count++),Array.isArray(t)?g(t,r,n,function(t){return t}):null!=t&&(c(t)&&(t=u(t,i+(!t.key||e&&e.key===t.key?"":(""+t.key).replace(Y,"$&/")+"/")+n)),r.push(t))}function g(t,e,n,r,i){var o="";null!=n&&(o=(""+n).replace(Y,"$&/")+"/"),d(t,v,e=h(e,o,r,i)),p(e)}function _(){var t=L.current;if(null===t)throw r(Error(321));return t}var b=n(1),E="function"==typeof Symbol&&Symbol["for"],w=E?Symbol["for"]("react.element"):60103,x=E?Symbol["for"]("react.portal"):60106,R=E?Symbol["for"]("react.fragment"):60107,S=E?Symbol["for"]("react.strict_mode"):60108,k=E?Symbol["for"]("react.profiler"):60114,C=E?Symbol["for"]("react.provider"):60109,N=E?Symbol["for"]("react.context"):60110,A=E?Symbol["for"]("react.forward_ref"):60112,M=E?Symbol["for"]("react.suspense"):60113,T=E?Symbol["for"]("react.suspense_list"):60120,O=E?Symbol["for"]("react.memo"):60115,D=E?Symbol["for"]("react.lazy"):60116;E&&Symbol["for"]("react.fundamental"),E&&Symbol["for"]("react.responder");var I="function"==typeof Symbol&&Symbol.iterator,P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j={};i.prototype.isReactComponent={},i.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw r(Error(85));this.updater.enqueueSetState(this,t,e,"setState")},i.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},o.prototype=i.prototype;var F=a.prototype=new o;F.constructor=a,b(F,i.prototype),F.isPureReactComponent=!0;var L={current:null},U={suspense:null},B={current:null},$=Object.prototype.hasOwnProperty,H={key:!0,ref:!0,__self:!0,__source:!0},Y=/\/+/g,W=[],G={Children:{map:function(t,e,n){if(null==t)return t;var r=[];return g(t,r,null,e,n),r},forEach:function(t,e,n){return null==t?t:(d(t,y,e=h(null,null,e,n)),void p(e))},count:function(t){return d(t,function(){return null},null)},toArray:function(t){var e=[];return g(t,e,null,function(t){return t}),e},only:function(t){if(!c(t))throw r(Error(143));return t}},createRef:function(){return{current:null}},Component:i,PureComponent:a,createContext:function(t,e){return void 0===e&&(e=null),(t={$$typeof:N,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:C,_context:t},t.Consumer=t},forwardRef:function(t){return{$$typeof:A,render:t}},lazy:function(t){return{$$typeof:D,_ctor:t,_status:-1,_result:null}},memo:function(t,e){return{$$typeof:O,type:t,compare:void 0===e?null:e}},useCallback:function(t,e){return _().useCallback(t,e)},useContext:function(t,e){return _().useContext(t,e)},useEffect:function(t,e){return _().useEffect(t,e)},useImperativeHandle:function(t,e,n){return _().useImperativeHandle(t,e,n)},useDebugValue:function(){},useLayoutEffect:function(t,e){return _().useLayoutEffect(t,e)},useMemo:function(t,e){return _().useMemo(t,e)},useReducer:function(t,e,n){return _().useReducer(t,e,n)},useRef:function(t){return _().useRef(t)},useState:function(t){return _().useState(t)},Fragment:R,Profiler:k,StrictMode:S,Suspense:M,unstable_SuspenseList:T,createElement:s,cloneElement:function(t,e,n){if(null==t)throw r(Error(267),t);var i=void 0,o=b({},t.props),a=t.key,s=t.ref,u=t._owner;if(null!=e){void 0!==e.ref&&(s=e.ref,u=B.current),void 0!==e.key&&(a=""+e.key);var c=void 0;for(i in t.type&&t.type.defaultProps&&(c=t.type.defaultProps),e)$.call(e,i)&&!H.hasOwnProperty(i)&&(o[i]=void 0===e[i]&&void 0!==c?c[i]:e[i])}if(1===(i=arguments.length-2))o.children=n;else if(1<i){c=Array(i);for(var l=0;l<i;l++)c[l]=arguments[l+2];o.children=c}return{$$typeof:w,type:t.type,key:a,ref:s,props:o,_owner:u}},createFactory:function(t){var e=s.bind(null,t);return e.type=t,e},isValidElement:c,version:"16.9.0",unstable_withSuspenseConfig:function(t,e){var n=U.suspense;U.suspense=void 0===e?null:e;try{t()}finally{U.suspense=n}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:L,ReactCurrentBatchConfig:U,ReactCurrentOwner:B,IsSomeRendererActing:{current:!1},assign:b}},z={"default":G},q=z&&G||z;t.exports=q["default"]||q},function(t,e,n){
  /** @license React v16.9.0
  	 * react-dom-server.browser.production.min.js
  	 *
  	 * Copyright (c) Facebook, Inc. and its affiliates.
  	 *
  	 * This source code is licensed under the MIT license found in the
  	 * LICENSE file in the root directory of this source tree.
  	 */
  "use strict";function r(t){for(var e=t.message,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r]);return t.message="Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",t}function i(t){if(null==t)return null;if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case M:return"Fragment";case A:return"Portal";case O:return"Profiler";case T:return"StrictMode";case F:return"Suspense";case L:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case I:return"Context.Consumer";case D:return"Context.Provider";case j:var e=t.render;return e=e.displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case U:return i(t.type);case B:if(t=1===t._status?t._result:null)return i(t)}return null}function o(t,e){for(var n=0|t._threadCount;n<=e;n++)t[n]=t._currentValue2,t._threadCount=n+1}function a(t,e,n,r){if(r&&("object"==typeof(r=t.contextType)&&null!==r))return o(r,n),r[n];if(t=t.contextTypes){for(var i in n={},t)n[i]=e[i];e=n}else e=Y;return e}function s(t){return!!q.call(J,t)||!q.call(V,t)&&(z.test(t)?J[t]=!0:(V[t]=!0,!1))}function u(t,e,n,r){if(null!==n&&0===n.type)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(t=t.toLowerCase().slice(0,5))&&"aria-"!==t);default:return!1}}function c(t,e,n,r){if(null==e||u(t,e,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!e;case 4:return!1===e;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function l(t,e,n,r,i,o){this.acceptsBooleans=2===e||3===e||4===e,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o}function h(t){return t[1].toUpperCase()}function p(t){if("boolean"==typeof t||"number"==typeof t)return""+t;t=""+t;var e=Z.exec(t);if(e){var n,r="",i=0;for(n=e.index;n<t.length;n++){switch(t.charCodeAt(n)){case 34:e="&quot;";break;case 38:e="&amp;";break;case 39:e="&#x27;";break;case 60:e="&lt;";break;case 62:e="&gt;";break;default:continue}i!==n&&(r+=t.substring(i,n)),i=n+1,r+=e}t=i!==n?r+t.substring(i,n):r}return t}function f(t,e){var n,r=K.hasOwnProperty(t)?K[t]:null;return(n="style"!==t)&&(n=null!==r?0===r.type:2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])),n||c(t,e,r,!1)?"":null!==r?(t=r.attributeName,3===(n=r.type)||4===n&&!0===e?t+'=""':(r.sanitizeURL&&(e=""+e),t+'="'+p(e)+'"')):s(t)?t+'="'+p(e)+'"':""}function d(){if(null===Q)throw r(Error(321));return Q}function m(){if(0<ot)throw r(Error(312));return{memoizedState:null,queue:null,next:null}}function y(){return null===et?null===tt?(nt=!1,tt=et=m()):(nt=!0,et=tt):null===et.next?(nt=!1,et=et.next=m()):(nt=!0,et=et.next),et}function v(t,e,n,r){for(;rt;)rt=!1,ot+=1,et=null,n=t(e,r);return tt=Q=null,ot=0,et=it=null,n}function g(t,e){return"function"==typeof e?e(t):e}function _(t,e,n){if(Q=d(),et=y(),nt){var r=et.queue;if(e=r.dispatch,null!==it&&void 0!==(n=it.get(r))){it["delete"](r),r=et.memoizedState;do{r=t(r,n.action),n=n.next}while(null!==n);return et.memoizedState=r,[r,e]}return[et.memoizedState,e]}return t=t===g?"function"==typeof e?e():e:void 0!==n?n(e):e,et.memoizedState=t,t=(t=et.queue={last:null,dispatch:null}).dispatch=b.bind(null,Q,t),[et.memoizedState,t]}function b(t,e,n){if(!(25>ot))throw r(Error(301));if(t===Q)if(rt=!0,t={action:n,next:null},null===it&&(it=new Map),void 0===(n=it.get(e)))it.set(e,t);else{for(e=n;null!==e.next;)e=e.next;e.next=t}}function E(){}function w(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function x(t){if(null==t)return t;var e="";return C.Children.forEach(t,function(t){null!=t&&(e+=t)}),e}function R(t,e){if(void 0===t)throw r(Error(152),i(e)||"Component")}function S(t,e,n){function o(o,s){var u=s.prototype&&s.prototype.isReactComponent,c=a(s,e,n,u),l=[],h=!1,p={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===l)return null},enqueueReplaceState:function(t,e){h=!0,l=[e]},enqueueSetState:function(t,e){return null===l?null:void l.push(e)}},f=void 0;if(u)f=new s(o.props,c,p),"function"==typeof s.getDerivedStateFromProps&&(null!=(u=s.getDerivedStateFromProps.call(null,o.props,f.state))&&(f.state=k({},f.state,u)));else if(Q={},f=s(o.props,c,p),null==(f=v(s,o.props,f,c))||null==f.render)return void R(t=f,s);if(f.props=o.props,f.context=c,f.updater=p,void 0===(p=f.state)&&(f.state=p=null),"function"==typeof f.UNSAFE_componentWillMount||"function"==typeof f.componentWillMount)if("function"==typeof f.componentWillMount&&"function"!=typeof s.getDerivedStateFromProps&&f.componentWillMount(),"function"==typeof f.UNSAFE_componentWillMount&&"function"!=typeof s.getDerivedStateFromProps&&f.UNSAFE_componentWillMount(),l.length){p=l;var d=h;if(l=null,h=!1,d&&1===p.length)f.state=p[0];else{u=d?p[0]:f.state;var m=!0;for(d=d?1:0;d<p.length;d++){var y=p[d];null!=(y="function"==typeof y?y.call(f,u,o.props,c):y)&&(m?(m=!1,u=k({},u,y)):k(u,y))}f.state=u}}else l=null;if(R(t=f.render(),s),o=void 0,"function"==typeof f.getChildContext&&"object"==typeof(c=s.childContextTypes))for(var g in o=f.getChildContext())if(!(g in c))throw r(Error(108),i(s)||"Unknown",g);o&&(e=k({},e,o))}for(;C.isValidElement(t);){var s=t,u=s.type;if("function"!=typeof u)break;o(s,u)}return{child:t,context:e}}var k=n(1),C=n(2),N="function"==typeof Symbol&&Symbol["for"],A=N?Symbol["for"]("react.portal"):60106,M=N?Symbol["for"]("react.fragment"):60107,T=N?Symbol["for"]("react.strict_mode"):60108,O=N?Symbol["for"]("react.profiler"):60114,D=N?Symbol["for"]("react.provider"):60109,I=N?Symbol["for"]("react.context"):60110,P=N?Symbol["for"]("react.concurrent_mode"):60111,j=N?Symbol["for"]("react.forward_ref"):60112,F=N?Symbol["for"]("react.suspense"):60113,L=N?Symbol["for"]("react.suspense_list"):60120,U=N?Symbol["for"]("react.memo"):60115,B=N?Symbol["for"]("react.lazy"):60116,$=N?Symbol["for"]("react.fundamental"):60117,H=C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;H.hasOwnProperty("ReactCurrentDispatcher")||(H.ReactCurrentDispatcher={current:null}),H.hasOwnProperty("ReactCurrentBatchConfig")||(H.ReactCurrentBatchConfig={suspense:null});for(var Y={},W=new Uint16Array(16),G=0;15>G;G++)W[G]=G+1;W[15]=0;var z=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,q=Object.prototype.hasOwnProperty,V={},J={},K={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){K[t]=new l(t,0,!1,t,null,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];K[e]=new l(e,1,!1,t[1],null,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){K[t]=new l(t,2,!1,t.toLowerCase(),null,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){K[t]=new l(t,2,!1,t,null,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){K[t]=new l(t,3,!1,t.toLowerCase(),null,!1)}),["checked","multiple","muted","selected"].forEach(function(t){K[t]=new l(t,3,!0,t,null,!1)}),["capture","download"].forEach(function(t){K[t]=new l(t,4,!1,t,null,!1)}),["cols","rows","size","span"].forEach(function(t){K[t]=new l(t,6,!1,t,null,!1)}),["rowSpan","start"].forEach(function(t){K[t]=new l(t,5,!1,t.toLowerCase(),null,!1)});var X=/[\-:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(X,h);K[e]=new l(e,1,!1,t,null,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(X,h);K[e]=new l(e,1,!1,t,"http://www.w3.org/1999/xlink",!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(X,h);K[e]=new l(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1)}),["tabIndex","crossOrigin"].forEach(function(t){K[t]=new l(t,1,!1,t.toLowerCase(),null,!1)}),K.xlinkHref=new l("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach(function(t){K[t]=new l(t,1,!1,t.toLowerCase(),null,!0)});var Z=/["'&<>]/,Q=null,tt=null,et=null,nt=!1,rt=!1,it=null,ot=0,at=0,st={readContext:function(t){var e=at;return o(t,e),t[e]},useContext:function(t){d();var e=at;return o(t,e),t[e]},useMemo:function(t,e){if(Q=d(),e=void 0===e?null:e,null!==(et=y())){var n=et.memoizedState;if(null!==n&&null!==e){t:{var r=n[1];if(null===r)r=!1;else{for(var i=0;i<r.length&&i<e.length;i++){var o=e[i],a=r[i];if((o!==a||0===o&&1/o!=1/a)&&(o==o||a==a)){r=!1;break t}}r=!0}}if(r)return n[0]}}return t=t(),et.memoizedState=[t,e],t},useReducer:_,useRef:function(t){Q=d();var e=(et=y()).memoizedState;return null===e?(t={current:t},et.memoizedState=t):e},useState:function(t){return _(g,t)},useLayoutEffect:function(){},useCallback:function(t){return t},useImperativeHandle:E,useEffect:E,useDebugValue:E,useResponder:function(t,e){return{props:e,responder:t}}},ut={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"},ct={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},lt=k({menuitem:!0},ct),ht={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pt=["Webkit","ms","Moz","O"];Object.keys(ht).forEach(function(t){pt.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ht[e]=ht[t]})});var ft=/([A-Z])/g,dt=/^ms-/,mt=C.Children.toArray,yt=H.ReactCurrentDispatcher,vt={listing:!0,pre:!0,textarea:!0},gt=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,_t={},bt={},Et=Object.prototype.hasOwnProperty,wt={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null},xt=function(){function t(e,n){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");C.isValidElement(e)?e.type!==M?e=[e]:(e=e.props.children,e=C.isValidElement(e)?[e]:mt(e)):e=mt(e),e={type:null,domNamespace:ut.html,children:e,childIndex:0,context:Y,footer:""};var i=W[0];if(0===i){var o=W,a=2*(i=o.length);if(!(65536>=a))throw r(Error(304));var s=new Uint16Array(a);for(s.set(o),(W=s)[0]=i+1,o=i;o<a-1;o++)W[o]=o+1;W[a-1]=0}else W[0]=W[i];this.threadID=i,this.stack=[e],this.exhausted=!1,this.currentSelectValue=null,this.previousWasTextNode=!1,this.makeStaticMarkup=n,this.suspenseDepth=0,this.contextIndex=-1,this.contextStack=[],this.contextValueStack=[]}return t.prototype.destroy=function(){if(!this.exhausted){this.exhausted=!0,this.clearProviders();var t=this.threadID;W[t]=W[0],W[0]=t}},t.prototype.pushProvider=function(t){var e=++this.contextIndex,n=t.type._context,r=this.threadID;o(n,r);var i=n[r];this.contextStack[e]=n,this.contextValueStack[e]=i,n[r]=t.props.value},t.prototype.popProvider=function(){var t=this.contextIndex,e=this.contextStack[t],n=this.contextValueStack[t];this.contextStack[t]=null,this.contextValueStack[t]=null,this.contextIndex--,e[this.threadID]=n},t.prototype.clearProviders=function(){for(var t=this.contextIndex;0<=t;t--)this.contextStack[t][this.threadID]=this.contextValueStack[t]},t.prototype.read=function(t){if(this.exhausted)return null;var e=at;at=this.threadID;var n=yt.current;yt.current=st;try{for(var i=[""],o=!1;i[0].length<t;){if(0===this.stack.length){this.exhausted=!0;var a=this.threadID;W[a]=W[0],W[0]=a;break}var s=this.stack[this.stack.length-1];if(o||s.childIndex>=s.children.length){var u=s.footer;if(""!==u&&(this.previousWasTextNode=!1),this.stack.pop(),"select"===s.type)this.currentSelectValue=null;else if(null!=s.type&&null!=s.type.type&&s.type.type.$$typeof===D)this.popProvider(s.type);else if(s.type===F){this.suspenseDepth--;var c=i.pop();if(o){o=!1;var l=s.fallbackFrame;if(!l)throw r(Error(303));this.stack.push(l),i[this.suspenseDepth]+="<!--$!-->";continue}i[this.suspenseDepth]+=c}i[this.suspenseDepth]+=u}else{var h=s.children[s.childIndex++],p="";try{p+=this.render(h,s.context,s.domNamespace)}catch(t){throw t}i.length<=this.suspenseDepth&&i.push(""),i[this.suspenseDepth]+=p}}return i[0]}finally{yt.current=n,at=e}},t.prototype.render=function(t,e,n){if("string"==typeof t||"number"==typeof t)return""===(n=""+t)?"":this.makeStaticMarkup?p(n):this.previousWasTextNode?"<!-- -->"+p(n):(this.previousWasTextNode=!0,p(n));if(t=(e=S(t,e,this.threadID)).child,e=e.context,null===t||!1===t)return"";if(!C.isValidElement(t)){if(null!=t&&null!=t.$$typeof){if((n=t.$$typeof)===A)throw r(Error(257));throw r(Error(258),n.toString())}return t=mt(t),this.stack.push({type:null,domNamespace:n,children:t,childIndex:0,context:e,footer:""}),""}var i=t.type;if("string"==typeof i)return this.renderDOM(t,e,n);switch(i){case T:case P:case O:case L:case M:return t=mt(t.props.children),this.stack.push({type:null,domNamespace:n,children:t,childIndex:0,context:e,footer:""}),"";case F:throw r(Error(294))}if("object"==typeof i&&null!==i)switch(i.$$typeof){case j:Q={};var a=i.render(t.props,t.ref);return a=v(i.render,t.props,a,t.ref),a=mt(a),this.stack.push({type:null,domNamespace:n,children:a,childIndex:0,context:e,footer:""}),"";case U:return t=[C.createElement(i.type,k({ref:t.ref},t.props))],this.stack.push({type:null,domNamespace:n,children:t,childIndex:0,context:e,footer:""}),"";case D:return n={type:t,domNamespace:n,children:i=mt(t.props.children),childIndex:0,context:e,footer:""},this.pushProvider(t),this.stack.push(n),"";case I:i=t.type,a=t.props;var s=this.threadID;return o(i,s),i=mt(a.children(i[s])),this.stack.push({type:t,domNamespace:n,children:i,childIndex:0,context:e,footer:""}),"";case $:throw r(Error(338));case B:throw r(Error(295))}throw r(Error(130),null==i?i:typeof i,"")},t.prototype.renderDOM=function(t,e,n){var i=t.type.toLowerCase();if(n===ut.html&&w(i),!_t.hasOwnProperty(i)){if(!gt.test(i))throw r(Error(65),i);_t[i]=!0}var o=t.props;if("input"===i)o=k({type:void 0},o,{defaultChecked:void 0,defaultValue:void 0,value:null!=o.value?o.value:o.defaultValue,checked:null!=o.checked?o.checked:o.defaultChecked});else if("textarea"===i){var a=o.value;if(null==a){a=o.defaultValue;var u=o.children;if(null!=u){if(null!=a)throw r(Error(92));if(Array.isArray(u)){if(!(1>=u.length))throw r(Error(93));u=u[0]}a=""+u}null==a&&(a="")}o=k({},o,{value:void 0,children:""+a})}else if("select"===i)this.currentSelectValue=null!=o.value?o.value:o.defaultValue,o=k({},o,{value:void 0});else if("option"===i){u=this.currentSelectValue;var c=x(o.children);if(null!=u){var l=null!=o.value?o.value+"":c;if(a=!1,Array.isArray(u)){for(var h=0;h<u.length;h++)if(""+u[h]===l){a=!0;break}}else a=""+u===l;o=k({selected:void 0,children:void 0},o,{selected:a,children:c})}}if(a=o){if(lt[i]&&(null!=a.children||null!=a.dangerouslySetInnerHTML))throw r(Error(137),i,"");if(null!=a.dangerouslySetInnerHTML){if(null!=a.children)throw r(Error(60));if(!("object"==typeof a.dangerouslySetInnerHTML&&"__html"in a.dangerouslySetInnerHTML))throw r(Error(61))}if(null!=a.style&&"object"!=typeof a.style)throw r(Error(62),"")}for(E in a=o,u=this.makeStaticMarkup,c=1===this.stack.length,l="<"+t.type,a)if(Et.call(a,E)){var d=a[E];if(null!=d){if("style"===E){h=void 0;var m="",y="";for(h in d)if(d.hasOwnProperty(h)){var v=0===h.indexOf("--"),g=d[h];if(null!=g){if(v)var _=h;else if(_=h,bt.hasOwnProperty(_))_=bt[_];else{var b=_.replace(ft,"-$1").toLowerCase().replace(dt,"-ms-");_=bt[_]=b}m+=y+_+":",y=h,m+=v=null==g||"boolean"==typeof g||""===g?"":v||"number"!=typeof g||0===g||ht.hasOwnProperty(y)&&ht[y]?(""+g).trim():g+"px",y=";"}}d=m||null}h=null;t:if(v=i,g=a,-1===v.indexOf("-"))v="string"==typeof g.is;else switch(v){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":v=!1;break t;default:v=!0}v?wt.hasOwnProperty(E)||(h=s(h=E)&&null!=d?h+'="'+p(d)+'"':""):h=f(E,d),h&&(l+=" "+h)}}u||c&&(l+=' data-reactroot=""');var E=l;a="",ct.hasOwnProperty(i)?E+="/>":(E+=">",a="</"+t.type+">");t:{if(null!=(u=o.dangerouslySetInnerHTML)){if(null!=u.__html){u=u.__html;break t}}else if("string"==typeof(u=o.children)||"number"==typeof u){u=p(u);break t}u=null}return null!=u?(o=[],vt[i]&&"\n"===u.charAt(0)&&(E+="\n"),E+=u):o=mt(o.children),t=t.type,n=null==n||"http://www.w3.org/1999/xhtml"===n?w(t):"http://www.w3.org/2000/svg"===n&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":n,this.stack.push({domNamespace:n,type:i,children:o,childIndex:0,context:e,footer:a}),this.previousWasTextNode=!1,E},t}(),Rt={renderToString:function(t){t=new xt(t,!1);try{return t.read(1/0)}finally{t.destroy()}},renderToStaticMarkup:function(t){t=new xt(t,!0);try{return t.read(1/0)}finally{t.destroy()}},renderToNodeStream:function(){throw r(Error(207))},renderToStaticNodeStream:function(){throw r(Error(208))},version:"16.9.0"},St={"default":Rt},kt=St&&Rt||St;t.exports=kt["default"]||kt},,,function(t,e,n){"use strict";t.exports=n(11)}]),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["react","react-dom","react-dom/server"],e):"object"==typeof exports?exports.ReactRailsUJS=e(require("react"),require("react-dom"),require("react-dom/server")):t.ReactRailsUJS=e(t.React,t.ReactDOM,t.ReactDOMServer)}(this,function(__WEBPACK_EXTERNAL_MODULE_3__,__WEBPACK_EXTERNAL_MODULE_4__,__WEBPACK_EXTERNAL_MODULE_5__){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=6)}([function(module,exports){var topLevel="undefined"==typeof window?this:window;module.exports=function(className){var constructor;return constructor=topLevel[className],constructor||(constructor=eval(className)),constructor&&constructor["default"]&&(constructor=constructor["default"]),constructor}},function(t,e,n){var r=n(7),i=n(8),o=n(9),a=n(11),s=n(10);t.exports=function(t){t.handleEvent&&("undefined"!=typeof Turbolinks&&"undefined"!=typeof Turbolinks.EVENTS&&s.teardown(t),o.teardown(t),a.teardown(t),i.teardown(t),r.teardown(t)),"addEventListener"in window?(t.handleEvent=function(t,e){document.addEventListener(t,e)},t.removeEvent=function(t,e){document.removeEventListener(t,e)}):(t.handleEvent=function(t,e){window.attachEvent(t,e)},t.removeEvent=function(t,e){window.detachEvent(t,e)}),"undefined"!=typeof Turbolinks&&Turbolinks.supported?"undefined"!=typeof Turbolinks.EVENTS?s.setup(t):"undefined"!=typeof Turbolinks.controller?o.setup(t):a.setup(t):"undefined"!=typeof $&&"function"==typeof $.pjax?i.setup(t):r.setup(t)}},function(t,e,n){var r=n(0),i=n(12);t.exports=function(t){var e=i(t);return function(t){var n;try{n=e(t)}catch(i){try{n=r(t)}catch(o){console.error(i),console.error(o)}}return n}}},function(t){t.exports=__WEBPACK_EXTERNAL_MODULE_3__},function(t){t.exports=__WEBPACK_EXTERNAL_MODULE_4__},function(t){t.exports=__WEBPACK_EXTERNAL_MODULE_5__},function(t,e,n){var r=n(3),i=n(4),o=n(5),a=n(1),s=n(0),u=n(2),c={CLASS_NAME_ATTR:"data-react-class",PROPS_ATTR:"data-react-props",RENDER_ATTR:"data-hydrate",CACHE_ID_ATTR:"data-react-cache-id",TURBOLINKS_PERMANENT_ATTR:"data-turbolinks-permanent",jQuery:"undefined"!=typeof window&&"undefined"!=typeof window.jQuery&&window.jQuery,components:{},findDOMNodes:function(t){var e,n,r=c.CLASS_NAME_ATTR;switch(typeof t){case"undefined":e="["+r+"]",n=document;break;case"object":e="["+r+"]",n=t;break;case"string":e=t+"["+r+"], "+t+" ["+r+"]",n=document}return c.jQuery?c.jQuery(e,n):n.querySelectorAll(e)},getConstructor:s,useContext:function(t){this.getConstructor=u(t)},serverRender:function(t,e,n){var i=this.getConstructor(e),a=r.createElement(i,n);return o[t](a)},mountComponents:function(t){for(var e=c,n=e.findDOMNodes(t),o=0;o<n.length;++o){var a=n[o],s=a.getAttribute(e.CLASS_NAME_ATTR),u=e.getConstructor(s),l=a.getAttribute(e.PROPS_ATTR),h=l&&JSON.parse(l),p=a.getAttribute(e.RENDER_ATTR),f=a.getAttribute(e.CACHE_ID_ATTR),d=a.hasAttribute(e.TURBOLINKS_PERMANENT_ATTR);if(!u){var m="Cannot find component: '"+s+"'";throw console&&console.log&&console.log("%c[react-rails] %c"+m+" for element","font-weight: bold","",a),new Error(m+". Make sure your component is available to render.")}var y=this.components[f];y===undefined&&(y=r.createElement(u,h),d&&(this.components[f]=y)),y=p&&"function"==typeof i.hydrate?i.hydrate(y,a):i.render(y,a)}},unmountComponents:function(t){for(var e=c.findDOMNodes(t),n=0;n<e.length;++n){var r=e[n];i.unmountComponentAtNode(r)}},detectEvents:function(){a(this)},handleMount:function(t){var e=undefined;t&&t.target&&(e=t.target),c.mountComponents(e)},handleUnmount:function(t){var e=undefined;t&&t.target&&(e=t.target),c.unmountComponents(e)}};"undefined"!=typeof window&&c.detectEvents(),self.ReactRailsUJS=c,t.exports=c},function(t){t.exports={setup:function(t){"addEventListener"in window?t.handleEvent("DOMContentLoaded",t.handleMount):t.handleEvent("onload",t.handleMount)},teardown:function(t){t.removeEvent("DOMContentLoaded",t.handleMount),t.removeEvent("onload",t.handleMount)}}},function(t){t.exports={setup:function(t){t.handleEvent("ready",t.handleMount),t.handleEvent("pjax:end",t.handleMount),t.handleEvent("pjax:beforeReplace",t.handleUnmount)},teardown:function(t){t.removeEvent("ready",t.handleMount),t.removeEvent("pjax:end",t.handleMount),t.removeEvent("pjax:beforeReplace",t.handleUnmount)}}},function(t){t.exports={setup:function(t){t.handleEvent("turbolinks:load",t.handleMount),t.handleEvent("turbolinks:before-render",t.handleUnmount)},teardown:function(t){t.removeEvent("turbolinks:load",t.handleMount),t.removeEvent("turbolinks:before-render",t.handleUnmount)}}},function(t){t.exports={setup:function(t){t.handleEvent(Turbolinks.EVENTS.CHANGE,t.handleMount),t.handleEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,t.handleUnmount)},teardown:function(t){t.removeEvent(Turbolinks.EVENTS.CHANGE,t.handleMount),t.removeEvent(Turbolinks.EVENTS.BEFORE_UNLOAD,t.handleUnmount)}}},function(t){t.exports={setup:function(t){Turbolinks.pagesCached(0),t.handleEvent("page:change",t.handleMount),t.handleEvent("page:receive",t.handleUnmount)},teardown:function(t){t.removeEvent("page:change",t.handleMount),t.removeEvent("page:receive",t.handleUnmount)}}},function(t){t.exports=function(t){return function(e){var n=e.split("."),r=n.shift(),i=n,o=t("./"+r);return i.forEach(function(t){o=o[t]}),o.__esModule&&(o=o["default"]),o}}}])});var _extends=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},module;(function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.render=e(this.render,this),this.switchTabs=e(this.switchTabs,this),this.switchTabsHandler=e(this.switchTabsHandler,this),this.componentDidMount=e(this.componentDidMount,this),this.updateMe=e(this.updateMe,this),this.state={current:t.tabs[0]}}return n(r,t),r.prototype.updateMe=function(){return this.setState({update:this.state.update+1})},r.prototype.componentDidMount=function(){return this.switchTabs(location.hash),window.addEventListener("hashchange",this.switchTabsHandler)},r.prototype.switchTabsHandler=function(){return this.switchTabs(location.hash)},r.prototype.switchTabs=function(t){var e;if(t){if(!(e=document.querySelector('a[href="'+t+'"]')))return!1;if(e.click(),t)return setTimeout(function(){return window.scrollTo(0,0)},1)}},r.prototype.render=function(){var t,e,n,r;return e=this.state.current,this.state.update,n=this.props.tabs.map((r=this,function(t,n){var i,o,a,s,u,c,l,h,p;return i=t.name===e.name,s={toggle:"tab"},o={"aria-controls":(h=t.name.replace(/\s+/,"-"))+"-tab","aria-selected":"true"},c=("#"+h).toLowerCase(),a=["nav-link"],i&&a.push("active"),p=function(e){return r.setState({current:t}),location.hash=""+c,e.preventDefault(),!1},u=React.createElement("a",_extends({className:a.join(" "),id:h+"-tab"},s,{href:c,role:"tab",onClick:p},o),t.name),l=[],i&&l.push("active"),React.createElement("li",{key:n,className:l},u)})),t=this.props.tabs.map(function(t,n){var r,i,o;return r={"aria-labelledby":(o=t.name.replace(/\s+/,"-"))+"-tab"},i=["tab-pane","fade"],t.name===e.name&&i.push("active in"),React.createElement("div",_extends({className:i.join(" "),id:o,role:"tabpanel"},r,{key:n}),t.component)}),React.createElement("div",null,React.createElement("ul",{className:"nav nav-tabs",id:"myTab",role:"tablist"},n),React.createElement("div",{className:"tab-content",id:"myTabContent"},t))},r}(React.Component),this.ActivityTabbed=t}).call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){return this.handleChange=e(this.handleChange,this),r.__super__.constructor.apply(this,arguments)}return n(r,t),r.prototype.handleChange=function(t){if(null!=this.props.handler)return this.props.handler(t.target.value)},r.prototype.render=function(){return React.createElement("div",null,React.createElement("input",{type:"date",onChange:this.handleChange}))},r}(React.Component),this.DatePicker=t}.call(this),function(){var t,e=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;t=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.logoutComponent=function(){return this.props.logout_url?React.createElement("li",null,React.createElement("a",{href:this.props.logout_url,"data-method":"delete"},"Logout")):""},n.prototype.usernameDisplay=function(){if(this.props.username)return React.createElement("li",null,React.createElement("p",{className:"navbar-text"},this.props.username))},n.prototype.render=function(){return React.createElement("nav",{className:"navbar navbar-default"},React.createElement("div",{className:"collapse navbar-collapse"},React.createElement("ul",{className:"nav navbar-nav navbar-right"},this.usernameDisplay(),this.logoutComponent())))},n}(React.Component),this.MainNav=t}.call(this);var countdown=function(t){"use strict";function e(t,e){var n=t.getTime();return t.setMonth(t.getMonth()+e),Math.round((t.getTime()-n)/U)}function n(t){var e=t.getTime(),n=new Date(e);return n.setMonth(t.getMonth()+1),Math.round((n.getTime()-e)/U)}function r(t){var e=t.getTime(),n=new Date(e);return n.setFullYear(t.getFullYear()+1),Math.round((n.getTime()-e)/U)}function i(t,e){if(e=e instanceof Date||null!==e&&isFinite(e)?new Date(+e):new Date,!t)return e;var n=+t.value||0;return n?(e.setTime(e.getTime()+n),e):((n=+t.milliseconds||0)&&e.setMilliseconds(e.getMilliseconds()+n),(n=+t.seconds||0)&&e.setSeconds(e.getSeconds()+n),(n=+t.minutes||0)&&e.setMinutes(e.getMinutes()+n),(n=+t.hours||0)&&e.setHours(e.getHours()+n),(n=+t.weeks||0)&&(n*=B),(n+=+t.days||0)&&e.setDate(e.getDate()+n),(n=+t.months||0)&&e.setMonth(e.getMonth()+n),(n=+t.millennia||0)&&(n*=W),(n+=+t.centuries||0)&&(n*=Y),(n+=+t.decades||0)&&(n*=H),(n+=+t.years||0)&&e.setFullYear(e.getFullYear()+n),e)}function o(t,e){return E(t)+(1===t?m[e]:y[e])}function a(){}function s(t,e){switch(e){case"seconds":if(t.seconds!==j||isNaN(t.minutes))return;t.minutes++,t.seconds=0;case"minutes":if(t.minutes!==F||isNaN(t.hours))return;t.hours++,t.minutes=0;case"hours":if(t.hours!==L||isNaN(t.days))return;t.days++,t.hours=0;case"days":if(t.days!==B||isNaN(t.weeks))return;t.weeks++,t.days=0;case"weeks":if(t.weeks!==n(t.refMonth)/B||isNaN(t.months))return;t.months++,t.weeks=0;case"months":if(t.months!==$||isNaN(t.years))return;t.years++,t.months=0;case"years":if(t.years!==H||isNaN(t.decades))return;t.decades++,t.years=0;case"decades":if(t.decades!==Y||isNaN(t.centuries))return;t.centuries++,t.decades=0;case"centuries":if(t.centuries!==W||isNaN(t.millennia))return;t.millennia++,t.centuries=0}}function u(t,e,n,r,i,o){return t[n]>=0&&(e+=t[n],delete t[n]),(e/=i)+1<=1?0:t[r]>=0?(t[r]=+(t[r]+e).toFixed(o),s(t,r),0):e}function c(t,e){var i=u(t,0,"milliseconds","seconds",P,e);if(i&&(i=u(t,i,"seconds","minutes",j,e))&&(i=u(t,i,"minutes","hours",F,e))&&(i=u(t,i,"hours","days",L,e))&&(i=u(t,i,"days","weeks",B,e))&&(i=u(t,i,"weeks","months",n(t.refMonth)/B,e))&&(i=u(t,i,"months","years",r(t.refMonth)/n(t.refMonth),e))&&(i=u(t,i,"years","decades",H,e))&&(i=u(t,i,"decades","centuries",Y,e))&&(i=u(t,i,"centuries","millennia",W,e)))throw new Error("Fractional unit overflow")}function l(t){var n;for(t.milliseconds<0?(n=G(-t.milliseconds/P),t.seconds-=n,t.milliseconds+=n*P):t.milliseconds>=P&&(t.seconds+=z(t.milliseconds/P),t.milliseconds%=P),t.seconds<0?(n=G(-t.seconds/j),t.minutes-=n,t.seconds+=n*j):t.seconds>=j&&(t.minutes+=z(t.seconds/j),t.seconds%=j),t.minutes<0?(n=G(-t.minutes/F),t.hours-=n,t.minutes+=n*F):t.minutes>=F&&(t.hours+=z(t.minutes/F),t.minutes%=F),t.hours<0?(n=G(-t.hours/L),t.days-=n,t.hours+=n*L):t.hours>=L&&(t.days+=z(t.hours/L),t.hours%=L);t.days<0;)t.months--,t.days+=e(t.refMonth,1);t.days>=B&&(t.weeks+=z(t.days/B),t.days%=B),t.months<0?(n=G(-t.months/$),t.years-=n,t.months+=n*$):t.months>=$&&(t.years+=z(t.months/$),t.months%=$),t.years>=H&&(t.decades+=z(t.years/H),t.years%=H,t.decades>=Y&&(t.centuries+=z(t.decades/Y),t.decades%=Y,t.centuries>=W&&(t.millennia+=z(t.centuries/W),t.centuries%=W)))}function h(t,n,r,i){var o=0;!(n&D)||o>=r?(t.centuries+=t.millennia*W,delete t.millennia):t.millennia&&o++,!(n&O)||o>=r?(t.decades+=t.centuries*Y,delete t.centuries):t.centuries&&o++,!(n&T)||o>=r?(t.years+=t.decades*H,delete t.decades):t.decades&&o++,!(n&M)||o>=r?(t.months+=t.years*$,delete t.years):t.years&&o++,!(n&A)||o>=r?(t.months&&(t.days+=e(t.refMonth,t.months)),delete t.months,t.days>=B&&(t.weeks+=z(t.days/B),t.days%=B)):t.months&&o++,
  !(n&N)||o>=r?(t.days+=t.weeks*B,delete t.weeks):t.weeks&&o++,!(n&C)||o>=r?(t.hours+=t.days*L,delete t.days):t.days&&o++,!(n&k)||o>=r?(t.minutes+=t.hours*F,delete t.hours):t.hours&&o++,!(n&S)||o>=r?(t.seconds+=t.minutes*j,delete t.minutes):t.minutes&&o++,!(n&R)||o>=r?(t.milliseconds+=t.seconds*P,delete t.seconds):t.seconds&&o++,n&x&&!(o>=r)||c(t,i)}function p(t,e,n,r,i,o){var a=new Date;if(t.start=e=e||a,t.end=n=n||a,t.units=r,t.value=n.getTime()-e.getTime(),t.value<0){var s=n;n=e,e=s}t.refMonth=new Date(e.getFullYear(),e.getMonth(),15,12,0,0);try{t.millennia=0,t.centuries=0,t.decades=0,t.years=n.getFullYear()-e.getFullYear(),t.months=n.getMonth()-e.getMonth(),t.weeks=0,t.days=n.getDate()-e.getDate(),t.hours=n.getHours()-e.getHours(),t.minutes=n.getMinutes()-e.getMinutes(),t.seconds=n.getSeconds()-e.getSeconds(),t.milliseconds=n.getMilliseconds()-e.getMilliseconds(),l(t),h(t,r,i,o)}finally{delete t.refMonth}return t}function f(t){return t&x?P/30:t&R?P:t&S?P*j:t&k?P*j*F:t&C?P*j*F*L:P*j*F*L*B}function d(t,e,n,r,o){var s;n=+n||I,r=r>0?r:NaN,o=o>0?o<20?Math.round(o):20:0;var u=null;"function"==typeof t?(s=t,t=null):t instanceof Date||(null!==t&&isFinite(t)?t=new Date(+t):("object"==typeof u&&(u=t),t=null));var c=null;if("function"==typeof e?(s=e,e=null):e instanceof Date||(null!==e&&isFinite(e)?e=new Date(+e):("object"==typeof e&&(c=e),e=null)),u&&(t=i(u,e)),c&&(e=i(c,t)),!t&&!e)return new a;if(!s)return p(new a,t,e,n,r,o);var l,h=f(n),d=function(){s(p(new a,t,e,n,r,o),l)};return d(),l=setInterval(d,h)}var m,y,v,g,_,b,E,w,x=1,R=2,S=4,k=8,C=16,N=32,A=64,M=128,T=256,O=512,D=1024,I=M|A|C|k|S|R,P=1e3,j=60,F=60,L=24,U=L*F*j*P,B=7,$=12,H=10,Y=10,W=10,G=Math.ceil,z=Math.floor,q=0,V=1,J=2,K=3,X=4,Z=5,Q=6,tt=7,et=8,nt=9,rt=10;a.prototype.toString=function(t){var e=w(this),n=e.length;if(!n)return t?""+t:_;if(1===n)return e[0];var r=v+e.pop();return e.join(g)+r},a.prototype.toHTML=function(t,e){t=t||"span";var n=w(this),r=n.length;if(!r)return(e=e||_)?"<"+t+">"+e+"</"+t+">":e;for(var i=0;i<r;i++)n[i]="<"+t+">"+n[i]+"</"+t+">";if(1===r)return n[0];var o=v+n.pop();return n.join(g)+o},a.prototype.addTo=function(t){return i(this,t)},w=function(t){var e=[],n=t.millennia;return n&&e.push(b(n,rt)),(n=t.centuries)&&e.push(b(n,nt)),(n=t.decades)&&e.push(b(n,et)),(n=t.years)&&e.push(b(n,tt)),(n=t.months)&&e.push(b(n,Q)),(n=t.weeks)&&e.push(b(n,Z)),(n=t.days)&&e.push(b(n,X)),(n=t.hours)&&e.push(b(n,K)),(n=t.minutes)&&e.push(b(n,J)),(n=t.seconds)&&e.push(b(n,V)),(n=t.milliseconds)&&e.push(b(n,q)),e},d.MILLISECONDS=x,d.SECONDS=R,d.MINUTES=S,d.HOURS=k,d.DAYS=C,d.WEEKS=N,d.MONTHS=A,d.YEARS=M,d.DECADES=T,d.CENTURIES=O,d.MILLENNIA=D,d.DEFAULTS=I,d.ALL=D|O|T|M|A|N|C|k|S|R|x;var it=d.setFormat=function(t){if(t){if("singular"in t||"plural"in t){var e=t.singular||[];e.split&&(e=e.split("|"));var n=t.plural||[];n.split&&(n=n.split("|"));for(var r=q;r<=rt;r++)m[r]=e[r]||m[r],y[r]=n[r]||y[r]}"string"==typeof t.last&&(v=t.last),"string"==typeof t.delim&&(g=t.delim),"string"==typeof t.empty&&(_=t.empty),"function"==typeof t.formatNumber&&(E=t.formatNumber),"function"==typeof t.formatter&&(b=t.formatter)}},ot=d.resetFormat=function(){m=" millisecond| second| minute| hour| day| week| month| year| decade| century| millennium".split("|"),y=" milliseconds| seconds| minutes| hours| days| weeks| months| years| decades| centuries| millennia".split("|"),v=" and ",g=", ",_="",E=function(t){return t},b=o};return d.setLabels=function(t,e,n,r,i,o,a){it({singular:t,plural:e,last:n,delim:r,empty:i,formatNumber:o,formatter:a})},d.resetLabels=ot,ot(),t&&t.exports?t.exports=d:"function"==typeof window.define&&"undefined"!=typeof window.define.amd&&window.define("countdown",[],function(){return d}),d}(module),_extends=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};(function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.retrieveGoal=e(this.retrieveGoal,this),this.retrieveGoals=e(this.retrieveGoals,this),this.goalChanged=e(this.goalChanged,this),this.handleStop=e(this.handleStop,this),this.handleResume=e(this.handleResume,this),this.updateCount=e(this.updateCount,this),this.componentWillUnmount=e(this.componentWillUnmount,this),this.componentDidMount=e(this.componentDidMount,this),this.render=e(this.render,this),r.__super__.constructor.call(this,t),this.state={count:0,goals:[],changing:!1}}return n(r,t),r.prototype.render=function(){var t,e,n,r,i,o,a,s,u;return countdown.setLabels("|||hr|d","ms|sec|min|||wks||yrs",", "),r=this.props.end?moment(this.props.end):null,n=countdown(moment(this.props.start),r).toString(),t="",this.props.end||(t=" (active)"),a="",u="",this.props.end?a=React.createElement(ActivityResume,{resume:this.handleResume}):(i=this.handleStop,u=React.createElement(ActivityStop,{stop:i})),this.state.changing&&(u="",a=React.createElement(Spinner,null)),o=this.props.table||!1,s=moment(this.props.start).format("L"),e=moment(this.props.start).fromNow(),o?React.createElement("tr",null,React.createElement("td",null,React.createElement(ActivityTime,{time:this.props.start,type:"start",activityUpdateUrl:this.props.activity_update_url}),"\xa0-\xa0",React.createElement(ActivityTime,{time:this.props.end,type:"end",activityUpdateUrl:this.props.activity_update_url})),React.createElement("td",null,s," ",React.createElement("em",null,"(",e,")")),React.createElement("td",null,this.props.description,t),React.createElement("td",null,u,a),React.createElement("td",null,n),React.createElement("td",null,React.createElement(GoalSelector,_extends({goals:this.state.goals,listener:this.goalChanged},this.state.goal)))):React.createElement("div",{className:"row"},React.createElement("div",{className:"col-xs-2 col-md-2"},React.createElement(ActivityTime,{time:this.props.start}),"\xa0-\xa0",React.createElement(ActivityTime,{time:this.props.end,activityUpdateUrl:this.props.updateUrl})),React.createElement("div",{className:"col-xs-2 col-md-2"},s," ",React.createElement("em",null,"(",e,")")),React.createElement("div",{className:"col-xs-2 col-md-2"},this.props.description,t),React.createElement("div",{className:"col-xs-2 col-md-2"},u),React.createElement("div",{className:"col-xs-2 col-md-2"},n),React.createElement("div",{className:"col-xs-2 col-md-2"},React.createElement(GoalSelector,_extends({goals:this.state.goals,listener:this.goalChanged},this.state.goal))))},r.prototype.componentDidMount=function(){return this.setState({interval:setInterval(this.updateCount,1e3)}),this.retrieveGoals(),this.retrieveGoal()},r.prototype.componentWillUnmount=function(){return clearInterval(this.state.interval)},r.prototype.updateCount=function(){return this.setState({count:this.state.count+1})},r.prototype.handleResume=function(){return this.setState({changing:!0},(t=this,function(){return t.props.startTracking(t.props.description).always(function(){return t.setState({changing:!1})})}));var t},r.prototype.handleStop=function(){return this.setState({changing:!0},(t=this,function(){return $.ajax({url:t.props.stop,type:"PUT"}).success(function(){return t.props.updater(),t.setState({changing:!1})}).error(function(){return t.setState({changing:!1})})}));var t},r.prototype.goalChanged=function(t){return $.ajax({url:t.activities_url+"/"+this.props.id,type:"PUT"}).success((e=this,function(){return e.setState({goal:t})}));var e},r.prototype.retrieveGoals=function(){if(this.props.goals_url)return $.ajax({url:this.props.goals_url,type:"GET",dataType:"json"}).success((t=this,function(e){return t.setState({goals:e})}));var t},r.prototype.retrieveGoal=function(){if(this.props.goal_url)return $.ajax({url:this.props.goal_url,type:"GET",dataType:"json"}).success((t=this,function(e){return t.setState({goal:e})}));var t},r}(React.Component),this.Activity=t}).call(this),function(){var t,e,n=function(t,e){return function(){return t.apply(e,arguments)}};e=["a02030","c03040","e04040","f06040","ff9040","e04020","f06020","ffb050","ffa030","ffc030","ffe040","ffff90","508060","60a050","70b040","a0d060","c0e070","e0f080","40a070","20c080","70d080","a0e0a0","40e0a0","80f0d0","3060b0","3080c0","4090d0","70b0f0","a0e0ff","403090","5040c0","5050e0","6080f0","6020c0","9020f0","a050f0","b080f0","c03070","e040a0","f070d0","f090f0","905060","c07080","f08080","ffa090","ffc0b0","f09080","ffb090","ffd0b0","605050","907060","a08070","b0a080","d0c0a0","e0e0c0","202030","303040","505060","707080","9090a0","a0b0c0","c0d0e0","e0f0f0","ffffff"],t=function(){function t(t){this.datasets=n(this.datasets,this),this.dataset=t}return t.prototype.datasets=function(t){var n,r,i,o,a,s,u,c;return o=0,s=[],"Total"===(a=this.dataset)?s.push({label:this.datasetLabel(),backgroundColor:"#"+e[o+1],borderColor:"#"+e[o],data:this.data(t)}):"goal"===a?(u=function(t,e){return t[e.goal_id]=(t[e.goal_id]||[]).concat(e),t},i=t.reduce(u,{}),s=Object.entries(i).map((c=this,function(t){var n,r;return n=t[0],r=t[1],"null"===n&&(n="n/a"),o+=1,{label:c.datasetLabel()+" Goal "+(n||"n/a"),backgroundColor:"#"+e[o+1],borderColor:"#"+e[o],data:c.data(r)}}))):"activity"===a&&(n=function(t,e){return t[e.description]=(t[e.description]||[]).concat(e),t},r=t.reduce(n,{}),s=Object.entries(r).map(function(t){return function(n){var r,i;return r=n[0],i=n[1],"null"===r&&(r="n/a"),o+=1,{label:t.datasetLabel()+" "+r,backgroundColor:"#"+e[o+1],borderColor:"#"+e[o],data:t.data(i)}}}(this))),s.filter(function(t){return!!t.data.find(function(t){return t>0})})},t}(),this.ChartAggregator=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t,n,i){null==i&&(i="minute"),this.data=e(this.data,this),this.datasetLabel=e(this.datasetLabel,this),r.__super__.constructor.call(this,t),this.day=n,this.year=moment().year(),this.daysInYear=Math.ceil(moment.duration(moment().endOf("year").diff(moment().startOf("year"))).asDays()),this.denomination=i}return n(r,t),r.prototype.datasetLabel=function(){return""+this.startDate().format("dddd MMMM D, YYYY")},r.prototype.next=function(){return this.day+=1,this.day=Math.min(this.daysInYear,this.day)},r.prototype.previous=function(){return this.day-=1,this.day=Math.max(0,this.day)},r.prototype.startDate=function(t){return null==t&&(t=moment().year(this.year).dayOfYear(this.day).startOf("day").format("HH:mm")),moment().year(this.year).dayOfYear(this.day).hour(moment(t,"HH:mm").hour()).startOf("hour")},r.prototype.endDate=function(t){return t?this.startDate(t).endOf("hour"):this.startDate(t).endOf("day")},r.prototype.labels=function(){var t,e;return function(){t=[];for(var e=0,n=this.startDate().endOf("day").hours();0<=n?e<=n:e>=n;0<=n?e++:e--)t.push(e);return t}.apply(this).map((e=this,function(t){return e.startDate().hour(t).format("HH:mm")}))},r.prototype.data=function(t){var e,n,r;return n=function(t,e){return t+e},e=this.denomination,this.labels().map((r=this,function(i){var o,a,s;return a=r.startDate(i),s=r.endDate(i),o=function(t){var e,n,r;return r=t.start,e=null!=(n=t.end)?n:moment(),moment(a).isBefore(moment(r))&&moment(s).isAfter(moment(r))||moment(a).isBefore(moment(e))&&moment(s).isAfter(moment(e))},t.filter(o).map(function(t){var n,r,i,o,u;return i=t.start,n=null!=(r=t.end)?r:moment(),i=moment.max(moment(i),a),n=moment.min(moment(n),s),u=moment.min(i,n),o=moment.max(i,n),i=u,n=o,moment.duration(n.diff(i)).as(e)}).reduce(n,0)}))},r}(ChartAggregator),this.ChartByDay=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t,n,i,o){null==i&&(i=moment().year()),null==o&&(o="hour"),this.datasetLabel=e(this.datasetLabel,this),r.__super__.constructor.call(this,t),this.month=n,this.year=i,this.denomination=o}return n(r,t),r.prototype.datasetLabel=function(){return this.startDate().format("MMMM").toString()+", "+this.startDate().year()},r.prototype.next=function(){return this.month+=1,this.month=Math.min(12,this.month)},r.prototype.previous=function(){return this.month-=1,this.month=Math.max(0,this.month)},r.prototype.startDate=function(t){return null==t&&(t=moment().year(this.year).month(this.month).startOf("month").format("dddd D")),moment().year(this.year).month(this.month).date(Number.parseInt(t.slice(t.length-2))).startOf("day")},r.prototype.endDate=function(t){return this.startDate(t).endOf("day")},r.prototype.labels=function(){var t,e,n;return t=Number.parseInt(this.startDate().daysInMonth()),function(){e=[];for(var n=0;0<=t?n<=t:n>=t;0<=t?n++:n--)e.push(n);return e}.apply(this).map((n=this,function(t){return n.startDate().date(t).format("dddd D")}))},r.prototype.data=function(t){var e,n,r;return n=function(t,e){return t+=e},e=this.denomination,this.labels().map((r=this,function(i){var o,a,s;return a=r.startDate(i),s=r.endDate(i),o=function(t){var e,n,r;return r=t.start,e=null!=(n=t.end)?n:moment(),moment(a).isBefore(moment(r))&&moment(s).isAfter(moment(r))||moment(a).isBefore(moment(e))&&moment(s).isAfter(moment(e))},t.filter(o).map(function(t){var n,r,i,o,u;return i=t.start,n=null!=(r=t.end)?r:moment(),i=moment.max(moment(i),a),n=moment.min(moment(n),s),u=moment.min(i,n),o=moment.max(i,n),i=u,n=o,moment.duration(n.diff(i)).as(e)}).reduce(n,0)}))},r}(ChartAggregator),this.ChartByMonth=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t,n,i){null==i&&(i="hours"),this.data=e(this.data,this),this.datasetLabel=e(this.datasetLabel,this),r.__super__.constructor.call(this,t),this.week=n,this.year=moment().year(),this.denomination=i}return n(r,t),r.prototype.datasetLabel=function(){return"Week "+this.startDate().week()+" of "+this.startDate().year()+" ending "+this.endDate().format("MMM DD, YYYY")},r.prototype.next=function(){return this.week+=1,this.week=Math.min(moment().year(this.year).weeksInYear(),this.week)},r.prototype.previous=function(){return this.week-=1,this.week=Math.max(0,this.week)},r.prototype.startDate=function(t){return null==t&&(t=moment().year(this.year).week(this.week).startOf("week").format("dddd")),moment().year(this.year).week(this.week).day(t).startOf("day")},r.prototype.endDate=function(t){return t?this.startDate(t).endOf("day"):this.startDate(t).endOf("isoWeek")},r.prototype.labels=function(){return moment.weekdays()},r.prototype.data=function(t){var e,n,r;return n=function(t,e){return t+e},e=this.denomination,this.labels().map((r=this,function(i){var o,a,s;return a=r.startDate(i),s=r.endDate(i),o=function(t){var e,n,r;return r=t.start,e=null!=(n=t.end)?n:moment(),moment(a).isBefore(moment(r))&&moment(s).isAfter(moment(r))||moment(a).isBefore(moment(e))&&moment(s).isAfter(moment(e))},t.filter(o).map(function(t){var n,r,i,o,u;return i=t.start,n=null!=(r=t.end)?r:moment(),i=moment.max(moment(i),a),n=moment.min(moment(n),s),u=moment.min(i,n),o=moment.max(i,n),i=u,n=o,moment.duration(n.diff(i)).as(e)}).reduce(n,0)}))},r}(ChartAggregator),this.ChartByWeek=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t,n,i){null==i&&(i="hour"),this.datasetLabel=e(this.datasetLabel,this),r.__super__.constructor.call(this,t),this.year=n,this.denomination=i}return n(r,t),r.prototype.datasetLabel=function(){return""+this.startDate().year().toString()},r.prototype.next=function(){return this.year+=1,this.year=Math.min(moment().year()+1,this.year)},r.prototype.previous=function(){return this.year-=1,this.year=Math.max(0,this.year)},r.prototype.startDate=function(t){return null==t&&(t=moment().year(this.year).startOf("year").format("MMMM")),moment().year(this.year).month(t).startOf("month")},r.prototype.endDate=function(t){return this.startDate(t).endOf("month")},r.prototype.labels=function(){return moment.months()},r.prototype.data=function(t){var e,n,r;return n=function(t,e){return t+=e},e=this.denomination,this.labels().map((r=this,function(i){var o,a,s;return a=r.startDate(i),s=r.endDate(i),o=function(t){var e,n,r;return r=t.start,e=null!=(n=t.end)?n:moment(),moment(a).isBefore(moment(r))&&moment(s).isAfter(moment(r))||moment(a).isBefore(moment(e))&&moment(s).isAfter(moment(e))},t.filter(o).map(function(t){var n,r,i,o,u;return i=t.start,n=null!=(r=t.end)?r:moment(),i=moment.max(moment(i),a),n=moment.min(moment(n),s),u=moment.min(i,n),o=moment.max(i,n),i=u,n=o,moment.duration(n.diff(i)).as(e)}).reduce(n,0)}))},r}(ChartAggregator),this.ChartByYear=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){this.render=e(this.render,this),this.previous=e(this.previous,this),this.next=e(this.next,this),this.datasetChange=e(this.datasetChange,this),this.changeTimeAgg=e(this.changeTimeAgg,this),this.byChange=e(this.byChange,this),moment().year(),this.state={chart:new ChartByMonth("Total",moment().month()),page:0,dataset:"Total",agg:"month",charts:{day:ChartByDay,week:ChartByWeek,month:ChartByMonth,year:ChartByYear}}}return n(r,t),r.prototype.componentDidMount=function(){return this.changeChart()},r.prototype.changeChart=function(){var t,e,n,r;return(null!=(r=this.chartObj)?r.destroy:void 0)&&this.chartObj.destroy(),t=this.state.chart,e={type:"bar",options:{scales:{y:{beginAtZero:!0}},onClick:function(t,e){var r,i;return e=e[0]._chart,r=Chart.helpers.getRelativePosition(t,e),i=e.scales["x-axis-0"].getValueForPixel(r.x),e.scales["y-axis-0"].getValueForPixel(r.y),n[i]}},data:{labels:n=t.labels(),datasets:t.datasets(this.props.activities)}},this.chartObj=new Chart($(this.chart)[0],e)},r.prototype.byChange=function(t){var e;return e=t.target.value,this.changeTimeAgg(e)},r.prototype.changeTimeAgg=function(t){var e,n;return e=this.state.chart,"day"===t&&(e=new ChartByDay(this.state.dataset,moment().dayOfYear())),"week"===t?e=new ChartByWeek(this.state.dataset,moment().week()):"year"===t?e=new ChartByYear(this.state.dataset,moment().year()):"month"===t&&(e=new ChartByMonth(this.state.dataset,moment().month())),this.setState({agg:t,chart:e},(n=this,function(){return n.changeChart()}))},r.prototype.datasetChange=function(t){var e,n;return e=t.target.value,this.setState({dataset:e},(n=this,function(){return n.changeTimeAgg(n.state.agg)}))},r.prototype.next=function(){return this.state.chart.next(),this.setState({page:this.state.page+1},(t=this,function(){return t.changeChart()}));var t},r.prototype.previous=function(){return this.state.chart.previous(),this.setState({page:this.state.page+1},(t=this,function(){return t.changeChart()}));var t},r.prototype.render=function(){var t,e,n,r,i=this;return{maxHeight:"600px"},n=this.byChange,r=React.createElement("select",{onChange:n},[React.createElement("option",{value:"day"},"By Day"),React.createElement("option",{value:"week"},"By Week"),React.createElement("option",{value:"month",selected:!0},"By Month"),React.createElement("option",{value:"year"},"By Year")]),t=this.datasetChange,e=React.createElement("select",{onChange:t},[React.createElement("option",{value:"Total",selected:!0},"Total"),React.createElement("option",{value:"goal"},"By Goal"),React.createElement("option",{value:"activity"},"By Activity")]),React.createElement("div",null,e,"\n",r,"\n",React.createElement("button",{onClick:this.previous},React.createElement("i",{className:"glyphicon glyphicon-chevron-left"}),"Previous"),"\n",React.createElement("button",{onClick:this.next},"Next",React.createElement("i",{className:"glyphicon glyphicon-chevron-right"})),"\n",React.createElement("canvas",{ref:function(t){return i.chart=t},height:100}))},r}(React.Component),this.ActivityCharts=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.onStopCurrent=e(this.onStopCurrent,this),this.updateCount=e(this.updateCount,this),this.componentWillUnmount=e(this.componentWillUnmount,this),r.__super__.constructor.call(this,t),this.state={count:0,stopping:!1}}return n(r,t),r.prototype.componentDidMount=function(){return this.setState({interval:setInterval(this.updateCount,1e3)})},r.prototype.componentWillUnmount=function(){return clearInterval(this.state.interval)},r.prototype.updateCount=function(){return this.setState({count:this.state.count+1})},r.prototype.onStopCurrent=function(){return this.setState({stopping:!0},(t=this,function(){return t.props.onStopCurrent(t.props.activity).success(function(){return t.setState({stopping:!1})}).error(function(){return t.setState({stopping:!1})})}));var t},r.prototype.render=function(){var t,e,n,r,i;return countdown.setLabels("|||hr|d","ms|s|m|||wks||yrs",", "),r=this.props.activity.end?moment(this.props.activity.end):null,n=countdown(moment(this.props.activity.start),r).toString(),t=["btn","pull-left"],e=null!=this.props.endTime,i="",this.props.loading&&(i=React.createElement(Spinner,null)),React.createElement("div",{className:"container-fluid"},React.createElement("div",{className:"row"},React.createElement("h1",null,"Currently: ",this.props.activity.description),React.createElement("h4",null,i,n),React.createElement("button",{className:t.join(" "),onClick:this.onStopCurrent,disabled:e},this.state.stopping?React.createElement(Spinner,null):"","Stop Tracking")))},r}(React.Component),this.ActivityCurrent=t}.call(this);var _extends=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};(function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.render=e(this.render,this),this.newGoal=e(this.newGoal,this),this.changed=e(this.changed,this),this.handleChange=e(this.handleChange,this),this.state={userInput:"",working:!1,goals:t.list}}return n(r,t),r.prototype.handleChange=function(t){return this.setState({userInput:t.target.value})},r.prototype.changed=function(){return this.setState({goals:this.props.collection.getAll()})},r.prototype.newGoal=function(t){var e;return t.preventDefault(),this.setState({working:!0}),new GoalModel({name:this.state.userInput}).save().success((e=this,function(){return e.props.collection.fetch().success(function(){return e.setState({goals:e.props.collection.getAll()})}),e.setState({working:!1})}))},r.prototype.render=function(){var t,e,n,r;return e=this.state.working,r=this.props.collection,t=this.changed,n=this.state.goals.map(function(e,n){var i;return i=r.find(function(t){return t.id===e.id}),React.createElement(Goal,_extends({key:n},e,{list:r,model:i,changed:t}))}),React.createElement("div",{className:"container-fluid"},React.createElement("div",{className:"row"},React.createElement("div",{className:"col-md-12"},React.createElement("h2",null,"Activity Daily Goals"),React.createElement("div",{className:"row"},React.createElement("div",{className:"col-md-12"},React.createElement("form",{className:"form-inline",action:"/goals",method:"POST"},React.createElement("div",{className:"form-group"},React.createElement("div",{className:"input-group"},React.createElement("input",{className:"form-control",type:"text",id:"name",placeholder:"Goal Name",value:this.state.userInput,onChange:this.handleChange}))),React.createElement("button",{className:"btn btn-primary",type:"submit",disabled:e,onClick:this.newGoal},"Add")))))),React.createElement("div",{className:"row"},React.createElement("div",{className:"col-md-12"},React.createElement("h3",null,"Goals List"))),React.createElement("div",{className:"row"},React.createElement("div",{className:"col-md-12"},n)))},r}(React.Component),this.ActivityDailyGoals=t}).call(this),function(){function t(t){function e(e,n,r,i,o,a){for(;o>=0&&o<a;o+=t){var s=i?i[o]:o;r=n(r,e[s],s,e)}return r}return function(n,r,i,o){r=_(r,o,4);var a=!k(n)&&g.keys(n),s=(a||n).length,u=t>0?0:s-1;return arguments.length<3&&(i=n[a?a[u]:u],u+=t),e(n,r,i,a,u,s)}}function e(t){return function(e,n,r){n=b(n,r);for(var i=S(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}}function n(t,e,n){return function(r,i,o){var a=0,s=S(r);if("number"==typeof o)t>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(l.call(r,a,s),g.isNaN))>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&o<s;o+=t)if(r[o]===i)return o;return-1}}function r(t,e){var n=T.length,r=t.constructor,i=g.isFunction(r)&&r.prototype||s,o="constructor";for(g.has(t,o)&&!g.contains(e,o)&&e.push(o);n--;)(o=T[n])in t&&t[o]!==i[o]&&!g.contains(e,o)&&e.push(o)}var i=this,o=i._,a=Array.prototype,s=Object.prototype,u=Function.prototype,c=a.push,l=a.slice,h=s.toString,p=s.hasOwnProperty,f=Array.isArray,d=Object.keys,m=u.bind,y=Object.create,v=function(){},g=function(t){return t instanceof g?t:this instanceof g?void(this._wrapped=t):new g(t)};"undefined"!=typeof exports?(void 0!==module&&module.exports&&(exports=module.exports=g),exports._=g):i._=g,g.VERSION="1.8.3";var _=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},b=function(t,e,n){return null==t?g.identity:g.isFunction(t)?_(t,e,n):g.isObject(t)?g.matcher(t):g.property(t)};g.iteratee=function(t,e){return b(t,e,Infinity)};var E=function(t,e){return function(n){var r=arguments.length;if(r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),s=a.length,u=0;u<s;u++){var c=a[u];e&&void 0!==n[c]||(n[c]=o[c])}return n}},w=function(t){if(!g.isObject(t))return{};if(y)return y(t);v.prototype=t;var e=new v;return v.prototype=null,e},x=function(t){return function(e){return null==e?void 0:e[t]}},R=Math.pow(2,53)-1,S=x("length"),k=function(t){var e=S(t);return"number"==typeof e&&e>=0&&e<=R};g.each=g.forEach=function(t,e,n){var r,i;if(e=_(e,n),k(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=g.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},g.map=g.collect=function(t,e,n){e=b(e,n);for(var r=!k(t)&&g.keys(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o},g.reduce=g.foldl=g.inject=t(1),g.reduceRight=g.foldr=t(-1),g.find=g.detect=function(t,e,n){var r;if(void 0!==(r=k(t)?g.findIndex(t,e,n):g.findKey(t,e,n))&&-1!==r)return t[r]},g.filter=g.select=function(t,e,n){var r=[];return e=b(e,n),g.each(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r},g.reject=function(t,e,n){return g.filter(t,g.negate(b(e)),n)},g.every=g.all=function(t,e,n){e=b(e,n);for(var r=!k(t)&&g.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0},g.some=g.any=function(t,e,n){e=b(e,n);for(var r=!k(t)&&g.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1},g.contains=g.includes=g.include=function(t,e,n,r){return k(t)||(t=g.values(t)),("number"!=typeof n||r)&&(n=0),g.indexOf(t,e,n)>=0},g.invoke=function(t,e){var n=l.call(arguments,2),r=g.isFunction(e);return g.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},g.pluck=function(t,e){return g.map(t,g.property(e))},g.where=function(t,e){return g.filter(t,g.matcher(e))},g.findWhere=function(t,e){return g.find(t,g.matcher(e))},g.max=function(t,e,n){var r,i,o=-Infinity,a=-Infinity;if(null==e&&null!=t)for(var s=0,u=(t=k(t)?t:g.values(t)).length;s<u;s++)(r=t[s])>o&&(o=r);else e=b(e,n),g.each(t,function(t,n,r){((i=e(t,n,r))>a||i===-Infinity&&o===-Infinity)&&(o=t,a=i)});return o},g.min=function(t,e,n){var r,i,o=Infinity,a=Infinity;if(null==e&&null!=t)for(var s=0,u=(t=k(t)?t:g.values(t)).length;s<u;s++)(r=t[s])<o&&(o=r);else e=b(e,n),g.each(t,function(t,n,r){((i=e(t,n,r))<a||i===Infinity&&o===Infinity)&&(o=t,a=i)});return o},g.shuffle=function(t){for(var e,n=k(t)?t:g.values(t),r=n.length,i=Array(r),o=0;o<r;o++)(e=g.random(0,o))!==o&&(i[o]=i[e]),i[e]=n[o];return i},g.sample=function(t,e,n){return null==e||n?(k(t)||(t=g.values(t)),t[g.random(t.length-1)]):g.shuffle(t).slice(0,Math.max(0,e))},g.sortBy=function(t,e,n){return e=b(e,n),g.pluck(g.map(t,function(t,n,r){return{value:t,index:n,criteria:e(t,n,r)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")};var C=function(t){return function(e,n,r){var i={};return n=b(n,r),g.each(e,function(r,o){var a=n(r,o,e);t(i,r,a)}),i}};g.groupBy=C(function(t,e,n){g.has(t,n)?t[n].push(e):t[n]=[e]}),g.indexBy=C(function(t,e,n){t[n]=e}),g.countBy=C(function(t,e,n){g.has(t,n)?t[n]++:t[n]=1}),g.toArray=function(t){return t?g.isArray(t)?l.call(t):k(t)?g.map(t,g.identity):g.values(t):[]},g.size=function(t){return null==t?0:k(t)?t.length:g.keys(t).length},g.partition=function(t,e,n){e=b(e,n);var r=[],i=[];return g.each(t,function(t,n,o){(e(t,n,o)?r:i).push(t)}),[r,i]},g.first=g.head=g.take=function(t,e,n){if(null!=t)return null==e||n?t[0]:g.initial(t,t.length-e)},g.initial=function(t,e,n){return l.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},g.last=function(t,e,n){if(null!=t)return null==e||n?t[t.length-1]:g.rest(t,Math.max(0,t.length-e))},g.rest=g.tail=g.drop=function(t,e,n){return l.call(t,null==e||n?1:e)},g.compact=function(t){return g.filter(t,g.identity)};var N=function(t,e,n,r){for(var i=[],o=0,a=r||0,s=S(t);a<s;a++){var u=t[a];if(k(u)&&(g.isArray(u)||g.isArguments(u))){e||(u=N(u,e,n));var c=0,l=u.length;for(i.length+=l;c<l;)i[o++]=u[c++]}else n||(i[o++]=u)}return i};g.flatten=function(t,e){return N(t,e,!1)},g.without=function(t){return g.difference(t,l.call(arguments,1))},g.uniq=g.unique=function(t,e,n,r){g.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=b(n,r));for(var i=[],o=[],a=0,s=S(t);a<s;a++){var u=t[a],c=n?n(u,a,t):u;e?(a&&o===c||i.push(u),o=c):n?g.contains(o,c)||(o.push(c),i.push(u)):g.contains(i,u)||i.push(u)}return i},g.union=function(){return g.uniq(N(arguments,!0,!0))},g.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=S(t);r<i;r++){var o=t[r];if(!g.contains(e,o)){for(var a=1;a<n&&g.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},g.difference=function(t){var e=N(arguments,!0,!0,1);return g.filter(t,function(t){return!g.contains(e,t)})},g.zip=function(){return g.unzip(arguments)},g.unzip=function(t){for(var e=t&&g.max(t,S).length||0,n=Array(e),r=0;r<e;r++)n[r]=g.pluck(t,r);return n},g.object=function(t,e){for(var n={},r=0,i=S(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},g.findIndex=e(1),g.findLastIndex=e(-1),g.sortedIndex=function(t,e,n,r){for(var i=(n=b(n,r,1))(e),o=0,a=S(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o},g.indexOf=n(1,g.findIndex,g.sortedIndex),g.lastIndexOf=n(-1,g.findLastIndex),g.range=function(t,e,n){null==e&&(e=t||0,t=0),n=n||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i};var A=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=w(t.prototype),a=t.apply(o,i);return g.isObject(a)?a:o};g.bind=function(t,e){if(m&&t.bind===m)return m.apply(t,l.call(arguments,1));if(!g.isFunction(t))throw new TypeError("Bind must be called on a function");var n=l.call(arguments,2),r=function(){return A(t,r,e,this,n.concat(l.call(arguments)))};return r},g.partial=function(t){var e=l.call(arguments,1),n=function(){for(var r=0,i=e.length,o=Array(i),a=0;a<i;a++)o[a]=e[a]===g?arguments[r++]:e[a]
  ;for(;r<arguments.length;)o.push(arguments[r++]);return A(t,n,this,this,o)};return n},g.bindAll=function(t){var e,n,r=arguments.length;if(r<=1)throw new Error("bindAll must be passed function names");for(e=1;e<r;e++)t[n=arguments[e]]=g.bind(t[n],t);return t},g.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return g.has(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},g.delay=function(t,e){var n=l.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},g.defer=g.partial(g.delay,g,1),g.throttle=function(t,e,n){var r,i,o,a=null,s=0;n||(n={});var u=function(){s=!1===n.leading?0:g.now(),a=null,o=t.apply(r,i),a||(r=i=null)};return function(){var c=g.now();s||!1!==n.leading||(s=c);var l=e-(c-s);return r=this,i=arguments,l<=0||l>e?(a&&(clearTimeout(a),a=null),s=c,o=t.apply(r,i),a||(r=i=null)):a||!1===n.trailing||(a=setTimeout(u,l)),o}},g.debounce=function(t,e,n){var r,i,o,a,s,u=function(){var c=g.now()-a;c<e&&c>=0?r=setTimeout(u,e-c):(r=null,n||(s=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=g.now();var c=n&&!r;return r||(r=setTimeout(u,e)),c&&(s=t.apply(o,i),o=i=null),s}},g.wrap=function(t,e){return g.partial(e,t)},g.negate=function(t){return function(){return!t.apply(this,arguments)}},g.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},g.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},g.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},g.once=g.partial(g.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),T=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];g.keys=function(t){if(!g.isObject(t))return[];if(d)return d(t);var e=[];for(var n in t)g.has(t,n)&&e.push(n);return M&&r(t,e),e},g.allKeys=function(t){if(!g.isObject(t))return[];var e=[];for(var n in t)e.push(n);return M&&r(t,e),e},g.values=function(t){for(var e=g.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},g.mapObject=function(t,e,n){e=b(e,n);for(var r,i=g.keys(t),o=i.length,a={},s=0;s<o;s++)a[r=i[s]]=e(t[r],r,t);return a},g.pairs=function(t){for(var e=g.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},g.invert=function(t){for(var e={},n=g.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},g.functions=g.methods=function(t){var e=[];for(var n in t)g.isFunction(t[n])&&e.push(n);return e.sort()},g.extend=E(g.allKeys),g.extendOwn=g.assign=E(g.keys),g.findKey=function(t,e,n){e=b(e,n);for(var r,i=g.keys(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r},g.pick=function(t,e,n){var r,i,o={},a=t;if(null==a)return o;g.isFunction(e)?(i=g.allKeys(a),r=_(e,n)):(i=N(arguments,!1,!1,1),r=function(t,e,n){return e in n},a=Object(a));for(var s=0,u=i.length;s<u;s++){var c=i[s],l=a[c];r(l,c,a)&&(o[c]=l)}return o},g.omit=function(t,e,n){if(g.isFunction(e))e=g.negate(e);else{var r=g.map(N(arguments,!1,!1,1),String);e=function(t,e){return!g.contains(r,e)}}return g.pick(t,e,n)},g.defaults=E(g.allKeys,!0),g.create=function(t,e){var n=w(t);return e&&g.extendOwn(n,e),n},g.clone=function(t){return g.isObject(t)?g.isArray(t)?t.slice():g.extend({},t):t},g.tap=function(t,e){return e(t),t},g.isMatch=function(t,e){var n=g.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0};var O=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof g&&(t=t._wrapped),e instanceof g&&(e=e._wrapped);var i=h.call(t);if(i!==h.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(g.isFunction(a)&&a instanceof a&&g.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===t)return r[u]===e;if(n.push(t),r.push(e),o){if((u=t.length)!==e.length)return!1;for(;u--;)if(!O(t[u],e[u],n,r))return!1}else{var c,l=g.keys(t);if(u=l.length,g.keys(e).length!==u)return!1;for(;u--;)if(c=l[u],!g.has(e,c)||!O(t[c],e[c],n,r))return!1}return n.pop(),r.pop(),!0};g.isEqual=function(t,e){return O(t,e)},g.isEmpty=function(t){return null==t||(k(t)&&(g.isArray(t)||g.isString(t)||g.isArguments(t))?0===t.length:0===g.keys(t).length)},g.isElement=function(t){return!(!t||1!==t.nodeType)},g.isArray=f||function(t){return"[object Array]"===h.call(t)},g.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},g.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){g["is"+t]=function(e){return h.call(e)==="[object "+t+"]"}}),g.isArguments(arguments)||(g.isArguments=function(t){return g.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(g.isFunction=function(t){return"function"==typeof t||!1}),g.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},g.isNaN=function(t){return g.isNumber(t)&&t!==+t},g.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===h.call(t)},g.isNull=function(t){return null===t},g.isUndefined=function(t){return void 0===t},g.has=function(t,e){return null!=t&&p.call(t,e)},g.noConflict=function(){return i._=o,this},g.identity=function(t){return t},g.constant=function(t){return function(){return t}},g.noop=function(){},g.property=x,g.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},g.matcher=g.matches=function(t){return t=g.extendOwn({},t),function(e){return g.isMatch(e,t)}},g.times=function(t,e,n){var r=Array(Math.max(0,t));e=_(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},g.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},g.now=Date.now||function(){return(new Date).getTime()};var D={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},I=g.invert(D),P=function(t){var e=function(e){return t[e]},n="(?:"+g.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};g.escape=P(D),g.unescape=P(I),g.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),g.isFunction(r)?r.call(t):r};var j=0;g.uniqueId=function(t){var e=++j+"";return t?t+e:e},g.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,L={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,B=function(t){return"\\"+L[t]};g.template=function(t,e,n){!e&&n&&(e=n),e=g.defaults({},e,g.templateSettings);var r=RegExp([(e.escape||F).source,(e.interpolate||F).source,(e.evaluate||F).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,a,s){return o+=t.slice(i,s).replace(U,B),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(e.variable||"obj","_",o)}catch(c){throw c.source=o,c}var s=function(t){return a.call(this,t,g)},u=e.variable||"obj";return s.source="function("+u+"){\n"+o+"}",s},g.chain=function(t){var e=g(t);return e._chain=!0,e};var $=function(t,e){return t._chain?g(e).chain():e};g.mixin=function(t){g.each(g.functions(t),function(e){var n=g[e]=t[e];g.prototype[e]=function(){var t=[this._wrapped];return c.apply(t,arguments),$(this,n.apply(g,t))}})},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=a[t];g.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],$(this,n)}}),g.each(["concat","join","slice"],function(t){var e=a[t];g.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}}),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return g})}.call(this),function(t){var e="object"==typeof self&&self.self==self&&self||"object"==typeof global&&global.global==global&&global;if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(n,r,i){e.Backbone=t(e,i,n,r)});else if("undefined"!=typeof exports){var n,r=require("underscore");try{n=require("jquery")}catch(i){}t(e,exports,r,n)}else e.Backbone=t(e,{},e._,e.jQuery||e.Zepto||e.ender||e.$)}(function(t,e,n,r){var i=t.Backbone,o=Array.prototype.slice;e.VERSION="1.2.3",e.$=r,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a=function(t,e,r){switch(t){case 1:return function(){return n[e](this[r])};case 2:return function(t){return n[e](this[r],t)};case 3:return function(t,i){return n[e](this[r],u(t,this),i)};case 4:return function(t,i,o){return n[e](this[r],u(t,this),i,o)};default:return function(){var t=o.call(arguments);return t.unshift(this[r]),n[e].apply(n,t)}}},s=function(t,e,r){n.each(e,function(e,i){n[i]&&(t.prototype[i]=a(e,i,r))})},u=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?c(t):n.isString(t)?function(e){return e.get(t)}:t},c=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},l=e.Events={},h=/\s+/,p=function(t,e,r,i,o){var a,s=0;if(r&&"object"==typeof r){void 0!==i&&"context"in o&&void 0===o.context&&(o.context=i);for(a=n.keys(r);s<a.length;s++)e=p(t,e,a[s],r[a[s]],o)}else if(r&&h.test(r))for(a=r.split(h);s<a.length;s++)e=t(e,a[s],i,o);else e=t(e,r,i,o);return e};l.on=function(t,e,n){return f(this,t,e,n)};var f=function(t,e,n,r,i){(t._events=p(d,t._events||{},e,n,{context:r,ctx:t,listening:i}),i)&&((t._listeners||(t._listeners={}))[i.id]=i);return t};l.listenTo=function(t,e,r){if(!t)return this;var i=t._listenId||(t._listenId=n.uniqueId("l")),o=this._listeningTo||(this._listeningTo={}),a=o[i];if(!a){var s=this._listenId||(this._listenId=n.uniqueId("l"));a=o[i]={obj:t,objId:i,id:s,listeningTo:o,count:0}}return f(t,e,r,this,a),this};var d=function(t,e,n,r){if(n){var i=t[e]||(t[e]=[]),o=r.context,a=r.ctx,s=r.listening;s&&s.count++,i.push({callback:n,context:o,ctx:o||a,listening:s})}return t};l.off=function(t,e,n){return this._events?(this._events=p(m,this._events,t,e,{context:n,listeners:this._listeners}),this):this},l.stopListening=function(t,e,r){var i=this._listeningTo;if(!i)return this;for(var o=t?[t._listenId]:n.keys(i),a=0;a<o.length;a++){var s=i[o[a]];if(!s)break;s.obj.off(e,r,this)}return n.isEmpty(i)&&(this._listeningTo=void 0),this};var m=function(t,e,r,i){if(t){var o,a=0,s=i.context,u=i.listeners;if(e||r||s){for(var c=e?[e]:n.keys(t);a<c.length;a++){var l=t[e=c[a]];if(!l)break;for(var h=[],p=0;p<l.length;p++){var f=l[p];r&&r!==f.callback&&r!==f.callback._callback||s&&s!==f.context?h.push(f):(o=f.listening)&&0==--o.count&&(delete u[o.id],delete o.listeningTo[o.objId])}h.length?t[e]=h:delete t[e]}return n.size(t)?t:void 0}for(var d=n.keys(u);a<d.length;a++)delete u[(o=u[d[a]]).id],delete o.listeningTo[o.objId]}};l.once=function(t,e,r){var i=p(y,{},t,e,n.bind(this.off,this));return this.on(i,void 0,r)},l.listenToOnce=function(t,e,r){var i=p(y,{},e,r,n.bind(this.stopListening,this,t));return this.listenTo(t,i)};var y=function(t,e,r,i){if(r){var o=t[e]=n.once(function(){i(e,o),r.apply(this,arguments)});o._callback=r}return t};l.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),r=0;r<e;r++)n[r]=arguments[r+1];return p(v,this._events,t,void 0,n),this};var v=function(t,e,n,r){if(t){var i=t[e],o=t.all;i&&o&&(o=o.slice()),i&&g(i,r),o&&g(o,[e].concat(r))}return t},g=function(t,e){var n,r=-1,i=t.length,o=e[0],a=e[1],s=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a,s);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e);return}};l.bind=l.on,l.unbind=l.off,n.extend(e,l);var _=e.Model=function(t,e){var r=t||{};e||(e={}),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{}),r=n.defaults({},r,n.result(this,"defaults")),this.set(r,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(_.prototype,l,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(){return n.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return n.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!n.iteratee(t,this)(this.attributes)},set:function(t,e,r){if(null==t)return this;var i;if("object"==typeof t?(i=t,r=e):(i={})[t]=e,r||(r={}),!this._validate(i,r))return!1;var o=r.unset,a=r.silent,s=[],u=this._changing;this._changing=!0,u||(this._previousAttributes=n.clone(this.attributes),this.changed={});var c=this.attributes,l=this.changed,h=this._previousAttributes;for(var p in i)e=i[p],n.isEqual(c[p],e)||s.push(p),n.isEqual(h[p],e)?delete l[p]:l[p]=e,o?delete c[p]:c[p]=e;if(this.id=this.get(this.idAttribute),!a){s.length&&(this._pending=r);for(var f=0;f<s.length;f++)this.trigger("change:"+s[f],this,c[s[f]],r)}if(u)return this;if(!a)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,n.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,n.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!n.isEmpty(this.changed):n.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&n.clone(this.changed);var e=this._changing?this._previousAttributes:this.attributes,r={};for(var i in t){var o=t[i];n.isEqual(e[i],o)||(r[i]=o)}return!!n.size(r)&&r},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(t){t=n.extend({parse:!0},t);var e=this,r=t.success;return t.success=function(n){var i=t.parse?e.parse(n,t):n;if(!e.set(i,t))return!1;r&&r.call(t.context,e,n,t),e.trigger("sync",e,n,t)},U(this,t),this.sync("read",this,t)},save:function(t,e,r){var i;null==t||"object"==typeof t?(i=t,r=e):(i={})[t]=e;var o=(r=n.extend({validate:!0,parse:!0},r)).wait;if(i&&!o){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;var a=this,s=r.success,u=this.attributes;r.success=function(t){a.attributes=u;var e=r.parse?a.parse(t,r):t;if(o&&(e=n.extend({},i,e)),e&&!a.set(e,r))return!1;s&&s.call(r.context,a,t,r),a.trigger("sync",a,t,r)},U(this,r),i&&o&&(this.attributes=n.extend({},u,i));var c=this.isNew()?"create":r.patch?"patch":"update";"patch"!==c||r.attrs||(r.attrs=i);var l=this.sync(c,this,r);return this.attributes=u,l},destroy:function(t){t=t?n.clone(t):{};var e=this,r=t.success,i=t.wait,o=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(n){i&&o(),r&&r.call(t.context,e,n,t),e.isNew()||e.trigger("sync",e,n,t)};var a=!1;return this.isNew()?n.defer(t.success):(U(this,t),a=this.sync("delete",this,t)),i||o(),a},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||L();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},n.defaults({validate:!0},t))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=n.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger("invalid",this,r,n.extend(e,{validationError:r})),!1)}}),s(_,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes");var b=e.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,n.extend({silent:!0},e))},E={add:!0,remove:!0,merge:!0},w={add:!0,remove:!1},x=function(t,e,n){n=Math.min(Math.max(n,0),t.length);for(var r=Array(t.length-n),i=e.length,o=0;o<r.length;o++)r[o]=t[o+n];for(o=0;o<i;o++)t[o+n]=e[o];for(o=0;o<r.length;o++)t[o+i+n]=r[o]};n.extend(b.prototype,l,{model:_,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,n.extend({merge:!1},e,w))},remove:function(t,e){e=n.extend({},e);var r=!n.isArray(t);t=r?[t]:n.clone(t);var i=this._removeModels(t,e);return!e.silent&&i&&this.trigger("update",this,e),r?i[0]:i},set:function(t,e){if(null!=t){(e=n.defaults({},e,E)).parse&&!this._isModel(t)&&(t=this.parse(t,e));var r=!n.isArray(t);t=r?[t]:t.slice();var i=e.at;null!=i&&(i=+i),i<0&&(i+=this.length+1);for(var o,a=[],s=[],u=[],c={},l=e.add,h=e.merge,p=e.remove,f=!1,d=this.comparator&&null==i&&!1!==e.sort,m=n.isString(this.comparator)?this.comparator:null,y=0;y<t.length;y++){o=t[y];var v=this.get(o);if(v){if(h&&o!==v){var g=this._isModel(o)?o.attributes:o;e.parse&&(g=v.parse(g,e)),v.set(g,e),d&&!f&&(f=v.hasChanged(m))}c[v.cid]||(c[v.cid]=!0,a.push(v)),t[y]=v}else l&&(o=t[y]=this._prepareModel(o,e))&&(s.push(o),this._addReference(o,e),c[o.cid]=!0,a.push(o))}if(p){for(y=0;y<this.length;y++)c[(o=this.models[y]).cid]||u.push(o);u.length&&this._removeModels(u,e)}var _=!1,b=!d&&l&&p;if(a.length&&b?(_=this.length!=a.length||n.some(this.models,function(t,e){return t!==a[e]}),this.models.length=0,x(this.models,a,0),this.length=this.models.length):s.length&&(d&&(f=!0),x(this.models,s,null==i?this.length:i),this.length=this.models.length),f&&this.sort({silent:!0}),!e.silent){for(y=0;y<s.length;y++)null!=i&&(e.index=i+y),(o=s[y]).trigger("add",o,this,e);(f||_)&&this.trigger("sort",this,e),(s.length||u.length)&&this.trigger("update",this,e)}return r?t[0]:t}},reset:function(t,e){e=e?n.clone(e):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],e);return e.previousModels=this.models,this._reset(),t=this.add(t,n.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,n.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,n.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(null!=t){var e=this.modelId(this._isModel(t)?t.attributes:t);return this._byId[t]||this._byId[e]||this._byId[t.cid]}},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var r=e.length;return n.isFunction(e)&&(e=n.bind(e,this)),1===r||n.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return n.invoke(this.models,"get",t)},fetch:function(t){var e=(t=n.extend({parse:!0},t)).success,r=this;return t.success=function(n){var i=t.reset?"reset":"set";r[i](n,t),e&&e.call(t.context,r,n,t),r.trigger("sync",r,n,t)},U(this,t),this.sync("read",this,t)},create:function(t,e){var r=(e=e?n.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;r||this.add(t,e);var i=this,o=e.success;return e.success=function(t,e,n){r&&i.add(t,n),o&&o.call(n.context,t,e,n)},t.save(null,e),t},parse:function(t){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;(e=e?n.clone(e):{}).collection=this;var r=new this.model(t,e);return r.validationError?(this.trigger("invalid",this,r.validationError,e),!1):r},_removeModels:function(t,e){for(var n=[],r=0;r<t.length;r++){var i=this.get(t[r]);if(i){var o=this.indexOf(i);this.models.splice(o,1),this.length--,e.silent||(e.index=o,i.trigger("remove",i,this,e)),n.push(i),this._removeReference(i,e)}}return!!n.length&&n},_isModel:function(t){return t instanceof _},_addReference:function(t){this._byId[t.cid]=t;var e=this.modelId(t.attributes);null!=e&&(this._byId[e]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t){delete this._byId[t.cid];var e=this.modelId(t.attributes);null!=e&&delete this._byId[e],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){if("add"!==t&&"remove"!==t||n===this){if("destroy"===t&&this.remove(e,r),"change"===t){var i=this.modelId(e.previousAttributes()),o=this.modelId(e.attributes);i!==o&&(null!=i&&delete this._byId[i],null!=o&&(this._byId[o]=e))}this.trigger.apply(this,arguments)}}}),s(b,{forEach:3,each:3,map:3,collect:3,reduce:4,foldl:4,inject:4,reduceRight:4,foldr:4,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3},"models");var R=e.View=function(t){this.cid=n.uniqueId("view"),n.extend(this,n.pick(t,k)),this._ensureElement(),this.initialize.apply(this,arguments)},S=/^(\S+)\s*(.*)$/,k=["model","collection","el","id","attributes","className","tagName","events"];n.extend(R.prototype,l,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=n.result(this,"events")),!t)return this;for(var e in this.undelegateEvents(),t){var r=t[e];if(n.isFunction(r)||(r=this[r]),r){var i=e.match(S);this.delegate(i[1],i[2],n.bind(r,this))}}return this},delegate:function(t,e,n){return this.$el.on(t+".delegateEvents"+this.cid,e,n),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,n){return this.$el.off(t+".delegateEvents"+this.cid,e,n),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"));else{var t=n.extend({},n.result(this,"attributes"));this.id&&(t.id=n.result(this,"id")),this.className&&(t["class"]=n.result(this,"className")),this.setElement(this._createElement(n.result(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}}),e.sync=function(t,r,i){var o=C[t];n.defaults(i||(i={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:o,dataType:"json"};if(i.url||(a.url=n.result(r,"url")||L()),null!=i.data||!r||"create"!==t&&"update"!==t&&"patch"!==t||(a.contentType="application/json",a.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),i.emulateHTTP&&("PUT"===o||"DELETE"===o||"PATCH"===o)){a.type="POST",i.emulateJSON&&(a.data._method=o);var s=i.beforeSend;i.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",o),s)return s.apply(this,arguments)}}"GET"===a.type||i.emulateJSON||(a.processData=!1);var u=i.error;i.error=function(t,e,n){i.textStatus=e,i.errorThrown=n,u&&u.call(i.context,t,e,n)};var c=i.xhr=e.ajax(n.extend(a,i));return r.trigger("request",r,c,i),c};var C={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var N=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},A=/\((.*?)\)/g,M=/(\(\?)?:\w+/g,T=/\*\w+/g,O=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(N.prototype,l,{initialize:function(){},route:function(t,r,i){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(r)&&(i=r,r=""),i||(i=this[r]);var o=this;return e.history.route(t,function(n){var a=o._extractParameters(t,n);!1!==o.execute(i,a,r)&&(o.trigger.apply(o,["route:"+r].concat(a)),o.trigger("route",r,a),e.history.trigger("route",o,r,a))}),this},execute:function(t,e){t&&t.apply(this,e)},navigate:function(t,n){return e.history.navigate(t,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,"routes");for(var t,e=n.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(O,"\\$&").replace(A,"(?:$1)?").replace(M,function(t,e){return e?t:"([^/?]+)"}).replace(T,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return n.map(r,function(t,e){return e===r.length-1?t||null:t?decodeURIComponent(t):null})}});var D=e.History=function(){this.handlers=[],this.checkUrl=n.bind(this.checkUrl,this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},I=/^[#\/]|\s+$/g,P=/^\/+|\/+$/g,j=/#.*$/;D.started=!1,n.extend(D.prototype,l,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(I,"")},start:function(t){if(D.started)throw new Error("Backbone.history has already been started");if(D.started=!0,this.options=n.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(P,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash="#"+this.fragment}var o=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?o("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?o("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),D.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(){var t=this.getFragment();if(t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.some(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0}))},navigate:function(t,e){if(!D.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+t;if(t=this.decodeFragment(t.replace(j,"")),this.fragment!==t){if(this.fragment=t,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new D;var F=function(t,e){var r,i=this;r=t&&n.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,e);var o=function(){this.constructor=r};return o.prototype=i.prototype,r.prototype=new o,t&&n.extend(r.prototype,t),r.__super__=i.prototype,r};_.extend=b.extend=N.extend=R.extend=D.extend=F;var L=function(){throw new Error('A "url" property or function must be specified')},U=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}};return e}),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){return this.getAll=e(this.getAll,this),r.__super__.constructor.apply(this,arguments)}return n(r,t),r.prototype.getAll=function(){return this.map(function(t){return t.attributes})},r}(Backbone.Collection),this.BaseCollection=t}.call(this),function(){var t,e=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;t=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.url="/activities",n.prototype.initialize=function(){},n.prototype.isCurrent=function(){return null!=this.get("end")},n}(Backbone.Model),this.ActivityModel=t}.call(this),function(){var t,e=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;t=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.url="/activities",n.prototype.model=ActivityModel,n.prototype.initialize=function(){},n.prototype.getCurrent=function(){return this.find(function(t){return!t.isCurrent()})},n}(BaseCollection),this.ActivityCollection=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){return this.url=e(this.url,this),r.__super__.constructor.apply(this,arguments)}return n(r,t),r.prototype.url=function(){var t;return t="/goals",this.attributes.id&&(t="/goals/"+this.attributes.id),t},r.prototype.initialize=function(){},r}(Backbone.Model),this.GoalModel=t}.call(this),function(){var t,e=function(t,e){function r(){
  this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;t=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.url="/goals",n.prototype.model=GoalModel,n.prototype.initialize=function(){},n}(BaseCollection),this.GoalCollection=t}.call(this),function(){}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.render=e(this.render,this),r.__super__.constructor.call(this,t)}return n(r,t),r.prototype.render=function(){return React.createElement("div",{className:"container-fluid"},React.createElement("div",{className:"row"},React.createElement("div",{className:"col-md-12"},React.createElement(ActivityList,{startTracking:this.props.startTracking,title:"History",updater:this.props.updater,activities:this.props.activities}))))},r}(React.Component),this.ActivityHistory=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){var n;this.render=e(this.render,this),this.onStopCurrent=e(this.onStopCurrent,this),this.updateGoals=e(this.updateGoals,this),this.startTracking=e(this.startTracking,this),this.updateActivities=e(this.updateActivities,this),this.updateTabs=e(this.updateTabs,this),this.state={activityObj:new ActivityCollection(t.initialCollection),activities:t.initialCollection,goalsObj:new GoalCollection(t.goals),goals:t.goals,loading:!1},this.state.current=this.state.activityObj.getCurrent(),this.state.goalsObj.on("sync change reset add remove",(n=this,function(){var t;return t=n.state.goalsObj.getAll(),n.setState({goals:t},n.updateTabs)})),this.state.activityObj.on("sync change reset add remove",function(t){return function(){return t.setState({activities:t.state.activityObj.getAll(),activityObj:t.state.activityObj,current:t.state.activityObj.getCurrent()},t.updateTabs)}}(this))}return n(r,t),r.prototype.componentDidMount=function(){if(null==this.props.initialCollection&&this.updateActivities(),null==this.props.goals)return this.updateGoals()},r.prototype.updateTabs=function(){return this.tabs.updateMe()},r.prototype.updateActivities=function(){return this.state.activityObj.fetch()},r.prototype.startTracking=function(t){var e,n;return e=$.Deferred(),this.setState({loading:!0},(n=this,function(){return n.activityNew.sendNewActivity(t,function(){return n.updateActivities(),n.setState({loading:!1})}).success(function(){return e.resolve()}).error(function(){return e.reject()})})),e.promise()},r.prototype.updateGoals=function(){return this.state.goalsObj.fetch()},r.prototype.onStopCurrent=function(t){return $.ajax({url:t.stop,type:"PUT"}).success((e=this,function(){return e.updateActivities()}));var e},r.prototype.render=function(){var t,e,n,r,i,o=this;return e=this.state.activities,t=null,t=null!=this.state.current?React.createElement(ActivityCurrent,{key:0,onStopCurrent:this.onStopCurrent,activity:this.state.current.attributes,loading:this.state.loading}):React.createElement("div",{key:0,className:"row"},React.createElement("h1",null,"No current activity"),this.state.loading?React.createElement(Spinner,null):""),i=this.updateActivities,n=this.startTracking,(r=[]).push({name:"Todays List",component:React.createElement(ActivityList,{key:r.length,startTracking:n,sort_descending:!0,updater:i,activities:e})}),r.push({name:"Summary",component:React.createElement(ActivitySummary,{key:r.length,startTracking:n,activities:this.props.history})}),r.push({name:"History",component:React.createElement(ActivityHistory,{key:r.length,startTracking:n,updater:i,activities:this.props.history})}),r.push({name:"Goals",component:React.createElement(ActivityDailyGoals,{key:r.length,startTracking:n,list:this.state.goals,collection:this.state.goalsObj})}),r.push({name:"Visualize",component:React.createElement(ActivityCharts,{key:r.length,startTracking:n,activities:this.props.history})}),React.createElement("div",{className:"container-fluid"},React.createElement("div",{className:"row"},React.createElement("div",{className:"col-md-7"},t),React.createElement("div",{className:"col-md-5"},React.createElement("div",{className:"well"},React.createElement("div",{className:"container-fluid"},React.createElement(ActivityNew,{ref:function(t){return o.activityNew=t},collection:this.state.activityObj}))))),React.createElement("div",{className:"row"},React.createElement("div",{className:"col-md-12"},React.createElement(ActivityTabbed,{ref:function(t){return o.tabs=t},tabs:r}))))},r}(React.Component),this.ActivityHome=t}.call(this);var _extends=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};(function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;ReactBootstrap.Row,t=function(t){function r(){return this.render=e(this.render,this),r.__super__.constructor.apply(this,arguments)}return n(r,t),r.prototype.render=function(){var t,e,n,r,i;return r=this.props.title||"Todays",i=this.props.updater,t=this.props.activities,this.props.sort_descending&&(t=_.sortBy(t,function(t){return-1*moment(t.end||t.start).valueOf()})),n=this.props.startTracking,e=_.map(t,function(t){return React.createElement(Activity,_extends({startTracking:n,table:!0,key:t.id,updater:i},t))}),React.createElement("div",{className:"container-fluid"},React.createElement("div",{className:"row"},React.createElement("h3",null,r," ",React.createElement("span",{className:"badge"},this.props.activities.length))),React.createElement("div",{className:"table-responsive row"},React.createElement("table",{className:"table table-striped table-hover"},React.createElement("thead",null,React.createElement("tr",null,React.createElement("th",null,"Begin - End"),React.createElement("th",null,"Date (time elapsed)"),React.createElement("th",null,"Activity name"),React.createElement("th",null,"Actions"),React.createElement("th",null,"Duration"),React.createElement("th",null,"Goal"))),React.createElement("tbody",null,e))))},r}(React.Component),this.ActivityList=t}).call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){return this.render=e(this.render,this),this.startNew=e(this.startNew,this),this.sendNewActivity=e(this.sendNewActivity,this),this.startTracking=e(this.startTracking,this),this.setTracking=e(this.setTracking,this),this.handleChange=e(this.handleChange,this),r.__super__.constructor.apply(this,arguments)}return n(r,t),r.prototype.state={userInput:""},r.prototype.handleChange=function(t){return this.setState({userInput:t.target.value})},r.prototype.setTracking=function(t,e){return this.setState({userInput:t},(n=this,function(){if(n.startNew(n.state.userInput),e)return e()}));var n},r.prototype.startTracking=function(t){return t.preventDefault(),this.sendNewActivity(this.state.userInput)},r.prototype.sendNewActivity=function(t,e){var n;return new ActivityModel({description:t}).save().success((n=this,function(){if(n.props.collection.fetch(),null!=n.props.changed&&n.props.changed(),e)return e()})).fail(function(){return console.error(arguments)})},r.prototype.startNew=function(t,e){return this.sendNewActivity(t,e),!1},r.prototype.render=function(){var t;return t="New","Start",null!=this.props.collection.getCurrent()&&("Switch",t="Switch"),React.createElement("div",{className:"row"},React.createElement("div",{className:"col-md-12"},React.createElement("div",{className:"container-fluid"},React.createElement("div",{className:"row"},React.createElement("h3",null,t," Activity")),React.createElement("div",{className:"row"},React.createElement("div",{className:"input-group"},React.createElement("span",{className:"input-group-addon",onClick:this.startTracking},React.createElement("i",{className:"glyphicon glyphicon-play"})),React.createElement("input",{id:"description",type:"text",className:"form-control",name:"description",placeholder:"Description",value:this.state.userInput,onChange:this.handleChange}))))))},r}(React.Component),this.ActivityNew=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){return this.render=e(this.render,this),r.__super__.constructor.apply(this,arguments)}return n(r,t),r.prototype.render=function(){var t;return t=this.props.resume,React.createElement("button",{onClick:t},React.createElement("i",{className:"glyphicon glyphicon-play"}))},r}(React.Component),this.ActivityResume=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.render=e(this.render,this),this.handleStop=e(this.handleStop,this),this.rotate=e(this.rotate,this),r.__super__.constructor.call(this,t),this.state={displayState:"words"}}return n(r,t),r.prototype.rotate=function(){return"spinner"===this.state.displayState?this.setState({displayState:"words"}):this.setState({displayState:"spinner"}),setTimeout(this.rotate,1e3)},r.prototype.handleStop=function(){},r.prototype.render=function(){var t;return"spinner"===this.state.displayState&&"St","words"===this.state.displayState&&"Stop",t=this.props.stop||this.handleStop,React.createElement("button",{onClick:t},React.createElement("i",{className:"glyphicon glyphicon-stop"}))},r}(React.Component),this.ActivityStop=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.render=e(this.render,this),this.summarize=e(this.summarize,this),this.state={summary:this.summarize(t.activities)}}return n(r,t),r.prototype.summarize=function(t){var e,n,r,i;return r={},i=function(t,e){var n;return n=0,null!=t[e.description]&&(n=t[e.description]),t[e.description]=n+moment(e.end).diff(moment(e.start)),t.time_diff=moment(e.end).diff(moment(e.start)),t},e=_.reduce(t,i,{}),r=Object.entries(e).sort(function(t,e){return e[1]-t[1]}),n=0,r=_.map(r,function(t){var e,r;return r=t[0],e=t[1],React.createElement(ActivityTotal,{key:++n,title:r,time:e})})},r.prototype.render=function(){return React.createElement("div",{className:"row"},React.createElement("div",{className:"col-md-12"},React.createElement("h3",null,"Summary"),this.state.summary))},r}(React.Component),this.ActivitySummary=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.optionList=e(this.optionList,this),this.changeActivity=e(this.changeActivity,this),this.hideSelect=e(this.hideSelect,this),this.editTime=e(this.editTime,this),r.__super__.constructor.call(this,t),this.state={time:t.time,display:"noselect",options:this.optionList(t),changing:!1}}return n(r,t),r.prototype.editTime=function(){return"select"===this.state.display?this.setState({display:"noselect"}):this.setState({display:"select"})},r.prototype.hideSelect=function(){return this.setState({display:"noselect"})},r.prototype.changeActivity=function(t){var e,n,r;if(n=t.target.value,e=moment(n),"start"===this.props.type&&this.setState({changing:!0},(r=this,function(){return $.ajax({url:r.props.activityUpdateUrl,contentType:"application/json",type:"PUT",data:JSON.stringify({start:e.format()})}).success(function(t){return r.setState({changing:!1,time:t.start,display:"noselect",options:r.optionList(r.state)})})})),"end"===this.props.type)return this.setState({changing:!0},function(t){return function(){return $.ajax({url:t.props.activityUpdateUrl,contentType:"application/json",type:"PUT",data:JSON.stringify({end:e.format()})}).success(function(e){return t.setState({changing:!1,time:e.end,display:"noselect",options:t.optionList(t.state)})})}}(this))},r.prototype.render=function(){var t;return t="",this.state.time&&(t=moment(this.state.time).format("hh:mm")),t="select"===this.state.display?React.createElement("select",{onMouseOut:this.hideSelect,onChange:this.changeActivity},this.state.options):React.createElement("span",{onClick:this.editTime},t),this.state.changing&&(t=React.createElement(Spinner,null)),React.createElement("span",null,t)},r.prototype.optionList=function(t){var e,n,r,i,o,a;if(null==t.time)return[];for(o=t.time,r=[],e=0,n=(i=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]).length;e<n;e++)(a=i[e])<i.length/2?r[a]=React.createElement("option",{key:a,value:moment(o).subtract(i.length/2-a,"hour")},"-",i.length/2-a,"h ",moment(o).subtract(i.length/2-a,"hour").format("hh:mm  MM/DD")):r[a]=React.createElement("option",{key:a,value:moment(o).add(a-i.length/2,"hour")},"+",a-i.length/2,"h ",moment(o).add(a-i.length/2,"hour").format("hh:mm MM/DD"));return r},r}(React.Component),this.ActivityTime=t}.call(this),function(){var t,e=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;t=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.render=function(){var t;return t=moment.duration(this.props.time).humanize(),React.createElement("div",null,t," - ",this.props.title)},n}(React.Component),this.ActivityTotal=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){return this.render=e(this.render,this),this.handleDateChange=e(this.handleDateChange,this),this.remove=e(this.remove,this),r.__super__.constructor.apply(this,arguments)}return n(r,t),r.prototype.remove=function(){return this.props.model.destroy().success((t=this,function(){if(t.props.list.fetch(),null!=t.props.changed)return t.props.changed()}));var t},r.prototype.handleDateChange=function(t){return this.props.model.set({target_date:t}),this.props.model.save({target_date:t},{success:(e=this,function(){return e.props.changed()})});var e},r.prototype.render=function(){var t,e,n,r;return t=moment(this.props.created_at).format("YYYY MMM DD"),n=moment(this.props.target_date).format("YYYY MMM DD"),e={float:"left",marginRight:12},r={paddingTop:8,display:"inline-block"},React.createElement("div",{className:"panel panel-default"},React.createElement("div",{className:"panel-heading"},React.createElement("h4",{className:"panel-title clearfix"},React.createElement("span",{style:r},this.props.name),React.createElement("div",{className:"btn-group pull-right"},React.createElement("div",{className:"btn"},React.createElement(GoalDuration,{duration:this.props.duration}),"\n"),React.createElement("a",{className:"btn btn-default btn-sm",onClick:this.remove,"aria-label":"Delete"},React.createElement("span",{className:"glyphicon glyphicon-remove-sign","aria-hidden":"true"}))))),React.createElement("div",{className:"panel-body"},React.createElement("div",{className:"row"},React.createElement("div",{className:"col-sm-6"},React.createElement("label",{style:e},"Created:"),React.createElement("div",null,t)),React.createElement("div",{className:"col-sm-6"},React.createElement("label",{style:e},"Target Date:"),React.createElement("div",null,n),React.createElement(DatePicker,{handler:this.handleDateChange.bind(this)}))),React.createElement("div",{className:"row"},React.createElement("div",{className:"col-sm-12"},React.createElement("label",{style:e},"Activities"),React.createElement("div",null,this.props.activity_count)))))},r}(React.Component),this.Goal=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){return this.render=e(this.render,this),r.__super__.constructor.apply(this,arguments)}return n(r,t),r.prototype.render=function(){return React.createElement("span",{className:"badge"},"Time Spent: ",moment.duration({seconds:this.props.duration}).asHours()," hours")},r}(React.Component),this.GoalDuration=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){var n;this.optionList=e(this.optionList,this),this.changeSelection=e(this.changeSelection,this),this.hideSelect=e(this.hideSelect,this),this.editGoal=e(this.editGoal,this),this.componentWillReceiveProps=e(this.componentWillReceiveProps,this),r.__super__.constructor.call(this,t),n="noselect",this.state={editing:!!t.id,name:t.name,display:n,options:this.optionList(t)}}return n(r,t),r.prototype.componentWillReceiveProps=function(t){var e;if(this.props=t,e=this.state.display,!this.state.editing&&"select"===e&&t.name)return"noselect"},r.prototype.editGoal=function(){return this.setState({editing:!0,display:"select"})},r.prototype.hideSelect=function(){return this.setState({editing:!1,display:"noselect"})},r.prototype.changeSelection=function(t){var e;if(void 0," "!==(e=t.target.selectedOptions.item(0).value))return _.find(this.props.goals,function(t){return t.id.toString()===e})},r.prototype.render=function(){return"","select"===this.state.display?React.createElement("select",{defaultValue:"DEFAULT",value:this.id,onChange:this.changeSelection},this.state.options):React.createElement("div",{onClick:this.editGoal},this.state.name||"N/A")},r.prototype.optionList=function(t){var e;return t.goals?((e=t.goals.map(function(t){return React.createElement("option",{key:t.id,value:t.id},t.name)})).unshift(React.createElement("option",{key:"DEFAULT",value:"DEFAULT"})),e):[]},r}(React.Component),this.GoalSelector=t}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){return this.render=e(this.render,this),r.__super__.constructor.apply(this,arguments)}return n(r,t),r.prototype.render=function(){return React.createElement("nav",{className:"mynav navbar navbar-inverse navbar-fixed-top"},React.createElement("ul",{className:"nav sidebar-nav"},React.createElement("li",null,"Sidenav")))},r}(React.Component),this.Sidenav=t}.call(this),function(){var t,e=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;t=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.render=function(){var t,e;return e=this.props.width||"25px",t=this.props.height||"25px",React.createElement("div",{style:{width:e,height:t}},React.createElement("div",{className:"circle-spinner"}))},n}(React.Component),this.Spinner=t}.call(this);