@pie-qti/player-elements 0.1.23 → 0.1.25
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/dist/ItemToolBar-d36g3aw4-B6TGPyKt.js +3079 -0
- package/dist/ItemToolBar-d36g3aw4-B6TGPyKt.js.map +1 -0
- package/dist/ar-SA-BDmOol_3.js +854 -0
- package/dist/ar-SA-BDmOol_3.js.map +1 -0
- package/dist/{define-CqE08oOW.js → define-D80uAEx4.js} +2891 -4399
- package/dist/define-D80uAEx4.js.map +1 -0
- package/dist/dist-BSG0NOza.js +229 -0
- package/dist/dist-BSG0NOza.js.map +1 -0
- package/dist/{dist-CsEP48m1.js → dist-C8BDh5vZ.js} +1129 -760
- package/dist/dist-C8BDh5vZ.js.map +1 -0
- package/dist/dist-CQel8-vi.js +2507 -0
- package/dist/dist-CQel8-vi.js.map +1 -0
- package/dist/{dist-DQ_jFQFX.js → dist-L-bDDBry.js} +231 -147
- package/dist/dist-L-bDDBry.js.map +1 -0
- package/dist/{element-DU-n15ch.js → element-C5rTAwch.js} +2 -2
- package/dist/{element-DU-n15ch.js.map → element-C5rTAwch.js.map} +1 -1
- package/dist/{element-class-DBV-1lkb-BeszDwN_.js → element-class-B_qAd8ET-DGj15cBY.js} +4404 -3503
- package/dist/element-class-B_qAd8ET-DGj15cBY.js.map +1 -0
- package/dist/elements/BaseSvelteMountElement.d.ts +1 -0
- package/dist/elements/QtiAssessmentPlayerElement.d.ts +1 -0
- package/dist/elements.js +3 -3
- package/dist/es-ES-C98YtDtb.js +802 -0
- package/dist/es-ES-C98YtDtb.js.map +1 -0
- package/dist/fr-FR-CrmmiRPf.js +802 -0
- package/dist/fr-FR-CrmmiRPf.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/item-toolbar-element-BgqPFwsS.js +1990 -0
- package/dist/item-toolbar-element-BgqPFwsS.js.map +1 -0
- package/dist/{types-BFOGFD4R.js → language-tags-BwFWXo71.js} +24 -3
- package/dist/language-tags-BwFWXo71.js.map +1 -0
- package/dist/nl-NL-BRA_1Wcl.js +507 -0
- package/dist/nl-NL-BRA_1Wcl.js.map +1 -0
- package/dist/nl-NL-CAR7pgVz.js +802 -0
- package/dist/nl-NL-CAR7pgVz.js.map +1 -0
- package/dist/pie-DwmznDHb.js +363 -0
- package/dist/pie-DwmznDHb.js.map +1 -0
- package/dist/pie-assessment-toolkit-Cruxm385.js +5 -0
- package/dist/pie-assessment-toolkit-Cruxm385.js.map +1 -0
- package/dist/pie-assessment-toolkit-DJfg6laX.js +5 -0
- package/dist/pie-assessment-toolkit-DJfg6laX.js.map +1 -0
- package/dist/{pie-assessment-toolkit-element-BGOTMhdG.js → pie-assessment-toolkit-element-CT5UuvVY.js} +1679 -1245
- package/dist/pie-assessment-toolkit-element-CT5UuvVY.js.map +1 -0
- package/dist/pie-tool-calculator-Crfk-IZe.js +378 -0
- package/dist/pie-tool-calculator-Crfk-IZe.js.map +1 -0
- package/dist/{root-Dqg3cyBt.js → provider-gBXlGb0d.js} +4 -44
- package/dist/provider-gBXlGb0d.js.map +1 -0
- package/dist/register-players.js +1 -1
- package/dist/register.js +10603 -10162
- package/dist/register.js.map +1 -1
- package/dist/{resolveItems-DhQQhD2k.js → resolveItems-CNMvD8LP.js} +2 -2
- package/dist/{resolveItems-DhQQhD2k.js.map → resolveItems-CNMvD8LP.js.map} +1 -1
- package/dist/ro-RO-DTZbhL0e.js +802 -0
- package/dist/ro-RO-DTZbhL0e.js.map +1 -0
- package/dist/root-dCY6j_Hh.js +47 -0
- package/dist/root-dCY6j_Hh.js.map +1 -0
- package/dist/tag-names-DZGvnAgd.js +2495 -0
- package/dist/tag-names-DZGvnAgd.js.map +1 -0
- package/dist/th-TH-aqlT_oK3.js +802 -0
- package/dist/th-TH-aqlT_oK3.js.map +1 -0
- package/dist/tool-tts-inline-k3hLJUfp.js +4447 -0
- package/dist/tool-tts-inline-k3hLJUfp.js.map +1 -0
- package/dist/zh-CN-DCqaRRhU.js +802 -0
- package/dist/zh-CN-DCqaRRhU.js.map +1 -0
- package/package.json +8 -8
- package/dist/define-CqE08oOW.js.map +0 -1
- package/dist/dist-B1Rc9Jhz.js +0 -220
- package/dist/dist-B1Rc9Jhz.js.map +0 -1
- package/dist/dist-CQEJemjs.js +0 -5061
- package/dist/dist-CQEJemjs.js.map +0 -1
- package/dist/dist-CsEP48m1.js.map +0 -1
- package/dist/dist-DQ_jFQFX.js.map +0 -1
- package/dist/element-class-DBV-1lkb-BeszDwN_.js.map +0 -1
- package/dist/item-toolbar-element-iE73NEkH.js +0 -1922
- package/dist/item-toolbar-element-iE73NEkH.js.map +0 -1
- package/dist/pie-assessment-toolkit-element-BGOTMhdG.js.map +0 -1
- package/dist/pie-tool-calculator-CkQb5qxg.js +0 -2243
- package/dist/pie-tool-calculator-CkQb5qxg.js.map +0 -1
- package/dist/root-Dqg3cyBt.js.map +0 -1
- package/dist/tool-tts-inline-CA3VjWU4.js +0 -3670
- package/dist/tool-tts-inline-CA3VjWU4.js.map +0 -1
- package/dist/types-BFOGFD4R.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-L-bDDBry.js","names":[],"sources":["../../../node_modules/.bun/@pie-players+tts-server-core@0.3.73/node_modules/@pie-players/tts-server-core/dist/speech-marks.js","../../../node_modules/.bun/@pie-players+tts-server-core@0.3.73/node_modules/@pie-players/tts-server-core/dist/speed-rate.js","../../../node_modules/.bun/@pie-players+tts-client-server@0.3.73/node_modules/@pie-players/tts-client-server/dist/ServerTTSProvider.js"],"sourcesContent":["/**\n * Speech marks utilities\n * @module @pie-players/tts-server-core\n */\nconst asFiniteNumber = (value) => {\n const next = Number(value);\n return Number.isFinite(next) ? next : null;\n};\nconst sortWordMarks = (marks) => [...marks].sort((left, right) => {\n if (left.time !== right.time)\n return left.time - right.time;\n if (left.start !== right.start)\n return left.start - right.start;\n return left.end - right.end;\n});\n/**\n * Parse a provider's JSONL word-mark wire format: one `{time, type, start,\n * end, value}` object per line. Rows missing a numeric `time` are dropped —\n * that anchor is load-bearing for the timing correction below — but rows\n * missing `start`/`end` still surface (estimated from the previous mark's\n * end) rather than being lost outright.\n */\nconst parseWordMarksJsonl = (raw) => {\n const marks = [];\n let fallbackIndex = 0;\n for (const line of raw.split(/\\r?\\n/)) {\n const trimmed = line.trim();\n if (!trimmed)\n continue;\n try {\n const parsed = JSON.parse(trimmed);\n if (parsed.type && parsed.type !== \"word\")\n continue;\n const time = asFiniteNumber(parsed.time);\n if (time === null)\n continue;\n const value = typeof parsed.value === \"string\" ? parsed.value : \"\";\n const start = asFiniteNumber(parsed.start) ?? fallbackIndex;\n const end = asFiniteNumber(parsed.end) ?? start + Math.max(1, value.length);\n fallbackIndex = Math.max(end + 1, fallbackIndex);\n marks.push({ time, type: \"word\", start, end, value });\n }\n catch {\n // Ignore malformed JSONL rows while preserving valid marks.\n }\n }\n return sortWordMarks(marks);\n};\nconst normalizeMarkTimeUnits = (marks) => {\n if (marks.length < 2)\n return marks;\n const times = marks.map((mark) => mark.time).filter((time) => time >= 0);\n const maxTime = times.length ? Math.max(...times) : 0;\n const deltas = [];\n for (let index = 1; index < times.length; index += 1) {\n const delta = times[index] - times[index - 1];\n if (delta > 0 && Number.isFinite(delta))\n deltas.push(delta);\n }\n const medianDelta = deltas.length > 0\n ? [...deltas].sort((a, b) => a - b)[Math.floor(deltas.length / 2)]\n : 0;\n const shapeSuggestsSeconds = (maxTime > 0 && maxTime < 100 && marks.length > 3) ||\n (medianDelta > 0 && medianDelta < 10);\n if (!shapeSuggestsSeconds)\n return marks;\n return marks.map((mark) => ({ ...mark, time: mark.time * 1000 }));\n};\nconst estimateOffsetShift = (marks, requestText) => {\n if (!marks.length || !requestText.length)\n return 0;\n const textLower = requestText.toLowerCase();\n const candidates = [];\n let cursor = 0;\n for (const mark of marks) {\n const token = mark.value.trim().toLowerCase();\n if (!token)\n continue;\n const found = textLower.indexOf(token, cursor);\n if (found < 0)\n continue;\n const delta = mark.start - found;\n if (delta >= 0)\n candidates.push(delta);\n cursor = found + token.length;\n if (candidates.length >= 8)\n break;\n }\n if (candidates.length > 0) {\n const ordered = [...candidates].sort((a, b) => a - b);\n return ordered[Math.floor(ordered.length / 2)];\n }\n return Math.max(0, Math.floor(marks[0].start));\n};\nconst rebaseOffsetsToRequestText = (marks, requestText) => {\n if (!marks.length || !requestText.length)\n return marks;\n const textLength = requestText.length;\n const maxEnd = Math.max(...marks.map((mark) => mark.end));\n if (maxEnd <= textLength + 2)\n return marks;\n const shift = estimateOffsetShift(marks, requestText);\n if (shift <= 0)\n return marks;\n return marks.map((mark) => ({\n ...mark,\n start: mark.start - shift,\n end: mark.end - shift,\n }));\n};\nconst clampMarkRanges = (marks, requestText) => {\n if (!requestText.length)\n return marks;\n const textLength = requestText.length;\n return sortWordMarks(marks.map((mark) => {\n const start = Math.max(0, Math.min(textLength, Math.floor(mark.start)));\n const end = Math.max(start + 1, Math.min(textLength, Math.floor(mark.end)));\n return { ...mark, start, end };\n }));\n};\n/**\n * Parse and correct a provider's JSONL word-mark response against the text\n * that was actually requested: normalizes second-vs-millisecond time units,\n * rebases offsets that drifted from the request text (a provider quirk seen\n * in production), and clamps ranges to the request text's bounds.\n *\n * Shared by every provider/transport that speaks this wire shape so the\n * correction is applied once rather than reimplemented per caller.\n */\nexport function normalizeSpeechMarks(raw, requestText) {\n const parsed = parseWordMarksJsonl(raw);\n const withTimes = normalizeMarkTimeUnits(parsed);\n const rebased = rebaseOffsetsToRequestText(withTimes, requestText);\n return clampMarkRanges(rebased, requestText);\n}\n/**\n * Estimate speech marks for text when provider doesn't support them\n *\n * Uses average speaking rate to estimate word timing.\n * Not as accurate as provider-generated marks, but better than nothing.\n *\n * @param text - Text to generate marks for\n * @param avgWordsPerMinute - Average speaking rate (default 150)\n * @returns Estimated speech marks\n */\nexport function estimateSpeechMarks(text, avgWordsPerMinute = 150) {\n const words = text.split(/\\s+/).filter((w) => w.length > 0);\n const msPerWord = (60 * 1000) / avgWordsPerMinute;\n const marks = [];\n let charIndex = 0;\n for (let i = 0; i < words.length; i++) {\n const word = words[i];\n // Find word position in original text (preserves spacing)\n const wordStart = text.indexOf(word, charIndex);\n if (wordStart === -1) {\n // Word not found (shouldn't happen), skip\n charIndex += word.length + 1;\n continue;\n }\n marks.push({\n time: Math.round(i * msPerWord),\n type: \"word\",\n start: wordStart,\n end: wordStart + word.length,\n value: word,\n });\n charIndex = wordStart + word.length;\n }\n return marks;\n}\n/**\n * Adjust speech marks timing for different speaking rates\n *\n * @param marks - Original speech marks\n * @param rate - Speech rate multiplier (0.25 to 4.0)\n * @returns Adjusted speech marks\n */\nexport function adjustSpeechMarksForRate(marks, rate) {\n if (rate === 1.0) {\n return marks; // No adjustment needed\n }\n return marks.map((mark) => ({\n ...mark,\n time: Math.round(mark.time / rate),\n }));\n}\n/**\n * Validate speech marks\n * Ensures marks are properly ordered and have valid data\n *\n * @param marks - Speech marks to validate\n * @returns Validation errors (empty array if valid)\n */\nexport function validateSpeechMarks(marks) {\n const errors = [];\n if (!marks || marks.length === 0) {\n return errors; // Empty is valid\n }\n for (let i = 0; i < marks.length; i++) {\n const mark = marks[i];\n // Check required fields\n if (typeof mark.time !== \"number\" || mark.time < 0) {\n errors.push(`Mark ${i}: invalid time (${mark.time})`);\n }\n if (typeof mark.start !== \"number\" || mark.start < 0) {\n errors.push(`Mark ${i}: invalid start (${mark.start})`);\n }\n if (typeof mark.end !== \"number\" || mark.end <= mark.start) {\n errors.push(`Mark ${i}: invalid end (${mark.end}, start: ${mark.start})`);\n }\n if (!mark.value || typeof mark.value !== \"string\") {\n errors.push(`Mark ${i}: invalid value`);\n }\n // Check ordering (time should be monotonically increasing)\n if (i > 0 && mark.time < marks[i - 1].time) {\n errors.push(`Mark ${i}: time (${mark.time}) is less than previous mark (${marks[i - 1].time})`);\n }\n }\n return errors;\n}\n/**\n * Merge overlapping or adjacent speech marks\n * Useful when combining marks from multiple sources\n *\n * @param marks - Speech marks to merge\n * @returns Merged speech marks\n */\nexport function mergeSpeechMarks(marks) {\n if (marks.length <= 1) {\n return marks;\n }\n // Sort by start position\n const sorted = [...marks].sort((a, b) => a.start - b.start);\n const merged = [sorted[0]];\n for (let i = 1; i < sorted.length; i++) {\n const current = sorted[i];\n const previous = merged[merged.length - 1];\n // Check if marks overlap or are adjacent\n if (current.start <= previous.end) {\n // Merge with previous mark\n previous.end = Math.max(previous.end, current.end);\n previous.value = previous.value + \" \" + current.value;\n previous.time = Math.min(previous.time, current.time); // Use earlier time\n }\n else {\n // No overlap, add as new mark\n merged.push(current);\n }\n }\n return merged;\n}\n/**\n * Filter speech marks by type\n *\n * @param marks - Speech marks to filter\n * @param type - Type to filter by\n * @returns Filtered speech marks\n */\nexport function filterSpeechMarksByType(marks, type) {\n return marks.filter((mark) => mark.type === type);\n}\n/**\n * Get speech mark at specific time\n *\n * @param marks - Speech marks\n * @param time - Time in milliseconds\n * @returns Speech mark at time, or null if none found\n */\nexport function getSpeechMarkAtTime(marks, time) {\n // Binary search for efficiency\n let left = 0;\n let right = marks.length - 1;\n let closest = null;\n while (left <= right) {\n const mid = Math.floor((left + right) / 2);\n const mark = marks[mid];\n if (mark.time === time) {\n return mark;\n }\n // Track closest mark\n if (!closest ||\n Math.abs(mark.time - time) < Math.abs(closest.time - time)) {\n closest = mark;\n }\n if (mark.time < time) {\n left = mid + 1;\n }\n else {\n right = mid - 1;\n }\n }\n // Return closest mark if within reasonable threshold (500ms)\n if (closest && Math.abs(closest.time - time) <= 500) {\n return closest;\n }\n return null;\n}\n/**\n * Calculate statistics for speech marks\n *\n * @param marks - Speech marks\n * @returns Statistics about the marks\n */\nexport function getSpeechMarksStats(marks) {\n if (marks.length === 0) {\n return {\n count: 0,\n totalDuration: 0,\n avgWordDuration: 0,\n wordsPerMinute: 0,\n };\n }\n const wordMarks = filterSpeechMarksByType(marks, \"word\");\n const totalDuration = marks[marks.length - 1].time;\n const avgWordDuration = totalDuration / wordMarks.length;\n const wordsPerMinute = (wordMarks.length / totalDuration) * 60 * 1000;\n return {\n count: marks.length,\n wordCount: wordMarks.length,\n totalDuration,\n avgWordDuration,\n wordsPerMinute,\n };\n}\n","/**\n * Speed-rate bucketing utility\n * @module @pie-players/tts-server-core\n */\n/**\n * Bucket a numeric rate multiplier into the three-value vocabulary some\n * providers (SchoolCity, and backends modeled on it) accept instead of a\n * continuous rate. `0.95` / `1.5` is a deliberate tolerance band around the\n * `1.0` default rather than a strict `<1` / `>1` split, so small rate\n * perturbations near normal speed still read as `fallback` instead of\n * immediately flipping to `slow`/`fast`.\n */\nexport function resolveSpeedRateBucket(rate, fallback = \"medium\") {\n const value = Number(rate ?? 1);\n if (!Number.isFinite(value))\n return fallback;\n if (value <= 0.95)\n return \"slow\";\n if (value >= 1.5)\n return \"fast\";\n return fallback;\n}\n","/**\n * ServerTTSProvider - Client-side TTS provider that calls server API\n *\n * Provides high-quality TTS by calling a server-side API that uses\n * providers like AWS Polly, Google Cloud TTS, etc.\n * Returns audio with precise word-level timing (speech marks).\n */\nimport { createPieLogger, isGlobalDebugEnabled, } from \"@pie-players/pie-players-shared/pie\";\nimport { normalizeSpeechMarks, resolveSpeedRateBucket, } from \"@pie-players/tts-server-core\";\nconst logger = createPieLogger(\"server-tts-provider\", () => isGlobalDebugEnabled());\n/**\n * Parse a TTS asset URL (speech marks or audio). Rejects anything that is\n * not an absolute http(s) URL; relative URLs are resolved against\n * `apiEndpoint` when it is itself absolute.\n */\nfunction parseAssetUrl(rawUrl, config) {\n if (typeof rawUrl !== \"string\" || rawUrl.length === 0) {\n return null;\n }\n try {\n const base = typeof config.apiEndpoint === \"string\" &&\n /^https?:\\/\\//i.test(config.apiEndpoint)\n ? config.apiEndpoint\n : undefined;\n const parsed = base ? new URL(rawUrl, base) : new URL(rawUrl);\n if (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") {\n return null;\n }\n return parsed;\n }\n catch {\n return null;\n }\n}\n/**\n * Decide whether a parsed asset URL is allowed to receive the provider's\n * `Authorization` header. Defaults to the origin of `apiEndpoint` when\n * `assetOrigins` is not configured.\n */\nfunction isOriginTrustedForAuth(url, config) {\n const configured = Array.isArray(config.assetOrigins)\n ? config.assetOrigins\n .filter((value) => typeof value === \"string\" && value.length > 0)\n .map((value) => {\n try {\n return new URL(value).origin;\n }\n catch {\n return value;\n }\n })\n : [];\n if (configured.length === 0) {\n if (typeof config.apiEndpoint === \"string\" &&\n /^https?:\\/\\//i.test(config.apiEndpoint)) {\n try {\n return new URL(config.apiEndpoint).origin === url.origin;\n }\n catch {\n return false;\n }\n }\n // Relative apiEndpoint (e.g. \"/api/tts\") implies same-origin usage;\n // only same-origin assets should carry auth.\n return (typeof window !== \"undefined\" &&\n typeof window.location?.origin === \"string\" &&\n window.location.origin === url.origin);\n }\n return configured.includes(url.origin);\n}\n/**\n * Strip auth-carrying headers when the target origin is not trusted.\n */\nfunction scrubAuthHeaders(headers) {\n const cleaned = {};\n for (const [key, value] of Object.entries(headers)) {\n const lower = key.toLowerCase();\n if (lower === \"authorization\" ||\n lower === \"proxy-authorization\" ||\n lower === \"cookie\" ||\n lower.startsWith(\"x-auth-\")) {\n continue;\n }\n cleaned[key] = value;\n }\n return cleaned;\n}\nconst getTelemetryReporter = (config) => {\n const providerOptions = config.providerOptions && typeof config.providerOptions === \"object\"\n ? config.providerOptions\n : {};\n const reporter = providerOptions.__pieTelemetry;\n return typeof reporter === \"function\"\n ? reporter\n : undefined;\n};\nconst MAX_TEXT_LENGTH_BY_MODE = {\n pie: 3000,\n custom: 3000,\n};\n/**\n * Server providers whose SSML support is reliable enough to receive generated\n * SSML (AWS Polly, Google Cloud TTS). This is an allow-list rather than a\n * deny-list: the `custom` transport (and unknown providers) report\n * `supportsSSML: false` so the toolkit falls back to plain text. Some custom\n * backends advertise SSML support server-side but mis-voice or ignore parts of\n * it, so we stay conservative at the client boundary.\n */\nconst SSML_CAPABLE_PIE_PROVIDERS = new Set([\"polly\", \"google\"]);\nconst resolveSupportsSSML = (config) => {\n if (!config)\n return false;\n if (resolveTransportMode(config) !== \"pie\")\n return false;\n // The pie transport defaults to Polly when no provider is named.\n const provider = (config.provider || \"polly\").toLowerCase();\n return SSML_CAPABLE_PIE_PROVIDERS.has(provider);\n};\nconst trimTrailingSlash = (value) => value.replace(/\\/+$/, \"\");\nconst resolveVoicesValidationUrl = (config) => {\n const base = trimTrailingSlash(config.apiEndpoint);\n const provider = (config.provider || \"\").toLowerCase();\n if (provider === \"polly\" || provider === \"google\") {\n return `${base}/${provider}/voices`;\n }\n return `${base}/voices`;\n};\nconst resolveTransportMode = (config) => {\n if (config.transportMode === \"custom\")\n return \"custom\";\n if (config.transportMode === \"pie\")\n return \"pie\";\n return config.provider === \"custom\" ? \"custom\" : \"pie\";\n};\nconst resolveEndpointMode = (config, mode) => {\n if (config.endpointMode)\n return config.endpointMode;\n return mode === \"custom\" ? \"rootPost\" : \"synthesizePath\";\n};\nconst resolveValidationMode = (config, mode) => {\n if (config.endpointValidationMode)\n return config.endpointValidationMode;\n return mode === \"custom\" ? \"none\" : \"voices\";\n};\nconst resolveSpeedRate = (config) => {\n const providerOptions = (config.providerOptions || {});\n if (typeof providerOptions.speedRate === \"string\") {\n return providerOptions.speedRate;\n }\n return resolveSpeedRateBucket(config.rate);\n};\nconst parseInlineSpeechMarks = (input) => {\n if (!Array.isArray(input))\n return [];\n const marks = [];\n let fallbackIndex = 0;\n for (const entry of input) {\n if (!entry || typeof entry !== \"object\")\n continue;\n const type = typeof entry.type === \"string\" ? entry.type : \"word\";\n const time = typeof entry.time === \"number\" && Number.isFinite(entry.time)\n ? entry.time\n : 0;\n const value = typeof entry.value === \"string\" ? entry.value : \"\";\n const explicitStart = typeof entry.start === \"number\" && Number.isFinite(entry.start)\n ? entry.start\n : null;\n const explicitEnd = typeof entry.end === \"number\" && Number.isFinite(entry.end)\n ? entry.end\n : null;\n const start = explicitStart ?? fallbackIndex;\n const end = explicitEnd ?? start + Math.max(1, value.length || 1);\n fallbackIndex = Math.max(fallbackIndex, end + 1);\n marks.push({ time, type, start, end, value });\n }\n return marks.sort((left, right) => {\n if (left.time !== right.time)\n return left.time - right.time;\n if (left.start !== right.start)\n return left.start - right.start;\n return left.end - right.end;\n });\n};\nconst pieAdapter = {\n id: \"pie\",\n resolveSynthesisUrl: (config) => {\n const endpointMode = resolveEndpointMode(config, \"pie\");\n const base = trimTrailingSlash(config.apiEndpoint);\n return endpointMode === \"rootPost\" ? base : `${base}/synthesize`;\n },\n buildRequestBody: (text, config) => {\n const providerOptions = (config.providerOptions || {});\n const engine = typeof config.engine === \"string\"\n ? config.engine\n : typeof providerOptions.engine === \"string\"\n ? providerOptions.engine\n : undefined;\n const sampleRate = typeof providerOptions.sampleRate === \"number\" &&\n Number.isFinite(providerOptions.sampleRate)\n ? providerOptions.sampleRate\n : undefined;\n const format = providerOptions.format === \"mp3\" ||\n providerOptions.format === \"ogg\" ||\n providerOptions.format === \"pcm\"\n ? providerOptions.format\n : undefined;\n const speechMarkTypes = Array.isArray(providerOptions.speechMarkTypes)\n ? providerOptions.speechMarkTypes.filter((entry) => entry === \"word\" || entry === \"sentence\" || entry === \"ssml\")\n : undefined;\n return {\n text,\n provider: config.provider || \"polly\",\n voice: config.voice,\n language: config.language,\n rate: config.rate,\n engine,\n sampleRate,\n format,\n speechMarkTypes,\n includeSpeechMarks: true,\n };\n },\n parseResponse: async (response, _config, _headers, _signal, _text) => {\n const data = await response.json();\n return {\n audio: {\n kind: \"base64\",\n data: data.audio,\n contentType: data.contentType,\n },\n speechMarks: Array.isArray(data.speechMarks) ? data.speechMarks : [],\n };\n },\n};\nconst customAdapter = {\n id: \"custom\",\n resolveSynthesisUrl: (config) => {\n const endpointMode = resolveEndpointMode(config, \"custom\");\n const base = trimTrailingSlash(config.apiEndpoint);\n return endpointMode === \"synthesizePath\" ? `${base}/synthesize` : base;\n },\n buildRequestBody: (text, config) => {\n const providerOptions = (config.providerOptions || {});\n const langId = typeof providerOptions.lang_id === \"string\"\n ? providerOptions.lang_id\n : config.language || \"en-US\";\n const cache = typeof providerOptions.cache === \"boolean\" ? providerOptions.cache : true;\n return {\n text,\n speedRate: resolveSpeedRate(config),\n lang_id: langId,\n cache,\n };\n },\n parseResponse: async (response, config, headers, signal, text) => {\n const data = await response.json();\n const marksHeaders = {};\n if (config.includeAuthOnAssetFetch) {\n for (const [key, value] of Object.entries(headers)) {\n if (key.toLowerCase() === \"authorization\") {\n marksHeaders[key] = value;\n }\n }\n }\n let speechMarks = [];\n const inlineSpeechMarks = parseInlineSpeechMarks(data.speechMarks);\n if (inlineSpeechMarks.length > 0) {\n speechMarks = inlineSpeechMarks;\n }\n else if (typeof data.word === \"string\" && data.word.length > 0) {\n const marksUrl = parseAssetUrl(data.word, config);\n if (marksUrl !== null) {\n const effectiveMarksHeaders = isOriginTrustedForAuth(marksUrl, config)\n ? marksHeaders\n : scrubAuthHeaders(marksHeaders);\n const marksResponse = await fetch(marksUrl.toString(), {\n headers: effectiveMarksHeaders,\n signal,\n // Fail loud on redirects; the origin allow-list decision\n // is made pre-redirect and a silent hop could leak auth\n // to an unlisted origin.\n redirect: \"error\",\n });\n if (marksResponse.ok) {\n const marksRaw = await marksResponse.text();\n speechMarks = normalizeSpeechMarks(marksRaw, text);\n }\n }\n }\n const parsedAudioUrl = parseAssetUrl(data.audioContent, config);\n if (parsedAudioUrl === null) {\n throw new Error(\"TTS server returned an invalid audio URL\");\n }\n return {\n audio: {\n kind: \"url\",\n url: parsedAudioUrl.toString(),\n },\n speechMarks,\n };\n },\n};\nconst ADAPTERS = {\n pie: pieAdapter,\n custom: customAdapter,\n};\n/**\n * Provider implementation that handles audio playback\n */\nclass ServerTTSProviderImpl {\n config;\n adapter;\n currentAudio = null;\n pausedState = false;\n wordTimings = [];\n highlightInterval = null;\n /**\n * Index of the word timing most recently handed to `onWordBoundary`, or -1\n * before the first. It survives pause/resume so resuming continues from the\n * spoken position instead of replaying the passage from its first word.\n */\n highlightCursor = -1;\n intentionallyStopped = false;\n activeSynthesisController = null;\n synthesisRunId = 0;\n telemetryReporter;\n onPlaybackStart;\n onWordBoundary;\n constructor(config, adapter) {\n this.config = config;\n this.adapter = adapter;\n this.telemetryReporter = getTelemetryReporter(config);\n }\n async emitTelemetry(eventName, payload) {\n try {\n await this.telemetryReporter?.(eventName, payload);\n }\n catch (error) {\n logger.warn(\"telemetry callback failed:\", error);\n }\n }\n async speak(text) {\n // Stop any current playback\n this.stop();\n // Reset intentionally stopped flag for new playback\n this.intentionallyStopped = false;\n const runId = ++this.synthesisRunId;\n const synthesisController = new AbortController();\n this.activeSynthesisController = synthesisController;\n // Call server API to synthesize speech\n const { audioUrl, wordTimings } = await this.synthesizeSpeech(text, synthesisController.signal, runId);\n if (runId !== this.synthesisRunId) {\n URL.revokeObjectURL(audioUrl);\n return;\n }\n this.wordTimings = wordTimings;\n this.highlightCursor = -1;\n return new Promise((resolve, reject) => {\n // Create audio element\n const audio = new Audio(audioUrl);\n this.currentAudio = audio;\n // Apply volume from config\n if (this.config.volume !== undefined) {\n audio.volume = Math.max(0, Math.min(1, this.config.volume));\n }\n // Setup event handlers\n audio.onplay = () => {\n if (runId !== this.synthesisRunId || this.currentAudio !== audio) {\n return;\n }\n this.pausedState = false;\n try {\n this.onPlaybackStart?.();\n }\n catch (error) {\n logger.warn(\"playback-start callback failed:\", error);\n }\n // Start word highlighting\n if (this.onWordBoundary && this.wordTimings.length > 0) {\n this.startWordHighlighting();\n }\n };\n audio.onended = () => {\n this.stopWordHighlighting();\n URL.revokeObjectURL(audioUrl);\n this.currentAudio = null;\n this.wordTimings = [];\n this.highlightCursor = -1;\n resolve();\n };\n audio.onerror = (event) => {\n this.stopWordHighlighting();\n URL.revokeObjectURL(audioUrl);\n this.currentAudio = null;\n this.wordTimings = [];\n this.highlightCursor = -1;\n void event;\n // Only reject if this wasn't an intentional stop\n if (!this.intentionallyStopped) {\n reject(new Error(\"Failed to play audio from server\"));\n }\n else {\n // Intentional stop, resolve normally\n resolve();\n }\n };\n audio.onpause = () => {\n this.stopWordHighlighting();\n this.pausedState = true;\n };\n // Start playback\n audio.play().catch(reject);\n });\n }\n /**\n * Call server API to synthesize speech\n */\n async synthesizeSpeech(text, signal, runId) {\n const synthStartedAt = Date.now();\n await this.emitTelemetry(\"pie-tool-backend-call-start\", {\n toolId: \"tts\",\n backend: this.config.provider || \"server\",\n operation: \"synthesize-speech\",\n });\n const headers = {\n \"Content-Type\": \"application/json\",\n ...this.config.headers,\n };\n // Add authentication if provided\n if (this.config.authToken) {\n headers[\"Authorization\"] = `Bearer ${this.config.authToken}`;\n }\n const synthUrl = this.adapter.resolveSynthesisUrl(this.config);\n const requestBody = this.adapter.buildRequestBody(text, this.config);\n const response = await (async () => {\n try {\n return await fetch(synthUrl, {\n method: \"POST\",\n headers,\n body: JSON.stringify(requestBody),\n signal,\n });\n }\n catch (error) {\n await this.emitTelemetry(\"pie-tool-backend-call-error\", {\n toolId: \"tts\",\n backend: this.config.provider || \"server\",\n operation: \"synthesize-speech\",\n duration: Date.now() - synthStartedAt,\n errorType: \"TTSBackendNetworkError\",\n message: error instanceof Error ? error.message : String(error),\n });\n throw error;\n }\n })();\n if (!response.ok) {\n const rawBody = await response.text().catch(() => \"\");\n let errorData = {};\n if (rawBody) {\n try {\n errorData = JSON.parse(rawBody);\n }\n catch (parseError) {\n logger.warn(\"non-OK response body was not JSON\", {\n status: response.status,\n url: synthUrl,\n bodyLength: rawBody.length,\n parseError: parseError instanceof Error\n ? parseError.message\n : String(parseError),\n });\n // A provider's error body can echo the SSML it rejected, so the body\n // itself stays behind the debug gate; the length above is what says\n // a body arrived and was not JSON.\n logger.debug(\"non-OK response body\", {\n rawBodyPreview: rawBody.slice(0, 500),\n });\n }\n }\n const errorMessage = (typeof errorData.message === \"string\" && errorData.message) ||\n (typeof errorData.error?.message === \"string\"\n ? errorData.error.message\n : undefined) ||\n `Server returned ${response.status}`;\n await this.emitTelemetry(\"pie-tool-backend-call-error\", {\n toolId: \"tts\",\n backend: this.config.provider || \"server\",\n operation: \"synthesize-speech\",\n duration: Date.now() - synthStartedAt,\n statusCode: response.status,\n errorType: \"TTSBackendRequestError\",\n message: errorMessage,\n });\n logger.error(\"synthesize request failed\", {\n status: response.status,\n url: synthUrl,\n backend: this.config.provider || \"server\",\n message: errorMessage,\n textLength: text.length,\n });\n // The text under synthesis is item content and the provider's error body\n // can echo it, so both stay behind the debug gate. `errorMessage` above is\n // thrown to the caller regardless, and `textLength` is what correlates a\n // failure with a payload without publishing what the learner is reading.\n const textPreview = text.replace(/\\s+/g, \" \").trim().slice(0, 120);\n logger.debug(\"synthesize request failed for text\", {\n responseBody: errorData,\n textPreview: textPreview.length < text.length ? `${textPreview}…` : textPreview,\n });\n throw new Error(errorMessage);\n }\n const normalized = await this.adapter.parseResponse(response, this.config, headers, signal, text);\n if (runId !== this.synthesisRunId || signal.aborted) {\n throw new Error(\"Synthesis superseded by a newer request\");\n }\n let audioBlob;\n if (normalized.audio.kind === \"base64\") {\n audioBlob = this.base64ToBlob(normalized.audio.data, normalized.audio.contentType);\n }\n else {\n const audioAssetUrl = normalized.audio.url;\n const assetFetchStartedAt = Date.now();\n await this.emitTelemetry(\"pie-tool-backend-call-start\", {\n toolId: \"tts\",\n backend: this.config.provider || \"server\",\n operation: \"fetch-synthesized-audio-asset\",\n });\n const assetHeaders = {};\n if (this.config.includeAuthOnAssetFetch) {\n if (this.config.authToken) {\n assetHeaders[\"Authorization\"] = `Bearer ${this.config.authToken}`;\n }\n }\n const parsedAssetUrl = parseAssetUrl(audioAssetUrl, this.config);\n if (parsedAssetUrl === null) {\n await this.emitTelemetry(\"pie-tool-backend-call-error\", {\n toolId: \"tts\",\n backend: this.config.provider || \"server\",\n operation: \"fetch-synthesized-audio-asset\",\n duration: Date.now() - assetFetchStartedAt,\n errorType: \"TTSAssetInvalidUrl\",\n message: \"TTS asset URL rejected (non-http(s) or malformed)\",\n });\n throw new Error(\"TTS asset URL rejected (non-http(s) or malformed)\");\n }\n const effectiveAssetHeaders = isOriginTrustedForAuth(parsedAssetUrl, this.config)\n ? assetHeaders\n : scrubAuthHeaders(assetHeaders);\n const audioResponse = await (async () => {\n try {\n return await fetch(parsedAssetUrl.toString(), {\n headers: effectiveAssetHeaders,\n signal,\n redirect: \"error\",\n });\n }\n catch (error) {\n await this.emitTelemetry(\"pie-tool-backend-call-error\", {\n toolId: \"tts\",\n backend: this.config.provider || \"server\",\n operation: \"fetch-synthesized-audio-asset\",\n duration: Date.now() - assetFetchStartedAt,\n errorType: \"TTSAssetNetworkError\",\n message: error instanceof Error ? error.message : String(error),\n });\n throw error;\n }\n })();\n if (!audioResponse.ok) {\n await this.emitTelemetry(\"pie-tool-backend-call-error\", {\n toolId: \"tts\",\n backend: this.config.provider || \"server\",\n operation: \"fetch-synthesized-audio-asset\",\n duration: Date.now() - assetFetchStartedAt,\n statusCode: audioResponse.status,\n errorType: \"TTSAssetFetchError\",\n message: `Failed to download synthesized audio (${audioResponse.status})`,\n });\n throw new Error(`Failed to download synthesized audio (${audioResponse.status})`);\n }\n audioBlob = await audioResponse.blob();\n await this.emitTelemetry(\"pie-tool-backend-call-success\", {\n toolId: \"tts\",\n backend: this.config.provider || \"server\",\n operation: \"fetch-synthesized-audio-asset\",\n duration: Date.now() - assetFetchStartedAt,\n });\n }\n const audioUrl = URL.createObjectURL(audioBlob);\n // Convert speech marks to word timings\n const wordTimings = this.parseSpeechMarks(normalized.speechMarks);\n await this.emitTelemetry(\"pie-tool-backend-call-success\", {\n toolId: \"tts\",\n backend: this.config.provider || \"server\",\n operation: \"synthesize-speech\",\n duration: Date.now() - synthStartedAt,\n });\n return { audioUrl, wordTimings };\n }\n /**\n * Convert base64 to Blob\n */\n base64ToBlob(base64, contentType) {\n const byteCharacters = atob(base64);\n const byteNumbers = new Array(byteCharacters.length);\n for (let i = 0; i < byteCharacters.length; i++) {\n byteNumbers[i] = byteCharacters.charCodeAt(i);\n }\n const byteArray = new Uint8Array(byteNumbers);\n return new Blob([byteArray], { type: contentType });\n }\n /**\n * Parse speech marks into word timings\n */\n parseSpeechMarks(marks) {\n return marks\n .filter((mark) => mark.type === \"word\")\n .map((mark, index) => ({\n time: mark.time,\n wordIndex: index,\n charIndex: mark.start,\n length: mark.end - mark.start,\n word: mark.value,\n }));\n }\n /**\n * Start word highlighting synchronized with audio playback\n */\n startWordHighlighting() {\n this.stopWordHighlighting();\n if (!this.currentAudio ||\n !this.onWordBoundary ||\n this.wordTimings.length === 0) {\n logger.debug(\"cannot start word highlighting\", {\n hasAudio: !!this.currentAudio,\n hasCallback: !!this.onWordBoundary,\n wordTimingsCount: this.wordTimings.length,\n });\n return;\n }\n logger.debug(\"starting word highlighting\", {\n wordTimingsCount: this.wordTimings.length,\n playbackRate: this.currentAudio.playbackRate,\n });\n // A 50ms interval, chosen over the two alternatives: 50ms is below the\n // perceptual threshold for word-level sync at a fifth of the wake-ups a\n // 60Hz `requestAnimationFrame` loop would spend on the same job, and\n // `timeupdate` fires at browser discretion — commonly 150-250ms — so it\n // would need a timer behind it to interpolate anyway. The interval also\n // degrades better while the tab is hidden: browsers clamp it to roughly\n // 1s where they suspend rAF outright, and because a tick resolves\n // straight to the word that is current, one clamped tick resyncs the\n // highlight rather than replaying a backlog.\n this.highlightInterval = window.setInterval(() => {\n if (!this.currentAudio) {\n this.stopWordHighlighting();\n return;\n }\n const currentTimeMs = this.currentAudio.currentTime * 1000;\n const index = this.resolveCurrentWordIndex(currentTimeMs, this.highlightCursor);\n if (index < 0 || index === this.highlightCursor) {\n return;\n }\n // Report only the word that is current now. Words a tick crossed over\n // are deliberately skipped rather than fired in order: the callback\n // names the word being spoken and its consumer repaints a single range\n // per call, so replaying the backlog would paint highlights the learner\n // never sees and leave the last paint behind the audio. Firing one word\n // per tick capped highlighting at 20 words/second, which is how the\n // highlight used to drift off the spoken word and never catch up.\n this.highlightCursor = index;\n const timing = this.wordTimings[index];\n logger.debug(\"word boundary\", {\n wordIndex: timing.wordIndex,\n charIndex: timing.charIndex,\n length: timing.length,\n timingMs: timing.time,\n currentTimeMs,\n });\n this.onWordBoundary?.(timing.word, timing.charIndex, timing.length);\n }, 50);\n }\n /**\n * Index of the last timing whose start time has arrived at `currentTimeMs`,\n * or -1 when playback has not reached the first word yet.\n *\n * The scan resumes at `cursor`, so a tick costs the number of words it\n * crossed instead of the length of the passage. A backward jump — a seek, or\n * a replay on the same element — invalidates the cursor, and only then does\n * the scan restart from the beginning.\n */\n resolveCurrentWordIndex(currentTimeMs, cursor) {\n const timings = this.wordTimings;\n let index = cursor < timings.length ? cursor : -1;\n if (index >= 0 && currentTimeMs < timings[index].time) {\n index = -1;\n }\n while (index + 1 < timings.length &&\n timings[index + 1].time <= currentTimeMs) {\n index++;\n }\n return index;\n }\n /**\n * Stop word highlighting\n */\n stopWordHighlighting() {\n if (this.highlightInterval !== null) {\n clearInterval(this.highlightInterval);\n this.highlightInterval = null;\n }\n }\n pause() {\n if (this.currentAudio && !this.pausedState) {\n this.currentAudio.pause();\n this.stopWordHighlighting();\n this.pausedState = true;\n }\n }\n resume() {\n if (this.currentAudio && this.pausedState) {\n this.currentAudio.play();\n this.pausedState = false;\n // Resume word highlighting\n if (this.onWordBoundary && this.wordTimings.length > 0) {\n this.startWordHighlighting();\n }\n }\n }\n stop() {\n this.synthesisRunId += 1;\n if (this.activeSynthesisController) {\n this.activeSynthesisController.abort();\n this.activeSynthesisController = null;\n }\n this.stopWordHighlighting();\n if (this.currentAudio) {\n // Mark as intentionally stopped to prevent error handler from rejecting\n this.intentionallyStopped = true;\n this.currentAudio.pause();\n if (this.currentAudio.src) {\n URL.revokeObjectURL(this.currentAudio.src);\n }\n this.currentAudio.src = \"\";\n this.currentAudio = null;\n }\n this.pausedState = false;\n this.wordTimings = [];\n this.highlightCursor = -1;\n }\n isPlaying() {\n return this.currentAudio !== null && !this.pausedState;\n }\n isPaused() {\n return this.pausedState;\n }\n /**\n * Update settings dynamically (rate, pitch, voice)\n * Note: Server-side synthesis bakes rate, pitch, and voice into the audio and\n * speech marks. Settings updates are stored for the next synthesis; active\n * speed changes are handled by TTSService replaying from the current segment.\n */\n updateSettings(settings) {\n // Update config\n if (settings.rate !== undefined) {\n this.config.rate = settings.rate;\n this.config.providerOptions = {\n ...(this.config.providerOptions || {}),\n speedRate: resolveSpeedRateBucket(settings.rate),\n };\n }\n if (settings.pitch !== undefined) {\n // Server-side pitch is baked into audio, so this only affects next speak()\n this.config.pitch = settings.pitch;\n }\n if (settings.voice !== undefined) {\n // Voice change requires resynthesis, affects next speak()\n this.config.voice = settings.voice;\n }\n }\n}\n/**\n * Server TTS Provider\n *\n * Client-side provider that calls a server API for TTS synthesis.\n * The server handles provider selection (Polly, Google, etc.) and credential management.\n */\nexport class ServerTTSProvider {\n providerId = \"server-tts\";\n providerName = \"Server TTS\";\n version = \"1.0.0\";\n config = null;\n adapter = null;\n telemetryReporter;\n async emitTelemetry(eventName, payload) {\n try {\n await this.telemetryReporter?.(eventName, payload);\n }\n catch (error) {\n logger.warn(\"telemetry callback failed:\", error);\n }\n }\n /**\n * Initialize the server TTS provider.\n *\n * This is designed to be fast by default (no API calls).\n * Set validateEndpoint: true in config to test API availability during initialization.\n *\n * @performance Default: <10ms, With validation: 100-500ms\n */\n async initialize(config) {\n const serverConfig = config;\n if (!serverConfig.apiEndpoint) {\n throw new Error(\"apiEndpoint is required for ServerTTSProvider\");\n }\n this.config = serverConfig;\n this.telemetryReporter = getTelemetryReporter(serverConfig);\n const transportMode = resolveTransportMode(serverConfig);\n this.adapter = ADAPTERS[transportMode];\n // Only test API availability if explicitly requested (slower but safer)\n if (serverConfig.validateEndpoint) {\n const validationStartedAt = Date.now();\n await this.emitTelemetry(\"pie-tool-backend-call-start\", {\n toolId: \"tts\",\n backend: serverConfig.provider || \"server\",\n operation: \"validate-endpoint\",\n });\n const available = await this.testAPIAvailability();\n if (!available) {\n await this.emitTelemetry(\"pie-tool-backend-call-error\", {\n toolId: \"tts\",\n backend: serverConfig.provider || \"server\",\n operation: \"validate-endpoint\",\n duration: Date.now() - validationStartedAt,\n errorType: \"TTSEndpointValidationError\",\n message: `Server TTS API not available at ${serverConfig.apiEndpoint}`,\n });\n throw new Error(`Server TTS API not available at ${serverConfig.apiEndpoint}`);\n }\n await this.emitTelemetry(\"pie-tool-backend-call-success\", {\n toolId: \"tts\",\n backend: serverConfig.provider || \"server\",\n operation: \"validate-endpoint\",\n duration: Date.now() - validationStartedAt,\n });\n }\n return new ServerTTSProviderImpl(serverConfig, this.adapter);\n }\n /**\n * Test if API endpoint is available (with timeout).\n *\n * @performance 100-500ms depending on network\n */\n async testAPIAvailability() {\n if (!this.config || !this.adapter)\n return false;\n try {\n const headers = { ...this.config.headers };\n if (this.config.authToken) {\n headers[\"Authorization\"] = `Bearer ${this.config.authToken}`;\n }\n // Create abort controller for timeout\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), 5000); // 5 second timeout\n const mode = resolveValidationMode(this.config, this.adapter.id);\n if (mode === \"none\") {\n clearTimeout(timeoutId);\n return true;\n }\n const validationUrl = mode === \"voices\"\n ? resolveVoicesValidationUrl(this.config)\n : this.adapter.resolveSynthesisUrl(this.config);\n const method = mode === \"voices\" ? \"GET\" : \"OPTIONS\";\n try {\n const response = await fetch(validationUrl, {\n method,\n headers,\n signal: controller.signal,\n });\n clearTimeout(timeoutId);\n // Some endpoints may not accept OPTIONS; treat 405 as reachable.\n return response.ok || response.status === 405;\n }\n catch {\n clearTimeout(timeoutId);\n return false;\n }\n }\n catch {\n return false;\n }\n }\n supportsFeature(feature) {\n switch (feature) {\n case \"pause\":\n case \"resume\":\n case \"wordBoundary\":\n case \"voiceSelection\":\n case \"rateControl\":\n return true;\n case \"pitchControl\":\n // Depends on server provider, assume no for safety\n return false;\n default:\n return false;\n }\n }\n getCapabilities() {\n const mode = this.config ? resolveTransportMode(this.config) : \"pie\";\n return {\n supportsPause: true,\n supportsResume: true,\n supportsWordBoundary: true, // ✅ Via speech marks from server\n supportsVoiceSelection: true,\n supportsRateControl: true,\n supportsPitchControl: false, // Depends on server provider\n supportsSSML: resolveSupportsSSML(this.config),\n maxTextLength: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AAQ,EAAW;IACvB,CAAC;IAGD,OAFA,aAAa,CAAS,GAEf,EAAS,MAAM,EAAS,WAAW;GAC9C,QACM;IAEF,OADA,aAAa,CAAS,GACf;GACX;EACJ,QACM;GACF,OAAO;EACX;CACJ;CACA,gBAAgB,GAAS;EACrB,QAAQ,GAAR;GACI,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK,eACD,OAAO;GACX,KAAK,gBAED,OAAO;GACX,SACI,OAAO;EACf;CACJ;CACA,kBAAkB;EACd,IAAM,IAAO,KAAK,SAAS,EAAqB,KAAK,MAAM,IAAI;EAC/D,OAAO;GACH,eAAe;GACf,gBAAgB;GAChB,sBAAsB;GACtB,wBAAwB;GACxB,qBAAqB;GACrB,sBAAsB;GACtB,cAAc,EAAoB,KAAK,MAAM;GAC7C,eAAe,EAAwB;EAC3C;CACJ;CACA,UAAU;EAGN,AAFA,KAAK,SAAS,MACd,KAAK,UAAU,MACf,KAAK,oBAAoB,KAAA;CAC7B;AACJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./element-class-
|
|
1
|
+
import { t as e } from "./element-class-B_qAd8ET-DGj15cBY.js";
|
|
2
2
|
//#region ../item-player/dist/element.js
|
|
3
3
|
var t = "pie-qti-item-player";
|
|
4
4
|
globalThis.customElements && !customElements.get(t) && customElements.define(t, e);
|
|
5
5
|
//#endregion
|
|
6
6
|
|
|
7
|
-
//# sourceMappingURL=element-
|
|
7
|
+
//# sourceMappingURL=element-C5rTAwch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-
|
|
1
|
+
{"version":3,"file":"element-C5rTAwch.js","names":["e"],"sources":["../../item-player/dist/element.js"],"sourcesContent":["import { t as e } from \"./element-class-B_qAd8ET.js\";\n//#region src/element.ts\nvar t = \"pie-qti-item-player\";\nglobalThis.customElements && !customElements.get(t) && customElements.define(t, e);\n//#endregion\nexport { e as PieQtiItemPlayerElement };\n\n//# sourceMappingURL=element.js.map"],"mappings":";;AAEA,IAAI,IAAI;AACR,WAAW,kBAAkB,CAAC,eAAe,IAAI,CAAC,KAAK,eAAe,OAAO,GAAGA,CAAC"}
|