PageSourceSearch

https://inteleza.ai/assets/wellbeing-NR1tfjZ3.js

js inteleza.ai collected 2026-10-05 15:36:29 UTC 3,568 bytes, 1 lines download raw bytes

1function e(e,t,n=8){let r=t.trim().replace(/\s+/g,` `);return r?e.some(e=>e.toLocaleLowerCase()===r.toLocaleLowerCase())?{items:e,error:`You already added that.`}:e.length>=n?{items:e,error:`You can add up to ${n}.`}:{items:[...e,r],error:null}:{items:e,error:`Write something first.`}}function t(e){let t=[e.values.length>0,e.strengths.length>0,e.drains.length>0,e.purpose.trim().length>0,e.horizon.trim().length>0],n=t.filter(Boolean).length,r=t[0]?t[1]?t[2]?t[3]?t[4]?`Your profile is ready for a two-week review.`:`Picture what you would like life to look like in five years.`:`Describe what matters in the life you are building.`:`Name what tends to drain your energy.`:`Add a few strengths you can rely on.`:`Start by choosing the values that matter most to you.`;return{complete:n,total:t.length,next:r}}var n={1:`Very low`,2:`Low`,3:`Okay`,4:`Good`,5:`Very good`};function r(e){return e?n[Math.max(1,Math.min(5,Math.round(e)))]??`Okay`:`Not set`}var i=[{key:`sleep`,label:`Sleep`,unit:`hours`},{key:`steps`,label:`Steps`,unit:`steps`},{key:`movement`,label:`Movement`,unit:`minutes`},{key:`resting_hr`,label:`Resting heart rate`,unit:`bpm`},{key:`weight`,label:`Weight`,unit:`kg`},{key:`water`,label:`Water`,unit:`glasses`},{key:`recovery`,label:`Recovery`,unit:`score`}];function a(e){return i.find(t=>t.key===e)?.label??e}var o=864e5;function s(e){return e.toISOString().slice(0,10)}function c(e,t=s(new Date)){let n=new Set(e),r=new Date(`${t}T00:00:00Z`).getTime(),i=n.has(t)?r:r-o;if(!n.has(s(new Date(i))))return 0;let a=0;for(;n.has(s(new Date(i)));)a+=1,i-=o;return a}function l(e){return e.length===0?null:Math.round(e.reduce((e,t)=>e+t,0)/e.length*10)/10}function u(e,t=s(new Date)){return{days:e.length,mood:l(e.map(e=>e.mood)),energy:l(e.map(e=>e.energy)),focus:l(e.map(e=>e.focus)),sleep:l(e.map(e=>e.sleep_hours).filter(e=>typeof e==`number`)),streak:c(e.map(e=>e.day),t)}}function d(e){let t=new Map;for(let n of e){let e=t.get(n.metric)??[];e.push(n),t.set(n.metric,e)}return[...t.entries()].map(([e,t])=>{let n=[...t].sort((e,t)=>e.day.localeCompare(t.day)),r=Math.floor(n.length/2),i=l(n.slice(0,r).map(e=>e.value)),o=l(n.slice(n.length-r).map(e=>e.value)),s=`steady`;if(i!==null&&o!==null&&i!==0){let e=(o-i)/Math.abs(i);e>.05?s=`rising`:e<-.05&&(s=`falling`)}let c=n[n.length-1]??null;return{metric:e,label:a(e),unit:c?.unit??null,entries:n.length,average:l(n.map(e=>e.value)),latest:c?.value??null,latestDay:c?.day??null,trend:s}}).sort((e,t)=>t.entries-e.entries)}function f(e,t,n=30,r=s(new Date)){let i=Math.max(1,Math.round(n)),a=new Map;for(let n of e)n.metric===t&&a.set(n.day,n.value);let c=new Date(`${r}T00:00:00Z`).getTime();return Array.from({length:i},(e,t)=>{let n=s(new Date(c-(i-1-t)*o));return{day:n,value:a.has(n)?a.get(n):null}})}function p(e,t=null){if(!e)return{monthlySurplus:null,runwayMonths:null,monthsToTarget:null,savingsProgress:null};let n=e.monthly_income??null,r=e.fixed_costs??null,i=t?.monthly_change??0,a=t?.one_off??0,o=n===null&&r===null?null:(n??0)-(r??0)+i,s=(e.current_savings??0)+a,c=o!==null&&o<0&&s>0?Math.round(s/Math.abs(o)*10)/10:null,l=e.savings_target??null;return{monthlySurplus:o,runwayMonths:c,monthsToTarget:l&&o&&o>0&&l>s?Math.ceil((l-s)/o):l&&s>=l?0:null,savingsProgress:l&&l>0?Math.max(0,Math.min(100,Math.round(s/l*100))):null}}function m(e,t){if(e==null)return`-`;try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t,maximumFractionDigits:0}).format(e)}catch{return`${t} ${Math.round(e)}`}}export{r as a,d as c,m as i,a as l,e as n,t as o,p as r,u as s,i as t,f as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.