UNPKG

@europeana/portal

Version:
1,398 lines (1,159 loc) 41.5 kB
exports.ids = [79,81]; exports.modules = { /***/ 203: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/ContentCard.vue?vue&type=template&id=28c51dc4& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-card',{staticClass:"text-left content-card",class:_vm.cardClass,attrs:{"data-qa":"content card","no-body":""}},[_c('div',{staticClass:"card-wrapper"},[_c('SmartLink',{attrs:{"destination":_vm.url,"link-class":"card-link","aria-label":_vm.displayTitle ? _vm.displayTitle.value : null,"title":(_vm.variant === 'mosaic' && _vm.displayTitle) ? _vm.displayTitle.value : null}}),_vm._v(" "),(_vm.variant !== 'mini')?_c('MediaDefaultThumbnail',{directives:[{name:"show",rawName:"v-show",value:(!_vm.cardImageUrl),expression:"!cardImageUrl"}],attrs:{"media-type":_vm.mediaType,"offset":_vm.offset}}):_vm._e(),_vm._v(" "),(_vm.cardImageUrl)?_c('div',{staticClass:"card-img",class:{ logo: _vm.logo }},[(_vm.lazy)?_c('b-img-lazy',{attrs:{"src":_vm.optimisedImageUrl,"blank-width":_vm.blankImageWidth,"blank-height":_vm.blankImageHeight,"width":_vm.imageWidth,"height":_vm.imageHeight,"alt":_vm.imageAlt},nativeOn:{"error":function($event){return _vm.imageNotFound.apply(null, arguments)},"load":function($event){return _vm.imageLoaded.apply(null, arguments)}}}):_c('b-img',{attrs:{"src":_vm.optimisedImageUrl,"width":_vm.imageWidth,"height":_vm.imageHeight,"alt":_vm.imageAlt},on:{"error":_vm.imageNotFound,"load":_vm.imageLoaded}})],1):_vm._e(),_vm._v(" "),(_vm.variant !== 'mosaic')?_c('b-card-body',{attrs:{"data-qa":"card body"}},[((_vm.displaySubTitle && _vm.variant !== 'mini') && _vm.showSubtitle)?_c('b-card-sub-title',{staticClass:"mt-0",attrs:{"sub-title-tag":"div","sub-title-text-variant":"default"}},[_vm._v("\n "+_vm._s(_vm.displaySubTitle)+"\n ")]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"title-texts-wrapper"},[(_vm.displayTitle)?_c('b-card-title',{attrs:{"title-tag":"div","data-qa":"card title","lang":_vm.displayTitle.code}},[_c('span',[_vm._v("\n "+_vm._s(_vm._f("truncate")(_vm.displayTitle.value,90, _vm.$t('formatting.ellipsis')))+"\n ")])]):_vm._e(),_vm._v(" "),(_vm.hitsText)?_c('b-card-text',{attrs:{"text-tag":"div","data-qa":"highlighted search term"}},[_c('p',[_vm._v("\n "+_vm._s(_vm.hitsText.prefix)),_c('strong',{staticClass:"has-text-highlight"},[_vm._v(_vm._s(_vm.hitsText.exact))]),_vm._v(_vm._s(_vm.hitsText.suffix)+"\n ")])]):_vm._e(),_vm._v(" "),(_vm.displayTexts.length > 0)?_vm._l((_vm.displayTexts),function(text,index){return _c('b-card-text',{key:index,attrs:{"lang":text.code,"text-tag":"div"}},[_c('p',{domProps:{"innerHTML":_vm._s(_vm.cardText(text.values))}})])}):_vm._e()],2),_vm._v(" "),_c('client-only',[_vm._t("footer")],2)],1):_vm._e()],1),_vm._v(" "),_c('client-only',[_vm._t("image-overlay")],2)],1)} var staticRenderFns = [] // CONCATENATED MODULE: ./src/components/generic/ContentCard.vue?vue&type=template&id=28c51dc4& // EXTERNAL MODULE: external "vue-client-only" var external_vue_client_only_ = __webpack_require__(20); var external_vue_client_only_default = /*#__PURE__*/__webpack_require__.n(external_vue_client_only_); // EXTERNAL MODULE: ./src/components/generic/SmartLink.vue + 3 modules var SmartLink = __webpack_require__(26); // EXTERNAL MODULE: ./src/mixins/stripMarkdown.js var stripMarkdown = __webpack_require__(204); // EXTERNAL MODULE: ./src/plugins/europeana/utils.js var utils = __webpack_require__(2); // EXTERNAL MODULE: ./src/plugins/europeana/themes.js var themes = __webpack_require__(27); // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/ContentCard.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var ContentCardvue_type_script_lang_js_ = ({ name: 'ContentCard', components: { ClientOnly: external_vue_client_only_default.a, SmartLink: SmartLink["a" /* default */], MediaDefaultThumbnail: () => __webpack_require__.e(/* import() */ 15).then(__webpack_require__.bind(null, 578)) }, mixins: [stripMarkdown["a" /* default */]], props: { /** * Card title * * If an object is supplied, it is expected to be a LangMap. */ title: { type: [String, Object], default: '' }, /** * Card subtitle */ subTitle: { type: String, default: null }, /** * Card texts * * Each element may be a string, an array of strings, or a LangMap */ texts: { type: Array, default: () => [] }, /** * Hits from a search to highlight in the card texts */ hitsText: { type: Object, default: null }, /** * URL for the card to link to * * An object should be a Vue route */ url: { type: [String, Object], default: '' }, /** * URL of an image to display */ imageUrl: { type: String, default: '' }, /** * Content type of the image */ imageContentType: { type: String, default: null }, /** * Width of the image */ imageWidth: { type: Number, default: null }, /** * Height of the image */ imageHeight: { type: Number, default: null }, /** * Image alt text */ imageAlt: { type: String, default: '' }, /** * Image optimisation options * * Passed to `optimisedImageUrl` filter */ imageOptimisationOptions: { type: Object, default: () => ({}) }, /** * If `true`, image will be lazy-loaded */ lazy: { type: Boolean, default: true }, /** * If `true`, subtitle will be shown */ showSubtitle: { type: Boolean, default: true }, /** * Style variant to use * @values default, entity, mini, list, mosaic */ variant: { type: String, default: 'default' }, /** * If `true`, will omit all URIs from texts */ omitAllUris: { type: Boolean, default: false }, /** * If `true`, will omit URIs from texts only if other values are present */ omitUrisIfOtherValues: { type: Boolean, default: false }, /** * For each element of `texts`, limit the number of values shown * * Default is no limit */ limitValuesWithinEachText: { type: Number, default: -1 }, /** * Height of image placeholder when lazy-loading image */ blankImageHeight: { type: Number, default: null }, /** * Width of image placeholder when lazy-loading image */ blankImageWidth: { type: Number, default: null }, /** * If `true`, the image is a logo and will be styled differently */ logo: { type: Boolean, default: false }, /** * Type of media */ mediaType: { type: String, default: null }, /** * Offset, used for random color picking */ offset: { type: Number, default: null } }, data() { return { cardImageUrl: this.imageUrl, displayLabelTypes: 'exhibitions|galleries|blog|collections', themes: themes["a" /* default */].map(theme => theme.id) }; }, computed: { cardClass() { return `${this.variant}-card`; }, displayTitle() { if (!this.title) { return null; } else if (typeof this.title === 'string') { return { value: this.title, code: null }; } else { const langMapValue = Object(utils["h" /* langMapValueForLocale */])(this.title, this.$i18n.locale); return { value: langMapValue.values[0], code: langMapValue.code }; } }, displaySubTitle() { return this.subTitle || this.displayLabel; }, displayLabel() { if (!this.displayLabelType) { return false; } if (this.displayLabelType === 'collections') { const entityId = typeof this.url === 'string' ? this.url.split('/').pop().split('-').shift() : this.url.params.pathMatch; // TODO: remove when thematic collections topics get their own 'theme' type return this.themes.includes(entityId) ? this.$t('cardLabels.theme') : this.$t(`cardLabels.${this.displayLabelTypeCollections}`); } if (this.displayLabelType === 'blog') { return this.$tc('blog.posts', 1); } return this.$tc(`${this.displayLabelType}.${this.displayLabelType}`, 1); }, displayLabelTypeCollections() { return typeof this.url === 'object' ? this.url.params.type : this.url.split('/').slice(-2, -1); }, displayLabelType() { return this.displayLabelMatch ? this.displayLabelMatch[1] : false; }, displayLabelMatch() { return typeof this.url === 'object' ? this.displayLabelMatchObject : this.displayLabelMatchString; }, displayLabelMatchObject() { return this.url.name.match(new RegExp(`(${this.displayLabelTypes})`)); }, displayLabelMatchString() { return this.url.match(new RegExp(`/(${this.displayLabelTypes})[/.]`)); }, displayTexts() { return this.texts.filter(Boolean).map(value => { if (typeof value === 'string') { return { values: [value], code: null }; } else if (Array.isArray(value)) { return { values: value, code: null }; } else { return Object(utils["h" /* langMapValueForLocale */])(value, this.$i18n.locale, { omitUrisIfOtherValues: this.omitUrisIfOtherValues, omitAllUris: this.omitAllUris }); } }); }, optimisedImageUrl() { return this.$options.filters.optimisedImageUrl(this.imageUrl, this.imageContentType, this.imageOptimisationOptions); } }, watch: { imageUrl() { this.cardImageUrl = this.imageUrl; } }, methods: { cardText(values) { const limited = this.limitValuesWithinEachText > -1 ? values.slice(0, this.limitValuesWithinEachText) : [].concat(values); if (values.length > limited.length) { limited.push(this.$t('formatting.ellipsis')); } const joined = limited.join(this.$t('formatting.listSeperator') + ' '); const stripped = this.stripMarkdown(joined); return this.$options.filters.truncate(stripped, 255, this.$t('formatting.ellipsis')); }, redrawMasonry() { if (this.$redrawVueMasonry) { this.$nextTick(() => { this.$redrawVueMasonry(); }); } }, imageNotFound() { this.cardImageUrl = ''; this.redrawMasonry(); }, imageLoaded(event) { // ignore b-img-lazy's blank placeholder images if (!event.target.src.startsWith('data:')) { this.redrawMasonry(); } } } }); // CONCATENATED MODULE: ./src/components/generic/ContentCard.vue?vue&type=script&lang=js& /* harmony default export */ var generic_ContentCardvue_type_script_lang_js_ = (ContentCardvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(3); // EXTERNAL MODULE: ./src/components/generic/ContentCard.vue?vue&type=custom&index=0&blockType=docs&lang=md var ContentCardvue_type_custom_index_0_blockType_docs_lang_md = __webpack_require__(205); var ContentCardvue_type_custom_index_0_blockType_docs_lang_md_default = /*#__PURE__*/__webpack_require__.n(ContentCardvue_type_custom_index_0_blockType_docs_lang_md); // CONCATENATED MODULE: ./src/components/generic/ContentCard.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( generic_ContentCardvue_type_script_lang_js_, render, staticRenderFns, false, null, null, "473081f0" ) /* custom blocks */ if (typeof ContentCardvue_type_custom_index_0_blockType_docs_lang_md_default.a === 'function') ContentCardvue_type_custom_index_0_blockType_docs_lang_md_default()(component) /* harmony default export */ var ContentCard = __webpack_exports__["default"] = (component.exports); /***/ }), /***/ 204: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(184); /* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(marked__WEBPACK_IMPORTED_MODULE_0__); const htmlRemovalPatternsFromTags = tags => { return [/\n$/].concat(tags.map(tag => new RegExp(`</?${tag}.*?>`, 'gi'))); }; /* harmony default export */ __webpack_exports__["a"] = ({ methods: { /** * Strip markdown from text. * This method FIRST converts markdown to HTML, then removes HTML tags. * WARNING: This also means any HTML tags already present before will be stripped. * * As an optional parameter specific HTML tag names can be supplied. In which case, * only these will be removed. * @param {string} text String containing mark1down * @param {string[]} tags the HTML tags to be removed. * @return {String} text value with HTML breaks */ stripMarkdown(text, tags = ['']) { text = marked__WEBPACK_IMPORTED_MODULE_0__["marked"].parse(text); // Marked adds newlines to the end of the string, and wraps it in a <p> tag. for (const pattern of htmlRemovalPatternsFromTags(tags)) { text = text.replace(pattern, ''); } return text; } } }); /***/ }), /***/ 205: /***/ (function(module, exports) { /***/ }), /***/ 246: /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a <style> tag // load the styles var content = __webpack_require__(301); if(content.__esModule) content = content.default; if(typeof content === 'string') content = [[module.i, content, '']]; if(content.locals) module.exports = content.locals; // add CSS to SSR context var add = __webpack_require__(13).default module.exports.__inject__ = function (context) { add("3f6cbcc0", content, true, context) }; /***/ }), /***/ 300: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ContentCardSection_vue_vue_type_style_index_0_id_c30fc238_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(246); /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ContentCardSection_vue_vue_type_style_index_0_id_c30fc238_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ContentCardSection_vue_vue_type_style_index_0_id_c30fc238_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ContentCardSection_vue_vue_type_style_index_0_id_c30fc238_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ContentCardSection_vue_vue_type_style_index_0_id_c30fc238_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /***/ }), /***/ 301: /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(12); var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false); // Module ___CSS_LOADER_EXPORT___.push([module.i, ".browse-section h2[data-v-c30fc238],.browse-section p[data-v-c30fc238]{color:#4d4d4d;text-align:left}.browse-section h2[data-v-c30fc238]{font-size:1.5rem;font-weight:600;letter-spacing:.1212rem}.browse-section p[data-v-c30fc238]{letter-spacing:.0975rem;line-height:1.5}", ""]); // Exports module.exports = ___CSS_LOADER_EXPORT___; /***/ }), /***/ 368: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/browse/ContentCardSection.vue?vue&type=template&id=c30fc238&scoped=true& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.section)?_c('section',{staticClass:"browse-section row mb-5",attrs:{"data-qa":"browse section"}},[_vm._ssrNode("<div class=\"col-12 col-lg-9\" data-v-c30fc238><h2 data-qa=\"section headline\" data-v-c30fc238>"+_vm._ssrEscape("\n "+_vm._s(_vm.section.headline)+"\n ")+"</h2> <p data-v-c30fc238>"+_vm._ssrEscape("\n "+_vm._s(_vm.section.text)+"\n ")+"</p></div> "),_vm._ssrNode("<div class=\"col-12\" data-v-c30fc238>","</div>",[_c('b-card-group',{staticClass:"card-deck-4-cols",attrs:{"deck":"","data-qa":"section group"}},[(_vm.isPeopleSection)?_vm._l((_vm.cards),function(card,index){return _c('ContentCard',{key:index,attrs:{"title":card.name,"url":_vm.entityRouterLink(card.identifier, card.slug),"image-url":card.entityImage,"image-optimisation-options":{ width: 510 },"variant":"mini"}})}):_vm._l((_vm.cards),function(card,index){return _c('BrowseContentCard',{key:index,attrs:{"fields":card,"card-type":card['__typename'],"variant":card['__variant']}})})],2),_vm._ssrNode(" "),(_vm.section.moreButton)?_c('SmartLink',{staticClass:"btn btn-light",attrs:{"destination":_vm.section.moreButton.url,"data-qa":"section more button"}},[_vm._v("\n "+_vm._s(_vm.section.moreButton.text)+"\n ")]):_vm._e()],2)],2):_vm._e()} var staticRenderFns = [] // CONCATENATED MODULE: ./src/components/browse/ContentCardSection.vue?vue&type=template&id=c30fc238&scoped=true& // EXTERNAL MODULE: ./src/components/generic/ContentCard.vue + 4 modules var ContentCard = __webpack_require__(203); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/browse/BrowseContentCard.vue?vue&type=template&id=3e2e2615& var BrowseContentCardvue_type_template_id_3e2e2615_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('ContentCard',{attrs:{"title":_vm.title,"texts":_vm.texts,"url":_vm.destination,"image-url":_vm.imageUrl,"image-content-type":_vm.imageContentType,"image-width":_vm.imageWidth,"image-height":_vm.imageHeight,"image-alt":_vm.imageAlt,"variant":_vm.cardVariant,"omit-all-uris":true,"image-optimisation-options":{ width: 510 },"logo":_vm.fields.logo}})} var BrowseContentCardvue_type_template_id_3e2e2615_staticRenderFns = [] // CONCATENATED MODULE: ./src/components/browse/BrowseContentCard.vue?vue&type=template&id=3e2e2615& // EXTERNAL MODULE: ./src/plugins/europeana/data.js var data = __webpack_require__(10); // EXTERNAL MODULE: ./src/plugins/europeana/record.js var record = __webpack_require__(55); // EXTERNAL MODULE: ./src/plugins/europeana/entity.js var entity = __webpack_require__(52); // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/browse/BrowseContentCard.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // /* harmony default export */ var BrowseContentCardvue_type_script_lang_js_ = ({ components: { ContentCard: ContentCard["default"] }, props: { fields: { type: Object, default: () => ({}) }, cardType: { type: String, default: null }, variant: { type: String, default: null } }, computed: { cardFields() { return this.cardType === 'AutomatedRecordCard' && this.fields.encoding ? this.fields.encoding : this.fields; }, title() { if (this.cardType === 'AutomatedRecordCard' && this.fields.encoding) { if (this.cardFields.dcTitleLangAware) { return this.cardFields.dcTitleLangAware; } else if (this.cardFields.dcDescriptionLangAware) { return this.cardFields.dcDescriptionLangAware; } else { return this.$t('record.record'); } } return this.cardFields.name; }, imageIsContentfulAsset() { var _this$cardFields$imag, _this$cardFields$imag2; return ((_this$cardFields$imag = this.cardFields.image) === null || _this$cardFields$imag === void 0 ? void 0 : (_this$cardFields$imag2 = _this$cardFields$imag.url) === null || _this$cardFields$imag2 === void 0 ? void 0 : _this$cardFields$imag2.includes('://images.ctfassets.net/')) || false; }, imageUrl() { let imageUrl = ''; if (this.cardFields.thumbnailUrl) { imageUrl = this.cardFields.thumbnailUrl; } else if (typeof this.cardFields.image === 'string') { imageUrl = this.cardFields.image; } else if (this.cardFields.edmPreview) { imageUrl = this.$apis.thumbnail.edmPreview(this.cardFields.edmPreview[0], { size: 400 }); } else if (this.cardFields.entityImage) { imageUrl = this.cardFields.entityImage; } else if (this.imageIsContentfulAsset) { imageUrl = this.cardFields.image.url; } return imageUrl; }, imageContentType() { return this.imageIsContentfulAsset ? this.cardFields.image.contentType : null; }, imageAlt() { return this.imageIsContentfulAsset && this.cardFields.image.description ? this.cardFields.image.description : ''; }, imageWidth() { return this.imageIsContentfulAsset ? this.cardFields.image.width : null; }, imageHeight() { return this.imageIsContentfulAsset ? this.cardFields.image.height : null; }, destination() { let destination = ''; if (this.fields.url) { destination = this.fields.url; } else if (this.forEuropeanaRecord()) { destination = this.recordRouterLink(this.fields.identifier); } else if (typeof this.fields.identifier === 'string' && /^https?:\/\//.test(this.fields.identifier)) { if (this.forEuropeanaEntity()) { destination = this.entityRouterLink(this.fields.identifier, this.fields.slug); } else { destination = this.fields.identifier; } } return destination; }, texts() { // TODO: Refactor content model to set this directly, so this method can be skipped. const texts = []; let textFields; if (this.cardType === 'AutomatedRecordCard') { if (this.fields.encoding) { textFields = ['dcCreatorLangAware', 'dataProvider']; } else { textFields = ['creator', 'provider']; } } else { textFields = ['description']; } for (const field of textFields) { if (this.cardFields[field]) { texts.push(this.cardFields[field]); } } return texts; }, cardVariant() { if (this.variant) { return this.variant; } return this.cardType === 'AutomatedEntityCard' ? 'entity' : 'default'; } }, methods: { forEuropeanaRecord() { return typeof this.fields.identifier === 'string' && Object(record["b" /* isEuropeanaRecordId */])(this.fields.identifier); }, forEuropeanaEntity() { return typeof this.fields.identifier === 'string' && this.fields.identifier.includes(data["a" /* BASE_URL */]); }, entityRouterLink(uri, slug) { const uriMatch = uri.match(`^${data["a" /* BASE_URL */]}/([^/]+)/(.+)$`); return { name: 'collections-type-all', params: { type: Object(entity["e" /* getEntityTypeHumanReadable */])(uriMatch[1]), pathMatch: slug ? slug : uriMatch[2] } }; }, recordRouterLink(identifier) { return { name: 'item-all', params: { pathMatch: identifier.slice(1) } }; } } }); // CONCATENATED MODULE: ./src/components/browse/BrowseContentCard.vue?vue&type=script&lang=js& /* harmony default export */ var browse_BrowseContentCardvue_type_script_lang_js_ = (BrowseContentCardvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(3); // CONCATENATED MODULE: ./src/components/browse/BrowseContentCard.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( browse_BrowseContentCardvue_type_script_lang_js_, BrowseContentCardvue_type_template_id_3e2e2615_render, BrowseContentCardvue_type_template_id_3e2e2615_staticRenderFns, false, null, null, "71f34e9a" ) /* harmony default export */ var BrowseContentCard = (component.exports); // EXTERNAL MODULE: ./src/components/generic/SmartLink.vue + 3 modules var SmartLink = __webpack_require__(26); // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/browse/ContentCardSection.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var ContentCardSectionvue_type_script_lang_js_ = ({ components: { BrowseContentCard: BrowseContentCard, ContentCard: ContentCard["default"], SmartLink: SmartLink["a" /* default */] }, props: { section: { type: Object, default: () => null } }, computed: { cards() { return this.section.hasPartCollection.items.filter(card => !!card); }, isPeopleSection() { if (this.cards.length !== 4) { return false; } return this.cards.every(card => { if (card['__typename'] !== 'AutomatedEntityCard') { return false; } const identifier = card.identifier; return identifier ? Object(entity["b" /* entityParamsFromUri */])(identifier).type === 'person' : false; }); } }, methods: { entityRouterLink(uri, slug) { const uriMatch = uri.match(`^${data["a" /* BASE_URL */]}/([^/]+)/(.+)$`); return { name: 'collections-type-all', params: { type: Object(entity["e" /* getEntityTypeHumanReadable */])(uriMatch[1]), pathMatch: slug ? slug : uriMatch[2] } }; } } }); // CONCATENATED MODULE: ./src/components/browse/ContentCardSection.vue?vue&type=script&lang=js& /* harmony default export */ var browse_ContentCardSectionvue_type_script_lang_js_ = (ContentCardSectionvue_type_script_lang_js_); // CONCATENATED MODULE: ./src/components/browse/ContentCardSection.vue function injectStyles (context) { var style0 = __webpack_require__(300) if (style0.__inject__) style0.__inject__(context) } /* normalize component */ var ContentCardSection_component = Object(componentNormalizer["a" /* default */])( browse_ContentCardSectionvue_type_script_lang_js_, render, staticRenderFns, false, injectStyles, "c30fc238", "12017038" ) /* harmony default export */ var ContentCardSection = __webpack_exports__["default"] = (ContentCardSection_component.exports); /***/ }), /***/ 458: /***/ (function(module, exports) { /***/ }), /***/ 530: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/browse/AutomatedCardGroup.vue?vue&type=template&id=4092d047& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.entries && _vm.entries.length > 0)?_c('div',[(_vm.key === 'items/type-counts')?_c('InfoCardSection',{attrs:{"section":_vm.contentCardSection}}):_c('ContentCardSection',{attrs:{"section":_vm.contentCardSection}})],1):_vm._e()} var staticRenderFns = [] // CONCATENATED MODULE: ./src/components/browse/AutomatedCardGroup.vue?vue&type=template&id=4092d047& // EXTERNAL MODULE: ./src/components/browse/ContentCardSection.vue + 9 modules var ContentCardSection = __webpack_require__(368); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/browse/InfoCardSection.vue?vue&type=template&id=e63f2d90& var InfoCardSectionvue_type_template_id_e63f2d90_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.section)?_c('section',{staticClass:"info-card-section row mb-3"},[_vm._ssrNode("<div class=\"col-12\">","</div>",[_c('b-card-group',{class:_vm.cardGroupClass,attrs:{"deck":"","align":"center","data-qa":"section group"}},_vm._l((_vm.cards),function(card,index){return _c('InfoCard',{key:index,attrs:{"url":card.url,"info":card.info,"label":card.label,"image":card.image,"variant":_vm.cardVariant}})}),1),_vm._ssrNode(" "),(_vm.section.moreButton)?_c('SmartLink',{staticClass:"btn btn-light",attrs:{"destination":_vm.section.moreButton.url,"data-qa":"section more button"}},[_vm._v("\n "+_vm._s(_vm.section.moreButton.text)+"\n ")]):_vm._e()],2)]):_vm._e()} var InfoCardSectionvue_type_template_id_e63f2d90_staticRenderFns = [] // CONCATENATED MODULE: ./src/components/browse/InfoCardSection.vue?vue&type=template&id=e63f2d90& // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/InfoCard.vue?vue&type=template&id=7f11a43e& var InfoCardvue_type_template_id_7f11a43e_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-card',{staticClass:"text-center info-card",class:_vm.cardClass,attrs:{"data-qa":"info card","no-body":""}},[_c('SmartLink',{attrs:{"destination":_vm.url,"link-class":"card-link"}},[(_vm.image)?_c('div',{staticClass:"card-img"},[_c('span',{class:_vm.image})]):_vm._e(),_vm._v(" "),_c('b-card-body',{attrs:{"data-qa":"card body"}},[(_vm.info)?_c('b-card-title',{attrs:{"title-tag":"div","data-qa":"card info"}},[_c('span',[_vm._v("\n "+_vm._s(_vm.info)+"\n ")])]):_vm._e(),_vm._v(" "),_c('b-card-text',{staticClass:"text-uppercase",attrs:{"text-tag":"div"}},[_vm._v("\n "+_vm._s(_vm.label)+"\n ")])],1)],1)],1)} var InfoCardvue_type_template_id_7f11a43e_staticRenderFns = [] // CONCATENATED MODULE: ./src/components/generic/InfoCard.vue?vue&type=template&id=7f11a43e& // EXTERNAL MODULE: ./src/components/generic/SmartLink.vue + 3 modules var SmartLink = __webpack_require__(26); // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/InfoCard.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var InfoCardvue_type_script_lang_js_ = ({ name: 'InfoCard', components: { SmartLink: SmartLink["a" /* default */] }, props: { url: { type: Object, default: null }, info: { type: String, default: '' }, label: { type: String, default: null }, image: { type: String, default: '' }, variant: { type: String, default: 'default' // other options: dark } }, computed: { cardClass() { return `${this.variant}-card`; } } }); // CONCATENATED MODULE: ./src/components/generic/InfoCard.vue?vue&type=script&lang=js& /* harmony default export */ var generic_InfoCardvue_type_script_lang_js_ = (InfoCardvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(3); // EXTERNAL MODULE: ./src/components/generic/InfoCard.vue?vue&type=custom&index=0&blockType=docs&lang=md var InfoCardvue_type_custom_index_0_blockType_docs_lang_md = __webpack_require__(458); var InfoCardvue_type_custom_index_0_blockType_docs_lang_md_default = /*#__PURE__*/__webpack_require__.n(InfoCardvue_type_custom_index_0_blockType_docs_lang_md); // CONCATENATED MODULE: ./src/components/generic/InfoCard.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( generic_InfoCardvue_type_script_lang_js_, InfoCardvue_type_template_id_7f11a43e_render, InfoCardvue_type_template_id_7f11a43e_staticRenderFns, false, null, null, "394a840f" ) /* custom blocks */ if (typeof InfoCardvue_type_custom_index_0_blockType_docs_lang_md_default.a === 'function') InfoCardvue_type_custom_index_0_blockType_docs_lang_md_default()(component) /* harmony default export */ var InfoCard = (component.exports); // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/browse/InfoCardSection.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var InfoCardSectionvue_type_script_lang_js_ = ({ components: { InfoCard: InfoCard }, props: { section: { type: Object, default: () => null } }, computed: { cards() { return this.section.hasPartCollection.items.filter(card => card !== null); }, cardGroupClass() { if (this.section.type === 'items/type-counts') { return 'card-deck-3-cols'; } else { return 'card-deck-4-cols'; } }, cardVariant() { if (this.section.type === 'items/type-counts') { return 'dark'; } else { return 'default'; } } } }); // CONCATENATED MODULE: ./src/components/browse/InfoCardSection.vue?vue&type=script&lang=js& /* harmony default export */ var browse_InfoCardSectionvue_type_script_lang_js_ = (InfoCardSectionvue_type_script_lang_js_); // CONCATENATED MODULE: ./src/components/browse/InfoCardSection.vue /* normalize component */ var InfoCardSection_component = Object(componentNormalizer["a" /* default */])( browse_InfoCardSectionvue_type_script_lang_js_, InfoCardSectionvue_type_template_id_e63f2d90_render, InfoCardSectionvue_type_template_id_e63f2d90_staticRenderFns, false, null, null, "7f0dd99b" ) /* harmony default export */ var InfoCardSection = (InfoCardSection_component.exports); // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/browse/AutomatedCardGroup.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // const FEATURED_ORGANISATIONS = 'Featured organisations'; const FEATURED_PLACES = 'Featured places'; const FEATURED_TOPICS = 'Featured topics'; const FEATURED_TIMES = 'Featured centuries'; const RECENT_ITEMS = 'Recent items'; const ITEM_COUNTS_MEDIA_TYPE = 'Item counts by media type'; /* harmony default export */ var AutomatedCardGroupvue_type_script_lang_js_ = ({ name: 'AutomatedCardGroup', components: { ContentCardSection: ContentCardSection["default"], InfoCardSection: InfoCardSection }, props: { sectionType: { type: String, required: true }, moreButton: { type: Object, default: null } }, data() { const data = { entries: [] }; if (this.sectionType === FEATURED_ORGANISATIONS) { data.key = 'collections/organisations/featured'; data.cardType = 'AutomatedEntityCard'; data.headline = this.$i18n.t('automatedCardGroup.organisation'); } else if (this.sectionType === FEATURED_PLACES) { data.key = `${this.$i18n.locale}/collections/places/featured`; data.cardType = 'AutomatedEntityCard'; data.headline = this.$i18n.t('automatedCardGroup.place'); } else if (this.sectionType === FEATURED_TOPICS) { data.key = `${this.$i18n.locale}/collections/topics/featured`; data.cardType = 'AutomatedEntityCard'; data.headline = this.$i18n.t('automatedCardGroup.topic'); } else if (this.sectionType === FEATURED_TIMES) { data.key = `${this.$i18n.locale}/collections/times/featured`; data.cardType = 'AutomatedEntityCard'; data.headline = this.$i18n.t('automatedCardGroup.time'); } else if (this.sectionType === RECENT_ITEMS) { data.key = 'items/recent'; data.cardType = 'AutomatedRecordCard'; data.headline = this.$i18n.t('automatedCardGroup.item'); } else if (this.sectionType === ITEM_COUNTS_MEDIA_TYPE) { data.key = 'items/type-counts'; data.cardType = 'InfoCard'; } return data; }, fetch() { if (true) { return __webpack_require__.e(/* import() */ 104).then(__webpack_require__.bind(null, 532)).then(module => { return module.cached(this.key, this.$config).then(entries => { this.entries = entries; }); }); } else {} }, computed: { contentCardSection() { var _this$entries2; if (this.sectionType === ITEM_COUNTS_MEDIA_TYPE) { var _this$entries; return { type: this.key, hasPartCollection: { items: (_this$entries = this.entries) === null || _this$entries === void 0 ? void 0 : _this$entries.map(entry => ({ __typename: this.cardType, url: this.searchFromType(entry.label), info: this.$i18n.n(entry.count), label: this.$t(`facets.TYPE.options.${entry.label}`), image: this.infoImageFromType(entry.label) })) }, moreButton: this.moreButton }; } return { headline: this.headline, hasPartCollection: { items: (_this$entries2 = this.entries) === null || _this$entries2 === void 0 ? void 0 : _this$entries2.map(entry => ({ __typename: this.cardType, __variant: this.sectionType === RECENT_ITEMS ? null : 'mini', name: entry.prefLabel, identifier: entry.id, image: this.$apis.entity.imageUrl(entry), encoding: entry, logo: !!entry.logo })) }, moreButton: this.moreButton }; } }, methods: { infoImageFromType(itemType) { return `ic-${itemType.toLowerCase()}`; }, searchFromType(itemType) { return { name: 'search', query: { query: '', qf: `TYPE:"${itemType}"` } }; } } }); // CONCATENATED MODULE: ./src/components/browse/AutomatedCardGroup.vue?vue&type=script&lang=js& /* harmony default export */ var browse_AutomatedCardGroupvue_type_script_lang_js_ = (AutomatedCardGroupvue_type_script_lang_js_); // CONCATENATED MODULE: ./src/components/browse/AutomatedCardGroup.vue /* normalize component */ var AutomatedCardGroup_component = Object(componentNormalizer["a" /* default */])( browse_AutomatedCardGroupvue_type_script_lang_js_, render, staticRenderFns, false, null, null, "65174e8a" ) /* harmony default export */ var AutomatedCardGroup = __webpack_exports__["default"] = (AutomatedCardGroup_component.exports); /***/ }) };; //# sourceMappingURL=79.js.map