{"version":3,"file":"ParticipantPage-D7rnZbFn.mjs","names":[],"sources":["../src/components/pages/ParticipantPage.vue","../src/components/pages/ParticipantPage.vue"],"sourcesContent":["<template>\n  <section class=\"page-box\">\n    <template v-if=\"loaded && !error && participant\">\n      <h1>\n        {{ t(\"Animator\") }}\n      </h1>\n      <section class=\"d-flex flex-column align-items-center mb-3\">\n        <img\n          v-lazy=\"useProxyImageUrl(participant.imageUrl, '200')\"\n          width=\"200\"\n          height=\"200\"\n          aria-hidden=\"true\"\n          alt=\"\"\n          :title=\"t('Animator image', { name: name })\"\n          class=\"img-box mb-3\"\n        />\n        <h2 class=\"text-capitalize\">\n          {{ name }}\n        </h2>\n        <!-- eslint-disable vue/no-v-html -->\n        <div\n          class=\"participant-desc html-wysiwyg-content\"\n          v-html=\"urlify(description)\"\n        />\n        <!-- eslint-enable -->\n        <slot\n          v-if=\"editRight && !state.generalParameters.podcastmaker\"\n          name=\"edit-box\"\n          :participant=\"participant\"\n          :on-updated=\"updateParticipant\"\n        />\n        <ShareSocialsButtons\n          v-if=\"state.podcastPage.ShareButtons\"\n          class=\"w-100\"\n          :organisation-id=\"participant.orga.id\"\n        >\n        <template #additional-buttons>\n          <ShareAnonymous \n            :participant-id=\"participant.participantId\" \n            :organisation-id=\"participant.orga.id\"\n            relative-class=\"\"\n            btn-class=\"btn share-btn mb-2 text-dark me-2\"\n          />\n        </template>\n        </ShareSocialsButtons>\n      </section>\n      <!-- productorId define to avoid overwrite #12817 -->\n      <PodcastFilterList\n        v-if=\"isInit\"\n        v-model:query=\"searchPattern\"\n        :first=\"paginateFirst\"\n        :size=\"ps\"\n        :participant-id=\"participantId\"\n        :name=\"name\"\n        :category-filter=\"true\"\n        :productor-id=\"['']\"\n        :reload=\"reload\"\n        :show-count=\"true\"\n        :force-update-parameters=\"true\"\n      />\n    </template>\n    <ClassicLoading\n      :loading-text=\"!loaded ? t('Loading content ...') : undefined\"\n      :error-text=\"error ? t(`Animator doesn't exist`) : undefined\"\n    />\n  </section>\n</template>\n\n<script setup lang=\"ts\">\nimport classicApi from \"../../api/classicApi\";\nimport { state } from \"../../stores/ParamSdkStore\";\nimport { useFilterStore } from \"../../stores/FilterStore\";\nimport displayHelper from \"../../helper/displayHelper\";\nimport {useSeoTitleUrl} from \"../composable/route/useSeoTitleUrl\";\nimport {useImageProxy} from \"../composable/useImageProxy\";\nimport {useOrgaComputed} from \"../composable/useOrgaComputed\";\nimport {useErrorHandler} from \"../composable/useErrorHandler\";\nimport { Participant } from \"@/stores/class/general/participant\";\nimport ClassicLoading from \"../form/ClassicLoading.vue\";\nimport { computed, defineAsyncComponent, ref, Ref, watch } from \"vue\";\nimport { AxiosError } from \"axios\";\nimport { useI18n } from \"vue-i18n\";\nimport { useRoute } from \"vue-router\";\nimport { useSimplePageParam } from \"../composable/route/useSimplePageParam\";\nconst ShareSocialsButtons = defineAsyncComponent(\n  () => import(\"../display/sharing/ShareSocialsButtons.vue\"),\n);\nconst PodcastFilterList = defineAsyncComponent(\n  () => import(\"../display/podcasts/PodcastFilterList.vue\"),\n);\nconst ShareAnonymous = defineAsyncComponent(() => import(\"../display/sharing/ShareAnonymous.vue\"));\n\n\n//Props\nconst props = defineProps({\n  participantId: { default: undefined, type: Number },\n  pr: { default: 0, type: Number },\n  ps: { default: 30, type: Number },\n  routeQuery: { default: \"\", type: String },\n});\n\n\n//Data\nconst loaded = ref(false);\nconst error = ref(false);\nconst reload = ref(false);\nconst participant: Ref<Participant | undefined> = ref(undefined);\n\n\n//Composables\nconst route = useRoute();\nconst { t } = useI18n();\nconst { useProxyImageUrl } = useImageProxy();\nconst {  isEditRights } = useOrgaComputed();\nconst { updatePathParams } = useSeoTitleUrl();\nconst {handle403} = useErrorHandler();\nconst filterStore = useFilterStore();\nconst {\n  searchPattern,\n  paginateFirst,\n  isInit\n} = useSimplePageParam(props, true);\n\n\n//Computed\nconst description = computed(() =>participant.value?.description ?? \"\");\nconst name = computed(() =>`${participant.value?.firstName ?? \"\"} ${participant.value?.lastName ?? \"\"}`.trim());\nconst editRight = computed(() =>isEditRights(participant.value?.orga?.id));\n\n\n//Watch\nwatch(participant, () => {reload.value = !reload.value}, {deep: true});\nwatch(()=>props.participantId, () =>getParticipantDetails(), {immediate: true});\n\n\n\n//Methods\nfunction urlify(text:string|undefined){\n  return displayHelper.urlify(text);\n}\nfunction  initError(): void {\n  error.value = true;\n  loaded.value = true;\n}\nasync function getParticipantDetails(): Promise<void> {\n  loaded.value = false;\n  try {\n    const data = await classicApi.fetchData<Participant>({\n      api: 0,\n      path: \"participant/\" + props.participantId,\n    });\n    if (\n      \"PUBLIC\" !== data?.orga?.privacy &&\n      filterStore.filterOrgaId !== data?.orga?.id &&\n      route.query.productor !== data?.orga?.id\n    ) {\n      initError();\n      return;\n    }\n    updateParticipant(data);\n    loaded.value = true;\n  } catch (error) {\n    handle403(error as AxiosError);\n    initError();\n  }\n}\nfunction updateParticipant(participantUpdated: Participant): void {\n  participant.value = participantUpdated;\n  updatePathParams(name.value);\n}\n</script>\n\n<style lang=\"scss\">\n.octopus-app {\n  @media (width >= 950px) {\n    .participant-desc {\n      max-width: 50%;\n      line-height: 1.5em;\n    }\n  }\n}\n</style>\n","<template>\n  <section class=\"page-box\">\n    <template v-if=\"loaded && !error && participant\">\n      <h1>\n        {{ t(\"Animator\") }}\n      </h1>\n      <section class=\"d-flex flex-column align-items-center mb-3\">\n        <img\n          v-lazy=\"useProxyImageUrl(participant.imageUrl, '200')\"\n          width=\"200\"\n          height=\"200\"\n          aria-hidden=\"true\"\n          alt=\"\"\n          :title=\"t('Animator image', { name: name })\"\n          class=\"img-box mb-3\"\n        />\n        <h2 class=\"text-capitalize\">\n          {{ name }}\n        </h2>\n        <!-- eslint-disable vue/no-v-html -->\n        <div\n          class=\"participant-desc html-wysiwyg-content\"\n          v-html=\"urlify(description)\"\n        />\n        <!-- eslint-enable -->\n        <slot\n          v-if=\"editRight && !state.generalParameters.podcastmaker\"\n          name=\"edit-box\"\n          :participant=\"participant\"\n          :on-updated=\"updateParticipant\"\n        />\n        <ShareSocialsButtons\n          v-if=\"state.podcastPage.ShareButtons\"\n          class=\"w-100\"\n          :organisation-id=\"participant.orga.id\"\n        >\n        <template #additional-buttons>\n          <ShareAnonymous \n            :participant-id=\"participant.participantId\" \n            :organisation-id=\"participant.orga.id\"\n            relative-class=\"\"\n            btn-class=\"btn share-btn mb-2 text-dark me-2\"\n          />\n        </template>\n        </ShareSocialsButtons>\n      </section>\n      <!-- productorId define to avoid overwrite #12817 -->\n      <PodcastFilterList\n        v-if=\"isInit\"\n        v-model:query=\"searchPattern\"\n        :first=\"paginateFirst\"\n        :size=\"ps\"\n        :participant-id=\"participantId\"\n        :name=\"name\"\n        :category-filter=\"true\"\n        :productor-id=\"['']\"\n        :reload=\"reload\"\n        :show-count=\"true\"\n        :force-update-parameters=\"true\"\n      />\n    </template>\n    <ClassicLoading\n      :loading-text=\"!loaded ? t('Loading content ...') : undefined\"\n      :error-text=\"error ? t(`Animator doesn't exist`) : undefined\"\n    />\n  </section>\n</template>\n\n<script setup lang=\"ts\">\nimport classicApi from \"../../api/classicApi\";\nimport { state } from \"../../stores/ParamSdkStore\";\nimport { useFilterStore } from \"../../stores/FilterStore\";\nimport displayHelper from \"../../helper/displayHelper\";\nimport {useSeoTitleUrl} from \"../composable/route/useSeoTitleUrl\";\nimport {useImageProxy} from \"../composable/useImageProxy\";\nimport {useOrgaComputed} from \"../composable/useOrgaComputed\";\nimport {useErrorHandler} from \"../composable/useErrorHandler\";\nimport { Participant } from \"@/stores/class/general/participant\";\nimport ClassicLoading from \"../form/ClassicLoading.vue\";\nimport { computed, defineAsyncComponent, ref, Ref, watch } from \"vue\";\nimport { AxiosError } from \"axios\";\nimport { useI18n } from \"vue-i18n\";\nimport { useRoute } from \"vue-router\";\nimport { useSimplePageParam } from \"../composable/route/useSimplePageParam\";\nconst ShareSocialsButtons = defineAsyncComponent(\n  () => import(\"../display/sharing/ShareSocialsButtons.vue\"),\n);\nconst PodcastFilterList = defineAsyncComponent(\n  () => import(\"../display/podcasts/PodcastFilterList.vue\"),\n);\nconst ShareAnonymous = defineAsyncComponent(() => import(\"../display/sharing/ShareAnonymous.vue\"));\n\n\n//Props\nconst props = defineProps({\n  participantId: { default: undefined, type: Number },\n  pr: { default: 0, type: Number },\n  ps: { default: 30, type: Number },\n  routeQuery: { default: \"\", type: String },\n});\n\n\n//Data\nconst loaded = ref(false);\nconst error = ref(false);\nconst reload = ref(false);\nconst participant: Ref<Participant | undefined> = ref(undefined);\n\n\n//Composables\nconst route = useRoute();\nconst { t } = useI18n();\nconst { useProxyImageUrl } = useImageProxy();\nconst {  isEditRights } = useOrgaComputed();\nconst { updatePathParams } = useSeoTitleUrl();\nconst {handle403} = useErrorHandler();\nconst filterStore = useFilterStore();\nconst {\n  searchPattern,\n  paginateFirst,\n  isInit\n} = useSimplePageParam(props, true);\n\n\n//Computed\nconst description = computed(() =>participant.value?.description ?? \"\");\nconst name = computed(() =>`${participant.value?.firstName ?? \"\"} ${participant.value?.lastName ?? \"\"}`.trim());\nconst editRight = computed(() =>isEditRights(participant.value?.orga?.id));\n\n\n//Watch\nwatch(participant, () => {reload.value = !reload.value}, {deep: true});\nwatch(()=>props.participantId, () =>getParticipantDetails(), {immediate: true});\n\n\n\n//Methods\nfunction urlify(text:string|undefined){\n  return displayHelper.urlify(text);\n}\nfunction  initError(): void {\n  error.value = true;\n  loaded.value = true;\n}\nasync function getParticipantDetails(): Promise<void> {\n  loaded.value = false;\n  try {\n    const data = await classicApi.fetchData<Participant>({\n      api: 0,\n      path: \"participant/\" + props.participantId,\n    });\n    if (\n      \"PUBLIC\" !== data?.orga?.privacy &&\n      filterStore.filterOrgaId !== data?.orga?.id &&\n      route.query.productor !== data?.orga?.id\n    ) {\n      initError();\n      return;\n    }\n    updateParticipant(data);\n    loaded.value = true;\n  } catch (error) {\n    handle403(error as AxiosError);\n    initError();\n  }\n}\nfunction updateParticipant(participantUpdated: Participant): void {\n  participant.value = participantUpdated;\n  updatePathParams(name.value);\n}\n</script>\n\n<style lang=\"scss\">\n.octopus-app {\n  @media (width >= 950px) {\n    .participant-desc {\n      max-width: 50%;\n      line-height: 1.5em;\n    }\n  }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoFA,MAAM,sBAAsB,2BACpB,OAAO,qCACf;EACA,MAAM,oBAAoB,2BAClB,OAAO,mCACf;EACA,MAAM,iBAAiB,2BAA2B,OAAO,gCAAwC;EAIjG,MAAM,QAAQ;EASd,MAAM,SAAS,IAAI,KAAK;EACxB,MAAM,QAAQ,IAAI,KAAK;EACvB,MAAM,SAAS,IAAI,KAAK;EACxB,MAAM,cAA4C,IAAI,KAAA,CAAS;EAI/D,MAAM,QAAQ,SAAS;EACvB,MAAM,EAAE,MAAM,QAAQ;EACtB,MAAM,EAAE,qBAAqB,cAAc;EAC3C,MAAM,EAAG,iBAAiB,gBAAgB;EAC1C,MAAM,EAAE,qBAAqB,eAAe;EAC5C,MAAM,EAAC,cAAa,gBAAgB;EACpC,MAAM,cAAc,eAAe;EACnC,MAAM,EACJ,eACA,eACA,WACE,mBAAmB,OAAO,IAAI;EAIlC,MAAM,cAAc,eAAc,YAAY,OAAO,eAAe,EAAE;EACtE,MAAM,OAAO,eAAc,GAAG,YAAY,OAAO,aAAa,GAAG,GAAG,YAAY,OAAO,YAAY,KAAK,KAAK,CAAC;EAC9G,MAAM,YAAY,eAAc,aAAa,YAAY,OAAO,MAAM,EAAE,CAAC;EAIzE,MAAM,mBAAmB;GAAC,OAAO,QAAQ,CAAC,OAAO;EAAK,GAAG,EAAC,MAAM,KAAI,CAAC;EACrE,YAAU,MAAM,qBAAoB,sBAAsB,GAAG,EAAC,WAAW,KAAI,CAAC;EAK9E,SAAS,OAAO,MAAsB;GACpC,OAAO,sBAAc,OAAO,IAAI;EAClC;EACA,SAAU,YAAkB;GAC1B,MAAM,QAAQ;GACd,OAAO,QAAQ;EACjB;EACA,eAAe,wBAAuC;GACpD,OAAO,QAA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