@project-ava-supernova/core 0.2.180 → 0.2.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/health/equipment.d.ts +6 -0
- package/dist/health/equipment.d.ts.map +1 -1
- package/dist/health/equipment.js +8 -2
- package/dist/health/equipment.js.map +1 -1
- package/dist/health/for-you-plan.d.ts +59 -0
- package/dist/health/for-you-plan.d.ts.map +1 -0
- package/dist/health/for-you-plan.js +43 -0
- package/dist/health/for-you-plan.js.map +1 -0
- package/dist/health/for-you.d.ts +144 -0
- package/dist/health/for-you.d.ts.map +1 -0
- package/dist/health/for-you.js +294 -0
- package/dist/health/for-you.js.map +1 -0
- package/dist/health/library-fit.d.ts +121 -0
- package/dist/health/library-fit.d.ts.map +1 -0
- package/dist/health/library-fit.js +137 -0
- package/dist/health/library-fit.js.map +1 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +59 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +59 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +59 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +63 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +59 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +59 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +59 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/id.d.ts.map +1 -1
- package/dist/i18n/locales/id.js +59 -0
- package/dist/i18n/locales/id.js.map +1 -1
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +59 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +59 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/ko.d.ts.map +1 -1
- package/dist/i18n/locales/ko.js +59 -0
- package/dist/i18n/locales/ko.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +59 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +59 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +59 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +59 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/th.d.ts.map +1 -1
- package/dist/i18n/locales/th.js +59 -0
- package/dist/i18n/locales/th.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +59 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/uk.d.ts.map +1 -1
- package/dist/i18n/locales/uk.js +59 -0
- package/dist/i18n/locales/uk.js.map +1 -1
- package/dist/i18n/locales/vi.d.ts.map +1 -1
- package/dist/i18n/locales/vi.js +59 -0
- package/dist/i18n/locales/vi.js.map +1 -1
- package/dist/i18n/locales/zh-CN.d.ts.map +1 -1
- package/dist/i18n/locales/zh-CN.js +59 -0
- package/dist/i18n/locales/zh-CN.js.map +1 -1
- package/dist/i18n/locales/zh-TW.d.ts.map +1 -1
- package/dist/i18n/locales/zh-TW.js +59 -0
- package/dist/i18n/locales/zh-TW.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +16 -1
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "For you" on the command centre's Health tab (Health & Nutrition, Part 4,
|
|
3
|
+
* 14 Nov 2026; mockup approved the same night).
|
|
4
|
+
*
|
|
5
|
+
* Three situations, from the plan of 11 Nov:
|
|
6
|
+
* - No profile yet: a few good-looking recipes and an exercise, and an
|
|
7
|
+
* invitation to tell Ava about themselves. This is the advert.
|
|
8
|
+
* - Profile, no plan: picks that pass their hard rules, each with a short
|
|
9
|
+
* "why this", new each day. Nobody has to make a plan to try something.
|
|
10
|
+
* - Plan running: today's session and tonight's dinner first, then a few
|
|
11
|
+
* things that go with today (an exercise of the same kind, a quick lunch
|
|
12
|
+
* where there is none, a fitting swap for tonight).
|
|
13
|
+
*
|
|
14
|
+
* Runs where the person's profile lives (the extension host, the IDE engine).
|
|
15
|
+
* Library pages, details and safety facts are fetched by slug; the profile is
|
|
16
|
+
* never sent anywhere. The rules are core's own (health/safety.ts), the same
|
|
17
|
+
* check the wizard and the library tabs use.
|
|
18
|
+
*/
|
|
19
|
+
import { checkExercise, checkRecipe, fetchSafetyFacts, safetyProfileFrom, hasHardRules } from './safety.js';
|
|
20
|
+
import { orderByPreference } from './library-fit.js';
|
|
21
|
+
export { applyForYouAction } from './for-you-plan.js';
|
|
22
|
+
const some = (v) => Array.isArray(v) && v.some((x) => typeof x === 'string' && x.trim());
|
|
23
|
+
/** Has the person told Ava anything about themselves? */
|
|
24
|
+
export function profileIsSet(p) {
|
|
25
|
+
if (!p)
|
|
26
|
+
return false;
|
|
27
|
+
const c = p.constraints ?? {};
|
|
28
|
+
const f = p.food ?? {};
|
|
29
|
+
return some(c.allergens) || some(c.dietary) || some(c.injuries) || some(c.equipment_available)
|
|
30
|
+
|| some(f.likes) || some(f.dislikes) || some(f.cuisines)
|
|
31
|
+
|| !!p.goals?.primary || !!p.training?.experience || !!p.kitchen?.level;
|
|
32
|
+
}
|
|
33
|
+
// ── Small pure helpers (tested) ──────────────────────────────────────────────
|
|
34
|
+
/** A number from a date, so the picks change each day and stay put within it. */
|
|
35
|
+
export function daySeed(day) {
|
|
36
|
+
let h = 2166136261;
|
|
37
|
+
for (let i = 0; i < day.length; i++) {
|
|
38
|
+
h ^= day.charCodeAt(i);
|
|
39
|
+
h = Math.imul(h, 16777619);
|
|
40
|
+
}
|
|
41
|
+
return h >>> 0;
|
|
42
|
+
}
|
|
43
|
+
/** The same list in a day-stable shuffled order. */
|
|
44
|
+
export function shuffleForDay(items, day) {
|
|
45
|
+
let s = daySeed(day) || 1;
|
|
46
|
+
const rnd = () => { s ^= s << 13; s >>>= 0; s ^= s >>> 17; s ^= s << 5; s >>>= 0; return s / 4294967296; };
|
|
47
|
+
const out = items.slice();
|
|
48
|
+
for (let i = out.length - 1; i > 0; i--) {
|
|
49
|
+
const j = Math.floor(rnd() * (i + 1));
|
|
50
|
+
[out[i], out[j]] = [out[j], out[i]];
|
|
51
|
+
}
|
|
52
|
+
return out;
|
|
53
|
+
}
|
|
54
|
+
/** YYYY-MM-DD of a plan day, local time. */
|
|
55
|
+
export function planDayDate(startDate, dayIndex) {
|
|
56
|
+
const d = new Date(`${startDate}T12:00:00`);
|
|
57
|
+
d.setDate(d.getDate() + dayIndex - 1);
|
|
58
|
+
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
59
|
+
}
|
|
60
|
+
const pretty = (s) => s.replace(/_/g, ' ').replace(/\s+/g, ' ').trim();
|
|
61
|
+
const cap = (s) => (s ? s[0].toUpperCase() + s.slice(1) : s);
|
|
62
|
+
/** "High protein · 40 min · no nuts". Up to three facts, in the order that matters most to them. */
|
|
63
|
+
export function recipeWhy(f, profile) {
|
|
64
|
+
const bits = [];
|
|
65
|
+
const wantDiet = (profile?.constraints?.dietary ?? []).map((d) => pretty(d).toLowerCase());
|
|
66
|
+
const diet = f.diets.find((d) => wantDiet.includes(pretty(d).toLowerCase()));
|
|
67
|
+
if (diet)
|
|
68
|
+
bits.push(cap(pretty(diet)));
|
|
69
|
+
else if (f.protein != null && f.protein >= 30)
|
|
70
|
+
bits.push('High protein');
|
|
71
|
+
if (f.minutes != null)
|
|
72
|
+
bits.push(`${f.minutes} min`);
|
|
73
|
+
if (f.protein != null && !bits.includes('High protein'))
|
|
74
|
+
bits.push(`${Math.round(f.protein)} g protein`);
|
|
75
|
+
const cuisines = (profile?.food?.cuisines ?? []).map((c) => pretty(c).toLowerCase());
|
|
76
|
+
if (f.cuisine && cuisines.includes(pretty(f.cuisine).toLowerCase()))
|
|
77
|
+
bits.push('a cuisine you like');
|
|
78
|
+
const allergen = (profile?.constraints?.allergens ?? [])[0];
|
|
79
|
+
if (allergen)
|
|
80
|
+
bits.push(`no ${pretty(allergen).toLowerCase()}`);
|
|
81
|
+
return bits.slice(0, 3).join(' · ');
|
|
82
|
+
}
|
|
83
|
+
const LEVEL_MAX = { beginner: 2, intermediate: 4, advanced: 5 };
|
|
84
|
+
/** "No kit needed · your level". */
|
|
85
|
+
export function exerciseWhy(f, profile, lead) {
|
|
86
|
+
const bits = [];
|
|
87
|
+
if (lead)
|
|
88
|
+
bits.push(lead);
|
|
89
|
+
const kit = f.equipment.filter((e) => e.slug !== 'bodyweight');
|
|
90
|
+
if (!kit.length)
|
|
91
|
+
bits.push('No kit needed');
|
|
92
|
+
else if (some(profile?.constraints?.equipment_available))
|
|
93
|
+
bits.push('Uses kit you have');
|
|
94
|
+
else
|
|
95
|
+
bits.push(kit.slice(0, 2).map((e) => e.name).join(' or '));
|
|
96
|
+
const exp = profile?.training?.experience ?? null;
|
|
97
|
+
if (exp && f.difficulty != null && f.difficulty <= (LEVEL_MAX[exp] ?? 5) && f.difficulty >= (exp === 'advanced' ? 3 : 1))
|
|
98
|
+
bits.push('your level');
|
|
99
|
+
else if (!exp && f.difficulty != null && f.difficulty <= 2)
|
|
100
|
+
bits.push('beginner friendly');
|
|
101
|
+
return bits.slice(0, 3).join(' · ');
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Today across ALL their running plans. A meal plan and a training plan side
|
|
105
|
+
* by side is the normal way people run them, so the session comes from the
|
|
106
|
+
* plan that trains today and the meals from the plan that feeds today.
|
|
107
|
+
*/
|
|
108
|
+
export function todayInPlans(plans, today) {
|
|
109
|
+
const out = { sessionPlan: null, sessionDay: null, session: null, mealPlan: null, mealDay: null, dinner: null, meals: [] };
|
|
110
|
+
for (const plan of plans) {
|
|
111
|
+
if (!plan.start_date || plan.status === 'archived')
|
|
112
|
+
continue;
|
|
113
|
+
const day = plan.days.find((d) => planDayDate(plan.start_date, d.day_index) === today);
|
|
114
|
+
if (!day)
|
|
115
|
+
continue;
|
|
116
|
+
if (!out.session && day.training.length) {
|
|
117
|
+
out.sessionPlan = plan;
|
|
118
|
+
out.sessionDay = day.day_index;
|
|
119
|
+
out.session = { planId: plan.id, dayIndex: day.day_index, title: day.title, count: day.training.length, first: day.training[0]?.name ?? null, firstSlug: day.training[0]?.ref?.slug ?? null };
|
|
120
|
+
}
|
|
121
|
+
if (!out.mealPlan && day.meals.length) {
|
|
122
|
+
out.mealPlan = plan;
|
|
123
|
+
out.mealDay = day.day_index;
|
|
124
|
+
out.meals = day.meals;
|
|
125
|
+
out.dinner = day.meals.find((m) => m.slot === 'dinner') ?? null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return out;
|
|
129
|
+
}
|
|
130
|
+
// ── Fetching (library data only) ─────────────────────────────────────────────
|
|
131
|
+
const BASE = () => process.env.AVA_PLATFORM_URL || 'https://avasupernova.com';
|
|
132
|
+
async function getJson(path, f) {
|
|
133
|
+
const res = await f(`${BASE()}${path}`, { headers: { Accept: 'application/json' } });
|
|
134
|
+
if (!res.ok)
|
|
135
|
+
throw new Error(`HTTP ${res.status} ${path}`);
|
|
136
|
+
return res.json();
|
|
137
|
+
}
|
|
138
|
+
/** One page of the library, at a day-stable place in it. */
|
|
139
|
+
async function libraryPage(kind, params, day, f, size = 48) {
|
|
140
|
+
const q = new URLSearchParams(params);
|
|
141
|
+
const head = await getJson(`/api/health/${kind}?${new URLSearchParams({ ...params, limit: '1', offset: '0' })}`, f);
|
|
142
|
+
const total = head.total ?? 0;
|
|
143
|
+
const offset = total > size ? daySeed(`${day}:${kind}:${q}`) % (total - size) : 0;
|
|
144
|
+
// The library hands out at most 100 a request: a bigger window is read in parts.
|
|
145
|
+
const out = [];
|
|
146
|
+
for (let at = offset; at < offset + size && at < Math.max(total, 1); at += 100) {
|
|
147
|
+
q.set('limit', String(Math.min(100, offset + size - at)));
|
|
148
|
+
q.set('offset', String(at));
|
|
149
|
+
const page = await getJson(`/api/health/${kind}?${q}`, f);
|
|
150
|
+
const rows = page[kind] ?? [];
|
|
151
|
+
out.push(...rows);
|
|
152
|
+
if (rows.length < 100)
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
return out;
|
|
156
|
+
}
|
|
157
|
+
async function recipeFacts(slug, level, f) {
|
|
158
|
+
const d = await getJson(`/api/health/recipes/${encodeURIComponent(slug)}`, f);
|
|
159
|
+
const r = d.recipe ?? d;
|
|
160
|
+
const v = r.versions?.find((x) => x.level === level) ?? r.versions?.[0];
|
|
161
|
+
return { minutes: v?.total_time_minutes ?? null, protein: v?.nutrition?.protein_g ?? null, diets: v?.diets ?? [], cuisine: r.cuisine_name ?? null, image: r.hero_image_url ?? null };
|
|
162
|
+
}
|
|
163
|
+
async function exerciseDetail(slug, f) {
|
|
164
|
+
const d = await getJson(`/api/health/exercises/${encodeURIComponent(slug)}`, f);
|
|
165
|
+
return d.exercise ?? d;
|
|
166
|
+
}
|
|
167
|
+
const WORKOUT_LABEL = {
|
|
168
|
+
strength: 'Strength', hypertrophy: 'Muscle', conditioning: 'Conditioning', hiit: 'HIIT', mobility: 'Mobility', flexibility: 'Flexibility', yoga: 'Yoga', pilates: 'Pilates', calisthenics: 'Bodyweight',
|
|
169
|
+
};
|
|
170
|
+
// ── The whole card ──────────────────────────────────────────────────────────
|
|
171
|
+
export async function buildForYou(opts) {
|
|
172
|
+
const f = opts.fetchImpl ?? fetch;
|
|
173
|
+
const { profile, today } = opts;
|
|
174
|
+
const set = profileIsSet(profile);
|
|
175
|
+
const rules = safetyProfileFrom(profile);
|
|
176
|
+
const strict = hasHardRules(rules);
|
|
177
|
+
const level = profile?.kitchen?.level ?? null;
|
|
178
|
+
const base = { state: set ? 'profile' : 'no_profile', picks: [], session: null, dinner: null, extras: [], planTitle: null, checked: true, day: today };
|
|
179
|
+
// Candidates: dinners (mains) and exercises, one day-stable page of each.
|
|
180
|
+
// Snacks too, for a running plan whose lunch is already covered.
|
|
181
|
+
const [recipes, exercises, snacks] = await Promise.all([
|
|
182
|
+
libraryPage('recipes', { course: 'main' }, today, f).catch(() => []),
|
|
183
|
+
libraryPage('exercises', {}, today, f, 250).catch(() => []),
|
|
184
|
+
libraryPage('recipes', { course: 'snack' }, today, f, 24).catch(() => []),
|
|
185
|
+
]);
|
|
186
|
+
// Their rules, checked here: blocked never offered; with rules, a caution
|
|
187
|
+
// exercise is not offered as a pick either (it is fine in a plan, with a
|
|
188
|
+
// note, but a "for you" suggestion should not need a warning).
|
|
189
|
+
let okRecipe = (_) => true;
|
|
190
|
+
let okExercise = (_) => true;
|
|
191
|
+
if (strict) {
|
|
192
|
+
try {
|
|
193
|
+
const facts = await fetchSafetyFacts({ recipes: [...recipes, ...snacks].map((r) => r.slug), exercises: exercises.map((e) => e.slug), level }, f);
|
|
194
|
+
okRecipe = (s) => !!facts.recipes[s] && checkRecipe(facts.recipes[s], rules).verdict === 'ok';
|
|
195
|
+
okExercise = (s) => !!facts.exercises[s] && checkExercise(facts.exercises[s], rules).verdict === 'ok';
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
return { ...base, checked: false };
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const fitRecipes = orderByPreference(shuffleForDay(recipes.filter((r) => okRecipe(r.slug) && (set || r.hero_image_url)), today), profile);
|
|
202
|
+
const exp = profile?.training?.experience ?? null;
|
|
203
|
+
const fitExercises = shuffleForDay(exercises.filter((e) => okExercise(e.slug) && e.difficulty <= (exp ? (LEVEL_MAX[exp] ?? 5) : 3)), today);
|
|
204
|
+
const recipePick = async (r, kicker) => {
|
|
205
|
+
const facts = await recipeFacts(r.slug, level, f).catch(() => ({ minutes: null, protein: null, diets: [], cuisine: r.cuisine_name, image: null }));
|
|
206
|
+
return { kind: 'recipe', slug: r.slug, name: r.name, kicker: kicker ?? r.cuisine_name, why: recipeWhy(facts, set ? profile : null), image: r.hero_image_url, course: r.course };
|
|
207
|
+
};
|
|
208
|
+
const exercisePick = async (e, lead) => {
|
|
209
|
+
const d = await exerciseDetail(e.slug, f).catch(() => ({ slug: e.slug, workout_type: e.workout_type, difficulty: e.difficulty, equipment: [] }));
|
|
210
|
+
return { kind: 'exercise', slug: e.slug, name: e.name, kicker: WORKOUT_LABEL[e.workout_type] ?? cap(pretty(e.workout_type)), why: exerciseWhy({ equipment: d.equipment ?? [], difficulty: d.difficulty ?? e.difficulty }, set ? profile : null, lead), image: e.thumbnail_url ?? ('thumbnail_url' in d ? d.thumbnail_url ?? null : null) };
|
|
211
|
+
};
|
|
212
|
+
// ── Plans running today ──
|
|
213
|
+
const t = todayInPlans(opts.activePlans, today);
|
|
214
|
+
if (t.session || t.meals.length) {
|
|
215
|
+
const extras = [];
|
|
216
|
+
let session = t.session;
|
|
217
|
+
if (t.session && t.sessionPlan && t.sessionDay != null) {
|
|
218
|
+
const inSession = new Set(t.sessionPlan.days.find((d) => d.day_index === t.sessionDay)?.training.map((x) => x.ref?.slug).filter(Boolean));
|
|
219
|
+
const first = t.session.firstSlug ? await exerciseDetail(t.session.firstSlug, f).catch(() => null) : null;
|
|
220
|
+
session = { ...t.session, image: first?.thumbnail_url ?? null };
|
|
221
|
+
// More of the same kind of training as today's first exercise.
|
|
222
|
+
const match = fitExercises.find((e) => !inSession.has(e.slug) && (!first?.workout_type || e.workout_type === first.workout_type));
|
|
223
|
+
if (match) {
|
|
224
|
+
const p = await exercisePick(match, 'Same kind of training as today');
|
|
225
|
+
extras.push({ ...p, action: { type: 'add_exercise', planId: t.sessionPlan.id, dayIndex: t.sessionDay, slug: p.slug, name: p.name } });
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
const usedRecipes = new Set(t.meals.map((m) => m.ref?.slug).filter(Boolean));
|
|
229
|
+
if (t.mealPlan && t.mealDay != null && !t.meals.some((m) => m.slot === 'lunch')) {
|
|
230
|
+
for (const r of fitRecipes.slice(0, 8)) {
|
|
231
|
+
if (usedRecipes.has(r.slug))
|
|
232
|
+
continue;
|
|
233
|
+
const p = await recipePick(r, 'Lunch');
|
|
234
|
+
usedRecipes.add(r.slug);
|
|
235
|
+
extras.push({ ...p, why: `A lunch for today · ${p.why}`, action: { type: 'add_meal', planId: t.mealPlan.id, dayIndex: t.mealDay, slot: 'lunch', slug: p.slug, name: p.name } });
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// Lunch already covered: a snack for today instead.
|
|
240
|
+
if (t.mealPlan && t.mealDay != null && t.meals.some((m) => m.slot === 'lunch') && !t.meals.some((m) => m.slot === 'snack')) {
|
|
241
|
+
const snack = orderByPreference(shuffleForDay(snacks.filter((r) => okRecipe(r.slug) && !usedRecipes.has(r.slug)), today), profile)[0];
|
|
242
|
+
if (snack) {
|
|
243
|
+
const p = await recipePick(snack, 'Snack');
|
|
244
|
+
usedRecipes.add(snack.slug);
|
|
245
|
+
extras.push({ ...p, why: `A snack for today · ${p.why}`, action: { type: 'add_meal', planId: t.mealPlan.id, dayIndex: t.mealDay, slot: 'snack', slug: p.slug, name: p.name } });
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
let dinner = null;
|
|
249
|
+
if (t.dinner && t.mealPlan && t.mealDay != null) {
|
|
250
|
+
const dn = t.dinner;
|
|
251
|
+
const facts = dn.ref?.slug ? await recipeFacts(dn.ref.slug, level, f).catch(() => null) : null;
|
|
252
|
+
const why = facts
|
|
253
|
+
? recipeWhy(facts, profile)
|
|
254
|
+
: [dn.cook_time_minutes ? `${dn.cook_time_minutes} min` : null, dn.protein_g ? `${Math.round(dn.protein_g)} g protein` : null].filter(Boolean).join(' · ');
|
|
255
|
+
dinner = { planId: t.mealPlan.id, dayIndex: t.mealDay, mealId: dn.id, slug: dn.ref?.slug ?? null, name: dn.name, why, image: facts?.image ?? null };
|
|
256
|
+
const swap = fitRecipes.find((r) => !usedRecipes.has(r.slug));
|
|
257
|
+
if (swap) {
|
|
258
|
+
const p = await recipePick(swap, 'Swap for tonight');
|
|
259
|
+
extras.push({ ...p, why: `If you swap tonight · ${p.why}`, action: { type: 'swap_meal', planId: t.mealPlan.id, dayIndex: t.mealDay, mealId: dn.id, slug: p.slug, name: p.name } });
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
// Three suggestions fill the row: top up with more of today's kind of training.
|
|
263
|
+
if (t.session && t.sessionPlan && t.sessionDay != null) {
|
|
264
|
+
const taken = new Set([
|
|
265
|
+
...t.sessionPlan.days.find((d) => d.day_index === t.sessionDay)?.training.map((x) => x.ref?.slug).filter(Boolean),
|
|
266
|
+
...extras.map((x) => x.slug),
|
|
267
|
+
]);
|
|
268
|
+
const kind = extras.find((x) => x.action.type === 'add_exercise') ? exercises.find((e) => e.slug === extras.find((x) => x.action.type === 'add_exercise').slug)?.workout_type : null;
|
|
269
|
+
for (const e of fitExercises) {
|
|
270
|
+
if (extras.length >= 3)
|
|
271
|
+
break;
|
|
272
|
+
if (taken.has(e.slug) || (kind && e.workout_type !== kind))
|
|
273
|
+
continue;
|
|
274
|
+
taken.add(e.slug);
|
|
275
|
+
const p = await exercisePick(e, 'Same kind of training as today');
|
|
276
|
+
extras.splice(1, 0, { ...p, action: { type: 'add_exercise', planId: t.sessionPlan.id, dayIndex: t.sessionDay, slug: p.slug, name: p.name } });
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
const titles = [...new Set([t.sessionPlan?.title, t.mealPlan?.title].filter(Boolean))];
|
|
280
|
+
const sessionDay = t.sessionPlan?.days.find((d) => d.day_index === t.sessionDay);
|
|
281
|
+
const todayItems = {
|
|
282
|
+
training: (sessionDay?.training ?? []).map((e) => ({ id: e.id, name: e.name, sets: e.sets, reps: e.reps })),
|
|
283
|
+
meals: t.meals.map((m) => ({ id: m.id, slot: m.slot, name: m.name })),
|
|
284
|
+
};
|
|
285
|
+
return { ...base, state: 'running', session, dinner, extras, planTitle: titles.join(' · ') || null, todayItems };
|
|
286
|
+
}
|
|
287
|
+
// ── No plan today: two dinners and an exercise ──
|
|
288
|
+
const picks = await Promise.all([
|
|
289
|
+
...fitRecipes.slice(0, 2).map((r) => recipePick(r, r.cuisine_name ? `${r.cuisine_name} · Dinner` : 'Dinner')),
|
|
290
|
+
...fitExercises.slice(0, 1).map((e) => exercisePick(e)),
|
|
291
|
+
]);
|
|
292
|
+
return { ...base, picks };
|
|
293
|
+
}
|
|
294
|
+
//# sourceMappingURL=for-you.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"for-you.js","sourceRoot":"","sources":["../../src/health/for-you.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,EAAsB,MAAM,aAAa,CAAC;AAChI,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EAAE,iBAAiB,EAA4C,MAAM,mBAAmB,CAAC;AAuEhG,MAAM,IAAI,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAElG,yDAAyD;AACzD,MAAM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,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,UAAU,EAAE,CAAC;IACnH,CAAC;IAED,mDAAmD;IACnD,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC9B,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,YAAY,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC7G,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;KACxD,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "The library fits you" (Health & Nutrition, Part 3, 14 Nov 2026).
|
|
3
|
+
*
|
|
4
|
+
* The Recipes and Exercises tabs open showing only what fits the person's
|
|
5
|
+
* HARD rules (allergens, diet, injuries marked "avoid", kit they don't have),
|
|
6
|
+
* with one switch to see everything. The ready-made plans say "fits you" or
|
|
7
|
+
* "needs a swap". Preferences (likes, dislikes, favourite cuisines) only
|
|
8
|
+
* change the ORDER — they never hide anything.
|
|
9
|
+
*
|
|
10
|
+
* His decision (14 Nov): the person's computer does the filtering. The
|
|
11
|
+
* verdicts come from the same safety check the plan wizard uses
|
|
12
|
+
* (health_safety_check → core health/safety.ts), which reads the profile on
|
|
13
|
+
* their machine and sends only slugs to the server. The website never sees
|
|
14
|
+
* their rules.
|
|
15
|
+
*
|
|
16
|
+
* Pure, no Node imports: the extension webview and the IDE both import this
|
|
17
|
+
* file, so the two apps cannot drift apart.
|
|
18
|
+
*/
|
|
19
|
+
export interface FitVerdict {
|
|
20
|
+
verdict: 'ok' | 'warn' | 'blocked';
|
|
21
|
+
reasons: string[];
|
|
22
|
+
unverified?: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface FitState {
|
|
25
|
+
/** Verdicts by slug, from health_safety_result. */
|
|
26
|
+
results: Record<string, FitVerdict>;
|
|
27
|
+
/** False when the last check could not reach the library. */
|
|
28
|
+
checked: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** The hard-rule fields of a stored profile, any shape tolerated. */
|
|
31
|
+
interface ProfileLike {
|
|
32
|
+
constraints?: {
|
|
33
|
+
allergens?: string[];
|
|
34
|
+
dietary?: string[];
|
|
35
|
+
injuries?: string[];
|
|
36
|
+
equipment_available?: string[];
|
|
37
|
+
} | null;
|
|
38
|
+
food?: {
|
|
39
|
+
likes?: string[];
|
|
40
|
+
dislikes?: string[];
|
|
41
|
+
cuisines?: string[];
|
|
42
|
+
} | null;
|
|
43
|
+
}
|
|
44
|
+
/** True when the profile holds at least one hard rule. Same fields as safety.ts's safetyProfileFrom. */
|
|
45
|
+
export declare function profileHasHardRules(profile: ProfileLike | null | undefined): boolean;
|
|
46
|
+
export interface FitView<T> {
|
|
47
|
+
/** What to draw, in order. */
|
|
48
|
+
shown: T[];
|
|
49
|
+
/** Left out because they break a hard rule (fitsOnly on). */
|
|
50
|
+
hidden: number;
|
|
51
|
+
/** Not answered yet — held back while fitsOnly is on, so nothing unchecked
|
|
52
|
+
* is presented as fitting. */
|
|
53
|
+
pending: number;
|
|
54
|
+
/** The check could not run. Everything is shown and the screen must say so. */
|
|
55
|
+
failed: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Which items of one page to show.
|
|
59
|
+
*
|
|
60
|
+
* - No hard rules: everything, nothing to say.
|
|
61
|
+
* - Check failed: everything, with `failed` so the screen says it is unchecked.
|
|
62
|
+
* Hiding the whole library because the network blinked helps nobody, and
|
|
63
|
+
* calling it "fits you" would be a lie — so it is shown and labelled.
|
|
64
|
+
* - fitsOnly: blocked and not-yet-answered are held back; cautions stay
|
|
65
|
+
* (things to do differently, not never).
|
|
66
|
+
* - Show all: everything; the cards carry their verdicts.
|
|
67
|
+
*/
|
|
68
|
+
export declare function libraryFit<T extends {
|
|
69
|
+
slug: string;
|
|
70
|
+
}>(items: T[], state: FitState, opts: {
|
|
71
|
+
rules: boolean;
|
|
72
|
+
fitsOnly: boolean;
|
|
73
|
+
}): FitView<T>;
|
|
74
|
+
/** Slugs on this page with no verdict yet — what to ask the check about. */
|
|
75
|
+
export declare function slugsToCheck<T extends {
|
|
76
|
+
slug: string;
|
|
77
|
+
}>(items: T[], state: FitState): string[];
|
|
78
|
+
/**
|
|
79
|
+
* Preferences steer, never hide: favourite cuisines and liked foods first,
|
|
80
|
+
* disliked foods last, everything else in the library's own order.
|
|
81
|
+
* Matched on the recipe's name and cuisine — the list carries no ingredients,
|
|
82
|
+
* so "mushrooms" moves "Mushroom risotto" down, not every dish with a
|
|
83
|
+
* mushroom in it. Stable: equal scores keep their order.
|
|
84
|
+
*/
|
|
85
|
+
export declare function orderByPreference<T extends {
|
|
86
|
+
name: string;
|
|
87
|
+
cuisine_name?: string | null;
|
|
88
|
+
}>(items: T[], profile: ProfileLike | null | undefined): T[];
|
|
89
|
+
/** The recipe and exercise slugs a plan's days refer to. */
|
|
90
|
+
export declare function planRefs(days: Array<{
|
|
91
|
+
meals?: Array<{
|
|
92
|
+
ref?: {
|
|
93
|
+
slug: string;
|
|
94
|
+
} | null;
|
|
95
|
+
}> | null;
|
|
96
|
+
training?: Array<{
|
|
97
|
+
ref?: {
|
|
98
|
+
slug: string;
|
|
99
|
+
} | null;
|
|
100
|
+
}> | null;
|
|
101
|
+
}>): {
|
|
102
|
+
recipes: string[];
|
|
103
|
+
exercises: string[];
|
|
104
|
+
};
|
|
105
|
+
export interface StarterFit {
|
|
106
|
+
state: 'fits' | 'swap' | 'pending' | 'unchecked';
|
|
107
|
+
/** Items that break a hard rule (by slug). */
|
|
108
|
+
blocked: string[];
|
|
109
|
+
/** Items to take care with (by slug). */
|
|
110
|
+
cautions: string[];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* One ready-made plan against their rules: "fits you" or "needs a swap".
|
|
114
|
+
* A plan is only said to fit once every item in it has been answered.
|
|
115
|
+
*/
|
|
116
|
+
export declare function starterFit(refs: {
|
|
117
|
+
recipes: string[];
|
|
118
|
+
exercises: string[];
|
|
119
|
+
}, state: FitState): StarterFit;
|
|
120
|
+
export {};
|
|
121
|
+
//# sourceMappingURL=library-fit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-fit.d.ts","sourceRoot":"","sources":["../../src/health/library-fit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;IACnC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,QAAQ;IACvB,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpC,6DAA6D;IAC7D,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qEAAqE;AACrE,UAAU,WAAW;IACnB,WAAW,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;IACvH,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAA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AA;KAAE,CAAC,GAAG,IAAI,CAAC;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,GAAG,IAAI,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;CAC5D,CAAC,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAO9C;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC;IACjD,8CAA8C;IAC9C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,EAAE,KAAK,EAAE,QAAQ,GAAG,UAAU,CAaxG"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "The library fits you" (Health & Nutrition, Part 3, 14 Nov 2026).
|
|
3
|
+
*
|
|
4
|
+
* The Recipes and Exercises tabs open showing only what fits the person's
|
|
5
|
+
* HARD rules (allergens, diet, injuries marked "avoid", kit they don't have),
|
|
6
|
+
* with one switch to see everything. The ready-made plans say "fits you" or
|
|
7
|
+
* "needs a swap". Preferences (likes, dislikes, favourite cuisines) only
|
|
8
|
+
* change the ORDER — they never hide anything.
|
|
9
|
+
*
|
|
10
|
+
* His decision (14 Nov): the person's computer does the filtering. The
|
|
11
|
+
* verdicts come from the same safety check the plan wizard uses
|
|
12
|
+
* (health_safety_check → core health/safety.ts), which reads the profile on
|
|
13
|
+
* their machine and sends only slugs to the server. The website never sees
|
|
14
|
+
* their rules.
|
|
15
|
+
*
|
|
16
|
+
* Pure, no Node imports: the extension webview and the IDE both import this
|
|
17
|
+
* file, so the two apps cannot drift apart.
|
|
18
|
+
*/
|
|
19
|
+
const filled = (v) => Array.isArray(v) && v.some((x) => typeof x === 'string' && x.trim().length > 0);
|
|
20
|
+
/** True when the profile holds at least one hard rule. Same fields as safety.ts's safetyProfileFrom. */
|
|
21
|
+
export function profileHasHardRules(profile) {
|
|
22
|
+
const c = profile?.constraints;
|
|
23
|
+
return !!c && (filled(c.allergens) || filled(c.dietary) || filled(c.injuries) || filled(c.equipment_available));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Which items of one page to show.
|
|
27
|
+
*
|
|
28
|
+
* - No hard rules: everything, nothing to say.
|
|
29
|
+
* - Check failed: everything, with `failed` so the screen says it is unchecked.
|
|
30
|
+
* Hiding the whole library because the network blinked helps nobody, and
|
|
31
|
+
* calling it "fits you" would be a lie — so it is shown and labelled.
|
|
32
|
+
* - fitsOnly: blocked and not-yet-answered are held back; cautions stay
|
|
33
|
+
* (things to do differently, not never).
|
|
34
|
+
* - Show all: everything; the cards carry their verdicts.
|
|
35
|
+
*/
|
|
36
|
+
export function libraryFit(items, state, opts) {
|
|
37
|
+
if (!opts.rules)
|
|
38
|
+
return { shown: items, hidden: 0, pending: 0, failed: false };
|
|
39
|
+
const unanswered = items.filter((i) => !state.results[i.slug]);
|
|
40
|
+
if (!state.checked && unanswered.length)
|
|
41
|
+
return { shown: items, hidden: 0, pending: 0, failed: true };
|
|
42
|
+
if (!opts.fitsOnly)
|
|
43
|
+
return { shown: items, hidden: 0, pending: unanswered.length, failed: false };
|
|
44
|
+
let hidden = 0, pending = 0;
|
|
45
|
+
const shown = [];
|
|
46
|
+
for (const i of items) {
|
|
47
|
+
const v = state.results[i.slug];
|
|
48
|
+
if (!v) {
|
|
49
|
+
pending++;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if (v.verdict === 'blocked') {
|
|
53
|
+
hidden++;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
shown.push(i);
|
|
57
|
+
}
|
|
58
|
+
return { shown, hidden, pending, failed: false };
|
|
59
|
+
}
|
|
60
|
+
/** Slugs on this page with no verdict yet — what to ask the check about. */
|
|
61
|
+
export function slugsToCheck(items, state) {
|
|
62
|
+
return items.map((i) => i.slug).filter((s) => !state.results[s]);
|
|
63
|
+
}
|
|
64
|
+
const lc = (s) => s.trim().toLowerCase().replace(/[_-]+/g, ' ');
|
|
65
|
+
/**
|
|
66
|
+
* Preferences steer, never hide: favourite cuisines and liked foods first,
|
|
67
|
+
* disliked foods last, everything else in the library's own order.
|
|
68
|
+
* Matched on the recipe's name and cuisine — the list carries no ingredients,
|
|
69
|
+
* so "mushrooms" moves "Mushroom risotto" down, not every dish with a
|
|
70
|
+
* mushroom in it. Stable: equal scores keep their order.
|
|
71
|
+
*/
|
|
72
|
+
export function orderByPreference(items, profile) {
|
|
73
|
+
const likes = (profile?.food?.likes ?? []).map(lc).filter(Boolean);
|
|
74
|
+
const dislikes = (profile?.food?.dislikes ?? []).map(lc).filter(Boolean);
|
|
75
|
+
const cuisines = (profile?.food?.cuisines ?? []).map(lc).filter(Boolean);
|
|
76
|
+
if (!likes.length && !dislikes.length && !cuisines.length)
|
|
77
|
+
return items;
|
|
78
|
+
// "mushrooms" should find "Mushroom risotto": compare on the word stem.
|
|
79
|
+
const stem = (w) => w.replace(/(es|s)$/, '');
|
|
80
|
+
const mentions = (name, word) => {
|
|
81
|
+
const n = lc(name);
|
|
82
|
+
return n.includes(word) || n.includes(stem(word));
|
|
83
|
+
};
|
|
84
|
+
const score = (i) => {
|
|
85
|
+
let s = 0;
|
|
86
|
+
if (i.cuisine_name && cuisines.includes(lc(i.cuisine_name)))
|
|
87
|
+
s += 2;
|
|
88
|
+
if (likes.some((w) => mentions(i.name, w)))
|
|
89
|
+
s += 1;
|
|
90
|
+
if (dislikes.some((w) => mentions(i.name, w)))
|
|
91
|
+
s -= 3;
|
|
92
|
+
return s;
|
|
93
|
+
};
|
|
94
|
+
return items
|
|
95
|
+
.map((item, index) => ({ item, index, s: score(item) }))
|
|
96
|
+
.sort((a, b) => b.s - a.s || a.index - b.index)
|
|
97
|
+
.map((x) => x.item);
|
|
98
|
+
}
|
|
99
|
+
/** The recipe and exercise slugs a plan's days refer to. */
|
|
100
|
+
export function planRefs(days) {
|
|
101
|
+
const recipes = new Set(), exercises = new Set();
|
|
102
|
+
for (const d of days) {
|
|
103
|
+
for (const m of d.meals ?? [])
|
|
104
|
+
if (m.ref?.slug)
|
|
105
|
+
recipes.add(m.ref.slug);
|
|
106
|
+
for (const e of d.training ?? [])
|
|
107
|
+
if (e.ref?.slug)
|
|
108
|
+
exercises.add(e.ref.slug);
|
|
109
|
+
}
|
|
110
|
+
return { recipes: [...recipes], exercises: [...exercises] };
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* One ready-made plan against their rules: "fits you" or "needs a swap".
|
|
114
|
+
* A plan is only said to fit once every item in it has been answered.
|
|
115
|
+
*/
|
|
116
|
+
export function starterFit(refs, state) {
|
|
117
|
+
const slugs = [...refs.recipes, ...refs.exercises];
|
|
118
|
+
const blocked = [], cautions = [];
|
|
119
|
+
let unanswered = 0;
|
|
120
|
+
for (const s of slugs) {
|
|
121
|
+
const v = state.results[s];
|
|
122
|
+
if (!v) {
|
|
123
|
+
unanswered++;
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (v.verdict === 'blocked')
|
|
127
|
+
blocked.push(s);
|
|
128
|
+
else if (v.verdict === 'warn')
|
|
129
|
+
cautions.push(s);
|
|
130
|
+
}
|
|
131
|
+
if (blocked.length)
|
|
132
|
+
return { state: 'swap', blocked, cautions };
|
|
133
|
+
if (unanswered)
|
|
134
|
+
return { state: state.checked ? 'pending' : 'unchecked', blocked, cautions };
|
|
135
|
+
return { state: 'fits', blocked, cautions };
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=library-fit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-fit.js","source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AM,SAAS,CAAC;AACzC,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"ar.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/ar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CA6iJxD,CAAC"}
|