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:
| Name | Type | Description |
|---|---|---|
el | HTMLElement | element from which highlights will be removed |
- Source
_fmtAnalyticsCard(key, value) → {string}
Formats an analytics metric value for display on a summary card.
Parameters:
| Name | Type | Description |
|---|---|---|
key | string | Metric key (e.g. 'total_audio_seconds', 'storage_bytes'). |
value | number | | Raw 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:
| Name | Type | Description |
|---|---|---|
b | number | Byte count. |
Returns:
Formatted size string.
- Type:
- string
_friendlyFirebaseError(code) → {string}
Map a Firebase auth error code to a human-readable message.
Parameters:
| Name | Type | Description |
|---|---|---|
code | string | The 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:
| Name | Type | Description |
|---|---|---|
hex | string | Six-digit hex colour (e.g. '#60a5fa'). |
alpha | number | Alpha value between 0 and 1. |
Returns:
CSS rgba() colour string.
- Type:
- string
_hidePtLinkTooltip()
Hides and removes the active link tooltip.
- Source
_highlightChartMetric(key)
Highlights a single metric dataset on the chart, dimming all others.
Parameters:
| Name | Type | Description |
|---|---|---|
key | string | Metric key to highlight. |
_highlightTextInEl(el, query)
Injects wrappers around all occurrences of `query` within the text nodes of `el`.
Parameters:
| Name | Type | Description |
|---|---|---|
el | HTMLElement | element whose text nodes will be wrapped with highlights |
query | string | already lower-cased search string |
- Source
_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:
| Name | Type | Description |
|---|---|---|
embedId | string | | Embed ID to highlight, or null to clear. |
_setFldRowSelected(folderId)
Applies or clears the selected-row highlight in the folders table.
Parameters:
| Name | Type | Description |
|---|---|---|
folderId | string | | Folder ID to highlight, or null to clear. |
_setProjRowSelected(projectId)
Applies or clears the selected-row highlight in the projects table.
Parameters:
| Name | Type | Description |
|---|---|---|
projectId | string | | Project ID to highlight, or null to clear. |
_setSubRowSelected(subId)
Applies or clears the selected-row highlight in the subscriptions table.
Parameters:
| Name | Type | Description |
|---|---|---|
subId | string | | Subscription tier ID to highlight, or null to clear. |
_setUserRowSelected(userId)
Applies or clears the selected-row highlight in the users table.
Parameters:
| Name | Type | Description |
|---|---|---|
userId | string | | User ID to highlight, or null to clear. |
_showPtLinkTooltip(url, name, description)
Shows a tooltip near the cursor with link metadata.
Parameters:
| Name | Type | Description |
|---|---|---|
url | string | the hyperlink URL |
name | string | | optional display name for the link |
description | string | | optional description text |
- Source
_subVal(col, sub) → {*}
Extracts a flat sortable value for virtual subscription columns.
Parameters:
| Name | Type | Description |
|---|---|---|
col | string | Column key. |
sub | object | Subscription 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:
| Name | Type | Description |
|---|---|---|
key | string | Metric key. |
value | number | Raw 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:
| Name | Type | Description |
|---|---|---|
key | string | Metric key to toggle. |
activateTheme(themeId)
Activates a theme and refreshes all theme-dependent UI.
Parameters:
| Name | Type | Description |
|---|---|---|
themeId | string | The theme ID to activate. |
- Source
applyThemeColors(themeId)
Clears all managed CSS variables then applies the saved colors for `themeId`.
Parameters:
| Name | Type | Description |
|---|---|---|
themeId | string | The theme ID whose colors to apply. |
- Source
applyTier(tier, subscriptionSinceopt, usageopt)
Populates the subscription info panel with the given tier's details.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
tier | object | | The active subscription tier object, or null. | ||
subscriptionSince | string | | <optional> | null | ISO date string of when the subscription started. |
usage | object | <optional> | {} | Current usage counters (e.g. transcription_mins, storage_bytes). |
- Source
buildProject(pdata) → {Project}
Constructs a Project instance from raw server presentation data.
Parameters:
| Name | Type | Description |
|---|---|---|
pdata | object | presentation data payload from the server |
- Source
Returns:
- Type:
- Project
buildThemePrefs() → {Object}
Collects current theme state from localStorage into a preferences patch.
- Source
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:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params | object | Tier feature limits used to calculate the price.Properties
|
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:
| Name | Type | Description |
|---|---|---|
v | number | The raw value to clamp. |
- Source
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.
- Source
cmpValues(a, b) → {number}
Null-safe comparator for table sorting, handles booleans and strings.
Parameters:
| Name | Type | Description |
|---|---|---|
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:
| Name | Type | Description |
|---|---|---|
name | string | Display name for the new theme. |
- Source
deleteCustomTheme(id)
Deletes a custom theme by ID and falls back to 'dark' if it was active.
Parameters:
| Name | Type | Description |
|---|---|---|
id | string | The ID of the custom theme to delete. |
- Source
displayName(speakerId, speakers) → {string}
Returns the display name for a speaker id, falling back to the raw id.
Parameters:
| Name | Type | Description |
|---|---|---|
speakerId | string | The speaker identifier. |
speakers | Object.<string, Speaker> | Speaker id → Speaker map. |
- Source
Returns:
- Type:
- string
(async) doDeleteEmbed(embedId)
Sends a DELETE request for the given embed and removes it from the local list.
Parameters:
| Name | Type | Description |
|---|---|---|
embedId | string | ID of the embed to delete. |
(async) doDeleteFolder(folderId)
Sends a DELETE request for the given folder and removes it from the local list.
Parameters:
| Name | Type | Description |
|---|---|---|
folderId | string | ID of the folder to delete. |
(async) doDeleteProject(projectId)
Sends a DELETE request for the given project and removes it from the local list.
Parameters:
| Name | Type | Description |
|---|---|---|
projectId | string | ID 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:
| Name | Type | Description |
|---|---|---|
tierId | string | ID 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:
| Name | Type | Description |
|---|---|---|
userId | string | ID 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:
| Name | Type | Description |
|---|---|---|
folderId | string | ID of the folder to update. |
makePublic | boolean | True to make the folder public, false to make it private. |
btn | HTMLElement | The 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:
| Name | Type | Description |
|---|---|---|
projectId | string | ID of the project to update. |
makePublic | boolean | True to make the project public, false to make it private. |
btn | HTMLElement | The 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:
| Name | Type | Description |
|---|---|---|
userId | string | ID of the target user. |
activate | boolean | Desired active state. |
btn | HTMLElement | The 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:
| Name | Type | Description |
|---|---|---|
themeObj | Object | Theme data to export. |
- Source
drawerRow(label, value, mono) → {string}
Renders a label/value row for the drawer.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
label | string | Display label. | |
value | string | Value to display. | |
mono | boolean | false | Whether 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:
| Name | Type | Description |
|---|---|---|
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:
| Name | Type | Description |
|---|---|---|
audioDurationSecs | number | audio duration in seconds |
whisperModelKey | string | key of the Whisper model (e.g. 'medium') |
pyannoteModelKey | string | key 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:
| Name | Type | Description |
|---|---|---|
audioDurationSecs | number | audio duration in seconds |
whisperModelKey | string | key of the Whisper model (e.g. 'medium') |
pyannoteModelKey | string | key 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:
| Name | Type | Description |
|---|---|---|
path | string | Full filesystem path for the output file. |
text | string | CSV string from formatCSV(). |
- Source
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:
| Name | Type | Description |
|---|---|---|
path | string | Full filesystem path for the output file. |
text | string | Formatted transcript text from one of the format* functions. |
style | string | Export style key: 'script' | 'professional' | 'transcript'. |
speakers | Object.<string, Speaker> | Speaker map, used to identify names for bold rendering. |
- Source
Returns:
- Type:
- Promise.<void>
exportFile(fileType, path, text, style, speakers) → {Promise.<void>}
Dispatches to the correct file writer for the given file type.
Parameters:
| Name | Type | Description |
|---|---|---|
fileType | string | 'txt' | 'md' | 'csv' | 'docx' | 'pdf' |
path | string | Full filesystem path for the output file. |
text | string | Formatted transcript text from format(). |
style | string | Export style key passed through to DOCX/PDF writers. |
speakers | Object.<string, Speaker> | Passed through to DOCX/PDF writers. |
- Source
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:
| Name | Type | Description |
|---|---|---|
path | string | Full filesystem path for the output file. |
text | string | Formatted transcript text from one of the format* functions. |
- Source
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:
| Name | Type | Description |
|---|---|---|
path | string | Full filesystem path for the output file. |
text | string | Formatted transcript text from one of the format* functions. |
style | string | Export style key: 'script' | 'professional' | 'transcript'. |
speakers | Object.<string, Speaker> | Speaker map, used to identify names for bold rendering. |
- Source
Returns:
- Type:
- Promise.<void>
exportTXT(path, text) → {Promise.<void>}
Writes a plain-text export to the given path.
Parameters:
| Name | Type | Description |
|---|---|---|
path | string | Full filesystem path for the output file. |
text | string | Formatted transcript text from one of the format* functions. |
- Source
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:
| Name | Type | Description |
|---|---|---|
projectId | string | The project UUID. |
token | string | | Firebase ID token for authenticated requests, or null. |
- Source
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:
| Name | Type | Description |
|---|---|---|
col | object | Column descriptor from COLS. |
user | object | User data object. |
Returns:
Inner HTML for the cell.
- Type:
- string
fmtCost(n) → {string}
Formats a cost value in USD for display.
Parameters:
| Name | Type | Description |
|---|---|---|
n | number | cost in USD |
Returns:
formatted cost string
- Type:
- string
fmtDate(iso) → {string}
Formats an ISO timestamp as a short local date string.
Parameters:
| Name | Type | Description |
|---|---|---|
iso | string | | ISO 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:
| Name | Type | Description |
|---|---|---|
iso | string | | ISO 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:
| Name | Type | Description |
|---|---|---|
s | number | duration 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:
| Name | Type | Description |
|---|---|---|
secs | number | | Duration 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:
| Name | Type | Description |
|---|---|---|
col | object | Column descriptor from EMB_COLS. |
emb | object | Embed 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:
| Name | Type | Description |
|---|---|---|
col | object | Column descriptor from FLD_COLS. |
fld | object | Folder data object. |
Returns:
Inner HTML for the cell.
- Type:
- string
fmtGb(gb) → {string}
Formats a gigabyte value for display, returning 'Unlimited' for null.
Parameters:
| Name | Type | Description |
|---|---|---|
gb | number | | Gigabytes to format. |
- Source
Returns:
- Type:
- string
fmtHMS(totalSeconds) → {string}
Formats a seconds value as HH:MM:SS.
Parameters:
| Name | Type | Description |
|---|---|---|
totalSeconds | number | Total number of seconds to format. |
- Source
Returns:
- Type:
- string
fmtHrs(hrs) → {string}
Formats an hour value for display, returning 'Unlimited' for null.
Parameters:
| Name | Type | Description |
|---|---|---|
hrs | number | | Hours to format. |
- Source
Returns:
- Type:
- string
fmtMins(mins) → {string}
Formats a minute value for display, returning 'Unlimited' for null.
Parameters:
| Name | Type | Description |
|---|---|---|
mins | number | | Minutes to format. |
- Source
Returns:
- Type:
- string
fmtProjCell(col, proj) → {string}
Renders a projects table cell as an HTML string for the given column.
Parameters:
| Name | Type | Description |
|---|---|---|
col | object | Column descriptor from PROJ_COLS. |
proj | object | Project 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:
| Name | Type | Description |
|---|---|---|
col | string | Column key string. |
sub | object | Subscription 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:
| Name | Type | Attributes | Description |
|---|---|---|---|
style | string | 'script' | 'professional' | 'transcript' | 'csv' | |
transcript | Transcript | The transcript to format. | |
speakers | Object.<string, Speaker> | Speaker id → Speaker map. | |
options | object | <optional> | Passed through to formatTranscript. |
- Source
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:
| Name | Type | Description |
|---|---|---|
transcript | Transcript | The transcript to format. |
speakers | Object.<string, Speaker> | Speaker id → Speaker map. |
- Source
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:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
transcript | Transcript | The transcript to format. | |||||||||||||||||||||||||||||||||||||||||
speakers | Object.<string, Speaker> | Speaker id → Speaker map. | |||||||||||||||||||||||||||||||||||||||||
options | object | <optional> | Formatting options.Properties
|
- Source
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:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
transcript | Transcript | The transcript to format. | ||||||||||||||||||||||||||||||||||||
speakers | Object.<string, Speaker> | Speaker id → Speaker map. | ||||||||||||||||||||||||||||||||||||
options | object | <optional> | Formatting options.Properties
|
- Source
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:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
transcript | Transcript | The transcript to format. | |||||||||||||||||||||||||||||||||||||||||
speakers | Object.<string, Speaker> | Speaker id → Speaker map. | |||||||||||||||||||||||||||||||||||||||||
options | object | <optional> | Formatting options.Properties
|
- Source
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:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
transcript | Transcript | The transcript to format. | |||||||||||||||||||||||||||||||||||||||||
speakers | Object.<string, Speaker> | Speaker id → Speaker map. | |||||||||||||||||||||||||||||||||||||||||
options | object | <optional> | Formatting options.Properties
|
- Source
Returns:
- Type:
- string
getCustomColors() → {object}
Returns the current theme's saved color map.
- Source
Returns:
map of CSS variable names to color values
- Type:
- object
getCustomThemes() → {Array.<CustomTheme>}
Returns all saved custom theme objects.
- Source
Returns:
- Type:
- Array.<CustomTheme>
getGroupLabel(value) → {string}
Returns a human-readable label for the current group-by field value.
Parameters:
| Name | Type | Description |
|---|---|---|
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.
- Source
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.
- Source
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.
- Source
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:
| Name | Type | Description |
|---|---|---|
presTranscript | PresentationTranscript | The rendered transcript panel. |
- Source
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.
- Source
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.
- Source
Returns:
- Type:
- Promise.<void>
openAccountDrawer(tabopt)
Opens the account settings drawer, lazy-loading the iframe on first open.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
tab | string | | <optional> | null | Optional tab name to switch to (e.g. 'subscription'). |
openDeleteConfirm(userId, displayLabel)
Opens the delete confirmation dialog for a user account.
Parameters:
| Name | Type | Description |
|---|---|---|
userId | string | ID of the user to delete. |
displayLabel | string | Display name or email shown in the confirmation message. |
openDeleteEmbedConfirm(embedId, label)
Opens the delete confirmation dialog for an embed.
Parameters:
| Name | Type | Description |
|---|---|---|
embedId | string | ID of the embed to delete. |
label | string | Truncated embed ID shown in the confirmation message. |
openDeleteFolderConfirm(folderId, label)
Opens the delete confirmation dialog for a folder.
Parameters:
| Name | Type | Description |
|---|---|---|
folderId | string | ID of the folder to delete. |
label | string | Display name of the folder shown in the confirmation message. |
openDeleteProjectConfirm(projectId, label)
Opens the delete confirmation dialog for a project.
Parameters:
| Name | Type | Description |
|---|---|---|
projectId | string | ID of the project to delete. |
label | string | Display name of the project shown in the confirmation message. |
openDeleteSubConfirm(tierId, label)
Opens the delete confirmation dialog for a subscription tier.
Parameters:
| Name | Type | Description |
|---|---|---|
tierId | string | ID of the tier to delete. |
label | string | Display 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:
| Name | Type | Description |
|---|---|---|
userId | string | ID of the user to display. |
openEmbedDrawer(embedId)
Opens the embed detail drawer for the given embed.
Parameters:
| Name | Type | Description |
|---|---|---|
embedId | string | ID of the embed to display. |
openFolderDrawer(folderId)
Opens the folder detail drawer for the given folder.
Parameters:
| Name | Type | Description |
|---|---|---|
folderId | string | ID of the folder to display. |
openProjectDrawer(projectId)
Opens the project detail drawer for the given project.
Parameters:
| Name | Type | Description |
|---|---|---|
projectId | string | ID of the project to display. |
openSubDrawer(subId)
Opens the subscription edit drawer for an existing tier or for creating a new one.
Parameters:
| Name | Type | Description |
|---|---|---|
subId | string | | ID of the subscription tier to edit, or null to create a new tier. |
openTierModal()
Opens the tier selection modal.
- Source
populateSurveyFields(surveyAnswers)
Populate the survey dropdowns from saved survey_answers preferences.
Parameters:
| Name | Type | Description |
|---|---|---|
surveyAnswers | object | The preferences.survey_answers object. |
- Source
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:
| Name | Type | Description |
|---|---|---|
data | object | Analytics 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.
- Source
renderCustomThemes()
Re-renders the custom theme buttons in the theme selector group.
- Source
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:
| Name | Type | Description |
|---|---|---|
prefs | object | User 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:
| Name | Type | Description |
|---|---|---|
data | object | Analytics snapshot data object containing mrr fields. |
renderSegmentLinks(container, text, annotations, segIdx)
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:
| Name | Type | Description |
|---|---|---|
container | HTMLElement | the DOM element to populate |
text | string | the segment's plain text content |
annotations | object | | the project annotations object containing hyperlinks |
segIdx | number | index of the segment within the transcript |
- Source
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:
| Name | Type | Description |
|---|---|---|
data | object | Analytics 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:
| Name | Type | Description |
|---|---|---|
activeTierId | string | | The ID of the currently active tier, or null. |
- Source
resolveBase(themeId) → {'light'|'dark'}
Resolves any theme ID to 'light' or 'dark'.
Parameters:
| Name | Type | Description |
|---|---|---|
themeId | string | The theme ID to resolve ('auto', 'light', 'dark', or custom ID). |
- Source
Returns:
- Type:
- 'light' |
'dark'
resolvedBase() → {'light'|'dark'}
Resolves the active theme to 'light' or 'dark' (custom themes return their base).
- Source
Returns:
- Type:
- 'light' |
'dark'
restoreThemeFromPrefs(prefs)
Restores theme state from saved preferences into localStorage then re-applies the theme.
Parameters:
| Name | Type | Description |
|---|---|---|
prefs | Object | Saved user preferences object from the server. |
- Source
saveCurrentColors(colors)
Persists `colors` to the right storage location for the active theme.
Parameters:
| Name | Type | Description |
|---|---|---|
colors | object | map of CSS variable names to color values |
- Source
saveCustomThemes(themes)
Persists the custom themes array.
Parameters:
| Name | Type | Description |
|---|---|---|
themes | Array | The custom themes array to persist. |
- Source
(async) selectTier(tier)
Sends a subscription update request for the selected tier.
Parameters:
| Name | Type | Description |
|---|---|---|
tier | object | The tier object to subscribe to. |
- Source
setTheme(themeId)
Switches to `themeId`, applies data-theme + color overrides, and persists the choice. Accepts 'auto', 'light', 'dark', or a custom theme ID.
Parameters:
| Name | Type | Description |
|---|---|---|
themeId | string | The theme ID to switch to. |
- Source
showAdminPage(user)
Reveals the admin page UI and populates the header with the current admin user's info.
Parameters:
| Name | Type | Description |
|---|---|---|
user | object | The admin user object from the API. |
showPresentation()
Hides all state panels and reveals the waveform and transcript sections.
- Source
showState(id)
Shows the named UI state panel (loading, auth required, or no access) and hides the others.
Parameters:
| Name | Type | Description |
|---|---|---|
id | 'presLoading' | | ID of the panel to show. |
- Source
showStatus(el, text, isErroropt)
Briefly displays a save status message on the given element.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
el | HTMLElement | The status element to update. | ||
text | string | Message to display. | ||
isError | boolean | <optional> | false | Whether to style the message as an error. |
- Source
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:
| Name | Type | Description |
|---|---|---|
transcript | Transcript | The transcript to scan. |
speakers | Object.<string, Speaker> | Speaker id → Speaker map. |
- Source
Returns:
- Type:
- Array.<string>
switchTab(target)
Activates the named tab and its corresponding panel.
Parameters:
| Name | Type | Description |
|---|---|---|
target | string | The tab identifier matching a data-tab attribute. |
- Source
syncThemeToServer()
Debounced (500 ms): merges current theme state into preferences and PUTs to server.
- Source
triggerDownload(blob, filename)
Triggers a browser file download for the given Blob.
Parameters:
| Name | Type | Description |
|---|---|---|
blob | Blob | The file content as a Blob. |
filename | string | The suggested download filename. |
- Source
updateAutosaveToggle()
Syncs the autosave checkbox with the stored preference.
- Source
updateColorSectionLabel()
Updates the color section heading to reflect the currently active theme name.
- Source
updateColors()
Updates exported color variables from current CSS custom properties.
- Source
updateStartupBehaviorBtns()
Syncs the radio button selection with the stored preference.
- Source
updateThemeBtns()
Syncs the active state of the built-in theme buttons with the stored preference.
- Source
updateTierCards(currentTierId)
Updates the active/disabled state of existing tier cards without re-rendering.
Parameters:
| Name | Type | Description |
|---|---|---|
currentTierId | string | | The ID of the currently active tier. |
- Source
updateUndoQueueInput()
Syncs the undo queue size input with the stored preference.
- Source
Type Definitions
CustomTheme
Type:
Properties- object
| Name | Type | Description |
|---|---|---|
id | string | |
name | string | |
base | 'light' | | |
colors | object |
- Source