PageSourceSearch

https://exam.net/build/assets/chunk.Bljeh1A0bQOw.js

js exam.net collected 2026-10-01 15:09:12 UTC 53,503 bytes, 91 lines download raw bytes

1var Be=Object.defineProperty;var $e=Object.getOwnPropertySymbols;var Pe=Object.prototype.hasOwnProperty,Ve=Object.prototype.propertyIsEnumerable;var _e=(n,m,l)=>m in n?Be(n,m,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[m]=l,be=(n,m)=>{for(var l in m||(m={}))Pe.call(m,l)&&_e(n,l,m[l]);if($e)for(var l of $e(m))Ve.call(m,l)&&_e(n,l,m[l]);return n};var K=(n,m,l)=>new Promise((k,t)=>{var s=a=>{try{o(l.next(a))}catch(v){t(v)}},d=a=>{try{o(l.throw(a))}catch(v){t(v)}},o=a=>a.done?k(a.value):Promise.resolve(a.value).then(s,d);o((l=l.apply(n,m)).next())});import{f as ye,w as q,r as b,k as J,q as h,s as x,u as e,J as G,K as Z,y as T,x as R,O as we,C as he,Q as D,v as y,A as $,c as de,a0 as Te,I as H,z,V as Me,L as Q,a1 as Oe,D as ee,R as te,M as Ke,aj as ke,H as We,Z as Fe}from"./chunk.CaKkpqnfqRp7.js";import{j as Ye,a as C,aK as Re,cH as qe,F as Xe}from"./entry.BuXKX4_t9gqW.js";import{s as ze}from"./chunk.fITB3rBeC9hl.js";import{L as ae}from"./chunk.D0oM7fm6J3rd.js";import{u as Je,b as Ae,S as Ue,P as me,a as pe,s as fe}from"./chunk.CCfNaIAVhYqF.js";import{K as je}from"./chunk.DMiigLJ6-phQ.js";import{_ as ce}from"./chunk.BeCpqYyPcmPp.js";import{c as Ge,_ as Qe}from"./chunk.DKZ8pNvhxcra.js";import"./chunk.vKmSb7iagUEM.js";import"./chunk.C9Cw7x6sFZ90.js";import"./chunk.BW9eYjIvWPrD.js";function Ze(){try{const n=ae.getJSONItem("inspectionSentIds",[]);return new Map(n.map(([m,l])=>[m,l.map(k=>({type:k.type,sentAt:new Date(k.sentAt)})).filter(k=>!isNaN(k.sentAt.getTime()))]))}catch(n){return new Map}}function et(n){if(n.size===0){ae.removeItem("inspectionSentIds");return}try{const m=[...n.entries()].map(([l,k])=>[l,k.map(t=>({type:t.type,sentAt:t.sentAt.toISOString()}))]);ae.setItem("inspectionSentIds",JSON.stringify(m))}catch(m){ae.removeItem("inspectionSentIds")}}const tt={handleAlreadyEmailed:!1,handleNoLicense:!1,handleDomains:!1};function nt(){const n=ae.getJSONItem("inspectionSettings",{}),m=n!==null&&typeof n=="object"&&!Array.isArray(n)?n:{};return be(be({},tt),m)}const Ie=20,Ce=5;function Le(n,m){var l,k,t,s,d;if(m.length===0||!((l=n==null?void 0:n.exam)!=null&&l.teacher))return{matched:!1};try{const a=(t=JSON.parse((k=n.extra)!=null?k:"").browserBlocking)==null?void 0:t.version;if(Array.isArray(a)&&a.length>3)return{matched:!1};const v=(d=(s=n.exam.teacher.email.split("@").pop())==null?void 0:s.toLowerCase())!=null?d:"";return m.includes(v)?{matched:!0,reason:`domain match: ${v}`}:{matched:!1}}catch(o){return{matched:!1}}}function st(n,m,l,k){var a;const t=new Map;for(const v of n)t.set(v.bek.hash,[...(a=t.get(v.bek.hash))!=null?a:[],v]);const s=[],d=[],o=[];for(const[v,S]of t){const{matched:E,reason:A}=Le(S[0].student,m);if(l&&E){d.push({hash:v,group:S,reason:A!=null?A:""});continue}for(const f of S){const i=k(f.student);i?o.push({item:f,reason:i}):s.push(f)}}return{unhandled:s,groupHandles:d,itemHandles:o}}function De(n){return n.every(m=>{const l={};window.Diff.diffWords(m.previous,m.new).forEach(d=>{d.added&&d.value.split("").forEach(o=>{l[o]=(l[o]||0)+1})});const k=Object.values(l),t=k.reduce((d,o)=>d+o,0);return t<20?!0:k.sort((d,o)=>o-d).slice(0,4).reduce((d,o)=>d+o,0)/t>.95})}function at(n,m,l){const k=[],t=[],s=[];for(const d of n){if(m(d)){t.push(d);continue}const o=l(d.student);o?s.push({item:d,reason:o}):k.push(d)}return{unhandled:k,junkHandles:t,itemHandles:s}}function ge(n){return K(this,null,function*(){return(yield C.post(`/api/inspect/seb-hash-invalids/bek/${n}/handled`)).data.handled_count})}const xe=Ye("inspection",()=>{const n=ye(Ze()),m=ye(nt()),l=b(0),k=Je(),t=b([]),s=b(!1),d=b([]),o=b(!1);q(()=>[...n.entries()],()=>et(n),{deep:!0}),q(m,()=>{ae.setItem("inspectionSettings",JSON.stringify(m))});function a(u,p){var B;const I=(B=n.get(u))!=null?B:[];n.set(u,[...I,{type:p,sentAt:new Date}])}function v(){n.clear()}function S(u,p){var I,B,U;if(m.handleAlreadyEmailed){const W=je(new Date);if((I=n.get(u.id))!=null&&I.some(Y=>Y.type===p&&Y.sentAt>W))return"email already sent"}return m.handleNoLicense&&((U=(B=u.exam)==null?void 0:B.teacher.school)==null?void 0:U.is_customer)===!1?"no license":null}function E(u,p,I,B){var U,W;k.add({severity:"success",summary:`${u} — resolved ${p}
1 pending`,detail:`${(W=(U=I.exam)==null?void 0:U.teacher.email)!=null?W:""} — ${B}`})}function A(u,p,I){return K(this,null,function*(){if(!(u!==0||s.value||t.value.length>=Ie||!(m.handleDomains&&I.length>0)&&!m.handleAlreadyEmailed&&!m.handleNoLicense)){s.value=!0;try{const U=new URLSearchParams({limit:String(Ie-t.value.length)});t.value.forEach(F=>U.append("exclude_ids[]",String(F.bek.id))),p!==null&&U.append("exclude_ids[]",String(p));const W=yield C.post("/api/inspect/beks/batch",U),{items:Y}=W.data,L=st(Y,I,m.handleDomains,F=>S(F,"bek"));t.value.push(...L.unhandled);const X=[...L.groupHandles.map(({hash:F,group:ne,reason:_})=>ge(F).then(M=>{M>0&&(l.value+=M,E(`hash ${F}`,M,ne[0].student,_))})),...L.itemHandles.map(({item:F,reason:ne})=>C.post(`/api/inspect/seb-hash-invalids/${F.bek.id}/handled`).then(()=>{l.value++,E(`hash ${F.bek.hash}`,1,F.student,ne)}))];yield Promise.allSettled(X)}catch(U){Ae.report("Failed to prefetch bek inspection reports")}finally{s.value=!1}}})}function f(u,p){return K(this,null,function*(){if(!(u!==0||o.value||d.value.length>=Ce)){o.value=!0;try{const I=new URLSearchParams({limit:String(Ce-d.value.length)});d.value.forEach(L=>I.append("exclude_student_ids[]",String(L.student.id))),p!==null&&I.append("exclude_student_ids[]",String(p));const B=yield C.post("/api/inspect/autotypes/batch",I),{items:U}=B.data,W=at(U,L=>De(L.student.autotypes),L=>S(L,"autotype"));d.value.push(...W.unhandled);const Y=[...W.junkHandles.map(L=>C.delete(`/api/inspect/autotypes/${L.student.id}`).then(()=>{l.value++,E(`student ${L.student.id}`,L.student.autotypes.length,L.student,"nothing real typed")})),...W.itemHandles.map(({item:L,reason:X})=>C.post(`/api/inspect/autotypes/${L.student.id}/handled`).then(()=>{l.value++,E(`student ${L.student.id}`,L.student.autotypes.length,L.student,X)}))];yield Promise.allSettled(Y)}catch(I){Ae.report("Failed to prefetch autotype inspection reports")}finally{o.value=!1}}})}function i(u){d.value=d.value.filter(p=>p.student.id!==u)}function g(u){t.value=t.value.filter(p=>p.bek.hash!==u)}function r(u){t.value=t.value.filter(p=>p.bek.id!==u)}return{sentIds:n,settings:m,autoHandleCount:l,bekPrefetched:t,autotypePrefetched:d,addId:a,clearIds:v,topUpBekPrefetch:A,topUpAutotypePrefetch:f,purgeBekPrefetchedByHash:g,removeBekPrefetchedItem:r,removeAutotypePrefetchedItem:i,itemSkipReason:S,notifyAutoHandled:E}}),Ne={VM:[`
2Dear {{ TEACHER_NAME }},
3
4At {{ PRODUCT_STRING }}, we've designed our software to block many types of attempts at cheating by students. But in some cases, we need to partner with you as a teacher since some types of attempts can only be detected through analysis after the exam is submitted. We do this by analysis of the student's behavior and the student's computer system.  
5
6Such an analysis has raised a flag that is a highly likely attempt at cheating by one of your students.  
7
8It regards {{ STUDENT }}, for the exam key {{ EXAMKEY }}.
9
10You can review the student in the Monitoring / Results view: {{ STUDENT_LINK }}
11
12We have detected an attempted use of a "virtual machine", which is not allowed when taking an exam with Exam.net. It is a strong sign of an attempt at cheating. 
13
14A virtual machine is software that allows users to run more than one software environment on a single computer. The reason this is a problem is that the one environment doesn't know about the other environments. Therefore, students could switch between two different virtual computers and Exam.net cannot always block this; but we can detect that it is happening.
15
16We encourage you to compare the student's exam results with previous exams to assess whether the student might have violated the academic honesty codes of your school. We also recommend that you clearly communicate to students that virtual machines are not allowed and, if used, will likely be reported to you as the teacher. 
17`],SEB:[`
18Dear {{ TEACHER_NAME }},
19
20At {{ PRODUCT_STRING }}, we've designed our software to block many types of attempts at cheating by students. But in some cases, we need to partner with you as a teacher since some types of attempts can only be detected through analysis after the exam is submitted. We do this by anal
20ysis of the student's behavior and the student's computer system.
21
22Such an analysis of one of your students indicates changes to the student's computer or to Safe Exam Browser (SEB) that aren't normal and that raised a flag for a potential attempt at cheating.
23
24It regards {{ STUDENT }}, for the exam key {{ EXAMKEY }}.
25
26You can review the student in the Monitoring / Results view: {{ STUDENT_LINK }}
27
28We encourage you to evaluate the exam results once more in relation to the student's previous shown knowledge of the subject. If you do not suspect any academic dishonesty, we recommend asking the student to reinstall SEB under your supervision. You can find installation instructions here: <a href="https://support.exam.net/s/article/install-high-security-software-seb-exam-net-app-kiosk-app-for-chromebooks?language=en_US">Install SEB</a>.
29
30If you do suspect dishonesty or if you have received similar warnings about this student previously, we recommend involving your internal IT department to verify that the SEB setup. They may consider using the SEB Verificator tool to check the student's setup before their next exam: <a href="https://safeexambrowser.org/download_en.html#SEBVerificator">(link to download)</a> on the student device at your next exam. `],EXTENSION:[`
31Dear {{ TEACHER_NAME }},
32
33At {{ PRODUCT_STRING }}, we've designed our software to block many types of attempts at cheating by students. But in some cases, we need to partner with you as a teacher since some types of attempts can only be detected through analysis after the exam is submitted. We do this by analysis of the student's behavior and the student's computer system.
34
35Such an analysis has raised a flag that is a highly likely attempt at cheating by one of your students.  
36
37It regards {{ STUDENT }}, for the exam key {{ EXAMKEY }}.
38
39You can review the student in the Monitoring / Results view: {{ STUDENT_LINK }}
40
41We have detected that the student has installed a browser extension specifically intended to circumvent the cheat protection modules of Exam.net, which is a clear violation.
42
43We generally recommend that teachers use the high-security mode options at Exam.net, where extensions and similar technical approaches cannot be used.`],AUTOTYPE:[`
44Dear {{ TEACHER_NAME }},
45
46At {{ PRODUCT_STRING }}, we've designed our software to block many types of attempts at cheating by students. But in some cases, we need to partner with you as a teacher since some types of attempts can only be detected through analysis after the exam is submitted. We do this by analysis of the student's behavior and the student's computer system.   
47
48Such an analysis has raised a flag that is a potential attempt at cheating by one of your students.  
49
50It regards {{ STUDENT }}, for the exam key {{ EXAMKEY }}.
51
52You can review the student in the Monitoring / Results view: {{ STUDENT_LINK }}
53
54Our system has detected a potential use of an "auto-typing" program, which is not allowed at Exam.net and is a sign of a cheating attempt. We encourage you to compare the student's exam results with previous assessments to assess whether the student has been involved with academic dishonesty for this exam.
55
56The activity started at the historic point number YY. You can see this event in the student history log under the Result view as in the image below.
57
58Please note that if your student has an accommodation to use dictation services, it is difficult for us to distinguish between a student speaking and the computer auto-typing the spoken text vs. a student pasting text in from an external source.  
59
60<img width="400" src="https://exam.net/cdn/images/email/inspection/history2.png">
61
62`],CORES:[`
63    Dear {{ TEACHER_NAME }},
64    
65    At {{ PRODUCT_STRING }}, we've designed our software to block many types of attempts at cheating by students. But in some cases, we need to partner with you as a teacher since some types of attempts can only be detected through analysis after the exam is submitted. We do this by analysis of the student's behavior and the student's computer system.  
66    
67    Such an analysis has raised a flag that is a highly likely attempt at cheating by one of your students.  
68    
69    It regards {{ STUDENT }}, for the exam key {{ EXAMKEY }}.
70
71    You can review the student in the Monitoring / Results view: {{ STUDENT_LINK }}
72
73    Some description about the "CORES" case.
74    
75    We encourage you to compare the student's exam results with previous exams to assess whether the student might have violated the academic honesty codes of your school. We also recommend that you clearly communicate to students that virtual machines are not allowed and, if used, will likely be reported to you as the teacher. 
76    `],SCREEN:[`
77    Dear {{ TEACHER_NAME }},
78    
79    At {{ PRODUCT_STRING }}, we've designed our software to block many types of attempts at cheating by students. But in some cases, we need to partner with you as a teacher since some types of attempts can only be detected through analysis after the exam is submitted. We do this by anal
79ysis of the student's behavior and the student's computer system.  
80    
81    Such an analysis has raised a flag that is a highly likely attempt at cheating by one of your students.  
82    
83    It regards {{ STUDENT }}, for the exam key {{ EXAMKEY }}.
84
85    You can review the student in the Monitoring / Results view: {{ STUDENT_LINK }}
86
87    Some description about the "SCREEN" case.
88    
89    We encourage you to compare the student's exam results with previous exams to assess whether the student might have violated the academic honesty codes of your school. We also recommend that you clearly communicate to students that virtual machines are not allowed and, if used, will likely be reported to you as the teacher. 
90    `]},le={render(n,m,l=0){return Ne[n][l%Ne[n].length].replace(/{{\s+STUDENT\s+}}/,Re.initials(m)).replace(/{{\s+STUDENT_LINK\s+}}/,()=>{const k=`${window.location.origin}/admin/exams/${m.exam.id}?student=${m.id}&view=results`;return`<a href="${k}">${k}</a>`}).replace(/{{\s+EXAMKEY\s+}}/,m.exam.examkey).replace(/{{\s+TEACHER_NAME\s+}}/,`${m.exam.teacher.firstName} ${m.exam.teacher.lastName}`).replace(/{{\s+PRODUCT_STRING\s+}}/,Number(m.is_kunskapsmatrisen)===1?"KM and Exam.net":"Exam.net")}},lt={key:0},ot={class:"mb-3"},ut={key:0},it={class:"gap-2 inline-flex items-center"},dt={key:0,class:"flex flex-col text-gray-500 text-xs"},rt=J({__name:"InspectionActionBar",props:{level:{type:Number,required:!0},student:{type:Object,default:null},type:{type:String,required:!0}},emits:["update-level","mark-handled","show-email"],setup(n,{emit:m}){const l=n,k=m,t=xe();return q(()=>l.student,s=>{if(!s||l.level!==0)return;const d=t.itemSkipReason(s,l.type);d&&(t.autoHandleCount++,t.notifyAutoHandled(`${l.type} ${s.id}`,1,s,d),k("mark-handled"))},{immediate:!0}),(s,d)=>{var o,a,v,S;return n.student?(h(),x("div",lt,[e("div",ot,[(h(),x(G,null,Z([0,1,2],E=>e("div",{key:E,class:"inline-flex"},[E!==n.level?(h(),x("div",ut,[T(Ue,{label:`Move to level ${E}`,onClick:A=>s.$emit("update-level",E)},null,8,["label","onClick"]),d[2]||(d[2]=e("span",{class:"mx-1"},null,-1))])):R("",!0)])),64))]),we(s.$slots,"default",{},void 0,!0),T(me,{label:"Mark as handled",onClick:d[0]||(d[0]=E=>s.$emit("mark-handled"))}),d[3]||(d[3]=e("span",{class:"mx-1"},null,-1)),e("div",it,[T(me,{label:D(t).sentIds.has((o=n.student)==null?void 0:o.id)?"Email sent":"Show email",class:he({"email-sent":D(t).sentIds.has((a=n.student)==null?void 0:a.id)}),onClick:d[1]||(d[1]=E=>s.$emit("show-email"))},null,8,["label","class"]),D(t).sentIds.has((v=n.student)==null?void 0:v.id)?(h(),x("div",dt,[(h(!0),x(G,null,Z(D(t).sentIds.get((S=n.student)==null?void 0:S.id),E=>(h(),x("span",{key:E.sentAt.toISOString()},y(E.type)+": "+y(E.sentAt.toLocaleDateString()),1))),128))])):R("",!0)])])):R("",!0)}}}),oe=pe(rt,[["__scopeId","data-v-95989c03"]]),ct={key:0},mt={class:"flex"},pt={class:"w-2/3"},vt=["href"],ft={key:0},yt=["href"],ht=["href"],xt={key:0,class:"mx-2 text-gray-300"},bt={key:1,class:"text-green-600"},kt={key:2,class:"font-semibold text-red-600"},gt={key:3,class:"text-gray-400"},wt={key:1,class:"font-semibold text-red-600"},Et={class:"w-1/3"},St={key:0},$t={key:1,class:"bg-exam-orange m-2 p-2 rounded text-white"},_t={class:"[overflow-wrap:anywhere]"},Tt=J({__name:"StudentInfo",props:{student:{default:null},backupsCount:{default:null}},setup(n){const m=n;function l(o){var a;return["FULL","BASIC"].includes((a=o==null?void 0:o.toUpperCase())!=null?a:"")}const k=de(()=>{var S,E,A,f,i;const o=(E=(S=m.student)==null?void 0:S.exam)==null?void 0:E.teacher.school,a=(f=(A=o==null?void 0:o.product_licenses)==null?void 0:A.filter(g=>g.product==="KM"))!=null?f:[],v=(i=a.find(g=>l(g.type)))!=null?i:a[0];return[{product:"Exam.net",type:o==null?void 0:o.access_type,isPaying:l(o==null?void 0:o.access_type)},{product:"KM",type:v==null?void 0:v.type,isPaying:l(v==null?void 0:v.type)}]}),t=de(()=>{var o,a,v;return(v=(a=(o=m.student)==null?void 0:o.exam)==null?void 0:a.teacher.school)==null?void 0:v.is_customer});function s(o){return`/admin/impersonate/${o!=null?o:""}`}function d(o){return`/admin/exams/${o!=null?o:""}`}return(o,a)=>{var v,S,E,A,f;return n.student?(h(),x("div",ct,[e("div",mt,[e("div",pt,[a[0]||(a[0]=e("b",{class:"inline-block w-20"},"Student:",-1)),e("a",{href:D(Ge)("exams-students",{student:n.student.id}),target:"_blank"},y(n.student.id),9,vt),$(", "+y(D(Re).displayName(n.student))+" ",1),n.backupsCount!==null?(h(),x("span",ft," ("+y(n.backupsCount)+" backups, "+y(n.student.autotypes.length)+" autotypes, "+y(n.student.student_logs.length)+" log events) ",1)):R("",!0),a[1]||(a[1]=e("br",null,null,-1)),a[2]||(a[2]=e("b",{class:"inline-block w-20"},"Teacher:",-1)),e("a",{href:s((v=n.student.exam)==null?void 0:v.teacher.email),target:"_blank"},y((S=n.student.exam)==null?void 0:S.teacher.email),9,yt),a[3]||(a[3]=e("br",null,null,-1)),a[4]||(a[4]=e("b",{class:"inline-block w-20"},"Examkey:",-1)),e("a",{href:d((E=n.student.exam)==null?void 0:E.id),target:"_blank"},y((A=n.student.exam)==null?void 0:A.examkey),9,ht),a[5]||(a[5]=e("br",null,null,-1)),a[6]||(a[6]=e("b",{class:"inline-block w-20"},"License:",-1)),(h(!0),x(G,null,Z(k.value,(i,g)=>{var r,u;return h(),x(G,{key:i.product},[g?(h(),x("span",xt,"|")):R("",!0),$(" "+y(i.product)+" ",1),i.isPaying?(h(),x("span",bt,y(i.type),1)):t.value===!1?(h(),x("span",kt,y((r=i.type)!=null?r:"N/A"),1)):(h(),x("span",gt,y((u=i.type)!=null?u:"N/A"),1))],64)}),128)),t.value===!1?(h(),x("span",wt," (not paying)")):R("",!0),a[7]||(a[7]=e("br",null,null,-1))]),e("div",Et,[a[8]||(a[8]=e("b",null,"created_at:",-1)),a[9]||(a[9]=$()),T(ce,{datetime:n.student.created_at},null,8,["datetime"]),a[10]||(a[10]=e("br",null,null,-1)),a[11]||(a[11]=e("b",null,"updated_at:",-1)),a[12]||(a[12]=$()),T(ce,{datetime:n.student.updated_at},null,8,["datetime"]),a[13]||(a[13]=e("br",null,null,-1)),a[14]||(a[14]=e("b",null,"leave_time (submitted_at):",-1)),a[15]||(a[15]=$()),T(ce,{datetime:(f=n.student.leave_time)!=null?f:void 0},null,8,["datetime"]),a[16]||(a[16]=e("br",null,null,-1))])]),n.student.extra&&JSON.parse(n.student.extra).ua?(h(),x("span",St,[a[17]||(a[17]=e("b",null,"SEB version:",-1)),$(" "+y(JSON.parse(n.student.extra).ua)+" ",1),a[18]||(a[18]=e("br",null,null,-1))])):R("",!0),a[19]||(a[19]=e("b",null,"Security mode etc.:",-1)),$(" "+y(n.student.security)+" "+y(n.student.extra),1),a[20]||(a[20]=e("br",null,null,-1)),Number(n.student.is_kunskapsmatrisen)===1?(h(),x("div",$t," KM 1.0 Student ")):R("",!0),a[21]||(a[21]=e("hr",null,null,-1)),e("div",_t,[we(o.$slots,"extra",{},void 0,!0)])])):R("",!0)}}}),ue=pe(Tt,[["__scopeId","data-v-4244a504"]]),At={style:{position:"fixed",width:"100vw",height:"100vh",left:"0",top:"0","z-index":"99999999",display:"flex","justify-content":"center","align-items":"center",background:"#000000a6"}},It={class:"box"},Ct={style:{"margin-bottom":"20px","font-weight":"700"}},Nt=J({__name:"EmailModal",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{},content:{required:!0},contentModifiers:{}},emits:Oe(["sent"],["update:modelValue","update:content"]),setup(n,{expose:m,emit:l}){const k=l,t=Te(n,"modelValue"),s=Te(n,"content");function d(){C.post("/api/inspect/mail",s.value).then(()=>{t.value=!1,k("sent")})}return m({send:d}),(o,a)=>H((h(),x("div",At,[T(qe,null,{default:z(()=>[H(e("div",It,[e("h3",Ct,"Send email to "+y(s.value.recipient),1),H(e("textarea",{"onUpdate:modelValue":a[0]||(a[0]=v=>s.value.message=v),style:{height:"500px",width:"600px"}},null,512),[[Me,s.value.message]]),T(me,{label:"Send",onClick:d}),a[2]||(a[2]=e("span",{class:"ml-1"},null,-1)),T(me,{label:"Close without sending",onClick:a[1]||(a[1]=v=>t.value=!1)}),we(o.$slots,"extra-actions",{},void 0,!0)],512),[[Q,t.value]])]),_:3})],512)),[[Q,t.value]])}}),ie=pe(Nt,[["__scopeId","data-v-b56e9489"]]),Mt={key:0,class:"container mb-8 mt-6 mx-auto"},Rt={class:"bg-white container h-full mb-72 mt-6 mx-auto rounded shadow"},Ut={key:0,class:"bg-[var(--yellow-50)] m-2 p-2 rounded text-exam-blue"},Lt={class:"flex p-1"},Dt=["onMouseover"],Ht={key:0},Bt={style:{display:"flex"}},Pt=["textContent"],Vt=["textContent"],Ot={style:{flex:"1",overflow:"auto"}},Kt={class:"section"},Wt={class:"section__toolbar"},Ft={class:"flex flex-wrap gap-1"},Yt=["onClick"],qt={key:0,class:"ml-auto text-sm"},Xt={class:"text-gray-500"},zt={key:0,class:"p-2"},Jt=J({__name:"AutoType",props:{type:{type:String,default:""},level:{type:Number,default:0},postponeLevel:{type:Number,required:!0}},emits:["email-sent"],setup(n,{emit:m}){const l=n,k=m,t=xe(),s=b(null),d=b([]),o=b(null),a=b(""),v=b(0),S=b(0),E=b(!1),A=b({recipient:"",student_id:0,message:"",type:""}),f=b(0);let i=null;const g=de(()=>{var _,M;return((_=s.value)==null?void 0:_.autotypes[v.value])||((M=s.value)==null?void 0:M.autotypes[0])||null}),r=de(()=>{if(!g.value)return"";const _=fe(g.value.previous),M=fe(g.value.new),se=window.Diff.diffWords(_,M);let w="";return se.forEach(c=>{const N=c.added?"green":c.removed?"red":"grey";N!=="grey"&&(w+=`<span style="color: ${N};">${c.value}</span>`)}),w}),u=de(()=>d.value[S.value]||d.value[0]||null);q(s,()=>{d.value=[],clearTimeout(i!=null?i:void 0),i=setTimeout(()=>F(),2e3)}),q([()=>l.type,()=>l.level],([_])=>{_==="autotype"&&X()});function p(_){l.type==="autotype"&&(E.value||(_.key==="m"&&U(),_.key==="j"&&L(),_.key==="p"&&I(l.postponeLevel),_.key==="h"&&Y(),_.key==="ArrowLeft"&&S.value>0&&(S.value-=1),_.key==="ArrowRight"&&S.value<d.value.length-1&&(S.value+=1)))}ee(()=>{document.addEventListener("keydown",p)}),te(()=>{document.removeEventListener("keydown",p),clearTimeout(i!=null?i:void 0)});function I(_){return K(this,null,function*(){s.value!==null&&(yield C.post(`/api/inspect/autotypes/${s.value.id}/level`,{level:_}),X())})}function B(_){return _.student_answer?fe(_.student_answer):fe(_.answer||"")}function U(){const _="AUTOTYPE";A.value={recipient:s.value.exam.teacher.email,student_id:s.value.id,type:_,message:le.render(_,s.value,f.value)},E.value=!0}function W(){k("email-sent",s.value.id),Y()}function Y(){s.value&&C({method:"post",url:`/api/inspect/autotypes/${s.value.id}/handled`}).then(()=>X())}function L(){C({method:"delete",url:`/api/inspect/autotypes/${s.value.id}`}).then(()=>X())}function X(){C(`/api/inspect/autotypes?level=${l.level}`).then(_=>{if(["skipped","done"].includes(_.data.status)){s.value=null,o.value=null,a.value="";return}if(s.value=_.data.student,o.value=_.data.backupJWT,a.value=_.data.bucket,v.value=0,S.value=0,t.removeAutotypePrefetchedItem(_.data.student.id),De(s.value.autotypes)){L();return}t.topUpAutotypePrefetch(l.level,_.data.student.id)})}function F(){return K(this,null,function*(){var N,V,O;const _=(N=s.value)==null?void 0:N.id;if(!_)return;const M=yield C.get(`/api/student/${_}/backups`),{individualEncryptionKey:se,backups:w}=M.data,c=(yield Xe.studentBackups(_,se,a.value,(V=o.value)!=null?V:void 0)).map(P=>({id:P.url,created_at:P.timeCreated,student_answer:P.data&&P.data.answer,fileBased:!0})).filter(P=>P.student_answer);((O=s.value)==null?void 0:O.id)===_&&(d.value=[...w,...c].sort((P,ve)=>window.moment.utc(P.created_at).diff(window.moment.utc(ve.created_at))))})}function ne(){f.value+=1,U()}return(_,M)=>{const se=Ke("sanitized-html");return H((h(),x("div",null,[s.value?(h(),x("div",Mt,[T(oe,{level:n.level,student:s.value,type:n.type,onUpdateLevel:I,onMarkHandled:Y,onShowEmail
90:U},{default:z(()=>[T(me,{label:"Delete",onClick:L}),M[2]||(M[2]=e("span",{class:"mx-1"},null,-1))]),_:1},8,["level","student","type"])])):R("",!0),e("div",Rt,[T(ie,{modelValue:E.value,"onUpdate:modelValue":M[0]||(M[0]=w=>E.value=w),content:A.value,"onUpdate:content":M[1]||(M[1]=w=>A.value=w),onSent:W},{"extra-actions":z(()=>[M[3]||(M[3]=e("span",{class:"ml-1"},null,-1)),T(Ue,{label:"Change email template",onClick:ne})]),_:1},8,["modelValue","content"]),T(ue,{student:s.value,backupsCount:d.value.length},{extra:z(()=>{var w,c,N,V,O,P,ve,Ee,Se;return[(c=(w=s.value)==null?void 0:w.quick_typings)!=null&&c.length?(h(),x("div",Ut,y((V=(N=s.value)==null?void 0:N.quick_typings)==null?void 0:V.length)+' "Quick Typings" have also been detected for this student. ',1)):R("",!0),M[6]||(M[6]=e("hr",null,null,-1)),e("div",Lt,[(h(!0),x(G,null,Z((O=s.value)==null?void 0:O.autotypes,(j,re)=>(h(),x("div",{key:j.id,class:he(["cursor-crosshair min-w-[20px] option px-2 text-center",{"option--ai-ACTUAL_TEXT":j.ai_status==="ACTUAL_TEXT","option--ai-NOT_TEXT":j.ai_status==="NOT_TEXT"}]),onMouseover:He=>v.value=Number(re)},[$(y(Number(re)+1)+" ",1),j.ai_status?(h(),x("span",Ht,"(AI says "+y(j.ai_status)+")",1)):R("",!0)],42,Dt))),128))]),e("div",Bt,[e("div",{style:{flex:"1",overflow:"auto"},textContent:y((P=g.value)==null?void 0:P.previous)},null,8,Pt),e("div",{style:{flex:"1",overflow:"auto"},textContent:y((ve=g.value)==null?void 0:ve.new)},null,8,Vt),H(e("div",Ot,null,512),[[se,r.value]])]),M[7]||(M[7]=e("hr",null,null,-1)),e("section",Kt,[e("div",Wt,[e("div",Ft,[(h(!0),x(G,null,Z(d.value,(j,re)=>(h(),x("button",{key:j.id,type:"button",class:he(["cursor-pointer min-w-[20px] option px-2 text-center",{"option--marked":!j.fileBased,"option--selected":re===S.value}]),onClick:He=>S.value=re},y(re+1),11,Yt))),128))]),u.value?(h(),x("div",qt,[$(" #"+y(S.value+1)+" · ",1),T(ce,{datetime:u.value.created_at},null,8,["datetime"]),M[4]||(M[4]=$(" · ",-1)),e("span",Xt,y(u.value.fileBased?"file":"database"),1)])):R("",!0)]),M[5]||(M[5]=e("p",{class:"px-2 text-gray-500 text-xs"},"Use ← and → to step through backups.",-1)),u.value?H((h(),x("div",zt,null,512)),[[se,B(u.value)]]):R("",!0)]),(h(!0),x(G,null,Z((Ee=s.value)==null?void 0:Ee.student_logs,j=>(h(),x("div",{key:j.id},y(j),1))),128)),M[8]||(M[8]=e("hr",null,null,-1)),$(" "+y((Se=s.value)==null?void 0:Se.exam),1)]}),_:1},8,["student","backupsCount"])])],512)),[[Q,n.type==="autotype"]])}}}),jt=pe(Jt,[["__scopeId","data-v-1390caa5"]]),Gt={class:"container mb-8 mt-6 mx-auto"},Qt={class:"bg-white container h-full mb-72 mt-6 mx-auto rounded shadow"},Zt={class:"table-auto"},en={class:"px-6 py-4"},tn={class:"px-6 py-4"},nn=J({__name:"QuickTyping",props:{type:{type:String,default:""},level:{type:Number,default:0}},emits:["done","email-sent"],setup(n,{emit:m}){const l=n,k=m,t=b(null),s=b(!1),d=b({recipient:"",student_id:0,message:"",type:""});q([()=>l.type,()=>l.level],([f])=>{f==="quickTyping"&&E()});function o(f){l.type==="quickTyping"&&(s.value||(f.key==="m"&&A(),f.key==="h"&&S()))}ee(()=>{document.addEventListener("keydown",o)}),te(()=>{document.removeEventListener("keydown",o)});function a(f){return K(this,null,function*(){t.value&&(yield C.post(`/api/inspect/quick-typings/${t.value.id}/level`,{level:f}),E())})}function v(){k("email-sent",t.value.id),S()}function S(){t.value&&C({method:"post",url:`/api/inspect/quick-typings/${t.value.id}/handled`}).then(()=>E()).catch(()=>{})}function E(){C(`/api/inspect/quick-typings?level=${l.level}`).then(f=>{if(["skipped","done"].includes(f.data.status)){t.value=null;return}t.value=f.data.student,(!t.value||!t.value.is_kunskapsmatrisen&&!t.value.exam)&&S()}).catch(()=>{t.value=null,k("done")})}function A(){const f="AUTOTYPE";d.value={recipient:t.value.exam.teacher.email,student_id:t.value.id,type:f,message:le.render(f,t.value,0)},s.value=!0}return(f,i)=>H((h(),x("div",null,[e("div",Gt,[T(oe,{level:n.level,student:t.value,type:n.type,onUpdateLevel:a,onMarkHandled:S,onShowEmail:A},null,8,["level","student","type"])]),e("div",Qt,[T(ie,{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=g=>s.value=g),content:d.value,"onUpdate:content":i[1]||(i[1]=g=>d.value=g),onSent:v},null,8,["modelValue","content"]),T(ue,{student:t.value},{extra:z(()=>{var g;return[e("table",Zt,[i[2]||(i[2]=e("thead",{class:"bg-gray-50 text-gray-700 uppercase"}
90,[e("tr",null,[e("th",null,"Time"),e("th",null,"Text")])],-1)),e("tbody",null,[(h(!0),x(G,null,Z((g=t.value)==null?void 0:g.quick_typings,r=>(h(),x("tr",{key:r.id,class:"bg-white border-b"},[e("td",en,[T(ce,{datetime:r.created_at},null,8,["datetime"])]),e("td",tn,y(r.text),1)]))),128))])])]}),_:1},8,["student"])])],512)),[[Q,n.type==="quickTyping"]])}}),sn={class:"container mb-8 mt-6 mx-auto"},an={class:"bg-white container h-full mb-72 mt-6 mx-auto rounded shadow"},ln={class:"table-auto"},on={class:"px-6 py-4"},un={class:"px-6 py-4"},dn={class:"px-6 py-4"},rn=J({__name:"Backspace",props:{type:{type:String,default:""},level:{type:Number,default:0}},emits:["done","email-sent"],setup(n,{emit:m}){const l=n,k=m,t=b(null),s=b(!1),d=b(null),o=b(null),a=b(0),v=b({recipient:"",student_id:0,message:"",type:""});q([()=>l.type,()=>l.level],([r])=>{r==="backspace"&&i()});function S(r){var u;l.type==="backspace"&&(r.key==="m"&&s.value&&((u=d.value)==null||u.send()),!s.value&&(r.key==="m"&&g(),r.key==="h"&&f()))}ee(()=>{document.addEventListener("keydown",S)}),te(()=>{document.removeEventListener("keydown",S)});function E(r){return K(this,null,function*(){o.value!==null&&(yield C.post(`/api/inspect/backspace/${t.value.id}/level`,{level:r}),i())})}function A(){k("email-sent",t.value.id),f()}function f(){t.value&&C({method:"post",url:`/api/inspect/backspace/${t.value.id}/handled`}).then(()=>i()).catch(()=>{})}function i(){C(`/api/inspect/backspace?level=${l.level}`).then(r=>{o.value=r.data.suspectedEvents.map(u=>(u.data=JSON.parse(u.data),u)),t.value=r.data.student,a.value=r.data.studentsForExam,(!t.value||!t.value.is_kunskapsmatrisen&&!t.value.exam)&&f()}).catch(()=>{t.value=null,a.value=0,k("done")})}function g(){const r="AUTOTYPE";v.value={recipient:t.value.exam.teacher.email,student_id:t.value.id,type:r,message:le.render(r,t.value,1)},s.value=!0}return(r,u)=>H((h(),x("div",null,[e("div",sn,[T(oe,{level:n.level,student:t.value,type:n.type,onUpdateLevel:E,onMarkHandled:f,onShowEmail:g},null,8,["level","student","type"])]),e("div",an,[T(ie,{ref_key:"emailModalRef",ref:d,modelValue:s.value,"onUpdate:modelValue":u[0]||(u[0]=p=>
90s.value=p),content:v.value,"onUpdate:content":u[1]||(u[1]=p=>v.value=p),onSent:A},null,8,["modelValue","content"]),T(ue,{student:t.value},{extra:z(()=>[e("table",ln,[u[2]||(u[2]=e("thead",{class:"bg-gray-50 text-gray-700 uppercase"},[e("tr",null,[e("th",null,"Time"),e("th",null,"Count"),e("th",null,"Keys")])],-1)),e("tbody",null,[(h(!0),x(G,null,Z(o.value,p=>(h(),x("tr",{key:p.id,class:"bg-white border-b"},[e("td",on,[T(ce,{datetime:p.created_at},null,8,["datetime"])]),e("td",un,y(p.data.count),1),e("td",dn,y(p.data.text),1)]))),128))])])]),_:1},8,["student"])])],512)),[[Q,n.type==="backspace"]])}}),cn={class:"container flex items-end justify-between mb-8 mt-6 mx-auto"},mn={class:"w-80"},pn={class:"bg-white container h-full mb-72 mt-6 mx-auto rounded shadow"},vn={class:"p-1"},fn={key:0,class:"bg-red-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-red-800 text-sm"},yn={class:"p-1"},hn={key:0,class:"bg-green-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-green-800 text-sm"},xn={key:1,class:"bg-yellow-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-sm text-yellow-800"},bn={key:2,class:"bg-red-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-red-800 text-sm"},kn={class:"p-1"},gn={class:"bg-green-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-green-800 text-sm"},wn={key:0,class:"p-1"},En={key:1,class:"p-1"},Sn={key:2,class:"p-1"},$n={key:3,class:"p-1"},_n={key:4,class:"p-1"},Tn={key:5,class:"p-1"},An={key:6,class:"p-1"},In={key:7,class:"p-1"},Cn={key:8,class:"p-1"},Nn={key:9,class:"p-1"},Mn={key:10,class:"p-1"},Rn={key:11,class:"p-1"},Un=J({__name:"Bek",props:{type:{type:String,default:""},level:{type:Number,default:0}},emits:["email-sent"],setup(n,{emit:m}){const l=n,k=m,t=xe(),s=b(null),d=b(null),o=b(null),a=b(0),v=b(0),S=b([]),E=b(!1),A=b({recipient:"",student_id:0,message:"",type:""}),f=b(""),i=b([]),g=b(""),r=de(()=>{var w,c;return((c=(w=o.value)==null?void 0:w.count)!=null?c:0)-v.value}),u=de(()=>g.value.split(",").map(w=>w.trim().toLowerCase()).filter(w=>w));q([()=>l.type,()=>l.level],([w])=>{w==="bek"&&_()});function p(w){l.type==="bek"&&(E.value||document.activeElement&&(document.activeElement.tagName==="INPUT"||document.activeElement.tagName==="TEXTAREA")||(w.key==="p"&&ne(),w.key==="m"&&M(),w.key==="h"&&X()))}ee(()=>{document.addEventListener("keydown",p);const w=ae.getItem("autoHandleEmailDomains");w&&(g.value=w)}),te(()=>{document.removeEventListener("keydown",p)});function I(w){return K(this,null,function*(){d.value!==null&&(yield C.post(`/api/inspect/seb-hash-invalids/${d.value.id}/level`,{level:w}),_())})}function B(w,c){return i.value.some(N=>{var V,O;return N.customization===w&&N.school_id===((O=(V=c==null?void 0:c.exam)==null?void 0:V.teacher)==null?void 0:O.school_id)})}function U(w,c){if(!w||!w.extra)return!1;try{const N=JSON.parse(w.extra);return!N.ua||typeof N.ua!="string"?!1:N.ua.includes(c)}catch(N){return!1}}function W(w,c){return!o.value||typeof o.value[w]!="string"?!1:o.value[w].includes(c)}function Y(w){var c,N,V;return Number((V=(N=(c=s.value)==null?void 0:c.exam)==null?void 0:N.teacher)==null?void 0:V.school_id)===Number(w)}function L(){k("email-sent",s.value.id),X()}function X(){d.value!==null&&C({method:"post",url:`/api/inspect/seb-hash-invalids/${d.value.id}/handled`}).then(()=>_())}function F(){d.value!==null&&(t.purgeBekPrefetchedByHash(d.value.hash),ge(d.value.hash).then(()=>_()))}function ne(){const{matched:w,reason:c}=Le(s.value,u.value);if(!w)return!1;const N=d.value.hash,V=s.value;return t.purgeBekPrefetchedByHash(N),ge(N).then(O=>{O>0&&(t.autoHandleCount+=O,t.notifyAutoHandled(`hash ${N}`,O,V,c!=null?c:"")),_()}),!0}function _(){f.value=null,C(`/api/inspect/beks?level=${l.level}`).then(w=>{if(!w.data||Array.isArray(w.data)||["skipped","done"].includes(w.data.status)){s.value=null;return}s.value=w.data.student,d.value=w.data.bek,o.value=w.data.sebHash,v.value=w.data.pendingCount,S.value=w.data.suspiciousBeks,a.value=w.data.ckCount,i.value=w.data.schoolCustomizations,t.removeBekPrefetchedItem(w.data.bek.id),t.settings.handleDomains&&ne()||t.topUpBekPrefetch(l.level,w.data.bek.id,u.value)})}function M(){A.value={recipient:s.value.exam.teacher.email,student_id:s.value.id,type:"SEB",message:le.render("SEB",s.value)},E.value=!0}function se(){ae.setItem("autoHandleEmailDomains",g.value)}return(w,c)=>H((h(),x("div",null,[e("div",cn,[e("div",null,[T(oe,{level:n.level,student:s.value,type:n.type,onUpdateLevel:I,onMarkHandled:X,onShowEmail
90:M},{default:z(()=>[T(me,{label:"Handled all with same BEK ",onClick:F}),c[4]||(c[4]=e("span",{class:"mx-1"},null,-1))]),_:1},8,["level","student","type"])]),e("div",mn,[c[6]||(c[6]=e("div",{class:"mb-1 text-gray-500 text-xs"},' Email domains that should be auto-handled, only the part after "@", separate with commas. ',-1)),H(e("input",{"onUpdate:modelValue":c[0]||(c[0]=N=>g.value=N),class:"border border-gray-300 px-3 py-2 rounded text-sm w-full",placeholder:"example.se, school.com",onChange:se},null,544),[[Me,g.value]]),e("div",null,[H(e("input",{id:"auto","onUpdate:modelValue":c[1]||(c[1]=N=>D(t).settings.handleDomains=N),type:"checkbox",name:"auto",class:"mr-2 mt-2"},null,512),[[ke,D(t).settings.handleDomains]]),c[5]||(c[5]=e("label",{for:"auto",class:"cursor-pointer inline text-gray-500 text-xs"},"Auto-handle for specified domains",-1))])])]),e("div",pn,[T(ie,{modelValue:E.value,"onUpdate:modelValue":c[2]||(c[2]=N=>E.value=N),content:A.value,"onUpdate:content":c[3]||(c[3]=N=>A.value=N),onSent:L},null,8,["modelValue","content"]),T(ue,{student:s.value},{extra:z(()=>{var N,V;return[e("div",vn,[S.value.find(O=>{var P;return O.hash===((P=d.value)==null?void 0:P.hash)})?(h(),x("span",fn,[e("b",null," WARNING: Marked as a suspicious hash ("+y(d.value&&((N=S.value.find(O=>{var P;return O.hash===((P=d.value)==null?void 0:P.hash)}))==null?void 0:N.description))+") ",1)])):R("",!0)]),e("div",yn,[r.value>100?(h(),x("span",hn,[c[7]||(c[7]=e("b",null,"BEK count with pending excluded:",-1)),$("  "+y(r.value),1)])):R("",!0),r.value>50&&r.value<=100?(h(),x("span",xn,[c[8]||(c[8]=e("b",null,"BEK count with pending excluded:",-1)),$("  "+y(r.value),1)])):R("",!0),r.value<=50?(h(),x("span",bn,[c[9]||(c[9]=e("b",null,"BEK count with pending excluded:",-1)),$("  "+y(r.value),1)])):R("",!0)]),e("div",kn,[e("span",gn,[c[10]||(c[10]=e("b",null,"CK count:",-1)),$("  "+y(a.value),1)])]),Y(162)||Y(64)?(h(),x("div",wn,[...c[11]||(c[11]=[e("span",{class:"bg-yellow-100 font-bold inline-flex items-center px-3 py-0.5 rounded-full text-black text-sm"}," School which usually has odd beks (id [162, 64]) ",-1)])])):R("",!0),U(s.value,"_HARD")?(h(),x("div",En,[...c[12]||(c[12]=[e("span",{class:"bg-blue-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-blue-800 text-sm"}," HARD ",-1)])])):R("",!0),U(s.value,"_NO_SERVICE")?(h(),x("div",Sn,[...c[13]||(c[13]=[e("span",{class:"bg-blue-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-blue-800 text-sm"}," NO SERVICE ",-1)])])):R("",!0),U(s.value,"_QUIT_PASSWORD")?(h(),x("div",$n,[...c[14]||(c[14]=[e("span",{class:"bg-blue-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-blue-800 text-sm"}," QUIT_PASSWORD ",-1)])])):R("",!0),U(s.value,"_EXT_RESOURCES")?(h(),x("div",_n,[...c[15]||(c[15]=[e("span",{class:"bg-blue-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-blue-800 text-sm"}," EXT_RESOURCES ",-1)])])):R("",!0),U(s.value,"_SEB_SERVER")?(h(),x("div",Tn,[...c[16]||(c[16]=[e("span",{class:"bg-blue-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-blue-800 text-sm"}," SEB_SERVER ",-1)])])):R("",!0),U(s.value,"_INSIDE_SEB_SERVER")?(h(),x("div",An,[...c[17]||(c[17]=[e("span",{class:"bg-blue-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-blue-800 text-sm"}," INSIDE_SEB_SERVER ",-1)])])):R("",!0),U(s.value,"_POPUPS")?(h(),x("div",In,[...c[18]||(c[18]=[e("span",{class:"bg-blue-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-blue-800 text-sm"}," POPUPS ",-1)])])):R("",!0),B("ignoreService",s.value)?(h(),x("div",Cn,[...c[19]||(c[19]=[e("span",{class:"bg-yellow-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-red-800 text-sm"}," School always ignores service ",-1)])])):R("",!0),W("url","exam-fallback-2")?(h(),x("div",Nn,[...c[20]||(c[20]=[e("span",{class:"bg-blue-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-blue-800 text-sm"}," Fallback domain (https://exam-fallback-2.azurewebsites.net/) ",-1)])])):R("",!0),U(s.value,"iPad")?(h(),x("div",Mn,[...c[21]||(c[21]=[e("span",{class:"bg-blue-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-blue-800 text-sm"}," iPad ",-1)])])):R("",!0),U(s.value,"Mac")?(h(),x("div",Rn,[...c[22]||(c[22]=[e("span",{class:"bg-blue-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-blue-800 text-sm"}," Mac (or iPad) ",-1)])])):R("",!0),c[23]||(c[23]=e("hr",{class:"p-1"},null,-1)),$(" "+y(o.value)+" ",1),c[24]||(c[24]=e("hr",{class:"p-1"},null,-1)),$(" "+y((V=s.value)==null?void 0:V.exam),1)]}),_:1},8,["student"])])],512)),[[Q,n.type==="bek"]])}}),Ln={class:"container mb-8 mt-6 mx-auto"},Dn={class:"bg-white container h-full mb-72 mt-6 mx-auto rounded shadow"},Hn=J({__name:"Extension",props:{type:{type:String,default:""},level:{type:Number,default:0}},emits:["done","email-sent"],setup(n,{emit:m}){const l=n,k=m,t=b(null),s=b(!1),d=b(null),o=b(null),a=b(0),v=b({recipient:"",student_id:0,message:"",type:""});q([()=>l.type,()=>l.level],([r])=>{r==="extensions"&&i()});function S(r){var u;l.type==="extensions"&&(r.key==="m"&&s.value&&((u=d.value)==null||u.send()),!s.value&&(r.key==="m"&&g(),r.ke
90y==="h"&&f()))}ee(()=>{document.addEventListener("keydown",S)}),te(()=>{document.removeEventListener("keydown",S)});function E(r){return K(this,null,function*(){o.value!==null&&(yield C.post(`/api/inspect/suspected/${o.value.id}/level`,{level:r}),i())})}function A(){k("email-sent",t.value.id),f()}function f(){o.value&&C({method:"post",url:`/api/inspect/suspected/${o.value.id}/handled`}).then(()=>i()).catch(()=>{})}function i(){C(`/api/inspect/extensions?level=${l.level}`).then(r=>{o.value=r.data.suspected,t.value=r.data.student,a.value=r.data.studentsForExam,(!t.value||!t.value.is_kunskapsmatrisen&&!t.value.exam)&&f()}).catch(()=>{t.value=null,a.value=0,k("done")})}function g(){const r="EXTENSION";v.value={recipient:t.value.exam.teacher.email,student_id:t.value.id,type:r,message:le.render(r,t.value)},s.value=!0}return(r,u)=>H((h(),x("div",null,[e("div",Ln,[T(oe,{level:n.level,student:t.value,type:n.type,onUpdateLevel:E,onMarkHandled:f,onShowEmail:g},null,8,["level","student","type"])]),e("div",Dn,[T(ie,{ref_key:"emailModalRef",ref:d,modelValue:s.value,"onUpdate:modelValue":u[0]||(u[0]=p=>
90s.value=p),content:v.value,"onUpdate:content":u[1]||(u[1]=p=>v.value=p),onSent:A},null,8,["modelValue","content"]),T(ue,{student:t.value},{extra:z(()=>{var p,I;return[$(y(o.value)+" ",1),u[2]||(u[2]=e("hr",{class:"p-2"},null,-1)),$(" "+y((p=t.value)==null?void 0:p.exam)+" ",1),u[3]||(u[3]=e("hr",{class:"p-2"},null,-1)),$(" "+y((I=t.value)==null?void 0:I.answer)+" ",1),u[4]||(u[4]=e("hr",{class:"p-2"},null,-1)),$(" "+y(a.value)+" students in the exam ",1)]}),_:1},8,["student"])])],512)),[[Q,n.type==="extensions"]])}}),Bn={class:"container mb-8 mt-6 mx-auto"},Pn={class:"bg-white container h-full mb-72 mt-6 mx-auto rounded shadow"},Vn=J({__name:"VM",props:{type:{type:String,default:""},level:{type:Number,default:0}},emits:["done","email-sent"],setup(n,{emit:m}){const l=n,k=m,t=b(null),s=b(!1),d=b(null),o=b(null),a=b(0),v=b({recipient:"",student_id:0,message:"",type:""});q([()=>l.type,()=>l.level],([r])=>{r==="vm"&&i()});function S(r){var u;l.type==="vm"&&(r.key==="m"&&s.value&&((u=d.value)==null||u.send()),!s.value&&(r.key==="m"&&g(),r.key==="h"&&f()))}ee(()=>{document.addEventListener("keydown",S)}),te(()=>{document.removeEventListener("keydown",S)});function E(r){return K(this,null,function*(){o.value!==null&&(yield C.post(`/api/inspect/suspected/${o.value.id}/level`,{level:r}),i())})}function A(){k("email-sent",t.value.id),f()}function f(){o.value&&C({method:"post",url:`/api/inspect/suspected/${o.value.id}/handled`}).then(()=>i()).catch(()=>{})}function i(){C(`/api/inspect/vms?level=${l.level}`).then(r=>{o.value=r.data.suspected,t.value=r.data.student,a.value=r.data.studentsForExam,(!t.value||!t.value.is_kunskapsmatrisen&&!t.value.exam)&&f()}).catch(()=>{t.value=null,a.value=0,k("done")})}function g(){v.value={recipient:t.value.exam.teacher.email,student_id:t.value.id,type:"VM",message:le.render("VM",t.value)},s.value=!0}return(r,u)=>H((h(),x("div",null,[e("div",Bn,[T(oe,{level:n.level,student:t.value,type:n.type,onUpdateLevel:E,onMarkHandled:f,onShowEmail:g},null,8,["level","student","type"])]),e("div",Pn,[T(ie,{ref_key:"emailModalRef",ref:d,modelValue:s.value,"onUpdate:modelValue":u[0]||(u[0]=p=>
90s.value=p),content:v.value,"onUpdate:content":u[1]||(u[1]=p=>v.value=p),onSent:A},null,8,["modelValue","content"]),T(ue,{student:t.value},{extra:z(()=>{var p,I;return[$(y(o.value)+" ",1),u[2]||(u[2]=e("hr",{class:"p-2"},null,-1)),$(" "+y((p=t.value)==null?void 0:p.exam)+" ",1),u[3]||(u[3]=e("hr",{class:"p-2"},null,-1)),$(" "+y((I=t.value)==null?void 0:I.answer)+" ",1),u[4]||(u[4]=e("hr",{class:"p-2"},null,-1)),$(" "+y(a.value)+" students in the exam ",1)]}),_:1},8,["student"])])],512)),[[Q,n.type==="vm"]])}}),On={class:"container mb-8 mt-6 mx-auto"},Kn={class:"bg-white container h-full mb-72 mt-6 mx-auto rounded shadow"},Wn=J({__name:"Cores",props:{type:{type:String,default:""},level:{type:Number,default:0}},emits:["done","email-sent"],setup(n,{emit:m}){const l=n,k=m,t=b(null),s=b(!1),d=b(null),o=b(null),a=b(0),v=b({recipient:"",student_id:0,message:"",type:""});q([()=>l.type,()=>l.level],([r])=>{r==="cores"&&i()});function S(r){var u;l.type==="cores"&&(r.key==="m"&&s.value&&((u=d.value)==null||u.send()),!s.value&&(r.key==="m"&&g(),r.key==="h"&&f()))}ee(()=>{document.addEventListener("keydown",S)}),te(()=>{document.removeEventListener("keydown",S)});function E(r){return K(this,null,function*(){o.value!==null&&(yield C.post(`/api/inspect/suspected/${o.value.id}/level`,{level:r}),i())})}function A(){k("email-sent",t.value.id),f()}function f(){C({method:"post",url:`/api/inspect/suspected/${o.value.id}/handled`}).then(()=>i()).catch(()=>{})}function i(){C(`/api/inspect/cores?level=${l.level}`).then(r=>{o.value=r.data.suspected,t.value=r.data.student,a.value=r.data.studentsForExam,(!t.value||!t.value.is_kunskapsmatrisen&&!t.value.exam)&&f()}).catch(()=>{t.value=null,a.value=0,k("done")})}function g(){const r="CORES";v.value={recipient:t.value.exam.teacher.email,student_id:t.value.id,type:r,message:le.render(r,t.value)},s.value=!0}return(r,u)=>H((h(),x("div",null,[e("div",On,[T(oe,{level:n.level,student:t.value,type:n.type,onUpdateLevel:E,onMarkHandled:f,onShowEmail:g},null,8,["level","student","type"])]),e("div",Kn,[T(ie,{ref_key:"emailModalRef",ref:d,modelValue:s.value,"onUpdate:modelValue":u[0]||(u[0]=p=>
90s.value=p),content:v.value,"onUpdate:content":u[1]||(u[1]=p=>v.value=p),onSent:A},null,8,["modelValue","content"]),T(ue,{student:t.value},{extra:z(()=>{var p,I;return[u[2]||(u[2]=e("hr",{class:"p-2"},null,-1)),$(" "+y(o.value)+" ",1),u[3]||(u[3]=e("hr",{class:"p-2"},null,-1)),$(" "+y((p=t.value)==null?void 0:p.exam)+" ",1),u[4]||(u[4]=e("hr",{class:"p-2"},null,-1)),$(" "+y((I=t.value)==null?void 0:I.answer)+" ",1),u[5]||(u[5]=e("hr",{class:"p-2"},null,-1)),$(" "+y(a.value)+" students in the exam ",1)]}),_:1},8,["student"])])],512)),[[Q,n.type==="cores"]])}}),Fn={class:"container mb-8 mt-6 mx-auto"},Yn={class:"bg-white container h-full mb-72 mt-6 mx-auto rounded shadow"},qn={key:0,class:"bg-red-100 font-medium inline-flex items-center px-3 py-0.5 rounded-full text-red-800 text-sm"},Xn=J({__name:"Screen",props:{type:{type:String,default:""},level:{type:Number,default:0}},emits:["done","email-sent"],setup(n,{emit:m}){const l=n,k=m,t=b(null),s=b(!1),d=b(null),o=b(null),a=b(!1),v=b(0),S=b({recipient:"",student_id:0,message:"",type:""});q([()=>l.type,()=>l.level],([u])=>{u==="screen"&&g()});function E(u){var p;l.type==="screen"&&(u.key==="m"&&s.value&&((p=d.value)==null||p.send()),!s.value&&(u.key==="m"&&r(),u.key==="h"&&i()))}ee(()=>{document.addEventListener("keydown",E)}),te(()=>{document.removeEventListener("keydown",E)});function A(u){return K(this,null,function*(){o.value!==null&&(yield C.post(`/api/inspect/suspected/${o.value.id}/level`,{level:u}),g())})}function f(){k("email-sent",t.value.id),i()}function i(){C({method:"post",url:`/api/inspect/suspected/${o.value.id}/handled`}).then(()=>g()).catch(()=>{})}function g(){C(`/api/inspect/screen?level=${l.level}`).then(u=>{var p;o.value=u.data.suspected,t.value=u.data.student,a.value=(p=u.data.student)==null?void 0:p.extra.includes("iPhone"),v.value=u.data.studentsForExam,(!t.value||!t.value.is_kunskapsmatrisen&&!t.value.exam)&&i()}).catch(()=>{t.value=null,v.value=0,k("done")})}function r(){const u="SCREEN";S.value={recipient:t.value.exam.teacher.email,student_id:t.value.id,type:u,message:le.render(u,t.value)},s.value=!0}return(u,p)=>H((h(),x("div",null,[e("div",Fn,[T(oe,{level:n.level,student:t.value,type:n.type,onUpdateLevel:A,onMarkHandled:i,onShowEmail:r},null,8,["level","student","type"])]),e("div",Yn,[T(ie,{ref_key:"emailModalRef",ref:d,modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=I=>s.value=I),content:S.value,"onUpdate:content":p[1]||(p[1]=I=>S.value=I),onSent:f},null,8,["modelValue","content"]),T(ue,{student:t.value},{extra:z(()=>{var I,B;return[a.value?(h(),x("span",qn,[...p[2]||(p[2]=[e("b",null,"iPhone",-1)])])):R("",!0),p[3]||(p[3]=e("hr",{class:"p-2"},null,-1)),$(" "+y(o.value)+" ",1),p[4]||(p[4]=e("hr",{class:"p-2"},null,-1)),$(" "+y((I=t.value)==null?void 0:I.exam)+" ",1),p[5]||(p[5]=e("hr",{class:"p-2"},null,-1)),$(" "+y((B=t.value)==null?void 0:B.answer)+" ",1),p[6]||(p[6]=e("hr",{class:"p-2"},null,-1)),$(" "+y(v.value)+" students in the exam ",1)]}),_:1},8,["student"])])],512)),[[Q,n.type==="screen"]])}}),zn={class:"Inspection"},Jn={class:"Inspection__controls"},jn={class:"Inspection__stats"},Gn={class:"Inspection__stat"},Qn={class:"Inspection__stat"},Zn={class:"Inspection__stat"},es={class:"Inspection__stat"},ts={class:"Inspection__cards"},ns=["aria-pressed","onClick"],ss={class:"flex gap-4 items-start ml-auto"},as={class:"flex gap-2 items-center text-xs"},ls={class:"flex gap-2 items-center text-xs"},os={class:"text-xs"},us={class:"text-gray-500 text-xs"},is={class:"Inspection__details"},ds={class:"Inspection__empty"},rs=J({__name:"Inspection",props:{postponeLevel:{type:Number,required:!0}},setup(n){const m=n,l=xe(),k=b(""),t=b(0),s=ye({autotype:"",quickTyping:"",backspace:"",bek:"",extensions:"",vm:"",cores:"",screen:""}),d=ye({0:0,1:0,2:0,[m.postponeLevel]:0}),o=[{type:"autotype",label:"Autotype",component:jt},{type:"quickTyping",label:"Quick Typing",component:nn},{type:"bek",label:"BEK",component:Un},{type:"vm",label:"VM",component:Vn},{type:"extensions",label:"Extension",component:Hn},{type:"backspace",label:"Backspace",component:rn},{type:"cores",label:"Cores",component:Wn},{type:"screen",label:"Screen",component:Xn}];function a(f){k.value=f}function v(f){l.addId(f,k.value)}function S(){return K(this,null,function*(){yield Promise.all([0,1,2,m.postponeLevel].map(f=>K(null,null,function*(){const i=(yield C.get(`/api/inspect/count?level=${f}`)).data;d[f]=i.autotype+i.quickTyping+i.backspace+i.bek+i.extensions+i.vm+i.cores+i.screen})))})}function E(){return K(this,null,function*(){S();const f=yield C.get(`/api/inspect/count?level=${t.value}`);o.forEach(i=>
90{s[i.type]=f.data[i.type]})})}q(t,()=>{E()});function A(f){f.key==="c"&&E()}return ee(()=>{E(),document.addEventListener("keydown",A)}),te(()=>{document.removeEventListener("keydown",A)}),(f,i)=>(h(),x("div",zn,[e("div",Jn,[T(ze,{id:"level",modelValue:t.value,"onUpdate:modelValue":i[0]||(i[0]=g=>t.value=g),size:"small",options:[{label:"Level 0",value:0},{label:"Level 1",value:1},{label:"Level 2",value:2}],optionLabel:"label",optionValue:"value"},null,8,["modelValue"]),e("div",jn,[e("div",Gn,[i[4]||(i[4]=$("Level 0",-1)),i[5]||(i[5]=e("br",null,null,-1)),$(y(d[0]),1)]),e("div",Qn,[i[6]||(i[6]=$("Level 1",-1)),i[7]||(i[7]=e("br",null,null,-1)),$(y(d[1]),1)]),e("div",Zn,[i[8]||(i[8]=$("Level 2",-1)),i[9]||(i[9]=e("br",null,null,-1)),$(y(d[2]),1)]),e("div",es,[$("Level "+y(n.postponeLevel),1),i[10]||(i[10]=e("br",null,null,-1)),$(y(d[n.postponeLevel]),1)])]),e("ul",ts,[(h(),x(G,null,Z(o,g=>e("li",{key:g.type},[e("button",{class:he(["Inspection__card",{"Inspection__card--active":k.value===g.type}]),"aria-pressed":k.value===g.type,onClick:r=>a(g.type)},[$(y(g.label),1),i[11]||(i[11]=e("br",null,null,-1)),$(y(s[g.type]),1)],10,ns)])),64))]),e("div",ss,[e("div",null,[e("label",as,[H(e("input",{"onUpdate:modelValue":i[1]||(i[1]=g=>D(l).settings.handleAlreadyEmailed=g),type:"checkbox"},null,512),[[ke,D(l).settings.handleAlreadyEmailed]]),i[12]||(i[12]=$(" Auto-handle if same email already sent ",-1))]),e("label",ls,[H(e("input",{"onUpdate:modelValue":i[2]||(i[2]=g=>D(l).settings.handleNoLicense=g),type:"checkbox"},null,512),[[ke,D(l).settings.handleNoLicense]]),i[13]||(i[13]=$(" Auto-handle non-paying schools ",-1))]),e("div",os,y(D(l).autoHandleCount)+" auto-handled",1),e("div",us," Queue: "+y(D(l).bekPrefetched.length)+" bek / "+y(D(l).autotypePrefetched.length)+" autotype ",1)]),D(l).sentIds.size>0?(h(),We(Qe,{key:0,title:`Clear sent IDs (${D(l).sentIds.size})`,presses:3,class:"Inspection__clearButton",onClick:i[3]||(i[3]=g=>D(l).clearIds())},null,8,["title"])):R("",!0)])]),e("div",is,[H(e("div",ds,[...i[14]||(i[14]=[e("p",null,"Select a type to view details",-1)])],512),[[Q,!k.value]]),(h(),x(G,null,Z(o,g=>T(Fe(g.component),{key:g.type,type:k.value,level:t.value,postponeLevel:n.postponeLevel,onDone:E,onEmailSent:v},null,40,["type","level","postponeLevel"])),64))])]))}}),Es=pe(rs,[["__scopeId","data-v-797aa98e"]]);export{Es as default};
91//# sourceMappingURL=chunk.Bljeh1A0bQOw.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.