@getoeteter/discord-transcripts 1.0.3 → 1.0.5

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/README.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  Generate standalone HTML transcripts from Discord channels. Works with discord.js v14.
4
4
 
5
- The generated HTML files are completely self-contained no external dependencies, no JavaScript frameworks. Just open the file in a browser.
5
+ The generated HTML files are completely self-contained - no external dependencies, no JavaScript frameworks. Just open the file in a browser.
6
6
 
7
7
  ## Installation
8
8
 
9
9
  ```bash
10
10
  npm install @getoeteter/discord-transcripts
11
11
  # or
12
- pnpm add @getoeteter/discord-transcripts
12
+ bun add @getoeteter/discord-transcripts
13
13
  ```
14
14
 
15
15
  Requires `discord.js` ^14.0.0 as a peer dependency.
@@ -1 +1 @@
1
- var e=this&&this.__rest||function(e,i){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&i.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&(String.fromCharCode(102,117,110,99,116,105,111,110))==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)i.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(t[o[n]]=e[o[n]])}return t};import{generateTranscriptHtml as i}from"./generator.js";export async function createTranscript(o,n={}){const{limit:a=100,before:r,after:s,filename:l,resolveRoles:d=1}=n,c=e(n,[(String.fromCharCode(108,105,109,105,116)),(String.fromCharCode(98,101,102,111,114,101)),(String.fromCharCode(97,102,116,101,114)),(String.fromCharCode(102,105,108,101,110,97,109,101)),(String.fromCharCode(114,101,115,111,108,118,101,82,111,108,101,115))]),m=Math.min(Math.max(1,a),5e3),u=await(async function(e,i,t,o){var n,a;const r=[];let s=t;if(o){let t=o;for(;r.length<i;){const o=await e.messages.fetch(Object.assign({limit:Math.min(100,i-r.length)},t?{after:t}:{}));if(0===o.size)break;const a=[...o.values()].sort((e,i)=>e.createdTimestamp-i.createdTimestamp);r.push(...a),t=null===(n=a[a.length-1])||void 0===n?void 0:n.id}return r}for(;r.length<i;){const t=await e.messages.fetch(Object.assign({limit:Math.min(100,i-r.length)},s?{before:s}:{}));if(0===t.size)break;r.push(...t.values()),s=null===(a=t.last())||void 0===a?void 0:a.id}return r.reverse()})(o,m,r,s),p=o.guild,h=(function(e){const i={};return e.roles.cache.forEach(e=>{i[e.id]={id:e.id,name:e.name,color:e.color,position:e.position}}),i})(p),v=(function(e){const i={};return e.channels.cache.forEach(e=>{i[e.id]={id:e.id,name:e.name,type:e.type}}),i})(p),f=d?await(async function(e,i){const t={},o=[...new Set(i.map(e=>e.author.id))];for(const i of o)try{const o=await e.members.fetch(i);t[i]=o.roles.cache.map(e=>e.id)}catch(e){}return t})(p,u):{},g={guild:{id:p.id,name:p.name,icon:p.icon},channel:{id:o.id,name:o.name,type:o.type,topic:o.topic},messages:u.map(t),roles:h,channels:v,memberRoles:f,generatedAt:(new Date).toISOString(),totalMessages:u.length},y=i(g,c);return{html:y,buffer:Buffer.from(y,(String.fromCharCode(117,116,102,45,56))),filename:null!=l?l:`transcript-${o.name}-${(new Date).toISOString().split("T")[0]}.html`,messageCount:u.length}}function t(e){var i,n,a,r,s,l,d;return{id:e.id,type:e.type,content:e.content,author:{id:e.author.id,username:e.author.username,globalName:e.author.globalName,avatar:e.author.avatar,bot:e.author.bot,discriminator:e.author.discriminator},timestamp:e.createdAt.toISOString(),editedTimestamp:null!==(n=null===(i=e.editedAt)||void 0===i?void 0:i.toISOString())&&void 0!==n?n:null,pinned:e.pinned,webhookId:e.webhookId,mentions:e.mentions.users.map(e=>({id:e.id,username:e.username})),attachments:e.attachments.map(e=>({id:e.id,filename:e.name,description:e.description,contentType:e.contentType,size:e.size,url:e.url,width:e.width,height:e.height,spoiler:e.spoiler})),embeds:e.embeds.map(e=>{var i,t,o,n,a;return{title:null!==(i=e.title)&&void 0!==i?i:void 0,type:e.data.type,description:null!==(t=e.description)&&void 0!==t?t:void 0,url:null!==(o=e.url)&&void 0!==o?o:void 0,timestamp:null!==(n=e.timestamp)&&void 0!==n?n:void 0,color:null!==(a=e.color)&&void 0!==a?a:void 0,footer:e.footer?{text:e.footer.text,iconUrl:e.footer.iconURL}:void 0,image:e.image?{url:e.image.url,width:e.image.width,height:e.image.height}:void 0,thumbnail:e.thumbnail?{url:e.thumbnail.url,width:e.thumbnail.width,height:e.thumbnail.height}:void 0,video:e.video?{url:e.video.url,proxyUrl:e.video.proxyURL,width:e.video.width,height:e.video.height}:void 0,provider:e.provider?{name:e.provider.name,url:e.provider.url}:void 0,author:e.author?{name:e.author.name,url:e.author.url,iconUrl:e.author.iconURL}:void 0,fields:e.fields.map(e=>({name:e.name,value:e.value,inline:e.inline}))}}),reactions:e.reactions.cache.map(e=>{var i,t;return{emoji:{id:e.emoji.id,name:null!==(i=e.emoji.name)&&void 0!==i?i:"❓",animated:null!==(t=e.emoji.animated)&&void 0!==t?t:0},count:e.count}}),messageReference:e.reference?{messageId:null!==(a=e.reference.messageId)&&void 0!==a?a:void 0,channelId:null!==(r=e.reference.channelId)&&void 0!==r?r:void 0,guildId:null!==(s=e.reference.guildId)&&void 0!==s?s:void 0}:void 0,referencedMessage:(null===(l=e.reference)||void 0===l?void 0:l.messageId)&&e.channel.messages.cache.has(e.reference.messageId)?t(e.channel.messages.cache.get(e.reference.messageId)):void 0,stickers:e.stickers.map(e=>({id:e.id,name:e.name,formatType:e.format,url:e.url})),thread:e.thread?{id:e.thread.id,name:e.thread.name,messageCount:null!==(d=e.thread.messageCount)&&void 0!==d?d:void 0}:void 0,components:e.components.map(e=>o(e.toJSON()))}}function o(e){var i,t,n,a;const r={type:e.type};return void 0!==e.style&&(r.style=e.style),e.label&&(r.label=e.label),e.custom_id&&(r.customId=e.custom_id),e.url&&(r.url=e.url),e.disabled&&(r.disabled=e.disabled),e.emoji&&(r.emoji={id:null!==(i=e.emoji.id)&&void 0!==i?i:void 0,name:null!==(t=e.emoji.name)&&void 0!==t?t:"",animated:null!==(n=e.emoji.animated)&&void 0!==n?n:0}),e.content&&(r.content=e.content),void 0!==e.accent_color&&(r.accentColor=e.accent_color),e.spoiler&&(r.spoiler=e.spoiler),e.accessory&&(r.accessory={type:e.accessory.type,media:e.accessory.media,description:e.accessory.description,spoiler:e.accessory.spoiler}),e.items&&(r.items=e.items.map(e=>({media:e.media,description:e.description,spoiler:e.spoiler}))),e.file&&(r.file={url:e.file.url,contentType:e.file.content_type}),void 0!==e.spacing&&(r.spacing=e.spacing),void 0!==e.divider&&(r.divider=e.divider),e.description&&(r.description=e.description),(null===(a=e.components)||void 0===a?void 0:a.length)&&(r.components=e.components.map(o)),r}
1
+ var e=this&&this.__rest||function(e,i){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&i.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&(String.fromCharCode(102,117,110,99,116,105,111,110))==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)i.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(t[o[n]]=e[o[n]])}return t};import{generateTranscriptHtml as i}from"./generator.js";export async function createTranscript(o,n={}){const{limit:a=100,before:r,after:d,filename:l,resolveRoles:s=1}=n,c=e(n,[(String.fromCharCode(108,105,109,105,116)),(String.fromCharCode(98,101,102,111,114,101)),(String.fromCharCode(97,102,116,101,114)),(String.fromCharCode(102,105,108,101,110,97,109,101)),(String.fromCharCode(114,101,115,111,108,118,101,82,111,108,101,115))]),m=Math.min(Math.max(1,a),5e3),u=await(async function(e,i,t,o){var n,a;const r=[];let d=t;if(o){let t=o;for(;r.length<i;){const o=await e.messages.fetch(Object.assign({limit:Math.min(100,i-r.length)},t?{after:t}:{}));if(0===o.size)break;const a=[...o.values()].sort((e,i)=>e.createdTimestamp-i.createdTimestamp);r.push(...a),t=null===(n=a[a.length-1])||void 0===n?void 0:n.id}return r}for(;r.length<i;){const t=await e.messages.fetch(Object.assign({limit:Math.min(100,i-r.length)},d?{before:d}:{}));if(0===t.size)break;r.push(...t.values()),d=null===(a=t.last())||void 0===a?void 0:a.id}return r.reverse()})(o,m,r,d),p=o.guild,h=(function(e){const i={};return e.roles.cache.forEach(e=>{i[e.id]={id:e.id,name:e.name,color:e.color,position:e.position}}),i})(p),v=(function(e){const i={};return e.channels.cache.forEach(e=>{i[e.id]={id:e.id,name:e.name,type:e.type}}),i})(p),f=s?await(async function(e,i){const t={},o=[...new Set(i.map(e=>e.author.id))];for(const i of o)try{const o=await e.members.fetch(i);t[i]=o.roles.cache.map(e=>e.id)}catch(e){}return t})(p,u):{},g={guild:{id:p.id,name:p.name,icon:p.icon},channel:{id:o.id,name:o.name,type:o.type,topic:o.topic},messages:u.map(t),roles:h,channels:v,memberRoles:f,generatedAt:(new Date).toISOString(),totalMessages:u.length},y=i(g,c);return{html:y,buffer:Buffer.from(y,(String.fromCharCode(117,116,102,45,56))),filename:null!=l?l:`transcript-${o.name}-${(new Date).toISOString().split("T")[0]}.html`,messageCount:u.length}}function t(e){var i,n,a,r,d,l,s;return{id:e.id,type:e.type,content:e.content,author:{id:e.author.id,username:e.author.username,globalName:e.author.globalName,avatar:e.author.avatar,bot:e.author.bot,discriminator:e.author.discriminator},timestamp:e.createdAt.toISOString(),editedTimestamp:null!==(n=null===(i=e.editedAt)||void 0===i?void 0:i.toISOString())&&void 0!==n?n:null,pinned:e.pinned,webhookId:e.webhookId,mentions:e.mentions.users.map(e=>({id:e.id,username:e.username})),attachments:e.attachments.map(e=>({id:e.id,filename:e.name,description:e.description,contentType:e.contentType,size:e.size,url:e.url,width:e.width,height:e.height,spoiler:e.spoiler})),embeds:e.embeds.map(e=>{var i,t,o,n,a;return{title:null!==(i=e.title)&&void 0!==i?i:void 0,type:e.data.type,description:null!==(t=e.description)&&void 0!==t?t:void 0,url:null!==(o=e.url)&&void 0!==o?o:void 0,timestamp:null!==(n=e.timestamp)&&void 0!==n?n:void 0,color:null!==(a=e.color)&&void 0!==a?a:void 0,footer:e.footer?{text:e.footer.text,iconUrl:e.footer.iconURL}:void 0,image:e.image?{url:e.image.url,width:e.image.width,height:e.image.height}:void 0,thumbnail:e.thumbnail?{url:e.thumbnail.url,width:e.thumbnail.width,height:e.thumbnail.height}:void 0,video:e.video?{url:e.video.url,proxyUrl:e.video.proxyURL,width:e.video.width,height:e.video.height}:void 0,provider:e.provider?{name:e.provider.name,url:e.provider.url}:void 0,author:e.author?{name:e.author.name,url:e.author.url,iconUrl:e.author.iconURL}:void 0,fields:e.fields.map(e=>({name:e.name,value:e.value,inline:e.inline}))}}),reactions:e.reactions.cache.map(e=>{var i,t;return{emoji:{id:e.emoji.id,name:null!==(i=e.emoji.name)&&void 0!==i?i:"❓",animated:null!==(t=e.emoji.animated)&&void 0!==t?t:0},count:e.count}}),messageReference:e.reference?{messageId:null!==(a=e.reference.messageId)&&void 0!==a?a:void 0,channelId:null!==(r=e.reference.channelId)&&void 0!==r?r:void 0,guildId:null!==(d=e.reference.guildId)&&void 0!==d?d:void 0}:void 0,referencedMessage:(null===(l=e.reference)||void 0===l?void 0:l.messageId)&&e.channel.messages.cache.has(e.reference.messageId)?t(e.channel.messages.cache.get(e.reference.messageId)):void 0,stickers:e.stickers.map(e=>({id:e.id,name:e.name,formatType:e.format,url:e.url})),thread:e.thread?{id:e.thread.id,name:e.thread.name,messageCount:null!==(s=e.thread.messageCount)&&void 0!==s?s:void 0}:void 0,components:e.components.map(e=>o(e.toJSON()))}}function o(e){var i,t,n,a;const r={type:e.type};return void 0!==e.style&&(r.style=e.style),e.label&&(r.label=e.label),e.custom_id&&(r.customId=e.custom_id),e.url&&(r.url=e.url),e.disabled&&(r.disabled=e.disabled),e.emoji&&(r.emoji={id:null!==(i=e.emoji.id)&&void 0!==i?i:void 0,name:null!==(t=e.emoji.name)&&void 0!==t?t:"",animated:null!==(n=e.emoji.animated)&&void 0!==n?n:0}),e.content&&(r.content=e.content),void 0!==e.accent_color&&(r.accentColor=e.accent_color),e.spoiler&&(r.spoiler=e.spoiler),e.accessory&&(r.accessory={type:e.accessory.type,media:e.accessory.media,description:e.accessory.description,spoiler:e.accessory.spoiler}),e.items&&(r.items=e.items.map(e=>({media:e.media,description:e.description,spoiler:e.spoiler}))),e.file&&(r.file={url:e.file.url,contentType:e.file.content_type}),void 0!==e.spacing&&(r.spacing=e.spacing),void 0!==e.divider&&(r.divider=e.divider),e.media&&(r.media={url:e.media.url}),e.description&&(r.description=e.description),(null===(a=e.components)||void 0===a?void 0:a.length)&&(r.components=e.components.map(o)),r}
@@ -1 +1 @@
1
- import{parseDiscordMarkdown as e,formatMessageTimestamp as s,getAvatarUrl as i,colorIntToHex as t,formatFileSize as a,isImageAttachment as n,isVideoAttachment as d,isAudioAttachment as o}from"./markdown.js";import{TRANSCRIPT_CSS as r}from"./transcript-css.js";const c=(String.fromCharCode(60,115,118,103,32,119,105,100,116,104,61,34,50,52,34,32,104,101,105,103,104,116,61,34,50,52,34,32,118,105,101,119,66,111,120,61,34,48,32,48,32,50,52,32,50,52,34,32,102,105,108,108,61,34,99,117,114,114,101,110,116,67,111,108,111,114,34,62,60,112,97,116,104,32,100,61,34,77,53,46,56,56,54,53,55,32,50,49,67,53,46,53,55,53,52,55,32,50,49,32,53,46,51,51,57,57,32,50,48,46,55,49,56,57,32,53,46,51,57,52,50,55,32,50,48,46,52,49,50,54,76,54,46,48,48,48,48,49,32,49,55,72,50,46,53,57,53,49,49,67,50,46,50,56,52,52,57,32,49,55,32,50,46,48,52,57,48,53,32,49,54,46,55,49,57,56,32,50,46,49,48,50,53,57,32,49,54,46,52,49,51,56,76,50,46,50,55,55,53,57,32,49,53,46,52,49,51,56,67,50,46,51,49,57,52,54,32,49,53,46,49,55,52,54,32,50,46,53,50,55,50,50,32,49,53,32,50,46,55,55,48,49,49,32,49,53,72,54,46,51,53,48,48,49,76,55,46,52,49,48,48,49,32,57,72,52,46,48,48,53,49,49,67,51,46,54,57,52,52,57,32,57,32,51,46,52,53,57,48,53,32,56,46,55,49,57,55,55,32,51,46,53,49,50,53,57,32,56,46,52,49,51,56,49,76,51,46,54,56,55,53,57,32,55,46,52,49,51,56,49,67,51,46,55,50,57,52,54,32,55,46,49,55,52,53,54,32,51,46,57,51,55,50,50,32,55,32,52,46,49,56,48,49,49,32,55,72,55,46,55,54,48,48,49,76,56,46,51,57,54,55,55,32,51,46,52,49,50,54,50,67,56,46,52,51,57,49,52,32,51,46,49,55,51,57,49,32,56,46,54,52,54,54,52,32,51,32,56,46,56,56,57,48,55,32,51,72,57,46,56,55,51,52,52,67,49,48,46,49,56,52,53,32,51,32,49,48,46,52,50,48,49,32,51,46,50,56,49,48,55,32,49,48,46,51,54,53,55,32,51,46,53,56,55,51,56,76,57,46,55,54,48,48,49,32,55,72,49,53,46,55,54,76,49,54,46,51,57,54,56,32,51,46,52,49,50,54,50,67,49,54,46,52,51,57,49,32,51,46,49,55,51,57,49,32,49,54,46,54,52,54,54,32,51,32,49,54,46,56,56,57,49,32,51,72,49,55,46,56,55,51,52,67,49,56,46,49,56,52,53,32,51,32,49,56,46,52,50,48,49,32,51,46,50,56,49,48,55,32,49,56,46,51,54,53,55,32,51,46,53,56,55,51,56,76,49,55,46,55,54,32,55,72,50,49,46,49,54,52,57,67,50,49,46,52,55,53,53,32,55,32,50,49,46,55,49,49,32,55,46,50,56,48,50,51,32,50,49,46,54,53,55,52,32,55,46,53,56,54,49,57,76,50,49,46,52,56,50,52,32,56,46,53,56,54,49,57,67,50,49,46,52,52,48,54,32,56,46,56,50,53,52,52,32,50,49,46,50,51,50,56,32,57,32,50,48,46,57,56,57,57,32,57,72,49,55,46,52,49,76,49,54,46,51,53,32,49,53,72,49,57,46,55,53,52,57,67,50,48,46,48,54,53,53,32,49,53,32,50,48,46,51,48,49,32,49,53,46,50,56,48,50,32,50,48,46,50,52,55,52,32,49,53,46,53,56,54,50,76,50,48,46,48,55,50,52,32,49,54,46,53,56,54,50,67,50,48,46,48,51,48,54,32,49,54,46,56,50,53,52,32,49,57,46,56,50,50,56,32,49,55,32,49,57,46,53,55,57,57,32,49,55,72,49,54,76,49,53,46,51,54,51,50,32,50,48,46,53,56,55,52,67,49,53,46,51,50,48,57,32,50,48,46,56,50,54,49,32,49,53,46,49,49,51,52,32,50,49,32,49,52,46,56,55,48,57,32,50,49,72,49,51,46,56,56,54,54,67,49,51,46,53,55,53,53,32,50,49,32,49,51,46,51,51,57,57,32,50,48,46,55,49,56,57,32,49,51,46,51,57,52,51,32,50,48,46,52,49,50,54,76,49,52,32,49,55,72,56,46,48,48,48,48,49,76,55,46,51,54,51,50,53,32,50,48,46,53,56,55,52,67,55,46,51,50,48,56,56,32,50,48,46,56,50,54,49,32,55,46,49,49,51,51,55,32,50,49,32,54,46,56,55,48,57,52,32,50,49,72,53,46,56,56,54,53,55,90,77,57,46,52,49,48,52,53,32,57,76,56,46,51,53,48,52,53,32,49,53,72,49,52,46,51,53,48,52,76,49,53,46,52,49,48,52,32,57,72,57,46,52,49,48,52,53,90,34,47,62,60,47,115,118,103,62)),l=(String.fromCharCode(60,115,118,103,32,119,105,100,116,104,61,34,50,52,34,32,104,101,105,103,104,116,61,34,50,52,34,32,118,105,101,119,66,111,120,61,34,48,32,48,32,50,52,32,50,52,34,32,102,105,108,108,61,34,99,117,114,114,101,110,116,67,111,108,111,114,34,62,60,112,97,116,104,32,100,61,34,77,49,50,32,51,97,49,32,49,32,48,32,48,32,48,45,49,45,49,104,45,46,48,54,97,49,32,49,32,48,32,48,32,48,45,46,55,52,46,51,50,76,53,46,57,50,32,55,46,53,51,72,51,97,49,32,49,32,48,32,48,32,48,45,49,32,49,118,55,97,49,32,49,32,48,32,48,32,48,32,49,32,49,104,50,46,57,50,108,52,46,50,56,32,53,46,50,49,97,49,32,49,32,48,32,48,32,48,32,46,55,52,46,51,50,72,49,49,97,49,32,49,32,48,32,48,32,48,32,49,45,49,86,51,90,77,49,53,46,49,32,50,48,46,55,53,99,45,46,53,56,46,49,52,45,49,46,49,45,46,51,51,45,49,46,49,45,46,57,50,118,45,46,48,50,99,48,45,46,52,55,46,51,49,45,46,56,53,46,55,51,45,49,46,48,49,32,50,46,50,45,46,56,50,32,51,46,55,55,45,50,46,57,53,32,51,46,55,55,45,53,46,52,54,32,48,45,50,46,53,49,45,49,46,53,56,45,52,46,54,52,45,51,46,55,55,45,53,46,52,54,45,46,52,50,45,46,49,54,45,46,55,51,45,46,53,52,45,46,55,51,45,49,46,48,49,118,45,46,48,50,99,48,45,46,53,57,46,53,50,45,49,46,48,54,32,49,46,49,45,46,57,50,65,55,46,53,32,55,46,53,32,48,32,48,32,49,32,50,48,32,49,51,46,51,52,97,55,46,53,32,55,46,53,32,48,32,48,32,49,45,52,46,57,32,55,46,52,49,90,77,49,52,46,52,51,32,49,54,46,53,52,99,45,46,53,53,46,50,45,49,46,49,45,46,49,55,45,49,46,49,45,46,55,51,32,48,45,46,52,46,50,54,45,46,55,51,46,54,50,45,46,57,65,51,46,52,56,32,51,46,52,56,32,48,32,48,32,48,32,49,53,46,53,32,49,50,99,48,45,49,46,50,55,45,46,54,56,45,50,46,51,56,45,49,46,53,53,45,50,46,57,49,45,46,51,54,45,46,49,55,45,46,54,50,45,46,53,45,46,54,50,45,46,57,32,48,45,46,53,54,46,53,53,45,46,57,51,32,49,46,49,45,46,55,51,97,53,46,49,52,32,53,46,49,52,32,48,32,48,32,49,32,50,46,53,55,32,52,46,53,52,99,48,32,49,46,57,52,45,49,46,48,52,32,51,46,54,51,45,50,46,53,55,32,52,46,53,52,90,34,47,62,60,47,115,118,103,62)),h=(String.fromCharCode(60,115,118,103,32,119,105,100,116,104,61,34,50,52,34,32,104,101,105,103,104,116,61,34,50,52,34,32,118,105,101,119,66,111,120,61,34,48,32,48,32,50,52,32,50,52,34,32,102,105,108,108,61,34,99,117,114,114,101,110,116,67,111,108,111,114,34,62,60,112,97,116,104,32,100,61,34,77,51,46,57,32,56,46,50,54,72,50,86,49,53,46,50,57,52,49,72,51,46,57,86,56,46,50,54,90,34,47,62,60,112,97,116,104,32,100,61,34,77,49,57,46,49,32,52,86,53,46,49,50,54,53,57,76,52,46,56,53,32,56,46,50,54,52,52,55,86,49,56,46,49,49,55,54,67,52,46,56,53,32,49,56,46,53,52,57,54,32,53,46,49,52,54,52,32,49,56,46,57,50,53,50,32,53,46,53,55,48,49,32,49,57,46,48,51,49,53,76,57,46,51,55,48,49,32,49,57,46,57,55,50,55,67,57,46,52,52,54,49,32,49,57,46,57,57,50,32,57,46,53,50,52,32,50,48,32,57,46,54,32,50,48,67,57,46,56,57,53,52,53,32,50,48,32,49,48,46,49,55,55,54,32,49,57,46,56,54,51,53,32,49,48,46,51,53,53,49,32,49,57,46,54,49,48,54,76,49,50,46,54,52,32,49,54,46,51,55,50,55,76,49,57,46,49,32,49,55,46,56,55,51,53,86,49,57,72,50,49,86,52,72,49,57,46,49,90,77,49,48,46,54,50,56,54,32,49,55,46,53,55,54,53,76,55,46,57,53,32,49,54,46,57,48,52,53,76,56,46,48,51,55,32,49,54,46,53,55,54,53,72,49,48,46,56,57,49,52,76,49,48,46,54,50,56,54,32,49,55,46,53,55,54,53,90,77,49,56,46,49,53,32,49,54,46,48,50,52,55,76,53,46,56,53,32,49,51,46,52,53,52,49,86,57,46,48,55,53,56,56,76,49,56,46,49,53,32,54,46,53,48,53,50,57,86,49,54,46,48,50,52,55,90,34,47,62,60,47,115,118,103,62));function m(e){return e.replace(/&/g,(String.fromCharCode(38,97,109,112,59))).replace(/</g,(String.fromCharCode(38,108,116,59))).replace(/>/g,(String.fromCharCode(38,103,116,59))).replace(/"/g,(String.fromCharCode(38,113,117,111,116,59))).replace(/'/g,(String.fromCharCode(38,35,48,51,57,59)))}const v={theme:(String.fromCharCode(100,97,114,107)),showReactions:1,showAvatars:1,showTimestamps:1,showRoleColors:1,showEmbeds:1,showAttachments:1,showThreads:1,showHeader:1,dateFormat:(String.fromCharCode(97,98,115,111,108,117,116,101)),maxImageWidth:400,compact:0};export function generateTranscriptHtml(e,s){var i,t,a,n,d,o;const p=Object.assign(Object.assign({},v),s),g=e.channel.name,f=null!==(t=null===(i=e.guild)||void 0===i?void 0:i.name)&&void 0!==t?t:(String.fromCharCode(68,105,115,99,111,114,100)),$=null!==(a=p.pageTitle)&&void 0!==a?a:`${f} - #${g}`,w=null!==(n=e.totalMessages)&&void 0!==n?n:e.messages.length,y=null!==(d=e.generatedAt)&&void 0!==d?d:(new Date).toISOString(),L=(String.fromCharCode(108,105,103,104,116))===p.theme?"discord-light":(String.fromCharCode(100,105,115,99,111,114,100,45,100,97,114,107)),C=p.compact?" discord-compact":"",H=(function(e,s){var i;const t=[],a=[],n=new Set;for(const s of e.messages)if(n.has(s.author.id)||(n.add(s.author.id),a.push({id:s.author.id,username:s.author.globalName||s.author.username})),s.mentions)for(const e of s.mentions)n.has(e.id)||(n.add(e.id),a.push({id:e.id,username:e.username}));e._globalMentions=a,0!=s.showHeader&&t.push((function(e){var s;const{channel:i,guild:t}=e,a=null!==(s=e.totalMessages)&&void 0!==s?s:e.messages.length,n=(null==t?void 0:t.icon)?`<img src="https://cdn.discordapp.com/icons/${m(t.id)}/${m(t.icon)}.webp?size=64" alt="" class="discord-guild-icon" loading="lazy" />`:"",d=2===(v=i.type)||13===v?`<span class="discord-channel-icon">${l}</span>`:5===v?`<span class="discord-channel-icon">${h}</span>`:`<span class="discord-channel-icon">${c}</span>`,o=i.topic?`<div class="discord-channel-topic">${m(i.topic)}</div>`:"",r=e.generatedAt?`<span>${new Date(e.generatedAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}</span>`:"";var v;return`<div class="discord-channel-header">\n<div class="discord-channel-header-top">\n${n}\n<div class="discord-channel-name">${d}<span>${m(i.name)}</span></div>\n${o}\n</div>\n<div class="discord-transcript-meta"><span>${a} messages</span>${r}</div>\n</div>`})(e)),t.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,109,101,115,115,97,103,101,115,34,62))),t.push((function(e){const s=2===(t=e.type)||13===t?l:5===t?h:c,i=e.topic?`<p class="discord-channel-beginning-topic">${m(e.topic)}</p>`:"";var t;return`<div class="discord-channel-beginning">\n<div class="discord-channel-beginning-icon">${s}</div>\n<h2 class="discord-channel-beginning-title">Welcome to #${m(e.name)}!</h2>\n${i}\n<p class="discord-channel-beginning-subtitle">This is the start of the #${m(e.name)} channel.</p>\n</div>`})(e.channel));const d=(function(e){const s=[];let i=[];for(const t of e){if(0===i.length){i.push(t);continue}const e=i[i.length-1],a=e.author.id===t.author.id,n=new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime()<42e4,d=!(0!==t.type&&19!==t.type||0!==e.type&&19!==e.type),o=!t.referencedMessage&&!t.messageReference;a&&n&&d&&o?i.push(t):(s.push(i),i=[t])}return i.length>0&&s.push(i),s})(e.messages);for(let i=0;i<d.length;i++){const a=d[i];if(0===i||!b(a[0].timestamp,d[i-1][0].timestamp)){const e=new Date(a[0].timestamp);t.push(`<div class="discord-date-separator">\n<div class="discord-date-separator-line"></div>\n<span class="discord-date-separator-text">${m(e.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}))}</span>\n<div class="discord-date-separator-line"></div>\n</div>`)}for(let i=0;i<a.length;i++)t.push(u(a[i],s,e,0===i))}t.push((String.fromCharCode(60,47,100,105,118,62)));const o=e.generatedAt?` on ${new Date(e.generatedAt).toLocaleString("en-US")}`:"";return t.push(`<div class="discord-transcript-footer"><p>Transcript generated${o} &bull; ${null!==(i=e.totalMessages)&&void 0!==i?i:e.messages.length} messages</p></div>`),t.join("\n")})(Object.assign(Object.assign({},e),{generatedAt:y}),p),x=p.fontFamily?`body { font-family: ${m(p.fontFamily)}; }`:"";return`<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="UTF-8" />\n<meta name="viewport" content="width=device-width, initial-scale=1.0" />\n<title>${m($)}</title>\n<meta name="description" content="Transcript of #${m(g)} - ${w} messages" />\n<meta property="og:title" content="${m($)}" />\n<meta property="og:description" content="Discord transcript with ${w} messages" />\n<meta property="og:type" content="website" />\n<meta name="generator" content="discord-transcript" />\n<meta name="robots" content="noindex, nofollow" />\n${p.faviconUrl?`<link rel="icon" href="${m(p.faviconUrl)}" />`:""}\n<link rel="preconnect" href="https://fonts.googleapis.com" />\n<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" />\n<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap" />\n<style>\nhtml { color-scheme: ${"light"===p.theme?"light":"dark"}; }\n*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }\nbody { overflow-x: hidden; background: ${"light"===p.theme?"#fff":"#313338"}; }\n${r}\n${x}\n${null!==(o=p.customCss)&&void 0!==o?o:""}\n</style>\n</head>\n<body>\n<div class="discord-transcript ${L}${C}">\n${H}\n</div>\n<script>\ndocument.addEventListener('click', function(e) {\n var el = e.target.closest('.discord-spoiler');\n if (el) el.classList.toggle('revealed');\n var att = e.target.closest('.discord-spoiler-attachment');\n if (att) att.classList.toggle('discord-spoiler-attachment');\n});\n<\/script>\n</body>\n</html>`}function u(a,n,d,o){var r,c,l,h,v,u,$,b;const w=(function(e){switch(e.type){case 1:return(String.fromCharCode(97,100,100,101,100,32,97,32,114,101,99,105,112,105,101,110,116,32,116,111,32,116,104,101,32,103,114,111,117,112,46));case 2:return(String.fromCharCode(114,101,109,111,118,101,100,32,97,32,114,101,99,105,112,105,101,110,116,32,102,114,111,109,32,116,104,101,32,103,114,111,117,112,46));case 3:return(String.fromCharCode(115,116,97,114,116,101,100,32,97,32,99,97,108,108,46));case 4:return`changed the channel name: ${e.content}`;case 5:return(String.fromCharCode(99,104,97,110,103,101,100,32,116,104,101,32,99,104,97,110,110,101,108,32,105,99,111,110,46));case 6:return(String.fromCharCode(112,105,110,110,101,100,32,97,32,109,101,115,115,97,103,101,32,116,111,32,116,104,105,115,32,99,104,97,110,110,101,108,46));case 7:return(String.fromCharCode(106,111,105,110,101,100,32,116,104,101,32,115,101,114,118,101,114,33));case 8:return(String.fromCharCode(106,117,115,116,32,98,111,111,115,116,101,100,32,116,104,101,32,115,101,114,118,101,114,33));case 9:return(String.fromCharCode(106,117,115,116,32,98,111,111,115,116,101,100,32,116,104,101,32,115,101,114,118,101,114,33,32,84,104,105,115,32,115,101,114,118,101,114,32,104,97,115,32,97,99,104,105,101,118,101,100,32,76,101,118,101,108,32,49,33));case 10:return(String.fromCharCode(106,117,115,116,32,98,111,111,115,116,101,100,32,116,104,101,32,115,101,114,118,101,114,33,32,84,104,105,115,32,115,101,114,118,101,114,32,104,97,115,32,97,99,104,105,101,118,101,100,32,76,101,118,101,108,32,50,33));case 11:return(String.fromCharCode(106,117,115,116,32,98,111,111,115,116,101,100,32,116,104,101,32,115,101,114,118,101,114,33,32,84,104,105,115,32,115,101,114,118,101,114,32,104,97,115,32,97,99,104,105,101,118,101,100,32,76,101,118,101,108,32,51,33));case 12:return`has added a channel follow: ${e.content}`;case 27:return(String.fromCharCode(115,116,97,114,116,101,100,32,97,32,83,116,97,103,101,32,101,118,101,110,116,46));case 28:return(String.fromCharCode(101,110,100,101,100,32,116,104,101,32,83,116,97,103,101,32,101,118,101,110,116,46));case 29:return(String.fromCharCode(105,115,32,110,111,119,32,97,32,115,112,101,97,107,101,114,46));case 31:return`changed the Stage topic: ${e.content}`;default:return null}})(a);if(w)return`<div class="discord-message discord-system-message" id="msg-${m(a.id)}">\n<div class="discord-system-message-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M14.707 5.636L13.293 7.05L17.243 11H4V13H17.243L13.293 16.95L14.707 18.364L21.071 12L14.707 5.636Z"/></svg></div>\n<div class="discord-system-message-content">\n<span class="discord-system-message-author">${m(a.author.username)}</span> ${m(w)}\n<span class="discord-message-timestamp">${m(s(a.timestamp,n.dateFormat))}</span>\n</div>\n</div>`;const y=[],L=(function(e,s){var i,a;if(!e||!s)return;let n;for(const t of e){const e=s[t];e&&e.color&&0!==e.color&&(!n||(null!==(i=e.position)&&void 0!==i?i:0)>(null!==(a=n.position)&&void 0!==a?a:0))&&(n=e)}return n?t(n.color):void 0})(null===(r=d.memberRoles)||void 0===r?void 0:r[a.author.id],d.roles),C=a.pinned?" discord-message-pinned":"",H=o?"":(String.fromCharCode(32,100,105,115,99,111,114,100,45,109,101,115,115,97,103,101,45,103,114,111,117,112,101,100));if(y.push(`<div class="discord-message${C}${H}" id="msg-${m(a.id)}">`),a.referencedMessage){const e=a.referencedMessage,s=0!=n.showAvatars?`<img src="${m(i(e.author.id,e.author.avatar,e.author.discriminator))}" alt="" class="discord-reply-avatar" width="16" height="16" loading="lazy" />`:"",t=e.content?m((x=e.content).length<=200?x:x.slice(0,200)+"…"):(String.fromCharCode(67,108,105,99,107,32,116,111,32,115,101,101,32,97,116,116,97,99,104,109,101,110,116));y.push(`<div class="discord-reply-context">\n<div class="discord-reply-bar"></div>\n${s}\n<span class="discord-reply-username">${m(e.author.username)}</span>\n<span class="discord-reply-content">${t}</span>\n</div>`)}else a.messageReference&&y.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,114,101,112,108,121,45,99,111,110,116,101,120,116,34,62,10,60,115,112,97,110,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,114,101,112,108,121,45,99,111,110,116,101,110,116,32,100,105,115,99,111,114,100,45,114,101,112,108,121,45,100,101,108,101,116,101,100,34,62,79,114,105,103,105,110,97,108,32,109,101,115,115,97,103,101,32,119,97,115,32,100,101,108,101,116,101,100,60,47,115,112,97,110,62,10,60,47,100,105,118,62)));var x;if(y.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,109,101,115,115,97,103,101,45,98,111,100,121,34,62))),o&&0!=n.showAvatars){const e=i(a.author.id,a.author.avatar,a.author.discriminator);y.push(`<div class="discord-message-avatar-container">\n<img src="${m(e)}" alt="${m(a.author.username)}'s avatar" class="discord-message-avatar" width="40" height="40" loading="lazy" />\n</div>`)}if(!o){const e=new Date(a.timestamp).toLocaleTimeString((String.fromCharCode(101,110,45,85,83)),{hour:(String.fromCharCode(50,45,100,105,103,105,116)),minute:(String.fromCharCode(50,45,100,105,103,105,116))});y.push(`<div class="discord-message-gutter"><span class="discord-message-timestamp-short">${m(e)}</span></div>`)}if(y.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,109,101,115,115,97,103,101,45,99,111,110,116,101,110,116,45,119,114,97,112,112,101,114,34,62))),o){const e=0!=n.showRoleColors&&L?` style="color:${L}"`:"",i=a.author.globalName||a.author.username,t=a.author.bot?`<span class="discord-bot-badge">${a.webhookId?"":'<span class="discord-bot-badge-icon"><svg width="10" height="10" viewBox="0 0 16 15.2" fill="#fff"><path d="M7.4,11.17,4,8.62,5,7.26l2,1.53L10.64,4l1.36,1Z"/></svg></span>'}${a.webhookId?"WEBHOOK":"BOT"}</span>`:"",d=a.pinned?'<span class="discord-pin-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M22 12L12.101 2.10101L10.686 3.51401L12.101 4.92901L7.15 9.87801V11.293L4.322 14.121L5.735 15.535L8.565 12.707H9.979L14.928 7.75701L16.343 9.17201L9.414 16.101L10.828 17.515L17.757 10.586L19.172 12L22 12Z"/><path d="M3.08 21.192L8.15 16.122L7.736 15.707L2.666 20.778L3.08 21.192Z"/></svg></span>':"",o=0!=n.showTimestamps?`<span class="discord-message-timestamp">${m(s(a.timestamp,n.dateFormat))}</span>`:"",r=a.editedTimestamp?`<span class="discord-message-edited" title="Edited: ${m(new Date(a.editedTimestamp).toLocaleString())}">(edited)</span>`:"";y.push(`<div class="discord-message-header">\n<span class="discord-message-username"${e}>${m(i)}</span>\n${t}${d}${o}${r}\n</div>`)}const M=null!==(l=null!==(c=d._globalMentions)&&void 0!==c?c:a.mentions)&&void 0!==l?l:[];if(a.content){const s=e(a.content,d.roles,d.channels,M);y.push(`<div class="discord-message-text">${s}</div>`)}if(null===(h=a.stickers)||void 0===h?void 0:h.length){y.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,115,116,105,99,107,101,114,115,34,62)));for(const e of a.stickers)e.url?y.push(`<div class="discord-sticker"><img src="${m(e.url)}" alt="${m(e.name)}" class="discord-sticker-img" width="160" height="160" loading="lazy" /></div>`):y.push(`<div class="discord-sticker"><div class="discord-sticker-placeholder">${m(e.name)}</div></div>`);y.push((String.fromCharCode(60,47,100,105,118,62)))}if(0!=n.showAttachments&&(null===(v=a.attachments)||void 0===v?void 0:v.length)){y.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,97,116,116,97,99,104,109,101,110,116,115,34,62)));for(const e of a.attachments)y.push(g(e,n.maxImageWidth));y.push((String.fromCharCode(60,47,100,105,118,62)))}if(0!=n.showEmbeds&&(null===(u=a.embeds)||void 0===u?void 0:u.length)){y.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,101,109,98,101,100,115,34,62)));for(const e of a.embeds)y.push(p(e,{roles:d.roles,channels:d.channels,mentions:M}));y.push((String.fromCharCode(60,47,100,105,118,62)))}var j,k;if((null===($=a.components)||void 0===$?void 0:$.length)&&y.push((j=a.components,k={roles:d.roles,channels:d.channels,mentions:M},j.map(e=>f(e,k)).join(""))),0!=n.showReactions&&(null===(b=a.reactions)||void 0===b?void 0:b.length)&&y.push(`<div class="discord-reactions">${a.reactions.map(e=>{let s;if(e.emoji.id){const i=e.emoji.animated?"gif":"webp";s=`<img src="https://cdn.discordapp.com/emojis/${e.emoji.id}.${i}?size=48&quality=lossless" alt=":${m(e.emoji.name)}:" class="discord-reaction-emoji-custom" width="18" height="18" loading="lazy" />`}else s=`<span class=(String.fromCharCode(100,105,115,99,111,114,100,45,114,101,97,99,116,105,111,110,45,101,109,111,106,105,45,117,110,105,99,111,100,101))>${m(e.emoji.name)}</span>`;return`<div class=(String.fromCharCode(100,105,115,99,111,114,100,45,114,101,97,99,116,105,111,110))>${s}<span class=(String.fromCharCode(100,105,115,99,111,114,100,45,114,101,97,99,116,105,111,110,45,99,111,117,110,116))>${e.count}</span></div>`}).join("")}</div>`),0!=n.showThreads&&a.thread){const e=void 0!==a.thread.messageCount?`<span class="discord-thread-count">${a.thread.messageCount} messages</span>`:"";y.push(`<div class="discord-thread-indicator">\n<span class="discord-thread-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M5.43309 21C5.35842 21 5.30189 20.9325 5.31494 20.859L5.99991 17H2.14274C2.06819 17 2.01168 16.9327 2.02453 16.8593L2.33253 15.0993C2.34258 15.0419 2.39244 15 2.45074 15H6.34991L7.73991 7H3.94274C3.86819 7 3.81168 6.93274 3.82453 6.85931L4.13253 5.09931C4.14258 5.04189 4.19244 5 4.25074 5H8.08991L8.85218 0.860131C8.86222 0.802722 8.91208 0.760826 8.97038 0.760826H10.7504C10.825 0.760826 10.8815 0.828324 10.8685 0.901826L10.1399 5H16.1399L16.9022 0.860131C16.9122 0.802722 16.9621 0.760826 17.0204 0.760826H18.8004C18.875 0.760826 18.9315 0.828324 18.9185 0.901826L18.1899 5H22.0474C22.1219 5 22.1784 5.06726 22.1656 5.14069L21.8576 6.90069C21.8475 6.95811 21.7977 7 21.7394 7H17.8399L16.45 15H20.2474C20.3219 15 20.3784 15.0673 20.3656 15.1407L20.0576 16.9007C20.0475 16.9581 19.9977 17 19.9394 17H16.0999L15.3376 21.1399C15.3276 21.1973 15.2777 21.2392 15.2194 21.2392H13.4394C13.3648 21.2392 13.3083 21.1717 13.3213 21.0982L14.0499 17H8.04991L7.28764 21.1399C7.2776 21.1973 7.22774 21.2392 7.16943 21.2392H5.43309ZM8.39991 15H14.3999L15.7899 7H9.78991L8.39991 15Z"/></svg></span>\n<div class="discord-thread-name">${m(a.thread.name)}</div>\n${e}\n</div>`)}return y.push((String.fromCharCode(60,47,100,105,118,62,60,47,100,105,118,62,60,47,100,105,118,62))),y.join("\n")}function p(s,i){var a,n,d,o,r,c,l,h,v,u,p;if((String.fromCharCode(103,105,102,118))===s.type&&((null===(a=s.video)||void 0===a?void 0:a.url)||(null===(n=s.thumbnail)||void 0===n?void 0:n.url))){const e=(null===(d=s.video)||void 0===d?void 0:d.proxyUrl)||(null===(o=s.video)||void 0===o?void 0:o.url),i=null===(r=s.thumbnail)||void 0===r?void 0:r.url,t=(null===(c=s.video)||void 0===c?void 0:c.width)?Math.min(s.video.width,400):400;if(e)return`<div class="discord-attachment discord-attachment-image">\n<video autoplay loop muted playsinline class="discord-attachment-img" style="max-width:${t}px" ${i?`poster="${m(i)}"`:""}>\n<source src="${m(e)}" type="video/mp4" />\n</video></div>`;if(i)return`<div class="discord-attachment discord-attachment-image">\n<img src="${m(i)}" alt="" class="discord-attachment-img" loading="lazy" style="max-width:${t}px" /></div>`}if((String.fromCharCode(105,109,97,103,101))===s.type&&(null===(l=s.thumbnail)||void 0===l?void 0:l.url)&&!s.title&&!s.description&&!(null===(h=s.fields)||void 0===h?void 0:h.length)){const e=s.thumbnail.width?Math.min(s.thumbnail.width,400):400;return`<div class="discord-attachment discord-attachment-image">\n<img src="${m(s.thumbnail.url)}" alt="" class="discord-attachment-img" loading="lazy" style="max-width:${e}px" /></div>`}const g=s.color?t(s.color):(String.fromCharCode(118,97,114,40,45,45,100,99,45,98,111,114,100,101,114,45,115,117,98,116,108,101,41)),f=[];if(f.push(`<div class="discord-embed" style="border-left-color:${g}">`),s.author){const e=s.author.iconUrl?`<img src="${m(s.author.iconUrl)}" alt="" class="discord-embed-author-icon" width="24" height="24" loading="lazy" />`:"",i=s.author.url?`<a href="${m(s.author.url)}" class="discord-embed-author-name discord-link" target="_blank" rel="noopener noreferrer">${m(s.author.name)}</a>`:`<span class="discord-embed-author-name">${m(s.author.name)}</span>`;f.push(`<div class="discord-embed-author">${e}${i}</div>`)}if(s.title){const e=s.url?`<a href="${m(s.url)}" class="discord-link" target="_blank" rel="noopener noreferrer">${m(s.title)}</a>`:m(s.title);f.push(`<div class="discord-embed-title">${e}</div>`)}if(s.description&&f.push(`<div class="discord-embed-description">${e(s.description,null==i?void 0:i.roles,null==i?void 0:i.channels,null==i?void 0:i.mentions)}</div>`),null===(v=s.fields)||void 0===v?void 0:v.length){f.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,101,109,98,101,100,45,102,105,101,108,100,115,34,62)));for(const t of s.fields){const s=t.inline?" discord-embed-field-inline":"";f.push(`<div class="discord-embed-field${s}">\n<div class="discord-embed-field-name">${m(t.name)}</div>\n<div class="discord-embed-field-value">${e(t.value,null==i?void 0:i.roles,null==i?void 0:i.channels,null==i?void 0:i.mentions)}</div>\n</div>`)}f.push((String.fromCharCode(60,47,100,105,118,62)))}if(s.image){const e=s.image.width?Math.min(s.image.width,400):400;f.push(`<div class="discord-embed-image"><img src="${m(s.image.url)}" alt="" class="discord-embed-image-img" loading="lazy" style="max-width:${e}px" /></div>`)}if(s.thumbnail&&f.push(`<div class="discord-embed-thumbnail"><img src="${m(s.thumbnail.url)}" alt="" class="discord-embed-thumbnail-img" loading="lazy" /></div>`),null===(u=s.video)||void 0===u?void 0:u.url){const e=s.video.width?Math.min(s.video.width,400):400,i=(null===(p=s.thumbnail)||void 0===p?void 0:p.url)?` poster="${m(s.thumbnail.url)}"`:"";f.push(`<div class="discord-embed-video"><video controls preload="metadata" class="discord-embed-image-img" style="max-width:${e}px;border-radius:4px"${i}><source src="${m(s.video.url)}" type="video/mp4" /></video></div>`)}if(s.footer){const e=s.footer.iconUrl?`<img src="${m(s.footer.iconUrl)}" alt="" class="discord-embed-footer-icon" width="20" height="20" loading="lazy" />`:"",i=s.timestamp?`<span class="discord-embed-footer-separator"> &bull; ${m(new Date(s.timestamp).toLocaleString("en-US"))}</span>`:"";f.push(`<div class="discord-embed-footer">${e}<span class="discord-embed-footer-text">${m(s.footer.text)}</span>${i}</div>`)}return f.push((String.fromCharCode(60,47,100,105,118,62))),f.join("\n")}function g(e,s=400){var i,t;const r=e.spoiler||e.filename.startsWith((String.fromCharCode(83,80,79,73,76,69,82,95)))?" discord-spoiler-attachment":"";if(n(e.contentType)){const i=e.width?Math.min(e.width,s):s,t=m(e.description||e.filename),a=e.description?`<div class="discord-attachment-alt">${m(e.description)}</div>`:"";return`<div class="discord-attachment discord-attachment-image${r}">\n<a href="${m(e.url)}" target="_blank" rel="noopener noreferrer">\n<img src="${m(e.url)}" alt="${t}" class="discord-attachment-img" loading="lazy" style="max-width:${i}px" />\n</a>${a}</div>`}return d(e.contentType)?`<div class="discord-attachment discord-attachment-video">\n<video controls preload="metadata" class="discord-attachment-video-player" style="max-width:${s}px">\n<source src="${m(e.url)}" type="${m(null!==(i=e.contentType)&&void 0!==i?i:"")}" />\n</video></div>`:o(e.contentType)?`<div class="discord-attachment discord-attachment-audio">\n<div class="discord-attachment-audio-container">\n<div class="discord-attachment-file-name">${m(e.filename)}</div>\n<audio controls preload="metadata" class="discord-attachment-audio-player">\n<source src="${m(e.url)}" type="${m(null!==(t=e.contentType)&&void 0!==t?t:"")}" />\n</audio>\n<div class="discord-attachment-file-size">${m(a(e.size))}</div>\n</div></div>`:`<div class="discord-attachment discord-attachment-file">\n<div class="discord-attachment-file-container">\n<span class="discord-attachment-file-icon"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M4 2C4 0.895431 4.89543 0 6 0H14L20 6V22C20 23.1046 19.1046 24 18 24H6C4.89543 24 4 23.1046 4 22V2ZM13 1.5V7H18.5L13 1.5ZM6 2V22H18V8H12V2H6Z"/></svg></span>\n<div class="discord-attachment-file-info">\n<a href="${m(e.url)}" class="discord-link discord-attachment-file-name" target="_blank" rel="noopener noreferrer">${m(e.filename)}</a>\n<div class="discord-attachment-file-size">${m(a(e.size))}</div>\n</div>\n<a href="${m(e.url)}" class="discord-attachment-download" target="_blank" rel="noopener noreferrer" aria-label="Download ${m(e.filename)}"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M16.293 9.293L17.707 10.707L12 16.414L6.29297 10.707L7.70697 9.293L11 12.586V2H13V12.586L16.293 9.293Z"/><path d="M18 20V18H20V20C20 21.102 19.104 22 18 22H6C4.896 22 4 21.102 4 20V18H6V20H18Z"/></svg></a>\n</div></div>`}function f(s,i){var a;switch(s.type){case 1:return(function(e){var s;const i=(null!==(s=e.components)&&void 0!==s?s:[]).map(e=>2===e.type?$(e):e.type>=3&&e.type<=8?`<div class="discord-select"><span class="discord-select-placeholder">${m(e.label||"Make a selection")}</span></div>`:"");return`<div class="discord-component-row">${i.join("")}</div>`})(s);case 2:return $(s);case 3:case 4:case 5:case 6:case 7:case 8:return`<div class="discord-select"><span class="discord-select-placeholder">${m(s.label||"Make a selection")}</span></div>`;case 9:return(function(e,s){var i,t,a,n;return`<div class="discord-v2-section">${(null!==(i=e.components)&&void 0!==i?i:[]).map(e=>f(e,s)).join("")}${e.accessory?`<div class="discord-v2-section-accessory"><img src="${m(null!==(a=null===(t=e.accessory.media)||void 0===t?void 0:t.url)&&void 0!==a?a:"")}" alt="${m(null!==(n=e.accessory.description)&&void 0!==n?n:"")}" class="discord-v2-thumbnail-img" loading="lazy" /></div>`:""}</div>`})(s,i);case 10:return(function(s,i){var t;return`<div class="discord-v2-text-display">${e(null!==(t=s.content)&&void 0!==t?t:"",null==i?void 0:i.roles,null==i?void 0:i.channels,null==i?void 0:i.mentions)}</div>`})(s,i);case 11:return(function(e){var s,i,t;const a=null!==(i=null===(s=e.media)||void 0===s?void 0:s.url)&&void 0!==i?i:"",n=null!==(t=e.description)&&void 0!==t?t:"";return`<div class="discord-v2-thumbnail"><img src="${m(a)}" alt="${m(n)}" class="discord-v2-thumbnail-img" loading="lazy" /></div>`})(s);case 12:return(function(e){var s,i,t;const a=(null!==(s=e.items)&&void 0!==s?s:[]).map(e=>{const s=e.spoiler?" discord-v2-spoiler":"",i=e.description?` alt="${m(e.description)}"`:(String.fromCharCode(32,97,108,116,61,34,34));return`<div class="discord-v2-media-item${s}"><img src="${m(e.media.url)}"${i} class="discord-v2-media-img" loading="lazy" /></div>`});return`<div class="discord-v2-media-gallery${1===(null!==(t=null===(i=e.items)||void 0===i?void 0:i.length)&&void 0!==t?t:0)?" discord-v2-media-gallery-single":""}">${a.join("")}</div>`})(s);case 13:return(function(e){var s;if(!e.file)return"";const i=e.file.url,t=i.startsWith((String.fromCharCode(97,116,116,97,99,104,109,101,110,116,58,47,47)))?i.slice(13):null!==(s=i.split("/").pop())&&void 0!==s?s:(String.fromCharCode(102,105,108,101));return`<div class="discord-v2-file"><div class="discord-v2-file-icon"><svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M6.16667 14.5C6.16667 16.525 7.80833 18.1667 9.83333 18.1667H17.3333C19.9083 18.1667 22 16.075 22 13.5C22 10.925 19.9083 8.83333 17.3333 8.83333H10.5556C8.73056 8.83333 7.27778 10.2861 7.27778 12.1111C7.27778 13.9361 8.73056 15.3889 10.5556 15.3889H16.7778V13.7222H10.5556C9.64722 13.7222 8.94444 13.0194 8.94444 12.1111C8.94444 11.2028 9.64722 10.5 10.5556 10.5H17.3333C18.9917 10.5 20.3333 11.8417 20.3333 13.5C20.3333 15.1583 18.9917 16.5 17.3333 16.5H9.83333C8.725 16.5 7.83333 15.6083 7.83333 14.5C7.83333 13.3917 8.725 12.5 9.83333 12.5H16.7778V10.8333H9.83333C7.80833 10.8333 6.16667 12.475 6.16667 14.5Z"/></svg></div><div class="discord-v2-file-info"><a href="${m(i)}" class="discord-v2-file-name discord-link" target="_blank" rel="noopener noreferrer">${m(t)}</a></div></div>`})(s);case 14:return(function(e){return`<div class="discord-v2-separator${2===e.spacing?" discord-v2-separator-large":""}${0!=e.divider?" discord-v2-separator-divider":""}"></div>`})(s);case 17:return(function(e,s){var i;const a=e.accentColor?` style="border-left: 3px solid ${t(e.accentColor)}"`:"";return`<div class="discord-v2-container${e.spoiler?" discord-v2-spoiler":""}"${a}>${(null!==(i=e.components)&&void 0!==i?i:[]).map(e=>f(e,s)).join("")}</div>`})(s,i);case 18:return`<div class="discord-v2-label">${m(null!==(a=s.content)&&void 0!==a?a:"")}</div>`;default:return""}}function $(e){const s=(function(e){switch(e){case 1:return(String.fromCharCode(100,105,115,99,111,114,100,45,98,117,116,116,111,110,45,112,114,105,109,97,114,121));case 2:default:return(String.fromCharCode(100,105,115,99,111,114,100,45,98,117,116,116,111,110,45,115,101,99,111,110,100,97,114,121));case 3:return(String.fromCharCode(100,105,115,99,111,114,100,45,98,117,116,116,111,110,45,115,117,99,99,101,115,115));case 4:return(String.fromCharCode(100,105,115,99,111,114,100,45,98,117,116,116,111,110,45,100,97,110,103,101,114));case 5:return(String.fromCharCode(100,105,115,99,111,114,100,45,98,117,116,116,111,110,45,108,105,110,107))}})(e.style),i=e.disabled?" discord-button-disabled":"",t=e.emoji?e.emoji.id?`<img src="https://cdn.discordapp.com/emojis/${e.emoji.id}.${e.emoji.animated?"gif":"webp"}?size=48" alt=":${m(e.emoji.name)}:" class="discord-button-emoji" width="18" height="18" loading="lazy" />`:`<span class="discord-button-emoji">${m(e.emoji.name)}</span>`:"",a=e.label?m(e.label):"";return e.url?`<a href="${m(e.url)}" class="discord-button ${s}" target="_blank" rel="noopener noreferrer">${t}${a}</a>`:`<span class="discord-button ${s}${i}">${t}${a}</span>`}function b(e,s){const i=new Date(e),t=new Date(s);return i.getFullYear()===t.getFullYear()&&i.getMonth()===t.getMonth()&&i.getDate()===t.getDate()}
1
+ import{parseDiscordMarkdown as e,formatMessageTimestamp as s,getAvatarUrl as i,colorIntToHex as t,formatFileSize as a,isImageAttachment as n,isVideoAttachment as d,isAudioAttachment as o}from"./markdown.js";import{TRANSCRIPT_CSS as r}from"./transcript-css.js";const c=(String.fromCharCode(60,115,118,103,32,119,105,100,116,104,61,34,50,52,34,32,104,101,105,103,104,116,61,34,50,52,34,32,118,105,101,119,66,111,120,61,34,48,32,48,32,50,52,32,50,52,34,32,102,105,108,108,61,34,99,117,114,114,101,110,116,67,111,108,111,114,34,62,60,112,97,116,104,32,100,61,34,77,53,46,56,56,54,53,55,32,50,49,67,53,46,53,55,53,52,55,32,50,49,32,53,46,51,51,57,57,32,50,48,46,55,49,56,57,32,53,46,51,57,52,50,55,32,50,48,46,52,49,50,54,76,54,46,48,48,48,48,49,32,49,55,72,50,46,53,57,53,49,49,67,50,46,50,56,52,52,57,32,49,55,32,50,46,48,52,57,48,53,32,49,54,46,55,49,57,56,32,50,46,49,48,50,53,57,32,49,54,46,52,49,51,56,76,50,46,50,55,55,53,57,32,49,53,46,52,49,51,56,67,50,46,51,49,57,52,54,32,49,53,46,49,55,52,54,32,50,46,53,50,55,50,50,32,49,53,32,50,46,55,55,48,49,49,32,49,53,72,54,46,51,53,48,48,49,76,55,46,52,49,48,48,49,32,57,72,52,46,48,48,53,49,49,67,51,46,54,57,52,52,57,32,57,32,51,46,52,53,57,48,53,32,56,46,55,49,57,55,55,32,51,46,53,49,50,53,57,32,56,46,52,49,51,56,49,76,51,46,54,56,55,53,57,32,55,46,52,49,51,56,49,67,51,46,55,50,57,52,54,32,55,46,49,55,52,53,54,32,51,46,57,51,55,50,50,32,55,32,52,46,49,56,48,49,49,32,55,72,55,46,55,54,48,48,49,76,56,46,51,57,54,55,55,32,51,46,52,49,50,54,50,67,56,46,52,51,57,49,52,32,51,46,49,55,51,57,49,32,56,46,54,52,54,54,52,32,51,32,56,46,56,56,57,48,55,32,51,72,57,46,56,55,51,52,52,67,49,48,46,49,56,52,53,32,51,32,49,48,46,52,50,48,49,32,51,46,50,56,49,48,55,32,49,48,46,51,54,53,55,32,51,46,53,56,55,51,56,76,57,46,55,54,48,48,49,32,55,72,49,53,46,55,54,76,49,54,46,51,57,54,56,32,51,46,52,49,50,54,50,67,49,54,46,52,51,57,49,32,51,46,49,55,51,57,49,32,49,54,46,54,52,54,54,32,51,32,49,54,46,56,56,57,49,32,51,72,49,55,46,56,55,51,52,67,49,56,46,49,56,52,53,32,51,32,49,56,46,52,50,48,49,32,51,46,50,56,49,48,55,32,49,56,46,51,54,53,55,32,51,46,53,56,55,51,56,76,49,55,46,55,54,32,55,72,50,49,46,49,54,52,57,67,50,49,46,52,55,53,53,32,55,32,50,49,46,55,49,49,32,55,46,50,56,48,50,51,32,50,49,46,54,53,55,52,32,55,46,53,56,54,49,57,76,50,49,46,52,56,50,52,32,56,46,53,56,54,49,57,67,50,49,46,52,52,48,54,32,56,46,56,50,53,52,52,32,50,49,46,50,51,50,56,32,57,32,50,48,46,57,56,57,57,32,57,72,49,55,46,52,49,76,49,54,46,51,53,32,49,53,72,49,57,46,55,53,52,57,67,50,48,46,48,54,53,53,32,49,53,32,50,48,46,51,48,49,32,49,53,46,50,56,48,50,32,50,48,46,50,52,55,52,32,49,53,46,53,56,54,50,76,50,48,46,48,55,50,52,32,49,54,46,53,56,54,50,67,50,48,46,48,51,48,54,32,49,54,46,56,50,53,52,32,49,57,46,56,50,50,56,32,49,55,32,49,57,46,53,55,57,57,32,49,55,72,49,54,76,49,53,46,51,54,51,50,32,50,48,46,53,56,55,52,67,49,53,46,51,50,48,57,32,50,48,46,56,50,54,49,32,49,53,46,49,49,51,52,32,50,49,32,49,52,46,56,55,48,57,32,50,49,72,49,51,46,56,56,54,54,67,49,51,46,53,55,53,53,32,50,49,32,49,51,46,51,51,57,57,32,50,48,46,55,49,56,57,32,49,51,46,51,57,52,51,32,50,48,46,52,49,50,54,76,49,52,32,49,55,72,56,46,48,48,48,48,49,76,55,46,51,54,51,50,53,32,50,48,46,53,56,55,52,67,55,46,51,50,48,56,56,32,50,48,46,56,50,54,49,32,55,46,49,49,51,51,55,32,50,49,32,54,46,56,55,48,57,52,32,50,49,72,53,46,56,56,54,53,55,90,77,57,46,52,49,48,52,53,32,57,76,56,46,51,53,48,52,53,32,49,53,72,49,52,46,51,53,48,52,76,49,53,46,52,49,48,52,32,57,72,57,46,52,49,48,52,53,90,34,47,62,60,47,115,118,103,62)),l=(String.fromCharCode(60,115,118,103,32,119,105,100,116,104,61,34,50,52,34,32,104,101,105,103,104,116,61,34,50,52,34,32,118,105,101,119,66,111,120,61,34,48,32,48,32,50,52,32,50,52,34,32,102,105,108,108,61,34,99,117,114,114,101,110,116,67,111,108,111,114,34,62,60,112,97,116,104,32,100,61,34,77,49,50,32,51,97,49,32,49,32,48,32,48,32,48,45,49,45,49,104,45,46,48,54,97,49,32,49,32,48,32,48,32,48,45,46,55,52,46,51,50,76,53,46,57,50,32,55,46,53,51,72,51,97,49,32,49,32,48,32,48,32,48,45,49,32,49,118,55,97,49,32,49,32,48,32,48,32,48,32,49,32,49,104,50,46,57,50,108,52,46,50,56,32,53,46,50,49,97,49,32,49,32,48,32,48,32,48,32,46,55,52,46,51,50,72,49,49,97,49,32,49,32,48,32,48,32,48,32,49,45,49,86,51,90,77,49,53,46,49,32,50,48,46,55,53,99,45,46,53,56,46,49,52,45,49,46,49,45,46,51,51,45,49,46,49,45,46,57,50,118,45,46,48,50,99,48,45,46,52,55,46,51,49,45,46,56,53,46,55,51,45,49,46,48,49,32,50,46,50,45,46,56,50,32,51,46,55,55,45,50,46,57,53,32,51,46,55,55,45,53,46,52,54,32,48,45,50,46,53,49,45,49,46,53,56,45,52,46,54,52,45,51,46,55,55,45,53,46,52,54,45,46,52,50,45,46,49,54,45,46,55,51,45,46,53,52,45,46,55,51,45,49,46,48,49,118,45,46,48,50,99,48,45,46,53,57,46,53,50,45,49,46,48,54,32,49,46,49,45,46,57,50,65,55,46,53,32,55,46,53,32,48,32,48,32,49,32,50,48,32,49,51,46,51,52,97,55,46,53,32,55,46,53,32,48,32,48,32,49,45,52,46,57,32,55,46,52,49,90,77,49,52,46,52,51,32,49,54,46,53,52,99,45,46,53,53,46,50,45,49,46,49,45,46,49,55,45,49,46,49,45,46,55,51,32,48,45,46,52,46,50,54,45,46,55,51,46,54,50,45,46,57,65,51,46,52,56,32,51,46,52,56,32,48,32,48,32,48,32,49,53,46,53,32,49,50,99,48,45,49,46,50,55,45,46,54,56,45,50,46,51,56,45,49,46,53,53,45,50,46,57,49,45,46,51,54,45,46,49,55,45,46,54,50,45,46,53,45,46,54,50,45,46,57,32,48,45,46,53,54,46,53,53,45,46,57,51,32,49,46,49,45,46,55,51,97,53,46,49,52,32,53,46,49,52,32,48,32,48,32,49,32,50,46,53,55,32,52,46,53,52,99,48,32,49,46,57,52,45,49,46,48,52,32,51,46,54,51,45,50,46,53,55,32,52,46,53,52,90,34,47,62,60,47,115,118,103,62)),h=(String.fromCharCode(60,115,118,103,32,119,105,100,116,104,61,34,50,52,34,32,104,101,105,103,104,116,61,34,50,52,34,32,118,105,101,119,66,111,120,61,34,48,32,48,32,50,52,32,50,52,34,32,102,105,108,108,61,34,99,117,114,114,101,110,116,67,111,108,111,114,34,62,60,112,97,116,104,32,100,61,34,77,51,46,57,32,56,46,50,54,72,50,86,49,53,46,50,57,52,49,72,51,46,57,86,56,46,50,54,90,34,47,62,60,112,97,116,104,32,100,61,34,77,49,57,46,49,32,52,86,53,46,49,50,54,53,57,76,52,46,56,53,32,56,46,50,54,52,52,55,86,49,56,46,49,49,55,54,67,52,46,56,53,32,49,56,46,53,52,57,54,32,53,46,49,52,54,52,32,49,56,46,57,50,53,50,32,53,46,53,55,48,49,32,49,57,46,48,51,49,53,76,57,46,51,55,48,49,32,49,57,46,57,55,50,55,67,57,46,52,52,54,49,32,49,57,46,57,57,50,32,57,46,53,50,52,32,50,48,32,57,46,54,32,50,48,67,57,46,56,57,53,52,53,32,50,48,32,49,48,46,49,55,55,54,32,49,57,46,56,54,51,53,32,49,48,46,51,53,53,49,32,49,57,46,54,49,48,54,76,49,50,46,54,52,32,49,54,46,51,55,50,55,76,49,57,46,49,32,49,55,46,56,55,51,53,86,49,57,72,50,49,86,52,72,49,57,46,49,90,77,49,48,46,54,50,56,54,32,49,55,46,53,55,54,53,76,55,46,57,53,32,49,54,46,57,48,52,53,76,56,46,48,51,55,32,49,54,46,53,55,54,53,72,49,48,46,56,57,49,52,76,49,48,46,54,50,56,54,32,49,55,46,53,55,54,53,90,77,49,56,46,49,53,32,49,54,46,48,50,52,55,76,53,46,56,53,32,49,51,46,52,53,52,49,86,57,46,48,55,53,56,56,76,49,56,46,49,53,32,54,46,53,48,53,50,57,86,49,54,46,48,50,52,55,90,34,47,62,60,47,115,118,103,62));function m(e){return e.replace(/&/g,(String.fromCharCode(38,97,109,112,59))).replace(/</g,(String.fromCharCode(38,108,116,59))).replace(/>/g,(String.fromCharCode(38,103,116,59))).replace(/"/g,(String.fromCharCode(38,113,117,111,116,59))).replace(/'/g,(String.fromCharCode(38,35,48,51,57,59)))}const v={theme:(String.fromCharCode(100,97,114,107)),showReactions:1,showAvatars:1,showTimestamps:1,showRoleColors:1,showEmbeds:1,showAttachments:1,showThreads:1,showHeader:1,dateFormat:(String.fromCharCode(97,98,115,111,108,117,116,101)),maxImageWidth:400,compact:0};export function generateTranscriptHtml(e,s){var i,t,a,n,d,o;const p=Object.assign(Object.assign({},v),s),g=e.channel.name,f=null!==(t=null===(i=e.guild)||void 0===i?void 0:i.name)&&void 0!==t?t:(String.fromCharCode(68,105,115,99,111,114,100)),$=null!==(a=p.pageTitle)&&void 0!==a?a:`${f} - #${g}`,w=null!==(n=e.totalMessages)&&void 0!==n?n:e.messages.length,y=null!==(d=e.generatedAt)&&void 0!==d?d:(new Date).toISOString(),L=(String.fromCharCode(108,105,103,104,116))===p.theme?"discord-light":(String.fromCharCode(100,105,115,99,111,114,100,45,100,97,114,107)),C=p.compact?" discord-compact":"",H=(function(e,s){var i;const t=[],a=[],n=new Set;for(const s of e.messages)if(n.has(s.author.id)||(n.add(s.author.id),a.push({id:s.author.id,username:s.author.globalName||s.author.username})),s.mentions)for(const e of s.mentions)n.has(e.id)||(n.add(e.id),a.push({id:e.id,username:e.username}));e._globalMentions=a,0!=s.showHeader&&t.push((function(e){var s;const{channel:i,guild:t}=e,a=null!==(s=e.totalMessages)&&void 0!==s?s:e.messages.length,n=(null==t?void 0:t.icon)?`<img src="https://cdn.discordapp.com/icons/${m(t.id)}/${m(t.icon)}.webp?size=64" alt="" class="discord-guild-icon" loading="lazy" />`:"",d=2===(v=i.type)||13===v?`<span class="discord-channel-icon">${l}</span>`:5===v?`<span class="discord-channel-icon">${h}</span>`:`<span class="discord-channel-icon">${c}</span>`,o=i.topic?`<div class="discord-channel-topic">${m(i.topic)}</div>`:"",r=e.generatedAt?`<span>${new Date(e.generatedAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}</span>`:"";var v;return`<div class="discord-channel-header">\n<div class="discord-channel-header-top">\n${n}\n<div class="discord-channel-name">${d}<span>${m(i.name)}</span></div>\n${o}\n</div>\n<div class="discord-transcript-meta"><span>${a} messages</span>${r}</div>\n</div>`})(e)),t.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,109,101,115,115,97,103,101,115,34,62))),t.push((function(e){const s=2===(t=e.type)||13===t?l:5===t?h:c,i=e.topic?`<p class="discord-channel-beginning-topic">${m(e.topic)}</p>`:"";var t;return`<div class="discord-channel-beginning">\n<div class="discord-channel-beginning-icon">${s}</div>\n<h2 class="discord-channel-beginning-title">Welcome to #${m(e.name)}!</h2>\n${i}\n<p class="discord-channel-beginning-subtitle">This is the start of the #${m(e.name)} channel.</p>\n</div>`})(e.channel));const d=(function(e){const s=[];let i=[];for(const t of e){if(0===i.length){i.push(t);continue}const e=i[i.length-1],a=e.author.id===t.author.id,n=new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime()<42e4,d=!(0!==t.type&&19!==t.type||0!==e.type&&19!==e.type),o=!t.referencedMessage&&!t.messageReference;a&&n&&d&&o?i.push(t):(s.push(i),i=[t])}return i.length>0&&s.push(i),s})(e.messages);for(let i=0;i<d.length;i++){const a=d[i];if(0===i||!b(a[0].timestamp,d[i-1][0].timestamp)){const e=new Date(a[0].timestamp);t.push(`<div class="discord-date-separator">\n<div class="discord-date-separator-line"></div>\n<span class="discord-date-separator-text">${m(e.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}))}</span>\n<div class="discord-date-separator-line"></div>\n</div>`)}for(let i=0;i<a.length;i++)t.push(u(a[i],s,e,0===i))}t.push((String.fromCharCode(60,47,100,105,118,62)));const o=e.generatedAt?` on ${new Date(e.generatedAt).toLocaleString("en-US")}`:"";return t.push(`<div class="discord-transcript-footer"><p>Transcript generated${o} &bull; ${null!==(i=e.totalMessages)&&void 0!==i?i:e.messages.length} messages</p></div>`),t.join("\n")})(Object.assign(Object.assign({},e),{generatedAt:y}),p),x=p.fontFamily?`body { font-family: ${m(p.fontFamily)}; }`:"";return`<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="UTF-8" />\n<meta name="viewport" content="width=device-width, initial-scale=1.0" />\n<title>${m($)}</title>\n<meta name="description" content="Transcript of #${m(g)} - ${w} messages" />\n<meta property="og:title" content="${m($)}" />\n<meta property="og:description" content="Discord transcript with ${w} messages" />\n<meta property="og:type" content="website" />\n<meta name="generator" content="discord-transcript" />\n<meta name="robots" content="noindex, nofollow" />\n${p.faviconUrl?`<link rel="icon" href="${m(p.faviconUrl)}" />`:""}\n<link rel="preconnect" href="https://fonts.googleapis.com" />\n<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" />\n<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap" />\n<style>\nhtml { color-scheme: ${"light"===p.theme?"light":"dark"}; }\n*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }\nbody { overflow-x: hidden; background: ${"light"===p.theme?"#fff":"#313338"}; }\n${r}\n${x}\n${null!==(o=p.customCss)&&void 0!==o?o:""}\n</style>\n</head>\n<body>\n<div class="discord-transcript ${L}${C}">\n${H}\n</div>\n<script>\ndocument.addEventListener('click', function(e) {\n var el = e.target.closest('.discord-spoiler');\n if (el) el.classList.toggle('revealed');\n var att = e.target.closest('.discord-spoiler-attachment');\n if (att) att.classList.toggle('discord-spoiler-attachment');\n});\n<\/script>\n</body>\n</html>`}function u(a,n,d,o){var r,c,l,h,v,u,$,b;const w=(function(e){switch(e.type){case 1:return(String.fromCharCode(97,100,100,101,100,32,97,32,114,101,99,105,112,105,101,110,116,32,116,111,32,116,104,101,32,103,114,111,117,112,46));case 2:return(String.fromCharCode(114,101,109,111,118,101,100,32,97,32,114,101,99,105,112,105,101,110,116,32,102,114,111,109,32,116,104,101,32,103,114,111,117,112,46));case 3:return(String.fromCharCode(115,116,97,114,116,101,100,32,97,32,99,97,108,108,46));case 4:return`changed the channel name: ${e.content}`;case 5:return(String.fromCharCode(99,104,97,110,103,101,100,32,116,104,101,32,99,104,97,110,110,101,108,32,105,99,111,110,46));case 6:return(String.fromCharCode(112,105,110,110,101,100,32,97,32,109,101,115,115,97,103,101,32,116,111,32,116,104,105,115,32,99,104,97,110,110,101,108,46));case 7:return(String.fromCharCode(106,111,105,110,101,100,32,116,104,101,32,115,101,114,118,101,114,33));case 8:return(String.fromCharCode(106,117,115,116,32,98,111,111,115,116,101,100,32,116,104,101,32,115,101,114,118,101,114,33));case 9:return(String.fromCharCode(106,117,115,116,32,98,111,111,115,116,101,100,32,116,104,101,32,115,101,114,118,101,114,33,32,84,104,105,115,32,115,101,114,118,101,114,32,104,97,115,32,97,99,104,105,101,118,101,100,32,76,101,118,101,108,32,49,33));case 10:return(String.fromCharCode(106,117,115,116,32,98,111,111,115,116,101,100,32,116,104,101,32,115,101,114,118,101,114,33,32,84,104,105,115,32,115,101,114,118,101,114,32,104,97,115,32,97,99,104,105,101,118,101,100,32,76,101,118,101,108,32,50,33));case 11:return(String.fromCharCode(106,117,115,116,32,98,111,111,115,116,101,100,32,116,104,101,32,115,101,114,118,101,114,33,32,84,104,105,115,32,115,101,114,118,101,114,32,104,97,115,32,97,99,104,105,101,118,101,100,32,76,101,118,101,108,32,51,33));case 12:return`has added a channel follow: ${e.content}`;case 27:return(String.fromCharCode(115,116,97,114,116,101,100,32,97,32,83,116,97,103,101,32,101,118,101,110,116,46));case 28:return(String.fromCharCode(101,110,100,101,100,32,116,104,101,32,83,116,97,103,101,32,101,118,101,110,116,46));case 29:return(String.fromCharCode(105,115,32,110,111,119,32,97,32,115,112,101,97,107,101,114,46));case 31:return`changed the Stage topic: ${e.content}`;default:return null}})(a);if(w)return`<div class="discord-message discord-system-message" id="msg-${m(a.id)}">\n<div class="discord-system-message-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M14.707 5.636L13.293 7.05L17.243 11H4V13H17.243L13.293 16.95L14.707 18.364L21.071 12L14.707 5.636Z"/></svg></div>\n<div class="discord-system-message-content">\n<span class="discord-system-message-author">${m(a.author.username)}</span> ${m(w)}\n<span class="discord-message-timestamp">${m(s(a.timestamp,n.dateFormat))}</span>\n</div>\n</div>`;const y=[],L=(function(e,s){var i,a;if(!e||!s)return;let n;for(const t of e){const e=s[t];e&&e.color&&0!==e.color&&(!n||(null!==(i=e.position)&&void 0!==i?i:0)>(null!==(a=n.position)&&void 0!==a?a:0))&&(n=e)}return n?t(n.color):void 0})(null===(r=d.memberRoles)||void 0===r?void 0:r[a.author.id],d.roles),C=a.pinned?" discord-message-pinned":"",H=o?"":(String.fromCharCode(32,100,105,115,99,111,114,100,45,109,101,115,115,97,103,101,45,103,114,111,117,112,101,100));if(y.push(`<div class="discord-message${C}${H}" id="msg-${m(a.id)}">`),a.referencedMessage){const e=a.referencedMessage,s=0!=n.showAvatars?`<img src="${m(i(e.author.id,e.author.avatar,e.author.discriminator))}" alt="" class="discord-reply-avatar" width="16" height="16" loading="lazy" />`:"",t=e.content?m((x=e.content).length<=200?x:x.slice(0,200)+"…"):(String.fromCharCode(67,108,105,99,107,32,116,111,32,115,101,101,32,97,116,116,97,99,104,109,101,110,116));y.push(`<div class="discord-reply-context">\n<div class="discord-reply-bar"></div>\n${s}\n<span class="discord-reply-username">${m(e.author.username)}</span>\n<span class="discord-reply-content">${t}</span>\n</div>`)}else a.messageReference&&y.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,114,101,112,108,121,45,99,111,110,116,101,120,116,34,62,10,60,115,112,97,110,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,114,101,112,108,121,45,99,111,110,116,101,110,116,32,100,105,115,99,111,114,100,45,114,101,112,108,121,45,100,101,108,101,116,101,100,34,62,79,114,105,103,105,110,97,108,32,109,101,115,115,97,103,101,32,119,97,115,32,100,101,108,101,116,101,100,60,47,115,112,97,110,62,10,60,47,100,105,118,62)));var x;if(y.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,109,101,115,115,97,103,101,45,98,111,100,121,34,62))),o&&0!=n.showAvatars){const e=i(a.author.id,a.author.avatar,a.author.discriminator);y.push(`<div class="discord-message-avatar-container">\n<img src="${m(e)}" alt="${m(a.author.username)}'s avatar" class="discord-message-avatar" width="40" height="40" loading="lazy" />\n</div>`)}if(!o){const e=new Date(a.timestamp).toLocaleTimeString((String.fromCharCode(101,110,45,85,83)),{hour:(String.fromCharCode(50,45,100,105,103,105,116)),minute:(String.fromCharCode(50,45,100,105,103,105,116))});y.push(`<div class="discord-message-gutter"><span class="discord-message-timestamp-short">${m(e)}</span></div>`)}if(y.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,109,101,115,115,97,103,101,45,99,111,110,116,101,110,116,45,119,114,97,112,112,101,114,34,62))),o){const e=0!=n.showRoleColors&&L?` style="color:${L}"`:"",i=a.author.globalName||a.author.username,t=a.author.bot?`<span class="discord-bot-badge">${a.webhookId?"":'<span class="discord-bot-badge-icon"><svg width="10" height="10" viewBox="0 0 16 15.2" fill="#fff"><path d="M7.4,11.17,4,8.62,5,7.26l2,1.53L10.64,4l1.36,1Z"/></svg></span>'}${a.webhookId?"WEBHOOK":"BOT"}</span>`:"",d=a.pinned?'<span class="discord-pin-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M22 12L12.101 2.10101L10.686 3.51401L12.101 4.92901L7.15 9.87801V11.293L4.322 14.121L5.735 15.535L8.565 12.707H9.979L14.928 7.75701L16.343 9.17201L9.414 16.101L10.828 17.515L17.757 10.586L19.172 12L22 12Z"/><path d="M3.08 21.192L8.15 16.122L7.736 15.707L2.666 20.778L3.08 21.192Z"/></svg></span>':"",o=0!=n.showTimestamps?`<span class="discord-message-timestamp">${m(s(a.timestamp,n.dateFormat))}</span>`:"",r=a.editedTimestamp?`<span class="discord-message-edited" title="Edited: ${m(new Date(a.editedTimestamp).toLocaleString())}">(edited)</span>`:"";y.push(`<div class="discord-message-header">\n<span class="discord-message-username"${e}>${m(i)}</span>\n${t}${d}${o}${r}\n</div>`)}const M=null!==(l=null!==(c=d._globalMentions)&&void 0!==c?c:a.mentions)&&void 0!==l?l:[];if(a.content){const s=e(a.content,d.roles,d.channels,M);y.push(`<div class="discord-message-text">${s}</div>`)}if(null===(h=a.stickers)||void 0===h?void 0:h.length){y.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,115,116,105,99,107,101,114,115,34,62)));for(const e of a.stickers)e.url?y.push(`<div class="discord-sticker"><img src="${m(e.url)}" alt="${m(e.name)}" class="discord-sticker-img" width="160" height="160" loading="lazy" /></div>`):y.push(`<div class="discord-sticker"><div class="discord-sticker-placeholder">${m(e.name)}</div></div>`);y.push((String.fromCharCode(60,47,100,105,118,62)))}if(0!=n.showAttachments&&(null===(v=a.attachments)||void 0===v?void 0:v.length)){y.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,97,116,116,97,99,104,109,101,110,116,115,34,62)));for(const e of a.attachments)y.push(g(e,n.maxImageWidth));y.push((String.fromCharCode(60,47,100,105,118,62)))}if(0!=n.showEmbeds&&(null===(u=a.embeds)||void 0===u?void 0:u.length)){y.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,101,109,98,101,100,115,34,62)));for(const e of a.embeds)y.push(p(e,{roles:d.roles,channels:d.channels,mentions:M}));y.push((String.fromCharCode(60,47,100,105,118,62)))}var j,k;if((null===($=a.components)||void 0===$?void 0:$.length)&&y.push((j=a.components,k={roles:d.roles,channels:d.channels,mentions:M},j.map(e=>f(e,k)).join(""))),0!=n.showReactions&&(null===(b=a.reactions)||void 0===b?void 0:b.length)&&y.push(`<div class="discord-reactions">${a.reactions.map(e=>{let s;if(e.emoji.id){const i=e.emoji.animated?"gif":"webp";s=`<img src="https://cdn.discordapp.com/emojis/${e.emoji.id}.${i}?size=48&quality=lossless" alt=":${m(e.emoji.name)}:" class="discord-reaction-emoji-custom" width="18" height="18" loading="lazy" />`}else s=`<span class="discord-reaction-emoji-unicode">${m(e.emoji.name)}</span>`;return`<div class="discord-reaction">${s}<span class="discord-reaction-count">${e.count}</span></div>`}).join("")}</div>`),0!=n.showThreads&&a.thread){const e=void 0!==a.thread.messageCount?`<span class="discord-thread-count">${a.thread.messageCount} messages</span>`:"";y.push(`<div class="discord-thread-indicator">\n<span class="discord-thread-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M5.43309 21C5.35842 21 5.30189 20.9325 5.31494 20.859L5.99991 17H2.14274C2.06819 17 2.01168 16.9327 2.02453 16.8593L2.33253 15.0993C2.34258 15.0419 2.39244 15 2.45074 15H6.34991L7.73991 7H3.94274C3.86819 7 3.81168 6.93274 3.82453 6.85931L4.13253 5.09931C4.14258 5.04189 4.19244 5 4.25074 5H8.08991L8.85218 0.860131C8.86222 0.802722 8.91208 0.760826 8.97038 0.760826H10.7504C10.825 0.760826 10.8815 0.828324 10.8685 0.901826L10.1399 5H16.1399L16.9022 0.860131C16.9122 0.802722 16.9621 0.760826 17.0204 0.760826H18.8004C18.875 0.760826 18.9315 0.828324 18.9185 0.901826L18.1899 5H22.0474C22.1219 5 22.1784 5.06726 22.1656 5.14069L21.8576 6.90069C21.8475 6.95811 21.7977 7 21.7394 7H17.8399L16.45 15H20.2474C20.3219 15 20.3784 15.0673 20.3656 15.1407L20.0576 16.9007C20.0475 16.9581 19.9977 17 19.9394 17H16.0999L15.3376 21.1399C15.3276 21.1973 15.2777 21.2392 15.2194 21.2392H13.4394C13.3648 21.2392 13.3083 21.1717 13.3213 21.0982L14.0499 17H8.04991L7.28764 21.1399C7.2776 21.1973 7.22774 21.2392 7.16943 21.2392H5.43309ZM8.39991 15H14.3999L15.7899 7H9.78991L8.39991 15Z"/></svg></span>\n<div class="discord-thread-name">${m(a.thread.name)}</div>\n${e}\n</div>`)}return y.push((String.fromCharCode(60,47,100,105,118,62,60,47,100,105,118,62,60,47,100,105,118,62))),y.join("\n")}function p(s,i){var a,n,d,o,r,c,l,h,v,u,p;if((String.fromCharCode(103,105,102,118))===s.type&&((null===(a=s.video)||void 0===a?void 0:a.url)||(null===(n=s.thumbnail)||void 0===n?void 0:n.url))){const e=(null===(d=s.video)||void 0===d?void 0:d.proxyUrl)||(null===(o=s.video)||void 0===o?void 0:o.url),i=null===(r=s.thumbnail)||void 0===r?void 0:r.url,t=(null===(c=s.video)||void 0===c?void 0:c.width)?Math.min(s.video.width,400):400;if(e)return`<div class="discord-attachment discord-attachment-image">\n<video autoplay loop muted playsinline class="discord-attachment-img" style="max-width:${t}px" ${i?`poster="${m(i)}"`:""}>\n<source src="${m(e)}" type="video/mp4" />\n</video></div>`;if(i)return`<div class="discord-attachment discord-attachment-image">\n<img src="${m(i)}" alt="" class="discord-attachment-img" loading="lazy" style="max-width:${t}px" /></div>`}if((String.fromCharCode(105,109,97,103,101))===s.type&&(null===(l=s.thumbnail)||void 0===l?void 0:l.url)&&!s.title&&!s.description&&!(null===(h=s.fields)||void 0===h?void 0:h.length)){const e=s.thumbnail.width?Math.min(s.thumbnail.width,400):400;return`<div class="discord-attachment discord-attachment-image">\n<img src="${m(s.thumbnail.url)}" alt="" class="discord-attachment-img" loading="lazy" style="max-width:${e}px" /></div>`}const g=s.color?t(s.color):(String.fromCharCode(118,97,114,40,45,45,100,99,45,98,111,114,100,101,114,45,115,117,98,116,108,101,41)),f=[];if(f.push(`<div class="discord-embed" style="border-left-color:${g}">`),s.author){const e=s.author.iconUrl?`<img src="${m(s.author.iconUrl)}" alt="" class="discord-embed-author-icon" width="24" height="24" loading="lazy" />`:"",i=s.author.url?`<a href="${m(s.author.url)}" class="discord-embed-author-name discord-link" target="_blank" rel="noopener noreferrer">${m(s.author.name)}</a>`:`<span class="discord-embed-author-name">${m(s.author.name)}</span>`;f.push(`<div class="discord-embed-author">${e}${i}</div>`)}if(s.title){const e=s.url?`<a href="${m(s.url)}" class="discord-link" target="_blank" rel="noopener noreferrer">${m(s.title)}</a>`:m(s.title);f.push(`<div class="discord-embed-title">${e}</div>`)}if(s.description&&f.push(`<div class="discord-embed-description">${e(s.description,null==i?void 0:i.roles,null==i?void 0:i.channels,null==i?void 0:i.mentions)}</div>`),null===(v=s.fields)||void 0===v?void 0:v.length){f.push((String.fromCharCode(60,100,105,118,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,101,109,98,101,100,45,102,105,101,108,100,115,34,62)));for(const t of s.fields){const s=t.inline?" discord-embed-field-inline":"";f.push(`<div class="discord-embed-field${s}">\n<div class="discord-embed-field-name">${m(t.name)}</div>\n<div class="discord-embed-field-value">${e(t.value,null==i?void 0:i.roles,null==i?void 0:i.channels,null==i?void 0:i.mentions)}</div>\n</div>`)}f.push((String.fromCharCode(60,47,100,105,118,62)))}if(s.image){const e=s.image.width?Math.min(s.image.width,400):400;f.push(`<div class="discord-embed-image"><img src="${m(s.image.url)}" alt="" class="discord-embed-image-img" loading="lazy" style="max-width:${e}px" /></div>`)}if(s.thumbnail&&f.push(`<div class="discord-embed-thumbnail"><img src="${m(s.thumbnail.url)}" alt="" class="discord-embed-thumbnail-img" loading="lazy" /></div>`),null===(u=s.video)||void 0===u?void 0:u.url){const e=s.video.width?Math.min(s.video.width,400):400,i=(null===(p=s.thumbnail)||void 0===p?void 0:p.url)?` poster="${m(s.thumbnail.url)}"`:"";f.push(`<div class="discord-embed-video"><video controls preload="metadata" class="discord-embed-image-img" style="max-width:${e}px;border-radius:4px"${i}><source src="${m(s.video.url)}" type="video/mp4" /></video></div>`)}if(s.footer){const e=s.footer.iconUrl?`<img src="${m(s.footer.iconUrl)}" alt="" class="discord-embed-footer-icon" width="20" height="20" loading="lazy" />`:"",i=s.timestamp?`<span class="discord-embed-footer-separator"> &bull; ${m(new Date(s.timestamp).toLocaleString("en-US"))}</span>`:"";f.push(`<div class="discord-embed-footer">${e}<span class="discord-embed-footer-text">${m(s.footer.text)}</span>${i}</div>`)}return f.push((String.fromCharCode(60,47,100,105,118,62))),f.join("\n")}function g(e,s=400){var i,t;const r=e.spoiler||e.filename.startsWith((String.fromCharCode(83,80,79,73,76,69,82,95)))?" discord-spoiler-attachment":"";if(n(e.contentType)){const i=e.width?Math.min(e.width,s):s,t=m(e.description||e.filename),a=e.description?`<div class="discord-attachment-alt">${m(e.description)}</div>`:"";return`<div class="discord-attachment discord-attachment-image${r}">\n<a href="${m(e.url)}" target="_blank" rel="noopener noreferrer">\n<img src="${m(e.url)}" alt="${t}" class="discord-attachment-img" loading="lazy" style="max-width:${i}px" />\n</a>${a}</div>`}return d(e.contentType)?`<div class="discord-attachment discord-attachment-video">\n<video controls preload="metadata" class="discord-attachment-video-player" style="max-width:${s}px">\n<source src="${m(e.url)}" type="${m(null!==(i=e.contentType)&&void 0!==i?i:"")}" />\n</video></div>`:o(e.contentType)?`<div class="discord-attachment discord-attachment-audio">\n<div class="discord-attachment-audio-container">\n<div class="discord-attachment-file-name">${m(e.filename)}</div>\n<audio controls preload="metadata" class="discord-attachment-audio-player">\n<source src="${m(e.url)}" type="${m(null!==(t=e.contentType)&&void 0!==t?t:"")}" />\n</audio>\n<div class="discord-attachment-file-size">${m(a(e.size))}</div>\n</div></div>`:`<div class="discord-attachment discord-attachment-file">\n<div class="discord-attachment-file-container">\n<span class="discord-attachment-file-icon"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M4 2C4 0.895431 4.89543 0 6 0H14L20 6V22C20 23.1046 19.1046 24 18 24H6C4.89543 24 4 23.1046 4 22V2ZM13 1.5V7H18.5L13 1.5ZM6 2V22H18V8H12V2H6Z"/></svg></span>\n<div class="discord-attachment-file-info">\n<a href="${m(e.url)}" class="discord-link discord-attachment-file-name" target="_blank" rel="noopener noreferrer">${m(e.filename)}</a>\n<div class="discord-attachment-file-size">${m(a(e.size))}</div>\n</div>\n<a href="${m(e.url)}" class="discord-attachment-download" target="_blank" rel="noopener noreferrer" aria-label="Download ${m(e.filename)}"><svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M16.293 9.293L17.707 10.707L12 16.414L6.29297 10.707L7.70697 9.293L11 12.586V2H13V12.586L16.293 9.293Z"/><path d="M18 20V18H20V20C20 21.102 19.104 22 18 22H6C4.896 22 4 21.102 4 20V18H6V20H18Z"/></svg></a>\n</div></div>`}function f(s,i){var a;switch(s.type){case 1:return(function(e){var s;const i=(null!==(s=e.components)&&void 0!==s?s:[]).map(e=>2===e.type?$(e):e.type>=3&&e.type<=8?`<div class="discord-select"><span class="discord-select-placeholder">${m(e.label||"Make a selection")}</span></div>`:"");return`<div class="discord-component-row">${i.join("")}</div>`})(s);case 2:return $(s);case 3:case 4:case 5:case 6:case 7:case 8:return`<div class="discord-select"><span class="discord-select-placeholder">${m(s.label||"Make a selection")}</span></div>`;case 9:return(function(e,s){var i,t,a,n;return`<div class="discord-v2-section">${(null!==(i=e.components)&&void 0!==i?i:[]).map(e=>f(e,s)).join("")}${e.accessory?`<div class="discord-v2-section-accessory"><img src="${m(null!==(a=null===(t=e.accessory.media)||void 0===t?void 0:t.url)&&void 0!==a?a:"")}" alt="${m(null!==(n=e.accessory.description)&&void 0!==n?n:"")}" class="discord-v2-thumbnail-img" loading="lazy" /></div>`:""}</div>`})(s,i);case 10:return(function(s,i){var t;return`<div class="discord-v2-text-display">${e(null!==(t=s.content)&&void 0!==t?t:"",null==i?void 0:i.roles,null==i?void 0:i.channels,null==i?void 0:i.mentions)}</div>`})(s,i);case 11:return(function(e){var s,i,t;const a=null!==(i=null===(s=e.media)||void 0===s?void 0:s.url)&&void 0!==i?i:"",n=null!==(t=e.description)&&void 0!==t?t:"";return`<div class="discord-v2-thumbnail"><img src="${m(a)}" alt="${m(n)}" class="discord-v2-thumbnail-img" loading="lazy" /></div>`})(s);case 12:return(function(e){var s,i,t;const a=(null!==(s=e.items)&&void 0!==s?s:[]).map(e=>{const s=e.spoiler?" discord-v2-spoiler":"",i=e.description?` alt="${m(e.description)}"`:(String.fromCharCode(32,97,108,116,61,34,34));return`<div class="discord-v2-media-item${s}"><img src="${m(e.media.url)}"${i} class="discord-v2-media-img" loading="lazy" /></div>`});return`<div class="discord-v2-media-gallery${1===(null!==(t=null===(i=e.items)||void 0===i?void 0:i.length)&&void 0!==t?t:0)?" discord-v2-media-gallery-single":""}">${a.join("")}</div>`})(s);case 13:return(function(e){var s;if(!e.file)return"";const i=e.file.url,t=i.startsWith((String.fromCharCode(97,116,116,97,99,104,109,101,110,116,58,47,47)))?i.slice(13):null!==(s=i.split("/").pop())&&void 0!==s?s:(String.fromCharCode(102,105,108,101));return`<div class="discord-v2-file"><div class="discord-v2-file-icon"><svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M6.16667 14.5C6.16667 16.525 7.80833 18.1667 9.83333 18.1667H17.3333C19.9083 18.1667 22 16.075 22 13.5C22 10.925 19.9083 8.83333 17.3333 8.83333H10.5556C8.73056 8.83333 7.27778 10.2861 7.27778 12.1111C7.27778 13.9361 8.73056 15.3889 10.5556 15.3889H16.7778V13.7222H10.5556C9.64722 13.7222 8.94444 13.0194 8.94444 12.1111C8.94444 11.2028 9.64722 10.5 10.5556 10.5H17.3333C18.9917 10.5 20.3333 11.8417 20.3333 13.5C20.3333 15.1583 18.9917 16.5 17.3333 16.5H9.83333C8.725 16.5 7.83333 15.6083 7.83333 14.5C7.83333 13.3917 8.725 12.5 9.83333 12.5H16.7778V10.8333H9.83333C7.80833 10.8333 6.16667 12.475 6.16667 14.5Z"/></svg></div><div class="discord-v2-file-info"><a href="${m(i)}" class="discord-v2-file-name discord-link" target="_blank" rel="noopener noreferrer">${m(t)}</a></div></div>`})(s);case 14:return(function(e){return`<div class="discord-v2-separator${2===e.spacing?" discord-v2-separator-large":""}${0!=e.divider?" discord-v2-separator-divider":""}"></div>`})(s);case 17:return(function(e,s){var i;const a=e.accentColor?` style="border-left: 3px solid ${t(e.accentColor)}"`:"";return`<div class="discord-v2-container${e.spoiler?" discord-v2-spoiler":""}"${a}>${(null!==(i=e.components)&&void 0!==i?i:[]).map(e=>f(e,s)).join("")}</div>`})(s,i);case 18:return`<div class="discord-v2-label">${m(null!==(a=s.content)&&void 0!==a?a:"")}</div>`;default:return""}}function $(e){const s=(function(e){switch(e){case 1:return(String.fromCharCode(100,105,115,99,111,114,100,45,98,117,116,116,111,110,45,112,114,105,109,97,114,121));case 2:default:return(String.fromCharCode(100,105,115,99,111,114,100,45,98,117,116,116,111,110,45,115,101,99,111,110,100,97,114,121));case 3:return(String.fromCharCode(100,105,115,99,111,114,100,45,98,117,116,116,111,110,45,115,117,99,99,101,115,115));case 4:return(String.fromCharCode(100,105,115,99,111,114,100,45,98,117,116,116,111,110,45,100,97,110,103,101,114));case 5:return(String.fromCharCode(100,105,115,99,111,114,100,45,98,117,116,116,111,110,45,108,105,110,107))}})(e.style),i=e.disabled?" discord-button-disabled":"",t=e.emoji?e.emoji.id?`<img src="https://cdn.discordapp.com/emojis/${e.emoji.id}.${e.emoji.animated?"gif":"webp"}?size=48" alt=":${m(e.emoji.name)}:" class="discord-button-emoji" width="18" height="18" loading="lazy" />`:`<span class="discord-button-emoji">${m(e.emoji.name)}</span>`:"",a=e.label?m(e.label):"";return e.url?`<a href="${m(e.url)}" class="discord-button ${s}" target="_blank" rel="noopener noreferrer">${t}${a}</a>`:`<span class="discord-button ${s}${i}">${t}${a}</span>`}function b(e,s){const i=new Date(e),t=new Date(s);return i.getFullYear()===t.getFullYear()&&i.getMonth()===t.getMonth()&&i.getDate()===t.getDate()}
@@ -1 +1 @@
1
- import e from"sanitize-html";const t={allowedTags:[(String.fromCharCode(115,116,114,111,110,103)),"em","u","s",(String.fromCharCode(99,111,100,101)),(String.fromCharCode(112,114,101)),"br",(String.fromCharCode(115,112,97,110)),(String.fromCharCode(100,105,118)),(String.fromCharCode(98,108,111,99,107,113,117,111,116,101)),"h1","h2","h3","ul","ol","li","a",(String.fromCharCode(105,109,103))],allowedAttributes:{span:[(String.fromCharCode(99,108,97,115,115)),(String.fromCharCode(100,97,116,97,45,42)),(String.fromCharCode(115,116,121,108,101))],div:[(String.fromCharCode(99,108,97,115,115)),(String.fromCharCode(100,97,116,97,45,42))],a:[(String.fromCharCode(104,114,101,102)),(String.fromCharCode(99,108,97,115,115)),(String.fromCharCode(116,97,114,103,101,116)),(String.fromCharCode(114,101,108))],code:[(String.fromCharCode(99,108,97,115,115))],pre:[(String.fromCharCode(99,108,97,115,115))],img:[(String.fromCharCode(115,114,99)),(String.fromCharCode(97,108,116)),(String.fromCharCode(99,108,97,115,115)),(String.fromCharCode(119,105,100,116,104)),(String.fromCharCode(104,101,105,103,104,116)),(String.fromCharCode(108,111,97,100,105,110,103))],blockquote:[(String.fromCharCode(99,108,97,115,115))]},allowedStyles:{span:{color:[/^#[0-9a-fA-F]{6}$/],"background-color":[/^rgba\(\d{1,3},\d{1,3},\d{1,3},[\d.]+\)$/]}},allowedSchemes:[(String.fromCharCode(104,116,116,112,115)),(String.fromCharCode(104,116,116,112))]};function r(e){return e.replace(/&/g,(String.fromCharCode(38,97,109,112,59))).replace(/</g,(String.fromCharCode(38,108,116,59))).replace(/>/g,(String.fromCharCode(38,103,116,59))).replace(/"/g,(String.fromCharCode(38,113,117,111,116,59))).replace(/'/g,(String.fromCharCode(38,35,48,51,57,59)))}export function parseDiscordMarkdown(n,a,l,s){if(!n)return"";let i=r(n);const c=[];return i=i.replace(/```(\w+\n)?([\s\S]*?)```/g,(e,t,o)=>{const n=null==t?void 0:t.trim(),a=n?` class="language-${r(n)}"`:"",l=c.length;return c.push(`<pre class="discord-code-block"><code${a}>${o}</code></pre>`),`${l}`}),i=i.replace(/`([^`\n]+)`/g,(e,t)=>{const r=c.length;return c.push(`<code class="discord-inline-code">${t}</code>`),`${r}`}),i=i.replace(/^### (.+)$/gm,(String.fromCharCode(60,104,51,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,104,101,97,100,101,114,34,62,36,49,60,47,104,51,62))),i=i.replace(/^## (.+)$/gm,(String.fromCharCode(60,104,50,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,104,101,97,100,101,114,34,62,36,49,60,47,104,50,62))),i=i.replace(/^# (.+)$/gm,(String.fromCharCode(60,104,49,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,104,101,97,100,101,114,34,62,36,49,60,47,104,49,62))),i=i.replace(/^&gt;&gt;&gt; ([\s\S]+)$/gm,(String.fromCharCode(60,98,108,111,99,107,113,117,111,116,101,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,98,108,111,99,107,113,117,111,116,101,34,62,36,49,60,47,98,108,111,99,107,113,117,111,116,101,62))),i=i.replace(/^&gt; (.+)$/gm,(String.fromCharCode(60,98,108,111,99,107,113,117,111,116,101,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,98,108,111,99,107,113,117,111,116,101,34,62,36,49,60,47,98,108,111,99,107,113,117,111,116,101,62))),i=i.replace(/^- (.+)$/gm,(String.fromCharCode(60,108,105,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,108,105,115,116,45,105,116,101,109,34,62,36,49,60,47,108,105,62))),i=i.replace(/\*\*\*(.+?)\*\*\*/g,(String.fromCharCode(60,115,116,114,111,110,103,62,60,101,109,62,36,49,60,47,101,109,62,60,47,115,116,114,111,110,103,62))),i=i.replace(/\*\*(.+?)\*\*/g,(String.fromCharCode(60,115,116,114,111,110,103,62,36,49,60,47,115,116,114,111,110,103,62))),i=i.replace(/__(.+?)__/g,(String.fromCharCode(60,117,62,36,49,60,47,117,62))),i=i.replace(/\*(.+?)\*/g,(String.fromCharCode(60,101,109,62,36,49,60,47,101,109,62))),i=i.replace(/(?<!\w)_(.+?)_(?!\w)/g,(String.fromCharCode(60,101,109,62,36,49,60,47,101,109,62))),i=i.replace(/~~(.+?)~~/g,(String.fromCharCode(60,115,62,36,49,60,47,115,62))),i=i.replace(/\|\|(.+?)\|\|/g,(String.fromCharCode(60,115,112,97,110,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,115,112,111,105,108,101,114,34,32,100,97,116,97,45,115,112,111,105,108,101,114,61,34,116,114,117,101,34,62,36,49,60,47,115,112,97,110,62))),i=i.replace(/\[([^\]]+)\]\((&lt;)?((https?:\/\/)[^\s)]+?)(&gt;)?\)/g,(String.fromCharCode(60,97,32,104,114,101,102,61,34,36,51,34,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,108,105,110,107,34,32,116,97,114,103,101,116,61,34,95,98,108,97,110,107,34,32,114,101,108,61,34,110,111,111,112,101,110,101,114,32,110,111,114,101,102,101,114,114,101,114,34,62,36,49,60,47,97,62))),i=i.replace(/(?<![="'])(https?:\/\/[^\s<]+)/g,(String.fromCharCode(60,97,32,104,114,101,102,61,34,36,49,34,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,108,105,110,107,34,32,116,97,114,103,101,116,61,34,95,98,108,97,110,107,34,32,114,101,108,61,34,110,111,111,112,101,110,101,114,32,110,111,114,101,102,101,114,114,101,114,34,62,36,49,60,47,97,62))),i=i.replace(/&lt;@!?(\d+)&gt;/g,(e,t)=>{var o;const n=null==s?void 0:s.find(e=>e.id===t),a=null!==(o=null==n?void 0:n.username)&&void 0!==o?o:(String.fromCharCode(85,110,107,110,111,119,110,32,85,115,101,114));return`<span class="discord-mention" data-mention-type="user" data-mention-id="${r(t)}">@${r(a)}</span>`}),i=i.replace(/&lt;@&amp;(\d+)&gt;/g,(e,t)=>{var o;const n=null==a?void 0:a[t],l=null!==(o=null==n?void 0:n.name)&&void 0!==o?o:(String.fromCharCode(85,110,107,110,111,119,110,32,82,111,108,101));let s="";return(null==n?void 0:n.color)&&(s=` style="color:#${n.color.toString(16).padStart(6,"0")};background-color:rgba(${n.color>>16&255},${n.color>>8&255},${255&n.color},0.1)"`),`<span class="discord-mention discord-role-mention" data-mention-type="role" data-mention-id="${r(t)}"${s}>@${r(l)}</span>`}),i=i.replace(/&lt;#(\d+)&gt;/g,(e,t)=>{var o;const n=null==l?void 0:l[t],a=null!==(o=null==n?void 0:n.name)&&void 0!==o?o:(String.fromCharCode(117,110,107,110,111,119,110,45,99,104,97,110,110,101,108));return`<span class="discord-mention" data-mention-type="channel" data-mention-id="${r(t)}">#${r(a)}</span>`}),i=i.replace(/@(everyone|here)/g,(String.fromCharCode(60,115,112,97,110,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,109,101,110,116,105,111,110,32,100,105,115,99,111,114,100,45,109,101,110,116,105,111,110,45,101,118,101,114,121,111,110,101,34,62,64,36,49,60,47,115,112,97,110,62))),i=i.replace(/&lt;(a?):(\w+):(\d+)&gt;/g,(e,t,o,n)=>`<img src="https://cdn.discordapp.com/emojis/${n}.${t?"gif":"webp"}?size=48&quality=lossless" alt=":${r(o)}:" class="discord-custom-emoji" width="22" height="22" loading="lazy" />`),i=i.replace(/&lt;t:(\d+)(?::([tTdDfFR]))?&gt;/g,(e,t,n)=>{const a=(function(e,t){switch(t){case"t":return e.toLocaleTimeString((String.fromCharCode(101,110,45,85,83)),{hour:(String.fromCharCode(50,45,100,105,103,105,116)),minute:(String.fromCharCode(50,45,100,105,103,105,116))});case"T":return e.toLocaleTimeString((String.fromCharCode(101,110,45,85,83)),{hour:(String.fromCharCode(50,45,100,105,103,105,116)),minute:(String.fromCharCode(50,45,100,105,103,105,116)),second:(String.fromCharCode(50,45,100,105,103,105,116))});case"d":return e.toLocaleDateString((String.fromCharCode(101,110,45,85,83)));case"D":return e.toLocaleDateString((String.fromCharCode(101,110,45,85,83)),{day:(String.fromCharCode(110,117,109,101,114,105,99)),month:(String.fromCharCode(108,111,110,103)),year:(String.fromCharCode(110,117,109,101,114,105,99))});case"f":return e.toLocaleString((String.fromCharCode(101,110,45,85,83)),{day:(String.fromCharCode(110,117,109,101,114,105,99)),month:(String.fromCharCode(108,111,110,103)),year:(String.fromCharCode(110,117,109,101,114,105,99)),hour:(String.fromCharCode(50,45,100,105,103,105,116)),minute:(String.fromCharCode(50,45,100,105,103,105,116))});case"F":return e.toLocaleString((String.fromCharCode(101,110,45,85,83)),{weekday:(String.fromCharCode(108,111,110,103)),day:(String.fromCharCode(110,117,109,101,114,105,99)),month:(String.fromCharCode(108,111,110,103)),year:(String.fromCharCode(110,117,109,101,114,105,99)),hour:(String.fromCharCode(50,45,100,105,103,105,116)),minute:(String.fromCharCode(50,45,100,105,103,105,116))});case"R":return o(e);default:return e.toLocaleString((String.fromCharCode(101,110,45,85,83)))}})(new Date(1e3*parseInt(t)),n||"f");return`<span class="discord-timestamp">${r(a)}</span>`}),i=i.replace(/\n/g,(String.fromCharCode(60,98,114,32,47,62))),c.length>0&&(i=i.replace(/\uE000(\d+)\uE001/g,(e,t)=>c[parseInt(t)])),e(i,t)}function o(e){const t=Date.now()-e.getTime(),r=Math.abs(t),o=t>0,n=Math.floor(r/1e3),a=Math.floor(n/60),l=Math.floor(a/60),s=Math.floor(l/24),i=Math.floor(s/30),c=Math.floor(s/365);let d,g;c>0?(d=(String.fromCharCode(121,101,97,114)),g=c):i>0?(d=(String.fromCharCode(109,111,110,116,104)),g=i):s>0?(d=(String.fromCharCode(100,97,121)),g=s):l>0?(d=(String.fromCharCode(104,111,117,114)),g=l):a>0?(d=(String.fromCharCode(109,105,110,117,116,101)),g=a):(d=(String.fromCharCode(115,101,99,111,110,100)),g=n);const u=1!==g?"s":"";return o?`${g} ${d}${u} ago`:`in ${g} ${d}${u}`}export function formatMessageTimestamp(e,t=(String.fromCharCode(97,98,115,111,108,117,116,101))){const r=new Date(e),n=r.toLocaleString((String.fromCharCode(101,110,45,85,83)),{month:(String.fromCharCode(50,45,100,105,103,105,116)),day:(String.fromCharCode(50,45,100,105,103,105,116)),year:(String.fromCharCode(110,117,109,101,114,105,99)),hour:(String.fromCharCode(50,45,100,105,103,105,116)),minute:(String.fromCharCode(50,45,100,105,103,105,116))});switch(t){case"relative":return o(r);case"both":return`${n} (${o(r)})`;default:return n}}export function getAvatarUrl(e,t,r){if(t){const r=t.startsWith("a_")?"gif":(String.fromCharCode(119,101,98,112));return`https://cdn.discordapp.com/avatars/${e}/${t}.${r}?size=128`}return`https://cdn.discordapp.com/embed/avatars/${r?parseInt(r)%5:(BigInt(e)>>BigInt(22))%BigInt(6)}.png`}export function colorIntToHex(e){return`#${e.toString(16).padStart(6,"0")}`}export function formatFileSize(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(1)} GB`}export function isImageAttachment(e){return!!(null==e?void 0:e.startsWith((String.fromCharCode(105,109,97,103,101,47))))}export function isVideoAttachment(e){return!!(null==e?void 0:e.startsWith((String.fromCharCode(118,105,100,101,111,47))))}export function isAudioAttachment(e){return!!(null==e?void 0:e.startsWith((String.fromCharCode(97,117,100,105,111,47))))}
1
+ import e from"sanitize-html";const t={allowedTags:[(String.fromCharCode(115,116,114,111,110,103)),"em","u","s",(String.fromCharCode(99,111,100,101)),(String.fromCharCode(112,114,101)),"br",(String.fromCharCode(115,112,97,110)),(String.fromCharCode(100,105,118)),(String.fromCharCode(98,108,111,99,107,113,117,111,116,101)),"h1","h2","h3","ul","ol","li","a",(String.fromCharCode(105,109,103))],allowedAttributes:{span:[(String.fromCharCode(99,108,97,115,115)),(String.fromCharCode(100,97,116,97,45,42)),(String.fromCharCode(115,116,121,108,101))],div:[(String.fromCharCode(99,108,97,115,115)),(String.fromCharCode(100,97,116,97,45,42))],a:[(String.fromCharCode(104,114,101,102)),(String.fromCharCode(99,108,97,115,115)),(String.fromCharCode(116,97,114,103,101,116)),(String.fromCharCode(114,101,108))],code:[(String.fromCharCode(99,108,97,115,115))],pre:[(String.fromCharCode(99,108,97,115,115))],img:[(String.fromCharCode(115,114,99)),(String.fromCharCode(97,108,116)),(String.fromCharCode(99,108,97,115,115)),(String.fromCharCode(119,105,100,116,104)),(String.fromCharCode(104,101,105,103,104,116)),(String.fromCharCode(108,111,97,100,105,110,103))],blockquote:[(String.fromCharCode(99,108,97,115,115))],ul:[(String.fromCharCode(99,108,97,115,115))],li:[(String.fromCharCode(99,108,97,115,115))]},allowedStyles:{span:{color:[/^#[0-9a-fA-F]{6}$/],"background-color":[/^rgba\(\d{1,3},\d{1,3},\d{1,3},[\d.]+\)$/]}},allowedSchemes:[(String.fromCharCode(104,116,116,112,115)),(String.fromCharCode(104,116,116,112))]};function r(e){return e.replace(/&/g,(String.fromCharCode(38,97,109,112,59))).replace(/</g,(String.fromCharCode(38,108,116,59))).replace(/>/g,(String.fromCharCode(38,103,116,59))).replace(/"/g,(String.fromCharCode(38,113,117,111,116,59))).replace(/'/g,(String.fromCharCode(38,35,48,51,57,59)))}export function parseDiscordMarkdown(n,a,l,s){if(!n)return"";let i=r(n);const c=[];return i=i.replace(/```(\w+\n)?([\s\S]*?)```/g,(e,t,o)=>{const n=null==t?void 0:t.trim(),a=!t&&o.startsWith("\n")?o.slice(1):o,l=n?` class="language-${r(n)}"`:"",s=c.length;return c.push(`<pre class="discord-code-block"><code${l}>${a}</code></pre>`),`${s}`}),i=i.replace(/`([^`\n]+)`/g,(e,t)=>{const r=c.length;return c.push(`<code class="discord-inline-code">${t}</code>`),`${r}`}),i=i.replace(/^### (.+)$/gm,(String.fromCharCode(60,104,51,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,104,101,97,100,101,114,34,62,36,49,60,47,104,51,62))),i=i.replace(/^## (.+)$/gm,(String.fromCharCode(60,104,50,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,104,101,97,100,101,114,34,62,36,49,60,47,104,50,62))),i=i.replace(/^# (.+)$/gm,(String.fromCharCode(60,104,49,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,104,101,97,100,101,114,34,62,36,49,60,47,104,49,62))),i=i.replace(/^&gt;&gt;&gt; ([\s\S]+)$/gm,(String.fromCharCode(60,98,108,111,99,107,113,117,111,116,101,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,98,108,111,99,107,113,117,111,116,101,34,62,36,49,60,47,98,108,111,99,107,113,117,111,116,101,62))),i=i.replace(/^&gt; (.+)$/gm,(String.fromCharCode(60,98,108,111,99,107,113,117,111,116,101,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,98,108,111,99,107,113,117,111,116,101,34,62,36,49,60,47,98,108,111,99,107,113,117,111,116,101,62))),i=i.replace(/(^- .+$(?:\n^- .+$)*)/gm,e=>`<ul class="discord-list">${e.split("\n").map(e=>e.replace(/^- (.+)$/,'<li class="discord-list-item">$1</li>')).join("")}</ul>`),i=i.replace(/\*\*\*(.+?)\*\*\*/g,(String.fromCharCode(60,115,116,114,111,110,103,62,60,101,109,62,36,49,60,47,101,109,62,60,47,115,116,114,111,110,103,62))),i=i.replace(/\*\*(.+?)\*\*/g,(String.fromCharCode(60,115,116,114,111,110,103,62,36,49,60,47,115,116,114,111,110,103,62))),i=i.replace(/__(.+?)__/g,(String.fromCharCode(60,117,62,36,49,60,47,117,62))),i=i.replace(/\*(.+?)\*/g,(String.fromCharCode(60,101,109,62,36,49,60,47,101,109,62))),i=i.replace(/(?<!\w)_(.+?)_(?!\w)/g,(String.fromCharCode(60,101,109,62,36,49,60,47,101,109,62))),i=i.replace(/~~(.+?)~~/g,(String.fromCharCode(60,115,62,36,49,60,47,115,62))),i=i.replace(/\|\|(.+?)\|\|/g,(String.fromCharCode(60,115,112,97,110,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,115,112,111,105,108,101,114,34,32,100,97,116,97,45,115,112,111,105,108,101,114,61,34,116,114,117,101,34,62,36,49,60,47,115,112,97,110,62))),i=i.replace(/\[([^\]]+)\]\((&lt;)?((https?:\/\/)[^\s)]+?)(&gt;)?\)/g,(String.fromCharCode(60,97,32,104,114,101,102,61,34,36,51,34,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,108,105,110,107,34,32,116,97,114,103,101,116,61,34,95,98,108,97,110,107,34,32,114,101,108,61,34,110,111,111,112,101,110,101,114,32,110,111,114,101,102,101,114,114,101,114,34,62,36,49,60,47,97,62))),i=i.replace(/(?<![="'])(https?:\/\/[^\s<]+)/g,(String.fromCharCode(60,97,32,104,114,101,102,61,34,36,49,34,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,108,105,110,107,34,32,116,97,114,103,101,116,61,34,95,98,108,97,110,107,34,32,114,101,108,61,34,110,111,111,112,101,110,101,114,32,110,111,114,101,102,101,114,114,101,114,34,62,36,49,60,47,97,62))),i=i.replace(/&lt;@!?(\d+)&gt;/g,(e,t)=>{var o;const n=null==s?void 0:s.find(e=>e.id===t),a=null!==(o=null==n?void 0:n.username)&&void 0!==o?o:(String.fromCharCode(85,110,107,110,111,119,110,32,85,115,101,114));return`<span class="discord-mention" data-mention-type="user" data-mention-id="${r(t)}">@${r(a)}</span>`}),i=i.replace(/&lt;@&amp;(\d+)&gt;/g,(e,t)=>{var o;const n=null==a?void 0:a[t],l=null!==(o=null==n?void 0:n.name)&&void 0!==o?o:(String.fromCharCode(85,110,107,110,111,119,110,32,82,111,108,101));let s="";return(null==n?void 0:n.color)&&(s=` style="color:#${n.color.toString(16).padStart(6,"0")};background-color:rgba(${n.color>>16&255},${n.color>>8&255},${255&n.color},0.1)"`),`<span class="discord-mention discord-role-mention" data-mention-type="role" data-mention-id="${r(t)}"${s}>@${r(l)}</span>`}),i=i.replace(/&lt;#(\d+)&gt;/g,(e,t)=>{var o;const n=null==l?void 0:l[t],a=null!==(o=null==n?void 0:n.name)&&void 0!==o?o:(String.fromCharCode(117,110,107,110,111,119,110,45,99,104,97,110,110,101,108));return`<span class="discord-mention" data-mention-type="channel" data-mention-id="${r(t)}">#${r(a)}</span>`}),i=i.replace(/@(everyone|here)/g,(String.fromCharCode(60,115,112,97,110,32,99,108,97,115,115,61,34,100,105,115,99,111,114,100,45,109,101,110,116,105,111,110,32,100,105,115,99,111,114,100,45,109,101,110,116,105,111,110,45,101,118,101,114,121,111,110,101,34,62,64,36,49,60,47,115,112,97,110,62))),i=i.replace(/&lt;(a?):(\w+):(\d+)&gt;/g,(e,t,o,n)=>`<img src="https://cdn.discordapp.com/emojis/${n}.${t?"gif":"webp"}?size=48&quality=lossless" alt=":${r(o)}:" class="discord-custom-emoji" width="22" height="22" loading="lazy" />`),i=i.replace(/&lt;t:(\d+)(?::([tTdDfFR]))?&gt;/g,(e,t,n)=>{const a=(function(e,t){switch(t){case"t":return e.toLocaleTimeString((String.fromCharCode(101,110,45,85,83)),{hour:(String.fromCharCode(50,45,100,105,103,105,116)),minute:(String.fromCharCode(50,45,100,105,103,105,116))});case"T":return e.toLocaleTimeString((String.fromCharCode(101,110,45,85,83)),{hour:(String.fromCharCode(50,45,100,105,103,105,116)),minute:(String.fromCharCode(50,45,100,105,103,105,116)),second:(String.fromCharCode(50,45,100,105,103,105,116))});case"d":return e.toLocaleDateString((String.fromCharCode(101,110,45,85,83)));case"D":return e.toLocaleDateString((String.fromCharCode(101,110,45,85,83)),{day:(String.fromCharCode(110,117,109,101,114,105,99)),month:(String.fromCharCode(108,111,110,103)),year:(String.fromCharCode(110,117,109,101,114,105,99))});case"f":return e.toLocaleString((String.fromCharCode(101,110,45,85,83)),{day:(String.fromCharCode(110,117,109,101,114,105,99)),month:(String.fromCharCode(108,111,110,103)),year:(String.fromCharCode(110,117,109,101,114,105,99)),hour:(String.fromCharCode(50,45,100,105,103,105,116)),minute:(String.fromCharCode(50,45,100,105,103,105,116))});case"F":return e.toLocaleString((String.fromCharCode(101,110,45,85,83)),{weekday:(String.fromCharCode(108,111,110,103)),day:(String.fromCharCode(110,117,109,101,114,105,99)),month:(String.fromCharCode(108,111,110,103)),year:(String.fromCharCode(110,117,109,101,114,105,99)),hour:(String.fromCharCode(50,45,100,105,103,105,116)),minute:(String.fromCharCode(50,45,100,105,103,105,116))});case"R":return o(e);default:return e.toLocaleString((String.fromCharCode(101,110,45,85,83)))}})(new Date(1e3*parseInt(t)),n||"f");return`<span class="discord-timestamp">${r(a)}</span>`}),i=i.replace(/\n/g,(String.fromCharCode(60,98,114,32,47,62))),c.length>0&&(i=i.replace(/\uE000(\d+)\uE001/g,(e,t)=>c[parseInt(t)])),e(i,t)}function o(e){const t=Date.now()-e.getTime(),r=Math.abs(t),o=t>0,n=Math.floor(r/1e3),a=Math.floor(n/60),l=Math.floor(a/60),s=Math.floor(l/24),i=Math.floor(s/30),c=Math.floor(s/365);let d,u;c>0?(d=(String.fromCharCode(121,101,97,114)),u=c):i>0?(d=(String.fromCharCode(109,111,110,116,104)),u=i):s>0?(d=(String.fromCharCode(100,97,121)),u=s):l>0?(d=(String.fromCharCode(104,111,117,114)),u=l):a>0?(d=(String.fromCharCode(109,105,110,117,116,101)),u=a):(d=(String.fromCharCode(115,101,99,111,110,100)),u=n);const g=1!==u?"s":"";return o?`${u} ${d}${g} ago`:`in ${u} ${d}${g}`}export function formatMessageTimestamp(e,t=(String.fromCharCode(97,98,115,111,108,117,116,101))){const r=new Date(e),n=r.toLocaleString((String.fromCharCode(101,110,45,85,83)),{month:(String.fromCharCode(50,45,100,105,103,105,116)),day:(String.fromCharCode(50,45,100,105,103,105,116)),year:(String.fromCharCode(110,117,109,101,114,105,99)),hour:(String.fromCharCode(50,45,100,105,103,105,116)),minute:(String.fromCharCode(50,45,100,105,103,105,116))});switch(t){case"relative":return o(r);case"both":return`${n} (${o(r)})`;default:return n}}export function getAvatarUrl(e,t,r){if(t){const r=t.startsWith("a_")?"gif":(String.fromCharCode(119,101,98,112));return`https://cdn.discordapp.com/avatars/${e}/${t}.${r}?size=128`}return`https://cdn.discordapp.com/embed/avatars/${r?parseInt(r)%5:(BigInt(e)>>BigInt(22))%BigInt(6)}.png`}export function colorIntToHex(e){return`#${e.toString(16).padStart(6,"0")}`}export function formatFileSize(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(1)} GB`}export function isImageAttachment(e){return!!(null==e?void 0:e.startsWith((String.fromCharCode(105,109,97,103,101,47))))}export function isVideoAttachment(e){return!!(null==e?void 0:e.startsWith((String.fromCharCode(118,105,100,101,111,47))))}export function isAudioAttachment(e){return!!(null==e?void 0:e.startsWith((String.fromCharCode(97,117,100,105,111,47))))}
@@ -200,6 +200,10 @@ export interface DiscordComponent {
200
200
  spacing?: number;
201
201
  /** Whether Separator shows a divider line */
202
202
  divider?: boolean;
203
+ /** Media reference for Thumbnail (type 11) */
204
+ media?: {
205
+ url: string;
206
+ };
203
207
  /** Description for Thumbnail (type 11) */
204
208
  description?: string;
205
209
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getoeteter/discord-transcripts",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Discord.js HTML transcript generator",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "build": "tsc && node scripts/obfuscate.mjs",
18
18
  "typecheck": "tsc --noEmit",
19
19
  "clean": "rm -rf dist",
20
- "prepublishOnly": "pnpm run clean && pnpm run build"
20
+ "prepublishOnly": "bun run clean && bun run build"
21
21
  },
22
22
  "keywords": [
23
23
  "discord",