patreon-dl 3.6.1 → 3.7.0
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.
- package/NOTICE +23 -0
- package/README.md +13 -5
- package/bin/patreon-dl-vimeo.js +7 -4
- package/dist/browse/api/CampaignAPIMixin.d.ts +1 -1
- package/dist/browse/api/ContentAPIMixin.d.ts +4 -1
- package/dist/browse/api/ContentAPIMixin.js +44 -11
- package/dist/browse/api/ContentAPIMixin.js.map +1 -1
- package/dist/browse/api/FilterAPIMixin.d.ts +1 -1
- package/dist/browse/api/SettingsAPIMixin.d.ts +1 -0
- package/dist/browse/api/SettingsAPIMixin.js +4 -2
- package/dist/browse/api/SettingsAPIMixin.js.map +1 -1
- package/dist/browse/api/index.d.ts +12 -6
- package/dist/browse/db/CampaignDBMixin.d.ts +3 -3
- package/dist/browse/db/ContentDBMixin.d.ts +14 -14
- package/dist/browse/db/ContentDBMixin.js +12 -5
- package/dist/browse/db/ContentDBMixin.js.map +1 -1
- package/dist/browse/db/index.d.ts +17 -17
- package/dist/browse/server/handler/SettingsAPIRequestHandler.js +2 -1
- package/dist/browse/server/handler/SettingsAPIRequestHandler.js.map +1 -1
- package/dist/browse/types/Settings.d.ts +3 -0
- package/dist/browse/types/Settings.js.map +1 -1
- package/dist/browse/web/assets/index-CW4CUoWl.css +1 -0
- package/dist/browse/web/assets/{index-Dw_64hkR.js → index-CziUWlSw.js} +31 -31
- package/dist/browse/web/index.html +2 -2
- package/dist/downloaders/Downloader.d.ts +5 -4
- package/dist/downloaders/Downloader.js +3 -1
- package/dist/downloaders/Downloader.js.map +1 -1
- package/dist/downloaders/PostDownloader.js +10 -0
- package/dist/downloaders/PostDownloader.js.map +1 -1
- package/dist/downloaders/ProductDownloader.js +2 -0
- package/dist/downloaders/ProductDownloader.js.map +1 -1
- package/dist/downloaders/task/DownloadTaskFactory.d.ts +4 -0
- package/dist/downloaders/task/DownloadTaskFactory.js +3 -2
- package/dist/downloaders/task/DownloadTaskFactory.js.map +1 -1
- package/dist/downloaders/task/YouTubeDownloadTask.js +7 -2
- package/dist/downloaders/task/YouTubeDownloadTask.js.map +1 -1
- package/dist/parsers/PostParser.js +62 -7
- package/dist/parsers/PostParser.js.map +1 -1
- package/dist/utils/FilenameFormatHelper.d.ts +2 -2
- package/dist/utils/FilenameFormatHelper.js +45 -2
- package/dist/utils/FilenameFormatHelper.js.map +1 -1
- package/dist/utils/MediaFilenameResolver.d.ts +4 -1
- package/dist/utils/MediaFilenameResolver.js +6 -4
- package/dist/utils/MediaFilenameResolver.js.map +1 -1
- package/dist/utils/URLHelper.js +8 -8
- package/dist/utils/URLHelper.js.map +1 -1
- package/dist/utils/YouTubeCredentialsCapturer.js +1 -1
- package/dist/utils/YouTubeCredentialsCapturer.js.map +1 -1
- package/dist/utils/yt/InnertubeLoader.d.ts +19 -1
- package/dist/utils/yt/InnertubeLoader.js +55 -15
- package/dist/utils/yt/InnertubeLoader.js.map +1 -1
- package/package.json +2 -1
- package/dist/browse/web/assets/index-DjOKbT1U.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentDBMixin.js","sourceRoot":"","sources":["../../../src/browse/db/ContentDBMixin.ts"],"names":[],"mappings":";;;;;AAEA,OAAO,EAAE,kBAAkB,EAAoB,MAAM,qBAAqB,CAAC;AAI3E,MAAM,UAAU,cAAc,CAAsC,IAAW;;IAC7E,YAAO,MAAM,SAAU,SAAQ,IAAI;YAA5B;;;YAysCP,CAAC;YAxsCC,WAAW,CAAC,OAAuB;gBACjC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;gBACrE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC;gBAC1E,IAAI,C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C;gBACzG,CAAC;YACH,CAAC;QACH,CAAC;WAmCD;AACJ,CAAC","sourcesContent":["import { type Comment, type Downloadable, type Post, type Product, type Tier, type Campaign } from '../../entities';\nimport { type PostTag, type Collection } from '../../entities/Post';\nimport { getYearMonthString, type KeysOfValue } from '../../utils/Misc.js';\nimport { type GetContentContext, type GetPreviousNextContentResult, type ContentList, type ContentType, type GetContentListParams, type PostWithComments, type ContentListSortBy, type GetCollectionListParams, type CollectionList, type GetPostTagListParams, type PostTagList } from '../types/Content.js';\nimport { type CampaignDBConstructor } from './CampaignDBMixin.js';\n\nexport function ContentDBMixin<TBase extends CampaignDBConstructor>(Base: TBase) {\n return class ContentDB extends Base {\n saveContent(content: Post | Product) {\n const title = content.type === 'post' ? content.title : content.name;\n this.log('debug', `Save ${content.type} #${content.id} (${title}) to DB`);\n try {\n // Normally, campaign would have already been saved to DB via\n // downloader logic, but we should still save it one more\n // time just in case. Difference is, we do not overwrite \n // DB entry if it already exists.\n this.saveCampaign(content.campaign, new Date(), false);\n\n const contentExists = this.checkContentExists(content.id, content.type, content.campaign);\n this.exec('BEGIN TRANSACTION');\n\n if (!contentExists) {\n this.log('debug', `INSERT ${content.type} \"${title}\" (${content.id})`);\n this.run(\n `\n INSERT INTO content (\n content_id,\n content_type,\n campaign_id,\n title,\n content_subtype,\n is_viewable,\n published_at,\n details\n )\n VALUES (?, ?, ?, ?, ?, ?, ?, ?)\n `,\n [\n content.id,\n content.type,\n content.campaign?.id || '-1',\n title,\n content.type === 'post' ? content.postType : content.productType || null,\n (content.type === 'post' ? content.isViewable : content.isAccessible) ? 1 : 0,\n this.#publishedAtToTime(content.publishedAt),\n JSON.stringify(content)\n ]\n );\n } else {\n this.log('debug', `${content.type} #${content.id} already exists in DB - update record`);\n this.run(`\n UPDATE content\n SET\n content_type = ?,\n campaign_id = ?,\n title = ?,\n content_subtype = ?,\n is_viewable = ?,\n published_at = ?,\n details = ?\n WHERE content_id = ?\n `,\n [\n content.type,\n content.campaign?.id || '-1',\n title,\n content.type === 'post' ? content.postType : content.productType || null,\n (content.type === 'post' ? content.isViewable : content.isAccessible) ? 1 : 0,\n this.#publishedAtToTime(content.publishedAt),\n JSON.stringify(content),\n content.id\n ]\n );\n }\n\n // Save content media\n this.#saveContentMedia(content);\n\n // Save tiers and collections and tags\n if (content.type === 'post') {\n this.#savePostTiers(content);\n this.#savePostCollection(content);\n this.#savePostTags(content);\n }\n\n this.exec('COMMIT');\n } catch (error) {\n this.log(\n 'error',\n `Failed to save content \"${title}\" (${content.id}) to DB:`,\n error\n );\n this.exec('ROLLBACK');\n }\n }\n\n #saveContentMedia(\n content: Post | Product\n ) {\n this.log('debug', `Save media for ${content.type} #${content.id} to DB`);\n switch (content.type) {\n case 'post':\n this.#savepostMedia(content);\n break;\n case 'product':\n this.#saveProductMedia(content);\n break;\n }\n }\n\n #savepostMedia(post: Post) {\n const mediaProps: KeysOfValue<Post, Downloadable | Downloadable[] | null>[] = [\n 'embed',\n 'attachments',\n 'audio',\n 'audioPreview',\n 'images',\n 'videoPreview',\n 'video'\n ];\n if (post.coverImage) {\n this.saveMedia(post.coverImage);\n }\n if (post.thumbnail) {\n this.saveMedia(post.thumbnail);\n }\n for (const prop of mediaProps) {\n if (post[prop]) {\n const data = post[prop];\n const downloadables = (Array.isArray(data) ? data : [data])\n .filter((data) => data !== undefined);\n downloadables.forEach((dl, index) => this.#doSaveContentMedia(\n post,\n dl,\n index,\n prop === 'audioPreview'||\n prop === 'videoPreview' ||\n (prop === 'images' && !post.isViewable)\n ));\n }\n }\n }\n\n #saveProductMedia(product: Product) {\n const mediaProps: KeysOfValue<Product, Downloadable[]>[] = [\n 'contentMedia',\n 'previewMedia'\n ];\n for (const prop of mediaProps) {\n if (product[prop]) {\n const data = product[prop];\n const downloadables = (Array.isArray(data) ? data : [data])\n .filter((data) => data !== undefined);\n downloadables.forEach((dl, index) => this.#doSaveContentMedia(\n product,\n dl,\n index,\n prop === 'previewMedia'\n ));\n }\n }\n }\n\n #doSaveContentMedia(\n content: Post | Product,\n media: Downloadable,\n mediaIndex: number,\n isPreview: boolean\n ) {\n if (!media.downloaded || !media.downloaded.path) {\n return;\n }\n this.log('debug',\n `Save ${content.type} media to DB`,\n `(${content.type} ID: ${content.id}, media ID: ${media.id})`\n );\n this.saveMedia(media);\n try {\n const contentMediaExists = this.checkContentMediaExists(content, media);\n if (!contentMediaExists) {\n this.run(\n `\n INSERT INTO content_media (\n media_id,\n content_id,\n content_type,\n media_index,\n campaign_id,\n is_preview\n )\n VALUES (?, ?, ?, ?, ?, ?)\n `,\n [\n media.id,\n content.id,\n content.type,\n mediaIndex,\n content.campaign?.id || '-1',\n isPreview ? 1 : 0\n ]\n );\n }\n else {\n this.log('debug',\n `${content.type} media already exists in DB`,\n `(${content.type} ID: ${content.id}, media ID: ${media.id})`,\n '- update record'\n );\n this.run(\n `\n UPDATE content_media\n SET\n content_id = ?,\n content_type = ?,\n media_index = ?,\n campaign_id = ?,\n is_preview = ?\n WHERE\n media_id = ?\n `,\n [\n content.id,\n content.type,\n mediaIndex,\n content.campaign?.id || '-1',\n isPreview ? 1 : 0,\n media.id,\n ]\n );\n }\n }\n catch (error) {\n this.log(\n 'error',\n `Failed to save content media (type: ${content.type}, content_id: ${content.id}, media_id: ${media.id}) to DB:`,\n error\n );\n throw error;\n }\n }\n\n #publishedAtToTime(publishedAt: string | null) {\n try {\n if (!publishedAt) {\n return null;\n }\n return new Date(publishedAt).getTime();\n }\n catch (error) {\n this.log('warn', `Failed to convert publishedAt value \"${publishedAt}\" to date integer:`, error);\n return null;\n }\n }\n\n #savePostTiers(post: Post) {\n this.log('debug', `Save tiers for post #${post.id} to DB`);\n // Clear existing tiers for post\n this.log('debug', `Clear existing tiers in DB for post #${post.id} before saving current ones`);\n this.run(`DELETE FROM post_tier WHERE post_id = ?`, [\n post.id\n ]);\n post.tiers.forEach((tier) => this.#doSaveTier(post, tier));\n }\n\n #doSaveTier(post: Post, tier: Tier) {\n this.log('debug', `Add post tier #${tier.id} (${tier.title}) to DB`);\n this.run(`\n INSERT INTO post_tier (\n post_id,\n tier_id,\n campaign_id\n )\n VALUES (?, ?, ?)\n `,\n [\n post.id,\n tier.id,\n post.campaign?.id || '-1'\n ]);\n }\n\n savePostComments(post: Post, comments: Comment[]) {\n try {\n this.log('debug', `Save comments for post #${post.id}`);\n const commentsExist = this.checkPostCommentsExist(post);\n if (!commentsExist) {\n this.run(\n `\n INSERT INTO post_comments (\n post_id,\n comment_count,\n comments\n )\n VALUES (?, ?, ?)\n `,\n [\n post.id,\n post.commentCount,\n JSON.stringify(comments)\n ]\n );\n }\n else {\n this.log('debug', `Comments for post #${post.id} already exists in DB - update record`);\n this.run(\n `\n UPDATE post_comments\n SET\n comment_count = ?,\n comments = ?\n WHERE\n post_id = ?\n `,\n [\n post.commentCount,\n JSON.stringify(comments),\n post.id\n ]\n );\n }\n }\n catch (error) {\n this.log(\n 'error',\n `Failed to save comments for post #${post.id} to DB:`,\n error\n );\n throw error;\n }\n }\n\n checkPostCommentsExist(post: Post) {\n try {\n const result = this.get(\n `\n SELECT COUNT(*) as count\n FROM post_comments\n WHERE\n post_id = ?\n `,\n [ post.id ]\n );\n return result.count > 0;\n } catch (error) {\n this.log(\n 'error',\n `Failed to check if comments for post #${post.id} exist in DB:`,\n error\n );\n return false;\n }\n }\n\n getContent(id: string, contentType: 'post'): PostWithComments | null;\n getContent(id: string, contentType: 'product'): Product | null;\n getContent(id: string, contentType: ContentType) {\n this.log('debug', `Get ${contentType} #${id} from DB`);\n const result = this.get(\n `\n SELECT\n details,\n IFNULL(post_comments.comment_count, 0) AS comment_count,\n comments\n FROM\n content\n LEFT JOIN\n post_comments ON post_comments.post_id = content.content_id AND content.content_type = 'post'\n WHERE\n content_id = ? AND content_type = ?`,\n [id, contentType]\n );\n return result ? this.#parseContentRowJoinedComments(result) : null;\n }\n\n getPreviousNextContent<T extends ContentType>(\n content: Post | Product,\n context: GetContentContext<T>\n ): GetPreviousNextContentResult<T> {\n let previousWhere: string;\n let previousSortBy: ContentListSortBy;\n let nextWhere: string;\n let nextSortBy: ContentListSortBy;\n let whereValues: any[];\n const sortBy = context.sortBy ?? 'latest';\n const publishedAt = this.#publishedAtToTime(content.publishedAt);\n const title = content.type === 'post' ? content.title : content.name;\n switch (sortBy) {\n case 'a-z':\n case 'z-a': {\n const p = `\n (\n (title < ?)\n OR\n (title = ? AND published_at > ?)\n OR\n (title = ? AND published_at = ? AND content_id > ?)\n )\n `;\n const n = `\n (\n (title > ?)\n OR\n (title = ? AND published_at < ?)\n OR\n (title = ? AND published_at = ? AND content_id < ?)\n )\n `;\n whereValues = [title, title, publishedAt, title, publishedAt, content.id];\n if (sortBy === 'a-z') {\n previousWhere = p;\n previousSortBy = 'z-a';\n nextWhere = n;\n nextSortBy = 'a-z';\n }\n else { // z-a\n previousWhere = n;\n previousSortBy = 'a-z';\n nextWhere = p;\n nextSortBy = 'z-a';\n }\n break;\n }\n case 'latest':\n case 'oldest':\n case 'best_match': {\n const older = `\n (\n (published_at < ?)\n OR\n (published_at = ? AND content_id < ?)\n )\n `;\n const newer = `\n (\n (published_at > ?)\n OR\n (published_at = ? AND content_id > ?)\n )\n `;\n whereValues = [publishedAt, publishedAt, content.id];\n if (sortBy === 'latest') {\n previousWhere = newer;\n previousSortBy = 'oldest';\n nextWhere = older;\n nextSortBy = 'latest';\n }\n else { // oldest\n previousWhere = older;\n previousSortBy = 'latest';\n nextWhere = newer;\n nextSortBy = 'oldest';\n }\n break;\n }\n }\n const previous = (this.getContentList(\n {\n ...context,\n search: context.search,\n sortBy: previousSortBy,\n limit: 1, offset: 0\n },\n {\n whereClauses: [previousWhere],\n whereValues\n },\n false\n )).items[0] || null;\n const next = (this.getContentList(\n {\n ...context,\n search: context.search,\n sortBy: nextSortBy,\n limit: 1, offset: 0\n },\n {\n whereClauses: [nextWhere],\n whereValues\n },\n false\n )).items[0] || null;\n\n return {\n previous,\n next\n } as GetPreviousNextContentResult<T>;\n }\n\n getContentList<T extends ContentType>(\n params: GetContentListParams<T>,\n db?: { whereClauses: string[]; whereValues: any[]; },\n includeTotal = true\n ): ContentList<T> {\n const { campaign, type: contentType, isViewable, datePublished, search, sortBy, limit, offset } = params;\n const { whereClauses: extraWhereClauses = [], whereValues: extraWhereValues = [] } = db || {};\n const campaignId = !campaign ? null : (typeof campaign === 'string' ? campaign : campaign.id);\n const tiers = params.type === 'post' ? (params as GetContentListParams<'post'>).tiers : null;\n const collection = params.type === 'post' ? (params as GetContentListParams<'post'>).collection : null;\n const tag = params.type === 'post' ? (params as GetContentListParams<'post'>).tag : null;\n this.log('debug', `Get ${contentType}s from DB:`, {\n campaign: campaignId,\n isViewable,\n datePublished,\n search,\n tiers: params.type === 'post' ? JSON.stringify(tiers) : 'N/A',\n collection: params.type === 'post' ? JSON.stringify(collection) : 'N/A',\n tag: params.type === 'post' ? JSON.stringify(tag) : 'N/A',\n sortBy,\n limit,\n offset\n });\n const contentSubtypes = params.type === 'post' ? (params as GetContentListParams<'post'>).postTypes : null;\n if (tiers && tiers.length > 0 && !campaign) {\n throw Error('Invalid params: \"tiers\" must be used with \"campaign\"');\n }\n if (search && !contentType) {\n throw Error('Invalid params: \"search\" must be used with \"contentType\"');\n }\n const joinParts: string[] = [];\n if (tiers && tiers.length > 0) {\n joinParts.push('LEFT JOIN post_tier ON post_tier.post_id = content.content_id');\n }\n if (collection) {\n joinParts.push(`LEFT JOIN post_collection ON post_collection.post_id = content.content_id`);\n }\n if (tag) {\n joinParts.push(`LEFT JOIN post_tag_post ON post_tag_post.post_id = content.content_id AND post_tag_post.campaign_id = content.campaign_id`);\n }\n const join = joinParts.join(' ');\n const whereEquals: { column: string; value: string | number; }[] = [];\n if (campaignId) {\n whereEquals.push({ column: 'content.campaign_id', value: campaignId });\n }\n if (contentType) {\n whereEquals.push({ column: 'content_type', value: contentType });\n }\n if (isViewable !== undefined) {\n whereEquals.push({ column: 'is_viewable', value: isViewable ? 1 : 0});\n }\n if (datePublished) {\n const strftimeFormat =\n /^\\d{4}$/.test(datePublished) ? '%Y' :\n /^\\d{4}-\\d{2}$/.test(datePublished) ? '%Y-%m'\n : null;\n if (!strftimeFormat) {\n throw Error('Invalid params: \"datePublished\" must be in format \"YYYY\" or \"YYYY-MM\" (e.g. \"2025-06\")');\n }\n whereEquals.push({\n column: `strftime('${strftimeFormat}', datetime(published_at / 1000, 'unixepoch'))`,\n value: datePublished\n });\n }\n if (collection) {\n whereEquals.push({\n column: 'post_collection.collection_id',\n value: typeof collection === 'string' ? collection : collection.id\n });\n }\n if (tag) {\n whereEquals.push({\n column: 'post_tag_post.post_tag_id',\n value: typeof tag === 'string' ? tag : tag.id\n });\n }\n const whereIns: { column: string; values: (string | number)[] }[] = [];\n if (contentSubtypes && contentSubtypes.length > 0) {\n whereIns.push({ column: 'content_subtype', values: contentSubtypes})\n }\n if (tiers && tiers.length > 0) {\n const ids = tiers.map((tier) => typeof tier === 'string' ? tier : tier.id);\n whereIns.push({ column: 'tier_id', values: ids });\n }\n const whereClauseParts: string[] = [];\n if (whereEquals.length > 0) {\n whereClauseParts.push(...whereEquals.map(({column: field}) => `${field} = ?` ));\n }\n if (whereIns.length > 0) {\n whereClauseParts.push(...whereIns.map((wi) => `${wi.column} IN (${wi.values.map(() => '?').join(', ')})`));\n }\n if (search) {\n whereClauseParts.push(`${contentType}_fts MATCH ?`);\n }\n whereClauseParts.push(...extraWhereClauses);\n const whereClause = whereClauseParts.length > 0 ? 'WHERE ' + whereClauseParts.join(' AND ') : '';\n const whereValues = [\n ...whereEquals.map(({value}) => value),\n ...whereIns.reduce<(string | number)[]>((result, {values}) => {\n result.push(...values);\n return result;\n }, [])\n ];\n if (search) {\n whereValues.push(search); \n }\n whereValues.push(...extraWhereValues);\n let orderByClause: string;\n switch (sortBy) {\n case 'a-z':\n orderByClause = 'title ASC';\n break;\n case 'z-a':\n orderByClause = 'title DESC';\n break;\n case 'latest':\n orderByClause = 'published_at DESC';\n break;\n case 'oldest':\n orderByClause = 'published_at ASC';\n break;\n case 'best_match':\n orderByClause = `ORDER BY bm25(${contentType}_fts) DESC`;\n break;\n default:\n orderByClause = '';\n }\n if (orderByClause) {\n orderByClause = `ORDER BY ${orderByClause}`;\n }\n let limitOffsetClause = '';\n const limitOffsetValues: number[] = [];\n if (limit !== undefined && offset !== undefined) {\n limitOffsetClause = 'LIMIT ? OFFSET ?';\n limitOffsetValues.push(limit, offset);\n }\n else if (limit !== undefined) {\n limitOffsetClause = 'LIMIT ?';\n limitOffsetValues.push(limit);\n }\n\n let fromClause: string;\n if (search) {\n fromClause = `\n FROM\n ${contentType}_fts\n LEFT JOIN\n ${contentType}_fts_source ON ${contentType}_fts_source.fts_rowid = ${contentType}_fts.rowid\n LEFT JOIN\n content ON content.content_id = ${contentType}_fts_source.${contentType}_id\n `;\n } else {\n fromClause = 'FROM content';\n }\n\n const rows = this.all(\n `\n SELECT DISTINCT\n details,\n IFNULL(post_comments.comment_count, 0) AS comment_count,\n comments\n ${fromClause}\n LEFT JOIN\n post_comments ON post_comments.post_id = content.content_id AND content.content_type = 'post'\n ${join}\n ${whereClause}\n ${orderByClause}\n ${limitOffsetClause}\n `,\n [ ...whereValues, ...limitOffsetValues ]\n );\n const items = rows.map<T extends 'post' ? PostWithComments : T extends 'product' ? Product : PostWithComments | Product>((row) => this.#parseContentRowJoinedComments(row));\n const totalResult = includeTotal ? this.get(\n `SELECT COUNT(*) AS content_count ${fromClause} ${join} ${whereClause}`,\n [...whereValues]\n ) : null;\n const total = totalResult ? (totalResult.content_count as number) : 0;\n return {\n items,\n total\n };\n }\n\n /**\n * \n * @param row Must have `details`, `comment_count` and `comments`\n * @returns \n */\n #parseContentRowJoinedComments(row: any) {\n const details = JSON.parse(row.details);\n if (!Reflect.has(details, 'type')) {\n return details;\n }\n switch (details.type) {\n case 'post': {\n // `comment_count` column somehow created as string type\n // Cast it back to number as some were saved as decimals (e.g. \"2.0\")\n const commentCount = Number(row.comment_count) || 0;\n const comments = row.comments !== null ? JSON.parse(row.comments) : null;\n return {\n ...details,\n commentCount,\n comments\n } satisfies PostWithComments;\n }\n case 'product':\n default:\n return details;\n }\n }\n\n getContentCountByDate(\n contentType: ContentType,\n groupBy: 'year' | 'month',\n filter?: {\n campaign?: Campaign | string | null,\n date?: Date | null}\n ) {\n const campaign = filter?.campaign || null;\n const campaignId = !campaign ? null : (typeof campaign === 'string' ? campaign : campaign.id);\n this.log('debug', `Get ${contentType} count by date:`, {\n groupBy,\n filter: !filter ? null : {\n campaign: campaignId,\n date: filter.date\n }\n });\n const date = filter?.date || null;\n const whereClauseParts = ['content_type = ?'];\n const whereValues: string[] = [contentType];\n if (campaignId) {\n whereClauseParts.push('campaign_id = ?');\n whereValues.push(campaignId);\n }\n if (date) {\n whereClauseParts.push(`dt = ?`);\n const value = groupBy === 'year' ?\n String(date.getUTCFullYear())\n : getYearMonthString(date);\n whereValues.push(String(value));\n }\n const whereClause = `WHERE ${whereClauseParts.join(' AND ')}`;\n const strftimeFormat = groupBy === 'year' ? '%Y' : '%Y-%m'\n const rows = this.all(\n `\n SELECT\n COUNT(content_id) AS content_count,\n strftime('${strftimeFormat}',\n datetime(published_at / 1000, 'unixepoch')) AS dt\n FROM\n content\n ${whereClause}\n GROUP BY dt\n ORDER BY dt DESC\n `,\n [...whereValues]\n );\n return rows.map((row) => ({\n dt: row.dt as string,\n count: row.content_count as number\n }));\n }\n\n getPostCountByType(campaign: Campaign | string) {\n const campaignId = typeof campaign === 'string' ? campaign : campaign.id;\n this.log('debug', `Get post count by type for campaign #${campaignId}`);\n const rows = this.all(\n `\n SELECT\n COUNT(content_id) AS post_count, content_subtype AS post_type\n FROM\n content\n WHERE\n content_type = 'post' AND campaign_id = ?\n GROUP BY content_subtype \n `,\n [campaignId]\n );\n return rows.map((row) => ({\n postType: row.post_type as string,\n count: row.post_count as number\n }));\n }\n\n getPostCountByTier(campaign: Campaign | string) {\n const campaignId = typeof campaign === 'string' ? campaign : campaign.id;\n this.log('debug', `Get post count by tier for campaign #${campaignId}`);\n const rows = this.all(\n `\n SELECT\n COUNT(post_id) as post_count, tier_id, reward.title\n FROM post_tier\n RIGHT JOIN reward ON reward.reward_id = post_tier.tier_id AND reward.campaign_id = post_tier.campaign_id\n WHERE\n post_tier.campaign_id = ?\n GROUP BY\n tier_id\n `,\n [campaignId]\n );\n return rows.map((row) => ({\n tierId: row.tier_id as string,\n title: row.title as string,\n count: row.post_count as number\n }));\n }\n\n checkContentExists(id: string, contentType: ContentType, campaign: Campaign | null) {\n this.log('debug', `Check if ${contentType} #${id} exists in DB`);\n try {\n const result = this.get(\n `\n SELECT COUNT(*) as count\n FROM content\n WHERE\n content_id = ? AND\n content_type = ? AND\n campaign_id = ?\n `,\n [ id, contentType, campaign?.id || '-1' ]\n );\n return result.count > 0;\n } catch (error) {\n this.log(\n 'error',\n `Failed to check if ${contentType} #${id} exists in DB:`,\n error\n );\n return false;\n }\n }\n\n saveCollection(collection: Collection, campaign: Campaign | null, overwriteIfExists = true) {\n this.log('debug', `Save collection #${collection.id} (${collection.title}) to DB`);\n try {\n // Normally, campaign would have already been saved to DB via\n // downloader logic, but we should still save it one more\n // time just in case. Difference is, we do not overwrite \n // DB entry if it already exists.\n this.saveCampaign(campaign, new Date(), false);\n\n const collectionExists = this.checkCollectionExists(collection.id);\n if (collectionExists && !overwriteIfExists) {\n return;\n }\n\n if (collection.thumbnail) {\n this.saveMedia(collection.thumbnail);\n }\n\n if (!collectionExists) {\n this.log('debug', `INSERT collection \"${collection.title}\" (${collection.id})`);\n this.run(\n `\n INSERT INTO collection (\n collection_id,\n campaign_id,\n title,\n created_at,\n edited_at,\n details\n )\n VALUES (?, ?, ?, ?, ?, ?)\n `,\n [\n collection.id,\n campaign?.id || '-1',\n collection.title,\n this.#publishedAtToTime(collection.createdAt),\n this.#publishedAtToTime(collection.editedAt),\n JSON.stringify(collection)\n ]\n );\n } else {\n this.log('debug', `Collection #${collection.id} already exists in DB - update record`);\n this.run(`\n UPDATE collection\n SET\n title = ?,\n created_at = ?,\n edited_at = ?,\n details = ?\n WHERE\n collection_id = ? AND\n campaign_id = ?\n `,\n [\n collection.title,\n this.#publishedAtToTime(collection.createdAt),\n this.#publishedAtToTime(collection.editedAt),\n JSON.stringify(collection),\n collection.id,\n campaign?.id || '-1'\n ]\n );\n }\n } catch (error) {\n this.log(\n 'error',\n `Failed to save collection \"${collection.title}\" (${collection.id}) to DB:`,\n error\n );\n }\n }\n\n savePostTag(tag: PostTag, campaign: Campaign | null, overwriteIfExists = true) {\n this.log('debug', `Save post_tag \"${tag.id}\" to DB`);\n try {\n // Normally, campaign would have already been saved to DB via\n // downloader logic, but we should still save it one more\n // time just in case. Difference is, we do not overwrite \n // DB entry if it already exists.\n this.saveCampaign(campaign, new Date(), false);\n\n const tagExists = this.checkPostTagExists(tag.id, campaign);\n if (tagExists && !overwriteIfExists) {\n return;\n }\n\n if (!tagExists) {\n this.log('debug', `INSERT post_tag \"${tag.id}\"`);\n this.run(\n `\n INSERT INTO post_tag (\n post_tag_id,\n campaign_id,\n value,\n details\n )\n VALUES (?, ?, ?, ?)\n `,\n [\n tag.id,\n campaign?.id || '-1',\n tag.value,\n JSON.stringify(tag)\n ]\n );\n } else {\n this.log('debug', `post_tag \"${tag.id}\" already exists in DB - update record`);\n this.run(`\n UPDATE post_tag\n SET\n value = ?,\n details = ?\n WHERE\n post_tag_id = ? AND\n campaign_id = ?\n `,\n [\n tag.value,\n JSON.stringify(tag),\n tag.id,\n campaign?.id || '-1'\n ]\n );\n }\n } catch (error) {\n this.log(\n 'error',\n `Failed to save post_tag \"${tag.id}\" to DB:`,\n error\n );\n }\n }\n\n getCollection(id: string) {\n this.log('debug', `Get collection #${id} from DB`);\n try {\n const result = this.get(\n `\n SELECT\n campaign_id,\n details,\n (SELECT COUNT(post_id) AS post_count FROM post_collection WHERE collection_id = ?) AS post_count\n FROM collection\n WHERE collection_id = ?;\n `,\n [id, id]\n );\n if (result) {\n const collection = JSON.parse(result.details) as Collection;\n collection.numPosts = result.post_count || 0;\n return {\n collection,\n campaignId: result.campaign_id as string\n };\n }\n return null;\n } catch (error) {\n this.log('error', `Failed to get collection #${id} from DB:`, error);\n return null;\n }\n }\n\n #savePostCollection(post: Post) {\n this.log('debug', `Clear post_collection for post #${post.id}`);\n this.run(`DELETE FROM post_collection WHERE post_id = ?`, [\n post.id\n ]);\n if (!post.collections || post.collections.length === 0) {\n return;\n }\n for (const collection of post.collections) {\n // Normally, collection would have already been saved to DB via\n // downloader logic, but we should still save it one more\n // time just in case. Difference is, we do not overwrite \n // DB entry if it already exists.\n this.saveCollection(collection, post.campaign, false);\n try {\n this.run(\n `\n INSERT INTO post_collection (\n collection_id,\n campaign_id,\n post_id,\n post_created_at\n )\n VALUES (?, ?, ?, ?)\n `,\n [\n collection.id,\n post.campaign?.id || '-1',\n post.id,\n this.#publishedAtToTime(collection.createdAt)\n ]\n );\n }\n catch (error) {\n this.log('error', `Failed to save post_collection for post #${post.id} -> collection #${collection.id}:`, error);\n }\n }\n }\n\n getCollectionList(params: GetCollectionListParams): CollectionList {\n const { campaign, search, sortBy, limit, offset } = params;\n const campaignId = typeof campaign === 'string' ? campaign : campaign.id;\n\n const whereClauseParts: string[] = [ 'campaign_id = ?' ];\n const whereValues: (string | number)[] = [ campaignId ];\n if (search) {\n whereClauseParts.push('collection_fts MATCH ?');\n whereValues.push(search);\n }\n const whereClause = whereClauseParts.length > 0 ? 'WHERE ' + whereClauseParts.join(' AND ') : '';\n\n let orderByClause: string;\n switch (sortBy) {\n case 'a-z':\n orderByClause = 'collection.title ASC';\n break;\n case 'z-a':\n orderByClause = 'collection.title DESC';\n break;\n case 'last_created':\n orderByClause = 'created_at DESC';\n break;\n case 'last_updated':\n orderByClause = 'edited_at DESC';\n break;\n default:\n orderByClause = '';\n }\n if (orderByClause) {\n orderByClause = `ORDER BY ${orderByClause}`;\n }\n\n let limitOffsetClause = '';\n const limitOffsetValues: number[] = [];\n if (limit !== undefined && offset !== undefined) {\n limitOffsetClause = 'LIMIT ? OFFSET ?';\n limitOffsetValues.push(limit, offset);\n }\n else if (limit !== undefined) {\n limitOffsetClause = 'LIMIT ?';\n limitOffsetValues.push(limit);\n }\n\n let fromClause: string;\n if (search) {\n fromClause = `\n FROM\n collection_fts\n LEFT JOIN\n collection_fts_source ON collection_fts_source.fts_rowid = collection_fts.rowid\n LEFT JOIN\n collection ON collection.collection_id = collection_fts_source.collection_id\n `;\n } else {\n fromClause = 'FROM collection';\n }\n\n const rows = this.all(\n `\n SELECT\n details, post_count\n ${fromClause}\n LEFT JOIN\n (SELECT COUNT(post_id) AS post_count, collection_id FROM post_collection GROUP BY collection_id) pcc ON pcc.collection_id = collection.collection_id\n ${whereClause}\n ${orderByClause}\n ${limitOffsetClause}\n `,\n [...whereValues, ...limitOffsetValues]\n );\n const totalResult = this.get(\n `SELECT COUNT(*) AS collection_count ${fromClause} ${whereClause}`,\n [...whereValues]\n );\n const total = totalResult ? (totalResult.collection_count as number) : 0;\n const collections = rows.map((row) => {\n const collection = JSON.parse(row.details) as Collection;\n collection.numPosts = row.post_count || 0;\n return collection;\n });\n return {\n collections,\n total\n };\n }\n\n checkCollectionExists(id: string) {\n this.log('debug', `Check if collection #${id} exists in DB`);\n try {\n const result = this.get(\n `\n SELECT COUNT(*) as count\n FROM collection\n WHERE\n collection_id = ?\n `,\n [ id ]\n );\n return result.count > 0;\n } catch (error) {\n this.log(\n 'error',\n `Failed to check if collection #${id} exists in DB:`,\n error\n );\n return false;\n }\n }\n\n checkPostTagExists(id: string, campaign: Campaign | null) {\n this.log('debug', `Check if tag \"${id}\" exists in DB`);\n try {\n const result = this.get(\n `\n SELECT COUNT(*) as count\n FROM post_tag\n WHERE\n post_tag_id = ? AND\n campaign_id = ?\n `,\n [ id, campaign?.id || '-1']\n );\n return result.count > 0;\n } catch (error) {\n this.log(\n 'error',\n `Failed to check if post_tag \"${id}\" exists in DB:`,\n error\n );\n return false;\n }\n }\n\n getPostComments(post: Post | string): Comment[] | null {\n const postId = typeof post === 'string' ? post : post.id;\n this.log('debug', `Get comments for post #${postId}`);\n const result = this.get(\n `SELECT comments FROM post_comments WHERE post_id = ?`,\n [postId]\n );\n return result ? JSON.parse(result.comments) : null; \n }\n\n #savePostTags(post: Post) {\n this.log('debug', `Clear post_tag_post for post #${post.id}`);\n this.run(`DELETE FROM post_tag_post WHERE post_id = ?`, [\n post.id\n ]);\n if (!post.tags || post.tags.length === 0) {\n return;\n }\n for (const tag of post.tags) {\n this.savePostTag(tag, post.campaign, false);\n try {\n this.run(\n `\n INSERT INTO post_tag_post (\n post_tag_id,\n campaign_id,\n post_id\n )\n VALUES (?, ?, ?)\n `,\n [\n tag.id,\n post.campaign?.id || '-1',\n post.id\n ]\n );\n }\n catch (error) {\n this.log('error', `Failed to save post_tag_post for post #${post.id} -> post_tag \"${tag.id}\":`, error);\n }\n }\n }\n\n getPostTagList(params: GetPostTagListParams): PostTagList {\n const { campaign } = params;\n const campaignId = typeof campaign === 'string' ? campaign : campaign.id;\n\n const whereClauseParts: string[] = [ 'campaign_id = ?' ];\n const whereValues: (string | number)[] = [ campaignId ]; \n const whereClause = `WHERE ${whereClauseParts.join(' AND ')}`;\n const orderByClause = 'ORDER BY post_tag.value ASC';\n const fromClause = 'FROM post_tag';\n\n const rows = this.all(\n `\n SELECT\n details\n ${fromClause}\n ${whereClause}\n ${orderByClause}\n `,\n [...whereValues]\n );\n const totalResult = this.get(\n `SELECT COUNT(*) AS tag_count ${fromClause} ${whereClause}`,\n [...whereValues]\n );\n const total = totalResult ? (totalResult.tag_count as number) : 0;\n const tags = rows.map((row) => {\n return JSON.parse(row.details) as PostTag;\n });\n return {\n tags,\n total\n };\n }\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContentDBMixin.js","sourceRoot":"","sources":["../../../src/browse/db/ContentDBMixin.ts"],"names":[],"mappings":";;;;;AAEA,OAAO,EAAE,kBAAkB,EAAoB,MAAM,qBAAqB,CAAC;AAI3E,MAAM,UAAU,cAAc,CAAsC,IAAW;;IAC7E,YAAO,MAAM,SAAU,SAAQ,IAAI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6CAA6C,EAAE;gBACtD,IAAI,CAAC,EAAE;aACR,CAAC,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzC,OAAO;YACT,CAAC;YACD,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBAC5B,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBAC5C,IAAI,CAAC;oBACH,IAAI,CAAC,GAAG,CACN;;;;;;;aAOC,EACD;wBACE,GAAG,CAAC,EAAE;wBACN,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,IAAI;wBACzB,IAAI,CAAC,EAAE;qBACR,CACF,CAAC;gBACJ,CAAC;gBACD,OAAO,KAAK,EAAE,CAAC;oBACb,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,0CAA0C,IAAI,CAAC,EAAE,iBAAiB,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;gBACzG,CAAC;YACH,CAAC;QACH,CAAC;WAmCD;AACJ,CAAC","sourcesContent":["import { type Comment, type Downloadable, type Post, type Product, type Tier, type Campaign } from '../../entities';\nimport { type PostTag, type Collection } from '../../entities/Post';\nimport { getYearMonthString, type KeysOfValue } from '../../utils/Misc.js';\nimport { type GetContentContext, type GetPreviousNextContentResult, type ContentList, type ContentType, type GetContentListParams, type PostWithComments, type ContentListSortBy, type GetCollectionListParams, type CollectionList, type GetPostTagListParams, type PostTagList } from '../types/Content.js';\nimport { type CampaignDBConstructor } from './CampaignDBMixin.js';\n\nexport function ContentDBMixin<TBase extends CampaignDBConstructor>(Base: TBase) {\n return class ContentDB extends Base {\n saveContent(content: Post | Product) {\n const title = content.type === 'post' ? content.title : content.name;\n this.log('debug', `Save ${content.type} #${content.id} (${title}) to DB`);\n try {\n // Normally, campaign would have already been saved to DB via\n // downloader logic, but we should still save it one more\n // time just in case. Difference is, we do not overwrite \n // DB entry if it already exists.\n this.saveCampaign(content.campaign, new Date(), false);\n\n const contentExists = this.checkContentExists(content.id, content.type, content.campaign);\n this.exec('BEGIN TRANSACTION');\n\n if (!contentExists) {\n this.log('debug', `INSERT ${content.type} \"${title}\" (${content.id})`);\n this.run(\n `\n INSERT INTO content (\n content_id,\n content_type,\n campaign_id,\n title,\n content_subtype,\n is_viewable,\n published_at,\n details\n )\n VALUES (?, ?, ?, ?, ?, ?, ?, ?)\n `,\n [\n content.id,\n content.type,\n content.campaign?.id || '-1',\n title,\n content.type === 'post' ? content.postType : content.productType || null,\n (content.type === 'post' ? content.isViewable : content.isAccessible) ? 1 : 0,\n this.#publishedAtToTime(content.publishedAt),\n JSON.stringify(content)\n ]\n );\n } else {\n this.log('debug', `${content.type} #${content.id} already exists in DB - update record`);\n this.run(`\n UPDATE content\n SET\n content_type = ?,\n campaign_id = ?,\n title = ?,\n content_subtype = ?,\n is_viewable = ?,\n published_at = ?,\n details = ?\n WHERE content_id = ?\n `,\n [\n content.type,\n content.campaign?.id || '-1',\n title,\n content.type === 'post' ? content.postType : content.productType || null,\n (content.type === 'post' ? content.isViewable : content.isAccessible) ? 1 : 0,\n this.#publishedAtToTime(content.publishedAt),\n JSON.stringify(content),\n content.id\n ]\n );\n }\n\n // Save content media\n this.#saveContentMedia(content);\n\n // Save tiers and collections and tags\n if (content.type === 'post') {\n this.#savePostTiers(content);\n this.#savePostCollection(content);\n this.#savePostTags(content);\n }\n\n this.exec('COMMIT');\n } catch (error) {\n this.log(\n 'error',\n `Failed to save content \"${title}\" (${content.id}) to DB:`,\n error\n );\n this.exec('ROLLBACK');\n }\n }\n\n #saveContentMedia(\n content: Post | Product\n ) {\n this.log('debug', `Save media for ${content.type} #${content.id} to DB`);\n switch (content.type) {\n case 'post':\n this.#savepostMedia(content);\n break;\n case 'product':\n this.#saveProductMedia(content);\n break;\n }\n }\n\n #savepostMedia(post: Post) {\n const mediaProps: KeysOfValue<Post, Downloadable | Downloadable[] | null>[] = [\n 'embed',\n 'attachments',\n 'audio',\n 'audioPreview',\n 'images',\n 'videoPreview',\n 'video'\n ];\n if (post.coverImage) {\n this.saveMedia(post.coverImage);\n }\n if (post.thumbnail) {\n this.saveMedia(post.thumbnail);\n }\n for (const prop of mediaProps) {\n if (post[prop]) {\n const data = post[prop];\n const downloadables = (Array.isArray(data) ? data : [data])\n .filter((data) => data !== undefined);\n downloadables.forEach((dl, index) => this.#doSaveContentMedia(\n post,\n dl,\n index,\n prop === 'audioPreview'||\n prop === 'videoPreview' ||\n (prop === 'images' && !post.isViewable)\n ));\n }\n }\n }\n\n #saveProductMedia(product: Product) {\n const mediaProps: KeysOfValue<Product, Downloadable[]>[] = [\n 'contentMedia',\n 'previewMedia'\n ];\n for (const prop of mediaProps) {\n if (product[prop]) {\n const data = product[prop];\n const downloadables = (Array.isArray(data) ? data : [data])\n .filter((data) => data !== undefined);\n downloadables.forEach((dl, index) => this.#doSaveContentMedia(\n product,\n dl,\n index,\n prop === 'previewMedia'\n ));\n }\n }\n }\n\n #doSaveContentMedia(\n content: Post | Product,\n media: Downloadable,\n mediaIndex: number,\n isPreview: boolean\n ) {\n if (!media.downloaded || !media.downloaded.path) {\n return;\n }\n this.log('debug',\n `Save ${content.type} media to DB`,\n `(${content.type} ID: ${content.id}, media ID: ${media.id})`\n );\n this.saveMedia(media);\n try {\n const contentMediaExists = this.checkContentMediaExists(content, media);\n if (!contentMediaExists) {\n this.run(\n `\n INSERT INTO content_media (\n media_id,\n content_id,\n content_type,\n media_index,\n campaign_id,\n is_preview\n )\n VALUES (?, ?, ?, ?, ?, ?)\n `,\n [\n media.id,\n content.id,\n content.type,\n mediaIndex,\n content.campaign?.id || '-1',\n isPreview ? 1 : 0\n ]\n );\n }\n else {\n this.log('debug',\n `${content.type} media already exists in DB`,\n `(${content.type} ID: ${content.id}, media ID: ${media.id})`,\n '- update record'\n );\n this.run(\n `\n UPDATE content_media\n SET\n content_id = ?,\n content_type = ?,\n media_index = ?,\n campaign_id = ?,\n is_preview = ?\n WHERE\n media_id = ?\n `,\n [\n content.id,\n content.type,\n mediaIndex,\n content.campaign?.id || '-1',\n isPreview ? 1 : 0,\n media.id,\n ]\n );\n }\n }\n catch (error) {\n this.log(\n 'error',\n `Failed to save content media (type: ${content.type}, content_id: ${content.id}, media_id: ${media.id}) to DB:`,\n error\n );\n throw error;\n }\n }\n\n #publishedAtToTime(publishedAt: string | null) {\n try {\n if (!publishedAt) {\n return null;\n }\n return new Date(publishedAt).getTime();\n }\n catch (error) {\n this.log('warn', `Failed to convert publishedAt value \"${publishedAt}\" to date integer:`, error);\n return null;\n }\n }\n\n #savePostTiers(post: Post) {\n this.log('debug', `Save tiers for post #${post.id} to DB`);\n // Clear existing tiers for post\n this.log('debug', `Clear existing tiers in DB for post #${post.id} before saving current ones`);\n this.run(`DELETE FROM post_tier WHERE post_id = ?`, [\n post.id\n ]);\n post.tiers.forEach((tier) => this.#doSaveTier(post, tier));\n }\n\n #doSaveTier(post: Post, tier: Tier) {\n this.log('debug', `Add post tier #${tier.id} (${tier.title}) to DB`);\n this.run(`\n INSERT INTO post_tier (\n post_id,\n tier_id,\n campaign_id\n )\n VALUES (?, ?, ?)\n `,\n [\n post.id,\n tier.id,\n post.campaign?.id || '-1'\n ]);\n }\n\n savePostComments(post: Post, comments: Comment[]) {\n try {\n this.log('debug', `Save comments for post #${post.id}`);\n const commentsExist = this.checkPostCommentsExist(post);\n if (!commentsExist) {\n this.run(\n `\n INSERT INTO post_comments (\n post_id,\n comment_count,\n comments\n )\n VALUES (?, ?, ?)\n `,\n [\n post.id,\n post.commentCount,\n JSON.stringify(comments)\n ]\n );\n }\n else {\n this.log('debug', `Comments for post #${post.id} already exists in DB - update record`);\n this.run(\n `\n UPDATE post_comments\n SET\n comment_count = ?,\n comments = ?\n WHERE\n post_id = ?\n `,\n [\n post.commentCount,\n JSON.stringify(comments),\n post.id\n ]\n );\n }\n }\n catch (error) {\n this.log(\n 'error',\n `Failed to save comments for post #${post.id} to DB:`,\n error\n );\n throw error;\n }\n }\n\n checkPostCommentsExist(post: Post) {\n try {\n const result = this.get(\n `\n SELECT COUNT(*) as count\n FROM post_comments\n WHERE\n post_id = ?\n `,\n [ post.id ]\n );\n return result.count > 0;\n } catch (error) {\n this.log(\n 'error',\n `Failed to check if comments for post #${post.id} exist in DB:`,\n error\n );\n return false;\n }\n }\n\n getContent(id: string, contentType: 'post'): PostWithComments | null;\n getContent(id: string, contentType: 'product'): Product | null;\n getContent(id: string, contentType: ContentType) {\n this.log('debug', `Get ${contentType} #${id} from DB`);\n const result = this.get(\n `\n SELECT\n details,\n IFNULL(post_comments.comment_count, 0) AS comment_count,\n comments\n FROM\n content\n LEFT JOIN\n post_comments ON post_comments.post_id = content.content_id AND content.content_type = 'post'\n WHERE\n content_id = ? AND content_type = ?`,\n [id, contentType]\n );\n return result ? this.#parseContentRowJoinedComments(result) : null;\n }\n\n getPreviousNextContent<T extends ContentType>(\n content: Post | Product,\n context: GetContentContext<T>\n ): GetPreviousNextContentResult<T> {\n let previousWhere: string;\n let previousSortBy: ContentListSortBy;\n let nextWhere: string;\n let nextSortBy: ContentListSortBy;\n let whereValues: any[];\n const sortBy = context.sortBy ?? 'latest';\n const publishedAt = this.#publishedAtToTime(content.publishedAt);\n const title = content.type === 'post' ? content.title : content.name;\n switch (sortBy) {\n case 'a-z':\n case 'z-a': {\n const p = `\n (\n (title < ?)\n OR\n (title = ? AND published_at > ?)\n OR\n (title = ? AND published_at = ? AND content_id > ?)\n )\n `;\n const n = `\n (\n (title > ?)\n OR\n (title = ? AND published_at < ?)\n OR\n (title = ? AND published_at = ? AND content_id < ?)\n )\n `;\n whereValues = [title, title, publishedAt, title, publishedAt, content.id];\n if (sortBy === 'a-z') {\n previousWhere = p;\n previousSortBy = 'z-a';\n nextWhere = n;\n nextSortBy = 'a-z';\n }\n else { // z-a\n previousWhere = n;\n previousSortBy = 'a-z';\n nextWhere = p;\n nextSortBy = 'z-a';\n }\n break;\n }\n case 'latest':\n case 'oldest':\n case 'best_match': {\n const older = `\n (\n (published_at < ?)\n OR\n (published_at = ? AND content_id < ?)\n )\n `;\n const newer = `\n (\n (published_at > ?)\n OR\n (published_at = ? AND content_id > ?)\n )\n `;\n whereValues = [publishedAt, publishedAt, content.id];\n if (sortBy === 'latest') {\n previousWhere = newer;\n previousSortBy = 'oldest';\n nextWhere = older;\n nextSortBy = 'latest';\n }\n else { // oldest\n previousWhere = older;\n previousSortBy = 'latest';\n nextWhere = newer;\n nextSortBy = 'oldest';\n }\n break;\n }\n }\n const previous = (this.getContentList(\n {\n ...context,\n search: context.search,\n sortBy: previousSortBy,\n limit: 1, offset: 0\n },\n {\n whereClauses: [previousWhere],\n whereValues\n },\n false\n )).items[0] || null;\n const next = (this.getContentList(\n {\n ...context,\n search: context.search,\n sortBy: nextSortBy,\n limit: 1, offset: 0\n },\n {\n whereClauses: [nextWhere],\n whereValues\n },\n false\n )).items[0] || null;\n\n return {\n previous,\n next\n } as GetPreviousNextContentResult<T>;\n }\n\n getContentList<T extends ContentType>(\n params: GetContentListParams<T>,\n db?: { whereClauses: string[]; whereValues: any[]; },\n includeTotal = true\n ): ContentList<T> {\n const { campaign, type: contentType, isViewable, datePublished, search, sortBy, limit, offset } = params;\n const { whereClauses: extraWhereClauses = [], whereValues: extraWhereValues = [] } = db || {};\n const campaignId = !campaign ? null : (typeof campaign === 'string' ? campaign : campaign.id);\n const tiers = params.type === 'post' ? (params as GetContentListParams<'post'>).tiers : null;\n const collection = params.type === 'post' ? (params as GetContentListParams<'post'>).collection : null;\n const tag = params.type === 'post' ? (params as GetContentListParams<'post'>).tag : null;\n this.log('debug', `Get ${contentType}s from DB:`, {\n campaign: campaignId,\n isViewable,\n datePublished,\n search,\n tiers: params.type === 'post' ? JSON.stringify(tiers) : 'N/A',\n collection: params.type === 'post' ? JSON.stringify(collection) : 'N/A',\n tag: params.type === 'post' ? JSON.stringify(tag) : 'N/A',\n sortBy,\n limit,\n offset\n });\n const contentSubtypes = params.type === 'post' ? (params as GetContentListParams<'post'>).postTypes : null;\n if (tiers && tiers.length > 0 && !campaign) {\n throw Error('Invalid params: \"tiers\" must be used with \"campaign\"');\n }\n if (search && !contentType) {\n throw Error('Invalid params: \"search\" must be used with \"contentType\"');\n }\n const joinParts: string[] = [];\n if (tiers && tiers.length > 0) {\n joinParts.push('LEFT JOIN post_tier ON post_tier.post_id = content.content_id');\n }\n if (collection) {\n joinParts.push(`LEFT JOIN post_collection ON post_collection.post_id = content.content_id`);\n }\n if (tag) {\n joinParts.push(`LEFT JOIN post_tag_post ON post_tag_post.post_id = content.content_id AND post_tag_post.campaign_id = content.campaign_id`);\n }\n const join = joinParts.join(' ');\n const whereEquals: { column: string; value: string | number; }[] = [];\n if (campaignId) {\n whereEquals.push({ column: 'content.campaign_id', value: campaignId });\n }\n if (contentType) {\n whereEquals.push({ column: 'content_type', value: contentType });\n }\n if (isViewable !== undefined) {\n whereEquals.push({ column: 'is_viewable', value: isViewable ? 1 : 0});\n }\n if (datePublished) {\n const strftimeFormat =\n /^\\d{4}$/.test(datePublished) ? '%Y' :\n /^\\d{4}-\\d{2}$/.test(datePublished) ? '%Y-%m'\n : null;\n if (!strftimeFormat) {\n throw Error('Invalid params: \"datePublished\" must be in format \"YYYY\" or \"YYYY-MM\" (e.g. \"2025-06\")');\n }\n whereEquals.push({\n column: `strftime('${strftimeFormat}', datetime(published_at / 1000, 'unixepoch'))`,\n value: datePublished\n });\n }\n if (collection) {\n whereEquals.push({\n column: 'post_collection.collection_id',\n value: typeof collection === 'string' ? collection : collection.id\n });\n }\n if (tag) {\n whereEquals.push({\n column: 'post_tag_post.post_tag_id',\n value: typeof tag === 'string' ? tag : tag.id\n });\n }\n const whereIns: { column: string; values: (string | number)[] }[] = [];\n if (contentSubtypes && contentSubtypes.length > 0) {\n whereIns.push({ column: 'content_subtype', values: contentSubtypes})\n }\n if (tiers && tiers.length > 0) {\n const ids = tiers.map((tier) => typeof tier === 'string' ? tier : tier.id);\n whereIns.push({ column: 'tier_id', values: ids });\n }\n const whereClauseParts: string[] = [];\n if (whereEquals.length > 0) {\n whereClauseParts.push(...whereEquals.map(({column: field}) => `${field} = ?` ));\n }\n if (whereIns.length > 0) {\n whereClauseParts.push(...whereIns.map((wi) => `${wi.column} IN (${wi.values.map(() => '?').join(', ')})`));\n }\n if (search) {\n whereClauseParts.push(`${contentType}_fts MATCH ?`);\n }\n whereClauseParts.push(...extraWhereClauses);\n const whereClause = whereClauseParts.length > 0 ? 'WHERE ' + whereClauseParts.join(' AND ') : '';\n const whereValues = [\n ...whereEquals.map(({value}) => value),\n ...whereIns.reduce<(string | number)[]>((result, {values}) => {\n result.push(...values);\n return result;\n }, [])\n ];\n if (search) {\n whereValues.push(search); \n }\n whereValues.push(...extraWhereValues);\n let orderByClause: string;\n switch (sortBy) {\n case 'a-z':\n orderByClause = 'title ASC';\n break;\n case 'z-a':\n orderByClause = 'title DESC';\n break;\n case 'latest':\n orderByClause = 'published_at DESC';\n break;\n case 'oldest':\n orderByClause = 'published_at ASC';\n break;\n case 'best_match':\n orderByClause = `ORDER BY bm25(${contentType}_fts) DESC`;\n break;\n default:\n orderByClause = '';\n }\n if (orderByClause) {\n orderByClause = `ORDER BY ${orderByClause}`;\n }\n let limitOffsetClause = '';\n const limitOffsetValues: number[] = [];\n if (limit !== undefined && offset !== undefined) {\n limitOffsetClause = 'LIMIT ? OFFSET ?';\n limitOffsetValues.push(limit, offset);\n }\n else if (limit !== undefined) {\n limitOffsetClause = 'LIMIT ?';\n limitOffsetValues.push(limit);\n }\n\n let fromClause: string;\n if (search) {\n fromClause = `\n FROM\n ${contentType}_fts\n LEFT JOIN\n ${contentType}_fts_source ON ${contentType}_fts_source.fts_rowid = ${contentType}_fts.rowid\n LEFT JOIN\n content ON content.content_id = ${contentType}_fts_source.${contentType}_id\n `;\n } else {\n fromClause = 'FROM content';\n }\n\n const rows = this.all(\n `\n SELECT DISTINCT\n details,\n IFNULL(post_comments.comment_count, 0) AS comment_count,\n comments\n ${fromClause}\n LEFT JOIN\n post_comments ON post_comments.post_id = content.content_id AND content.content_type = 'post'\n ${join}\n ${whereClause}\n ${orderByClause}\n ${limitOffsetClause}\n `,\n [ ...whereValues, ...limitOffsetValues ]\n );\n const items = rows.map<T extends 'post' ? PostWithComments : T extends 'product' ? Product : PostWithComments | Product>((row) => this.#parseContentRowJoinedComments(row));\n const totalResult = includeTotal ? this.get(\n `SELECT COUNT(*) AS content_count ${fromClause} ${join} ${whereClause}`,\n [...whereValues]\n ) : null;\n const total = totalResult ? (totalResult.content_count as number) : 0;\n return {\n items,\n total\n };\n }\n\n /**\n * \n * @param row Must have `details`, `comment_count` and `comments`\n * @returns \n */\n #parseContentRowJoinedComments(row: any) {\n const details = JSON.parse(row.details);\n if (!Reflect.has(details, 'type')) {\n return details;\n }\n switch (details.type) {\n case 'post': {\n // `comment_count` column somehow created as string type\n // Cast it back to number as some were saved as decimals (e.g. \"2.0\")\n const commentCount = Number(row.comment_count) || 0;\n const comments = row.comments !== null ? JSON.parse(row.comments) : null;\n return {\n ...details,\n commentCount,\n comments\n } satisfies PostWithComments;\n }\n case 'product':\n default:\n return details;\n }\n }\n\n getContentCountByDate(\n contentType: ContentType,\n groupBy: 'year' | 'month',\n filter?: {\n campaign?: Campaign | string | null,\n date?: Date | null}\n ) {\n const campaign = filter?.campaign || null;\n const campaignId = !campaign ? null : (typeof campaign === 'string' ? campaign : campaign.id);\n this.log('debug', `Get ${contentType} count by date:`, {\n groupBy,\n filter: !filter ? null : {\n campaign: campaignId,\n date: filter.date\n }\n });\n const date = filter?.date || null;\n const whereClauseParts = ['content_type = ?'];\n const whereValues: string[] = [contentType];\n if (campaignId) {\n whereClauseParts.push('campaign_id = ?');\n whereValues.push(campaignId);\n }\n if (date) {\n whereClauseParts.push(`dt = ?`);\n const value = groupBy === 'year' ?\n String(date.getUTCFullYear())\n : getYearMonthString(date);\n whereValues.push(String(value));\n }\n const whereClause = `WHERE ${whereClauseParts.join(' AND ')}`;\n const strftimeFormat = groupBy === 'year' ? '%Y' : '%Y-%m'\n const rows = this.all(\n `\n SELECT\n COUNT(content_id) AS content_count,\n strftime('${strftimeFormat}',\n datetime(published_at / 1000, 'unixepoch')) AS dt\n FROM\n content\n ${whereClause}\n GROUP BY dt\n ORDER BY dt DESC\n `,\n [...whereValues]\n );\n return rows.map((row) => ({\n dt: row.dt as string,\n count: row.content_count as number\n }));\n }\n\n getPostCountByType(campaign: Campaign | string) {\n const campaignId = typeof campaign === 'string' ? campaign : campaign.id;\n this.log('debug', `Get post count by type for campaign #${campaignId}`);\n const rows = this.all(\n `\n SELECT\n COUNT(content_id) AS post_count, content_subtype AS post_type\n FROM\n content\n WHERE\n content_type = 'post' AND campaign_id = ?\n GROUP BY content_subtype \n `,\n [campaignId]\n );\n return rows.map((row) => ({\n postType: row.post_type as string,\n count: row.post_count as number\n }));\n }\n\n getPostCountByTier(campaign: Campaign | string) {\n const campaignId = typeof campaign === 'string' ? campaign : campaign.id;\n this.log('debug', `Get post count by tier for campaign #${campaignId}`);\n const rows = this.all(\n `\n SELECT\n COUNT(post_id) as post_count, tier_id, reward.title\n FROM post_tier\n RIGHT JOIN reward ON reward.reward_id = post_tier.tier_id AND reward.campaign_id = post_tier.campaign_id\n WHERE\n post_tier.campaign_id = ?\n GROUP BY\n tier_id\n `,\n [campaignId]\n );\n return rows.map((row) => ({\n tierId: row.tier_id as string,\n title: row.title as string,\n count: row.post_count as number\n }));\n }\n\n checkContentExists(id: string, contentType: ContentType, campaign?: Campaign | null) {\n this.log('debug', `Check if ${contentType} #${id} exists in DB`);\n const whereClauseParts = [\n 'content_id = ?',\n 'content_type = ?'\n ];\n const whereValues = [id, contentType];\n if (campaign !== undefined) {\n whereClauseParts.push('campaign_id = ?');\n whereValues.push(campaign?.id || '-1');\n }\n const whereClause = `WHERE ${whereClauseParts.join(' AND ')}`;\n try {\n const result = this.get(\n `\n SELECT COUNT(*) as count\n FROM content\n ${whereClause}\n `,\n whereValues\n );\n return result.count > 0;\n } catch (error) {\n this.log(\n 'error',\n `Failed to check if ${contentType} #${id} exists in DB:`,\n error\n );\n return false;\n }\n }\n\n saveCollection(collection: Collection, campaign: Campaign | null, overwriteIfExists = true) {\n this.log('debug', `Save collection #${collection.id} (${collection.title}) to DB`);\n try {\n // Normally, campaign would have already been saved to DB via\n // downloader logic, but we should still save it one more\n // time just in case. Difference is, we do not overwrite \n // DB entry if it already exists.\n this.saveCampaign(campaign, new Date(), false);\n\n const collectionExists = this.checkCollectionExists(collection.id);\n if (collectionExists && !overwriteIfExists) {\n return;\n }\n\n if (collection.thumbnail) {\n this.saveMedia(collection.thumbnail);\n }\n\n if (!collectionExists) {\n this.log('debug', `INSERT collection \"${collection.title}\" (${collection.id})`);\n this.run(\n `\n INSERT INTO collection (\n collection_id,\n campaign_id,\n title,\n created_at,\n edited_at,\n details\n )\n VALUES (?, ?, ?, ?, ?, ?)\n `,\n [\n collection.id,\n campaign?.id || '-1',\n collection.title,\n this.#publishedAtToTime(collection.createdAt),\n this.#publishedAtToTime(collection.editedAt),\n JSON.stringify(collection)\n ]\n );\n } else {\n this.log('debug', `Collection #${collection.id} already exists in DB - update record`);\n this.run(`\n UPDATE collection\n SET\n title = ?,\n created_at = ?,\n edited_at = ?,\n details = ?\n WHERE\n collection_id = ? AND\n campaign_id = ?\n `,\n [\n collection.title,\n this.#publishedAtToTime(collection.createdAt),\n this.#publishedAtToTime(collection.editedAt),\n JSON.stringify(collection),\n collection.id,\n campaign?.id || '-1'\n ]\n );\n }\n } catch (error) {\n this.log(\n 'error',\n `Failed to save collection \"${collection.title}\" (${collection.id}) to DB:`,\n error\n );\n }\n }\n\n savePostTag(tag: PostTag, campaign: Campaign | null, overwriteIfExists = true) {\n this.log('debug', `Save post_tag \"${tag.id}\" to DB`);\n try {\n // Normally, campaign would have already been saved to DB via\n // downloader logic, but we should still save it one more\n // time just in case. Difference is, we do not overwrite \n // DB entry if it already exists.\n this.saveCampaign(campaign, new Date(), false);\n\n const tagExists = this.checkPostTagExists(tag.id, campaign);\n if (tagExists && !overwriteIfExists) {\n return;\n }\n\n if (!tagExists) {\n this.log('debug', `INSERT post_tag \"${tag.id}\"`);\n this.run(\n `\n INSERT INTO post_tag (\n post_tag_id,\n campaign_id,\n value,\n details\n )\n VALUES (?, ?, ?, ?)\n `,\n [\n tag.id,\n campaign?.id || '-1',\n tag.value,\n JSON.stringify(tag)\n ]\n );\n } else {\n this.log('debug', `post_tag \"${tag.id}\" already exists in DB - update record`);\n this.run(`\n UPDATE post_tag\n SET\n value = ?,\n details = ?\n WHERE\n post_tag_id = ? AND\n campaign_id = ?\n `,\n [\n tag.value,\n JSON.stringify(tag),\n tag.id,\n campaign?.id || '-1'\n ]\n );\n }\n } catch (error) {\n this.log(\n 'error',\n `Failed to save post_tag \"${tag.id}\" to DB:`,\n error\n );\n }\n }\n\n getCollection(id: string) {\n this.log('debug', `Get collection #${id} from DB`);\n try {\n const result = this.get(\n `\n SELECT\n campaign_id,\n details,\n (SELECT COUNT(post_id) AS post_count FROM post_collection WHERE collection_id = ?) AS post_count\n FROM collection\n WHERE collection_id = ?;\n `,\n [id, id]\n );\n if (result) {\n const collection = JSON.parse(result.details) as Collection;\n collection.numPosts = result.post_count || 0;\n return {\n collection,\n campaignId: result.campaign_id as string\n };\n }\n return null;\n } catch (error) {\n this.log('error', `Failed to get collection #${id} from DB:`, error);\n return null;\n }\n }\n\n #savePostCollection(post: Post) {\n this.log('debug', `Clear post_collection for post #${post.id}`);\n this.run(`DELETE FROM post_collection WHERE post_id = ?`, [\n post.id\n ]);\n if (!post.collections || post.collections.length === 0) {\n return;\n }\n for (const collection of post.collections) {\n // Normally, collection would have already been saved to DB via\n // downloader logic, but we should still save it one more\n // time just in case. Difference is, we do not overwrite \n // DB entry if it already exists.\n this.saveCollection(collection, post.campaign, false);\n try {\n this.run(\n `\n INSERT INTO post_collection (\n collection_id,\n campaign_id,\n post_id,\n post_created_at\n )\n VALUES (?, ?, ?, ?)\n `,\n [\n collection.id,\n post.campaign?.id || '-1',\n post.id,\n this.#publishedAtToTime(collection.createdAt)\n ]\n );\n }\n catch (error) {\n this.log('error', `Failed to save post_collection for post #${post.id} -> collection #${collection.id}:`, error);\n }\n }\n }\n\n getCollectionList(params: GetCollectionListParams): CollectionList {\n const { campaign, search, sortBy, limit, offset } = params;\n const campaignId = typeof campaign === 'string' ? campaign : campaign.id;\n\n const whereClauseParts: string[] = [ 'campaign_id = ?' ];\n const whereValues: (string | number)[] = [ campaignId ];\n if (search) {\n whereClauseParts.push('collection_fts MATCH ?');\n whereValues.push(search);\n }\n const whereClause = whereClauseParts.length > 0 ? 'WHERE ' + whereClauseParts.join(' AND ') : '';\n\n let orderByClause: string;\n switch (sortBy) {\n case 'a-z':\n orderByClause = 'collection.title ASC';\n break;\n case 'z-a':\n orderByClause = 'collection.title DESC';\n break;\n case 'last_created':\n orderByClause = 'created_at DESC';\n break;\n case 'last_updated':\n orderByClause = 'edited_at DESC';\n break;\n default:\n orderByClause = '';\n }\n if (orderByClause) {\n orderByClause = `ORDER BY ${orderByClause}`;\n }\n\n let limitOffsetClause = '';\n const limitOffsetValues: number[] = [];\n if (limit !== undefined && offset !== undefined) {\n limitOffsetClause = 'LIMIT ? OFFSET ?';\n limitOffsetValues.push(limit, offset);\n }\n else if (limit !== undefined) {\n limitOffsetClause = 'LIMIT ?';\n limitOffsetValues.push(limit);\n }\n\n let fromClause: string;\n if (search) {\n fromClause = `\n FROM\n collection_fts\n LEFT JOIN\n collection_fts_source ON collection_fts_source.fts_rowid = collection_fts.rowid\n LEFT JOIN\n collection ON collection.collection_id = collection_fts_source.collection_id\n `;\n } else {\n fromClause = 'FROM collection';\n }\n\n const rows = this.all(\n `\n SELECT\n details, post_count\n ${fromClause}\n LEFT JOIN\n (SELECT COUNT(post_id) AS post_count, collection_id FROM post_collection GROUP BY collection_id) pcc ON pcc.collection_id = collection.collection_id\n ${whereClause}\n ${orderByClause}\n ${limitOffsetClause}\n `,\n [...whereValues, ...limitOffsetValues]\n );\n const totalResult = this.get(\n `SELECT COUNT(*) AS collection_count ${fromClause} ${whereClause}`,\n [...whereValues]\n );\n const total = totalResult ? (totalResult.collection_count as number) : 0;\n const collections = rows.map((row) => {\n const collection = JSON.parse(row.details) as Collection;\n collection.numPosts = row.post_count || 0;\n return collection;\n });\n return {\n collections,\n total\n };\n }\n\n checkCollectionExists(id: string) {\n this.log('debug', `Check if collection #${id} exists in DB`);\n try {\n const result = this.get(\n `\n SELECT COUNT(*) as count\n FROM collection\n WHERE\n collection_id = ?\n `,\n [ id ]\n );\n return result.count > 0;\n } catch (error) {\n this.log(\n 'error',\n `Failed to check if collection #${id} exists in DB:`,\n error\n );\n return false;\n }\n }\n\n checkPostTagExists(id: string, campaign: Campaign | null) {\n this.log('debug', `Check if tag \"${id}\" exists in DB`);\n try {\n const result = this.get(\n `\n SELECT COUNT(*) as count\n FROM post_tag\n WHERE\n post_tag_id = ? AND\n campaign_id = ?\n `,\n [ id, campaign?.id || '-1']\n );\n return result.count > 0;\n } catch (error) {\n this.log(\n 'error',\n `Failed to check if post_tag \"${id}\" exists in DB:`,\n error\n );\n return false;\n }\n }\n\n getPostComments(post: Post | string): Comment[] | null {\n const postId = typeof post === 'string' ? post : post.id;\n this.log('debug', `Get comments for post #${postId}`);\n const result = this.get(\n `SELECT comments FROM post_comments WHERE post_id = ?`,\n [postId]\n );\n return result ? JSON.parse(result.comments) : null; \n }\n\n #savePostTags(post: Post) {\n this.log('debug', `Clear post_tag_post for post #${post.id}`);\n this.run(`DELETE FROM post_tag_post WHERE post_id = ?`, [\n post.id\n ]);\n if (!post.tags || post.tags.length === 0) {\n return;\n }\n for (const tag of post.tags) {\n this.savePostTag(tag, post.campaign, false);\n try {\n this.run(\n `\n INSERT INTO post_tag_post (\n post_tag_id,\n campaign_id,\n post_id\n )\n VALUES (?, ?, ?)\n `,\n [\n tag.id,\n post.campaign?.id || '-1',\n post.id\n ]\n );\n }\n catch (error) {\n this.log('error', `Failed to save post_tag_post for post #${post.id} -> post_tag \"${tag.id}\":`, error);\n }\n }\n }\n\n getPostTagList(params: GetPostTagListParams): PostTagList {\n const { campaign } = params;\n const campaignId = typeof campaign === 'string' ? campaign : campaign.id;\n\n const whereClauseParts: string[] = [ 'campaign_id = ?' ];\n const whereValues: (string | number)[] = [ campaignId ]; \n const whereClause = `WHERE ${whereClauseParts.join(' AND ')}`;\n const orderByClause = 'ORDER BY post_tag.value ASC';\n const fromClause = 'FROM post_tag';\n\n const rows = this.all(\n `\n SELECT\n details\n ${fromClause}\n ${whereClause}\n ${orderByClause}\n `,\n [...whereValues]\n );\n const totalResult = this.get(\n `SELECT COUNT(*) AS tag_count ${fromClause} ${whereClause}`,\n [...whereValues]\n );\n const total = totalResult ? (totalResult.tag_count as number) : 0;\n const tags = rows.map((row) => {\n return JSON.parse(row.details) as PostTag;\n });\n return {\n tags,\n total\n };\n }\n };\n}\n"]}
|
|
@@ -45,13 +45,13 @@ declare const DB: {
|
|
|
45
45
|
} & {
|
|
46
46
|
new (...args: any[]): {
|
|
47
47
|
saveContent(content: import("../../index.js").Post | import("../../index.js").Product): void;
|
|
48
|
-
"__#
|
|
49
|
-
"__#
|
|
50
|
-
"__#
|
|
51
|
-
"__#
|
|
52
|
-
"__#
|
|
53
|
-
"__#
|
|
54
|
-
"__#
|
|
48
|
+
"__#115@#saveContentMedia"(content: import("../../index.js").Post | import("../../index.js").Product): void;
|
|
49
|
+
"__#115@#savepostMedia"(post: import("../../index.js").Post): void;
|
|
50
|
+
"__#115@#saveProductMedia"(product: import("../../index.js").Product): void;
|
|
51
|
+
"__#115@#doSaveContentMedia"(content: import("../../index.js").Post | import("../../index.js").Product, media: import("../../index.js").Downloadable, mediaIndex: number, isPreview: boolean): void;
|
|
52
|
+
"__#115@#publishedAtToTime"(publishedAt: string | null): number | null;
|
|
53
|
+
"__#115@#savePostTiers"(post: import("../../index.js").Post): void;
|
|
54
|
+
"__#115@#doSaveTier"(post: import("../../index.js").Post, tier: import("../../index.js").Tier): void;
|
|
55
55
|
savePostComments(post: import("../../index.js").Post, comments: import("../../index.js").Comment[]): void;
|
|
56
56
|
checkPostCommentsExist(post: import("../../index.js").Post): boolean;
|
|
57
57
|
getContent(id: string, contentType: "post"): import("../types/Content.js").PostWithComments | null;
|
|
@@ -61,7 +61,7 @@ declare const DB: {
|
|
|
61
61
|
whereClauses: string[];
|
|
62
62
|
whereValues: any[];
|
|
63
63
|
} | undefined, includeTotal?: boolean): import("../types/Content.js").ContentList<T>;
|
|
64
|
-
"__#
|
|
64
|
+
"__#115@#parseContentRowJoinedComments"(row: any): any;
|
|
65
65
|
getContentCountByDate(contentType: import("../types/Content.js").ContentType, groupBy: "year" | "month", filter?: {
|
|
66
66
|
campaign?: import("../../index.js").Campaign | string | null;
|
|
67
67
|
date?: Date | null;
|
|
@@ -78,26 +78,26 @@ declare const DB: {
|
|
|
78
78
|
title: string;
|
|
79
79
|
count: number;
|
|
80
80
|
}[];
|
|
81
|
-
checkContentExists(id: string, contentType: import("../types/Content.js").ContentType, campaign
|
|
81
|
+
checkContentExists(id: string, contentType: import("../types/Content.js").ContentType, campaign?: import("../../index.js").Campaign | null): boolean;
|
|
82
82
|
saveCollection(collection: import("../../index.js").Collection, campaign: import("../../index.js").Campaign | null, overwriteIfExists?: boolean): void;
|
|
83
83
|
savePostTag(tag: import("../../index.js").PostTag, campaign: import("../../index.js").Campaign | null, overwriteIfExists?: boolean): void;
|
|
84
84
|
getCollection(id: string): {
|
|
85
85
|
collection: import("../../index.js").Collection;
|
|
86
86
|
campaignId: string;
|
|
87
87
|
} | null;
|
|
88
|
-
"__#
|
|
88
|
+
"__#115@#savePostCollection"(post: import("../../index.js").Post): void;
|
|
89
89
|
getCollectionList(params: import("../types/Content.js").GetCollectionListParams): import("../types/Content.js").CollectionList;
|
|
90
90
|
checkCollectionExists(id: string): boolean;
|
|
91
91
|
checkPostTagExists(id: string, campaign: import("../../index.js").Campaign | null): boolean;
|
|
92
92
|
getPostComments(post: import("../../index.js").Post | string): import("../../index.js").Comment[] | null;
|
|
93
|
-
"__#
|
|
93
|
+
"__#115@#savePostTags"(post: import("../../index.js").Post): void;
|
|
94
94
|
getPostTagList(params: import("../types/Content.js").GetPostTagListParams): import("../types/Content.js").PostTagList;
|
|
95
95
|
saveCampaign(campaign: import("../../index.js").Campaign | null, downloadDate: Date, overwriteIfExists?: boolean): void;
|
|
96
96
|
getCampaign(params: import("../types/Campaign.js").GetCampaignParams): import("../../index.js").Campaign | null;
|
|
97
|
-
"__#
|
|
98
|
-
"__#
|
|
97
|
+
"__#114@#saveRewards"(campaign: import("../../index.js").Campaign): void;
|
|
98
|
+
"__#114@#doSaveReward"(campaign: import("../../index.js").Campaign, reward: import("../../index.js").Reward): void;
|
|
99
99
|
getCampaignList(params: import("../types/Campaign.js").GetCampaignListParams): import("../types/Campaign.js").CampaignList;
|
|
100
|
-
"__#
|
|
100
|
+
"__#114@#getCampaignWithCounts"(params: import("../types/Campaign.js").GetCampaignParams): import("../types/Campaign.js").CampaignWithCounts | null;
|
|
101
101
|
checkCampaignExists(id: string): boolean;
|
|
102
102
|
saveUser(user: import("../../index.js").User | null): void;
|
|
103
103
|
getUserByID(id: string): import("../../index.js").User | null;
|
|
@@ -147,10 +147,10 @@ declare const DB: {
|
|
|
147
147
|
new (...args: any[]): {
|
|
148
148
|
saveCampaign(campaign: import("../../index.js").Campaign | null, downloadDate: Date, overwriteIfExists?: boolean): void;
|
|
149
149
|
getCampaign(params: import("../types/Campaign.js").GetCampaignParams): import("../../index.js").Campaign | null;
|
|
150
|
-
"__#
|
|
151
|
-
"__#
|
|
150
|
+
"__#114@#saveRewards"(campaign: import("../../index.js").Campaign): void;
|
|
151
|
+
"__#114@#doSaveReward"(campaign: import("../../index.js").Campaign, reward: import("../../index.js").Reward): void;
|
|
152
152
|
getCampaignList(params: import("../types/Campaign.js").GetCampaignListParams): import("../types/Campaign.js").CampaignList;
|
|
153
|
-
"__#
|
|
153
|
+
"__#114@#getCampaignWithCounts"(params: import("../types/Campaign.js").GetCampaignParams): import("../types/Campaign.js").CampaignWithCounts | null;
|
|
154
154
|
checkCampaignExists(id: string): boolean;
|
|
155
155
|
saveUser(user: import("../../index.js").User | null): void;
|
|
156
156
|
getUserByID(id: string): import("../../index.js").User | null;
|
|
@@ -43,7 +43,8 @@ _SettingsAPIRequestHandler_api = new WeakMap(), _SettingsAPIRequestHandler_insta
|
|
|
43
43
|
const hasValidThemeValue = Reflect.has(data, 'theme') && typeof data.theme === 'string';
|
|
44
44
|
const hasValidListItemsPerPageValue = Reflect.has(data, 'listItemsPerPage') && typeof data.listItemsPerPage === 'number';
|
|
45
45
|
const hasValidGalleryItemsPerPageValue = Reflect.has(data, 'galleryItemsPerPage') && typeof data.galleryItemsPerPage === 'number';
|
|
46
|
-
|
|
46
|
+
const hasValidMaxContentWidthValue = Reflect.has(data, 'maxContentWidth') && typeof data.maxContentWidth === 'string';
|
|
47
|
+
return hasValidThemeValue && hasValidListItemsPerPageValue && hasValidGalleryItemsPerPageValue && hasValidMaxContentWidthValue;
|
|
47
48
|
};
|
|
48
49
|
export default SettingsAPIRequestHandler;
|
|
49
50
|
//# sourceMappingURL=SettingsAPIRequestHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsAPIRequestHandler.js","sourceRoot":"","sources":["../../../../src/browse/server/handler/SettingsAPIRequestHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAG3C,MAAqB,yBAA0B,SAAQ,WAAW;IAKhE,YAAY,GAAgB,EAAE,MAAsB;QAClD,KAAK,CAAC,MAAM,CAAC,CAAC;;QALhB,SAAI,GAAG,2BAA2B,CAAC;QAEnC,iDAAkB;QAIhB,uBAAA,IAAI,kCAAQ,GAAG,MAAA,CAAC;IAClB,CAAC;IAED,8BAA8B,CAAC,IAAa,EAAE,GAAa;QACzD,GAAG,CAAC,IAAI,CAAC,uBAAA,IAAI,sCAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,iCAAiC,CAAC,IAAa,EAAE,GAAa;QAC5D,GAAG,CAAC,IAAI,CAAC,uBAAA,IAAI,sCAAK,CAAC,uBAAuB,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,+BAA+B,CAAC,GAAY,EAAE,GAAa;QACzD,uBAAA,IAAI,sCAAK,CAAC,kBAAkB,CAAC,uBAAA,IAAI,+FAAwB,MAA5B,IAAI,EAAyB,GAAG,CAAC,CAAC,CAAC;QAChE,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingsAPIRequestHandler.js","sourceRoot":"","sources":["../../../../src/browse/server/handler/SettingsAPIRequestHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAG3C,MAAqB,yBAA0B,SAAQ,WAAW;IAKhE,YAAY,GAAgB,EAAE,MAAsB;QAClD,KAAK,CAAC,MAAM,CAAC,CAAC;;QALhB,SAAI,GAAG,2BAA2B,CAAC;QAEnC,iDAAkB;QAIhB,uBAAA,IAAI,kCAAQ,GAAG,MAAA,CAAC;IAClB,CAAC;IAED,8BAA8B,CAAC,IAAa,EAAE,GAAa;QACzD,GAAG,CAAC,IAAI,CAAC,uBAAA,IAAI,sCAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,iCAAiC,CAAC,IAAa,EAAE,GAAa;QAC5D,GAAG,CAAC,IAAI,CAAC,uBAAA,IAAI,sCAAK,CAAC,uBAAuB,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,+BAA+B,CAAC,GAAY,EAAE,GAAa;QACzD,uBAAA,IAAI,sCAAK,CAAC,kBAAkB,CAAC,uBAAA,IAAI,+FAAwB,MAA5B,IAAI,EAAyB,GAAG,CAAC,CAAC,CAAC;QAChE,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;CAoBF;qNAlByB,GAAY;IAClC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACtB,IAAI,uBAAA,IAAI,yFAAkB,MAAtB,IAAI,EAAmB,IAAI,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,CAAC,8BAA8B,CAAC,CAAC;AAC9C,CAAC,qGAEiB,IAAS;IACzB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC;IACxF,MAAM,6BAA6B,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,kBAAkB,CAAC,IAAI,OAAO,IAAI,CAAC,gBAAgB,KAAK,QAAQ,CAAC;IACzH,MAAM,gCAAgC,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,qBAAqB,CAAC,IAAI,OAAO,IAAI,CAAC,mBAAmB,KAAK,QAAQ,CAAC;IAClI,MAAM,4BAA4B,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,OAAO,IAAI,CAAC,eAAe,KAAK,QAAQ,CAAC;IACtH,OAAO,kBAAkB,IAAI,6BAA6B,IAAI,gCAAgC,IAAI,4BAA4B,CAAC;AACjI,CAAC;eAxCkB,yBAAyB","sourcesContent":["import { type Request, type Response } from 'express';\nimport { type Logger } from '../../../utils/logging';\nimport { type APIInstance } from '../../api';\nimport Basehandler from './BaseHandler.js';\nimport { type BrowseSettings } from '../../types/Settings.js';\n\nexport default class SettingsAPIRequestHandler extends Basehandler {\n name = 'SettingsAPIRequestHandler';\n\n #api: APIInstance;\n\n constructor(api: APIInstance, logger?: Logger | null) {\n super(logger);\n this.#api = api;\n }\n\n handleGetBrowseSettingsRequest(_req: Request, res: Response) {\n res.json(this.#api.getBrowseSettings());\n }\n\n handleBrowseSettingOptionsRequest(_req: Request, res: Response) {\n res.json(this.#api.getBrowseSettingOptions());\n }\n\n handleSaveBrowseSettingsRequest(req: Request, res: Response) {\n this.#api.saveBrowseSettings(this.#retrieveBrowseSettings(req));\n res.sendStatus(200);\n }\n\n #retrieveBrowseSettings(req: Request) {\n const body = req.body;\n if (this.#isBrowseSettings(body)) {\n return body;\n }\n throw Error('Invalid browse settings data');\n }\n\n #isBrowseSettings(data: any): data is BrowseSettings {\n if (typeof data !== 'object' || !data) {\n return false;\n }\n const hasValidThemeValue = Reflect.has(data, 'theme') && typeof data.theme === 'string';\n const hasValidListItemsPerPageValue = Reflect.has(data, 'listItemsPerPage') && typeof data.listItemsPerPage === 'number';\n const hasValidGalleryItemsPerPageValue = Reflect.has(data, 'galleryItemsPerPage') && typeof data.galleryItemsPerPage === 'number';\n const hasValidMaxContentWidthValue = Reflect.has(data, 'maxContentWidth') && typeof data.maxContentWidth === 'string';\n return hasValidThemeValue && hasValidListItemsPerPageValue && hasValidGalleryItemsPerPageValue && hasValidMaxContentWidthValue;\n }\n}"]}
|
|
@@ -3,13 +3,16 @@ export interface BrowseTheme {
|
|
|
3
3
|
value: string;
|
|
4
4
|
stylesheets: string[];
|
|
5
5
|
}
|
|
6
|
+
export type MaxContentWidth = 'Narrower' | 'Standard' | 'Wider';
|
|
6
7
|
export interface BrowseSettings {
|
|
7
8
|
theme: string;
|
|
8
9
|
listItemsPerPage: number;
|
|
9
10
|
galleryItemsPerPage: number;
|
|
11
|
+
maxContentWidth: MaxContentWidth;
|
|
10
12
|
}
|
|
11
13
|
export interface BrowseSettingOptions {
|
|
12
14
|
themes: BrowseTheme[];
|
|
13
15
|
listItemsPerPage: number[];
|
|
14
16
|
galleryItemsPerPage: number[];
|
|
17
|
+
maxContentWidth: MaxContentWidth[];
|
|
15
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../../src/browse/types/Settings.ts"],"names":[],"mappings":"","sourcesContent":["export interface BrowseTheme {\n name: string;\n value: string;\n stylesheets: string[];\n}\n\nexport interface BrowseSettings {\n theme: string;\n listItemsPerPage: number;\n galleryItemsPerPage: number;\n}\n\nexport interface BrowseSettingOptions {\n themes: BrowseTheme[];\n listItemsPerPage: number[];\n galleryItemsPerPage: number[];\n}"]}
|
|
1
|
+
{"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../../src/browse/types/Settings.ts"],"names":[],"mappings":"","sourcesContent":["export interface BrowseTheme {\n name: string;\n value: string;\n stylesheets: string[];\n}\n\nexport type MaxContentWidth = 'Narrower' | 'Standard' | 'Wider';\n\nexport interface BrowseSettings {\n theme: string;\n listItemsPerPage: number;\n galleryItemsPerPage: number;\n maxContentWidth: MaxContentWidth;\n}\n\nexport interface BrowseSettingOptions {\n themes: BrowseTheme[];\n listItemsPerPage: number[];\n galleryItemsPerPage: number[];\n maxContentWidth: MaxContentWidth[];\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";@font-face{font-family:Material Icons;font-style:normal;font-weight:400;font-display:block;src:url(/assets/material-icons-kAwBdRge.woff2) format("woff2"),url(/assets/material-icons-Dr0goTwe.woff) format("woff")}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}@font-face{font-family:Material Icons Outlined;font-style:normal;font-weight:400;font-display:block;src:url(/assets/material-icons-outlined-DZhiGvEA.woff2) format("woff2"),url(/assets/material-icons-outlined-BpWbwl2n.woff) format("woff")}.material-icons-outlined{font-family:Material Icons Outlined;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}@font-face{font-family:Material Icons Round;font-style:normal;font-weight:400;font-display:block;src:url(/assets/material-icons-round-DrirKXBx.woff2) format("woff2"),url(/assets/material-icons-round-BDlwx-sv.woff) format("woff")}.material-icons-round{font-family:Material Icons Round;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}@font-face{font-family:Material Icons Sharp;font-style:normal;font-weight:400;font-display:block;src:url(/assets/material-icons-sharp-gidztirS.woff2) format("woff2"),url(/assets/material-icons-sharp-CH1KkVu7.woff) format("woff")}.material-icons-sharp{font-family:Material Icons Sharp;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}@font-face{font-family:Material Icons Two Tone;font-style:normal;font-weight:400;font-display:block;src:url(/assets/material-icons-two-tone-DuNIpaEj.woff2) format("woff2"),url(/assets/material-icons-two-tone-B7wz7mED.woff) format("woff")}.material-icons-two-tone{font-family:Material Icons Two Tone;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}a{text-decoration:none}.campaign-list.mw-narrower{max-width:40.5em}.campaign-list.mw-standard{max-width:47.5em}.campaign-list.mw-wider{max-width:54.5em}.campaign-card{overflow:hidden}.campaign-card__avatar{height:6.5em;aspect-ratio:1;object-fit:cover}.campaign-card__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;color:var(--bs-link-color);font-weight:700}.campaign-card__creation-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden}.campaign-card__count-icon{font-size:1.2em!important;margin-right:.3em}.campaign-card__count-text{font-size:1em}.custom-scrollbars__track-vertical{top:0;bottom:0;right:0;background:var(--bs-secondary);opacity:.2;border-radius:3px}.custom-scrollbars__track-horizontal{left:0;right:0;bottom:0;background:var(--bs-secondary);opacity:.2;border-radius:3px}.custom-scrollbars__thumb-vertical,.custom-scrollbars__thumb-horizontal{border-radius:3px;background:var(--bs-light);opacity:.2}.sidebar{width:100%;height:100vh;border-radius:0}.sidebar__header{background:var(--bs-card-bg)}.sidebar__brand a{color:inherit}.sidebar__section-title{color:var(--bs-body-color);font-weight:700;font-size:.9em}.sidebar__main{display:flex;flex-direction:column}.sidebar__link{display:flex;align-items:center;color:var(--bs-body-color);transition:color .15s}.sidebar__link:hover{color:var(--bs-link-hover-color)}.sidebar__link-icon{width:1.5em;height:1.5em;object-fit:cover}.sidebar__link-icon--svg{fill:var(--bs-body-color)}.sidebar__link-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;font-size:.9em}.sidebar-trigger{text-decoration:none;color:var(--bs-body-color);transition:color .15s}.sidebar-trigger:hover{color:var(--bs-link-hover-color)}.campaign-content{width:100%}.campaign-content--post.mw-narrower{max-width:40.5em}.campaign-content--post.mw-standard{max-width:47.5em}.campaign-content--post.mw-wider{max-width:54.5em}.post-card{overflow:hidden}.post-card__inline-media-wrapper{text-align:center}.post-card__inline-media-wrapper img{max-width:100%}.post-card__inline-media-caption,.post-card__external-embed-caption{font-size:smaller}.post-card__external-embed-wrapper{text-align:center}.post-card__external-embed>iframe{width:100%;height:100%}.post-card__content img{max-width:100%}.media-grid{display:grid;position:relative;max-height:32em;gap:1px;background:var(--bs-card-border-color);border-bottom:var(--bs-card-border-color)}.media-grid--1{grid-template-rows:1fr;grid-template-columns:1fr;grid-template-areas:"a"}.media-grid--2{grid-template-rows:1fr;grid-template-columns:1fr 1fr;grid-template-areas:"a b"}.media-grid--3{grid-template-rows:1fr 1fr;grid-template-columns:1fr 1fr;grid-template-areas:"a b" "a c"}.media-grid--4{grid-template-rows:1fr 1fr;grid-template-columns:1fr 1fr;grid-template-areas:"a b" "c d"}.media-grid__item-wrapper{width:100%;position:relative}.media-grid__item-wrapper:nth-child(1){grid-area:a}.media-grid__item-wrapper:nth-child(2){grid-area:b}.media-grid__item-wrapper:nth-child(3){grid-area:c}.media-grid__item-wrapper:nth-child(4){grid-area:d}.media-grid__thumbnail-backdrop{width:100%;height:100%;position:absolute;background-size:cover;filter:blur(1em);transform:scale(1.5)}.media-grid__thumbnail-wrapper{width:100%;height:100%;z-index:1000;cursor:pointer}.media-grid__thumbnail-wrapper--video:before{content:"";font-family:Material Icons Outlined;font-size:4em;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;transition:opacity .15s ease-in-out;opacity:.8}.media-grid__thumbnail-wrapper--video:hover:before{opacity:1}.media-grid__thumbnail{width:100%;height:100%;object-fit:contain}.media-grid__badge{position:absolute;font-size:1em;bottom:1em;left:1em;z-index:1001}@font-face{font-family:lg;src:url(data:font/woff2;base64,d09GMgABAAAAAAkcAAsAAAAAEogAAAjNAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgSQRCAqcLJZKCzoAATYCJANwBCAFgkoHIBupDgDm53Gzej8JpU0wqygVVyoWwphIsuuw60jpmBY6ppTa7mk7jtx57UQ0V2ulvfmteSIQji061T2HvfDEECASKizU5VUQXFjFRtgYTVg+woiYDVezOThR4tAvr/YYgOO/RZ+BAABzYtMA8Kl8Neg3UIDCoCkOyWBuLcCvSHycH78QvhFxmUCK03A0RwGSvXBAHgR8UB8DMvocJYAgbiZiJnqmYGbXjG3mz7P8nHhe8Uvxr0j+fzwPABAjWT1E83IJHh/x87G/jv1l7JtY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X3QZBL+rl+hTWuR/2At7LhYVX9BBsULaqi9LWh+6xMDLW6V65dy2gsMbszemQ96XMDvrSfRM60ceo5R/oGDXB0KrxJsTACBhbV48S4Cd5IeyAVdU5Yg+2nPGKS+XAwmOljrwpIdMmdJPexI9ndnIXUIVgety83YzRdXD6E6YvF0gVGJRMhpOyQW6xGM0Zbq7zw8AoAcWAYa7cSOsARF+Fm8DBAAYgDUq07ZSWvm3UIoAAIAfde39SB7Hz+K/xR9vAkMBg0YE8PKEChkH47+9MDggitAdAEObxnBmZAFu5C4eyMxqN/2c3ZUK2qJ+tDUvrTR/BGHDbqZplsDNZVVQjIaim4XA6TE4YLCfEdweIwAKaArx8aN1JETYMNMDEWGYZdRjMJDAB4T7+EEiwAdiBKCBlRQCfnwjEgohbttG2AYb3yS+7tWIDW1rd/6mMedAM+yEHbAvWge0XgNevwdW20Cmdfb6NXBYqm+DtZHUyUW88R/abjA/OxeYpIa9sNmNGMqHbMgd2CAZPzVuOfQFg5H275pWwx73mQMODQAAAA==) format("woff2"),url(/assets/lg-oyjwlqP2.ttf?io9a6k) format("truetype"),url(/assets/lg-CosQH4Cu.woff?io9a6k) format("woff"),url(/assets/lg-B0dIV2BS.svg?io9a6k#lg) format("svg");font-weight:400;font-style:normal;font-display:block}.lg-icon{font-family:lg!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.lg-container{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,Liberation Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.lg-next,.lg-prev{background-color:#00000073;border-radius:2px;color:#999;cursor:pointer;display:block;font-size:22px;margin-top:-10px;padding:8px 10px 9px;position:absolute;top:50%;z-index:1084;outline:none;border:none}.lg-next.disabled,.lg-prev.disabled{opacity:0!important;cursor:default}.lg-next:hover:not(.disabled),.lg-prev:hover:not(.disabled){color:#fff}.lg-single-item .lg-next,.lg-single-item .lg-prev{display:none}.lg-next{right:20px}.lg-next:before{content:""}.lg-prev{left:20px}.lg-prev:after{content:""}@-webkit-keyframes lg-right-end{0%{left:0}50%{left:-30px}to{left:0}}@-moz-keyframes lg-right-end{0%{left:0}50%{left:-30px}to{left:0}}@-ms-keyframes lg-right-end{0%{left:0}50%{left:-30px}to{left:0}}@keyframes lg-right-end{0%{left:0}50%{left:-30px}to{left:0}}@-webkit-keyframes lg-left-end{0%{left:0}50%{left:30px}to{left:0}}@-moz-keyframes lg-left-end{0%{left:0}50%{left:30px}to{left:0}}@-ms-keyframes lg-left-end{0%{left:0}50%{left:30px}to{left:0}}@keyframes lg-left-end{0%{left:0}50%{left:30px}to{left:0}}.lg-outer.lg-right-end .lg-object{-webkit-animation:lg-right-end .3s;-o-animation:lg-right-end .3s;animation:lg-right-end .3s;position:relative}.lg-outer.lg-left-end .lg-object{-webkit-animation:lg-left-end .3s;-o-animation:lg-left-end .3s;animation:lg-left-end .3s;position:relative}.lg-toolbar{z-index:1082;left:0;position:absolute;top:0;width:100%}.lg-media-overlap .lg-toolbar{background-image:linear-gradient(0deg,#0000,#0006)}.lg-toolbar .lg-icon{color:#999;cursor:pointer;float:right;font-size:24px;height:47px;line-height:27px;padding:10px 0;text-align:center;width:50px;text-decoration:none!important;outline:medium none;will-change:color;-webkit-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear;background:none;border:none;box-shadow:none}.lg-toolbar .lg-icon.lg-icon-18{font-size:18px}.lg-toolbar .lg-icon:hover{color:#fff}.lg-toolbar .lg-close:after{content:""}.lg-toolbar .lg-maximize{font-size:22px}.lg-toolbar .lg-maximize:after{content:""}.lg-toolbar .lg-download:after{content:""}.lg-sub-html{color:#eee;font-size:16px;padding:10px 40px;text-align:center;z-index:1080;opacity:0;-webkit-transition:opacity .2s ease-out 0s;-o-transition:opacity .2s ease-out 0s;transition:opacity .2s ease-out 0s}.lg-sub-html h4{margin:0;font-size:13px;font-weight:700}.lg-sub-html p{font-size:12px;margin:5px 0 0}.lg-sub-html a{color:inherit}.lg-sub-html a:hover{text-decoration:underline}.lg-media-overlap .lg-sub-html{background-image:linear-gradient(180deg,#0000,#0009)}.lg-item .lg-sub-html{position:absolute;bottom:0;right:0;left:0}.lg-error-msg{font-size:14px;color:#999}.lg-counter{color:#999;display:inline-block;font-size:16px;padding-left:20px;padding-top:12px;height:47px;vertical-align:middle}.lg-closing .lg-toolbar,.lg-closing .lg-prev,.lg-closing .lg-next,.lg-closing .lg-sub-html{opacity:0;-webkit-transition:-webkit-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;-moz-transition:-moz-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;-o-transition:-o-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;transition:transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-img-wrap,body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-video-cont,body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-media-cont{opacity:0;-moz-transform:scale3d(.5,.5,.5);-o-transform:scale3d(.5,.5,.5);-ms-transform:scale3d(.5,.5,.5);-webkit-transform:scale3d(.5,.5,.5);transform:scale3d(.5,.5,.5);will-change:transform,opacity;-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1)!important;-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1)!important;-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1)!important;transition:transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1)!important}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-img-wrap,body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-video-cont,body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-media-cont{opacity:1;-moz-transform:scale3d(1,1,1);-o-transform:scale3d(1,1,1);-ms-transform:scale3d(1,1,1);-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}.lg-icon:focus-visible{color:#fff;border-radius:3px;outline:1px dashed rgba(255,255,255,.6)}.lg-toolbar .lg-icon:focus-visible{border-radius:8px;outline-offset:-5px}.lg-group:after{content:"";display:table;clear:both}.lg-container{display:none;outline:none}.lg-on{scroll-behavior:unset}.lg-overlay-open{overflow:hidden}.lg-toolbar,.lg-prev,.lg-next,.lg-pager-outer,.lg-hide-sub-html .lg-sub-html{opacity:0;will-change:transform,opacity;-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;transition:transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s}.lg-show-in .lg-toolbar,.lg-show-in .lg-prev,.lg-show-in .lg-next,.lg-show-in .lg-pager-outer,.lg-show-in.lg-hide-sub-html .lg-sub-html{opacity:1}.lg-show-in .lg-hide-items .lg-prev{opacity:0;-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}.lg-show-in .lg-hide-items .lg-next{opacity:0;-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}.lg-show-in .lg-hide-items .lg-toolbar{opacity:0;-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}.lg-show-in .lg-hide-items.lg-hide-sub-html .lg-sub-html{opacity:0;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}.lg-outer{width:100%;height:100%;position:fixed;top:0;left:0;z-index:1050;text-align:left;opacity:.001;outline:none;will-change:auto;overflow:hidden;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-outer *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lg-outer.lg-zoom-from-image,.lg-outer.lg-visible{opacity:1}.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-prev-slide,.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-next-slide,.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-current{-webkit-transition-duration:inherit!important;transition-duration:inherit!important;-webkit-transition-timing-function:inherit!important;transition-timing-function:inherit!important}.lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide,.lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide,.lg-outer.lg-css3.lg-dragging .lg-item.lg-current{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-outer.lg-grab img.lg-object{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer.lg-grabbing img.lg-object{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg-content{position:absolute;top:0;left:0;right:0;bottom:0}.lg-outer .lg-inner{width:100%;position:absolute;left:0;top:0;bottom:0;-webkit-transition:opacity 0s;-o-transition:opacity 0s;transition:opacity 0s;white-space:nowrap}.lg-outer .lg-item{display:none!important}.lg-outer .lg-item:not(.lg-start-end-progress){background:url(/assets/loading-BZOHaeKn.gif) no-repeat scroll center center transparent}.lg-outer.lg-css3 .lg-prev-slide,.lg-outer.lg-css3 .lg-current,.lg-outer.lg-css3 .lg-next-slide,.lg-outer.lg-css .lg-current{display:inline-block!important}.lg-outer .lg-item,.lg-outer .lg-img-wrap{display:inline-block;text-align:center;position:absolute;width:100%;height:100%}.lg-outer .lg-item:before,.lg-outer .lg-img-wrap:before{content:"";display:inline-block;height:100%;vertical-align:middle}.lg-outer .lg-img-wrap{position:absolute;left:0;right:0;top:0;bottom:0;white-space:nowrap;font-size:0}.lg-outer .lg-item.lg-complete{background-image:none}.lg-outer .lg-item.lg-current{z-index:1060}.lg-outer .lg-object{display:inline-block;vertical-align:middle;max-width:100%;max-height:100%;width:auto;height:auto;position:relative}.lg-outer .lg-empty-html.lg-sub-html,.lg-outer .lg-empty-html .lg-sub-html{display:none}.lg-outer.lg-hide-download .lg-download{opacity:.75;pointer-events:none}.lg-outer .lg-first-slide .lg-dummy-img{position:absolute;top:50%;left:50%}.lg-outer.lg-components-open:not(.lg-zoomed) .lg-components{-webkit-transform:translate3d(0,0%,0);transform:translateZ(0);opacity:1}.lg-outer.lg-components-open:not(.lg-zoomed) .lg-sub-html{opacity:1;transition:opacity .2s ease-out .15s}.lg-outer .lg-media-cont{text-align:center;display:inline-block;vertical-align:middle;position:relative}.lg-outer .lg-media-cont .lg-object{width:100%!important;height:100%!important}.lg-outer .lg-has-iframe .lg-media-cont{-webkit-overflow-scrolling:touch;overflow:auto}.lg-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1040;background-color:#000;opacity:0;will-change:auto;-webkit-transition:opacity 333ms ease-in 0s;-o-transition:opacity 333ms ease-in 0s;transition:opacity 333ms ease-in 0s}.lg-backdrop.in{opacity:1}.lg-css3.lg-no-trans .lg-prev-slide,.lg-css3.lg-no-trans .lg-next-slide,.lg-css3.lg-no-trans .lg-current{-webkit-transition:none 0s ease 0s!important;-moz-transition:none 0s ease 0s!important;-o-transition:none 0s ease 0s!important;transition:none 0s ease 0s!important}.lg-css3.lg-use-css3 .lg-item{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-css3.lg-fade .lg-item{opacity:0}.lg-css3.lg-fade .lg-item.lg-current{opacity:1}.lg-css3.lg-fade .lg-item.lg-prev-slide,.lg-css3.lg-fade .lg-item.lg-next-slide,.lg-css3.lg-fade .lg-item.lg-current{-webkit-transition:opacity .1s ease 0s;-moz-transition:opacity .1s ease 0s;-o-transition:opacity .1s ease 0s;transition:opacity .1s ease 0s}.lg-css3.lg-use-css3 .lg-item.lg-start-progress{-webkit-transition:-webkit-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;-moz-transition:-moz-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;-o-transition:-o-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;transition:transform 1s cubic-bezier(.175,.885,.32,1.275) 0s}.lg-css3.lg-use-css3 .lg-item.lg-start-end-progress{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s}.lg-css3.lg-slide.lg-use-css3 .lg-item{opacity:0}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current{-webkit-transform:translate3d(0,0,0);transform:translateZ(0);opacity:1}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s}.lg-container{display:none}.lg-container.lg-show{display:block}.lg-container.lg-dragging-vertical .lg-backdrop{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-container.lg-dragging-vertical .lg-css3 .lg-item.lg-current{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-inline .lg-backdrop,.lg-inline .lg-outer{position:absolute}.lg-inline .lg-backdrop{z-index:1}.lg-inline .lg-outer{z-index:2}.lg-inline .lg-maximize:after{content:""}.lg-components{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);will-change:transform;-webkit-transition:-webkit-transform .35s ease-out 0s;-moz-transition:-moz-transform .35s ease-out 0s;-o-transition:-o-transform .35s ease-out 0s;transition:transform .35s ease-out 0s;z-index:1080;position:absolute;bottom:0;right:0;left:0}.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-img-wrap,.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-image{-webkit-transition-duration:0ms!important;transition-duration:0ms!important}.lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap{will-change:transform;-webkit-transition:-webkit-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s;-moz-transition:-moz-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s;-o-transition:-o-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s;transition:transform .5s cubic-bezier(.12,.415,.01,1.19) 0s}.lg-outer.lg-use-transition-for-zoom.lg-zoom-drag-transition .lg-item.lg-complete.lg-zoomable .lg-img-wrap{will-change:transform;-webkit-transition:-webkit-transform .8s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .8s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .8s cubic-bezier(0,0,.25,1) 0s;transition:transform .8s cubic-bezier(0,0,.25,1) 0s}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transform:translate3d(0,0,0);transform:translateZ(0);-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1);-webkit-transition:-webkit-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;-moz-transition:-moz-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;-o-transition:-o-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;transition:transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.no-transition,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.no-transition{transition:none!important}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition{transform:scaleZ(1) translate3d(-50%,-50%,0)!important;max-width:none!important;max-height:none!important;top:50%!important;left:50%!important}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition-x,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition-x{transform:scaleZ(1) translate3d(-50%,0,0)!important;top:0!important;left:50%!important;max-width:none!important;max-height:none!important}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition-y,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition-y{transform:scaleZ(1) translate3d(0,-50%,0)!important;top:50%!important;left:0%!important;max-width:none!important;max-height:none!important}.lg-icon.lg-zoom-in:after{content:""}.lg-actual-size .lg-icon.lg-zoom-in{opacity:1;pointer-events:auto}.lg-icon.lg-actual-size{font-size:20px}.lg-icon.lg-actual-size:after{content:""}.lg-icon.lg-zoom-out{opacity:.5;pointer-events:none}.lg-icon.lg-zoom-out:after{content:""}.lg-zoomed .lg-icon.lg-zoom-out{opacity:1;pointer-events:auto}.lg-outer[data-lg-slide-type=video] .lg-zoom-in,.lg-outer[data-lg-slide-type=video] .lg-actual-size,.lg-outer[data-lg-slide-type=video] .lg-zoom-out,.lg-outer[data-lg-slide-type=iframe] .lg-zoom-in,.lg-outer[data-lg-slide-type=iframe] .lg-actual-size,.lg-outer[data-lg-slide-type=iframe] .lg-zoom-out,.lg-outer.lg-first-slide-loading .lg-zoom-in,.lg-outer.lg-first-slide-loading .lg-actual-size,.lg-outer.lg-first-slide-loading .lg-zoom-out{opacity:.75;pointer-events:none}.lg-outer .lg-thumb-outer{background-color:#0d0a0a;width:100%;max-height:350px;overflow:hidden;float:left}.lg-outer .lg-thumb-outer.lg-grab .lg-thumb-item{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer .lg-thumb-outer.lg-grabbing .lg-thumb-item{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg-thumb-outer.lg-dragging .lg-thumb,.lg-outer .lg-thumb-outer.lg-rebuilding-thumbnails .lg-thumb{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-outer .lg-thumb-outer.lg-thumb-align-middle{text-align:center}.lg-outer .lg-thumb-outer.lg-thumb-align-left{text-align:left}.lg-outer .lg-thumb-outer.lg-thumb-align-right{text-align:right}.lg-outer.lg-single-item .lg-thumb-outer{display:none}.lg-outer .lg-thumb{padding:5px 0;height:100%;margin-bottom:-5px;display:inline-block;vertical-align:middle}@media (min-width: 768px){.lg-outer .lg-thumb{padding:10px 0}}.lg-outer .lg-thumb-item{cursor:pointer;float:left;overflow:hidden;height:100%;border-radius:2px;margin-bottom:5px;will-change:border-color}@media (min-width: 768px){.lg-outer .lg-thumb-item{border-radius:4px;border:2px solid #fff;-webkit-transition:border-color .25s ease;-o-transition:border-color .25s ease;transition:border-color .25s ease}}.lg-outer .lg-thumb-item.active,.lg-outer .lg-thumb-item:hover{border-color:#a90707}.lg-outer .lg-thumb-item img{width:100%;height:100%;object-fit:cover;display:block}.lg-outer.lg-can-toggle .lg-item{padding-bottom:0}.lg-outer .lg-toggle-thumb:after{content:""}.lg-outer.lg-animate-thumb .lg-thumb{-webkit-transition-timing-function:cubic-bezier(.215,.61,.355,1);transition-timing-function:cubic-bezier(.215,.61,.355,1)}.lg-outer .lg-video-cont{text-align:center;display:inline-block;vertical-align:middle;position:relative}.lg-outer .lg-video-cont .lg-object{width:100%!important;height:100%!important}.lg-outer .lg-has-iframe .lg-video-cont{-webkit-overflow-scrolling:touch;overflow:auto}.lg-outer .lg-video-object{position:absolute;left:0;right:0;width:100%;height:100%;top:0;bottom:0;z-index:3}.lg-outer .lg-video-poster{z-index:1}.lg-outer .lg-has-video .lg-video-object{opacity:0;will-change:opacity;-webkit-transition:opacity .3s ease-in;-o-transition:opacity .3s ease-in;transition:opacity .3s ease-in}.lg-outer .lg-has-video.lg-video-loaded .lg-video-poster,.lg-outer .lg-has-video.lg-video-loaded .lg-video-play-button{opacity:0!important}.lg-outer .lg-has-video.lg-video-loaded .lg-video-object{opacity:1}@keyframes lg-play-stroke{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes lg-play-rotate{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.lg-video-play-button{width:18%;max-width:140px;position:absolute;top:50%;left:50%;z-index:2;cursor:pointer;transform:translate(-50%,-50%) scale(1);will-change:opacity,transform;-webkit-transition:-webkit-transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s;-moz-transition:-moz-transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s;-o-transition:-o-transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s;transition:transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s}.lg-video-play-button:hover .lg-video-play-icon-bg,.lg-video-play-button:hover .lg-video-play-icon{opacity:1}.lg-video-play-icon-bg{fill:none;stroke-width:3%;stroke:#fcfcfc;opacity:.6;will-change:opacity;-webkit-transition:opacity .12s ease-in;-o-transition:opacity .12s ease-in;transition:opacity .12s ease-in}.lg-video-play-icon-circle{position:absolute;top:0;left:0;bottom:0;right:0;fill:none;stroke-width:3%;stroke:#1e1e1ee6;stroke-opacity:1;stroke-linecap:round;stroke-dasharray:200;stroke-dashoffset:200}.lg-video-play-icon{position:absolute;width:25%;max-width:120px;left:50%;top:50%;transform:translate3d(-50%,-50%,0);opacity:.6;will-change:opacity;-webkit-transition:opacity .12s ease-in;-o-transition:opacity .12s ease-in;transition:opacity .12s ease-in}.lg-video-play-icon .lg-video-play-icon-inner{fill:#fcfcfc}.lg-video-loading .lg-video-play-icon-circle{animation:lg-play-rotate 2s linear .25s infinite,lg-play-stroke 1.5s ease-in-out .25s infinite}.lg-video-loaded .lg-video-play-button{opacity:0;transform:translate(-50%,-50%) scale(.7)}.light-gallery-item{position:relative}.light-gallery-item__badge{position:absolute;font-size:.85em;top:1em;left:1em;z-index:1001}.fade-content{--fade-content-height: 480px;--fade-content-bg: var(--bs-card-bg);position:relative}.fade-content__body{overflow:hidden;position:relative;transition:max-height .3s ease;max-height:var(--fade-content-height)}.fade-content__body--expanded{max-height:none}.fade-content__overlay{position:absolute;bottom:0;left:0;width:100%;height:50px;background:linear-gradient(to bottom,transparent,var(--fade-content-bg));pointer-events:none}.fade-content__toggle{margin-top:.5rem}.filter-modal__section{transition:height .15s ease,margin-bottom .15s ease}.filter-modal__section--hidden{overflow:hidden;height:0!important;margin-bottom:0!important}.filter-modal__section:not(:last-of-type){margin-bottom:2rem}.filter-modal-button{display:flex;align-items:center;white-space:nowrap}.filter-modal-button--show:before{content:"";font-family:Material Icons;font-size:1.2em;margin-right:.2em}.filter-modal-button--clear:before{content:"";font-family:Material Icons;font-size:1.2em;margin-right:.2em}.product-list{--card-width: 300px;--gap: 16px;width:100%;display:flex;flex-wrap:wrap;gap:var(--gap)}.product-list__card-wrapper{width:var(--card-width);flex-grow:1}.product-list__card-wrapper--fixed{flex-grow:0}.product-card{width:100%}.product-card__description img{max-width:100%}.product-card--compact .product-card__description{display:none}.product-card--compact .product-card__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;color:var(--bs-link-color)}.product-card__media-nav{display:flex;gap:1.5em;border-bottom:1px solid var(--bs-secondary)}.product-card__media-nav a{position:relative;top:1px;padding:.5em 0;color:var(--bs-link-color)}.product-card__media-nav a:hover{color:var(--bs-link-hover-color)}.product-card__media-nav a.active{color:var(--bs-link-color);border-bottom:2px solid var(--bs-link-color)}.product-card__media-nav a.active:hover{color:var(--bs-link-hover-color)}.lg-video-poster{object-fit:contain}.media-gallery{display:flex;flex-wrap:wrap;gap:var(--media-gallery-gap)}.media-gallery__thumbnail-wrapper{flex-grow:1;width:auto;position:relative;height:var(--media-gallery-row-height);border:var(--media-gallery-thumbnail-border) solid var(--bs-border-color);border-radius:var(--bs-border-radius);overflow:hidden;cursor:pointer}.media-gallery__thumbnail-wrapper--video:before{content:"";font-family:Material Icons Outlined;font-size:4em;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;transition:opacity .15s ease-in-out;opacity:.8}.media-gallery__thumbnail-wrapper--video:hover:before{opacity:1}.media-gallery__thumbnail-wrapper--empty{width:var(--media-gallery-row-height)}.media-gallery__thumbnail{width:100%;height:100%;object-fit:cover}.media-gallery__source-link{color:inherit}.media-gallery__source-link:hover{text-decoration:none!important}.campaign-header__cover{max-height:10em;width:100%;object-fit:cover}.campaign-header__avatar{height:8em;aspect-ratio:1;object-fit:cover}.campaign-header__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;font-weight:700}.campaign-header__creation-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden}.campaign-header__nav{border-bottom:1px solid var(--bs-secondary)}.campaign-header__nav a{padding-bottom:.5em;position:relative;top:1px}.campaign-header__nav a.active{border-bottom:2px solid var(--bs-link-color)}.about-campaign__summary img{max-width:100%}.slider--h100 .slick-track{display:flex!important}.slider--h100 .slick-track .slick-slide{height:auto;display:flex!important}.slider--h100 .slick-track .slick-slide>div{display:flex;width:100%}.slider__dots li button:before{color:var(--bs-body-color)!important}.reward-card{width:100%;height:100%}.reward-card__image{max-height:10em;object-fit:contain}.reward-card__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;font-weight:700}.reward-card__content{font-size:.9em}.reward-card__content p{margin-bottom:0}.reward-card__content ul{padding-left:1em}.reward-card__content img{max-width:100%}.slick-slider{position:relative;display:block;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-khtml-user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.slick-list{position:relative;display:block;overflow:hidden;margin:0;padding:0}.slick-list:focus{outline:none}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-track,.slick-slider .slick-list{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translateZ(0)}.slick-track{position:relative;top:0;left:0;display:block;margin-left:auto;margin-right:auto}.slick-track:before,.slick-track:after{display:table;content:""}.slick-track:after{clear:both}.slick-loading .slick-track{visibility:hidden}.slick-slide{display:none;float:left;height:100%;min-height:1px}[dir=rtl] .slick-slide{float:right}.slick-slide img{display:block}.slick-slide.slick-loading img{display:none}.slick-slide.dragging img{pointer-events:none}.slick-initialized .slick-slide{display:block}.slick-loading .slick-slide{visibility:hidden}.slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.slick-arrow.slick-hidden{display:none}.slick-loading .slick-list{background:#fff url(/assets/ajax-loader-BcnMEykj.gif) center center no-repeat}@font-face{font-family:slick;font-weight:400;font-style:normal;src:url(data:application/vnd.ms-fontobject;base64,AAgAAGQHAAABAAIAAAAAAAIABQkAAAAAAAABAJABAAAAAExQAQAAgCAAAAAAAAAAAAAAAAEAAAAAAAAATxDE8AAAAAAAAAAAAAAAAAAAAAAAAAoAcwBsAGkAYwBrAAAADgBSAGUAZwB1AGwAYQByAAAAFgBWAGUAcgBzAGkAbwBuACAAMQAuADAAAAAKAHMAbABpAGMAawAAAAAAAAEAAAANAIAAAwBQRkZUTW3RyK8AAAdIAAAAHEdERUYANAAGAAAHKAAAACBPUy8yT/b9sgAAAVgAAABWY21hcCIPRb0AAAHIAAABYmdhc3D//wADAAAHIAAAAAhnbHlmP5u2YAAAAzwAAAIsaGVhZAABMfsAAADcAAAANmhoZWED5QIFAAABFAAAACRobXR4BkoASgAAAbAAAAAWbG9jYQD2AaIAAAMsAAAAEG1heHAASwBHAAABOAAAACBuYW1lBSeBwgAABWgAAAFucG9zdC+zMgMAAAbYAAAARQABAAAAAQAA8MQQT18PPPUACwIAAAAAAM9xeH8AAAAAz3F4fwAlACUB2wHbAAAACAACAAAAAAAAAAEAAAHbAAAALgIAAAAAAAHbAAEAAAAAAAAAAAAAAAAAAAAEAAEAAAAHAEQAAgAAAAAAAgAAAAEAAQAAAEAAAAAAAAAAAQIAAZAABQAIAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAIABQkAAAAAAACAAAABAAAAIAAAAAAAAAAAUGZFZABAAGEhkgHg/+AALgHb/9sAAAABAAAAAAAAAgAAAAAAAAACAAAAAgAAJQAlACUAJQAAAAAAAwAAAAMAAAAcAAEAAAAAAFwAAwABAAAAHAAEAEAAAAAMAAgAAgAEAAAAYSAiIZAhkv//AAAAAABhICIhkCGS//8AAP+l3+PedN5xAAEAAAAAAAAAAAA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wcEhQMCw8OHAMDJwMDAgQnFBQRFBsaLCZeJiwaGxQRDxEcJQgEBgAAAAAAAAwAlgABAAAAAAABAAUADAABAAAAAAACAAcAIgABAAAAAAADACEAbgABAAAAAAAEAAUAnAABAAAAAAAFAAsAugABAAAAAAAGAAUA0gADAAEECQABAAoAAAADAAEECQACAA4AEgADAAEECQADAEIAKgADAAEECQAEAAoAkAADAAEECQAFABYAogADAAEECQAGAAoAxgBzAGwAaQBjAGsAAHNsaWNrAABSAGUAZwB1AGwAYQByAABSZWd1bGFyAABGAG8AbgB0AEYAbwByAGcAZQAgADIALgAwACAAOgAgAHMAbABpAGMAawAgADoAIAAxADQALQA0AC0AMgAwADEANAAARm9udEZvcmdlIDIuMCA6IHNsaWNrIDogMTQtNC0yMDE0AABzAGwAaQBjAGsAAHNsaWNrAABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABzAGwAaQBjAGsAAHNsaWNrAAAAAAIAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAgECAQMAhwBECmFycm93cmlnaHQJYXJyb3dsZWZ0AAAAAAAAAf//AAIAAQAAAA4AAAAYAAAAAAACAAEAAwAGAAEABAAAAAIAAAAAAAEAAAAAzu7XsAAAAADPcXh/AAAAAM9xeH8=);src:url(data:application/vnd.ms-fontobject;base64,AAgAAGQHAAABAAIAAAAAAAIABQkAAAAAAAABAJABAAAAAExQAQAAgCAAAAAAAAAAAAAAAAEAAAAAAAAATxDE8AAAAAAAAAAAAAAAAAAAAAAAAAoAcwBsAGkAYwBrAAAADgBSAGUAZwB1AGwAYQByAAAAFgBWAGUAcgBzAGkAbwBuACAAMQAuADAAAAAKAHMAbABpAGMAawAAAAAAAAEAAAANAIAAAwBQRkZUTW3RyK8AAAdIAAAAHEdERUYANAAGAAAHKAAAACBPUy8yT/b9sgAAAVgAAABWY21hcCIPRb0AAAHIAAABYmdhc3D//wADAAAHIAAAAAhnbHlmP5u2YAAAAzwA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yMDE0AABzAGwAaQBjAGsAAHNsaWNrAABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABzAGwAaQBjAGsAAHNsaWNrAAAAAAIAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAgECAQMAhwBECmFycm93cmlnaHQJYXJyb3dsZWZ0AAAAAAAAAf//AAIAAQAAAA4AAAAYAAAAAAACAAEAAwAGAAEABAAAAAIAAAAAAAEAAAAAzu7XsAAAAADPcXh/AAAAAM9xeH8=) format("truetype"),url(/assets/slick-BlzDm7g2.svg#slick) format("svg")}.slick-prev,.slick-next{font-size:0;line-height:0;position:absolute;top:50%;display:block;width:20px;height:20px;padding:0;-webkit-transform:translate(0,-50%);-ms-transform:translate(0,-50%);transform:translateY(-50%);cursor:pointer;color:transparent;border:none;outline:none;background:transparent}.slick-prev:hover,.slick-prev:focus,.slick-next:hover,.slick-next:focus{color:transparent;outline:none;background:transparent}.slick-prev:hover:before,.slick-prev:focus:before,.slick-next:hover:before,.slick-next:focus:before{opacity:1}.slick-prev.slick-disabled:before,.slick-next.slick-disabled:before{opacity:.25}.slick-prev:before,.slick-next:before{font-family:slick;font-size:20px;line-height:1;opacity:.75;color:#fff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.slick-prev{left:-25px}[dir=rtl] .slick-prev{right:-25px;left:auto}.slick-prev:before{content:"←"}[dir=rtl] .slick-prev:before{content:"→"}.slick-next{right:-25px}[dir=rtl] .slick-next{right:auto;left:-25px}.slick-next:before{content:"→"}[dir=rtl] .slick-next:before{content:"←"}.slick-dotted.slick-slider{margin-bottom:30px}.slick-dots{position:absolute;bottom:-25px;display:block;width:100%;padding:0;margin:0;list-style:none;text-align:center}.slick-dots li{position:relative;display:inline-block;width:20px;height:20px;margin:0 5px;padding:0;cursor:pointer}.slick-dots li button{font-size:0;line-height:0;display:block;width:20px;height:20px;padding:5px;cursor:pointer;color:transparent;border:0;outline:none;background:transparent}.slick-dots li button:hover,.slick-dots li button:focus{outline:none}.slick-dots li button:hover:before,.slick-dots li button:focus:before{opacity:1}.slick-dots li button:before{font-family:slick;font-size:6px;line-height:20px;position:absolute;top:0;left:0;width:20px;height:20px;content:"•";text-align:center;opacity:.25;color:#000;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.slick-dots li.slick-active button:before{opacity:.75;color:#000}.slider-arrow{width:auto!important;height:auto!important;color:var(--bs-btn-color)!important;background:var(--bs-btn-bg)!important;font-size:inherit!important}.slider-arrow__icon{font-size:2em}.slider-arrow:hover{color:var(--bs-btn-hover-color)!important;background-color:var(--bs-btn-hover-bg)!important}.slider-arrow.slick-prev:before,.slider-arrow.slick-next:before{content:none!important}.slider-arrow--prev{left:-2.5em}.slider-arrow--next{right:-2.5em}.post-nav__wrapper.fixed{position:sticky;bottom:0;border-top:1px solid var(--bs-secondary);padding-top:.5rem;background:var(--bs-body-bg)}.post-nav__previous,.post-nav__next{display:flex;align-items:center;width:calc(50% - 2rem)}.post-nav__previous--fill,.post-nav__next--fill{width:calc(90% - 2rem)}.post-nav__previous-label,.post-nav__next-label{width:calc(100% - 1.7rem);display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.post-nav__next-label{text-align:right}.post-nav__next{justify-content:end}.post-nav__previous:before{content:"";font-family:Material Icons;font-size:1.2em;margin-right:.5em}.post-nav__next:after{content:"";font-family:Material Icons;font-size:1.2em;margin-left:.5em}.post-content__column.mw-narrower{max-width:40.5em}.post-content__column.mw-standard{max-width:47.5em}.post-content__column.mw-wider{max-width:54.5em}.collection-list.mw-narrower{max-width:40.5em}.collection-list.mw-standard{max-width:47.5em}.collection-list.mw-wider{max-width:54.5em}.collection-card{overflow:hidden}.collection-card__thumbnail>img{height:6.5em;aspect-ratio:1;object-fit:cover}.collection-card__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;color:var(--bs-link-color);font-weight:700}.collection-card__description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden}.collection-card__count-icon{font-size:1.2em!important;margin-right:.3em}.collection-card__count-text{font-size:1em}.collection-banner{overflow:hidden;border:none;border-radius:0}.collection-banner.mw-narrower{max-width:40.5em}.collection-banner.mw-standard{max-width:47.5em}.collection-banner.mw-wider{max-width:54.5em}.collection-banner__thumbnail{z-index:100}.collection-banner__thumbnail>img{border-radius:var(--bs-border-radius);height:8em;aspect-ratio:1;object-fit:cover}.collection-banner__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;color:var(--bs-link-color);font-size:1.2rem;font-weight:700}.collection-banner .fade-content__toggle{margin-bottom:.5em}.collection-banner--nodesc .collection-banner__thumbnail>img{height:4em}.collection-banner--nodesc .collection-banner__title{flex:1 auto;align-items:center;font-size:1.5rem}
|