@pie-players/pie-section-player 0.3.75 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +845 -964
- package/custom-elements.json +3922 -0
- package/dist/browser/assets/{evaluation-worker-CORp9m0K.js → evaluation-worker-0xRDVTJx.js} +82215 -73234
- package/dist/browser/chunks/ToolCoordinator-0a6c4088.js +1 -0
- package/dist/browser/chunks/attribute-coercion-b93b482c.js +1 -0
- package/dist/browser/chunks/calculator-element-271c142f.js +8 -9
- package/dist/browser/chunks/catalog-context-46d3e50e.js +1 -1
- package/dist/browser/chunks/classPrivateFieldGet2-338e0179.js +1 -1
- package/dist/browser/chunks/classPrivateMethodInitSpec-563cd0a5.js +1 -0
- package/dist/browser/chunks/custom-element-define-2a92deb0.js +1 -0
- package/dist/browser/chunks/dist-41b39e7f.js +1 -1
- package/dist/browser/chunks/dist-ca9b9622.js +1 -1
- package/dist/browser/chunks/focus-trap-44913bf3.js +1 -1
- package/dist/browser/chunks/math-rendering-ready-9a0fd90a.js +1 -1
- package/dist/browser/chunks/mathjax-BKrHE4xs-3ca05bf6.js +1 -1
- package/dist/browser/chunks/nl-NL-364d61b9.js +1 -1
- package/dist/browser/chunks/nl-NL-8b7e6d4b.js +1 -1
- package/dist/browser/chunks/pie-api-client-687c319a.js +1 -1
- package/dist/browser/chunks/provider-4c704118.js +1 -1
- package/dist/browser/chunks/runtime-YFqnU6ic-d5c0cb49.js +8605 -0
- package/dist/browser/chunks/{src-BcptuNS5-ed25d7fd.js → src-D_1goyPT-8cca0246.js} +81 -82
- package/dist/browser/chunks/{sre-engine-jd8cc08x-42d270e5.js → sre-engine-bj997w4b-891a4cbe.js} +1 -1
- package/dist/browser/chunks/term-lookup-632cf6b1.js +1 -0
- package/dist/browser/chunks/tool-annotation-toolbar-997438b4.js +5 -5
- package/dist/browser/chunks/tool-answer-eliminator-35483abd.js +6 -6
- package/dist/browser/chunks/tool-color-scheme-b7de5cdf.js +5 -5
- package/dist/browser/chunks/tool-dictionary-cecff3b4.js +3 -3
- package/dist/browser/chunks/tool-graph-cb0338e8.js +6 -6
- package/dist/browser/chunks/tool-host-contract-fae1c415.js +1 -0
- package/dist/browser/chunks/tool-instance-id-76ac45e2.js +1 -0
- package/dist/browser/chunks/tool-line-reader-f8ef3c6a.js +3 -3
- package/dist/browser/chunks/tool-periodic-table-43b133b8.js +13 -16
- package/dist/browser/chunks/tool-picture-dictionary-33721e91.js +3 -3
- package/dist/browser/chunks/tool-protractor-23f77028.js +6 -6
- package/dist/browser/chunks/tool-ruler-1d9a03a6.js +12 -9
- package/dist/browser/chunks/tool-tts-inline-98c2ce7a.js +24 -30
- package/dist/browser/chunks/toolbar-registration-helpers-a7ab1ad4.js +194 -0
- package/dist/browser/pie-section-player.js +61 -65
- package/dist/chunks/nl-NL-364d61b9.js +34 -6
- package/dist/chunks/{sre-engine-jd8cc08x-42d270e5.js → sre-engine-bj997w4b-891a4cbe.js} +1 -1
- package/dist/component-definitions.d.ts +0 -2
- package/dist/components/shared/card-media-region.d.ts +3 -4
- package/dist/components/shared/framework-error-latch.d.ts +4 -2
- package/dist/components/shared/missing-tool-providers.d.ts +0 -6
- package/dist/components/shared/player-preload.d.ts +4 -9
- package/dist/components/shared/section-player-card-context.d.ts +0 -3
- package/dist/components/shared/section-player-host-runtime.d.ts +0 -2
- package/dist/components/shared/section-player-view-state.d.ts +0 -1
- package/dist/controllers/SectionController.d.ts +20 -6
- package/dist/pie-section-player.js +10987 -11045
- package/package.json +11 -9
- package/dist/browser/chunks/ToolCoordinator-cc2dc319.js +0 -1
- package/dist/browser/chunks/runtime-wcU7KOFU-ac86d7b8.js +0 -8536
- package/dist/browser/chunks/tool-host-contract-b93b482c.js +0 -1
- package/dist/browser/chunks/tool-instance-id-2a92deb0.js +0 -1
- package/dist/browser/chunks/tts-runtime-config-a7ab1ad4.js +0 -194
- /package/dist/browser/chunks/{ItemToolBar-jx38w99s-58defccc.js → ItemToolBar-66hcwmfw-3bcb82a3.js} +0 -0
- /package/dist/chunks/{ItemToolBar-jx38w99s-1287ba31.js → ItemToolBar-66hcwmfw-1287ba31.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var r={load:{method:"POST",path:"/api/player/load"},saveSession:{method:"POST",path:"/api/player/save"},model:{method:"POST",path:"/api/player/model"},score:{method:"POST",path:"/api/player/score"}};function w(t){return t?t.endsWith("/")?t.slice(0,-1):t:""}function d(t,n){return t?typeof t=="string"?{method:n.method,path:t}:{method:t.method??n.method,path:t.path}:n}function l(t,n){return/^https?:\/\//i.test(n)?n:`${w(t)}${n.startsWith("/")?n:`/${n}`}`}async function u(t,n){const e=t??n;if(!e)return null;if(typeof e.getToken=="function"){const s=await e.getToken();return s?String(s):null}return e.token?String(e.token):null}function p(t){const n=t?.overrides;return n&&Object.keys(n).length>0?n:void 0}var S=65536;function k(t){return(typeof TextEncoder<"u"?new TextEncoder().encode(t).length:t.length)>S}function b(t){if(!t||typeof t!="object")return"";const{error:n,message:e}=t;return typeof n=="string"&&n?n:typeof e=="string"&&e?e:""}async function c(t,n,e,s,o,i){const a=JSON.stringify(e??{}),f=i?.keepalive===!0&&!k(a),m=typeof AbortController<"u"?new AbortController:null,y=!f&&typeof s?.timeoutMs=="number"&&s.timeoutMs>0?s.timeoutMs:0,h=m&&y>0?setTimeout(()=>m.abort(),y):null;try{const g={"content-type":"application/json","x-date":String(Date.now()),...s?.headers||{}};o&&(g.authorization=`Bearer ${o}`);const v=await fetch(t,{method:n,headers:g,body:a,signal:h?m?.signal:void 0,keepalive:f}),I=await v.json().catch(()=>null);if(!v.ok)throw new Error(b(I)||`Backend request failed with status ${v.status}`);return I}finally{h&&clearTimeout(h)}}async function O(t,n,e){const s=d(t.endpoints?.load,r.load),o=await u(t.auth,n);return c(l(t.baseUrl,s.path),s.method,{itemId:e.itemId,sessionId:e.sessionId,assignmentId:e.assignmentId,env:e.env,overrides:p(e.requestOptions)},t.request,o)}async function T(t,n,e,s){const o=d(t.endpoints?.saveSession,r.saveSession),i=await u(t.auth,n),a=e.session.id||e.sessionId;return c(l(t.baseUrl,o.path),o.method,{sessionId:a,data:e.session.data,env:e.env,itemId:e.itemId,assignmentId:e.assignmentId,models:e.models,passageModels:e.passageModels,overrides:p(e.requestOptions)},t.request,i,{keepalive:s?.keepalive===!0})}async function q(t,n,e){const s=d(t.endpoints?.model,r.model),o=await u(t.auth,n),i=e.session.id||e.sessionId,a=i?{sessionId:i}:{itemId:e.itemId,assignmentId:e.assignmentId};return c(l(t.baseUrl,s.path),s.method,{...a,data:e.session.data,env:e.env,models:e.models,passageModels:e.passageModels,overrides:p(e.requestOptions)},t.request,o)}async function M(t,n,e){const s=d(t.endpoints?.score,r.score),o=await u(t.auth,n),i=e.session.id||e.sessionId;return c(l(t.baseUrl,s.path),s.method,{...e.options,sessionId:i,data:e.session.data,env:e.env,itemId:e.itemId,assignmentId:e.assignmentId,overrides:p(e.requestOptions)},t.request,o)}export{O as callPieApiDeliveryLoad,q as callPieApiDeliveryModel,T as callPieApiDeliverySave,M as callPieApiDeliveryScore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as s}from"./defineProperty-a20a667d.js";function r(o){return o?o.trim().replace(/_/g,"-").split(/[.@]/)[0].toLowerCase():""}function v(o){const t=r(o);if(!t)return[];const e=t.split("-"),i=[];for(let a=e.length;a>0;a--){const n=e.slice(0,a);n.length>1&&n[n.length-1].length===1||i.push(n.join("-"))}return i}function w(o,t){for(const e of v(o)){const i=t.find(a=>r(a)===e);if(i!=null)return i}}var f={common:{close:"Close",cancel:"Cancel",save:"Save",reset:"Reset",retry:"Retry",back:"Back",next:"Next",previous:"Previous",submit:"Submit",continue:"Continue",finish:"Finish",yes:"Yes",no:"No",ok:"OK",any:"Any",off:"Off",auto:"Auto",all:"All",none:"None",loading:"Loading…",error:"Error",settings:"Settings",language:"Language",theme:"Theme",preview:"Preview",author:"Author",unknown:"Unknown",untitled:"Untitled",apply:"Apply",enabled:"Enabled",disabled:"Disabled",closeA11y:"Close",settingsA11y:"Open settings menu"},player:{passage:"Passage",passages:"Passages",question:"Question",questionNumbered:"Question {position}",questions:"Questions",items:"Items",section:"Section",loadingSection:"Loading section content…",sectionLoadError:"Section content could not be loaded.",loadingPassage:"Loading passage content…",configurationError:"Configuration Error",playerError:"Player Error",authoringBackendError:"Authoring Backend Configuration Error",itemLoadError:"Question could not be loaded.",sectionTabsA11y:"Section content tabs",passagesRegionA11y:"Passages",itemsRegionA11y:"Items",sectionToolsA11y:"Section tools",scrollDownA11y:"Scroll down",resizePanels:"Resize panels",resizePassagesAndItemsA11y:"Resize passages and items panels",resizeMediaRegion:"Resize media region",resizeQuestionAndMediaA11y:"Resize question and media panels",resizePassageAndMediaA11y:"Resize passage and media panels",assessment:{sectionPosition:"Section {position} of {total}",noSections:"No sections",loadFailed:"The assessment could not be loaded. Try again.",restoreFailed:"Your saved answers for this section could not be restored. Try again."},formative:{checkAnswer:"Check answer",tryAgain:"Try again",answerRecorded:"Answer recorded.",correct:"Correct.",partlyCorrect:"Partly correct.",notCorrect:"Not correct.",notAutoScored:"Answer recorded. This question is not scored automatically.",checkFailed:"This question could not be checked. Try again.",triesLeft:{one:"{count} try left.",other:"{count} tries left."}},timedMedia:{waitingForMedia:"Questions will appear as the media plays.",questionAvailable:"Question {position} is now available.",playbackPaused:"Playback paused. Answer question {position} to continue.",playbackAdvisory:"Answer question {position} before continuing with the media.",playbackReleased:"Answer accepted. Continue playing the media."}},toolkit:{toolsA11y:"Assessment tools",toolbarInitError:"Unable to initialize assessment toolkit.",settingsTitle:"Settings",closeSettingsA11y:"Close settings",dragPanelA11y:"Drag panel",closePanelA11y:"Close panel",resizeWindow:"Resize window",minimize:"Minimize",maximize:"Maximize",minimizePanelA11y:"Minimize panel",maximizePanelA11y:"Maximize panel",window:{moveLeftA11y:"Move tool left",moveRightA11y:"Move tool right",moveUpA11y:"Move tool up",moveDownA11y:"Move tool down",shrinkA11y:"Shrink tool window",growA11y:"Grow tool window",centerA11y:"Center tool window",closeA11y:"Close tool"},placement:{controlsA11y:"Move and rotate",rotateClockwiseA11y:"Rotate {degrees}° clockwise",rotateCounterclockwiseA11y:"Rotate {degrees}° counterclockwise"},announce:{movedUp:"Moved up to {position}",movedDown:"Moved down to {position}",movedLeft:"Moved left to {position}",movedRight:"Moved right to {position}",rotatedTo:"Rotated to {degrees} degrees"}},tools:{calculator:{name:"Calculator",nameBasic:"Basic Calculator",nameScientific:"Scientific Calculator",nameGraphing:"Graphing Calculator",description:"Multi-type calculator (basic, scientific, graphing)",openedBasic:"Basic calculator opened",openedScientific:"Scientific calculator opened",openedGraphing:"Graphing calculator opened",closedBasic:"Basic calculator closed",closedScientific:"Scientific calculator closed",closedGraphing:"Graphing calculator closed",toolA11y:"Calculator tool",loading:"Loading calculator…",providerUnavailable:"The calculator is unavailable."},graph:{name:"Graph",description:"Coordinate plane",buttonA11y:"Graph, coordinate plane",tooltip:"Graph",toolA11y:"Graph tool — draw points and lines on a coordinate grid",canvasA11y:"Graph canvas — use tools to add points and draw lines",grid:"Grid:",gridOpacityA11y:"Grid opacity",pointA11y:"Graph point {id}",modeSelector:"Selector",modeSelectorHint:"Selector: click and drag points to move them or associated lines.",modePoint:"Point",modePointHint:"Point: click on the grid to add points.",modeLine:"Line",modeLineHint:"Line: click a starting point, then an ending point to draw a line.",modeDelete:"Delete",modeDeleteHint:"Delete: click on a point to delete it and any connected lines."},periodicTable:{name:"Periodic Table",description:"Chemistry periodic table reference",buttonA11y:"Periodic Table, chemistry reference",tooltip:"Periodic Table",toolA11y:"Periodic table — select an element to view its details",elementsA11y:"Periodic table elements",showAllA11y:"Show all elements",allElements:"All Elements",atomicMass:"Atomic Mass",atomicNumber:"Atomic No",electronConfig:"Electron Config",phase:"Phase",filterByA11y:"Filter by {category}",elementA11y:"{name}, Symbol: {symbol}, Atomic number: {number}, Atomic mass: {mass}, Category: {category}",outsideFilterA11y:", outside the current filter",category:{unknown:"Unknown",alkaliMetal:"Alkali Metal",alkalineEarthMetal:"Alkaline Earth Metal",transitionMetal:"Transition Metal",postTransitionMetal:"Post-transition Metal",metalloid:"Metalloid",diatomicNonmetal:"Diatomic Nonmetal",polyatomicNonmetal:"Polyatomic Nonmetal",nobleGas:"Noble Gas",lanthanide:"Lanthanide",actinide:"Actinide"}},ruler:{name:"Ruler",description:"On-screen ruler for measurements",buttonA11y:"Ruler",tooltip:"Ruler",toolA11y:"Draggable and rotatable ruler measurement tool",unitSelectionA11y:"Ruler unit selection",inches:"Inches",centimeters:"Centimeters",inchesInSentence:"inches",centimetersInSentence:"centimeters",switchToInchesA11y:"Switch to inches",switchToCentimetersA11y:"Switch to centimeters",switchedTo:"Switched to {unit}",applicationA11y:"Ruler tool. Use arrow keys to move, Shift+arrows to rotate, PageUp or PageDown for fine rotation, U to toggle units. Current unit: {unit}",imageAlt:"Ruler showing {unit}"},protractor:{name:"Protractor",description:"On-screen protractor for angle measurements",buttonA11y:"Protractor",tooltip:"Protractor",toolA11y:"Protractor tool. Use arrow keys to move, Shift+arrows to rotate, and PageUp or PageDown for fine rotation.",roleA11y:"Draggable and rotatable protractor measurement tool",imageAlt:"Protractor with 180-degree semicircular scale marked from 0 to 180 degrees in both directions, with degree markings every 10 degrees"},dictionary:{name:"Dictionary",description:"Look up word definitions",buttonA11y:"Dictionary, look up word definitions",tooltip:"Dictionary",toolA11y:"Dictionary"},pictureDictionary:{name:"Picture Dictionary",description:"Look up pictures for words",buttonA11y:"Picture Dictionary, look up pictures for words",tooltip:"Picture Dictionary",toolA11y:"Picture Dictionary"},dictionarySpanish:{name:"Spanish Dictionary",description:"Look up word definitions in Spanish",buttonA11y:"Spanish Dictionary, look up word definitions in Spanish",tooltip:"Spanish Dictionary",toolA11y:"Spanish Dictionary"},pictureDictionarySpanish:{name:"Spanish Picture Dictionary",description:"Look up pictures for words in Spanish",buttonA11y:"Spanish Picture Dictionary, look up pictures for words in Spanish",tooltip:"Spanish Picture Dictionary",toolA11y:"Spanish Picture Dictionary"},lineReader:{name:"Line Reader",description:"Reading guide overlay",buttonA11y:"Line Reader, reading guide",tooltip:"Line Reader",roleA11y:"Draggable and resizable reading guide overlay",close:"Close line reader",resizeWindowA11y:"Drag to resize the reading window",resizeFrameA11y:"Drag to resize the frame and window width",windowHeightAnnounce:"Reading window height {pixels} pixels",frameHeightAnnounce:"Frame height {pixels} pixels",widthAnnounce:"Width {pixels} pixels",applicationA11y:"Line Reader tool. A clear reading window inside an obscuring frame. Use arrow keys to move, +/- to resize the reading window, Escape to close. Reading window height: {paneHeight} pixels, Frame height: {frameHeight} pixels",resizeWindowFullA11y:"Resize the reading window. Drag, or use the up and down arrow keys to change its height. Current height {paneHeight} pixels",resizeFrameFullA11y:"Resize the frame. Drag, or use the up and down arrow keys to change the frame height and the left and right arrow keys to change the width. Current frame height {frameHeight} pixels, width {width} pixels"},answerEliminator:{name:"Answer Eliminator",description:"Strike through answer choices",buttonA11y:"Strike Through, eliminate answer choices",tooltip:"Strike Through"},highlighter:{name:"Highlighter",description:"Highlight and annotate text",buttonA11y:"Highlight text",tooltip:"Highlight"},annotationToolbar:{name:"Annotation",description:"Highlight and annotate text",buttonA11y:"Annotate, highlight and mark up text",tooltip:"Annotate",toolbarA11y:"Text annotation toolbar",underline:"Underline",underlineA11y:"Underline selected text",readAloud:"Read Aloud",readAloudA11y:"Read selected text aloud",remove:"Remove",removeA11y:"Remove this annotation",clearAll:"Clear All",clearAllA11y:"Clear all annotations from document",highlightYellowA11y:"Yellow highlight",highlightPinkA11y:"Pink highlight",highlightBlueA11y:"Blue highlight",highlightGreenA11y:"Green highlight"},theme:{name:"Theme",description:"Accessible themes and contrast",buttonA11y:"Theme, change colors and contrast",tooltip:"Theme",selectorA11y:"Theme selector",hint:"Select a theme to improve readability and reduce eye strain.",selectA11y:"Select theme",selectCurrentA11y:"Select theme. Current theme: {name}",optionUnavailableA11y:"{name}, unavailable",unavailableName:"Unavailable theme: {id}",unavailableDescription:"PIE's managed base theme remains active until this theme becomes available again.",unavailableStatus:"The selected theme is unavailable. PIE's managed base theme is active until it becomes available again."},textToSpeech:{name:"Text to Speech",description:"Read content aloud",inline:{controlsA11y:"Reading controls",playbackSpeedA11y:"Playback speed",rewindA11y:"Rewind",fastForwardA11y:"Fast-forward",stopA11y:"Stop reading",initializing:"Initializing text-to-speech",initFailed:"Unable to initialize text-to-speech. Try again.",starting:"Starting reading",started:"Reading started",resumed:"Reading resumed",pausedAnnouncement:"Reading paused",stopped:"Reading stopped",switchedSection:"Reading switched to another section",startFailed:"Unable to start reading",skippedForward:"Skipped forward",skipForwardFailed:"Unable to skip forward",skippedBackward:"Skipped backward",skipBackwardFailed:"Unable to skip backward",speedChangeFailed:"Unable to change playback speed",speedAnnounce:"Playback speed {label}",playA11y:"Play reading",pauseA11y:"Pause reading",resumeA11y:"Resume reading"}},signLanguage:{name:"Sign Language",description:"Signed alternate for authored content",generic:"Sign language",unknown:"Sign language ({code})",ase:"American Sign Language",bfi:"British Sign Language",fsl:"French Sign Language",gss:"Greek Sign Language",mfs:"Mexican Sign Language",signedEnglish:"Signed English",regionA11y:"{language} translation"},audioTranscript:{name:"Audio Transcript",description:"Text transcript of audio content",regionA11y:"Transcript"}},debug:{session:"Session",sessionData:"Session Data",sessionDataPersistent:"PIE Session Data (Persistent)",noItemSessionYet:"No item session data yet. Interact with the item to see updates here.",itemSessionsSnapshot:"Item Sessions Snapshot",sectionControllerUnavailable:"Section controller not available for this section yet.",filteredModel:"Filtered Model",environment:"Environment",events:"Events",controllerEvents:"Controller Events",instrumentation:"Instrumentation",databaseState:"Database state",sessionDb:"Session DB (Server)",noRows:"No rows",noRecords:"No instrumentation records yet.",selectRecord:"Select a record to inspect details.",selectEvent:"Select an event to inspect payload details.",showRawTables:"Show raw tables",showReconstructedSnapshots:"Show reconstructed snapshots",showSectionRequest:"Show section request",showAssessmentRequest:"Show assessment request",liveUpdatesUnsupported:"Live updates are not supported in this browser",liveUpdatesDisconnected:"Live updates disconnected; retrying…",fieldType:"Type:",fieldTarget:"Target:",fieldItem:"Item:",fieldCanonical:"Canonical:",fieldIntent:"Intent:",fieldDuplicates:"Duplicates:",fieldSemanticRepeats:"Semantic Repeats:",dragItemSessionPanelA11y:"Drag item session panel",debuggerTabsA11y:"Debugger tabs",sessionDataJsonA11y:"Session data JSON",environmentJsonA11y:"Environment JSON",filteredModelJsonA11y:"Filtered model JSON",sectionSessionJsonA11y:"Section session snapshot JSON",eventLevelFilterA11y:"Event level filter",controllerEventDetailsA11y:"Controller event details",instrumentationFilterA11y:"Filter instrumentation record type",instrumentationDetailsA11y:"Instrumentation record details",toggleSessionPanelA11y:"Toggle session panel",toggleEventPanelA11y:"Toggle event broadcast panel",toggleDatabasePanelA11y:"Toggle database state panel",toggleInstrumentationPanelA11y:"Toggle instrumentation panel",pnp:{title:"PNP Profile",noAssessmentBound:"No assessment bound",determinationReadOnly:"Determination (read-only)",toolsEditor:"Tools Editor",enforcement:"PNP enforcement",allAvailableTools:"All available tools",clearPlacement:"Clear placement",tool:"Tool",placement:"Placement",provider:"Provider",simulation:"PNP simulation",resolvedTools:"Resolved Tools (toolkit)",provenanceSummary:"Tool Policy Provenance Summary",perToolDecisions:"Per-Tool Decisions",policyDiagnostics:"Policy Diagnostics",profileReadOnly:"PNP Profile (read-only)"},tts:{title:"TTS settings",closeA11y:"Close TTS settings",toolbarLayoutMode:"Toolbar layout mode",reservedRow:"Reserved row",expandingRow:"Expanding row",floatingOverlay:"Floating overlay",leftAlignedControls:"Left-aligned controls",inlineSpeedButtons:"Inline speed buttons",resetToDefaults:"Reset to defaults",mathHighlighting:"Math highlighting",checkingAvailability:"Checking availability…",recheck:"Recheck",voice:"Voice",bestAvailableVoice:"Best available voice (auto)",unnamedVoice:"Unnamed voice",apiEndpoint:"API endpoint",gender:"Gender",any:"Any",male:"Male",female:"Female",neutral:"Neutral",engine:"Engine",neural:"Neural",standard:"Standard",providerDefault:"Provider default",format:"Format",sampleRate:"Sample rate",speechMarks:"Speech marks",word:"Word",wordAndSentence:"Word + sentence",voiceType:"Voice type",wavenetVoiceType:"WaveNet",studioVoiceType:"Studio",plainText:"Plain text",sampleText:"Sample text",resetSample:"Reset sample",providerAvailable:"Provider available.",providerUnavailable:"Provider unavailable.",providerCheckFailed:"Provider availability check failed.",providerNotChecked:"Provider availability has not been checked yet.",webSpeechUnavailable:"Web Speech API is not available in this browser.",browserNoVoices:"Browser text-to-speech is available, but no voices were returned yet.",browserUnavailable:"Browser text-to-speech is not available.",googleUnavailable:"Google Cloud TTS is not available from the configured API.",pollyUnavailable:"AWS Polly is not available from the configured API.",recommendedVoices:"Recommended voices",allVoices:"All available voices",previewVoice:"Preview voice",stopPreview:"Stop preview",applying:"Applying…",ssmlPreviewUnsupported:"SSML preview is not supported in the Browser backend.",pollySsmlHint:"Some Polly neural voices reject certain SSML tags (for example emphasis). Use basic SSML tags if preview fails.",mathHighlightParts:"Highlighting each part of a formula as it is read, falling back to the whole formula when alignment is uncertain.",mathHighlightBlock:"Highlighting each formula as a single block instead of breaking it into parts.",previewFailed:"Failed to play preview audio.",previewNoAudio:"Preview response did not include audio content.",previewEnterText:"Enter preview text before starting playback.",previewUnavailable:"Cannot preview while this service is unavailable.",browserSynthesisUnavailable:"Browser speech synthesis is unavailable.",browserSynthesisEndedEarly:"Browser speech synthesis ended before audio started. Restart the browser and try again.",browserSynthesisQueueFailed:"Browser speech synthesis failed to queue preview audio.",browserPreviewFailed:"Failed to play browser voice preview.",ssmlWordTrackingDisabled:"Google SSML preview preserves authored SSML, so word tracking is disabled.",applyUnavailable:"Cannot apply settings while this service is unavailable.",coordinatorUnavailable:"Toolkit coordinator is not available for text-to-speech updates."}}},d="en-US";function T(o){return o}var b=new Set(["ar","ckb","dv","fa","he","iw","ks","ku","nqo","ps","sd","syr","ug","ur","yi"]),A=new Set(["zero","one","two","few","many","other"]);function g(o){if(typeof o!="object"||o===null)return!1;const t=Object.keys(o);return t.length>0&&t.every(e=>A.has(e))}function h(o){try{const e=new Intl.Locale(o).textInfo;if(e?.direction==="rtl"||e?.direction==="ltr")return e.direction}catch{}const t=r(o).split("-")[0]??"";return b.has(t)?"rtl":"ltr"}var m=class c{constructor(t={}){s(this,"locale",void 0),s(this,"fallbackLocale",void 0),s(this,"catalogs",void 0),s(this,"customMessages",void 0),s(this,"loading",void 0),s(this,"listeners",new Set),s(this,"config",void 0),this.config={...t},this.fallbackLocale=l(t.fallbackLocale)||"en-US",this.catalogs=new Map([[d,f]]),this.customMessages={...t.customMessages??{}},this.loading=new Map,this.locale=this.resolveLocaleTag(t.locale)??"en-US"}async initialize(t){if(this.config={...this.config,...t},t.customMessages)for(const[e,i]of Object.entries(t.customMessages))this.addCustomMessages(e,i);await this.setLocale(t.locale??this.locale)}getLocale(){return this.locale}async setLocale(t){const e=this.resolveLocaleTag(t);if(!e){this.locale=l(t)||"en-US",this.notify();return}if(!this.catalogs.has(e)){const i=this.loading.get(e);if(i)await i;else{const a=this.loadCatalog(e);this.loading.set(e,a);try{await a}finally{this.loading.delete(e)}}}this.locale=e,this.notify()}t(t,e){const i=this.lookup(t);return i===void 0?(this.config.onMissingKey?.(t,this.locale),t):p(i,e)}plural(t,e){const i=this.lookupNode(t);return i===void 0||!g(i)?this.t(t,e):p(i[this.selectPluralCategory(e.count)]??i.other,e)}getDirection(){return h(this.locale)}getAvailableLocales(){return[...new Set([...this.catalogs.keys(),...this.config.availableLocales??[],...Object.keys(this.customMessages)])]}isLocaleLoaded(t){const e=this.resolveLocaleTag(t);return e!==void 0&&this.catalogs.has(e)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}hasKey(t){return this.lookup(t)!==void 0}addCustomMessages(t,e){const i=l(t);this.customMessages[i]=y(this.customMessages[i]??{},e),this.notify()}withLocale(t){const e=this.resolveLocaleTag(t)??l(t);if(e===this.locale)return this;const i=new c({...this.config,locale:e});return i.locale=e||"en-US",i.catalogs=this.catalogs,i.customMessages=this.customMessages,i.loading=this.loading,i}formatNumber(t,e){try{return new Intl.NumberFormat(this.locale,e).format(t)}catch{return new Intl.NumberFormat(d,e).format(t)}}formatDate(t,e){try{return new Intl.DateTimeFormat(this.locale,e).format(t)}catch{return new Intl.DateTimeFormat(d,e).format(t)}}getBundle(t=this.locale){const e=this.resolveLocaleTag(t);if(!e)return;const i=this.catalogs.get(e);if(i)return{locale:e,translations:i,direction:h(e)}}resolveLocaleTag(t){if(!t)return;const e=this.getAvailableLocales(),i=w(t,e);if(i)return i;const a=r(t).split("-")[0];if(a)return e.find(n=>r(n).split("-")[0]===a)}async loadCatalog(t){const e=this.config.loadCatalog;if(e)try{this.catalogs.set(t,await e(t))}catch(i){throw new Error(`Failed to load i18n catalog for locale: ${t}`,{cause:i})}}lookupNode(t){const e=[this.customMessages[this.locale],this.catalogs.get(this.locale),this.customMessages[this.fallbackLocale],this.catalogs.get(this.fallbackLocale)];for(const i of e){const a=S(i,t);if(a!==void 0)return a}}lookup(t){const e=this.lookupNode(t);if(typeof e=="string")return e;if(e!==void 0&&g(e))return e.other}selectPluralCategory(t){let e=c.pluralRules.get(this.locale);if(!e){try{e=new Intl.PluralRules(this.locale)}catch{return t===1?"one":"other"}c.pluralRules.set(this.locale,e)}return e.select(t)}notify(){for(const t of this.listeners)t()}};s(m,"pluralRules",new Map);function l(o){return o?o.trim().replace(/_/g,"-"):""}function S(o,t){if(!o)return;let e=o;for(const i of t.split("."))if(typeof e!="object"||e===null||(e=e[i],e===void 0))return;return e}function p(o,t){return t?o.replace(/\{(\w+)\}/g,(e,i)=>{const a=t[i];return a==null?e:String(a)}):o}function y(o,t){const e={...o};for(const[i,a]of Object.entries(t)){const n=e[i];a&&typeof a=="object"&&n&&typeof n=="object"?e[i]=y(n,a):e[i]=a}return e}var u;function k(){return u||(u=new m),u}function L(o){const t=o?.i18n??k();return{getLocale:()=>t.getLocale(),setLocale:e=>t.setLocale(e),t:(e,i)=>t.t(e,i),plural:(e,i)=>t.plural?.(e,i)??t.t(e,i),getDirection:()=>t.getDirection?.()??"ltr",hasKey:e=>t.hasKey?.(e)??!1,subscribe:e=>t.subscribe?.(e)??(()=>{})}}export{v as a,L as i,m as n,r as o,T as r,d as t};
|
|
1
|
+
import{t as s}from"./defineProperty-a20a667d.js";function r(i){return i?i.trim().replace(/_/g,"-").split(/[.@]/)[0].toLowerCase():""}function l(i){return i?i.trim().replace(/_/g,"-"):""}function v(i){const t=r(i);if(!t)return[];const e=t.split("-"),o=[];for(let a=e.length;a>0;a--){const n=e.slice(0,a);n.length>1&&n[n.length-1].length===1||o.push(n.join("-"))}return o}function w(i,t){for(const e of v(i)){const o=t.find(a=>r(a)===e);if(o!=null)return o}}var f={common:{close:"Close",cancel:"Cancel",save:"Save",reset:"Reset",retry:"Retry",back:"Back",next:"Next",previous:"Previous",submit:"Submit",continue:"Continue",finish:"Finish",yes:"Yes",no:"No",ok:"OK",any:"Any",off:"Off",auto:"Auto",all:"All",none:"None",loading:"Loading…",error:"Error",settings:"Settings",language:"Language",theme:"Theme",preview:"Preview",author:"Author",unknown:"Unknown",untitled:"Untitled",apply:"Apply",enabled:"Enabled",disabled:"Disabled",closeA11y:"Close",settingsA11y:"Open settings menu"},player:{passage:"Passage",passages:"Passages",question:"Question",questionNumbered:"Question {position}",questions:"Questions",items:"Items",section:"Section",loadingSection:"Loading section content…",sectionLoadError:"Section content could not be loaded.",loadingPassage:"Loading passage content…",configurationError:"Configuration Error",playerError:"Player Error",authoringBackendError:"Authoring Backend Configuration Error",itemLoadError:"Question could not be loaded.",sectionTabsA11y:"Section content tabs",passagesRegionA11y:"Passages",itemsRegionA11y:"Items",sectionToolsA11y:"Section tools",scrollDownA11y:"Scroll down",resizePanels:"Resize panels",resizePassagesAndItemsA11y:"Resize passages and items panels",resizeMediaRegion:"Resize media region",resizeQuestionAndMediaA11y:"Resize question and media panels",resizePassageAndMediaA11y:"Resize passage and media panels",assessment:{sectionPosition:"Section {position} of {total}",noSections:"No sections",loadFailed:"The assessment could not be loaded. Try again.",restoreFailed:"Your saved answers for this section could not be restored. Try again."},formative:{checkAnswer:"Check answer",tryAgain:"Try again",answerRecorded:"Answer recorded.",correct:"Correct.",partlyCorrect:"Partly correct.",notCorrect:"Not correct.",notAutoScored:"Answer recorded. This question is not scored automatically.",checkFailed:"This question could not be checked. Try again.",triesLeft:{one:"{count} try left.",other:"{count} tries left."}},timedMedia:{waitingForMedia:"Questions will appear as the media plays.",questionAvailable:"Question {position} is now available.",playbackPaused:"Playback paused. Answer question {position} to continue.",playbackAdvisory:"Answer question {position} before continuing with the media.",playbackReleased:"Answer accepted. Continue playing the media."}},toolkit:{toolsA11y:"Assessment tools",toolbarInitError:"Unable to initialize assessment toolkit.",settingsTitle:"Settings",closeSettingsA11y:"Close settings",dragPanelA11y:"Drag panel",closePanelA11y:"Close panel",resizeWindow:"Resize window",minimize:"Minimize",maximize:"Maximize",minimizePanelA11y:"Minimize panel",maximizePanelA11y:"Maximize panel",window:{moveLeftA11y:"Move tool left",moveRightA11y:"Move tool right",moveUpA11y:"Move tool up",moveDownA11y:"Move tool down",shrinkA11y:"Shrink tool window",growA11y:"Grow tool window",centerA11y:"Center tool window",closeA11y:"Close tool"},placement:{controlsA11y:"Move and rotate",rotateClockwiseA11y:"Rotate {degrees}° clockwise",rotateCounterclockwiseA11y:"Rotate {degrees}° counterclockwise"},announce:{movedUp:"Moved up to {position}",movedDown:"Moved down to {position}",movedLeft:"Moved left to {position}",movedRight:"Moved right to {position}",rotatedTo:"Rotated to {degrees} degrees"}},tools:{calculator:{name:"Calculator",nameBasic:"Basic Calculator",nameScientific:"Scientific Calculator",nameGraphing:"Graphing Calculator",description:"Multi-type calculator (basic, scientific, graphing)",openedBasic:"Basic calculator opened",openedScientific:"Scientific calculator opened",openedGraphing:"Graphing calculator opened",closedBasic:"Basic calculator closed",closedScientific:"Scientific calculator closed",closedGraphing:"Graphing calculator closed",toolA11y:"Calculator tool",loading:"Loading calculator…",providerUnavailable:"The calculator is unavailable."},graph:{name:"Graph",description:"Coordinate plane",buttonA11y:"Graph, coordinate plane",tooltip:"Graph",toolA11y:"Graph tool — draw points and lines on a coordinate grid",canvasA11y:"Graph canvas — use tools to add points and draw lines",grid:"Grid:",gridOpacityA11y:"Grid opacity",pointA11y:"Graph point {id}",modeSelector:"Selector",modeSelectorHint:"Selector: click and drag points to move them or associated lines.",modePoint:"Point",modePointHint:"Point: click on the grid to add points.",modeLine:"Line",modeLineHint:"Line: click a starting point, then an ending point to draw a line.",modeDelete:"Delete",modeDeleteHint:"Delete: click on a point to delete it and any connected lines."},periodicTable:{name:"Periodic Table",description:"Chemistry periodic table reference",buttonA11y:"Periodic Table, chemistry reference",tooltip:"Periodic Table",toolA11y:"Periodic table — select an element to view its details",elementsA11y:"Periodic table elements",showAllA11y:"Show all elements",allElements:"All Elements",atomicMass:"Atomic Mass",atomicNumber:"Atomic No",electronConfig:"Electron Config",phase:"Phase",filterByA11y:"Filter by {category}",elementA11y:"{name}, Symbol: {symbol}, Atomic number: {number}, Atomic mass: {mass}, Category: {category}",outsideFilterA11y:", outside the current filter",category:{unknown:"Unknown",alkaliMetal:"Alkali Metal",alkalineEarthMetal:"Alkaline Earth Metal",transitionMetal:"Transition Metal",postTransitionMetal:"Post-transition Metal",metalloid:"Metalloid",diatomicNonmetal:"Diatomic Nonmetal",polyatomicNonmetal:"Polyatomic Nonmetal",nobleGas:"Noble Gas",lanthanide:"Lanthanide",actinide:"Actinide"}},ruler:{name:"Ruler",description:"On-screen ruler for measurements",buttonA11y:"Ruler",tooltip:"Ruler",toolA11y:"Draggable and rotatable ruler measurement tool",unitSelectionA11y:"Ruler unit selection",inches:"Inches",centimeters:"Centimeters",inchesInSentence:"inches",centimetersInSentence:"centimeters",switchToInchesA11y:"Switch to inches",switchToCentimetersA11y:"Switch to centimeters",switchedTo:"Switched to {unit}",applicationA11y:"Ruler tool. Use arrow keys to move, Shift+arrows to rotate, PageUp or PageDown for fine rotation, U to toggle units. Current unit: {unit}",imageAlt:"Ruler showing {unit}"},protractor:{name:"Protractor",description:"On-screen protractor for angle measurements",buttonA11y:"Protractor",tooltip:"Protractor",toolA11y:"Protractor tool. Use arrow keys to move, Shift+arrows to rotate, and PageUp or PageDown for fine rotation.",roleA11y:"Draggable and rotatable protractor measurement tool",imageAlt:"Protractor with 180-degree semicircular scale marked from 0 to 180 degrees in both directions, with degree markings every 10 degrees"},dictionary:{name:"Dictionary",description:"Look up word definitions",buttonA11y:"Dictionary, look up word definitions",tooltip:"Dictionary",toolA11y:"Dictionary"},pictureDictionary:{name:"Picture Dictionary",description:"Look up pictures for words",buttonA11y:"Picture Dictionary, look up pictures for words",tooltip:"Picture Dictionary",toolA11y:"Picture Dictionary"},dictionarySpanish:{name:"Spanish Dictionary",description:"Look up word definitions in Spanish",buttonA11y:"Spanish Dictionary, look up word definitions in Spanish",tooltip:"Spanish Dictionary",toolA11y:"Spanish Dictionary"},pictureDictionarySpanish:{name:"Spanish Picture Dictionary",description:"Look up pictures for words in Spanish",buttonA11y:"Spanish Picture Dictionary, look up pictures for words in Spanish",tooltip:"Spanish Picture Dictionary",toolA11y:"Spanish Picture Dictionary"},lineReader:{name:"Line Reader",description:"Reading guide overlay",buttonA11y:"Line Reader, reading guide",tooltip:"Line Reader",roleA11y:"Draggable and resizable reading guide overlay",close:"Close line reader",resizeWindowA11y:"Drag to resize the reading window",resizeFrameA11y:"Drag to resize the frame and window width",windowHeightAnnounce:"Reading window height {pixels} pixels",frameHeightAnnounce:"Frame height {pixels} pixels",widthAnnounce:"Width {pixels} pixels",applicationA11y:"Line Reader tool. A clear reading window inside an obscuring frame. Use arrow keys to move, +/- to resize the reading window, Escape to close. Reading window height: {paneHeight} pixels, Frame height: {frameHeight} pixels",resizeWindowFullA11y:"Resize the reading window. Drag, or use the up and down arrow keys to change its height. Current height {paneHeight} pixels",resizeFrameFullA11y:"Resize the frame. Drag, or use the up and down arrow keys to change the frame height and the left and right arrow keys to change the width. Current frame height {frameHeight} pixels, width {width} pixels"},answerEliminator:{name:"Answer Eliminator",description:"Strike through answer choices",buttonA11y:"Strike Through, eliminate answer choices",tooltip:"Strike Through"},highlighter:{name:"Highlighter",description:"Highlight and annotate text",buttonA11y:"Highlight text",tooltip:"Highlight"},annotationToolbar:{name:"Annotation",description:"Highlight and annotate text",buttonA11y:"Annotate, highlight and mark up text",tooltip:"Annotate",toolbarA11y:"Text annotation toolbar",underline:"Underline",underlineA11y:"Underline selected text",readAloud:"Read Aloud",readAloudA11y:"Read selected text aloud",remove:"Remove",removeA11y:"Remove this annotation",clearAll:"Clear All",clearAllA11y:"Clear all annotations from document",highlightYellowA11y:"Yellow highlight",highlightPinkA11y:"Pink highlight",highlightBlueA11y:"Blue highlight",highlightGreenA11y:"Green highlight"},theme:{name:"Theme",description:"Accessible themes and contrast",buttonA11y:"Theme, change colors and contrast",tooltip:"Theme",selectorA11y:"Theme selector",hint:"Select a theme to improve readability and reduce eye strain.",selectA11y:"Select theme",selectCurrentA11y:"Select theme. Current theme: {name}",optionUnavailableA11y:"{name}, unavailable",unavailableName:"Unavailable theme: {id}",unavailableDescription:"PIE's managed base theme remains active until this theme becomes available again.",unavailableStatus:"The selected theme is unavailable. PIE's managed base theme is active until it becomes available again."},textToSpeech:{name:"Text to Speech",description:"Read content aloud",initFailed:"Unable to initialize text-to-speech. Try again.",inline:{controlsA11y:"Reading controls",playbackSpeedA11y:"Playback speed",rewindA11y:"Rewind",fastForwardA11y:"Fast-forward",stopA11y:"Stop reading",starting:"Starting reading",started:"Reading started",resumed:"Reading resumed",pausedAnnouncement:"Reading paused",stopped:"Reading stopped",switchedSection:"Reading switched to another section",nothingToRead:"Nothing to read aloud here",startFailed:"Unable to start reading",skippedForward:"Skipped forward",skipForwardFailed:"Unable to skip forward",skippedBackward:"Skipped backward",skipBackwardFailed:"Unable to skip backward",speedChangeFailed:"Unable to change playback speed",speedAnnounce:"Playback speed {label}",playA11y:"Play reading",pauseA11y:"Pause reading",resumeA11y:"Resume reading"}},signLanguage:{name:"Sign Language",description:"Signed alternate for authored content",generic:"Sign language",unknown:"Sign language ({code})",ase:"American Sign Language",bfi:"British Sign Language",fsl:"French Sign Language",gss:"Greek Sign Language",mfs:"Mexican Sign Language",signedEnglish:"Signed English",regionA11y:"{language} translation"},audioTranscript:{name:"Audio Transcript",description:"Text transcript of audio content",regionA11y:"Transcript"}},debug:{session:"Session",sessionData:"Session Data",sessionDataPersistent:"PIE Session Data (Persistent)",noItemSessionYet:"No item session data yet. Interact with the item to see updates here.",itemSessionsSnapshot:"Item Sessions Snapshot",sectionControllerUnavailable:"Section controller not available for this section yet.",filteredModel:"Filtered Model",environment:"Environment",events:"Events",controllerEvents:"Controller Events",instrumentation:"Instrumentation",databaseState:"Database state",sessionDb:"Session DB (Server)",noRows:"No rows",noRecords:"No instrumentation records yet.",selectRecord:"Select a record to inspect details.",selectEvent:"Select an event to inspect payload details.",showRawTables:"Show raw tables",showReconstructedSnapshots:"Show reconstructed snapshots",showSectionRequest:"Show section request",showAssessmentRequest:"Show assessment request",liveUpdatesUnsupported:"Live updates are not supported in this browser",liveUpdatesDisconnected:"Live updates disconnected; retrying…",fieldType:"Type:",fieldTarget:"Target:",fieldItem:"Item:",fieldCanonical:"Canonical:",fieldIntent:"Intent:",fieldDuplicates:"Duplicates:",fieldSemanticRepeats:"Semantic Repeats:",dragItemSessionPanelA11y:"Drag item session panel",debuggerTabsA11y:"Debugger tabs",sessionDataJsonA11y:"Session data JSON",environmentJsonA11y:"Environment JSON",filteredModelJsonA11y:"Filtered model JSON",sectionSessionJsonA11y:"Section session snapshot JSON",eventLevelFilterA11y:"Event level filter",controllerEventDetailsA11y:"Controller event details",instrumentationFilterA11y:"Filter instrumentation record type",instrumentationDetailsA11y:"Instrumentation record details",toggleSessionPanelA11y:"Toggle session panel",toggleEventPanelA11y:"Toggle event broadcast panel",toggleDatabasePanelA11y:"Toggle database state panel",toggleInstrumentationPanelA11y:"Toggle instrumentation panel",pnp:{title:"PNP Profile",noAssessmentBound:"No assessment bound",noAssessmentBoundBody:"Profile, district and test-administration policy have nothing to read, so only an item's requiredTools can grant an accommodation. Pass the assessment to the toolkit's assessment property, or call updateAssessment(...) on the toolkit coordinator.",determinationReadOnly:"Determination (read-only)",toolsEditor:"Tools Editor",enforcement:"PNP enforcement",allAvailableTools:"All available tools",clearPlacement:"Clear placement",tool:"Tool",placement:"Placement",provider:"Provider",simulation:"PNP simulation",resolvedTools:"Resolved Tools (toolkit)",provenanceSummary:"Tool Policy Provenance Summary",perToolDecisions:"Per-Tool Decisions",policyDiagnostics:"Policy Diagnostics",profileReadOnly:"PNP Profile (read-only)"},tts:{title:"TTS settings",closeA11y:"Close TTS settings",toolbarLayoutMode:"Toolbar layout mode",reservedRow:"Reserved row",expandingRow:"Expanding row",floatingOverlay:"Floating overlay",leftAlignedControls:"Left-aligned controls",inlineSpeedButtons:"Inline speed buttons",resetToDefaults:"Reset to defaults",mathHighlighting:"Math highlighting",checkingAvailability:"Checking availability…",recheck:"Recheck",voice:"Voice",bestAvailableVoice:"Best available voice (auto)",unnamedVoice:"Unnamed voice",apiEndpoint:"API endpoint",gender:"Gender",any:"Any",male:"Male",female:"Female",neutral:"Neutral",engine:"Engine",neural:"Neural",standard:"Standard",providerDefault:"Provider default",format:"Format",sampleRate:"Sample rate",speechMarks:"Speech marks",word:"Word",wordAndSentence:"Word + sentence",voiceType:"Voice type",wavenetVoiceType:"WaveNet",studioVoiceType:"Studio",plainText:"Plain text",sampleText:"Sample text",resetSample:"Reset sample",providerAvailable:"Provider available.",providerUnavailable:"Provider unavailable.",providerCheckFailed:"Provider availability check failed.",providerNotChecked:"Provider availability has not been checked yet.",webSpeechUnavailable:"Web Speech API is not available in this browser.",browserNoVoices:"Browser text-to-speech is available, but no voices were returned yet.",browserUnavailable:"Browser text-to-speech is not available.",googleUnavailable:"Google Cloud TTS is not available from the configured API.",pollyUnavailable:"AWS Polly is not available from the configured API.",recommendedVoices:"Recommended voices",allVoices:"All available voices",previewVoice:"Preview voice",stopPreview:"Stop preview",applying:"Applying…",ssmlPreviewUnsupported:"SSML preview is not supported in the Browser backend.",pollySsmlHint:"Some Polly neural voices reject certain SSML tags (for example emphasis). Use basic SSML tags if preview fails.",mathHighlightParts:"Highlighting each part of a formula as it is read, falling back to the whole formula when alignment is uncertain.",mathHighlightBlock:"Highlighting each formula as a single block instead of breaking it into parts.",previewFailed:"Failed to play preview audio.",previewNoAudio:"Preview response did not include audio content.",previewEnterText:"Enter preview text before starting playback.",previewUnavailable:"Cannot preview while this service is unavailable.",browserSynthesisUnavailable:"Browser speech synthesis is unavailable.",ssmlWordTrackingDisabled:"Google SSML preview preserves authored SSML, so word tracking is disabled.",applyUnavailable:"Cannot apply settings while this service is unavailable.",coordinatorUnavailable:"Toolkit coordinator is not available for text-to-speech updates.",customProviderNotRegistered:"Custom provider '{id}' is not registered.",customProviderNoConfig:"Custom provider '{id}' did not return an apply config.",httpError:"HTTP {status}: {message}",unknownError:"Unknown error",previewRequestFailed:"Preview request failed ({status}).",notAvailable:"n/a",voiceLocal:"local",voiceRemote:"remote",voiceBrowserDefault:"browser default",browserAvailable:{one:"Browser TTS available ({count} voice detected).",other:"Browser TTS available ({count} voices detected)."},pollyAvailable:{one:"AWS Polly available ({count} matching voice, {engine} engine).",other:"AWS Polly available ({count} matching voices, {engine} engine)."},googleAvailable:{one:"Google Cloud TTS available ({count} matching voice).",other:"Google Cloud TTS available ({count} matching voices)."},headerRowReservation:"Item header row reservation: {state}",speedOptionsHelp:"Comma or semicolon-separated multipliers. Include 1 for Normal; leave empty to hide speed controls.",usingSelectedVoice:"Using selected voice: {voice}",autoVoice:"Best available voice (auto): {voice}",autoVoiceWaiting:"Best available voice (auto): waiting for browser voices.",previewHintBrowserSsml:"SSML is unsupported in Browser preview.",previewHintGoogleSsml:"SSML preserved. Tracking disabled.",previewHintCustom:"Tracking enabled when provider returns speech marks.",previewHintTracking:"Tracking enabled while preview plays."}}},d="en-US";function T(i){return i}var b=new Set(["ar","ckb","dv","fa","he","iw","ks","ku","nqo","ps","sd","syr","ug","ur","yi"]),A=new Set(["zero","one","two","few","many","other"]);function g(i){if(typeof i!="object"||i===null)return!1;const t=Object.keys(i);return t.length>0&&t.every(e=>A.has(e))}function h(i){try{const e=new Intl.Locale(i).textInfo;if(e?.direction==="rtl"||e?.direction==="ltr")return e.direction}catch{}const t=r(i).split("-")[0]??"";return b.has(t)?"rtl":"ltr"}var m=class c{constructor(t={}){s(this,"locale",void 0),s(this,"fallbackLocale",void 0),s(this,"catalogs",void 0),s(this,"customMessages",void 0),s(this,"loading",void 0),s(this,"listeners",new Set),s(this,"config",void 0),this.config={...t},this.fallbackLocale=l(t.fallbackLocale)||"en-US",this.catalogs=new Map([[d,f]]),this.customMessages={...t.customMessages??{}},this.loading=new Map,this.locale=this.resolveLocaleTag(t.locale)??"en-US"}async initialize(t){if(this.config={...this.config,...t},t.customMessages)for(const[e,o]of Object.entries(t.customMessages))this.addCustomMessages(e,o);await this.setLocale(t.locale??this.locale)}getLocale(){return this.locale}async setLocale(t){const e=this.resolveLocaleTag(t);if(!e){this.locale=l(t)||"en-US",this.notify();return}if(!this.catalogs.has(e)&&this.config.availableLocales?.includes(e)){const o=this.loading.get(e);if(o)await o;else{const a=this.loadCatalog(e);this.loading.set(e,a);try{await a}finally{this.loading.delete(e)}}}this.locale=e,this.notify()}t(t,e){const o=this.lookup(t);return o===void 0?(this.config.onMissingKey?.(t,this.locale),t):p(o,e)}plural(t,e){const o=this.lookupNode(t);return o===void 0||!g(o)?this.t(t,e):p(o[this.selectPluralCategory(e.count)]??o.other,e)}getDirection(){return h(this.locale)}getAvailableLocales(){return[...new Set([...this.catalogs.keys(),...this.config.availableLocales??[],...Object.keys(this.customMessages)])]}isLocaleLoaded(t){const e=this.resolveLocaleTag(t);return e!==void 0&&this.catalogs.has(e)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}hasKey(t){return this.lookup(t)!==void 0}addCustomMessages(t,e){const o=l(t);this.customMessages[o]=y(this.customMessages[o]??{},e),this.notify()}withLocale(t){const e=this.resolveLocaleTag(t)??l(t);if(e===this.locale)return this;const o=new c({...this.config,locale:e});return o.locale=e||"en-US",o.catalogs=this.catalogs,o.customMessages=this.customMessages,o.loading=this.loading,o}formatNumber(t,e){try{return new Intl.NumberFormat(this.locale,e).format(t)}catch{return new Intl.NumberFormat(d,e).format(t)}}formatDate(t,e){try{return new Intl.DateTimeFormat(this.locale,e).format(t)}catch{return new Intl.DateTimeFormat(d,e).format(t)}}getBundle(t=this.locale){const e=this.resolveLocaleTag(t);if(!e)return;const o=this.catalogs.get(e);if(o)return{locale:e,translations:o,direction:h(e)}}resolveLocaleTag(t){if(!t)return;const e=this.getAvailableLocales(),o=w(t,e);if(o)return o;const a=r(t).split("-")[0];if(a)return e.find(n=>r(n).split("-")[0]===a)}async loadCatalog(t){const e=this.config.loadCatalog;if(e)try{this.catalogs.set(t,await e(t))}catch(o){throw new Error(`Failed to load i18n catalog for locale: ${t}`,{cause:o})}}lookupNode(t){const e=[this.customMessages[this.locale],this.catalogs.get(this.locale),this.customMessages[this.fallbackLocale],this.catalogs.get(this.fallbackLocale)];for(const o of e){const a=S(o,t);if(a!==void 0)return a}}lookup(t){const e=this.lookupNode(t);if(typeof e=="string")return e;if(e!==void 0&&g(e))return e.other}selectPluralCategory(t){let e=c.pluralRules.get(this.locale);if(!e){try{e=new Intl.PluralRules(this.locale)}catch{return t===1?"one":"other"}c.pluralRules.set(this.locale,e)}return e.select(t)}notify(){for(const t of this.listeners)t()}};s(m,"pluralRules",new Map);function S(i,t){if(!i)return;let e=i;for(const o of t.split("."))if(typeof e!="object"||e===null||(e=e[o],e===void 0))return;return e}function p(i,t){return t?i.replace(/\{(\w+)\}/g,(e,o)=>{const a=t[o];return a==null?e:String(a)}):i}function y(i,t){const e={...i};for(const[o,a]of Object.entries(t)){const n=e[o];a&&typeof a=="object"&&n&&typeof n=="object"?e[o]=y(n,a):e[o]=a}return e}var u;function k(){return u||(u=new m),u}function L(i){const t=i?.i18n??k();return{getLocale:()=>t.getLocale(),setLocale:e=>t.setLocale(e),t:(e,o)=>t.t(e,o),plural:(e,o)=>t.plural?.(e,o)??t.t(e,o),getDirection:()=>t.getDirection?.()??"ltr",hasKey:e=>t.hasKey?.(e)??!1,subscribe:e=>t.subscribe?.(e)??(()=>{})}}export{v as a,L as i,m as n,r as o,T as r,l as s,d as t};
|