1import{b as B,w as D}from"./functions_helpers-D-Wjb5oA.js";import{E as g}from"./pinia-C77mTVcJ.js";import{s as V}from"./sharesRessources.mixin-CBYBPVy_.js";import{h as P}from"./haxios-eiGTx3T-.js";import{bN as x,bc as p,ac as l,b1 as i,aa as f,ab as _,ad as t,bo as m,F as C,ba as k,aQ as h,aS as A,x as b,ah as L,bI as U,be as T}from"./_plugin-vue_export-helper-CcwJHmZ5.js";import{T as M}from"./runtime-dom.esm-bundler-sqMgHvGa.js";import{l as z}from"./lodash-DOP3yL5f.js";const q={name:"uebungen-libary-absolved-stats-dashboard",data(){return{isLoading:!0,stats:null}},props:{uebung:{type:Object,required:!0}},computed:{bestResultsPerUser(){var n,e,r;return(r=(e=(n=this.stats)==null?void 0:n.data)==null?void 0:e.uebung)!=null&&r.length?this.stats.data.uebung.map(d=>d.sort((s,u)=>u.score_total_points!==s.score_total_points?u.score_total_points-s.score_total_points:u.score_correct_ratio-s.score_correct_ratio)[0]):[]},averageCorrectRatio(){return this.bestResultsPerUser.length?(this.bestResultsPerUser.reduce((e,r)=>e+r.score_correct_ratio,0)/this.bestResultsPerUser.length*100).toFixed(1):0},averageTimeRatio(){return this.bestResultsPerUser.length?(this.bestResultsPerUser.reduce((e,r)=>e+r.score_time_ratio,0)/this.bestResultsPerUser.length*100).toFixed(1):0},averageTotalPoints(){return this.bestResultsPerUser.length?(this.bestResultsPerUser.reduce((e,r)=>e+r.score_total_points,0)/this.bestResultsPerUser.length).toFixed(1):0},totalParticipants(){return this.bestResultsPerUser.length},totalAttempts(){var n,e,r;return(r=(e=(n=this.stats)==null?void 0:n.data)==null?void 0:e.uebung)!=null&&r.length?this.stats.data.uebung.reduce((d,o)=>d+o.length,0):0},sortedResults(){return this.bestResultsPerUser.length?[...this.bestResultsPerUser].sort((n,e)=>e.score_total_points!==n.score_total_points?e.score_total_points-n.score_total_points:e.score_correct_ratio-n.score_correct_ratio):[]}},methods:{getAttemptsForUser(n){var r,d,o;if(!((o=(d=(r=this.stats)==null?void 0:r.data)==null?void 0:d.uebung)!=null&&o.length))return 0;const e=this.stats.data.uebung.find(s=>s.length>0&&s[0].user.username===n);return(e==null?void 0:e.length)||0},getStats(){P.get(`/uebungen/absolved-records/index/${this.uebung.id}`).then(n=>{this.stats=n.data,this.isLoading=!1}).catch(n=>{console.error("Fehler beim Laden der Statistiken:",n),this.isLoading=!1})}},mounted(){this.getStats()}},O={class:"uebungen-library__uebung__result-dashboard w-full flex items-center justify-center p-4"},K={key:1,class:"flex flex-col w-full max-w-6xl space-y-4"},H={key:0,class:"rounded-lg p-2 mb-2"},N={class:"grid grid-cols-2 md:grid-cols-4 gap-4"},G={class:"flex flex-col items-center justify-center"},W={class:"text-2xl font-bold w-48 text-primary-600"},Z={class:"flex flex-col items-center justify-center"},Q={class:"text-2xl font-bold w-48 text-primary-600"},J={class:"flex flex-col items-center justify-center"},X={class:"text-2xl font-bold w-48 text-primary-600"},Y={class:"flex flex-col items-center justify-center"},ee={class:"flex flex-row items-center justify-start w-48"},te={class:"text-2xl font-bold text-primary-600"},ne={class:"text-xs text-grey-500 ml-1"},se={key:1,class:"rounded-lg overflow-hidden"},oe={class:"overflow-x-auto"},re={class:"w-full"},ie={class:"bg-grey-50"},le={class:"px-4 py-2 whitespace-nowrap"},ae={class:"text-xs font-medium text-blue-600"},ue={class:"px-4 py-2 whitespace-nowrap"},de={class:"flex items-center"},ce={class:"text-sm font-medium text-grey-900"},be={class:"px-4 py-2 whitespace-nowrap"},ge={class:"text-sm font-medium text-grey-600"},me={class:"px-4 py-2 whitespace-nowrap"},pe={class:"flex items-center"},he={class:"text-sm font-medium text-grey-900"},_e={class:"px-4 py-2 whitespace-nowrap"},ye={class:"flex items-center"},fe={class:"text-sm font-medium text-grey-900"},xe={class:"px-4 py-2 whitespace-nowrap"},ve={class:"text-sm font-bold"},we={class:"px-4 py-2 whitespace-nowrap"},Ce={class:"text-sm font-bold"},Ue={key:2,class:"rounded-lg p-6 text-center"};function ke(n,e,r,d,o,s){const u=p("loading-dots");return i(),l("div",O,[o.isLoading?(i(),f(u,{key:0})):(i(),l("div",K,[s.bestResultsPerUser.length>0?(i(),l("div",H,[t("div",N,[t("div",G,[e[0]||(e[0]=t("div",{class:"w-48 flex flex-row items-center justify-start text-sm text-grey-600"},[t("i",{class:"bx bx-check-circle text-lg mr-2"}),t("span",{class:""},"Korrektheit")],-1)),t("div",W,m(s.averageCorrectRatio)+"%",1)]),t("div",Z,[e[1]||(e[1]=t("div",{class:"w-48 flex flex-row items-center justify-start text-sm text-grey-600"},[t("i",{class:"bx bx-time text-lg mr-2"}),t("span",{class:""},"Zeit-Verhältnis")],-1)),t("div",Q,m(s.averageTimeRatio)+"%",1)]),t("div",J,[e[2]||(e[2]=t("div",{class:"w-48 flex flex-row items-center justify-start text-sm text-grey-600"},[t("i",{class:"bx bx-trophy text-lg mr-2"}),t("span",{class:""},"Punkte-Durchschnitt")],-1)),t("div",X,m(s.averageTotalPoints),1)]),t("div",Y,[e[3]||(e[3]=t("div",{class:"w-48 flex flex-row items-center justify-start text-sm text-grey-600"},[t("i",{class:"bx bx-group text-lg mr-2"}),t("span",{class:""},"Teilnehmer")],-1)),t("div",ee,[t("div",te,m(s.totalParticipants),1),t("div",ne,"("+m(s.totalAttempts)+" Versuche)",1)])])])])):_("",!0),s.bestResultsPerUser.length>0?(i(),l("div",se,[t("div",oe,[t("table",re,[e[4]||(e[4]=t("thead",{class:"bg-grey-50"},[t("tr",null,[t("th",{class:"px-4 py-3 text-left text-xs font-medium text-grey-500 uppercase w-10"}," Platz "),t("th",{class:"px-4 py-3 text-left text-xs font-medium text-grey-500 uppercase"}," Benutzer "),t("th",{class:"px-4 py-3 text-left text-xs font-medium text-grey-500 uppercase"}," Versuche "),t("th",{class:"px-4 py-3 text-left text-xs font-medium text-grey-500 uppercase"}," Korrektheit "),t("th",{class:"px-4 py-3 text-left text-xs font-medium text-grey-500 uppercase"}," Zeit "),t("th",{class:"px-4 py-3 text-left text-xs font-medium text-grey-500 uppercase"}," Punkte "),t("th",{class:"px-4 py-3 text-left text-xs font-medium text-grey-500 uppercase"}," Gravitas ")])],-1)),t("tbody",ie,[(i(!0),l(C,null,k(s.sortedResults,(c,a)=>(i(),l("tr",{key:c.id,class:h(["hover:bg-grey-50",{"border-t border-grey-300":a>0}])},[t("td",le,[t("span",ae,m(a+1),1)]),t("td",ue,[t("div",de,[t("div",null,[t("div",ce,m(c.user.username),1)])])]),t("td",be,[t("span",ge,m(s.getAttemptsForUser(c.user.username)),1)]),t("td",me,[t("div",pe,[t("span",he,m((c.score_correct_ratio*100).toFixed(1))+"%",1)])]),t("td",_e,[t("div",ye,[t("span",fe,m((c.score_time_ratio*100).toFixed(1))+"%",1)])]),t("td",xe,[t("span",ve,m(c.score_total_points),1)]),t("td",we,[t("span",Ce,m(c.score_gravitas),1)])],2))),128))])])])])):(i(),l("div",Ue,e[5]||(e[5]=[t("i",{class:"bx bx-info-circle text-4xl text-grey-400 mb-3"},null,-1),t("h3",{class:"text-lg font-semibold text-grey-600 mb-2"},"Keine Ergebnisse verfügbar",-1),t("p",{class:"text-grey-500"},"Für diese Ãbung sind noch keine Ergebnisse vorhanden.",-1)])))]))])}const Me=x(q,[["render",ke]]),$e={name:"uebungen-library-index-uebung",mixins:[V],components:{"uebungen-library-absolved-stats-dashboard":Me},props:{uebung:Object,displayFilter:{type:String,default:"all"},uebung_key:{type:Number,default:0}},data(){return{isAnimating:!1,isActiveAbsolvedDashboard:!1,isHovering:!1}},methods:{shareUebung(){this.openShareModalForUebung(this.uebung)},openEditUebungModal(){g.$emit("uebungen-library__open-edit-modal",{uebung:this.uebung})},async showEditConfirmMessage(){if((await P.get(`/uebungen/absolved-records/check/${this.uebung.id}`)).data.data.uebung.length>0){this.$IrisMessenger.confirm({type:"info",title:"Ãbungsergebnisse löschen?",message:`Die Ãbung wurde bereits von Benutzern absolviert und es wurden Ergebnisstatistiken gespeichert. Wenn Sie die Ãbung bearbeiten wollen, dann 2 müssen diese Statistiken gelöscht werden, damit es nicht zu Verzerrungen kommt. Wollen Sie die Ergebnisse löschen, um die Ãbung zu bearbeiten?`,callback:this.deleteAbsolvedRecordsAndOpenEditModal});return}this.openEditUebungModal()},async deleteAbsolvedRecordsAndOpenEditModal(){await P.post(`/uebungen/absolved-records/delete/${this.uebung.id}`),this.openEditUebungModal()},toggleAbsolvedDashboard(){this.isActiveAbsolvedDashboard=!this.isActiveAbsolvedDashboard},deleteUebung(){let n=async()=>{P.post("/uebungen/delete/"+this.uebung.id).then(async e=>{this.$IrisMessenger.dialog({type:"success",title:"Ãbung gelöscht",message:"Die Ãbung wurde gelöscht.",selfDestructTimer:2e3}),await D(500),g.$emit("requested-uebungen-fetch")}).catch(e=>{console.error(e),this.$IrisMessenger.dialog({type:"danger",title:"Fehler",message:"Die Ãbung konnte nicht gelöscht werden.",selfDestructTimer:2e3})})};this.$IrisMessenger.confirm({type:"danger",title:"Ãbung löschen?",message:"Soll die Ãbung gelöscht werden?",callback:n})},formatDate:B,addAnimationTrigger(){this.$refs[`uebung-${this.uebung_key}`].classList.add("hover-trigger"),this.isHovering=!0},removeAnimationTrigger(){this.$refs[`uebung-${this.uebung_key}`].classList.remove("hover-trigger"),this.isHovering=!1},openAbsolveModal(n){const r=n.currentTarget.getBoundingClientRect(),d={x:r.left+r.
2width/2,y:r.top+r.height/2};this.isAnimating=!0,setTimeout(()=>{this.isAnimating=!1},300),g.$emit("uebungen-library__open-absolve-modal",{uebung:this.uebung,position:d})},openPrintModal(n){n.preventDefault(),n.stopPropagation();const r=n.currentTarget.getBoundingClientRect(),d={x:r.left+r.width/2,y:r.top+r.height/2};this.isAnimating=!0,setTimeout(()=>{g.$emit("uebungen-library__open-print-uebung-modal",{uebung:this.uebung,uebung_key:this.uebung_key,position:d}),setTimeout(()=>{this.isAnimating=!1},300)},200)}},computed:{resolvedUebung(){return this.$resolveUebungFromRegistry(this.uebung.uebung_type)},categoryColor(){try{return this.$UebungenRegistry.registered_categories[this.resolvedUebung.category].color}catch{return console.info(this.uebung),"#000000"}}},mounted:function(){}},Ae={class:"flex flex-row"},Pe={class:"uebungen-library__uebung__category-thumb flex-shrink-0"},Le={class:"flex justify-center items-center flex-col opacity-75 lg-minus:hidden"},je={class:"flex-grow flex flex-col"},Ee={class:"flex-grow bg-white flex flex-row"},Re={class:"uebungen-library__uebung__icon-title flex flex-row w-2/3 border-r border-grey-200"},Se={class:"uebungen-library__thumbnail p-4 flex items-center justify-center"},Te={class:"bg-grey-50 rounded-full p-3 transition-all duration-300 hover:bg-grey-100 xl-minus:hidden"},Ie={class:"p-4 text-left flex-grow flex flex-col justify-center"},De={class:"mb-2"},Fe={key:0,class:"flex flex-col w-full"},Be={class:"lg-minus:text-lg xl-plus:text-xl font-bold text-grey-800 line-clamp-2 leading-tight"},Ve={key:1,class:"text-red-500 font-medium"},ze={class:"text-xs bg-white font-mono"},qe={class:"flex flex-row items-center text-sm text-grey-500"},Oe={class:"flex items-center"},Ke={class:"font-medium"},He={class:"flex flex-row items-center p-4 space-x-1"},Ne=["disabled"],Ge={class:"uebungen-library__uebung__body w-1/3 flex items-center justify-center p-4 bg-white"},We={class:"flex flex-row space-x-4 w-full"},Ze=["disabled"],Qe=["disabled"];function Je(n,e,r,d,o,s){const u=p("hermeneus-icon"),c=p("uebungen-library-absolved-stats-dashboard");return i(),l("div",{ref:`uebung-${r.uebung_key}`,onMouseover:e[6]||(e[6]=a=>s.addAnimationTrigger()),onMouseout:e[7]||(e[7]=a=>s.removeAnimationTrigger()),class:"uebungen-library__uebung rounded-lg overflow-hidden shadow-md hover:shadow-xl mb-4 transition-all duration-300 transform hover:-translate-y-1"},[t("div",Ae,[t("div",Pe,[t("div",{class:"h-full xl-plus:w-24 p-4 flex flex-col justify-start items-center transition-all duration-300",style:A(`background-color: ${this.categoryColor}`)},[t("div",Le,[b(u,{height:"45",width:"45",name:`hi-uebung-category-${s.resolvedUebung.category}`,color:"text-white",class:"mb-2 lg-minus:hidden"},null,8,["name"]),t("div",{class:h(["text-sm font-medium text-center xl-minus:hidden text-white",{"opacity-0":!o.isHovering}])},m(this.$UebungenRegistry.registered_categories[s.resolvedUebung.category].title),3)])],4)]),t("div",je,[t("div",Ee,[t("div",Re,[t("div",Se,[t("div",Te,[b(u,{height:"48",width:"48",name:s.resolvedUebung.appearance.icon,class:"text-grey-700"},null,8,["name"])])]),t("div",Ie,[t("div",De,[r.uebung.specific_uebung?(i(),l("div",Fe,[t("h3",Be,m(r.uebung.specific_uebung.title),1)])):(i(),l("div",Ve,[e[8]||(e[8]=L(" Keine spezifische Ãbung gefunden! ")),e[9]||(e[9]=t("br",null,null,-1)),t("span",ze,"("+m(r.uebung.uebung_type)+")",1)]))]),e[11]||(e[11]=t("div",{class:"h-5 p-2"},null,-1)),t("div",qe,[t("span",Oe,[e[10]||(e[10]=t("i",{class:"far fa-calendar-alt mr-2"},null,-1)),t("span",Ke,m(s.formatDate(r.uebung.created_at)),1)])])]),t("div",He,[t("button",{class:"text-grey-500 hover:text-grey-700 p-2 rounded-full hover:bg-grey-100 transition-all duration-200 tooltip","data-tooltip":"Teilen",onClick:e[0]||(e[0]=(...a)=>s.shareUebung&&s.shareUebung(...a))},e[12]||(e[12]=[t("i",{class:"bx bx-share-alt text-xl"},null,-1)])),t("button",{class:"text-grey-500 hover:text-grey-700 p-2 rounded-full hover:bg-grey-100 transition-all duration-200 tooltip","data-tooltip":"Ergebnis-Dashboard",onClick:e[1]||(e[1]=(...a)=>s.toggleAbsolvedDashboard&&s.toggleAbsolvedDashboard(...a))},e[13]||(e[13]=[t("i",{class:"bx bx-bar-chart-alt-2 text-xl"},null,-1)])),t("button",{class:h(["text-grey-500 hover:text-grey-700 p-2 rounded-full hover:bg-grey-100 transition-all duration-200 tooltip",{"opacity-50 cursor-not-allowed":!s.resolvedUebung.options.is_editable}]),onClick:e[2]||(e[2]=(...a)=>s.showEditConfirmMessage&&s.showEditConfirmMessage(...a)),disabled:!s.resolvedUebung.options.is_editable,"data-tooltip":"Bearbeiten"},e[14]||(e[14]=[t("i",{class:"fa-regular fa-pen-to-square text-xl"},null,-1)]),10,Ne),t("button",{class:"text-grey-500 hover:text-red-500 p-2 rounded-full hover:bg-grey-100 transition-all duration-200 tooltip","data-tooltip":"Löschen",onClick:e[3]||(e[3]=a=>s.deleteUebung(r.uebung))},e[15]||(e[15]=[t("i",{class:"fa-regular fa-trash-can text-xl"},null,-1)]))])]),t("div",Ge,[t("div",We,[t("button",{onClick:e[4]||(e[4]=(...a)=>s.openAbsolveModal&&s.openAbsolveModal(...a)),class:h([{"button-clicked":o.isAnimating},"button-play flex-1 flex flex-row justify-center items-center py-2 px-4 roun
2ded-lg bg-primary-600 text-white hover:bg-primary-700 transition-all duration-300 transform disabled:opacity-50 disabled:hover:bg-primary-600 disabled:hover:text-white disabled:hover:shadow-md hover:scale-105 shadow-md"]),disabled:!s.resolvedUebung.options.is_absolvable},[b(u,{height:"28",width:"28",name:"hi-uebung-play",color:"text-white"}),e[16]||(e[16]=t("span",{class:"font-bold lg-minus:hidden ml-4 mt-1 z-[1000]"},"Starten",-1))],10,Ze),t("button",{onClick:e[5]||(e[5]=(...a)=>s.openPrintModal&&s.openPrintModal(...a)),disabled:!s.resolvedUebung.options.is_printable,class:h([{"opacity-50 cursor-not-allowed":!s.resolvedUebung.options.is_printable},"button-print flex-1 flex flex-row justify-center items-center py-3 px-4 rounded-lg border-2 border-grey-300 text-grey-700 hover:border-primary-600 hover:text-primary-700 transition-all duration-300 transform hover:scale-105"])},[b(u,{height:"28",width:"28",name:"hi-uebung-print",color:"current"}),e[17]||(e[17]=t("span",{class:"font-medium lg-minus:hidden ml-3 mt-1"},"Drucken",-1))],10,Qe)])])]),b(M,{name:"slide-down"},{default:U(()=>[o.isActiveAbsolvedDashboard?(i(),f(c,{key:0,uebung:r.uebung},null,8,["uebung"])):_("",!0)]),_:1})])])],544)}const Xe=x($e,[["render",Je],["__scopeId","data-v-6f05da79"]]),Ye={name:"uebungen-library-curated-uebung-card",props:{uebung:{type:Object,required:!0},categoryColor:{type:String,default:"#4CAF50"}},data(){return{isAnimating:!1}},computed:{resolvedUebung(){return this.$resolveUebungFromRegistry(this.uebung.uebung_type)},uebungTitle(){var n;return((n=this.uebung.specific_uebung)==null?void 0:n.title)||"Unbenannte Ãbung"},uebungDescription(){var n;return((n=this.uebung.specific_uebung)==null?void 0:n.description)||null}},methods:{openAbsolveModal(n){const r=n.currentTarget.getBoundingClientRect(),d={x:r.left+r.width/2,y:r.top+r.height/2};this.isAnimating=!0,setTimeout(()=>{this.isAnimating=!1},300),g.$emit("uebungen-library__open-absolve-modal",{uebung:this.uebung,position:d})},openPrintModal(n){n.preventDefault(),n.stopPropagation();const r=n.currentTarget.getBoundingClientRect(),d={x:r.left+r.width/2,y:r.top+r.height/2};this.isAnimating=!0,setTimeout(()=>{g.$emit("uebungen-library__open-print-uebung-modal",{uebung:this.uebung,position:d}),setTimeout(()=>{this.isAnimating=!1},300)},200)}}},et={class:"curated-uebung-row"},tt={class:"curated-uebung-row__content"},nt={class:"text-base font-semibold text-grey-800 leading-tight"},st={key:0,class:"curated-uebung-row__desc text-sm text-grey-500"},ot={class:"flex items-center gap-1.5 flex-shrink-0 ml-3"},rt=["disabled"],it=["disabled"];function lt(n,e,r,d,o,s){var u,c,a,y,v,j,E,S;return i(),l("div",et,[t("div",tt,[t("span",nt,m(s.uebungTitle),1),s.uebungDescription?(i(),l("div",st,m(s.uebungDescription),1)):_("",!0)]),t("div",ot,[t("button",{onClick:e[0]||(e[0]=(...R)=>s.openAbsolveModal&&s.openAbsolveModal(...R)),disabled:!((c=(u=s.resolvedUebung)==null?void 0:u.options)!=null&&c.is_absolvable),class:h([{"button-clicked":o.isAnimating,"opacity-30 cursor-not-allowed":!((y=(a=s.resolvedUebung)==null?void 0:a.options)!=null&&y.is_absolvable)},"w-8 h-8 text-white rounded-full flex items-center justify-center transition-all duration-200 hover:scale-110"]),style:A({backgroundColor:r.categoryColor})},e[2]||(e[2]=[t("i",{class:"fas fa-play text-xs"},null,-1)]),14,rt),t("button",{onClick:e[1]||(e[1]=(...R)=>s.openPrintModal&&s.openPrintModal(...R)),disabled:!((j=(v=s.resolvedUebung)==null?void 0:v.options)!=null&&j.is_printable),class:h([{"opacity-30 cursor-not-allowed":!((S=(E=s.resolvedUebung)==null?void 0:E.options)!=null&&S.is_printable)},"w-8 h-8 border border-grey-300 text-grey-400 rounded-full flex items-center justify-center transition-all duration-200 hover:scale-110 hover:border-grey-500 hover:text-grey-600"])},e[3]||(e[3]=[t("i",{class:"fas fa-print text-xs"},null,-1)]),10,it)])])}const at=x(Ye,[["render",lt],["__scopeId","data-v-bcea7de5"]]),ut={name:"uebungen-library-curated-category-tile",components:{UebungenLibraryCuratedUebungCard:at},props:{category:{type:Object,required:!0},categoryAlias:{type:String,required:!0},uebungenByModule:{type:Object,required:!0}},data(){return{isHovered:!1}},computed:{totalUebungenCount(){return Object.values(this.uebungenByModule).reduce((n,e)=>n+e.uebungen.length,0)},categoryIcon(){return`hi-uebung-category-${this.categoryAlias}`},trueColorCategoryIcon(){return`hi-tc-uebung-category-${this.categoryAlias}`},categoryColor(){return this.category.color||"#4CAF50"},moduleEntries(){return Object.entries(this.uebungenByModule)}},methods:{getModuleIcon(n){var r,d,o;const e=(d=(r=this.$UebungenRegistry)==null?void 0:r.registered_uebungen)==null?void 0:d[n];return((o=e==null?void 0:e.appearance)==null?void 0:o.icon)||"hi-uebung-default"},getModuleTitle(n){var r,d;const e=(d=(r=this.$UebungenRegistry)==null?void 0:r.registered_uebungen)==null?void 0:d[n];return(e==null?void 0:e.title)||n}}},dt={class:"flex items-center gap-3 p-5 border-b border-grey-200"},ct={class:"flex flex-col justify-center flex-1"},bt={class:"text-xl uppercase font-bold text-grey-800 leading-tight tracking-wide"},gt={class:"bg-grey-100 text-grey-600 text-xs px-2 py-0.5 rounded-full"},mt={class:"flex items-center gap-3 px-5 py-2.5 bg-grey-50 border-b border-grey-100"},pt={class:"flex-shrink-0 text-grey-500"},ht={class:"text-lg font-semibold text-grey-700"},_t={class:"text-base text-grey-400"};function yt(n,e,r,d,o,s){const u=p("hermeneus-icon"),c=p("UebungenLibraryCuratedUebungCard");return i(),l("div",{class:"bg-white shadow-md border border-grey-200 overflow-hidden",style:A({borderTopColor:s.categoryColor,borderTopWidth:"3px",borderTopStyle:"solid"}),onMouseenter:e[0]||(e[0]=a=>o.isHovered=!0),onMouseleave:e[1]||(e[1]=a=>o.isHovered=!1)},[t("div",dt,[t("div",{class:"flex-shrink-0 relative",style:A([{width:"64px",height:"64px"},{color:s.categoryColor}])},[b(u,{name:s.trueColorCategoryIcon,height:"64",width:"64","preserve-colors":!0,class:"absolute inset-0 transition-opacity duration-300",style:A({opacity:o.isHovered?1:0})},null,8,["name","style"]),b(u,{name:s.categoryIcon,height:"64",width:"64",color:"current",class:"absolute inset-0 transition-opacity duration-300",style:A({opacity:o.isHovered?0:1})},null,8,["name","style"])],4),t("div",ct,[t("h2",bt,m(r.category.title),1)]),t("span",gt,m(s.totalUebungenCount)+" "+m(s.totalUebungenCount===1?"Ãbung":"Ãbungen"),1)]),(i(!0),l(C,null,k(s.moduleEntries,([a,y])=>(i(),l("div",{key:a},[t("div",mt,[t("div",pt,[b(u,{name:s.getModuleIcon(a),height:"36",width:"36",color:"current"},null,8,["name"])]),t("span",ht,m(s.getModuleTitle(a)),1),t("span",_t," ("+m(y.uebungen.length)+") ",1)]),t("div",null,[(i(!0),l(C,null,k(y.uebungen,v=>(i(),f(c,{key:v.id,uebung:v,"category-color":s.categoryColor},null,8,["uebung","category-color"]))),128))])]))),128))],36)}const ft=x(ut,[["render",yt]]),xt={name:"uebungen-library-curated-dashboard",components:{UebungenLibraryCuratedCategoryTile:ft},props:{uebungen:{type:Array,required:!0},isLoading:{type:Boolean,default:!1}},computed:{groupedUebungen(){const n={};
2return this.uebungen.forEach(e=>{var s,u,c;const r=this.$resolveUebungFromRegistry(e.uebung_type);if(!r||((s=r.options)==null?void 0:s.is_curatable)===!1)return;const d=r.category,o=r.alias;if(!n[d]){const a=(c=(u=this.$UebungenRegistry)==null?void 0:u.registered_categories)==null?void 0:c[d];if(!a)return;n[d]={category:a,modules:{}}}n[d].modules[o]||(n[d].modules[o]={alias:o,uebungen:[]}),n[d].modules[o].uebungen.push(e)}),n},orderedCategories(){return Object.entries(this.groupedUebungen).sort((e,r)=>{const d=Object.values(e[1].modules).reduce((s,u)=>s+u.uebungen.length,0);return Object.values(r[1].modules).reduce((s,u)=>s+u.uebungen.length,0)-d})},hasUebungen(){return this.orderedCategories.length>0}},methods:{getAnimationDelay(n){return`animation-delay: ${(n+1)*100}ms`},getCategoryGridClass(n){return n===0?"curated-dashboard__grid-item--primary":"curated-dashboard__grid-item--secondary"}}},vt={class:"curated-dashboard p-6"},wt={key:0,class:"flex items-center justify-center py-20"},Ct={key:1,class:"flex flex-col items-center justify-center py-20"},Ut={key:2,class:"curated-dashboard__grid"};function kt(n,e,r,d,o,s){const u=p("loading-comet"),c=p("UebungenLibraryCuratedCategoryTile");return i(),l("div",vt,[r.isLoading?(i(),l("div",wt,[b(u)])):s.hasUebungen?(i(),l("div",Ut,[(i(!0),l(C,null,k(s.orderedCategories,([a,y],v)=>(i(),l("div",{key:a,class:h([s.getCategoryGridClass(v),"animate-fade-slide"]),style:A(s.getAnimationDelay(v))},[b(c,{category:y.category,"category-alias":a,"uebungen-by-module":y.modules},null,8,["category","category-alias","uebungen-by-module"])],6))),128))])):(i(),l("div",Ct,e[0]||(e[0]=[t("div",{class:"w-24 h-24 bg-grey-200 rounded-full flex items-center justify-center mb-6"},[t("i",{class:"fas fa-folder-open text-4xl text-grey-400"})],-1),t("h3",{class:"text-2xl font-semibold text-grey-600 mb-2"},"Keine kuratierten Ãbungen",-1),t("p",{class:"text-grey-500 text-center max-w-md"}," Es sind aktuell keine kuratierten Ãbungen verfügbar. ",-1)])))])}const Mt=x(xt,[["render",kt],["__scopeId","data-v-571bdc0e"]]),$t={name:"uebungen-library-index",components:{UebungenLibraryIndexUebung:Xe,UebungenLibraryCuratedDashboard:Mt},data(){return{uebungen:[],filter_scope:"user",filter_category:"all",filter_search:"",isLoading:!1,isAnimating:!1,spreadPosition:{x:0,y:0}}},computed:{canCreateUebungen(){var n;return["admin","editor","tester"].includes((n=this.$userData)==null?void 0:n.role)},apiURLAppendix:function(){let n=`?scope=${this.filter_scope}`,e=this.filter_category==="all"?"":`&category=${this.filter_category}`,r=this.filter_search===""?"":`&search=${this.filter_search}`;return`${n}${e}${r}`}},methods:{async fetchUebungen(){this.isLoading=!0,this.uebungen=[],await P.get(`/uebungen/index${this.apiURLAppendix}`).then(async n=>{await D(600),this.isLoading=!1,this.uebungen=n.data.data.uebung})},setScope(n){this.filter_scope=n},openAbsolveModal(n,e){g.$emit("uebungen-library__open-absolve-modal",{uebung:n,position:e})},closeAbsolveModal(){g.$emit("close-absolve-uebung-modal")}},watch:{filter_scope:function(){this.fetchUebungen()},filter_category:function(){this.fetchUebungen()},filter_search:z.debounce(function(){this.fetchUebungen()},700)},mounted(){this.canCreateUebungen||(this.filter_scope="corpus"),this.fetchUebungen(),g.$on("requested-uebungen-fetch",()=>{this.fetchUebungen()})},beforeDestroy(){g.$off("requested-uebungen-fetch")}},At={class:"rounded shadow-md"},Pt={class:"uebungen-library__index__top-bar border border-t border-grey-300 flex flex-row justify-between xl-minus:flex-wrap rounded-t"},Lt={key:0,class:"px-6 pt-5 pb-9 bg-white flex flex-row items-center w-8/12"},jt={class:"uebungen-library_index__categories xl-minus:w-full xl:w-6/12 py-4 px-5 flex flex-row justify-between items-start flex-wrap minus:w-full select-none"},Et=["category_key"],Rt=["for"],St={class:"transition-all"},Tt={key:0,class:"flex flex-row justify-between flex-wrap p-5"},It={key:1},Dt={key:2,class:"flex flex-col p-5"};function Ft(n,e,r,d,o,s){const u=p("InputGroupAddon"),c=p("InputText"),a=p("InputGroup"),y=p("Divider"),v=p("RadioButton"),j=p("hermeneus-icon"),E=p("UebungenLibraryCuratedDashboard"),S=p("Skeleton"),R=p("UebungenLibraryIndexUebung");return i(),l("div",At,[t("div",Pt,[t("div",{class:h(["flex flex-col justify-between xl-minus:w-full",{"xl:w-6/12":o.filter_scope!=="corpus","w-full":o.filter_scope==="corpus"}])},[t("div",{class:h(["flex flex-row justify-start",{"w-2/3":o.filter_scope!=="corpus"}])},[s.canCreateUebungen?(i(),l("button",{key:0,onClick:e[0]||(e[0]=w=>s.setScope("user")),class:h([{"is-active-category text-primary-500":o.filter_scope==="user","text-grey-600":o.filter_scope!=="user"},"btn-category flex flex-row items-center justify-center bg-white hover:text-primary-600 py-5 px-6 text-xl whitespace-nowrap"])},e[7]||(e[7]=[t("i",{class:"bx bx-user mr-2 text-2xl"},null,-1),L("Meine Ãbungen ")]),2)):_("",!0),t("button",{onClick:e[1]||(e[1]=w=>s.setScope("corpus")),class:h([{"is-active-category text-primary-500":o.filter_scope==="corpus","text-grey-600":o.filter_scope!=="corpus"},"btn-category flex flex-row items-center justify-center bg-white hover:text-primary-600 py-5 px-6 text-xl whitespace-nowrap"])},e[8]||(e[8]=[t("i",{class:"hi hi-sentence mr-2 text-2xl"},null,-1),L("Kuratierte Ãbungen ")]),2),s.canCreateUebungen?(i(),l("button",{key:1,onClick:e[2]||(e[2]=w=>s.setScope("all")),class:h([{"is-active-category text-primary-500":o.filter_scope==="all","text-grey-600":o.filter_scope!=="all"},"btn-category flex flex-row items-center justify-center bg-white hover:text-primary-600 py-5 px-6 text-xl whitespace-nowrap"])},e[9]||(e[9]=[t("i",{class:"bx bx-list-ul mr-2 text-2xl"},null,-1),L("Stöbern ")]),2)):_("",!0)],2),o.filter_scope!=="corpus"?(i(),l("div",Lt,[b(a,null,{default:U(()=>[b(u,null,{default:U(()=>e[10]||(e[10]=[t("div",null,[t("i",{class:"fas fa-search text-lg"})],-1)])),_:1,__:[10]}),b(c,{size:"large",modelValue:o.filter_search,"onUpdate:modelValue":e[3]||(e[3]=w=>o.filter_search=w),placeholder:"Suche"},null,8,["modelValue"]),b(u,null,{default:U(()=>[t("button",{class:"hover:text-primary-600",onClick:e[4]||(e[4]=w=>this.filter_search="")},e[11]||(e[11]=[t("i",{class:"fas fa-times text-lg"},null,-1)]))]),_:1})]),_:1})])):_("",!0)],2),o.filter_scope!=="corpus"?(i(),l(C,{key:0},[b(y,{layout:"vertical",class:"mx-4 xl-minus:hidden"}),t("div",jt,[t("div",{class:h(["flex flex-row items-center mr-4 py-2 px-3 rounded-md cursor-pointer hover:text-grey-700 h-14 transition-all",{"text-primary-600 bg-grey-200":o.filter_category==="all","text-grey-600":o.filter_category!=="all"}])},[b(v,{modelValue:o.filter_category,"onUpdate:modelValue":e[5]||(e[5]=w=>o.filter_category=w),inputId:"all",name:"dynamic",value:"all",size:"large",variant:"primary"},null,8,["modelValue"]),e[12]||(e[12]=t("div",{class:"flex flex-row items-center ml-2 cursor-pointer"},[t("label",{for:"all",class:"text-xl cursor-pointer"},[t("i",{class:"fa-solid fa-bars-staggered text-2xl mx-2"}),L(" Alle")])],-1))],2),(i(!0),l(C,null,k(this.$UebungenRegistry.registered_categories,(w,$)=>(i(),l("div",{category_key:$,class:h(["flex flex-row items-center mr-4 py-2 px-3 rounded-md cursor-pointer hover:text-grey-700 h-14 transition-all",{"text-primary-600 bg-grey-200":o.filter_category===$,"text-grey-600":o.filter_category!=="key"}])},[b(v,{modelValue:o.filter_category,"onUpdate:modelValue":e[6]||(e[6]=F=>o.filter_category=F),inputId:$,name:"dynamic",value:$,size:"large",variant:"primary"},null,8,["modelValue","inputId","value"]),t("div",null,[t("label",{for:$,class:"text-xl mt-1 flex flex-row items-center ml-2 whitespace-nowrap cursor-pointer"},[b(j,{height:"32",width:"32",name:`hi-uebung-category-${$}`,color:"current",class:"mx-2"},null,8,["name"]),L(" "+m(w.title),1)],8,Rt)])],10,Et))),256))])],64)):_("",!0)]),t("div",St,[o.filter_scope==="corpus"?(i(),f(E,{key:0,uebungen:o.uebungen,"is-loading":o.isLoading},null,8,["uebungen","is-loading"])):(i(),l(C,{key:1},[o.isLoading?(i(),l("div",Tt,[(i(),l(C,null,k(60,w=>b(S,{height:"6rem",borderRadius:"12px",key:w,class:"m-3"})),64))])):!o.isLoading&&o.uebungen.length===0?(i(),l("div",It,e[13]||(e[13]=[t("div",{class:"flex flex-col items-center justify-center py-10"},[t("div",{class:"text-2xl text-grey-600"},"Keine Ãbungen gefunden!")],-1)]))):(i(),l("div",Dt,[(i(!0),l(C,null,k(o.uebungen,(w,$)=>(i(),f(R,{uebung:w,uebung_key:Number($),onOpenAbsolveModal:s.openAbsolveModal},null,8,["uebung","uebung_key","onOpenAbsolveModal"]))),256))]))],64))])])}const Bt=x($t,[["render",Ft],["__scopeId","data-v-7a5b4ce3"]]),Vt={name:"uebungen-library-create-uebung",data(){return{hoveredCategory:null,hoveredLudusCursus:!1}},methods:{createVokabelAbfrage(){g.$emit("uebungen-library__load-component-in-modal",{component_alias:"vokabel-abfrage-create-component",component_title:"Vokabelabfrage",component_icon:"hi-uebung-vokabelabfrage"})},selectUebung(n){g.$emit("uebungen-library__load-component-in-modal",{component_alias:n.components.create.alias,component_title:n.components.create.title,component_icon:"hi-uebungen-new"})}},computed:{registeredCategories(){return this.$UebungenRegistry.registered_categories},registeredUebungen(){return this.$UebungenRegistry.registered_uebungen},registeredUebungenByCategories(){return this.$UebungenRegistry.registered_uebungen_by_category.map(n=>({...n,uebungen:n.uebungen.filter(e=>{var r;return((r=e.options)==null?void 0:r.is_creatable)!==!1})}))}}},zt={class:"uebungen-library__create-uebung p-6 flex flex-row justify-evenly"},qt=["onMouseenter"],Ot=["onClick","disabled"],Kt={class:"header flex flex-col items-center justify-center w-full relative pointer-events-none"},Ht={class:"flex flex-row justify-center w-full p-6"},Nt={class:"text-4xl leading-normal uppercase text-center font-bold p-6"},Gt={class:"uebungen-library__create-uebung__btn__desc text-xl leading-relaxed px-6"},Wt={key:0,class:"uebungen-library__create-uebung__vokabelabfrage text-sm w-full text-white p-3 mt-6"},Zt={class:"w-18"},Qt={key:1,class:"text-sm w-full text-white p-3 mt-6"},Jt={class:"w-18"},Xt={class:"flex flex-col justify-center items-center"},Yt={class:"font-bold text-3xl mt-3"},en={class:"text-base text-center mt-2 uebungen-library__create-uebung__uebung-desc"},tn={class:"w-18"},nn=["onClick"],sn={class:"font-bold text-left"},on={class:"text-sm text-left uebungen-library__create-uebung__uebung-desc"};function rn(n,e,r,d,o,s){const u=p("hermeneus-icon");return i(),l("div",zt,[e[6]||(e[6]=t("div",{class:"uebungen-library__create-uebung__bg-container"},[t("img",{src:"/img/svg/discipulus-ipad.svg",alt:"",class:"uebungen-library__create-uebung__bg"})],-1)),(i(!0),l(C,null,k(s.registeredUebungenByCategories,c=>(i(),l("div",{key:c.alias,class:h(["mt-12",["uebungen-library__create-uebung__category-card-container",c.alias==="uebung-vocab"?"uebungen-library__create-uebung__category-card-container--wide":""]]),onMouseenter:a=>o.hoveredCategory=c.alias,onMouseleave:e[4]||(e[4]=a=>
2o.hoveredCategory=null)},[t("div",{class:h([{"is-hovered":o.hoveredCategory===c.alias,"uebungen-library__create-uebung__category-card--wide":c.alias==="uebung-vocab"},"uebungen-library__create-uebung__category-card cursor-pointer flex flex-row border-4 border-white rounded-xl shadow-xl overflow-hidden hover:shadow-2xl transition-all relative"])},[t("button",{onClick:a=>this.$emit("uebungen-library__set-active-step",`uebungen-library-category-${c.alias}-create`),class:"uebungen-library__create-uebung__btn flex flex-col items-center text-white leading-relaxed transition-all relative",disabled:!c.is_enabled},[t("div",Kt,[t("div",Ht,[o.hoveredCategory===c.alias?(i(),f(u,{key:0,height:"112",width:"112",name:`hi-tc-uebung-category-${c.alias}`,"preserve-colors":!0,class:"z-10"},null,8,["name"])):(i(),f(u,{key:1,height:"112",width:"112",name:`hi-uebung-category-${c.alias}`,color:"current",class:"z-10"},null,8,["name"]))])]),t("h2",Nt,m(c.title),1),t("div",Gt,m(c.description),1),c.alias==="uebung-vocab"?(i(),l("div",Wt,[t("button",{onClick:e[0]||(e[0]=(...a)=>s.createVokabelAbfrage&&s.createVokabelAbfrage(...a)),class:"uebung-item w-full flex flex-row justify-start items-start text-primary-400 hover:text-primary-200 p-4 mt-2 rounded bg-transparent hover:bg-primary-900/50 ring-1 ring-primary-400/50 text-xl transition-all"},[t("div",Zt,[b(u,{height:"48",width:"48",name:"hi-uebung-vokabelabfrage",color:"current",class:"mr-4"})]),e[5]||(e[5]=t("div",{class:"flex flex-col justify-start items-start"},[t("div",{class:"text-xl font-bold"},"Vokabelabfrage"),t("div",{class:"text-sm text-left uebungen-library__create-uebung__uebung-desc"},"Eine Abfrage aus verschiedenen Vokabel-Ãbungen erstellen")],-1))])])):_("",!0),c.alias==="uebung-ludus"?(i(),l("div",Qt,[(i(!0),l(C,null,k(c.uebungen,a=>(i(),l("div",{onClick:e[1]||(e[1]=y=>s.selectUebung(s.registeredUebungen["uebung-ludus-cursus"])),onMouseenter:e[2]||(e[2]=y=>o.hoveredLudusCursus=!0),onMouseleave:e[3]||(e[3]=y=>o.hoveredLudusCursus=!1),class:"uebung-item cursor-pointer flex flex-col justify-center items-center bg-primary-900 hover:bg-primary-200 p-4 mt-2 rounded text-primary-400 hover:text-primary-800 text-xl transition-all"},[t("div",Jt,[b(u,{height:"160",width:"160",name:"hi-ludus-cursus","preserve-colors":o.hoveredLudusCursus,color:"current",class:"mr-4"},null,8,["preserve-colors"])]),t("div",Xt,[t("div",Yt,m(a.title),1),t("div",en,m(a.description),1)])],32))),256))])):(i(),l("div",{key:2,class:h(["text-sm w-full text-white p-3",{"mt-6":c.alias!=="uebung-vocab","grid grid-cols-2 gap-2":c.alias==="uebung-vocab"}])},[(i(!0),l(C,null,k(c.uebungen,a=>(i(),l("button",{class:h([{"hidden-vokabel-abfrage":a.alias==="vokabel-abfrage","mt-2":c.alias!=="uebung-vocab"},"uebung-item flex flex-row justify-start items-start bg-primary-900 hover:bg-primary-800 p-4 rounded text-primary-400 hover:text-primary-200 text-xl transition-all"])},[t("div",tn,[b(u,{height:"48",width:"48",name:`${a.appearance.icon}`,color:"current",class:"mr-4"},null,8,["name"])]),t("div",{onClick:y=>s.selectUebung(a),class:"flex flex-col justify-start items-start"},[t("div",sn,m(a.title),1),t("div",on,m(a.description),1)],8,nn)],2))),256))],2))],8,Ot)],2)],42,qt))),128))])}const I=x(Vt,[["render",rn],["__scopeId","data-v-dc6568ee"]]),ln={name:"uebungen-library-dashboard",components:{UebungenLibraryCreateUebung:I,UebungenLibraryIndex:Bt},data(){return{}},methods:{openCreateUebungComponentEvent(){this.$emit("uebungen-library__set-active-step","create-uebung")},openModal(n){const r=n.currentTarget.getBoundingClientRect(),d={x:r.left+r.width/2,y:r.top+r.height/2};g.$emit("uebungen-library__open-create-modal",{position:d})}}},an={class:"uebungen-library__dashboard flex flex-col"},un={class:"flex flex-row justify-end p-5"};function dn(n,e,r,d,o,s){const u=p("hermeneus-icon"),c=p("uebungen-library-index");return i(),l("div",an,[t("div",un,[this.$userData.role==="admin"?(i(),l("button",{key:0,onClick:e[0]||(e[0]=(...a)=>s.openModal&&s.openModal(...a)),class:"uebungen-library__btn-create-uebung w-[6rem] h-[6rem] text-5xl text-white rounded-xl"},[b(u,{name:"hi-uebung-create",color:"current",height:"68",width:"68",class:"z-[1000]"})])):_("",!0)]),e[1]||(e[1]=t("div",{class:"flex flex-row"},[t("div",{class:"w-1/2 bg-primary-200"}),t("div",{class:"w-1/2 bg-primary-200"})],-1)),t("div",null,[b(c,{class:"rounded"})])])}const cn=x(ln,[["render",dn],["__scopeId","data-v-152639b0"]]),bn={methods:{openUebungCreateModal(n){g.$emit("openUebungCreateModal",n)}}},gn={name:"uebungen-library-category-uebung-classic-create",mixins:[bn]},mn=["onClick"],pn={class:"text-2xl"},hn={class:"flex mt-2"};function _n(n,e,r,d,o,s){return i(),l("div",null,[t("div",null,[t("button",{onClick:e[0]||(e[0]=u=>this.$emit("uebungen-library__set-active-step","create-uebung")),class:"left-0 pl-5 w-24 h-24 text-5xl bg-white hover:bg-primary-700 hover:text-white text-primary-700 p-4 shadow-lg"},e[1]||(e[1]=[t("i",{class:"fas fa-caret-left"},null,-1)])),t("div",null,[e[3]||(e[3]=t("h1",null,"UebungenLibrary__CategoryUebungClassicCreate",-1)),(i(!0),l(C,null,k(this.$UebungenRegistry.registered_uebungen,(u,c)=>(i(),l("button",{onClick:a=>this.openUebungCreateModal({title:`${u.components.create.title}`,componentPath:u.components.create.path,moduleName:u.module.name}),class:"m-5 shadow p-3 bg-white hover:bg-primary-200"},[t("div",pn,[e[2]||(e[2]=t("i",{class:"fas fa-plus-square mr-2"}
2,null,-1)),L(m(u.title),1)]),t("div",hn,m(u.description),1)],8,mn))),256))])])])}const yn=x(gn,[["render",_n]]),fn={name:"uebungen-library-create-uebung-modal",components:{UebungenLibraryCreateUebung:I},props:{},data(){return{component_alias:null,component_title:null,component_icon:null}},methods:{closeModal(){this.$emit("close-create-uebung-modal")},loadComponentInModal(n,e,r){this.component_alias=n,this.component_title=e,this.component_icon=r}},mounted(){g.$on("uebungen-library__load-component-in-modal",n=>{this.loadComponentInModal(n.component_alias,n.component_title,n.component_icon)})}},xn={class:"uebungen-library__modal flex flex-col fixed top-0 left-0 w-screen h-screen z-[1000]"},vn={class:"uebungen-library__modal-header relative flex flex-row justify-center items-center px-20 bg-primary-900 text-white transition-all delay-75"},wn={key:0,class:"flex flex-row items-center"},Cn={class:"flex flex-row items-center py-3 px-8 bg-white text-primary-700 hover:text-secondary_color transition-all"},Un={class:"text-xl md-minus:hidden"},kn={class:"uebungen-library__modal-content flex-grow overflow-auto"};function Mn(n,e,r,d,o,s){const u=p("hermeneus-icon");return i(),l("div",xn,[t("div",vn,[t("button",{onClick:e[0]||(e[0]=(...c)=>s.closeModal&&s.closeModal(...c)),class:"flex flex-row items-center py-3 px-8 hover:text-secondary_color transition-all"},[b(u,{name:"hi-uebungen-new",color:"current",height:"48",width:"48",class:"mr-2"}),e[3]||(e[3]=t("span",{class:"text-xl font-light md-minus:hidden"},"Ãbungsbibliothek",-1))]),e[7]||(e[7]=t("i",{class:"fas fa-angle-right mx-5"},null,-1)),t("button",{onClick:e[1]||(e[1]=c=>s.loadComponentInModal("uebungen-library-create-uebung","Ãbung erstellen: Auswahl","hi-uebung-create")),class:h([{"bg-primary-800":o.component_alias==="uebungen-library-create-uebung","bg-primary-900":o.component_alias!=="uebungen-library-create-uebung"},"flex flex-row items-center bg-primary-800 py-3 px-8 hover:text-secondary_color transition-all"])},[b(u,{name:"hi-uebung-create",color:"current",height:"48",width:"48",class:"mr-2"}),e[4]||(e[4]=t("span",{class:"text-xl font-light md-minus:hidden"},"Ãbung erstellen: Auswahl",-1))],2),o.component_alias&&o.component_alias!=="uebungen-library-create-uebung"?(i(),l("div",wn,[e[5]||(e[5]=t("i",{class:"fas fa-angle-right mx-5"},null,-1)),t("button",Cn,[b(u,{name:o.component_icon,color:"current",height:"48",width:"48",class:"mr-2"},null,8,["name"]),t("span",Un,m(o.component_title),1)])])):_("",!0),t("button",{class:"absolute right-8 top-1/2 transform -translate-y-1/2 text-primary-400 hover:text-white",onClick:e[2]||(e[2]=(...c)=>s.closeModal&&s.closeModal(...c))},e[6]||(e[6]=[t("i",{class:"text-3xl fas fa-times"},null,-1)]))]),t("div",kn,[b(M,{name:"slide",mode:"out-in"},{default:U(()=>[(i(),f(T(o.component_alias??"uebungen-library-create-uebung")))]),_:1})])])}const $n=x(fn,[["render",Mn],["__scopeId","data-v-04cc099f"]]),An={name:"uebungen-library-absolve-uebung-modal",props:{uebung:{type:Object,required:!0}},data(){return{isClosing:!1,isLoading:!1,component_alias:null,component_title:null,component_icon:null,component_data:null}},computed:{resolvedUebung(){return this.$resolveUebungFromRegistry(this.uebung.uebung_type)},dynamicComponent(){return this.component_alias||"uebungen-library-absolve-uebung"}},methods:{closeModal(){this.isClosing=!0,setTimeout(()=>{this.$emit("close-absolve-uebung-modal"),this.isClosing=!1},300)},getAbsolveComponent(){this.component_alias=this.$resolveUebungFromRegistry(this.uebung.uebung_type).components.absolve.alias,this.component_title=this.$resolveUebungFromRegistry(this.uebung.uebung_type).components.absolve.title,this.component_icon=this.$resolveUebungFromRegistry(this.uebung.uebung_type).appearance.icon??null,this.getAbsolveComponentData()},getAbsolveComponentData(){this.isLoading=!0,P.get(`/uebungen/absolve/${this.uebung.id}`).then(n=>{this.component_data=n.data.data,this.isLoading=!1})},loadComponentInModal(n,e,r,d){this.component_alias=n,this.component_title=e,this.component_icon=r,this.component_data=d},handleEscKey(n){n.key==="Escape"&&this.closeModal()},preventScroll(){document.body.style.overflow="hidden"},enableScroll(){document.body.style.overflow=""}},mounted(){this.getAbsolveComponent(),this.preventScroll(),window.addEventListener("keydown",this.handleEscKey),g.$on("uebungen-library__load-component-in-absolve-modal",n=>{this.loadComponentInModal(n.component_alias,n.component_title,n.component_icon)})},beforeDestroy(){this.enableScroll(),window.removeEventListener("keydown",this.handleEscKey),g.$off("uebungen-library__load-component-in-absolve-modal")}},Pn={class:"uebungen-library__modal flex flex-col fixed top-0 left-0 w-screen h-screen z-[1000]"},Ln={class:"uebungen-library__modal-header relative flex flex-row justify-center items-center px-20 bg-primary-900 text-white transition-all delay-75"},jn={class:"flex flex-row justify-center items-center"},En={key:0,class:"flex flex-row items-center"},Rn={class:"flex flex-row items-center py-3 px-8 bg-white text-primary-700 hover:text-secondary_color transition-all"},Sn={class:"text-xl md-minus:hidden"},Tn={class:"uebungen-library__modal-content flex-grow overflow-auto"},In={key:0,class:"pt-32 flex justify-center items-center"};function Dn(n,e,r,d,o,s){const u=p("hermeneus-icon"),c=p("loading-comet");return i(),l("div",Pn,[t("div",Ln,[t("div",jn,[t("button",{onClick:e[0]||(e[0]=(...a)=>s.closeModal&&s.closeModal(...a)),class:"flex flex-row items-center py-3 px-8 hover:text-secondary_color transition-all"},[b(u,{name:"hi-uebungen-new",color:"current",height:"48",width:"48",class:"mr-2"}),e[3]||(e[3]=t("span",{class:"text-xl font-light md-minus:hidden"},"Ãbungsbibliothek",-1))]),e[6]||(e[6]=t("i",{class:"fas fa-angle-right mx-5"},null,-1)),t("button",{onClick:e[1]||(e[1]=a=>s.loadComponentInModal("uebungen-library-absolve-uebung","Ãbung absolvieren","hi-uebung-play")),class:h([{"bg-primary-800":o.component_alias==="uebungen-library-absolve-uebung","bg-primary-900":o.component_alias!=="uebungen-library-absolve-uebung"},"flex flex-row items-center bg-primary-800 py-3 px-8 hover:text-secondary_color transition-all"])},[b(u,{name:"hi-uebung-play",color:"current",height:"48",width:"48",class:"mr-2 pt-2"}),e[4]||(e[4]=t("span",{class:"text-xl font-light md-minus:hidden"},"Ãbung durchführen",-1))],2),o.component_alias&&o.component_alias!=="uebungen-library-absolve-uebung"?(i(),l("div",En,[e[5]||(e[5]=t("i",{class:"fas fa-angle-right mx-5"},null,-1)),t("button",Rn,[b(u,{name:o.component_icon,color:"current",height:"48",width:"48",class:"mr-2"},null,8,["name"]),t("span",Sn,m(o.component_title),1)])])):_("",!0)]),t("button",{class:"absolute right-8 top-1/2 transform -translate-y-1/2 text-primary-400 hover:text-white",onClick:e[2]||(e[2]=(...a)=>s.closeModal&&s.closeModal(...a))},e[7]||(e[7]=[t("i",{class:"text-3xl fas fa-times"},null,-1)]))]),t("div",Tn,[b(M,{name:"slide",mode:"out-in"},{default:U(()=>[o.isLoading?(i(),l("div",In,[b(c,{class:"text-primary-700"})])):s.dynamicComponent?(i(),f(T(s.dynamicComponent),{key:1,data:o.component_data,class:"p-5 bg-white"},null,8,["data"])):_("",!0)]),_:1})])])}const Fn=x(An,[["render",Dn],["__scopeId","data-v-8441de8a"]]),Bn={name:"uebungen-library-edit-uebung-modal",props:{uebung:{type:Object,required:!0}},data(){return{isClosing:!1,isLoading:!1,component_alias:null,component_title:null,component_icon:null,component_data:null}},computed:{resolvedUebung(){return this.$resolveUebungFromRegistry(this.uebung.uebung_type)},dynamicComponent(){return this.component_alias||"uebungen-library-edit-uebung"}},methods:{closeModal(){this.isClosing=!0,setTimeout(()=>{this.$emit("close-edit-uebung-modal"),this.isClosing=!1},300)},getEditComponent(){this.component_alias=this.$resolveUebungFromRegistry(this.uebung.uebung_type).components.edit.alias,this.component_title=this.$resolveUebungFromRegistry(this.uebung.uebung_type).components.edit.title,this.component_icon=this.$resolveUebungFromRegistry(this.uebung.uebung_type).appearance.icon??null,this.getEditComponentData()},getEditComponentData(){this.isLoading=!0,P.get(`/uebungen/edit/${this.uebung.id}`).then(n=>{this.component_data=n.data.data,this.isLoading=!1})},loadComponentInModal(n,e,r,d){this.component_alias=n,this.component_title=e,this.component_icon=r,this.component_data=d},handleEscKey(n){n.key==="Escape"&&this.closeModal()},preventScroll(){document.body.style.overflow="hidden"},enableScroll(){document.body.style.overflow=""}},mounted(){this.getEditComponent(),this.preventScroll(),window.addEventListener("keydown",this.handleEscKey),g.$on("uebungen-library__load-component-in-edit-modal",n=>{this.loadComponentInModal(n.component_alias,n.component_title,n.component_icon)})},beforeDestroy(){this.enableScroll(),window.removeEventListener("keydown",this.handleEscKey),g.$off("uebungen-library__load-component-in-edit-modal")}},Vn={class:"uebungen-library__modal flex flex-col fixed top-0 left-0 w-screen h-screen z-[1000]"},zn={class:"uebungen-library__modal-header relative flex flex-row justify-center items-center px-20 bg-primary-900 text-white transition-all delay-75"},qn={class:"flex flex-row justify-center items-center"},On={key:0,class:"flex flex-row items-center"},Kn={class:"flex flex-row items-center py-3 px-8 bg-white text-primary-700 hover:text-secondary_color transition-all"},Hn={class:"text-xl md-minus:hidden"},Nn={class:"uebungen-library__modal-content flex-grow overflow-auto"},Gn={key:0,class:"pt-32 flex justify-center items-center"};function Wn(n,e,r,d,o,s){const u=p("hermeneus-icon"),c=p("loading-comet");return i(),l("div",Vn,[t("div",zn,[t("div",qn,[t("button",{onClick:e[0]||(e[0]=(...a)=>s.closeModal&&s.closeModal(...a)),class:"flex flex-row items-center py-3 px-8 hover:text-secondary_color transition-all"},[b(u,{name:"hi-uebungen-new",color:"current",height:"48",width:"48",class:"mr-2"}),e[2]||(e[2]=t("span",{class:"text-xl font-light md-minus:hidden"},"Ãbungsbibliothek",-1))]),o.component_alias&&o.component_alias!=="uebungen-library-edit-uebung"?(i(),l("div",On,[e[3]||(e[3]=t("i",{class:"fas fa-angle-right mx-5"},null,-1)),t("button",Kn,[b(u,{name:o.component_icon,color:"current",height:"48",width:"48",class:"mr-2"},null,8,["name"]),t("span",Hn,m(o.component_title),1)])])):_("",!0)]),t("button",{class:"absolute right-8 top-1/2 transform -translate-y-1/2 text-primary-400 hover:text-white",onClick:e[1]||(e[1]=(...a)=>s.closeModal&&s.closeModal(...a))},e[4]||(e[4]=[t("i",{class:"text-3xl fas fa-times"},null,-1)]))]),t("div",Nn,[b(M,{name:"slide",mode:"out-in"},{default:U(()=>[o.isLoading?(i(),l("div",Gn,[b(c,{class:"text-primary-700"})])):s.dynamicComponent?(i(),f(T(s.dynamicComponent),{key:1,data:o.component_data,class:"p-5 bg-white"},null,8,["data"])):_("",!0)]),_:1})])])}const Zn=x(Bn,[["render",Wn],["__scopeId","data-v-e94b582f"]]),Qn={name:"uebungen-library-print-uebung-modal",props:{uebung:{type:Object,required:!0}},data(){return{isClosing:!1,isLoading:!1,component_alias:null,component_title:null,component_icon:null,component_data:null}},computed:{resolvedUebung(){return this.$resolveUebungFromRegistry(this.uebung.uebung_type)},dynamicComponent(){return this.component_alias||"uebungen-library-print-uebung"}},methods:{closeModal(){this.isClosing=!0,setTimeout(()=>{this.$emit("close-print-uebung-modal"),this.isClosing=!1},300)},print(){this.prepareForPrint(),this.$el.offsetHeight,window.print()},getPrintComponent(){var n,e;this.component_alias=((n=this.$resolveUebungFromRegistry(this.uebung.uebung_type).components.print)==null?void 0:n.alias)||"uebungen-library-print-uebung",this.component_title=((e=this.$resolveUebungFromRegistry(this.uebung.uebung_type).components.print)==null?void 0:e.title)||"Ãbung drucken",this.component_icon=this.$resolveUebungFromRegistry(this.uebung.uebung_type).appearance.icon??"hi-uebung-print",this.getPrintComponentData()},getPrintComponentData(){this.isLoading=!0,P.get(`/uebungen/print/${this.uebung.id}`).then(n=>{this.component_data=n.data.data,this.isLoading=!1})},loadComponentInModal(n,e,r,d){this.component_alias=n,this.component_title=e,this.component_icon=r,this.component_data=d},handleEscKey(n){n.key==="Escape"&&this.closeModal()},preventScroll(){document.body.style.overflow="hidden"},enableScroll(){document.body.style.overflow=""},prepareForPrint(){const n=this.$el,e=n.querySelector(".uebungen-library__modal-content"),r=n.querySelector(".uebungen-library__modal-header"),d=n.querySelector(".uebungen-library__print-options");n.classList.remove("fixed","h-screen","w-screen","flex","flex-col"),n.style.setProperty("position","static","important"),n.style.setProperty("height","auto","important"),n.style.setProperty("width","100%","important"),n.style.setProperty("display","block","important"),e&&(e.scrollTop=0,e.classList.remove("overflow-auto","flex-grow"),e.style.setProperty("overflow","visible","important"),e.style.setProperty("height","auto","important")),r&&r.style.setProperty("display","none","important"),d&&d.style.setProperty("display","none","important");const o=n.parentElement;
2o&&(Array.from(o.children).forEach(s=>{s!==n&&(s._savedDisplay=s.style.display,s.style.setProperty("display","none","important"))}),o.style.setProperty("overflow","visible","important"),o.style.setProperty("height","auto","important"))},restoreFromPrint(){const n=this.$el,e=n.querySelector(".uebungen-library__modal-content"),r=n.querySelector(".uebungen-library__modal-header"),d=n.querySelector(".uebungen-library__print-options");n.classList.add("fixed","h-screen","w-screen","flex","flex-col"),n.style.removeProperty("position"),n.style.removeProperty("height"),n.style.removeProperty("width"),n.style.removeProperty("display"),e&&(e.classList.add("overflow-auto","flex-grow"),e.style.removeProperty("overflow"),e.style.removeProperty("height")),r&&r.style.removeProperty("display"),d&&d.style.removeProperty("display");const o=n.parentElement;o&&(Array.from(o.children).forEach(s=>{s!==n&&(s.style.display=s._savedDisplay||"")}),o.style.removeProperty("overflow"),o.style.removeProperty("height"))}},mounted(){this.getPrintComponent(),this.preventScroll(),window.addEventListener("keydown",this.handleEscKey),window.addEventListener("beforeprint",this.prepareForPrint),window.addEventListener("afterprint",this.restoreFromPrint),g.$on("uebungen-library__load-component-in-print-modal",n=>{this.loadComponentInModal(n.component_alias,n.component_title,n.component_icon)})},beforeDestroy(){this.enableScroll(),window.removeEventListener("keydown",this.handleEscKey),window.removeEventListener("beforeprint",this.prepareForPrint),window.removeEventListener("afterprint",this.restoreFromPrint),g.$off("uebungen-library__load-component-in-print-modal")}},Jn={class:"uebungen-library__modal flex flex-col fixed top-0 left-0 w-screen h-screen z-[1000]"},Xn={class:"uebungen-library__modal-header relative flex flex-row justify-center items-center px-20 bg-primary-900 text-white transition-all delay-75"},Yn={key:0,class:"flex flex-row items-center pointer-events-none"},es={class:"flex flex-row items-center py-3 px-8 bg-white text-primary-700 transition-all"},ts={class:"text-xl md-minus:hidden"},ns={class:"uebungen-library__modal-content flex-grow overflow-auto"},ss={key:0,class:"pt-32 flex justify-center items-center"},os={key:1},rs={class:"uebungen-library__print-options p-6 flex justify-end"};function is(n,e,r,d,o,s){const u=p("hermeneus-icon"),c=p("loading-comet"),a=p("Button");return i(),l("div",Jn,[t("div",Xn,[t("button",{onClick:e[0]||(e[0]=(...y)=>s.closeModal&&s.closeModal(...y)),class:"flex flex-row items-center py-3 px-8 hover:text-secondary_color transition-all"},[b(u,{name:"hi-uebungen-new",color:"current",height:"48",width:"48",class:"mr-2"}),e[3]||(e[3]=t("span",{class:"text-xl font-light md-minus:hidden"},"Ãbungsbibliothek",-1))]),e[7]||(e[7]=t("i",{class:"fas fa-angle-right mx-5"},null,-1)),t("button",{onClick:e[1]||(e[1]=y=>s.loadComponentInModal("uebungen-library-print-uebung","Ãbung drucken","hi-uebung-print")),class:h([{"bg-primary-800":o.component_alias==="uebungen-library-print-uebung","bg-primary-900":o.component_alias!=="uebungen-library-print-uebung"},"flex flex-row items-center bg-primary-800 py-3 px-8 pointer-events-none transition-all"])},[b(u,{name:"hi-uebung-print",color:"current",height:"48",width:"48",class:"mr-2 pt-2"}),e[4]||(e[4]=t("span",{class:"text-xl font-light md-minus:hidden"},"Ãbung drucken",-1))],2),o.component_alias&&o.component_alias!=="uebungen-library-print-uebung"?(i(),l("div",Yn,[e[5]||(e[5]=t("i",{class:"fas fa-angle-right mx-5"},null,-1)),t("button",es,[b(u,{name:o.component_icon,color:"current",height:"48",width:"48",class:"mr-2"},null,8,["name"]),t("span",ts,m(o.component_title),1)])])):_("",!0),t("button",{class:"absolute right-8 top-1/2 transform -translate-y-1/2 text-primary-400 hover:text-white",onClick:e[2]||(e[2]=(...y)=>s.closeModal&&s.closeModal(...y))},e[6]||(e[6]=[t("i",{class:"text-3xl fas fa-times"},null,-1)]))]),t("div",ns,[b(M,{name:"fade",mode:"out-in"},{default:U(()=>[o.isLoading?(i(),l("div",ss,[b(c,{class:"text-primary-700"})])):s.dynamicComponent?(i(),l("div",os,[t("div",rs,[b(a,{label:"Drucken",icon:"bx bx-printer",size:"large",onClick:s.print},null,8,["onClick"])]),(i(),f(T(s.dynamicComponent),{data:o.component_data,class:"p-5 bg-white"},null,8,["data"]))])):_("",!0)]),_:1})])])}const ls=x(Qn,[["render",is],["__scopeId","data-v-9a142a55"]]),as={name:"uebungen-library",props:{}
2,data(){return{showCreateModal:!1,showAbsolveModal:!1,showPrintModal:!1,showEditModal:!1,activeStep:"dashboard",modalData:{title:"asd",componentPath:"resources/vue/UebungTestCreateComponent.vue",moduleName:"UebungTest"},currentUebung:null,isAnimating:!1,spreadPosition:{x:0,y:0}}},computed:{activeModal(){return this.showCreateModal?"create":this.showAbsolveModal?"absolve":this.showPrintModal?"print":null},registeredCategories(){return this.$UebungenRegistry.registered_categories},registeredUebungen(){return this.$UebungenRegistry.registered_uebungen}},methods:{setActiveStep(n){this.activeStep=n},filteredUebungen(n){return Object.values(this.registeredUebungen).filter(e=>e.category===n)},openCreateModal(n){this.spreadPosition=n,this.isAnimating=!0,setTimeout(()=>{this.showCreateModal=!0},300)},closeCreateModal(){this.showCreateModal=!1,setTimeout(()=>{this.isAnimating=!1},600),g.$emit("refresh-uebungen-library")},openAbsolveModal(n,e){this.currentUebung=n,this.spreadPosition=e,this.isAnimating=!0,setTimeout(()=>{this.showAbsolveModal=!0},300)},openEditModal(n){this.currentUebung=n,this.showEditModal=!0},closeEditModal(){this.currentUebung=null,this.showEditModal=!1},closeAbsolveModal(){this.showAbsolveModal=!1,setTimeout(()=>{this.isAnimating=!1,this.currentUebung=null},600)},openPrintModal(n,e){this.currentUebung=n,this.spreadPosition=e,this.isAnimating=!0,setTimeout(()=>{this.showPrintModal=!0},300)},closePrintModal(){this.showPrintModal=!1,setTimeout(()=>{this.isAnimating=!1,this.currentUebung=null},600)}},components:{UebungenLibraryDashboard:cn,UebungenLibraryCreateUebung:I,UebungenLibraryCategoryUebungClassicCreate:yn,UebungenLibraryCreateUebungModal:$n,UebungenLibraryAbsolveUebungModal:Fn,UebungenLibraryEditUebungModal:Zn,UebungenLibraryPrintUebungModal:ls},mounted(){g.$on("openUebungCreateModal",n=>{this.modalData=n,this.showCreateModal=!0}),g.$on("uebungen-library__open-create-modal",n=>{this.openCreateModal(n.position)}),g.$on("uebungen-library__open-absolve-modal",n=>{this.openAbsolveModal(n.uebung,n.position)}),g.$on("uebungen-library__open-edit-modal",n=>{this.openEditModal(n.uebung)}),g.$on("uebungen-library__open-print-uebung-modal",n=>{this.openPrintModal(n.uebung,n.position)}),g.$on("close-create-uebung-modal",this.closeCreateModal),g.$on("close-absolve-uebung-modal",this.closeAbsolveModal),g.$on("close-print-uebung-modal",this.closePrintModal)},beforeDestroy(){g.$off("openUebungCreateModal"),g.$off("uebungen-library__open-create-modal"),g.$off("uebungen-library__open-absolve-modal"),g.$off("uebungen-library__open-print-uebung-modal"),g.$off("close-create-uebung-modal"),g.$off("close-absolve-uebung-modal"),g.$off("close-print-uebung-modal")}},us={class:"uebungen-library"};function ds(n,e,r,d,o,s){const u=p("uebungen-library-dashboard"),c=p("uebungen-library-create-uebung"),a=p("uebungen-library-category-uebung-classic-create"),y=p("uebungen-library-create-uebung-modal"),v=p("uebungen-library-edit-uebung-modal"),j=p("uebungen-library-absolve-uebung-modal"),E=p("uebungen-library-print-uebung-modal");return i(),l("div",us,[o.isAnimating?(i(),l("div",{key:0,class:h(["spread-overlay",{active:o.showCreateModal||o.showAbsolveModal||o.showPrintModal},`spread-overlay_${s.activeModal}`]),style:A({"--spread-x":o.spreadPosition.x+"px","--spread-y":o.spreadPosition.y+"px"})},null,6)):_("",!0),o.activeStep==="dashboard"?(i(),f(u,{key:1,onUebungenLibrary__setActiveStep:s.setActiveStep},null,8,["onUebungenLibrary__setActiveStep"])):o.activeStep==="create-uebung"?(i(),f(c,{key:2,onUebungenLibrary__setActiveStep:s.setActiveStep},null,8,["onUebungenLibrary__setActiveStep"])):o.activeStep==="uebungen-library-category-uebung-classic-create"?(i(),f(a,{key:3,onUebungenLibrary__setActiveStep:s.setActiveStep},null,8,["onUebungenLibrary__setActiveStep"])):_("",!0),b(M,{name:"modal"},{default:U(()=>[o.showCreateModal?(i(),f(y,{key:0,onCloseCreateUebungModal:s.closeCreateModal},null,8,["onCloseCreateUebungModal"])):_("",!0)]),_:1}),b(M,{name:"modal"},{default:U(()=>[o.showEditModal&&o.currentUebung?(i(),f(v,{key:0,uebung:o.currentUebung,onCloseEditUebungModal:s.closeEditModal},null,8,["uebung","onCloseEditUebungModal"])):_("",!0)]),_:1}),b(M,{name:"modal"},{default:U(()=>
2[o.showAbsolveModal&&o.currentUebung?(i(),f(j,{key:0,uebung:o.currentUebung,onCloseAbsolveUebungModal:s.closeAbsolveModal},null,8,["uebung","onCloseAbsolveUebungModal"])):_("",!0)]),_:1}),b(M,{name:"modal"},{default:U(()=>[o.showPrintModal&&o.currentUebung?(i(),f(E,{key:0,uebung:o.currentUebung,onClosePrintUebungModal:s.closePrintModal},null,8,["uebung","onClosePrintUebungModal"])):_("",!0)]),_:1})])}const ys=x(as,[["render",ds],["__scopeId","data-v-4ed7f902"]]);export{ys as default}; 3//# sourceMappingURL=UebungenLibrary-BQdS-i6V.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.