{"version":3,"file":"ParticipantItem-CTvu7cfd.mjs","names":[],"sources":["../src/components/display/participant/ParticipantItem.vue","../src/components/display/participant/ParticipantItem.vue"],"sourcesContent":["<template>\n  <article v-if=\"participant\" class=\"participant-item-container\">\n    <router-link\n      :to=\"{\n        name: 'participant',\n        params: { participantId: participant.participantId },\n      }\"\n      class=\"mt-3 text-dark\"\n      :title=\"t('Participant name page', { name: name })\"\n    >\n      <img\n        v-lazy=\"useProxyImageUrl(participant.imageUrl, '200')\"\n        width=\"200\"\n        height=\"200\"\n        aria-hidden=\"true\"\n        alt=\"\"\n        \n        :title=\"t('Animator image', { name: name })\"\n        class=\"img-box border\"\n      />\n      <div class=\"d-flex align-items-center h4 justify-content-center mt-2\">\n        <AlertIcon\n          v-if=\"!activeParticipant && !isPodcastmaker && editRight\"\n          :size=\"16\"\n          class=\"text-danger me-1\"\n          :title=\"t('Participant have not podcasts')\"\n        />\n        {{ name }}\n      </div>\n      <div\n        ref=\"descriptionParticipantContainer\"\n        class=\"element-description small-description html-wysiwyg-content\"\n      >\n        <!-- eslint-disable vue/no-v-html -->\n        <div\n          ref=\"descriptionParticipant\"\n          v-html=\"urlify(participant.description || '')\"\n        />\n        <!-- eslint-enable -->\n      </div>\n    </router-link>\n    <router-link\n      v-if=\"!isPodcastmaker\"\n      :to=\"{\n        name: 'productor',\n        params: { productorId: participant.orga.id },\n      }\"\n      class=\"small-text mt-1\"\n    >\n      © {{ participant.orga.name }}\n    </router-link>\n  </article>\n</template>\n\n<script setup lang=\"ts\">\nimport AlertIcon from \"vue-material-design-icons/Alert.vue\";\nimport classicApi from \"../../../api/classicApi\";\nimport { Participant } from \"@/stores/class/general/participant\";\nimport {useImageProxy} from \"../../composable/useImageProxy\";\nimport displayHelper from \"../../../helper/displayHelper\";\nimport {useOrgaComputed} from \"../../composable/useOrgaComputed\";\nimport { computed, onBeforeMount, onMounted, ref, useTemplateRef } from \"vue\";\nimport { Podcast } from \"@/stores/class/general/podcast\";\nimport { ListClassicReturn } from \"@/stores/class/general/listReturn\";\nimport { useI18n } from \"vue-i18n\";\n\n//Props \nconst props = defineProps({\n  participant: { default: () => ({}), type: Object as () => Participant },\n})\n \n//Data \nconst activeParticipant = ref(true);\n\n//Composables\nconst { t } = useI18n();\nconst { useProxyImageUrl } = useImageProxy();\nconst { isPodcastmaker, isEditRights } = useOrgaComputed();\n\n//Computed\nconst name = computed(() => `${props.participant.firstName ?? \"\"} ${props.participant.lastName ?? \"\"}`.trim());\nconst editRight = computed(() => {\n  if (!props.participant?.orga) {\n    return false;\n  }\n  return isEditRights(props.participant.orga.id);\n});\n\nonBeforeMount(()=>{\n  if (!editRight.value) return;\n  hasPodcast();\n})\n\nonMounted(()=>{\n  const participantDesc = useTemplateRef('descriptionParticipant')?.value as HTMLElement;\n  const participantDescContainer = useTemplateRef('descriptionParticipantContainer')?.value as HTMLElement;\n\n  if (\n    null !== participantDesc &&\n    null !== participantDescContainer &&\n    participantDesc.clientHeight > participantDescContainer.clientHeight\n  ) {\n    participantDescContainer.classList.add(\"after-element-description\");\n  }\n})\n\n//Methods\nfunction urlify(text:string|undefined){\n  return displayHelper.urlify(text);\n}\nasync function hasPodcast(): Promise<void> {\n  const data = await classicApi.fetchData<ListClassicReturn<Podcast>>({\n    api: 0,\n    path: \"podcast/search\",\n    parameters: {\n      participantId: props.participant.participantId,\n      first: 0,\n      size: 0,\n      includeStatus: [\"READY\", \"PROCESSING\"],\n    },\n    specialTreatement: true,\n  });\n  if (0 === data.count) {\n    activeParticipant.value = false;\n  }\n}\n</script>\n<style lang=\"scss\">\n.octopus-app .participant-item-container {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  border-radius: var(--octopus-border-radius);\n  width: var(--octopus-image-size);\n}\n</style>\n","<template>\n  <article v-if=\"participant\" class=\"participant-item-container\">\n    <router-link\n      :to=\"{\n        name: 'participant',\n        params: { participantId: participant.participantId },\n      }\"\n      class=\"mt-3 text-dark\"\n      :title=\"t('Participant name page', { name: name })\"\n    >\n      <img\n        v-lazy=\"useProxyImageUrl(participant.imageUrl, '200')\"\n        width=\"200\"\n        height=\"200\"\n        aria-hidden=\"true\"\n        alt=\"\"\n        \n        :title=\"t('Animator image', { name: name })\"\n        class=\"img-box border\"\n      />\n      <div class=\"d-flex align-items-center h4 justify-content-center mt-2\">\n        <AlertIcon\n          v-if=\"!activeParticipant && !isPodcastmaker && editRight\"\n          :size=\"16\"\n          class=\"text-danger me-1\"\n          :title=\"t('Participant have not podcasts')\"\n        />\n        {{ name }}\n      </div>\n      <div\n        ref=\"descriptionParticipantContainer\"\n        class=\"element-description small-description html-wysiwyg-content\"\n      >\n        <!-- eslint-disable vue/no-v-html -->\n        <div\n          ref=\"descriptionParticipant\"\n          v-html=\"urlify(participant.description || '')\"\n        />\n        <!-- eslint-enable -->\n      </div>\n    </router-link>\n    <router-link\n      v-if=\"!isPodcastmaker\"\n      :to=\"{\n        name: 'productor',\n        params: { productorId: participant.orga.id },\n      }\"\n      class=\"small-text mt-1\"\n    >\n      © {{ participant.orga.name }}\n    </router-link>\n  </article>\n</template>\n\n<script setup lang=\"ts\">\nimport AlertIcon from \"vue-material-design-icons/Alert.vue\";\nimport classicApi from \"../../../api/classicApi\";\nimport { Participant } from \"@/stores/class/general/participant\";\nimport {useImageProxy} from \"../../composable/useImageProxy\";\nimport displayHelper from \"../../../helper/displayHelper\";\nimport {useOrgaComputed} from \"../../composable/useOrgaComputed\";\nimport { computed, onBeforeMount, onMounted, ref, useTemplateRef } from \"vue\";\nimport { Podcast } from \"@/stores/class/general/podcast\";\nimport { ListClassicReturn } from \"@/stores/class/general/listReturn\";\nimport { useI18n } from \"vue-i18n\";\n\n//Props \nconst props = defineProps({\n  participant: { default: () => ({}), type: Object as () => Participant },\n})\n \n//Data \nconst activeParticipant = ref(true);\n\n//Composables\nconst { t } = useI18n();\nconst { useProxyImageUrl } = useImageProxy();\nconst { isPodcastmaker, isEditRights } = useOrgaComputed();\n\n//Computed\nconst name = computed(() => `${props.participant.firstName ?? \"\"} ${props.participant.lastName ?? \"\"}`.trim());\nconst editRight = computed(() => {\n  if (!props.participant?.orga) {\n    return false;\n  }\n  return isEditRights(props.participant.orga.id);\n});\n\nonBeforeMount(()=>{\n  if (!editRight.value) return;\n  hasPodcast();\n})\n\nonMounted(()=>{\n  const participantDesc = useTemplateRef('descriptionParticipant')?.value as HTMLElement;\n  const participantDescContainer = useTemplateRef('descriptionParticipantContainer')?.value as HTMLElement;\n\n  if (\n    null !== participantDesc &&\n    null !== participantDescContainer &&\n    participantDesc.clientHeight > participantDescContainer.clientHeight\n  ) {\n    participantDescContainer.classList.add(\"after-element-description\");\n  }\n})\n\n//Methods\nfunction urlify(text:string|undefined){\n  return displayHelper.urlify(text);\n}\nasync function hasPodcast(): Promise<void> {\n  const data = await classicApi.fetchData<ListClassicReturn<Podcast>>({\n    api: 0,\n    path: \"podcast/search\",\n    parameters: {\n      participantId: props.participant.participantId,\n      first: 0,\n      size: 0,\n      includeStatus: [\"READY\", \"PROCESSING\"],\n    },\n    specialTreatement: true,\n  });\n  if (0 === data.count) {\n    activeParticipant.value = false;\n  }\n}\n</script>\n<style lang=\"scss\">\n.octopus-app .participant-item-container {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  border-radius: var(--octopus-border-radius);\n  width: var(--octopus-image-size);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;EAmEA,MAAM,QAAQ;EAKd,MAAM,oBAAoB,IAAI,IAAI;EAGlC,MAAM,EAAE,MAAM,QAAQ;EACtB,MAAM,EAAE,qBAAqB,cAAc;EAC3C,MAAM,EAAE,gBAAgB,iBAAiB,gBAAgB;EAGzD,MAAM,OAAO,eAAe,GAAG,MAAM,YAAY,aAAa,GAAG,GAAG,MAAM,YAAY,YAAY,KAAK,KAAK,CAAC;EAC7G,MAAM,YAAY,eAAe;GAC/B,IAAI,CAAC,MAAM,aAAa,MACtB,OAAO;GAET,OAAO,aAAa,MAAM,YAAY,KAAK,EAAE;EAC/C,CAAC;EAED,oBA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