583,6,157,38,136,51,839,76,500,38,1368,35,655,35,486,66,151,80,380,54,402,61,140,70,613,40,738,51,470,33,1826,42,221,40,461,42,138,42,675,38,219,30,415,40,169,30,835,30,572,28,435,31,380,39,655,20,1034,46,266,39,235,29,1067,43,152,44,133,35,195,27,359,43,197,41,247,34,519,60,457,87,266,80,235,70,742,84,184,85,133,60,156,67,277,53,304,49,632,53,263,52,512,55,288,36,382,48,601,29,319,33,996,41,232,37,634,50,388,24,901,55,1127,59,489,69,386,62,179,61,155,60,169,75,266,68,235,58,1202,72,154,73,133,65,323,62,439,56,650,64,108,52,1017,37,317,34,72,34,72,27,291,49,497,36,726,19,1228
_info
{"project":"app01-preschool","branch":"master","version":37,"versionDate":"2024-05-22T09:40:36.000Z","fromVersion":0,"reset":true,"checksumDocs":"81-41219"}
pages/_shared/calcNavCategory/calc.ls
(function(){
return function(){
if (deviceLog['var']("enableLearnBetaTab")) {
return "learnBeta";
} else {
return "content";
}
};
})();
pages/_shared/calcPreschoolShapeBlockStats/calc.ls
(function(){
return function(block){
var levels, res$, i$, ref$, len$, i, level, e, firstUndoneLevel, l, totalDone, stats;
res$ = [];
for (i$ = 0, len$ = (ref$ = block.levels).length; i$ < len$; ++i$) {
i = i$;
level = ref$[i$];
e = typeof log != 'undefined' && log !== null ? log.findLast({
event: "finishLevel",
puid: level.puid
}) : void 8;
res$.push({
index: i,
indexId: i + 1,
level: level,
isDone: e != null
});
}
levels = res$;
firstUndoneLevel = _.find(levels, function(l){
return !l.isDone;
});
for (i$ = 0, len$ = levels.length; i$ < len$; ++i$) {
l = levels[i$];
l.isLocked = !(l.isDone || l === firstUndoneLevel);
}
totalDone = _.filter(levels, {
isDone: true
}).length;
stats = {
levels: levels,
totalDone: totalDone,
allDone: totalDone === levels.length
};
inc("setDebugPreschoolViewMode/set")(stats);
return stats;
};
})();
pages/_shared/calcPreschoolShapeBlockStats/setDebugPreschoolViewMode/set.ls
(function(){
return function(status){
var m, i$, ref$, len$, l;
m = app.debugPreschoolMode;
if (!m || m === "normal") {} else if (m === "unlocked") {
for (i$ = 0, len$ = (ref$ = status.levels).length; i$ < len$; ++i$) {
l = ref$[i$];
l.isLocked = false;
}
return status.totalDone = 1;
} else if (m === "solved") {
for (i$ = 0, len$ = (ref$ = status.levels).length; i$ < len$; ++i$) {
l = ref$[i$];
l.isLocked = false;
l.isDone = true;
}
status.totalDone = 4;
return status.allDone = true;
}
};
})();
pages/_shared/defaultBlockSvg/svg.svg
pages/_shared/loadShapeSvg/load.ls
(function(){
return function(p){
var svgPath, ref$, fileId, fileFolder, etag, ref1$, ref2$;
svgPath = ((ref$ = p.shapeSvg) != null ? ref$.path : void 8) || p.shapeSvg;
if (!svgPath) {
return p.onLoaded(path("/pages/_shared/defaultBlockSvg/svg.svg"));
}
fileId = "svg/" + svgPath.substr(4);
fileFolder = "content/" + p.project + "/_svgs";
etag = ((ref1$ = p.shapeSvg) != null ? ref1$.etag : void 8) || "latest";
return inc("/../app01/lib/util/downloadContentFile/download")({
fileId: fileId,
fileFolder: fileFolder,
etag: etag,
returnFileContent: (ref2$ = p.returnFileContent) != null ? ref2$ : false,
onError: p.onError,
onLoaded: p.onLoaded
});
};
})();
pages/_shared/topDebugMenu/menu.ls
(function(){
return function(page){
var tap, div, c;
if (!engine.isDebug) {
return;
}
tap = function(){
return inc("menu/menu")(page, div);
};
return div = Div({
display: "flex",
position: "absolute",
bottom: "0.35em",
right: 0,
color: c = Color.grey[450],
padding: "0.45em",
fontSize: "0.8em"
}).html(SvgIcon({
svg: path("/../app01/lib/svg/shape/debug.svg"),
color: c
}), SvgIcon({
svg: path("/../app01/lib/svg/shape/dots-vertical.svg"),
color: c,
size: "0.8em"
})).tap(tap);
};
})();
pages/_shared/topDebugMenu/menu/itemBlockLevelScreenshots/item.ls
(function(){
return function(page){
return {
label: "Render level screenshots",
tap: function(){
return inc("loadDebugPage/load")(page);
}
};
};
})();
pages/_shared/topDebugMenu/menu/itemBlockLevelScreenshots/loadDebugPage/load.ls
(function(){
return function(page){
var project;
project = {
name: "app01-debug-pages",
branch: "develop",
server: "https://ide-server.solocode.com"
};
return inc("/../app01/lib/util/loadProject/load")(project, function(){
return startPage({
path: path("/../app01-debug-pages/pages/debug-pages/blockLevelScreenshots/page"),
params: _.omit(page.params, "history")
});
});
};
})();
pages/_shared/topDebugMenu/menu/itemBlockPath/item.ls
(function(){
return function(page){
var a, p, div;
a = page.block.path.split("/remote_");
p = a[1] || a[0];
div = Div({
color: Color.grey[500],
fontSize: "0.7em",
padding: "0.5em 0.9em",
borderTop: "1px solid " + Color.grey[200],
wordWrap: "break-word",
maxWidth: "20em",
userSelect: "text"
}).html(p).tap({
up: function(){},
animation: "none"
}).css({
cursor: "text"
});
return {
div: div
};
};
})();
pages/_shared/topDebugMenu/menu/itemResetBlockLevels/item.ls
(function(){
return function(page){
return {
label: "Reset block levels",
tap: function(){
return inc("submit/submit")(page);
}
};
};
})();
pages/_shared/topDebugMenu/menu/itemResetBlockLevels/submit/submit.ls
(function(){
return function(page){
var levelPuids, logId;
levelPuids = _.map(page.block.levels, "puid");
logId = log.id();
return inc("/../app01/lib/util/pllsCall/call")({
path: path("/../server-apis-db2/apis/user/resetLevels/reset"),
params: {
logId: logId,
levelPuids: levelPuids
},
onError: function(error){
return debug("error", error);
},
onOffline: function(){
return inc("/../app01/lib/offline/offlinePopup/popup")();
},
onCompleted: function(result){
if (result.status !== "ok") {
return debug("error", result);
} else {
return log.sync(function(){
return startPage({
history: 0
});
});
}
}
});
};
})();
pages/_shared/topDebugMenu/menu/menu.ls
(function(){
return function(page, div){
var tap, items, res$, i$, ref$, len$;
tap = function(n){
app.debugPreschoolMode = n;
return startPage({
history: 0
});
};
res$ = [];
for (i$ = 0, len$ = (ref$ = ["normal", "unlocked", "solved"]).length; i$ < len$; ++i$) {
res$.push((fn$.call(this, ref$[i$])));
}
items = res$;
if (page.block) {
items.push(inc("itemResetBlockLevels/item")(page));
items.push(inc("itemBlockLevelScreenshots/item")(page));
items.push(inc("itemBlockPath/item")(page));
} else {
items.push(inc("testSurvey/test")(page));
}
return OverlayMenu({
referenceDiv: div,
items: items,
direction: "down left",
adjustXY: "6 -6"
});
function fn$(s){
return {
label: "Shapes " + s,
tap: function(){
return tap(s);
}
};
}
};
})();
pages/_shared/topDebugMenu/menu/testSurvey/test.ls
(function(){
return function(page){
var p, id;
p = inc("/pages/plan/list/row/blocksRow/blockShape/tap/surveyPath/path")();
id = _.nth(p.split("/"), -2);
return {
label: "Survey: " + id,
tap: function(){
return inc("/../app01/lib/util/survey/survey")({
surveyPath: p,
checkDoneEvents: false,
logEvents: false,
onEnded: function(surveyStatus, surveyResult){
debug(surveyResult);
if (surveyStatus === "completed") {
return startPage({
history: -1
});
}
}
});
}
};
};
})();
pages/_shared/topFocusMode/_t.ls
(function(){
return {
tip: {
de: "Tipp",
en: "Hint",
fr: "Aide",
es: "Ayuda",
pt: "Dica"
},
focus: {
de: "Fokus",
en: "Focus",
fr: "Focus",
es: "Foco",
pt: "Foco"
},
popupEnable: {
de: "Mit dem Fokus-Modus kannst du Ablenkungen für dein Kind vermeiden. Wenn er aktiviert wird, ist das Verlassen des Puzzle-Bereichs nur nach Lösen einer Rechenaufgabe möglich.",
en_gb: "With focus mode, you can avoid distractions for your child. When activated, it is only possible to leave the puzzle area by solving a maths problem.",
en: "With focus mode, you can avoid distractions for your child. When activated, it is only possible to leave the puzzle area by solving a math problem.",
fr: "Le mode Focus te permet d'éviter les distractions pour que ton enfant puisse se concentrer. Une fois le mode activé, le seul moyen de quitter l'écran des puzzles est de résoudre un problème de maths.",
es: "Con el modo Foco evitas distracciones para tus niños/as. Cuando está activado, sólo se puede abandonar el área de rompecabezas después de resolver una operación.",
pt: "Com o modo Foco você pode evitar distrações para sua criança. Quando ativado, só é possível sair da área de quebra-cabeças após resolver um problema de matemática."
},
popupDisable: {
de: "Möchtest du den Fokus-Modus wieder deaktivieren?",
en: "Would you like to deactivate focus mode?",
fr: "Veux-tu désactiver le mode Focus ?",
es: "¿Quieres desactivar el modo Foco?",
pt: "Você gostaria de desativar o modo Foco?"
},
activate: {
de: "Aktivieren",
en: "Activate",
fr: "Activer",
es: "Activar",
pt: "Ativar"
},
deactivate: {
de: "Deaktivieren",
en: "Deactivate",
fr: "désactiver",
es: "Desactivar",
pt: "Desativar"
},
cancel: {
de: "Abbrechen",
en: "Cancel",
fr: "Annuler",
es: "Cancelar",
pt: "Cancelar"
}
};
})();
pages/_shared/topFocusMode/check/check.ls
(function(){
return function(e){
return SvgIcon({
color: Color.grey[800],
size: "0.9em",
svg: e != null && e.value
? path("/../app01/lib/svg/icon/check-on.svg")
: path("/../app01/lib/svg/icon/check-off.svg")
});
};
})();
pages/_shared/topFocusMode/focusMode.ls
(function(){
return function(page){
var e, tap;
if (engine.isBotMode) {
return;
}
e = typeof log != 'undefined' && log !== null ? log.findLast("setPreschoolFocusModeEnabled") : void 8;
tap = function(){
return inc("popup/popup")(e);
};
return Div({
display: "flex",
position: "absolute",
top: 0,
right: 0,
height: "2.2em",
padding: "0 0.4em"
}).html(inc("tip/tip")(e), inc("label/label")(e), inc("check/check")(e)).tap({
animation: "none",
up: tap
});
};
})();
pages/_shared/topFocusMode/label/label.ls
(function(){
return function(e){
return Div({
color: Color.grey[800],
margin: "0 0.3em",
fontSize: "0.85em"
}).html(T("focus"));
};
})();
pages/_shared/topFocusMode/popup/popup.ls
(function(){
return function(e){
var enabled, ref$, onConfirm, submit;
enabled = (ref$ = e != null ? e.value : void 8) != null ? ref$ : false;
onConfirm = function(){
return inc("/../app01/lib/gui/parentalGatePreschool/parentalGate")(submit);
};
submit = function(){
if (e) {
log.deleteEvent(e);
}
log.log({
event: "setPreschoolFocusModeEnabled",
value: !enabled
});
return startPage({
history: 0
});
};
return inc("/../app01/lib/gui/confirmPopup/popup")(enabled
? {
label: T("popupDisable"),
yesLabel: T("deactivate"),
noLabel: T("cancel"),
onConfirm: onConfirm
}
: {
label: T("popupEnable"),
yesLabel: T("activate"),
noLabel: T("cancel"),
onConfirm: onConfirm
});
};
})();
pages/_shared/topFocusMode/tip/tip.ls
(function(){
return function(e){
if (e != null && e.value) {
return;
}
return Div({
background: Color.blue[400],
padding: "0em 0.2em",
color: "white",
borderRadius: "3px",
fontSize: "0.85em"
}).html(T("tip"));
};
})();
pages/block/_topbar/topbar.ls
(function(){
return function(page){
var div, ref$, ref1$;
div = inc("/../app01/addons/topbar2/topbar")({
back: true,
title: (ref$ = (ref1$ = page.block) != null ? ref1$.title : void 8) != null ? ref$ : " "
}).append(inc("/pages/_shared/topFocusMode/focusMode")(page), inc("/pages/_shared/topDebugMenu/menu")(page));
div.update = function(){
return div.replaceWith(inc(THISFILE)(page));
};
return div;
};
})();
pages/block/calcPlanDescription/calc.ls
(function(){
return function(page){
var p;
p = page.params;
return inc("/../app01/data/content/calcPlanDescription/calc")(p.blockPath || "/../" + p.blockPuid);
};
})();
pages/block/calcStats/calc.ls
(function(){
var lastStatsCache;
lastStatsCache = undefined;
return function(page){
var block, lastStats, stats, i$, ref$, len$, l, i, llast;
block = page.block;
lastStats = page.params.history < 1 ? lastStatsCache : void 8;
stats = inc("/pages/_shared/calcPreschoolShapeBlockStats/calc")(block);
if (page.params.shapeStatus === "solved") {
for (i$ = 0, len$ = (ref$ = stats.levels).length; i$ < len$; ++i$) {
l = ref$[i$];
l.isDone = true;
l.isLocked = false;
}
stats.totalDone = stats.levels.length;
stats.allDone = true;
return stats;
}
if (lastStats) {
for (i$ = 0, len$ = (ref$ = stats.levels).length; i$ < len$; ++i$) {
i = i$;
l = ref$[i$];
llast = lastStats.levels[i];
if (l.isDone !== llast.isDone) {
l.isDoneIsNew = true;
if (stats.allDone) {
stats.allDoneIsNew = true;
}
}
}
}
lastStatsCache = stats;
return stats;
};
})();
pages/block/loadBlock/load.ls
(function(){
return function(p){
var params;
params = p.page.params;
return inc("/../app01/lib/util/loadBlock/load")({
path: params.blockPath,
puid: params.blockPuid,
idePreview: params.context === "idePreview",
fileApi: deviceLog['var']("loadDevelopContent") ? "filesCalcDevelop" : "files",
onLoaded: function(block){
p.page.block = block;
p.page.topbar.update();
return p.onLoaded();
},
onError: function(error){
var techError;
techError = error.error !== "offline";
return inc("/../app01/lib/offline/offlinePage/offlinePage")(p.page, void 8, techError);
}
});
};
})();
pages/block/loadSvg/load.ls
(function(){
return function(page, onDone){
var onError, onLoaded;
onError = function(error){
page.svg = path("/pages/_shared/defaultBlockSvg/svg.svg");
return onDone(error);
};
onLoaded = function(svg){
page.svg = svg;
return onDone();
};
return inc("/pages/_shared/loadShapeSvg/load")({
shapeSvg: page.block.shapeSvg,
project: page.block.path.split("/")[2],
returnFileContent: true,
onLoaded: onLoaded,
onError: onError
});
};
})();
pages/block/lockIcons/icons.ls
(function(){
return function(page){
var level;
return Div({
position: "absolute",
left: 0,
top: 0,
right: 0,
bottom: 0,
pointerEvents: "none"
}).html((function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = page.shapeStats.levels).length; i$ < len$; ++i$) {
level = ref$[i$];
results$.push(inc("lockIcon/icon")(page, level));
}
return results$;
}()));
};
})();
pages/block/lockIcons/lockIcon/icon.ls
(function(){
return function(page, level){
var updatePosition, svg;
updatePosition = function(){
var el, o1, o2, o3, left, top;
el = page.shape.findFirst('#lock' + level.indexId);
o1 = el.offset();
o2 = page.shape.offset();
o3 = svg.offset();
left = o1.left - o2.left - o3.width / 2 + o1.width / 2;
top = o1.top - o2.top + o1.height / 2 - o3.height / 2;
return svg.css({
top: top + "px",
left: left + "px"
});
};
return svg = SvgIcon({
svg: path("/../app01/lib/svg/shape/lock.svg"),
color: Color.grey[350],
size: "2em"
}).css({
position: "absolute"
}).attr({
id: "lockIcon" + level.indexId
}).onDomAppend(function(){
return updatePosition();
});
};
})();
pages/block/page.ls
(function(){
return function(page){
page.enablePreschoolFocus = true;
page.planDescription = inc("calcPlanDescription/calc")(page);
return {
navCategory: inc("../_shared/calcNavCategory/calc")(),
top: function(){
return inc("_topbar/topbar")(page);
},
urlDescription: function(){
return inc("/../app01/pages/content/block/_urlDescription/description")(page);
},
start: function(){
var loadBlock, calcStats, loadSvg, create;
loadBlock = function(){
return inc("loadBlock/load")({
page: page,
onLoaded: calcStats
});
};
calcStats = function(){
page.shapeStats = inc("calcStats/calc")(page);
return loadSvg();
};
loadSvg = function(){
return inc("loadSvg/load")(page, create);
};
create = function(){
page.updateUrlDescription();
page.html(page.shape = inc("shape/shape")(page).append(inc("pinAvatar/pin")(page), inc("lockIcons/icons")(page)));
return requestAnimationFrame(function(){
return inc("updateAndAnimate/updateAndAnimate")(page);
});
};
page.html(inc("/../app01/lib/gui/spinner/spinner")());
return loadBlock();
}
};
};
})();
pages/block/pinAvatar/circle/avatar/avatar.ls
(function(){
return function(){
var ad, ref$, avatar;
ad = (ref$ = log.findLast("setAvatar")) != null ? ref$.value : void 8;
return avatar = inc("/../app01/lib/gui/avatar/avatar")(ad, "half").css({
width: "3.6em",
height: "3.6em",
borderRadius: "999px"
});
};
})();
pages/block/pinAvatar/circle/circle.ls
(function(){
return function(){
return Div({
display: "flex",
width: "4em",
height: "4em",
borderRadius: "999px",
border: "4px solid " + Color.grey[500],
background: Color.grey[400],
zIndex: 1
}).html(inc("avatar/avatar")());
};
})();
pages/block/pinAvatar/pin.ls
(function(){
return function(page){
var lastElement, positionOn, div;
lastElement = undefined;
positionOn = function(el){
var o1, o2, o3, left, top;
lastElement = el;
div.show();
o1 = el.offset();
o2 = page.shape.offset();
o3 = div.offset();
left = o1.left - o2.left - o3.width / 2 + o1.width / 2;
top = o1.top - o2.top - o3.height + o1.height / 2;
return div.css({
top: top + "px",
left: left + "px"
});
};
div = Div({
position: "absolute",
display: "flex",
flexDirection: "column",
zIndex: "1",
filter: 'drop-shadow(0 0 0.5em rgba(0, 0, 0, 0.2))',
pointerEvents: "none"
}).attr({
id: "pinAvatar"
}).html(inc("circle/circle")(), inc("triangle/triangle")()).keyframeAnimate({
keyframes: {
"0%": {
transform: "translateY(0px)"
},
"35%": {
transform: "translateY(-10px)"
},
"70%": {
transform: "translateY(0px)"
},
"100%": {
transform: "translateY(0px)"
}
},
duration: 2500,
iterationCount: 999,
delay: 200,
timing: "linear"
}).hide().onWindowResize(function(){
if (lastElement) {
return positionOn(lastElement);
}
});
div.positionOn = positionOn;
return div;
};
})();
pages/block/pinAvatar/triangle/triangle.ls
(function(){
return function(){
return SvgIcon({
svg: path("triangle.svg"),
size: "2em",
color: Color.grey[500]
}).css({
marginTop: "-1em"
});
};
})();
pages/block/pinAvatar/triangle/triangle.svg
pages/block/shape/calcSize/calc.ls
(function(){
return function(){
var s;
s = body.offsetHeight * 0.5;
s = Math.min(s, body.offsetWidth * 0.8);
s = Math.max(200, s);
s = Math.min(500, s);
s = _.round(s);
return s + "px";
};
})();
pages/block/shape/shape.ls
(function(){
return function(page){
var size, shape, i$, ref$, len$, i, level;
size = inc("calcSize/calc")();
shape = Svg({
svg: page.svg
}).css({
width: size,
height: size
});
for (i$ = 0, len$ = (ref$ = page.block.levels).length; i$ < len$; ++i$) {
i = i$;
level = ref$[i$];
inc("tapLevel/tap")(page, level, i, shape);
}
return page.shape = shape;
};
})();
pages/block/shape/tapLevel/hoverOff/off.ls
(function(){
return function(partEl){
var fill;
fill = partEl.originalFill;
if (fill === "transparent") {
return partEl.attr({
fill: fill
});
} else {
return partEl.css({
opacity: 1
});
}
};
})();
pages/block/shape/tapLevel/hoverOn/on.ls
(function(){
return function(partEl){
var fill;
fill = partEl.attr("fill");
partEl.originalFill = fill;
if (fill === "transparent") {
return partEl.attr({
fill: "rgba(255,255,255,0.25)"
});
} else {
return partEl.css({
opacity: 0.7
});
}
};
})();
pages/block/shape/tapLevel/tap.ls
(function(){
return function(page, level, i, shape){
var partEl;
partEl = shape.findFirst('#part' + (i + 1));
partEl.startLevel = function(){
return startPage({
path: path("/../app01/pages/level/play/page"),
animation: "fadeIn",
params: {
levelPath: level.path,
context: "preschoolShape"
}
});
};
return partEl.tap({
cancel: function(){
return inc("hoverOff/off")(partEl);
},
down: function(){
return inc("hoverOn/on")(partEl);
},
up: function(){
inc("hoverOff/off")(partEl);
return partEl.startLevel();
}
});
};
})();
pages/block/updateAndAnimate/animateAllDoneIsNew/animate.ls
(function(){
return function(f, stats, page){
var onTimeout;
onTimeout = function(){
var i$, ref$, len$, level;
f("outline").hide();
for (i$ = 0, len$ = (ref$ = stats.levels).length; i$ < len$; ++i$) {
level = ref$[i$];
f("part" + level.indexId).attr({
fill: "transparent"
});
}
f("solution").fadeIn(1000);
return f("pinAvatar").hide();
};
setTimeout(onTimeout, 1000);
return setTimeout(function(){
return inc("backPinAvatar/pin")(page);
}, 3000);
};
})();
pages/block/updateAndAnimate/animateAllDoneIsNew/backPinAvatar/circle/avatar/avatar.ls
(function(){
return function(){
var ad, ref$, avatar;
ad = (ref$ = log.findLast("setAvatar")) != null ? ref$.value : void 8;
return avatar = inc("/../app01/lib/gui/avatar/avatar")(ad, "half").css({
width: "3.6em",
height: "3.6em",
borderRadius: "999px"
});
};
})();
pages/block/updateAndAnimate/animateAllDoneIsNew/backPinAvatar/circle/circle.ls
(function(){
return function(){
return Div({
display: "flex",
width: "4em",
height: "4em",
borderRadius: "999px",
border: "4px solid " + Color.grey[500],
background: Color.grey[400],
zIndex: 1
}).html(inc("avatar/avatar")());
};
})();
pages/block/updateAndAnimate/animateAllDoneIsNew/backPinAvatar/pin.ls
(function(){
return function(page){
var div;
div = Div({
position: "absolute",
display: "flex",
flexDirection: "column",
zIndex: "1",
filter: 'drop-shadow(0 0 0.5em rgba(0, 0, 0, 0.2))',
top: "40px",
left: "20px"
}).attr({
id: "pinAvatar"
}).html(inc("triangle/triangle")(), inc("circle/circle")()).keyframeAnimate({
keyframes: {
"0%": {
transform: "translateY(0px)"
},
"35%": {
transform: "translateY(-10px)"
},
"70%": {
transform: "translateY(0px)"
},
"100%": {
transform: "translateY(0px)"
}
},
duration: 2500,
iterationCount: 999,
delay: 200,
timing: "linear"
}).appendTo(page.topbar).fadeIn(1000).tap({
animation: "none",
up: function(){
div.hide();
return startPage({
history: -1,
animation: "slideRight"
});
}
});
return div;
};
})();
pages/block/updateAndAnimate/animateAllDoneIsNew/backPinAvatar/triangle/triangle.ls
(function(){
return function(){
return SvgIcon({
svg: path("triangle.svg"),
size: "2em",
color: Color.grey[500]
}).css({
marginBottom: "-1em",
transform: "rotate(180deg)"
});
};
})();
pages/block/updateAndAnimate/animateAllDoneIsNew/backPinAvatar/triangle/triangle.svg
pages/block/updateAndAnimate/animateNewDoneLevel/animate.ls
(function(){
return function(f, newDoneLevel){
var partEl;
partEl = f("part" + newDoneLevel.indexId).fadeIn(1000);
return inc("playSound/play")();
};
})();
pages/block/updateAndAnimate/animateNewDoneLevel/playSound/play.ls
(function(){
return function(){
var v, sound;
v = inc("/../app01/data/user/audioVolume/get")();
sound = inc("/../app01/lib/util/sound/sound")({
base64: inc("/../sounds/finish4.mp3.base64"),
isSoundEffect: true,
volume: v * 0.07
});
return setTimeout(sound.play, 300);
};
})();
pages/block/updateAndAnimate/updateAllDone/update.ls
(function(){
return function(f, stats){
var i$, ref$, len$, level, results$ = [];
f("solution").css({
opacity: 1
});
for (i$ = 0, len$ = (ref$ = stats.levels).length; i$ < len$; ++i$) {
level = ref$[i$];
results$.push(f("part" + level.indexId).attr({
fill: "transparent"
}));
}
return results$;
};
})();
pages/block/updateAndAnimate/updateAndAnimate.ls
(function(){
return function(page){
var stats, newDoneLevel, todoLevel, f;
stats = page.shapeStats;
newDoneLevel = _.find(stats.levels, {
isDoneIsNew: true
});
todoLevel = _.find(stats.levels, {
isDone: false
});
f = function(n){
return page.findFirst('#' + n);
};
inc("updateHelpers/update")(f);
inc("updateLevels/update")(f, stats);
inc("updatePinAvatar/update")(f, stats, todoLevel);
if (newDoneLevel) {
inc("animateNewDoneLevel/animate")(f, newDoneLevel);
}
if (stats.allDoneIsNew) {
return inc("animateAllDoneIsNew/animate")(f, stats, page);
} else if (stats.allDone) {
return inc("updateAllDone/update")(f, stats);
}
};
})();
pages/block/updateAndAnimate/updateHelpers/update.ls
(function(){
return function(f){
var i$, ref$, len$, n, results$ = [];
for (i$ = 0, len$ = (ref$ = ["dots", "locks", "solution"]).length; i$ < len$; ++i$) {
n = ref$[i$];
results$.push(f(n).css({
opacity: 0,
pointerEvents: "none"
}));
}
return results$;
};
})();
pages/block/updateAndAnimate/updateLevels/update.ls
(function(){
return function(f, stats){
var i$, ref$, len$, level, results$ = [];
for (i$ = 0, len$ = (ref$ = stats.levels).length; i$ < len$; ++i$) {
level = ref$[i$];
f("part" + level.indexId).attr({
stroke: "rgba(0,0,0,0.06)",
fill: level.isDone
? f("dot" + level.indexId).attr("fill")
: Color.grey[200]
});
if (!level.isLocked) {
f("lockIcon" + level.indexId).css({
opacity: 0
});
}
if (level.isLocked) {
results$.push(f("part" + level.indexId).css({
pointerEvents: "none"
}));
}
}
return results$;
};
})();
pages/block/updateAndAnimate/updatePinAvatar/update.ls
(function(){
return function(f, stats, todoLevel){
if (stats.allDone) {
return;
}
return f("pinAvatar").positionOn(f("lockIcon" + todoLevel.indexId)).css({
pointerEvents: "auto"
}).tap({
animation: "none",
up: function(){
return f("part" + todoLevel.indexId).startLevel();
}
});
};
})();
pages/plan/_topbar/params/params.ls
(function(){
return function(page){
var p, params, ref$, ref1$;
if (deviceLog['var']("enableLearnBetaTab")) {
return inc("paramsLearnTabBeta")(page);
}
p = inc("/../app01/pages/content/plan/_topbar/params/params")(page);
return params = {
title: (ref$ = (ref1$ = page.plan) != null ? ref1$.title : void 8) != null ? ref$ : " ",
menu: p.menu,
menuLabel: p.menuLabel
};
};
})();
pages/plan/_topbar/params/paramsLearnTabBeta.ls
(function(){
return function(page){
var p, params, ref$, ref1$, lastPagePath;
p = inc("/../app01/pages/content/plan/_topbar/params/params")(page);
params = {
title: (ref$ = (ref1$ = page.plan) != null ? ref1$.title : void 8) != null ? ref$ : " ",
menu: p.menu,
menuLabel: p.menuLabel
};
params.back = true;
lastPagePath = app.pageHistory[app.pageHistory.length - 2].path;
if (_.endsWith(lastPagePath, "learn/page")) {
params.backLabel = SvgIcon({
svg: path("/../app01/lib/svg/shape/home.svg"),
color: Color.grey[650],
size: "0.9em"
}).css({
padding: "0.6em 0 0.4em"
});
}
return params;
};
})();
pages/plan/_topbar/topbar.ls
(function(){
return function(page){
var div;
div = inc("/../app01/addons/topbar2/topbar")(inc("params/params")(page)).append(inc("/pages/_shared/topFocusMode/focusMode")(page), inc("/pages/_shared/topDebugMenu/menu")(page));
div.update = function(){
return div.replaceWith(inc(THISFILE)(page));
};
return div;
};
})();
pages/plan/calcTodoBlock/calc.ls
(function(){
return function(page, onDone){
var blocks, i$, len$, i, b, e, ref$, lastBlock, todoBlock, ref1$, ref2$, l;
blocks = page.plan.topics[0].blocks;
if (engine.isBotMode) {
page.todoBlock = {
allBlocksDone: true
};
onDone();
return;
}
for (i$ = 0, len$ = blocks.length; i$ < len$; ++i$) {
i = i$;
b = blocks[i$];
b.index = i;
b.hasLastEvent = false;
e = log.findLast({
event: "finishLevel",
puid: (ref$ = _.last(b.levels)) != null ? ref$.puid : void 8
});
if (e) {
b.hasLastEvent = true;
}
}
lastBlock = _.last(_.filter(blocks, {
hasLastEvent: true
}));
todoBlock = !lastBlock
? blocks[0]
: lastBlock !== _.last(blocks)
? blocks[lastBlock.index + 1]
: {
allBlocksDone: true,
index: _.last(blocks).index + 1
};
for (i$ = 0, len$ = (ref1$ = (ref2$ = todoBlock.levels) != null
? ref2$
: []).length; i$ < len$; ++i$) {
l = ref1$[i$];
e = log.findLast({
event: "finishLevel",
puid: l.puid
});
if (!e) {
todoBlock.todoLevel = l;
break;
}
}
page.todoBlock = todoBlock;
return onDone();
};
})();
pages/plan/list/calcCssShapeSize/calc.ls
(function(){
return function(page){
var w, s, h;
w = body.offsetWidth * 0.95;
s = _.round(w / 3);
s = Math.min(s, 200);
h = _.round(body.offsetHeight * 0.5);
s = Math.min(s, h);
return page.cssVar({
shapeSize: s + "px"
});
};
})();
pages/plan/list/calcListData/calc.ls
(function(){
return function(page){
var blocks, i$, ref$, len$, t, j$, ref1$, len1$, b, listData, c;
blocks = [];
for (i$ = 0, len$ = (ref$ = page.plan.topics).length; i$ < len$; ++i$) {
t = ref$[i$];
for (j$ = 0, len1$ = (ref1$ = t.blocks).length; j$ < len1$; ++j$) {
b = ref1$[j$];
if (!b.error || engine.isDebug) {
blocks.push(b);
}
}
}
return listData = _.concat({
rowType: "header"
}, (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = _.chunk(blocks, 3)).length; i$ < len$; ++i$) {
c = ref$[i$];
results$.push({
rowType: "blocks",
blocks: c
});
}
return results$;
}()), {
rowType: "footer"
});
};
})();
pages/plan/list/calcListPositionTodoBlock/calc.ls
(function(){
return function(page){
var i$, ref$, len$, i, d, j$, ref1$, len1$, b;
for (i$ = 0, len$ = (ref$ = page.listData).length; i$ < len$; ++i$) {
i = i$;
d = ref$[i$];
for (j$ = 0, len1$ = (ref1$ = d.blocks || []).length; j$ < len1$; ++j$) {
b = ref1$[j$];
if (b === page.todoBlock) {
return {
rowIndex: i,
bottomOffset: 100
};
}
}
}
return {
rowIndex: 0,
topOffset: 0
};
};
})();
pages/plan/list/list.ls
(function(){
var lastListPosition;
lastListPosition = null;
return function(page){
var calcCssShapeSize, list;
page.listData = inc("calcListData/calc")(page);
calcCssShapeSize = function(){
return inc("calcCssShapeSize/calc")(page);
};
list = ListDiv({
data: page.listData,
row: inc("row/row")(page),
nearScopeSize: 0.5,
nearScopeDelay: 1000,
debug: false,
scopeRender: {
enabled: true,
debug: false,
maxDurations: "200 5 5",
nearScopeSize: 0.5
},
listPosition: lastListPosition && page.params.history < 0
? lastListPosition
: inc("calcListPositionTodoBlock/calc")(page)
}).css({
height: "var(--centerHeight)"
}).onElementClass("onPageFinish", function(){
return lastListPosition = page.list.getListPosition();
}).onWindowResize(function(){
calcCssShapeSize();
return requestAnimationFrame(function(){
return list.repositionCurrentRows();
});
});
calcCssShapeSize();
return page.list = list;
};
})();
pages/plan/list/row/blocksRow/blockShape/blockShape.ls
(function(){
return function(page, block){
var stats, loadSvg, onLoadError, onLoaded, tap, div;
stats = inc("calcStats/calc")(page, block);
loadSvg = function(){
return inc("/pages/_shared/loadShapeSvg/load")({
shapeSvg: block.shapeSvg,
project: block.path.split("/")[2],
returnFileContent: true,
onLoaded: onLoaded,
onError: onLoadError
});
};
onLoadError = function(error){
var svg;
svg = path("/pages/_shared/defaultBlockSvg/svg.svg");
return onLoaded(svg);
};
onLoaded = function(svg){
return div.html(inc("shape/shape")(block, svg, stats), inc("debugShapeSvgMissing/div")(page, block), block === page.todoBlock ? inc("pinAvatar/pin")(page, block, div) : void 8);
};
tap = function(){
return inc("tap/tap")(page, block, stats);
};
return div = Div({
display: "flex",
width: "var(--shapeSize)",
height: "calc(var(--shapeSize) + 5px)"
}).tap(stats.status !== "locked" && !engine.isBotMode ? tap : void 8).onScopeRender(function(){
if (block.error) {
return div.html(inc("errorBlockDiv/div")(block));
} else if (stats.status === "locked") {
return div.html(inc("lockedIcon/icon")());
} else {
return loadSvg();
}
});
};
})();
pages/plan/list/row/blocksRow/blockShape/calcStats/calc.ls
(function(){
return function(page, block){
var stats, m, todoIndex;
stats = inc("/pages/_shared/calcPreschoolShapeBlockStats/calc")(block);
stats.isLocked = stats.totalDone === 0 && block !== page.todoBlock.block;
m = app.debugPreschoolMode;
todoIndex = page.todoBlock.index;
stats.status = m === "unlocked"
? "todo"
: m === "solved"
? "solved"
: block.index === todoIndex
? "todo"
: block.index < todoIndex
? "solved"
: block.index > todoIndex ? "locked" : void 8;
return stats;
};
})();
pages/plan/list/row/blocksRow/blockShape/debugShapeSvgMissing/div.ls
(function(){
return function(page, block){
if (!engine.isDebug) {
return;
}
if (block.shapeSvg) {
return;
}
return Div({
display: "flex",
position: "absolute",
top: "82%",
left: 0,
right: 0,
color: Color.grey[400],
fontSize: "0.7em"
}).html(SvgIcon({
svg: path("/../app01/lib/svg/shape/debug.svg"),
color: Color.grey[400]
}).css({
marginRight: "0.2em"
}), "shapeSvg missing");
};
})();
pages/plan/list/row/blocksRow/blockShape/errorBlockDiv/div.ls
(function(){
return function(block){
return Div({
color: Color.red[400],
fontSize: "0.7em",
flex: "1 1 auto",
maxHeight: "100%",
overflow: "hidden"
}).html(block.error);
};
})();
pages/plan/list/row/blocksRow/blockShape/errorLoadDiv/div.ls
(function(){
return function(error){
return SvgIcon({
svg: path("/pages/_shared/defaultBlockSvg/svg.svg"),
size: "50%"
}).css({
opacity: 0.15
});
};
})();
pages/plan/list/row/blocksRow/blockShape/lockedIcon/icon.ls
(function(){
return function(){
return SvgIcon({
svg: path("/../app01/lib/svg/shape/lock.svg"),
color: Color.grey[200]
}).css({
width: "40%",
height: "40%"
});
};
})();
pages/plan/list/row/blocksRow/blockShape/pinAvatar/circle/avatar/avatar.ls
(function(){
return function(){
var ad, ref$, avatar;
ad = (ref$ = log.findLast("setAvatar")) != null ? ref$.value : void 8;
return avatar = inc("/../app01/lib/gui/avatar/avatar")(ad, "half").css({
width: "2.6em",
height: "2.6em",
borderRadius: "999px"
});
};
})();
pages/plan/list/row/blocksRow/blockShape/pinAvatar/circle/circle.ls
(function(){
return function(){
return Div({
display: "flex",
width: "3em",
height: "3em",
borderRadius: "999px",
border: "4px solid " + Color.grey[500],
background: Color.grey[400],
zIndex: 1
}).html(inc("avatar/avatar")());
};
})();
pages/plan/list/row/blocksRow/blockShape/pinAvatar/pin.ls
(function(){
return function(page, block, parentDiv){
var map, updatePosition, div;
map = page.map;
updatePosition = function(){
var l, i, el, o1, o2, o3, top, left;
l = page.todoBlock.todoLevel;
if (!l) {
div.hide();
return;
}
div.closest(".listRow").css({
zIndex: 1
});
i = _.indexOf(block.levels, l);
el = parentDiv.findFirst('#lock' + (i + 1));
o1 = el.offset();
o2 = parentDiv.offset();
o3 = div.offset();
top = o1.top - o2.top - o3.height + o1.height / 2;
left = o1.left - o2.left - o3.width / 2 + o1.width / 2;
return div.css({
top: top + "px",
left: left + "px"
});
};
return div = Div({
position: "absolute",
display: "flex",
flexDirection: "column",
zIndex: "1",
filter: 'drop-shadow(0 0 0.5em rgba(0, 0, 0, 0.2))',
pointerEvents: "none"
}).html(inc("circle/circle")(), inc("triangle/triangle")()).keyframeAnimate({
keyframes: {
"0%": {
transform: "translateY(0px)"
},
"40%": {
transform: "translateY(-10px)"
},
"80%": {
transform: "translateY(0px)"
},
"100%": {
transform: "translateY(0px)"
}
},
duration: 2000,
iterationCount: 999,
delay: 200,
timing: "linear"
}).onDomAppend(function(){
return updatePosition();
}).onWindowResize(function(){
return updatePosition();
}).fadeIn();
};
})();
pages/plan/list/row/blocksRow/blockShape/pinAvatar/triangle/triangle.ls
(function(){
return function(){
return SvgIcon({
svg: path("triangle.svg"),
size: "1.7em",
color: Color.grey[500]
}).css({
marginTop: "-1em"
});
};
})();
pages/plan/list/row/blocksRow/blockShape/pinAvatar/triangle/triangle.svg
pages/plan/list/row/blocksRow/blockShape/shape/findInSvg/find.ls
(function(){
return function(n, svg, block){
var el;
el = svg.findFirst(n);
if (!el) {
if (engine.isDebug) {
setTimeout(function(){
return svg.parent().append(Div({
position: "absolute",
bottom: 0,
left: 0,
color: Color.red[500],
fontSize: "0.6em"
}).html("Svg " + n + " missing"));
});
}
el = Div();
}
return el;
};
})();
pages/plan/list/row/blocksRow/blockShape/shape/level/level.ls
(function(){
return function(level, i, svg, stats){
var s, isDone, dotEl, lockEl, partEl;
s = stats;
isDone = s.levels[i].isDone;
dotEl = svg.findFirst('#dot' + (i + 1));
lockEl = svg.findFirst('#lock' + (i + 1)).css({
opacity: 0
});
return partEl = svg.findFirst('#part' + (i + 1)).attr({
stroke: "rgba(0,0,0,0.1)",
fill: isDone
? dotEl.attr("fill")
: Color.grey[200]
}).css(stats.status === "solved" ? {
opacity: 0
} : void 8);
};
})();
pages/plan/list/row/blocksRow/blockShape/shape/shape.ls
(function(){
return function(block, svg, stats){
var f, i$, ref$, len$, i, level;
svg = Svg({
svg: svg,
size: "20em"
}).css({
width: "100%",
height: "100%",
pointerEvents: "none"
});
f = function(n){
return inc("findInSvg/find")(n, svg, block);
};
f('#dots').hide();
if (stats.status === "solved") {
f('#outline path').attr({
stroke: Color.grey[300],
"stroke-width": 3
});
} else if (stats.status === "todo") {
f('#solution').hide();
f('#outline path').attr({
stroke: Color.grey[400]
});
}
for (i$ = 0, len$ = (ref$ = block.levels).length; i$ < len$; ++i$) {
i = i$;
level = ref$[i$];
inc("level/level")(level, i, svg, stats);
}
return svg;
};
})();
pages/plan/list/row/blocksRow/blockShape/tap/surveyPath/path.ls
(function(){
return function(){
return path("/../app01-surveys/pages/2023-03-22-preschool/start");
};
})();
pages/plan/list/row/blocksRow/blockShape/tap/tap.ls
(function(){
return function(page, block, stats){
var minBlockIndex, showSurvey, onSurveyEnded;
minBlockIndex = 6;
showSurvey = function(){
return inc("/../app01/lib/util/survey/survey")({
surveyPath: inc("surveyPath/path")(),
startCondition: function(){
return block.index >= minBlockIndex && engine.guiLanguage === "de" && false;
},
checkDoneEvents: true,
logEvents: true,
extraData: {
planPath: page.plan.path,
blockIndex: block.index,
minBlockIndex: minBlockIndex
},
onEnded: onSurveyEnded
});
};
onSurveyEnded = function(surveyStatus, surveyResult){
var surveyVisible;
if (surveyStatus === "aborted") {
return;
}
inc("/../app01/data/content/setCurrentBlock/set")({
planPath: page.plan.path,
blockPath: block.path
});
surveyVisible = _.includes(app.currentPagePath, "survey");
return startPage({
path: path("/pages/block/page"),
animation: surveyVisible ? "slideDown" : "slideLeft",
history: surveyVisible ? 0 : 1,
params: {
blockPath: block.path,
shapeStatus: stats.status
}
});
};
return showSurvey();
};
})();
pages/plan/list/row/blocksRow/row.ls
(function(){
return function(page, data){
var block;
return Div({
display: "flex"
}).html((function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = data.blocks).length; i$ < len$; ++i$) {
block = ref$[i$];
results$.push(inc("blockShape/blockShape")(page, block));
}
return results$;
}()));
};
})();
pages/plan/list/row/footer/row.ls
(function(){
return function(){
return Div({
height: "2em"
});
};
})();
pages/plan/list/row/header/row.ls
(function(){
return function(){
return Div({
height: "2em"
});
};
})();
pages/plan/list/row/row.ls
(function(){
return function(page){
return function(data){
var t;
t = data.rowType;
return Div().html(Div({
width: "35em",
maxWidth: "95%",
margin: "0 auto"
}).html(t === "header"
? inc("header/row")()
: t === "footer"
? inc("footer/row")()
: inc("blocksRow/row")(page, data)));
};
};
})();
pages/plan/loadAllShapeSvgs/checkExists/check.ls
(function(){
return function(shapeSvg, project, onDone){
var svgPath, fileId, fileHash, etag;
svgPath = (shapeSvg != null ? shapeSvg.path : void 8) || shapeSvg;
fileId = "svg/" + svgPath.substr(4);
fileHash = inc("/../app01/lib/util/md5/md5")(fileId).substr(0, 10);
etag = (shapeSvg != null ? shapeSvg.etag : void 8) || "latest";
return inc("/../app01/lib/util/fileDirectoryList/fileExists/exists")({
filePath: "content/" + project + "/_svgs/" + fileHash + "_" + etag,
onDone: onDone
});
};
})();
pages/plan/loadAllShapeSvgs/load.ls
(function(){
return function(page){
var project, i$, ref$, len$, topic, lresult$, j$, ref1$, len1$, block, results$ = [];
project = page.plan.project;
inc("/../app01/lib/util/fileDirectoryList/clearListCache/clear")();
for (i$ = 0, len$ = (ref$ = page.plan.topics).length; i$ < len$; ++i$) {
topic = ref$[i$];
lresult$ = [];
for (j$ = 0, len1$ = (ref1$ = topic.blocks).length; j$ < len1$; ++j$) {
block = ref1$[j$];
lresult$.push(inc("checkExists/check")(block.shapeSvg, project, fn$));
}
results$.push(lresult$);
}
return results$;
function fn$(exists){
if (!exists) {
return inc("/pages/_shared/loadShapeSvg/load")({
shapeSvg: block.shapeSvg,
project: project,
onLoaded: function(){},
onError: function(){}
});
}
}
};
})();
pages/plan/page.ls
(function(){
return function(page){
page.context = page.params.context;
page.enablePreschoolFocus = true;
page.planDescription = inc("/../app01/data/content/calcPlanDescription/calc")(page.params.planPath);
return {
navCategory: inc("../_shared/calcNavCategory/calc")(),
top: function(){
return inc("_topbar/topbar")(page);
},
urlDescription: function(){
return inc("/../app01/pages/content/plan/_urlDescription/description")(page);
},
start: function(){
var loadPlan, loadAllShapeSvgs, calcTodoBlock, create;
loadPlan = function(){
return inc("/../app01/pages/content/plan/loadPlan/load")(page, function(plan){
page.plan = plan;
if (engine.isMobileApp) {
return loadAllShapeSvgs();
} else {
return calcTodoBlock();
}
});
};
loadAllShapeSvgs = function(){
inc("loadAllShapeSvgs/load")(page);
return calcTodoBlock();
};
calcTodoBlock = function(){
page.topbar.update();
return inc("calcTodoBlock/calc")(page, create);
};
create = function(){
page.updateUrlDescription();
return page.html(inc("list/list")(page));
};
if (page.params.history === -1) {
return loadPlan();
} else {
page.append(page.spinner = inc("/../app01/lib/gui/spinner/spinner")());
return inc("/../app01/lib/util/waitFrames/wait")(4, loadPlan);
}
}
};
};
})();