From fb7ac94ab602ca372f9186700c5bb328856c1b60 Mon Sep 17 00:00:00 2001
From: Daniel >",u=u||o,null==r[o]){if(n){var t=null===r[o]?"null":"undefined";return new Error("The "+i+" `"+u+"` is marked as required in `"+a+"`, but its value is `"+t+"`.")}return null}return e.apply(void 0,[r,o,a,i,u].concat(l))})}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function a(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}function i(e){var t="undefined"==typeof e?"undefined":x(e);return Array.isArray(e)?"array":e instanceof RegExp?"object":a(t,e)?"symbol":t}function u(e){var t=i(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function s(e,n){return o(function(r,o,a,s,l){return t.untracked(function(){if(e&&i(r[o])===n.toLowerCase())return null;var s=void 0;switch(n){case"Array":s=t.isObservableArray;break;case"Object":s=t.isObservableObject;break;case"Map":s=t.isObservableMap;break;default:throw new Error("Unexpected mobxType: "+n)}var c=r[o];if(!s(c)){var f=u(c),p=e?" or javascript `"+n.toLowerCase()+"`":"";return new Error("Invalid prop `"+l+"` of type `"+f+"` supplied to `"+a+"`, expected `mobx.Observable"+n+"`"+p+".")}return null})})}function l(e,n){return o(function(r,o,a,i,u){for(var l=arguments.length,c=Array(l>5?l-5:0),f=5;fe&&n[t]--},b.prototype.mapReduce=function(e,t){try{return t(this.data().map(e))}catch(e){throw e}},w.prototype=new p,w.prototype.console={log:function(){},warn:function(){},error:function(){}},w.prototype.addAutoUpdateObserver=function(e){this.autoupdate&&"function"==typeof Object.observe&&Object.observe(e,this.observerCallback,["add","update","delete","reconfigure","setPrototype"])},w.prototype.removeAutoUpdateObserver=function(e){this.autoupdate&&"function"==typeof Object.observe&&Object.unobserve(e,this.observerCallback)},w.prototype.addTransform=function(e,t){if(this.transforms.hasOwnProperty(e))throw new Error("a transform by that name already exists");this.transforms[e]=t},w.prototype.getTransform=function(e){return this.transforms[e]},w.prototype.setTransform=function(e,t){this.transforms[e]=t},w.prototype.removeTransform=function(e){delete this.transforms[e]},w.prototype.byExample=function(e){var t,n,r;r=[];for(t in e)e.hasOwnProperty(t)&&r.push((n={},n[t]=e[t],n));return{$and:r}},w.prototype.findObject=function(e){return this.findOne(this.byExample(e))},w.prototype.findObjects=function(e){return this.find(this.byExample(e))},w.prototype.ttlDaemonFuncGen=function(){var e=this,t=this.ttl.age;return function(){var n=Date.now(),r=e.chain().where(function(e){var r=e.meta.updated||e.meta.created,o=n-r;return t>1,t(a[i[l]][n],r,!1)?u=l+1:s=l;var c=u;return e(r,a[i[c]][n])?c:t(r,a[i[c]][n],!1)?o?c:c-1:o?c+1:c},w.prototype.calculateRangeEnd=function(n,o){var a=this.data,i=this.binaryIndices[n].values,u=0,s=i.length-1,l=0;if(0===i.length)return-1;for(a[i[u]][n],a[i[s]][n];u>1,t(o,a[i[l]][n],!1)?s=l:u=l+1;var c=s;return e(o,a[i[c]][n])?c:r(o,a[i[c]][n],!1)?c+1:e(o,a[i[c-1]][n])?c-1:c},w.prototype.calculateRange=function(n,o,a){var i,u,s,l,c=this.data,f=this.binaryIndices[o].values,p=0,d=f.length-1;if(0===c.length)return[0,-1];var h=c[f[p]][o],m=c[f[d]][o];switch(n){case"$eq":case"$aeq":if(t(a,h,!1)||r(a,m,!1))return[0,-1];break;case"$dteq":if(t(a,h,!1)||r(a,m,!1))return[0,-1];break;case"$gt":if(r(a,m,!0))return[0,-1];if(r(h,a,!1))return[p,d];break;case"$gte":if(r(a,m,!1))return[0,-1];if(r(h,a,!0))return[p,d];break;case"$lt":if(t(a,h,!0))return[0,-1];if(t(m,a,!1))return[p,d];break;case"$lte":if(t(a,h,!1))return[0,-1];if(t(m,a,!0))return[p,d];break;case"$between":return r(a[0],m,!1)?[0,-1]:t(a[1],h,!1)?[0,-1]:(i=this.calculateRangeStart(o,a[0]),s=this.calculateRangeEnd(o,a[1]),i<0&&i++,s>d&&s--,r(c[f[i]][o],a[0],!0)||i++,t(c[f[s]][o],a[1],!0)||s--,sP(this.data[n],e,o)&&(t=P(this.data[n],e,o),a.index=this.data[n].$loki):(t=P(this.data[n],e,o),a.index=this.data[n].$loki);return a.value=t,a},w.prototype.extractNumerical=function(e){return this.extract(e).map(k).filter(Number).filter(function(e){return!isNaN(e)})},w.prototype.avg=function(e){return C(this.extractNumerical(e))},w.prototype.stdDev=function(e){return _(this.extractNumerical(e))},w.prototype.mode=function(e){var t={},n=this.extract(e);n.forEach(function(e){t[e]?t[e]+=1:t[e]=1});var r,o,a;for(o in t)r?r>",u=u||o,null==r[o]){if(n){var t=null===r[o]?"null":"undefined";return new Error("The "+i+" `"+u+"` is marked as required in `"+a+"`, but its value is `"+t+"`.")}return null}return e.apply(void 0,[r,o,a,i,u].concat(l))})}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function a(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}function i(e){var t="undefined"==typeof e?"undefined":x(e);return Array.isArray(e)?"array":e instanceof RegExp?"object":a(t,e)?"symbol":t}function u(e){var t=i(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function s(e,n){return o(function(r,o,a,s,l){return t.untracked(function(){if(e&&i(r[o])===n.toLowerCase())return null;var s=void 0;switch(n){case"Array":s=t.isObservableArray;break;case"Object":s=t.isObservableObject;break;case"Map":s=t.isObservableMap;break;default:throw new Error("Unexpected mobxType: "+n)}var c=r[o];if(!s(c)){var f=u(c),p=e?" or javascript `"+n.toLowerCase()+"`":"";return new Error("Invalid prop `"+l+"` of type `"+f+"` supplied to `"+a+"`, expected `mobx.Observable"+n+"`"+p+".")}return null})})}function l(e,n){return o(function(r,o,a,i,u){for(var l=arguments.length,c=Array(l>5?l-5:0),f=5;fe&&n[t]--},b.prototype.mapReduce=function(e,t){try{return t(this.data().map(e))}catch(e){throw e}},w.prototype=new p,w.prototype.console={log:function(){},warn:function(){},error:function(){}},w.prototype.addAutoUpdateObserver=function(e){this.autoupdate&&"function"==typeof Object.observe&&Object.observe(e,this.observerCallback,["add","update","delete","reconfigure","setPrototype"])},w.prototype.removeAutoUpdateObserver=function(e){this.autoupdate&&"function"==typeof Object.observe&&Object.unobserve(e,this.observerCallback)},w.prototype.addTransform=function(e,t){if(this.transforms.hasOwnProperty(e))throw new Error("a transform by that name already exists");this.transforms[e]=t},w.prototype.getTransform=function(e){return this.transforms[e]},w.prototype.setTransform=function(e,t){this.transforms[e]=t},w.prototype.removeTransform=function(e){delete this.transforms[e]},w.prototype.byExample=function(e){var t,n,r;r=[];for(t in e)e.hasOwnProperty(t)&&r.push((n={},n[t]=e[t],n));return{$and:r}},w.prototype.findObject=function(e){return this.findOne(this.byExample(e))},w.prototype.findObjects=function(e){return this.find(this.byExample(e))},w.prototype.ttlDaemonFuncGen=function(){var e=this,t=this.ttl.age;return function(){var n=Date.now(),r=e.chain().where(function(e){var r=e.meta.updated||e.meta.created,o=n-r;return t>1,t(a[i[l]][n],r,!1)?u=l+1:s=l;var c=u;return e(r,a[i[c]][n])?c:t(r,a[i[c]][n],!1)?o?c:c-1:o?c+1:c},w.prototype.calculateRangeEnd=function(n,o){var a=this.data,i=this.binaryIndices[n].values,u=0,s=i.length-1,l=0;if(0===i.length)return-1;for(a[i[u]][n],a[i[s]][n];u>1,t(o,a[i[l]][n],!1)?s=l:u=l+1;var c=s;return e(o,a[i[c]][n])?c:r(o,a[i[c]][n],!1)?c+1:e(o,a[i[c-1]][n])?c-1:c},w.prototype.calculateRange=function(n,o,a){var i,u,s,l,c=this.data,f=this.binaryIndices[o].values,p=0,d=f.length-1;if(0===c.length)return[0,-1];var h=c[f[p]][o],m=c[f[d]][o];switch(n){case"$eq":case"$aeq":if(t(a,h,!1)||r(a,m,!1))return[0,-1];break;case"$dteq":if(t(a,h,!1)||r(a,m,!1))return[0,-1];break;case"$gt":if(r(a,m,!0))return[0,-1];if(r(h,a,!1))return[p,d];break;case"$gte":if(r(a,m,!1))return[0,-1];if(r(h,a,!0))return[p,d];break;case"$lt":if(t(a,h,!0))return[0,-1];if(t(m,a,!1))return[p,d];break;case"$lte":if(t(a,h,!1))return[0,-1];if(t(m,a,!0))return[p,d];break;case"$between":return r(a[0],m,!1)?[0,-1]:t(a[1],h,!1)?[0,-1]:(i=this.calculateRangeStart(o,a[0]),s=this.calculateRangeEnd(o,a[1]),i<0&&i++,s>d&&s--,r(c[f[i]][o],a[0],!0)||i++,t(c[f[s]][o],a[1],!0)||s--,sP(this.data[n],e,o)&&(t=P(this.data[n],e,o),a.index=this.data[n].$loki):(t=P(this.data[n],e,o),a.index=this.data[n].$loki);return a.value=t,a},w.prototype.extractNumerical=function(e){return this.extract(e).map(k).filter(Number).filter(function(e){return!isNaN(e)})},w.prototype.avg=function(e){return C(this.extractNumerical(e))},w.prototype.stdDev=function(e){return _(this.extractNumerical(e))},w.prototype.mode=function(e){var t={},n=this.extract(e);n.forEach(function(e){t[e]?t[e]+=1:t[e]=1});var r,o,a;for(o in t)r?r