{"version":3,"file":"useQuizzesSubscription-CwRLGtm8.js","sources":["../../../app/javascript/composables/useQuizzesSubscription.js"],"sourcesContent":["import { useStore } from \"@/store\"\nimport { computed } from \"vue\"\nimport { useSchoolsUser } from \"@/composables/useSchoolsUser\"\n\n\nexport function useQuizzesSubscription(subscription) {\n const store = useStore()\n\n const schoolsUser = computed(() => {\n return store.getters.schoolsUser(subscription?.schools_user_id)\n })\n\n const schoolsUserFacade = computed(() => {\n return useSchoolsUser(schoolsUser.value).facade()\n })\n\n const score = computed(() => {\n return store.getters.scoreByQuizAndUserId(subscription?.quiz_id, schoolsUser.value?.user_id)\n })\n\n const timeAccommodation = computed(() => {\n return store.getters.timeAccommodation(subscription?.time_accommodation_id)\n })\n\n function facade() {\n return {\n ...subscription,\n cheating_attempt_count: score.value?.cheating_attempt_count,\n teacher_cheat_confirmation: score.value?.teacher_cheat_confirmation,\n answered_questions_count_cache: score.value?.answered_questions_count_cache,\n status: score.value?.state || \"not_started\",\n schoolsUser: schoolsUser.value,\n timeAccommodation: timeAccommodation.value,\n score: score.value,\n }\n }\n\n return {\n facade,\n schoolsUser,\n schoolsUserFacade,\n score,\n timeAccommodation,\n }\n}\n"],"names":["useQuizzesSubscription","subscription","store","useStore","schoolsUser","computed","schoolsUserFacade","useSchoolsUser","score","_a","timeAccommodation","facade","__spreadProps","__spreadValues","_b","_c","_d"],"mappings":"o7BAKO,SAASA,EAAuBC,EAAc,CACnD,MAAMC,EAAQC,EAAQ,EAEhBC,EAAcC,EAAS,IACpBH,EAAM,QAAQ,YAAYD,GAAA,YAAAA,EAAc,eAAe,CAC/D,EAEKK,EAAoBD,EAAS,IAC1BE,EAAeH,EAAY,KAAK,EAAE,OAAM,CAChD,EAEKI,EAAQH,EAAS,IAAM,OAC3B,OAAOH,EAAM,QAAQ,qBAAqBD,GAAA,YAAAA,EAAc,SAASQ,EAAAL,EAAY,QAAZ,YAAAK,EAAmB,OAAO,CAC5F,CAAA,EAEKC,EAAoBL,EAAS,IAC1BH,EAAM,QAAQ,kBAAkBD,GAAA,YAAAA,EAAc,qBAAqB,CAC3E,EAED,SAASU,GAAS,aAChB,OAAOC,EAAAC,EAAA,GACFZ,GADE,CAEL,wBAAwBQ,EAAAD,EAAM,QAAN,YAAAC,EAAa,uBACrC,4BAA4BK,EAAAN,EAAM,QAAN,YAAAM,EAAa,2BACzC,gCAAgCC,EAAAP,EAAM,QAAN,YAAAO,EAAa,+BAC7C,SAAQC,EAAAR,EAAM,QAAN,YAAAQ,EAAa,QAAS,cAC9B,YAAaZ,EAAY,MACzB,kBAAmBM,EAAkB,MACrC,MAAOF,EAAM,KACnB,EACA,CAEE,MAAO,CACL,OAAAG,EACA,YAAAP,EACA,kBAAAE,EACA,MAAAE,EACA,kBAAAE,CACJ,CACA"}