{"version":3,"file":"FindingAidsSeries-C74_Ss4U.js","sources":["../../src/queries/GetFindingAidsSeries.js","../../src/components/findingAids/FindingAidsSeries.vue"],"sourcesContent":["import gql from 'graphql-tag';\n\nexport const findingAidsSeriesQuery = gql`\n  query getFindingAidsSeries($slug: ID!) {\n    findingAidsSeries(id: $slug, idType: SLUG) {\n      collection {\n        callNumber\n        series {\n          title\n          slug\n        }\n        title\n      }\n      content\n      files {\n        box\n        collection\n        depth\n        folder\n        label\n        id\n        phystech\n        slug\n        type\n        uid\n        unitdate\n        unittitle\n      }\n      subseries {\n        label\n        files {\n          box\n          collection\n          depth\n          folder\n          label\n          id\n          phystech\n          slug\n          type\n          uid\n          unitdate\n          unittitle\n        }\n      }\n      seriesData {\n        date_label\n        volume\n      }\n      title\n      slug\n    }\n  }\n`;\n","<template>\n  <article v-if=\"series && Object.keys(series).length\" class=\"space-0-above\">\n    <FindingAidsHeader\n      :obj=\"{ breadcrumb: series.collection.callNumber.toLowerCase() }\"\n    ></FindingAidsHeader>\n    <div :class=\"$style.content\">\n      <h1 class=\"no-border-above\">{{ series.title }}</h1>\n      <nav :class=\"$style.breadcrumbs\">\n        Contained in:\n        <router-link :to=\"{ path: '/library-archives/archives-collections' }\">\n          Finding Aids\n        </router-link>\n        <IconChevronRight></IconChevronRight>\n        <router-link\n          :to=\"{\n            name: 'FindingAidsCollection',\n            params: { slug: series.collection.callNumber.toLowerCase() },\n          }\"\n          v-html=\"`${series.collection.title} (${series.collection.callNumber})`\"\n        ></router-link>\n      </nav>\n      <ProcessContent :content=\"series.content\" wrapper=\"section\"></ProcessContent>\n      <aside>\n        <ContentDrawer\n          :end-title=\"'Hide series in this collection'\"\n          :title=\"'Show series in this collection'\"\n        >\n          <ul :class=\"[$style.list, 'body-1']\">\n            <li v-for=\"(item, key) in filterSeries(series.collection.series)\" :key=\"key\">\n              <router-link\n                :to=\"{ name: 'FindingAidsSeries', params: { slug: item.slug } }\"\n                v-html=\"item.title\"\n              ></router-link>\n            </li>\n          </ul>\n        </ContentDrawer>\n      </aside>\n      <FileList v-if=\"series.files\" :class=\"$style.spaced\" :files=\"series.files\"></FileList>\n      <section v-if=\"series.subseries\">\n        <div v-for=\"(item, key) in series.subseries\" :key=\"key\" :class=\"$style.spaced\">\n          <h2 v-html=\"`Subseries ${item.label}`\"></h2>\n          <h3>Folder List</h3>\n          <FileList :files=\"item.files\"></FileList>\n        </div>\n      </section>\n    </div>\n  </article>\n  <BackToTop></BackToTop>\n</template>\n\n<script setup lang=\"ts\">\nimport BackToTop from '@/components/common/BackToTop.vue';\nimport ContentDrawer from '@/components/shortcodes/ContentDrawer.vue';\nimport { dataLoaded, useHandleError, useMetaData } from '@/composables/Common.js';\nimport FileList from '@/components/findingAids/FileList.vue';\nimport { FindingAid } from '@/types/findingaids.interface';\nimport FindingAidsHeader from '@/components/findingAids/FindingAidsHeader.vue';\nimport { findingAidsSeriesQuery } from '@/queries/GetFindingAidsSeries';\nimport IconChevronRight from '@/assets/svgs/IconChevronRight.svg?component';\nimport ProcessContent from '@/components/common/ProcessContent.vue';\nimport { ref } from 'vue';\nimport { useQuery } from 'villus';\n\nconst props = defineProps<{\n  slug: string;\n}>();\n\nconst { handleError } = useHandleError();\nconst { setMetaDescription, setMetaTitle } = useMetaData();\n\nconst series = ref<FindingAid>();\nconst { data, error } = useQuery({\n  onData: (data) => {\n    if (data.findingAidsSeries && Object.keys(data.findingAidsSeries).length) {\n      series.value = data.findingAidsSeries;\n      setMetaTitle(data.findingAidsSeries.title);\n      setMetaDescription(data.findingAidsSeries.excerpt);\n      dataLoaded();\n    }\n\n    if (!data.findingAidsSeries || Object.keys(data.findingAidsSeries).length === 0) {\n      handleError('FindingAidsSeries', error);\n    }\n  },\n  query: findingAidsSeriesQuery,\n  variables: { slug: props.slug },\n});\n\nfunction filterSeries(filterSeries): array {\n  return filterSeries.filter((item) => item.title !== series.value.title);\n}\n</script>\n\n<script lang=\"ts\">\nexport default {\n  beforeRoute(params, villusClient) {\n    return new Promise<void>((resolve, reject) => {\n      villusClient\n        .executeQuery({\n          query: findingAidsSeriesQuery,\n          variables: { slug: params.slug },\n        })\n        .then(() => resolve())\n        .catch((err) => reject(err));\n    });\n  },\n};\n</script>\n\n<style lang=\"scss\" module>\n.breadcrumbs {\n  @include body-2;\n\n  & {\n    display: inline-block;\n    padding: 0.75rem 0;\n  }\n\n  svg {\n    height: 0.625em;\n    padding: 0 0.125rem;\n    vertical-align: initial;\n    width: 0.625em;\n  }\n}\n\n.list {\n  margin-left: 0;\n\n  li {\n    list-style: none;\n  }\n}\n\n.subseries {\n  .fa-folder-list {\n    border-top: 1px solid $white;\n    padding-top: 1rem;\n  }\n}\n\n.spaced {\n  @include space-48-64-above;\n  h2,\n  h3,\n  h4 {\n    color: $black;\n  }\n}\n\n@media (min-width: $break-point) {\n  .content {\n    @include grid-content;\n  }\n}\n</style>\n"],"names":["findingAidsSeriesQuery","gql","__default__","params","villusClient","resolve","reject","err","props","__props","handleError","useHandleError","setMetaDescription","setMetaTitle","useMetaData","series","ref","data","error","useQuery","dataLoaded","filterSeries","item"],"mappings":"oqBAEO,MAAMA,EAAyBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wFC4FvBC,EAAA,CACb,YAAYC,EAAQC,EAAc,CAChC,OAAO,IAAI,QAAc,CAACC,EAASC,IAAW,CAC5CF,EACG,aAAa,CACZ,MAAOJ,EACP,UAAW,CAAE,KAAMG,EAAO,IAAK,CAAA,CAChC,EACA,KAAK,IAAME,GAAS,EACpB,MAAOE,GAAQD,EAAOC,CAAG,CA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