PageSourceSearch

https://critikid.com/_app/immutable/nodes/31.VI4jUxzS.js

js critikid.com collected 2026-10-08 08:09:32 UTC 59,960 bytes, 63 lines download raw bytes

1import"../chunks/B-hL0dNY.js";import{w as Zt}from"../chunks/CIxJ3N3e.js";import{S as ke,i as Ce,d as P,t as w,a as h,g as ne,e as re,m as L,c as N,b as S}from"../chunks/BtyF1ts6.js";import{s as Ee,n as ie,d,y as pe,l as b,i as $,v as g,m as k,p as q,e as je,h as T,q as C,H as Be,j as D,z as K,k as V,t as A,f as oe,r as ae,a7 as Pe,L as xt,b as es,o as ts,P as ss,T as Ue,D as Le,F as ls,C as ns,U as Ne,M as St,E as Se}from"../chunks/4Ipyk7qm.js";import{e as x,u as Tt,o as Dt}from"../chunks/Bz1bFhes.js";import{p as rs}from"../chunks/Cdp5a0Ho.js";import{g as os}from"../chunks/Dc2ttzei.js";import{c as as,P as is,H as De}from"../chunks/Cww_Bgeq.js";import{P as we}from"../chunks/CK0jUXYe.js";import{C as qe}from"../chunks/J79CbPsG.js";import{B as ce,I as It}from"../chunks/Bpdl1oiJ.js";import{M as He}from"../chunks/C5gU4NND.js";import{H as cs}from"../chunks/Cpfwp92E.js";import{P as me}from"../chunks/BnxsZX33.js";import{B as fs}from"../chunks/utSlKmIo.js";import{F as Qe}from"../chunks/DyA01_gi.js";import{s as Vt}from"../chunks/Bd62qcQU.js";import{f as Te,a as Re}from"../chunks/BJIi4cC6.js";import{c as ve}from"../chunks/BkQvJq-r.js";const us=!1,_s=!1;async function Fe({params:r}){return{head_title:`Classroom ${r.classroom_id}`,head_description:"Manage classroom sessions and view student progress."}}const ds=Fe?Zt(Fe):void 0,_n=Object.freeze(Object.defineProperty({__proto__:null,load:ds,prerender:_s,ssr:us},Symbol.toStringTag,{value:"Module"})),ps=r=>Array.isArray(r)?r[0]||null:r&&typeof r=="object"?r:null,Ae=new Map,We=new Map,Ye={title:"",type:"video",questions:[],teacher_materials:[]},ms=(r=[])=>(r||[]).filter(e=>e&&typeof e=="object").map((e,s)=>{const t=e.value!==void 0&&e.value!==null?`${e.value}`:`${s}`;return{value:t,label:e.label||t,...e.is_correct!==void 0?{is_correct:!!e.is_correct}:{},user_selected:e.user_selected===!0}}),At=(r="")=>{if(r==null)return[];const e=`${r}`.trim();return e?e.split(",").map(s=>s.trim()).filter(Boolean):[]},jt=(r=[],e=[])=>ms(r).map(s=>({...s,user_selected:e.includes(`${s.value}`)})),$s=(r={},e=0)=>{const s=At(r.user_answer);return{...r,question_index:r.question_index!==void 0?r.question_index:e,question_id:r.question_id||"",question_text:r.question_text||"",question_type:r.question_type||"text",options:jt(r.options||[],s),selected_values:s,has_answer:s.length>0,user_answer:r.user_answer??null,correct_answer:r.correct_answer??null,is_correct:null}},hs=(r,e=[])=>{var t;if(!r)return"";if(Ae.has(r))return Ae.get(r)||"";const s=((t=e.find(l=>l.id===r))==null?void 0:t.title)||"";return Ae.set(r,s),s},gs=(r,e,s=[])=>{var i;if(!r)return Ye;let t=We.get(r);if(t||(t=new Map,We.set(r,t)),t.has(e))return t.get(e)||Ye;const l=s.find(a=>
1a.id===r),n=(i=l==null?void 0:l.lessons)==null?void 0:i.find(a=>a.id===e),o={title:(n==null?void 0:n.title)||"",type:(n==null?void 0:n.type)||"video",questions:(n==null?void 0:n.questions)||[],teacher_materials:(l==null?void 0:l.teacher_materials)||[]};return t.set(e,o),o},Bt=(r,e=[])=>{const s=gs(r.course_product_id,r.lesson_id,e),t=Array.isArray(s.questions)?s.questions:[],l={},n=i=>i?(l[i]||(l[i]={student_session_id:i,display_name:"Student",last_seen_at:null,completed_at:null,video_completed:!1,correct:0,incorrect:0,questions:t.map((a,c)=>$s(a,c))}),l[i]):null;for(const i of r.Classroom_Lesson_Participants||[]){const a=n(i.student_session_id);if(!a)continue;const c=ps(i.Classroom_Student_Sessions);c!=null&&c.display_name&&(a.display_name=c.display_name),a.last_seen_at=(c==null?void 0:c.last_seen_at)||null}for(const i of r.Classroom_Answers||[]){const a=n(i.student_session_id);if(!a||(i.is_correct===!0?a.correct+=1:i.is_correct===!1&&(a.incorrect+=1),!i.question_id))continue;const c=a.questions.findIndex(p=>p.question_id===i.question_id);if(c===-1)continue;const f=a.questions[c];if(!f)continue;const u=At(i.user_answer),_=u.length>0,m=jt(f.options||[],u);a.questions[c]={...f,question_text:i.question_text||f.question_text,question_type:i.question_type||f.question_type,correct_answer:i.correct_answer!==void 0&&i.correct_answer!==null?i.correct_answer:f.correct_answer??null,user_answer:i.user_answer!==void 0&&i.user_answer!==null?i.user_answer:null,options:m,selected_values:u,has_answer:_,is_correct:i.is_correct===!0||i.is_correct===!1?i.is_correct:null}}for(const i of r.Classroom_Lesson_Progress||[]){const a=n(i.student_session_id);a&&i.completed_at&&(!a.completed_at||i.completed_at>a.completed_at)&&(a.completed_at=i.completed_at)}for(const i of r.Classroom_Video_Progress||[]){const a=n(i.student_session_id);a&&(a.video_completed=a.video_completed||i.complete===!0)}const o=hs(r.course_product_id,e);return{id:r.id,course_product_id:r.course_product_id,lesson_id:r.lesson_id,course_title:o,lesson_title:s.title,lesson_type:s.type,teacher_materials:s.teacher_materials,students:Object.values(l).sort((i,a)=>i.display_name.localeCompare(a.display_name)),started_at:r.started_at,ended_at:r.ended_at,ended:!!r.ended_at}},Ge=(r,e=[])=>(r||[]).map(s=>Bt(s,e)),Je=(r="")=>{const e=`${r||""}`;return e.startsWith(Vt)?!1:!!e.startsWith("http")};function Ke(r,e,s){const t=r.slice();return t[2]=e[s],t}function Xe(r){let e,s,t,l,n,o,i,a=r[2].label+"",c,f;return{c(){e=C("label"),s=C("input"),o=D(),i=C("span"),c=A(a),f=D(),this.h()},l(u){e=k(u,"LABEL",{class:!0});var _=q(e);s=k(_,"INPUT",{class:!0,type:!0,"data-is_correct":!0}),o=T(_),i=k(_,"SPAN",{});var m=q(i);c=V(m,a),m.forEach(d),f=T(_),_.forEach(d),this.h()},h(){b(s,"class","js-cb"),b(s,"type","checkbox"),s.value=t=r[2].value,b(s,"data-is_correct",l=r[2].is_correct),s.checked=n=r[2].user_selected,s.disabled=!0,b(e,"class","field-cb")},m(u,_){$(u,e,_),g(e,s),g(e,o),g(e,i),g(i,c),g(e,f)},p(u,_){_&1&&t!==(t=u[2].value)&&(s.value=t),_&1&&l!==(l=u[2].is_correct)&&b(s,"data-is_correct",l),_&1&&n!==(n=u[2].user_selected)&&(s.checked=n),_&1&&a!==(a=u[2].label+"")&&K(c,a)},d(u){u&&d(e)}}}function bs(r){let e,s,t,l=(r[0].question_text||"Question")+"",n,o,i,a=x(r[0].options),c=[];for(let f=0;f<a.length;f+=1)c[f]=Xe(Ke(r,a,f));return{c(){e=C("div"),s=C("p"),t=new Be(!1),n=D(),o=C("div");for(let f=0;f<c.length;f+=1)c[f].c();this.h()},l(f){e=k(f,"DIV",{class:!0});var u=q(e);s=k(u,"P",{class:!0});var _=q(s);t=je(_,!1),_.forEach(d),n=T(u),o=k(u,"DIV",{class:!0});var m=q(o);for(let p=0;p<c.length;p+=1)c[p].l(m);m.forEach(d),u.forEach(d),this.h()},h(){t.a=null,b(s,"class","field-cb-group-label"),b(o,"class","field-cb-group-options"),b(e,"class",i="field-cb-group "+r[1])},m(f,u){$(f,e,u),g(e,s),t.m(l,s),g(e,n),g(e,o);for(let _=0;_<c.length;_+=1)c[_]&&c[_].m(o,null)},p(f,[u]){if(u&1&&l!==(l=(f[0].question_text||"Question")+"")&&t.p(l),u&1){a=x(f[0].options);let _;for(_=0;_<a.length;_+=1){const m=Ke(f,a,_);c[_]?c[_].p(m,u):(c[_]=Xe(m),c[_].c(),c[_].m(o,null))}for(;_<c.length;_+=1)c[_].d(1);c.length=a.length}u&2&&i!==(i="field-cb-group "+f[1])&&b(e,"class",i)},i:ie,o:ie,d(f){f&&d(e),pe(c,f)}}}function vs(r,e,s){let{question:t}=e,{class:l=""}=e;return r.$$set=n=>{"question"in n&&s(0,t=n.question),"class"in n&&s(1,l=n.class)},[t,l]}class ws extends ke{constructor(e){super(),Ce(this,e,vs,bs,Ee,{question:0,class:1})}}function Ze(r,e,s){const t=r.slice();return t[4]=e[s],t}function xe(r){let e,s,t,l,n,o,i,a=r[4].label+"",c,f;return{c(){e=C("label"),s=C("input"),o=D(),i=C("span"),c=A(a),f=D(),this.h()},l(u){e=k(u,"LABEL",{class:!0});var _=q(e);s=k(_,"INPUT",{class:!0,type:!0,name:!0,"data-is_correct":!0}),o=T(_),i=k(_,"SPAN",{});var m=q(i);c=V(m,a),m.forEach(d),f=T(_),_.forEach(d),this.h()},h(){b(s,"class","js-rb"),b(s,"type","radio"),b(s,"name",r[2]),s.value=t=r[4].value,b(s,"data-is_correct",l=r[4].is_correct),s.checked=n=r[4].user_selected,s.disabled=!0,b(e,"class","field-rb")},m(u,_){$(u,e,_),g(e,s),g(e,o),g(e,i),g(i,c),g(e,f)},p(u,_){_&4&&b(s,"name",u[2]),_&1&&t!==(t=u[4].value)&&(s.value=t),_&1&&l!==(l=u[4].is_correct)&&b(s,"data-is_correct",l),_&1&&n!==(n=u[4].user_selected)&&(s.checked=n),_&1&&a!==(a=u[4].label+"")&&K(c,a)},d(u){u&&d(e)}}}function ks(r){let e,s,t,l=(r[0].question_text||"Question")+"",n,o,i,a=x(r[0].options),c=[];for(let f=0;f<a.length;f+=1)c[f]=xe(Ze(r,a,f));return{c(){e=C("div"),s=C("p"),t=new Be(!1),n=D(),o=C("div");for(let f=0;f<c.length;f+=1)c[f].c();this.h()},l(f){e=k(f,"DIV",{class:!0});var u=q(e);s=k(u,"P",{class:!0});var _=q(s);t=je(_,!1),_.forEach(d),n=T(u),o=k(u,"DIV",{class:!0});var m=q(o);for(let p=0;p<c.length;p+=1)c[p].l(m);m.forEach(d),u.forEach(d),this.h()},h(){t.a=null,b(s,"class","field-rb-group-label"),b(o,"class","field-rb-group-options"),b(e,"class",i="field-rb-group "+r[1])},m(f,u){$(f,e,u),g(e,s),t.m(l,s),g(e,n),g(e,o);for(let _=0;_<c.length;_+=1)c[_]&&c[_].m(o,null)},p(f,[u]){if(u&1&&l!==(l=(f[0].question_text||"Question")+"")&&t.p(l),u&5){a=x(f[0].options);let _;for(_=0;_<a.length;_+=1){const m=Ze(f,a,_);c[_]?c[_].p(m,u):(c[_]=xe(m),c[_].c(),c[_].m(o,null))}for(;_<c.length;_+=1)c[_].d(1);c.length=a.length}u&2&&i!==(i="field-rb-group "+f[1])&&b(e,"class",i)},i:ie,o:ie,d(f){f&&d(e),pe(c,f)}}}let Cs=0;function Es(r,e,s){let t,{question:l}=e,{class:n=""}=e;const o=Cs++;return r.$$set=i=>{"question"in i&&s(0,l=i.question),"class"in i&&s(1,n=i.class)},r.$$.update=()=>{r.$$.dirty&1&&s(2,t=`rbg_${(l==null?void 0:l.question_id)||"question"}_${o}`)},[l,n,t]}class qs extends ke{constructor(e){super(),Ce(this,e,Es,ks,Ee,{question:0,class:1})}}function et(r,e,s){const t=r.slice();return t[8]=e[s],t}function ys(r){let e,s;return e=new It({props:{sm:!0,chevron_right:!r[1],chevron_down:r[1]}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l&2&&(n.chevron_right=!t[1]),l&2&&(n.chevron_down=t[1]),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function tt(r){let e,s,t=r[0].video_completed?"Video complete":"Video in progress",l,n;return{c(){e=C("td"),s=C("span"),l=A(t),this.h()},l(o){e=k(o,"TD",{class:!0});var i=q(e);s=k(i,"SPAN",{class:!0});var a=q(s);
1l=V(a,t),a.forEach(d),i.forEach(d),this.h()},h(){b(s,"class",n=r[0].video_completed?"text-green-700":""),b(e,"class","py-2 px-2 whitespace-nowrap")},m(o,i){$(o,e,i),g(e,s),g(s,l)},p(o,i){i&1&&t!==(t=o[0].video_completed?"Video complete":"Video in progress")&&K(l,t),i&1&&n!==(n=o[0].video_completed?"text-green-700":"")&&b(s,"class",n)},d(o){o&&d(e)}}}function st(r){let e,s,t,l,n,o;const i=[Ls,Ps],a=[];function c(f,u){return f[2]?0:1}return t=c(r),l=a[t]=i[t](r),{c(){e=C("tr"),s=C("td"),l.c(),this.h()},l(f){e=k(f,"TR",{class:!0});var u=q(e);s=k(u,"TD",{class:!0,colspan:!0});var _=q(s);l.l(_),_.forEach(d),u.forEach(d),this.h()},h(){b(s,"class","pb-3 align-top px-7"),b(s,"colspan",n=r[0].lesson_type==="video"?5:4),b(e,"class","border-b border-border-muted")},m(f,u){$(f,e,u),g(e,s),a[t].m(s,null),o=!0},p(f,u){let _=t;t=c(f),t===_?a[t].p(f,u):(ne(),w(a[_],1,1,()=>{a[_]=null}),re(),l=a[t],l?l.p(f,u):(l=a[t]=i[t](f),l.c()),h(l,1),l.m(s,null)),(!o||u&1&&n!==(n=f[0].lesson_type==="video"?5:4))&&b(s,"colspan",n)},i(f){o||(h(l),o=!0)},o(f){w(l),o=!1},d(f){f&&d(e),a[t].d()}}}function Ps(r){let e,s="No answers yet.";return{c(){e=C("p"),e.textContent=s,this.h()},l(t){e=k(t,"P",{class:!0,"data-svelte-h":!0}),ae(e)!=="svelte-1x6s52s"&&(e.textContent=s),this.h()},h(){b(e,"class","text-symbols-muted")},m(t,l){$(t,e,l)},p:ie,i:ie,o:ie,d(t){t&&d(e)}}}function Ls(r){var o;let e,s,t=x((o=r[0])==null?void 0:o.questions),l=[];for(let i=0;i<t.length;i+=1)l[i]=rt(et(r,t,i));const n=i=>w(l[i],1,1,()=>{l[i]=null});return{c(){e=C("div");for(let i=0;i<l.length;i+=1)l[i].c();this.h()},l(i){e=k(i,"DIV",{class:!0});var a=q(e);for(let c=0;c<l.length;c+=1)l[c].l(a);a.forEach(d),this.h()},h(){b(e,"class","space-y-2")},m(i,a){$(i,e,a);for(let c=0;c<l.length;c+=1)l[c]&&l[c].m(e,null);s=!0},p(i,a){var c;if(a&97){t=x((c=i[0])==null?void 0:c.questions);let f;for(f=0;f<t.length;f+=1){const u=et(i,t,f);l[f]?(l[f].p(u,a),h(l[f],1)):(l[f]=rt(u),l[f].c(),h(l[f],1),l[f].m(e,null))}for(ne(),f=t.length;f<l.length;f+=1)n(f);re()}},i(i){if(!s){for(let a=0;a<t.length;a+=1)h(l[a]);s=!0}},o(i){l=l.filter(Boolean);for(let a=0;a<l.length;a+=1)w(l[a]);s=!1},d(i){i&&d(e),pe(l,i)}}}function lt(r){let e,s,t,l,n,o;const i=[Ts,Ss,Ns],a=[];function c(f,u){return u&1&&(s=null),s==null&&(s=!!["radio","fallacy_buttons","button_group"].includes(f[8].question_type)),s?0:f[8].question_type==="checkbox"?1:2}return t=c(r,-1),l=a[t]=i[t](r),{c(){e=C("div"),l.c(),n=D(),this.h()},l(f){e=k(f,"DIV",{class:!0});var u=q(e);l.l(u),n=T(u),u.forEach(d),this.h()},h(){b(e,"class","question rounded py-2"),Pe(e,"correct",r[8].is_correct),Pe(e,"incorrect",!r[8].is_correct)},m(f,u){$(f,e,u),a[t].m(e,null),g(e,n),o=!0},p(f,u){let _=t;t=c(f,u),t===_?a[t].p(f,u):(ne(),w(a[_],1,1,()=>{a[_]=null}),re(),l=a[t],l?l.p(f,u):(l=a[t]=i[t](f),l.c()),h(l,1),l.m(e,n)),(!o||u&1)&&Pe(e,"correct",f[8].is_correct),(!o||u&1)&&Pe(e,"incorrect",!f[8].is_correct)},i(f){o||(h(l),o=!0)},o(f){w(l),o=!1},d(f){f&&d(e),a[t].d()}}}function Ns(r){let e,s,t=(r[8].question_text||"Question")+"",l,n,o,i=r[5](r[8].user_answer)+"",a,c,f=r[8].correct_answer&&nt(r);return{c(){e=C("p"),s=new Be(!1),l=D(),n=C("p"),f&&f.c(),o=D(),a=A(i),this.h()},l(u){e=k(u,"P",{class:!0});var _=q(e);s=je(_,!1),_.forEach(d),l=T(u),n=k(u,"P",{class:!0});var m=q(n);f&&f.l(m),o=T(m),a=V(m,i),m.forEach(d),this.h()},h(){s.a=null,b(e,"class","bg-surface-highlight px-4 py-2 rounded-md"),b(n,"class","mt-2 py-2 px-4 bg-surface-muted rounded-lg whitespace-pre-wrap")},m(u,_){$(u,e,_),s.m(t,e),$(u,l,_),$(u,n,_),f&&f.m(n,null),g(n,o),g(n,a),c=!0},p(u,_){(!c||_&1)&&t!==(t=(u[8].question_text||"Question")+"")&&s.p(t),u[8].correct_answer?f?(f.p(u,_),_&1&&h(f,1)):(f=nt(u),f.c(),h(f,1),f.m(n,o)):f&&(ne(),w(f,1,1,()=>{f=null}),re()),(!c||_&1)&&i!==(i=u[5](u[8].user_answer)+"")&&K(a,i)},i(u){c||(h(f),c=!0)},o(u){w(f),c=!1},d(u){u&&(d(e),d(l),d(n)),f&&f.d()}}}function Ss(r){let e,s;return e=new ws({props:{question:r[8],class:"my-0"}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l&1&&(n.question=t[8]),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function Ts(r){let e,s;return e=new qs({props:{question:r[8],class:"my-0"}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l&1&&(n.question=t[8]),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function nt(r){let e,s,t,l;return s=new It({props:{class:r[8].is_correct?"text-green-500":"text-red-500",check_circle:r[8].is_correct,times_circle:!r[8].is_correct}}),{c(){e=C("span"),S(s.$$.fragment),this.h()},l(n){e=k(n,"SPAN",{title:!0});var o=q(e);N(s.$$.fragment,o),o.forEach(d),this.h()}
1,h(){b(e,"title",t="Correct answer: "+r[8].correct_answer)},m(n,o){$(n,e,o),L(s,e,null),l=!0},p(n,o){const i={};o&1&&(i.class=n[8].is_correct?"text-green-500":"text-red-500"),o&1&&(i.check_circle=n[8].is_correct),o&1&&(i.times_circle=!n[8].is_correct),s.$set(i),(!l||o&1&&t!==(t="Correct answer: "+n[8].correct_answer))&&b(e,"title",t)},i(n){l||(h(s.$$.fragment,n),l=!0)},o(n){w(s.$$.fragment,n),l=!1},d(n){n&&d(e),P(s)}}}function rt(r){let e=r[8].has_answer&&r[6](r[8]),s,t,l=e&&lt(r);return{c(){l&&l.c(),s=oe()},l(n){l&&l.l(n),s=oe()},m(n,o){l&&l.m(n,o),$(n,s,o),t=!0},p(n,o){o&1&&(e=n[8].has_answer&&n[6](n[8])),e?l?(l.p(n,o),o&1&&h(l,1)):(l=lt(n),l.c(),h(l,1),l.m(s.parentNode,s)):l&&(ne(),w(l,1,1,()=>{l=null}),re())},i(n){t||(h(l),t=!0)},o(n){w(l),t=!1},d(n){n&&d(s),l&&l.d(n)}}}function Ds(r){let e,s,t,l,n,o,i=r[0].display_name+"",a,c,f,u,_,m,p,v,I=r[0].correct+"",z,W,j,le=r[0].incorrect+"",J,Y,O,B,y=r[0].completed_at?"Done":"In progress",M,R,te,G,ee;l=new ce({props:{sm:!0,left:!0,$$slots:{default:[ys]},$$scope:{ctx:r}}}),l.$on("click",r[3]);let X=r[0].lesson_type==="video"&&tt(r),Z=r[1]&&st(r);return{c(){e=C("tr"),s=C("td"),t=C("div"),S(l.$$.fragment),n=D(),o=C("span"),a=A(i),c=D(),f=C("span"),m=D(),X&&X.c(),p=D(),v=C("td"),z=A(I),W=D(),j=C("td"),J=A(le),Y=D(),O=C("td"),B=C("span"),M=A(y),te=D(),Z&&Z.c(),G=oe(),this.h()},l(U){e=k(U,"TR",{class:!0});var Q=q(e);s=k(Q,"TD",{class:!0});var de=q(s);t=k(de,"DIV",{class:!0});var ue=q(t);N(l.$$.fragment,ue),n=T(ue),o=k(ue,"SPAN",{class:!0});var he=q(o);a=V(he,i),he.forEach(d),c=T(ue),f=k(ue,"SPAN",{title:!0,class:!0}),q(f).forEach(d),ue.forEach(d),de.forEach(d),m=T(Q),X&&X.l(Q),p=T(Q),v=k(Q,"TD",{class:!0});var ge=q(v);z=V(ge,I),ge.forEach(d),W=T(Q),j=k(Q,"TD",{class:!0});var be=q(j);J=V(be,le),be.forEach(d),Y=T(Q),O=k(Q,"TD",{class:!0});var $e=q(O);B=k($e,"SPAN",{class:!0});var ye=q(B);M=V(ye,y),ye.forEach(d),$e.forEach(d),Q.forEach(d),te=T(U),Z&&Z.l(U),G=oe(),this.h()},h(){b(o,"class","font-bold"),b(f,"title",u="Last action "+Te(r[0].last_seen_at)),b(f,"class",_="h-2.5 w-2.5 rounded-full "+(r[4](r[0].last_seen_at)?"bg-green-500":"bg-symbols-muted")),b(t,"class","flex items-center gap-1"),b(s,"class","py-2 pr-2"),b(v,"class","py-2 px-2 text-right"),b(j,"class","py-2 px-2 text-right"),b(B,"class",R=r[0].completed_at?"text-green-700 font-medium":""),b(O,"class","py-2 px-2 whitespace-nowrap"),b(e,"class","border-t border-border-muted")},m(U,Q){$(U,e,Q),g(e,s),g(s,t),L(l,t,null),g(t,n),g(t,o),g(o,a),g(t,c),g(t,f),g(e,m),X&&X.m(e,null),g(e,p),g(e,v),g(v,z),g(e,W),g(e,j),g(j,J),g(e,Y),g(e,O),g(O,B),g(B,M),$(U,te,Q),Z&&Z.m(U,Q),$(U,G,Q),ee=!0},p(U,[Q]){const de={};Q&2050&&(de.$$scope={dirty:Q,ctx:U}),l.$set(de),(!ee||Q&1)&&i!==(i=U[0].display_name+"")&&K(a,i),(!ee||Q&1&&u!==(u="Last action "+Te(U[0].last_seen_at)))&&b(f,"title",u),(!ee||Q&1&&_!==(_="h-2.5 w-2.5 rounded-full "+(U[4](U[0].last_seen_at)?"bg-green-500":"bg-symbols-muted")))&&b(f,"class",_),U[0].lesson_type==="video"?X?X.p(U,Q):(X=tt(U),X.c(),X.m(e,p)):X&&(X.d(1),X=null),(!ee||Q&1)&&I!==(I=U[0].correct+"")&&K(z,I),(!ee||Q&1)&&le!==(le=U[0].incorrect+"")&&K(J,le),(!ee||Q&1)&&y!==(y=U[0].completed_at?"Done":"In progress")&&K(M,y),(!ee||Q&1&&R!==(R=U[0].completed_at?"text-green-700 font-medium":""))&&b(B,"class",R),U[1]?Z?(Z.p(U,Q),Q&2&&h(Z,1)):(Z=st(U),Z.c(),h(Z,1),Z.m(G.parentNode,G)):Z&&(ne(),w(Z,1,1,()=>{Z=null}),re())},i(U){ee||(h(l.$$.fragment,U),h(Z),ee=!0)},o(U){w(l.$$.fragment,U),w(Z),ee=!1},d(U){U&&(d(e),d(te),d(G)),P(l),X&&X.d(),Z&&Z.d(U)}}}function Is(r,e,s){let t,{student:l}=e,n=!1;const o=2*60*1e3,i=()=>{s(1,n=!n)},a=u=>{if(!u)return!1;const _=Date.parse(u);return Number.isNaN(_)?!1:Date.now()-_<=o},c=u=>u==null?"—":`${u}`.trim()||"—",f=u=>(u==null?void 0:u.question_type)!=="thermometer";return r.$$set=u=>{"student"in u&&s(0,l=u.student)},r.$$.update=()=>{r.$$.dirty&1&&s(2,t=l==null?void 0:l.questions.some(u=>u.has_answer&&f(u)))},[l,n,t,i,a,c,f]}class Vs extends ke{constructor(e){super(),Ce(this,e,Is,Ds,Ee,{student:0})}}function ot(r,e,s){const t=r.slice();return t[8]=e[s],t}function at(r,e,s){const t=r.slice();return t[11]=e[s],t[13]=s,t}function As(r){let e=r[0].course_title+"",s,t,l=r[0].lesson_id+1+"",n,o,i=r[0].lesson_title+"",a;return{c(){s=A(e),t=A(" · "),n=A(l),o=A(`.
2                    `),a=A(i)},l(c){s=V(c,e),t=V(c," · "),n=V(c,l),o=V(c,`.
3                    `),a=V(c,i)},m(c,f){$(c,s,f),$(c,t,f),$(c,n,f),$(c,o,f),$(c,a,f)},p(c,f){f&1&&e!==(e=c[0].course_title+"")&&K(s,e),f&1&&l!==(l=c[0].lesson_id+1+"")&&K(n,l),f&1&&i!==(i=c[0].lesson_title+"")&&K(a,i)},d(c){c&&(d(s),d(t),d(n),d(o),d(a))}}}function js(r){let e;return{c(){e=A("· Active")},l(s){e=V(s,"· Active")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function Bs(r){let e;return{c(){e=A("· Ended")},l(s){e=V(s,"· Ended")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function Hs(r){let e,s;return e=new ce({props:{sm:!0,outline:!0,stopPropagation:!0,$$slots:{default:[Os]},$$scope:{ctx:r}}}),e.$on("click",r[4]),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l&16388&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function Ms(r){let e,s;return e=new ce({props:{class:"whitespace-nowrap self-start",outline:!0,stopPropagation:!0,$$slots:{default:[zs]},$$scope:{ctx:r}}}),e.$on("click",r[7]),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l&16384&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function Os(r){let e=r[2]?"Collapse":"Expand",s;return{c(){s=A(e)},l(t){s=V(t,e)},m(t,l){$(t,s,l)},p(t,l){l&4&&e!==(e=t[2]?"Collapse":"Expand")&&K(s,e)},d(t){t&&d(s)}}}function zs(r){let e;return{c(){e=A("End lesson")},l(s){e=V(s,"End lesson")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function it(r){var f;let e,s,t,l,n,o=((f=r[0].teacher_materials)==null?void 0:f.length)&&ct(r);const i=[Rs,Qs],a=[];function c(u,_){var m;return(m=u[0].students)!=null&&m.length?0:1}return t=c(r),l=a[t]=i[t](r),{c(){e=C("div"),o&&o.c(),s=D(),l.c(),this.h()},l(u){e=k(u,"DIV",{class:!0});var _=q(e);o&&o.l(_),s=T(_),l.l(_),_.forEach(d),this.h()},h(){b(e,"class","")},m(u,_){$(u,e,_),o&&o.m(e,null),g(e,s),a[t].m(e,null),n=!0},p(u,_){var p;(p=u[0].teacher_materials)!=null&&p.length?o?o.p(u,_):(o=ct(u),o.c(),o.m(e,s)):o&&(o.d(1),o=null);let m=t;t=c(u),t===m?a[t].p(u,_):(ne(),w(a[m],1,1,()=>{a[m]=null}),re(),l=a[t],l?l.p(u,_):(l=a[t]=i[t](u),l.c()),h(l,1),l.m(e,null))},i(u){n||(h(l),n=!0)},o(u){w(l),n=!1},d(u){u&&d(e),o&&o.d(),a[t].d()}}}function ct(r){let e,s,t="Teacher materials:",l,n=x(r[0].teacher_materials),o=[];for(let i=0;i<n.length;i+=1)o[i]=ft(at(r,n,i));return{c(){e=C("p"),s=C("b"),s.textContent=t,l=D();for(let i=0;i<o.length;i+=1)o[i].c();this.h()},l(i){e=k(i,"P",{class:!0});var a=q(e);s=k(a,"B",{"data-svelte-h":!0}),ae(s)!=="svelte-18u1hw6"&&(s.textContent=t),l=T(a);for(let c=0;c<o.length;c+=1)o[c].l(a);a.forEach(d),this.h()},h(){b(e,"class","mb-4")},m(i,a){$(i,e,a),g(e,s),g(e,l);for(let c=0;c<o.length;c+=1)o[c]&&o[c].m(e,null)},p(i,a){if(a&1){n=x(i[0].teacher_materials);let c;for(c=0;c<n.length;c+=1){const f=at(i,n,c);o[c]?o[c].p(f,a):(o[c]=ft(f),o[c].c(),o[c].m(e,null))}for(;c<o.length;c+=1)o[c].d(1);o.length=n.length}},d(i){i&&d(e),pe(o,i)}}}function Us(r){let e;return{c(){e=A(",")},l(s){e=V(s,",")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function ft(r){let e,s,t=r[11].label+"",l,n,o,i=r[13]>0&&Us();return{c(){i&&i.c(),e=D(),s=C("a"),l=A(t),this.h()},l(a){i&&i.l(a),e=T(a),s=k(a,"A",{href:!0,class:!0,target:!0,rel:!0});var c=q(s);
3l=V(c,t),c.forEach(d),this.h()},h(){b(s,"href",n=r[11].url),b(s,"class","link"),b(s,"target","_blank"),b(s,"rel",o=Je(r[11].url)?"noreferrer noopener":void 0)},m(a,c){i&&i.m(a,c),$(a,e,c),$(a,s,c),g(s,l)},p(a,c){c&1&&t!==(t=a[11].label+"")&&K(l,t),c&1&&n!==(n=a[11].url)&&b(s,"href",n),c&1&&o!==(o=Je(a[11].url)?"noreferrer noopener":void 0)&&b(s,"rel",o)},d(a){a&&(d(e),d(s)),i&&i.d(a)}}}function Qs(r){let e,s="No students joined yet.";return{c(){e=C("p"),e.textContent=s},l(t){e=k(t,"P",{"data-svelte-h":!0}),ae(e)!=="svelte-t5wr5y"&&(e.textContent=s)},m(t,l){$(t,e,l)},p:ie,i:ie,o:ie,d(t){t&&d(e)}}}function Rs(r){let e,s,t,l,n,o="Student",i,a,c,f="Correct",u,_,m="Incorrect",p,v,I="Status",z,W,j=[],le=new Map,J,Y=r[0].lesson_type==="video"&&ut(),O=x(r[0].students);const B=y=>y[8].student_session_id;for(let y=0;y<O.length;y+=1){let M=ot(r,O,y),R=B(M);le.set(R,j[y]=_t(R,M))}return{c(){e=C("div"),s=C("table"),t=C("thead"),l=C("tr"),n=C("th"),n.textContent=o,i=D(),Y&&Y.c(),a=D(),c=C("th"),c.textContent=f,u=D(),_=C("th"),_.textContent=m,p=D(),v=C("th"),v.textContent=I,z=D(),W=C("tbody");for(let y=0;y<j.length;y+=1)j[y].c();this.h()},l(y){e=k(y,"DIV",{class:!0});var M=q(e);s=k(M,"TABLE",{class:!0});var R=q(s);t=k(R,"THEAD",{});var te=q(t);l=k(te,"TR",{class:!0});var G=q(l);n=k(G,"TH",{class:!0,"data-svelte-h":!0}),ae(n)!=="svelte-1g5clj6"&&(n.textContent=o),i=T(G),Y&&Y.l(G),a=T(G),c=k(G,"TH",{class:!0,"data-svelte-h":!0}),ae(c)!=="svelte-144x5vo"&&(c.textContent=f),u=T(G),_=k(G,"TH",{class:!0,"data-svelte-h":!0}),ae(_)!=="svelte-ekjw4j"&&(_.textContent=m),p=T(G),v=k(G,"TH",{class:!0,"data-svelte-h":!0}),ae(v)!=="svelte-28cxn2"&&(v.textContent=I),G.forEach(d),te.forEach(d),z=T(R),W=k(R,"TBODY",{});var ee=q(W);for(let X=0;X<j.length;X+=1)j[X].l(ee);ee.forEach(d),R.forEach(d),M.forEach(d),this.h()},h(){b(n,"class","pr-2 w-full"),b(c,"class","text-right px-2"),b(_,"class","text-right px-2"),b(v,"class","px-2"),b(l,"class","text-left border-b border-b-border-default"),b(s,"class","w-full border-collapse"),b(e,"class","overflow-x-auto")},m(y,M){$(y,e,M),g(e,s),g(s,t),g(t,l),g(l,n),g(l,i),Y&&Y.m(l,null),g(l,a),g(l,c),g(l,u),g(l,_),g(l,p),g(l,v),g(s,z),g(s,W);for(let R=0;R<j.length;R+=1)j[R]&&j[R].m(W,null);J=!0},p(y,M){y[0].lesson_type==="video"?Y||(Y=ut(),Y.c(),Y.m(l,a)):Y&&(Y.d(1),Y=null),M&1&&(O=x(y[0].students),ne(),j=Tt(j,M,B,1,y,O,le,W,Dt,_t,null,ot),re())},i(y){if(!J){for(let M=0;M<O.length;M+=1)h(j[M]);J=!0}},o(y){for(let M=0;M<j.length;M+=1)w(j[M]);J=!1},d(y){y&&d(e),Y&&Y.d();for(let M=0;M<j.length;M+=1)j[M].d()}}}function ut(r){let e,s="Video";return{c(){e=C("th"),e.textContent=s,this.h()},l(t){e=k(t,"TH",{class:!0,"data-svelte-h":!0}),ae(e)!=="svelte-maevuz"&&(e.textContent=s),this.h()},h(){b(e,"class","px-2")},m(t,l){$(t,e,l)},d(t){t&&d(e)}}}function _t(r,e){let s,t,l;return t=new Vs({props:{student:{...e[8],lesson_type:e[0].lesson_type}}}),{key:r,first:null,c(){s=oe(),S(t.$$.fragment),this.h()},l(n){s=oe(),N(t.$$.fragment,n),this.h()},h(){this.first=s},m(n,o){$(n,s,o),L(t,n,o),l=!0},p(n,o){e=n;const i={};o&1&&(i.student={...e[8],lesson_type:e[0].lesson_type}),t.$set(i)},i(n){l||(h(t.$$.fragment,n),l=!0)},o(n){w(t.$$.fragment,n),l=!1},d(n){n&&d(s),P(t,n)}}}function Fs(r){let e,s,t,l,n,o,i,a=Te(r[0].started_at)+"",c,f,u,_,m,p,v,I;l=new as({props:{$$slots:{default:[As]},$$scope:{ctx:r}}});function z(B,y){return B[0].ended?Bs:js}let W=z(r),j=W(r);const le=[Ms,Hs],J=[];function Y(B,y){return B[1]?0:1}m=Y(r),p=J[m]=le[m](r);let O=r[2]&&it(r);return{c(){e=C("div"),s=C("div"),t=C("div"),S(l.$$.fragment),n=D(),o=C("p"),i=C("span"),c=A(a),u=D(),j.c(),_=D(),p.c(),v=D(),O&&O.c(),this.h()},l(B){e=k(B,"DIV",{class:!0});var y=q(e);s=k(y,"DIV",{class:!0});var M=q(s);t=k(M,"DIV",{class:!0});var R=q(t);N(l.$$.fragment,R),n=T(R),o=k(R,"P",{});var te=q(o);i=k(te,"SPAN",{title:!0});var G=q(i);c=V(G,a),G.forEach(d),u=T(te),j.l(te),te.forEach(d),R.forEach(d),_=T(M),p.l(M),M.forEach(d),v=T(y),O&&O.l(y),y.forEach(d),this.h()},h(){b(i,"title",f=Re(r[0].started_at)),b(t,"class","space-y-1"),b(s,"class","flex flex-nowrap items-center justify-between gap-2"),b(e,"class","flex flex-col gap-2")},m(B,y){$(B,e,y),g(e,s),g(s,t),L(l,t,null),g(t,n),g(t,o),g(o,i),g(i,c),g(o,u),j.m(o,null),g(s,_),J[m].m(s,null),g(e,v),O&&O.m(e,null),I=!0},p(B,y){const M={};y&16385&&(M.$$scope={dirty:y,ctx:B}),l.$set(M),(!I||y&1)&&a!==(a=Te(B[0].started_at)+"")&&K(c,a),(!I||y&1&&f!==(f=Re(B[0].started_at)))&&b(i,"title",f),W!==(W=z(B))&&
3(j.d(1),j=W(B),j&&(j.c(),j.m(o,null)));let R=m;m=Y(B),m===R?J[m].p(B,y):(ne(),w(J[R],1,1,()=>{J[R]=null}),re(),p=J[m],p?p.p(B,y):(p=J[m]=le[m](B),p.c()),h(p,1),p.m(s,null)),B[2]?O?(O.p(B,y),y&4&&h(O,1)):(O=it(B),O.c(),h(O,1),O.m(e,null)):O&&(ne(),w(O,1,1,()=>{O=null}),re())},i(B){I||(h(l.$$.fragment,B),h(p),h(O),I=!0)},o(B){w(l.$$.fragment,B),w(p),w(O),I=!1},d(B){B&&d(e),P(l),j.d(),J[m].d(),O&&O.d()}}}function Ws(r){let e,s;return e=new qe({props:{$$slots:{default:[Fs]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,[l]){const n={};l&16391&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function Ys(r,e,s){let t,l,{lesson:n}=e;const o=xt();let i=null,a=!0;const c=()=>{s(2,a=!a)},f=()=>o("end_lesson");return r.$$set=u=>{"lesson"in u&&s(0,n=u.lesson)},r.$$.update=()=>{r.$$.dirty&1&&s(6,t=(n==null?void 0:n.id)||null),r.$$.dirty&1&&s(1,l=!!(n&&!n.ended)),r.$$.dirty&98&&t!==i&&(s(5,i=t),s(2,a=l))},[n,l,a,o,c,i,t,f]}class Gs extends ke{constructor(e){super(),Ce(this,e,Ys,Ws,Ee,{lesson:0})}}function dt(r,e,s){const t=r.slice();return t[58]=e[s],t}function pt(r,e,s){const t=r.slice();return t[58]=e[s],t}function mt(r,e,s){const t=r.slice();return t[63]=e[s],t}function $t(r,e,s){const t=r.slice();return t[66]=e[s],t}function ht(r,e,s){const t=r.slice();return t[69]=e[s],t}function Js(r){var t;let e=(((t=r[1])==null?void 0:t.title)||"Classroom")+"",s;return{c(){s=A(e)},l(l){s=V(l,e)},m(l,n){$(l,s,n)},p(l,n){var o;n[0]&2&&e!==(e=(((o=l[1])==null?void 0:o.title)||"Classroom")+"")&&K(s,e)},d(l){l&&d(s)}}}function Ks(r){let e,s;return e=new cs({props:{$$slots:{default:[Js]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[0]&2|l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function Xs(r){let e,s,t,l="critikid.com/join",n,o,i;return{c(){e=C("p"),s=A("Tell students to go to "),t=C("b"),t.textContent=l,n=A(`
4                    and use the code
5                    `),o=C("b"),i=A(r[0]),this.h()},l(a){e=k(a,"P",{});var c=q(e);s=V(c,"Tell students to go to "),t=k(c,"B",{class:!0,"data-svelte-h":!0}),ae(t)!=="svelte-65tv4u"&&(t.textContent=l),n=V(c,`
6                    and use the code
7                    `),o=k(c,"B",{class:!0});var f=q(o);i=V(f,r[0]),f.forEach(d),c.forEach(d),this.h()},h(){b(t,"class","text-symbols-emphasis"),b(o,"class","font-mono tracking-wider text-symbols-emphasis")},m(a,c){$(a,e,c),g(e,s),g(e,t),g(e,n),g(e,o),g(o,i)},p(a,c){c[0]&1&&K(i,a[0])},d(a){a&&d(e)}}}function Zs(r){let e=r[17]?"Copied!":"Copy join link",s;return{c(){s=A(e)},l(t){s=V(t,e)},m(t,l){$(t,s,l)},p(t,l){l[0]&131072&&e!==(e=t[17]?"Copied!":"Copy join link")&&K(s,e)},d(t){t&&d(s)}}}function xs(r){let e;return{c(){e=A("Present instructions")},l(s){e=V(s,"Present instructions")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function el(r){let e,s,t,l,n,o,i;return e=new me({props:{$$slots:{default:[Xs]},$$scope:{ctx:r}}}),l=new ce({props:{outline:!0,$$slots:{default:[Zs]},$$scope:{ctx:r}}}),l.$on("click",r[19]),o=new ce({props:{outline:!0,$$slots:{default:[xs]},$$scope:{ctx:r}}}),o.$on("click",r[20]),{c(){S(e.$$.fragment),s=D(),t=C("div"),S(l.$$.fragment),n=D(),S(o.$$.fragment),this.h()},l(a){N(e.$$.fragment,a),s=T(a),t=k(a,"DIV",{class:!0});var c=q(t);N(l.$$.fragment,c),n=T(c),N(o.$$.fragment,c),c.forEach(d),this.h()},h(){b(t,"class","not-prose flex gap-2 mt-2")},m(a,c){L(e,a,c),$(a,s,c),$(a,t,c),L(l,t,null),g(t,n),L(o,t,null),i=!0},p(a,c){const f={};c[0]&1|c[2]&1024&&(f.$$scope={dirty:c,ctx:a}),e.$set(f);const u={};c[0]&131072|c[2]&1024&&(u.$$scope={dirty:c,ctx:a}),l.$set(u);const _={};c[2]&1024&&(_.$$scope={dirty:c,ctx:a}),o.$set(_)},i(a){i||(h(e.$$.fragment,a),h(l.$$.fragment,a),h(o.$$.fragment,a),i=!0)},o(a){w(e.$$.fragment,a),w(l.$$.fragment,a),w(o.$$.fragment,a),i=!1},d(a){a&&(d(s),d(t)),P(e,a),P(l),P(o)}}}function tl(r){let e,s;return e=new qe({props:{$$slots:{default:[el]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[0]&131073|l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function sl(r){let e,s;return e=new we({props:{class:"!mt-8",$$slots:{default:[ul]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[0]&24|l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function ll(r){let e,s;return e=new we({props:{$$slots:{default:[pl]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[0]&64|l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function nl(r){let e,s;return e=new we({props:{$$slots:{default:[hl]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function rl(r){let e;return{c(){e=A("Lessons")},l(s){e=V(s,"Lessons")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function ol(r){let e;return{c(){e=A("New lesson")},l(s){e=V(s,"New lesson")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function al(r){let e,s=[],t=new Map,l,n=x(r[4]);const o=i=>i[69].id;for(let i=0;i<n.length;i+=1){let a=ht(r,n,i),c=o(a);t.set(c,s[i]=gt(c,a))}return{c(){e=C("div");for(let i=0;i<s.length;i+=1)s[i].c();this.h()},l(i){e=k(i,"DIV",{class:!0});var a=q(e);for(let c=0;c<s.length;c+=1)s[c].l(a);a.forEach(d),this.h()}
7,h(){b(e,"class","space-y-4 mt-3")},m(i,a){$(i,e,a);for(let c=0;c<s.length;c+=1)s[c]&&s[c].m(e,null);l=!0},p(i,a){a[0]&134217744&&(n=x(i[4]),ne(),s=Tt(s,a,o,1,i,n,t,e,Dt,gt,null,ht),re())},i(i){if(!l){for(let a=0;a<n.length;a+=1)h(s[a]);l=!0}},o(i){for(let a=0;a<s.length;a+=1)w(s[a]);l=!1},d(i){i&&d(e);for(let a=0;a<s.length;a+=1)s[a].d()}}}function il(r){let e,s;return e=new qe({props:{class:"mt-3",$$slots:{default:[fl]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function gt(r,e){let s,t,l;function n(){return e[33](e[69])}return t=new Gs({props:{lesson:e[69]}}),t.$on("end_lesson",n),{key:r,first:null,c(){s=oe(),S(t.$$.fragment),this.h()},l(o){s=oe(),N(t.$$.fragment,o),this.h()},h(){this.first=s},m(o,i){$(o,s,i),L(t,o,i),l=!0},p(o,i){e=o;const a={};i[0]&16&&(a.lesson=e[69]),t.$set(a)},i(o){l||(h(t.$$.fragment,o),l=!0)},o(o){w(t.$$.fragment,o),l=!1},d(o){o&&d(s),P(t,o)}}}function cl(r){let e,s="No lessons have been started in this classroom yet.";return{c(){e=C("p"),e.textContent=s},l(t){e=k(t,"P",{"data-svelte-h":!0}),ae(e)!=="svelte-18vder9"&&(e.textContent=s)},m(t,l){$(t,e,l)},p:ie,d(t){t&&d(e)}}}function fl(r){let e,s;return e=new me({props:{$$slots:{default:[cl]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function ul(r){let e,s,t,l,n,o,i,a,c;s=new De({props:{$$slots:{default:[rl]},$$scope:{ctx:r}}}),l=new ce({props:{primary:!0,disabled:!r[3].length,$$slots:{default:[ol]},$$scope:{ctx:r}}}),l.$on("click",r[24]);const f=[il,al],u=[];function _(m,p){return m[4].length===0?0:1}return o=_(r),i=u[o]=f[o](r),{c(){e=C("div"),S(s.$$.fragment),t=D(),S(l.$$.fragment),n=D(),i.c(),a=oe(),this.h()},l(m){e=k(m,"DIV",{class:!0});var p=q(e);N(s.$$.fragment,p),t=T(p),N(l.$$.fragment,p),p.forEach(d),n=T(m),i.l(m),a=oe(),this.h()},h(){b(e,"class","flex flex-wrap items-center justify-between gap-4")},m(m,p){$(m,e,p),L(s,e,null),g(e,t),L(l,e,null),$(m,n,p),u[o].m(m,p),$(m,a,p),c=!0},p(m,p){const v={};p[2]&1024&&(v.$$scope={dirty:p,ctx:m}),s.$set(v);const I={};p[0]&8&&(I.disabled=!m[3].length),p[2]&1024&&(I.$$scope={dirty:p,ctx:m}),l.$set(I);let z=o;o=_(m),o===z?u[o].p(m,p):(ne(),w(u[z],1,1,()=>{u[z]=null}),re(),i=u[o],i?i.p(m,p):(i=u[o]=f[o](m),i.c()),h(i,1),i.m(a.parentNode,a))},i(m){c||(h(s.$$.fragment,m),h(l.$$.fragment,m),h(i),c=!0)},o(m){w(s.$$.fragment,m),w(l.$$.fragment,m),w(i),c=!1},d(m){m&&(d(e),d(n),d(a)),P(s),P(l),u[o].d(m)}}}function _l(r){let e,s;return{c(){e=C("p"),s=A(r[6])},l(t){e=k(t,"P",{});var l=q(e);s=V(l,r[6]),l.forEach(d)},m(t,l){$(t,e,l),g(e,s)},p(t,l){l[0]&64&&K(s,t[6])},d(t){t&&d(e)}}}function dl(r){let e,s;return e=new me({props:{$$slots:{default:[_l]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[0]&64|l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function pl(r){let e,s;return e=new qe({props:{$$slots:{default:[dl]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[0]&64|l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function ml(r){let e,s="Loading classroom...";return{c(){e=C("p"),e.textContent=s},l(t){e=k(t,"P",{"data-svelte-h":!0}),ae(e)!=="svelte-1eac469"&&(e.textContent=s)},m(t,l){$(t,e,l)},p:ie,d(t){t&&d(e)}}}function $l(r){let e,s;return e=new me({props:{$$slots:{default:[ml]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function hl(r){let e,s;return e=new qe({props:{$$slots:{default:[$l]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function gl(r){let e,s,t,l,n,o,i,a,c,f;e=new fs({props:{items:r[18]}}),t=new we({props:{$$slots:{default:[Ks]},$$scope:{ctx:r}}}),n=new we({props:{$$slots:{default:[tl]},$$scope:{ctx:r}}});const u=[nl,ll,sl],_=[];function m(p,v){return p[5]?0:p[6]?1:2}return i=m(r),a=_[i]=u[i](r),{c(){S(e.$$.fragment),s=D(),S(t.$$.fragment),l=D(),S(n.$$.fragment),o=D(),a.c(),c=oe()},l(p){N(e.$$.fragment,p),s=T(p),N(t.$$.fragment,p),l=T(p),N(n.$$.fragment,p),o=T(p),a.l(p),c=oe()},m(p,v){L(e,p,v),$(p,s,v),L(t,p,v),$(p,l,v),L(n,p,v),$(p,o,v),_[i].m(p,v),$(p,c,v),f=!0},p(p,v){const I={};v[0]&262144&&(I.items=p[18]),e.$set(I);const z={};v[0]&2|v[2]&1024&&(z.$$scope={dirty:v,ctx:p}),t.$set(z);const W={};v[0]&131073|v[2]&1024&&(W.$$scope={dirty:v,ctx:p}),n.$set(W);let j=i;i=m(p),i===j?_[i].p(p,v):(ne(),w(_[j],1,1,()=>{_[j]=null}),re(),a=_[i],a?a.p(p,v):(a=_[i]=u[i](p),a.c()),h(a,1),a.m(c.parentNode,c))},i(p){f||(h(e.$$.fragment,p),h(t.$$.fragment,p),h(n.$$.fragment,p),h(a),f=!0)},o(p){w(e.$$.fragment,p),w(t.$$.fragment,p),w(n.$$.fragment,p),w(a),f=!1},d(p){p&&(d(s),d(l),d(o),d(c)),P(e,p),P(t,p),P(n,p),_[i].d(p)}}}function bt(r){let e,s;return e=new He({props:{sm:!0,$$slots:{footer:[Nl],header:[yl],default:[El]},$$scope:{ctx:r}}}),e.$on("close",r[38]),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[0]&8072|l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function bl(r){let e,s,t,l;return e=new Qe({props:{label:"Course",invert:!0,$$slots:{default:[wl]},$$scope:{ctx:r}}}),t=new Qe({props:{label:"Lesson",invert:!0,$$slots:{default:[kl]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment),s=D(),S(t.$$.fragment)},l(n){N(e.$$.fragment,n),s=T(n),N(t.$$.fragment,n)},m(n,o){L(e,n,o),$(n,s,o),L(t,n,o),l=!0},p(n,o){const i={};o[0]&264|o[2]&1024&&(i.$$scope={dirty:o,ctx:n}),e.$set(i);const a={};o[0]&640|o[2]&1024&&(a.$$scope={dirty:o,ctx:n}),t.$set(a)},i(n){l||(h(e.$$.fragment,n),h(t.$$.fragment,n),l=!0)},o(n){w(e.$$.fragment,n),w(t.$$.fragment,n),l=!1},d(n){n&&d(s),P(e,n),P(t,n)}}}function vl(r){let e,s;return e=new me({props:{invert:!0,$$slots:{default:[Cl]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function vt(r){let e,s=(r[66].grades?`${r[66].title}: ${r[66].grades}`:r[66].title)+"",t,l;return{c(){e=C("option"),t=A(s),this.h()},l(n){e=k(n,"OPTION",{});var o=q(e);t=V(o,s),o.forEach(d),this.h()},h(){e.__value=l=r[66].id,Se(e,e.__value)},m(n,o){$(n,e,o),g(e,t)},p(n,o){o[0]&8&&s!==(s=(n[66].grades?`${n[66].title}: ${n[66].grades}`:n[66].title)+"")&&K(t,s),o[0]&8&&l!==(l=n[66].id)&&(e.__value=l,Se(e,e.__value))},d(n){n&&d(e)}}}function wl(r){let e,s,t,l=x(r[3]),n=[];for(let o=0;o<l.length;o+=1)n[o]=vt($t(r,l,o));return{c(){e=C("select");for(let o=0;o<n.length;o+=1)n[o].c();this.h()},l(o){e=k(o,"SELECT",{id:!0});var i=q(e);for(let a=0;a<n.length;a+=1)n[a].l(i);
7i.forEach(d),this.h()},h(){b(e,"id","course-select"),r[8]===void 0&&St(()=>r[35].call(e))},m(o,i){$(o,e,i);for(let a=0;a<n.length;a+=1)n[a]&&n[a].m(e,null);Ne(e,r[8],!0),s||(t=[Le(e,"change",r[35]),Le(e,"change",r[36])],s=!0)},p(o,i){if(i[0]&8){l=x(o[3]);let a;for(a=0;a<l.length;a+=1){const c=$t(o,l,a);n[a]?n[a].p(c,i):(n[a]=vt(c),n[a].c(),n[a].m(e,null))}for(;a<n.length;a+=1)n[a].d(1);n.length=l.length}i[0]&264&&Ne(e,o[8])},d(o){o&&d(e),pe(n,o),s=!1,ns(t)}}}function wt(r){let e,s=r[63].label+"",t,l;return{c(){e=C("option"),t=A(s),this.h()},l(n){e=k(n,"OPTION",{});var o=q(e);t=V(o,s),o.forEach(d),this.h()},h(){e.__value=l=r[63].id,Se(e,e.__value)},m(n,o){$(n,e,o),g(e,t)},p(n,o){o[0]&128&&s!==(s=n[63].label+"")&&K(t,s),o[0]&128&&l!==(l=n[63].id)&&(e.__value=l,Se(e,e.__value))},d(n){n&&d(e)}}}function kl(r){let e,s,t,l=x(r[7]),n=[];for(let o=0;o<l.length;o+=1)n[o]=wt(mt(r,l,o));return{c(){e=C("select");for(let o=0;o<n.length;o+=1)n[o].c();this.h()},l(o){e=k(o,"SELECT",{id:!0});var i=q(e);for(let a=0;a<n.length;a+=1)n[a].l(i);i.forEach(d),this.h()},h(){b(e,"id","lesson-select"),r[9]===void 0&&St(()=>r[37].call(e))},m(o,i){$(o,e,i);for(let a=0;a<n.length;a+=1)n[a]&&n[a].m(e,null);Ne(e,r[9],!0),s||(t=Le(e,"change",r[37]),s=!0)},p(o,i){if(i[0]&128){l=x(o[7]);let a;for(a=0;a<l.length;a+=1){const c=mt(o,l,a);n[a]?n[a].p(c,i):(n[a]=wt(c),n[a].c(),n[a].m(e,null))}for(;a<n.length;a+=1)n[a].d(1);n.length=l.length}i[0]&640&&Ne(e,o[9])},d(o){o&&d(e),pe(n,o),s=!1,t()}}}function Cl(r){let e,s=`No available courses for this classroom. Check your
8                        school subscription.`;return{c(){e=C("p"),e.textContent=s},l(t){e=k(t,"P",{"data-svelte-h":!0}),ae(e)!=="svelte-1ubq69k"&&(e.textContent=s)},m(t,l){$(t,e,l)},p:ie,d(t){t&&d(e)}}}function kt(r){let e,s;return{c(){e=C("p"),s=A(r[10]),this.h()},l(t){e=k(t,"P",{class:!0});var l=q(e);s=V(l,r[10]),l.forEach(d),this.h()},h(){b(e,"class","text-red-500")},m(t,l){$(t,e,l),g(e,s)},p(t,l){l[0]&1024&&K(s,t[10])},d(t){t&&d(e)}}}function El(r){let e,s,t,l,n,o,i="Start",a,c,f;const u=[vl,bl],_=[];function m(v,I){return v[3].length?1:0}s=m(r),t=_[s]=u[s](r);let p=r[10]&&kt(r);return{c(){e=C("form"),t.c(),l=D(),p&&p.c(),n=D(),o=C("button"),o.textContent=i,this.h()},l(v){e=k(v,"FORM",{class:!0});var I=q(e);t.l(I),l=T(I),p&&p.l(I),n=T(I),o=k(I,"BUTTON",{type:!0,class:!0,"data-svelte-h":!0}),ae(o)!=="svelte-129r7ly"&&(o.textContent=i),I.forEach(d),this.h()},h(){b(o,"type","submit"),b(o,"class","sr-only"),b(e,"class","space-y-3")},m(v,I){$(v,e,I),_[s].m(e,null),g(e,l),p&&p.m(e,null),g(e,n),g(e,o),a=!0,c||(f=Le(e,"submit",ls(r[26])),c=!0)},p(v,I){let z=s;s=m(v),s===z?_[s].p(v,I):(ne(),w(_[z],1,1,()=>{_[z]=null}),re(),t=_[s],t?t.p(v,I):(t=_[s]=u[s](v),t.c()),h(t,1),t.m(e,l)),v[10]?p?p.p(v,I):(p=kt(v),p.c(),p.m(e,n)):p&&(p.d(1),p=null)},i(v){a||(h(t),a=!0)},o(v){w(t),a=!1},d(v){v&&d(e),_[s].d(),p&&p.d(),c=!1,f()}}}function ql(r){let e;return{c(){e=A("New lesson")},l(s){e=V(s,"New lesson")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function yl(r){let e,s;return e=new De({props:{invert:!0,$$slots:{default:[ql]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function Pl(r){let e;return{c(){e=A("Cancel")},l(s){e=V(s,"Cancel")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function Ll(r){let e;return{c(){e=A("Start lesson")},l(s){e=V(s,"Start lesson")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function Nl(r){let e,s,t,l,n;return s=new ce({props:{outline:!0,invert:!0,$$slots:{default:[Pl]},$$scope:{ctx:r}}}),s.$on("click",r[34]),l=new ce({props:{primary:!0,invert:!0,loading:r[11],disabled:!r[3].length,$$slots:{default:[Ll]},$$scope:{ctx:r}}}),l.$on("click",r[26]),{c(){e=C("div"),S(s.$$.fragment),t=D(),S(l.$$.fragment),this.h()},l(o){e=k(o,"DIV",{slot:!0,class:!0});var i=q(e);N(s.$$.fragment,i),t=T(i),N(l.$$.fragment,i),i.forEach(d),this.h()},h(){b(e,"slot","footer"),b(e,"class","flex items-center justify-between gap-2")},m(o,i){$(o,e,i),L(s,e,null),g(e,t),L(l,e,null),n=!0},p(o,i){const a={};i[2]&1024&&(a.$$scope={dirty:i,ctx:o}),s.$set(a);const c={};i[0]&2048&&(c.loading=o[11]),i[0]&8&&(c.disabled=!o[3].length),i[2]&1024&&(c.$$scope={dirty:i,ctx:o}),l.$set(c)},i(o){n||(h(s.$$.fragment,o),h(l.$$.fragment,o),n=!0)},o(o){w(s.$$.fragment,o),w(l.$$.fragment,o),n=!1},d(o){o&&d(e),P(s),P(l)}}}function Ct(r){let e,s;return e=new He({props:{sm:!0,$$slots:{footer:[jl],header:[Il],default:[Tl]},$$scope:{ctx:r}}}),e.$on("close",r[23]),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[0]&20|l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function Et(r){let e,s=r[58].display_name+"",t;return{c(){e=C("li"),t=A(s)},l(l){e=k(l,"LI",{});var n=q(e);
8t=V(n,s),n.forEach(d)},m(l,n){$(l,e,n),g(e,t)},p(l,n){n[0]&20&&s!==(s=l[58].display_name+"")&&K(t,s)},d(l){l&&d(e)}}}function Sl(r){var i;let e,s=`Starting a new lesson will end the current lesson for all
9                students. These students haven't pressed "I am done" yet:`,t,l,n=x((((i=r[4].find(r[39]))==null?void 0:i.students)||[]).filter(Lt)),o=[];for(let a=0;a<n.length;a+=1)o[a]=Et(pt(r,n,a));return{c(){e=C("p"),e.textContent=s,t=D(),l=C("ul");for(let a=0;a<o.length;a+=1)o[a].c()},l(a){e=k(a,"P",{"data-svelte-h":!0}),ae(e)!=="svelte-1ufo155"&&(e.textContent=s),t=T(a),l=k(a,"UL",{});var c=q(l);for(let f=0;f<o.length;f+=1)o[f].l(c);c.forEach(d)},m(a,c){$(a,e,c),$(a,t,c),$(a,l,c);for(let f=0;f<o.length;f+=1)o[f]&&o[f].m(l,null)},p(a,c){var f;if(c[0]&20){n=x((((f=a[4].find(a[39]))==null?void 0:f.students)||[]).filter(Lt));let u;for(u=0;u<n.length;u+=1){const _=pt(a,n,u);o[u]?o[u].p(_,c):(o[u]=Et(_),o[u].c(),o[u].m(l,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=n.length}},d(a){a&&(d(e),d(t),d(l)),pe(o,a)}}}function Tl(r){let e,s;return e=new me({props:{invert:!0,sm:!0,$$slots:{default:[Sl]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[0]&20|l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function Dl(r){let e;return{c(){e=A("Not everyone is done yet")},l(s){e=V(s,"Not everyone is done yet")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function Il(r){let e,s;return e=new De({props:{invert:!0,$$slots:{default:[Dl]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function Vl(r){let e;return{c(){e=A("Cancel")},l(s){e=V(s,"Cancel")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function Al(r){let e;return{c(){e=A("Continue")},l(s){e=V(s,"Continue")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function jl(r){let e,s,t,l,n;return s=new ce({props:{outline:!0,invert:!0,$$slots:{default:[Vl]},$$scope:{ctx:r}}}),s.$on("click",r[23]),l=new ce({props:{primary:!0,invert:!0,$$slots:{default:[Al]},$$scope:{ctx:r}}}),l.$on("click",r[25]),{c(){e=C("div"),S(s.$$.fragment),t=D(),S(l.$$.fragment),this.h()},l(o){e=k(o,"DIV",{slot:!0,class:!0});var i=q(e);N(s.$$.fragment,i),t=T(i),N(l.$$.fragment,i),i.forEach(d),this.h()},h(){b(e,"slot","footer"),b(e,"class","flex items-center justify-between gap-2")},m(o,i){$(o,e,i),L(s,e,null),g(e,t),L(l,e,null),n=!0},p(o,i){const a={};i[2]&1024&&(a.$$scope={dirty:i,ctx:o}),s.$set(a);const c={};i[2]&1024&&(c.$$scope={dirty:i,ctx:o}),l.$set(c)},i(o){n||(h(s.$$.fragment,o),h(l.$$.fragment,o),n=!0)},o(o){w(s.$$.fragment,o),w(l.$$.fragment,o),n=!1},d(o){o&&d(e),P(s),P(l)}}}function qt(r){let e,s;return e=new He({props:{sm:!0,$$slots:{footer:[Ql],header:[Ol],default:[Hl]},$$scope:{ctx:r}}}),e.$on("close",r[22]),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[0]&98324|l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function yt(r){let e,s=r[58].display_name+"",t;return{c(){e=C("li"),t=A(s)},l(l){e=k(l,"LI",{});var n=q(e);t=V(n,s),n.forEach(d)},m(l,n){$(l,e,n),g(e,t)},p(l,n){n[0]&20&&s!==(s=l[58].display_name+"")&&K(t,s)},d(l){l&&d(e)}}}function Bl(r){var i;let e,s="Some students haven't finished this lesson yet. End it anyway?",t,l,n=x((((i=r[4].find(r[40]))==null?void 0:i.students)||[]).filter(Nt)),o=[];for(let a=0;a<n.length;a+=1)o[a]=yt(dt(r,n,a));return{c(){e=C("p"),e.textContent=s,t=D(),l=C("ul");for(let a=0;a<o.length;a+=1)o[a].c()},l(a){e=k(a,"P",{"data-svelte-h":!0}),ae(e)!=="svelte-1v8gi6b"&&(e.textContent=s),t=T(a),l=k(a,"UL",{});var c=q(l);for(let f=0;f<o.length;f+=1)o[f].l(c);c.forEach(d)},m(a,c){$(a,e,c),$(a,t,c),$(a,l,c);for(let f=0;f<o.length;f+=1)o[f]&&o[f].m(l,null)},p(a,c){var f;if(c[0]&20){n=x((((f=a[4].find(a[40]))==null?void 0:f.students)||[]).filter(Nt));let u;for(u=0;
9u<n.length;u+=1){const _=dt(a,n,u);o[u]?o[u].p(_,c):(o[u]=yt(_),o[u].c(),o[u].m(l,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=n.length}},d(a){a&&(d(e),d(t),d(l)),pe(o,a)}}}function Pt(r){let e,s;return{c(){e=C("p"),s=A(r[16]),this.h()},l(t){e=k(t,"P",{class:!0});var l=q(e);s=V(l,r[16]),l.forEach(d),this.h()},h(){b(e,"class","text-red-500 mt-3")},m(t,l){$(t,e,l),g(e,s)},p(t,l){l[0]&65536&&K(s,t[16])},d(t){t&&d(e)}}}function Hl(r){let e,s,t,l;e=new me({props:{invert:!0,sm:!0,$$slots:{default:[Bl]},$$scope:{ctx:r}}});let n=r[16]&&Pt(r);return{c(){S(e.$$.fragment),s=D(),n&&n.c(),t=oe()},l(o){N(e.$$.fragment,o),s=T(o),n&&n.l(o),t=oe()},m(o,i){L(e,o,i),$(o,s,i),n&&n.m(o,i),$(o,t,i),l=!0},p(o,i){const a={};i[0]&20|i[2]&1024&&(a.$$scope={dirty:i,ctx:o}),e.$set(a),o[16]?n?n.p(o,i):(n=Pt(o),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},i(o){l||(h(e.$$.fragment,o),l=!0)},o(o){w(e.$$.fragment,o),l=!1},d(o){o&&(d(s),d(t)),P(e,o),n&&n.d(o)}}}function Ml(r){let e;return{c(){e=A("Not everyone is done yet")},l(s){e=V(s,"Not everyone is done yet")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function Ol(r){let e,s;return e=new De({props:{invert:!0,$$slots:{default:[Ml]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,l){L(e,t,l),s=!0},p(t,l){const n={};l[2]&1024&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||(h(e.$$.fragment,t),s=!0)},o(t){w(e.$$.fragment,t),s=!1},d(t){P(e,t)}}}function zl(r){let e;return{c(){e=A("Cancel")},l(s){e=V(s,"Cancel")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function Ul(r){let e;return{c(){e=A("End anyway")},l(s){e=V(s,"End anyway")},m(s,t){$(s,e,t)},d(s){s&&d(e)}}}function Ql(r){let e,s,t,l,n;return s=new ce({props:{outline:!0,invert:!0,$$slots:{default:[zl]},$$scope:{ctx:r}}}),s.$on("click",r[22]),l=new ce({props:{primary:!0,invert:!0,loading:r[15],$$slots:{default:[Ul]},$$scope:{ctx:r}}}),l.$on("click",r[28]),{c(){e=C("div"),S(s.$$.fragment),t=D(),S(l.$$.fragment),this.h()},l(o){e=k(o,"DIV",{slot:!0,class:!0});var i=q(e);N(s.$$.fragment,i),t=T(i),N(l.$$.fragment,i),i.forEach(d),this.h()},h(){b(e,"slot","footer"),b(e,"class","flex items-center justify-between gap-2")},m(o,i){$(o,e,i),L(s,e,null),g(e,t),L(l,e,null),n=!0},p(o,i){const a={};i[2]&1024&&(a.$$scope={dirty:i,ctx:o}),s.$set(a);const c={};i[0]&32768&&(c.loading=o[15]),i[2]&1024&&(c.$$scope={dirty:i,ctx:o}),l.$set(c)},i(o){n||(h(s.$$.fragment,o),h(l.$$.fragment,o),n=!0)},o(o){w(s.$$.fragment,o),w(l.$$.fragment,o),n=!1},d(o){o&&d(e),P(s),P(l)}}}function Rl(r){let e,s,t,l,n,o;e=new is({props:{main_class:"space-y-4",$$slots:{default:[gl]},$$scope:{ctx:r}}});let i=r[12]&&bt(r),a=r[13]&&Ct(r),c=r[14]&&qt(r);return{c(){S(e.$$.fragment),s=D(),i&&i.c(),t=D(),a&&a.c(),l=D(),c&&c.c(),n=oe()},l(f){N(e.$$.fragment,f),s=T(f),i&&i.l(f),t=T(f),a&&a.l(f),l=T(f),c&&c.l(f),n=oe()},m(f,u){L(e,f,u),$(f,s,u),i&&i.m(f,u),$(f,t,u),a&&a.m(f,u),$(f,l,u),c&&c.m(f,u),$(f,n,u),o=!0},p(f,u){const _={};u[0]&393339|u[2]&1024&&(_.$$scope={dirty:u,ctx:f}),e.$set(_),f[12]?i?(i.p(f,u),u[0]&4096&&h(i,1)):(i=bt(f),i.c(),h(i,1),i.m(t.parentNode,t)):i&&(ne(),w(i,1,1,()=>{i=null}),re()),f[13]?a?(a.p(f,u),u[0]&8192&&h(a,1)):(a=Ct(f),a.c(),h(a,1),a.m(l.parentNode,l)):a&&(ne(),w(a,1,1,()=>{a=null}),re()),f[14]?c?(c.p(f,u),u[0]&16384&&h(c,1)):(c=qt(f),c.c(),h(c,1),c.m(n.parentNode,n)):c&&(ne(),w(c,1,1,()=>{c=null}),re())},i(f){o||(h(e.$$.fragment,f),h(i),h(a),h(c),o=!0)},o(f){w(e.$$.fragment,f),w(i),w(a),w(c),o=!1},d(f){f&&(d(s),d(t),d(l),d(n)),P(e,f),i&&i.d(f),a&&a.d(f),c&&c.d(f)}}}const Lt=r=>!r.completed_at,Nt=r=>!r.completed_at;function Fl(r,e,s){let t,l,n;es(r,rs,E=>s(32,n=E));let{data:o}=e,{supabase:i,courses:a,session:c}=o,f="",u=null,_=[],m=!0,p="",v=null,I=[],z="",W="",j="",le=!1,J=!1,Y=!1,O=!1,B=null,y=!1,M="",R=!1,te=null,G=!0,ee=!1;const X=async()=>{await navigator.clipboard.writeText(`${Vt}/join?classroom_code=${f}`),s(17,R=!0),setTimeout(()=>s(17,R=!1),2e3)},Z=()=>{const E=screen.width,H=screen.height;window.open(`/my-classrooms/${f}/presentation`,"presentation",`width=${E},height=${H},menubar=no,toolbar=no,location=no,status=no`)},U=E=>a.find(H=>H.id===E),Q=E=>{var F;if(s(7,I=[]),s(9,W=""),!E)return;const H=U(E);(F=H==null?void 0:H.lessons)!=null&&F.length&&(s(7,I=H.lessons.map(se=>({id:`${se.id}`,label:`${se.id+1}. ${se.title}`}))),I.length&&s(9,W=I[0].id))},de=()=>{s(12,J=!0),s(10,j="");const E=_[0];if(E&&a.some(H=>H.id===E.course_product_id)){s(8,z=E.course_product_id),Q(z);const H=String(E.lesson_id+1);I.some(F=>F.id===H)&&s(9,W=H)}else a.length&&(s(8,z=a[0].id),Q(z))},ue=E=>((E==null?void 0:E.students)||[]).reduce((H,F)=>H||!F.completed_at,!1),he=()=>{s(14,O=!1),B=null,s(15,y=!1),s(16,M="")},ge=()=>{s(13,Y=!1)},be=async({lesson_id:E=null}={})=>{let H=i.from("Classroom_Lessons").select(`
10                id, course_product_id, lesson_id, started_at, ended_at,
11                Classroom_Lesson_Participants (
12                    student_session_id,
13                    Classroom_Student_Sessions (
14                        display_name, last_seen_at
15                    )
16                ),
17                Classroom_Answers (
18                    student_session_id,
19                    question_id,
20                    question_text,
21                    question_type,
22                    correct_answer,
23                    user_answer,
24                    is_correct,
25                    created_at,
26                    updated_at
27                ),
28                Classroom_Lesson_Progress (
29                    student_session_id, completed_at
30                ),
31                Classroom_Video_Progress (
32                    student_session_id, complete
33                )
34            `).eq("classroom_id",f);if(E){H=H.eq("id",E);const{data:fe,error:_e}=await H.maybeSingle();return _e?{lesson_rows:[],error:_e}:{lesson_rows:fe?[fe]:[],error:null}}const{data:F,error:se}=await H.order("started_at",{ascending:!1});return se?{lesson_rows:[],error:se}:{lesson_rows:F||[],error:null}},$e=async()=>{var F;const{lesson_rows:E,error:H}=await be();if(H){console.error("classroom_lessons_error",H),ve(H,{message:"Load classroom lessons failed",operation:"select",table:"Classroom_Lessons"}),s(6,p="Unable to load lessons."),s(5,m=!1);return}s(4,_=Ge(E,a)),s(2,v=((F=_.find(se=>!se.ended))==null?void 0:F.id)||null)},ye=async()=>
34{if(!v)return;const E=v,{lesson_rows:H,error:F}=await be({lesson_id:E});if(F){console.error("classroom_active_lesson_error",F),ve(F,{message:"Load active classroom lesson failed",operation:"select",table:"Classroom_Lessons"});return}if(!H.length){s(2,v=null);return}const se=H[0];if(!se)return;const fe=Bt(se,a);s(4,_=_.map(_e=>_e.id===E?fe:_e)),fe.ended&&s(2,v=null)},Ht=async()=>{var se;if(s(6,p=""),s(5,m=!0),!t){os("/");return}const{data:E,error:H}=await i.from("Classrooms").select(`
35                id, title, school_id, teacher_user_id, created_at,
36                Classroom_Lessons (
37                    id, course_product_id, lesson_id, started_at, ended_at,
38                    Classroom_Lesson_Participants (
39                        student_session_id,
40                        Classroom_Student_Sessions (
41                            display_name, last_seen_at
42                        )
43                    ),
44                    Classroom_Answers (
45                        student_session_id,
46                        question_id,
47                        question_text,
48                        question_type,
49                        correct_answer,
50                        user_answer,
51                        is_correct,
52                        created_at,
53                        updated_at
54                    ),
55                    Classroom_Lesson_Progress (
56                        student_session_id, completed_at
57                    ),
58                    Classroom_Video_Progress (
59                        student_session_id, complete
60                    )
61                )
62            `).eq("id",f).is("archived_at",null).order("started_at",{referencedTable:"Classroom_Lessons",ascending:!1}).maybeSingle(),F=Array.isArray(E)?E[0]||null:E||null;if(H||!F){console.error("classroom_load_error",H),H&&ve(H,{message:"Load classroom failed",operation:"select",table:"Classrooms"}),s(6,p="Classroom not found."),s(5,m=!1);return}s(1,u=F),s(4,_=Ge(F.Classroom_Lessons||[],a)),s(2,v=((se=_.find(fe=>!fe.ended))==null?void 0:se.id)||null),s(5,m=!1)},Mt=async({course_product_id:E,lesson_number:H})=>{const{error:F}=await i.from("Classroom_Lessons").insert({classroom_id:f,course_product_id:E,lesson_id:H,started_by:t});if(F){console.error("start_lesson_error",F),ve(F,{message:"Start lesson insert failed",operation:"insert",table:"Classroom_Lessons"}),s(10,j="Unable to start lesson."),s(11,le=!1);return}return s(12,J=!1),s(11,le=!1),await $e(),!0},Ot=()=>{const E=_.find(H=>H.id===v);if(ue(E)){s(13,Y=!0);return}de()},zt=()=>{ge(),de()},Ut=async()=>{s(10,j="");const E=Number(W);if(!z||Number.isNaN(E)){s(10,j="Select a course and lesson.");return}if(s(11,le=!0),v&&!await Ie(v)){s(10,j="Unable to end active lesson."),s(11,le=!1);return}await Mt({course_product_id:z,lesson_number:E})},Ie=async E=>{if(!E)return;const H=v===E,F=new Date().toISOString(),se=_;s(4,_=_.map(_e=>_e.id===E?{..._e,ended:!0,ended_at:F}:_e)),H&&s(2,v=null);const{error:fe}=await i.from("Classroom_Lessons").update({ended_at:F}).eq("id",E).eq("classroom_id",f).is("ended_at",null);return fe?(console.error("end_lesson_error",fe),ve(fe,{message:"End lesson update failed",operation:"update",table:"Classroom_Lessons"}),s(4,_=se),H&&s(2,v=E),await $e(),!1):(await $e(),!0)},Me=async E=>{if(!E)return;const H=_.find(se=>se.id===E);if(v===E&&ue(H)){B=E,s(16,M=""),s(14,O=!0);return}await Ie(E)},Qt=async()=>{if(!B||y)return;s(15,y=!0),s(16,M="");const E=await Ie(B);if(s(15,y=!1),!E){s(16,M="Unable to end lesson.");return}he()},Oe=()=>{te||(te=setInterval(async()=>{if(G&&v&&!ee){ee=!0;try{await ye()}finally{ee=!1}}},4e3))},Ve=()=>{te&&(clearInterval(te),te=null,ee=!1)},ze=()=>{s(31,G=document.visibilityState==="visible"),G?v&&Oe():Ve()};ts(()=>{Ht(),document.addEventListener("visibilitychange",ze)}),ss(()=>{Ve(),document.removeEventListener("visibilitychange",ze)});const Rt=E=>Me(E.id),Ft=()=>s(12,J=!1);function Wt(){z=Ue(this),s(8,z),s(3,a),s(29,o)}const Yt=()=>Q(z);function Gt(){W=Ue(this),s(9,W),s(7,I)}const Jt=()=>s(12,J=!1),Kt=E=>E.id===v,Xt=E=>E.id===v;return r.$$set=E=>{"data"in E&&s(29,o=E.data)},r.$$.update=()=>{var E;r.$$.dirty[0]&536870912&&s(3,{supabase:i,courses:a,session:c}=o,a,(s(30,c),s(29,o))),r.$$.dirty[0]&1073741824&&(t=(E=c==null?void 0:c.user)==null?void 0:E.id),r.$$.dirty[1]&2&&s(0,f=n.params.classroom_id),r.$$.dirty[0]&3&&s(18,l=[{path:"my-classrooms",title:"My Classrooms"},{path:f,title:(u==null?void 0:u.title)||"Classroom"}]),r.$$.dirty[0]&4|r.$$.dirty[1]&1&&v&&G&&Oe(),r.$$.dirty[0]&4&&(v||Ve())},[f,u,v,a,_,m,p,I,z,W,j,le,J,Y,O,y,M,R,l,X,Z,Q,he,ge,Ot,zt,Ut,Me,Qt,o,c,G,n,Rt,Ft,Wt,Yt,Gt,Jt,Kt,Xt]}class dn extends ke{constructor(e){super(),Ce(this,e,Fl,Rl,Ee,{data:29},null,[-1,-1,-1])}}export{dn as component,_n as universal};
63//# sourceMappingURL=31.VI4jUxzS.js.map

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.