1"use strict";(self.webpackChunkranking=self.webpackChunkranking||[]).push([[491,4107],{491(e,n,s){s.r(n),s.d(n,{StudentModalContent:()=>g,default:()=>p});var a=s(9379),t=s(9950),l=s(2875),r=s(8327),i=s(486),c=s(264),o=s(8287),d=s(2116),m=s(2009),u=s(4414);const h={personal:"Personalisiert",self:"Selbst erstellt"},g=e=>{let{student:n,classId:s,rank:g,totalStudents:p,onClose:x,onRemove:j,inline:f=!1}=e;const[v,b]=(0,t.useState)([]),[N,k]=(0,t.useState)([]),[C,_]=(0,t.useState)(!0),[y,w]=(0,t.useState)(null),[S,A]=(0,t.useState)(!1),[E,K]=(0,t.useState)(!1),z=t.useRef(null),[D,M]=(0,t.useState)([]),[R,L]=(0,t.useState)(null),[I,P]=(0,t.useState)([]),[F,T]=(0,t.useState)(null);(0,t.useEffect)(()=>{s&&(0,i.aqn)(s).then(e=>M(e||[])).catch(()=>M([]))},[s]),(0,t.useEffect)(()=>{L(null),P([]),A(!1)},[null===n||void 0===n?void 0:n.id,s]);const O=(0,t.useMemo)(()=>{const e=new Set(v.filter(e=>e.folder_id).map(e=>e.folder_id));let n=!0;for(;n;)n=!1,D.forEach(s=>{e.has(s.id)&&s.parent_folder_id&&!e.has(s.parent_folder_id)&&(e.add(s.parent_folder_id),n=!0)});return e},[v,D]),q=(0,t.useMemo)(()=>D.filter(e=>(null===R?!e.parent_folder_id:e.parent_folder_id===R)&&O.has(e.id)).sort((e,n)=>e.folder_order-n.folder_order),[D,R,O]),B=e=>{if(-1===e)L(null),P([]);else{const n=I[e];L(n.id),P(n=>n.slice(0,e+1))}};t.useEffect(()=>()=>clearTimeout(z.current),[]),(0,t.useEffect)(()=>{if(null===n||void 0===n||!n.id)return;let e=!1;(async()=>{try{const[s,a]=await Promise.all([(0,i.xwS)(n.id),(0,i.tyu)(n.id)]);if(e)return;const t=Array.isArray(null===s||void 0===s?void 0:s.data)?s.data:Array.isArray(s)?s:[];b(t),k(Array.isArray(a)?a:[])}catch(s){console.error("Failed to load student data:",s)}finally{e||_(!1)}})();const s=(0,i.iwI)(e=>{e.student_id===n.id&&k(n=>{const s=n.findIndex(n=>n.task_id===e.task_id);if(-1===s)return[...n,{task_id:e.task_id,status:e.status}];const t=[...n];return t[s]=(0,a.A)((0,a.A)({},t[s]),{},{status:e.status}),t})});return()=>{e=!0,s()}},[null===n||void 0===n?void 0:n.id]);const{sheetSessionProgress:Q,progressSummary:W,completedSheetIds:G}=(0,t.useMemo)(()=>{const e=new Map(N.map(e=>[e.task_id,(0,c.S)(e.status)])),n={},s={correct:[],corrected:[],wrong:[],inWork:[],error:[],notAttempted:[]},a=new Set;return v.forEach(t=>{n[t.id]={};let l=0,r=!0;(t.sessions||[]).forEach(a=>{const i={correct:[],corrected:[],wrong:[],error:[],notAttempted:[],inWork:[]};(a.tasks||[]).forEach(n=>{l++;const a=e.get(n.id)||"not-attempted";"correct"===a?(i.correct.push(n.id),s.correct.push(n.id)):"corrected"===a?(i.corrected.push(n.id),s.corrected.push(n.id)):"wrong"===a?(i.wrong.push(n.id),s.wrong.push(n.id),r=!1):"error"===a?(i.error.push(n.id),s.error.push(n.id)):"in-work"===a?(i.inWork.push(n.id),s.inWork.push(n.id),r=!1):(i.notAttempted.push(n.id),s.notAttempted.push(n.id),r=!1)}),n[t.id][a.id]=i}),l>0&&r&&a.add(t.id)}),{sheetSessionProgress:n,progressSummary:s,completedSheetIds:a}},[v,N]),{activeSheets:Y,completedSheets:Z}=(0,t.useMemo)(()=>{const e=[],n=[];return v.forEach(s=>{(null===R?!s.folder_id:s.folder_id===R)&&(G.has(s.id)?n.push(s):e.push(s))}),{activeSheets:e,completedSheets:n}},[v,G,R]),V=S?Z:Z.slice(0,6),X=(0,t.useMemo)(()=>N.map(e=>(0,a.A)((0,a.A)({},e),{},{student_id:n.id})),[N,n.id]),H=(0,t.useMemo)(()=>v.filter(e=>{const s=e.assignments||[];return s.some(e=>e.user_id===n.id)&&!s.some(e=>e.class_id)}).length,[v,n.id]),U=e=>{const s=e.assignments||[],a=s.some(e=>e.user_id===n.id),t=s.some(e=>e.class_id);return a&&t?"personal":a?"self":t?"teacher":"unknown"};return n?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:"student-modal".concat(f?" student-modal--inline":""),children:[x&&(0,u.jsx)("button",{className:"close-button",onClick:x,children:(0,u.jsx)(l.QCr,{})}),(0,u.jsxs)("div",{className:"student-modal-header",children:[(0,u.jsx)(r.A,{seed:n.avatar_seed,size:44}),(0,u.jsxs)("div",{className:"student-modal-header-info",children:[(0,u.jsxs)("div",{className:"student-modal-name-row",children:[(0,u.jsx)("span",{className:"student-modal-name",children:n.name}),(0,u.jsx)("span",{className:"status-pill ".concat(n.connected?"online":"offline"),children:n.connected?"Online":"Offline"})]}),(0,u.jsxs)("div",{className:"student-modal-meta",children:[(0,u.jsxs)("span",{children:["XP ",n.points||0]}),null!=g&&(0,u.jsxs)("span",{children:["Rang ",g,"/",p]}),H>0&&(0,u.jsxs)("span",{className:"self-sheet-count-badge",children:[(0,u.jsxs)("span",{className:"self-sheet-icon-wrap",children:[(0,u.jsx)(l.Gp9,{className:"self-sheet-icon"}),(0,u.jsx)("span",{className:"self-sheet-icon-count",children:H})]}),"Selbst erstellt"]}
1)]})]})]}),(0,u.jsx)("div",{className:"student-modal-progress",children:(0,u.jsx)(o.A,{progress:W})}),(0,u.jsxs)("div",{className:"student-modal-body",children:[I.length>0&&(0,u.jsxs)("div",{className:"sm-breadcrumb",children:[(0,u.jsx)("button",{className:"sm-bc-item",onClick:()=>B(-1),children:(0,u.jsx)(l.rQ8,{})}),I.map((e,n)=>(0,u.jsxs)(t.Fragment,{children:[(0,u.jsx)(l.X6T,{className:"sm-bc-sep"}),(0,u.jsx)("button",{className:"sm-bc-item".concat(n===I.length-1?" current":""),onClick:()=>B(n),children:e.name})]},e.id))]}),C?(0,u.jsx)("p",{className:"muted",children:"Lade\u2026"}):0===v.length?(0,u.jsx)("p",{className:"muted",children:"Keine \xdcbungsbl\xe4tter"}):(0,u.jsxs)(u.Fragment,{children:[q.length>0&&(0,u.jsx)("div",{className:"sm-folder-row",children:q.map(e=>(0,u.jsxs)("button",{className:"sm-folder-chip",onClick:()=>(e=>{L(e.id),P(n=>[...n,{id:e.id,name:e.name}])})(e),onMouseEnter:()=>T(e.id),onMouseLeave:()=>T(null),children:[F===e.id?(0,u.jsx)(l.g1V,{className:"sm-folder-icon"}):(0,u.jsx)(l.M1W,{className:"sm-folder-icon"}),(0,u.jsx)("span",{children:e.name})]},e.id))}),Y.length>0&&(0,u.jsx)("div",{className:"student-sheet-grid",children:Y.map(e=>{const n=U(e);return(0,u.jsx)(d.A,{sheet:e,onSheetClicked:()=>w(e),onSessionClick:()=>w(e),sessionProgress:Q[e.id]||{},origin:n,originLabel:h[n]||h.unknown},e.id)})}),Z.length>0&&(0,u.jsxs)("div",{className:"student-completed-section",children:[(0,u.jsxs)("div",{className:"student-sheets-section-label",children:["Abgeschlossen (",Z.length,")"]}),(0,u.jsx)("div",{className:"student-sheet-grid",children:V.map(e=>{const n=U(e);return(0,u.jsx)("div",{className:"student-sheet-completed-wrapper",children:(0,u.jsx)(d.A,{sheet:e,onSheetClicked:()=>w(e),onSessionClick:()=>w(e),sessionProgress:Q[e.id]||{},origin:n,originLabel:h[n]||h.unknown})},e.id)})}),Z.length>6&&!S&&(0,u.jsxs)("button",{className:"load-more-btn",onClick:()=>A(!0),children:[Z.length-6," weitere laden"]})]}),0===q.length&&0===Y.length&&0===Z.length&&(0,u.jsx)("p",{className:"muted",children:"Ordner ist leer"})]})]}),j&&(0,u.jsx)("div",{className:"student-modal-footer",children:(0,u.jsxs)("button",{className:"remove-student-link".concat(E?" confirming":""),onClick:()=>{E?(clearTimeout(z.current),j(n.id)):(K(!0),z.current=setTimeout(()=>K(!1),4e3))},children:[(0,u.jsx)(l.qbC,{})," ",E?"Wirklich entfernen?":"Sch\xfcler entfernen"]})})]}),y&&(0,u.jsx)(m.A,{isOpen:!0,sheet:y,readOnly:!0,onClose:()=>w(null),sessionProgress:Q[y.id]||{},studentEntries:X,classStudents:[n],showStudentProgress:!0,classId:s})]}):null},p=e=>(0,u.jsx)("div",{className:"student-modal-overlay",children:(0,u.jsx)(g,(0,a.A)({},e))})},644(e,n,s){s.d(n,{Ay:()=>N});var a=s(9379),t=s(9950),l=s(2875),r=(s(3565),s(9378)),i=s(7901),c=s(3718),o=s(8045),d=s(8989);const m=e=>{const n=(e||"").trim().length;return n<=6?"len-s":n<=14?"len-m":n<=24?"len-l":"len-xl"},u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;const n=e.getMonth()>=7?e.getFullYear():e.getFullYear()-1;return"".concat(n,"/").concat(String(n+1).slice(-2))},h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;const n=(e.getMonth()>=7?e.getFullYear():e.getFullYear()-1)+1;return"".concat(n,"/").concat(String(n+1).slice(-2))};var g=s(4414);const p=e=>{const n=(0,c.TT)(e),s=n.filter(e=>"compact-trash"===e.id);if(s.length)return s;const t=n.filter(e=>!String(e.id).startsWith("year:"));if(t.length)return t;const l=n.filter(e=>String(e.id).startsWith("year:"));return l.length?l:(0,c.fp)((0,a.A)((0,a.A)({},e),{},{droppableContainers:e.droppableContainers.filter(e=>"compact-trash"!==e.id)}))},x=e=>{let{dragging:n,onCreate:s,mobile:a=!1}=e;const{setNodeRef:t,isOver:r}=(0,c.zM)({id:"compact-trash"});return(0,g.jsx)("button",{ref:t,type:"button",className:"compact-create-class-button".concat(a?" mobile-add-class":"").concat(n?" is-delete-target":"").concat(r?" is-over":""),onClick:n?void 0:s,"aria-label":n?"Klasse zum L\xf6schen hier ablegen":"Neue Klasse erstellen",title:n?"Klasse hier ablegen \u2013 L\xf6schen erst nach Best\xe4tigung":"Neue Klasse erstellen",children:n?(0,g.jsx)(l.qbC,{}):(0,g.jsx)(l.OiG,{})})},j=e=>{let{year:n,label:s,count:a,collapsed:t,showHeader:r,showEmpty:i,onToggle:o,children:d}=e;const{setNodeRef:m,isOver:u}=(0,c.zM)({id:"year:".concat(n)});return(0,g.jsxs)("div",{ref:m,className:["school-year-section",u?"is-over":""].filter(
1Boolean).join(" "),children:[r&&(0,g.jsxs)("button",{type:"button",className:"school-year-header",onClick:o,"aria-expanded":!t,children:[(0,g.jsx)(l.Vr3,{className:"school-year-caret".concat(t?" collapsed":"")}),(0,g.jsx)("span",{className:"school-year-label",children:n}),s&&(0,g.jsx)("span",{className:"school-year-tag",children:s}),(0,g.jsx)("span",{className:"school-year-count",children:a})]}),!t&&(0,g.jsxs)("div",{className:"school-year-body",children:[d,i&&0===a&&(0,g.jsx)("div",{className:"school-year-empty",children:"Klasse hierher ziehen"})]})]})},f=e=>{let{onJoinClass:n,onClose:s,mobile:a=!1}=e;const[r,i]=(0,t.useState)(""),[c,o]=(0,t.useState)(!1),[d,m]=(0,t.useState)(null),u=(0,t.useRef)(null);(0,t.useEffect)(()=>{var e;null===(e=u.current)||void 0===e||e.focus()},[]);return(0,g.jsxs)("form",{className:"teacher-join-class".concat(a?" teacher-join-class--mobile":""),onSubmit:async e=>{e.preventDefault();const a=r.trim().toUpperCase();if(4===a.length&&!c){o(!0),m(null);try{await n(a),s()}catch(h){var t,l,i,d,u;const e=(null===h||void 0===h||null===(t=h.data)||void 0===t||null===(l=t.detail)||void 0===l?void 0:l.message)||(null===h||void 0===h||null===(i=h.data)||void 0===i?void 0:i.detail)||(null===h||void 0===h?void 0:h.message);m(404===(null===h||void 0===h?void 0:h.status)?"Diesen Klassencode gibt es nicht.":"free_class_limit"===(null===h||void 0===h||null===(d=h.data)||void 0===d||null===(u=d.detail)||void 0===u?void 0:u.code)?{message:e,code:"free_class_limit"}:403===(null===h||void 0===h?void 0:h.status)?"Diese Klasse nimmt gerade keine Beitrittsanfragen an.":e||"Die Beitrittsanfrage konnte nicht gesendet werden.")}finally{o(!1)}}},children:[(0,g.jsxs)("div",{className:"teacher-join-class__header",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("strong",{children:"Klasse beitreten"}),(0,g.jsx)("span",{children:"Die Klassenleitung best\xe4tigt deine Anfrage."})]}),(0,g.jsx)("button",{type:"button",className:"teacher-join-class__close",onClick:s,"aria-label":"Code-Eingabe schlie\xdfen",children:(0,g.jsx)(l.QCr,{})})]}),(0,g.jsxs)("div",{className:"teacher-join-class__controls",children:[(0,g.jsx)("input",{ref:u,className:"teacher-join-class__input",value:r,onChange:e=>{i(e.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,4)),d&&m(null)},placeholder:"ABCD","aria-label":"Vierstelliger Klassencode","aria-invalid":Boolean(d),maxLength:4,inputMode:"text",autoCapitalize:"characters",autoComplete:"off",spellCheck:!1,disabled:c}),(0,g.jsx)("button",{type:"submit",className:"teacher-join-class__submit",disabled:4!==r.length||c,children:c?"Sende \u2026":"Anfragen"})]}),d&&(0,g.jsx)("p",{className:"teacher-join-class__error",role:"alert",children:"object"===typeof d?d.message:d}),"free_class_limit"===(null===d||void 0===d?void 0:d.code)&&(0,g.jsxs)("div",{className:"teacher-join-class__license-links",children:[(0,g.jsx)("a",{href:"/preise?modell=lehrkraft",children:"Lehrkraft-Lizenz ansehen \u2192"}),(0,g.jsx)("a",{href:"/preise",children:"Schullizenz ansehen \u2192"})]})]})},v=e=>{let{classItem:n,activeClass:s,isCollapsed:t,renamingClass:i,renameInputRef:c,renameValue:u,setRenameValue:h,onSelectClass:p,startRename:x,commitRename:j,cancelRename:f,setClassToDelete:v,onRenameClass:b,onManageTeachers:N,readOnly:k,teacherId:C}=e;const{attributes:_,listeners:y,setNodeRef:w,transform:S,transition:A,isDragging:E}=(0,o.gl)({id:n.id}),K=Number(n.pending_teacher_requests)||0,z=!n.teacher_id||String(n.teacher_id)===String(C),D={transform:d.Ks.Transform.toString(S),transition:A,opacity:E?.5:1};return(0,g.jsxs)("div",(0,a.A)((0,a.A)((0,a.A)({ref:w,style:D,className:"class-card ".concat((null===s||void 0===s?void 0:s.id)===n.id?"active":"").concat(E?" is-dragging":"").concat(K>0?" has-requests":""),"data-class-drop-id":n.id,title:n.name,onClick:()=>(null===i||void 0===i?void 0:i.id)!==n.id&&p(n)},k?{role:"button",tabIndex:0,"aria-label":n.name,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),p(n))}}:{}),k?{}:(0,a.A)((0,a.A)({}
1,_),y)),{},{children:[t&&K>0&&(0,g.jsx)("span",{className:"class-card__request-dot",title:"".concat(K," offene Beitrittsanfrage").concat(K>1?"n":""),children:K}),(0,g.jsxs)("div",{className:"class-drag-handle",children:[(0,g.jsx)("img",{src:(0,r.q)(n.name),className:"class-avatar",alt:"".concat(n.name," class icon")}),n.eduplaces_linked&&(0,g.jsx)("img",{className:"class-eduplaces-mark",src:"/infoPage/Bildmarke-Edu-1K_RZ-k1.svg",alt:"EduPlaces",title:"Mit EduPlaces verkn\xfcpft"})]}),(0,g.jsxs)("div",{className:"class-content",children:[t||(null===i||void 0===i?void 0:i.id)!==n.id?(0,g.jsx)("h3",{className:"class-name ".concat(m(n.name)),children:n.name}):(0,g.jsx)("form",{className:"rename-form",onSubmit:e=>{e.preventDefault(),j()},onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:(0,g.jsx)("input",{ref:c,type:"text",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>"Escape"===e.key&&f(),onBlur:j,maxLength:40,className:"rename-input"})}),!t&&!k&&(null===i||void 0===i?void 0:i.id)!==n.id&&(0,g.jsxs)("div",{className:"class-actions",children:[N&&(0,g.jsxs)("button",{className:"teachers-class-button".concat(K?" has-requests":""),onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),N(n)},title:K?"".concat(K," offene Beitrittsanfrage").concat(K>1?"n":""):"Lehrkr\xe4fte dieser Klasse",children:[(0,g.jsx)(l.M5n,{}),K>0&&(0,g.jsx)("span",{className:"teachers-class-button__badge",children:K})]}),b&&(0,g.jsx)("button",{className:"rename-class-button",onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onClick:e=>x(e,n),title:"Umbenennen",children:(0,g.jsx)(l.Mbp,{})}),z&&(0,g.jsx)("button",{className:"delete-class-button",title:"Klasse l\xf6schen","aria-label":"".concat(n.name," l\xf6schen"),onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),v(n)},children:(0,g.jsx)(l.qbC,{})})]})]})]}))},b=e=>{let{classItem:n,activeClass:s,onSelectClass:t,startRename:l,readOnly:i}=e;const{attributes:c,listeners:u,setNodeRef:h,transform:p,transition:x,isDragging:j}=(0,o.gl)({id:n.id,disabled:i});return(0,g.jsxs)("button",(0,a.A)((0,a.A)({ref:h,style:{transform:d.Ks.Transform.toString(p),transition:x},className:"mobile-class-item ".concat((null===s||void 0===s?void 0:s.id)===n.id?"active":"").concat(Number(n.pending_teacher_requests)>0?" has-requests":"").concat(j?" is-dragging":""),"data-class-drop-id":n.id,title:n.name,onClick:()=>t(n),onDoubleClick:e=>!i&&l(e,n)},i?{}:(0,a.A)((0,a.A)({},c),u)),{},{children:[(0,g.jsxs)("span",{className:"mobile-class-avatar-wrap",children:[(0,g.jsx)("img",{src:(0,r.q)(n.name),className:"mobile-class-avatar",alt:"".concat(n.name," class icon")}),n.eduplaces_linked&&(0,g.jsx)("img",{className:"class-eduplaces-mark",src:"/infoPage/Bildmarke-Edu-1K_RZ-k1.svg",alt:"EduPlaces",title:"Mit EduPlaces verkn\xfcpft"})]}),(0,g.jsx)("span",{className:"mobile-class-name ".concat(m(n.name)),children:n.name}),Number(n.pending_teacher_requests)>0&&(0,g.jsx)("span",{className:"mobile-class-item__request-badge",title:"".concat(n.pending_teacher_requests," offene Beitrittsanfragen"),children:n.pending_teacher_requests})]}))},N=e=>{let{students:n,classes:s,teacherId:d,activeClass:N,onSelectClass:k,onCreateClass:C,onDeleteClass:_,onLeaveClass:y,onRenameClass:w,onReorderClasses:S,onToggleClassOpen:A,onMoveClassToYear:E,onManageTeachers:K,onJoinClass:z,readOnly:D=!1,storageKey:M="selectedClassId"}=e;const[R,L]=(0,t.useState)(!1),[I,P]=(0,t.useState)(u),[F,T]=(0,t.useState)(!1),[O,q]=(0,t.useState)(""),[B,Q]=(0,t.useState)(null),W=!(null!==B&&void 0!==B&&B.teacher_id)||String(B.teacher_id)===String(d),[G,Y]=(0,t.useState)(!1),[Z,V]=(0,t.useState)(window.innerWidth<768),[X,H]=(0,t.useState)(null),[U,J]=(0,t.useState)(""),[$,ee]=(0,t.useState)({}),[ne,se]=(0,t.useState)(!1),[ae,te]=(0,t.useState)(null),[le,re]=(0,t.useState)(null),[ie,ce]=(0,t.useState)(null),oe=(0,t.useRef)(null),de=(0,t.useRef)(null===N||void 0===N?void 0:N.id),me=(0,t.useMemo)(()=>[...new Set(s.map(e=>
1e.school_year).filter(Boolean))].sort().reverse(),[s]),ue=(0,t.useMemo)(()=>{const e=new Set(me);return e.add(u()),e.add(h()),[...e].sort().reverse()},[me]),he=(0,t.useMemo)(()=>function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;const s=u(n),a={};e.forEach(e=>{const n=e.school_year||s;a[n]=(a[n]||0)+1});const t=Object.keys(a);if(!t.length)return s;const l=t.sort((e,n)=>a[n]-a[e]||n.localeCompare(e))[0];return l>s?l:s}(s),[s]),ge=(e=>{const n=parseInt(String(e).slice(0,4),10);return Number.isNaN(n)?h():"".concat(n+1,"/").concat(String(n+2).slice(-2))})(he),pe=[...new Set([u(),h(),ge,...me])].sort(),xe=null!==le&&void 0!==le?le:s,je=(0,t.useMemo)(()=>{const e={};return xe.forEach(n=>{const s=n.school_year||he;(e[s]=e[s]||[]).push(n)}),e},[xe,he]),fe=e=>(null===e||void 0===e?void 0:e.school_year)||he,ve=[...ue,ge].filter((e,n,s)=>s.indexOf(e)===n).filter(e=>(je[e]||[]).length>0).sort().reverse(),be=((e,n,s,a)=>a&&e.includes(a)?a:s&&e.includes(s)?s:e.includes(n)?n:e[0]||n)(ve,he,(null===N||void 0===N?void 0:N.school_year)||he,ie);(0,t.useEffect)(()=>{ce(null)},[null===N||void 0===N?void 0:N.id]);const Ne=(0,t.useRef)(!1),ke=(0,c.FR)((0,c.MS)(c.cA,{activationConstraint:{distance:5}}),(0,c.MS)(c.IG,{activationConstraint:{delay:400,tolerance:8}}));(0,t.useEffect)(()=>{const e=()=>V(window.innerWidth<768);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,t.useEffect)(()=>{if(s.length)if(Ne.current)N&&(0,i.ni)(M,N.id.toString());else{const e=(0,i.$E)(M),n=s.find(n=>n.id.toString()===e)||(je[he]||[])[0]||s[0];N&&N.id===n.id||k(n),Ne.current=!0}},[s,je,he,N,k,M]),(0,t.useEffect)(()=>{null!==N&&void 0!==N&&N.id&&N.id!==de.current&&!R&&Y(!0),de.current=null===N||void 0===N?void 0:N.id},[null===N||void 0===N?void 0:N.id,R]),(0,t.useEffect)(()=>{X&&oe.current&&(oe.current.focus(),oe.current.select())},[X]);const Ce=()=>{O.trim()&&(L(!1),C(O.trim(),I),q(""))},_e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u();P(e),T(!1),L(!0),Y(!1)},ye=(e,n)=>{e.stopPropagation(),H(n),J(n.name)},we=()=>{if(!X)return;const e=U.trim();e&&e!==X.name&&w(X.id,e),H(null),J("")},Se=()=>{H(null),J("")},Ae=e=>{let{active:n,over:t}=e;if(!t)return;if("compact-trash"===t.id)return;const l=null!==le&&void 0!==le?le:s,r=(e=>{let{classes:n,activeId:s,overId:a,yearOf:t}=e;const l=n.find(e=>e.id===s);if(!l)return null;const r=String(a),i=r.startsWith("year:"),c=i?null:n.find(e=>e.id===a),o=i?r.slice(5):c?t(c):null;if(!o)return null;let d;if(c)d=n.findIndex(e=>e.id===a);else{const e=n.filter(e=>e.id!==l.id),s=e.reduce((e,n,s)=>t(n)===o?s:e,-1);d=-1===s?e.length:s+1}return{targetYear:o,newIndex:d,changesYear:o!==t(l)}})({classes:l,activeId:n.id,overId:t.id,yearOf:fe});if(!r)return;if((G||Z)&&r.changesYear)return;const i=l.findIndex(e=>e.id===n.id);-1!==i&&(r.changesYear||i!==r.newIndex)&&re((0,o.be)(l,i,r.newIndex).map(e=>e.id===n.id?(0,a.A)((0,a.A)({},e),{},{school_year:r.targetYear}):e))},Ee=e=>{let{active:n,over:a}=e;const t=le;if(re(null),te(null),!a)return;if("compact-trash"===a.id&&(G||Z)){const e=s.find(e=>e.id===n.id);return void(!e||e.teacher_id&&String(e.teacher_id)!==String(d)&&!y||Q(e))}if(!t)return;const l=s.find(e=>e.id===n.id),r=t.find(e=>e.id===n.id);if(!l||!r)return;if((G||Z)&&a.id!==n.id){const e=s.find(e=>e.id===a.id);if(e&&fe(e)!==fe(l))return}const i=r.school_year!==fe(l),c=t.map(e=>e.id).join()!==s.map(e=>e.id).join();i?null===E||void 0===E||E(l.id,r.school_year,t):c&&(null===S||void 0===S||S(t))};return Z?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"mobile-classes-container",children:[ve.length>1&&(0,g.jsx)("div",{className:"mobile-year-chips",children:ve.map(e=>(0,g.jsx)("button",{className:"mobile-year-chip".concat(e===be?" active":""),onClick:()=>ce(e),children:e},e))}),(0,g.jsxs)(c.Mp,{sensors:ke,collisionDetection:p,onDragStart:e=>{let{active:n}=e;te(n.id),re(s)},onDragOver:Ae,onDragCancel:()=>{te(null),re(null)},onDragEnd:Ee,children:[(0,g.jsxs)("div",{className:"mobile-classes-scroller",children:[(0,g.jsx)("div",{className:"mobile-class-items",children:(0,g.jsx)(o.gB,{items:(je[be]||[]).map(e=>e.id),strategy:o.m$,children:(je[be]||[]).map(e=>(0,g.jsx)(b,{classItem:e,activeClass:N,onSelectClass:k,startRename:ye,readOnly:D},e.id))})}),!D&&(0,g.jsxs)("div",{className:"mobile-class-actions",children:[(0,g.jsx)(x,{mobile:!0,dragging:!!ae,onCreate:()=>_e(be)}),z&&!ae&&(0,g.jsx)("button",{className:"mobile-add-class mobile-join-class",onClick:()=>T(!0),title:"Klasse per Code beitreten","aria-label":"Klasse per Code beitreten",children:(0,g.jsx)(l.NPy,{})})]})]}),(0,g.jsx)(c.Hd,{dropAnimation:{duration:180},children:ae?(()=>{const e=s.find(e=>e.id===ae);return e?(0,g.jsxs)("div",{className:"mobile-class-item mobile-class-item--overlay",children:[(0,g.jsx)("img",{src:(0,r.q)(e.name),className:"mobile-class-avatar",alt:""}),(0,g.jsx)("span",{className:"mobile-class-name",children:e.name})]}):null})():null})]})]}),!D&&R&&(0,g.jsx)("div",{className:"mobile-create-modal",children:(0,g.jsxs)("div",{className:"modal-content",children:[(0,g.jsx)("button",{className:"close-modal",onClick:()=>L(!1),children:(0,g.jsx)(l.QCr,{})}),(0,g.jsx)("h3",{children:"Neue Klasse erstellen"}),(0,g.jsx)("input",{type:"text",value:O,onChange:e=>q(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Ce(),"Escape"===e.key&&L(!1)},placeholder:"Klassenname (z.B. 6A Mathe)",autoFocus:!0,maxLength:40}),(0,g.jsx)("label",{className:"create-class-year-label",htmlFor:"mobile-create-school-year",children:"Schuljahr"}),(0,g.jsx)("select",{id:"mobile-create-school-year",className:"create-class-year-select",value:I,onChange:e=>P(e.target.value),children:pe.map(e=>(0,g.jsx)("option",{value:e,children:e},e))}),(0,g.jsx)("button",{className:"create-button",onClick:Ce,disabled:!O.trim(),children:"Erstellen"})]})}),!D&&F&&z&&(0,g.jsx)("div",{className:"mobile-create-modal",onClick:()=>T(!1),children:(0,g.jsx)("div",{className:"modal-content",onClick:e=>e.stopPropagation(),children:(0,g.jsx)(f,{onJoinClass:z,onClose:()=>T(!1),mobile:!0})})}),!D&&X&&(0,g.jsx)("div",{className:"mobile-create-modal",children:(0,g.jsxs)("div",{className:"modal-content",children:[(0,g.jsx)("button",{className:"close-modal",onClick:Se,children:(0,g.jsx)(l.QCr,{})}),(0,g.jsx)("h3",{children:"Klasse umbenennen"}),(0,g.jsx)("input",{ref:oe,type:"text",value:U,onChange:e=>J(e.target.value),onKeyDown:e=>{"Enter"===e.key&&we(),"Escape"===e.key&&Se()},maxLength:40}),(0,g.jsx)("button",{className:"create-button",onClick:we,disabled:!U.trim(),children:"Umbenennen"})]})}),!D&&B&&(0,g.jsx)("div",{className:"delete-confirmation-modal",children:(0,g.jsxs)("div",{className:"modal-content",children:[(0,g.jsxs)("h3",{children:[B.name," ",W?"l\xf6schen":"verlassen","?"]}),(0,g.jsx)("p",{className:"delete-confirmation-hint",children:W?B.eduplaces_linked?"Die Klasse wird f\xfcr alle Lehrkr\xe4fte gel\xf6scht. Ihre EduPlaces-Gruppe wird abgew\xe4hlt.":"Die \xdcbungsbl\xe4tter und Fortschritte dieser Klasse k\xf6nnen danach nicht mehr aufgerufen werden.":"Du siehst die Klasse danach nicht mehr. F\xfcr die anderen Lehrkr\xe4fte bleibt sie bestehen."}),(0,g.jsxs)("div",{className:"modal-actions",children:[(0,g.jsx)("button",{className:"cancel-delete",onClick:()=>Q(null),children:"Abbrechen"}),(0,g.jsx)("button",{className:"confirm-delete",onClick:()=>{W?_(B.id):null===y||void 0===y||y(B.id),Q(null)},children:W?"L\xf6schen":"Verlassen"})]})]})})]}):(0,g.jsxs)("div",{className:"classes-sidebar ".concat(G?"collapsed":""),children:[(0,g.jsxs)("div",{className:"sidebar-header",children:[!G&&(0,g.jsx)("h2",{children:"Deine Klassen"}),(0,g.jsx)("button",{className:"collapse-button",onClick:()=>{Y(!G)},"aria-label":G?"Expand sidebar":"Collapse sidebar",children:G?(0,g.jsx)(l.X6T,{}):(0,g.jsx)(l._Jj,{})})]}),(0,g.jsxs)(c.Mp,{sensors:ke,collisionDetection:p,onDragStart:e=>{let{active:n}=e;
1te(n.id),re(s)},onDragOver:Ae,onDragCancel:()=>{te(null),re(null)},onDragEnd:Ee,children:[(0,g.jsxs)("div",{className:"class-list-container",children:[(()=>{const e=e=>e.map(e=>(0,g.jsx)(v,{classItem:e,teacherId:d,activeClass:N,isCollapsed:G,renamingClass:X,renameInputRef:oe,renameValue:U,setRenameValue:J,onSelectClass:k,startRename:ye,commitRename:we,cancelRename:Se,setClassToDelete:Q,onRenameClass:w,onManageTeachers:K,readOnly:D},e.id)),n=[...new Set([...me,...ne?[he,ge]:[]])].sort((e,n)=>e===he?-1:n===he?1:n.localeCompare(e)),s=ne||me.length>1,t=n.map(e=>{var n;return{year:e,list:je[e]||[],collapsed:!!s&&(null!==(n=$[e])&&void 0!==n&&n)}}),l=G?xe.map(e=>e.id):t.filter(e=>!e.collapsed).flatMap(e=>e.list.map(e=>e.id));return(0,g.jsx)(o.gB,{items:l,strategy:o._G,children:G?e(xe):t.map(n=>{let{year:t,list:l,collapsed:r}=n;return(0,g.jsx)(j,{year:t,label:t===u()?"aktuell":t===ge?"n\xe4chstes":null,count:l.length,collapsed:r,showHeader:s,showEmpty:ne,onToggle:()=>ee(e=>(0,a.A)((0,a.A)({},e),{},{[t]:!r})),children:e(l)},t)})})})(),(0,g.jsx)(c.Hd,{dropAnimation:{duration:180},children:ae?(()=>{const e=s.find(e=>e.id===ae);return e?(0,g.jsxs)("div",{className:"class-card class-card--overlay".concat(G?" is-compact":""),children:[(0,g.jsx)("div",{className:"class-drag-handle",children:(0,g.jsx)("img",{src:(0,r.q)(e.name),className:"class-avatar",alt:""})}),(0,g.jsx)("div",{className:"class-content",children:(0,g.jsx)("h3",{className:"class-name ".concat(m(e.name)),children:e.name})})]}):null})():null})]}),!D&&(0,g.jsx)("div",{className:"class-list-footer".concat(G?" is-compact":""),children:G?(0,g.jsx)(x,{dragging:!!ae,onCreate:()=>_e()}):R?(0,g.jsxs)("form",{className:"sidebar-create-form",onSubmit:e=>{e.preventDefault(),Ce()},children:[(0,g.jsxs)("div",{className:"sidebar-create-heading",children:[(0,g.jsx)("strong",{children:"Neue Klasse"}),(0,g.jsx)("button",{type:"button",onClick:()=>L(!1),"aria-label":"Klassenerstellung schlie\xdfen",children:(0,g.jsx)(l.QCr,{})})]}),(0,g.jsx)("input",{type:"text",value:O,onChange:e=>q(e.target.value),placeholder:"Name, z. B. 6A Mathe","aria-label":"Klassenname",autoFocus:!0,maxLength:40}),(0,g.jsx)("label",{className:"create-class-year-label",htmlFor:"sidebar-create-school-year",children:"Schuljahr"}),(0,g.jsx)("select",{id:"sidebar-create-school-year",className:"create-class-year-select",value:I,onChange:e=>P(e.target.value),children:pe.map(e=>(0,g.jsx)("option",{value:e,children:e},e))}),(0,g.jsx)("button",{type:"submit",className:"new-class-button",disabled:!O.trim(),children:"Klasse erstellen"})]}):F&&z?(0,g.jsx)(f,{onJoinClass:z,onClose:()=>T(!1)}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("button",{type:"button",className:"new-class-button",onClick:()=>_e(),children:[(0,g.jsx)(l.OiG,{})," Klasse erstellen"]}),(0,g.jsxs)("div",{className:"sidebar-secondary-actions",children:[(0,g.jsxs)("button",{type:"button",className:"sidebar-school-years-button",onClick:()=>se(e=>!e),"aria-expanded":ne,"aria-label":"Schuljahre verwalten, aktuell ".concat(he),title:"Schuljahre verwalten",children:[(0,g.jsx)("span",{children:"Schuljahr"}),(0,g.jsx)("strong",{children:he}),(0,g.jsx)(l.Vr3,{className:ne?"is-open":"","aria-hidden":"true"})]}),z&&(0,g.jsx)("button",{type:"button",className:"sidebar-join-class-button",onClick:()=>{L(!1),T(!0),Y(!1)},"aria-label":"Klasse per Code beitreten",title:"Klasse per Code beitreten",children:(0,g.jsx)(l.NPy,{"aria-hidden":"true"})})]})]})})]}),!D&&B&&(0,g.jsx)("div",{className:"delete-confirmation-modal",children:(0,g.jsxs)("div",{className:"modal-content",children:[(0,g.jsxs)("h3",{children:[B.name," ",W?"l\xf6schen":"verlassen","?"]}),(0,g.jsx)("p",{className:"delete-confirmation-hint",children:W?B.eduplaces_linked?"Die Klasse wird f\xfcr alle Lehrkr\xe4fte gel\xf6scht. Ihre EduPlaces-Gruppe wird abgew\xe4hlt.":"Die \xdcbungsbl\xe4tter und Fortschritte dieser Klasse k\xf6nnen danach nicht mehr aufgerufen werden.":"Du siehst die Klasse danach nicht mehr. F\xfcr die anderen Lehrkr\xe4fte bleibt sie bestehen."}),(0,g.jsxs)("div",{className:"modal-actions",children:[(0,g.jsx)("button",{className:"cancel-delete",onClick:()=>Q(null),children:"Abbrechen"}),(0,g.jsx)("button",{className:"confirm-delete",onClick:()=>{W?_(B.id):null===y||void 0===y||y(B.id),Q(null)},children:W?"L\xf6schen":"Verlassen"})]})]})})]})}},3146(e,n,s){s.d(n,{A:()=>H});
1var a=s(9950),t=s(2875),l=s(4304),r=s(8327),i=s(491),c=s(486),o=s(4414);const d=e=>"managed"===e.auth_provider||"student"===e.role,m=(e,n)=>(n.points||0)-(e.points||0)||(e.name||"").localeCompare(n.name||""),u=e=>{let{student:n,selfSheetCount:s,onSelect:a,index:l=0,isNew:i=!1,isGuest:c=!1}=e;return(0,o.jsxs)("div",{className:"student-card-compact".concat(n.connected?"":" offline").concat(i?" student-card-new":"").concat(c?" is-guest":""),style:{"--i":Math.min(l,6)},"data-tooltip-id":"student-tooltip","data-tooltip-content":"".concat(n.name," - ").concat(n.connected?"Online":"Offline").concat(s>0?" \xb7 ".concat(s," Zusatzblatt").concat(1!==s?"bl\xe4tter":""):""),onClick:a,children:[(0,o.jsx)(r.A,{seed:n.avatar_seed,size:32}),(0,o.jsx)("div",{className:"status-indicator-compact",children:(0,o.jsx)(t.Qp1,{size:6,color:n.connected?"#10B981":"#94A3B8"})}),s>0&&(0,o.jsxs)("div",{className:"self-sheet-badge",children:[(0,o.jsx)(t.Gp9,{className:"self-sheet-badge-icon"}),(0,o.jsx)("span",{className:"self-sheet-badge-count",children:s})]})]})},h=e=>{let{students:n,classId:s,onRemoveStudent:t,readOnly:r=!1}=e;const[h,g]=(0,a.useState)(null),p=(0,a.useMemo)(()=>{var e;return null!==(e=n.find(e=>e.id===h))&&void 0!==e?e:null},[h,n]),[x,j]=(0,a.useState)({}),[f,v]=(0,a.useState)(new Set),[b,N]=(0,a.useState)(!1),k=(0,a.useRef)(null),C=(0,a.useRef)(null);(0,a.useEffect)(()=>{const e=new Set(n.map(e=>e.id));if(null!==k.current){const n=[...e].filter(e=>!k.current.has(e));n.length>0&&(clearTimeout(C.current),v(new Set(n)),C.current=setTimeout(()=>{v(new Set),C.current=null},2500))}k.current=e},[n]),(0,a.useEffect)(()=>()=>clearTimeout(C.current),[]);const{visibleStudents:_,inactiveGuests:y,rankMap:w}=(0,a.useMemo)(()=>{const e=[...n].sort(m),s=new Map(e.map((e,n)=>[e.id,n+1]));return{visibleStudents:e.filter((e,n)=>n<20||d(e)||e.connected),inactiveGuests:e.filter((e,n)=>n>=20&&!d(e)&&!e.connected),rankMap:s}},[n]);(0,a.useEffect)(()=>{if(!s||null===n||void 0===n||!n.length)return;let e=!1;return(0,c.XON)(s).then(n=>{e||j(null!==n&&void 0!==n?n:{})}).catch(()=>{}),()=>{e=!0}},[s]);return(0,o.jsxs)("div",{className:"student-list-wrapper",children:[(0,o.jsxs)("div",{className:"student-list-compact",children:[_.map((e,n)=>(0,o.jsx)(u,{student:e,selfSheetCount:x[e.id]||0,onSelect:()=>g(e.id),index:n,isNew:f.has(e.id)},e.id)),y.length>0&&(0,o.jsxs)("button",{className:"guest-count-pill".concat(b?" is-expanded":""),onClick:()=>N(e=>!e),"data-tooltip-id":"student-tooltip","data-tooltip-content":"".concat(y.length," inaktive Gast-").concat(1===y.length?"Account":"Accounts"),children:["+",y.length]}),b&&y.map((e,n)=>(0,o.jsx)(u,{student:e,selfSheetCount:x[e.id]||0,onSelect:()=>g(e.id),index:n,isNew:!1,isGuest:!0},e.id))]}),p&&(0,o.jsx)(i.default,{student:p,classId:s,rank:w.get(p.id)||n.length,totalStudents:n.length,onClose:()=>g(null),onRemove:r?null:e=>{t&&t(e),g(null)}}),(0,o.jsx)(l.m_,{id:"student-tooltip",place:"top",effect:"solid"})]})};var g,p,x,j,f,v,b,N=s(7528),k=s(9163),C=s(4937),_=s(5887);const y=C.Ay.div(g||(g=(0,N.A)(["\n position: fixed;\n bottom: 2rem;\n left: 50%;\n transform: translateX(-50%);\n background: white;\n color: #1e293b;\n padding: 1.5rem;\n border-radius: 12px;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1rem;\n max-width: 90%;\n width: 500px;\n box-shadow: 0 8px 30px rgba(0,0,0,0.15);\n animation: fadeIn 0.3s ease;\n z-index: 1001;\n border: 1px solid #e2e8f0;\n\n @keyframes fadeIn {\n from { opacity: 0; transform: translateX(-50%) translateY(10px); }\n to { opacity: 1; transform: translateX(-50%) translateY(0); }\n }\n\n .hint-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n width: 100%;\n }\n\n .hint-title {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-weight: 600;\n font-size: 1.1rem;\n color: #4f46e5;\n }\n\n .qr-instruction-image {\n height: 170px;\n object-fit: contain;\n }\n\n .hint-text {\n text-align: center;\n line-height: 1.5;\n max-width: 400px;\n }\n\n .close-btn {\n background: transparent;\n border: none;\n color: #64748b;\n cursor: pointer;\n padding: 0.25rem;\n transition: all 0.2s;\n border-radius: 50%;\n\n &:hover {\n background: #f1f5f9;\n color: #475569;\n }\n }\n"]))),w=C.Ay.div(p||(p=(0,N.A)(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: white;\n z-index: 1000;\n display: flex;\n flex-direction: column;
1\n align-items: center;\n justify-content: center;\n padding: 1.5rem;\n"]))),S=C.Ay.div(x||(x=(0,N.A)(["\n text-align: center;\n margin-bottom: 1.5rem;\n max-width: 800px;\n\n h2 {\n font-size: 2rem;\n color: #1e293b;\n margin-bottom: 0.5rem;\n }\n\n p {\n font-size: 1.1rem;\n color: #64748b;\n margin-bottom: 1.5rem;\n }\n"]))),A=C.Ay.div(j||(j=(0,N.A)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1.5rem;\n margin-bottom: 2rem;\n"]))),E=C.Ay.div(f||(f=(0,N.A)(["\n background: white;\n padding: 1.5rem;\n border-radius: 16px;\n box-shadow: 0 8px 30px rgba(0,0,0,0.1);\n"]))),K=C.Ay.div(v||(v=(0,N.A)(["\n display: flex;\n align-items: center;\n gap: 1rem;\n background: #f8fafc;\n padding: 1rem 1.5rem;\n border-radius: 12px;\n margin-top: 1rem;\n\n .code {\n font-size: 2.5rem;\n font-weight: 700;\n letter-spacing: 0.3rem;\n color: #4f46e5;\n font-family: 'Courier New', monospace;\n }\n\n button {\n background: #e0e7ff;\n color: #4f46e5;\n border: none;\n border-radius: 8px;\n padding: 0.5rem 1rem;\n font-size: 0.9rem;\n font-weight: 500;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n transition: all 0.2s;\n\n &:hover {\n background: #c7d2fe;\n }\n }\n"]))),z=C.Ay.button(b||(b=(0,N.A)(["\n position: absolute;\n top: 1.5rem;\n right: 1.5rem;\n background: none;\n border: none;\n font-size: 1.25rem;\n cursor: pointer;\n color: #64748b;\n padding: 0.5rem;\n border-radius: 50%;\n transition: all 0.2s;\n\n &:hover {\n background: #f1f5f9;\n color: #475569;\n }\n"]))),D=e=>{let{shareCode:n,students:s,classInfo:l,onClose:r,classId:i,onToggleClassOpen:d}=e;const m="local"===(0,c.LrY)()?"localhost:3000/join?code=".concat(n):"https://livinglines.app/join?code=".concat(n),u=m.match(/code=([a-zA-Z0-9-]+)/),g=u?u[1]:n,p=(0,a.useRef)(!1),[x,j]=(0,a.useState)(()=>0===s.length&&!localStorage.getItem("qr_instruction_dismissed"));return(0,a.useEffect)(()=>{if(!g.match(/^[a-zA-Z0-9-]+$/))return console.error("Invalid share code format:",n),void r();i&&d&&!p.current&&(d(i,!0),p.current=!0)},[g,n,i,d,r]),(0,o.jsxs)(w,{children:[(0,o.jsx)(z,{onClick:r,"aria-label":"Schlie\xdfen",children:(0,o.jsx)(t.QCr,{})}),(0,o.jsxs)(S,{children:[(0,o.jsxs)("h2",{children:["Klasse ",l.name," beitreten"]}),(0,o.jsxs)("p",{children:["Scannen Sie diesen QR-Code, um der Klasse ",l.name," beizutreten"]})]}),(0,o.jsxs)(A,{children:[(0,o.jsx)(E,{children:(0,o.jsx)(k.h,{value:m,size:280,level:"H"})}),(0,o.jsxs)(K,{children:[(0,o.jsx)("span",{className:"code",children:g}),(0,o.jsxs)("button",{onClick:()=>{navigator.clipboard.writeText(m),_.Ay.success("Link erfolgreich kopiert!",{position:"bottom-right",style:{background:"#4f46e5",color:"#fff"}})},children:[(0,o.jsx)(t.paH,{})," Link kopieren"]})]})]}),(0,o.jsx)("div",{style:{width:"100%",maxWidth:"800px"},children:(0,o.jsx)(h,{students:s,onRemoveStudent:()=>{}})}),x&&(0,o.jsxs)(y,{children:[(0,o.jsxs)("div",{className:"hint-header",children:[(0,o.jsxs)("div",{className:"hint-title",children:[(0,o.jsx)(t.__w,{}),(0,o.jsx)("span",{children:"Anleitung f\xfcr Lehrkr\xe4fte"})]}),(0,o.jsx)("button",{className:"close-btn",onClick:()=>{localStorage.setItem("qr_instruction_dismissed","true"),j(!1)},"aria-label":"Hinweis schlie\xdfen",children:(0,o.jsx)(t.QCr,{size:16})})]}),(0,o.jsx)("img",{src:"/show-qr-code.png",alt:"QR-Code im Unterricht zeigen",className:"qr-instruction-image"}),(0,o.jsx)("p",{className:"hint-text",children:"Zeigen oder teilen Sie diesen QR-Code so, dass Sch\xfcler*innen ihn mit ihrem Tablet scannen und der Klasse beitreten k\xf6nnen."})]})]})};var M=s(757),R=s(7818),L=s(2994);const I=e=>{let{shareCode:n}=e;const s=(0,L.Zp)(),{t:a}=(0,R.Bd)("common");return(0,o.jsxs)("button",{className:"class-link-button secondary",onClick:()=>s("/join?code=".concat(n)),children:[(0,o.jsx)(t.mFx,{className:"class-link-icon"}),(0,o.jsx)("span",{className:"class-link-text",children:a("header.goToClassView")})]})};var P=s(9379),F=s(7119),T=s(9613),O=s(6911),q=s(1044);const B=["klug","mutig","sanft","lustig","nett","gl\xfccklich","stolz","weise","schnell","tapfer","geduldig","freundlich","witzig","schlau","besonnen","listig","kreativ","ruhig","herzlich","flink","wachsam","z\xe4rtlich","willensstark","bescheiden","fr\xf6hlich","flei\xdfig","redlich","vertr\xe4umt","witzvoll","einfallsreich","treu","tollk\xfchn","hilfsbereit","aufmerksam","neugierig","gewitzt","gro\xdfz\xfcgig","liebevoll","sorgsam","warmherzig","aufgeweckt","einf\xfchlsam","gutherzig","verspielt","beschwingt","h\xf6flich","optimistisch","zielsicher","frisch","gewandt","lebendig","strahlend"],Q=[{name:"L\xf6we",gender:"m"},{name:"Tiger",gender:"m"},{name:"B\xe4r",gender:"m"},{name:"Fuchs",gender:"m"},{name:"Wolf",gender:"m"},{name:"Falke",gender:"m"},{name:"Hirsch",gender:"m"},{name:"Kauz",gender:"m"},{name:"Dachs",gender:"m"},{name:"Panther",gender:"m"},{name:"Adler",gender:"m"},{name:"Rabe",gender:"m"},{name:"Otter",gender:"m"},{name:"Panda",gender:"m"},{name:"Pinguin",gender:"m"},{name:"Eule",gender:"f"},{name:"Maus",gender:"f"},{name:"Kr\xe4he",gender:"f"},{name:"Libelle",gender:"f"},{name:"Biene",gender:"f"},{name:"Giraffe",gender:"f"},{name:"Robbe",gender:"f"},{name:"Katze",gender:"f"},{name:"Gazelle",gender:"f"},{name:"Schaf",gender:"n"},{name:"Pferd",gender:"n"},{name:"Reh",gender:"n"},{name:"Kaninchen",gender:"n"},{name:"Murmeltier",gender:"n"},{name:"Eichh\xf6rnchen",gender:"n"},{name:"Cham\xe4leon",gender:"n"},{name:"K\xe4nguru",gender:"n"},{name:"Faultier",gender:"n"},{name:"Zebra",gender:"n"},{name:"Alpaka",gender:"n"},{name:"Erdm\xe4nnchen",gender:"n"}],W=e=>String(null!==e&&void 0!==e?e:"").trim().toLocaleLowerCase("de");function G(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Math.random;const n=B[Math.floor(e()*B.length)],s=Q[Math.floor(e()*Q.length)],a="m"===s.gender?"er":"f"===s.gender?"e":"es";return"".concat(n).concat(a," ").concat(s.name)}const Y=e=>{const n="local"===(0,c.LrY)()?"http://localhost:3000":"https://livinglines.app";return"".concat(n,"/auto-login?token=").concat(e)},Z=e=>{let{seed:n,size:s=52,onClick:a}=e;const t=(0,T.gn)(O,{seed:n||"default",size:s,backgroundColor:["b6e3f4"],mouth:["variant05","variant06"],eyebrows:["variant10","variant15"],accessories:["none"]});return(0,o.jsx)("div",{className:"scm-avatar-svg".concat(a?" scm-avatar-clickable":""),style:{width:s,height:s},onClick:a,title:a?"Avatar \xe4ndern":void 0,dangerouslySetInnerHTML:{__html:t}})},V=e=>{let{student:n,isDuplicate:s,onRename:l,onDelete:r,onAvatarChange:i}=e;const[c,d]=(0,a.useState)(!1),[m,u]=(0,a.useState)(n.name),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{u(n.name)},[n.name]),(0,a.useEffect)(()=>{var e;c&&(null===(e=h.current)||void 0===e||e.focus())},[c]);const g=async()=>{const e=m.trim();if(!e)return d(!1),void u(n.name);if(e!==n.name){await l(n.id,e)||u(n.name)}d(!1)};return(0,o.jsxs)("div",{className:"scm-student-card",children:[(0,o.jsx)("button",{className:"scm-card-delete no-print",onClick:()=>r(n.id),title:"L\xf6schen",children:(0,o.jsx)(t.QCr,{})}),(0,o.jsxs)("div",{className:"scm-card-left",children:[(0,o.jsx)(Z,{seed:n.avatar_seed,size:52,onClick:()=>i(n.id)}),(0,o.jsxs)("div",{className:"scm-card-name-area",children:[c?(0,o.jsx)("input",{ref:h,value:m,onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&g(),"Escape"===e.key&&(d(!1),u(n.name))},onBlur:g,className:"scm-name-input"}):(0,o.jsx)("span",{className:"scm-card-name".concat(s?" scm-card-name--duplicate":""),onClick:()=>
1d(!0),title:s?"Diesen Namen gibt es in der Klasse mehrfach. Zum \xc4ndern anklicken.":void 0,children:n.name}),s&&!c&&(0,o.jsx)("span",{className:"scm-card-duplicate-badge no-print",children:"doppelt"})]})]}),n.login_token&&(0,o.jsx)(k.h,{value:Y(n.login_token),size:88,level:"M",className:"scm-card-qr"})]})},X=e=>{let{classId:n,className:s,onClose:l}=e;const[r,i]=(0,a.useState)([]),[d,m]=(0,a.useState)(!0),[u,h]=(0,a.useState)(!1),[g,p]=(0,a.useState)(1);(0,a.useEffect)(()=>{(0,c.wX7)(n).then(i).catch(()=>{}).finally(()=>m(!1))},[n]),(0,a.useEffect)(()=>{const e=()=>p(Math.min(1,(window.innerWidth-40)/800));return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const x=function(e){const n=new Map;return e.forEach(e=>{const s=W(e);s&&n.set(s,(n.get(s)||0)+1)}),new Set([...n].filter(e=>{let[,n]=e;return n>1}).map(e=>{let[n]=e;return n}))}(r.map(e=>e.name)),j=async e=>{const s=Math.min(e,50-r.length);if(!(s<=0)){h(!0);try{const e=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Math.random;const a=new Set(n.map(W)),t=[];for(let l=0;l<e;l+=1){let e=null;for(let n=0;n<200;n+=1){const n=G(s);if(!a.has(W(n))){e=n;break}}if(!e){const n=G(s);let t=2;for(;a.has(W("".concat(n," ").concat(t)));)t+=1;e="".concat(n," ").concat(t)}a.add(W(e)),t.push(e)}return t}(s,r.map(e=>e.name)),a=await(0,c.sYm)(n,s,e);
1i(e=>[...e,...a])}catch(t){var a;const e=(null===t||void 0===t||null===(a=t.data)||void 0===a?void 0:a.detail)||(null===t||void 0===t?void 0:t.message)||"Fehler beim Erstellen";_.Ay.error(e,{duration:5e3})}finally{h(!1)}}},f=async e=>{const n=r.slice(-e);if(n.length){h(!0);try{await Promise.all(n.map(e=>(0,c.QaP)(e.id))),i(e=>e.slice(0,e.length-n.length))}catch(s){_.Ay.error("Fehler beim L\xf6schen")}finally{h(!1)}}},v=async(e,n)=>{try{const s=await(0,c.V3u)(e,n);return i(n=>n.map(n=>n.id===e?(0,P.A)((0,P.A)({},n),{},{name:s.name}):n)),!0}catch(s){return _.Ay.error((null===s||void 0===s?void 0:s.message)||"Fehler beim Umbenennen"),!1}},b=async e=>{try{await(0,c.QaP)(e),i(n=>n.filter(n=>n.id!==e))}catch(n){_.Ay.error("Fehler beim L\xf6schen")}},N=async e=>{try{const n=await(0,c.UtY)(e);i(s=>s.map(s=>s.id===e?(0,P.A)((0,P.A)({},s),{},{avatar_seed:n.avatar_seed}):s))}catch(n){}},k=(0,a.useRef)(null),C=(0,q.R)({contentRef:k,documentTitle:"",pageStyle:"@page { size: A4; margin: 0; }",preserveAfterPrint:!0});(0,a.useEffect)(()=>()=>{var e;return null===(e=document.getElementById("printWindow"))||void 0===e?void 0:e.remove()},[]);const y=!d&&0===r.length,w=(0,o.jsxs)("div",{className:"scm-overlay",id:"scm-print-root",children:[(0,o.jsxs)("div",{className:"scm-toolbar no-print",children:[(0,o.jsx)("span",{className:"scm-title",children:"Zugangskarten"}),(0,o.jsxs)("div",{className:"scm-count-group",children:[(0,o.jsx)("button",{className:"scm-count-jump",onClick:()=>f(10),disabled:u||r.length<1,children:"\u221210"}),(0,o.jsx)("button",{onClick:()=>f(1),disabled:u||r.length<1,children:(0,o.jsx)(t.iu5,{})}),(0,o.jsx)("span",{className:"scm-count-value",children:r.length}),(0,o.jsx)("button",{onClick:()=>j(1),disabled:u||r.length>=50,children:(0,o.jsx)(t.OiG,{})}),(0,o.jsx)("button",{className:"scm-count-jump",onClick:()=>j(10),disabled:u||r.length>=50,children:"+10"})]}),(0,o.jsx)("div",{className:"scm-toolbar-spacer"}),r.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"scm-toolbar-divider"}),(0,o.jsxs)("button",{className:"scm-print-btn",onClick:C,children:[(0,o.jsx)(t.n4o,{})," ",(0,o.jsx)("span",{className:"scm-btn-text",children:"Drucken"})]})]}),(0,o.jsx)("button",{className:"scm-close-btn",onClick:l,title:"Schlie\xdfen",children:(0,o.jsx)(t.QCr,{})})]}),d?(0,o.jsx)("div",{className:"scm-loading no-print",children:"Lade\u2026"}):y?(0,o.jsx)("div",{className:"scm-empty no-print",children:(0,o.jsxs)("div",{className:"scm-empty-card",children:[(0,o.jsx)("div",{className:"scm-empty-howto",children:(0,o.jsx)("img",{src:"/how-to-contact-cards.webp",alt:"Anleitung Zugangskarten"})}),(0,o.jsxs)("p",{className:"scm-empty-desc",children:["Erstelle Accounts f\xfcr deine Klasse und drucke die Zugangskarten aus.",(0,o.jsx)("br",{}),"Sch\xfclerinnen und Sch\xfcler k\xf6nnen sich damit ganz einfach und datenschutzkonform von \xfcberall anmelden."]}),(0,o.jsx)("button",{className:"scm-create-btn",onClick:()=>j(10),disabled:u||r.length>=50,children:u?"Erstelle\u2026":"10 Zugangskarten erstellen"})]})}):(0,o.jsxs)(o.Fragment,{children:[x.size>0&&(0,o.jsxs)("div",{className:"scm-duplicate-hint no-print",role:"status",children:[1===x.size?"Ein Name kommt in dieser Klasse doppelt vor.":"".concat(x.size," Namen kommen in dieser Klasse doppelt vor.")," ","Klicke auf einen markierten Namen, um ihn zu \xe4ndern."]}),(0,o.jsx)("div",{className:"scm-zoom-wrapper",style:g<1?{zoom:g}:void 0,children:(0,o.jsx)("div",{ref:k,className:"scm-print-content",children:(()=>{const e=(n=r,s=27,Array.from({length:Math.ceil(n.length/s)},(e,a)=>n.slice(a*s,a*s+s)));var n,s;return e.map((n,s)=>(0,o.jsxs)("div",{className:"scm-page-group".concat(s===e.length-1?" scm-page-group--last":""),children:[(0,o.jsx)("div",{className:"scm-grid",children:n.map(e=>{return(0,o.jsx)(V,{student:e,isDuplicate:(n=e.name,s=x,s.has(W(n))),onRename:v,onDelete:b,onAvatarChange:N},e.id);var n,s})}),(0,o.jsx)("div",{className:"scm-page-label no-print",children:e.length>1?"Seite ".concat(s+1," / ").concat(e.length):"".concat(n.length," Karten")})]},s))})()})})]})]});return(0,F.createPortal)(w,document.body)},H=e=>{let{classes:n=[],classStudents:s,classTeachers:l=[],activeClass:i,school:d,teacher:m=null,onManageTeachers:u,onRenameClass:g,onDeleteClass:p,onLeaveClass:x,onRemoveStudent:j,onToggleClassOpen:f,teacherId:v,hasClasses:b,readOnly:N=!1,headerExtra:k=null,importSheet:C=null,importToken:y=null,onClearImport:w,openSheetId:S=null,onSheetOpened:A,importPanelEl:E=null}=e;const[K,z]=(0,a.useState)(!1),[R,L]=(0,a.useState)(!1),[P,F]=(0,a.useState)(!1),T=window.innerWidth<768,O=l.filter(e=>e.is_class_teacher),[q,B]=(0,a.useState)(!1),[Q,W]=(0,a.useState)(!1),[G,Y]=(0,a.useState)(""),[Z,V]=(0,a.useState)(!1),[H,U]=(0,a.useState)(!1),J=!(null!==i&&void 0!==i&&i.teacher_id)||String(i.teacher_id)===String(null===m||void 0===m?void 0:m.id),$=(0,a.useRef)(null),ee=(0,a.useRef)(null);(0,a.useEffect)(()=>
1{if(!q)return;const e=e=>{$.current&&!$.current.contains(e.target)&&B(!1)},n=e=>{"Escape"===e.key&&B(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",n),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",n)}},[q]),(0,a.useEffect)(()=>{Q&&ee.current&&(ee.current.focus(),ee.current.select())},[Q]);const ne=()=>{const e=G.trim();e&&e!==(null===i||void 0===i?void 0:i.name)&&(null===g||void 0===g||g(i.id,e)),W(!1)},se=i?"local"===(0,c.LrY)()?"http://localhost:3000/join?code=".concat(i.code):"https://livinglines.app/join?code=".concat(i.code):"",[ae,te]=(0,a.useState)(!1),le=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!ae)return;const e=e=>{le.current&&!le.current.contains(e.target)&&te(!1)},n=e=>{"Escape"===e.key&&te(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",n),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",n)}},[ae]);const re=()=>{se&&(navigator.clipboard.writeText(se),_.Ay.success("Link kopiert"),te(!1))};return(0,o.jsxs)("div",{className:"class-details",children:[K&&i&&!N&&(0,o.jsx)(D,{shareCode:i.code,students:s,classInfo:{name:i.name,school:d,is_open:i.is_open},onClose:()=>z(!1),classId:i.id,onToggleClassOpen:f}),i?(0,o.jsxs)("div",{className:"class-management",children:[(0,o.jsxs)("div",{className:"class-header",children:[(0,o.jsxs)("div",{className:"class-header__title",children:[Q?(0,o.jsx)("form",{className:"class-header__rename-form",onSubmit:e=>{e.preventDefault(),ne()},children:(0,o.jsx)("input",{ref:ee,type:"text",value:G,onChange:e=>Y(e.target.value),onBlur:ne,onKeyDown:e=>{"Escape"===e.key&&W(!1)},maxLength:40})}):(0,o.jsx)("h2",{children:i.name}),O.length>1&&(()=>{const e="Team: ".concat(O.map(e=>e.name||e.email||"\u2013").join(", ")),n=(0,o.jsxs)(o.Fragment,{children:[O.slice(0,4).map(e=>(0,o.jsx)("span",{className:"class-teacher-badge__avatar",children:(0,o.jsx)(r.A,{seed:e.avatar_seed||e.name||e.id,size:22})},e.id)),O.length>4&&(0,o.jsxs)("span",{className:"class-teacher-badge__more",children:["+",O.length-4]})]});return u?(0,o.jsx)("button",{type:"button",className:"class-teacher-badge",onClick:()=>u(i),title:e,"aria-label":"Lehrkr\xe4fte dieser Klasse verwalten",children:n}):(0,o.jsx)("span",{className:"class-teacher-badge class-teacher-badge--static",title:e,children:n})})()]}),(0,o.jsxs)("div",{className:"header-actions",ref:le,children:[k,!N&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(I,{shareCode:i.code}),(0,o.jsxs)("div",{className:"header-menu",children:[(0,o.jsxs)("button",{className:"header-action".concat(ae?" is-open":""),onClick:()=>te(e=>!e),"aria-haspopup":"menu","aria-expanded":ae,"aria-label":"Sch\xfcler einladen",children:[(0,o.jsx)(t.NPy,{}),(0,o.jsx)("span",{className:"header-action__label",children:"Einladen"}),(0,o.jsx)(t.Vr3,{className:"header-action__caret"})]}),ae&&(0,o.jsxs)("div",{className:"header-menu__list",role:"menu",children:[T&&navigator.share&&(0,o.jsxs)("button",{onClick:async()=>{if(navigator.share)try{await navigator.share({url:se})}catch(e){}else re();te(!1)},children:[(0,o.jsx)(t.eb3,{})," Einladungslink teilen"]}),(0,o.jsxs)("button",{onClick:re,children:[(0,o.jsx)(t.AnD,{})," Einladungslink kopieren"]}),(0,o.jsxs)("button",{onClick:()=>{z(!0),te(!1)},children:[(0,o.jsx)(t.Acq,{})," QR-Code anzeigen"]}),(0,o.jsxs)("button",{onClick:()=>{L(e=>!e),te(!1)},children:[(0,o.jsx)(t.AWX,{})," Zugangskarten"]})]})]}),(0,o.jsxs)("div",{className:"header-menu header-menu--more",ref:$,children:[(0,o.jsx)("button",{className:"header-action header-action--icon-only".concat(q?" is-open":""),onClick:()=>B(e=>!e),"aria-haspopup":"menu","aria-expanded":q,"aria-label":"Weitere Klassenoptionen",children:(0,o.jsx)(t.HFM,{})}),q&&(0,o.jsxs)("div",{className:"header-menu__list header-menu__list--right",role:"menu",children:[g&&(0,o.jsxs)("button",{onClick:()=>{Y((null===i||void 0===i?void 0:i.name)||""),W(!0),B(!1)},children:[(0,o.jsx)(t.Mbp,{})," Umbenennen"]}),u&&(0,o.jsxs)("button",{onClick:()=>{u(i),B(!1)},children:[(0,o.jsx)(t.M5n,{})," Lehrkr\xe4fte verwalten"]}),p&&J&&(0,o.jsxs)("button",{className:"header-menu__item--danger",onClick:()=>{V(!0),B(!1)},children:[(0,o.jsx)(t.qbC,{})," Klasse l\xf6schen"]}),x&&!J&&(0,o.jsxs)("button",{className:"header-menu__item--danger",onClick:()=>{U(!0),B(!1)},children:[(0,o.jsx)(t.axc,{})," Klasse verlassen"]}
1)]})]})]})]})]}),H&&(0,o.jsx)("div",{className:"class-delete-overlay",onClick:()=>U(!1),children:(0,o.jsxs)("div",{className:"class-delete-modal",onClick:e=>e.stopPropagation(),children:[(0,o.jsx)("button",{className:"class-delete-modal__close",onClick:()=>U(!1),"aria-label":"Abbrechen",children:(0,o.jsx)(t.QCr,{})}),(0,o.jsxs)("h3",{children:[i.name," verlassen?"]}),(0,o.jsx)("p",{children:"Du siehst die Klasse danach nicht mehr. F\xfcr die anderen Lehrkr\xe4fte bleibt sie bestehen."}),(0,o.jsxs)("div",{className:"class-delete-modal__actions",children:[(0,o.jsx)("button",{className:"class-delete-modal__cancel",onClick:()=>U(!1),children:"Abbrechen"}),(0,o.jsx)("button",{className:"class-delete-modal__confirm",onClick:()=>{x(i.id),U(!1)},children:"Verlassen"})]})]})}),Z&&(0,o.jsx)("div",{className:"class-delete-overlay",onClick:()=>V(!1),children:(0,o.jsxs)("div",{className:"class-delete-modal",onClick:e=>e.stopPropagation(),children:[(0,o.jsx)("button",{className:"class-delete-modal__close",onClick:()=>V(!1),"aria-label":"Abbrechen",children:(0,o.jsx)(t.QCr,{})}),(0,o.jsxs)("h3",{children:[i.name," l\xf6schen?"]}),(0,o.jsx)("p",{children:i.eduplaces_linked?"Die Klasse wird f\xfcr alle Lehrkr\xe4fte gel\xf6scht. Ihre EduPlaces-Gruppe wird abgew\xe4hlt.":"Die \xdcbungsbl\xe4tter und Fortschritte der Klasse k\xf6nnen danach nicht mehr aufgerufen werden."}),(0,o.jsxs)("div",{className:"class-delete-modal__actions",children:[(0,o.jsx)("button",{className:"class-delete-modal__cancel",onClick:()=>V(!1),children:"Abbrechen"}),(0,o.jsx)("button",{className:"class-delete-modal__confirm",onClick:()=>{p(i.id),V(!1)},children:"L\xf6schen"})]})]})}),(0,o.jsx)("div",{className:"student-section",children:s.length>0?(0,o.jsx)(h,{students:s,classId:i.id,onRemoveStudent:j,readOnly:N}):!T&&!N&&P&&(0,o.jsxs)("div",{className:"empty-students-message",children:[(0,o.jsx)("img",{src:"/show-qr-code.png",alt:"QR-Code im Unterricht zeigen",className:"qr-instruction-image"}),(0,o.jsx)("p",{children:"Sch\xfcler k\xf6nnen \xfcber einen QR-Code der Klasse beitreten."}),(0,o.jsxs)("button",{className:"share-qr-button",onClick:()=>z(!0),children:[(0,o.jsx)(t.eb3,{})," QR-Code anzeigen"]})]})}),!N&&R&&(0,o.jsx)(X,{classId:i.id,activeClassName:i.name,onClose:()=>L(!1)}),(0,o.jsx)(M.A,{classId:i.id,className:i.name,teacherId:v,classStudents:s,classTeachers:l,readOnly:N,showStudentProgress:!0,showTeacherProgress:!0,onSheetsLoaded:e=>F(e.length>0),importSheet:C,importToken:y,onClearImport:w,openSheetId:S,onSheetOpened:A,importPanelEl:E},i.id)]}):(0,o.jsx)("div",{className:"no-class-selected",children:b?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"placeholder-icon",children:(0,o.jsx)(t.Acq,{size:48})}),(0,o.jsx)("h3",{children:"W\xe4hle eine Klasse aus"}),(0,o.jsx)("p",{children:"W\xe4hle eine Klasse aus der Seitenleiste, um Sch\xfcler und Freigabeoptionen zu sehen"})]}):(0,o.jsx)(o.Fragment,{children:N?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"placeholder-icon",children:(0,o.jsx)(t.Acq,{size:48})}),(0,o.jsx)("h3",{children:"Keine Klassen vorhanden"}),(0,o.jsx)("p",{children:"F\xfcr diese Lehrkraft sind aktuell keine Klassen hinterlegt."})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("img",{src:"/teacher-welcome.png",alt:"Willkommen bei Ihrer Klassenverwaltung",className:"welcome-image"}),(0,o.jsx)("h3",{children:"Erstelle deine erste Klasse"}),(0,o.jsx)("p",{className:"create-class-prompt",children:"Mit dem + kannst du deine erste Klasse erstellen."})]})})})]})}},5177(e,n,s){s.d(n,{A:()=>l});s(9950);var a=s(8327),t=s(4414);const l=e=>{let{query:n,onQueryChange:s,suggestions:l=[],onSelect:r,placeholder:i="Name oder E-Mail",disabled:c=!1,emptyState:o=null}=e;return(0,t.jsxs)("div",{className:"person-autocomplete",children:[(0,t.jsx)("input",{type:"text",className:"person-autocomplete__input",value:n,onChange:e=>s(e.target.value),placeholder:i,disabled:c}),l.length>0&&(0,t.jsx)("div",{className:"person-autocomplete__list",children:l.map(e=>(0,t.jsxs)("button",{type:"button",className:"person-autocomplete__item",onClick:()=>
1r(e),children:[(0,t.jsx)(a.A,{seed:e.avatar_seed||e.name||e.id,size:28}),(0,t.jsxs)("span",{className:"person-autocomplete__details",children:[(0,t.jsx)("span",{className:"person-autocomplete__name",children:e.name||"\u2013"}),(0,t.jsx)("span",{className:"person-autocomplete__email",children:e.email||"\u2013"})]}),e.school_name&&(0,t.jsx)("span",{className:"person-autocomplete__school",children:e.school_name})]},e.id))}),0===l.length&&o]})}},7831(e,n,s){s.d(n,{Ay:()=>d,Bt:()=>c,Me:()=>i,XX:()=>o});var a=s(9950),t=s(2875),l=s(24),r=(s(4565),s(4414));const i=e=>{var n;let{account:s,badge:t,tone:i="neutral"}=e;if(!s)return null;const c=Object.entries(s.counts||{});return(0,r.jsxs)("div",{className:"account-card account-card--".concat(i),children:[t&&(0,r.jsx)("span",{className:"account-card__badge",children:t}),(0,r.jsx)("div",{className:"account-card__name",children:s.name||"(ohne Namen)"}),(0,r.jsx)("div",{className:"account-card__meta",children:[s.role_label,s.school_name,s.email].filter(Boolean).join(" \xb7 ")}),s.created_at&&(0,r.jsxs)("div",{className:"account-card__meta",children:["Angelegt am ",(o=s.created_at,o?new Date(o).toLocaleDateString("de-DE"):null)]}),(null===(n=s.login_methods)||void 0===n?void 0:n.length)>0&&(0,r.jsx)("ul",{className:"account-card__methods",children:s.login_methods.map(e=>(0,r.jsxs)("li",{children:[(0,r.jsx)(l.rb,{provider:e.provider,size:14}),(0,r.jsxs)("span",{children:[e.label,e.detail&&(0,r.jsxs)("span",{className:"account-card__method-detail",children:[" ",e.detail]})]})]},"".concat(e.provider,"-").concat(e.detail||e.label)))}),c.length>0?(0,r.jsx)("dl",{className:"account-card__counts",children:c.map(e=>{let[n,s]=e;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("dt",{children:n}),(0,r.jsx)("dd",{children:s})]},n)})}):(0,r.jsx)("div",{className:"account-card__meta",children:"Noch keine Inhalte"})]});var o},c=e=>{let{accounts:n}=e;const s=new Set,a=n.flatMap(e=>(null===e||void 0===e?void 0:e.login_methods)||[]).filter(e=>{const n="".concat(e.provider,"-").concat(e.detail||e.label);return!s.has(n)&&"guest"!==e.provider&&(s.add(n),!0)});return a.length<2?null:(0,r.jsxs)("div",{className:"merge-combined",children:[(0,r.jsx)("span",{className:"merge-combined__title",children:"Danach melden Sie sich mit jedem dieser Wege im selben Konto an"}),(0,r.jsx)("ul",{children:a.map(e=>(0,r.jsxs)("li",{children:[(0,r.jsx)(l.rb,{provider:e.provider,size:14}),(0,r.jsx)("span",{children:e.detail||e.label})]},"".concat(e.provider,"-").concat(e.detail||e.label)))})]})},o=e=>{let{blockers:n=[],warnings:s=[],notes:a=[]}=e;return(0,r.jsxs)(r.Fragment,{children:[n.length>0&&(0,r.jsx)("ul",{className:"merge-findings merge-findings--blocked",children:n.map(e=>(0,r.jsxs)("li",{children:[(0,r.jsx)(t.Rqy,{})," ",e]},e))}),s.length>0&&(0,r.jsx)("ul",{className:"merge-findings merge-findings--warn",children:s.map(e=>(0,r.jsxs)("li",{children:[(0,r.jsx)(t.BS8,{})," ",e]},e))}),a.length>0&&(0,r.jsx)("ul",{className:"merge-findings merge-findings--note",children:a.map(e=>(0,r.jsxs)("li",{children:[(0,r.jsx)(t.__w,{})," ",e]},e))}),0===n.length&&0===s.length&&0===a.length&&(0,r.jsxs)("p",{className:"merge-findings merge-findings--ok",children:[(0,r.jsx)(t.A7C,{})," Die Konten passen zusammen."]})]})},d=e=>{let{preview:n}=e;return n?(0,r.jsxs)("div",{className:"account-merge-preview",children:[(0,r.jsxs)("div",{className:"account-merge-preview__pair",children:[(0,r.jsx)(i,{account:n.source,badge:"Geht auf",tone:"source"}),(0,r.jsx)(t.Z0P,{className:"account-merge-preview__arrow","aria-hidden":"true"}),(0,r.jsx)(i,{account:n.target,badge:"Bleibt",tone:"target"})]}),0===n.blockers.length&&(0,r.jsx)(c,{accounts:[n.target,n.source]}),(0,r.jsx)(o,{blockers:n.blockers,warnings:n.warnings,notes:n.notes})]}):null}},9378(e,n,s){s.d(n,{q:()=>c});var a=s(9613),t=s(2735);const l=["b6e3f4","ffd5dc","ffdfbf","c0aede","d1d4f9","c7f0d8","ffe9a8","f4c7e3"],r=e=>l[(e=>{let n=0;for(let s=0;s<e.length;s++)n=(n<<5)-n+e.charCodeAt(s),n|=0;return Math.abs(n)})(e||"")%l.length],i=new Map,c=e=>{const n=e||"",s=i.get(n);if(s)return s;const l=(0,a.gn)(t,{seed:n,size:80,scale:80,radius:10,backgroundColor:[r(n)],backgroundType:["gradientLinear"],backgroundRotation:[0,360],color:["ffd5dc","ffdfbf","c0aede","d1d4f9","b6e3f4"]}).toString(),c="data:image/svg+xml;utf8,".concat(encodeURIComponent(l));return i.set(n,c),c}}}]);
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.