@pie-element/mc-populated-blank 0.2.0 → 0.2.2
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 +9 -3
- package/dist/controller/defaults.d.ts +4 -0
- package/dist/controller/defaults.d.ts.map +1 -1
- package/dist/controller/index.d.ts.map +1 -1
- package/dist/controller/index.js +7 -6
- package/dist/controller/index.js.map +1 -1
- package/dist/delivery/index.js +670 -296
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.d.ts +2 -1
- package/dist/index.iife.d.ts.map +1 -1
- package/dist/index.iife.js +20 -5
- package/dist/index.js +670 -296
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/controller/defaults.ts +2 -0
- package/src/controller/index.ts +5 -6
- package/src/delivery/McPopulatedBlank.svelte +429 -104
- package/src/index.iife.ts +2 -8
package/dist/index.js
CHANGED
|
@@ -179,6 +179,14 @@ function hydration_failed() {
|
|
|
179
179
|
throw new Error(`https://svelte.dev/e/hydration_failed`);
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
|
+
* Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value
|
|
183
|
+
* @param {string} key
|
|
184
|
+
* @returns {never}
|
|
185
|
+
*/
|
|
186
|
+
function props_invalid_value(key) {
|
|
187
|
+
throw new Error(`https://svelte.dev/e/props_invalid_value`);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
182
190
|
* Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.
|
|
183
191
|
* @returns {never}
|
|
184
192
|
*/
|
|
@@ -487,6 +495,29 @@ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
|
|
|
487
495
|
* schedule effects if the update takes place inside a `$:` effect
|
|
488
496
|
*/
|
|
489
497
|
var legacy_is_updating_store = false;
|
|
498
|
+
/**
|
|
499
|
+
* Whether or not the prop currently being read is a store binding, as in
|
|
500
|
+
* `<Child bind:x={$y} />`. If it is, we treat the prop as mutable even in
|
|
501
|
+
* runes mode, and skip `binding_property_non_reactive` validation
|
|
502
|
+
*/
|
|
503
|
+
var is_store_binding = false;
|
|
504
|
+
/**
|
|
505
|
+
* Returns a tuple that indicates whether `fn()` reads a prop that is a store binding.
|
|
506
|
+
* Used to prevent `binding_property_non_reactive` validation false positives and
|
|
507
|
+
* ensure that these props are treated as mutable even in runes mode
|
|
508
|
+
* @template T
|
|
509
|
+
* @param {() => T} fn
|
|
510
|
+
* @returns {[T, boolean]}
|
|
511
|
+
*/
|
|
512
|
+
function capture_store_binding(fn) {
|
|
513
|
+
var previous_is_store_binding = is_store_binding;
|
|
514
|
+
try {
|
|
515
|
+
is_store_binding = false;
|
|
516
|
+
return [fn(), is_store_binding];
|
|
517
|
+
} finally {
|
|
518
|
+
is_store_binding = previous_is_store_binding;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
490
521
|
//#endregion
|
|
491
522
|
//#region \0@oxc-project+runtime@0.120.0/helpers/checkPrivateRedeclaration.js
|
|
492
523
|
function _checkPrivateRedeclaration(e, t) {
|
|
@@ -3070,46 +3101,6 @@ var event_symbol = Symbol("events");
|
|
|
3070
3101
|
var all_registered_events = /* @__PURE__ */ new Set();
|
|
3071
3102
|
/** @type {Set<(events: Array<string>) => void>} */
|
|
3072
3103
|
var root_event_handles = /* @__PURE__ */ new Set();
|
|
3073
|
-
/**
|
|
3074
|
-
* @param {string} event_name
|
|
3075
|
-
* @param {EventTarget} dom
|
|
3076
|
-
* @param {EventListener} [handler]
|
|
3077
|
-
* @param {AddEventListenerOptions} [options]
|
|
3078
|
-
*/
|
|
3079
|
-
function create_event(event_name, dom, handler, options = {}) {
|
|
3080
|
-
/**
|
|
3081
|
-
* @this {EventTarget}
|
|
3082
|
-
*/
|
|
3083
|
-
function target_handler(event) {
|
|
3084
|
-
if (!options.capture) handle_event_propagation.call(dom, event);
|
|
3085
|
-
if (!event.cancelBubble) return without_reactive_context(() => {
|
|
3086
|
-
return handler?.call(this, event);
|
|
3087
|
-
});
|
|
3088
|
-
}
|
|
3089
|
-
if (event_name.startsWith("pointer") || event_name.startsWith("touch") || event_name === "wheel") queue_micro_task(() => {
|
|
3090
|
-
dom.addEventListener(event_name, target_handler, options);
|
|
3091
|
-
});
|
|
3092
|
-
else dom.addEventListener(event_name, target_handler, options);
|
|
3093
|
-
return target_handler;
|
|
3094
|
-
}
|
|
3095
|
-
/**
|
|
3096
|
-
* @param {string} event_name
|
|
3097
|
-
* @param {Element} dom
|
|
3098
|
-
* @param {EventListener} [handler]
|
|
3099
|
-
* @param {boolean} [capture]
|
|
3100
|
-
* @param {boolean} [passive]
|
|
3101
|
-
* @returns {void}
|
|
3102
|
-
*/
|
|
3103
|
-
function event(event_name, dom, handler, capture, passive) {
|
|
3104
|
-
var options = {
|
|
3105
|
-
capture,
|
|
3106
|
-
passive
|
|
3107
|
-
};
|
|
3108
|
-
var target_handler = create_event(event_name, dom, handler, options);
|
|
3109
|
-
if (dom === document.body || dom === window || dom === document || dom instanceof HTMLMediaElement) teardown(() => {
|
|
3110
|
-
dom.removeEventListener(event_name, target_handler, options);
|
|
3111
|
-
});
|
|
3112
|
-
}
|
|
3113
3104
|
var last_propagated_event = null;
|
|
3114
3105
|
/**
|
|
3115
3106
|
* @this {EventTarget}
|
|
@@ -3251,19 +3242,50 @@ function from_html(content, flags) {
|
|
|
3251
3242
|
};
|
|
3252
3243
|
}
|
|
3253
3244
|
/**
|
|
3254
|
-
* @
|
|
3245
|
+
* @param {string} content
|
|
3246
|
+
* @param {number} flags
|
|
3247
|
+
* @param {'svg' | 'math'} ns
|
|
3248
|
+
* @returns {() => Node | Node[]}
|
|
3255
3249
|
*/
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
var
|
|
3263
|
-
var
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3250
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3251
|
+
function from_namespace(content, flags, ns = "svg") {
|
|
3252
|
+
/**
|
|
3253
|
+
* Whether or not the first item is a text/element node. If not, we need to
|
|
3254
|
+
* create an additional comment node to act as `effect.nodes.start`
|
|
3255
|
+
*/
|
|
3256
|
+
var has_start = !content.startsWith("<!>");
|
|
3257
|
+
var is_fragment = (flags & 1) !== 0;
|
|
3258
|
+
var wrapped = `<${ns}>${has_start ? content : "<!>" + content}</${ns}>`;
|
|
3259
|
+
/** @type {Element | DocumentFragment} */
|
|
3260
|
+
var node;
|
|
3261
|
+
return () => {
|
|
3262
|
+
if (hydrating) {
|
|
3263
|
+
assign_nodes(hydrate_node, null);
|
|
3264
|
+
return hydrate_node;
|
|
3265
|
+
}
|
|
3266
|
+
if (!node) {
|
|
3267
|
+
var root = /* @__PURE__ */ get_first_child(create_fragment_from_html(wrapped));
|
|
3268
|
+
if (is_fragment) {
|
|
3269
|
+
node = document.createDocumentFragment();
|
|
3270
|
+
while (/* @__PURE__ */ get_first_child(root)) node.appendChild(/* @__PURE__ */ get_first_child(root));
|
|
3271
|
+
} else node = /* @__PURE__ */ get_first_child(root);
|
|
3272
|
+
}
|
|
3273
|
+
var clone = node.cloneNode(true);
|
|
3274
|
+
if (is_fragment) {
|
|
3275
|
+
var start = /* @__PURE__ */ get_first_child(clone);
|
|
3276
|
+
var end = clone.lastChild;
|
|
3277
|
+
assign_nodes(start, end);
|
|
3278
|
+
} else assign_nodes(clone, clone);
|
|
3279
|
+
return clone;
|
|
3280
|
+
};
|
|
3281
|
+
}
|
|
3282
|
+
/**
|
|
3283
|
+
* @param {string} content
|
|
3284
|
+
* @param {number} flags
|
|
3285
|
+
*/
|
|
3286
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3287
|
+
function from_svg(content, flags) {
|
|
3288
|
+
return /* @__PURE__ */ from_namespace(content, flags, "svg");
|
|
3267
3289
|
}
|
|
3268
3290
|
/**
|
|
3269
3291
|
* Assign the created (or in hydration mode, traversed) dom elements to the current block
|
|
@@ -4517,6 +4539,94 @@ function bind_this(element_or_component = {}, update, get_value, get_parts) {
|
|
|
4517
4539
|
return element_or_component;
|
|
4518
4540
|
}
|
|
4519
4541
|
//#endregion
|
|
4542
|
+
//#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/reactivity/props.js
|
|
4543
|
+
/** @import { Effect, Source } from './types.js' */
|
|
4544
|
+
/**
|
|
4545
|
+
* This function is responsible for synchronizing a possibly bound prop with the inner component state.
|
|
4546
|
+
* It is used whenever the compiler sees that the component writes to the prop, or when it has a default prop_value.
|
|
4547
|
+
* @template V
|
|
4548
|
+
* @param {Record<string, unknown>} props
|
|
4549
|
+
* @param {string} key
|
|
4550
|
+
* @param {number} flags
|
|
4551
|
+
* @param {V | (() => V)} [fallback]
|
|
4552
|
+
* @returns {(() => V | ((arg: V) => V) | ((arg: V, mutation: boolean) => V))}
|
|
4553
|
+
*/
|
|
4554
|
+
function prop(props, key, flags, fallback) {
|
|
4555
|
+
var runes = !legacy_mode_flag || (flags & 2) !== 0;
|
|
4556
|
+
var bindable = (flags & 8) !== 0;
|
|
4557
|
+
var lazy = (flags & 16) !== 0;
|
|
4558
|
+
var fallback_value = fallback;
|
|
4559
|
+
var fallback_dirty = true;
|
|
4560
|
+
var get_fallback = () => {
|
|
4561
|
+
if (fallback_dirty) {
|
|
4562
|
+
fallback_dirty = false;
|
|
4563
|
+
fallback_value = lazy ? untrack(fallback) : fallback;
|
|
4564
|
+
}
|
|
4565
|
+
return fallback_value;
|
|
4566
|
+
};
|
|
4567
|
+
/** @type {((v: V) => void) | undefined} */
|
|
4568
|
+
let setter;
|
|
4569
|
+
if (bindable) {
|
|
4570
|
+
var is_entry_props = STATE_SYMBOL in props || LEGACY_PROPS in props;
|
|
4571
|
+
setter = get_descriptor(props, key)?.set ?? (is_entry_props && key in props ? (v) => props[key] = v : void 0);
|
|
4572
|
+
}
|
|
4573
|
+
/** @type {V} */
|
|
4574
|
+
var initial_value;
|
|
4575
|
+
var is_store_sub = false;
|
|
4576
|
+
if (bindable) [initial_value, is_store_sub] = capture_store_binding(() => props[key]);
|
|
4577
|
+
else initial_value = props[key];
|
|
4578
|
+
if (initial_value === void 0 && fallback !== void 0) {
|
|
4579
|
+
initial_value = get_fallback();
|
|
4580
|
+
if (setter) {
|
|
4581
|
+
if (runes) props_invalid_value(key);
|
|
4582
|
+
setter(initial_value);
|
|
4583
|
+
}
|
|
4584
|
+
}
|
|
4585
|
+
/** @type {() => V} */
|
|
4586
|
+
var getter;
|
|
4587
|
+
if (runes) getter = () => {
|
|
4588
|
+
var value = props[key];
|
|
4589
|
+
if (value === void 0) return get_fallback();
|
|
4590
|
+
fallback_dirty = true;
|
|
4591
|
+
return value;
|
|
4592
|
+
};
|
|
4593
|
+
else getter = () => {
|
|
4594
|
+
var value = props[key];
|
|
4595
|
+
if (value !== void 0) fallback_value = void 0;
|
|
4596
|
+
return value === void 0 ? fallback_value : value;
|
|
4597
|
+
};
|
|
4598
|
+
if (runes && (flags & 4) === 0) return getter;
|
|
4599
|
+
if (setter) {
|
|
4600
|
+
var legacy_parent = props.$$legacy;
|
|
4601
|
+
return (function(value, mutation) {
|
|
4602
|
+
if (arguments.length > 0) {
|
|
4603
|
+
if (!runes || !mutation || legacy_parent || is_store_sub)
|
|
4604
|
+
/** @type {Function} */ setter(mutation ? getter() : value);
|
|
4605
|
+
return value;
|
|
4606
|
+
}
|
|
4607
|
+
return getter();
|
|
4608
|
+
});
|
|
4609
|
+
}
|
|
4610
|
+
var overridden = false;
|
|
4611
|
+
var d = ((flags & 1) !== 0 ? derived : derived_safe_equal)(() => {
|
|
4612
|
+
overridden = false;
|
|
4613
|
+
return getter();
|
|
4614
|
+
});
|
|
4615
|
+
if (bindable) get(d);
|
|
4616
|
+
var parent_effect = active_effect;
|
|
4617
|
+
return (function(value, mutation) {
|
|
4618
|
+
if (arguments.length > 0) {
|
|
4619
|
+
const new_value = mutation ? get(d) : runes && bindable ? proxy(value) : value;
|
|
4620
|
+
set(d, new_value);
|
|
4621
|
+
overridden = true;
|
|
4622
|
+
if (fallback_value !== void 0) fallback_value = new_value;
|
|
4623
|
+
return value;
|
|
4624
|
+
}
|
|
4625
|
+
if (is_destroying_effect && overridden || (parent_effect.f & 16384) !== 0) return d.v;
|
|
4626
|
+
return get(d);
|
|
4627
|
+
});
|
|
4628
|
+
}
|
|
4629
|
+
//#endregion
|
|
4520
4630
|
//#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/legacy/legacy-client.js
|
|
4521
4631
|
/** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */
|
|
4522
4632
|
/**
|
|
@@ -4920,34 +5030,141 @@ function create_custom_element(Component, props_definition, slots, exports, shad
|
|
|
4920
5030
|
return Class;
|
|
4921
5031
|
}
|
|
4922
5032
|
//#endregion
|
|
5033
|
+
//#region ../../lib-svelte/styling/dist/index2.js
|
|
5034
|
+
var e = {
|
|
5035
|
+
50: "#e8f5e9",
|
|
5036
|
+
500: "#4caf50"
|
|
5037
|
+
}, t = {
|
|
5038
|
+
200: "#9fa8da",
|
|
5039
|
+
500: "#3f51b5",
|
|
5040
|
+
800: "#283593"
|
|
5041
|
+
}, n = { 500: "#ff9800" }, r = {
|
|
5042
|
+
200: "#f48fb1",
|
|
5043
|
+
900: "#880e4f",
|
|
5044
|
+
A400: "#f50057"
|
|
5045
|
+
}, i = {
|
|
5046
|
+
50: "#ffebee",
|
|
5047
|
+
700: "#d32f2f"
|
|
5048
|
+
}, a = {
|
|
5049
|
+
TEXT: "black",
|
|
5050
|
+
DISABLED: "grey",
|
|
5051
|
+
DISABLED_SECONDARY: "#ABABAB",
|
|
5052
|
+
CORRECT: e[500],
|
|
5053
|
+
CORRECT_SECONDARY: e[50],
|
|
5054
|
+
CORRECT_TERTIARY: "#0EA449",
|
|
5055
|
+
CORRECT_WITH_ICON: "#087D38",
|
|
5056
|
+
INCORRECT: n[500],
|
|
5057
|
+
INCORRECT_SECONDARY: i[50],
|
|
5058
|
+
INCORRECT_WITH_ICON: "#BF0D00",
|
|
5059
|
+
MISSING: i[700],
|
|
5060
|
+
MISSING_WITH_ICON: "#6A78A1",
|
|
5061
|
+
PRIMARY: t[500],
|
|
5062
|
+
PRIMARY_LIGHT: t[200],
|
|
5063
|
+
PRIMARY_DARK: t[800],
|
|
5064
|
+
SECONDARY: r.A400,
|
|
5065
|
+
SECONDARY_LIGHT: r[200],
|
|
5066
|
+
SECONDARY_DARK: r[900],
|
|
5067
|
+
TERTIARY: "#146EB3",
|
|
5068
|
+
TERTIARY_LIGHT: "#D0E2F0",
|
|
5069
|
+
BACKGROUND: "rgba(255,255,255,0)",
|
|
5070
|
+
BACKGROUND_DARK: "#ECEDF1",
|
|
5071
|
+
DROPDOWN_BACKGROUND: "#E0E1E6",
|
|
5072
|
+
SECONDARY_BACKGROUND: "rgba(241,241,241,1)",
|
|
5073
|
+
BORDER: "#9A9A9A",
|
|
5074
|
+
BORDER_LIGHT: "#D1D1D1",
|
|
5075
|
+
BORDER_DARK: "#646464",
|
|
5076
|
+
BORDER_GRAY: "#7E8494",
|
|
5077
|
+
BLACK: "#000000",
|
|
5078
|
+
WHITE: "#ffffff",
|
|
5079
|
+
TRANSPARENT: "transparent",
|
|
5080
|
+
FOCUS_CHECKED: "#BBDEFB",
|
|
5081
|
+
FOCUS_CHECKED_BORDER: "#1565C0",
|
|
5082
|
+
FOCUS_UNCHECKED: "#E0E0E0",
|
|
5083
|
+
FOCUS_UNCHECKED_BORDER: "#757575",
|
|
5084
|
+
BLUE_GREY100: "#F3F5F7",
|
|
5085
|
+
BLUE_GREY300: "#C0C3CF",
|
|
5086
|
+
BLUE_GREY600: "#7E8494",
|
|
5087
|
+
BLUE_GREY900: "#152452",
|
|
5088
|
+
FADED_PRIMARY: "#DCDAFB"
|
|
5089
|
+
};
|
|
5090
|
+
Object.freeze(a);
|
|
5091
|
+
var o = (e) => (...t) => {
|
|
5092
|
+
let n = t.pop();
|
|
5093
|
+
return t.reduceRight((t, n) => `var(--${e}-${n}, ${t})`, n);
|
|
5094
|
+
}, s = o("pie"), c = () => s("text", a.TEXT), l = () => s("disabled", a.DISABLED), u = () => s("disabled-secondary", a.DISABLED_SECONDARY), d = () => s("correct", a.CORRECT), f = () => s("correct-secondary", a.CORRECT_SECONDARY), p = () => s("correct-tertiary", a.CORRECT_TERTIARY), m = () => s("correct-icon", a.CORRECT_WITH_ICON), h = () => s("incorrect", a.INCORRECT), g = () => s("incorrect-icon", a.INCORRECT_WITH_ICON), _ = () => s("incorrect-secondary", a.INCORRECT_SECONDARY), v = () => s("missing", a.MISSING), y = () => s("missing-icon", a.MISSING_WITH_ICON), b = () => s("primary", a.PRIMARY), x = () => s("primary-light", a.PRIMARY_LIGHT), S = () => s("primary-dark", a.PRIMARY_DARK), C = () => s("primary-text", "text", a.TEXT), w = () => s("faded-primary", a.FADED_PRIMARY), T = () => s("secondary", a.SECONDARY), E = () => s("secondary-light", a.SECONDARY_LIGHT), D = () => s("secondary-dark", a.SECONDARY_DARK), O = () => s("secondary-text", "text", a.TEXT), k = () => s("background", a.BACKGROUND), A = () => s("background-dark", a.BACKGROUND_DARK), j = () => s("secondary-background", a.SECONDARY_BACKGROUND), M = () => s("dropdown-background", a.DROPDOWN_BACKGROUND), N = () => s("tertiary", a.TERTIARY), P = () => s("tertiary-light", a.TERTIARY_LIGHT), F = () => s("border", a.BORDER), I = () => s("border-light", a.BORDER_LIGHT), L = () => s("border-dark", a.BORDER_DARK), R = () => s("border-gray", a.BORDER_GRAY), z = () => s("black", a.BLACK), B = () => s("white", a.WHITE), V = () => a.TRANSPARENT, H = () => s("focus-checked", a.FOCUS_CHECKED), U = () => s("focus-checked-border", a.FOCUS_CHECKED_BORDER), W = () => s("focus-unchecked", a.FOCUS_UNCHECKED), G = () => s("focus-unchecked-border", a.FOCUS_UNCHECKED_BORDER), K = () => s("blue-grey-100", a.BLUE_GREY100), q = () => s("blue-grey-300", a.BLUE_GREY300), J = () => s("blue-grey-600", a.BLUE_GREY600), Y = () => s("blue-grey-900", a.BLUE_GREY900), Z = {
|
|
5095
|
+
text: c,
|
|
5096
|
+
disabled: l,
|
|
5097
|
+
disabledSecondary: u,
|
|
5098
|
+
correct: d,
|
|
5099
|
+
correctSecondary: f,
|
|
5100
|
+
correctTertiary: p,
|
|
5101
|
+
correctWithIcon: m,
|
|
5102
|
+
incorrect: h,
|
|
5103
|
+
incorrectWithIcon: g,
|
|
5104
|
+
incorrectSecondary: _,
|
|
5105
|
+
missing: v,
|
|
5106
|
+
missingWithIcon: y,
|
|
5107
|
+
primary: b,
|
|
5108
|
+
primaryLight: x,
|
|
5109
|
+
primaryDark: S,
|
|
5110
|
+
primaryText: C,
|
|
5111
|
+
fadedPrimary: w,
|
|
5112
|
+
secondary: T,
|
|
5113
|
+
secondaryLight: E,
|
|
5114
|
+
secondaryDark: D,
|
|
5115
|
+
secondaryText: O,
|
|
5116
|
+
background: k,
|
|
5117
|
+
backgroundDark: A,
|
|
5118
|
+
secondaryBackground: j,
|
|
5119
|
+
dropdownBackground: M,
|
|
5120
|
+
tertiary: N,
|
|
5121
|
+
tertiaryLight: P,
|
|
5122
|
+
border: F,
|
|
5123
|
+
borderLight: I,
|
|
5124
|
+
borderDark: L,
|
|
5125
|
+
borderGray: R,
|
|
5126
|
+
black: z,
|
|
5127
|
+
white: B,
|
|
5128
|
+
transparent: V,
|
|
5129
|
+
focusChecked: H,
|
|
5130
|
+
focusCheckedBorder: U,
|
|
5131
|
+
focusUnchecked: W,
|
|
5132
|
+
focusUncheckedBorder: G,
|
|
5133
|
+
blueGrey100: K,
|
|
5134
|
+
blueGrey300: q,
|
|
5135
|
+
blueGrey600: J,
|
|
5136
|
+
blueGrey900: Y
|
|
5137
|
+
};
|
|
5138
|
+
//#endregion
|
|
4923
5139
|
//#region src/delivery/McPopulatedBlank.svelte
|
|
4924
5140
|
var root_1 = /* @__PURE__ */ from_html(`<div class="mb-4 prose pie-prompt"></div>`);
|
|
4925
|
-
var root_3 = /* @__PURE__ */
|
|
4926
|
-
var
|
|
4927
|
-
var
|
|
4928
|
-
var root_6 = /* @__PURE__ */ from_html(`<
|
|
4929
|
-
var
|
|
4930
|
-
var
|
|
4931
|
-
var
|
|
4932
|
-
var root_10 = /* @__PURE__ */ from_html(`<
|
|
4933
|
-
var
|
|
4934
|
-
var
|
|
4935
|
-
var
|
|
4936
|
-
var
|
|
4937
|
-
var
|
|
4938
|
-
var
|
|
4939
|
-
var
|
|
4940
|
-
var
|
|
4941
|
-
var root_20 = /* @__PURE__ */ from_html(`<
|
|
4942
|
-
var
|
|
4943
|
-
var
|
|
4944
|
-
var root_23 = /* @__PURE__ */ from_html(`<span class="
|
|
4945
|
-
var
|
|
4946
|
-
var
|
|
5141
|
+
var root_3 = /* @__PURE__ */ from_svg(`<svg class="pie-correct-answer-toggle-svg svelte-6wlbb4" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-283 359 34 35"><circle cx="-266" cy="375.9" r="14" fill="var(--pie-correct-answer-toggle-icon-open-bg, #bce2ff)"></circle><path d="M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z" fill="var(--pie-correct-answer-toggle-icon-open-bg, #bce2ff)"></path><polygon points="-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6" fill="var(--pie-correct-answer-toggle-icon-glyph-color, #1a9cff)"></polygon></svg>`);
|
|
5142
|
+
var root_4 = /* @__PURE__ */ from_svg(`<svg class="pie-correct-answer-toggle-svg svelte-6wlbb4" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-129.5 127 34 35"><path d="M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z" fill="#D0CAC5" stroke="#E6E3E0" stroke-width="0.75"></path><path d="M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z" fill="#B3ABA4" stroke="#CDC7C2" stroke-width="0.5"></path><circle cx="-114.2" cy="143.5" r="14" fill="white"></circle><path d="M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z" fill="var(--pie-correct-answer-toggle-icon-closed-bg, #bce2ff)"></path><polygon points="-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2" fill="var(--pie-correct-answer-toggle-icon-glyph-color, #1a9cff)"></polygon></svg>`);
|
|
5143
|
+
var root_2 = /* @__PURE__ */ from_html(`<div class="pie-correct-answer-toggle-row svelte-6wlbb4"><button type="button" class="mb-3 pie-toggle-correct-answer svelte-6wlbb4" style="gap:var(--mpb-toggle-button-gap, 0.5rem);" data-testid="show-correct-answer"><span class="pie-correct-answer-toggle-content svelte-6wlbb4"><span class="pie-correct-answer-toggle-icon-holder svelte-6wlbb4" aria-hidden="true"><!></span> <span class="pie-correct-answer-toggle-label svelte-6wlbb4"> </span></span></button></div>`);
|
|
5144
|
+
var root_6 = /* @__PURE__ */ from_html(`<audio class="sr-only pie-audio-player svelte-6wlbb4" preload="metadata" aria-hidden="true" tabindex="-1"></audio> <button class="listen-button pie-listen-button rli-feature-audio svelte-6wlbb4" type="button"><img alt="" aria-hidden="true"/> <img alt="" aria-hidden="true"/></button>`, 1);
|
|
5145
|
+
var root_8 = /* @__PURE__ */ from_html(`<button class="mt-2 text-sm underline pie-audio-autoplay-enable" type="button"> </button>`);
|
|
5146
|
+
var root_7 = /* @__PURE__ */ from_html(`<audio controls="" class="w-full max-w-md pie-audio-player" preload="metadata"><track kind="captions"/></audio> <!>`, 1);
|
|
5147
|
+
var root_9 = /* @__PURE__ */ from_html(`<p class="text-sm text-red-700 pie-audio-error" role="alert"> </p>`);
|
|
5148
|
+
var root_10 = /* @__PURE__ */ from_html(`<p><strong> </strong> </p>`);
|
|
5149
|
+
var root_5 = /* @__PURE__ */ from_html(`<div class="mb-4 audio-container pie-audio-container svelte-6wlbb4"><!> <!></div>`);
|
|
5150
|
+
var root_11 = /* @__PURE__ */ from_html(`<div class="mb-3 prose prose-p:my-1 sentence-line pie-sentence-line svelte-6wlbb4"></div>`);
|
|
5151
|
+
var root_13 = /* @__PURE__ */ from_html(`<img class="w-auto object-contain pie-blank-image" style="max-height:var(--mpb-selected-image-max-height, 4rem);"/>`);
|
|
5152
|
+
var root_14 = /* @__PURE__ */ from_html(`<span class="blank-inner choice-label pie-blank-value svelte-6wlbb4"></span>`);
|
|
5153
|
+
var root_15 = /* @__PURE__ */ from_html(`<span class="blank-inner-empty svelte-6wlbb4" aria-hidden="true"> </span>`);
|
|
5154
|
+
var root_12 = /* @__PURE__ */ from_html(`<div class="mb-4 template-line pie-template-line svelte-6wlbb4"><!> <span role="status" aria-live="polite" aria-atomic="true"><!></span> <!></div>`);
|
|
5155
|
+
var root_16 = /* @__PURE__ */ from_html(`<p class="sr-only pie-result-feedback svelte-6wlbb4" role="status" aria-live="polite"> </p>`);
|
|
5156
|
+
var root_19 = /* @__PURE__ */ from_html(`<img class="object-contain mx-auto pie-choice-image" style="max-height:var(--mpb-choice-image-max-height, 5rem);"/>`);
|
|
5157
|
+
var root_20 = /* @__PURE__ */ from_html(`<span class="choice-label pie-choice-label svelte-6wlbb4"></span>`);
|
|
5158
|
+
var root_18 = /* @__PURE__ */ from_html(`<label class="cursor-pointer choice-tile text-center pie-choice-tile svelte-6wlbb4"><span class="choice-tile-content pie-choice-tile-content svelte-6wlbb4"><!></span> <input type="radio" class="choice-radio-bottom pie-choice-radio pie-choice-radio-bottom svelte-6wlbb4"/></label>`);
|
|
5159
|
+
var root_22 = /* @__PURE__ */ from_html(`<img class="object-contain pie-choice-image" style="max-height:var(--mpb-choice-image-max-height, 5rem);"/>`);
|
|
5160
|
+
var root_23 = /* @__PURE__ */ from_html(`<span class="choice-label pie-choice-label svelte-6wlbb4"></span>`);
|
|
5161
|
+
var root_21 = /* @__PURE__ */ from_html(`<input type="radio" class="choice-radio-inline pie-choice-radio pie-choice-radio-inline svelte-6wlbb4"/> <label class="cursor-pointer flex-1 pie-choice-label-wrap"><!></label>`, 1);
|
|
5162
|
+
var root_24 = /* @__PURE__ */ from_html(`<span aria-hidden="true"> </span>`);
|
|
5163
|
+
var root_17 = /* @__PURE__ */ from_html(`<div style="gap:var(--mpb-choice-row-gap, 0.5rem);"><!> <!></div>`);
|
|
4947
5164
|
var root = /* @__PURE__ */ from_html(`<div><!> <!> <!> <!> <!> <!> <fieldset class="border-0 p-0 m-0 pie-choices-fieldset svelte-6wlbb4"><legend class="sr-only pie-choices-legend svelte-6wlbb4"> </legend> <div style="gap:var(--mpb-choice-group-gap, 0.5rem);" role="radiogroup" tabindex="-1"></div></fieldset></div>`);
|
|
4948
5165
|
var $$css = {
|
|
4949
5166
|
hash: "svelte-6wlbb4",
|
|
4950
|
-
code: ".sr-only.svelte-6wlbb4 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.mc-populated-blank-root.svelte-6wlbb4 .prose {max-width:none;}.blank-slot.svelte-6wlbb4:focus-within {outline:2px solid var(--pie-focus, #2563eb);outline-offset:2px;}.blank-slot.svelte-6wlbb4 {display:inline-flex;align-items:center;justify-content:center;text-align:center;vertical-align:baseline;}.template-line.svelte-6wlbb4 {white-space:pre-wrap;}.template-line.svelte-6wlbb4 p {margin:0;}.blank-inner-empty.svelte-6wlbb4 {display:inline-block;min-width:4ch;}.blank-slot-standalone.svelte-6wlbb4 {width:var(--mpb-blank-standalone-width, 7rem);}.listen-button.svelte-6wlbb4 {width:var(--mpb-listen-button-size, 128px);height:var(--mpb-listen-button-size, 128px);border:0;padding:0;background-color:transparent;cursor:pointer;z-index:1;}.listen-button.svelte-6wlbb4:hover {background-color:#e2f1fe;}.listen-feature-icon.svelte-6wlbb4 {width:var(--mpb-listen-button-size, 128px);height:var(--mpb-listen-button-size, 128px);object-fit:contain;display:none;}.listen-feature-icon.listen-active.svelte-6wlbb4 {display:block;}.choice-row-horizontal.svelte-6wlbb4 {flex-direction:column;align-items:center;width:min(var(--mpb-choice-width-px, 170px), var(--mpb-choice-width-vw, 30vw));gap:0;}.choice-tile.svelte-6wlbb4 {display:flex;flex-direction:column;justify-content:space-between;align-items:center;width:100%;min-height:var(--mpb-choice-tile-min-height, 11rem);padding:0.8rem 0.65rem 0.5rem;border-radius:8px;background:transparent;transition:background-color 120ms ease-in-out;}.choice-tile-content.svelte-6wlbb4 {width:100%;display:flex;align-items:center;justify-content:center;min-height:var(--mpb-choice-content-min-height, 7.5rem);}.choice-row-horizontal.svelte-6wlbb4:hover .choice-tile:where(.svelte-6wlbb4) {background:#ececec;}.choice-row-horizontal.is-selected.svelte-6wlbb4 .choice-tile:where(.svelte-6wlbb4) {background:#eceabf;}.choice-row-horizontal.is-selected.svelte-6wlbb4:hover .choice-tile:where(.svelte-6wlbb4) {background:#eceabf;}.choice-row-horizontal.svelte-6wlbb4 p {margin:0;text-align:center;}.choice-label.svelte-6wlbb4 p,\n .blank-inner.svelte-6wlbb4 p {margin:0;}.blank-inner.svelte-6wlbb4 {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.choice-radio-bottom.svelte-6wlbb4 {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}.choice-radio-inline.svelte-6wlbb4 {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}.layout-audio_blank_only.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {display:flex;justify-content:flex-end;}.layout-audio_blank_only.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {text-align:center;margin:var(--mpb-audio-blank-template-margin-top, 0.8rem) 0\n var(--mpb-audio-blank-template-margin-bottom, 1.8rem);}.layout-audio_blank_only.svelte-6wlbb4 .blank-slot:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .blank-slot:where(.svelte-6wlbb4) {width:var(--mpb-blank-wide-width, 10rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 4px);}.layout-stimulus_image_blank.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-stimulus-min-column, 210px), 1fr) auto;grid-template-areas:'sentence audio'\n '. template'\n 'choices choices';column-gap:var(--mpb-stimulus-grid-column-gap, 2rem);row-gap:var(--mpb-stimulus-grid-row-gap, 0.7rem);align-items:start;}.layout-stimulus_image_blank.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {grid-area:audio;margin:0;}.layout-stimulus_image_blank.svelte-6wlbb4 .sentence-line:where(.svelte-6wlbb4) {grid-area:sentence;margin:var(--mpb-stimulus-sentence-margin-top, 0.2rem) 0 0;}.layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:0;text-align:center;justify-self:center;}.layout-stimulus_image_blank.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-stimulus-choices-margin-top, 0.9rem);}.layout-token_sequence.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-text-min-column, 260px), 1fr) auto;grid-template-areas:'template audio'\n 'choices choices';column-gap:var(--mpb-token-grid-column-gap, 1.5rem);row-gap:var(--mpb-token-grid-row-gap, 0.8rem);align-items:start;}.layout-token_sequence.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {grid-area:audio;margin:0;justify-self:end;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-token-template-margin-top, 0.6rem) 0 0;justify-self:center;text-align:center;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) span + span {margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 .blank-slot:where(.svelte-6wlbb4) {width:var(--mpb-blank-standalone-width, 7rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 4px);margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-token-choices-margin-top, 0.2rem);}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-text-min-column, 260px), 1fr) auto;grid-template-areas:'template audio'\n 'choices choices';column-gap:var(--mpb-inline-grid-column-gap, 1.5rem);row-gap:var(--mpb-inline-grid-row-gap, 0.65rem);align-items:start;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {grid-area:audio;margin:0;justify-self:end;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-inline-template-margin-top, 0.45rem) 0 0;text-align:center;justify-self:center;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-inline-choices-margin-top, 0.25rem);}"
|
|
5167
|
+
code: ".sr-only.svelte-6wlbb4 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.mc-populated-blank-root.svelte-6wlbb4 .prose {max-width:none;}.blank-slot.svelte-6wlbb4:focus-within {outline:2px solid var(--pie-focus, #2563eb);outline-offset:2px;}.blank-slot.svelte-6wlbb4 {display:inline-flex;align-items:center;justify-content:center;text-align:center;vertical-align:baseline;}.pie-toggle-correct-answer.svelte-6wlbb4 {width:100%;cursor:pointer;border:0;background:transparent;padding:0;display:flex;justify-content:center;text-align:center;color:var(--pie-correct-answer-toggle-label-color, var(--pie-text, black));}.pie-correct-answer-toggle-row.svelte-6wlbb4 {width:100%;display:flex;justify-content:flex-end;}.pie-correct-answer-toggle-content.svelte-6wlbb4 {display:flex;margin:0 auto;align-items:center;}.pie-correct-answer-toggle-icon-holder.svelte-6wlbb4 {width:25px;margin-right:5px;display:inline-flex;align-items:center;justify-content:center;}.pie-correct-answer-toggle-svg.svelte-6wlbb4 {width:25px;height:25px;}.pie-correct-answer-toggle-label.svelte-6wlbb4 {width:fit-content;min-width:140px;align-self:center;vertical-align:middle;font-weight:400;user-select:none;}.pie-toggle-correct-answer.svelte-6wlbb4:hover .pie-correct-answer-toggle-label:where(.svelte-6wlbb4),\n .pie-toggle-correct-answer.svelte-6wlbb4:focus-visible .pie-correct-answer-toggle-label:where(.svelte-6wlbb4) {text-decoration:underline;}.template-line.svelte-6wlbb4 {white-space:pre-wrap;}.template-line.svelte-6wlbb4 p {margin:0;}.blank-inner-empty.svelte-6wlbb4 {display:inline-block;min-width:4ch;}.blank-slot-standalone.svelte-6wlbb4 {width:var(--mpb-blank-standalone-width, 7rem);}.listen-button.svelte-6wlbb4 {width:var(--mpb-listen-button-size, 128px);height:var(--mpb-listen-button-size, 128px);border:0;padding:0;background-color:transparent;cursor:pointer;z-index:1;}.listen-button.svelte-6wlbb4:hover {background-color:#e2f1fe;}.listen-feature-icon.svelte-6wlbb4 {width:var(--mpb-listen-button-size, 128px);height:var(--mpb-listen-button-size, 128px);object-fit:contain;display:none;}.listen-feature-icon.listen-active.svelte-6wlbb4 {display:block;}.choice-row-horizontal.svelte-6wlbb4 {flex-direction:column;align-items:center;width:min(var(--mpb-choice-width-px, 170px), var(--mpb-choice-width-vw, 30vw));gap:0;}.choice-tile.svelte-6wlbb4 {display:flex;flex-direction:column;justify-content:space-between;align-items:center;width:100%;min-height:var(--mpb-choice-tile-min-height, 11rem);padding:0.8rem 0.65rem 0.5rem;border-radius:8px;background:transparent;transition:background-color 120ms ease-in-out;}.choice-tile-content.svelte-6wlbb4 {width:100%;display:flex;align-items:center;justify-content:center;min-height:var(--mpb-choice-content-min-height, 7.5rem);}.choice-row-horizontal.svelte-6wlbb4:hover .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-hover-bg, #ececec);}.choice-row-horizontal.is-selected.svelte-6wlbb4 .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-selected-bg, #f1f1f1);}.choice-row-horizontal.is-selected.svelte-6wlbb4:hover .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-selected-bg, #f1f1f1);}.pie-choice.choice-correct.svelte-6wlbb4 {border-left:3px solid var(--pie-correct-answer-choice-correct-border, #0ea449);}.pie-choice.choice-incorrect.svelte-6wlbb4 {border-left:3px solid var(--pie-correct-answer-choice-incorrect-border, #bf0d00);}.pie-choice-horizontal.choice-correct.svelte-6wlbb4 .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-correct-bg, #e8f5e9);}.pie-choice-horizontal.choice-incorrect.svelte-6wlbb4 .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-incorrect-bg, #ffebee);}.pie-choice-feedback-badge.svelte-6wlbb4 {margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:1.1rem;height:1.1rem;border-radius:9999px;font-size:0.72rem;line-height:1;font-weight:700;color:var(--pie-correct-answer-feedback-glyph-color, #fff);}.pie-choice-feedback-correct.svelte-6wlbb4 {background:var(--pie-correct-answer-feedback-correct-bg, #087d38);}.pie-choice-feedback-incorrect.svelte-6wlbb4 {background:var(--pie-correct-answer-feedback-incorrect-bg, #bf0d00);}.choice-row-horizontal.svelte-6wlbb4 p {margin:0;text-align:center;}.choice-label.svelte-6wlbb4 p,\n .blank-inner.svelte-6wlbb4 p {margin:0;}.blank-inner.svelte-6wlbb4 {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.choice-radio-bottom.svelte-6wlbb4 {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}.choice-radio-inline.svelte-6wlbb4 {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}.layout-audio_blank_only.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {display:flex;width:min(100%, var(--mpb-audio-instructions-max-width, 875px));margin-left:auto;margin-right:auto;justify-content:flex-end;}.layout-audio_blank_only.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {text-align:center;margin:var(--mpb-audio-blank-template-margin-top, 0.8rem) 0\n var(--mpb-audio-blank-template-margin-bottom, 1.8rem);}.layout-audio_blank_only.svelte-6wlbb4 .blank-slot:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .blank-slot:where(.svelte-6wlbb4) {width:var(--mpb-blank-wide-width, 10rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 4px);}.layout-stimulus_image_blank.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-stimulus-min-column, 210px), 1fr) auto;grid-template-areas:'sentence audio'\n '. template'\n 'choices choices';column-gap:var(--mpb-stimulus-grid-column-gap, 2rem);row-gap:var(--mpb-stimulus-grid-row-gap, 0.7rem);align-items:start;}.layout-stimulus_image_blank.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {grid-area:audio;margin:0;}.layout-stimulus_image_blank.svelte-6wlbb4 .sentence-line:where(.svelte-6wlbb4) {grid-area:sentence;margin:var(--mpb-stimulus-sentence-margin-top, 0.2rem) 0 0;}.layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:0;text-align:center;justify-self:center;}.layout-stimulus_image_blank.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-stimulus-choices-margin-top, 0.9rem);}.layout-token_sequence.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-text-min-column, 260px), 1fr) auto;grid-template-areas:'template audio'\n 'choices choices';column-gap:var(--mpb-token-grid-column-gap, 1.5rem);row-gap:var(--mpb-token-grid-row-gap, 0.8rem);align-items:start;}.layout-token_sequence.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {grid-area:audio;margin:0;justify-self:end;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-token-template-margin-top, 0.6rem) 0 0;justify-self:center;text-align:center;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) span + span {margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 .blank-slot:where(.svelte-6wlbb4) {width:var(--mpb-blank-standalone-width, 7rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 4px);margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-token-choices-margin-top, 0.2rem);}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-text-min-column, 260px), 1fr) auto;grid-template-areas:'template audio'\n 'choices choices';column-gap:var(--mpb-inline-grid-column-gap, 1.5rem);row-gap:var(--mpb-inline-grid-row-gap, 0.65rem);align-items:start;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {grid-area:audio;margin:0;justify-self:end;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-inline-template-margin-top, 0.45rem) 0 0;text-align:center;justify-self:center;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-inline-choices-margin-top, 0.25rem);}\n\n /* Match Learnosity responsive behavior for CQT audio-blank layouts:\n at smaller widths, audio control shifts left and answer tiles stack. */\n @media (max-width: 760px) {.layout-audio_blank_only.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {width:100%;margin-left:0;margin-right:0;justify-content:flex-start;justify-self:start;}.layout-audio_blank_only.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4) {flex-direction:column;align-items:flex-start;justify-content:flex-start;}.layout-audio_blank_only.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4) {width:min(100%, var(--mpb-narrow-choice-max-width, 230px));align-items:flex-start;}\n }"
|
|
4951
5168
|
};
|
|
4952
5169
|
function McPopulatedBlank($$anchor, $$props) {
|
|
4953
5170
|
push($$props, true);
|
|
@@ -4975,6 +5192,8 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
4975
5192
|
horizontalChoiceRadioTopMarginRem: .5,
|
|
4976
5193
|
audioBlankTemplateMarginTopRem: .8,
|
|
4977
5194
|
audioBlankTemplateMarginBottomRem: 1.8,
|
|
5195
|
+
audioInstructionsMaxWidthPx: 875,
|
|
5196
|
+
narrowHorizontalChoiceMaxWidthPx: 230,
|
|
4978
5197
|
stimulusGridColumnGapRem: 2,
|
|
4979
5198
|
stimulusGridRowGapRem: .7,
|
|
4980
5199
|
stimulusSentenceMarginTopRem: .2,
|
|
@@ -5024,37 +5243,44 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5024
5243
|
listenLabelEn: "Listen",
|
|
5025
5244
|
listenLabelEs: "Escuchar"
|
|
5026
5245
|
};
|
|
5246
|
+
let model = prop($$props, "model", 7), session = prop($$props, "session", 7), options = prop($$props, "options", 7);
|
|
5027
5247
|
let audioEl = /* @__PURE__ */ state(null);
|
|
5028
5248
|
let isMediaPlaying = /* @__PURE__ */ state(false);
|
|
5029
5249
|
let localChoiceId = /* @__PURE__ */ state("");
|
|
5030
5250
|
let autoPlayPromptOpen = /* @__PURE__ */ state(false);
|
|
5031
5251
|
let autoplayAttempted = /* @__PURE__ */ state(false);
|
|
5252
|
+
let featureAudioButtonEl = /* @__PURE__ */ state(null);
|
|
5253
|
+
let autoplayEnableButtonEl = /* @__PURE__ */ state(null);
|
|
5254
|
+
let toggleCorrectAnswerButtonEl = /* @__PURE__ */ state(null);
|
|
5255
|
+
let choicesGroupEl = /* @__PURE__ */ state(null);
|
|
5032
5256
|
const instanceId = `mc-populated-blank-${Math.random().toString(36).slice(2, 10)}`;
|
|
5033
|
-
const
|
|
5034
|
-
const
|
|
5257
|
+
const deliveryMode = /* @__PURE__ */ user_derived(() => (model()?.mode || model()?.env?.mode || "").toString());
|
|
5258
|
+
const isEvaluateMode = /* @__PURE__ */ user_derived(() => get(deliveryMode) === "evaluate");
|
|
5259
|
+
const correctness = /* @__PURE__ */ user_derived(() => model()?.correctness);
|
|
5260
|
+
const isResponseCorrect = /* @__PURE__ */ user_derived(() => typeof model()?.responseCorrect === "boolean" ? model().responseCorrect : get(correctness) === "correct");
|
|
5035
5261
|
const isCorrect = /* @__PURE__ */ user_derived(() => get(correctness) === "correct");
|
|
5036
5262
|
const isIncorrect = /* @__PURE__ */ user_derived(() => get(correctness) === "incorrect");
|
|
5037
|
-
const isAudioOnlyMode = /* @__PURE__ */ user_derived(() =>
|
|
5263
|
+
const isAudioOnlyMode = /* @__PURE__ */ user_derived(() => model()?.interactionMode === "audio_mc_only");
|
|
5038
5264
|
const isBlankOnlyTemplate = /* @__PURE__ */ user_derived(() => {
|
|
5039
|
-
const t =
|
|
5265
|
+
const t = model()?.template || "";
|
|
5040
5266
|
if (!t) return false;
|
|
5041
5267
|
return t.replace(/<[^>]+>/g, "").replace(/ /g, " ").trim() === BLANK_TOKEN;
|
|
5042
5268
|
});
|
|
5043
|
-
const layoutProfile = /* @__PURE__ */ user_derived(() =>
|
|
5044
|
-
const choiceLayout = /* @__PURE__ */ user_derived(() =>
|
|
5269
|
+
const layoutProfile = /* @__PURE__ */ user_derived(() => model()?.layoutProfile || "");
|
|
5270
|
+
const choiceLayout = /* @__PURE__ */ user_derived(() => model()?.choiceLayout || (get(isAudioOnlyMode) || get(isBlankOnlyTemplate) ? "horizontal" : "vertical"));
|
|
5045
5271
|
const isHorizontalChoices = /* @__PURE__ */ user_derived(() => get(choiceLayout) === "horizontal");
|
|
5046
|
-
const showVisibleTranscript = /* @__PURE__ */ user_derived(() =>
|
|
5047
|
-
const hasPlayableAudio = /* @__PURE__ */ user_derived(() =>
|
|
5048
|
-
const hasAudioButMissingResource = /* @__PURE__ */ user_derived(() =>
|
|
5049
|
-
const hasInlineSentenceAudioLayout = /* @__PURE__ */ user_derived(() => get(layoutProfile) === "inline_sentence" &&
|
|
5272
|
+
const showVisibleTranscript = /* @__PURE__ */ user_derived(() => !!model()?.showVisibleTranscript);
|
|
5273
|
+
const hasPlayableAudio = /* @__PURE__ */ user_derived(() => !!model()?.hasAudio && !!model()?.audioUrl);
|
|
5274
|
+
const hasAudioButMissingResource = /* @__PURE__ */ user_derived(() => !!model()?.hasAudio && !model()?.audioUrl);
|
|
5275
|
+
const hasInlineSentenceAudioLayout = /* @__PURE__ */ user_derived(() => get(layoutProfile) === "inline_sentence" && !!model()?.hasAudio);
|
|
5050
5276
|
const uiText = /* @__PURE__ */ user_derived(() => ({
|
|
5051
5277
|
...DEFAULT_UI_TEXT,
|
|
5052
|
-
|
|
5278
|
+
...model()?.uiText || {}
|
|
5053
5279
|
}));
|
|
5054
5280
|
const profilePresetLimits = /* @__PURE__ */ user_derived(() => {
|
|
5055
5281
|
const profile = String(get(layoutProfile) || "");
|
|
5056
5282
|
const defaults = DEFAULT_LAYOUT_PROFILE_PRESETS[profile] || {};
|
|
5057
|
-
const customPresets =
|
|
5283
|
+
const customPresets = model()?.layoutProfilePresets && typeof model().layoutProfilePresets === "object" ? model().layoutProfilePresets : {};
|
|
5058
5284
|
const custom = customPresets[profile] && typeof customPresets[profile] === "object" ? customPresets[profile] : {};
|
|
5059
5285
|
return {
|
|
5060
5286
|
...defaults,
|
|
@@ -5062,13 +5288,28 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5062
5288
|
};
|
|
5063
5289
|
});
|
|
5064
5290
|
const layoutLimits = /* @__PURE__ */ user_derived(() => {
|
|
5065
|
-
const configured =
|
|
5291
|
+
const configured = model()?.layoutLimits && typeof model().layoutLimits === "object" ? model().layoutLimits : {};
|
|
5066
5292
|
return {
|
|
5067
5293
|
...DEFAULT_LAYOUT_LIMITS,
|
|
5068
5294
|
...get(profilePresetLimits),
|
|
5069
5295
|
...configured
|
|
5070
5296
|
};
|
|
5071
5297
|
});
|
|
5298
|
+
const correctAnswerStyleVars = /* @__PURE__ */ user_derived(() => [
|
|
5299
|
+
`--pie-correct-answer-toggle-label-color:${Z.text()}`,
|
|
5300
|
+
`--pie-correct-answer-toggle-icon-open-bg:${Z.tertiaryLight()}`,
|
|
5301
|
+
`--pie-correct-answer-toggle-icon-closed-bg:${Z.backgroundDark()}`,
|
|
5302
|
+
`--pie-correct-answer-toggle-icon-glyph-color:${Z.tertiary()}`,
|
|
5303
|
+
`--pie-correct-answer-choice-hover-bg:${Z.backgroundDark()}`,
|
|
5304
|
+
`--pie-correct-answer-choice-selected-bg:${Z.secondaryBackground()}`,
|
|
5305
|
+
`--pie-correct-answer-choice-correct-bg:${Z.correctSecondary()}`,
|
|
5306
|
+
`--pie-correct-answer-choice-incorrect-bg:${Z.incorrectSecondary()}`,
|
|
5307
|
+
`--pie-correct-answer-choice-correct-border:${Z.correctTertiary()}`,
|
|
5308
|
+
`--pie-correct-answer-choice-incorrect-border:${Z.incorrectWithIcon()}`,
|
|
5309
|
+
`--pie-correct-answer-feedback-correct-bg:${Z.correctWithIcon()}`,
|
|
5310
|
+
`--pie-correct-answer-feedback-incorrect-bg:${Z.incorrectWithIcon()}`,
|
|
5311
|
+
`--pie-correct-answer-feedback-glyph-color:${Z.white()}`
|
|
5312
|
+
].join(";"));
|
|
5072
5313
|
const rootStyle = /* @__PURE__ */ user_derived(() => [
|
|
5073
5314
|
`--mpb-listen-button-size:${get(layoutLimits).listenButtonSizePx}px`,
|
|
5074
5315
|
`--mpb-blank-standalone-width:${get(layoutLimits).blankStandaloneWidthRem}rem`,
|
|
@@ -5089,6 +5330,8 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5089
5330
|
`--mpb-horizontal-choice-radio-top-margin:${get(layoutLimits).horizontalChoiceRadioTopMarginRem}rem`,
|
|
5090
5331
|
`--mpb-audio-blank-template-margin-top:${get(layoutLimits).audioBlankTemplateMarginTopRem}rem`,
|
|
5091
5332
|
`--mpb-audio-blank-template-margin-bottom:${get(layoutLimits).audioBlankTemplateMarginBottomRem}rem`,
|
|
5333
|
+
`--mpb-audio-instructions-max-width:${get(layoutLimits).audioInstructionsMaxWidthPx}px`,
|
|
5334
|
+
`--mpb-narrow-choice-max-width:${get(layoutLimits).narrowHorizontalChoiceMaxWidthPx}px`,
|
|
5092
5335
|
`--mpb-stimulus-grid-column-gap:${get(layoutLimits).stimulusGridColumnGapRem}rem`,
|
|
5093
5336
|
`--mpb-stimulus-grid-row-gap:${get(layoutLimits).stimulusGridRowGapRem}rem`,
|
|
5094
5337
|
`--mpb-stimulus-sentence-margin-top:${get(layoutLimits).stimulusSentenceMarginTopRem}rem`,
|
|
@@ -5101,15 +5344,16 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5101
5344
|
`--mpb-inline-grid-column-gap:${get(layoutLimits).inlineGridColumnGapRem}rem`,
|
|
5102
5345
|
`--mpb-inline-grid-row-gap:${get(layoutLimits).inlineGridRowGapRem}rem`,
|
|
5103
5346
|
`--mpb-inline-template-margin-top:${get(layoutLimits).inlineTemplateMarginTopRem}rem`,
|
|
5104
|
-
`--mpb-inline-choices-margin-top:${get(layoutLimits).inlineChoicesMarginTopRem}rem
|
|
5347
|
+
`--mpb-inline-choices-margin-top:${get(layoutLimits).inlineChoicesMarginTopRem}rem`,
|
|
5348
|
+
get(correctAnswerStyleVars)
|
|
5105
5349
|
].join(";"));
|
|
5106
5350
|
const useFeatureButtonAudio = /* @__PURE__ */ user_derived(() => {
|
|
5107
|
-
if (typeof
|
|
5351
|
+
if (typeof model()?.useFeatureButtonAudio === "boolean") return !!model().useFeatureButtonAudio;
|
|
5108
5352
|
const profile = get(layoutProfile) || "";
|
|
5109
|
-
return
|
|
5353
|
+
return !!model()?.hasAudio && (profile === "audio_blank_only" || profile === "stimulus_image_blank" || profile === "token_sequence");
|
|
5110
5354
|
});
|
|
5111
5355
|
const templateParts = /* @__PURE__ */ user_derived(() => {
|
|
5112
|
-
const t =
|
|
5356
|
+
const t = model()?.template || "";
|
|
5113
5357
|
const idx = t.indexOf(BLANK_TOKEN);
|
|
5114
5358
|
if (idx < 0) return {
|
|
5115
5359
|
before: t,
|
|
@@ -5129,18 +5373,22 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5129
5373
|
if (get(layoutProfile) === "audio_blank_only" || get(layoutProfile) === "stimulus_image_blank") return `${get(layoutLimits).blankUnderlineWideWidthPx}px`;
|
|
5130
5374
|
return `${get(layoutLimits).blankUnderlineWidthPx}px`;
|
|
5131
5375
|
});
|
|
5132
|
-
const choices = /* @__PURE__ */ user_derived(() => Array.isArray(
|
|
5133
|
-
const choiceMode = /* @__PURE__ */ user_derived(() =>
|
|
5134
|
-
const selectedId = /* @__PURE__ */ user_derived(() =>
|
|
5135
|
-
const radioGroupName = /* @__PURE__ */ user_derived(() => `${instanceId}-choice-group-${
|
|
5376
|
+
const choices = /* @__PURE__ */ user_derived(() => Array.isArray(model()?.choices) ? model().choices : []);
|
|
5377
|
+
const choiceMode = /* @__PURE__ */ user_derived(() => model()?.choiceMode || "text");
|
|
5378
|
+
const selectedId = /* @__PURE__ */ user_derived(() => session()?.choiceId || get(localChoiceId) || "");
|
|
5379
|
+
const radioGroupName = /* @__PURE__ */ user_derived(() => `${instanceId}-choice-group-${model()?.id || "1"}`);
|
|
5136
5380
|
let showCorrectAnswer = /* @__PURE__ */ state(false);
|
|
5381
|
+
const alwaysShowCorrect = /* @__PURE__ */ user_derived(() => !!model()?.alwaysShowCorrect || !!options()?.alwaysShowCorrect || !!options()?.addCorrectResponse);
|
|
5382
|
+
const canRevealCorrectAnswer = /* @__PURE__ */ user_derived(() => !!model()?.correctChoiceId && (get(isEvaluateMode) || get(alwaysShowCorrect)));
|
|
5383
|
+
const shouldShowCorrectAnswer = /* @__PURE__ */ user_derived(() => get(alwaysShowCorrect) || get(showCorrectAnswer));
|
|
5384
|
+
const shouldShowCorrectAnswerToggle = /* @__PURE__ */ user_derived(() => get(isEvaluateMode) && !get(isResponseCorrect) && !!model()?.correctChoiceId && !get(alwaysShowCorrect));
|
|
5137
5385
|
const displayChoiceId = /* @__PURE__ */ user_derived(() => {
|
|
5138
|
-
if (get(
|
|
5386
|
+
if (get(canRevealCorrectAnswer) && get(shouldShowCorrectAnswer) && model()?.correctChoiceId) return model().correctChoiceId;
|
|
5139
5387
|
return get(selectedId);
|
|
5140
5388
|
});
|
|
5141
5389
|
const displayChoice = /* @__PURE__ */ user_derived(() => get(choices).find((c) => c.id === get(displayChoiceId)));
|
|
5142
5390
|
const legendText = /* @__PURE__ */ user_derived(() => {
|
|
5143
|
-
const plain = (
|
|
5391
|
+
const plain = (model()?.prompt || "").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
|
|
5144
5392
|
const maxChars = Math.max(8, Number(get(layoutLimits).legendMaxChars) || DEFAULT_LAYOUT_LIMITS.legendMaxChars);
|
|
5145
5393
|
return plain.length > maxChars ? `${plain.slice(0, Math.max(1, maxChars - 1))}…` : plain || get(uiText).answerChoices;
|
|
5146
5394
|
});
|
|
@@ -5148,26 +5396,53 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5148
5396
|
const transcriptId = /* @__PURE__ */ user_derived(() => `${instanceId}-transcript`);
|
|
5149
5397
|
const legendId = /* @__PURE__ */ user_derived(() => `${instanceId}-choices-legend`);
|
|
5150
5398
|
const resultId = /* @__PURE__ */ user_derived(() => `${instanceId}-result`);
|
|
5151
|
-
const choicesGroupLabelledBy = /* @__PURE__ */ user_derived(() =>
|
|
5399
|
+
const choicesGroupLabelledBy = /* @__PURE__ */ user_derived(() => model()?.prompt ? get(promptId) : void 0);
|
|
5400
|
+
const choicesGroupAriaLabel = /* @__PURE__ */ user_derived(() => {
|
|
5401
|
+
if (model()?.prompt) return void 0;
|
|
5402
|
+
const explicit = String(model()?.choiceGroupLabel || "").trim();
|
|
5403
|
+
if (explicit) return explicit;
|
|
5404
|
+
return get(legendText);
|
|
5405
|
+
});
|
|
5152
5406
|
const templateDescribedBy = /* @__PURE__ */ user_derived(() => {
|
|
5153
5407
|
const ids = [];
|
|
5154
|
-
if (
|
|
5155
|
-
if (
|
|
5408
|
+
if (model()?.prompt) ids.push(get(promptId));
|
|
5409
|
+
if (model()?.hasAudio && model()?.audioTranscript) ids.push(get(transcriptId));
|
|
5156
5410
|
return ids.length ? ids.join(" ") : void 0;
|
|
5157
5411
|
});
|
|
5158
5412
|
const lang = /* @__PURE__ */ user_derived(() => {
|
|
5159
|
-
const locale =
|
|
5413
|
+
const locale = model()?.locale || "";
|
|
5160
5414
|
return locale ? locale.slice(0, 2) : "en";
|
|
5161
5415
|
});
|
|
5162
5416
|
const audioErrorMessage = /* @__PURE__ */ user_derived(() => get(hasAudioButMissingResource) ? get(uiText).audioResourceUnavailable : "");
|
|
5163
5417
|
const resultText = /* @__PURE__ */ user_derived(() => {
|
|
5164
|
-
if (!get(isEvaluateMode) || get(
|
|
5418
|
+
if (!get(isEvaluateMode) || get(shouldShowCorrectAnswer)) return "";
|
|
5165
5419
|
if (get(isCorrect)) return "Correct answer selected";
|
|
5166
5420
|
if (get(isIncorrect) && get(selectedId)) return "Incorrect answer selected";
|
|
5167
5421
|
return "";
|
|
5168
5422
|
});
|
|
5423
|
+
const choiceCorrectnessById = /* @__PURE__ */ user_derived(() => {
|
|
5424
|
+
const map = /* @__PURE__ */ new Map();
|
|
5425
|
+
const correctChoiceId = String(model()?.correctChoiceId || "");
|
|
5426
|
+
const activeSelectedId = String(get(selectedId) || "");
|
|
5427
|
+
if (!get(isEvaluateMode) || !correctChoiceId) return map;
|
|
5428
|
+
if (get(shouldShowCorrectAnswer) && get(canRevealCorrectAnswer)) {
|
|
5429
|
+
map.set(correctChoiceId, "correct");
|
|
5430
|
+
return map;
|
|
5431
|
+
}
|
|
5432
|
+
if (!activeSelectedId) {
|
|
5433
|
+
map.set(correctChoiceId, "incorrect");
|
|
5434
|
+
return map;
|
|
5435
|
+
}
|
|
5436
|
+
if (activeSelectedId === correctChoiceId) {
|
|
5437
|
+
map.set(correctChoiceId, "correct");
|
|
5438
|
+
return map;
|
|
5439
|
+
}
|
|
5440
|
+
map.set(activeSelectedId, "incorrect");
|
|
5441
|
+
map.set(correctChoiceId, "incorrect");
|
|
5442
|
+
return map;
|
|
5443
|
+
});
|
|
5169
5444
|
function emitSession(updatedSession, sourceEl) {
|
|
5170
|
-
const host = sourceEl
|
|
5445
|
+
const host = getHostElement(sourceEl);
|
|
5171
5446
|
if (host?.onSessionChange) {
|
|
5172
5447
|
host.onSessionChange(updatedSession);
|
|
5173
5448
|
return;
|
|
@@ -5187,17 +5462,21 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5187
5462
|
const choiceId = input.value;
|
|
5188
5463
|
set(localChoiceId, choiceId, true);
|
|
5189
5464
|
emitSession({
|
|
5190
|
-
|
|
5191
|
-
id:
|
|
5465
|
+
...session(),
|
|
5466
|
+
id: session()?.id || model()?.id || "1",
|
|
5192
5467
|
element: "mc-populated-blank",
|
|
5193
5468
|
choiceId
|
|
5194
5469
|
}, input);
|
|
5195
5470
|
}
|
|
5196
5471
|
function toggleCorrectAnswer() {
|
|
5472
|
+
if (!get(shouldShowCorrectAnswerToggle)) return;
|
|
5197
5473
|
set(showCorrectAnswer, !get(showCorrectAnswer));
|
|
5198
5474
|
}
|
|
5475
|
+
user_effect(() => {
|
|
5476
|
+
if (!get(isEvaluateMode) || get(isResponseCorrect) || get(alwaysShowCorrect)) set(showCorrectAnswer, false);
|
|
5477
|
+
});
|
|
5199
5478
|
function onRadioGroupKeydown(e) {
|
|
5200
|
-
if (
|
|
5479
|
+
if (model()?.disabled) return;
|
|
5201
5480
|
const key = e.key;
|
|
5202
5481
|
if (![
|
|
5203
5482
|
"ArrowDown",
|
|
@@ -5223,24 +5502,33 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5223
5502
|
});
|
|
5224
5503
|
}
|
|
5225
5504
|
function onAudioPlaying(e) {
|
|
5226
|
-
const host = e.currentTarget
|
|
5505
|
+
const host = getHostElement(e.currentTarget);
|
|
5227
5506
|
set(isMediaPlaying, true);
|
|
5228
5507
|
host?.onAudioStarted?.();
|
|
5229
5508
|
set(autoPlayPromptOpen, false);
|
|
5230
5509
|
}
|
|
5231
5510
|
function onAudioEnded(e) {
|
|
5232
|
-
const host = e.currentTarget
|
|
5511
|
+
const host = getHostElement(e.currentTarget);
|
|
5233
5512
|
set(isMediaPlaying, false);
|
|
5234
5513
|
host?.onAudioEnded?.();
|
|
5235
5514
|
}
|
|
5515
|
+
function getHostElement(sourceEl) {
|
|
5516
|
+
let cursor = sourceEl;
|
|
5517
|
+
while (cursor) {
|
|
5518
|
+
const maybeHost = cursor;
|
|
5519
|
+
if (typeof maybeHost?.onSessionChange === "function" || typeof maybeHost?.onAudioStarted === "function" || typeof maybeHost?.onAudioEnded === "function") return maybeHost;
|
|
5520
|
+
cursor = cursor.parentElement;
|
|
5521
|
+
}
|
|
5522
|
+
return document.querySelector("mc-populated-blank") || null;
|
|
5523
|
+
}
|
|
5236
5524
|
function speechButtonLabel(locale = "") {
|
|
5237
5525
|
return locale.toLowerCase().startsWith("es") ? get(uiText).listenLabelEs : get(uiText).listenLabelEn;
|
|
5238
5526
|
}
|
|
5239
5527
|
const featureAudioSkin = /* @__PURE__ */ user_derived(() => {
|
|
5240
|
-
const locale = String(
|
|
5528
|
+
const locale = String(model()?.locale || "").toLowerCase();
|
|
5241
5529
|
const lang = locale.slice(0, 2);
|
|
5242
|
-
const byLocale =
|
|
5243
|
-
const customSingle =
|
|
5530
|
+
const byLocale = model()?.audioButtonSkinsByLocale && typeof model().audioButtonSkinsByLocale === "object" ? model().audioButtonSkinsByLocale : {};
|
|
5531
|
+
const customSingle = model()?.audioButtonSkin && typeof model().audioButtonSkin === "object" ? model().audioButtonSkin : null;
|
|
5244
5532
|
const defaultSkin = locale.startsWith("es") ? DEFAULT_AUDIO_BUTTON_SKINS.es : DEFAULT_AUDIO_BUTTON_SKINS.default;
|
|
5245
5533
|
return byLocale[locale] || byLocale[lang] || byLocale.default || customSingle || defaultSkin;
|
|
5246
5534
|
});
|
|
@@ -5248,188 +5536,279 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5248
5536
|
if (get(hasPlayableAudio) && get(audioEl)) get(audioEl).play().catch(() => {});
|
|
5249
5537
|
}
|
|
5250
5538
|
user_effect(() => {
|
|
5251
|
-
if (
|
|
5539
|
+
if (session()?.choiceId) set(localChoiceId, session().choiceId, true);
|
|
5540
|
+
});
|
|
5541
|
+
user_effect(() => {
|
|
5542
|
+
const el = get(audioEl);
|
|
5543
|
+
if (!el) return;
|
|
5544
|
+
const handlePlaying = (e) => onAudioPlaying(e);
|
|
5545
|
+
const handleEnded = (e) => onAudioEnded(e);
|
|
5546
|
+
el.addEventListener("playing", handlePlaying);
|
|
5547
|
+
el.addEventListener("ended", handleEnded);
|
|
5548
|
+
return () => {
|
|
5549
|
+
el.removeEventListener("playing", handlePlaying);
|
|
5550
|
+
el.removeEventListener("ended", handleEnded);
|
|
5551
|
+
};
|
|
5552
|
+
});
|
|
5553
|
+
user_effect(() => {
|
|
5554
|
+
const btn = get(featureAudioButtonEl);
|
|
5555
|
+
if (!btn) return;
|
|
5556
|
+
const handleClick = () => playFeatureAudio();
|
|
5557
|
+
btn.addEventListener("click", handleClick);
|
|
5558
|
+
return () => {
|
|
5559
|
+
btn.removeEventListener("click", handleClick);
|
|
5560
|
+
};
|
|
5561
|
+
});
|
|
5562
|
+
user_effect(() => {
|
|
5563
|
+
const btn = get(autoplayEnableButtonEl);
|
|
5564
|
+
if (!btn) return;
|
|
5565
|
+
const handleClick = () => handleEnableAutoplayClick();
|
|
5566
|
+
btn.addEventListener("click", handleClick);
|
|
5567
|
+
return () => {
|
|
5568
|
+
btn.removeEventListener("click", handleClick);
|
|
5569
|
+
};
|
|
5570
|
+
});
|
|
5571
|
+
user_effect(() => {
|
|
5572
|
+
const btn = get(toggleCorrectAnswerButtonEl);
|
|
5573
|
+
if (!btn) return;
|
|
5574
|
+
const handleClick = () => toggleCorrectAnswer();
|
|
5575
|
+
btn.addEventListener("click", handleClick);
|
|
5576
|
+
return () => {
|
|
5577
|
+
btn.removeEventListener("click", handleClick);
|
|
5578
|
+
};
|
|
5579
|
+
});
|
|
5580
|
+
user_effect(() => {
|
|
5581
|
+
const group = get(choicesGroupEl);
|
|
5582
|
+
if (!group) return;
|
|
5583
|
+
const handleChange = (e) => {
|
|
5584
|
+
const target = e.target;
|
|
5585
|
+
if (!target || target.type !== "radio") return;
|
|
5586
|
+
onRadioChange(e);
|
|
5587
|
+
};
|
|
5588
|
+
const handleKeydown = (e) => onRadioGroupKeydown(e);
|
|
5589
|
+
group.addEventListener("change", handleChange);
|
|
5590
|
+
group.addEventListener("keydown", handleKeydown);
|
|
5591
|
+
return () => {
|
|
5592
|
+
group.removeEventListener("change", handleChange);
|
|
5593
|
+
group.removeEventListener("keydown", handleKeydown);
|
|
5594
|
+
};
|
|
5252
5595
|
});
|
|
5253
5596
|
user_effect(() => {
|
|
5254
|
-
if (
|
|
5597
|
+
if (!model()?.hasAudio || !model()?.autoplayAudioEnabled) return;
|
|
5255
5598
|
if (get(autoplayAttempted)) return;
|
|
5256
5599
|
set(autoplayAttempted, true);
|
|
5257
|
-
if (get(audioEl) &&
|
|
5600
|
+
if (get(audioEl) && model()?.audioUrl) get(audioEl).play().catch(() => {
|
|
5258
5601
|
set(autoPlayPromptOpen, true);
|
|
5259
5602
|
});
|
|
5260
5603
|
});
|
|
5604
|
+
var $$exports = {
|
|
5605
|
+
get model() {
|
|
5606
|
+
return model();
|
|
5607
|
+
},
|
|
5608
|
+
set model($$value) {
|
|
5609
|
+
model($$value);
|
|
5610
|
+
flushSync();
|
|
5611
|
+
},
|
|
5612
|
+
get session() {
|
|
5613
|
+
return session();
|
|
5614
|
+
},
|
|
5615
|
+
set session($$value) {
|
|
5616
|
+
session($$value);
|
|
5617
|
+
flushSync();
|
|
5618
|
+
},
|
|
5619
|
+
get options() {
|
|
5620
|
+
return options();
|
|
5621
|
+
},
|
|
5622
|
+
set options($$value) {
|
|
5623
|
+
options($$value);
|
|
5624
|
+
flushSync();
|
|
5625
|
+
}
|
|
5626
|
+
};
|
|
5261
5627
|
var div = root();
|
|
5262
5628
|
var node = child(div);
|
|
5263
5629
|
var consequent = ($$anchor) => {
|
|
5264
5630
|
var div_1 = root_1();
|
|
5265
|
-
html(div_1, () =>
|
|
5631
|
+
html(div_1, () => model().prompt, true);
|
|
5266
5632
|
reset(div_1);
|
|
5267
5633
|
template_effect(() => set_attribute(div_1, "id", get(promptId)));
|
|
5268
5634
|
append($$anchor, div_1);
|
|
5269
5635
|
};
|
|
5270
5636
|
if_block(node, ($$render) => {
|
|
5271
|
-
if (
|
|
5637
|
+
if (model()?.prompt) $$render(consequent);
|
|
5272
5638
|
});
|
|
5273
5639
|
var node_1 = sibling(node, 2);
|
|
5274
|
-
var
|
|
5640
|
+
var consequent_2 = ($$anchor) => {
|
|
5275
5641
|
var div_2 = root_2();
|
|
5276
|
-
var
|
|
5642
|
+
var button = child(div_2);
|
|
5643
|
+
var span = child(button);
|
|
5644
|
+
var span_1 = child(span);
|
|
5645
|
+
var node_2 = child(span_1);
|
|
5277
5646
|
var consequent_1 = ($$anchor) => {
|
|
5278
|
-
|
|
5647
|
+
append($$anchor, root_3());
|
|
5648
|
+
};
|
|
5649
|
+
var alternate = ($$anchor) => {
|
|
5650
|
+
append($$anchor, root_4());
|
|
5651
|
+
};
|
|
5652
|
+
if_block(node_2, ($$render) => {
|
|
5653
|
+
if (get(shouldShowCorrectAnswer)) $$render(consequent_1);
|
|
5654
|
+
else $$render(alternate, -1);
|
|
5655
|
+
});
|
|
5656
|
+
reset(span_1);
|
|
5657
|
+
var span_2 = sibling(span_1, 2);
|
|
5658
|
+
var text = child(span_2, true);
|
|
5659
|
+
reset(span_2);
|
|
5660
|
+
reset(span);
|
|
5661
|
+
reset(button);
|
|
5662
|
+
bind_this(button, ($$value) => set(toggleCorrectAnswerButtonEl, $$value), () => get(toggleCorrectAnswerButtonEl));
|
|
5663
|
+
reset(div_2);
|
|
5664
|
+
template_effect(() => {
|
|
5665
|
+
set_attribute(button, "aria-pressed", get(shouldShowCorrectAnswer));
|
|
5666
|
+
set_text(text, get(shouldShowCorrectAnswer) ? get(uiText).hideCorrectAnswer : get(uiText).showCorrectAnswer);
|
|
5667
|
+
});
|
|
5668
|
+
append($$anchor, div_2);
|
|
5669
|
+
};
|
|
5670
|
+
if_block(node_1, ($$render) => {
|
|
5671
|
+
if (get(shouldShowCorrectAnswerToggle)) $$render(consequent_2);
|
|
5672
|
+
});
|
|
5673
|
+
var node_3 = sibling(node_1, 2);
|
|
5674
|
+
var consequent_8 = ($$anchor) => {
|
|
5675
|
+
var div_3 = root_5();
|
|
5676
|
+
var node_4 = child(div_3);
|
|
5677
|
+
var consequent_3 = ($$anchor) => {
|
|
5678
|
+
var fragment = root_6();
|
|
5279
5679
|
var audio = first_child(fragment);
|
|
5280
5680
|
bind_this(audio, ($$value) => set(audioEl, $$value), () => get(audioEl));
|
|
5281
|
-
var
|
|
5282
|
-
var img = child(
|
|
5681
|
+
var button_1 = sibling(audio, 2);
|
|
5682
|
+
var img = child(button_1);
|
|
5283
5683
|
var img_1 = sibling(img, 2);
|
|
5284
|
-
reset(
|
|
5684
|
+
reset(button_1);
|
|
5685
|
+
bind_this(button_1, ($$value) => set(featureAudioButtonEl, $$value), () => get(featureAudioButtonEl));
|
|
5285
5686
|
template_effect(($0) => {
|
|
5286
|
-
set_attribute(audio, "src",
|
|
5287
|
-
set_attribute(
|
|
5687
|
+
set_attribute(audio, "src", model().audioUrl);
|
|
5688
|
+
set_attribute(button_1, "aria-label", $0);
|
|
5288
5689
|
set_class(img, 1, `listen-feature-icon pie-listen-icon rli-feature-listen ${get(isMediaPlaying) ? "" : "listen-active"}`, "svelte-6wlbb4");
|
|
5289
5690
|
set_attribute(img, "src", get(featureAudioSkin).silentUrl);
|
|
5290
5691
|
set_class(img_1, 1, `listen-feature-icon pie-listen-icon rli-feature-listen ${get(isMediaPlaying) ? "listen-active" : ""}`, "svelte-6wlbb4");
|
|
5291
5692
|
set_attribute(img_1, "src", get(featureAudioSkin).playingUrl);
|
|
5292
|
-
}, [() => speechButtonLabel(
|
|
5293
|
-
event("playing", audio, onAudioPlaying);
|
|
5294
|
-
event("ended", audio, onAudioEnded);
|
|
5295
|
-
event("click", button, playFeatureAudio);
|
|
5693
|
+
}, [() => speechButtonLabel(model()?.locale)]);
|
|
5296
5694
|
append($$anchor, fragment);
|
|
5297
5695
|
};
|
|
5298
|
-
var
|
|
5299
|
-
var fragment_1 =
|
|
5696
|
+
var consequent_5 = ($$anchor) => {
|
|
5697
|
+
var fragment_1 = root_7();
|
|
5300
5698
|
var audio_1 = first_child(fragment_1);
|
|
5301
5699
|
bind_this(audio_1, ($$value) => set(audioEl, $$value), () => get(audioEl));
|
|
5302
|
-
var
|
|
5303
|
-
var
|
|
5304
|
-
var
|
|
5305
|
-
var
|
|
5306
|
-
reset(
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
append($$anchor,
|
|
5700
|
+
var node_5 = sibling(audio_1, 2);
|
|
5701
|
+
var consequent_4 = ($$anchor) => {
|
|
5702
|
+
var button_2 = root_8();
|
|
5703
|
+
var text_1 = child(button_2, true);
|
|
5704
|
+
reset(button_2);
|
|
5705
|
+
bind_this(button_2, ($$value) => set(autoplayEnableButtonEl, $$value), () => get(autoplayEnableButtonEl));
|
|
5706
|
+
template_effect(() => set_text(text_1, get(uiText).clickToEnableAutoplay));
|
|
5707
|
+
append($$anchor, button_2);
|
|
5310
5708
|
};
|
|
5311
|
-
if_block(
|
|
5312
|
-
if (get(autoPlayPromptOpen)) $$render(
|
|
5709
|
+
if_block(node_5, ($$render) => {
|
|
5710
|
+
if (get(autoPlayPromptOpen)) $$render(consequent_4);
|
|
5313
5711
|
});
|
|
5314
5712
|
template_effect(() => {
|
|
5315
|
-
set_attribute(audio_1, "src",
|
|
5316
|
-
set_attribute(audio_1, "aria-describedby",
|
|
5713
|
+
set_attribute(audio_1, "src", model().audioUrl);
|
|
5714
|
+
set_attribute(audio_1, "aria-describedby", model()?.audioTranscript ? get(transcriptId) : void 0);
|
|
5317
5715
|
});
|
|
5318
|
-
event("playing", audio_1, onAudioPlaying);
|
|
5319
|
-
event("ended", audio_1, onAudioEnded);
|
|
5320
5716
|
append($$anchor, fragment_1);
|
|
5321
5717
|
};
|
|
5322
|
-
var
|
|
5323
|
-
var p =
|
|
5324
|
-
var
|
|
5718
|
+
var consequent_6 = ($$anchor) => {
|
|
5719
|
+
var p = root_9();
|
|
5720
|
+
var text_2 = child(p, true);
|
|
5325
5721
|
reset(p);
|
|
5326
|
-
template_effect(() => set_text(
|
|
5722
|
+
template_effect(() => set_text(text_2, get(audioErrorMessage)));
|
|
5327
5723
|
append($$anchor, p);
|
|
5328
5724
|
};
|
|
5329
|
-
if_block(
|
|
5330
|
-
if (get(hasPlayableAudio) && get(useFeatureButtonAudio)) $$render(
|
|
5331
|
-
else if (get(hasPlayableAudio)) $$render(
|
|
5332
|
-
else if (get(hasAudioButMissingResource)) $$render(
|
|
5725
|
+
if_block(node_4, ($$render) => {
|
|
5726
|
+
if (get(hasPlayableAudio) && get(useFeatureButtonAudio)) $$render(consequent_3);
|
|
5727
|
+
else if (get(hasPlayableAudio)) $$render(consequent_5, 1);
|
|
5728
|
+
else if (get(hasAudioButMissingResource)) $$render(consequent_6, 2);
|
|
5333
5729
|
});
|
|
5334
|
-
var
|
|
5335
|
-
var
|
|
5336
|
-
var p_1 =
|
|
5730
|
+
var node_6 = sibling(node_4, 2);
|
|
5731
|
+
var consequent_7 = ($$anchor) => {
|
|
5732
|
+
var p_1 = root_10();
|
|
5337
5733
|
var strong = child(p_1);
|
|
5338
|
-
var
|
|
5734
|
+
var text_3 = child(strong);
|
|
5339
5735
|
reset(strong);
|
|
5340
|
-
var
|
|
5736
|
+
var text_4 = sibling(strong);
|
|
5341
5737
|
reset(p_1);
|
|
5342
5738
|
template_effect(() => {
|
|
5343
5739
|
set_class(p_1, 1, `text-sm mt-2 text-gray-700 pie-audio-transcript ${get(showVisibleTranscript) ? "" : "sr-only"}`, "svelte-6wlbb4");
|
|
5344
5740
|
set_attribute(p_1, "id", get(transcriptId));
|
|
5345
|
-
set_text(
|
|
5346
|
-
set_text(
|
|
5741
|
+
set_text(text_3, `${get(uiText).transcriptLabel ?? ""}:`);
|
|
5742
|
+
set_text(text_4, ` ${model().audioTranscript ?? ""}`);
|
|
5347
5743
|
});
|
|
5348
5744
|
append($$anchor, p_1);
|
|
5349
5745
|
};
|
|
5350
|
-
if_block(
|
|
5351
|
-
if (
|
|
5746
|
+
if_block(node_6, ($$render) => {
|
|
5747
|
+
if (model()?.audioTranscript) $$render(consequent_7);
|
|
5352
5748
|
});
|
|
5353
|
-
reset(div_2);
|
|
5354
|
-
append($$anchor, div_2);
|
|
5355
|
-
};
|
|
5356
|
-
if_block(node_1, ($$render) => {
|
|
5357
|
-
if ($$props?.model?.hasAudio) $$render(consequent_6);
|
|
5358
|
-
});
|
|
5359
|
-
var node_5 = sibling(node_1, 2);
|
|
5360
|
-
var consequent_7 = ($$anchor) => {
|
|
5361
|
-
var div_3 = root_8();
|
|
5362
|
-
html(div_3, () => $$props.model.sentenceHtml, true);
|
|
5363
5749
|
reset(div_3);
|
|
5364
|
-
template_effect(() => set_attribute(div_3, "aria-describedby", get(templateDescribedBy)));
|
|
5365
5750
|
append($$anchor, div_3);
|
|
5366
5751
|
};
|
|
5367
|
-
if_block(
|
|
5368
|
-
if (
|
|
5752
|
+
if_block(node_3, ($$render) => {
|
|
5753
|
+
if (model()?.hasAudio) $$render(consequent_8);
|
|
5369
5754
|
});
|
|
5370
|
-
var
|
|
5371
|
-
var
|
|
5372
|
-
var div_4 =
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5755
|
+
var node_7 = sibling(node_3, 2);
|
|
5756
|
+
var consequent_9 = ($$anchor) => {
|
|
5757
|
+
var div_4 = root_11();
|
|
5758
|
+
html(div_4, () => model().sentenceHtml, true);
|
|
5759
|
+
reset(div_4);
|
|
5760
|
+
template_effect(() => set_attribute(div_4, "aria-describedby", get(templateDescribedBy)));
|
|
5761
|
+
append($$anchor, div_4);
|
|
5762
|
+
};
|
|
5763
|
+
if_block(node_7, ($$render) => {
|
|
5764
|
+
if (model()?.sentenceHtml) $$render(consequent_9);
|
|
5765
|
+
});
|
|
5766
|
+
var node_8 = sibling(node_7, 2);
|
|
5767
|
+
var consequent_12 = ($$anchor) => {
|
|
5768
|
+
var div_5 = root_12();
|
|
5769
|
+
var node_9 = child(div_5);
|
|
5770
|
+
html(node_9, () => get(templateParts).before);
|
|
5771
|
+
var span_3 = sibling(node_9, 2);
|
|
5772
|
+
var node_10 = child(span_3);
|
|
5773
|
+
var consequent_10 = ($$anchor) => {
|
|
5774
|
+
var img_2 = root_13();
|
|
5379
5775
|
template_effect(() => {
|
|
5380
5776
|
set_attribute(img_2, "src", get(displayChoice).imageUrl);
|
|
5381
5777
|
set_attribute(img_2, "alt", get(displayChoice).imageAlt || "Selected answer image");
|
|
5382
5778
|
});
|
|
5383
5779
|
append($$anchor, img_2);
|
|
5384
5780
|
};
|
|
5385
|
-
var
|
|
5386
|
-
var
|
|
5387
|
-
html(
|
|
5388
|
-
reset(
|
|
5389
|
-
append($$anchor,
|
|
5781
|
+
var consequent_11 = ($$anchor) => {
|
|
5782
|
+
var span_4 = root_14();
|
|
5783
|
+
html(span_4, () => get(displayChoice).labelHtml, true);
|
|
5784
|
+
reset(span_4);
|
|
5785
|
+
append($$anchor, span_4);
|
|
5390
5786
|
};
|
|
5391
|
-
var
|
|
5392
|
-
append($$anchor,
|
|
5787
|
+
var alternate_1 = ($$anchor) => {
|
|
5788
|
+
append($$anchor, root_15());
|
|
5393
5789
|
};
|
|
5394
|
-
if_block(
|
|
5395
|
-
if (get(choiceMode) === "image" && get(displayChoice)?.imageUrl) $$render(
|
|
5396
|
-
else if (get(displayChoice)?.labelHtml) $$render(
|
|
5397
|
-
else $$render(
|
|
5398
|
-
});
|
|
5399
|
-
reset(span);
|
|
5400
|
-
html(sibling(span, 2), () => get(templateParts).after);
|
|
5401
|
-
reset(div_4);
|
|
5402
|
-
template_effect(() => {
|
|
5403
|
-
set_attribute(div_4, "aria-describedby", get(templateDescribedBy));
|
|
5404
|
-
set_class(span, 1, `inline-flex items-center min-h-[1.5em] px-2 mx-1 border-b-2 border-gray-500 align-baseline blank-slot pie-blank-slot ${get(isBlankOnlyTemplate) ? "blank-slot-standalone pie-blank-slot-standalone" : ""}`, "svelte-6wlbb4");
|
|
5405
|
-
set_style(span, `width:${get(blankWidth)};border-bottom-width:${get(blankBorderWidth)};`);
|
|
5406
|
-
set_attribute(span, "aria-label", get(uiText).selectedAnswerInSentence);
|
|
5790
|
+
if_block(node_10, ($$render) => {
|
|
5791
|
+
if (get(choiceMode) === "image" && get(displayChoice)?.imageUrl) $$render(consequent_10);
|
|
5792
|
+
else if (get(displayChoice)?.labelHtml) $$render(consequent_11, 1);
|
|
5793
|
+
else $$render(alternate_1, -1);
|
|
5407
5794
|
});
|
|
5408
|
-
append($$anchor, div_4);
|
|
5409
|
-
};
|
|
5410
|
-
if_block(node_6, ($$render) => {
|
|
5411
|
-
if (!get(isAudioOnlyMode)) $$render(consequent_10);
|
|
5412
|
-
});
|
|
5413
|
-
var node_10 = sibling(node_6, 2);
|
|
5414
|
-
var consequent_11 = ($$anchor) => {
|
|
5415
|
-
var button_2 = root_13();
|
|
5416
|
-
var span_3 = child(button_2);
|
|
5417
|
-
var text_4 = child(span_3, true);
|
|
5418
5795
|
reset(span_3);
|
|
5419
|
-
|
|
5796
|
+
html(sibling(span_3, 2), () => get(templateParts).after);
|
|
5797
|
+
reset(div_5);
|
|
5420
5798
|
template_effect(() => {
|
|
5421
|
-
set_attribute(
|
|
5422
|
-
|
|
5799
|
+
set_attribute(div_5, "aria-describedby", get(templateDescribedBy));
|
|
5800
|
+
set_class(span_3, 1, `inline-flex items-center min-h-[1.5em] px-2 mx-1 border-b-2 border-gray-500 align-baseline blank-slot pie-blank-slot ${get(isBlankOnlyTemplate) ? "blank-slot-standalone pie-blank-slot-standalone" : ""}`, "svelte-6wlbb4");
|
|
5801
|
+
set_style(span_3, `width:${get(blankWidth)};border-bottom-width:${get(blankBorderWidth)};`);
|
|
5802
|
+
set_attribute(span_3, "aria-label", get(uiText).selectedAnswerInSentence);
|
|
5423
5803
|
});
|
|
5424
|
-
|
|
5425
|
-
append($$anchor, button_2);
|
|
5804
|
+
append($$anchor, div_5);
|
|
5426
5805
|
};
|
|
5427
|
-
if_block(
|
|
5428
|
-
if (get(
|
|
5806
|
+
if_block(node_8, ($$render) => {
|
|
5807
|
+
if (!get(isAudioOnlyMode)) $$render(consequent_12);
|
|
5429
5808
|
});
|
|
5430
|
-
var
|
|
5431
|
-
var
|
|
5432
|
-
var p_2 =
|
|
5809
|
+
var node_12 = sibling(node_8, 2);
|
|
5810
|
+
var consequent_13 = ($$anchor) => {
|
|
5811
|
+
var p_2 = root_16();
|
|
5433
5812
|
var text_5 = child(p_2, true);
|
|
5434
5813
|
reset(p_2);
|
|
5435
5814
|
template_effect(() => {
|
|
@@ -5438,41 +5817,42 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5438
5817
|
});
|
|
5439
5818
|
append($$anchor, p_2);
|
|
5440
5819
|
};
|
|
5441
|
-
if_block(
|
|
5442
|
-
if (get(resultText)) $$render(
|
|
5820
|
+
if_block(node_12, ($$render) => {
|
|
5821
|
+
if (get(resultText)) $$render(consequent_13);
|
|
5443
5822
|
});
|
|
5444
|
-
var fieldset = sibling(
|
|
5823
|
+
var fieldset = sibling(node_12, 2);
|
|
5445
5824
|
var legend = child(fieldset);
|
|
5446
5825
|
var text_6 = child(legend, true);
|
|
5447
5826
|
reset(legend);
|
|
5448
|
-
var
|
|
5449
|
-
each(
|
|
5450
|
-
|
|
5451
|
-
var
|
|
5452
|
-
var
|
|
5453
|
-
|
|
5454
|
-
var
|
|
5455
|
-
var
|
|
5456
|
-
var
|
|
5457
|
-
|
|
5827
|
+
var div_6 = sibling(legend, 2);
|
|
5828
|
+
each(div_6, 21, () => get(choices), (c) => c.id, ($$anchor, c) => {
|
|
5829
|
+
const choiceCorrectness = /* @__PURE__ */ user_derived(() => get(choiceCorrectnessById).get(get(c).id));
|
|
5830
|
+
var div_7 = root_17();
|
|
5831
|
+
var node_13 = child(div_7);
|
|
5832
|
+
var consequent_15 = ($$anchor) => {
|
|
5833
|
+
var label = root_18();
|
|
5834
|
+
var span_6 = child(label);
|
|
5835
|
+
var node_14 = child(span_6);
|
|
5836
|
+
var consequent_14 = ($$anchor) => {
|
|
5837
|
+
var img_3 = root_19();
|
|
5458
5838
|
template_effect(() => {
|
|
5459
5839
|
set_attribute(img_3, "src", get(c).imageUrl);
|
|
5460
5840
|
set_attribute(img_3, "alt", get(c).imageAlt || `Choice ${get(c).id}`);
|
|
5461
5841
|
});
|
|
5462
5842
|
append($$anchor, img_3);
|
|
5463
5843
|
};
|
|
5464
|
-
var
|
|
5465
|
-
var
|
|
5466
|
-
html(
|
|
5467
|
-
reset(
|
|
5468
|
-
append($$anchor,
|
|
5844
|
+
var alternate_2 = ($$anchor) => {
|
|
5845
|
+
var span_7 = root_20();
|
|
5846
|
+
html(span_7, () => get(c).labelHtml || "", true);
|
|
5847
|
+
reset(span_7);
|
|
5848
|
+
append($$anchor, span_7);
|
|
5469
5849
|
};
|
|
5470
|
-
if_block(
|
|
5471
|
-
if (get(choiceMode) === "image" && get(c).imageUrl) $$render(
|
|
5472
|
-
else $$render(
|
|
5850
|
+
if_block(node_14, ($$render) => {
|
|
5851
|
+
if (get(choiceMode) === "image" && get(c).imageUrl) $$render(consequent_14);
|
|
5852
|
+
else $$render(alternate_2, -1);
|
|
5473
5853
|
});
|
|
5474
|
-
reset(
|
|
5475
|
-
var input_1 = sibling(
|
|
5854
|
+
reset(span_6);
|
|
5855
|
+
var input_1 = sibling(span_6, 2);
|
|
5476
5856
|
remove_input_defaults(input_1);
|
|
5477
5857
|
reset(label);
|
|
5478
5858
|
template_effect(() => {
|
|
@@ -5480,94 +5860,88 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5480
5860
|
set_attribute(input_1, "name", get(radioGroupName));
|
|
5481
5861
|
set_attribute(input_1, "id", `${instanceId}-opt-${get(c).id}`);
|
|
5482
5862
|
set_value(input_1, get(c).id);
|
|
5483
|
-
set_checked(input_1, (get(
|
|
5484
|
-
input_1.disabled =
|
|
5863
|
+
set_checked(input_1, (get(shouldShowCorrectAnswer) && get(canRevealCorrectAnswer) ? model()?.correctChoiceId : get(selectedId)) === get(c).id);
|
|
5864
|
+
input_1.disabled = model()?.disabled;
|
|
5485
5865
|
});
|
|
5486
|
-
event("change", input_1, onRadioChange);
|
|
5487
5866
|
append($$anchor, label);
|
|
5488
5867
|
};
|
|
5489
|
-
var
|
|
5490
|
-
var fragment_2 =
|
|
5868
|
+
var alternate_4 = ($$anchor) => {
|
|
5869
|
+
var fragment_2 = root_21();
|
|
5491
5870
|
var input_2 = first_child(fragment_2);
|
|
5492
5871
|
remove_input_defaults(input_2);
|
|
5493
5872
|
var label_1 = sibling(input_2, 2);
|
|
5494
|
-
var
|
|
5495
|
-
var
|
|
5496
|
-
var img_4 =
|
|
5873
|
+
var node_15 = child(label_1);
|
|
5874
|
+
var consequent_16 = ($$anchor) => {
|
|
5875
|
+
var img_4 = root_22();
|
|
5497
5876
|
template_effect(() => {
|
|
5498
5877
|
set_attribute(img_4, "src", get(c).imageUrl);
|
|
5499
5878
|
set_attribute(img_4, "alt", get(c).imageAlt || `Choice ${get(c).id}`);
|
|
5500
5879
|
});
|
|
5501
5880
|
append($$anchor, img_4);
|
|
5502
5881
|
};
|
|
5503
|
-
var
|
|
5504
|
-
var
|
|
5505
|
-
html(
|
|
5506
|
-
reset(
|
|
5507
|
-
append($$anchor,
|
|
5882
|
+
var alternate_3 = ($$anchor) => {
|
|
5883
|
+
var span_8 = root_23();
|
|
5884
|
+
html(span_8, () => get(c).labelHtml || "", true);
|
|
5885
|
+
reset(span_8);
|
|
5886
|
+
append($$anchor, span_8);
|
|
5508
5887
|
};
|
|
5509
|
-
if_block(
|
|
5510
|
-
if (get(choiceMode) === "image" && get(c).imageUrl) $$render(
|
|
5511
|
-
else $$render(
|
|
5888
|
+
if_block(node_15, ($$render) => {
|
|
5889
|
+
if (get(choiceMode) === "image" && get(c).imageUrl) $$render(consequent_16);
|
|
5890
|
+
else $$render(alternate_3, -1);
|
|
5512
5891
|
});
|
|
5513
5892
|
reset(label_1);
|
|
5514
5893
|
template_effect(() => {
|
|
5515
5894
|
set_attribute(input_2, "name", get(radioGroupName));
|
|
5516
5895
|
set_attribute(input_2, "id", `${instanceId}-opt-${get(c).id}`);
|
|
5517
5896
|
set_value(input_2, get(c).id);
|
|
5518
|
-
set_checked(input_2, (get(
|
|
5519
|
-
input_2.disabled =
|
|
5897
|
+
set_checked(input_2, (get(shouldShowCorrectAnswer) && get(canRevealCorrectAnswer) ? model()?.correctChoiceId : get(selectedId)) === get(c).id);
|
|
5898
|
+
input_2.disabled = model()?.disabled;
|
|
5520
5899
|
set_attribute(label_1, "for", `${instanceId}-opt-${get(c).id}`);
|
|
5521
5900
|
});
|
|
5522
|
-
event("change", input_2, onRadioChange);
|
|
5523
5901
|
append($$anchor, fragment_2);
|
|
5524
5902
|
};
|
|
5525
|
-
if_block(
|
|
5526
|
-
if (get(isHorizontalChoices)) $$render(
|
|
5527
|
-
else $$render(
|
|
5903
|
+
if_block(node_13, ($$render) => {
|
|
5904
|
+
if (get(isHorizontalChoices)) $$render(consequent_15);
|
|
5905
|
+
else $$render(alternate_4, -1);
|
|
5528
5906
|
});
|
|
5529
|
-
var
|
|
5530
|
-
var
|
|
5531
|
-
var
|
|
5532
|
-
var
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
append($$anchor, root_24());
|
|
5538
|
-
};
|
|
5539
|
-
if_block(node_16, ($$render) => {
|
|
5540
|
-
if (get(selectedId) === get(c).id && get(isCorrect)) $$render(consequent_16);
|
|
5541
|
-
else if (get(selectedId) === get(c).id && get(isIncorrect)) $$render(consequent_17, 1);
|
|
5907
|
+
var node_16 = sibling(node_13, 2);
|
|
5908
|
+
var consequent_17 = ($$anchor) => {
|
|
5909
|
+
var span_9 = root_24();
|
|
5910
|
+
var text_7 = child(span_9, true);
|
|
5911
|
+
reset(span_9);
|
|
5912
|
+
template_effect(() => {
|
|
5913
|
+
set_class(span_9, 1, `pie-choice-feedback-badge ${get(choiceCorrectness) === "correct" ? "pie-choice-feedback-correct" : "pie-choice-feedback-incorrect"}`, "svelte-6wlbb4");
|
|
5914
|
+
set_text(text_7, get(choiceCorrectness) === "correct" ? "✓" : "✕");
|
|
5542
5915
|
});
|
|
5543
|
-
append($$anchor,
|
|
5916
|
+
append($$anchor, span_9);
|
|
5544
5917
|
};
|
|
5545
|
-
if_block(
|
|
5546
|
-
if (get(isEvaluateMode) &&
|
|
5918
|
+
if_block(node_16, ($$render) => {
|
|
5919
|
+
if (get(isEvaluateMode) && get(choiceCorrectness)) $$render(consequent_17);
|
|
5547
5920
|
});
|
|
5548
|
-
reset(
|
|
5549
|
-
template_effect(() => set_class(
|
|
5550
|
-
append($$anchor,
|
|
5921
|
+
reset(div_7);
|
|
5922
|
+
template_effect(() => set_class(div_7, 1, `flex items-start choice-row pie-choice ${get(isHorizontalChoices) ? "choice-row-horizontal pie-choice-horizontal" : ""} ${(get(shouldShowCorrectAnswer) && get(canRevealCorrectAnswer) ? model()?.correctChoiceId : get(selectedId)) === get(c).id ? "is-selected pie-choice-selected" : ""} ${get(choiceCorrectness) ? `choice-${get(choiceCorrectness)} pie-choice-${get(choiceCorrectness)}` : ""}`, "svelte-6wlbb4"));
|
|
5923
|
+
append($$anchor, div_7);
|
|
5551
5924
|
});
|
|
5552
|
-
reset(
|
|
5925
|
+
reset(div_6);
|
|
5926
|
+
bind_this(div_6, ($$value) => set(choicesGroupEl, $$value), () => get(choicesGroupEl));
|
|
5553
5927
|
reset(fieldset);
|
|
5554
5928
|
reset(div);
|
|
5555
5929
|
template_effect(() => {
|
|
5556
5930
|
set_class(div, 1, `p-4 mc-populated-blank-root pie-element pie-element-mc-populated-blank pie-delivery-root layout-${get(layoutProfile)} ${get(hasInlineSentenceAudioLayout) ? "has-inline-audio" : ""}`, "svelte-6wlbb4");
|
|
5557
5931
|
set_attribute(div, "lang", get(lang));
|
|
5558
5932
|
set_style(div, get(rootStyle));
|
|
5559
|
-
fieldset.disabled =
|
|
5933
|
+
fieldset.disabled = model()?.disabled;
|
|
5560
5934
|
set_attribute(legend, "id", get(legendId));
|
|
5561
5935
|
set_text(text_6, get(legendText));
|
|
5562
|
-
set_class(
|
|
5563
|
-
set_attribute(
|
|
5564
|
-
set_attribute(
|
|
5936
|
+
set_class(div_6, 1, `pie-choices ${get(isHorizontalChoices) ? "flex flex-row flex-wrap items-start justify-center" : "flex flex-col"}`, "svelte-6wlbb4");
|
|
5937
|
+
set_attribute(div_6, "aria-labelledby", get(choicesGroupLabelledBy));
|
|
5938
|
+
set_attribute(div_6, "aria-label", get(choicesGroupAriaLabel));
|
|
5939
|
+
set_attribute(div_6, "aria-describedby", get(resultText) ? get(resultId) : void 0);
|
|
5565
5940
|
});
|
|
5566
|
-
event("keydown", div_5, onRadioGroupKeydown);
|
|
5567
5941
|
append($$anchor, div);
|
|
5568
|
-
pop();
|
|
5942
|
+
return pop($$exports);
|
|
5569
5943
|
}
|
|
5570
|
-
customElements.define("mc-populated-blank
|
|
5944
|
+
customElements.define("mc-populated-blank", create_custom_element(McPopulatedBlank, {
|
|
5571
5945
|
model: { type: "Object" },
|
|
5572
5946
|
session: { type: "Object" },
|
|
5573
5947
|
options: { type: "Object" }
|