{"version":3,"file":"user_devices-COO4_Wnb.js","sources":["../../../node_modules/.pnpm/vuetify@2.7.2_vue@2.7.16/node_modules/vuetify/lib/components/VBadge/VBadge.js","../../../app/javascript/views/quizzes/user_devices/user_device_mixin.js","../../../app/javascript/composables/useScore.js","../../../app/javascript/views/quizzes/user_devices/user_device_card.vue","../../../app/javascript/views/quizzes/user_devices/user_devices.vue"],"sourcesContent":["// Styles\nimport \"../../../src/components/VBadge/VBadge.sass\"; // Components\n\nimport VIcon from '../VIcon/VIcon'; // Mixins\n\nimport Colorable from '../../mixins/colorable';\nimport Themeable from '../../mixins/themeable';\nimport Toggleable from '../../mixins/toggleable';\nimport Transitionable from '../../mixins/transitionable';\nimport { factory as PositionableFactory } from '../../mixins/positionable'; // Utilities\n\nimport mixins from '../../util/mixins';\nimport { convertToUnit, getSlot } from '../../util/helpers';\nexport default mixins(Colorable, PositionableFactory(['left', 'bottom']), Themeable, Toggleable, Transitionable).extend({\n name: 'v-badge',\n props: {\n avatar: Boolean,\n bordered: Boolean,\n color: {\n type: String,\n default: 'primary'\n },\n content: {\n required: false\n },\n dot: Boolean,\n label: {\n type: String,\n default: '$vuetify.badge'\n },\n icon: String,\n inline: Boolean,\n offsetX: [Number, String],\n offsetY: [Number, String],\n overlap: Boolean,\n tile: Boolean,\n transition: {\n type: String,\n default: 'scale-rotate-transition'\n },\n value: {\n default: true\n }\n },\n computed: {\n classes() {\n return {\n 'v-badge--avatar': this.avatar,\n 'v-badge--bordered': this.bordered,\n 'v-badge--bottom': this.bottom,\n 'v-badge--dot': this.dot,\n 'v-badge--icon': this.icon != null,\n 'v-badge--inline': this.inline,\n 'v-badge--left': this.left,\n 'v-badge--overlap': this.overlap,\n 'v-badge--tile': this.tile,\n ...this.themeClasses\n };\n },\n\n computedBottom() {\n return this.bottom ? 'auto' : this.computedYOffset;\n },\n\n computedLeft() {\n if (this.isRtl) {\n return this.left ? this.computedXOffset : 'auto';\n }\n\n return this.left ? 'auto' : this.computedXOffset;\n },\n\n computedRight() {\n if (this.isRtl) {\n return this.left ? 'auto' : this.computedXOffset;\n }\n\n return !this.left ? 'auto' : this.computedXOffset;\n },\n\n computedTop() {\n return this.bottom ? this.computedYOffset : 'auto';\n },\n\n computedXOffset() {\n return this.calcPosition(this.offsetX);\n },\n\n computedYOffset() {\n return this.calcPosition(this.offsetY);\n },\n\n isRtl() {\n return this.$vuetify.rtl;\n },\n\n // Default fallback if offsetX\n // or offsetY are undefined.\n offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n },\n\n styles() {\n if (this.inline) return {};\n return {\n bottom: this.computedBottom,\n left: this.computedLeft,\n right: this.computedRight,\n top: this.computedTop\n };\n }\n\n },\n methods: {\n calcPosition(offset) {\n return `calc(100% - ${convertToUnit(offset || this.offset)})`;\n },\n\n genBadge() {\n const lang = this.$vuetify.lang;\n const label = this.$attrs['aria-label'] || lang.t(this.label);\n const data = this.setBackgroundColor(this.color, {\n staticClass: 'v-badge__badge',\n style: this.styles,\n attrs: {\n 'aria-atomic': this.$attrs['aria-atomic'] || 'true',\n 'aria-label': label,\n 'aria-live': this.$attrs['aria-live'] || 'polite',\n title: this.$attrs.title,\n role: this.$attrs.role || 'status'\n },\n directives: [{\n name: 'show',\n value: this.isActive\n }]\n });\n const badge = this.$createElement('span', data, [this.genBadgeContent()]);\n if (!this.transition) return badge;\n return this.$createElement('transition', {\n props: {\n name: this.transition,\n origin: this.origin,\n mode: this.mode\n }\n }, [badge]);\n },\n\n genBadgeContent() {\n // Dot prop shows no content\n if (this.dot) return undefined;\n const slot = getSlot(this, 'badge');\n if (slot) return slot;\n if (this.content) return String(this.content);\n if (this.icon) return this.$createElement(VIcon, this.icon);\n return undefined;\n },\n\n genBadgeWrapper() {\n return this.$createElement('span', {\n staticClass: 'v-badge__wrapper'\n }, [this.genBadge()]);\n }\n\n },\n\n render(h) {\n const badge = [this.genBadgeWrapper()];\n const children = [getSlot(this)];\n const {\n 'aria-atomic': _x,\n 'aria-label': _y,\n 'aria-live': _z,\n role,\n title,\n ...attrs\n } = this.$attrs;\n if (this.inline && this.left) children.unshift(badge);else children.push(badge);\n return h('span', {\n staticClass: 'v-badge',\n attrs,\n class: this.classes\n }, children);\n }\n\n});\n//# sourceMappingURL=VBadge.js.map","\nexport default {\n methods: {\n osIcon(device) {\n const icons = {\n \"Android\": \"mdi-android\",\n \"iOS\": \"mdi-apple\",\n \"Linux\": \"mdi-linux\",\n \"Mac OS\": \"mdi-apple\",\n \"macOS\": \"mdi-apple\", // Why is this different from \"Mac OS\"? https://github.com/faisalman/ua-parser-js/blob/master/CHANGELOG.md\n \"chromeOS\": \"mdi-chrome\",\n \"Windows\": \"mdi-microsoft-windows\",\n }\n\n return icons[device.os]\n },\n browserIcon(device) {\n const icons = {\n \"Chrome\": \"mdi-google-chrome\",\n \"Mobile Chrome\": \"mdi-google-chrome\",\n \"Firefox\": \"mdi-firefox\",\n \"Mobile Firefox\": \"mdi-firefox\",\n \"Safari\": \"mdi-apple-safari\",\n \"Edge\": \"mdi-microsoft-edge\",\n \"Internet Explorer\": \"mdi-internet-explorer\",\n \"Opera\": \"mdi-opera\",\n }\n\n return icons[device.browser]\n },\n\n icon(device) {\n const icons = {\n computer: \"mdi-laptop\",\n smartphone: \"mdi-cellphone\",\n tablet: \"mdi-tablet\",\n }\n\n return icons[device?.type]\n },\n },\n}\n","import { useStore } from \"@/store\"\nimport { computed } from \"vue\"\nimport { useQuizzesSubscription } from \"@/composables/useQuizzesSubscription\"\nimport { useSchoolsUser } from \"@/composables/useSchoolsUser\"\nimport i18n from \"@/plugins/i18n\"\n\nexport function useScore(score) {\n const store = useStore()\n\n const vmScoreDetailsText = computed(() => {\n const labels = [\n { range: [0, 0], label: i18n.t(\"evalmee.home.devices.vmScore.range.none\") },\n { range: [1, 3], label: i18n.t(\"evalmee.home.devices.vmScore.range.low\") },\n { range: [3, 6], label: i18n.t(\"evalmee.home.devices.vmScore.range.medium\") },\n { range: [6, 10], label: i18n.t(\"evalmee.home.devices.vmScore.range.high\") },\n ]\n\n const vmScore = score.max_virtual_machine_score\n\n return labels.find(label => vmScore >= label.range[0] && vmScore < label.range[1])?.label\n })\n\n const schoolsUser = computed(() => {\n return store.getters.schoolsUsers.find(su => su.user_id === score.user_id)\n })\n const subscription = computed(() => {\n return store.getters.quizzesSubscription(score.quiz_id, schoolsUser.value?.id)\n })\n\n const schoolsUserFacade = computed(() => {\n return useSchoolsUser(schoolsUser.value).facade()\n })\n\n const subscriptionFacade = computed(() => {\n return useQuizzesSubscription(subscription.value).facade()\n })\n\n const timeAccommodation = computed(() => {\n return store.getters.timeAccommodation(score.time_accommodation_id)\n })\n\n const session = computed(() => {\n return store.getters.quizSessions(score.quiz_id).find(s => s.id === score.quizzes_session_id)\n })\n\n function facade() {\n return {\n ...score,\n mouseExitDuration: score.cheat?.duration,\n devices: score.devices,\n schoolsUser: schoolsUser.value,\n subscription: subscription.value,\n timeAccommodation: timeAccommodation.value,\n success_levels_grade: score.grade,\n session: session.value,\n vmScoreDetailsText: vmScoreDetailsText.value,\n }\n }\n\n return {\n facade,\n schoolsUser,\n schoolsUserFacade,\n subscription,\n subscriptionFacade,\n timeAccommodation,\n vmScoreDetailsText,\n }\n}\n","\n\n\n","\n\n\n"],"names":["__unplugin_components_0","mixins","Colorable","PositionableFactory","Themeable","Toggleable","Transitionable","__spreadValues","offset","convertToUnit","lang","label","data","badge","slot","getSlot","VIcon","h","children","_a","_x","_y","_z","role","title","attrs","__objRest","userDeviceMixin","device","useScore","score","store","useStore","vmScoreDetailsText","computed","labels","i18n","vmScore","schoolsUser","su","subscription","schoolsUserFacade","useSchoolsUser","subscriptionFacade","useQuizzesSubscription","timeAccommodation","session","s","facade","__spreadProps","_sfc_main","EvalmeeChip","props","UserDeviceCard"],"mappings":"y5CAaA,MAAeA,EAAAC,EAAOC,EAAWC,EAAoB,CAAC,OAAQ,QAAQ,CAAC,EAAGC,EAAWC,EAAYC,CAAc,EAAE,OAAO,CACtH,KAAM,UACN,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