@wix/blog 1.0.712 → 1.0.714

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.
@@ -30,10 +30,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // context-post-by-id.ts
31
31
  var context_post_by_id_exports = {};
32
32
  __export(context_post_by_id_exports, {
33
- PostByIdProvider: () => hd,
34
- default: () => hd,
35
- injectAccessTokenGetter: () => gd,
36
- usePostByIdContext: () => dd
33
+ PostByIdProvider: () => gd,
34
+ default: () => gd,
35
+ injectAccessTokenGetter: () => _d,
36
+ usePostByIdContext: () => fd
37
37
  });
38
38
  module.exports = __toCommonJS(context_post_by_id_exports);
39
39
 
@@ -4414,31 +4414,38 @@ var tu = (e6, t2, n2 = false, r2) => {
4414
4414
  }, [e6, i2, r2, S2]);
4415
4415
  return { ...eu(a2, t2), toggleLike: ee2, liveLikes: C2 };
4416
4416
  };
4417
- var nu = () => {
4417
+ var nu = I(`@wix/viewer-service-multilingual`);
4418
+ var ru = () => {
4419
+ let e6;
4418
4420
  try {
4419
- let { locale: e6, language: t2 } = (0, import_services_manager_react.useService)(xo);
4420
- return e6 || t2;
4421
+ let { multilingualEnabled: t3, currentLocale: n3 } = (0, import_services_manager_react.useService)(nu);
4422
+ t3 && n3 && !n3.primaryLocale && (e6 = n3.regionalFormat);
4421
4423
  } catch {
4422
- return;
4423
4424
  }
4425
+ let t2, n2;
4426
+ try {
4427
+ ({ locale: t2, language: n2 } = (0, import_services_manager_react.useService)(xo));
4428
+ } catch {
4429
+ }
4430
+ return e6 || t2 || n2;
4424
4431
  };
4425
- var ru = () => {
4432
+ var iu = () => {
4426
4433
  try {
4427
4434
  return Xc((0, import_services_manager_react.useService)(Zn));
4428
4435
  } catch {
4429
4436
  return;
4430
4437
  }
4431
4438
  };
4432
- var iu = (e6, t2, n2) => typeof e6 != `number` || !Number.isFinite(e6) || e6 < 0 ? `` : new Intl.NumberFormat(n2, t2 === `compact` ? { notation: `compact`, maximumFractionDigits: 1 } : void 0).format(e6);
4439
+ var au = (e6, t2, n2) => typeof e6 != `number` || !Number.isFinite(e6) || e6 < 0 ? `` : new Intl.NumberFormat(n2, t2 === `compact` ? { notation: `compact`, maximumFractionDigits: 1 } : void 0).format(e6);
4433
4440
  var Q = { timeToRead: `post.time-to-read`, viewCount: `post.view-count`, commentCount: `post.comment-count`, likeCount: `post.like-count`, noPostsTitle: `post-list.empty-state.title`, noPostsDescription: `post-list.empty-state.description`, noRelatedPostsTitle: `related-posts.empty-state.title`, noRelatedPostsDescription: `related-posts.empty-state.description`, canvasPostTitle: `canvas.post-title`, canvasAuthorName: `canvas.author-name`, canvasExcerpt: `canvas.excerpt`, canvasContent: `canvas.content`, canvasCategory: `canvas.category`, canvasCategoryNumbered: `canvas.category-numbered`, canvasTagNumbered: `canvas.tag-numbered`, canvasCoverAlt: `cover-media.placeholder-alt`, canvasAuthorPhotoAlt: `canvas.author-photo-alt` };
4434
- var au = (e6, t2) => {
4435
- let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: iu(r2, `full`, t2) });
4441
+ var ou = (e6, t2) => {
4442
+ let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: au(r2, `full`, t2) });
4436
4443
  return { timeToRead: (t3) => e6(Q.timeToRead, { count: t3 }), viewCount: n2(Q.viewCount), commentCount: n2(Q.commentCount), likeCount: n2(Q.likeCount), noPostsEmptyState: () => ({ title: e6(Q.noPostsTitle), description: e6(Q.noPostsDescription) }), noRelatedPostsEmptyState: () => ({ title: e6(Q.noRelatedPostsTitle), description: e6(Q.noRelatedPostsDescription) }), canvas: { postTitle: () => e6(Q.canvasPostTitle), authorName: () => e6(Q.canvasAuthorName), excerpt: () => e6(Q.canvasExcerpt), content: () => e6(Q.canvasContent), category: () => e6(Q.canvasCategory), categoryNumbered: (t3) => e6(Q.canvasCategoryNumbered, { number: t3 }), tagNumbered: (t3) => e6(Q.canvasTagNumbered, { number: t3 }), coverAlt: () => e6(Q.canvasCoverAlt), authorPhotoAlt: () => e6(Q.canvasAuthorPhotoAlt) } };
4437
4444
  };
4438
- var ou = (0, import_react.createContext)({ isEditor: false, isPreview: false });
4439
- var su = () => (0, import_react.useContext)(ou);
4440
- var cu = ({ isEditor: e6, isPreview: t2 }) => e6 && !t2;
4441
- var lu = () => {
4445
+ var su = (0, import_react.createContext)({ isEditor: false, isPreview: false });
4446
+ var cu = () => (0, import_react.useContext)(su);
4447
+ var lu = ({ isEditor: e6, isPreview: t2 }) => e6 && !t2;
4448
+ var uu = () => {
4442
4449
  try {
4443
4450
  let { SSR: e6, SEO: t2 } = (0, import_services_manager_react.useService)(Wn);
4444
4451
  return e6 || t2;
@@ -4446,186 +4453,186 @@ var lu = () => {
4446
4453
  return false;
4447
4454
  }
4448
4455
  };
4449
- var uu = () => {
4450
- let e6 = lu();
4451
- return cu(su()) && !e6;
4456
+ var du = () => {
4457
+ let e6 = uu();
4458
+ return lu(cu()) && !e6;
4452
4459
  };
4453
- var du = (e6) => ({ href: e6 ?? `#`, target: `_self` });
4454
- var fu = (e6) => {
4460
+ var fu = (e6) => ({ href: e6 ?? `#`, target: `_self` });
4461
+ var pu = (e6) => {
4455
4462
  if (!e6) return;
4456
4463
  let t2 = e6 instanceof Date ? e6 : new Date(e6);
4457
4464
  return Number.isFinite(t2.getTime()) ? t2.toISOString() : void 0;
4458
4465
  };
4459
- var pu = (e6) => typeof e6 == `number` && e6 > 0 ? e6 : void 0;
4460
- var mu = (e6) => e6.replace(/&/g, `&amp;`).replace(/</g, `&lt;`).replace(/>/g, `&gt;`).replace(/"/g, `&quot;`).replace(/'/g, `&#39;`);
4461
- var $ = (e6) => ({ text: e6, html: `<p>${mu(e6)}</p>`, linkList: [] });
4462
- var hu = 6e4;
4463
- var gu = hu * 60;
4464
- var _u = gu * 24;
4465
- var vu = _u * 7;
4466
- var yu = (e6) => e6 < hu ? [`second`, e6 / 1e3] : e6 < gu ? [`minute`, e6 / hu] : e6 < _u ? [`hour`, e6 / gu] : [`day`, e6 / _u];
4467
- var bu = (e6, t2, n2 = Date.now()) => {
4466
+ var mu = (e6) => typeof e6 == `number` && e6 > 0 ? e6 : void 0;
4467
+ var hu = (e6) => e6.replace(/&/g, `&amp;`).replace(/</g, `&lt;`).replace(/>/g, `&gt;`).replace(/"/g, `&quot;`).replace(/'/g, `&#39;`);
4468
+ var $ = (e6) => ({ text: e6, html: `<p>${hu(e6)}</p>`, linkList: [] });
4469
+ var gu = 6e4;
4470
+ var _u = gu * 60;
4471
+ var vu = _u * 24;
4472
+ var yu = vu * 7;
4473
+ var bu = (e6) => e6 < gu ? [`second`, e6 / 1e3] : e6 < _u ? [`minute`, e6 / gu] : e6 < vu ? [`hour`, e6 / _u] : [`day`, e6 / vu];
4474
+ var xu = (e6, t2, n2 = Date.now()) => {
4468
4475
  let r2 = e6 instanceof Date ? e6 : new Date(e6), i2 = n2 - r2.getTime();
4469
- if (i2 >= 0 && i2 < vu) {
4470
- let [e7, n3] = yu(i2);
4476
+ if (i2 >= 0 && i2 < yu) {
4477
+ let [e7, n3] = bu(i2);
4471
4478
  return new Intl.RelativeTimeFormat(t2).format(-Math.round(n3), e7);
4472
4479
  }
4473
4480
  let a2 = r2.getFullYear() === new Date(n2).getFullYear();
4474
4481
  return new Intl.DateTimeFormat(t2, { ...a2 ? {} : { year: `numeric` }, month: `short`, day: `numeric` }).format(r2);
4475
4482
  };
4476
- var xu = `https://static.wixstatic.com/media/`;
4477
- var Su = 100;
4478
- var Cu = (e6, t2 = ``) => {
4483
+ var Su = `https://static.wixstatic.com/media/`;
4484
+ var Cu = 100;
4485
+ var wu = (e6, t2 = ``) => {
4479
4486
  let n2 = e6?.profile?.photo;
4480
4487
  if (!n2?.url) return;
4481
- let r2 = e6?.profile?.nickname, { _id: i2 } = n2, a2 = i2 || (n2.url.startsWith(xu) ? n2.url.slice(35).split(/[?#]/)[0] : void 0);
4482
- return { ...a2 && { uri: a2 }, url: n2.url, name: r2 ?? a2 ?? `author-photo`, width: n2.width || Su, height: n2.height || Su, alt: r2 ?? t2 };
4483
- };
4484
- var wu = `https://static.wixstatic.com/media/`;
4485
- var Tu = `wix:image://`;
4486
- var Eu = 1200;
4487
- var Du = 800;
4488
- var Ou = (e6) => {
4488
+ let r2 = e6?.profile?.nickname, { _id: i2 } = n2, a2 = i2 || (n2.url.startsWith(Su) ? n2.url.slice(35).split(/[?#]/)[0] : void 0);
4489
+ return { ...a2 && { uri: a2 }, url: n2.url, name: r2 ?? a2 ?? `author-photo`, width: n2.width || Cu, height: n2.height || Cu, alt: r2 ?? t2 };
4490
+ };
4491
+ var Tu = `https://static.wixstatic.com/media/`;
4492
+ var Eu = `wix:image://`;
4493
+ var Du = 1200;
4494
+ var Ou = 800;
4495
+ var ku = (e6) => {
4489
4496
  if (!e6) return;
4490
4497
  let t2 = Number.parseInt(e6, 10);
4491
4498
  return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
4492
4499
  };
4493
- var ku = (e6) => {
4494
- if (!e6.startsWith(Tu)) {
4500
+ var Au = (e6) => {
4501
+ if (!e6.startsWith(Eu)) {
4495
4502
  let t3 = e6.split(/[?#]/)[0];
4496
4503
  return t3 ? { uri: t3 } : void 0;
4497
4504
  }
4498
4505
  let [t2, n2] = e6.slice(12).split(`#`), [, r2, i2] = t2.split(`/`).filter(Boolean);
4499
4506
  if (!r2) return;
4500
4507
  let a2 = new URLSearchParams(n2 ?? ``);
4501
- return { uri: decodeURIComponent(r2), name: i2 ? decodeURIComponent(i2) : void 0, width: Ou(a2.get(`originWidth`)), height: Ou(a2.get(`originHeight`)) };
4508
+ return { uri: decodeURIComponent(r2), name: i2 ? decodeURIComponent(i2) : void 0, width: ku(a2.get(`originWidth`)), height: ku(a2.get(`originHeight`)) };
4502
4509
  };
4503
- var Au = (e6, t2) => {
4510
+ var ju = (e6, t2) => {
4504
4511
  if (!e6) return;
4505
- let n2 = ku(e6);
4512
+ let n2 = Au(e6);
4506
4513
  if (!n2) return;
4507
4514
  let r2 = n2.name ?? n2.uri;
4508
- return { uri: n2.uri, url: `${wu}${n2.uri}`, name: r2, width: n2.width ?? Eu, height: n2.height ?? Du, alt: t2 ?? r2 };
4515
+ return { uri: n2.uri, url: `${Tu}${n2.uri}`, name: r2, width: n2.width ?? Du, height: n2.height ?? Ou, alt: t2 ?? r2 };
4509
4516
  };
4510
- var ju = (e6) => {
4517
+ var Mu = (e6) => {
4511
4518
  let t2 = e6?.media?.wixMedia?.image;
4512
4519
  if (!t2) return;
4513
- let n2 = ku(t2);
4520
+ let n2 = Au(t2);
4514
4521
  if (!n2) return;
4515
4522
  let r2 = n2.name ?? n2.uri;
4516
- return { uri: n2.uri, url: `${wu}${n2.uri}`, name: r2, width: n2.width ?? Eu, height: n2.height ?? Du, alt: e6?.media?.altText ?? e6?.title ?? r2 };
4523
+ return { uri: n2.uri, url: `${Tu}${n2.uri}`, name: r2, width: n2.width ?? Du, height: n2.height ?? Ou, alt: e6?.media?.altText ?? e6?.title ?? r2 };
4517
4524
  };
4518
- var Mu = `https://static.wixstatic.com/media/`;
4519
- var Nu = `wix:video://`;
4520
- var Pu = (e6) => {
4525
+ var Nu = `https://static.wixstatic.com/media/`;
4526
+ var Pu = `wix:video://`;
4527
+ var Fu = (e6) => {
4521
4528
  if (!e6) return;
4522
4529
  let t2 = Number.parseInt(e6, 10);
4523
4530
  return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
4524
4531
  };
4525
- var Fu = (e6) => {
4526
- if (!e6.startsWith(Nu)) return;
4532
+ var Iu = (e6) => {
4533
+ if (!e6.startsWith(Pu)) return;
4527
4534
  let [t2, n2] = e6.slice(12).split(`#`), [, r2] = t2.split(`/`).filter(Boolean);
4528
4535
  if (!r2) return;
4529
4536
  let i2 = new URLSearchParams(n2 ?? ``), a2 = i2.get(`posterUri`);
4530
- return { id: decodeURIComponent(r2), posterUrl: a2 ? `${Mu}${a2}` : void 0, posterWidth: Pu(i2.get(`posterWidth`)), posterHeight: Pu(i2.get(`posterHeight`)) };
4537
+ return { id: decodeURIComponent(r2), posterUrl: a2 ? `${Nu}${a2}` : void 0, posterWidth: Fu(i2.get(`posterWidth`)), posterHeight: Fu(i2.get(`posterHeight`)) };
4531
4538
  };
4532
- var Iu = [/https?:\/\/(?:www\.|m\.)?youtube\.com\/watch\?(?:[^#]*&)?v=([\w-]+)/i, /https?:\/\/(?:www\.)?youtube\.com\/embed\/([\w-]+)/i, /https?:\/\/youtu\.be\/([\w-]+)/i];
4533
- var Lu = [/https?:\/\/player\.vimeo\.com\/video\/(\d+)/i, /https?:\/\/vimeo\.com\/(\d+)/i];
4534
- var Ru = (e6, t2) => {
4539
+ var Lu = [/https?:\/\/(?:www\.|m\.)?youtube\.com\/watch\?(?:[^#]*&)?v=([\w-]+)/i, /https?:\/\/(?:www\.)?youtube\.com\/embed\/([\w-]+)/i, /https?:\/\/youtu\.be\/([\w-]+)/i];
4540
+ var Ru = [/https?:\/\/player\.vimeo\.com\/video\/(\d+)/i, /https?:\/\/vimeo\.com\/(\d+)/i];
4541
+ var zu = (e6, t2) => {
4535
4542
  for (let n2 of e6) {
4536
4543
  let e7 = n2.exec(t2);
4537
4544
  if (e7) return e7[1];
4538
4545
  }
4539
4546
  };
4540
- var zu = (e6) => {
4541
- let t2 = Ru(Iu, e6);
4547
+ var Bu = (e6) => {
4548
+ let t2 = zu(Lu, e6);
4542
4549
  if (t2) return { provider: `youtube`, embedUrl: `https://www.youtube.com/embed/${t2}?autoplay=1` };
4543
- let n2 = Ru(Lu, e6);
4550
+ let n2 = zu(Ru, e6);
4544
4551
  return n2 ? { provider: `vimeo`, embedUrl: `https://player.vimeo.com/video/${n2}?autoplay=1` } : { provider: `unknown` };
4545
4552
  };
4546
- var Bu = (e6, t2 = []) => {
4553
+ var Vu = (e6, t2 = []) => {
4547
4554
  let n2 = e6?.media;
4548
4555
  if (!n2 || n2.displayed === false) return;
4549
- let r2 = ju(e6);
4556
+ let r2 = Mu(e6);
4550
4557
  if (r2) return { kind: `image`, image: r2 };
4551
- let i2 = n2.altText ?? e6?.title ?? ``, a2 = n2.wixMedia?.videoV2 ? Fu(n2.wixMedia.videoV2) : void 0;
4558
+ let i2 = n2.altText ?? e6?.title ?? ``, a2 = n2.wixMedia?.videoV2 ? Iu(n2.wixMedia.videoV2) : void 0;
4552
4559
  if (a2) return { kind: `wixVideo`, ...a2, sources: t2, altText: i2 };
4553
4560
  let o2 = n2.embedMedia?.video?.url;
4554
4561
  if (o2) {
4555
4562
  let { thumbnail: e7 } = n2.embedMedia ?? {};
4556
- return { kind: `embed`, videoUrl: o2, ...zu(o2), thumbnailUrl: e7?.url, thumbnailWidth: e7?.width, thumbnailHeight: e7?.height, altText: i2 };
4563
+ return { kind: `embed`, videoUrl: o2, ...Bu(o2), thumbnailUrl: e7?.url, thumbnailWidth: e7?.width, thumbnailHeight: e7?.height, altText: i2 };
4557
4564
  }
4558
4565
  };
4559
- var Vu = (e6) => {
4560
- let t2 = ju(e6), n2 = e6?.media?.wixMedia?.videoV2;
4566
+ var Hu = (e6) => {
4567
+ let t2 = Mu(e6), n2 = e6?.media?.wixMedia?.videoV2;
4561
4568
  if (t2 || !n2) return t2;
4562
- let r2 = Fu(n2), i2 = Au(r2?.posterUrl?.slice(35), e6?.media?.altText ?? e6?.title);
4569
+ let r2 = Iu(n2), i2 = ju(r2?.posterUrl?.slice(35), e6?.media?.altText ?? e6?.title);
4563
4570
  return i2 && { ...i2, width: r2?.posterWidth ?? i2.width, height: r2?.posterHeight ?? i2.height };
4564
4571
  };
4565
- var Hu = (e6, t2) => e6 && t2 ? `${e6}/${encodeURIComponent(t2)}` : void 0;
4566
- var Uu = (e6, t2) => {
4567
- let n2 = Hu(e6, t2);
4572
+ var Uu = (e6, t2) => e6 && t2 ? `${e6}/${encodeURIComponent(t2)}` : void 0;
4573
+ var Wu = (e6, t2) => {
4574
+ let n2 = Uu(e6, t2);
4568
4575
  return n2 ? { href: n2, target: `_self` } : void 0;
4569
4576
  };
4570
- var Wu = { href: `#`, target: `_self` };
4571
- var Gu = (e6, t2) => {
4577
+ var Gu = { href: `#`, target: `_self` };
4578
+ var Ku = (e6, t2) => {
4572
4579
  let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
4573
- return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink: Uu(t2, i2 ?? ``), categoryItem: { label: a2, slug: i2 ?? `` } };
4580
+ return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink: Wu(t2, i2 ?? ``), categoryItem: { label: a2, slug: i2 ?? `` } };
4574
4581
  };
4575
- var Ku = 2;
4576
- var qu = (e6) => Array.from({ length: Ku }, (t2, n2) => {
4582
+ var qu = 2;
4583
+ var Ju = (e6) => Array.from({ length: qu }, (t2, n2) => {
4577
4584
  let r2 = e6.canvas.categoryNumbered(n2 + 1);
4578
- return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink: Wu, categoryItem: { label: r2, slug: `` } };
4585
+ return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink: Gu, categoryItem: { label: r2, slug: `` } };
4579
4586
  });
4580
- var Ju = (e6, t2) => {
4587
+ var Yu = (e6, t2) => {
4581
4588
  let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
4582
- return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink: Uu(t2, i2 ?? ``), tagItem: { label: a2, slug: i2 ?? `` } };
4589
+ return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink: Wu(t2, i2 ?? ``), tagItem: { label: a2, slug: i2 ?? `` } };
4583
4590
  };
4584
- var Yu = 3;
4585
- var Xu = (e6) => Array.from({ length: Yu }, (t2, n2) => {
4591
+ var Xu = 3;
4592
+ var Zu = (e6) => Array.from({ length: Xu }, (t2, n2) => {
4586
4593
  let r2 = e6.canvas.tagNumbered(n2 + 1);
4587
- return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink: Wu, tagItem: { label: r2, slug: `` } };
4594
+ return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink: Gu, tagItem: { label: r2, slug: `` } };
4588
4595
  });
4589
- var Zu = 1;
4590
- var Qu = { views: 120, comments: 4, likes: 12 };
4591
- var $u = (e6) => ({ nodes: [{ type: `PARAGRAPH`, nodes: [{ type: `TEXT`, nodes: [], textData: { text: e6, decorations: [] } }] }] });
4592
- var ed = (e6, t2, n2, r2) => $(e6 === void 0 ? n2 ? r2(t2) : `` : r2(e6));
4593
- var td = (e6, t2, n2) => e6 ?? (n2 ? t2 : void 0);
4594
- var nd = { nodes: [] };
4595
- var rd = () => ({ title: $(``), excerpt: $(``), coverImage: void 0, coverMedia: void 0, richContent: nd, authorName: $(``), authorImage: void 0, timeToRead: $(``), publishedDate: $(``), viewCount: $(``), commentCount: $(``), likeCount: $(``), postCategories: [], itemCategoryLabel: $(``), postTags: [], hasCoverImage: false, hasExcerpt: false, hasTags: false, publishedDateValue: void 0, minutesToReadValue: void 0, viewCountValue: void 0, commentCountValue: void 0 });
4596
- var id = ({ post: e6, author: t2, metrics: n2, categories: r2, tags: i2, videoSources: a2 }, o2, s2, c2 = false, l2 = Date.now(), u2 = {}) => !e6 && !c2 ? rd() : { title: $(e6?.title ?? o2.canvas.postTitle()), excerpt: $(e6?.excerpt ?? o2.canvas.excerpt()), coverImage: Vu(e6), coverMedia: Bu(e6, a2), richContent: e6?.richContent ?? $u(o2.canvas.content()), authorName: $(t2?.profile?.nickname ?? o2.canvas.authorName()), authorImage: Cu(t2, o2.canvas.authorPhotoAlt()), timeToRead: $(typeof e6?.minutesToRead == `number` && e6.minutesToRead > 0 ? o2.timeToRead(e6.minutesToRead) : c2 ? o2.timeToRead(Zu) : ``), publishedDate: $(bu(e6?.firstPublishedDate ?? new Date(l2), s2, l2)), viewCount: ed(n2?.views, Qu.views, c2, o2.viewCount), commentCount: ed(n2?.comments, Qu.comments, c2, o2.commentCount), likeCount: ed(n2?.likes, Qu.likes, c2, o2.likeCount), postCategories: r2.length === 0 && c2 ? qu(o2) : r2.map((e7) => Gu(e7, u2.category)), itemCategoryLabel: $(r2[0]?.label ?? (c2 ? o2.canvas.category() : ``)), postTags: i2.length === 0 && c2 ? Xu(o2) : i2.map((e7) => Ju(e7, u2.tag)), hasCoverImage: !e6 || e6.media?.displayed !== false && Vu(e6) !== void 0, hasExcerpt: !e6 || !!e6.excerpt?.trim(), hasTags: !e6 || i2.length > 0, publishedDateValue: fu(e6?.firstPublishedDate) ?? (c2 ? `2026-05-12T12:00:00.000Z` : void 0), minutesToReadValue: pu(e6?.minutesToRead) ?? (c2 ? Zu : void 0), viewCountValue: td(n2?.views, Qu.views, c2), commentCountValue: td(n2?.comments, Qu.comments, c2) };
4597
- var ad = ({ postWithAuthor: e6, hasError: t2, monitoringClient: n2, isPostInPreview: r2, postPageBase: i2 }) => {
4598
- let { t: a2 } = yo(), o2 = nu(), s2 = (0, import_react.useMemo)(() => au(a2, o2), [a2, o2]), c2 = Hl(e6.fetchedAt), l2 = uu(), { isLiked: d2, likeCount: f2, isLikeCountLoaded: p2, viewCount: m2, commentCount: h2, toggleLike: g2, liveLikes: _2 } = tu(e6.post?._id ?? void 0, e6.metrics?.likes ?? 0, r2, n2), v2 = Bl(er), y2 = Bl(`tag`), b2 = (0, import_react.useMemo)(() => kl(e6.post), [e6]), x2 = ru(), S2 = (0, import_react.useMemo)(() => e6.post?.richContent && e6.paywall ? Qc(e6.post.richContent, e6.paywall, x2) : void 0, [e6, x2]);
4596
+ var Qu = 1;
4597
+ var $u = { views: 120, comments: 4, likes: 12 };
4598
+ var ed = (e6) => ({ nodes: [{ type: `PARAGRAPH`, nodes: [{ type: `TEXT`, nodes: [], textData: { text: e6, decorations: [] } }] }] });
4599
+ var td = (e6, t2, n2, r2) => $(e6 === void 0 ? n2 ? r2(t2) : `` : r2(e6));
4600
+ var nd = (e6, t2, n2) => e6 ?? (n2 ? t2 : void 0);
4601
+ var rd = { nodes: [] };
4602
+ var id = () => ({ title: $(``), excerpt: $(``), coverImage: void 0, coverMedia: void 0, richContent: rd, authorName: $(``), authorImage: void 0, timeToRead: $(``), publishedDate: $(``), viewCount: $(``), commentCount: $(``), likeCount: $(``), postCategories: [], itemCategoryLabel: $(``), postTags: [], hasCoverImage: false, hasExcerpt: false, hasTags: false, publishedDateValue: void 0, minutesToReadValue: void 0, viewCountValue: void 0, commentCountValue: void 0 });
4603
+ var ad = ({ post: e6, author: t2, metrics: n2, categories: r2, tags: i2, videoSources: a2 }, o2, s2, c2 = false, l2 = Date.now(), u2 = {}) => !e6 && !c2 ? id() : { title: $(e6?.title ?? o2.canvas.postTitle()), excerpt: $(e6?.excerpt ?? o2.canvas.excerpt()), coverImage: Hu(e6), coverMedia: Vu(e6, a2), richContent: e6?.richContent ?? ed(o2.canvas.content()), authorName: $(t2?.profile?.nickname ?? o2.canvas.authorName()), authorImage: wu(t2, o2.canvas.authorPhotoAlt()), timeToRead: $(typeof e6?.minutesToRead == `number` && e6.minutesToRead > 0 ? o2.timeToRead(e6.minutesToRead) : c2 ? o2.timeToRead(Qu) : ``), publishedDate: $(xu(e6?.firstPublishedDate ?? new Date(l2), s2, l2)), viewCount: td(n2?.views, $u.views, c2, o2.viewCount), commentCount: td(n2?.comments, $u.comments, c2, o2.commentCount), likeCount: td(n2?.likes, $u.likes, c2, o2.likeCount), postCategories: r2.length === 0 && c2 ? Ju(o2) : r2.map((e7) => Ku(e7, u2.category)), itemCategoryLabel: $(r2[0]?.label ?? (c2 ? o2.canvas.category() : ``)), postTags: i2.length === 0 && c2 ? Zu(o2) : i2.map((e7) => Yu(e7, u2.tag)), hasCoverImage: !e6 || e6.media?.displayed !== false && Hu(e6) !== void 0, hasExcerpt: !e6 || !!e6.excerpt?.trim(), hasTags: !e6 || i2.length > 0, publishedDateValue: pu(e6?.firstPublishedDate) ?? (c2 ? `2026-05-12T12:00:00.000Z` : void 0), minutesToReadValue: mu(e6?.minutesToRead) ?? (c2 ? Qu : void 0), viewCountValue: nd(n2?.views, $u.views, c2), commentCountValue: nd(n2?.comments, $u.comments, c2) };
4604
+ var od = ({ postWithAuthor: e6, hasError: t2, monitoringClient: n2, isPostInPreview: r2, postPageBase: i2 }) => {
4605
+ let { t: a2 } = yo(), o2 = ru(), s2 = (0, import_react.useMemo)(() => ou(a2, o2), [a2, o2]), c2 = Hl(e6.fetchedAt), l2 = du(), { isLiked: d2, likeCount: f2, isLikeCountLoaded: p2, viewCount: m2, commentCount: h2, toggleLike: g2, liveLikes: _2 } = tu(e6.post?._id ?? void 0, e6.metrics?.likes ?? 0, r2, n2), v2 = Bl(er), y2 = Bl(`tag`), b2 = (0, import_react.useMemo)(() => kl(e6.post), [e6]), x2 = iu(), S2 = (0, import_react.useMemo)(() => e6.post?.richContent && e6.paywall ? Qc(e6.post.richContent, e6.paywall, x2) : void 0, [e6, x2]);
4599
4606
  return (0, import_react.useMemo)(() => {
4600
- let n3 = id(!e6.post && l2 && e6.demoPost ? { ...e6, post: e6.demoPost } : e6, s2, o2, l2, c2, { category: v2, tag: y2 }), a3 = r2 || !e6.post ? void 0 : lr(e6.post, i2), u2 = a3 ?? (l2 ? du(i2) : void 0);
4607
+ let n3 = ad(!e6.post && l2 && e6.demoPost ? { ...e6, post: e6.demoPost } : e6, s2, o2, l2, c2, { category: v2, tag: y2 }), a3 = r2 || !e6.post ? void 0 : lr(e6.post, i2), u2 = a3 ?? (l2 ? fu(i2) : void 0);
4601
4608
  return { ...n3, ...S2 && { richContent: S2 }, relatedPostsSource: b2, commentingEnabled: e6.post?.commentingEnabled ?? void 0, viewCountValue: m2 ?? n3.viewCountValue, commentCountValue: h2 ?? n3.commentCountValue, itemLink: u2, postUrl: a3?.href, ...e6.post && (e6.metrics?.likes !== void 0 || p2) ? { likeCount: $(s2.likeCount(f2)) } : {}, isLiked: d2, likeCountValue: f2, isLikeCountLoaded: p2, toggleLike: g2, liveLikes: _2, clockValue: c2, isLoadingPost: false, hasError: t2, isEmpty: !e6.post && !l2 };
4602
4609
  }, [e6, t2, b2, S2, s2, o2, c2, f2, d2, p2, m2, h2, g2, _2, l2, r2, i2, v2, y2]);
4603
4610
  };
4604
- var od = (e6) => ({ post: e6, hasError: false });
4605
- var sd = () => ({ post: { post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: Date.now() }, hasError: true });
4606
- var cd = (e6) => {
4611
+ var sd = (e6) => ({ post: e6, hasError: false });
4612
+ var cd = () => ({ post: { post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: Date.now() }, hasError: true });
4613
+ var ld = (e6) => {
4607
4614
  throw e6;
4608
4615
  };
4609
- var ld = { ...rd(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
4616
+ var ud = { ...id(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
4610
4617
  }, liveLikes: void 0, postUrl: void 0, itemLink: void 0, clockValue: 0, relatedPostsSource: { currentPostId: void 0, categoryIds: void 0, relatedPostIds: void 0 }, commentingEnabled: void 0, isLoadingPost: true, hasError: false, isEmpty: false };
4611
- var ud = { ...ld, isLoadingPost: false, hasError: true, isEmpty: true };
4612
- function dd() {
4618
+ var dd = { ...ud, isLoadingPost: false, hasError: true, isEmpty: true };
4619
+ function fd() {
4613
4620
  return (0, import_post_context_provider.usePostContext)();
4614
4621
  }
4615
- var fd = 2500;
4616
- var pd = Promise.resolve(od({ post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: 0 }));
4617
- var md = ({ children: t2, postId: n2, postLoadPromise: r2, monitoringClient: i2 }) => {
4618
- let { post: a2, hasError: o2 } = Vn(r2), c2 = Xn(a2, (0, import_react.useCallback)(() => n2 ? El(n2) : Promise.resolve(void 0), [n2])), l2 = ad({ postWithAuthor: c2, hasError: o2, monitoringClient: i2, isPostInPreview: false, postPageBase: dr() });
4622
+ var pd = 2500;
4623
+ var md = Promise.resolve(sd({ post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: 0 }));
4624
+ var hd = ({ children: t2, postId: n2, postLoadPromise: r2, monitoringClient: i2 }) => {
4625
+ let { post: a2, hasError: o2 } = Vn(r2), c2 = Xn(a2, (0, import_react.useCallback)(() => n2 ? El(n2) : Promise.resolve(void 0), [n2])), l2 = od({ postWithAuthor: c2, hasError: o2, monitoringClient: i2, isPostInPreview: false, postPageBase: dr() });
4619
4626
  return mr(fr.postByIdProvider, o2 ? `error` : c2.post ? `data` : `empty`), (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: l2, children: t2 });
4620
4627
  };
4621
- function hd({ children: t2, postPicker: n2 }) {
4628
+ function gd({ children: t2, postPicker: n2 }) {
4622
4629
  let i2 = zl(n2), a2 = Gn(), o2 = gr(), s2 = (0, import_react.useMemo)(() => jl(zn), []), { i18n: c2, locale: l2 } = Go($o), d2 = qn(() => i2 ? Un(Mo({ key: `blog-builder:post-by-id:${i2}`, warmupData: o2, fetchData: () => {
4623
4630
  let e6 = Dl(i2, a2);
4624
- return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6, fd, `post-by-id`) : e6));
4625
- } }), od, a2 ? cd : sd) : pd, [i2, a2, o2, s2]);
4626
- return (0, import_jsx_runtime.jsx)(bo, { i18n: c2, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: ld, children: t2 }), children: [(0, import_jsx_runtime.jsx)(Wo, { i18n: c2, locale: l2 }), (0, import_jsx_runtime.jsx)(Fl, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: ud, children: t2 }), feature: Al.post, monitoringClient: s2, rethrow: a2, children: (0, import_jsx_runtime.jsx)(md, { postId: i2, postLoadPromise: d2, monitoringClient: s2, children: t2 }, i2 ?? ``) })] }) });
4631
+ return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6, pd, `post-by-id`) : e6));
4632
+ } }), sd, a2 ? ld : cd) : md, [i2, a2, o2, s2]);
4633
+ return (0, import_jsx_runtime.jsx)(bo, { i18n: c2, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: ud, children: t2 }), children: [(0, import_jsx_runtime.jsx)(Wo, { i18n: c2, locale: l2 }), (0, import_jsx_runtime.jsx)(Fl, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: dd, children: t2 }), feature: Al.post, monitoringClient: s2, rethrow: a2, children: (0, import_jsx_runtime.jsx)(hd, { postId: i2, postLoadPromise: d2, monitoringClient: s2, children: t2 }, i2 ?? ``) })] }) });
4627
4634
  }
4628
- var gd = Mn(`474ee948-702b-4c0f-970e-b5319eff6d8b`);
4635
+ var _d = Mn(`474ee948-702b-4c0f-970e-b5319eff6d8b`);
4629
4636
  // Annotate the CommonJS export names for ESM import in node:
4630
4637
  0 && (module.exports = {
4631
4638
  PostByIdProvider,