@europeana/portal
Version:
Europeana Portal
2 lines • 15 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{1007:function(t,e,n){"use strict";n(876)},1008:function(t,e,n){var r=n(137)(!1);r.push([t.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}",""]),t.exports=r},1085:function(t,e,n){"use strict";n.r(e);n(13),n(10),n(21),n(67);var r=n(711),data=(n(34),n(58),n(62),n(15),n(64),n(41),n(68),n(43),n(71),n(46),n(109)),l=n(322),o=n(314);function c(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,o=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){c=!0,l=t},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw l}}}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var h={components:{ContentCard:r.default},props:{fields:{type:Object,default:function(){return{}}},cardType:{type:String,default:null},variant:{type:String,default:null}},computed:{cardFields:function(){return"AutomatedRecordCard"===this.cardType&&this.fields.encoding?this.fields.encoding:this.fields},title:function(){return"AutomatedRecordCard"===this.cardType&&this.fields.encoding?this.cardFields.dcTitleLangAware?this.cardFields.dcTitleLangAware:this.cardFields.dcDescriptionLangAware?this.cardFields.dcDescriptionLangAware:this.$t("record.record"):this.cardFields.name},imageIsContentfulAsset:function(){var t,e;return(null===(t=this.cardFields.image)||void 0===t||null===(e=t.url)||void 0===e?void 0:e.includes("://images.ctfassets.net/"))||!1},imageUrl:function(){var t="";return this.cardFields.thumbnailUrl?t=this.cardFields.thumbnailUrl:"string"==typeof this.cardFields.image?t=this.cardFields.image:this.cardFields.edmPreview?t=this.$apis.thumbnail.edmPreview(this.cardFields.edmPreview[0],{size:400}):this.cardFields.entityImage?t=this.cardFields.entityImage:this.imageIsContentfulAsset&&(t=this.cardFields.image.url),t},imageContentType:function(){return this.imageIsContentfulAsset?this.cardFields.image.contentType:null},imageAlt:function(){return this.imageIsContentfulAsset&&this.cardFields.image.description?this.cardFields.image.description:""},imageWidth:function(){return this.imageIsContentfulAsset?this.cardFields.image.width:null},imageHeight:function(){return this.imageIsContentfulAsset?this.cardFields.image.height:null},destination:function(){var t="";return this.fields.url?t=this.fields.url:this.forEuropeanaRecord()?t=this.recordRouterLink(this.fields.identifier):"string"==typeof this.fields.identifier&&/^https?:\/\//.test(this.fields.identifier)&&(t=this.forEuropeanaEntity()?this.entityRouterLink(this.fields.identifier,this.fields.slug):this.fields.identifier),t},texts:function(){var t,e=[],n=c("AutomatedRecordCard"===this.cardType?this.fields.encoding?["dcCreatorLangAware","dataProvider"]:["creator","provider"]:["description"]);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.cardFields[r]&&e.push(this.cardFields[r])}}catch(t){n.e(t)}finally{n.f()}return e},cardVariant:function(){return this.variant?this.variant:"AutomatedEntityCard"===this.cardType?"entity":"default"}},methods:{forEuropeanaRecord:function(){return"string"==typeof this.fields.identifier&&Object(l.b)(this.fields.identifier)},forEuropeanaEntity:function(){return"string"==typeof this.fields.identifier&&this.fields.identifier.includes(data.a)},entityRouterLink:function(t,e){var n=t.match("^".concat(data.a,"/([^/]+)/(.+)$"));return{name:"collections-type-all",params:{type:Object(o.e)(n[1]),pathMatch:e||n[2]}}},recordRouterLink:function(t){return{name:"item-all",params:{pathMatch:t.slice(1)}}}}},f=n(59),m=Object(f.a)(h,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("ContentCard",{attrs:{title:t.title,texts:t.texts,url:t.destination,"image-url":t.imageUrl,"image-content-type":t.imageContentType,"image-width":t.imageWidth,"image-height":t.imageHeight,"image-alt":t.imageAlt,variant:t.cardVariant,"omit-all-uris":!0,"image-optimisation-options":{width:510},logo:t.fields.logo}})}),[],!1,null,null,null).exports,y=n(203),v={components:{BrowseContentCard:m,ContentCard:r.default,SmartLink:y.a},props:{section:{type:Object,default:function(){return null}}},computed:{cards:function(){return this.section.hasPartCollection.items.filter((function(t){return!!t}))},isPeopleSection:function(){return 4===this.cards.length&&this.cards.every((function(t){if("AutomatedEntityCard"!==t.__typename)return!1;var e=t.identifier;return!!e&&"person"===Object(o.b)(e).type}))}},methods:{entityRouterLink:function(t,e){var n=t.match("^".concat(data.a,"/([^/]+)/(.+)$"));return{name:"collections-type-all",params:{type:Object(o.e)(n[1]),pathMatch:e||n[2]}}}}},w=(n(1007),Object(f.a)(v,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.section?n("section",{staticClass:"browse-section row mb-5",attrs:{"data-qa":"browse section"}},[n("div",{staticClass:"col-12 col-lg-9"},[n("h2",{attrs:{"data-qa":"section headline"}},[t._v("\n "+t._s(t.section.headline)+"\n ")]),t._v(" "),n("p",[t._v("\n "+t._s(t.section.text)+"\n ")])]),t._v(" "),n("div",{staticClass:"col-12"},[n("b-card-group",{staticClass:"card-deck-4-cols",attrs:{deck:"","data-qa":"section group"}},[t.isPeopleSection?t._l(t.cards,(function(e,r){return n("ContentCard",{key:r,attrs:{title:e.name,url:t.entityRouterLink(e.identifier,e.slug),"image-url":e.entityImage,"image-optimisation-options":{width:510},variant:"mini"}})})):t._l(t.cards,(function(t,e){return n("BrowseContentCard",{key:e,attrs:{fields:t,"card-type":t.__typename,variant:t.__variant}})}))],2),t._v(" "),t.section.moreButton?n("SmartLink",{staticClass:"btn btn-light",attrs:{destination:t.section.moreButton.url,"data-qa":"section more button"}},[t._v("\n "+t._s(t.section.moreButton.text)+"\n ")]):t._e()],1)]):t._e()}),[],!1,null,"c30fc238",null));e.default=w.exports},711:function(t,e,n){"use strict";n.r(e);var r=n(44),l=(n(10),n(43),n(46),n(250),n(47),n(21),n(52),n(58),n(62),n(30),n(41),n(67),n(34),n(107),n(60),n(13),n(50),n(104),n(176)),o=n.n(l),c=n(203),d=n(712),h=n(31),f=n(204),m={name:"ContentCard",components:{ClientOnly:o.a,SmartLink:c.a,MediaDefaultThumbnail:function(){return n.e(24).then(n.bind(null,1172))}},mixins:[d.a],props:{title:{type:[String,Object],default:""},subTitle:{type:String,default:null},texts:{type:Array,default:function(){return[]}},hitsText:{type:Object,default:null},url:{type:[String,Object],default:""},imageUrl:{type:String,default:""},imageContentType:{type:String,default:null},imageWidth:{type:Number,default:null},imageHeight:{type:Number,default:null},imageAlt:{type:String,default:""},imageOptimisationOptions:{type:Object,default:function(){return{}}},lazy:{type:Boolean,default:!0},showSubtitle:{type:Boolean,default:!0},variant:{type:String,default:"default"},omitAllUris:{type:Boolean,default:!1},omitUrisIfOtherValues:{type:Boolean,default:!1},limitValuesWithinEachText:{type:Number,default:-1},blankImageHeight:{type:Number,default:null},blankImageWidth:{type:Number,default:null},logo:{type:Boolean,default:!1},mediaType:{type:String,default:null},offset:{type:Number,default:null}},data:function(){return{cardImageUrl:this.imageUrl,displayLabelTypes:"exhibitions|galleries|blog|collections",themes:f.a.map((function(t){return t.id}))}},computed:{cardClass:function(){return"".concat(this.variant,"-card")},displayTitle:function(){if(this.title){if("string"==typeof this.title)return{value:this.title,code:null};var t=Object(h.h)(this.title,this.$i18n.locale);return{value:t.values[0],code:t.code}}return null},displaySubTitle:function(){return this.subTitle||this.displayLabel},displayLabel:function(){if(!this.displayLabelType)return!1;if("collections"===this.displayLabelType){var t="string"==typeof this.url?this.url.split("/").pop().split("-").shift():this.url.params.pathMatch;return this.themes.includes(t)?this.$t("cardLabels.theme"):this.$t("cardLabels.".concat(this.displayLabelTypeCollections))}return"blog"===this.displayLabelType?this.$tc("blog.posts",1):this.$tc("".concat(this.displayLabelType,".").concat(this.displayLabelType),1)},displayLabelTypeCollections:function(){return"object"===Object(r.a)(this.url)?this.url.params.type:this.url.split("/").slice(-2,-1)},displayLabelType:function(){return!!this.displayLabelMatch&&this.displayLabelMatch[1]},displayLabelMatch:function(){return"object"===Object(r.a)(this.url)?this.displayLabelMatchObject:this.displayLabelMatchString},displayLabelMatchObject:function(){return this.url.name.match(new RegExp("(".concat(this.displayLabelTypes,")")))},displayLabelMatchString:function(){return this.url.match(new RegExp("/(".concat(this.displayLabelTypes,")[/.]")))},displayTexts:function(){var t=this;return this.texts.filter(Boolean).map((function(e){return"string"==typeof e?{values:[e],code:null}:Array.isArray(e)?{values:e,code:null}:Object(h.h)(e,t.$i18n.locale,{omitUrisIfOtherValues:t.omitUrisIfOtherValues,omitAllUris:t.omitAllUris})}))},optimisedImageUrl:function(){return this.$options.filters.optimisedImageUrl(this.imageUrl,this.imageContentType,this.imageOptimisationOptions)}},watch:{imageUrl:function(){this.cardImageUrl=this.imageUrl}},methods:{cardText:function(t){var e=this.limitValuesWithinEachText>-1?t.slice(0,this.limitValuesWithinEachText):[].concat(t);t.length>e.length&&e.push(this.$t("formatting.ellipsis"));var n=e.join(this.$t("formatting.listSeperator")+" "),r=this.stripMarkdown(n);return this.$options.filters.truncate(r,255,this.$t("formatting.ellipsis"))},redrawMasonry:function(){var t=this;this.$redrawVueMasonry&&this.$nextTick((function(){t.$redrawVueMasonry()}))},imageNotFound:function(){this.cardImageUrl="",this.redrawMasonry()},imageLoaded:function(t){t.target.src.startsWith("data:")||this.redrawMasonry()}}},y=n(59),v=n(715),w=n.n(v),component=Object(y.a)(m,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-card",{staticClass:"text-left content-card",class:t.cardClass,attrs:{"data-qa":"content card","no-body":""}},[n("div",{staticClass:"card-wrapper"},[n("SmartLink",{attrs:{destination:t.url,"link-class":"card-link","aria-label":t.displayTitle?t.displayTitle.value:null,title:"mosaic"===t.variant&&t.displayTitle?t.displayTitle.value:null}}),t._v(" "),"mini"!==t.variant?n("MediaDefaultThumbnail",{directives:[{name:"show",rawName:"v-show",value:!t.cardImageUrl,expression:"!cardImageUrl"}],attrs:{"media-type":t.mediaType,offset:t.offset}}):t._e(),t._v(" "),t.cardImageUrl?n("div",{staticClass:"card-img",class:{logo:t.logo}},[t.lazy?n("b-img-lazy",{attrs:{src:t.optimisedImageUrl,"blank-width":t.blankImageWidth,"blank-height":t.blankImageHeight,width:t.imageWidth,height:t.imageHeight,alt:t.imageAlt},nativeOn:{error:function(e){return t.imageNotFound.apply(null,arguments)},load:function(e){return t.imageLoaded.apply(null,arguments)}}}):n("b-img",{attrs:{src:t.optimisedImageUrl,width:t.imageWidth,height:t.imageHeight,alt:t.imageAlt},on:{error:t.imageNotFound,load:t.imageLoaded}})],1):t._e(),t._v(" "),"mosaic"!==t.variant?n("b-card-body",{attrs:{"data-qa":"card body"}},[t.displaySubTitle&&"mini"!==t.variant&&t.showSubtitle?n("b-card-sub-title",{staticClass:"mt-0",attrs:{"sub-title-tag":"div","sub-title-text-variant":"default"}},[t._v("\n "+t._s(t.displaySubTitle)+"\n ")]):t._e(),t._v(" "),n("div",{staticClass:"title-texts-wrapper"},[t.displayTitle?n("b-card-title",{attrs:{"title-tag":"div","data-qa":"card title",lang:t.displayTitle.code}},[n("span",[t._v("\n "+t._s(t._f("truncate")(t.displayTitle.value,90,t.$t("formatting.ellipsis")))+"\n ")])]):t._e(),t._v(" "),t.hitsText?n("b-card-text",{attrs:{"text-tag":"div","data-qa":"highlighted search term"}},[n("p",[t._v("\n "+t._s(t.hitsText.prefix)),n("strong",{staticClass:"has-text-highlight"},[t._v(t._s(t.hitsText.exact))]),t._v(t._s(t.hitsText.suffix)+"\n ")])]):t._e(),t._v(" "),t.displayTexts.length>0?t._l(t.displayTexts,(function(text,e){return n("b-card-text",{key:e,attrs:{lang:text.code,"text-tag":"div"}},[n("p",{domProps:{innerHTML:t._s(t.cardText(text.values))}})])})):t._e()],2),t._v(" "),n("client-only",[t._t("footer")],2)],1):t._e()],1),t._v(" "),n("client-only",[t._t("image-overlay")],2)],1)}),[],!1,null,null,null);"function"==typeof w.a&&w()(component);e.default=component.exports},712:function(t,e,n){"use strict";n(30),n(47),n(107),n(21),n(60),n(37),n(41),n(10),n(34),n(68),n(43),n(15),n(64),n(71),n(46);var r=n(717);function l(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,d=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return c=t.done,t},e:function(t){d=!0,l=t},f:function(){try{c||null==n.return||n.return()}finally{if(d)throw l}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var c=function(t){return[/\n$/].concat(t.map((function(t){return new RegExp("</?".concat(t,".*?>"),"gi")})))};e.a={methods:{stripMarkdown:function(text){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[""];text=r.marked.parse(text);var e,n=l(c(t));try{for(n.s();!(e=n.n()).done;){var pattern=e.value;text=text.replace(pattern,"")}}catch(t){n.e(t)}finally{n.f()}return text}}}},715:function(t,e){},876:function(t,e,n){var content=n(1008);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(138).default)("3f6cbcc0",content,!0,{sourceMap:!1})}}]);
//# sourceMappingURL=997cdd8.js.map