import { html, render } from "/js/lib/lit-html.js"; import { cdnImageUrl, getRKey, doHideAuthorOnUnauthenticated, getLabelNameAndDescription, parseYouTubeVideoFromUrl, } from "/js/dataHelpers.js"; import { parseAltFromGifDescription } from "/js/embedHelpers.js"; import { externalLinkTemplate } from "/js/templates/externalLink.template.js"; import { avatarTemplate } from "/js/templates/avatar.template.js"; import { closeWithAnimation } from "/js/dialogHelpers.js"; import "/js/components/plugin-rich-text.js"; import "/js/components/app-icon.js"; import { postHeaderTextTemplate } from "/js/templates/postHeaderText.template.js"; import { authorBadgesTemplate } from "/js/templates/labelBadges.template.js"; import { linkToPost, linkToFeed } from "/js/navigation.js"; import { moderationWarningTemplate } from "/js/templates/moderationWarning.template.js"; import "/js/components/container-link.js"; import { OG_CARD_SERVICE_URL, TENOR_GIF_PROXY_URL, KLIPY_GIF_PROXY_HOSTNAME, } from "/js/config.js"; import { isSafari } from "/js/utils.js"; import "/js/components/lightbox-image-group.js"; import "/js/components/streaming-video.js"; import "/js/components/moderation-warning.js"; import "/js/components/image-carousel.js"; import "/js/components/youtube-embed.js"; import { chatJoinLinkEmbedTemplate } from "/js/templates/chatJoinLinkEmbed.template.js"; function galleryItemsToImages(items) { return (items ?? []) .filter( (item) => !item.$type || item.$type === "app.bsky.embed.gallery#viewImage", ) .map(({ thumbnail, ...rest }) => ({ thumb: thumbnail, ...rest })); } function moderationWarningWrapperTemplate({ children, mediaLabel }) { return mediaLabel ? moderationWarningTemplate({ labelDefinition: mediaLabel.labelDefinition, labeler: mediaLabel.labeler, isAuthorLabel: false, children, }) : children; } function blockedQuoteTemplate() { return html`
`; } function removedQuoteTemplate() { return html``; } function notFoundQuoteTemplate() { return html``; } function mutedWrapperTemplate({ isMuted, label, iconStyle, children }) { if (isMuted) { return html`${altText}
`, dialog, ); document.body.appendChild(dialog); dialog.showModal(); } function gifPlayerTemplate({ type = "video", uri, alt, aspectRatio = null }) { return html`