@europeana/portal
Version:
Europeana Portal
1,847 lines (1,502 loc) • 449 kB
JavaScript
exports.ids = [70,88,102];
exports.modules = {
/***/ 199:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export extend */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getDocument; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getWindow; });
/* unused harmony export ssrDocument */
/* unused harmony export ssrWindow */
/**
* SSR Window 4.0.2
* Better handling for window object in SSR environment
* https://github.com/nolimits4web/ssr-window
*
* Copyright 2021, Vladimir Kharlampidi
*
* Licensed under MIT
*
* Released on: December 13, 2021
*/
/* eslint-disable no-param-reassign */
function isObject(obj) {
return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;
}
function extend(target = {}, src = {}) {
Object.keys(src).forEach(key => {
if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) {
extend(target[key], src[key]);
}
});
}
const ssrDocument = {
body: {},
addEventListener() {},
removeEventListener() {},
activeElement: {
blur() {},
nodeName: ''
},
querySelector() {
return null;
},
querySelectorAll() {
return [];
},
getElementById() {
return null;
},
createEvent() {
return {
initEvent() {}
};
},
createElement() {
return {
children: [],
childNodes: [],
style: {},
setAttribute() {},
getElementsByTagName() {
return [];
}
};
},
createElementNS() {
return {};
},
importNode() {
return null;
},
location: {
hash: '',
host: '',
hostname: '',
href: '',
origin: '',
pathname: '',
protocol: '',
search: ''
}
};
function getDocument() {
const doc = typeof document !== 'undefined' ? document : {};
extend(doc, ssrDocument);
return doc;
}
const ssrWindow = {
document: ssrDocument,
navigator: {
userAgent: ''
},
location: {
hash: '',
host: '',
hostname: '',
href: '',
origin: '',
pathname: '',
protocol: '',
search: ''
},
history: {
replaceState() {},
pushState() {},
go() {},
back() {}
},
CustomEvent: function CustomEvent() {
return this;
},
addEventListener() {},
removeEventListener() {},
getComputedStyle() {
return {
getPropertyValue() {
return '';
}
};
},
Image() {},
Date() {},
screen: {},
setTimeout() {},
clearTimeout() {},
matchMedia() {
return {};
},
requestAnimationFrame(callback) {
if (typeof setTimeout === 'undefined') {
callback();
return null;
}
return setTimeout(callback, 0);
},
cancelAnimationFrame(id) {
if (typeof setTimeout === 'undefined') {
return;
}
clearTimeout(id);
}
};
function getWindow() {
const win = typeof window !== 'undefined' ? window : {};
extend(win, ssrWindow);
return win;
}
/***/ }),
/***/ 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) {
/***/ }),
/***/ 209:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(URL) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return urlIsContentfulAsset; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return optimisedSrcForContentfulAsset; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return responsiveImageSrcset; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return responsiveBackgroundImageCSSVars; });
function urlIsContentfulAsset(url) {
return new URL(url).host === 'images.ctfassets.net';
}
function optimisedSrcForContentfulAsset(asset, params = {}) {
if (!(asset !== null && asset !== void 0 && asset.url)) {
return null;
}
const imageUrl = new URL(asset.url); // TODO: are optimisations possible on any other content types?
if (asset.contentType === 'image/jpeg') {
params['fm'] = 'jpg';
params['fl'] = 'progressive';
if (!params.q) {
params.q = 80;
}
}
for (const key in params) {
imageUrl.searchParams.set(key, params[key]);
}
return imageUrl.toString();
}
function responsiveImageSrcset(image, params) {
if (image !== null && image !== void 0 && image.url && urlIsContentfulAsset(image.url) && params) {
return [`${optimisedSrcForContentfulAsset(image, params.small)} ${params.small.w}w`, `${optimisedSrcForContentfulAsset(image, params.medium)} ${params.medium.w}w`, `${optimisedSrcForContentfulAsset(image, params.large)} ${params.large.w}w`, `${optimisedSrcForContentfulAsset(image, params.xl)} ${params.xl.w}w`, `${optimisedSrcForContentfulAsset(image, params.xxl)} ${params.xxl.w}w`, `${optimisedSrcForContentfulAsset(image, params.xxxl)} ${params.xxxl.w}w`, `${optimisedSrcForContentfulAsset(image, params.wqhd)} ${params.wqhd.w}w`, `${optimisedSrcForContentfulAsset(image, params['4k'])} ${params['4k'].w}w`].join(',');
} else if (image !== null && image !== void 0 && image.url) {
return image.url;
} else {
return null;
}
}
function responsiveBackgroundImageCSSVars(image, params) {
if (image.url && urlIsContentfulAsset(image.url) && params) {
return {
'--bg-img-small': `url('${optimisedSrcForContentfulAsset(image, params.small)}')`,
'--bg-img-medium': `url('${optimisedSrcForContentfulAsset(image, params.medium)}')`,
'--bg-img-large': `url('${optimisedSrcForContentfulAsset(image, params.large)}')`,
'--bg-img-xl': `url('${optimisedSrcForContentfulAsset(image, params.xl)}')`,
'--bg-img-xxl': `url('${optimisedSrcForContentfulAsset(image, params.xxl)}')`,
'--bg-img-xxxl': `url('${optimisedSrcForContentfulAsset(image, params.xxxl)}')`,
'--bg-img-wqhd': `url('${optimisedSrcForContentfulAsset(image, params.wqhd)}')`,
'--bg-img-4k': `url('${optimisedSrcForContentfulAsset(image, params['4k'])}')`
};
} else if (image.url) {
return {
'--bg-img-small': `url('${image.url}')`
};
} else {
return null;
}
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(9)["URL"]))
/***/ }),
/***/ 218:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
const ICON_CLASS_BY = 'icon-license-by';
const ICON_CLASS_CC = 'icon-license-cc';
const ICON_CLASS_COPYRIGHT_NOT_EVALUATED = 'icon-license-rs-unknown';
const ICON_CLASS_IN_COPYRIGHT = 'icon-license-rs-yes';
const ICON_CLASS_NC = 'icon-license-nc';
const ICON_CLASS_ND = 'icon-license-nd';
const ICON_CLASS_NO_COPYRIGHT = 'icon-license-rs-no';
const ICON_CLASS_PUBLIC_DOMAIN = 'icon-license-pd';
const ICON_CLASS_RIGHTS_RESERVED = 'icon-license-rr';
const ICON_CLASS_SA = 'icon-license-sa';
const ICON_CLASS_ZERO = 'icon-license-zero';
/* harmony default export */ __webpack_exports__["a"] = ({
methods: {
rightsNameAndIcon(rightsStatementUrl) {
const rights = {};
switch (true) {
case new RegExp('https?://creativecommons.org/(licenses/)?publicdomain/mark').test(rightsStatementUrl):
rights.name = 'Public Domain';
rights.iconClass = [ICON_CLASS_PUBLIC_DOMAIN];
break;
case new RegExp('https?://creativecommons.org/(licenses/)?publicdomain/zero').test(rightsStatementUrl):
rights.name = 'CC0';
rights.iconClass = [ICON_CLASS_ZERO];
break;
case new RegExp('https?://creativecommons.org/licenses/by/').test(rightsStatementUrl):
rights.name = 'CC BY';
rights.iconClass = [ICON_CLASS_CC, ICON_CLASS_BY];
break;
case new RegExp('https?://creativecommons.org/licenses/by-sa/').test(rightsStatementUrl):
rights.name = 'CC BY-SA';
rights.iconClass = [ICON_CLASS_CC, ICON_CLASS_BY, ICON_CLASS_SA];
break;
case new RegExp('https?://creativecommons.org/licenses/by-nc/').test(rightsStatementUrl):
rights.name = 'CC BY-NC';
rights.iconClass = [ICON_CLASS_CC, ICON_CLASS_BY, ICON_CLASS_NC];
break;
case new RegExp('https?://creativecommons.org/licenses/by-nc-sa/').test(rightsStatementUrl):
rights.name = 'CC BY-NC-SA';
rights.iconClass = [ICON_CLASS_CC, ICON_CLASS_BY, ICON_CLASS_NC, ICON_CLASS_SA];
break;
case new RegExp('https?://creativecommons.org/licenses/by-nc-nd/').test(rightsStatementUrl):
rights.name = 'CC BY-NC-ND';
rights.iconClass = [ICON_CLASS_CC, ICON_CLASS_BY, ICON_CLASS_NC, ICON_CLASS_ND];
break;
case new RegExp('https?://creativecommons.org/licenses/by-nd/').test(rightsStatementUrl):
rights.name = 'CC BY-ND';
rights.iconClass = [ICON_CLASS_CC, ICON_CLASS_BY, ICON_CLASS_ND];
break;
case new RegExp('https?://rightsstatements.org/(vocab|page)/InC-EDU/').test(rightsStatementUrl):
rights.name = 'In Copyright - Educational Use Permitted';
rights.iconClass = [ICON_CLASS_IN_COPYRIGHT];
break;
case new RegExp('https?://rightsstatements.org/(vocab|page)/NoC-NC/').test(rightsStatementUrl):
case new RegExp('https?://www.europeana.eu/rights/out-of-copyright-non-commercial/').test(rightsStatementUrl):
rights.name = 'No Copyright - Non-Commercial Use Only';
rights.iconClass = [ICON_CLASS_NO_COPYRIGHT];
break;
case new RegExp('https?://rightsstatements.org/(vocab|page)/NoC-OKLR/').test(rightsStatementUrl):
rights.name = 'No Copyright - Other Known Legal Restrictions';
rights.iconClass = [ICON_CLASS_NO_COPYRIGHT];
break;
case new RegExp('https?://www.europeana.eu/rights/rr-f/').test(rightsStatementUrl):
rights.name = 'Rights Reserved - Free Access';
rights.iconClass = [ICON_CLASS_RIGHTS_RESERVED];
break;
case new RegExp('https?://www.europeana.eu/rights/rr-p/').test(rightsStatementUrl):
rights.name = 'Rights Reserved - Paid Access';
rights.iconClass = [ICON_CLASS_RIGHTS_RESERVED];
break;
case new RegExp('https?://www.europeana.eu/rights/rr-r/').test(rightsStatementUrl):
rights.name = 'Rights Reserved - Restricted Access';
rights.iconClass = [ICON_CLASS_RIGHTS_RESERVED];
break;
case new RegExp('https?://www.europeana.eu/rights/unknown/').test(rightsStatementUrl):
rights.name = 'Unknown copyright status';
rights.iconClass = [];
break;
case new RegExp('https?://rightsstatements.org/(vocab|page)/InC/').test(rightsStatementUrl):
rights.name = 'In Copyright';
rights.iconClass = [ICON_CLASS_IN_COPYRIGHT];
break;
case new RegExp('https?://rightsstatements.org/(vocab|page)/InC-OW-EU/').test(rightsStatementUrl):
rights.name = 'In Copyright - EU Orphan Work';
rights.iconClass = [ICON_CLASS_IN_COPYRIGHT];
break;
case new RegExp('https?://rightsstatements.org/(vocab|page)/CNE/').test(rightsStatementUrl):
rights.name = 'Copyright Not Evaluated';
rights.iconClass = [ICON_CLASS_COPYRIGHT_NOT_EVALUATED];
break;
default:
rights.name = rightsStatementUrl;
break;
}
return rights;
}
}
});
/***/ }),
/***/ 225:
/***/ (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/RightsStatement.vue?vue&type=template&id=488721ec&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"license-label d-inline-flex align-items-center",class:{ 'text-uppercase': _vm.variant === 'simple' },attrs:{"data-qa":"rights statement"}},[_vm._ssrNode(((_vm.variant === 'icons')?((_vm._ssrList((_vm.rightsNameAndIcon(_vm.rightsStatementUrl).iconClass),function(icon){return ("<span"+(_vm._ssrClass("license",icon))+"></span>")}))):("<span class=\"icon-license\"></span>"))+" <span class=\"license-label-text\">"+_vm._ssrEscape("\n "+_vm._s(_vm.rightsNameAndIcon(_vm.rightsStatementUrl).name)+"\n ")+"</span>")])}
var staticRenderFns = []
// CONCATENATED MODULE: ./src/components/generic/RightsStatement.vue?vue&type=template&id=488721ec&
// EXTERNAL MODULE: ./src/mixins/rightsStatement.js
var rightsStatement = __webpack_require__(218);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/RightsStatement.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var RightsStatementvue_type_script_lang_js_ = ({
mixins: [rightsStatement["a" /* default */]],
props: {
rightsStatementUrl: {
type: String,
required: true
},
/**
* Style variant to use
* @values icons, simple
*/
variant: {
type: String,
default: 'icons'
}
}
});
// CONCATENATED MODULE: ./src/components/generic/RightsStatement.vue?vue&type=script&lang=js&
/* harmony default export */ var generic_RightsStatementvue_type_script_lang_js_ = (RightsStatementvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(3);
// CONCATENATED MODULE: ./src/components/generic/RightsStatement.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
generic_RightsStatementvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
"65327e37"
)
/* harmony default export */ var RightsStatement = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ 226:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _plugins_europeana_entity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(52);
/* harmony import */ var _plugins_europeana_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
/* harmony import */ var _plugins_europeana_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10);
/* harmony default export */ __webpack_exports__["a"] = ({
methods: {
collectionLinkGen(collection) {
var _collection$id;
const uriMatch = (_collection$id = collection.id) === null || _collection$id === void 0 ? void 0 : _collection$id.match(`^${_plugins_europeana_data__WEBPACK_IMPORTED_MODULE_2__[/* BASE_URL */ "a"]}/([^/]+)/(.+)$`);
if (!uriMatch) {
return null;
}
return this.$path({
name: 'collections-type-all',
params: {
type: Object(_plugins_europeana_entity__WEBPACK_IMPORTED_MODULE_0__[/* getEntityTypeHumanReadable */ "e"])(uriMatch[1]),
pathMatch: Object(_plugins_europeana_utils__WEBPACK_IMPORTED_MODULE_1__[/* getLabelledSlug */ "f"])(collection.id, collection.prefLabel.en)
}
});
}
}
});
/***/ }),
/***/ 232:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/CiteAttribution.vue?vue&type=template&id=fddd3be8&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.extended)?_c('cite',[(_vm.name)?_vm._ssrNode("<p>","</p>",[_vm._ssrNode(_vm._ssrEscape(_vm._s(_vm.$t('attribution.title'))+"\n ")),(_vm.url)?_c('SmartLink',{attrs:{"destination":_vm.url}},[_vm._v("\n "+_vm._s(_vm.name)+"\n ")]):_c('span',[_vm._v("\n "+_vm._s(_vm.name)+"\n ")])],2):_vm._e(),_vm._ssrNode(" "),(_vm.creator)?_vm._ssrNode("<p>","</p>",[_vm._ssrNode(_vm._ssrEscape(_vm._s(_vm.$t('attribution.creator'))+"\n ")),(_vm.url)?_c('SmartLink',{attrs:{"destination":_vm.url}},[_vm._v("\n "+_vm._s(_vm.creator)+"\n ")]):_c('span',[_vm._v("\n "+_vm._s(_vm.creator)+"\n ")])],2):_vm._e(),_vm._ssrNode(" "),(_vm.provider)?_vm._ssrNode("<p>","</p>",[_vm._ssrNode(_vm._ssrEscape(_vm._s(_vm.$t('attribution.institution'))+"\n ")),(_vm.url)?_c('SmartLink',{attrs:{"destination":_vm.url}},[_vm._v("\n "+_vm._s(_vm.provider)+"\n ")]):_c('span',[_vm._v("\n "+_vm._s(_vm.provider)+"\n ")])],2):_vm._e(),_vm._ssrNode(" "),_vm._ssrNode("<p>","</p>",[_c('SmartLink',{attrs:{"destination":_vm.rightsStatement,"link-class":"attribution"}},[(_vm.rightsStatement)?_c('RightsStatement',{attrs:{"rights-statement-url":_vm.rightsStatement}}):_vm._e()],1)],1)],2):_c('cite',[_c('SmartLink',{attrs:{"destination":_vm.url,"link-class":"attribution"}},[_vm._v("\n "+_vm._s(_vm.linkText)+"\n "),(_vm.rightsStatement)?_c('RightsStatement',{attrs:{"rights-statement-url":_vm.rightsStatement}}):_vm._e()],1)],1)}
var staticRenderFns = []
// CONCATENATED MODULE: ./src/components/generic/CiteAttribution.vue?vue&type=template&id=fddd3be8&
// EXTERNAL MODULE: ./src/components/generic/RightsStatement.vue + 4 modules
var RightsStatement = __webpack_require__(225);
// 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/CiteAttribution.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/**
* Attribution for a cited resource
*/
/* harmony default export */ var CiteAttributionvue_type_script_lang_js_ = ({
name: 'CiteAttribution',
components: {
RightsStatement: RightsStatement["default"],
SmartLink: SmartLink["a" /* default */]
},
props: {
/**
* Name of the cited resource
*/
name: {
type: String,
default: null
},
/**
* Creator of the cited resource
*/
creator: {
type: String,
default: null
},
/**
* Provider of the cited resource
*/
provider: {
type: String,
default: null
},
/**
* Rights statement URL of the cited resource
*/
rightsStatement: {
type: String,
required: true
},
/**
* URL of the cited resource
*/
url: {
type: String,
default: null
},
/**
* If `true`, use the extended format
*/
extended: {
type: Boolean,
default: false
}
},
computed: {
linkText() {
return [this.name, this.creator, this.provider].filter(Boolean).join(', ');
}
}
});
// CONCATENATED MODULE: ./src/components/generic/CiteAttribution.vue?vue&type=script&lang=js&
/* harmony default export */ var generic_CiteAttributionvue_type_script_lang_js_ = (CiteAttributionvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(3);
// EXTERNAL MODULE: ./src/components/generic/CiteAttribution.vue?vue&type=custom&index=0&blockType=docs&lang=md
var CiteAttributionvue_type_custom_index_0_blockType_docs_lang_md = __webpack_require__(233);
var CiteAttributionvue_type_custom_index_0_blockType_docs_lang_md_default = /*#__PURE__*/__webpack_require__.n(CiteAttributionvue_type_custom_index_0_blockType_docs_lang_md);
// CONCATENATED MODULE: ./src/components/generic/CiteAttribution.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
generic_CiteAttributionvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
"3da4c0f2"
)
/* custom blocks */
if (typeof CiteAttributionvue_type_custom_index_0_blockType_docs_lang_md_default.a === 'function') CiteAttributionvue_type_custom_index_0_blockType_docs_lang_md_default()(component)
/* harmony default export */ var CiteAttribution = __webpack_exports__["a"] = (component.exports);
/***/ }),
/***/ 233:
/***/ (function(module, exports) {
/***/ }),
/***/ 235:
/***/ (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__(256);
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("15a7eb04", content, true, context)
};
/***/ }),
/***/ 236:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "img/en-Funded by the EU_NEG.c525aa1.svg";
/***/ }),
/***/ 237:
/***/ (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__(284);
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("8f389d24", content, true, context)
};
/***/ }),
/***/ 238:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(URL) {/* unused harmony export default */
/* harmony import */ var ssr_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(199);
function History(_ref) {
let {
swiper,
extendParams,
on
} = _ref;
extendParams({
history: {
enabled: false,
root: '',
replaceState: false,
key: 'slides',
keepQuery: false
}
});
let initialized = false;
let paths = {};
const slugify = text => {
return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, '');
};
const getPathValues = urlOverride => {
const window = Object(ssr_window__WEBPACK_IMPORTED_MODULE_0__[/* getWindow */ "b"])();
let location;
if (urlOverride) {
location = new URL(urlOverride);
} else {
location = window.location;
}
const pathArray = location.pathname.slice(1).split('/').filter(part => part !== '');
const total = pathArray.length;
const key = pathArray[total - 2];
const value = pathArray[total - 1];
return {
key,
value
};
};
const setHistory = (key, index) => {
const window = Object(ssr_window__WEBPACK_IMPORTED_MODULE_0__[/* getWindow */ "b"])();
if (!initialized || !swiper.params.history.enabled) return;
let location;
if (swiper.params.url) {
location = new URL(swiper.params.url);
} else {
location = window.location;
}
const slide = swiper.slides.eq(index);
let value = slugify(slide.attr('data-history'));
if (swiper.params.history.root.length > 0) {
let root = swiper.params.history.root;
if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1);
value = `${root}/${key}/${value}`;
} else if (!location.pathname.includes(key)) {
value = `${key}/${value}`;
}
if (swiper.params.history.keepQuery) {
value += location.search;
}
const currentState = window.history.state;
if (currentState && currentState.value === value) {
return;
}
if (swiper.params.history.replaceState) {
window.history.replaceState({
value
}, null, value);
} else {
window.history.pushState({
value
}, null, value);
}
};
const scrollToSlide = (speed, value, runCallbacks) => {
if (value) {
for (let i = 0, length = swiper.slides.length; i < length; i += 1) {
const slide = swiper.slides.eq(i);
const slideHistory = slugify(slide.attr('data-history'));
if (slideHistory === value && !slide.hasClass(swiper.params.slideDuplicateClass)) {
const index = slide.index();
swiper.slideTo(index, speed, runCallbacks);
}
}
} else {
swiper.slideTo(0, speed, runCallbacks);
}
};
const setHistoryPopState = () => {
paths = getPathValues(swiper.params.url);
scrollToSlide(swiper.params.speed, paths.value, false);
};
const init = () => {
const window = Object(ssr_window__WEBPACK_IMPORTED_MODULE_0__[/* getWindow */ "b"])();
if (!swiper.params.history) return;
if (!window.history || !window.history.pushState) {
swiper.params.history.enabled = false;
swiper.params.hashNavigation.enabled = true;
return;
}
initialized = true;
paths = getPathValues(swiper.params.url);
if (!paths.key && !paths.value) return;
scrollToSlide(0, paths.value, swiper.params.runCallbacksOnInit);
if (!swiper.params.history.replaceState) {
window.addEventListener('popstate', setHistoryPopState);
}
};
const destroy = () => {
const window = Object(ssr_window__WEBPACK_IMPORTED_MODULE_0__[/* getWindow */ "b"])();
if (!swiper.params.history.replaceState) {
window.removeEventListener('popstate', setHistoryPopState);
}
};
on('init', () => {
if (swiper.params.history.enabled) {
init();
}
});
on('destroy', () => {
if (swiper.params.history.enabled) {
destroy();
}
});
on('transitionEnd _freeModeNoMomentumRelease', () => {
if (initialized) {
setHistory(swiper.params.history.key, swiper.activeIndex);
}
});
on('slideChange', () => {
if (initialized && swiper.params.cssMode) {
setHistory(swiper.params.history.key, swiper.activeIndex);
}
});
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(9)["URL"]))
/***/ }),
/***/ 249:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, "f", function() { return /* reexport */ core; });
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ Keyboard; });
__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ Navigation; });
__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ Pagination; });
__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ Lazy; });
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ EffectCoverflow; });
// UNUSED EXPORTS: Swiper, Virtual, Mousewheel, Scrollbar, Parallax, Zoom, Controller, A11y, History, HashNavigation, Autoplay, Thumbs, FreeMode, Grid, Manipulation, EffectFade, EffectCube, EffectFlip, EffectCreative, EffectCards
// EXTERNAL MODULE: ./node_modules/ssr-window/ssr-window.esm.js
var ssr_window_esm = __webpack_require__(199);
// CONCATENATED MODULE: ./node_modules/dom7/dom7.esm.js
/**
* Dom7 4.0.4
* Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API
* https://framework7.io/docs/dom7.html
*
* Copyright 2022, Vladimir Kharlampidi
*
* Licensed under MIT
*
* Released on: January 11, 2022
*/
/* eslint-disable no-proto */
function makeReactive(obj) {
const proto = obj.__proto__;
Object.defineProperty(obj, '__proto__', {
get() {
return proto;
},
set(value) {
proto.__proto__ = value;
}
});
}
class Dom7 extends Array {
constructor(items) {
if (typeof items === 'number') {
super(items);
} else {
super(...(items || []));
makeReactive(this);
}
}
}
function arrayFlat(arr = []) {
const res = [];
arr.forEach(el => {
if (Array.isArray(el)) {
res.push(...arrayFlat(el));
} else {
res.push(el);
}
});
return res;
}
function arrayFilter(arr, callback) {
return Array.prototype.filter.call(arr, callback);
}
function arrayUnique(arr) {
const uniqueArray = [];
for (let i = 0; i < arr.length; i += 1) {
if (uniqueArray.indexOf(arr[i]) === -1) uniqueArray.push(arr[i]);
}
return uniqueArray;
}
function toCamelCase(string) {
return string.toLowerCase().replace(/-(.)/g, (match, group) => group.toUpperCase());
} // eslint-disable-next-line
function qsa(selector, context) {
if (typeof selector !== 'string') {
return [selector];
}
const a = [];
const res = context.querySelectorAll(selector);
for (let i = 0; i < res.length; i += 1) {
a.push(res[i]);
}
return a;
}
function $(selector, context) {
const window = Object(ssr_window_esm["b" /* getWindow */])();
const document = Object(ssr_window_esm["a" /* getDocument */])();
let arr = [];
if (!context && selector instanceof Dom7) {
return selector;
}
if (!selector) {
return new Dom7(arr);
}
if (typeof selector === 'string') {
const html = selector.trim();
if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) {
let toCreate = 'div';
if (html.indexOf('<li') === 0) toCreate = 'ul';
if (html.indexOf('<tr') === 0) toCreate = 'tbody';
if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) toCreate = 'tr';
if (html.indexOf('<tbody') === 0) toCreate = 'table';
if (html.indexOf('<option') === 0) toCreate = 'select';
const tempParent = document.createElement(toCreate);
tempParent.innerHTML = html;
for (let i = 0; i < tempParent.childNodes.length; i += 1) {
arr.push(tempParent.childNodes[i]);
}
} else {
arr = qsa(selector.trim(), context || document);
} // arr = qsa(selector, document);
} else if (selector.nodeType || selector === window || selector === document) {
arr.push(selector);
} else if (Array.isArray(selector)) {
if (selector instanceof Dom7) return selector;
arr = selector;
}
return new Dom7(arrayUnique(arr));
}
$.fn = Dom7.prototype; // eslint-disable-next-line
function addClass(...classes) {
const classNames = arrayFlat(classes.map(c => c.split(' ')));
this.forEach(el => {
el.classList.add(...classNames);
});
return this;
}
function removeClass(...classes) {
const classNames = arrayFlat(classes.map(c => c.split(' ')));
this.forEach(el => {
el.classList.remove(...classNames);
});
return this;
}
function toggleClass(...classes) {
const classNames = arrayFlat(classes.map(c => c.split(' ')));
this.forEach(el => {
classNames.forEach(className => {
el.classList.toggle(className);
});
});
}
function hasClass(...classes) {
const classNames = arrayFlat(classes.map(c => c.split(' ')));
return arrayFilter(this, el => {
return classNames.filter(className => el.classList.contains(className)).length > 0;
}).length > 0;
}
function attr(attrs, value) {
if (arguments.length === 1 && typeof attrs === 'string') {
// Get attr
if (this[0]) return this[0].getAttribute(attrs);
return undefined;
} // Set attrs
for (let i = 0; i < this.length; i += 1) {
if (arguments.length === 2) {
// String
this[i].setAttribute(attrs, value);
} else {
// Object
for (const attrName in attrs) {
this[i][attrName] = attrs[attrName];
this[i].setAttribute(attrName, attrs[attrName]);
}
}
}
return this;
}
function removeAttr(attr) {
for (let i = 0; i < this.length; i += 1) {
this[i].removeAttribute(attr);
}
return this;
}
function prop(props, value) {
if (arguments.length === 1 && typeof props === 'string') {
// Get prop
if (this[0]) return this[0][props];
} else {
// Set props
for (let i = 0; i < this.length; i += 1) {
if (arguments.length === 2) {
// String
this[i][props] = value;
} else {
// Object
for (const propName in props) {
this[i][propName] = props[propName];
}
}
}
return this;
}
return this;
}
function dom7_esm_data(key, value) {
let el;
if (typeof value === 'undefined') {
el = this[0];
if (!el) return undefined; // Get value
if (el.dom7ElementDataStorage && key in el.dom7ElementDataStorage) {
return el.dom7ElementDataStorage[key];
}
const dataKey = el.getAttribute(`data-${key}`);
if (dataKey) {
return dataKey;
}
return undefined;
} // Set value
for (let i = 0; i < this.length; i += 1) {
el = this[i];
if (!el.dom7ElementDataStorage) el.dom7ElementDataStorage = {};
el.dom7ElementDataStorage[key] = value;
}
return this;
}
function removeData(key) {
for (let i = 0; i < this.length; i += 1) {
const el = this[i];
if (el.dom7ElementDataStorage && el.dom7ElementDataStorage[key]) {
el.dom7ElementDataStorage[key] = null;
delete el.dom7ElementDataStorage[key];
}
}
}
function dataset() {
const el = this[0];
if (!el) return undefined;
const dataset = {}; // eslint-disable-line
if (el.dataset) {
for (const dataKey in el.dataset) {
dataset[dataKey] = el.dataset[dataKey];
}
} else {
for (let i = 0; i < el.attributes.length; i += 1) {
const attr = el.attributes[i];
if (attr.name.indexOf('data-') >= 0) {
dataset[toCamelCase(attr.name.split('data-')[1])] = attr.value;
}
}
}
for (const key in dataset) {
if (dataset[key] === 'false') dataset[key] = false;else if (dataset[key] === 'true') dataset[key] = true;else if (parseFloat(dataset[key]) === dataset[key] * 1) dataset[key] *= 1;
}
return dataset;
}
function val(value) {
if (typeof value === 'undefined') {
// get value
const el = this[0];
if (!el) return undefined;
if (el.multiple && el.nodeName.toLowerCase() === 'select') {
const values = [];
for (let i = 0; i < el.selectedOptions.length; i += 1) {
values.push(el.selectedOptions[i].value);
}
return values;
}
return el.value;
} // set value
for (let i = 0; i < this.length; i += 1) {
const el = this[i];
if (Array.isArray(value) && el.multiple && el.nodeName.toLowerCase() === 'select') {
for (let j = 0; j < el.options.length; j += 1) {
el.options[j].selected = value.indexOf(el.options[j].value) >= 0;
}
} else {
el.value = value;
}
}
return this;
}
function dom7_esm_value(value) {
return this.val(value);
}
function dom7_esm_transform(transform) {
for (let i = 0; i < this.length; i += 1) {
this[i].style.transform = transform;
}
return this;
}
function transition(duration) {
for (let i = 0; i < this.length; i += 1) {
this[i].style.transitionDuration = typeof duration !== 'string' ? `${duration}ms` : duration;
}
return this;
}
function dom7_esm_on(...args) {
let [eventType, targetSelector, listener, capture] = args;
if (typeof args[1] === 'function') {
[eventType, listener, capture] = args;
targetSelector = undefined;
}
if (!capture) capture = false;
function handleLiveEvent(e) {
const target = e.target;
if (!target) return;
const eventData = e.target.dom7EventData || [];
if (eventData.indexOf(e) < 0) {