@everymatrix/blog-article-details 1.99.26 → 1.99.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-f613f8e8.js';
1
+ import { r as registerInstance, h } from './index-39cf8680.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
4
  const TRANSLATIONS = {
@@ -6,36 +6,64 @@ const TRANSLATIONS = {
6
6
  error: 'Error',
7
7
  home: 'Home',
8
8
  blog: 'Blog',
9
+ backToBlog: 'Back to blog',
10
+ moreArticles: 'More articles',
11
+ previousArticle: 'Previous article',
12
+ nextArticle: 'Next article',
9
13
  },
10
14
  ro: {
11
- error: 'Eroare',
12
- home: 'Acasă',
15
+ error: 'Error',
16
+ home: 'Home',
13
17
  blog: 'Blog',
18
+ backToBlog: 'Back to blog',
19
+ moreArticles: 'More articles',
20
+ previousArticle: 'Previous article',
21
+ nextArticle: 'Next article',
14
22
  },
15
23
  fr: {
16
24
  error: 'Error',
17
- home: 'Accueil',
25
+ home: 'Home',
18
26
  blog: 'Blog',
27
+ backToBlog: 'Back to blog',
28
+ moreArticles: 'More articles',
29
+ previousArticle: 'Previous article',
30
+ nextArticle: 'Next article',
19
31
  },
20
32
  ar: {
21
- error: 'خطأ',
22
- home: 'الرئيسية',
23
- blog: 'المدونة',
33
+ error: 'Error',
34
+ home: 'Home',
35
+ blog: 'Blog',
36
+ backToBlog: 'Back to blog',
37
+ moreArticles: 'More articles',
38
+ previousArticle: 'Previous article',
39
+ nextArticle: 'Next article',
24
40
  },
25
41
  hr: {
26
- error: 'Greška',
27
- home: 'Početna',
42
+ error: 'Error',
43
+ home: 'Home',
28
44
  blog: 'Blog',
45
+ backToBlog: 'Back to blog',
46
+ moreArticles: 'More articles',
47
+ previousArticle: 'Previous article',
48
+ nextArticle: 'Next article',
29
49
  },
30
50
  'pt-br': {
31
- error: 'Erro',
32
- home: 'Início',
51
+ error: 'Error',
52
+ home: 'Home',
33
53
  blog: 'Blog',
54
+ backToBlog: 'Back to blog',
55
+ moreArticles: 'More articles',
56
+ previousArticle: 'Previous article',
57
+ nextArticle: 'Next article',
34
58
  },
35
59
  'es-mx': {
36
60
  error: 'Error',
37
- home: 'Inicio',
61
+ home: 'Home',
38
62
  blog: 'Blog',
63
+ backToBlog: 'Back to blog',
64
+ moreArticles: 'More articles',
65
+ previousArticle: 'Previous article',
66
+ nextArticle: 'Next article',
39
67
  }
40
68
  };
41
69
  const translate = (key, customLang) => {
@@ -248,12 +276,14 @@ const getDevicePlatform = () => {
248
276
  return 'mtWeb';
249
277
  };
250
278
 
251
- const blogArticleDetailsCss = ":host {\n display: block;\n}\n\n.breadcrumb {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n max-width: 1300px;\n}\n.breadcrumb a {\n color: inherit;\n}\n\n.DetailsContainer {\n background-color: #07072A;\n color: #fff;\n display: flex;\n flex-direction: column;\n}\n.DetailsContainer .BlogBanner div {\n height: 400px;\n}\n.DetailsContainer .DetailsHeadWrapper {\n position: relative;\n}\n.DetailsContainer .DetailsBodyWrapper {\n padding: 30px;\n}\n.DetailsContainer .BlogDate {\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n background-color: #0D0D4D;\n z-index: 1;\n text-wrap: nowrap;\n position: absolute;\n bottom: 0;\n left: 30px;\n}\n.DetailsContainer .BlogTitle {\n font-size: 24px;\n}\n.DetailsContainer .BlogContent {\n font-size: 14px;\n}\n.DetailsContainer .BlogContent p:last-child {\n margin-bottom: 0;\n}\n\n@container (max-width: 475px) {\n .DetailsContainer {\n font-size: 12px;\n }\n}";
279
+ const blogArticleDetailsCss = ":host {\n display: block;\n}\n\n.breadcrumb {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n max-width: 1300px;\n margin-bottom: 30px;\n}\n.breadcrumb a {\n color: inherit;\n}\n\n.DetailsContainer {\n background-color: #07072A;\n position: relative;\n color: #fff;\n display: flex;\n flex-direction: column;\n}\n.DetailsContainer .BlogBanner img {\n display: block;\n width: 100%;\n height: 400px;\n object-fit: cover;\n}\n.DetailsContainer .DetailsHeadWrapper {\n position: relative;\n}\n.DetailsContainer .DetailsBodyWrapper {\n padding: 30px;\n}\n.DetailsContainer .BlogDate {\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n background-color: #0D0D4D;\n z-index: 1;\n text-wrap: nowrap;\n position: absolute;\n bottom: 0;\n left: 30px;\n}\n.DetailsContainer .BlogTitle {\n font-size: 24px;\n}\n.DetailsContainer .BlogCategoryPills {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n.DetailsContainer .BlogCategoryLink {\n position: relative;\n z-index: 3;\n padding: 4px 12px;\n border: 1px solid currentColor;\n border-radius: 999px;\n color: inherit;\n font-size: 12px;\n text-decoration: none;\n}\n.DetailsContainer .BlogContent {\n font-size: 14px;\n}\n.DetailsContainer .BlogContent p:last-child {\n margin-bottom: 0;\n}\n\n.BackButton {\n position: absolute;\n top: 30px;\n left: 30px;\n z-index: 2;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n box-sizing: border-box;\n min-width: 100px;\n height: 32px;\n padding: 0 12px;\n border: none;\n border-radius: 5px;\n background: var(--emw--color-primary, #524e52);\n color: var(--emw--color-typography-contrast, #fff);\n font: inherit;\n text-decoration: none;\n text-align: center;\n white-space: nowrap;\n cursor: pointer;\n transition: all 0.1s linear;\n}\n\n.DetailsContainer:not(:has(.BlogBanner img, .BlogBanner video)) .BackButton {\n position: static;\n align-self: flex-start;\n margin: 30px 30px 16px;\n}\n.DetailsContainer:not(:has(.BlogBanner img, .BlogBanner video)) .BlogDate {\n position: static;\n display: block;\n margin-left: 30px;\n}\n.DetailsContainer:not(:has(.BlogBanner img, .BlogBanner video)) .BlogBanner {\n display: none;\n}\n\n.AdjacentPosts {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n gap: 20px;\n padding: 30px;\n}\n.AdjacentPosts a {\n flex: 1 1 250px;\n}\n\n.AdjacentPosts a {\n color: var(--emw--color-primary, #fff);\n font: inherit;\n text-decoration: underline;\n}\n\n.BackButton:focus-visible,\n.AdjacentPosts a:focus-visible {\n outline: 2px solid var(--emw--color-primary, #fff);\n outline-offset: 3px;\n}\n\n@container (max-width: 475px) {\n .DetailsContainer {\n font-size: 12px;\n }\n}";
252
280
  const BlogArticleDetailsStyle0 = blogArticleDetailsCss;
253
281
 
254
282
  const BlogArticleDetails = class {
255
283
  constructor(hostRef) {
256
284
  registerInstance(this, hostRef);
285
+ this.articleRequest = 0;
286
+ this.neighboursRequest = 0;
257
287
  this.renderContentConditionally = (content) => {
258
288
  if (!content)
259
289
  return null;
@@ -263,21 +293,6 @@ const BlogArticleDetails = class {
263
293
  }
264
294
  return null;
265
295
  };
266
- this.setImage = (image) => {
267
- let source = '';
268
- switch (this.device) {
269
- case 'mobile':
270
- source = image.sources[0].pictureSource;
271
- break;
272
- case 'tablet':
273
- source = image.sources[1].pictureSource;
274
- break;
275
- case 'desktop':
276
- source = image.sources[2].pictureSource;
277
- break;
278
- }
279
- return source;
280
- };
281
296
  this.cmsEndpoint = undefined;
282
297
  this.language = 'en';
283
298
  this.userRoles = 'everyone';
@@ -289,7 +304,10 @@ const BlogArticleDetails = class {
289
304
  this.showImage = true;
290
305
  this.showTitle = true;
291
306
  this.showBreadcrumb = false;
307
+ this.hideCategory = '';
292
308
  this.showContent = true;
309
+ this.showMoreArticles = false;
310
+ this.showBackButton = false;
293
311
  this.postId = undefined;
294
312
  this.postSlug = undefined;
295
313
  this.postCustomPath = undefined;
@@ -298,15 +316,30 @@ const BlogArticleDetails = class {
298
316
  this.isLoading = true;
299
317
  this.bannerMatrixReady = false;
300
318
  this.device = 'mobile';
319
+ this.categories = [];
320
+ this.neighbours = {};
301
321
  }
302
322
  // Rerender when bannermatrix has finished loaded. Issue when bannermatrix passed as content from CMS.
303
323
  handleBannerReady() {
304
324
  this.bannerMatrixReady = true;
305
325
  }
306
326
  watchEndpoint(newValue, oldValue) {
307
- if (newValue && newValue != oldValue && this.cmsEndpoint && this.language && (this.postCustomPath || this.postSlug || this.postId)) {
327
+ if (newValue === oldValue)
328
+ return;
329
+ if (this.cmsEndpoint && this.language && (this.postCustomPath || this.postSlug || this.postId)) {
308
330
  this.getBlogArticleDetails();
309
331
  }
332
+ else {
333
+ this.articleRequest++;
334
+ this.categories = [];
335
+ this.neighbours = {};
336
+ }
337
+ }
338
+ handleMoreArticlesChange() {
339
+ this.neighboursRequest++;
340
+ this.neighbours = {};
341
+ if (this.showMoreArticles && !this.isLoading && this.blogData)
342
+ this.fetchMoreArticles(this.articleRequest);
310
343
  }
311
344
  handleClientStylingChange(newValue, oldValue) {
312
345
  if (newValue !== oldValue) {
@@ -329,6 +362,11 @@ const BlogArticleDetails = class {
329
362
  this.hasErrors = true;
330
363
  throw new Error('postId, postSlug or postCustomPath parameter has to be provided!');
331
364
  }
365
+ const request = ++this.articleRequest;
366
+ this.categories = [];
367
+ this.neighbours = {};
368
+ this.neighboursRequest++;
369
+ this.hasErrors = false;
332
370
  this.isLoading = true;
333
371
  let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts${this.postCustomPath ? '' : '/' + (this.postSlug || this.postId)}`);
334
372
  url.searchParams.append('env', this.cmsEnv);
@@ -337,15 +375,17 @@ const BlogArticleDetails = class {
337
375
  if (this.postCustomPath) {
338
376
  url.searchParams.append('customURL', this.postCustomPath);
339
377
  }
378
+ this.fetchCategories(request);
340
379
  fetch(url.href)
341
380
  .then((res) => {
342
381
  if (res.status >= 300) {
343
- this.hasErrors = true;
344
382
  throw new Error('There was an error while fetching the data');
345
383
  }
346
384
  return res.json();
347
385
  })
348
386
  .then((blogContent) => {
387
+ if (request !== this.articleRequest)
388
+ return;
349
389
  if (blogContent.count >= 1 && this.postCustomPath) {
350
390
  let firstBlogPublishDate = new Date(blogContent.items[0].publishingDate);
351
391
  let indexOfLatestPublished = 0;
@@ -361,13 +401,80 @@ const BlogArticleDetails = class {
361
401
  else {
362
402
  this.blogData = blogContent;
363
403
  }
364
- this.isLoading = false;
404
+ if (this.showMoreArticles)
405
+ this.fetchMoreArticles(request);
365
406
  })
366
407
  .catch((err) => {
408
+ if (request !== this.articleRequest)
409
+ return;
367
410
  this.hasErrors = true;
368
411
  console.log('Error', err);
369
412
  })
370
- .finally(() => this.isLoading = false);
413
+ .finally(() => {
414
+ if (request === this.articleRequest)
415
+ this.isLoading = false;
416
+ });
417
+ }
418
+ async fetchMoreArticles(articleRequest) {
419
+ var _a, _b, _c, _d, _e;
420
+ if (!this.cmsEndpoint || !this.language || !this.blogData || !this.showMoreArticles)
421
+ return;
422
+ const request = ++this.neighboursRequest;
423
+ const currentId = (_a = this.blogData) === null || _a === void 0 ? void 0 : _a.postID;
424
+ const currentPath = ((_b = this.blogData) === null || _b === void 0 ? void 0 : _b.customPath) || ((_c = this.blogData) === null || _c === void 0 ? void 0 : _c.slug) || this.postCustomPath || this.postSlug;
425
+ const posts = [];
426
+ const url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts`);
427
+ url.searchParams.set('per_page', '20');
428
+ url.searchParams.set('env', this.cmsEnv);
429
+ url.searchParams.set('userRoles', this.userRoles);
430
+ url.searchParams.set('device', getDevicePlatform());
431
+ try {
432
+ for (let page = 1; this.showMoreArticles && request === this.neighboursRequest && articleRequest === this.articleRequest; page++) {
433
+ url.searchParams.set('page', String(page));
434
+ const response = await fetch(url.href);
435
+ if (!response.ok)
436
+ throw new Error('Failed to fetch adjacent articles');
437
+ const data = await response.json();
438
+ if (!this.showMoreArticles || request !== this.neighboursRequest || articleRequest !== this.articleRequest)
439
+ return;
440
+ if (!Array.isArray(data === null || data === void 0 ? void 0 : data.items))
441
+ return;
442
+ posts.push(...data.items.filter(post => typeof ((post === null || post === void 0 ? void 0 : post.customPath) || (post === null || post === void 0 ? void 0 : post.slug)) === 'string' && (post.customPath || post.slug)));
443
+ const index = posts.findIndex(post => (currentId != null && post.postID === currentId) || (currentPath && (post.customPath || post.slug) === currentPath));
444
+ if (index >= 0 && (index < posts.length - 1 || !((_d = data.pages) === null || _d === void 0 ? void 0 : _d.next))) {
445
+ this.neighbours = { previous: posts[index + 1], next: posts[index - 1] };
446
+ return;
447
+ }
448
+ if (!((_e = data.pages) === null || _e === void 0 ? void 0 : _e.next))
449
+ return;
450
+ }
451
+ }
452
+ catch (error) {
453
+ console.error('Error fetching adjacent articles', error);
454
+ }
455
+ }
456
+ async fetchCategories(request) {
457
+ try {
458
+ const response = await fetch(`${this.cmsEndpoint}/${this.language}/blog-posts/category`);
459
+ if (!response.ok)
460
+ throw new Error('Failed to fetch categories');
461
+ const categories = await response.json();
462
+ if (request === this.articleRequest) {
463
+ const hiddenCategories = this.hideCategory
464
+ .split(',')
465
+ .map(value => value.trim().toLowerCase())
466
+ .filter(Boolean);
467
+ const visibleCategories = Array.isArray(categories)
468
+ ? categories.filter(category => typeof (category === null || category === void 0 ? void 0 : category.name) === 'string' && category.name && typeof category.slug === 'string' && category.slug
469
+ && !hiddenCategories.includes(category.name.toLowerCase()))
470
+ : [];
471
+ this.categories = visibleCategories;
472
+ }
473
+ }
474
+ catch (_a) {
475
+ if (request === this.articleRequest)
476
+ this.categories = [];
477
+ }
371
478
  }
372
479
  handleClientStyling() {
373
480
  if (window.emMessageBus !== undefined) {
@@ -384,6 +491,8 @@ const BlogArticleDetails = class {
384
491
  this.handleClientStyling();
385
492
  }
386
493
  disconnectedCallback() {
494
+ this.articleRequest++;
495
+ this.neighboursRequest++;
387
496
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
388
497
  }
389
498
  detectAndAlertDeviceType() {
@@ -400,17 +509,32 @@ const BlogArticleDetails = class {
400
509
  }
401
510
  formatDate(dateString) {
402
511
  const date = this.parseDate(dateString);
403
- return new Intl.DateTimeFormat(this.intlDateTimeFormat || 'en-GB').format(date);
512
+ return new Intl.DateTimeFormat(this.intlDateTimeFormat || 'en-GB', { day: 'numeric', month: 'short', year: 'numeric' }).format(date);
513
+ }
514
+ setImage(image) {
515
+ var _a, _b;
516
+ const sourceIndex = this.device === 'mobile' ? 0 : this.device === 'tablet' ? 1 : 2;
517
+ return (_b = (_a = image === null || image === void 0 ? void 0 : image.sources) === null || _a === void 0 ? void 0 : _a[sourceIndex]) === null || _b === void 0 ? void 0 : _b.pictureSource;
404
518
  }
405
519
  render() {
406
- var _a, _b, _c, _d, _e, _f;
520
+ var _a, _b, _c, _d, _e, _f, _g;
407
521
  if (this.hasErrors) {
408
522
  return (h("div", { class: "BlogArticleDetails" }, h("div", { class: "Title" }, translate('error', this.language))));
409
523
  }
410
- const homeUrl = !this.isLoading && this.showBreadcrumb ? `/${encodeURIComponent(this.language)}` : '';
411
- return (h("div", { ref: el => this.stylingContainer = el }, !this.isLoading && (h("div", { class: "DetailsContainer" }, h("div", { class: "DetailsHeadWrapper" }, this.showPublishingDate && this.blogData.publishingDate &&
412
- h("div", { class: "BlogDate" }, this.formatDate((_a = this.blogData) === null || _a === void 0 ? void 0 : _a.publishingDate)), this.showImage && (h("div", { class: `BlogBanner ${this.device}` }, ((_b = this.blogData.image) === null || _b === void 0 ? void 0 : _b.src) ? (h("div", { style: { background: `url(${this.setImage(this.blogData.image)}) no-repeat center center / cover` } })) : (((_c = this.blogData.video) === null || _c === void 0 ? void 0 : _c.sources[this.device]) ? (h("video", { src: this.blogData.video.sources[this.device], controls: true })) : (h("h1", { style: { color: "white" } }, "No Image")))))), h("div", { class: "DetailsBodyWrapper" }, this.showTitle &&
413
- h("div", { class: "BlogTitle" }, (_d = this.blogData) === null || _d === void 0 ? void 0 : _d.title), this.showBreadcrumb && (h("nav", { class: "breadcrumb", "aria-label": "Breadcrumb" }, h("a", { href: homeUrl }, translate('home', this.language)), h("span", { "aria-hidden": "true" }, "\u203A"), h("a", { href: `${homeUrl}/blog` }, translate('blog', this.language)), h("span", { "aria-hidden": "true" }, "\u203A"), h("span", { "aria-current": "page" }, (_e = this.blogData) === null || _e === void 0 ? void 0 : _e.title))), this.showContent && this.renderContentConditionally((_f = this.blogData) === null || _f === void 0 ? void 0 : _f.content))))));
524
+ const homeUrl = `/${encodeURIComponent(this.language)}`;
525
+ const categories = !this.isLoading && Array.isArray((_a = this.blogData) === null || _a === void 0 ? void 0 : _a.blogCategory)
526
+ ? this.blogData.blogCategory.map(slug => this.categories.find(category => category.slug === slug)).filter(Boolean)
527
+ : [];
528
+ const primaryCategory = categories[0];
529
+ const image = (_b = this.blogData) === null || _b === void 0 ? void 0 : _b.image;
530
+ const imageSrc = this.setImage(image);
531
+ const { previous, next } = this.neighbours;
532
+ return (h("div", { ref: el => this.stylingContainer = el }, !this.isLoading && (h("div", { class: "DetailsContainer" }, this.showBackButton && (h("a", { class: "BackButton", href: `${homeUrl}/blog` }, "\u2190 ", translate('backToBlog', this.language))), h("div", { class: "DetailsHeadWrapper" }, this.showPublishingDate && this.blogData.publishingDate &&
533
+ h("time", { class: "BlogDate", dateTime: this.blogData.publishingDate }, this.formatDate(this.blogData.publishingDate)), this.showImage && (h("div", { class: `BlogBanner ${this.device}` }, imageSrc ? (h("img", { src: imageSrc, alt: (image === null || image === void 0 ? void 0 : image.alt) || '' })) : (((_d = (_c = this.blogData.video) === null || _c === void 0 ? void 0 : _c.sources) === null || _d === void 0 ? void 0 : _d[this.device]) ? (h("video", { src: this.blogData.video.sources[this.device], controls: true })) : (null))))), h("div", { class: "DetailsBodyWrapper" }, this.showTitle &&
534
+ h("div", { class: "BlogTitle" }, (_e = this.blogData) === null || _e === void 0 ? void 0 : _e.title), this.showBreadcrumb && (h("nav", { class: "breadcrumb", "aria-label": "Breadcrumb" }, h("a", { href: homeUrl }, translate('home', this.language)), h("span", { "aria-hidden": "true" }, "\u203A"), h("a", { href: `${homeUrl}/blog` }, translate('blog', this.language)), h("span", { "aria-hidden": "true" }, "\u203A"), primaryCategory && [
535
+ h("a", { href: `${homeUrl}/blog/category/${encodeURIComponent(primaryCategory.slug)}` }, primaryCategory.name),
536
+ h("span", { "aria-hidden": "true" }, "\u203A"),
537
+ ], h("span", { "aria-current": "page" }, (_f = this.blogData) === null || _f === void 0 ? void 0 : _f.title))), categories.length > 0 && (h("div", { class: "BlogCategoryPills" }, categories.map(category => (h("a", { class: "BlogCategoryLink", href: `${homeUrl}/blog/category/${encodeURIComponent(category.slug)}` }, category.name))))), this.showContent && this.renderContentConditionally((_g = this.blogData) === null || _g === void 0 ? void 0 : _g.content)), this.showMoreArticles && (previous || next) && (h("nav", { class: "AdjacentPosts", "aria-label": translate('moreArticles', this.language) }, previous && h("a", { href: `${homeUrl}/blog/${encodeURIComponent(previous.customPath || previous.slug || '')}`, rel: "prev" }, "\u2190 ", translate('previousArticle', this.language), ": ", previous.title || previous.customPath || previous.slug), next && h("a", { href: `${homeUrl}/blog/${encodeURIComponent(next.customPath || next.slug || '')}`, rel: "next" }, translate('nextArticle', this.language), ": ", next.title || next.customPath || next.slug, " \u2192")))))));
414
538
  }
415
539
  static get watchers() { return {
416
540
  "postId": ["watchEndpoint"],
@@ -418,6 +542,9 @@ const BlogArticleDetails = class {
418
542
  "postCustomPath": ["watchEndpoint"],
419
543
  "cmsEndpoint": ["watchEndpoint"],
420
544
  "language": ["watchEndpoint"],
545
+ "cmsEnv": ["watchEndpoint"],
546
+ "userRoles": ["watchEndpoint"],
547
+ "showMoreArticles": ["handleMoreArticlesChange"],
421
548
  "clientStyling": ["handleClientStylingChange"],
422
549
  "clientStylingUrl": ["handleClientStylingChangeURL"]
423
550
  }; }
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-f613f8e8.js';
2
- export { s as setNonce } from './index-f613f8e8.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-39cf8680.js';
2
+ export { s as setNonce } from './index-39cf8680.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["blog-article-details",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showBreadcrumb":[516,"show-breadcrumb"],"showContent":[516,"show-content"],"postId":[513,"post-id"],"postSlug":[513,"post-slug"],"postCustomPath":[513,"post-custom-path"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32]},[[8,"BannerMatrixReady","handleBannerReady"]],{"postId":["watchEndpoint"],"postSlug":["watchEndpoint"],"postCustomPath":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
19
+ return bootstrapLazy([["blog-article-details",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showBreadcrumb":[516,"show-breadcrumb"],"hideCategory":[513,"hide-category"],"showContent":[516,"show-content"],"showMoreArticles":[516,"show-more-articles"],"showBackButton":[516,"show-back-button"],"postId":[513,"post-id"],"postSlug":[513,"post-slug"],"postCustomPath":[513,"post-custom-path"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32],"categories":[32],"neighbours":[32]},[[8,"BannerMatrixReady","handleBannerReady"]],{"postId":["watchEndpoint"],"postSlug":["watchEndpoint"],"postCustomPath":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"cmsEnv":["watchEndpoint"],"userRoles":["watchEndpoint"],"showMoreArticles":["handleMoreArticlesChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
20
20
  });
@@ -1,5 +1,5 @@
1
1
  const NAMESPACE = 'blog-article-details';
2
- const BUILD = /* blog-article-details */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: false, vdomListener: false, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
2
+ const BUILD = /* blog-article-details */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: false, vdomListener: false, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
3
3
 
4
4
  /*
5
5
  Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
@@ -370,27 +370,6 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
370
370
  const newClasses = parseClassList(newValue);
371
371
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
372
372
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
373
- } else if (memberName === "style") {
374
- {
375
- for (const prop in oldValue) {
376
- if (!newValue || newValue[prop] == null) {
377
- if (prop.includes("-")) {
378
- elm.style.removeProperty(prop);
379
- } else {
380
- elm.style[prop] = "";
381
- }
382
- }
383
- }
384
- }
385
- for (const prop in newValue) {
386
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
387
- if (prop.includes("-")) {
388
- elm.style.setProperty(prop, newValue[prop]);
389
- } else {
390
- elm.style[prop] = newValue[prop];
391
- }
392
- }
393
- }
394
373
  } else if (memberName === "ref") {
395
374
  if (newValue) {
396
375
  newValue(elm);
@@ -1,11 +1,11 @@
1
- import { b as bootstrapLazy } from './index-f613f8e8.js';
2
- export { s as setNonce } from './index-f613f8e8.js';
1
+ import { b as bootstrapLazy } from './index-39cf8680.js';
2
+ export { s as setNonce } from './index-39cf8680.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["blog-article-details",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showBreadcrumb":[516,"show-breadcrumb"],"showContent":[516,"show-content"],"postId":[513,"post-id"],"postSlug":[513,"post-slug"],"postCustomPath":[513,"post-custom-path"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32]},[[8,"BannerMatrixReady","handleBannerReady"]],{"postId":["watchEndpoint"],"postSlug":["watchEndpoint"],"postCustomPath":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
8
+ return bootstrapLazy([["blog-article-details",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showBreadcrumb":[516,"show-breadcrumb"],"hideCategory":[513,"hide-category"],"showContent":[516,"show-content"],"showMoreArticles":[516,"show-more-articles"],"showBackButton":[516,"show-back-button"],"postId":[513,"post-id"],"postSlug":[513,"post-slug"],"postCustomPath":[513,"post-custom-path"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32],"categories":[32],"neighbours":[32]},[[8,"BannerMatrixReady","handleBannerReady"]],{"postId":["watchEndpoint"],"postSlug":["watchEndpoint"],"postCustomPath":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"cmsEnv":["watchEndpoint"],"userRoles":["watchEndpoint"],"showMoreArticles":["handleMoreArticlesChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -44,10 +44,22 @@ export declare class BlogArticleDetails {
44
44
  * Property used to display the breadcrumb
45
45
  */
46
46
  showBreadcrumb: boolean;
47
+ /**
48
+ * Comma separated list of category names to hide, e.g. 'uncategorized, sports'
49
+ */
50
+ hideCategory: string;
47
51
  /**
48
52
  * Property used to display the description
49
53
  */
50
54
  showContent: boolean;
55
+ /**
56
+ * Display previous and next article links.
57
+ */
58
+ showMoreArticles: boolean;
59
+ /**
60
+ * Display the Back to blog link.
61
+ */
62
+ showBackButton: boolean;
51
63
  /**
52
64
  * Showing post ID parameter
53
65
  */
@@ -68,15 +80,22 @@ export declare class BlogArticleDetails {
68
80
  private isLoading;
69
81
  bannerMatrixReady: boolean;
70
82
  device: Device;
83
+ private categories;
84
+ private neighbours;
71
85
  handleBannerReady(): void;
72
86
  watchEndpoint(newValue: string, oldValue: string): void;
87
+ handleMoreArticlesChange(): void;
73
88
  handleClientStylingChange(newValue: string, oldValue: string): void;
74
89
  handleClientStylingChangeURL(newValue: string, oldValue: string): void;
75
90
  private stylingContainer?;
76
91
  private blogData;
77
92
  private stylingSubscription;
93
+ private articleRequest;
94
+ private neighboursRequest;
78
95
  connectedCallback(): void;
79
96
  getBlogArticleDetails(): void;
97
+ private fetchMoreArticles;
98
+ private fetchCategories;
80
99
  handleClientStyling(): void;
81
100
  componentDidLoad(): void;
82
101
  disconnectedCallback(): void;
@@ -84,6 +103,6 @@ export declare class BlogArticleDetails {
84
103
  parseDate(dateString: string): Date;
85
104
  formatDate(dateString: string): string;
86
105
  renderContentConditionally: (content: string) => HTMLElement | null;
87
- setImage: (image: any) => string;
106
+ private setImage;
88
107
  render(): void;
89
108
  }
@@ -23,6 +23,10 @@ export namespace Components {
23
23
  * CMS Endpoint stage
24
24
  */
25
25
  "cmsEnv": string;
26
+ /**
27
+ * Comma separated list of category names to hide, e.g. 'uncategorized, sports'
28
+ */
29
+ "hideCategory": string;
26
30
  /**
27
31
  * Intl date format
28
32
  */
@@ -47,6 +51,10 @@ export namespace Components {
47
51
  * Slug of post
48
52
  */
49
53
  "postSlug"?: string;
54
+ /**
55
+ * Display the Back to blog link.
56
+ */
57
+ "showBackButton": boolean;
50
58
  /**
51
59
  * Property used to display the breadcrumb
52
60
  */
@@ -59,6 +67,10 @@ export namespace Components {
59
67
  * Property used to display the image
60
68
  */
61
69
  "showImage": boolean;
70
+ /**
71
+ * Display previous and next article links.
72
+ */
73
+ "showMoreArticles": boolean;
62
74
  /**
63
75
  * Property used to display the publishing date
64
76
  */
@@ -102,6 +114,10 @@ declare namespace LocalJSX {
102
114
  * CMS Endpoint stage
103
115
  */
104
116
  "cmsEnv"?: string;
117
+ /**
118
+ * Comma separated list of category names to hide, e.g. 'uncategorized, sports'
119
+ */
120
+ "hideCategory"?: string;
105
121
  /**
106
122
  * Intl date format
107
123
  */
@@ -126,6 +142,10 @@ declare namespace LocalJSX {
126
142
  * Slug of post
127
143
  */
128
144
  "postSlug"?: string;
145
+ /**
146
+ * Display the Back to blog link.
147
+ */
148
+ "showBackButton"?: boolean;
129
149
  /**
130
150
  * Property used to display the breadcrumb
131
151
  */
@@ -138,6 +158,10 @@ declare namespace LocalJSX {
138
158
  * Property used to display the image
139
159
  */
140
160
  "showImage"?: boolean;
161
+ /**
162
+ * Display previous and next article links.
163
+ */
164
+ "showMoreArticles"?: boolean;
141
165
  /**
142
166
  * Property used to display the publishing date
143
167
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/blog-article-details",
3
- "version": "1.99.26",
3
+ "version": "1.99.28",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1,2 +0,0 @@
1
- var t=Object.defineProperty,e=new WeakMap,n=t=>e.get(t),l=(t,n)=>e.set(n.t=t,n),o=(t,e)=>(0,console.error)(t,e),s=new Map,r=new Map,i="slot-fb{display:contents}slot-fb[hidden]{display:none}",c="undefined"!=typeof window?window:{},u=c.document||{head:{}},a={l:0,o:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},f=t=>Promise.resolve(t),h=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),d=!1,p=[],m=[],y=(t,e)=>n=>{t.push(n),d||(d=!0,e&&4&a.l?w($):a.raf($))},v=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){o(t)}t.length=0},$=()=>{v(p),v(m),(d=p.length>0)&&a.raf($)},w=t=>f().then(t),b=y(m,!0),S={},g=t=>"object"==(t=typeof t)||"function"===t;function j(t){var e,n,l;return null!=(l=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((e,n)=>{for(var l in n)t(e,l,{get:n[l],enumerable:!0})})({},{err:()=>O,map:()=>C,ok:()=>k,unwrap:()=>P,unwrapErr:()=>x});var k=t=>({isOk:!0,isErr:!1,value:t}),O=t=>({isOk:!1,isErr:!0,value:t});function C(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>k(t))):k(n)}if(t.isErr)return O(t.value);throw"should never get here"}var E,M,P=t=>{if(t.isOk)return t.value;throw t.value},x=t=>{if(t.isErr)return t.value;throw t.value},T=(t,e,...n)=>{let l=null,o=!1,s=!1;const r=[],i=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof t&&!g(l))&&(l+=""),o&&s?r[r.length-1].i+=l:r.push(o?A(null,l):l),s=o)};if(i(n),e){const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}const c=A(t,null);return c.u=e,r.length>0&&(c.h=r),c},A=(t,e)=>({l:0,p:t,i:e,m:null,h:null,u:null}),L={},N=new WeakMap,R=t=>"sc-"+t.v,U=(t,e,n,l,o,s)=>{if(n!==l){let r=((t,e)=>e in t)(t,e);if(e.toLowerCase(),"class"===e){const e=t.classList,o=F(n),s=F(l);e.remove(...o.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!o.includes(t))))}else if("style"===e){for(const e in n)l&&null!=l[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in l)n&&l[e]===n[e]||(e.includes("-")?t.style.setProperty(e,l[e]):t.style[e]=l[e])}else if("ref"===e)l&&l(t);else{const i=g(l);if((r||i&&null!==l)&&!o)try{if(t.tagName.includes("-"))t[e]=l;else{const o=null==l?"":l;"list"===e?r=!1:null!=n&&t[e]==o||(t[e]=o)}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!r||4&s||o)&&!i&&t.setAttribute(e,l=!0===l?"":l)}}},D=/\s/,F=t=>t?t.split(D):[],H=(t,e,n)=>{const l=11===e.m.nodeType&&e.m.host?e.m.host:e.m,o=t&&t.u||S,s=e.u||S;for(const t of W(Object.keys(o)))t in s||U(l,t,o[t],void 0,n,e.l);for(const t of W(Object.keys(s)))U(l,t,o[t],s[t],n,e.l)};function W(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var q=!1,G=(t,e,n)=>{const l=e.h[n];let o,s,r=0;if(null!==l.i)o=l.m=u.createTextNode(l.i);else if(o=l.m=u.createElement(l.p),H(null,l,q),null!=E&&o["s-si"]!==E&&o.classList.add(o["s-si"]=E),l.h)for(r=0;r<l.h.length;++r)s=G(t,l,r),s&&o.appendChild(s);return o["s-hn"]=M,o},V=(t,e,n,l,o,s)=>{let r,i=t;for(i.shadowRoot&&i.tagName===M&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=G(null,n,o),r&&(l[o].m=r,J(i,r,e)))},_=(t,e,n)=>{for(let l=e;l<=n;++l){const e=t[l];if(e){const t=e.m;I(e),t&&t.remove()}}},z=(t,e)=>t.p===e.p,B=(t,e,n=!1)=>{const l=e.m=t.m,o=t.h,s=e.h,r=e.i;null===r?(H(t,e,q),null!==o&&null!==s?((t,e,n,l,o=!1)=>{let s,r=0,i=0,c=e.length-1,u=e[0],a=e[c],f=l.length-1,h=l[0],d=l[f];for(;r<=c&&i<=f;)null==u?u=e[++r]:null==a?a=e[--c]:null==h?h=l[++i]:null==d?d=l[--f]:z(u,h)?(B(u,h,o),u=e[++r],h=l[++i]):z(a,d)?(B(a,d,o),a=e[--c],d=l[--f]):z(u,d)?(B(u,d,o),J(t,u.m,a.m.nextSibling),u=e[++r],d=l[--f]):z(a,h)?(B(a,h,o),J(t,a.m,u.m),a=e[--c],h=l[++i]):(s=G(e&&e[i],n,i),h=l[++i],s&&J(u.m.parentNode,s,u.m));r>c?V(t,null==l[f+1]?null:l[f+1].m,n,l,i,f):i>f&&_(e,r,c)})(l,o,e,s,n):null!==s?(null!==t.i&&(l.textContent=""),V(l,null,e,s,0,s.length-1)):null!==o&&_(o,0,o.length-1)):t.i!==r&&(l.data=r)},I=t=>{t.u&&t.u.ref&&t.u.ref(null),t.h&&t.h.map(I)},J=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),K=(t,e)=>{e&&!t.$&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.$=e)))},Q=(t,e)=>{if(t.l|=16,!(4&t.l))return K(t,t.S),b((()=>X(t,e)));t.l|=512},X=(t,e)=>{const n=t.t;if(!n)throw Error(`Can't render component <${t.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);return e&&(t.l|=256,t.j&&(t.j.map((([t,e])=>ot(n,t,e))),t.j=void 0)),Y(void 0,(()=>tt(t,n,e)))},Y=(t,e)=>Z(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),Z=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,tt=async(t,e,n)=>{var l;const o=t.$hostElement$,s=o["s-rc"];n&&(t=>{const e=t.k,n=t.$hostElement$,l=e.l,o=((t,e)=>{var n;const l=R(e),o=r.get(l);if(t=11===t.nodeType?t:u,o)if("string"==typeof o){let s,r=N.get(t=t.head||t);if(r||N.set(t,r=new Set),!r.has(l)){{s=u.createElement("style"),s.innerHTML=o;const e=null!=(n=a.O)?n:j(u);null!=e&&s.setAttribute("nonce",e),t.insertBefore(s,t.querySelector("link"))}4&e.l&&(s.innerHTML+=i),r&&r.add(l)}}else t.adoptedStyleSheets.includes(o)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(t);et(t,e,o,n),s&&(s.map((t=>t())),o["s-rc"]=void 0);{const e=null!=(l=o["s-p"])?l:[],n=()=>nt(t);0===e.length?n():(Promise.all(e).then(n),t.l|=4,e.length=0)}},et=(t,e,n,l)=>{try{e=e.render(),t.l&=-17,t.l|=2,((t,e,n=!1)=>{const l=t.$hostElement$,o=t.k,s=t.C||A(null,null),r=(t=>t&&t.p===L)(e)?e:T(null,null,e);if(M=l.tagName,o.M&&(r.u=r.u||{},o.M.map((([t,e])=>r.u[e]=l[t]))),n&&r.u)for(const t of Object.keys(r.u))l.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(r.u[t]=l[t]);r.p=null,r.l|=4,t.C=r,r.m=s.m=l.shadowRoot||l,E=l["s-sc"],B(s,r,n)})(t,e,l)}catch(e){o(e,t.$hostElement$)}return null},nt=t=>{const e=t.$hostElement$,n=t.t,l=t.S;64&t.l||(t.l|=64,st(e),ot(n,"componentDidLoad"),t.P(e),l||lt()),t.$&&(t.$(),t.$=void 0),512&t.l&&w((()=>Q(t,!1))),t.l&=-517},lt=()=>{st(u.documentElement),w((()=>(t=>{const e=a.ce("appload",{detail:{namespace:"blog-article-details"}});return t.dispatchEvent(e),e})(c)))},ot=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){o(t)}},st=t=>t.classList.add("hydrated"),rt=(t,e,l)=>{var s,r;const i=t.prototype;if(e.T||e.A||t.watchers){t.watchers&&!e.A&&(e.A=t.watchers);const c=Object.entries(null!=(s=e.T)?s:{});if(c.map((([t,[s]])=>{(31&s||2&l&&32&s)&&Object.defineProperty(i,t,{get(){return((t,e)=>n(this).L.get(e))(0,t)},set(l){((t,e,l,s)=>{const r=n(t);if(!r)throw Error(`Couldn't find host element for "${s.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,c=r.L.get(e),u=r.l,a=r.t;if(l=((t,e)=>null==t||g(t)?t:4&e?"false"!==t&&(""===t||!!t):1&e?t+"":t)(l,s.T[e][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.L.set(e,l),a)){if(s.A&&128&u){const t=s.A[e];t&&t.map((t=>{try{a[t](l,c,e)}catch(t){o(t,i)}}))}2==(18&u)&&Q(r,!1)}})(this,t,l,e)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(t,o,s){a.jmp((()=>{var r;const c=l.get(t);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&s!==o){const n=l.t,i=null==(r=e.A)?void 0:r[t];null==i||i.forEach((e=>{null!=n[e]&&n[e].call(n,s,o,t)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=e.A)?r:{}),...c.filter((([t,e])=>15&e[0])).map((([t,n])=>{var o;const s=n[1]||t;return l.set(s,t),512&n[0]&&(null==(o=e.M)||o.push([t,s])),s}))]))}}return t},it=t=>{ot(t,"connectedCallback")},ct=t=>{ot(t,"disconnectedCallback")},ut=(t,l={})=>{var f;const d=[],p=l.exclude||[],m=c.customElements,y=u.head,v=y.querySelector("meta[charset]"),$=u.createElement("style"),w=[];let b,S=!0;Object.assign(a,l),a.o=new URL(l.resourcesUrl||"./",u.baseURI).href;let g=!1;if(t.map((t=>{t[1].map((l=>{var i;const c={l:l[0],v:l[1],T:l[2],N:l[3]};4&c.l&&(g=!0),c.T=l[2],c.N=l[3],c.M=[],c.A=null!=(i=l[4])?i:{};const u=c.v,f=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,n)=>{const l={l:0,$hostElement$:t,k:n,L:new Map};l.R=new Promise((t=>l.P=t)),t["s-p"]=[],t["s-rc"]=[],e.set(t,l)})(t=this,c),1&c.l)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open"})}connectedCallback(){const t=n(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,at(this,t,c.N)),b&&(clearTimeout(b),b=null),S?w.push(this):a.jmp((()=>(t=>{if(!(1&a.l)){const e=n(t),l=e.k,i=()=>{};if(1&e.l)at(t,e,l.N),(null==e?void 0:e.t)?it(e.t):(null==e?void 0:e.R)&&e.R.then((()=>it(e.t)));else{e.l|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){K(e,e.S=n);break}}l.T&&Object.entries(l.T).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let l;if(!(32&e.l)){if(e.l|=32,n.U){const t=(t=>{const e=t.v.replace(/-/g,"_"),n=t.U;if(!n)return;const l=s.get(n);return l?l[e]:import(`./${n}.entry.js`).then((t=>(s.set(n,t),t[e])),o)
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(t&&"then"in t){const e=()=>{};l=await t,e()}else l=t;if(!l)throw Error(`Constructor for "${n.v}#${e.D}" was not found`);l.isProxied||(n.A=l.watchers,rt(l,n,2),l.isProxied=!0);const r=()=>{};e.l|=8;try{new l(e)}catch(t){o(t)}e.l&=-9,e.l|=128,r(),it(e.t)}else l=t.constructor,customElements.whenDefined(t.localName).then((()=>e.l|=128));if(l&&l.style){let t;"string"==typeof l.style&&(t=l.style);const e=R(n);if(!r.has(e)){const l=()=>{};((t,e,n)=>{let l=r.get(t);h&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,r.set(t,l)})(e,t,!!(1&n.l)),l()}}}const i=e.S,c=()=>Q(e,!0);i&&i["s-rc"]?i["s-rc"].push(c):c()})(t,e,l)}i()}})(this)))}disconnectedCallback(){a.jmp((()=>(async()=>{if(!(1&a.l)){const t=n(this);t.F&&(t.F.map((t=>t())),t.F=void 0),(null==t?void 0:t.t)?ct(t.t):(null==t?void 0:t.R)&&t.R.then((()=>ct(t.t)))}})()))}componentOnReady(){return n(this).R}};c.U=t[0],p.includes(u)||m.get(u)||(d.push(u),m.define(u,rt(f,c,1)))}))})),d.length>0&&(g&&($.textContent+=i),$.textContent+=d.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",$.innerHTML.length)){$.setAttribute("data-styles","");const t=null!=(f=a.O)?f:j(u);null!=t&&$.setAttribute("nonce",t),y.insertBefore($,v?v.nextSibling:y.firstChild)}S=!1,w.length?w.map((t=>t.connectedCallback())):a.jmp((()=>b=setTimeout(lt,30)))},at=(t,e,n)=>{n&&n.map((([n,l,o])=>{const s=ht(t,n),r=ft(e,o),i=dt(n);a.ael(s,l,r,i),(e.F=e.F||[]).push((()=>a.rel(s,l,r,i)))}))},ft=(t,e)=>n=>{var l;try{256&t.l?null==(l=t.t)||l[e](n):(t.j=t.j||[]).push([e,n])}catch(t){o(t)}},ht=(t,e)=>8&e?c:t,dt=t=>({passive:!!(1&t),capture:!!(2&t)}),pt=t=>a.O=t;export{ut as b,T as h,f as p,l as r,pt as s}