diff --git a/homeassistant/__init__.py b/homeassistant/__init__.py index 0d41e7dd2e6..bc6dca95113 100644 --- a/homeassistant/__init__.py +++ b/homeassistant/__init__.py @@ -459,6 +459,11 @@ class State(object): self.last_changed = util.strip_microseconds( last_changed or self.last_updated) + @property + def domain(self): + """ Returns domain of this state. """ + return util.split_entity_id(self.entity_id)[0] + def copy(self): """ Creates a copy of itself. """ return State(self.entity_id, self.state, diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py index a4b93bdf19b..c81ddde4759 100644 --- a/homeassistant/components/frontend/version.py +++ b/homeassistant/components/frontend/version.py @@ -1,2 +1,2 @@ """ DO NOT MODIFY. Auto-generated by build_frontend script """ -VERSION = "1d8b14c387123a4b42fec6b8f9346675" +VERSION = "c47a52ae084d870c0c306eea8c27f507" diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html index 84b550ecffc..f1e67e40c3c 100644 --- a/homeassistant/components/frontend/www_static/frontend.html +++ b/homeassistant/components/frontend/www_static/frontend.html @@ -126,7 +126,7 @@ b.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.loc },e)},ce.prototype.__iterator=function(t,e){var n=this._iter.__iterator(gr,e),r=0;return new T(function(){var e=n.next();return e.done?e:E(t,r++,e.value,e)})},t(fe,R),fe.prototype.has=function(t){return this._iter.contains(t)},fe.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},fe.prototype.__iterator=function(t,e){var n=this._iter.__iterator(gr,e);return new T(function(){var e=n.next();return e.done?e:E(t,e.value,e.value,e)})},t(le,D),le.prototype.entrySeq=function(){return this._iter.toSeq()},le.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return e?(De(e),t(e[1],e[0],n)):void 0},e)},le.prototype.__iterator=function(t,e){var n=this._iter.__iterator(gr,e);return new T(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r)return De(r),t===mr?e:E(t,r[0],r[1],e)}})},ce.prototype.cacheResult=se.prototype.cacheResult=fe.prototype.cacheResult=le.prototype.cacheResult=ke,t(Le,H),Le.prototype.toString=function(){return this.__toString("Map {","}")},Le.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Le.prototype.set=function(t,e){return Je(this,t,e)},Le.prototype.setIn=function(t,e){return this.updateIn(t,fr,function(){return e})},Le.prototype.remove=function(t){return Je(this,t,fr)},Le.prototype.deleteIn=function(t){return this.updateIn(t,function(){return fr})},Le.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},Le.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=un(this,ze(t),e,n);return r===fr?void 0:r},Le.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Be()},Le.prototype.merge=function(){return nn(this,void 0,arguments)},Le.prototype.mergeWith=function(t){var e=or.call(arguments,1);return nn(this,t,e)},Le.prototype.mergeIn=function(t){var e=or.call(arguments,1);return this.updateIn(t,Be(),function(t){return t.merge.apply(t,e)})},Le.prototype.mergeDeep=function(){return nn(this,rn(void 0),arguments)},Le.prototype.mergeDeepWith=function(t){var e=or.call(arguments,1);return nn(this,rn(t),e)},Le.prototype.mergeDeepIn=function(t){var e=or.call(arguments,1);return this.updateIn(t,Be(),function(t){return t.mergeDeep.apply(t,e)})},Le.prototype.sort=function(t){return On(Ie(this,t))},Le.prototype.sortBy=function(t,e){return On(Ie(this,e,t))},Le.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Le.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new r)},Le.prototype.asImmutable=function(){return this.__ensureOwner()},Le.prototype.wasAltered=function(){return this.__altered},Le.prototype.__iterator=function(t,e){return new Ke(this,t,e)},Le.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},Le.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Fe(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Le.isMap=qe;var kr="@@__IMMUTABLE_MAP__@@",jr=Le.prototype;jr[kr]=!0,jr[ur]=jr.remove,jr.removeIn=jr.deleteIn,Pe.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(J(n,i[o][0]))return i[o][1];return r},Pe.prototype.update=function(t,e,r,o,u,a,s){for(var c=u===fr,f=this.entries,l=0,h=f.length;h>l&&!J(o,f[l][0]);l++);var p=h>l;if(p?f[l][1]===u:c)return this;if(n(s),(c||!p)&&n(a),!c||1!==f.length){if(!p&&!c&&f.length>=Lr)return Qe(t,f,o,u);var _=t&&t===this.ownerID,v=_?f:i(f);return p?c?l===h-1?v.pop():v[l]=v.pop():v[l]=[o,u]:v.push([o,u]),_?(this.entries=v,this):new Pe(t,v)}},Ue.prototype.get=function(t,e,n,r){void 0===e&&(e=ee(n));var i=1<<((0===t?e:e>>>t)&cr),o=this.bitmap;return 0===(o&i)?r:this.nodes[an(o&i-1)].get(t+ar,e,n,r)},Ue.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=ee(r));var a=(0===e?n:n>>>e)&cr,s=1<=qr)return en(t,h,c,a,_);if(f&&!_&&2===h.length&&Xe(h[1^l]))return h[1^l];if(f&&_&&1===h.length&&Xe(_))return _;var v=t&&t===this.ownerID,y=f?_?c:c^s:c|s,d=f?_?sn(h,l,_,v):fn(h,l,v):cn(h,l,_,v);return v?(this.bitmap=y,this.nodes=d,this):new Ue(t,y,d)},We.prototype.get=function(t,e,n,r){void 0===e&&(e=ee(n));var i=(0===t?e:e>>>t)&cr,o=this.nodes[i];return o?o.get(t+ar,e,n,r):r},We.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=ee(r));var a=(0===e?n:n>>>e)&cr,s=i===fr,c=this.nodes,f=c[a];if(s&&!f)return this;var l=Ye(f,t,e+ar,n,r,i,o,u);if(l===f)return this;var h=this.count;if(f){if(!l&&(h--,Pr>h))return tn(t,c,h,a)}else h++;var p=t&&t===this.ownerID,_=sn(c,a,l,p);return p?(this.count=h,this.nodes=_,this):new We(t,h,_)},Ve.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(J(n,i[o][0]))return i[o][1];return r},Ve.prototype.update=function(t,e,r,o,u,a,s){void 0===r&&(r=ee(o));var c=u===fr;if(r!==this.keyHash)return c?this:(n(s),n(a),Ze(this,t,e,r,[o,u]));for(var f=this.entries,l=0,h=f.length;h>l&&!J(o,f[l][0]);l++);var p=h>l;if(p?f[l][1]===u:c)return this;if(n(s),(c||!p)&&n(a),c&&2===h)return new Ge(t,this.keyHash,f[1^l]);var _=t&&t===this.ownerID,v=_?f:i(f);return p?c?l===h-1?v.pop():v[l]=v.pop():v[l]=[o,u]:v.push([o,u]),_?(this.entries=v,this):new Ve(t,this.keyHash,v)},Ge.prototype.get=function(t,e,n,r){return J(n,this.entry[0])?this.entry[1]:r},Ge.prototype.update=function(t,e,r,i,o,u,a){var s=o===fr,c=J(i,this.entry[0]);return(c?o===this.entry[1]:s)?this:(n(a),s?void n(u):c?t&&t===this.ownerID?(this.entry[1]=o,this):new Ge(t,this.keyHash,[i,o]):(n(u),Ze(this,t,e,ee(i),[i,o])))},Pe.prototype.iterate=Ve.prototype.iterate=function(t,e){for(var n=this.entries,r=0,i=n.length-1;i>=r;r++)if(t(n[e?i-r:r])===!1)return!1},Ue.prototype.iterate=We.prototype.iterate=function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++){var o=n[e?i-r:r];if(o&&o.iterate(t,e)===!1)return!1}},Ge.prototype.iterate=function(t){return t(this.entry)},t(Ke,T),Ke.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return $e(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,n>=i)return $e(t,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,n>=i){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return $e(t,o.entry);e=this._stack=He(o,e)}continue}e=this._stack=this._stack.__prev}return b()};var zr,Lr=sr/4,qr=sr/2,Pr=sr/4;t(ln,F),ln.of=function(){return this(arguments)},ln.prototype.toString=function(){return this.__toString("List [","]")},ln.prototype.get=function(t,e){if(t=u(this,t),0>t||t>=this.size)return e;t+=this._origin;var n=wn(this,t);return n&&n.array[t&cr]},ln.prototype.set=function(t,e){return dn(this,t,e)},ln.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},ln.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=ar,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):yn()},ln.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(n){Tn(n,0,e+t.length);for(var r=0;r>>e&cr;if(r>=this.array.length)return new pn([],t);var i,o=0===r;if(e>0){var u=this.array[r];if(i=u&&u.removeBefore(t,e-ar,n),i===u&&o)return this}if(o&&!i)return this;var a=mn(this,t);if(!o)for(var s=0;r>s;s++)a.array[s]=void 0;return i&&(a.array[r]=i),a},pn.prototype.removeAfter=function(t,e,n){if(n===e?1<>>e&cr;if(r>=this.array.length)return this;var i,o=r===this.array.length-1;if(e>0){var u=this.array[r];if(i=u&&u.removeAfter(t,e-ar,n),i===u&&o)return this}if(o&&!i)return this;var a=mn(this,t);return o||a.array.pop(),i&&(a.array[r]=i),a};var Vr,Gr={};t(On,Le),On.of=function(){return this(arguments)},On.prototype.toString=function(){return this.__toString("OrderedMap {","}")},On.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},On.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):An()},On.prototype.set=function(t,e){return Nn(this,t,e)},On.prototype.remove=function(t){return Nn(this,t,fr)},On.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},On.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],n)},e)},On.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},On.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?Sn(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=n,this)},On.isOrderedMap=In,On.prototype[yr]=!0,On.prototype[ur]=On.prototype.remove;var Kr;t(Cn,F),Cn.of=function(){return this(arguments)},Cn.prototype.toString=function(){return this.__toString("Stack [","]")},Cn.prototype.get=function(t,e){var n=this._head;for(t=u(this,t);n&&t--;)n=n.next;return n?n.value:e},Cn.prototype.peek=function(){return this._head&&this._head.value},Cn.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,n=arguments.length-1;n>=0;n--)e={value:arguments[n],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):xn(t,e)},Cn.prototype.pushAll=function(t){if(t=_(t),0===t.size)return this;ae(t.size);var e=this.size,n=this._head;return t.reverse().forEach(function(t){e++,n={value:t,next:n}}),this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):xn(e,n)},Cn.prototype.pop=function(){return this.slice(1)},Cn.prototype.unshift=function(){return this.push.apply(this,arguments)},Cn.prototype.unshiftAll=function(t){return this.pushAll(t)},Cn.prototype.shift=function(){return this.pop.apply(this,arguments)},Cn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Rn()},Cn.prototype.slice=function(t,e){if(s(t,e,this.size))return this;var n=c(t,this.size),r=f(e,this.size);if(r!==this.size)return F.prototype.slice.call(this,t,e);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):xn(i,o)},Cn.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?xn(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Cn.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var n=0,r=this._head;r&&t(r.value,n++,this)!==!1;)r=r.next;return n},Cn.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var n=0,r=this._head;return new T(function(){if(r){var e=r.value;return r=r.next,E(t,n++,e)}return b()})},Cn.isStack=Dn;var $r="@@__IMMUTABLE_STACK__@@",Hr=Cn.prototype;Hr[$r]=!0,Hr.withMutations=jr.withMutations,Hr.asMutable=jr.asMutable,Hr.asImmutable=jr.asImmutable,Hr.wasAltered=jr.wasAltered;var Fr;t(Mn,B),Mn.of=function(){return this(arguments)},Mn.fromKeys=function(t){return this(p(t).keySeq())},Mn.prototype.toString=function(){return this.__toString("Set {","}")},Mn.prototype.has=function(t){return this._map.has(t)},Mn.prototype.add=function(t){return jn(this,this._map.set(t,!0))},Mn.prototype.remove=function(t){return jn(this,this._map.remove(t))},Mn.prototype.clear=function(){return jn(this,this._map.clear())},Mn.prototype.union=function(){var t=or.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0===this.size&&1===t.length?this.constructor(t[0]):this.withMutations(function(e){for(var n=0;n1?" by "+this._step:"")+" ]"},Hn.prototype.get=function(t,e){return this.has(t)?this._start+u(this,t)*this._step:e},Hn.prototype.contains=function(t){var e=(t-this._start)/this._step;return e>=0&&e=e?new Hn(0,0):new Hn(this.get(t,this._end),this.get(e,this._end),this._step))},Hn.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step===0){var n=e/this._step;if(n>=0&&n=o;o++){if(t(i,o,this)===!1)return o+1;i+=e?-r:r}return o},Hn.prototype.__iterator=function(t,e){var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;return new T(function(){var u=i;return i+=e?-r:r,o>n?b():E(t,o++,u)})},Hn.prototype.equals=function(t){return t instanceof Hn?this._start===t._start&&this._end===t._end&&this._step===t._step:$n(this,t)};var ti;t(Fn,x),Fn.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Fn.prototype.get=function(t,e){return this.has(t)?this._value:e},Fn.prototype.contains=function(t){return J(this._value,t)},Fn.prototype.slice=function(t,e){var n=this.size;return s(t,e,n)?this:new Fn(this._value,f(e,n)-c(t,n))},Fn.prototype.reverse=function(){return this},Fn.prototype.indexOf=function(t){return J(this._value,t)?0:-1},Fn.prototype.lastIndexOf=function(t){return J(this._value,t)?this.size:-1},Fn.prototype.__iterate=function(t){for(var e=0;et||1/0===this.size||void 0!==this.size&&t>this.size?e:this.find(function(e,n){return n===t},void 0,e)},has:function(t){return t=u(this,t),t>=0&&(void 0!==this.size?1/0===this.size||te||!n||"undefined"==typeof t&&r)return 1;if(e>t||!r||"undefined"==typeof e&&n)return-1}return 0}function u(t,e,n){if(e!==e)return d(t,n);for(var r=(n||0)-1,i=t.length;++r-1;);return n}function l(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function h(t,e){return o(t.criteria,e.criteria)||t.index-e.index}function p(t,e){for(var n=-1,r=t.criteria,i=e.criteria,u=r.length;++n=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function w(t,e){for(var n=-1,r=t.length,i=-1,o=[];++ne,r=yr(0,t.length,this.views),i=r.start,o=r.end,u=o-i,a=this.dropCount,s=ya(u,this.takeCount-a),c=n?o:i-1,f=this.iteratees,l=f?f.length:0,h=0,p=[];t:for(;u--&&s>h;){c+=e;for(var _=-1,v=t[c];++_r&&(r=i)}return r}function on(t){for(var e=-1,n=t.length,r=Ea;++ei&&(r=i)}return r}function un(t,e,n,r){var i=-1,o=t.length;for(r&&o&&(n=t[++i]);++i=200&&Ra(e),c=e.length;s&&(o=Fe,a=!1,e=s);t:for(;++ie&&(e=-e>i?0:i+e),n="undefined"==typeof n||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=xu(i);++r=200,s=a&&Ra(),c=[];s?(r=Fe,o=!1):(a=!1,s=e?[]:c);t:for(;++n=i){for(;i>r;){var o=r+i>>>1,u=t[o];(n?e>=u:e>u)?r=o+1:i=o}return i}return Jn(t,e,Tu,n)}function Jn(t,e,n,r){e=n(e);for(var i=0,o=t?t.length:0,u=e!==e,a="undefined"==typeof e;o>i;){var s=ea((i+o)/2),c=n(t[s]),f=c===c;if(u)var l=f||r;else l=a?f&&(r||"undefined"!=typeof c):r?e>=c:e>c;l?i=s+1:o=s}return ya(o,Oa)}function Yn(t,e,n){if("function"!=typeof t)return Tu;if("undefined"==typeof e)return t;switch(n){case 1:return function(n){return t.call(e,n)};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)};case 5:return function(n,r,i,o,u){return t.call(e,n,r,i,o,u)}}return function(){return t.apply(e,arguments)}}function Xn(t){return Zu.call(t,0)}function Zn(t,e,n){for(var r=n.length,i=-1,o=va(t.length-r,0),u=-1,a=e.length,s=xu(o+a);++ue||null==n)return n;if(e>3&&Er(arguments[1],arguments[2],arguments[3])&&(e=2),e>3&&"function"==typeof arguments[e-2])var r=Yn(arguments[--e-1],arguments[e--],5);else e>2&&"function"==typeof arguments[e-1]&&(r=arguments[--e]);for(var i=0;++im){var I=a?Ye(a):null,S=va(c-m,0),A=_?O:null,D=_?null:O,x=_?E:null,R=_?null:E;e|=_?M:k,e&=~(_?k:M),v||(e&=~(N|C));var j=ur(t,e,n,x,A,R,D,I,s,S);return j.placeholder=b,j}}var z=h?n:this;return p&&(t=z[g]),a&&(E=Nr(E,a)),l&&s=e||!pa(e))return"";var i=e-r;return n=null==n?" ":n+"",cu(n,Qu(i/n.length)).slice(0,i)}function sr(t,e,n,r){function i(){for(var e=-1,a=arguments.length,s=-1,c=r.length,f=xu(a+c);++ss))return!1;for(;f&&++as:s>i)||s===r&&s===o)&&(i=s,o=t)}),o}function _r(t,n,r){var i=e.callback||mu;return i=i===mu?vn:i,r?i(t,n,r):i}function vr(t,n,r){var i=e.indexOf||$r;return i=i===$r?u:i,t?i(t,n,r):i}function yr(t,e,n){for(var r=-1,i=n?n.length:0;++r-1&&t%1==0&&e>t}function Er(t,e,n){if(!To(n))return!1;var r=typeof e;if("number"==r)var i=n.length,o=br(i)&&Tr(e,i);else o="string"==r&&e in n;return o&&n[e]===t}function br(t){return"number"==typeof t&&t>-1&&t%1==0&&Aa>=t}function Or(t){return t===t&&(0===t?1/t>0:!To(t))}function Ir(t,e){var n=t[1],r=e[1],i=n|r,o=z|j,u=N|C,a=o|u|D|R,s=n&z&&!(r&z),c=n&j&&!(r&j),f=(c?t:e)[7],l=(s?t:e)[8],h=!(n>=j&&r>u||n>u&&r>=j),p=i>=o&&a>=i&&(j>n||(c||s)&&f.length<=l);if(!h&&!p)return t;r&N&&(t[2]=e[2],i|=n&N?0:D);var _=e[3];if(_){var v=t[3];t[3]=v?Zn(v,_,e[4]):Ye(_),t[4]=v?w(t[3],$):Ye(e[4])}return _=e[5],_&&(v=t[5],t[5]=v?Qn(v,_,e[6]):Ye(_),t[6]=v?w(t[5],$):Ye(e[6])),_=e[7],_&&(t[7]=Ye(_)),r&z&&(t[8]=null==t[8]?e[8]:ya(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function Sr(t,e){t=Rr(t);for(var n=-1,r=e.length,i={};++nr;)u[++o]=Gn(t,r,r+=e);return u}function kr(t){for(var e=-1,n=t?t.length:0,r=-1,i=[];++ee?0:e)):[]}function Lr(t,e,n){var r=t?t.length:0;return r?((n?Er(t,e,n):null==e)&&(e=1),e=r-(+e||0),Gn(t,0,0>e?0:e)):[]}function qr(t,e,n){var r=t?t.length:0;if(!r)return[];for(e=_r(e,n,3);r--&&e(t[r],r,t););return Gn(t,0,r+1)}function Pr(t,e,n){var r=t?t.length:0;if(!r)return[];var i=-1;for(e=_r(e,n,3);++in?va(r+n,0):n||0;else if(n){var i=Bn(t,e),o=t[i];return(e===e?e===o:o!==o)?i:-1}return u(t,e,n)}function Hr(t){return Lr(t,1)}function Fr(){for(var t=[],e=-1,n=arguments.length,r=[],i=vr(),o=i==u;++e=120&&Ra(e&&a)))}n=t.length;var s=t[0],c=-1,f=s?s.length:0,l=[],h=r[0];t:for(;++cn?va(r+n,0):ya(n||0,r-1))+1;else if(n){i=Bn(t,e,!0)-1;var o=t[i];return(e===e?e===o:o!==o)?i:-1}if(e!==e)return d(t,i,!0);for(;i--;)if(t[i]===e)return i;return-1}function Yr(){var t=arguments[0];if(!t||!t.length)return t;for(var e=0,n=vr(),r=arguments.length;++e-1;)aa.call(t,i,1);return t}function Xr(t){return Un(t||[],On(arguments,!1,!1,1))}function Zr(t,e,n){var r=-1,i=t?t.length:0,o=[];for(e=_r(e,n,3);++re?0:e)):[]}function ii(t,e,n){var r=t?t.length:0;return r?((n?Er(t,e,n):null==e)&&(e=1),e=r-(+e||0),Gn(t,0>e?0:e)):[]}function oi(t,e,n){var r=t?t.length:0;if(!r)return[];for(e=_r(e,n,3);r--&&e(t[r],r,t););return Gn(t,r+1)}function ui(t,e,n){var r=t?t.length:0;if(!r)return[];var i=-1;for(e=_r(e,n,3);++i>>0,r=xu(n);++en?va(r+n,0):n||0:0,"string"==typeof t||!Va(t)&&No(t)?r>n&&t.indexOf(e,n)>-1:vr(t,e,n)>-1):!1}function bi(t,e,n){var r=Va(t)?tn:Tn;return("function"!=typeof e||"undefined"!=typeof n)&&(e=_r(e,n,3)),r(t,e)}function Oi(t,e,n){var r=Va(t)?en:En;return e=_r(e,n,3),r(t,e)}function Ii(t,e,n){if(Va(t)){var r=Ur(t,e,n);return r>-1?t[r]:S}return e=_r(e,n,3),bn(t,e,mn)}function Si(t,e,n){return e=_r(e,n,3),bn(t,e,wn)}function Ai(t,e){return Ii(t,zn(e))}function Ni(t,e,n){return"function"==typeof e&&"undefined"==typeof n&&Va(t)?Xe(t,e):mn(t,Yn(e,n,3))}function Ci(t,e,n){return"function"==typeof e&&"undefined"==typeof n&&Va(t)?Qe(t,e):wn(t,Yn(e,n,3))}function Di(t,e){return xn(t,e,Gn(arguments,2))}function xi(t,e,n){var r=Va(t)?nn:jn;return e=_r(e,n,3),r(t,e)}function Ri(t,e){return xi(t,Pn(e+""))}function Mi(t,e,n,r){var i=Va(t)?un:Vn;return i(t,_r(e,r,4),n,arguments.length<3,mn)}function ki(t,e,n,r){var i=Va(t)?an:Vn;return i(t,_r(e,r,4),n,arguments.length<3,wn)}function ji(t,e,n){var r=Va(t)?en:En;return e=_r(e,n,3),r(t,function(t,n,r){return!e(t,n,r)})}function zi(t,e,n){if(n?Er(t,e,n):null==e){t=xr(t);var r=t.length;return r>0?t[Wn(0,r-1)]:S}var i=Li(t);return i.length=ya(0>e?0:+e||0,i.length),i}function Li(t){t=xr(t);for(var e=-1,n=t.length,r=xu(n);++e3&&Er(e[1],e[2],e[3])&&(e=[t,e[1]]);var n=-1,r=t?t.length:0,i=On(e,!1,!1,1),o=br(r)?xu(r):[];return mn(t,function(t){for(var e=i.length,r=xu(e);e--;)r[e]=null==t?S:t[i[e]];o[++n]={criteria:r,index:n,value:t}}),a(o,p)}function Vi(t,e){return Oi(t,zn(e))}function Gi(t,e){if(!wo(e)){if(!wo(t))throw new Uu(K);var n=t;t=e,e=n}return t=pa(t=+t)?t:0,function(){return--t<1?e.apply(this,arguments):void 0}}function Ki(t,e,n){return n&&Er(t,e,n)&&(e=null),e=t&&null==e?t.length:va(+e||0,0),cr(t,z,null,null,null,null,e)}function $i(t,e){var n;if(!wo(e)){if(!wo(t))throw new Uu(K);var r=t;t=e,e=r}return function(){return--t>0?n=e.apply(this,arguments):e=null,n}}function Hi(t,e){var n=N;if(arguments.length>2){var r=Gn(arguments,2),i=w(r,Hi.placeholder);n|=M}return cr(t,n,e,r,i)}function Fi(t){return _n(t,arguments.length>1?On(arguments,!1,!1,1):Wo(t))}function Bi(t,e){var n=N|C;if(arguments.length>2){var r=Gn(arguments,2),i=w(r,Bi.placeholder);n|=M}return cr(e,n,t,r,i)}function Ji(t,e,n){n&&Er(t,e,n)&&(e=null);var r=cr(t,x,null,null,null,null,null,e);return r.placeholder=Ji.placeholder,r}function Yi(t,e,n){n&&Er(t,e,n)&&(e=null);var r=cr(t,R,null,null,null,null,null,e);return r.placeholder=Yi.placeholder,r}function Xi(t,e,n){function r(){h&&ta(h),s&&ta(s),s=h=p=S}function i(){var n=e-(Wa()-f);if(0>=n||n>e){s&&ta(s);var r=p;s=h=p=S,r&&(_=Wa(),c=t.apply(l,a),h||s||(a=l=null))}else h=ua(i,n)}function o(){h&&ta(h),s=h=p=S,(y||v!==e)&&(_=Wa(),c=t.apply(l,a),h||s||(a=l=null))}function u(){if(a=arguments,f=Wa(),l=this,p=y&&(h||!d),v===!1)var n=d&&!h;else{s||d||(_=f);var r=v-(f-_),u=0>=r||r>v;u?(s&&(s=ta(s)),_=f,c=t.apply(l,a)):s||(s=ua(o,r))}return u&&h?h=ta(h):h||e===v||(h=ua(i,e)),n&&(u=!0,c=t.apply(l,a)),!u||h||s||(a=l=null),c}var a,s,c,f,l,h,p,_=0,v=!1,y=!0;if(!wo(t))throw new Uu(K);if(e=0>e?0:e,n===!0){var d=!0;y=!1}else To(n)&&(d=n.leading,v="maxWait"in n&&va(+n.maxWait||0,e),y="trailing"in n?n.trailing:y);return u.cancel=r,u}function Zi(t){return dn(t,1,arguments,1)}function Qi(t,e){return dn(t,e,arguments,2)}function to(){var t=arguments,e=t.length;if(!e)return function(){};if(!tn(t,wo))throw new Uu(K);return function(){for(var n=0,r=t[n].apply(this,arguments);++ne)return function(){};if(!tn(t,wo))throw new Uu(K);return function(){for(var n=e,r=t[n].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function no(t,e){if(!wo(t)||e&&!wo(e))throw new Uu(K);var n=function(){var r=n.cache,i=e?e.apply(this,arguments):arguments[0];if(r.has(i))return r.get(i);var o=t.apply(this,arguments);return r.set(i,o),o};return n.cache=new no.Cache,n}function ro(t){if(!wo(t))throw new Uu(K);return function(){return!t.apply(this,arguments)}}function io(t){return $i(t,2)}function oo(t){var e=Gn(arguments,1),n=w(e,oo.placeholder);return cr(t,M,null,e,n)}function uo(t){var e=Gn(arguments,1),n=w(e,uo.placeholder);return cr(t,k,null,e,n)}function ao(t){var e=On(arguments,!1,!1,1);return cr(t,j,null,null,null,e)}function so(t,e,n){var r=!0,i=!0;if(!wo(t))throw new Uu(K);return n===!1?r=!1:To(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ve.leading=r,Ve.maxWait=+e,Ve.trailing=i,Xi(t,e,Ve)}function co(t,e){return e=null==e?Tu:e,cr(e,M,null,[t],[])}function fo(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n=Er(t,e,r)?null:e,e=!1),n="function"==typeof n&&Yn(n,r,1),yn(t,e,n)}function lo(t,e,n){return e="function"==typeof e&&Yn(e,n,1),yn(t,!0,e)}function ho(t){var e=g(t)?t.length:S;return br(e)&&Bu.call(t)==H||!1}function po(t){return t===!0||t===!1||g(t)&&Bu.call(t)==B||!1}function _o(t){return g(t)&&Bu.call(t)==J||!1}function vo(t){return t&&1===t.nodeType&&g(t)&&Bu.call(t).indexOf("Element")>-1||!1}function yo(t){if(null==t)return!0;var e=t.length;return br(e)&&(Va(t)||No(t)||ho(t)||g(t)&&wo(t.splice))?!e:!Ha(t).length}function go(t,e,n,r){if(n="function"==typeof n&&Yn(n,r,3),!n&&Or(t)&&Or(e))return t===e;var i=n?n(t,e):S;return"undefined"==typeof i?Rn(t,e,n):!!i}function mo(t){return g(t)&&"string"==typeof t.message&&Bu.call(t)==Y||!1}function wo(t){return"function"==typeof t||!1}function To(t){var e=typeof t;return"function"==e||t&&"object"==e||!1}function Eo(t,e,n,r){var i=Ha(e),o=i.length;if(n="function"==typeof n&&Yn(n,r,3),!n&&1==o){var u=i[0],a=e[u];if(Or(a))return null!=t&&a===t[u]&&Hu.call(t,u)}for(var s=xu(o),c=xu(o);o--;)a=s[o]=e[i[o]],c[o]=Or(a);return kn(t,i,s,c,n)}function bo(t){return So(t)&&t!=+t}function Oo(t){return null==t?!1:Bu.call(t)==X?Yu.test(Ku.call(t)):g(t)&&Ce.test(t)||!1}function Io(t){return null===t}function So(t){return"number"==typeof t||g(t)&&Bu.call(t)==Q||!1}function Ao(t){return g(t)&&Bu.call(t)==ee||!1}function No(t){return"string"==typeof t||g(t)&&Bu.call(t)==re||!1}function Co(t){return g(t)&&br(t.length)&&Ue[Bu.call(t)]||!1}function Do(t){return"undefined"==typeof t}function xo(t){var e=t?t.length:0;return br(e)?e?Ye(t):[]:Xo(t)}function Ro(t){return pn(t,Ko(t))}function Mo(t,e,n){var r=Da(t);return n&&Er(t,e,n)&&(e=null),e?pn(e,r,Ha(e)):r}function ko(t){if(null==t)return t;var e=Ye(arguments);return e.push(cn),$a.apply(S,e)}function jo(t,e,n){return e=_r(e,n,3),bn(t,e,Nn,!0)}function zo(t,e,n){return e=_r(e,n,3),bn(t,e,Cn,!0)}function Lo(t,e,n){return("function"!=typeof e||"undefined"!=typeof n)&&(e=Yn(e,n,3)),In(t,e,Ko)}function qo(t,e,n){return e=Yn(e,n,3),Sn(t,e,Ko)}function Po(t,e,n){return("function"!=typeof e||"undefined"!=typeof n)&&(e=Yn(e,n,3)),Nn(t,e)}function Uo(t,e,n){return e=Yn(e,n,3),Sn(t,e,Ha)}function Wo(t){return Dn(t,Ko(t))}function Vo(t,e){return t?Hu.call(t,e):!1}function Go(t,e,n){n&&Er(t,e,n)&&(e=null);for(var r=-1,i=Ha(t),o=i.length,u={};++r0;++rn?0:+n||0,r))-e.length,n>=0&&t.indexOf(e,n)==n}function ru(t){return t=s(t),t&&Te.test(t)?t.replace(me,v):t}function iu(t){return t=s(t),t&&Me.test(t)?t.replace(Re,"\\$&"):t}function ou(t,e,n){t=s(t),e=+e;var r=t.length;if(r>=e||!pa(e))return t;var i=(e-r)/2,o=ea(i),u=Qu(i);return n=ar("",u,n),n.slice(0,o)+t+n}function uu(t,e,n){return t=s(t),t&&ar(t,e,n)+t}function au(t,e,n){return t=s(t),t&&t+ar(t,e,n)}function su(t,e,n){return n&&Er(t,e,n)&&(e=0),ma(t,e)}function cu(t,e){var n="";if(t=s(t),e=+e,1>e||!t||!pa(e))return n;do e%2&&(n+=t),e=ea(e/2),t+=t;while(e);return n}function fu(t,e,n){return t=s(t),n=null==n?0:ya(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function lu(t,n,r){var i=e.templateSettings;r&&Er(t,n,r)&&(n=r=null),t=s(t),n=ln(ln({},r||n),i,fn);var o,u,a=ln(ln({},n.imports),i.imports,fn),c=Ha(a),f=Hn(a,c),l=0,h=n.interpolate||xe,p="__p += '",_=qu((n.escape||xe).source+"|"+h.source+"|"+(h===Oe?Ie:xe).source+"|"+(n.evaluate||xe).source+"|$","g"),v="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Pe+"]")+"\n";t.replace(_,function(e,n,r,i,a,s){return r||(r=i),p+=t.slice(l,s).replace(je,y),n&&(o=!0,p+="' +\n__e("+n+") +\n'"),a&&(u=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=s+e.length,e}),p+="';\n";var d=n.variable;d||(p="with (obj) {\n"+p+"\n}\n"),p=(u?p.replace(ve,""):p).replace(ye,"$1").replace(de,"$1;"),p="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=gu(function(){return ku(c,v+"return "+p).apply(S,f)});if(g.source=p,mo(g))throw g;return g}function hu(t,e,n){var r=t;return(t=s(t))?(n?Er(r,e,n):null==e)?t.slice(E(t),b(t)+1):(e+="",t.slice(f(t,e),l(t,e)+1)):t}function pu(t,e,n){var r=t;return t=s(t),t?t.slice((n?Er(r,e,n):null==e)?E(t):f(t,e+"")):t}function _u(t,e,n){var r=t;return t=s(t),t?(n?Er(r,e,n):null==e)?t.slice(0,b(t)+1):t.slice(0,l(t,e+"")+1):t}function vu(t,e,n){n&&Er(t,e,n)&&(e=null);var r=L,i=q;if(null!=e)if(To(e)){var o="separator"in e?e.separator:o;r="length"in e?+e.length||0:r,i="omission"in e?s(e.omission):i}else r=+e||0;if(t=s(t),r>=t.length)return t;var u=r-i.length;if(1>u)return i;var a=t.slice(0,u);if(null==o)return a+i;if(Ao(o)){if(t.slice(u).search(o)){var c,f,l=t.slice(0,u);for(o.global||(o=qu(o.source,(Se.exec(o)||"")+"g")),o.lastIndex=0;c=o.exec(l);)f=c.index;a=a.slice(0,null==f?u:f)}}else if(t.indexOf(o,u)!=u){var h=a.lastIndexOf(o);h>-1&&(a=a.slice(0,h))}return a+i}function yu(t){return t=s(t),t&&we.test(t)?t.replace(ge,O):t}function du(t,e,n){return n&&Er(t,e,n)&&(e=null),t=s(t),t.match(e||ze)||[]}function gu(t){try{return t()}catch(e){return mo(e)?e:Mu(e)}}function mu(t,e,n){return n&&Er(t,e,n)&&(e=null),g(t)?Eu(t):vn(t,e)}function wu(t){return function(){return t}}function Tu(t){return t}function Eu(t){return zn(yn(t,!0))}function bu(t,e,n){if(null==n){var r=To(e),i=r&&Ha(e),o=i&&i.length&&Dn(e,i);(o?o.length:r)||(o=!1,n=e,e=t,t=this)}o||(o=Dn(e,Ha(e)));var u=!0,a=-1,s=wo(t),c=o.length;n===!1?u=!1:To(n)&&"chain"in n&&(u=n.chain);for(;++at||!pa(t))return[];var r=-1,i=xu(ya(t,ba));for(e=Yn(e,n,1);++rr?i[r]=e(r):e(r);return i}function Du(t){var e=++Fu;return s(t)+e}t=t?Ze.defaults(Be.Object(),t,Ze.pick(Be,qe)):Be;var xu=t.Array,Ru=t.Date,Mu=t.Error,ku=t.Function,ju=t.Math,zu=t.Number,Lu=t.Object,qu=t.RegExp,Pu=t.String,Uu=t.TypeError,Wu=xu.prototype,Vu=Lu.prototype,Gu=(Gu=t.window)&&Gu.document,Ku=ku.prototype.toString,$u=Pn("length"),Hu=Vu.hasOwnProperty,Fu=0,Bu=Vu.toString,Ju=t._,Yu=qu("^"+iu(Bu).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xu=Oo(Xu=t.ArrayBuffer)&&Xu,Zu=Oo(Zu=Xu&&new Xu(0).slice)&&Zu,Qu=ju.ceil,ta=t.clearTimeout,ea=ju.floor,na=Oo(na=Lu.getPrototypeOf)&&na,ra=Wu.push,ia=Vu.propertyIsEnumerable,oa=Oo(oa=t.Set)&&oa,ua=t.setTimeout,aa=Wu.splice,sa=Oo(sa=t.Uint8Array)&&sa,ca=(Wu.unshift,Oo(ca=t.WeakMap)&&ca),fa=function(){try{var e=Oo(e=t.Float64Array)&&e,n=new e(new Xu(10),0,1)&&e}catch(r){}return n}(),la=Oo(la=xu.isArray)&&la,ha=Oo(ha=Lu.create)&&ha,pa=t.isFinite,_a=Oo(_a=Lu.keys)&&_a,va=ju.max,ya=ju.min,da=Oo(da=Ru.now)&&da,ga=Oo(ga=zu.isFinite)&&ga,ma=t.parseInt,wa=ju.random,Ta=zu.NEGATIVE_INFINITY,Ea=zu.POSITIVE_INFINITY,ba=ju.pow(2,32)-1,Oa=ba-1,Ia=ba>>>1,Sa=fa?fa.BYTES_PER_ELEMENT:0,Aa=ju.pow(2,53)-1,Na=ca&&new ca,Ca=e.support={};!function(){Ca.funcDecomp=!Oo(t.WinRTError)&&ke.test(I),Ca.funcNames="string"==typeof ku.name;try{Ca.dom=11===Gu.createDocumentFragment().nodeType}catch(e){Ca.dom=!1}try{Ca.nonEnumArgs=!ia.call(arguments,1)}catch(e){Ca.nonEnumArgs=!0}}(0,0),e.templateSettings={escape:Ee,evaluate:be,interpolate:Oe,variable:"",imports:{_:e}};var Da=function(){function e(){}return function(n){if(To(n)){e.prototype=n;var r=new e;e.prototype=null}return r||t.Object()}}(),xa=Na?function(t,e){return Na.set(t,e),t}:Tu;Zu||(Xn=Xu&&sa?function(t){var e=t.byteLength,n=fa?ea(e/Sa):0,r=n*Sa,i=new Xu(e);if(n){var o=new fa(i,0,n);o.set(new fa(t,0,n))}return e!=r&&(o=new sa(i,r),o.set(new sa(t,r))),i}:wu(null));var Ra=ha&&oa?function(t){return new He(t)}:wu(null),Ma=Na?function(t){return Na.get(t)}:Iu,ka=function(){var t=0,e=0;return function(n,r){var i=Wa(),o=U-(i-e);if(e=i,o>0){if(++t>=P)return n}else t=0;return xa(n,r)}}(),ja=tr(function(t,e,n){Hu.call(t,n)?++t[n]:t[n]=1 }),za=tr(function(t,e,n){Hu.call(t,n)?t[n].push(e):t[n]=[e]}),La=tr(function(t,e,n){t[n]=e}),qa=or(rn),Pa=or(on,!0),Ua=tr(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),Wa=da||function(){return(new Ru).getTime()},Va=la||function(t){return g(t)&&br(t.length)&&Bu.call(t)==F||!1};Ca.dom||(vo=function(t){return t&&1===t.nodeType&&g(t)&&!Ka(t)||!1});var Ga=ga||function(t){return"number"==typeof t&&pa(t)};(wo(/x/)||sa&&!wo(sa))&&(wo=function(t){return Bu.call(t)==X});var Ka=na?function(t){if(!t||Bu.call(t)!=te)return!1;var e=t.valueOf,n=Oo(e)&&(n=na(e))&&na(n);return n?t==n||na(t)==n:Cr(t)}:Cr,$a=er(ln),Ha=_a?function(t){if(t)var e=t.constructor,n=t.length;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&n&&br(n)?Dr(t):To(t)?_a(t):[]}:Dr,Fa=er(Ln),Ba=rr(function(t,e,n){return e=e.toLowerCase(),t+(n?e.charAt(0).toUpperCase()+e.slice(1):e)}),Ja=rr(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()});8!=ma(Le+"08")&&(su=function(t,e,n){return(n?Er(t,e,n):null==e)?e=0:e&&(e=+e),t=hu(t),ma(t,e||(Ne.test(t)?16:10))});var Ya=rr(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Xa=rr(function(t,e,n){return t+(n?" ":"")+(e.charAt(0).toUpperCase()+e.slice(1))});return n.prototype=e.prototype,ne.prototype["delete"]=ie,ne.prototype.get=Ge,ne.prototype.has=Ke,ne.prototype.set=$e,He.prototype.push=Je,no.Cache=ne,e.after=Gi,e.ary=Ki,e.assign=$a,e.at=Ti,e.before=$i,e.bind=Hi,e.bindAll=Fi,e.bindKey=Bi,e.callback=mu,e.chain=_i,e.chunk=Mr,e.compact=kr,e.constant=wu,e.countBy=ja,e.create=Mo,e.curry=Ji,e.curryRight=Yi,e.debounce=Xi,e.defaults=ko,e.defer=Zi,e.delay=Qi,e.difference=jr,e.drop=zr,e.dropRight=Lr,e.dropRightWhile=qr,e.dropWhile=Pr,e.filter=Oi,e.flatten=Gr,e.flattenDeep=Kr,e.flow=to,e.flowRight=eo,e.forEach=Ni,e.forEachRight=Ci,e.forIn=Lo,e.forInRight=qo,e.forOwn=Po,e.forOwnRight=Uo,e.functions=Wo,e.groupBy=za,e.indexBy=La,e.initial=Hr,e.intersection=Fr,e.invert=Go,e.invoke=Di,e.keys=Ha,e.keysIn=Ko,e.map=xi,e.mapValues=$o,e.matches=Eu,e.memoize=no,e.merge=Fa,e.mixin=bu,e.negate=ro,e.omit=Ho,e.once=io,e.pairs=Fo,e.partial=oo,e.partialRight=uo,e.partition=Ua,e.pick=Bo,e.pluck=Ri,e.property=Su,e.propertyOf=Au,e.pull=Yr,e.pullAt=Xr,e.range=Nu,e.rearg=ao,e.reject=ji,e.remove=Zr,e.rest=Qr,e.shuffle=Li,e.slice=ti,e.sortBy=Ui,e.sortByAll=Wi,e.take=ri,e.takeRight=ii,e.takeRightWhile=oi,e.takeWhile=ui,e.tap=vi,e.throttle=so,e.thru=yi,e.times=Cu,e.toArray=xo,e.toPlainObject=Ro,e.transform=Yo,e.union=ai,e.uniq=si,e.unzip=ci,e.values=Xo,e.valuesIn=Zo,e.where=Vi,e.without=fi,e.wrap=co,e.xor=li,e.zip=hi,e.zipObject=pi,e.backflow=eo,e.collect=xi,e.compose=eo,e.each=Ni,e.eachRight=Ci,e.extend=$a,e.iteratee=mu,e.methods=Wo,e.object=pi,e.select=Oi,e.tail=Qr,e.unique=si,bu(e,e),e.attempt=gu,e.camelCase=Ba,e.capitalize=tu,e.clone=fo,e.cloneDeep=lo,e.deburr=eu,e.endsWith=nu,e.escape=ru,e.escapeRegExp=iu,e.every=bi,e.find=Ii,e.findIndex=Ur,e.findKey=jo,e.findLast=Si,e.findLastIndex=Wr,e.findLastKey=zo,e.findWhere=Ai,e.first=Vr,e.has=Vo,e.identity=Tu,e.includes=Ei,e.indexOf=$r,e.isArguments=ho,e.isArray=Va,e.isBoolean=po,e.isDate=_o,e.isElement=vo,e.isEmpty=yo,e.isEqual=go,e.isError=mo,e.isFinite=Ga,e.isFunction=wo,e.isMatch=Eo,e.isNaN=bo,e.isNative=Oo,e.isNull=Io,e.isNumber=So,e.isObject=To,e.isPlainObject=Ka,e.isRegExp=Ao,e.isString=No,e.isTypedArray=Co,e.isUndefined=Do,e.kebabCase=Ja,e.last=Br,e.lastIndexOf=Jr,e.max=qa,e.min=Pa,e.noConflict=Ou,e.noop=Iu,e.now=Wa,e.pad=ou,e.padLeft=uu,e.padRight=au,e.parseInt=su,e.random=Qo,e.reduce=Mi,e.reduceRight=ki,e.repeat=cu,e.result=Jo,e.runInContext=I,e.size=qi,e.snakeCase=Ya,e.some=Pi,e.sortedIndex=ei,e.sortedLastIndex=ni,e.startCase=Xa,e.startsWith=fu,e.template=lu,e.trim=hu,e.trimLeft=pu,e.trimRight=_u,e.trunc=vu,e.unescape=yu,e.uniqueId=Du,e.words=du,e.all=bi,e.any=Pi,e.contains=Ei,e.detect=Ii,e.foldl=Mi,e.foldr=ki,e.head=Vr,e.include=Ei,e.inject=Mi,bu(e,function(){var t={};return Nn(e,function(n,r){e.prototype[r]||(t[r]=n)}),t}(),!1),e.sample=zi,e.prototype.sample=function(t){return this.__chain__||null!=t?this.thru(function(e){return zi(e,t)}):zi(this.value())},e.VERSION=A,Xe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){e[t].placeholder=e}),Xe(["filter","map","takeWhile"],function(t,e){var n=e==W;r.prototype[t]=function(t,r){var i=this.clone(),o=i.filtered,u=i.iteratees||(i.iteratees=[]);return i.filtered=o||n||e==G&&i.dir<0,u.push({iteratee:_r(t,r,3),type:e}),i}}),Xe(["drop","take"],function(t,e){var n=t+"Count",i=t+"While";r.prototype[t]=function(r){r=null==r?1:va(+r||0,0);var i=this.clone();if(i.filtered){var o=i[n];i[n]=e?ya(o,r):o+r}else{var u=i.views||(i.views=[]);u.push({size:r,type:t+(i.dir<0?"Right":"")})}return i},r.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()},r.prototype[t+"RightWhile"]=function(t,e){return this.reverse()[i](t,e).reverse()}}),Xe(["first","last"],function(t,e){var n="take"+(e?"Right":"");r.prototype[t]=function(){return this[n](1).value()[0]}}),Xe(["initial","rest"],function(t,e){var n="drop"+(e?"":"Right");r.prototype[t]=function(){return this[n](1)}}),Xe(["pluck","where"],function(t,e){var n=e?"filter":"map",i=e?zn:Pn;r.prototype[t]=function(t){return this[n](i(e?t:t+""))}}),r.prototype.dropWhile=function(t,e){var n,r,i=this.dir<0;return t=_r(t,e,3),this.filter(function(e,o,u){return n=n&&(i?r>o:o>r),r=o,n||(n=!t(e,o,u))})},r.prototype.reject=function(t,e){return t=_r(t,e,3),this.filter(function(e,n,r){return!t(e,n,r)})},r.prototype.slice=function(t,e){t=null==t?0:+t||0;var n=0>t?this.takeRight(-t):this.drop(t);return"undefined"!=typeof e&&(e=+e||0,n=0>e?n.dropRight(-e):n.take(e-t)),n},Nn(r.prototype,function(t,i){var o=e[i],u=/^(?:first|last)$/.test(i);e.prototype[i]=function(){var i=this.__wrapped__,a=arguments,s=this.__chain__,c=!!this.__actions__.length,f=i instanceof r,l=f&&!c;if(u&&!s)return l?t.call(i):o.call(e,this.value());var h=function(t){var n=[t];return ra.apply(n,a),o.apply(e,n)};if(f||Va(i)){var p=l?i:new r(this),_=t.apply(p,a);if(!u&&(c||_.actions)){var v=_.actions||(_.actions=[]);v.push({func:yi,args:[h],thisArg:e})}return new n(_,s)}return this.thru(h)}}),Xe(["concat","join","pop","push","shift","sort","splice","unshift"],function(t){var n=Wu[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:join|pop|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return i&&!this.__chain__?n.apply(this.value(),t):this[r](function(e){return n.apply(e,t)})}}),r.prototype.clone=i,r.prototype.reverse=m,r.prototype.value=Z,e.prototype.chain=di,e.prototype.reverse=gi,e.prototype.toString=mi,e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=wi,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var S,A="3.1.0",N=1,C=2,D=4,x=8,R=16,M=32,k=64,j=128,z=256,L=30,q="...",P=150,U=16,W=0,V=1,G=2,K="Expected a function",$="__lodash_placeholder__",H="[object Arguments]",F="[object Array]",B="[object Boolean]",J="[object Date]",Y="[object Error]",X="[object Function]",Z="[object Map]",Q="[object Number]",te="[object Object]",ee="[object RegExp]",ne="[object Set]",re="[object String]",ie="[object WeakMap]",oe="[object ArrayBuffer]",ue="[object Float32Array]",ae="[object Float64Array]",se="[object Int8Array]",ce="[object Int16Array]",fe="[object Int32Array]",le="[object Uint8Array]",he="[object Uint8ClampedArray]",pe="[object Uint16Array]",_e="[object Uint32Array]",ve=/\b__p \+= '';/g,ye=/\b(__p \+=) '' \+/g,de=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ge=/&(?:amp|lt|gt|quot|#39|#96);/g,me=/[&<>"'`]/g,we=RegExp(ge.source),Te=RegExp(me.source),Ee=/<%-([\s\S]+?)%>/g,be=/<%([\s\S]+?)%>/g,Oe=/<%=([\s\S]+?)%>/g,Ie=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Se=/\w*$/,Ae=/^\s*function[ \n\r\t]+\w/,Ne=/^0[xX]/,Ce=/^\[object .+?Constructor\]$/,De=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xe=/($^)/,Re=/[.*+?^${}()|[\]\/\\]/g,Me=RegExp(Re.source),ke=/\bthis\b/,je=/['\n\r\u2028\u2029\\]/g,ze=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"{2,}(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),Le=" \f \n\r\u2028\u2029 ᠎              ",qe=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","document","isFinite","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","window","WinRTError"],Pe=-1,Ue={};Ue[ue]=Ue[ae]=Ue[se]=Ue[ce]=Ue[fe]=Ue[le]=Ue[he]=Ue[pe]=Ue[_e]=!0,Ue[H]=Ue[F]=Ue[oe]=Ue[B]=Ue[J]=Ue[Y]=Ue[X]=Ue[Z]=Ue[Q]=Ue[te]=Ue[ee]=Ue[ne]=Ue[re]=Ue[ie]=!1;var We={};We[H]=We[F]=We[oe]=We[B]=We[J]=We[ue]=We[ae]=We[se]=We[ce]=We[fe]=We[Q]=We[te]=We[ee]=We[re]=We[le]=We[he]=We[pe]=We[_e]=!0,We[Y]=We[X]=We[Z]=We[ne]=We[ie]=!1;var Ve={leading:!1,maxWait:0,trailing:!1},Ge={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},Ke={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},$e={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},He={"function":!0,object:!0},Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Be=He[typeof window]&&window!==(this&&this.window)?window:this,Je=He[typeof e]&&e&&!e.nodeType&&e,Ye=He[typeof t]&&t&&!t.nodeType&&t,Xe=Je&&Ye&&"object"==typeof i&&i;!Xe||Xe.global!==Xe&&Xe.window!==Xe&&Xe.self!==Xe||(Be=Xe);var Ze=(Ye&&Ye.exports===Je&&Je,I());Be._=Ze,r=function(){return Ze}.call(e,n,e,t),!(r!==S&&(t.exports=r))}).call(this)}).call(e,n(35)(t),function(){return this}())},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t["default"]:t},i=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},o=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=r(n(1)),s=r(n(2)),c=r(n(3)),f=!1,l=!1,h="",p=!1,_="",v=function(t){function e(){u(this,e),null!=t&&t.apply(this,arguments)}return o(e,t),i(e,null,{isValidating:{get:function(){return f},configurable:!0},isLoggedIn:{get:function(){return l},configurable:!0},authToken:{get:function(){return h},configurable:!0},lastAttemptInvalid:{get:function(){return p},configurable:!0},lastAttemptMessage:{get:function(){return _},configurable:!0}}),e}(c),y=new v;y.dispatchToken=a.register(function(t){switch(t.actionType){case s.ACTION_VALIDATING_AUTH_TOKEN:f=!0,y.emitChange();break;case s.ACTION_VALID_AUTH_TOKEN:f=!1,l=!0,h=t.authToken,p=!1,_="",y.emitChange();break;case s.ACTION_INVALID_AUTH_TOKEN:f=!1,l=!1,h="",p=!0,_=t.message||"Unexpected result from API",y.emitChange();break;case s.ACTION_LOG_OUT:f=!1,l=!1,h="",p=!1,_="",y.emitChange()}}),t.exports=y},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t["default"]:t},i=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},o=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=n(5),s=a.Map,c=a.List,f=r(n(1)),l=r(n(2)),h=r(n(3)),p=new s,_=function(t){function e(){u(this,e),null!=t&&t.apply(this,arguments)}return o(e,t),i(e,null,{all:{get:function(){return p},configurable:!0},has:{value:function(t,e){var t=p.get(t);return t&&t.contains(e)},writable:!0,configurable:!0},getServices:{value:function(t){return p.get(t)||new c},writable:!0,configurable:!0}}),e}(h),v=new _;v.dispatchToken=f.register(function(t){switch(t.actionType){case l.ACTION_NEW_SERVICES:p=(new s).withMutations(function(e){t.services.forEach(function(t){e.set(t.domain,new c(t.services))})}),v.emitChange();break;case l.ACTION_REMOTE_EVENT_RECEIVED:if(t.event.event_type!==l.REMOTE_EVENT_SERVICE_REGISTERED)break;var e=t.event.data,n=e.domain,r=e.service;if(v.has(n,r))break;var i=v.getServices(n);p=p.set(n,i.push(r)),v.emitChange();break;case l.ACTION_LOG_OUT:p=new s,v.emitChange()}}),t.exports=v},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t["default"]:t},i=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},o=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=r(n(1)),s=r(n(2)),c=r(n(3)),f="STATE_CONNECTED",l="STATE_DISCONNECTED",h="STATE_ERROR",p=l,_=function(t){function e(){u(this,e),null!=t&&t.apply(this,arguments)}return o(e,t),i(e,null,{state:{get:function(){return p},configurable:!0},isStreaming:{get:function(){return p===this.STATE_CONNECTED},configurable:!0},hasError:{get:function(){return p===this.STATE_ERROR},configurable:!0}}),e}(c),v=new _;v.STATE_CONNECTED=f,v.STATE_DISCONNECTED=l,v.STATE_ERROR=h,v.dispatchToken=a.register(function(t){switch(t.actionType){case s.ACTION_STREAM_START:p=f,v.emitChange();break;case s.ACTION_STREAM_STOP:p=l,v.emitChange();break;case s.ACTION_STREAM_ERROR:p=h,v.emitChange()}}),t.exports=v},function(t,e,n){"use strict";function r(t){i.dispatch({actionType:u,message:t})}e.notify=r;var i=n(1),o=n(2),u=o.ACTION_NEW_NOTIFICATION;Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t){t.length>0&&f.dispatch({actionType:l.ACTION_NEW_SERVICES,services:t})}function i(t){return u("homeassistant","turn_on",{entity_id:t})}function o(t){return u("homeassistant","turn_off",{entity_id:t})}function u(t,e){var n=void 0===arguments[2]?{}:arguments[2];return c("POST","services/"+t+"/"+e,n).then(function(r){h("turn_on"==e&&n.entity_id?"Turned on "+n.entity_id+".":"turn_off"==e&&n.entity_id?"Turned off "+n.entity_id+".":"Service "+t+"/"+e+" called."),p(r)})}function a(){return c("GET","services").then(r)}var s=function(t){return t&&t.__esModule?t["default"]:t};e.newServices=r,e.callTurnOn=i,e.callTurnOff=o,e.callService=u,e.fetchAll=a;var c=s(n(4)),f=s(n(1)),l=s(n(2)),h=n(10).notify,p=n(12).newStates;Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t,e){(t.length>0||e)&&c.dispatch({actionType:f,states:t,replace:!!e})}function i(t,e){var n=void 0===arguments[2]?!1:arguments[2],i={state:e};n&&(i.attributes=n),s("POST","states/"+t,i).then(function(n){l("State of "+t+" set to "+e+"."),r([n])})}function o(t){s("GET","states/"+t).then(function(t){r([t])})}function u(){s("GET","states").then(function(t){r(t,!0)})}var a=function(t){return t&&t.__esModule?t["default"]:t};e.newStates=r,e.set=i,e.fetch=o,e.fetchAll=u;var s=a(n(4)),c=a(n(1)),f=n(2).ACTION_NEW_STATES,l=n(10).notify;Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(){c.dispatch({actionType:f.ACTION_FETCH_ALL}),l.fetchAll(),h.fetchAll(),p.fetchAll(),_.fetchAll(),y&&d()}function i(){y=!0,r()}function o(){y=!1,d.cancel()}var u=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t){return t&&t.__esModule?t["default"]:t};e.fetchAll=r,e.start=i,e.stop=o;var s=a(n(6)),c=a(n(1)),f=a(n(2)),l=u(n(24)),h=u(n(12)),p=u(n(11)),_=u(n(23)),v=3e4,y=!1,d=s.debounce(r,v);Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t["default"]:t},i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){for(var n,r=[],i=t[Symbol.iterator]();!(n=i.next()).done&&(r.push(n.value),!e||r.length!==e););return r}throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},u=function _(t,e,n){var r=Object.getOwnPropertyDescriptor(t,e);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:_(i,e,n)}if("value"in r&&r.writable)return r.value;var o=r.get;return void 0===o?void 0:o.call(n)},a=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},c=n(5).Record,f=r(n(8)),l=n(26).parseDateTime,h=new c({entityId:null,domain:null,object_id:null,state:null,entityDisplay:null,stateDisplay:null,lastChanged:null,lastChangedAsDate:null,attributes:{},isCustomGroup:null},"State"),p=function(t){function e(t,n,r){var o=void 0===arguments[3]?{}:arguments[3];s(this,e);var a=t.split("."),c=i(a,2),f=c[0],h=c[1],p=n.replace(/_/g," ");o.unit_of_measurement&&(p+=" "+o.unit_of_measurement),u(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,{entityId:t,domain:f,objectId:h,state:n,stateDisplay:p,lastChanged:r,attributes:o,entityDisplay:o.friendly_name||h.replace(/_/g," "),lastChangedAsDate:l(r),isCustomGroup:"group"===f&&!o.auto})}return a(e,t),o(e,{fromJSON:{value:function(t){var n=t.entity_id,r=t.state,i=t.last_changed,o=t.attributes;return new e(n,r,i,o)},writable:!0,configurable:!0}},{canToggle:{get:function(){return"group"===this.domain&&("on"===this.state||"off"===this.state)||f.has(this.domain,"turn_on")},configurable:!0}}),e}(h);t.exports=p},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t["default"]:t},i=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},o=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=n(5).List,s=r(n(1)),c=r(n(2)),f=r(n(3)),l=new a,h=function(t){function e(){u(this,e),null!=t&&t.apply(this,arguments)}return o(e,t),i(e,null,{loaded:{get:function(){return l},configurable:!0},isLoaded:{value:function(t){return l.contains(t)},writable:!0,configurable:!0}}),e}(f),p=new h;p.dispatchToken=s.register(function(t){switch(t.actionType){case c.ACTION_NEW_LOADED_COMPONENTS:l=new a(t.components),p.emitChange();break;case c.ACTION_REMOTE_EVENT_RECEIVED:if(t.event.event_type!==c.REMOTE_EVENT_COMPONENT_LOADED)break;var e=t.event.data.component;if(p.isLoaded(e))break;l=l.push(e),p.emitChange();break;case c.ACTION_LOG_OUT:l=new a,p.emitChange()}}),t.exports=p},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t["default"]:t},i=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},o=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=n(5).List,s=r(n(1)),c=r(n(2)),f=r(n(3)),l=new a,h=function(t){function e(){u(this,e),null!=t&&t.apply(this,arguments)}return o(e,t),i(e,null,{all:{get:function(){return l},configurable:!0}}),e}(f),p=new h;p.dispatchToken=s.register(function(t){switch(t.actionType){case c.ACTION_NEW_EVENTS:l=new a(t.events),p.emitChange();break;case c.ACTION_LOG_OUT:l=new a,p.emitChange()}}),t.exports=p},function(t,e,n){"use strict";function r(){return p.size}var i=function(t){return t&&t.__esModule?t["default"]:t},o=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},u=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=n(5).List,c=i(n(1)),f=i(n(2)),l=i(n(3)),h=i(n(31)),p=new s,_=function(t){function e(){a(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,null,{hasNewNotifications:{value:function(t){return!t||t+1l},writable:!0,configurable:!0},get:{value:function(t){return _[t]||null},writable:!0,configurable:!0},all:{get:function(){return a.values(_)},configurable:!0}}),e}(f),y=new v;y.dispatchToken=s.register(function(t){switch(t.actionType){case c.ACTION_NEW_STATE_HISTORY:a.forEach(t.stateHistory,function(t){if(0!==t.length){var e=t[0].entityId;_[e]=t,p[e]=new Date}}),t.isFetchAll&&(h=new Date),y.emitChange();break;case c.ACTION_LOG_OUT:h=null,p={},_={},y.emitChange()}}),t.exports=y},function(t,e,n){"use strict";function r(t){return-1!==_.indexOf(t)}function i(){return _.length===h}var o=function(t){return t&&t.__esModule?t["default"]:t},u=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},a=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},c=o(n(1)),f=o(n(2)),l=o(n(3)),h=4,p=!1,_=[],v=function(t){function e(){s(this,e),null!=t&&t.apply(this,arguments)}return a(e,t),u(e,null,{isFetching:{get:function(){return!i()},configurable:!0},initialLoadDone:{get:function(){return p},configurable:!0},componentsLoaded:{get:function(){return r(f.ACTION_NEW_LOADED_COMPONENTS)},configurable:!0},eventsLoaded:{get:function(){return r(f.ACTION_NEW_EVENTS)},configurable:!0},servicesLoaded:{get:function(){return r(f.ACTION_NEW_SERVICES)},configurable:!0},statesLoaded:{get:function(){return r(f.ACTION_NEW_STATES)},configurable:!0}}),e}(l),y=new v;y.dispatchToken=c.register(function(t){switch(t.actionType){case f.ACTION_FETCH_ALL:_=[],y.emitChange();break;case f.ACTION_NEW_LOADED_COMPONENTS:case f.ACTION_NEW_EVENTS:case f.ACTION_NEW_SERVICES:case f.ACTION_NEW_STATES:r(t.actionType)||(_.push(t.actionType),p=p||i(),y.emitChange());break;case f.ACTION_LOG_OUT:p=!1,_=[],y.emitChange()}}),t.exports=y},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t["default"]:t},i=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},o=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=r(n(1)),s=r(n(2)),c=r(n(3)),f="STATE_LISTENING",l="STATE_TRANSMITTING",h="STATE_IDLE",p="STATE_ERROR",_=h,v="",y="",d=function(t){function e(){u(this,e),null!=t&&t.apply(this,arguments)}return o(e,t),i(e,null,{state:{get:function(){return _},configurable:!0},isListening:{get:function(){return _===f},configurable:!0},isTransmitting:{get:function(){return _===l},configurable:!0},hasError:{get:function(){return _===p},configurable:!0},interimTranscript:{get:function(){return v},configurable:!0},finalTranscript:{get:function(){return y},configurable:!0}}),e}(c),g=new d;g.STATE_LISTENING=f,g.STATE_TRANSMITTING=l,g.STATE_IDLE=h,g.STATE_ERROR=p,g.dispatchToken=a.register(function(t){switch(t.actionType){case s.ACTION_LISTENING_START:_=f,v="",y="",g.emitChange();break;case s.ACTION_LISTENING_TRANSMITTING:_=l,v="",y=t.finalTranscript,g.emitChange();break;case s.ACTION_LISTENING_DONE:_=h,g.emitChange();break;case s.ACTION_LISTENING_ERROR:_=p,g.emitChange();break;case s.ACTION_LISTENING_RESULT:v=t.interimTranscript,y=t.finalTranscript,g.emitChange()}}),t.exports=g},function(t,e,n){"use strict";function r(t){a.dispatch({actionType:s.ACTION_NEW_LOADED_COMPONENTS,components:t})}function i(){return u("GET","components").then(r)}var o=function(t){return t&&t.__esModule?t["default"]:t};e.newLoaded=r,e.fetchAll=i;var u=o(n(4)),a=o(n(1)),s=o(n(2));Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t){s.dispatch({actionType:c.ACTION_NEW_EVENTS,events:t})}function i(){a("GET","events").then(r)}function o(t){var e=void 0===arguments[1]?{}:arguments[1];return a("POST","events/"+t,e).then(function(){f("Event "+t+" successful fired!"),s.dispatch({actionType:c.ACTION_EVENT_FIRED,eventType:t,eventData:e})})}var u=function(t){return t&&t.__esModule?t["default"]:t};e.newEvents=r,e.fetchAll=i,e.fire=o;var a=u(n(4)),s=u(n(1)),c=u(n(2)),f=n(10).notify;Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(){return"EventSource"in window}function i(t){null!==p&&y();var e="/api/stream";t&&(e+="?api_password="+t),p=new EventSource(e),_=t,p.addEventListener("open",function(){v(),c.dispatch({actionType:f.ACTION_STREAM_START}),l.stop(),l.fetchAll()},!1),p.addEventListener("message",function(t){v(),"ping"!==t.data&&c.dispatch({actionType:f.ACTION_REMOTE_EVENT_RECEIVED,event:JSON.parse(t.data)})},!1),p.addEventListener("error",function(){p.readyState!==EventSource.CLOSED&&c.dispatch({actionType:f.ACTION_STREAM_ERROR})},!1)}function o(){y(),c.dispatch({actionType:f.ACTION_STREAM_STOP}),l.start()}var u=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t){return t&&t.__esModule?t["default"]:t};e.isSupported=r,e.start=i,e.stop=o;var s=a(n(6)),c=a(n(1)),f=a(n(2)),l=u(n(13)),h=6e4,p=null,_=null,v=s.debounce(function(){i(_)},h),y=function(){p.close(),p=null,_=null,v.cancel()};Object.defineProperty(e,"__esModule",{value:!0})},function(t,e){"use strict";function n(t){var e=t.split(" "),n=r(e,2),i=n[0],o=n[1],u=i.split(":"),a=r(u,3),s=a[0],c=a[1],f=a[2],l=o.split("-"),h=r(l,3),p=h[0],_=h[1],v=h[2];return new Date(v,parseInt(_)-1,p,s,c,f)}var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){for(var n,r=[],i=t[Symbol.iterator]();!(n=i.next()).done&&(r.push(n.value),!e||r.length!==e););return r}throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.parseDateTime=n,Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t,e){var n=e.useStreaming,r=void 0===n?l.isSupported:n,i=e.rememberLogin,o=void 0===i?!1:i;s.dispatch({actionType:c.ACTION_VALIDATING_AUTH_TOKEN}),a("GET","",!1,{authToken:t}).then(function(){s.dispatch({actionType:c.ACTION_VALID_AUTH_TOKEN,authToken:t,rememberLogin:o}),r?l.start(t):f.start()},function(t){s.dispatch({actionType:c.ACTION_INVALID_AUTH_TOKEN,message:t.message}) -})}function i(){s.dispatch({actionType:c.ACTION_LOG_OUT})}var o=function(t){return t&&t.__esModule?t:{"default":t}},u=function(t){return t&&t.__esModule?t["default"]:t};e.validate=r,e.logOut=i;var a=u(n(4)),s=u(n(1)),c=u(n(2)),f=o(n(13)),l=o(n(25));Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t,e){(t||e.length>0)&&s.dispatch({actionType:c.ACTION_NEW_STATE_HISTORY,stateHistory:e.map(function(t){return t.map(f.fromJSON)}),isFetchAll:t})}function i(){a("GET","history/period").then(r.bind(null,!0))}function o(t){a("GET","history/period?filter_entity_id="+t).then(this.newStateHistory.bind(null,!1))}var u=function(t){return t&&t.__esModule?t["default"]:t};e.newStateHistory=r,e.fetchAll=i,e.fetch=o;var a=u(n(4)),s=u(n(1)),c=u(n(2)),f=u(n(14));Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(){return"webkitSpeechRecognition"in window}function i(){var t=v||_;c.dispatch({actionType:f.ACTION_LISTENING_TRANSMITTING,finalTranscript:t}),l("conversation","process",{text:t}).then(function(){c.dispatch({actionType:f.ACTION_LISTENING_DONE,finalTranscript:t})},function(){c.dispatch({actionType:f.ACTION_LISTENING_ERROR})})}function o(){null!==p&&(p.onstart=null,p.onresult=null,p.onerror=null,p.onend=null,p.stop(),p=null,i()),_="",v=""}function u(){o(),window.r=p=new webkitSpeechRecognition,p.interimResults=!0,p.onstart=function(){c.dispatch({actionType:f.ACTION_LISTENING_START})},p.onresult=function(t){_="";for(var e=t.resultIndex;et||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},e.prototype.emit=function(t){var e,r,u,a,s,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],o(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(u=arguments.length,a=new Array(u-1),s=1;u>s;s++)a[s-1]=arguments[s];r.apply(this,a)}else if(i(r)){for(u=arguments.length,a=new Array(u-1),s=1;u>s;s++)a[s-1]=arguments[s];for(c=r.slice(),u=c.length,s=0;u>s;s++)c[s].apply(this,a)}return!0},e.prototype.addListener=function(t,r){var u;if(!n(r))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(r.listener)?r.listener:r),this._events[t]?i(this._events[t])?this._events[t].push(r):this._events[t]=[this._events[t],r]:this._events[t]=r,i(this._events[t])&&!this._events[t].warned){var u;u=o(this._maxListeners)?e.defaultMaxListeners:this._maxListeners,u&&u>0&&this._events[t].length>u&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(t,e){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},e.prototype.removeListener=function(t,e){var r,o,u,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],u=r.length,o=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(a=u;a-->0;)if(r[a]===e||r[a].listener&&r[a].listener===e){o=a;break}if(0>o)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},e.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],n(r))this.removeListener(t,r);else for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},e.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},e.listenerCount=function(t,e){var r;return r=t._events&&t._events[e]?n(t._events[e])?1:t._events[e].length:0}},function(t,e,n){function r(t){return n(i(t))}function i(t){return o[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var o={"./auth":7,"./auth.js":7,"./component":15,"./component.js":15,"./event":16,"./event.js":16,"./notification":17,"./notification.js":17,"./preference":18,"./preference.js":18,"./service":8,"./service.js":8,"./state":19,"./state.js":19,"./state_history":20,"./state_history.js":20,"./store":3,"./store.js":3,"./stream":9,"./stream.js":9,"./sync":21,"./sync.js":21,"./voice":22,"./voice.js":22};r.keys=function(){return Object.keys(o)},r.resolve=i,t.exports=r,r.id=37}]); +})}function i(){s.dispatch({actionType:c.ACTION_LOG_OUT})}var o=function(t){return t&&t.__esModule?t:{"default":t}},u=function(t){return t&&t.__esModule?t["default"]:t};e.validate=r,e.logOut=i;var a=u(n(4)),s=u(n(1)),c=u(n(2)),f=o(n(13)),l=o(n(25));Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t,e){(t||e.length>0)&&s.dispatch({actionType:c.ACTION_NEW_STATE_HISTORY,stateHistory:e.map(function(t){return t.map(f.fromJSON)}),isFetchAll:t})}function i(){a("GET","history/period").then(r.bind(null,!0))}function o(t){a("GET","history/period?filter_entity_id="+t).then(this.newStateHistory.bind(null,!1))}var u=function(t){return t&&t.__esModule?t["default"]:t};e.newStateHistory=r,e.fetchAll=i,e.fetch=o;var a=u(n(4)),s=u(n(1)),c=u(n(2)),f=u(n(14));Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(){return"webkitSpeechRecognition"in window}function i(){var t=v||_;c.dispatch({actionType:f.ACTION_LISTENING_TRANSMITTING,finalTranscript:t}),l("conversation","process",{text:t}).then(function(){c.dispatch({actionType:f.ACTION_LISTENING_DONE,finalTranscript:t})},function(){c.dispatch({actionType:f.ACTION_LISTENING_ERROR})})}function o(){null!==p&&(p.onstart=null,p.onresult=null,p.onerror=null,p.onend=null,p.stop(),p=null,i()),_="",v=""}function u(){o(),window.r=p=new webkitSpeechRecognition,p.interimResults=!0,p.onstart=function(){c.dispatch({actionType:f.ACTION_LISTENING_START})},p.onresult=function(t){_="";for(var e=t.resultIndex;et||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},e.prototype.emit=function(t){var e,r,u,a,s,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],o(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(u=arguments.length,a=new Array(u-1),s=1;u>s;s++)a[s-1]=arguments[s];r.apply(this,a)}else if(i(r)){for(u=arguments.length,a=new Array(u-1),s=1;u>s;s++)a[s-1]=arguments[s];for(c=r.slice(),u=c.length,s=0;u>s;s++)c[s].apply(this,a)}return!0},e.prototype.addListener=function(t,r){var u;if(!n(r))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(r.listener)?r.listener:r),this._events[t]?i(this._events[t])?this._events[t].push(r):this._events[t]=[this._events[t],r]:this._events[t]=r,i(this._events[t])&&!this._events[t].warned){var u;u=o(this._maxListeners)?e.defaultMaxListeners:this._maxListeners,u&&u>0&&this._events[t].length>u&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(t,e){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},e.prototype.removeListener=function(t,e){var r,o,u,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],u=r.length,o=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(a=u;a-->0;)if(r[a]===e||r[a].listener&&r[a].listener===e){o=a;break}if(0>o)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},e.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],n(r))this.removeListener(t,r);else for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},e.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},e.listenerCount=function(t,e){var r;return r=t._events&&t._events[e]?n(t._events[e])?1:t._events[e].length:0}},function(t,e,n){function r(t){return n(i(t))}function i(t){return o[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var o={"./auth":7,"./auth.js":7,"./component":15,"./component.js":15,"./event":16,"./event.js":16,"./notification":17,"./notification.js":17,"./preference":18,"./preference.js":18,"./service":8,"./service.js":8,"./state":19,"./state.js":19,"./state_history":20,"./state_history.js":20,"./store":3,"./store.js":3,"./stream":9,"./stream.js":9,"./sync":21,"./sync.js":21,"./voice":22,"./voice.js":22};r.keys=function(){return Object.keys(o)},r.resolve=i,t.exports=r,r.id=37}]);
Currently: {{stateObj.attributes.current_temperature}} {{stateObj.attributes.unit_of_measurement}} -