@pie-players/pie-assessment-player 0.3.67 → 0.3.68
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.
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import "@pie-players/pie-section-player/components/section-player-splitpane-element";
|
|
2
2
|
import "@pie-players/pie-section-player/components/section-player-vertical-element";
|
|
3
|
-
import { defineCustomElementSafely as
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { coerceBooleanLike as $, defineCustomElementSafely as H } from "@pie-players/pie-players-shared";
|
|
4
|
+
import { createNewAssessmentSession as ne, frameworkErrorFromUnknown as ie, setCurrentSectionPosition as se, upsertSectionSession as oe } from "@pie-players/pie-assessment-toolkit";
|
|
5
|
+
var P = (e) => {
|
|
6
|
+
if (e === null || typeof e != "object") return e;
|
|
7
|
+
if (Array.isArray(e)) return e.map(P);
|
|
8
|
+
const t = {};
|
|
9
|
+
for (const n in e) Object.hasOwn(e, n) && (t[n] = P(e[n]));
|
|
10
|
+
return t;
|
|
11
|
+
}, q = "https://proxy.pie-api.com", re = `${q}/bundles/`;
|
|
12
|
+
function j(e) {
|
|
6
13
|
try {
|
|
7
14
|
const t = {
|
|
8
15
|
BASE_URL: "/",
|
|
@@ -15,167 +22,167 @@ function B(e) {
|
|
|
15
22
|
} catch {
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
|
-
var
|
|
19
|
-
function
|
|
25
|
+
var Ze = typeof window < "u" && window.PIE_BUILDER_ORIGIN_URL || j("PUBLIC_BUILDER_ORIGIN_URL") || q, ae = typeof window < "u" && window.PIE_BUILDER_BUNDLE_URL || j("PUBLIC_BUILDER_BUNDLE_URL") || re;
|
|
26
|
+
function y(e) {
|
|
20
27
|
"@babel/helpers - typeof";
|
|
21
|
-
return
|
|
28
|
+
return y = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
22
29
|
return typeof t;
|
|
23
30
|
} : function(t) {
|
|
24
31
|
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
25
|
-
},
|
|
32
|
+
}, y(e);
|
|
26
33
|
}
|
|
27
|
-
function
|
|
28
|
-
if (
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
var
|
|
32
|
-
if (
|
|
34
|
+
function le(e, t) {
|
|
35
|
+
if (y(e) != "object" || !e) return e;
|
|
36
|
+
var n = e[Symbol.toPrimitive];
|
|
37
|
+
if (n !== void 0) {
|
|
38
|
+
var i = n.call(e, t || "default");
|
|
39
|
+
if (y(i) != "object") return i;
|
|
33
40
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
34
41
|
}
|
|
35
42
|
return (t === "string" ? String : Number)(e);
|
|
36
43
|
}
|
|
37
|
-
function
|
|
38
|
-
var t =
|
|
39
|
-
return
|
|
44
|
+
function ce(e) {
|
|
45
|
+
var t = le(e, "string");
|
|
46
|
+
return y(t) == "symbol" ? t : t + "";
|
|
40
47
|
}
|
|
41
|
-
function
|
|
42
|
-
return (t =
|
|
43
|
-
value:
|
|
48
|
+
function a(e, t, n) {
|
|
49
|
+
return (t = ce(t)) in e ? Object.defineProperty(e, t, {
|
|
50
|
+
value: n,
|
|
44
51
|
enumerable: !0,
|
|
45
52
|
configurable: !0,
|
|
46
53
|
writable: !0
|
|
47
|
-
}) : e[t] =
|
|
54
|
+
}) : e[t] = n, e;
|
|
48
55
|
}
|
|
49
56
|
var N;
|
|
50
57
|
(function(e) {
|
|
51
58
|
e.SAVE = "save", e.MODEL = "model", e.SCORE = "score", e.MANUAL_SCORE = "manual-score";
|
|
52
59
|
})(N || (N = {}));
|
|
53
|
-
var
|
|
60
|
+
var T;
|
|
54
61
|
(function(e) {
|
|
55
62
|
e.AUTO = "auto", e.MANUAL = "manual";
|
|
56
|
-
})(
|
|
57
|
-
var
|
|
63
|
+
})(T || (T = {}));
|
|
64
|
+
var L;
|
|
58
65
|
(function(e) {
|
|
59
66
|
e.GATHER = "gather", e.VIEW = "view", e.EVALUATE = "evaluate";
|
|
60
|
-
})(
|
|
67
|
+
})(L || (L = {}));
|
|
61
68
|
var x;
|
|
62
69
|
(function(e) {
|
|
63
70
|
e.PENDING = "pending", e.IN_PROGRESS = "in_progress", e.COMPLETED = "completed", e.FAILED = "failed";
|
|
64
71
|
})(x || (x = {}));
|
|
65
|
-
var
|
|
66
|
-
constructor(t,
|
|
67
|
-
super(
|
|
72
|
+
var de = class V extends CustomEvent {
|
|
73
|
+
constructor(t, n = !1) {
|
|
74
|
+
super(V.TYPE, {
|
|
68
75
|
bubbles: !0,
|
|
69
76
|
detail: {
|
|
70
77
|
update: t,
|
|
71
|
-
reset:
|
|
78
|
+
reset: n
|
|
72
79
|
}
|
|
73
|
-
}),
|
|
80
|
+
}), a(this, "update", void 0), a(this, "reset", void 0), this.update = t, this.reset = n;
|
|
74
81
|
}
|
|
75
82
|
};
|
|
76
|
-
|
|
77
|
-
var
|
|
78
|
-
constructor(t,
|
|
79
|
-
super(
|
|
83
|
+
a(de, "TYPE", "model.updated");
|
|
84
|
+
var ue = class Y extends CustomEvent {
|
|
85
|
+
constructor(t, n) {
|
|
86
|
+
super(Y.TYPE, {
|
|
80
87
|
bubbles: !0,
|
|
81
88
|
detail: {
|
|
82
89
|
src: t,
|
|
83
|
-
done:
|
|
90
|
+
done: n
|
|
84
91
|
}
|
|
85
|
-
}),
|
|
92
|
+
}), a(this, "src", void 0), a(this, "done", void 0), this.src = t, this.done = n;
|
|
86
93
|
}
|
|
87
94
|
};
|
|
88
|
-
|
|
89
|
-
var
|
|
95
|
+
a(ue, "TYPE", "delete.image");
|
|
96
|
+
var he = class W extends CustomEvent {
|
|
90
97
|
constructor(t) {
|
|
91
|
-
super(
|
|
98
|
+
super(W.TYPE, {
|
|
92
99
|
bubbles: !0,
|
|
93
100
|
detail: t
|
|
94
|
-
}),
|
|
101
|
+
}), a(this, "handler", void 0), this.handler = t;
|
|
95
102
|
}
|
|
96
103
|
};
|
|
97
|
-
|
|
98
|
-
var
|
|
99
|
-
constructor(t,
|
|
100
|
-
super(
|
|
104
|
+
a(he, "TYPE", "insert.image");
|
|
105
|
+
var pe = class J extends CustomEvent {
|
|
106
|
+
constructor(t, n) {
|
|
107
|
+
super(J.TYPE, {
|
|
101
108
|
bubbles: !0,
|
|
102
109
|
detail: {
|
|
103
110
|
src: t,
|
|
104
|
-
done:
|
|
111
|
+
done: n
|
|
105
112
|
}
|
|
106
|
-
}),
|
|
113
|
+
}), a(this, "src", void 0), a(this, "done", void 0), this.src = t, this.done = n;
|
|
107
114
|
}
|
|
108
115
|
};
|
|
109
|
-
|
|
110
|
-
var
|
|
116
|
+
a(pe, "TYPE", "delete.sound");
|
|
117
|
+
var me = class Q extends CustomEvent {
|
|
111
118
|
constructor(t) {
|
|
112
|
-
super(
|
|
119
|
+
super(Q.TYPE, {
|
|
113
120
|
bubbles: !0,
|
|
114
121
|
detail: t
|
|
115
|
-
}),
|
|
122
|
+
}), a(this, "handler", void 0), this.handler = t;
|
|
116
123
|
}
|
|
117
124
|
};
|
|
118
|
-
|
|
119
|
-
var
|
|
120
|
-
constructor(t,
|
|
121
|
-
super(
|
|
125
|
+
a(me, "TYPE", "insert.sound");
|
|
126
|
+
var ge = class K extends CustomEvent {
|
|
127
|
+
constructor(t, n) {
|
|
128
|
+
super(K.TYPE, {
|
|
122
129
|
bubbles: !0,
|
|
123
130
|
composed: !0,
|
|
124
131
|
detail: {
|
|
125
|
-
complete:
|
|
132
|
+
complete: n,
|
|
126
133
|
component: t
|
|
127
134
|
}
|
|
128
|
-
}),
|
|
135
|
+
}), a(this, "component", void 0), a(this, "complete", void 0), this.component = t, this.complete = n;
|
|
129
136
|
}
|
|
130
137
|
};
|
|
131
|
-
|
|
132
|
-
var
|
|
138
|
+
a(ge, "TYPE", "session-changed");
|
|
139
|
+
var D;
|
|
133
140
|
(function(e) {
|
|
134
141
|
e[e.ROOT = 0] = "ROOT", e[e.SUBJECT = 1] = "SUBJECT", e[e.LEVEL = 2] = "LEVEL", e[e.STANDARD = 3] = "STANDARD";
|
|
135
|
-
})(
|
|
136
|
-
function
|
|
137
|
-
const
|
|
142
|
+
})(D || (D = {}));
|
|
143
|
+
function m(e, t) {
|
|
144
|
+
const n = `[${e}]`;
|
|
138
145
|
return {
|
|
139
|
-
debug: (
|
|
140
|
-
t() && console.debug(
|
|
146
|
+
debug: (i, ...s) => {
|
|
147
|
+
t() && console.debug(n, i, ...s);
|
|
141
148
|
},
|
|
142
|
-
info: (
|
|
143
|
-
warn: (
|
|
144
|
-
error: (
|
|
149
|
+
info: (i, ...s) => console.info(n, i, ...s),
|
|
150
|
+
warn: (i, ...s) => console.warn(n, i, ...s),
|
|
151
|
+
error: (i, ...s) => console.error(n, i, ...s)
|
|
145
152
|
};
|
|
146
153
|
}
|
|
147
|
-
function
|
|
154
|
+
function g() {
|
|
148
155
|
return typeof window < "u" && window.PIE_DEBUG === !0;
|
|
149
156
|
}
|
|
150
|
-
var
|
|
157
|
+
var Xe = m("math-rendering", () => g()), C;
|
|
151
158
|
(function(e) {
|
|
152
159
|
e.player = "player.js", e.clientPlayer = "client-player.js", e.editor = "editor.js";
|
|
153
|
-
})(
|
|
154
|
-
var
|
|
160
|
+
})(C || (C = {}));
|
|
161
|
+
var U;
|
|
155
162
|
(function(e) {
|
|
156
163
|
e.loading = "loading", e.loaded = "loaded";
|
|
157
|
-
})(
|
|
158
|
-
var
|
|
159
|
-
buildServiceBase:
|
|
160
|
-
bundleType:
|
|
164
|
+
})(U || (U = {}));
|
|
165
|
+
var et = m("pie-scoring", () => g()), tt = m("pie-updates", () => g()), nt = m("pie-initialization", () => g()), it = {
|
|
166
|
+
buildServiceBase: ae,
|
|
167
|
+
bundleType: C.player,
|
|
161
168
|
env: {
|
|
162
169
|
mode: "gather",
|
|
163
170
|
role: "student"
|
|
164
171
|
}
|
|
165
|
-
},
|
|
166
|
-
function
|
|
172
|
+
}, st = m("asset-handler", () => g()), ot = m("authoring", () => g());
|
|
173
|
+
function Z(e) {
|
|
167
174
|
if (!e || typeof e != "object") return !1;
|
|
168
175
|
const t = e;
|
|
169
176
|
return typeof t.providerId == "string" && typeof t.providerName == "string" && typeof t.initialize == "function" && typeof t.trackError == "function" && typeof t.trackEvent == "function" && typeof t.destroy == "function" && typeof t.isReady == "function";
|
|
170
177
|
}
|
|
171
|
-
var
|
|
172
|
-
function
|
|
178
|
+
var fe = m("instrumentation-event-bridge", () => g());
|
|
179
|
+
function ve(e) {
|
|
173
180
|
return e && typeof e == "object" ? e : typeof e > "u" ? {} : { value: e };
|
|
174
181
|
}
|
|
175
|
-
function
|
|
176
|
-
|
|
182
|
+
function ye(e) {
|
|
183
|
+
fe.warn(`[InstrumentationEventBridge:${e}] Ignoring invalid instrumentation provider; expected InstrumentationProvider contract`);
|
|
177
184
|
}
|
|
178
|
-
function
|
|
185
|
+
function be(e) {
|
|
179
186
|
try {
|
|
180
187
|
e.provider.trackError(e.error instanceof Error ? e.error : new Error(String(e.error ?? "Unknown instrumentation bridge error")), {
|
|
181
188
|
component: e.component,
|
|
@@ -185,44 +192,44 @@ function ae(e) {
|
|
|
185
192
|
} catch {
|
|
186
193
|
}
|
|
187
194
|
}
|
|
188
|
-
function
|
|
195
|
+
function Se(e) {
|
|
189
196
|
if (!e.host || !e.eventMap.length) return () => {
|
|
190
197
|
};
|
|
191
198
|
if (!e.instrumentationProvider) return () => {
|
|
192
199
|
};
|
|
193
|
-
if (!
|
|
194
|
-
return e.debug &&
|
|
200
|
+
if (!Z(e.instrumentationProvider))
|
|
201
|
+
return e.debug && ye(e.component), () => {
|
|
195
202
|
};
|
|
196
|
-
const t = e.instrumentationProvider,
|
|
203
|
+
const t = e.instrumentationProvider, n = [], i = Math.max(0, e.dedupeWindowMs ?? 0), s = /* @__PURE__ */ new Map(), o = (r, l) => {
|
|
197
204
|
const d = [
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
205
|
+
l.assessmentId,
|
|
206
|
+
l.sectionId,
|
|
207
|
+
l.attemptId,
|
|
208
|
+
l.itemId,
|
|
209
|
+
l.canonicalItemId,
|
|
210
|
+
l.sourceRuntimeId
|
|
204
211
|
].map((u) => String(u ?? "")).join("|");
|
|
205
212
|
return `${r.instrumentationEventName}|${d}`;
|
|
206
213
|
};
|
|
207
214
|
for (const r of e.eventMap) {
|
|
208
|
-
const
|
|
215
|
+
const l = (d) => {
|
|
209
216
|
try {
|
|
210
217
|
if (!t.isReady() || e.shouldTrackEvent && !e.shouldTrackEvent(d)) return;
|
|
211
|
-
const u =
|
|
218
|
+
const u = ve(d.detail), f = (/* @__PURE__ */ new Date()).toISOString(), c = {
|
|
212
219
|
...u,
|
|
213
220
|
...e.staticAttributes,
|
|
214
221
|
component: e.component,
|
|
215
222
|
sourceEventName: r.sourceEventName,
|
|
216
|
-
timestamp:
|
|
223
|
+
timestamp: f
|
|
217
224
|
};
|
|
218
|
-
if (
|
|
219
|
-
const
|
|
220
|
-
if (typeof
|
|
221
|
-
|
|
225
|
+
if (i > 0) {
|
|
226
|
+
const p = Date.now(), k = o(r, c), R = s.get(k);
|
|
227
|
+
if (typeof R == "number" && p - R < i) return;
|
|
228
|
+
s.set(k, p);
|
|
222
229
|
}
|
|
223
|
-
t.trackEvent(r.instrumentationEventName, { ...
|
|
230
|
+
t.trackEvent(r.instrumentationEventName, { ...c });
|
|
224
231
|
} catch (u) {
|
|
225
|
-
|
|
232
|
+
be({
|
|
226
233
|
provider: t,
|
|
227
234
|
component: e.component,
|
|
228
235
|
error: u,
|
|
@@ -230,43 +237,43 @@ function ce(e) {
|
|
|
230
237
|
});
|
|
231
238
|
}
|
|
232
239
|
};
|
|
233
|
-
e.host.addEventListener(r.sourceEventName,
|
|
234
|
-
e.host?.removeEventListener(r.sourceEventName,
|
|
240
|
+
e.host.addEventListener(r.sourceEventName, l), n.push(() => {
|
|
241
|
+
e.host?.removeEventListener(r.sourceEventName, l);
|
|
235
242
|
});
|
|
236
243
|
}
|
|
237
244
|
return () => {
|
|
238
|
-
for (const r of
|
|
245
|
+
for (const r of n) r();
|
|
239
246
|
};
|
|
240
247
|
}
|
|
241
|
-
var
|
|
248
|
+
var we = class {
|
|
242
249
|
constructor() {
|
|
243
|
-
|
|
250
|
+
a(this, "initialized", !1), a(this, "config", void 0);
|
|
244
251
|
}
|
|
245
252
|
trackError(e, t) {
|
|
246
253
|
if (!this.guardedOperation("trackError", e, t) || !this.applyErrorFilter(e, t)) return;
|
|
247
|
-
const
|
|
254
|
+
const n = this.transformAttributes(t);
|
|
248
255
|
try {
|
|
249
|
-
this.doTrackError(e,
|
|
250
|
-
} catch (
|
|
251
|
-
console.error(`[${this.providerName}] Error tracking error:`,
|
|
256
|
+
this.doTrackError(e, n), this.config?.debug && console.log(`[${this.providerName}] Tracked error:`, e, n);
|
|
257
|
+
} catch (i) {
|
|
258
|
+
console.error(`[${this.providerName}] Error tracking error:`, i);
|
|
252
259
|
}
|
|
253
260
|
}
|
|
254
261
|
trackEvent(e, t) {
|
|
255
262
|
if (!this.guardedOperation("trackEvent", e, t) || !this.applyEventFilter(e, t) || !this.applySampling(e)) return;
|
|
256
|
-
let
|
|
257
|
-
|
|
258
|
-
...
|
|
263
|
+
let n = this.transformAttributes(t);
|
|
264
|
+
n.timestamp || (n = {
|
|
265
|
+
...n,
|
|
259
266
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
260
267
|
});
|
|
261
268
|
try {
|
|
262
|
-
this.doTrackEvent(e,
|
|
263
|
-
} catch (
|
|
264
|
-
console.error(`[${this.providerName}] Error tracking event:`,
|
|
269
|
+
this.doTrackEvent(e, n), this.config?.debug && console.log(`[${this.providerName}] Tracked event:`, e, n);
|
|
270
|
+
} catch (i) {
|
|
271
|
+
console.error(`[${this.providerName}] Error tracking event:`, i);
|
|
265
272
|
}
|
|
266
273
|
}
|
|
267
|
-
trackMetric(e, t,
|
|
274
|
+
trackMetric(e, t, n) {
|
|
268
275
|
this.trackEvent(`metric:${e}`, {
|
|
269
|
-
...
|
|
276
|
+
...n,
|
|
270
277
|
metricValue: t,
|
|
271
278
|
metricName: e
|
|
272
279
|
});
|
|
@@ -275,8 +282,8 @@ var de = class {
|
|
|
275
282
|
if (this.guardedOperation("setUserContext", e, t))
|
|
276
283
|
try {
|
|
277
284
|
this.doSetUserContext(e, t), this.config?.debug && console.log(`[${this.providerName}] Set user context:`, e, t);
|
|
278
|
-
} catch (
|
|
279
|
-
console.error(`[${this.providerName}] Error setting user context:`,
|
|
285
|
+
} catch (n) {
|
|
286
|
+
console.error(`[${this.providerName}] Error setting user context:`, n);
|
|
280
287
|
}
|
|
281
288
|
}
|
|
282
289
|
setGlobalAttributes(e) {
|
|
@@ -302,9 +309,9 @@ var de = class {
|
|
|
302
309
|
transformAttributes(e) {
|
|
303
310
|
return this.config?.attributeTransformer ? this.config.attributeTransformer(e) : e;
|
|
304
311
|
}
|
|
305
|
-
},
|
|
312
|
+
}, Ae = class extends we {
|
|
306
313
|
constructor(...e) {
|
|
307
|
-
super(...e),
|
|
314
|
+
super(...e), a(this, "providerId", "newrelic"), a(this, "providerName", "New Relic");
|
|
308
315
|
}
|
|
309
316
|
async initialize(e) {
|
|
310
317
|
this.config = e, typeof window < "u" && window.newrelic ? (this.initialized = !0, this.config?.debug && console.log("[NewRelicProvider] Initialized successfully")) : (this.config?.debug && console.warn("[NewRelicProvider] New Relic not available (window.newrelic not found)"), this.initialized = !1);
|
|
@@ -322,22 +329,22 @@ var de = class {
|
|
|
322
329
|
window.newrelic.addPageAction(e, t);
|
|
323
330
|
}
|
|
324
331
|
doSetUserContext(e, t) {
|
|
325
|
-
const
|
|
326
|
-
if (
|
|
332
|
+
const n = window.newrelic;
|
|
333
|
+
if (n.setUserId && n.setUserId(e), t && n.setCustomAttribute) for (const [i, s] of Object.entries(t)) n.setCustomAttribute(i, s);
|
|
327
334
|
}
|
|
328
335
|
doSetGlobalAttributes(e) {
|
|
329
336
|
const t = window.newrelic;
|
|
330
|
-
if (t.setCustomAttribute) for (const [
|
|
337
|
+
if (t.setCustomAttribute) for (const [n, i] of Object.entries(e)) t.setCustomAttribute(n, i);
|
|
331
338
|
}
|
|
332
339
|
};
|
|
333
|
-
function
|
|
340
|
+
function M(e) {
|
|
334
341
|
return e && typeof e == "object" ? e : {};
|
|
335
342
|
}
|
|
336
|
-
function
|
|
337
|
-
const t =
|
|
343
|
+
function F(e) {
|
|
344
|
+
const t = M(M(e).loaderConfig);
|
|
338
345
|
return Object.keys(t).length > 0 ? t : null;
|
|
339
346
|
}
|
|
340
|
-
function
|
|
347
|
+
function B(e) {
|
|
341
348
|
if (!e || !("instrumentationProvider" in e)) return { kind: "unset" };
|
|
342
349
|
const t = e.instrumentationProvider;
|
|
343
350
|
return t === null ? { kind: "null" } : typeof t > "u" ? { kind: "unset" } : {
|
|
@@ -345,35 +352,35 @@ function _(e) {
|
|
|
345
352
|
value: t
|
|
346
353
|
};
|
|
347
354
|
}
|
|
348
|
-
function
|
|
355
|
+
function _(e) {
|
|
349
356
|
if (!e || !("trackPageActions" in e)) return;
|
|
350
357
|
const t = e.trackPageActions;
|
|
351
358
|
return typeof t == "boolean" ? t : void 0;
|
|
352
359
|
}
|
|
353
|
-
function
|
|
360
|
+
function Ie(e, t) {
|
|
354
361
|
return e.kind === "value" || e.kind === "null" ? e : t;
|
|
355
362
|
}
|
|
356
|
-
var
|
|
357
|
-
function
|
|
358
|
-
return
|
|
363
|
+
var S, Ee = m("instrumentation-provider-resolution", () => g());
|
|
364
|
+
function Pe() {
|
|
365
|
+
return S || (S = new Ae(), S.initialize()), S;
|
|
359
366
|
}
|
|
360
|
-
function
|
|
361
|
-
const t =
|
|
367
|
+
function Ce(e) {
|
|
368
|
+
const t = F(e.runtimePlayer), n = F(e.player), i = _(t), s = _(n), o = i ?? s ?? !1, r = Ie(B(t), B(n));
|
|
362
369
|
if (r.kind !== "null") {
|
|
363
|
-
if (r.kind === "unset") return
|
|
364
|
-
if (
|
|
370
|
+
if (r.kind === "unset") return o ? Pe() : void 0;
|
|
371
|
+
if (Z(r.value)) return r.value;
|
|
365
372
|
if (e.debug) {
|
|
366
|
-
const
|
|
367
|
-
|
|
373
|
+
const l = e.component ? `[${e.component}] ` : "";
|
|
374
|
+
Ee.warn(`${l}Ignoring invalid instrumentation provider; expected InstrumentationProvider contract`);
|
|
368
375
|
}
|
|
369
376
|
}
|
|
370
377
|
}
|
|
371
|
-
var
|
|
378
|
+
var rt = Object.freeze([
|
|
372
379
|
"composed",
|
|
373
380
|
"engine-ready",
|
|
374
381
|
"interactive",
|
|
375
382
|
"disposed"
|
|
376
|
-
]),
|
|
383
|
+
]), ke = [
|
|
377
384
|
{
|
|
378
385
|
sourceEventName: "assessment-controller-ready",
|
|
379
386
|
instrumentationEventName: "pie-assessment-controller-ready"
|
|
@@ -406,7 +413,7 @@ var Ye = Object.freeze([
|
|
|
406
413
|
sourceEventName: "assessment-error",
|
|
407
414
|
instrumentationEventName: "pie-assessment-error"
|
|
408
415
|
}
|
|
409
|
-
],
|
|
416
|
+
], at = /* @__PURE__ */ new Set([
|
|
410
417
|
"id",
|
|
411
418
|
"element",
|
|
412
419
|
.../* @__PURE__ */ new Set([
|
|
@@ -415,105 +422,801 @@ var Ye = Object.freeze([
|
|
|
415
422
|
"timestamp",
|
|
416
423
|
"sourceRuntimeId"
|
|
417
424
|
])
|
|
418
|
-
]),
|
|
419
|
-
function
|
|
420
|
-
|
|
425
|
+
]), lt = m("pie-overrides", () => g()), Re = { "nl-NL": () => import("./nl-NL-BnK-g-oc.js") }, Ne = ["en-US", "nl-NL"];
|
|
426
|
+
async function Te(e) {
|
|
427
|
+
const t = Re[e];
|
|
428
|
+
if (!t) throw new Error(`No bundled i18n catalog for locale: ${e}`);
|
|
429
|
+
return (await t()).default;
|
|
421
430
|
}
|
|
422
|
-
function
|
|
423
|
-
return e.replace(/
|
|
431
|
+
function b(e) {
|
|
432
|
+
return e ? e.trim().replace(/_/g, "-").split(/[.@]/)[0].toLowerCase() : "";
|
|
424
433
|
}
|
|
425
|
-
function
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
434
|
+
function Le(e) {
|
|
435
|
+
const t = b(e);
|
|
436
|
+
if (!t) return [];
|
|
437
|
+
const n = t.split("-"), i = [];
|
|
438
|
+
for (let s = n.length; s > 0; s--) {
|
|
439
|
+
const o = n.slice(0, s);
|
|
440
|
+
o.length > 1 && o[o.length - 1].length === 1 || i.push(o.join("-"));
|
|
441
|
+
}
|
|
442
|
+
return i;
|
|
429
443
|
}
|
|
430
|
-
function
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
return null;
|
|
444
|
+
function xe(e, t) {
|
|
445
|
+
for (const n of Le(e)) {
|
|
446
|
+
const i = t.find((s) => b(s) === n);
|
|
447
|
+
if (i != null) return i;
|
|
435
448
|
}
|
|
436
449
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
450
|
+
var De = {
|
|
451
|
+
common: {
|
|
452
|
+
close: "Close",
|
|
453
|
+
cancel: "Cancel",
|
|
454
|
+
save: "Save",
|
|
455
|
+
reset: "Reset",
|
|
456
|
+
retry: "Retry",
|
|
457
|
+
back: "Back",
|
|
458
|
+
next: "Next",
|
|
459
|
+
previous: "Previous",
|
|
460
|
+
submit: "Submit",
|
|
461
|
+
continue: "Continue",
|
|
462
|
+
finish: "Finish",
|
|
463
|
+
yes: "Yes",
|
|
464
|
+
no: "No",
|
|
465
|
+
ok: "OK",
|
|
466
|
+
any: "Any",
|
|
467
|
+
off: "Off",
|
|
468
|
+
auto: "Auto",
|
|
469
|
+
all: "All",
|
|
470
|
+
none: "None",
|
|
471
|
+
loading: "Loading…",
|
|
472
|
+
error: "Error",
|
|
473
|
+
settings: "Settings",
|
|
474
|
+
language: "Language",
|
|
475
|
+
theme: "Theme",
|
|
476
|
+
preview: "Preview",
|
|
477
|
+
author: "Author",
|
|
478
|
+
unknown: "Unknown",
|
|
479
|
+
untitled: "Untitled",
|
|
480
|
+
apply: "Apply",
|
|
481
|
+
enabled: "Enabled",
|
|
482
|
+
disabled: "Disabled",
|
|
483
|
+
closeA11y: "Close",
|
|
484
|
+
settingsA11y: "Open settings menu"
|
|
485
|
+
},
|
|
486
|
+
player: {
|
|
487
|
+
passage: "Passage",
|
|
488
|
+
passages: "Passages",
|
|
489
|
+
question: "Question",
|
|
490
|
+
questionNumbered: "Question {position}",
|
|
491
|
+
questions: "Questions",
|
|
492
|
+
items: "Items",
|
|
493
|
+
section: "Section",
|
|
494
|
+
loadingSection: "Loading section content…",
|
|
495
|
+
loadingPassage: "Loading passage content…",
|
|
496
|
+
configurationError: "Configuration Error",
|
|
497
|
+
playerError: "Player Error",
|
|
498
|
+
authoringBackendError: "Authoring Backend Configuration Error",
|
|
499
|
+
itemLoadError: "Question could not be loaded.",
|
|
500
|
+
sectionTabsA11y: "Section content tabs",
|
|
501
|
+
passagesRegionA11y: "Passages",
|
|
502
|
+
itemsRegionA11y: "Items",
|
|
503
|
+
sectionToolsA11y: "Section tools",
|
|
504
|
+
scrollDownA11y: "Scroll down",
|
|
505
|
+
resizePanels: "Resize panels",
|
|
506
|
+
resizePassagesAndItemsA11y: "Resize passages and items panels",
|
|
507
|
+
resizeMediaRegion: "Resize media region",
|
|
508
|
+
resizeQuestionAndMediaA11y: "Resize question and media panels",
|
|
509
|
+
resizePassageAndMediaA11y: "Resize passage and media panels",
|
|
510
|
+
assessment: {
|
|
511
|
+
sectionPosition: "Section {position} of {total}",
|
|
512
|
+
noSections: "No sections"
|
|
458
513
|
},
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
514
|
+
formative: {
|
|
515
|
+
checkAnswer: "Check answer",
|
|
516
|
+
tryAgain: "Try again",
|
|
517
|
+
answerRecorded: "Answer recorded.",
|
|
518
|
+
correct: "Correct.",
|
|
519
|
+
partlyCorrect: "Partly correct.",
|
|
520
|
+
notCorrect: "Not correct.",
|
|
521
|
+
notAutoScored: "Answer recorded. This question is not scored automatically.",
|
|
522
|
+
checkFailed: "This question could not be checked. Try again.",
|
|
523
|
+
triesLeft: {
|
|
524
|
+
one: "{count} try left.",
|
|
525
|
+
other: "{count} tries left."
|
|
526
|
+
}
|
|
462
527
|
},
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
528
|
+
timedMedia: {
|
|
529
|
+
waitingForMedia: "Questions will appear as the media plays.",
|
|
530
|
+
questionAvailable: "Question {position} is now available.",
|
|
531
|
+
playbackPaused: "Playback paused. Answer question {position} to continue.",
|
|
532
|
+
playbackAdvisory: "Answer question {position} before continuing with the media.",
|
|
533
|
+
playbackReleased: "Answer accepted. Continue playing the media."
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
toolkit: {
|
|
537
|
+
toolsA11y: "Assessment tools",
|
|
538
|
+
toolbarInitError: "Unable to initialize assessment toolkit.",
|
|
539
|
+
settingsTitle: "Settings",
|
|
540
|
+
closeSettingsA11y: "Close settings",
|
|
541
|
+
dragPanelA11y: "Drag panel",
|
|
542
|
+
closePanelA11y: "Close panel",
|
|
543
|
+
resizeWindow: "Resize window",
|
|
544
|
+
minimize: "Minimize",
|
|
545
|
+
maximize: "Maximize",
|
|
546
|
+
minimizePanelA11y: "Minimize panel",
|
|
547
|
+
maximizePanelA11y: "Maximize panel",
|
|
548
|
+
window: {
|
|
549
|
+
moveLeftA11y: "Move tool left",
|
|
550
|
+
moveRightA11y: "Move tool right",
|
|
551
|
+
moveUpA11y: "Move tool up",
|
|
552
|
+
moveDownA11y: "Move tool down",
|
|
553
|
+
shrinkA11y: "Shrink tool window",
|
|
554
|
+
growA11y: "Grow tool window",
|
|
555
|
+
centerA11y: "Center tool window",
|
|
556
|
+
closeA11y: "Close tool"
|
|
557
|
+
},
|
|
558
|
+
announce: {
|
|
559
|
+
movedUp: "Moved up to {position}",
|
|
560
|
+
movedDown: "Moved down to {position}",
|
|
561
|
+
movedLeft: "Moved left to {position}",
|
|
562
|
+
movedRight: "Moved right to {position}",
|
|
563
|
+
rotatedTo: "Rotated to {degrees} degrees"
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
tools: {
|
|
567
|
+
calculator: {
|
|
568
|
+
name: "Calculator",
|
|
569
|
+
nameBasic: "Basic Calculator",
|
|
570
|
+
nameScientific: "Scientific Calculator",
|
|
571
|
+
nameGraphing: "Graphing Calculator",
|
|
572
|
+
description: "Multi-type calculator (basic, scientific, graphing)",
|
|
573
|
+
openedBasic: "Basic calculator opened",
|
|
574
|
+
openedScientific: "Scientific calculator opened",
|
|
575
|
+
openedGraphing: "Graphing calculator opened",
|
|
576
|
+
closedBasic: "Basic calculator closed",
|
|
577
|
+
closedScientific: "Scientific calculator closed",
|
|
578
|
+
closedGraphing: "Graphing calculator closed",
|
|
579
|
+
toolA11y: "Calculator tool",
|
|
580
|
+
loading: "Loading calculator…",
|
|
581
|
+
providerUnavailable: "The calculator is unavailable."
|
|
582
|
+
},
|
|
583
|
+
graph: {
|
|
584
|
+
name: "Graph",
|
|
585
|
+
description: "Graphing calculator and coordinate plane",
|
|
586
|
+
buttonA11y: "Graph, graphing calculator",
|
|
587
|
+
tooltip: "Graph",
|
|
588
|
+
toolA11y: "Graph tool — draw points and lines on a coordinate grid",
|
|
589
|
+
canvasA11y: "Graph canvas — use tools to add points and draw lines",
|
|
590
|
+
grid: "Grid:",
|
|
591
|
+
gridOpacityA11y: "Grid opacity",
|
|
592
|
+
pointA11y: "Graph point {id}",
|
|
593
|
+
modeSelector: "Selector",
|
|
594
|
+
modeSelectorHint: "Selector: click and drag points to move them or associated lines.",
|
|
595
|
+
modePoint: "Point",
|
|
596
|
+
modePointHint: "Point: click on the grid to add points.",
|
|
597
|
+
modeLine: "Line",
|
|
598
|
+
modeLineHint: "Line: click a starting point, then an ending point to draw a line.",
|
|
599
|
+
modeDelete: "Delete",
|
|
600
|
+
modeDeleteHint: "Delete: click on a point to delete it and any connected lines."
|
|
601
|
+
},
|
|
602
|
+
periodicTable: {
|
|
603
|
+
name: "Periodic Table",
|
|
604
|
+
description: "Chemistry periodic table reference",
|
|
605
|
+
buttonA11y: "Periodic Table, chemistry reference",
|
|
606
|
+
tooltip: "Periodic Table",
|
|
607
|
+
toolA11y: "Periodic table — select an element to view its details",
|
|
608
|
+
elementsA11y: "Periodic table elements",
|
|
609
|
+
showAllA11y: "Show all elements",
|
|
610
|
+
allElements: "All Elements",
|
|
611
|
+
atomicMass: "Atomic Mass",
|
|
612
|
+
atomicNumber: "Atomic No",
|
|
613
|
+
electronConfig: "Electron Config",
|
|
614
|
+
phase: "Phase",
|
|
615
|
+
filterByA11y: "Filter by {category}",
|
|
616
|
+
elementA11y: "{name}, Symbol: {symbol}, Atomic number: {number}, Atomic mass: {mass}, Category: {category}",
|
|
617
|
+
outsideFilterA11y: ", outside the current filter",
|
|
618
|
+
category: {
|
|
619
|
+
unknown: "Unknown",
|
|
620
|
+
alkaliMetal: "Alkali Metal",
|
|
621
|
+
alkalineEarthMetal: "Alkaline Earth Metal",
|
|
622
|
+
transitionMetal: "Transition Metal",
|
|
623
|
+
postTransitionMetal: "Post-transition Metal",
|
|
624
|
+
metalloid: "Metalloid",
|
|
625
|
+
diatomicNonmetal: "Diatomic Nonmetal",
|
|
626
|
+
polyatomicNonmetal: "Polyatomic Nonmetal",
|
|
627
|
+
nobleGas: "Noble Gas",
|
|
628
|
+
lanthanide: "Lanthanide",
|
|
629
|
+
actinide: "Actinide"
|
|
477
630
|
}
|
|
631
|
+
},
|
|
632
|
+
ruler: {
|
|
633
|
+
name: "Ruler",
|
|
634
|
+
description: "On-screen ruler for measurements",
|
|
635
|
+
buttonA11y: "Ruler",
|
|
636
|
+
tooltip: "Ruler",
|
|
637
|
+
toolA11y: "Draggable and rotatable ruler measurement tool",
|
|
638
|
+
unitSelectionA11y: "Ruler unit selection",
|
|
639
|
+
inches: "Inches",
|
|
640
|
+
centimeters: "Centimeters",
|
|
641
|
+
inchesInSentence: "inches",
|
|
642
|
+
centimetersInSentence: "centimeters",
|
|
643
|
+
switchToInchesA11y: "Switch to inches",
|
|
644
|
+
switchToCentimetersA11y: "Switch to centimeters",
|
|
645
|
+
switchedTo: "Switched to {unit}",
|
|
646
|
+
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}",
|
|
647
|
+
imageAlt: "Ruler showing {unit}"
|
|
648
|
+
},
|
|
649
|
+
protractor: {
|
|
650
|
+
name: "Protractor",
|
|
651
|
+
description: "On-screen protractor for angle measurements",
|
|
652
|
+
buttonA11y: "Protractor",
|
|
653
|
+
tooltip: "Protractor",
|
|
654
|
+
toolA11y: "Protractor tool. Use arrow keys to move, Shift+arrows to rotate, and PageUp or PageDown for fine rotation.",
|
|
655
|
+
roleA11y: "Draggable and rotatable protractor measurement tool",
|
|
656
|
+
imageAlt: "Protractor with 180-degree semicircular scale marked from 0 to 180 degrees in both directions, with degree markings every 10 degrees"
|
|
657
|
+
},
|
|
658
|
+
dictionary: {
|
|
659
|
+
name: "Dictionary",
|
|
660
|
+
description: "Look up word definitions",
|
|
661
|
+
buttonA11y: "Dictionary, look up word definitions",
|
|
662
|
+
tooltip: "Dictionary",
|
|
663
|
+
toolA11y: "Dictionary"
|
|
664
|
+
},
|
|
665
|
+
pictureDictionary: {
|
|
666
|
+
name: "Picture Dictionary",
|
|
667
|
+
description: "Look up pictures for words",
|
|
668
|
+
buttonA11y: "Picture Dictionary, look up pictures for words",
|
|
669
|
+
tooltip: "Picture Dictionary",
|
|
670
|
+
toolA11y: "Picture Dictionary"
|
|
671
|
+
},
|
|
672
|
+
dictionarySpanish: {
|
|
673
|
+
name: "Spanish Dictionary",
|
|
674
|
+
description: "Look up word definitions in Spanish",
|
|
675
|
+
buttonA11y: "Spanish Dictionary, look up word definitions in Spanish",
|
|
676
|
+
tooltip: "Spanish Dictionary",
|
|
677
|
+
toolA11y: "Spanish Dictionary"
|
|
678
|
+
},
|
|
679
|
+
pictureDictionarySpanish: {
|
|
680
|
+
name: "Spanish Picture Dictionary",
|
|
681
|
+
description: "Look up pictures for words in Spanish",
|
|
682
|
+
buttonA11y: "Spanish Picture Dictionary, look up pictures for words in Spanish",
|
|
683
|
+
tooltip: "Spanish Picture Dictionary",
|
|
684
|
+
toolA11y: "Spanish Picture Dictionary"
|
|
685
|
+
},
|
|
686
|
+
lineReader: {
|
|
687
|
+
name: "Line Reader",
|
|
688
|
+
description: "Reading guide overlay",
|
|
689
|
+
buttonA11y: "Line Reader, reading guide",
|
|
690
|
+
tooltip: "Line Reader",
|
|
691
|
+
roleA11y: "Draggable and resizable reading guide overlay",
|
|
692
|
+
close: "Close line reader",
|
|
693
|
+
resizeWindowA11y: "Drag to resize the reading window",
|
|
694
|
+
resizeFrameA11y: "Drag to resize the frame and window width",
|
|
695
|
+
windowHeightAnnounce: "Reading window height {pixels} pixels",
|
|
696
|
+
frameHeightAnnounce: "Frame height {pixels} pixels",
|
|
697
|
+
widthAnnounce: "Width {pixels} pixels",
|
|
698
|
+
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",
|
|
699
|
+
resizeWindowFullA11y: "Resize the reading window. Drag, or use the up and down arrow keys to change its height. Current height {paneHeight} pixels",
|
|
700
|
+
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"
|
|
701
|
+
},
|
|
702
|
+
answerEliminator: {
|
|
703
|
+
name: "Answer Eliminator",
|
|
704
|
+
description: "Strike through answer choices",
|
|
705
|
+
buttonA11y: "Strike Through, eliminate answer choices",
|
|
706
|
+
tooltip: "Strike Through"
|
|
707
|
+
},
|
|
708
|
+
highlighter: {
|
|
709
|
+
name: "Highlighter",
|
|
710
|
+
description: "Highlight and annotate text",
|
|
711
|
+
buttonA11y: "Highlight text",
|
|
712
|
+
tooltip: "Highlight"
|
|
713
|
+
},
|
|
714
|
+
annotationToolbar: {
|
|
715
|
+
name: "Annotation",
|
|
716
|
+
description: "Highlight and annotate text",
|
|
717
|
+
buttonA11y: "Annotate, highlight and mark up text",
|
|
718
|
+
tooltip: "Annotate",
|
|
719
|
+
toolbarA11y: "Text annotation toolbar",
|
|
720
|
+
underline: "Underline",
|
|
721
|
+
underlineA11y: "Underline selected text",
|
|
722
|
+
readAloud: "Read Aloud",
|
|
723
|
+
readAloudA11y: "Read selected text aloud",
|
|
724
|
+
remove: "Remove",
|
|
725
|
+
removeA11y: "Remove this annotation",
|
|
726
|
+
clearAll: "Clear All",
|
|
727
|
+
clearAllA11y: "Clear all annotations from document",
|
|
728
|
+
highlightYellowA11y: "Yellow highlight",
|
|
729
|
+
highlightPinkA11y: "Pink highlight",
|
|
730
|
+
highlightBlueA11y: "Blue highlight",
|
|
731
|
+
highlightGreenA11y: "Green highlight"
|
|
732
|
+
},
|
|
733
|
+
theme: {
|
|
734
|
+
name: "Theme",
|
|
735
|
+
description: "Accessible themes and contrast",
|
|
736
|
+
buttonA11y: "Theme, change colors and contrast",
|
|
737
|
+
tooltip: "Theme",
|
|
738
|
+
selectorA11y: "Theme selector",
|
|
739
|
+
hint: "Select a theme to improve readability and reduce eye strain.",
|
|
740
|
+
selectA11y: "Select theme",
|
|
741
|
+
selectCurrentA11y: "Select theme. Current theme: {name}",
|
|
742
|
+
optionUnavailableA11y: "{name}, unavailable",
|
|
743
|
+
unavailableName: "Unavailable theme: {id}",
|
|
744
|
+
unavailableDescription: "PIE's managed base theme remains active until this theme becomes available again.",
|
|
745
|
+
unavailableStatus: "The selected theme is unavailable. PIE's managed base theme is active until it becomes available again."
|
|
746
|
+
},
|
|
747
|
+
textToSpeech: {
|
|
748
|
+
name: "Text to Speech",
|
|
749
|
+
description: "Read content aloud",
|
|
750
|
+
toolA11y: "Text-to-speech tool",
|
|
751
|
+
title: "Text-to-Speech",
|
|
752
|
+
initializing: "Initializing…",
|
|
753
|
+
initFailed: "Failed to initialize text-to-speech.",
|
|
754
|
+
selectText: "Select text on the page to read it aloud.",
|
|
755
|
+
speed: "Speed:",
|
|
756
|
+
play: "Play",
|
|
757
|
+
pause: "Pause",
|
|
758
|
+
resume: "Resume",
|
|
759
|
+
stop: "Stop",
|
|
760
|
+
speaking: "Speaking…",
|
|
761
|
+
paused: "Paused",
|
|
762
|
+
charactersSelected: {
|
|
763
|
+
one: "{count} character selected",
|
|
764
|
+
other: "{count} characters selected"
|
|
765
|
+
},
|
|
766
|
+
rate: {
|
|
767
|
+
slow: "Slow",
|
|
768
|
+
slower: "Slower",
|
|
769
|
+
normal: "Normal",
|
|
770
|
+
faster: "Faster",
|
|
771
|
+
fast: "Fast",
|
|
772
|
+
veryFast: "Very Fast"
|
|
773
|
+
},
|
|
774
|
+
inline: {
|
|
775
|
+
controlsA11y: "Reading controls",
|
|
776
|
+
playbackSpeedA11y: "Playback speed",
|
|
777
|
+
rewindA11y: "Rewind",
|
|
778
|
+
fastForwardA11y: "Fast-forward",
|
|
779
|
+
stopA11y: "Stop reading",
|
|
780
|
+
initializing: "Initializing text-to-speech",
|
|
781
|
+
initFailed: "Unable to initialize text-to-speech. Try again.",
|
|
782
|
+
starting: "Starting reading",
|
|
783
|
+
started: "Reading started",
|
|
784
|
+
resumed: "Reading resumed",
|
|
785
|
+
pausedAnnouncement: "Reading paused",
|
|
786
|
+
stopped: "Reading stopped",
|
|
787
|
+
switchedSection: "Reading switched to another section",
|
|
788
|
+
startFailed: "Unable to start reading",
|
|
789
|
+
skippedForward: "Skipped forward",
|
|
790
|
+
skipForwardFailed: "Unable to skip forward",
|
|
791
|
+
skippedBackward: "Skipped backward",
|
|
792
|
+
skipBackwardFailed: "Unable to skip backward",
|
|
793
|
+
speedChangeFailed: "Unable to change playback speed",
|
|
794
|
+
speedAnnounce: "Playback speed {label}",
|
|
795
|
+
playA11y: "Play reading",
|
|
796
|
+
pauseA11y: "Pause reading",
|
|
797
|
+
resumeA11y: "Resume reading"
|
|
798
|
+
}
|
|
799
|
+
},
|
|
800
|
+
signLanguage: {
|
|
801
|
+
name: "Sign Language",
|
|
802
|
+
description: "Signed alternate for authored content",
|
|
803
|
+
generic: "Sign language",
|
|
804
|
+
unknown: "Sign language ({code})",
|
|
805
|
+
ase: "American Sign Language",
|
|
806
|
+
bfi: "British Sign Language",
|
|
807
|
+
fsl: "French Sign Language",
|
|
808
|
+
gss: "Greek Sign Language",
|
|
809
|
+
mfs: "Mexican Sign Language",
|
|
810
|
+
signedEnglish: "Signed English",
|
|
811
|
+
regionA11y: "{language} translation"
|
|
812
|
+
},
|
|
813
|
+
audioTranscript: {
|
|
814
|
+
name: "Audio Transcript",
|
|
815
|
+
description: "Text transcript of audio content",
|
|
816
|
+
regionA11y: "Transcript"
|
|
478
817
|
}
|
|
479
|
-
}
|
|
818
|
+
},
|
|
819
|
+
debug: {
|
|
820
|
+
session: "Session",
|
|
821
|
+
sessionData: "Session Data",
|
|
822
|
+
sessionDataPersistent: "PIE Session Data (Persistent)",
|
|
823
|
+
noItemSessionYet: "No item session data yet. Interact with the item to see updates here.",
|
|
824
|
+
itemSessionsSnapshot: "Item Sessions Snapshot",
|
|
825
|
+
sectionControllerUnavailable: "Section controller not available for this section yet.",
|
|
826
|
+
filteredModel: "Filtered Model",
|
|
827
|
+
environment: "Environment",
|
|
828
|
+
events: "Events",
|
|
829
|
+
controllerEvents: "Controller Events",
|
|
830
|
+
instrumentation: "Instrumentation",
|
|
831
|
+
databaseState: "Database state",
|
|
832
|
+
sessionDb: "Session DB (Server)",
|
|
833
|
+
noRows: "No rows",
|
|
834
|
+
noRecords: "No instrumentation records yet.",
|
|
835
|
+
selectRecord: "Select a record to inspect details.",
|
|
836
|
+
selectEvent: "Select an event to inspect payload details.",
|
|
837
|
+
showRawTables: "Show raw tables",
|
|
838
|
+
showReconstructedSnapshots: "Show reconstructed snapshots",
|
|
839
|
+
showSectionRequest: "Show section request",
|
|
840
|
+
showAssessmentRequest: "Show assessment request",
|
|
841
|
+
liveUpdatesUnsupported: "Live updates are not supported in this browser",
|
|
842
|
+
liveUpdatesDisconnected: "Live updates disconnected; retrying…",
|
|
843
|
+
fieldType: "Type:",
|
|
844
|
+
fieldTarget: "Target:",
|
|
845
|
+
fieldItem: "Item:",
|
|
846
|
+
fieldCanonical: "Canonical:",
|
|
847
|
+
fieldIntent: "Intent:",
|
|
848
|
+
fieldDuplicates: "Duplicates:",
|
|
849
|
+
fieldSemanticRepeats: "Semantic Repeats:",
|
|
850
|
+
dragItemSessionPanelA11y: "Drag item session panel",
|
|
851
|
+
debuggerTabsA11y: "Debugger tabs",
|
|
852
|
+
sessionDataJsonA11y: "Session data JSON",
|
|
853
|
+
environmentJsonA11y: "Environment JSON",
|
|
854
|
+
filteredModelJsonA11y: "Filtered model JSON",
|
|
855
|
+
sectionSessionJsonA11y: "Section session snapshot JSON",
|
|
856
|
+
eventLevelFilterA11y: "Event level filter",
|
|
857
|
+
controllerEventDetailsA11y: "Controller event details",
|
|
858
|
+
instrumentationFilterA11y: "Filter instrumentation record type",
|
|
859
|
+
instrumentationDetailsA11y: "Instrumentation record details",
|
|
860
|
+
toggleSessionPanelA11y: "Toggle session panel",
|
|
861
|
+
toggleEventPanelA11y: "Toggle event broadcast panel",
|
|
862
|
+
toggleDatabasePanelA11y: "Toggle database state panel",
|
|
863
|
+
toggleInstrumentationPanelA11y: "Toggle instrumentation panel",
|
|
864
|
+
pnp: {
|
|
865
|
+
title: "PNP Profile",
|
|
866
|
+
noAssessmentBound: "No assessment bound",
|
|
867
|
+
determinationReadOnly: "Determination (read-only)",
|
|
868
|
+
toolsEditor: "Tools Editor",
|
|
869
|
+
enforcement: "PNP enforcement",
|
|
870
|
+
allAvailableTools: "All available tools",
|
|
871
|
+
clearPlacement: "Clear placement",
|
|
872
|
+
tool: "Tool",
|
|
873
|
+
placement: "Placement",
|
|
874
|
+
provider: "Provider",
|
|
875
|
+
simulation: "PNP simulation",
|
|
876
|
+
resolvedTools: "Resolved Tools (toolkit)",
|
|
877
|
+
provenanceSummary: "Tool Policy Provenance Summary",
|
|
878
|
+
perToolDecisions: "Per-Tool Decisions",
|
|
879
|
+
profileReadOnly: "PNP Profile (read-only)"
|
|
880
|
+
},
|
|
881
|
+
tts: {
|
|
882
|
+
title: "TTS settings",
|
|
883
|
+
closeA11y: "Close TTS settings",
|
|
884
|
+
toolbarLayoutMode: "Toolbar layout mode",
|
|
885
|
+
reservedRow: "Reserved row",
|
|
886
|
+
expandingRow: "Expanding row",
|
|
887
|
+
floatingOverlay: "Floating overlay",
|
|
888
|
+
leftAlignedControls: "Left-aligned controls",
|
|
889
|
+
inlineSpeedButtons: "Inline speed buttons",
|
|
890
|
+
resetToDefaults: "Reset to defaults",
|
|
891
|
+
mathHighlighting: "Math highlighting",
|
|
892
|
+
checkingAvailability: "Checking availability…",
|
|
893
|
+
recheck: "Recheck",
|
|
894
|
+
voice: "Voice",
|
|
895
|
+
bestAvailableVoice: "Best available voice (auto)",
|
|
896
|
+
unnamedVoice: "Unnamed voice",
|
|
897
|
+
apiEndpoint: "API endpoint",
|
|
898
|
+
gender: "Gender",
|
|
899
|
+
any: "Any",
|
|
900
|
+
male: "Male",
|
|
901
|
+
female: "Female",
|
|
902
|
+
neutral: "Neutral",
|
|
903
|
+
engine: "Engine",
|
|
904
|
+
neural: "Neural",
|
|
905
|
+
standard: "Standard",
|
|
906
|
+
providerDefault: "Provider default",
|
|
907
|
+
format: "Format",
|
|
908
|
+
sampleRate: "Sample rate",
|
|
909
|
+
speechMarks: "Speech marks",
|
|
910
|
+
word: "Word",
|
|
911
|
+
wordAndSentence: "Word + sentence",
|
|
912
|
+
voiceType: "Voice type",
|
|
913
|
+
wavenetVoiceType: "WaveNet",
|
|
914
|
+
studioVoiceType: "Studio",
|
|
915
|
+
plainText: "Plain text",
|
|
916
|
+
sampleText: "Sample text",
|
|
917
|
+
resetSample: "Reset sample",
|
|
918
|
+
providerAvailable: "Provider available.",
|
|
919
|
+
providerUnavailable: "Provider unavailable.",
|
|
920
|
+
providerCheckFailed: "Provider availability check failed.",
|
|
921
|
+
providerNotChecked: "Provider availability has not been checked yet.",
|
|
922
|
+
webSpeechUnavailable: "Web Speech API is not available in this browser.",
|
|
923
|
+
browserNoVoices: "Browser text-to-speech is available, but no voices were returned yet.",
|
|
924
|
+
browserUnavailable: "Browser text-to-speech is not available.",
|
|
925
|
+
googleUnavailable: "Google Cloud TTS is not available from the configured API.",
|
|
926
|
+
pollyUnavailable: "AWS Polly is not available from the configured API.",
|
|
927
|
+
recommendedVoices: "Recommended voices",
|
|
928
|
+
allVoices: "All available voices",
|
|
929
|
+
previewVoice: "Preview voice",
|
|
930
|
+
stopPreview: "Stop preview",
|
|
931
|
+
applying: "Applying…",
|
|
932
|
+
ssmlPreviewUnsupported: "SSML preview is not supported in the Browser backend.",
|
|
933
|
+
pollySsmlHint: "Some Polly neural voices reject certain SSML tags (for example emphasis). Use basic SSML tags if preview fails.",
|
|
934
|
+
mathHighlightParts: "Highlighting each part of a formula as it is read, falling back to the whole formula when alignment is uncertain.",
|
|
935
|
+
mathHighlightBlock: "Highlighting each formula as a single block instead of breaking it into parts.",
|
|
936
|
+
previewFailed: "Failed to play preview audio.",
|
|
937
|
+
previewNoAudio: "Preview response did not include audio content.",
|
|
938
|
+
previewEnterText: "Enter preview text before starting playback.",
|
|
939
|
+
previewUnavailable: "Cannot preview while this service is unavailable.",
|
|
940
|
+
browserSynthesisUnavailable: "Browser speech synthesis is unavailable.",
|
|
941
|
+
browserSynthesisEndedEarly: "Browser speech synthesis ended before audio started. Restart the browser and try again.",
|
|
942
|
+
browserSynthesisQueueFailed: "Browser speech synthesis failed to queue preview audio.",
|
|
943
|
+
browserPreviewFailed: "Failed to play browser voice preview.",
|
|
944
|
+
ssmlWordTrackingDisabled: "Google SSML preview preserves authored SSML, so word tracking is disabled.",
|
|
945
|
+
applyUnavailable: "Cannot apply settings while this service is unavailable.",
|
|
946
|
+
coordinatorUnavailable: "Toolkit coordinator is not available for text-to-speech updates."
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
}, E = "en-US", Ue = /* @__PURE__ */ new Set([
|
|
950
|
+
"ar",
|
|
951
|
+
"ckb",
|
|
952
|
+
"dv",
|
|
953
|
+
"fa",
|
|
954
|
+
"he",
|
|
955
|
+
"iw",
|
|
956
|
+
"ks",
|
|
957
|
+
"ku",
|
|
958
|
+
"nqo",
|
|
959
|
+
"ps",
|
|
960
|
+
"sd",
|
|
961
|
+
"syr",
|
|
962
|
+
"ug",
|
|
963
|
+
"ur",
|
|
964
|
+
"yi"
|
|
965
|
+
]), Me = /* @__PURE__ */ new Set([
|
|
966
|
+
"zero",
|
|
967
|
+
"one",
|
|
968
|
+
"two",
|
|
969
|
+
"few",
|
|
970
|
+
"many",
|
|
971
|
+
"other"
|
|
972
|
+
]);
|
|
973
|
+
function z(e) {
|
|
974
|
+
if (typeof e != "object" || e === null) return !1;
|
|
975
|
+
const t = Object.keys(e);
|
|
976
|
+
return t.length > 0 && t.every((n) => Me.has(n));
|
|
480
977
|
}
|
|
481
|
-
function
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
978
|
+
function O(e) {
|
|
979
|
+
try {
|
|
980
|
+
const n = new Intl.Locale(e).textInfo;
|
|
981
|
+
if (n?.direction === "rtl" || n?.direction === "ltr") return n.direction;
|
|
982
|
+
} catch {
|
|
983
|
+
}
|
|
984
|
+
const t = b(e).split("-")[0] ?? "";
|
|
985
|
+
return Ue.has(t) ? "rtl" : "ltr";
|
|
986
|
+
}
|
|
987
|
+
var X = class I {
|
|
988
|
+
constructor(t = {}) {
|
|
989
|
+
a(this, "locale", void 0), a(this, "fallbackLocale", void 0), a(this, "catalogs", void 0), a(this, "customMessages", void 0), a(this, "loading", void 0), a(this, "listeners", /* @__PURE__ */ new Set()), a(this, "config", void 0), this.config = { ...t }, this.fallbackLocale = w(t.fallbackLocale) || "en-US", this.catalogs = /* @__PURE__ */ new Map([[E, De]]), this.customMessages = { ...t.customMessages ?? {} }, this.loading = /* @__PURE__ */ new Map(), this.locale = this.resolveLocaleTag(t.locale) ?? "en-US";
|
|
990
|
+
}
|
|
991
|
+
async initialize(t) {
|
|
992
|
+
if (this.config = {
|
|
993
|
+
...this.config,
|
|
994
|
+
...t
|
|
995
|
+
}, t.customMessages) for (const [n, i] of Object.entries(t.customMessages)) this.addCustomMessages(n, i);
|
|
996
|
+
await this.setLocale(t.locale ?? this.locale);
|
|
997
|
+
}
|
|
998
|
+
getLocale() {
|
|
999
|
+
return this.locale;
|
|
1000
|
+
}
|
|
1001
|
+
async setLocale(t) {
|
|
1002
|
+
const n = this.resolveLocaleTag(t);
|
|
1003
|
+
if (!n) {
|
|
1004
|
+
this.locale = w(t) || "en-US", this.notify();
|
|
1005
|
+
return;
|
|
490
1006
|
}
|
|
491
|
-
|
|
1007
|
+
if (!this.catalogs.has(n)) {
|
|
1008
|
+
const i = this.loading.get(n);
|
|
1009
|
+
if (i) await i;
|
|
1010
|
+
else {
|
|
1011
|
+
const s = this.loadCatalog(n);
|
|
1012
|
+
this.loading.set(n, s);
|
|
1013
|
+
try {
|
|
1014
|
+
await s;
|
|
1015
|
+
} finally {
|
|
1016
|
+
this.loading.delete(n);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
this.locale = n, this.notify();
|
|
1021
|
+
}
|
|
1022
|
+
t(t, n) {
|
|
1023
|
+
const i = this.lookup(t);
|
|
1024
|
+
return i === void 0 ? (this.config.onMissingKey?.(t, this.locale), t) : G(i, n);
|
|
1025
|
+
}
|
|
1026
|
+
plural(t, n) {
|
|
1027
|
+
const i = this.lookupNode(t);
|
|
1028
|
+
return i === void 0 || !z(i) ? this.t(t, n) : G(i[this.selectPluralCategory(n.count)] ?? i.other, n);
|
|
1029
|
+
}
|
|
1030
|
+
getDirection() {
|
|
1031
|
+
return O(this.locale);
|
|
1032
|
+
}
|
|
1033
|
+
getAvailableLocales() {
|
|
1034
|
+
return [.../* @__PURE__ */ new Set([
|
|
1035
|
+
...this.catalogs.keys(),
|
|
1036
|
+
...this.config.availableLocales ?? [],
|
|
1037
|
+
...Object.keys(this.customMessages)
|
|
1038
|
+
])];
|
|
1039
|
+
}
|
|
1040
|
+
isLocaleLoaded(t) {
|
|
1041
|
+
const n = this.resolveLocaleTag(t);
|
|
1042
|
+
return n !== void 0 && this.catalogs.has(n);
|
|
1043
|
+
}
|
|
1044
|
+
subscribe(t) {
|
|
1045
|
+
return this.listeners.add(t), () => {
|
|
1046
|
+
this.listeners.delete(t);
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
hasKey(t) {
|
|
1050
|
+
return this.lookup(t) !== void 0;
|
|
1051
|
+
}
|
|
1052
|
+
addCustomMessages(t, n) {
|
|
1053
|
+
const i = w(t);
|
|
1054
|
+
this.customMessages[i] = ee(this.customMessages[i] ?? {}, n), this.notify();
|
|
1055
|
+
}
|
|
1056
|
+
withLocale(t) {
|
|
1057
|
+
const n = this.resolveLocaleTag(t) ?? w(t);
|
|
1058
|
+
if (n === this.locale) return this;
|
|
1059
|
+
const i = new I({
|
|
1060
|
+
...this.config,
|
|
1061
|
+
locale: n
|
|
1062
|
+
});
|
|
1063
|
+
return i.locale = n || "en-US", i.catalogs = this.catalogs, i.customMessages = this.customMessages, i.loading = this.loading, i;
|
|
1064
|
+
}
|
|
1065
|
+
formatNumber(t, n) {
|
|
1066
|
+
try {
|
|
1067
|
+
return new Intl.NumberFormat(this.locale, n).format(t);
|
|
1068
|
+
} catch {
|
|
1069
|
+
return new Intl.NumberFormat(E, n).format(t);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
formatDate(t, n) {
|
|
1073
|
+
try {
|
|
1074
|
+
return new Intl.DateTimeFormat(this.locale, n).format(t);
|
|
1075
|
+
} catch {
|
|
1076
|
+
return new Intl.DateTimeFormat(E, n).format(t);
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
getBundle(t = this.locale) {
|
|
1080
|
+
const n = this.resolveLocaleTag(t);
|
|
1081
|
+
if (!n) return;
|
|
1082
|
+
const i = this.catalogs.get(n);
|
|
1083
|
+
if (i)
|
|
1084
|
+
return {
|
|
1085
|
+
locale: n,
|
|
1086
|
+
translations: i,
|
|
1087
|
+
direction: O(n)
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
resolveLocaleTag(t) {
|
|
1091
|
+
if (!t) return;
|
|
1092
|
+
const n = this.getAvailableLocales(), i = xe(t, n);
|
|
1093
|
+
if (i) return i;
|
|
1094
|
+
const s = b(t).split("-")[0];
|
|
1095
|
+
if (s)
|
|
1096
|
+
return n.find((o) => b(o).split("-")[0] === s);
|
|
1097
|
+
}
|
|
1098
|
+
async loadCatalog(t) {
|
|
1099
|
+
const n = this.config.loadCatalog;
|
|
1100
|
+
if (n)
|
|
1101
|
+
try {
|
|
1102
|
+
this.catalogs.set(t, await n(t));
|
|
1103
|
+
} catch (i) {
|
|
1104
|
+
throw new Error(`Failed to load i18n catalog for locale: ${t}`, { cause: i });
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
lookupNode(t) {
|
|
1108
|
+
const n = [
|
|
1109
|
+
this.customMessages[this.locale],
|
|
1110
|
+
this.catalogs.get(this.locale),
|
|
1111
|
+
this.customMessages[this.fallbackLocale],
|
|
1112
|
+
this.catalogs.get(this.fallbackLocale)
|
|
1113
|
+
];
|
|
1114
|
+
for (const i of n) {
|
|
1115
|
+
const s = Fe(i, t);
|
|
1116
|
+
if (s !== void 0) return s;
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
lookup(t) {
|
|
1120
|
+
const n = this.lookupNode(t);
|
|
1121
|
+
if (typeof n == "string") return n;
|
|
1122
|
+
if (n !== void 0 && z(n)) return n.other;
|
|
1123
|
+
}
|
|
1124
|
+
selectPluralCategory(t) {
|
|
1125
|
+
let n = I.pluralRules.get(this.locale);
|
|
1126
|
+
if (!n) {
|
|
1127
|
+
try {
|
|
1128
|
+
n = new Intl.PluralRules(this.locale);
|
|
1129
|
+
} catch {
|
|
1130
|
+
return t === 1 ? "one" : "other";
|
|
1131
|
+
}
|
|
1132
|
+
I.pluralRules.set(this.locale, n);
|
|
1133
|
+
}
|
|
1134
|
+
return n.select(t);
|
|
1135
|
+
}
|
|
1136
|
+
notify() {
|
|
1137
|
+
for (const t of this.listeners) t();
|
|
1138
|
+
}
|
|
1139
|
+
};
|
|
1140
|
+
a(X, "pluralRules", /* @__PURE__ */ new Map());
|
|
1141
|
+
function w(e) {
|
|
1142
|
+
return e ? e.trim().replace(/_/g, "-") : "";
|
|
1143
|
+
}
|
|
1144
|
+
function Fe(e, t) {
|
|
1145
|
+
if (!e) return;
|
|
1146
|
+
let n = e;
|
|
1147
|
+
for (const i of t.split("."))
|
|
1148
|
+
if (typeof n != "object" || n === null || (n = n[i], n === void 0)) return;
|
|
1149
|
+
return n;
|
|
1150
|
+
}
|
|
1151
|
+
function G(e, t) {
|
|
1152
|
+
return t ? e.replace(/\{(\w+)\}/g, (n, i) => {
|
|
1153
|
+
const s = t[i];
|
|
1154
|
+
return s == null ? n : String(s);
|
|
1155
|
+
}) : e;
|
|
1156
|
+
}
|
|
1157
|
+
function ee(e, t) {
|
|
1158
|
+
const n = { ...e };
|
|
1159
|
+
for (const [i, s] of Object.entries(t)) {
|
|
1160
|
+
const o = n[i];
|
|
1161
|
+
s && typeof s == "object" && o && typeof o == "object" ? n[i] = ee(o, s) : n[i] = s;
|
|
1162
|
+
}
|
|
1163
|
+
return n;
|
|
1164
|
+
}
|
|
1165
|
+
function Be(e = {}) {
|
|
1166
|
+
return new X({
|
|
1167
|
+
loadCatalog: Te,
|
|
1168
|
+
availableLocales: Ne,
|
|
1169
|
+
...e
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
function v() {
|
|
1173
|
+
return Date.now();
|
|
1174
|
+
}
|
|
1175
|
+
function A(e) {
|
|
1176
|
+
return e.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
1177
|
+
}
|
|
1178
|
+
function _e(e) {
|
|
1179
|
+
if (e.attemptId) return `aas_v1_${A(e.assessmentId)}_${A(e.attemptId)}`;
|
|
1180
|
+
const t = te(), n = t ? ze(t) : "anon";
|
|
1181
|
+
return `aas_v1_${A(e.assessmentId)}_${A(n)}`;
|
|
492
1182
|
}
|
|
493
|
-
function
|
|
1183
|
+
function te() {
|
|
1184
|
+
try {
|
|
1185
|
+
return typeof window > "u" ? null : window.localStorage;
|
|
1186
|
+
} catch {
|
|
1187
|
+
return null;
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
function ze(e) {
|
|
1191
|
+
const t = "pie:assessment-player:anonymous-device-id", n = e.getItem(t);
|
|
1192
|
+
if (n) return n;
|
|
1193
|
+
const i = `anon-${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;
|
|
1194
|
+
return e.setItem(t, i), i;
|
|
1195
|
+
}
|
|
1196
|
+
function Oe(e) {
|
|
494
1197
|
if (!e) return [];
|
|
495
|
-
const t = [],
|
|
496
|
-
return
|
|
497
|
-
(
|
|
1198
|
+
const t = [], n = e.testParts || [];
|
|
1199
|
+
return n.length > 0 ? (n.forEach((i, s) => {
|
|
1200
|
+
(i.sections || []).forEach((o, r) => {
|
|
498
1201
|
t.push({
|
|
499
|
-
stageIdentifier:
|
|
500
|
-
stageIndex:
|
|
1202
|
+
stageIdentifier: i.identifier,
|
|
1203
|
+
stageIndex: s,
|
|
501
1204
|
sectionIndex: t.length,
|
|
502
|
-
sectionIdentifier:
|
|
503
|
-
section:
|
|
1205
|
+
sectionIdentifier: o.identifier || `section-${s}-${r}`,
|
|
1206
|
+
section: o
|
|
504
1207
|
});
|
|
505
1208
|
});
|
|
506
|
-
}), t) : ((e.sections || []).forEach((
|
|
1209
|
+
}), t) : ((e.sections || []).forEach((i, s) => {
|
|
507
1210
|
t.push({
|
|
508
1211
|
stageIdentifier: "default",
|
|
509
1212
|
stageIndex: 0,
|
|
510
|
-
sectionIndex:
|
|
511
|
-
sectionIdentifier:
|
|
512
|
-
section:
|
|
1213
|
+
sectionIndex: s,
|
|
1214
|
+
sectionIdentifier: i.identifier || `section-${s}`,
|
|
1215
|
+
section: i
|
|
513
1216
|
});
|
|
514
1217
|
}), t);
|
|
515
1218
|
}
|
|
516
|
-
var
|
|
1219
|
+
var Ge = class {
|
|
517
1220
|
constructor(e) {
|
|
518
1221
|
this.args = e, this.listeners = /* @__PURE__ */ new Set(), this.deliveryPlan = { sections: [] }, this.session = null, this.readiness = "bootstrapping", this.submitted = !1, this.storageContext = {
|
|
519
1222
|
assessmentId: e.assessmentId,
|
|
@@ -523,40 +1226,40 @@ var be = class {
|
|
|
523
1226
|
emit(e) {
|
|
524
1227
|
for (const t of this.listeners) t(e);
|
|
525
1228
|
}
|
|
526
|
-
handleError(e, t,
|
|
527
|
-
const
|
|
528
|
-
this.args.hooks?.onError?.(
|
|
1229
|
+
handleError(e, t, n) {
|
|
1230
|
+
const i = e instanceof Error ? e : new Error(String(e));
|
|
1231
|
+
this.args.hooks?.onError?.(i, {
|
|
529
1232
|
phase: t,
|
|
530
|
-
details:
|
|
1233
|
+
details: n
|
|
531
1234
|
});
|
|
532
1235
|
}
|
|
533
1236
|
async getPersistenceStrategy() {
|
|
534
1237
|
if (this.persistenceStrategy) return this.persistenceStrategy;
|
|
535
1238
|
const e = { createDefaultPersistence: () => {
|
|
536
|
-
const t =
|
|
1239
|
+
const t = te(), n = `pie:assessment-controller:v1:${this.storageContext.assessmentId}:${this.storageContext.attemptId || "default"}`;
|
|
537
1240
|
return {
|
|
538
1241
|
async loadSession() {
|
|
539
1242
|
if (!t) return null;
|
|
540
|
-
const
|
|
541
|
-
if (!
|
|
1243
|
+
const i = t.getItem(n);
|
|
1244
|
+
if (!i) return null;
|
|
542
1245
|
try {
|
|
543
|
-
return JSON.parse(
|
|
1246
|
+
return JSON.parse(i);
|
|
544
1247
|
} catch {
|
|
545
1248
|
return null;
|
|
546
1249
|
}
|
|
547
1250
|
},
|
|
548
|
-
async saveSession(
|
|
549
|
-
t && t.setItem(
|
|
1251
|
+
async saveSession(i, s) {
|
|
1252
|
+
t && t.setItem(n, JSON.stringify(s));
|
|
550
1253
|
},
|
|
551
1254
|
async clearSession() {
|
|
552
|
-
t && t.removeItem(
|
|
1255
|
+
t && t.removeItem(n);
|
|
553
1256
|
}
|
|
554
1257
|
};
|
|
555
1258
|
} };
|
|
556
1259
|
return this.persistenceStrategy = await this.args.hooks?.createAssessmentSessionPersistence?.(this.storageContext, e) ?? await e.createDefaultPersistence(), this.persistenceStrategy;
|
|
557
1260
|
}
|
|
558
1261
|
async createDeliveryPlan() {
|
|
559
|
-
const e = { createDefaultDeliveryPlan: () => ({ sections:
|
|
1262
|
+
const e = { createDefaultDeliveryPlan: () => ({ sections: Oe(this.args.assessment) }) }, t = {
|
|
560
1263
|
assessmentId: this.args.assessmentId,
|
|
561
1264
|
attemptId: this.args.attemptId,
|
|
562
1265
|
assessment: this.args.assessment
|
|
@@ -566,8 +1269,8 @@ var be = class {
|
|
|
566
1269
|
ensureSession() {
|
|
567
1270
|
if (this.session) return this.session;
|
|
568
1271
|
const e = this.deliveryPlan.sections.map((t) => t.sectionIdentifier);
|
|
569
|
-
return this.session =
|
|
570
|
-
assessmentAttemptSessionIdentifier:
|
|
1272
|
+
return this.session = ne({
|
|
1273
|
+
assessmentAttemptSessionIdentifier: _e({
|
|
571
1274
|
assessmentId: this.args.assessmentId,
|
|
572
1275
|
attemptId: this.args.attemptId
|
|
573
1276
|
}),
|
|
@@ -590,7 +1293,7 @@ var be = class {
|
|
|
590
1293
|
const e = await (await this.getPersistenceStrategy()).loadSession(this.storageContext);
|
|
591
1294
|
e && (this.session = e, this.emit({
|
|
592
1295
|
type: "assessment-session-applied",
|
|
593
|
-
timestamp:
|
|
1296
|
+
timestamp: v()
|
|
594
1297
|
})), this.ensureSession(), this.readiness = "ready";
|
|
595
1298
|
} catch (e) {
|
|
596
1299
|
this.readiness = "error", this.handleError(e, "session-load");
|
|
@@ -633,34 +1336,34 @@ var be = class {
|
|
|
633
1336
|
setIndex(e) {
|
|
634
1337
|
const t = this.buildNavigationSnapshot();
|
|
635
1338
|
if (e < 0 || e >= t.totalSections) return !1;
|
|
636
|
-
const
|
|
637
|
-
this.session =
|
|
1339
|
+
const n = t.currentSectionId, i = this.deliveryPlan.sections[e];
|
|
1340
|
+
this.session = se(this.ensureSession(), {
|
|
638
1341
|
currentSectionIndex: e,
|
|
639
|
-
currentSectionIdentifier:
|
|
1342
|
+
currentSectionIdentifier: i?.sectionIdentifier
|
|
640
1343
|
});
|
|
641
|
-
const
|
|
1344
|
+
const s = this.buildNavigationSnapshot();
|
|
642
1345
|
return this.emit({
|
|
643
1346
|
type: "assessment-route-changed",
|
|
644
|
-
timestamp:
|
|
645
|
-
currentSectionIndex:
|
|
646
|
-
totalSections:
|
|
647
|
-
currentSectionId:
|
|
648
|
-
previousSectionId:
|
|
649
|
-
canNext:
|
|
650
|
-
canPrevious:
|
|
1347
|
+
timestamp: v(),
|
|
1348
|
+
currentSectionIndex: s.currentSectionIndex,
|
|
1349
|
+
totalSections: s.totalSections,
|
|
1350
|
+
currentSectionId: s.currentSectionId,
|
|
1351
|
+
previousSectionId: n,
|
|
1352
|
+
canNext: s.canNext,
|
|
1353
|
+
canPrevious: s.canPrevious
|
|
651
1354
|
}), this.emit({
|
|
652
1355
|
type: "assessment-session-changed",
|
|
653
|
-
timestamp:
|
|
1356
|
+
timestamp: v()
|
|
654
1357
|
}), this.emit({
|
|
655
1358
|
type: "assessment-progress-changed",
|
|
656
|
-
timestamp:
|
|
1359
|
+
timestamp: v(),
|
|
657
1360
|
visitedSectionCount: this.ensureSession().navigationState.visitedSectionIdentifiers.length,
|
|
658
|
-
totalSections:
|
|
1361
|
+
totalSections: s.totalSections
|
|
659
1362
|
}), !0;
|
|
660
1363
|
}
|
|
661
1364
|
navigateTo(e) {
|
|
662
1365
|
if (typeof e == "number") return this.setIndex(e);
|
|
663
|
-
const t = this.deliveryPlan.sections.findIndex((
|
|
1366
|
+
const t = this.deliveryPlan.sections.findIndex((n) => n.sectionIdentifier === e);
|
|
664
1367
|
return t < 0 ? !1 : this.setIndex(t);
|
|
665
1368
|
}
|
|
666
1369
|
navigateNext() {
|
|
@@ -674,7 +1377,7 @@ var be = class {
|
|
|
674
1377
|
async submit() {
|
|
675
1378
|
this.submitted = !0, this.emit({
|
|
676
1379
|
type: "assessment-submission-state-changed",
|
|
677
|
-
timestamp:
|
|
1380
|
+
timestamp: v(),
|
|
678
1381
|
submitted: !0
|
|
679
1382
|
}), await this.persist();
|
|
680
1383
|
}
|
|
@@ -692,15 +1395,15 @@ var be = class {
|
|
|
692
1395
|
return this.ensureSession().sectionSessions[e]?.session || null;
|
|
693
1396
|
}
|
|
694
1397
|
updateSectionSession(e, t) {
|
|
695
|
-
this.session =
|
|
1398
|
+
this.session = oe(this.ensureSession(), {
|
|
696
1399
|
sectionIdentifier: e,
|
|
697
1400
|
sectionSession: t
|
|
698
1401
|
}), this.emit({
|
|
699
1402
|
type: "assessment-session-changed",
|
|
700
|
-
timestamp:
|
|
1403
|
+
timestamp: v()
|
|
701
1404
|
});
|
|
702
1405
|
}
|
|
703
|
-
},
|
|
1406
|
+
}, h = {
|
|
704
1407
|
controllerReady: "assessment-controller-ready",
|
|
705
1408
|
navigationRequested: "assessment-navigation-requested",
|
|
706
1409
|
submitRequested: "assessment-submit-requested",
|
|
@@ -711,53 +1414,7 @@ var be = class {
|
|
|
711
1414
|
submissionStateChanged: "assessment-submission-state-changed",
|
|
712
1415
|
error: "assessment-error"
|
|
713
1416
|
};
|
|
714
|
-
function
|
|
715
|
-
return e && { ...e };
|
|
716
|
-
}
|
|
717
|
-
function we(e) {
|
|
718
|
-
return e && typeof e == "object" && !Array.isArray(e) ? { ...e } : e;
|
|
719
|
-
}
|
|
720
|
-
function V(e) {
|
|
721
|
-
return e && Object.fromEntries(Object.entries(e).map(([t, s]) => [t, we(s)]));
|
|
722
|
-
}
|
|
723
|
-
function Pe(e) {
|
|
724
|
-
if (e)
|
|
725
|
-
return {
|
|
726
|
-
...e,
|
|
727
|
-
auth: I(e.auth),
|
|
728
|
-
endpoints: V(e.endpoints),
|
|
729
|
-
request: e.request ? {
|
|
730
|
-
...e.request,
|
|
731
|
-
headers: e.request.headers ? { ...e.request.headers } : void 0
|
|
732
|
-
} : void 0,
|
|
733
|
-
options: e.options ? {
|
|
734
|
-
...e.options,
|
|
735
|
-
overrides: e.options.overrides ? { ...e.options.overrides } : void 0
|
|
736
|
-
} : void 0,
|
|
737
|
-
autosave: e.autosave && typeof e.autosave == "object" ? { ...e.autosave } : e.autosave,
|
|
738
|
-
client: e.client ? { ...e.client } : void 0
|
|
739
|
-
};
|
|
740
|
-
}
|
|
741
|
-
function Ne(e) {
|
|
742
|
-
if (e)
|
|
743
|
-
return {
|
|
744
|
-
...e,
|
|
745
|
-
auth: I(e.auth),
|
|
746
|
-
delivery: Pe(e.delivery),
|
|
747
|
-
authoring: e.authoring ? {
|
|
748
|
-
...e.authoring,
|
|
749
|
-
auth: I(e.authoring.auth),
|
|
750
|
-
endpoints: V(e.authoring.endpoints),
|
|
751
|
-
request: e.authoring.request ? {
|
|
752
|
-
...e.authoring.request,
|
|
753
|
-
headers: e.authoring.request.headers ? { ...e.authoring.request.headers } : void 0
|
|
754
|
-
} : void 0,
|
|
755
|
-
media: e.authoring.media ? { ...e.authoring.media } : void 0,
|
|
756
|
-
client: e.authoring.client ? { ...e.authoring.client } : void 0
|
|
757
|
-
} : void 0
|
|
758
|
-
};
|
|
759
|
-
}
|
|
760
|
-
function Ce(e, t) {
|
|
1417
|
+
function $e(e, t) {
|
|
761
1418
|
return !e?.delivery || e.delivery.enabled === !1 || !t || e.delivery.assignmentId !== void 0 ? e : {
|
|
762
1419
|
...e,
|
|
763
1420
|
delivery: {
|
|
@@ -766,27 +1423,20 @@ function Ce(e, t) {
|
|
|
766
1423
|
}
|
|
767
1424
|
};
|
|
768
1425
|
}
|
|
769
|
-
function
|
|
770
|
-
const { sectionPlayerRuntime: t, playerType:
|
|
1426
|
+
function He(e) {
|
|
1427
|
+
const { sectionPlayerRuntime: t, playerType: n, attemptId: i, env: s, coordinator: o } = e, r = t?.player && typeof t.player == "object" ? {
|
|
771
1428
|
...t.player,
|
|
772
|
-
backend:
|
|
1429
|
+
backend: $e(t.player.backend ? P(t.player.backend) : void 0, i)
|
|
773
1430
|
} : t?.player;
|
|
774
1431
|
return {
|
|
775
|
-
playerType:
|
|
776
|
-
...
|
|
777
|
-
...
|
|
1432
|
+
playerType: n,
|
|
1433
|
+
...s ? { env: s } : {},
|
|
1434
|
+
...o ? { coordinator: o } : {},
|
|
778
1435
|
...t || {},
|
|
779
1436
|
...r !== void 0 ? { player: r } : {}
|
|
780
1437
|
};
|
|
781
1438
|
}
|
|
782
|
-
var
|
|
783
|
-
function Le(e, t = !1) {
|
|
784
|
-
if (e == null) return t;
|
|
785
|
-
if (typeof e == "boolean") return e;
|
|
786
|
-
const s = e.trim().toLowerCase();
|
|
787
|
-
return s === "" || s === "true" || s === "1" || s === "yes";
|
|
788
|
-
}
|
|
789
|
-
var Te = class extends HTMLElement {
|
|
1439
|
+
var qe = "pie-section-player-splitpane", je = "pie-section-player-vertical", Ve = class extends HTMLElement {
|
|
790
1440
|
static get observedAttributes() {
|
|
791
1441
|
return [
|
|
792
1442
|
"assessment-id",
|
|
@@ -794,16 +1444,26 @@ var Te = class extends HTMLElement {
|
|
|
794
1444
|
"show-navigation",
|
|
795
1445
|
"section-player-layout",
|
|
796
1446
|
"player-type",
|
|
797
|
-
"debug"
|
|
1447
|
+
"debug",
|
|
1448
|
+
"locale"
|
|
798
1449
|
];
|
|
799
1450
|
}
|
|
800
1451
|
constructor() {
|
|
801
|
-
super(), this.assessmentId = "", this.attemptId = "", this.assessment = null, this.env = null, this.coordinator = null, this.hooks = null, this.showNavigation = !0, this.sectionPlayerLayout = "splitpane", this.playerType = "iife", this._debug = void 0, this.controller = null, this.controllerReadyPromise = null, this.controllerReadyResolve = null, this.sectionHost = null, this.sectionControllerRef = null, this._sectionPlayerRuntime = null, this.readiness = { phase: "bootstrapping" }, this.controllerReadyPromise = new Promise((e) => {
|
|
1452
|
+
super(), this.assessmentId = "", this.attemptId = "", this.locale = "", this.assessment = null, this.env = null, this.coordinator = null, this.hooks = null, this.showNavigation = !0, this.sectionPlayerLayout = "splitpane", this.playerType = "iife", this._debug = void 0, this.controller = null, this.controllerReadyPromise = null, this.controllerReadyResolve = null, this.i18n = Be(), this.sectionHost = null, this.sectionControllerRef = null, this.containerRef = null, this.announcer = null, this.restoreFocusOnRender = !1, this._sectionPlayerRuntime = null, this.readiness = { phase: "bootstrapping" }, this.controllerReadyPromise = new Promise((e) => {
|
|
802
1453
|
this.controllerReadyResolve = e;
|
|
803
1454
|
});
|
|
804
1455
|
}
|
|
805
|
-
attributeChangedCallback(e, t,
|
|
806
|
-
e === "assessment-id" && (this.assessmentId =
|
|
1456
|
+
attributeChangedCallback(e, t, n) {
|
|
1457
|
+
e === "assessment-id" && (this.assessmentId = n || ""), e === "attempt-id" && (this.attemptId = n || ""), e === "show-navigation" && (this.showNavigation = n), e === "section-player-layout" && (this.sectionPlayerLayout = n === "vertical" ? "vertical" : "splitpane"), e === "player-type" && (this.playerType = n || "iife"), e === "debug" && (this.debug = n), e === "locale" && (this.locale = n || "", this.applyLocale()), this.isConnected && this.bootstrapController();
|
|
1458
|
+
}
|
|
1459
|
+
applyLocale() {
|
|
1460
|
+
this.unsubscribeI18n || (this.unsubscribeI18n = this.i18n.subscribe?.(() => {
|
|
1461
|
+
this.isConnected && this.render();
|
|
1462
|
+
})), this.i18n.setLocale(this.locale || "en-US"), this.forwardLocaleToSection();
|
|
1463
|
+
}
|
|
1464
|
+
forwardLocaleToSection() {
|
|
1465
|
+
const e = this.sectionHost?.firstElementChild;
|
|
1466
|
+
e && (this.locale ? e.setAttribute("locale", this.locale) : e.removeAttribute("locale"));
|
|
807
1467
|
}
|
|
808
1468
|
get debug() {
|
|
809
1469
|
return this._debug;
|
|
@@ -822,17 +1482,17 @@ var Te = class extends HTMLElement {
|
|
|
822
1482
|
const e = this.getAttribute("section-player-layout");
|
|
823
1483
|
this.sectionPlayerLayout = e === "vertical" ? "vertical" : this.sectionPlayerLayout;
|
|
824
1484
|
const t = this.getAttribute("player-type");
|
|
825
|
-
t && (this.playerType = t), this.debug = this.getAttribute("debug") ?? this.debug, this.attachInstrumentationBridge(), this.bootstrapController();
|
|
1485
|
+
t && (this.playerType = t), this.debug = this.getAttribute("debug") ?? this.debug, this.locale || (this.locale = this.getAttribute("locale") || ""), this.applyLocale(), this.attachInstrumentationBridge(), this.bootstrapController();
|
|
826
1486
|
}
|
|
827
1487
|
disconnectedCallback() {
|
|
828
|
-
this.unsubscribeController?.(), this.detachInstrumentationBridge?.(), this.detachInstrumentationBridge = void 0, this.hooks?.onAssessmentControllerDispose?.(this.controller || void 0);
|
|
1488
|
+
this.unsubscribeI18n?.(), this.unsubscribeI18n = void 0, this.unsubscribeController?.(), this.detachInstrumentationBridge?.(), this.detachInstrumentationBridge = void 0, this.hooks?.onAssessmentControllerDispose?.(this.controller || void 0);
|
|
829
1489
|
}
|
|
830
|
-
dispatch(e, t,
|
|
1490
|
+
dispatch(e, t, n = !1) {
|
|
831
1491
|
return this.dispatchEvent(new CustomEvent(e, {
|
|
832
1492
|
detail: t,
|
|
833
1493
|
bubbles: !0,
|
|
834
1494
|
composed: !0,
|
|
835
|
-
cancelable:
|
|
1495
|
+
cancelable: n
|
|
836
1496
|
}));
|
|
837
1497
|
}
|
|
838
1498
|
async bootstrapController() {
|
|
@@ -841,33 +1501,33 @@ var Te = class extends HTMLElement {
|
|
|
841
1501
|
return;
|
|
842
1502
|
}
|
|
843
1503
|
this.readiness = { phase: "bootstrapping" }, this.render();
|
|
844
|
-
const e = new
|
|
1504
|
+
const e = new Ge({
|
|
845
1505
|
assessmentId: this.assessmentId,
|
|
846
1506
|
attemptId: this.attemptId || void 0,
|
|
847
1507
|
assessment: this.assessment,
|
|
848
1508
|
hooks: this.hooks || void 0
|
|
849
1509
|
});
|
|
850
1510
|
this.unsubscribeController?.(), this.controller = e, this.unsubscribeController = e.subscribe((t) => {
|
|
851
|
-
t.type === "assessment-route-changed" && (this.cleanupTtsForSectionNavigation(t), this.dispatch(
|
|
1511
|
+
t.type === "assessment-route-changed" && (this.cleanupTtsForSectionNavigation(t), this.dispatch(h.routeChanged, t), this.restoreFocusOnRender = !0, this.render()), t.type === "assessment-session-applied" && this.dispatch(h.sessionApplied, t), t.type === "assessment-session-changed" && this.dispatch(h.sessionChanged, t), t.type === "assessment-progress-changed" && this.dispatch(h.progressChanged, t), t.type === "assessment-submission-state-changed" && this.dispatch(h.submissionStateChanged, t);
|
|
852
1512
|
});
|
|
853
1513
|
try {
|
|
854
|
-
await e.initialize(), this.readiness = { phase: "ready" }, this.controllerReadyResolve?.(e), this.dispatch(
|
|
1514
|
+
await e.initialize(), this.readiness = { phase: "ready" }, this.controllerReadyResolve?.(e), this.dispatch(h.controllerReady, { controller: e }), this.hooks?.onAssessmentControllerReady?.(e), this.render();
|
|
855
1515
|
} catch (t) {
|
|
856
|
-
this.readiness = { phase: "error" }, this.dispatch(
|
|
1516
|
+
this.readiness = { phase: "error" }, this.dispatch(h.error, { error: t }), this.renderEmptyState("Failed to initialize assessment player");
|
|
857
1517
|
}
|
|
858
1518
|
}
|
|
859
1519
|
resolveInstrumentationProvider() {
|
|
860
|
-
return
|
|
1520
|
+
return Ce({
|
|
861
1521
|
runtimePlayer: this.sectionPlayerRuntime?.player,
|
|
862
1522
|
component: "pie-assessment-player-default"
|
|
863
1523
|
});
|
|
864
1524
|
}
|
|
865
1525
|
attachInstrumentationBridge() {
|
|
866
|
-
this.detachInstrumentationBridge?.(), this.detachInstrumentationBridge =
|
|
1526
|
+
this.detachInstrumentationBridge?.(), this.detachInstrumentationBridge = Se({
|
|
867
1527
|
host: this,
|
|
868
1528
|
instrumentationProvider: this.resolveInstrumentationProvider(),
|
|
869
1529
|
component: "pie-assessment-player-default",
|
|
870
|
-
eventMap:
|
|
1530
|
+
eventMap: ke,
|
|
871
1531
|
staticAttributes: {
|
|
872
1532
|
instrumentationLayer: "assessment",
|
|
873
1533
|
assessmentId: this.assessmentId,
|
|
@@ -876,15 +1536,41 @@ var Te = class extends HTMLElement {
|
|
|
876
1536
|
});
|
|
877
1537
|
}
|
|
878
1538
|
renderEmptyState(e) {
|
|
879
|
-
this.innerHTML = "";
|
|
880
1539
|
const t = document.createElement("div");
|
|
881
|
-
t.className = "pie-assessment-player-empty", t.textContent = e, this.
|
|
1540
|
+
t.className = "pie-assessment-player-empty", t.textContent = e, this.swapContent(t);
|
|
1541
|
+
}
|
|
1542
|
+
swapContent(e) {
|
|
1543
|
+
this.containerRef?.remove(), this.containerRef = e, this.appendChild(e);
|
|
1544
|
+
}
|
|
1545
|
+
ensureAnnouncer() {
|
|
1546
|
+
if (this.announcer?.isConnected) return this.announcer;
|
|
1547
|
+
const e = document.createElement("div");
|
|
1548
|
+
return e.className = "pie-assessment-player-announcer", e.setAttribute("role", "status"), e.setAttribute("aria-live", "polite"), e.setAttribute("aria-atomic", "true"), e.style.cssText = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;", this.announcer = e, this.appendChild(e), e;
|
|
1549
|
+
}
|
|
1550
|
+
captureFocusIntent() {
|
|
1551
|
+
if (typeof document > "u") return null;
|
|
1552
|
+
const e = document.activeElement;
|
|
1553
|
+
return !e || !this.contains(e) ? null : e.classList?.contains("pie-assessment-player-nav-btn") ? e.textContent === "Back" ? "previous" : "next" : "section";
|
|
1554
|
+
}
|
|
1555
|
+
applyFocusIntent(e, t) {
|
|
1556
|
+
const n = e === "section" ? [this.sectionHost] : e === "next" ? [
|
|
1557
|
+
t.next,
|
|
1558
|
+
t.previous,
|
|
1559
|
+
this.sectionHost
|
|
1560
|
+
] : [
|
|
1561
|
+
t.previous,
|
|
1562
|
+
t.next,
|
|
1563
|
+
this.sectionHost
|
|
1564
|
+
];
|
|
1565
|
+
for (const i of n)
|
|
1566
|
+
if (i && !(i instanceof HTMLButtonElement && i.disabled) && (i.focus(), document.activeElement === i))
|
|
1567
|
+
return;
|
|
882
1568
|
}
|
|
883
1569
|
buildSectionPlayerTag() {
|
|
884
|
-
return this.sectionPlayerLayout === "vertical" ?
|
|
1570
|
+
return this.sectionPlayerLayout === "vertical" ? je : qe;
|
|
885
1571
|
}
|
|
886
1572
|
buildSectionRuntime() {
|
|
887
|
-
return
|
|
1573
|
+
return He({
|
|
888
1574
|
sectionPlayerRuntime: this.sectionPlayerRuntime,
|
|
889
1575
|
playerType: this.playerType,
|
|
890
1576
|
attemptId: this.attemptId || void 0,
|
|
@@ -898,16 +1584,25 @@ var Te = class extends HTMLElement {
|
|
|
898
1584
|
}
|
|
899
1585
|
cleanupTtsForSectionNavigation(e) {
|
|
900
1586
|
if (e.currentSectionId && e.previousSectionId && e.currentSectionId === e.previousSectionId) return;
|
|
901
|
-
const t = this.coordinator?.ttsService;
|
|
902
|
-
if (
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
}
|
|
910
|
-
|
|
1587
|
+
const t = this.coordinator, n = t?.ttsService;
|
|
1588
|
+
if (!n) return;
|
|
1589
|
+
const i = (s) => {
|
|
1590
|
+
t?.reportFrameworkError?.(ie({
|
|
1591
|
+
kind: "tts-init",
|
|
1592
|
+
source: "AssessmentPlayerDefaultElement.cleanupTtsForSectionNavigation",
|
|
1593
|
+
error: s,
|
|
1594
|
+
recoverable: !0
|
|
1595
|
+
}));
|
|
1596
|
+
};
|
|
1597
|
+
try {
|
|
1598
|
+
n.stop?.();
|
|
1599
|
+
} catch (s) {
|
|
1600
|
+
i(s);
|
|
1601
|
+
}
|
|
1602
|
+
try {
|
|
1603
|
+
n.requestControlHandoff?.();
|
|
1604
|
+
} catch (s) {
|
|
1605
|
+
i(s);
|
|
911
1606
|
}
|
|
912
1607
|
}
|
|
913
1608
|
syncCurrentSectionSessionIntoAssessment() {
|
|
@@ -915,27 +1610,29 @@ var Te = class extends HTMLElement {
|
|
|
915
1610
|
if (!e) return;
|
|
916
1611
|
const t = this.sectionHost?.firstElementChild?.getSectionController?.() || this.sectionControllerRef;
|
|
917
1612
|
if (!t?.getSession) return;
|
|
918
|
-
const
|
|
919
|
-
|
|
1613
|
+
const n = e.getCurrentSection();
|
|
1614
|
+
n && e.updateSectionSession(n.sectionIdentifier, t.getSession());
|
|
920
1615
|
}
|
|
921
1616
|
attachSectionControllerReadyListener(e, t) {
|
|
922
|
-
const
|
|
1617
|
+
const n = e;
|
|
923
1618
|
queueMicrotask(() => {
|
|
924
1619
|
(async () => {
|
|
925
|
-
const
|
|
926
|
-
if (this.sectionControllerRef =
|
|
927
|
-
const
|
|
928
|
-
|
|
1620
|
+
const i = await n.waitForSectionController?.(5e3) || null;
|
|
1621
|
+
if (this.sectionControllerRef = i, !i) return;
|
|
1622
|
+
const s = this.controller?.getSectionSession(t);
|
|
1623
|
+
s && i.applySession && await i.applySession(s, { mode: "replace" });
|
|
929
1624
|
})();
|
|
930
1625
|
}), e.addEventListener("session-changed", () => this.syncCurrentSectionSessionIntoAssessment()), e.addEventListener("item-session-changed", () => this.syncCurrentSectionSessionIntoAssessment());
|
|
931
1626
|
}
|
|
932
1627
|
render() {
|
|
933
1628
|
const e = this.controller;
|
|
934
|
-
this.attachInstrumentationBridge()
|
|
935
|
-
const t =
|
|
936
|
-
|
|
937
|
-
const
|
|
938
|
-
|
|
1629
|
+
this.attachInstrumentationBridge();
|
|
1630
|
+
const t = this.restoreFocusOnRender ? this.captureFocusIntent() : null;
|
|
1631
|
+
this.restoreFocusOnRender = !1, this.ensureAnnouncer(), this.sectionControllerRef = null;
|
|
1632
|
+
const n = document.createElement("div");
|
|
1633
|
+
n.className = "pie-assessment-player-default";
|
|
1634
|
+
const i = document.createElement("style");
|
|
1635
|
+
i.textContent = `
|
|
939
1636
|
:host {
|
|
940
1637
|
display: block;
|
|
941
1638
|
height: 100%;
|
|
@@ -982,36 +1679,43 @@ var Te = class extends HTMLElement {
|
|
|
982
1679
|
height: 100%;
|
|
983
1680
|
overflow: hidden;
|
|
984
1681
|
}
|
|
985
|
-
`,
|
|
986
|
-
const
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
const
|
|
993
|
-
|
|
994
|
-
const
|
|
995
|
-
|
|
1682
|
+
`, n.appendChild(i);
|
|
1683
|
+
const s = this.getSnapshot(), o = s.navigation.totalSections > 0 ? this.i18n.t("player.assessment.sectionPosition", {
|
|
1684
|
+
position: s.navigation.currentIndex + 1,
|
|
1685
|
+
total: s.navigation.totalSections
|
|
1686
|
+
}) : this.i18n.t("player.assessment.noSections");
|
|
1687
|
+
let r = null, l = null;
|
|
1688
|
+
if ($(this.showNavigation, !0)) {
|
|
1689
|
+
const f = document.createElement("div");
|
|
1690
|
+
f.className = "pie-assessment-player-navigation";
|
|
1691
|
+
const c = document.createElement("div");
|
|
1692
|
+
c.className = "pie-assessment-player-current-position", c.textContent = o;
|
|
1693
|
+
const p = document.createElement("div");
|
|
1694
|
+
p.className = "pie-assessment-player-nav-controls", r = document.createElement("button"), r.className = "pie-assessment-player-nav-btn", r.textContent = this.i18n.t("common.back"), r.disabled = !s.navigation.canPrevious, r.addEventListener("click", () => {
|
|
996
1695
|
this.navigatePrevious();
|
|
997
|
-
})
|
|
998
|
-
const p = document.createElement("button");
|
|
999
|
-
p.className = "pie-assessment-player-nav-btn", p.textContent = "Next", p.disabled = !n.navigation.canNext, p.addEventListener("click", () => {
|
|
1696
|
+
}), l = document.createElement("button"), l.className = "pie-assessment-player-nav-btn", l.textContent = this.i18n.t("common.next"), l.disabled = !s.navigation.canNext, l.addEventListener("click", () => {
|
|
1000
1697
|
this.navigateNext();
|
|
1001
|
-
}),
|
|
1698
|
+
}), p.appendChild(r), p.appendChild(l), f.appendChild(c), f.appendChild(p), n.appendChild(f);
|
|
1002
1699
|
}
|
|
1003
|
-
const
|
|
1004
|
-
|
|
1005
|
-
const
|
|
1006
|
-
if (
|
|
1007
|
-
const
|
|
1008
|
-
if (
|
|
1009
|
-
const
|
|
1010
|
-
|
|
1700
|
+
const d = document.createElement("div");
|
|
1701
|
+
d.className = "pie-assessment-player-section-host", d.setAttribute("role", "region"), d.setAttribute("aria-label", o), d.tabIndex = -1, this.sectionHost = d;
|
|
1702
|
+
const u = e?.getCurrentSection() || null;
|
|
1703
|
+
if (u) {
|
|
1704
|
+
const f = this.buildSectionPlayerTag(), c = document.createElement(f);
|
|
1705
|
+
if (c.setAttribute("assessment-id", this.assessmentId), c.setAttribute("section-id", u.sectionIdentifier), this.attemptId && c.setAttribute("attempt-id", this.attemptId), this.locale && c.setAttribute("locale", this.locale), this.debug !== void 0 && this.debug !== null) {
|
|
1706
|
+
const p = typeof this.debug == "boolean" ? String(this.debug) : this.debug;
|
|
1707
|
+
c.setAttribute("debug", p);
|
|
1011
1708
|
}
|
|
1012
|
-
|
|
1709
|
+
c.section = u.section, c.runtime = this.buildSectionRuntime(), c.hooks = { cardTitleFormatter: this.hooks?.cardTitleFormatter }, d.appendChild(c), this.attachSectionControllerReadyListener(c, u.sectionIdentifier);
|
|
1013
1710
|
}
|
|
1014
|
-
|
|
1711
|
+
n.appendChild(d), this.swapContent(n), t && (this.applyFocusIntent(t, {
|
|
1712
|
+
previous: r,
|
|
1713
|
+
next: l
|
|
1714
|
+
}), this.announceSectionChange(o));
|
|
1715
|
+
}
|
|
1716
|
+
announceSectionChange(e) {
|
|
1717
|
+
const t = this.ensureAnnouncer();
|
|
1718
|
+
t.textContent !== e && (t.textContent = e);
|
|
1015
1719
|
}
|
|
1016
1720
|
applyDebugFlag() {
|
|
1017
1721
|
if (this.debug === void 0 || this.debug === null || typeof window > "u") return;
|
|
@@ -1057,16 +1761,16 @@ var Te = class extends HTMLElement {
|
|
|
1057
1761
|
return this.getSnapshot().progress;
|
|
1058
1762
|
}
|
|
1059
1763
|
navigateTo(e) {
|
|
1060
|
-
const t = this.selectNavigation(),
|
|
1061
|
-
let
|
|
1764
|
+
const t = this.selectNavigation(), n = t.currentIndex, i = t.currentSectionId;
|
|
1765
|
+
let s = n, o;
|
|
1062
1766
|
if (typeof e == "number")
|
|
1063
|
-
|
|
1064
|
-
else if (
|
|
1065
|
-
if (!this.dispatch(
|
|
1066
|
-
fromIndex:
|
|
1067
|
-
toIndex:
|
|
1068
|
-
fromSectionId:
|
|
1069
|
-
toSectionId:
|
|
1767
|
+
s = e, o = this.controller?.getSectionAt(s)?.sectionIdentifier;
|
|
1768
|
+
else if (o = e, this.controller?.getCurrentSection()?.sectionIdentifier === o) return !0;
|
|
1769
|
+
if (!this.dispatch(h.navigationRequested, {
|
|
1770
|
+
fromIndex: n,
|
|
1771
|
+
toIndex: s,
|
|
1772
|
+
fromSectionId: i,
|
|
1773
|
+
toSectionId: o,
|
|
1070
1774
|
reason: "navigate-to"
|
|
1071
1775
|
}, !0)) return !1;
|
|
1072
1776
|
this.syncCurrentSectionSessionIntoAssessment();
|
|
@@ -1075,7 +1779,7 @@ var Te = class extends HTMLElement {
|
|
|
1075
1779
|
}
|
|
1076
1780
|
navigateNext() {
|
|
1077
1781
|
const e = this.selectNavigation(), t = this.controller?.getSectionAt(e.currentIndex + 1);
|
|
1078
|
-
if (!this.dispatch(
|
|
1782
|
+
if (!this.dispatch(h.navigationRequested, {
|
|
1079
1783
|
fromIndex: e.currentIndex,
|
|
1080
1784
|
toIndex: e.currentIndex + 1,
|
|
1081
1785
|
fromSectionId: e.currentSectionId,
|
|
@@ -1083,12 +1787,12 @@ var Te = class extends HTMLElement {
|
|
|
1083
1787
|
reason: "navigate-next"
|
|
1084
1788
|
}, !0)) return !1;
|
|
1085
1789
|
this.syncCurrentSectionSessionIntoAssessment();
|
|
1086
|
-
const
|
|
1087
|
-
return
|
|
1790
|
+
const n = this.controller?.navigateNext() === !0;
|
|
1791
|
+
return n && this.controller?.persist(), n;
|
|
1088
1792
|
}
|
|
1089
1793
|
navigatePrevious() {
|
|
1090
1794
|
const e = this.selectNavigation(), t = this.controller?.getSectionAt(e.currentIndex - 1);
|
|
1091
|
-
if (!this.dispatch(
|
|
1795
|
+
if (!this.dispatch(h.navigationRequested, {
|
|
1092
1796
|
fromIndex: e.currentIndex,
|
|
1093
1797
|
toIndex: e.currentIndex - 1,
|
|
1094
1798
|
fromSectionId: e.currentSectionId,
|
|
@@ -1096,28 +1800,22 @@ var Te = class extends HTMLElement {
|
|
|
1096
1800
|
reason: "navigate-previous"
|
|
1097
1801
|
}, !0)) return !1;
|
|
1098
1802
|
this.syncCurrentSectionSessionIntoAssessment();
|
|
1099
|
-
const
|
|
1100
|
-
return
|
|
1803
|
+
const n = this.controller?.navigatePrevious() === !0;
|
|
1804
|
+
return n && this.controller?.persist(), n;
|
|
1101
1805
|
}
|
|
1102
1806
|
getAssessmentController() {
|
|
1103
1807
|
return this.controller;
|
|
1104
1808
|
}
|
|
1105
1809
|
async waitForAssessmentController(e = 5e3) {
|
|
1106
1810
|
if (this.controller) return this.controller;
|
|
1107
|
-
const t = this.controllerReadyPromise || Promise.resolve(null),
|
|
1108
|
-
setTimeout(() =>
|
|
1811
|
+
const t = this.controllerReadyPromise || Promise.resolve(null), n = new Promise((i) => {
|
|
1812
|
+
setTimeout(() => i(null), e);
|
|
1109
1813
|
});
|
|
1110
|
-
return Promise.race([t,
|
|
1814
|
+
return Promise.race([t, n]);
|
|
1111
1815
|
}
|
|
1112
1816
|
};
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
if (e == null) return t;
|
|
1116
|
-
if (typeof e == "boolean") return e;
|
|
1117
|
-
const s = e.trim().toLowerCase();
|
|
1118
|
-
return s === "" || s === "true" || s === "1" || s === "yes";
|
|
1119
|
-
}
|
|
1120
|
-
var _e = class extends HTMLElement {
|
|
1817
|
+
H("pie-assessment-player-default", Ve, "assessment player default tag");
|
|
1818
|
+
var Ye = class extends HTMLElement {
|
|
1121
1819
|
constructor(...e) {
|
|
1122
1820
|
super(...e), this.showNavigation = !0;
|
|
1123
1821
|
}
|
|
@@ -1127,11 +1825,11 @@ var _e = class extends HTMLElement {
|
|
|
1127
1825
|
connectedCallback() {
|
|
1128
1826
|
this.showNavigation = this.getAttribute("show-navigation") ?? this.showNavigation, this.render();
|
|
1129
1827
|
}
|
|
1130
|
-
attributeChangedCallback(e, t,
|
|
1131
|
-
e === "show-navigation" && (this.showNavigation =
|
|
1828
|
+
attributeChangedCallback(e, t, n) {
|
|
1829
|
+
e === "show-navigation" && (this.showNavigation = n), this.render();
|
|
1132
1830
|
}
|
|
1133
1831
|
render() {
|
|
1134
|
-
const e =
|
|
1832
|
+
const e = $(this.showNavigation, !0);
|
|
1135
1833
|
this.innerHTML = "";
|
|
1136
1834
|
const t = document.createElement("style");
|
|
1137
1835
|
t.textContent = `
|
|
@@ -1152,18 +1850,18 @@ var _e = class extends HTMLElement {
|
|
|
1152
1850
|
overflow: hidden;
|
|
1153
1851
|
}
|
|
1154
1852
|
`;
|
|
1155
|
-
const s = document.createElement("div");
|
|
1156
|
-
if (s.className = "pie-assessment-player-shell", e) {
|
|
1157
|
-
const a = document.createElement("slot");
|
|
1158
|
-
a.name = "navigation", s.appendChild(a);
|
|
1159
|
-
}
|
|
1160
1853
|
const n = document.createElement("div");
|
|
1161
|
-
n.className = "pie-assessment-player-
|
|
1162
|
-
|
|
1163
|
-
|
|
1854
|
+
if (n.className = "pie-assessment-player-shell", e) {
|
|
1855
|
+
const o = document.createElement("slot");
|
|
1856
|
+
o.name = "navigation", n.appendChild(o);
|
|
1857
|
+
}
|
|
1858
|
+
const i = document.createElement("div");
|
|
1859
|
+
i.className = "pie-assessment-player-shell__body";
|
|
1860
|
+
const s = document.createElement("slot");
|
|
1861
|
+
i.appendChild(s), n.appendChild(i), this.appendChild(t), this.appendChild(n);
|
|
1164
1862
|
}
|
|
1165
1863
|
};
|
|
1166
|
-
|
|
1864
|
+
H("pie-assessment-player-shell", Ye, "assessment player shell tag");
|
|
1167
1865
|
export {
|
|
1168
|
-
|
|
1866
|
+
h as ASSESSMENT_PLAYER_PUBLIC_EVENTS
|
|
1169
1867
|
};
|