@pie-element/multiple-choice 14.0.5-next.20261014231219 → 14.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/browser/{Radio-B0RpBdhP.js → Radio-Bt7LNcmG.js} +5 -3
  2. package/dist/browser/{Radio-B0RpBdhP.js.map → Radio-Bt7LNcmG.js.map} +1 -1
  3. package/dist/browser/author/index.js +4743 -4710
  4. package/dist/browser/author/index.js.map +1 -1
  5. package/dist/browser/controller/index.js +5 -2
  6. package/dist/browser/delivery/index.js +7 -4
  7. package/dist/browser/delivery/index.js.map +1 -1
  8. package/dist/browser/editor-runtime/{Radio-B6E6ZX8F.js → Radio-DK9vJMgO.js} +5 -3
  9. package/dist/browser/editor-runtime/{Radio-B6E6ZX8F.js.map → Radio-DK9vJMgO.js.map} +1 -1
  10. package/dist/browser/editor-runtime/author/index.js +3012 -2979
  11. package/dist/browser/editor-runtime/author/index.js.map +1 -1
  12. package/dist/browser/editor-runtime/controller/index.js +5 -2
  13. package/dist/browser/editor-runtime/delivery/index.js +7 -4
  14. package/dist/browser/editor-runtime/delivery/index.js.map +1 -1
  15. package/dist/browser/editor-runtime/{main-B79CdY7l.js → main-CQBqpT6y.js} +2 -2
  16. package/dist/browser/editor-runtime/{main-B79CdY7l.js.map → main-CQBqpT6y.js.map} +1 -1
  17. package/dist/browser/editor-runtime/{mathjax-CptWnMbQ-DaM-nUQj.js → mathjax-CptWnMbQ-UoBFHQRx.js} +2 -2
  18. package/dist/browser/editor-runtime/{mathjax-CptWnMbQ-DaM-nUQj.js.map → mathjax-CptWnMbQ-UoBFHQRx.js.map} +1 -1
  19. package/dist/browser/editor-runtime/print/index.js +7 -4
  20. package/dist/browser/{main-Rdqs5iBR.js → main-CHDPpcIt.js} +2 -2
  21. package/dist/browser/{main-Rdqs5iBR.js.map → main-CHDPpcIt.js.map} +1 -1
  22. package/dist/browser/{mathjax-CptWnMbQ-D2JW9dA-.js → mathjax-CptWnMbQ-CTwyXakd.js} +2 -2
  23. package/dist/browser/{mathjax-CptWnMbQ-D2JW9dA-.js.map → mathjax-CptWnMbQ-CTwyXakd.js.map} +1 -1
  24. package/dist/browser/print/index.js +7 -4
  25. package/dist/index.iife.js +1 -1
  26. package/dist/schemas/configuration.schema.json +1 -1
  27. package/dist/schemas/model.schema.json +1 -1
  28. package/dist/schemas/session.schema.json +1 -1
  29. package/module/print.js +3 -1
  30. package/module/print.js.map +1 -1
  31. package/package.json +13 -13
@@ -198,8 +198,11 @@ var x = (e, t) => new Promise((n) => {
198
198
  n !== "radio" && t != null && d > t && (l.correctResponse = `The number of correct answers (${d}) exceeds max selections (${t}). Students won't be able to select all correct answers.`);
199
199
  }
200
200
  return t(s) || (l.choices = s), t(c) || (l.rationale = c), l;
201
- };
201
+ }, w = Object.freeze({
202
+ name: "@pie-element/multiple-choice",
203
+ version: "14.0.5"
204
+ });
202
205
  //#endregion
203
- export { x as createCorrectResponseSession, h as createDefaultModel, y as getLogTrace, v as getScore, _ as model, g as normalize, b as outcome, C as validate };
206
+ export { x as createCorrectResponseSession, h as createDefaultModel, y as getLogTrace, v as getScore, _ as model, g as normalize, b as outcome, w as piePackage, C as validate };
204
207
 
205
208
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
- import { H as e, M as t, N as n, U as r, Yt as i, s as a } from "../Radio-B0RpBdhP.js";
2
- import { n as o, t as s } from "../main-Rdqs5iBR.js";
1
+ import { H as e, M as t, N as n, U as r, Yt as i, s as a } from "../Radio-Bt7LNcmG.js";
2
+ import { n as o, t as s } from "../main-CHDPpcIt.js";
3
3
  import { a as c } from "../dist-DL6MQNxd.js";
4
4
  import l from "react";
5
5
  import { createRoot as u } from "react-dom/client";
@@ -320,8 +320,11 @@ var P = class extends HTMLElement {
320
320
  };
321
321
  this._onChange(o);
322
322
  }
323
- };
323
+ }, F = Object.freeze({
324
+ name: "@pie-element/multiple-choice",
325
+ version: "14.0.5"
326
+ });
324
327
  //#endregion
325
- export { P as default, j as isComplete };
328
+ export { P as default, j as isComplete, F as piePackage };
326
329
 
327
330
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/player-events/dist/index.js","../../../src/delivery/session-updater.ts","../../../src/delivery/index.ts"],"sourcesContent":["//#region src/session-notifier.ts\nvar e = \"commitPendingSession\", t = /* @__PURE__ */ new WeakMap();\nfunction n(e, n) {\n\tlet r = t.get(e);\n\tr || (r = /* @__PURE__ */ new Set(), t.set(e, r)), r.add(n);\n}\nfunction r(t) {\n\treturn Object.getOwnPropertyDescriptor(t, e) !== void 0;\n}\nfunction i(t) {\n\tif (r(t)) return;\n\tlet n = t[e];\n\tObject.defineProperty(t, e, {\n\t\tvalue: () => {\n\t\t\tif (typeof n == \"function\") try {\n\t\t\t\tn.call(t);\n\t\t\t} catch {}\n\t\t\to(t);\n\t\t},\n\t\tconfigurable: !0,\n\t\tenumerable: !1,\n\t\twritable: !0\n\t});\n}\nfunction a(e, t, r = {}) {\n\tlet a = r.delayMs, o = typeof a == \"function\" ? a : () => a ?? 0, s = r.maxWaitMs, c = null, l = null, u = !1, d = () => {\n\t\tc !== null && (clearTimeout(c), c = null), l !== null && (clearTimeout(l), l = null);\n\t}, f = () => {\n\t\td(), u && (u = !1, t());\n\t}, p = {\n\t\tnotify() {\n\t\t\tu = !0, c !== null && clearTimeout(c), c = setTimeout(f, Math.max(0, o())), s !== void 0 && l === null && (l = setTimeout(f, Math.max(0, s)));\n\t\t},\n\t\tflush() {\n\t\t\tif (!u) {\n\t\t\t\td();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tf();\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn(\"[session-notifier] a committed session-changed dispatch threw\", e);\n\t\t\t}\n\t\t}\n\t};\n\treturn n(e, p), i(e), p;\n}\nfunction o(e) {\n\tlet n = t.get(e);\n\tif (n) for (let e of [...n]) e.flush();\n}\n//#endregion\n//#region src/index.ts\nvar s = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, c = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { s as ModelSetEvent, e as SESSION_COMMIT_METHOD, c as SessionChangedEvent, a as createSessionNotifier, o as flushSessionNotifiers };\n","// @ts-nocheck\n\nexport function updateSessionValue(session, choiceMode, data) {\n session.value = session.value || [];\n if (choiceMode === 'checkbox') {\n if (data.selected) {\n session.value = Array.from(new Set([...session.value, data.value]));\n } else {\n session.value = session.value.filter(v => v !== data.value);\n }\n }\n\n if (choiceMode === 'radio') {\n if (data.selected) {\n session.value = [data.value];\n } else {\n session.value = [];\n }\n }\n \n //update session value metadata\n session.selector = data.selector; //the input method used to select the choice (e.g. mouse, keyboard)\n}\n\nexport function updateSessionMetadata(session, metadata) {\n session.audioStartTime = session.audioStartTime || metadata.audioStartTime; //timestamp when auto-played audio started playing\n session.audioEndTime = session.audioEndTime || metadata.audioEndTime; //timestamp when auto-played audio completed playing\n \n if(!session.waitTime && session.audioStartTime && session.audioEndTime) {\n // waitTime is elapsed time the user waited for auto-played audio to finish\n session.waitTime = (session.audioEndTime - session.audioStartTime);\n }\n}\n","// @ts-nocheck\n\nimport Main from './main.js';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { debounce } from '@pie-element/shared-lodash';\nimport debug from 'debug';\nimport {\n ModelSetEvent,\n SessionChangedEvent,\n createSessionNotifier,\n flushSessionNotifiers,\n} from '@pie-element/shared-player-events';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport { createUniqueId, EnableAudioAutoplayImage as EnableAudioAutoplayImageImport } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nconst EnableAudioAutoplayImage = unwrapReactInteropSymbol(EnableAudioAutoplayImageImport, 'EnableAudioAutoplayImage') || unwrapReactInteropSymbol(renderUi.EnableAudioAutoplayImage, 'EnableAudioAutoplayImage');\nimport { updateSessionValue, updateSessionMetadata } from './session-updater.js';\nimport { exceedsMaxSelections } from './utils.js';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nconst log = debug('pie-ui:multiple-choice');\n\nexport const isComplete = (session, model, audioComplete, elementContext) => {\n const { completeAudioEnabled } = model || {};\n\n // check audio completion if the setting is enabled and audio actually exists,\n // whether the audio is started by autoplay or by the student\n if (completeAudioEnabled && !audioComplete) {\n if (elementContext) {\n const audio = elementContext.querySelector('audio');\n const isInsidePrompt = audio && audio.closest('.preview-prompt');\n\n // only require audio completion if audio exists and is inside the prompt\n if (audio && isInsidePrompt) {\n return false;\n }\n }\n }\n\n if (!session || !session.value) {\n return false;\n }\n\n const { choiceMode, minSelections = 1, maxSelections } = model || {};\n const selections = session.value.length || 0;\n\n if (choiceMode === 'radio') {\n return !!selections;\n }\n\n if (selections < minSelections || exceedsMaxSelections(selections, maxSelections)) {\n return false;\n }\n\n return true;\n};\n\nfunction getPlayerAttributes(element) {\n const player =\n element.closest('pie-player') ||\n element.closest('pie-item-player');\n\n if (!player) {\n return { baseHeadingLevel: undefined, includeSrHeading: true };\n }\n\n const getRaw = (camelCaseName, hyphenatedName, allLowerName) => {\n let raw = player[camelCaseName];\n\n // fallback in case someone sets via HTML attribute manually\n if (raw == null) {\n raw =\n player.getAttribute(hyphenatedName) ??\n player.getAttribute(allLowerName);\n }\n\n return raw;\n };\n\n const levelRaw = getRaw('baseHeadingLevel', 'base-heading-level', 'baseheadinglevel');\n const level = parseInt(levelRaw, 10);\n const baseHeadingLevel = Number.isFinite(level) && level >= 1 && level <= 6 ? level : undefined;\n\n const srRaw = getRaw('includeSrHeading', 'include-sr-heading', 'includesrheading');\n const includeSrHeading = srRaw == null ? true : srRaw !== false && srRaw !== 'false';\n\n return { baseHeadingLevel, includeSrHeading };\n}\n\n// Resolves heading attributes for a custom element, preferring explicit instance\n// properties (set by a parent element such as EBSR) over player-level attributes.\nfunction resolveHeadingProps(element) {\n const fromPlayer = getPlayerAttributes(element);\n\n return {\n baseHeadingLevel: element._baseHeadingLevel !== undefined ? element._baseHeadingLevel : fromPlayer.baseHeadingLevel,\n includeSrHeading: element._includeSrHeading !== undefined ? element._includeSrHeading : fromPlayer.includeSrHeading,\n };\n}\n\nexport default class MultipleChoice extends HTMLElement {\n /**\n * The AfA PNP 3.0 supports this element takes. A PIE toolkit offers the answer\n * eliminator to an element declaring `answer-masking` and reads its choices\n * from `pieSupportTargets`.\n */\n static pieSupports = Object.freeze(['answer-masking']);\n\n constructor() {\n super();\n this._model = null;\n this._session = null;\n // Choice values the answer eliminator struck out; none can be selected.\n this._eliminatedChoices = new Set();\n this._options = null; // added for ebsr print mode detection\n this.audioComplete = false;\n this._boundHandleKeyDown = this.handleKeyDown.bind(this);\n this._keyboardEventsEnabled = false;\n this._audioInitialized = false;\n this._root = null;\n this._mathObserver = null;\n this._mathRenderPending = false;\n\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n var element = React.createElement(Main, {\n model: this._model,\n session: this._session,\n options: this._options,\n onChoiceChanged: this._onChange.bind(this),\n onShowCorrectToggle: this.onShowCorrectToggle.bind(this),\n eliminatedChoices: [...this._eliminatedChoices],\n ...resolveHeadingProps(this),\n });\n\n //TODO: aria-label is set in the _rerender because we need to change it when the model.choiceMode is updated. Consider revisiting the placement of the aria-label setting in the _rerender\n this.setAttribute(\n 'aria-label',\n translator.t(\n this._model.choiceMode === 'radio'\n ? 'multipleChoice.multipleChoiceQuestion'\n : 'multipleChoice.multipleCorrectAnswerQuestion',\n { lng: this._model.language },\n ),\n );\n this.setAttribute('role', 'region');\n this.setLangAttribute();\n\n this._initMathObserver();\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n\n if (this._model.keyboardEventsEnabled === true && !this._keyboardEventsEnabled) {\n this.enableKeyboardEvents();\n }\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n\n // `_onChange` already wrote the session; only this dispatch is deferred to\n // the next tick, and `disconnectedCallback` flushes it.\n this._sessionNotifier = createSessionNotifier(this, () => {\n this.dispatchEvent(\n new SessionChangedEvent(\n this.tagName.toLowerCase(),\n isComplete(this._session, this._model, this.audioComplete, this),\n ),\n );\n });\n this._dispatchResponseChanged = () => this._sessionNotifier.notify();\n\n this._dispatchModelSet = debounce(\n () => {\n this.dispatchEvent(\n new ModelSetEvent(\n this.tagName.toLowerCase(),\n isComplete(this._session, this._model, this.audioComplete, this),\n this._model !== undefined,\n ),\n );\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n\n _scheduleMathRender: any = () => {\n if (this._mathRenderPending) return;\n this._mathRenderPending = true;\n\n requestAnimationFrame(() => {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n }\n log('render complete - render math');\n renderMath(this);\n this._mathRenderPending = false;\n setTimeout(() => {\n if (this._mathObserver) {\n this._mathObserver.observe(this, { childList: true, subtree: true });\n }\n }, 50);\n });\n };\n\n _initMathObserver() {\n if (this._mathObserver) return;\n this._mathObserver = new MutationObserver(this._scheduleMathRender);\n this._mathObserver.observe(this, { childList: true, subtree: true });\n }\n\n _disconnectMathObserver() {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n this._mathObserver = null;\n }\n }\n\n onShowCorrectToggle() {\n renderMath(this);\n }\n\n setLangAttribute() {\n const language = this._model && typeof this._model.language ? this._model.language : '';\n const lang = language ? language.slice(0, 2) : 'en';\n this.setAttribute('lang', lang);\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n // reset the audioInitialized to false since the model changed, and we might need to reinitialize the audio\n this._audioInitialized = false;\n this._dispatchModelSet();\n }\n\n get session() {\n return this._session;\n }\n\n get options() {\n return this._options;\n }\n\n set options(o) {\n this._options = o;\n this._rerender();\n }\n\n set baseHeadingLevel(level) {\n this._baseHeadingLevel = level;\n this._rerender();\n }\n\n set includeSrHeading(value) {\n this._includeSrHeading = value;\n this._rerender();\n }\n\n set session(s) {\n this._session = s;\n this._rerender();\n }\n\n _onChange(data) {\n if (data.selected && this._eliminatedChoices.has(String(data.value))) {\n return;\n }\n updateSessionValue(this._session, this._model.choiceMode, data);\n this._dispatchResponseChanged();\n this._rerender();\n }\n\n /**\n * The rendered choices, for the `answer-masking` support this element\n * declares. Each id is the choice's value.\n */\n pieSupportTargets(term) {\n if (term !== 'answer-masking') {\n return [];\n }\n\n return Array.from(this.querySelectorAll('.choice-input')).flatMap((container) => {\n const input = container.querySelector('input[type=\"radio\"], input[type=\"checkbox\"]');\n const content = container.querySelector('label');\n if (!input?.value || !content) {\n return [];\n }\n\n const { value } = input;\n return [\n {\n id: value,\n label: (content.querySelector('.prompt-label') ?? content).textContent.trim(),\n container,\n content,\n isSelected: () => this._isChoiceSelected(value),\n isEliminable: () =>\n this._model?.mode === 'gather' && !this._model.disabled && !this._isChoiceSelected(value),\n setEliminated: (eliminated) => this._setChoiceEliminated(value, eliminated),\n },\n ];\n });\n }\n\n _isChoiceSelected(value) {\n return (this._session?.value ?? []).some((selected) => String(selected) === value);\n }\n\n _setChoiceEliminated(value, eliminated) {\n if (eliminated === this._eliminatedChoices.has(value)) {\n return;\n }\n\n if (eliminated) {\n this._eliminatedChoices.add(value);\n } else {\n this._eliminatedChoices.delete(value);\n }\n this._rerender();\n }\n\n _createAudioInfoToast() {\n const info = document.createElement('div');\n // Looked up by its class, which authored CSS may also target; a fixed id repeats when items share a page.\n info.id = createUniqueId('play-audio-info');\n info.className = 'play-audio-info';\n\n Object.assign(info.style, {\n position: 'absolute',\n top: 0,\n width: '100%',\n height: '100%',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n background: 'white',\n zIndex: '1000',\n cursor: 'pointer',\n });\n\n const img = document.createElement('img');\n img.src = EnableAudioAutoplayImage;\n img.alt = 'Click anywhere to enable audio autoplay';\n img.width = 500;\n img.height = 300;\n\n info.appendChild(img);\n return info;\n }\n\n connectedCallback() {\n this._initMathObserver();\n this._initPlayerObserver();\n this._rerender();\n\n // Observation: audio in Chrome will have the autoplay attribute,\n // while other browsers will not have the autoplay attribute and will need a user interaction to play the audio\n // This workaround fixes the issue of audio being cached and played on any user interaction in Safari and Firefox\n const observer = new MutationObserver((mutationsList, observer) => {\n mutationsList.forEach((mutation) => {\n if (mutation.type === 'childList') {\n if (this._audioInitialized) return;\n\n const audio = this.querySelector('audio');\n const isInsidePrompt = audio && audio.closest('.preview-prompt');\n\n if (!this._model) return;\n\n const { autoplayAudioEnabled, completeAudioEnabled } = this._model;\n\n if (!autoplayAudioEnabled && !completeAudioEnabled) return;\n if (audio && !isInsidePrompt) return;\n if (!audio) return;\n\n const info = this._createAudioInfoToast();\n const container = this.querySelector('.main-container');\n const enableAudio = () => {\n if (this.querySelector('.play-audio-info')) {\n audio.play();\n container.removeChild(info);\n }\n\n document.removeEventListener('click', enableAudio);\n };\n\n if (autoplayAudioEnabled) {\n // if the audio is paused, it means the user has not interacted with the page yet and the audio will not play\n // FIX FOR SAFARI: play with a slight delay to check if autoplay was blocked\n setTimeout(() => {\n if (audio.paused && !this.querySelector('.play-audio-info')) {\n // add info message as a toast to enable audio playback\n container.appendChild(info);\n document.addEventListener('click', enableAudio);\n } else {\n document.removeEventListener('click', enableAudio);\n }\n }, 500);\n }\n\n // we need to listen for the playing event to remove the toast in case the audio plays because of re-rendering\n const handlePlaying = () => {\n updateSessionMetadata(this._session, { audioStartTime: new Date().getTime() });\n\n const info = this.querySelector('.play-audio-info');\n if (info) {\n container.removeChild(info);\n }\n\n audio.removeEventListener('playing', handlePlaying);\n };\n\n audio.addEventListener('playing', handlePlaying);\n\n // we need to listen for the ended event to update the isComplete state\n const handleEnded = () => {\n updateSessionMetadata(this._session, { audioEndTime: new Date().getTime() });\n this.audioComplete = true;\n this._dispatchResponseChanged();\n audio.removeEventListener('ended', handleEnded);\n };\n\n audio.addEventListener('ended', handleEnded);\n\n // store references to remove later\n this._audio = audio;\n this._handlePlaying = handlePlaying;\n this._handleEnded = handleEnded;\n this._enableAudio = enableAudio;\n // set to true to prevent multiple initializations\n this._audioInitialized = true;\n\n observer.disconnect();\n }\n });\n });\n\n observer.observe(this, { childList: true, subtree: true });\n }\n\n enableKeyboardEvents() {\n if (!this._keyboardEventsEnabled) {\n window.addEventListener('keydown', this._boundHandleKeyDown);\n this._keyboardEventsEnabled = true;\n }\n }\n\n _initPlayerObserver() {\n const player = this.closest('pie-player') || this.closest('pie-item-player');\n if (!player) return;\n\n this._playerObserver = new MutationObserver(() => {\n this._rerender();\n });\n this._playerObserver.observe(player, {\n attributes: true,\n attributeFilter: ['base-heading-level', 'baseheadinglevel', 'include-sr-heading', 'includesrheading'],\n });\n }\n\n _disconnectPlayerObserver() {\n if (this._playerObserver) {\n this._playerObserver.disconnect();\n this._playerObserver = null;\n }\n }\n\n disconnectedCallback() {\n flushSessionNotifiers(this);\n\n this._disconnectMathObserver();\n this._disconnectPlayerObserver();\n if (this._keyboardEventsEnabled) {\n window.removeEventListener('keydown', this._boundHandleKeyDown);\n this._keyboardEventsEnabled = false;\n }\n\n document.removeEventListener('click', this._enableAudio);\n\n if (this._audio) {\n this._audio.removeEventListener('playing', this._handlePlaying);\n this._audio.removeEventListener('ended', this._handleEnded);\n this._audio = null;\n }\n\n this._rerender.cancel();\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n\n /**\n * Handles global keyboard events for selecting or toggling multiple-choice answers.\n * Maps keys (1-9, 0, a-j, A-J) to choices and updates the session state accordingly.\n * Ensures valid key presses toggle or select the appropriate choice based on the model.\n */\n handleKeyDown(event) {\n if (!this._model || !this._session) {\n return;\n }\n\n const { mode } = this._model;\n if (mode !== 'gather') {\n return;\n }\n\n const keyToIndex = (key) => {\n const numOffset = key >= '1' && key <= '9' ? key - '1' : key === '0' ? 9 : -1;\n const letterOffset = /^[a-jA-J]$/.test(key) ? key.toLowerCase().charCodeAt(0) - 'a'.charCodeAt(0) : -1;\n return numOffset >= 0 ? numOffset : letterOffset;\n };\n\n const choiceIndex = keyToIndex(event.key);\n\n if (choiceIndex === undefined || choiceIndex <= -1 || choiceIndex >= this._model.choices?.length) {\n return;\n }\n\n const currentValue = this._session.value || [];\n const choiceId = this._model.choices[choiceIndex].value;\n\n const alreadySelected = currentValue.includes(choiceId);\n const newValue = {\n value: choiceId,\n selected: this._model.choiceMode === 'radio' ? true : !alreadySelected,\n selector: 'Keyboard',\n };\n\n this._onChange(newValue);\n }\n}\n"],"mappings":";;;;;;mCACI,IAAI,wBAAwB,oBAAoB,I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AI,EAAI,YAAY,CAAC,CAAC,WAAW,CAAC,IAAI,KAAoB;GACpG,OAAO,KAAa,IAAI,IAAY;EACtC,EAEoB,CAAW,EAAM,GAAG;EAExC,IAAI,MAAgB,KAAA,KAAa,KAAe,MAAM,KAAe,KAAK,OAAO,SAAS,QACxF;EAGF,IAAM,IAAe,KAAK,SAAS,SAAS,CAAC,GACvC,IAAW,KAAK,OAAO,QAAQ,EAAY,CAAC,OAE5C,IAAkB,EAAa,SAAS,CAAQ,GAChD,IAAW;GACf,OAAO;GACP,UAAU,KAAK,OAAO,eAAe,WAAiB,CAAC;GACvD,UAAU;EACZ;EAEA,KAAK,UAAU,CAAQ;CACzB;AACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/player-events/dist/index.js","../../../src/delivery/session-updater.ts","../../../src/delivery/index.ts"],"sourcesContent":["//#region src/session-notifier.ts\nvar e = \"commitPendingSession\", t = /* @__PURE__ */ new WeakMap();\nfunction n(e, n) {\n\tlet r = t.get(e);\n\tr || (r = /* @__PURE__ */ new Set(), t.set(e, r)), r.add(n);\n}\nfunction r(t) {\n\treturn Object.getOwnPropertyDescriptor(t, e) !== void 0;\n}\nfunction i(t) {\n\tif (r(t)) return;\n\tlet n = t[e];\n\tObject.defineProperty(t, e, {\n\t\tvalue: () => {\n\t\t\tif (typeof n == \"function\") try {\n\t\t\t\tn.call(t);\n\t\t\t} catch {}\n\t\t\to(t);\n\t\t},\n\t\tconfigurable: !0,\n\t\tenumerable: !1,\n\t\twritable: !0\n\t});\n}\nfunction a(e, t, r = {}) {\n\tlet a = r.delayMs, o = typeof a == \"function\" ? a : () => a ?? 0, s = r.maxWaitMs, c = null, l = null, u = !1, d = () => {\n\t\tc !== null && (clearTimeout(c), c = null), l !== null && (clearTimeout(l), l = null);\n\t}, f = () => {\n\t\td(), u && (u = !1, t());\n\t}, p = {\n\t\tnotify() {\n\t\t\tu = !0, c !== null && clearTimeout(c), c = setTimeout(f, Math.max(0, o())), s !== void 0 && l === null && (l = setTimeout(f, Math.max(0, s)));\n\t\t},\n\t\tflush() {\n\t\t\tif (!u) {\n\t\t\t\td();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tf();\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn(\"[session-notifier] a committed session-changed dispatch threw\", e);\n\t\t\t}\n\t\t}\n\t};\n\treturn n(e, p), i(e), p;\n}\nfunction o(e) {\n\tlet n = t.get(e);\n\tif (n) for (let e of [...n]) e.flush();\n}\n//#endregion\n//#region ../../../node_modules/.bun/@pie-players+pie-context@1.0.0-beta.3/node_modules/@pie-players/pie-context/dist/events.js\nfunction s(e, t, n) {\n\tlet r = t.ownerDocument?.defaultView?.Event ?? Event;\n\treturn Object.assign(new r(e, {\n\t\tbubbles: !0,\n\t\tcomposed: !0\n\t}), n);\n}\nvar c = /* @__PURE__ */ new WeakSet(), l = (e, t) => typeof t == \"object\" && !!t && e.has(t), u = class {\n\tconstructor(e, t, n, r) {\n\t\tlet i = s(\"context-request\", t, {\n\t\t\tcontext: e,\n\t\t\tcontextTarget: t,\n\t\t\tcallback: n,\n\t\t\tsubscribe: r ?? !1\n\t\t});\n\t\treturn c.add(i), i;\n\t}\n\tstatic [Symbol.hasInstance](e) {\n\t\treturn l(c, e);\n\t}\n}, d = (e) => {\n\tlet t = [];\n\tfor (let n of e) n.requestorRef.deref() && n.callbackRef.deref() && t.push(n);\n\treturn t;\n}, f = class {\n\thost;\n\tpendingByContext = /* @__PURE__ */ new Map();\n\tattached = !1;\n\tconstructor(e) {\n\t\tthis.host = e;\n\t}\n\tattach() {\n\t\tthis.attached || (this.attached = !0, this.host.addEventListener(\"context-request\", this.onContextRequest), this.host.addEventListener(\"context-provider\", this.onContextProvider));\n\t}\n\tdetach() {\n\t\tthis.attached && (this.attached = !1, this.host.removeEventListener(\"context-request\", this.onContextRequest), this.host.removeEventListener(\"context-provider\", this.onContextProvider), this.pendingByContext.clear());\n\t}\n\tonContextRequest = (e) => {\n\t\tif (e.cancelBubble) return;\n\t\tlet t = e;\n\t\tif (t.subscribe !== !0 || typeof t.callback != \"function\" || t.context === void 0) return;\n\t\tlet n = t.contextTarget ?? e.composedPath?.()[0];\n\t\tif (!n) return;\n\t\tlet r = this.pendingByContext.get(t.context);\n\t\tr || (r = {\n\t\t\tcallbacks: /* @__PURE__ */ new WeakMap(),\n\t\t\trequests: []\n\t\t}, this.pendingByContext.set(t.context, r));\n\t\tlet i = t.callback, a = r.callbacks.get(n);\n\t\ta || (a = /* @__PURE__ */ new WeakSet(), r.callbacks.set(n, a)), !a.has(i) && (a.add(i), r.requests.push({\n\t\t\trequestorRef: new WeakRef(n),\n\t\t\tcallbackRef: new WeakRef(i)\n\t\t}), r.requests = d(r.requests));\n\t};\n\tonContextProvider = (e) => {\n\t\tlet t = e.context;\n\t\tif (t === void 0) return;\n\t\tlet n = this.pendingByContext.get(t);\n\t\tif (!(!n || n.requests.length === 0)) {\n\t\t\tthis.pendingByContext.delete(t);\n\t\t\tfor (let e of n.requests) {\n\t\t\t\tlet n = e.requestorRef.deref(), r = e.callbackRef.deref();\n\t\t\t\t!n || !r || n.dispatchEvent(new u(t, n, r, !0));\n\t\t\t}\n\t\t}\n\t};\n}, p = Symbol.for(\"pie.context.documentRoot\");\nfunction m(e) {\n\tif (!e) return;\n\tlet t = e;\n\tif (t[p]) return;\n\tlet n = e.documentElement;\n\tif (!n) return;\n\tlet r = new f(n);\n\tr.attach(), t[p] = r;\n}\n//#endregion\n//#region ../../../node_modules/.bun/@pie-players+pie-context@1.0.0-beta.3/node_modules/@pie-players/pie-context/dist/consumer.js\nvar h = class {\n\thost;\n\tcontext;\n\tsubscribe;\n\tonValue;\n\tisConnected = !1;\n\tisDisconnected = !1;\n\tunsubscribe;\n\tcurrentValue;\n\tconstructor(e, t) {\n\t\tthis.host = e, this.context = t.context, this.subscribe = t.subscribe ?? !0, this.onValue = t.onValue;\n\t}\n\tconnect() {\n\t\tthis.isConnected || (this.isConnected = !0, this.isDisconnected = !1, this.subscribe && m(this.host.ownerDocument), this.requestValue());\n\t}\n\tdisconnect() {\n\t\tthis.isConnected && (this.isConnected = !1, this.isDisconnected = !0, this.unsubscribe?.(), this.unsubscribe = void 0);\n\t}\n\tget value() {\n\t\treturn this.currentValue;\n\t}\n\thandleValue = (e, t) => {\n\t\tif (this.isDisconnected) {\n\t\t\tt?.();\n\t\t\treturn;\n\t\t}\n\t\tt !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = t), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = e, this.onValue?.(e);\n\t};\n\trequestValue() {\n\t\tthis.host.dispatchEvent(new u(this.context, this.host, this.handleValue, this.subscribe));\n\t}\n}, g = (e, t, n) => {\n\tlet r = new h(e, {\n\t\tcontext: t,\n\t\tsubscribe: !0,\n\t\tonValue: n\n\t});\n\tr.connect();\n\tlet i = (e) => {\n\t\te.context === t && r.requestValue();\n\t};\n\treturn e.addEventListener(\"context-provider\", i), () => {\n\t\te.removeEventListener(\"context-provider\", i), r.disconnect();\n\t};\n}, _ = ((e) => e)(Symbol.for(\"pie.sessionCommit\")), v = 1500;\nfunction y(e) {\n\treturn typeof e == \"number\" && Number.isFinite(e) && e >= 0 ? e : v;\n}\nfunction b(e, t) {\n\treturn g(e, _, (e) => {\n\t\tt(y(e?.idleSaveDelayMs));\n\t});\n}\n//#endregion\n//#region src/index.ts\nvar x = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, S = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { v as DEFAULT_IDLE_SAVE_DELAY_MS, x as ModelSetEvent, e as SESSION_COMMIT_METHOD, S as SessionChangedEvent, a as createSessionNotifier, o as flushSessionNotifiers, y as resolveIdleSaveDelay, b as subscribeIdleSaveDelay };\n","// @ts-nocheck\n\nexport function updateSessionValue(session, choiceMode, data) {\n session.value = session.value || [];\n if (choiceMode === 'checkbox') {\n if (data.selected) {\n session.value = Array.from(new Set([...session.value, data.value]));\n } else {\n session.value = session.value.filter(v => v !== data.value);\n }\n }\n\n if (choiceMode === 'radio') {\n if (data.selected) {\n session.value = [data.value];\n } else {\n session.value = [];\n }\n }\n \n //update session value metadata\n session.selector = data.selector; //the input method used to select the choice (e.g. mouse, keyboard)\n}\n\nexport function updateSessionMetadata(session, metadata) {\n session.audioStartTime = session.audioStartTime || metadata.audioStartTime; //timestamp when auto-played audio started playing\n session.audioEndTime = session.audioEndTime || metadata.audioEndTime; //timestamp when auto-played audio completed playing\n \n if(!session.waitTime && session.audioStartTime && session.audioEndTime) {\n // waitTime is elapsed time the user waited for auto-played audio to finish\n session.waitTime = (session.audioEndTime - session.audioStartTime);\n }\n}\n","// @ts-nocheck\n\nimport Main from './main.js';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { debounce } from '@pie-element/shared-lodash';\nimport debug from 'debug';\nimport {\n ModelSetEvent,\n SessionChangedEvent,\n createSessionNotifier,\n flushSessionNotifiers,\n} from '@pie-element/shared-player-events';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport { createUniqueId, EnableAudioAutoplayImage as EnableAudioAutoplayImageImport } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nconst EnableAudioAutoplayImage = unwrapReactInteropSymbol(EnableAudioAutoplayImageImport, 'EnableAudioAutoplayImage') || unwrapReactInteropSymbol(renderUi.EnableAudioAutoplayImage, 'EnableAudioAutoplayImage');\nimport { updateSessionValue, updateSessionMetadata } from './session-updater.js';\nimport { exceedsMaxSelections } from './utils.js';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nconst log = debug('pie-ui:multiple-choice');\n\nexport const isComplete = (session, model, audioComplete, elementContext) => {\n const { completeAudioEnabled } = model || {};\n\n // check audio completion if the setting is enabled and audio actually exists,\n // whether the audio is started by autoplay or by the student\n if (completeAudioEnabled && !audioComplete) {\n if (elementContext) {\n const audio = elementContext.querySelector('audio');\n const isInsidePrompt = audio && audio.closest('.preview-prompt');\n\n // only require audio completion if audio exists and is inside the prompt\n if (audio && isInsidePrompt) {\n return false;\n }\n }\n }\n\n if (!session || !session.value) {\n return false;\n }\n\n const { choiceMode, minSelections = 1, maxSelections } = model || {};\n const selections = session.value.length || 0;\n\n if (choiceMode === 'radio') {\n return !!selections;\n }\n\n if (selections < minSelections || exceedsMaxSelections(selections, maxSelections)) {\n return false;\n }\n\n return true;\n};\n\nfunction getPlayerAttributes(element) {\n const player =\n element.closest('pie-player') ||\n element.closest('pie-item-player');\n\n if (!player) {\n return { baseHeadingLevel: undefined, includeSrHeading: true };\n }\n\n const getRaw = (camelCaseName, hyphenatedName, allLowerName) => {\n let raw = player[camelCaseName];\n\n // fallback in case someone sets via HTML attribute manually\n if (raw == null) {\n raw =\n player.getAttribute(hyphenatedName) ??\n player.getAttribute(allLowerName);\n }\n\n return raw;\n };\n\n const levelRaw = getRaw('baseHeadingLevel', 'base-heading-level', 'baseheadinglevel');\n const level = parseInt(levelRaw, 10);\n const baseHeadingLevel = Number.isFinite(level) && level >= 1 && level <= 6 ? level : undefined;\n\n const srRaw = getRaw('includeSrHeading', 'include-sr-heading', 'includesrheading');\n const includeSrHeading = srRaw == null ? true : srRaw !== false && srRaw !== 'false';\n\n return { baseHeadingLevel, includeSrHeading };\n}\n\n// Resolves heading attributes for a custom element, preferring explicit instance\n// properties (set by a parent element such as EBSR) over player-level attributes.\nfunction resolveHeadingProps(element) {\n const fromPlayer = getPlayerAttributes(element);\n\n return {\n baseHeadingLevel: element._baseHeadingLevel !== undefined ? element._baseHeadingLevel : fromPlayer.baseHeadingLevel,\n includeSrHeading: element._includeSrHeading !== undefined ? element._includeSrHeading : fromPlayer.includeSrHeading,\n };\n}\n\nexport default class MultipleChoice extends HTMLElement {\n /**\n * The AfA PNP 3.0 supports this element takes. A PIE toolkit offers the answer\n * eliminator to an element declaring `answer-masking` and reads its choices\n * from `pieSupportTargets`.\n */\n static pieSupports = Object.freeze(['answer-masking']);\n\n constructor() {\n super();\n this._model = null;\n this._session = null;\n // Choice values the answer eliminator struck out; none can be selected.\n this._eliminatedChoices = new Set();\n this._options = null; // added for ebsr print mode detection\n this.audioComplete = false;\n this._boundHandleKeyDown = this.handleKeyDown.bind(this);\n this._keyboardEventsEnabled = false;\n this._audioInitialized = false;\n this._root = null;\n this._mathObserver = null;\n this._mathRenderPending = false;\n\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n var element = React.createElement(Main, {\n model: this._model,\n session: this._session,\n options: this._options,\n onChoiceChanged: this._onChange.bind(this),\n onShowCorrectToggle: this.onShowCorrectToggle.bind(this),\n eliminatedChoices: [...this._eliminatedChoices],\n ...resolveHeadingProps(this),\n });\n\n //TODO: aria-label is set in the _rerender because we need to change it when the model.choiceMode is updated. Consider revisiting the placement of the aria-label setting in the _rerender\n this.setAttribute(\n 'aria-label',\n translator.t(\n this._model.choiceMode === 'radio'\n ? 'multipleChoice.multipleChoiceQuestion'\n : 'multipleChoice.multipleCorrectAnswerQuestion',\n { lng: this._model.language },\n ),\n );\n this.setAttribute('role', 'region');\n this.setLangAttribute();\n\n this._initMathObserver();\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n\n if (this._model.keyboardEventsEnabled === true && !this._keyboardEventsEnabled) {\n this.enableKeyboardEvents();\n }\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n\n // `_onChange` already wrote the session; only this dispatch is deferred to\n // the next tick, and `disconnectedCallback` flushes it.\n this._sessionNotifier = createSessionNotifier(this, () => {\n this.dispatchEvent(\n new SessionChangedEvent(\n this.tagName.toLowerCase(),\n isComplete(this._session, this._model, this.audioComplete, this),\n ),\n );\n });\n this._dispatchResponseChanged = () => this._sessionNotifier.notify();\n\n this._dispatchModelSet = debounce(\n () => {\n this.dispatchEvent(\n new ModelSetEvent(\n this.tagName.toLowerCase(),\n isComplete(this._session, this._model, this.audioComplete, this),\n this._model !== undefined,\n ),\n );\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n\n _scheduleMathRender: any = () => {\n if (this._mathRenderPending) return;\n this._mathRenderPending = true;\n\n requestAnimationFrame(() => {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n }\n log('render complete - render math');\n renderMath(this);\n this._mathRenderPending = false;\n setTimeout(() => {\n if (this._mathObserver) {\n this._mathObserver.observe(this, { childList: true, subtree: true });\n }\n }, 50);\n });\n };\n\n _initMathObserver() {\n if (this._mathObserver) return;\n this._mathObserver = new MutationObserver(this._scheduleMathRender);\n this._mathObserver.observe(this, { childList: true, subtree: true });\n }\n\n _disconnectMathObserver() {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n this._mathObserver = null;\n }\n }\n\n onShowCorrectToggle() {\n renderMath(this);\n }\n\n setLangAttribute() {\n const language = this._model && typeof this._model.language ? this._model.language : '';\n const lang = language ? language.slice(0, 2) : 'en';\n this.setAttribute('lang', lang);\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n // reset the audioInitialized to false since the model changed, and we might need to reinitialize the audio\n this._audioInitialized = false;\n this._dispatchModelSet();\n }\n\n get session() {\n return this._session;\n }\n\n get options() {\n return this._options;\n }\n\n set options(o) {\n this._options = o;\n this._rerender();\n }\n\n set baseHeadingLevel(level) {\n this._baseHeadingLevel = level;\n this._rerender();\n }\n\n set includeSrHeading(value) {\n this._includeSrHeading = value;\n this._rerender();\n }\n\n set session(s) {\n this._session = s;\n this._rerender();\n }\n\n _onChange(data) {\n if (data.selected && this._eliminatedChoices.has(String(data.value))) {\n return;\n }\n updateSessionValue(this._session, this._model.choiceMode, data);\n this._dispatchResponseChanged();\n this._rerender();\n }\n\n /**\n * The rendered choices, for the `answer-masking` support this element\n * declares. Each id is the choice's value.\n */\n pieSupportTargets(term) {\n if (term !== 'answer-masking') {\n return [];\n }\n\n return Array.from(this.querySelectorAll('.choice-input')).flatMap((container) => {\n const input = container.querySelector('input[type=\"radio\"], input[type=\"checkbox\"]');\n const content = container.querySelector('label');\n if (!input?.value || !content) {\n return [];\n }\n\n const { value } = input;\n return [\n {\n id: value,\n label: (content.querySelector('.prompt-label') ?? content).textContent.trim(),\n container,\n content,\n isSelected: () => this._isChoiceSelected(value),\n isEliminable: () =>\n this._model?.mode === 'gather' && !this._model.disabled && !this._isChoiceSelected(value),\n setEliminated: (eliminated) => this._setChoiceEliminated(value, eliminated),\n },\n ];\n });\n }\n\n _isChoiceSelected(value) {\n return (this._session?.value ?? []).some((selected) => String(selected) === value);\n }\n\n _setChoiceEliminated(value, eliminated) {\n if (eliminated === this._eliminatedChoices.has(value)) {\n return;\n }\n\n if (eliminated) {\n this._eliminatedChoices.add(value);\n } else {\n this._eliminatedChoices.delete(value);\n }\n this._rerender();\n }\n\n _createAudioInfoToast() {\n const info = document.createElement('div');\n // Looked up by its class, which authored CSS may also target; a fixed id repeats when items share a page.\n info.id = createUniqueId('play-audio-info');\n info.className = 'play-audio-info';\n\n Object.assign(info.style, {\n position: 'absolute',\n top: 0,\n width: '100%',\n height: '100%',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n background: 'white',\n zIndex: '1000',\n cursor: 'pointer',\n });\n\n const img = document.createElement('img');\n img.src = EnableAudioAutoplayImage;\n img.alt = 'Click anywhere to enable audio autoplay';\n img.width = 500;\n img.height = 300;\n\n info.appendChild(img);\n return info;\n }\n\n connectedCallback() {\n this._initMathObserver();\n this._initPlayerObserver();\n this._rerender();\n\n // Observation: audio in Chrome will have the autoplay attribute,\n // while other browsers will not have the autoplay attribute and will need a user interaction to play the audio\n // This workaround fixes the issue of audio being cached and played on any user interaction in Safari and Firefox\n const observer = new MutationObserver((mutationsList, observer) => {\n mutationsList.forEach((mutation) => {\n if (mutation.type === 'childList') {\n if (this._audioInitialized) return;\n\n const audio = this.querySelector('audio');\n const isInsidePrompt = audio && audio.closest('.preview-prompt');\n\n if (!this._model) return;\n\n const { autoplayAudioEnabled, completeAudioEnabled } = this._model;\n\n if (!autoplayAudioEnabled && !completeAudioEnabled) return;\n if (audio && !isInsidePrompt) return;\n if (!audio) return;\n\n const info = this._createAudioInfoToast();\n const container = this.querySelector('.main-container');\n const enableAudio = () => {\n if (this.querySelector('.play-audio-info')) {\n audio.play();\n container.removeChild(info);\n }\n\n document.removeEventListener('click', enableAudio);\n };\n\n if (autoplayAudioEnabled) {\n // if the audio is paused, it means the user has not interacted with the page yet and the audio will not play\n // FIX FOR SAFARI: play with a slight delay to check if autoplay was blocked\n setTimeout(() => {\n if (audio.paused && !this.querySelector('.play-audio-info')) {\n // add info message as a toast to enable audio playback\n container.appendChild(info);\n document.addEventListener('click', enableAudio);\n } else {\n document.removeEventListener('click', enableAudio);\n }\n }, 500);\n }\n\n // we need to listen for the playing event to remove the toast in case the audio plays because of re-rendering\n const handlePlaying = () => {\n updateSessionMetadata(this._session, { audioStartTime: new Date().getTime() });\n\n const info = this.querySelector('.play-audio-info');\n if (info) {\n container.removeChild(info);\n }\n\n audio.removeEventListener('playing', handlePlaying);\n };\n\n audio.addEventListener('playing', handlePlaying);\n\n // we need to listen for the ended event to update the isComplete state\n const handleEnded = () => {\n updateSessionMetadata(this._session, { audioEndTime: new Date().getTime() });\n this.audioComplete = true;\n this._dispatchResponseChanged();\n audio.removeEventListener('ended', handleEnded);\n };\n\n audio.addEventListener('ended', handleEnded);\n\n // store references to remove later\n this._audio = audio;\n this._handlePlaying = handlePlaying;\n this._handleEnded = handleEnded;\n this._enableAudio = enableAudio;\n // set to true to prevent multiple initializations\n this._audioInitialized = true;\n\n observer.disconnect();\n }\n });\n });\n\n observer.observe(this, { childList: true, subtree: true });\n }\n\n enableKeyboardEvents() {\n if (!this._keyboardEventsEnabled) {\n window.addEventListener('keydown', this._boundHandleKeyDown);\n this._keyboardEventsEnabled = true;\n }\n }\n\n _initPlayerObserver() {\n const player = this.closest('pie-player') || this.closest('pie-item-player');\n if (!player) return;\n\n this._playerObserver = new MutationObserver(() => {\n this._rerender();\n });\n this._playerObserver.observe(player, {\n attributes: true,\n attributeFilter: ['base-heading-level', 'baseheadinglevel', 'include-sr-heading', 'includesrheading'],\n });\n }\n\n _disconnectPlayerObserver() {\n if (this._playerObserver) {\n this._playerObserver.disconnect();\n this._playerObserver = null;\n }\n }\n\n disconnectedCallback() {\n flushSessionNotifiers(this);\n\n this._disconnectMathObserver();\n this._disconnectPlayerObserver();\n if (this._keyboardEventsEnabled) {\n window.removeEventListener('keydown', this._boundHandleKeyDown);\n this._keyboardEventsEnabled = false;\n }\n\n document.removeEventListener('click', this._enableAudio);\n\n if (this._audio) {\n this._audio.removeEventListener('playing', this._handlePlaying);\n this._audio.removeEventListener('ended', this._handleEnded);\n this._audio = null;\n }\n\n this._rerender.cancel();\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n\n /**\n * Handles global keyboard events for selecting or toggling multiple-choice answers.\n * Maps keys (1-9, 0, a-j, A-J) to choices and updates the session state accordingly.\n * Ensures valid key presses toggle or select the appropriate choice based on the model.\n */\n handleKeyDown(event) {\n if (!this._model || !this._session) {\n return;\n }\n\n const { mode } = this._model;\n if (mode !== 'gather') {\n return;\n }\n\n const keyToIndex = (key) => {\n const numOffset = key >= '1' && key <= '9' ? key - '1' : key === '0' ? 9 : -1;\n const letterOffset = /^[a-jA-J]$/.test(key) ? key.toLowerCase().charCodeAt(0) - 'a'.charCodeAt(0) : -1;\n return numOffset >= 0 ? numOffset : letterOffset;\n };\n\n const choiceIndex = keyToIndex(event.key);\n\n if (choiceIndex === undefined || choiceIndex <= -1 || choiceIndex >= this._model.choices?.length) {\n return;\n }\n\n const currentValue = this._session.value || [];\n const choiceId = this._model.choices[choiceIndex].value;\n\n const alreadySelected = currentValue.includes(choiceId);\n const newValue = {\n value: choiceId,\n selected: this._model.choiceMode === 'radio' ? true : !alreadySelected,\n selector: 'Keyboard',\n };\n\n this._onChange(newValue);\n }\n}\n"],"mappings":";;;;;;mCACI,IAAI,wBAAwB,oBAAoB,IAAI,QAAQ;AAChE,SAAS,EAAE,GAAG,GAAG;CAChB,IAAI,IAAI,EAAE,IAAI,CAAC;CACf,MAAM,oBAAoB,IAAI,IAAI,GAAG,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;AAC3D;AACA,SAAS,EAAE,GAAG;CACb,OAAO,OAAO,yBAAyB,GAAG,CAAC,MAAM,KAAK;AACvD;AACA,SAAS,EAAE,GAAG;CACb,IAAI,EAAE,CAAC,GAAG;CACV,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Q,GAChD,IAAW;GACf,OAAO;GACP,UAAU,KAAK,OAAO,eAAe,WAAiB,CAAC;GACvD,UAAU;EACZ;EAEA,KAAK,UAAU,CAAQ;CACzB;AACF"}
@@ -7840,7 +7840,7 @@ var sm;
7840
7840
  function cm() {
7841
7841
  return sm;
7842
7842
  }
7843
- var lm = import("./mathjax-CptWnMbQ-DaM-nUQj.js");
7843
+ var lm = import("./mathjax-CptWnMbQ-UoBFHQRx.js");
7844
7844
  lm.catch(() => {});
7845
7845
  async function um(e, t) {
7846
7846
  let { createMathJax: n } = await lm;
@@ -8562,7 +8562,9 @@ var Zh = {
8562
8562
  overarc: "\\overparen",
8563
8563
  napprox: "\\not\\approx",
8564
8564
  longdiv: "\\enclose{longdiv}",
8565
- abs: ["\\left|#1\\right|", 1]
8565
+ abs: ["\\left|#1\\right|", 1],
8566
+ perpendicular: "\\perp",
8567
+ divide: "\\div"
8566
8568
  }, Qh = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)", $h = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/, eg = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/, tg = /\\embed\{newLine\}\[\]/g, ng = [
8567
8569
  ["$$", "$$"],
8568
8570
  ["$", "$"],
@@ -13693,4 +13695,4 @@ var cx = /*#__PURE__*/ l(ex, { checked: !0 }), lx = /*#__PURE__*/ l(ex, {}), ux
13693
13695
  //#endregion
13694
13696
  export { Rf as $, iv as A, Ps as At, qp as B, Cr as Bt, ly as C, Uu as Ct, Lv as D, Y as Dt, Yv as E, Us as Et, Yg as F, Ta as Ft, tp as G, ne as Gt, Ep as H, cr as Ht, om as I, da as It, Zf as J, b as Jt, ep as K, D as Kt, am as L, ua as Lt, Q_ as M, jo as Mt, qg as N, ro as Nt, Tv as O, Is as Ot, Jg as P, Ya as Pt, Hf as Q, $p as R, W as Rt, uy as S, fd as St, Zv as T, lc as Tt, mp as U, dt as Ut, Np as V, sr as Vt, rp as W, L as Wt, Yf as X, w as Xt, Xf as Y, S as Yt, Q as Z, C as Zt, jy as _, yd as _t, Eb as a, ff as at, xy as b, gd as bt, gb as c, zd as ct, Zy as d, kd as dt, Df as et, Xy as f, Dd as ft, By as g, bd as gt, Vy as h, xd as ht, Mb as i, pf as it, rv as j, Ms as jt, xv as k, Fs as kt, hb as l, Fd as lt, Jy as m, Sd as mt, Jb as n, Sf as nt, yb as o, ef as ot, Yy as p, Od as pt, Qf as q, y as qt, Lb as r, yf as rt, _b as s, $d as st, ux as t, Ef as tt, tb as u, Pd as ut, Oy as v, vd as vt, sy as w, vc as wt, dy as x, md as xt, Cy as y, _d as yt, Pp as z, Pr as zt };
13695
13697
 
13696
- //# sourceMappingURL=Radio-B6E6ZX8F.js.map
13698
+ //# sourceMappingURL=Radio-DK9vJMgO.js.map