Members

(constant) GPU_PER_SEC

A10G GPU cost per second on Modal.

(constant) WHISPER_MODELS

Pricing data and estimation functions for Modal transcription jobs. Cost model: (whisper compute time + pyannote compute time) × GPU $/sec. RTFs are empirical estimates for faster-whisper on A10G (roughly 4× faster than the original Whisper PyTorch implementation benchmarked on A100). pyannote RTF from pyannote/speaker-diarization-3.x model card.

Methods

_clearTextHighlights(el)

Removes all elements from `el`, restoring plain text.
Parameters:
NameTypeDescription
elHTMLElementelement from which highlights will be removed

_fmtAnalyticsCard(key, value) → {string}

Formats an analytics metric value for display on a summary card.
Parameters:
NameTypeDescription
keystringMetric key (e.g. 'total_audio_seconds', 'storage_bytes').
valuenumber | nullRaw metric value.
Returns:
Human-readable formatted value.
Type: 
string

_fmtBytes(b) → {string}

Formats a byte count as a human-readable string (B, KB, MB, GB).
Parameters:
NameTypeDescription
bnumberByte count.
Returns:
Formatted size string.
Type: 
string

_friendlyFirebaseError(code) → {string}

Map a Firebase auth error code to a human-readable message.
Parameters:
NameTypeDescription
codestringThe Firebase error code (e.g. 'auth/wrong-password').
Returns:
A user-facing error message.
Type: 
string

_getAnalyticsAxisRange() → {Object}

Returns the {min, max} Date objects for the current analytics range selection.
Returns:
Axis bounds; null means unbounded.
Type: 
Object

_getFilteredSnapshots() → {Array.<object>}

Returns analytics snapshots filtered to the current date range.
Returns:
Filtered array of snapshot objects.
Type: 
Array.<object>

_hexToRgba(hex, alpha) → {string}

Converts a hex colour string and alpha to an rgba() CSS string.
Parameters:
NameTypeDescription
hexstringSix-digit hex colour (e.g. '#60a5fa').
alphanumberAlpha value between 0 and 1.
Returns:
CSS rgba() colour string.
Type: 
string

_hidePtLinkTooltip()

Hides and removes the active link tooltip.

_highlightChartMetric(key)

Highlights a single metric dataset on the chart, dimming all others.
Parameters:
NameTypeDescription
keystringMetric key to highlight.

_highlightTextInEl(el, query)

Injects wrappers around all occurrences of `query` within the text nodes of `el`.
Parameters:
NameTypeDescription
elHTMLElementelement whose text nodes will be wrapped with highlights
querystringalready lower-cased search string

_refreshAnalyticsView()

Refreshes all analytics view components (revenue hero, cards, subscribers table, chart).

_resetChartHighlight()

Resets all chart datasets to their default colours after a hover highlight.

_setEmbRowSelected(embedId)

Applies or clears the selected-row highlight in the embeds table.
Parameters:
NameTypeDescription
embedIdstring | nullEmbed ID to highlight, or null to clear.

_setFldRowSelected(folderId)

Applies or clears the selected-row highlight in the folders table.
Parameters:
NameTypeDescription
folderIdstring | nullFolder ID to highlight, or null to clear.

_setProjRowSelected(projectId)

Applies or clears the selected-row highlight in the projects table.
Parameters:
NameTypeDescription
projectIdstring | nullProject ID to highlight, or null to clear.

_setSubRowSelected(subId)

Applies or clears the selected-row highlight in the subscriptions table.
Parameters:
NameTypeDescription
subIdstring | nullSubscription tier ID to highlight, or null to clear.

_setUserRowSelected(userId)

Applies or clears the selected-row highlight in the users table.
Parameters:
NameTypeDescription
userIdstring | nullUser ID to highlight, or null to clear.

_showPtLinkTooltip(url, name, description)

Shows a tooltip near the cursor with link metadata.
Parameters:
NameTypeDescription
urlstringthe hyperlink URL
namestring | nulloptional display name for the link
descriptionstring | nulloptional description text

_subVal(col, sub) → {*}

Extracts a flat sortable value for virtual subscription columns.
Parameters:
NameTypeDescription
colstringColumn key.
subobjectSubscription tier object.
Returns:
Sortable value for the column.
Type: 
*

_syncMetricDropdown()

Synchronises the metric dropdown value to reflect the current _analyticsVisibleKeys state.

_toChartValue(key, value) → {number}

Converts a raw metric value to the unit used on the chart axis.
Parameters:
NameTypeDescription
keystringMetric key.
valuenumberRaw metric value.
Returns:
Converted value (e.g. seconds → hours, bytes → GB).
Type: 
number

_toggleMetric(key)

Toggles visibility of a metric on the analytics chart.
Parameters:
NameTypeDescription
keystringMetric key to toggle.

activateTheme(themeId)

Activates a theme and refreshes all theme-dependent UI.
Parameters:
NameTypeDescription
themeIdstringThe theme ID to activate.

applyThemeColors(themeId)

Clears all managed CSS variables then applies the saved colors for `themeId`.
Parameters:
NameTypeDescription
themeIdstringThe theme ID whose colors to apply.

applyTier(tier, subscriptionSinceopt, usageopt)

Populates the subscription info panel with the given tier's details.
Parameters:
NameTypeAttributesDefaultDescription
tierobject | nullThe active subscription tier object, or null.
subscriptionSincestring | null<optional>
nullISO date string of when the subscription started.
usageobject<optional>
{}Current usage counters (e.g. transcription_mins, storage_bytes).

buildProject(pdata) → {Project}

Constructs a Project instance from raw server presentation data.
Parameters:
NameTypeDescription
pdataobjectpresentation data payload from the server
Returns:
Type: 
Project

buildThemePrefs() → {Object}

Collects current theme state from localStorage into a preferences patch.
Returns:
Current preferences patch.
Type: 
Object

calcTierPrice(params) → {number|null}

Calculates a recommended monthly subscription price from tier limits. Formula: ((storage_gb * 0.020) + (costPerHr(mostExpensiveModel) * transcription_hrs_month)) * 1.30
Parameters:
NameTypeDescription
paramsobjectTier feature limits used to calculate the price.
Properties
NameTypeDescription
storage_gbnumber | nullstorage quota in GB (null = unlimited)
transcription_hrs_monthnumber | nullmonthly transcription quota in hours (null = unlimited)
whisper_modelsArray.<string>allowed Whisper model keys for this tier
Returns:
recommended price in USD/month, or null if any limit is unlimited
Type: 
number | null

clampUndoQueueSize(v) → {number}

Clamps an undo queue size value to the allowed range (10–500) in multiples of 10.
Parameters:
NameTypeDescription
vnumberThe raw value to clamp.
Returns:
The clamped value.
Type: 
number

closeConfirm()

Closes the confirmation dialog and clears any pending callback.

closeDrawer()

Closes the user detail drawer and clears the selection highlight.

closeEmbedDrawer()

Closes the embed detail drawer and clears the selection highlight.

closeFolderDrawer()

Closes the folder detail drawer and clears the selection highlight.

closeProjectDrawer()

Closes the project detail drawer and clears the selection highlight.

closeSubDrawer()

Closes the subscription edit drawer and clears the selection highlight.

closeTierModal()

Closes the tier selection modal.

cmpValues(a, b) → {number}

Null-safe comparator for table sorting, handles booleans and strings.
Parameters:
NameTypeDescription
a*First value.
b*Second value.
Returns:
Negative, zero, or positive sort order.
Type: 
number

(async) collectAnalyticsNow()

Triggers an immediate analytics collection via the API then refreshes the display.

createCustomTheme(name)

Creates a new custom theme based on the current color state and activates it.
Parameters:
NameTypeDescription
namestringDisplay name for the new theme.

deleteCustomTheme(id)

Deletes a custom theme by ID and falls back to 'dark' if it was active.
Parameters:
NameTypeDescription
idstringThe ID of the custom theme to delete.

displayName(speakerId, speakers) → {string}

Returns the display name for a speaker id, falling back to the raw id.
Parameters:
NameTypeDescription
speakerIdstringThe speaker identifier.
speakersObject.<string, Speaker>Speaker id → Speaker map.
Returns:
Type: 
string

(async) doDeleteEmbed(embedId)

Sends a DELETE request for the given embed and removes it from the local list.
Parameters:
NameTypeDescription
embedIdstringID of the embed to delete.

(async) doDeleteFolder(folderId)

Sends a DELETE request for the given folder and removes it from the local list.
Parameters:
NameTypeDescription
folderIdstringID of the folder to delete.

(async) doDeleteProject(projectId)

Sends a DELETE request for the given project and removes it from the local list.
Parameters:
NameTypeDescription
projectIdstringID of the project to delete.

(async) doDeleteSub(tierId)

Sends a DELETE request for the given subscription tier and removes it from the local list.
Parameters:
NameTypeDescription
tierIdstringID of the tier to delete.

(async) doDeleteUser(userId)

Deletes a user account, removes them from _users, closes the drawer, and re-renders the table.
Parameters:
NameTypeDescription
userIdstringID of the user to delete.

(async) doSaveSub()

Validates the subscription form and POSTs or PATCHes the tier via the API.

(async) doSetFolderPublic(folderId, makePublic, btn)

Toggles the public/private state of a folder via PATCH and updates the local list.
Parameters:
NameTypeDescription
folderIdstringID of the folder to update.
makePublicbooleanTrue to make the folder public, false to make it private.
btnHTMLElementThe button that triggered the action (disabled while in-flight).

(async) doSetProjectPublic(projectId, makePublic, btn)

Toggles the public/private state of a project via PATCH and updates the local list.
Parameters:
NameTypeDescription
projectIdstringID of the project to update.
makePublicbooleanTrue to make the project public, false to make it private.
btnHTMLElementThe button that triggered the action (disabled while in-flight).

(async) doSetUserActive(userId, activate, btn)

PATCH is_active for a user, update _users, and refresh the table.
Parameters:
NameTypeDescription
userIdstringID of the target user.
activatebooleanDesired active state.
btnHTMLElementThe button that triggered the action (disabled while in-flight).

downloadThemeJson(themeObj)

Triggers a browser download of the given theme object as a JSON file.
Parameters:
NameTypeDescription
themeObjObjectTheme data to export.

drawerRow(label, value, mono) → {string}

Renders a label/value row for the drawer.
Parameters:
NameTypeDefaultDescription
labelstringDisplay label.
valuestringValue to display.
monobooleanfalseWhether to render the value in monospace.
Returns:
HTML string for the row.
Type: 
string

esc(s) → {string}

Escapes HTML special characters in a string.
Parameters:
NameTypeDescription
s*Value to escape (coerced to string).
Returns:
HTML-safe string.
Type: 
string

estimateCost(audioDurationSecs, whisperModelKey, pyannoteModelKey) → {number}

Estimates the dollar cost of a transcription job.
Parameters:
NameTypeDescription
audioDurationSecsnumberaudio duration in seconds
whisperModelKeystringkey of the Whisper model (e.g. 'medium')
pyannoteModelKeystringkey of the pyannote diarization model
Returns:
estimated cost in USD
Type: 
number

estimateTime(audioDurationSecs, whisperModelKey, pyannoteModelKey) → {number}

Estimates the processing time of a transcription job.
Parameters:
NameTypeDescription
audioDurationSecsnumberaudio duration in seconds
whisperModelKeystringkey of the Whisper model (e.g. 'medium')
pyannoteModelKeystringkey of the pyannote diarization model
Returns:
estimated processing time in seconds
Type: 
number

exportCSV(path, text) → {Promise.<void>}

Writes a CSV export to the given path.
Parameters:
NameTypeDescription
pathstringFull filesystem path for the output file.
textstringCSV string from formatCSV().
Returns:
Type: 
Promise.<void>

exportDOCX(path, text, style, speakers) → {Promise.<void>}

Writes a DOCX export to the given path, applying style-appropriate typography. Professional: bold speaker headings, justified body text, Georgia/serif font. Script: Courier New, indented speaker names, dialogue blocks. Transcript: IBM Plex Sans, timecode prefixes, quoted paragraphs.
Parameters:
NameTypeDescription
pathstringFull filesystem path for the output file.
textstringFormatted transcript text from one of the format* functions.
stylestringExport style key: 'script' | 'professional' | 'transcript'.
speakersObject.<string, Speaker>Speaker map, used to identify names for bold rendering.
Returns:
Type: 
Promise.<void>

exportFile(fileType, path, text, style, speakers) → {Promise.<void>}

Dispatches to the correct file writer for the given file type.
Parameters:
NameTypeDescription
fileTypestring'txt' | 'md' | 'csv' | 'docx' | 'pdf'
pathstringFull filesystem path for the output file.
textstringFormatted transcript text from format().
stylestringExport style key passed through to DOCX/PDF writers.
speakersObject.<string, Speaker>Passed through to DOCX/PDF writers.
Returns:
Type: 
Promise.<void>

exportMarkdown(path, text) → {Promise.<void>}

Writes a Markdown export to the given path. Speaker names become bold headings; paragraph text follows beneath each.
Parameters:
NameTypeDescription
pathstringFull filesystem path for the output file.
textstringFormatted transcript text from one of the format* functions.
Returns:
Type: 
Promise.<void>

exportPDF(path, text, style, speakers) → {Promise.<void>}

Writes a PDF export to the given path, applying style-appropriate typography. Professional: bold speaker headings, justified body text, Georgia/serif font. Script: Courier New, indented speaker names, dialogue blocks. Transcript: IBM Plex Sans, timecode prefixes, quoted paragraphs.
Parameters:
NameTypeDescription
pathstringFull filesystem path for the output file.
textstringFormatted transcript text from one of the format* functions.
stylestringExport style key: 'script' | 'professional' | 'transcript'.
speakersObject.<string, Speaker>Speaker map, used to identify names for bold rendering.
Returns:
Type: 
Promise.<void>

exportTXT(path, text) → {Promise.<void>}

Writes a plain-text export to the given path.
Parameters:
NameTypeDescription
pathstringFull filesystem path for the output file.
textstringFormatted transcript text from one of the format* functions.
Returns:
Type: 
Promise.<void>

(async) fetchAnalytics()

Fetches all analytics snapshots from the API and triggers a full re-render.

(async) fetchEmbeds()

Fetches the embed list from the API and re-renders the table.

(async) fetchFolders()

Fetches the folder list from the API and re-renders the table.

(async) fetchProjectData(projectId, token) → {Promise.<object>}

Fetches project metadata, waveform data, and transcript from the API, returning a combined data object suitable for buildProject.
Parameters:
NameTypeDescription
projectIdstringThe project UUID.
tokenstring | nullFirebase ID token for authenticated requests, or null.
Returns:
Type: 
Promise.<object>

(async) fetchProjects()

Fetches the project list from the API and re-renders the table.

(async) fetchSubs()

Fetches the subscription tier list from the API and re-renders the table.

(async) fetchUsers()

Fetches the user list from the API and re-renders the table.

fmtCell(col, user) → {string}

Renders a user table cell as an HTML string for the given column.
Parameters:
NameTypeDescription
colobjectColumn descriptor from COLS.
userobjectUser data object.
Returns:
Inner HTML for the cell.
Type: 
string

fmtCost(n) → {string}

Formats a cost value in USD for display.
Parameters:
NameTypeDescription
nnumbercost in USD
Returns:
formatted cost string
Type: 
string

fmtDate(iso) → {string}

Formats an ISO timestamp as a short local date string.
Parameters:
NameTypeDescription
isostring | nullISO 8601 date string, or null/empty.
Returns:
Formatted date, or '—' if not provided.
Type: 
string

fmtDatetime(iso) → {string}

Formats an ISO timestamp as a full local date and time string.
Parameters:
NameTypeDescription
isostring | nullISO 8601 date string, or null/empty.
Returns:
Formatted date-time, or '—' if not provided.
Type: 
string

fmtDur(s) → {string}

Formats a duration in seconds to a human-readable string.
Parameters:
NameTypeDescription
snumberduration in seconds
Returns:
formatted duration string (e.g. '2.5m', '1h')
Type: 
string

fmtDuration(secs) → {string}

Formats a duration in seconds as m:ss or h:mm:ss.
Parameters:
NameTypeDescription
secsnumber | nullDuration in seconds.
Returns:
Formatted duration string, or '—' if not provided.
Type: 
string

fmtEmbCell(col, emb) → {string}

Renders an embeds table cell as an HTML string for the given column.
Parameters:
NameTypeDescription
colobjectColumn descriptor from EMB_COLS.
embobjectEmbed data object.
Returns:
Inner HTML for the cell.
Type: 
string

fmtFldCell(col, fld) → {string}

Renders a folders table cell as an HTML string for the given column.
Parameters:
NameTypeDescription
colobjectColumn descriptor from FLD_COLS.
fldobjectFolder data object.
Returns:
Inner HTML for the cell.
Type: 
string

fmtGb(gb) → {string}

Formats a gigabyte value for display, returning 'Unlimited' for null.
Parameters:
NameTypeDescription
gbnumber | nullGigabytes to format.
Returns:
Type: 
string

fmtHMS(totalSeconds) → {string}

Formats a seconds value as HH:MM:SS.
Parameters:
NameTypeDescription
totalSecondsnumberTotal number of seconds to format.
Returns:
Type: 
string

fmtHrs(hrs) → {string}

Formats an hour value for display, returning 'Unlimited' for null.
Parameters:
NameTypeDescription
hrsnumber | nullHours to format.
Returns:
Type: 
string

fmtMins(mins) → {string}

Formats a minute value for display, returning 'Unlimited' for null.
Parameters:
NameTypeDescription
minsnumber | nullMinutes to format.
Returns:
Type: 
string

fmtProjCell(col, proj) → {string}

Renders a projects table cell as an HTML string for the given column.
Parameters:
NameTypeDescription
colobjectColumn descriptor from PROJ_COLS.
projobjectProject data object.
Returns:
Inner HTML for the cell.
Type: 
string

fmtSubCell(col, sub) → {string}

Renders a subscriptions table cell as an HTML string for the given column key.
Parameters:
NameTypeDescription
colstringColumn key string.
subobjectSubscription tier data object.
Returns:
Inner HTML for the cell.
Type: 
string

format(style, transcript, speakers, optionsopt) → {string}

Dispatches to the correct formatter for the given style key.
Parameters:
NameTypeAttributesDescription
stylestring'script' | 'professional' | 'transcript' | 'csv'
transcriptTranscriptThe transcript to format.
speakersObject.<string, Speaker>Speaker id → Speaker map.
optionsobject<optional>
Passed through to formatTranscript.
Returns:
Type: 
string

formatCSV(transcript, speakers) → {string}

Formats a transcript as an RFC 4180 CSV with columns: start, end, speaker, text. Speaker IDs are replaced with their display names.
Parameters:
NameTypeDescription
transcriptTranscriptThe transcript to format.
speakersObject.<string, Speaker>Speaker id → Speaker map.
Returns:
Type: 
string

formatMarkdown(transcript, speakers, optionsopt) → {string}

Formats a transcript as Markdown. The document title becomes an H1; speaker names become H2 headings; paragraph text follows as body text. Optional timestamps appear as inline code spans before each paragraph.
Parameters:
NameTypeAttributesDescription
transcriptTranscriptThe transcript to format.
speakersObject.<string, Speaker>Speaker id → Speaker map.
optionsobject<optional>
Formatting options.
Properties
NameTypeAttributesDefaultDescription
includeSpeakersboolean<optional>
falseWhether to prepend a speaker list.
includeTimestampsboolean<optional>
trueWhether to prefix paragraphs with timecodes.
displayRecordingDateboolean<optional>
falseWhether to show the recording date in the header.
displayExportDateboolean<optional>
falseWhether to show today's date in the header.
recordingDatestring<optional>
''Recording date string shown when displayRecordingDate is true.
titlestring<optional>
''Document title rendered as an H1 heading.
descriptionstring<optional>
''Optional description shown beneath the title.
Returns:
Type: 
string

formatProfessional(transcript, speakers, optionsopt) → {string}

Formats a transcript in professional report style. Each speaker block starts with the speaker's name as a standalone header, followed by paragraph text. Multiple paragraphs within a block are separated by a blank line; speaker blocks are separated by a blank line.
Parameters:
NameTypeAttributesDescription
transcriptTranscriptThe transcript to format.
speakersObject.<string, Speaker>Speaker id → Speaker map.
optionsobject<optional>
Formatting options.
Properties
NameTypeAttributesDefaultDescription
includeSpeakersboolean<optional>
falseWhether to prepend a speaker list.
displayRecordingDateboolean<optional>
falseWhether to show the recording date in the header.
displayExportDateboolean<optional>
falseWhether to show today's date in the header.
recordingDatestring<optional>
''Recording date string shown when displayRecordingDate is true.
titlestring<optional>
''Document title shown in the header.
descriptionstring<optional>
''Optional description shown beneath the title.
Returns:
Type: 
string

formatScript(transcript, speakers, optionsopt) → {string}

Formats a transcript in screenplay / dialogue-list style. Timecodes appear at each new minute boundary; speaker names are indented and uppercased; dialogue is word-wrapped with a smaller indent.
Parameters:
NameTypeAttributesDescription
transcriptTranscriptThe transcript to format.
speakersObject.<string, Speaker>Speaker id → Speaker map.
optionsobject<optional>
Formatting options.
Properties
NameTypeAttributesDefaultDescription
includeSpeakersboolean<optional>
falseWhether to prepend a speaker list.
includeTimestampsboolean<optional>
trueWhether to insert minute-boundary timecodes.
displayRecordingDateboolean<optional>
falseWhether to show the recording date in the header.
displayExportDateboolean<optional>
falseWhether to show today's date in the header.
recordingDatestring<optional>
''Recording date string shown when displayRecordingDate is true.
titlestring<optional>
''Document title shown in the header.
descriptionstring<optional>
''Optional description shown beneath the title.
Returns:
Type: 
string

formatTranscript(transcript, speakers, optionsopt) → {string}

Formats a transcript as a time-stamped transcription document. Includes a metadata header, then each paragraph prefixed with its start timecode and speaker name, with the text quoted on the following line.
Parameters:
NameTypeAttributesDescription
transcriptTranscriptThe transcript to format.
speakersObject.<string, Speaker>Speaker id → Speaker map.
optionsobject<optional>
Formatting options.
Properties
NameTypeAttributesDefaultDescription
titlestring<optional>
''Source title shown in the header.
descriptionstring<optional>
''Optional description shown beneath the title.
includeSpeakersboolean<optional>
falseWhether to prepend a speaker list.
includeTimestampsboolean<optional>
trueWhether to prefix paragraphs with timecodes.
displayRecordingDateboolean<optional>
falseWhether to show the recording date in the header.
displayExportDateboolean<optional>
falseWhether to show today's date in the header.
recordingDatestring<optional>
''Recording date string shown when displayRecordingDate is true.
Returns:
Type: 
string

getCustomColors() → {object}

Returns the current theme's saved color map.
Returns:
map of CSS variable names to color values
Type: 
object

getCustomThemes() → {Array.<CustomTheme>}

Returns all saved custom theme objects.
Returns:
Type: 
Array.<CustomTheme>

getGroupLabel(value) → {string}

Returns a human-readable label for the current group-by field value.
Parameters:
NameTypeDescription
value*The raw group field value.
Returns:
Display label for the group.
Type: 
string

getTheme() → {string}

Returns the stored theme ID, or 'auto' if none saved.
Returns:
Type: 
string

hideLoading()

Hides the loading spinner overlay.

(async) init() → {Promise.<void>}

Entry point: loads project data (from embedded SSR payload or via Firebase auth + API), constructs the controller and panels, and mounts everything into the page.
Returns:
Type: 
Promise.<void>

initAnalyticsPanel()

Builds and injects the analytics panel UI (toolbar, cards, chart, subscribers table) into the DOM.

initCopyBtn()

Wires the "Copy link" button to copy the current page URL to the clipboard.

initEmbedsPanel()

Builds and injects the embeds panel toolbar and table into the DOM, then fetches data.

initFoldersPanel()

Builds and injects the folders panel toolbar and table into the DOM, then fetches data.

initProjectsPanel()

Builds and injects the projects panel toolbar and table into the DOM, then fetches data.

initSchemaPanel()

Builds and renders the database schema ER diagram into the schema panel container.

initSearch(presTranscript)

Wires the transcript search bar. The magnifying-glass button collapses and expands the bar; text highlights are injected directly into segment DOM nodes.
Parameters:
NameTypeDescription
presTranscriptPresentationTranscriptThe rendered transcript panel.

initSubsPanel()

Builds and injects the subscriptions panel toolbar and table into the DOM, then fetches data.

initTheme()

Reads the saved preference and applies it. Call as early as possible.

initUsersPanel()

Builds and injects the users panel toolbar and table into the DOM, then fetches data.

(async) loadBundledThemes() → {Promise.<void>}

Fetches bundled themes from the server and merges any new or updated entries into localStorage. Called after restoreThemeFromPrefs so server prefs don't overwrite newly-added bundled themes.
Returns:
Type: 
Promise.<void>

openAccountDrawer(tabopt)

Opens the account settings drawer, lazy-loading the iframe on first open.
Parameters:
NameTypeAttributesDefaultDescription
tabstring | null<optional>
nullOptional tab name to switch to (e.g. 'subscription').

openDeleteConfirm(userId, displayLabel)

Opens the delete confirmation dialog for a user account.
Parameters:
NameTypeDescription
userIdstringID of the user to delete.
displayLabelstringDisplay name or email shown in the confirmation message.

openDeleteEmbedConfirm(embedId, label)

Opens the delete confirmation dialog for an embed.
Parameters:
NameTypeDescription
embedIdstringID of the embed to delete.
labelstringTruncated embed ID shown in the confirmation message.

openDeleteFolderConfirm(folderId, label)

Opens the delete confirmation dialog for a folder.
Parameters:
NameTypeDescription
folderIdstringID of the folder to delete.
labelstringDisplay name of the folder shown in the confirmation message.

openDeleteProjectConfirm(projectId, label)

Opens the delete confirmation dialog for a project.
Parameters:
NameTypeDescription
projectIdstringID of the project to delete.
labelstringDisplay name of the project shown in the confirmation message.

openDeleteSubConfirm(tierId, label)

Opens the delete confirmation dialog for a subscription tier.
Parameters:
NameTypeDescription
tierIdstringID of the tier to delete.
labelstringDisplay name of the tier shown in the confirmation message.

openDrawer(userId)

Opens the user detail drawer, immediately showing list data then fetching the full record.
Parameters:
NameTypeDescription
userIdstringID of the user to display.

openEmbedDrawer(embedId)

Opens the embed detail drawer for the given embed.
Parameters:
NameTypeDescription
embedIdstringID of the embed to display.

openFolderDrawer(folderId)

Opens the folder detail drawer for the given folder.
Parameters:
NameTypeDescription
folderIdstringID of the folder to display.

openProjectDrawer(projectId)

Opens the project detail drawer for the given project.
Parameters:
NameTypeDescription
projectIdstringID of the project to display.

openSubDrawer(subId)

Opens the subscription edit drawer for an existing tier or for creating a new one.
Parameters:
NameTypeDescription
subIdstring | nullID of the subscription tier to edit, or null to create a new tier.

openTierModal()

Opens the tier selection modal.

populateSurveyFields(surveyAnswers)

Populate the survey dropdowns from saved survey_answers preferences.
Parameters:
NameTypeDescription
surveyAnswersobjectThe preferences.survey_answers object.

renderAnalytics()

Updates the analytics status bar and triggers the full analytics view refresh.

renderAnalyticsCards(data)

Renders the analytics metric summary cards from the latest snapshot data.
Parameters:
NameTypeDescription
dataobjectAnalytics snapshot data object.

renderAnalyticsChart()

Destroys and rebuilds the analytics Chart.js line chart from the current snapshots and filters.

renderColorVars()

Renders the color variable editor rows grouped by category.

renderCustomThemes()

Re-renders the custom theme buttons in the theme selector group.

renderDrawerContent()

Re-render the drawer panel from _drawerUser.

renderEmbedDrawerContent()

Re-renders the embed drawer panel from _drawerEmbed.

renderEmbedsTable()

Rebuilds and injects the embeds table HTML, then wires up interaction handlers.

renderFolderDrawerContent()

Re-renders the folder drawer panel from _drawerFolder.

renderFoldersTable()

Rebuilds and injects the folders table HTML, then wires up interaction handlers.

renderPreferences(prefs) → {string}

Renders the preferences object as a series of drawer rows.
Parameters:
NameTypeDescription
prefsobjectUser preferences object.
Returns:
HTML string of drawer rows, or a hint message if empty.
Type: 
string

renderProjectDrawerContent()

Re-renders the project drawer panel from _drawerProject.

renderProjectsTable()

Rebuilds and injects the projects table HTML, then wires up interaction handlers.

renderRevenueHero(data)

Renders the MRR revenue hero cards from the latest analytics snapshot data.
Parameters:
NameTypeDescription
dataobjectAnalytics snapshot data object containing mrr fields.
Populates a segment container with plain text and styled link spans. Mirrors the workspace #renderHlContent / #getHyperlinksForSegment logic. In presentation mode links are directly clickable (no Ctrl required). Editor notes are never shown (presentation is always read-only).
Parameters:
NameTypeDescription
containerHTMLElementthe DOM element to populate
textstringthe segment's plain text content
annotationsobject | nullthe project annotations object containing hyperlinks
segIdxnumberindex of the segment within the transcript

renderSubDrawerContent()

Re-renders the subscription edit drawer panel from _drawerSub.

renderSubsTable()

Rebuilds and injects the subscriptions table HTML, then wires up interaction handlers.

renderSubscribersTable(data)

Renders the subscribers-by-tier breakdown table from the latest analytics snapshot data.
Parameters:
NameTypeDescription
dataobjectAnalytics snapshot data object containing subscribers_by_tier.

renderTable()

Rebuild and inject the table HTML, then wire up interaction handlers.

renderTierCards(activeTierId)

Builds and renders the tier selection cards into the tier grid.
Parameters:
NameTypeDescription
activeTierIdstring | nullThe ID of the currently active tier, or null.

resolveBase(themeId) → {'light'|'dark'}

Resolves any theme ID to 'light' or 'dark'.
Parameters:
NameTypeDescription
themeIdstringThe theme ID to resolve ('auto', 'light', 'dark', or custom ID).
Returns:
Type: 
'light' | 'dark'

resolvedBase() → {'light'|'dark'}

Resolves the active theme to 'light' or 'dark' (custom themes return their base).
Returns:
Type: 
'light' | 'dark'

restoreThemeFromPrefs(prefs)

Restores theme state from saved preferences into localStorage then re-applies the theme.
Parameters:
NameTypeDescription
prefsObjectSaved user preferences object from the server.

saveCurrentColors(colors)

Persists `colors` to the right storage location for the active theme.
Parameters:
NameTypeDescription
colorsobjectmap of CSS variable names to color values

saveCustomThemes(themes)

Persists the custom themes array.
Parameters:
NameTypeDescription
themesArrayThe custom themes array to persist.

(async) selectTier(tier)

Sends a subscription update request for the selected tier.
Parameters:
NameTypeDescription
tierobjectThe tier object to subscribe to.

setTheme(themeId)

Switches to `themeId`, applies data-theme + color overrides, and persists the choice. Accepts 'auto', 'light', 'dark', or a custom theme ID.
Parameters:
NameTypeDescription
themeIdstringThe theme ID to switch to.

showAdminPage(user)

Reveals the admin page UI and populates the header with the current admin user's info.
Parameters:
NameTypeDescription
userobjectThe admin user object from the API.

showPresentation()

Hides all state panels and reveals the waveform and transcript sections.

showState(id)

Shows the named UI state panel (loading, auth required, or no access) and hides the others.
Parameters:
NameTypeDescription
id'presLoading' | 'presAuthRequired' | 'presNoAccess'ID of the panel to show.

showStatus(el, text, isErroropt)

Briefly displays a save status message on the given element.
Parameters:
NameTypeAttributesDefaultDescription
elHTMLElementThe status element to update.
textstringMessage to display.
isErrorboolean<optional>
falseWhether to style the message as an error.

sortedEmbeds() → {Array.<object>}

Returns a sorted copy of the _embeds array based on the current sort column and direction.
Returns:
Sorted array of embed objects.
Type: 
Array.<object>

sortedFolders() → {Array.<object>}

Returns a sorted copy of the _folders array based on the current sort column and direction.
Returns:
Sorted array of folder objects.
Type: 
Array.<object>

sortedProjects() → {Array.<object>}

Returns a sorted copy of the _projects array based on the current sort column and direction.
Returns:
Sorted array of project objects.
Type: 
Array.<object>

sortedSubs() → {Array.<object>}

Returns a sorted copy of the _subs array based on the current sort column and direction.
Returns:
Sorted array of subscription tier objects.
Type: 
Array.<object>

sortedUsers() → {Array.<object>}

Returns a sorted copy of the _users array based on the current sort column and direction.
Returns:
Sorted array of user objects.
Type: 
Array.<object>

speakersInOrder(transcript, speakers) → {Array.<string>}

Returns speaker display names in order of first appearance in the transcript.
Parameters:
NameTypeDescription
transcriptTranscriptThe transcript to scan.
speakersObject.<string, Speaker>Speaker id → Speaker map.
Returns:
Type: 
Array.<string>

switchTab(target)

Activates the named tab and its corresponding panel.
Parameters:
NameTypeDescription
targetstringThe tab identifier matching a data-tab attribute.

syncThemeToServer()

Debounced (500 ms): merges current theme state into preferences and PUTs to server.

triggerDownload(blob, filename)

Triggers a browser file download for the given Blob.
Parameters:
NameTypeDescription
blobBlobThe file content as a Blob.
filenamestringThe suggested download filename.

updateAutosaveToggle()

Syncs the autosave checkbox with the stored preference.

updateColorSectionLabel()

Updates the color section heading to reflect the currently active theme name.

updateColors()

Updates exported color variables from current CSS custom properties.

updateStartupBehaviorBtns()

Syncs the radio button selection with the stored preference.

updateThemeBtns()

Syncs the active state of the built-in theme buttons with the stored preference.

updateTierCards(currentTierId)

Updates the active/disabled state of existing tier cards without re-rendering.
Parameters:
NameTypeDescription
currentTierIdstring | nullThe ID of the currently active tier.

updateUndoQueueInput()

Syncs the undo queue size input with the stored preference.

Type Definitions

CustomTheme

Type:
  • object
Properties
NameTypeDescription
idstring
namestring
base'light' | 'dark'
colorsobject