eat-js-sdk 2.3.7 → 2.3.9

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.
@@ -5444,6 +5444,7 @@ function CommonStringToHtml($$anchor, $$props) {
5444
5444
  let processedHtml = /* @__PURE__ */ user_derived(() => processHtmlString(htmlString(), htmlHeading()));
5445
5445
  let containerEl = /* @__PURE__ */ state(void 0);
5446
5446
  user_effect(() => {
5447
+ get$1(processedHtml);
5447
5448
  if (get$1(hasMath) && get$1(containerEl)) {
5448
5449
  typesetMathJax(get$1(containerEl));
5449
5450
  }
@@ -5834,7 +5835,7 @@ function ResultIcon($$anchor, $$props) {
5834
5835
  return pop($$exports);
5835
5836
  }
5836
5837
  create_custom_element(ResultIcon, { isCorrect: {}, iconType: {}, parentProps: {} }, [], [], true);
5837
- var root_3$e = /* @__PURE__ */ from_html(`<span class="sr-only">Alert. &nbsp;</span>`);
5838
+ var root_3$d = /* @__PURE__ */ from_html(`<span class="sr-only">Alert. &nbsp;</span>`);
5838
5839
  var root_1$m = /* @__PURE__ */ from_html(`<div data-testid="feedback-alt"><!> <div><!> <span><!></span></div></div>`);
5839
5840
  function FeedbackAlert($$anchor, $$props) {
5840
5841
  push($$props, true);
@@ -5927,7 +5928,7 @@ function FeedbackAlert($$anchor, $$props) {
5927
5928
  var node_2 = child(div_1);
5928
5929
  {
5929
5930
  var consequent_1 = ($$anchor3) => {
5930
- var span = root_3$e();
5931
+ var span = root_3$d();
5931
5932
  append($$anchor3, span);
5932
5933
  };
5933
5934
  if_block(node_2, ($$render) => {
@@ -6959,9 +6960,9 @@ function useImageModalSize() {
6959
6960
  calculateStimulusImageLayout
6960
6961
  };
6961
6962
  }
6962
- var root_3$d = /* @__PURE__ */ from_html(`<span class="w-6 h-6 flex items-center justify-center"><!></span>`);
6963
+ var root_3$c = /* @__PURE__ */ from_html(`<span class="w-6 h-6 flex items-center justify-center"><!></span>`);
6963
6964
  var root_4$7 = /* @__PURE__ */ from_html(`<span class="w-6 h-6 flex items-center justify-center"><!></span>`);
6964
- var root_5$8 = /* @__PURE__ */ from_html(`<div><span aria-hidden="true"><!></span></div>`);
6965
+ var root_5$9 = /* @__PURE__ */ from_html(`<div><span aria-hidden="true"><!></span></div>`);
6965
6966
  var root_8$6 = /* @__PURE__ */ from_html(`<span class="w-4 h-4 flex items-center justify-center"><!></span>`);
6966
6967
  var root_9$4 = /* @__PURE__ */ from_html(`<span class="w-4 h-4 flex items-center justify-center"><!></span>`);
6967
6968
  var root_2$d = /* @__PURE__ */ from_html(`<div class="absolute inset-0 m-0"><div class="w-full h-full px-0 md:px-[82px] lg:px-[128px] pt-14 pb-[72px] relative lg:py-24 flex flex-col items-center justify-center"><div aria-live="polite" aria-atomic="true" class="sr-only"> </div> <div class="w-full h-full flex flex-col md:flex-row md:justify-center items-center justify-between"><div class="md:hidden"></div> <!> <!> <div><div class="flex-shrink-0 flex items-center justify-between py-1 px-2 md:px-4 border-border-minimal border rounded-t-md lg:rounded-t-lg md:gap-4 h-8.5 md:h-fit"><!> <!> <!></div> <div class="rounded-b-md"><img class="mx-auto block rounded-b-md lg:rounded-b-lg object-contain max-w-full max-h-[calc(100vh-168px-34px)] md:max-h-[calc(100vh-128px-54px)] lg:max-h-[calc(100vh-192px-54px)] pointer-events-none"/></div></div> <div class="md:hidden flex justify-center items-center gap-1 flex-shrink-0 h-6 mt-4"><!> <!></div></div></div></div>`);
@@ -7189,7 +7190,7 @@ function MCQImageModal($$anchor, $$props) {
7189
7190
  dataTestId: "img-viewer-prev",
7190
7191
  onclick: navigatePrevious,
7191
7192
  children: ($$anchor4, $$slotProps2) => {
7192
- var span = root_3$d();
7193
+ var span = root_3$c();
7193
7194
  var node_2 = child(span);
7194
7195
  SvgLoader(node_2, {
7195
7196
  svgName: "smallChevronLeft",
@@ -7245,7 +7246,7 @@ function MCQImageModal($$anchor, $$props) {
7245
7246
  return get$1(fullAnswerText);
7246
7247
  },
7247
7248
  children: ($$anchor4, $$slotProps2) => {
7248
- var div_6 = root_5$8();
7249
+ var div_6 = root_5$9();
7249
7250
  var span_2 = child(div_6);
7250
7251
  var node_6 = child(span_2);
7251
7252
  {
@@ -7558,7 +7559,7 @@ function InteractionSection($$anchor, $$props) {
7558
7559
  return pop($$exports);
7559
7560
  }
7560
7561
  create_custom_element(InteractionSection, { children: {} }, [], [], true);
7561
- var root_5$7 = /* @__PURE__ */ from_html(`<div></div>`);
7562
+ var root_5$8 = /* @__PURE__ */ from_html(`<div></div>`);
7562
7563
  var root_4$6 = /* @__PURE__ */ from_html(`<div class="px-4 w-full max-w-[1008px] mx-auto flex-shrink-0 text-center font-semibold text-sm md:text-lg leading-[150%] text-white" aria-hidden="true" data-testid="img-viewer-cap-txt"> </div> <!>`, 1);
7563
7564
  var root_7$5 = /* @__PURE__ */ from_html(`<div></div>`);
7564
7565
  var root_2$c = /* @__PURE__ */ from_html(`<div class="absolute inset-0"><div class="w-full h-full flex items-center justify-center pt-14 pb-[72px] lg:py-24"><div aria-live="polite" aria-atomic="true" class="sr-only"> </div> <div class="flex flex-col items-center overflow-y-auto overflow-x-hidden w-full px-0 md:px-6 lg:px-16"><div class="relative bg-white rounded-md md:rounded-lg shadow-sm overflow-hidden flex-shrink-0"><img class="block object-contain w-full h-auto max-w-full mx-auto"/> <!></div> <!></div></div></div>`);
@@ -7732,7 +7733,7 @@ function PromptStimulusImageModal($$anchor, $$props) {
7732
7733
  var node_3 = sibling(div_5, 2);
7733
7734
  {
7734
7735
  var consequent = ($$anchor5) => {
7735
- var div_6 = root_5$7();
7736
+ var div_6 = root_5$8();
7736
7737
  template_effect(() => set_style(div_6, `height:${get$1(bottomSpacerHeight) ?? ""}px`));
7737
7738
  append($$anchor5, div_6);
7738
7739
  };
@@ -8215,7 +8216,7 @@ const shouldRenderSection = (section) => section.condition !== false;
8215
8216
  const getClassString = (classes = []) => classes.join(" ");
8216
8217
  const getStyleString = (styles = {}) => Object.entries(styles).map(([k, v]) => `${k}:${v}`).join(";");
8217
8218
  var root_4$5 = /* @__PURE__ */ from_html(`<p class="text-lg leading-[22px] text-blue-1000 font-semibold mt-4" data-testid="img-cap-txt"> </p>`);
8218
- var root_5$6 = /* @__PURE__ */ from_html(`<div class="mt-6 w-full"><button class="flex items-center font-semibold leading-[1.5] outline-none group w-fit h-11 text-charcoal" aria-controls="long-description-content" aria-labelledby="image-description-label" type="button"><div class="w-6 h-6 flex items-center justify-center mr-2" data-testid="img-desc-txt"><!></div> <div id="image-description-label" class="image-description-accordion group-[.active]:border-b-2">Image Description</div></button> <div id="long-description-content" data-testid="img-desc-txt"><!></div></div>`);
8219
+ var root_5$7 = /* @__PURE__ */ from_html(`<div class="mt-6 w-full"><button class="flex items-center font-semibold leading-[1.5] outline-none group w-fit h-11 text-charcoal" aria-controls="long-description-content" aria-labelledby="image-description-label" type="button"><div class="w-6 h-6 flex items-center justify-center mr-2" data-testid="img-desc-txt"><!></div> <div id="image-description-label" class="image-description-accordion group-[.active]:border-b-2">Image Description</div></button> <div id="long-description-content" data-testid="img-desc-txt"><!></div></div>`);
8219
8220
  var root_2$b = /* @__PURE__ */ from_html(`<div class="flex flex-col justify-center items-center text-center"><div class="flex flex-col items-center"><div class="relative inline-block"><img/> <!></div> <!></div></div> <!>`, 1);
8220
8221
  var root_1$j = /* @__PURE__ */ from_html(`<div class="w-full"><!></div>`);
8221
8222
  function CommonMedia($$anchor, $$props) {
@@ -8348,7 +8349,7 @@ function CommonMedia($$anchor, $$props) {
8348
8349
  var node_4 = sibling(div_1, 2);
8349
8350
  {
8350
8351
  var consequent_1 = ($$anchor4) => {
8351
- var div_4 = root_5$6();
8352
+ var div_4 = root_5$7();
8352
8353
  var button = child(div_4);
8353
8354
  button.__click = toggleLongDescription;
8354
8355
  button.__keydown = handleKeyDown;
@@ -8437,11 +8438,11 @@ create_custom_element(
8437
8438
  true
8438
8439
  );
8439
8440
  var root_4$4 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-txt-ctr"><!></div>`);
8440
- var root_5$5 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-img-ctr"><!></div>`);
8441
- var root_3$c = /* @__PURE__ */ from_html(`<!> <!>`, 1);
8441
+ var root_5$6 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-img-ctr"><!></div>`);
8442
+ var root_3$b = /* @__PURE__ */ from_html(`<!> <!>`, 1);
8442
8443
  var root_7$4 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-img-ctr"><!></div>`);
8443
8444
  var root_8$5 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-txt-ctr"><!></div>`);
8444
- var root_6$2 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
8445
+ var root_6$3 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
8445
8446
  var root_1$i = /* @__PURE__ */ from_html(`<div class="stimulus-section flex flex-col w-full"><!> <div><!></div></div>`);
8446
8447
  function StimulusSection($$anchor, $$props) {
8447
8448
  push($$props, true);
@@ -8530,7 +8531,7 @@ function StimulusSection($$anchor, $$props) {
8530
8531
  var node_2 = child(div_1);
8531
8532
  {
8532
8533
  var consequent_3 = ($$anchor3) => {
8533
- var fragment_2 = root_3$c();
8534
+ var fragment_2 = root_3$b();
8534
8535
  var node_3 = first_child(fragment_2);
8535
8536
  {
8536
8537
  var consequent_1 = ($$anchor4) => {
@@ -8555,7 +8556,7 @@ function StimulusSection($$anchor, $$props) {
8555
8556
  var node_5 = sibling(node_3, 2);
8556
8557
  {
8557
8558
  var consequent_2 = ($$anchor4) => {
8558
- var div_3 = root_5$5();
8559
+ var div_3 = root_5$6();
8559
8560
  let classes_2;
8560
8561
  var node_6 = child(div_3);
8561
8562
  CommonMedia(node_6, {
@@ -8590,7 +8591,7 @@ function StimulusSection($$anchor, $$props) {
8590
8591
  append($$anchor3, fragment_2);
8591
8592
  };
8592
8593
  var alternate = ($$anchor3) => {
8593
- var fragment_3 = root_6$2();
8594
+ var fragment_3 = root_6$3();
8594
8595
  var node_7 = first_child(fragment_3);
8595
8596
  {
8596
8597
  var consequent_4 = ($$anchor4) => {
@@ -8679,7 +8680,7 @@ create_custom_element(
8679
8680
  true
8680
8681
  );
8681
8682
  var root_8$4 = /* @__PURE__ */ from_html(`<div class="divider my-6"></div>`);
8682
- var root_13$1 = /* @__PURE__ */ from_html(`<div class="divider my-6"></div>`);
8683
+ var root_13$2 = /* @__PURE__ */ from_html(`<div class="divider my-6"></div>`);
8683
8684
  var root_15$1 = /* @__PURE__ */ from_html(`<div aria-live="polite"><!></div>`);
8684
8685
  var root_1$h = /* @__PURE__ */ from_html(`<div><!></div>`);
8685
8686
  var root_16$2 = /* @__PURE__ */ from_html(`<div><!></div>`);
@@ -8880,7 +8881,7 @@ function PromptContainer($$anchor, $$props) {
8880
8881
  var node_6 = first_child(fragment_10);
8881
8882
  {
8882
8883
  var consequent_5 = ($$anchor8) => {
8883
- var div_5 = root_13$1();
8884
+ var div_5 = root_13$2();
8884
8885
  append($$anchor8, div_5);
8885
8886
  };
8886
8887
  var alternate = ($$anchor8) => {
@@ -9068,9 +9069,9 @@ create_custom_element(
9068
9069
  );
9069
9070
  var root_1$g = /* @__PURE__ */ from_html(`<span> </span>`);
9070
9071
  var root_2$a = /* @__PURE__ */ from_html(`<span>Missing answer</span>`);
9071
- var root_3$b = /* @__PURE__ */ from_html(`<p>Missing answer</p>`);
9072
+ var root_3$a = /* @__PURE__ */ from_html(`<p>Missing answer</p>`);
9072
9073
  var root_4$3 = /* @__PURE__ */ from_html(`<p class="text-red-400 text-sm font-semibold leading-[1.3] pr-2.5 hidden md:block"> </p>`);
9073
- var root_5$4 = /* @__PURE__ */ from_html(`<span aria-hidden="true"><!></span>`);
9074
+ var root_5$5 = /* @__PURE__ */ from_html(`<span aria-hidden="true"><!></span>`);
9074
9075
  var root_9$3 = /* @__PURE__ */ from_html(`<span class="w-3 h-2 flex items-center justify-center"><!></span>`);
9075
9076
  var root_8$3 = /* @__PURE__ */ from_html(`<span><!></span>`);
9076
9077
  var root_10$3 = /* @__PURE__ */ from_html(`<div class="w-full overflow-hidden bg-white rounded-b-lg flex items-center justify-center relative"><img class="mcq-opt-img min-h-[154px] max-h-[184px] w-auto max-w-full object-contain pointer-events-none" data-testid="mcq-opt-img" loading="lazy"/></div>`);
@@ -9214,7 +9215,7 @@ function MCQOption($$anchor, $$props) {
9214
9215
  var node_3 = child(span_7);
9215
9216
  {
9216
9217
  var consequent_2 = ($$anchor2) => {
9217
- var p = root_3$b();
9218
+ var p = root_3$a();
9218
9219
  template_effect(() => set_class(p, 1, `text-green-750 text-sm font-semibold leading-[1.3] hidden md:block
9219
9220
  ${get$1(totalCorrectAnswers) > 1 ? "pr-2.5" : ""}`));
9220
9221
  append($$anchor2, p);
@@ -9239,7 +9240,7 @@ function MCQOption($$anchor, $$props) {
9239
9240
  var node_5 = sibling(node_4, 2);
9240
9241
  {
9241
9242
  var consequent_5 = ($$anchor2) => {
9242
- var span_8 = root_5$4();
9243
+ var span_8 = root_5$5();
9243
9244
  var node_6 = child(span_8);
9244
9245
  {
9245
9246
  var consequent_4 = ($$anchor3) => {
@@ -9504,7 +9505,7 @@ create_custom_element(
9504
9505
  [],
9505
9506
  true
9506
9507
  );
9507
- var root_3$a = /* @__PURE__ */ from_html(`<div aria-live="polite" class="mb-6"><!></div>`);
9508
+ var root_3$9 = /* @__PURE__ */ from_html(`<div aria-live="polite" class="mb-6"><!></div>`);
9508
9509
  var root$d = /* @__PURE__ */ from_html(`<!> <!>`, 1);
9509
9510
  function MCQComponent($$anchor, $$props) {
9510
9511
  push($$props, true);
@@ -9642,7 +9643,7 @@ function MCQComponent($$anchor, $$props) {
9642
9643
  var node_1 = first_child(fragment_2);
9643
9644
  {
9644
9645
  var consequent = ($$anchor3) => {
9645
- var div = root_3$a();
9646
+ var div = root_3$9();
9646
9647
  var node_2 = child(div);
9647
9648
  MCQFeedback(node_2, {
9648
9649
  get feedbackState() {
@@ -10280,9 +10281,9 @@ create_custom_element(
10280
10281
  true
10281
10282
  );
10282
10283
  var root_1$d = /* @__PURE__ */ from_html(`<p class="p2 text-red-400 mb-3">Student's answer</p>`);
10283
- var root_3$9 = /* @__PURE__ */ from_html(`<span class="w-8 h-8 absolute right-2 top-2.5 flex items-center justify-center" aria-hidden="true"><!></span>`);
10284
+ var root_3$8 = /* @__PURE__ */ from_html(`<span class="w-8 h-8 absolute right-2 top-2.5 flex items-center justify-center" aria-hidden="true"><!></span>`);
10284
10285
  var root_2$7 = /* @__PURE__ */ from_html(`<div class="relative"><textarea autocomplete="off" rows="3"></textarea> <!></div>`);
10285
- var root_5$3 = /* @__PURE__ */ from_html(`<span class="w-8 h-8 absolute right-2 top-2.5 flex items-center justify-center" aria-hidden="true"><!></span>`);
10286
+ var root_5$4 = /* @__PURE__ */ from_html(`<span class="w-8 h-8 absolute right-2 top-2.5 flex items-center justify-center" aria-hidden="true"><!></span>`);
10286
10287
  var root_4$1 = /* @__PURE__ */ from_html(`<div class="relative"><input autocomplete="off"/> <!></div>`);
10287
10288
  var root$b = /* @__PURE__ */ from_html(`<div class="relative"><!> <!></div>`);
10288
10289
  function TypeInTextField($$anchor, $$props) {
@@ -10435,7 +10436,7 @@ function TypeInTextField($$anchor, $$props) {
10435
10436
  var node_2 = sibling(textarea, 2);
10436
10437
  {
10437
10438
  var consequent_1 = ($$anchor3) => {
10438
- var span = root_3$9();
10439
+ var span = root_3$8();
10439
10440
  var node_3 = child(span);
10440
10441
  {
10441
10442
  let $0 = /* @__PURE__ */ user_derived(() => isSkipped() ? false : Boolean(isCorrect()));
@@ -10486,7 +10487,7 @@ function TypeInTextField($$anchor, $$props) {
10486
10487
  var node_4 = sibling(input, 2);
10487
10488
  {
10488
10489
  var consequent_3 = ($$anchor3) => {
10489
- var span_1 = root_5$3();
10490
+ var span_1 = root_5$4();
10490
10491
  var node_5 = child(span_1);
10491
10492
  {
10492
10493
  let $0 = /* @__PURE__ */ user_derived(() => isSkipped() ? false : Boolean(isCorrect()));
@@ -10621,8 +10622,9 @@ action.update = n.update;
10621
10622
  action.destroy = n.destroy;
10622
10623
  var root_1$c = /* @__PURE__ */ from_html(`<label data-testid="qn-number-txt" aria-hidden="true"><span></span> <span> </span></label>`);
10623
10624
  var root_2$6 = /* @__PURE__ */ from_html(`<div role="textbox" aria-readonly="true"><!></div>`);
10624
- var root_3$8 = /* @__PURE__ */ from_html(`<textarea rows="1" readonly=""></textarea>`);
10625
- var root_4 = /* @__PURE__ */ from_html(`<span class="w-6 h-6 absolute right-4 top-[calc(50%+0.375rem)] -translate-y-1/2 flex items-center justify-center"><!></span>`);
10625
+ var root_4 = /* @__PURE__ */ from_html(`<div role="textbox" aria-readonly="true" data-testid="ans-sum-corr-txb"><!></div>`);
10626
+ var root_5$3 = /* @__PURE__ */ from_html(`<textarea rows="1" readonly=""></textarea>`);
10627
+ var root_6$2 = /* @__PURE__ */ from_html(`<span class="w-6 h-6 absolute right-4 top-[calc(50%+0.375rem)] -translate-y-1/2 flex items-center justify-center"><!></span>`);
10626
10628
  var root$a = /* @__PURE__ */ from_html(`<div><!> <!> <!></div>`);
10627
10629
  function AnswerDisplay($$anchor, $$props) {
10628
10630
  push($$props, true);
@@ -10802,33 +10804,66 @@ function AnswerDisplay($$anchor, $$props) {
10802
10804
  );
10803
10805
  append($$anchor2, div_1);
10804
10806
  };
10805
- var alternate = ($$anchor2) => {
10806
- var textarea = root_3$8();
10807
- remove_textarea_child(textarea);
10808
- action$1(textarea, ($$node) => action?.($$node));
10809
- template_effect(() => {
10810
- set_attribute(textarea, "aria-label", get$1(ariaLabel));
10811
- set_class(textarea, 1, `${type() === "student" ? "ans-sum-stud-txb" : "ans-sum-corr-txb"} ${get$1(textareaClasses) ?? ""}`);
10812
- set_attribute(textarea, "data-testid", type() === "student" ? "ans-sum-stud-txb" : "ans-sum-corr-txb");
10813
- set_attribute(textarea, "id", `${type() ?? ""}-${comparison().id ?? ""}-${questionNumber() - 1}`);
10814
- set_value(textarea, get$1(displayAnswer));
10815
- set_attribute(textarea, "tabindex", get$1(tabIndex));
10816
- });
10817
- append($$anchor2, textarea);
10807
+ var alternate_1 = ($$anchor2) => {
10808
+ var fragment = comment();
10809
+ var node_3 = first_child(fragment);
10810
+ {
10811
+ var consequent_2 = ($$anchor3) => {
10812
+ var div_2 = root_4();
10813
+ var node_4 = child(div_2);
10814
+ CommonStringToHtml(node_4, {
10815
+ get htmlString() {
10816
+ return get$1(displayAnswer);
10817
+ },
10818
+ otherClass: "overflow-y-visible break-words"
10819
+ });
10820
+ reset(div_2);
10821
+ template_effect(() => {
10822
+ set_attribute(div_2, "aria-label", get$1(ariaLabel));
10823
+ set_class(div_2, 1, `ans-sum-corr-txb ${get$1(textareaClasses) ?? ""}`);
10824
+ set_attribute(div_2, "id", `${type() ?? ""}-${comparison().id ?? ""}-${questionNumber() - 1}`);
10825
+ set_attribute(div_2, "tabindex", get$1(tabIndex));
10826
+ });
10827
+ append($$anchor3, div_2);
10828
+ };
10829
+ var alternate = ($$anchor3) => {
10830
+ var textarea = root_5$3();
10831
+ remove_textarea_child(textarea);
10832
+ action$1(textarea, ($$node) => action?.($$node));
10833
+ template_effect(() => {
10834
+ set_attribute(textarea, "aria-label", get$1(ariaLabel));
10835
+ set_class(textarea, 1, get$1(textareaClasses));
10836
+ set_attribute(textarea, "data-testid", type() === "student" ? "ans-sum-stud-txb" : "ans-sum-corr-txb");
10837
+ set_attribute(textarea, "id", `${type() ?? ""}-${comparison().id ?? ""}-${questionNumber() - 1}`);
10838
+ set_value(textarea, get$1(displayAnswer));
10839
+ set_attribute(textarea, "tabindex", get$1(tabIndex));
10840
+ });
10841
+ append($$anchor3, textarea);
10842
+ };
10843
+ if_block(
10844
+ node_3,
10845
+ ($$render) => {
10846
+ if (type() === "correct") $$render(consequent_2);
10847
+ else $$render(alternate, false);
10848
+ },
10849
+ true
10850
+ );
10851
+ }
10852
+ append($$anchor2, fragment);
10818
10853
  };
10819
10854
  if_block(node_1, ($$render) => {
10820
10855
  if (isDropdownInteraction) $$render(consequent_1);
10821
- else $$render(alternate, false);
10856
+ else $$render(alternate_1, false);
10822
10857
  });
10823
10858
  }
10824
- var node_3 = sibling(node_1, 2);
10859
+ var node_5 = sibling(node_1, 2);
10825
10860
  {
10826
- var consequent_2 = ($$anchor2) => {
10827
- var span_2 = root_4();
10828
- var node_4 = child(span_2);
10861
+ var consequent_3 = ($$anchor2) => {
10862
+ var span_2 = root_6$2();
10863
+ var node_6 = child(span_2);
10829
10864
  {
10830
10865
  let $0 = /* @__PURE__ */ user_derived(() => isCorrect() ? "text-green-900" : "text-red-900");
10831
- ResultIcon(node_4, {
10866
+ ResultIcon(node_6, {
10832
10867
  get isCorrect() {
10833
10868
  return isCorrect();
10834
10869
  },
@@ -10840,8 +10875,8 @@ function AnswerDisplay($$anchor, $$props) {
10840
10875
  reset(span_2);
10841
10876
  append($$anchor2, span_2);
10842
10877
  };
10843
- if_block(node_3, ($$render) => {
10844
- if (showResultIcon() && type() === "student") $$render(consequent_2);
10878
+ if_block(node_5, ($$render) => {
10879
+ if (showResultIcon() && type() === "student") $$render(consequent_3);
10845
10880
  });
10846
10881
  }
10847
10882
  reset(div);
@@ -11124,17 +11159,22 @@ function TypeInFeedback($$anchor, $$props) {
11124
11159
  const showInlineComparisonTable = /* @__PURE__ */ user_derived(() => feedbackState().showComparisonTable && config().variant === "inline");
11125
11160
  const feedbackIconType = /* @__PURE__ */ user_derived(() => isInteractiveMode2() && config().variant === "inline" ? "info" : "result");
11126
11161
  let showDelayedComparisonTable = /* @__PURE__ */ state(false);
11162
+ let hasTriggeredComparisonTable = false;
11127
11163
  user_effect(() => {
11128
11164
  if (get$1(showInlineComparisonTable)) {
11129
- set(showDelayedComparisonTable, false);
11130
- const timer = setTimeout(
11131
- () => {
11132
- set(showDelayedComparisonTable, true);
11133
- },
11134
- 100
11135
- );
11136
- return () => clearTimeout(timer);
11165
+ if (!hasTriggeredComparisonTable) {
11166
+ hasTriggeredComparisonTable = true;
11167
+ set(showDelayedComparisonTable, false);
11168
+ const timer = setTimeout(
11169
+ () => {
11170
+ set(showDelayedComparisonTable, true);
11171
+ },
11172
+ 100
11173
+ );
11174
+ return () => clearTimeout(timer);
11175
+ }
11137
11176
  } else {
11177
+ hasTriggeredComparisonTable = false;
11138
11178
  set(showDelayedComparisonTable, false);
11139
11179
  }
11140
11180
  });
@@ -11290,6 +11330,7 @@ var root_3$7 = /* @__PURE__ */ from_html(`<p></p>`);
11290
11330
  var root_8$2 = /* @__PURE__ */ from_html(`<div class="absolute inset-0 bg-transparent z-50"></div>`);
11291
11331
  var root_2$4 = /* @__PURE__ */ from_html(`<div class="inline-typein-container mt-6 relative"><!> <div class="divider my-6"></div> <!></div>`);
11292
11332
  var root_10$2 = /* @__PURE__ */ from_html(`<div class="mb-4"><!></div>`);
11333
+ var root_13$1 = /* @__PURE__ */ from_html(`<div role="textbox" tabindex="0" aria-readonly="true" aria-labelledby="missing-answer-label" class="typein-textbox typein-textbox-missing border-2 border-green-700 py-[9px] px-4"><!></div>`);
11293
11334
  var root_12$2 = /* @__PURE__ */ from_html(`<div class="mt-6"><p id="missing-answer-label" class="p2 text-green-750 mb-3">Missing answer</p> <!></div>`);
11294
11335
  var root_9$2 = /* @__PURE__ */ from_html(`<!> <!> <span class="sr-only" aria-live="polite" aria-atomic="true"> </span> <!>`, 1);
11295
11336
  function TypeInComponent($$anchor, $$props) {
@@ -11339,6 +11380,15 @@ function TypeInComponent($$anchor, $$props) {
11339
11380
  return false;
11340
11381
  };
11341
11382
  const isMultiple = config().variant === "inline" ? getIsMultiple(segments) : false;
11383
+ const inlineHasMath = config().variant === "inline" && segments.some((seg) => seg.parts.some((p) => p.type === "text" && hasMathJax(p.content)));
11384
+ let inlineContainerEl = /* @__PURE__ */ state(void 0);
11385
+ user_effect(() => {
11386
+ get$1(inlineInputValues);
11387
+ get$1(feedbackState).showStatusLine;
11388
+ if (inlineHasMath && get$1(inlineContainerEl)) {
11389
+ typesetMathJax(get$1(inlineContainerEl));
11390
+ }
11391
+ });
11342
11392
  const validateAnswer = (answer) => {
11343
11393
  if (!api().validate) return { isValid: false, detail: [] };
11344
11394
  const result = api().validate(answer);
@@ -11522,15 +11572,15 @@ function TypeInComponent($$anchor, $$props) {
11522
11572
  var div = root_2$4();
11523
11573
  var node_1 = child(div);
11524
11574
  each(node_1, 17, () => segments, index, ($$anchor4, segment) => {
11525
- var p = root_3$7();
11526
- each(p, 21, () => get$1(segment).parts, index, ($$anchor5, part, partIndex) => {
11575
+ var p_1 = root_3$7();
11576
+ each(p_1, 21, () => get$1(segment).parts, index, ($$anchor5, part, partIndex) => {
11527
11577
  var fragment_2 = comment();
11528
11578
  var node_2 = first_child(fragment_2);
11529
11579
  {
11530
11580
  var consequent = ($$anchor6) => {
11531
11581
  var fragment_3 = comment();
11532
11582
  var node_3 = first_child(fragment_3);
11533
- html(node_3, () => get$1(part).content);
11583
+ html(node_3, () => processMathJax(get$1(part).content));
11534
11584
  append($$anchor6, fragment_3);
11535
11585
  };
11536
11586
  var alternate = ($$anchor6) => {
@@ -11587,8 +11637,8 @@ function TypeInComponent($$anchor, $$props) {
11587
11637
  }
11588
11638
  append($$anchor5, fragment_2);
11589
11639
  });
11590
- reset(p);
11591
- append($$anchor4, p);
11640
+ reset(p_1);
11641
+ append($$anchor4, p_1);
11592
11642
  });
11593
11643
  var node_5 = sibling(node_1, 4);
11594
11644
  {
@@ -11601,9 +11651,10 @@ function TypeInComponent($$anchor, $$props) {
11601
11651
  });
11602
11652
  }
11603
11653
  reset(div);
11654
+ bind_this(div, ($$value) => set(inlineContainerEl, $$value), () => get$1(inlineContainerEl));
11604
11655
  append($$anchor3, div);
11605
11656
  };
11606
- var alternate_1 = ($$anchor3) => {
11657
+ var alternate_2 = ($$anchor3) => {
11607
11658
  var fragment_6 = root_9$2();
11608
11659
  var node_6 = first_child(fragment_6);
11609
11660
  {
@@ -11679,40 +11730,64 @@ function TypeInComponent($$anchor, $$props) {
11679
11730
  reset(span);
11680
11731
  var node_9 = sibling(span, 2);
11681
11732
  {
11682
- var consequent_5 = ($$anchor4) => {
11733
+ var consequent_6 = ($$anchor4) => {
11683
11734
  var div_3 = root_12$2();
11684
11735
  var node_10 = sibling(child(div_3), 2);
11685
11736
  {
11686
- let $02 = /* @__PURE__ */ user_derived(() => get$1(missingAnswerDisplay) ?? "");
11687
- let $12 = /* @__PURE__ */ user_derived(() => config().variant === "long" ? "long" : "short");
11688
- let $22 = /* @__PURE__ */ user_derived(() => [get$1(missingAnswerDisplay) ?? ""]);
11689
- let $3 = /* @__PURE__ */ user_derived(() => config().variant === "long" ? "long-mis-ans-txa" : "short-mis-ans-txb");
11690
- TypeInTextField(node_10, {
11691
- class: "typein-textbox-missing",
11692
- get value() {
11693
- return get$1($02);
11694
- },
11695
- get variant() {
11696
- return get$1($12);
11697
- },
11698
- readonly: true,
11699
- showStatus: true,
11700
- isCorrect: true,
11701
- hideResultIcon: true,
11702
- get sessionAnswersFlat() {
11703
- return get$1($22);
11704
- },
11705
- "aria-labelledby": "missing-answer-label",
11706
- get dataTestId() {
11707
- return get$1($3);
11737
+ var consequent_5 = ($$anchor5) => {
11738
+ var div_4 = root_13$1();
11739
+ var node_11 = child(div_4);
11740
+ {
11741
+ let $02 = /* @__PURE__ */ user_derived(() => get$1(missingAnswerDisplay) ?? "");
11742
+ CommonStringToHtml(node_11, {
11743
+ get htmlString() {
11744
+ return get$1($02);
11745
+ },
11746
+ otherClass: "break-words"
11747
+ });
11748
+ }
11749
+ reset(div_4);
11750
+ template_effect(() => set_attribute(div_4, "data-testid", config().variant === "long" ? "long-mis-ans-txa" : "short-mis-ans-txb"));
11751
+ append($$anchor5, div_4);
11752
+ };
11753
+ var alternate_1 = ($$anchor5) => {
11754
+ {
11755
+ let $02 = /* @__PURE__ */ user_derived(() => get$1(missingAnswerDisplay) ?? "");
11756
+ let $12 = /* @__PURE__ */ user_derived(() => config().variant === "long" ? "long" : "short");
11757
+ let $22 = /* @__PURE__ */ user_derived(() => [get$1(missingAnswerDisplay) ?? ""]);
11758
+ let $3 = /* @__PURE__ */ user_derived(() => config().variant === "long" ? "long-mis-ans-txa" : "short-mis-ans-txb");
11759
+ TypeInTextField($$anchor5, {
11760
+ class: "typein-textbox-missing",
11761
+ get value() {
11762
+ return get$1($02);
11763
+ },
11764
+ get variant() {
11765
+ return get$1($12);
11766
+ },
11767
+ readonly: true,
11768
+ showStatus: true,
11769
+ isCorrect: true,
11770
+ hideResultIcon: true,
11771
+ get sessionAnswersFlat() {
11772
+ return get$1($22);
11773
+ },
11774
+ "aria-labelledby": "missing-answer-label",
11775
+ get dataTestId() {
11776
+ return get$1($3);
11777
+ }
11778
+ });
11708
11779
  }
11780
+ };
11781
+ if_block(node_10, ($$render) => {
11782
+ if (hasMathJax(get$1(missingAnswerDisplay) ?? "")) $$render(consequent_5);
11783
+ else $$render(alternate_1, false);
11709
11784
  });
11710
11785
  }
11711
11786
  reset(div_3);
11712
11787
  append($$anchor4, div_3);
11713
11788
  };
11714
11789
  if_block(node_9, ($$render) => {
11715
- if (get$1(showMissingAnswer)) $$render(consequent_5);
11790
+ if (get$1(showMissingAnswer)) $$render(consequent_6);
11716
11791
  });
11717
11792
  }
11718
11793
  template_effect(() => set_text(text, get$1(missingAnswerAnnouncement)));
@@ -11720,7 +11795,7 @@ function TypeInComponent($$anchor, $$props) {
11720
11795
  };
11721
11796
  if_block(node, ($$render) => {
11722
11797
  if (config().variant === "inline") $$render(consequent_3);
11723
- else $$render(alternate_1, false);
11798
+ else $$render(alternate_2, false);
11724
11799
  });
11725
11800
  }
11726
11801
  append($$anchor2, fragment_1);
@@ -19285,6 +19360,11 @@ const isSuperSubTag = (tag) => {
19285
19360
  const name = getTagName(tag);
19286
19361
  return name === "sup" || name === "sub";
19287
19362
  };
19363
+ const trailingPunctuationPattern = /([.,!?;:)\]}"'\u201D\u2019»…\u2014\u2013]+)$/;
19364
+ const leadingPunctuationPattern = /^([([{'""\u201C\u2018]+)/;
19365
+ const openingCharsAtWordEndPattern = /([(\[{\u201C\u2018]+)$/;
19366
+ const wordContainsOnlyPunctuationPattern = /^[^\w\u00C0-\u024F]+$/;
19367
+ const TOKEN_PATTERN = /((?:<(?!\/?eat-)[^>]+>)*)<eat-contentful>(.*?)<\/eat-contentful>((?:<\/[^>]+>)*)|((?:<(?!\/?eat-)[^>]*>|[^<>])+)/;
19288
19368
  const extractHtmlWords = (htmlText) => {
19289
19369
  const re = /(\s+)|(<\/[^>]+>)|(<[^>]+>)|([^\s<>]+)/g;
19290
19370
  const tokens = [];
@@ -19386,13 +19466,115 @@ const extractHtmlWords = (htmlText) => {
19386
19466
  });
19387
19467
  };
19388
19468
  const splitParagraphs = (rawText) => rawText.split(/<\/p>/i).map((p) => p.replace(/^<p>/i, "").trim()).filter(Boolean);
19469
+ const decodeAuthored = (para) => para.replace(/&lt;eat-contentful&gt;/g, "<eat-contentful>").replace(/&lt;\/eat-contentful&gt;/g, "</eat-contentful>").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&apos;/g, "'");
19470
+ const flushLeadingPunct = (text, state2) => {
19471
+ const m = text.match(leadingPunctuationPattern);
19472
+ const extractedLeading = m ? m[1] : "";
19473
+ const lp = state2.pendingLeadingPunct + extractedLeading;
19474
+ const leadingPunctuation = lp.length ? lp : void 0;
19475
+ state2.pendingLeadingPunct = "";
19476
+ return { leadingPunctuation, extractedLeading };
19477
+ };
19478
+ const appendTrailingOrPush = (text, state2) => {
19479
+ const prev = state2.segments[state2.segments.length - 1];
19480
+ if (prev && !prev.isPunctuation && !prev.isLineBreak) {
19481
+ prev.trailingPunctuation = (prev.trailingPunctuation ?? "") + text;
19482
+ } else {
19483
+ state2.segments.push({ id: `${state2.globalIndex}`, text, isPunctuation: true });
19484
+ state2.globalIndex++;
19485
+ }
19486
+ };
19487
+ const processPurePunctWord = (visibleWord, state2) => {
19488
+ const isDoubleQuote = visibleWord === '"';
19489
+ const isSingleQuote = visibleWord === "'";
19490
+ const quoteDepth = isDoubleQuote ? state2.openDoubleQuoteDepth : isSingleQuote ? state2.openSingleQuoteDepth : -1;
19491
+ if ((isDoubleQuote || isSingleQuote) && quoteDepth > 0) {
19492
+ appendTrailingOrPush(visibleWord, state2);
19493
+ if (isDoubleQuote) state2.openDoubleQuoteDepth--;
19494
+ else state2.openSingleQuoteDepth--;
19495
+ } else if (leadingPunctuationPattern.test(visibleWord)) {
19496
+ state2.pendingLeadingPunct += visibleWord;
19497
+ if (isDoubleQuote) state2.openDoubleQuoteDepth++;
19498
+ else if (isSingleQuote) state2.openSingleQuoteDepth++;
19499
+ } else {
19500
+ appendTrailingOrPush(visibleWord, state2);
19501
+ }
19502
+ };
19503
+ const processHtmlWord = (word, state2) => {
19504
+ const innerVisible = decodeHtmlEntities(stripTags(word));
19505
+ const outerOpenTags = word.match(/^((?:<[^>]+>)+)/)?.[1] ?? "";
19506
+ const outerCloseTags = word.match(/((?:<\/[^>]+>)+)$/)?.[1] ?? "";
19507
+ const wrapInTags = (s) => outerOpenTags ? outerOpenTags + s + outerCloseTags : s;
19508
+ const leadingMatch = innerVisible.match(leadingPunctuationPattern);
19509
+ const extractedLeading = leadingMatch ? leadingMatch[1] : "";
19510
+ const lp = state2.pendingLeadingPunct + (extractedLeading ? wrapInTags(extractedLeading) : "");
19511
+ const leadingPunctuation = lp.length ? lp : void 0;
19512
+ state2.pendingLeadingPunct = "";
19513
+ let wordForTrailing = word;
19514
+ if (extractedLeading) {
19515
+ wordForTrailing = word.replace(new RegExp("^((?:<[^>]+>)*)" + escapeRegExp(extractedLeading)), "$1");
19516
+ }
19517
+ const visibleAfterLeading = extractedLeading ? innerVisible.slice(extractedLeading.length) : innerVisible;
19518
+ const punctMatch = visibleAfterLeading.match(trailingPunctuationPattern);
19519
+ if (punctMatch) {
19520
+ const punc = punctMatch[1];
19521
+ const rebuilt = wordForTrailing.replace(new RegExp(escapeRegExp(punc) + "(</)"), "$1");
19522
+ state2.segments.push({
19523
+ id: `${state2.globalIndex}`,
19524
+ text: decodeNbsp(rebuilt),
19525
+ leadingPunctuation,
19526
+ trailingPunctuation: wrapInTags(punc)
19527
+ });
19528
+ } else {
19529
+ state2.segments.push({ id: `${state2.globalIndex}`, text: decodeNbsp(wordForTrailing), leadingPunctuation });
19530
+ }
19531
+ state2.globalIndex++;
19532
+ };
19533
+ const processPlainWord = (visibleWord, state2) => {
19534
+ const { leadingPunctuation, extractedLeading } = flushLeadingPunct(visibleWord, state2);
19535
+ let wordAfterLeading = extractedLeading ? visibleWord.slice(extractedLeading.length) : visibleWord;
19536
+ const openingCharsAtEnd = wordAfterLeading.match(openingCharsAtWordEndPattern);
19537
+ if (openingCharsAtEnd) {
19538
+ state2.pendingLeadingPunct += openingCharsAtEnd[1];
19539
+ wordAfterLeading = wordAfterLeading.slice(0, -openingCharsAtEnd[1].length);
19540
+ }
19541
+ if (!wordAfterLeading.length) return;
19542
+ const punctMatch = wordAfterLeading.match(trailingPunctuationPattern);
19543
+ const text = decodeNbsp(punctMatch ? wordAfterLeading.slice(0, -punctMatch[1].length) : wordAfterLeading);
19544
+ const trailingPunctuation = punctMatch ? punctMatch[1] : void 0;
19545
+ state2.segments.push({ id: `${state2.globalIndex}`, text, leadingPunctuation, trailingPunctuation });
19546
+ state2.globalIndex++;
19547
+ };
19548
+ const processContentfulToken = (match, state2) => {
19549
+ const outerOpen = match[1] ?? "";
19550
+ const outerClose = match[3] ?? "";
19551
+ const rawContent = match[2].trim();
19552
+ const displayText = decodeNbsp(rawContent);
19553
+ if (!displayText) return;
19554
+ const { leadingPunctuation, extractedLeading } = flushLeadingPunct(displayText, state2);
19555
+ const textAfterLeading = extractedLeading ? displayText.slice(extractedLeading.length) : displayText;
19556
+ const rawAfterLeading = extractedLeading ? rawContent.slice(extractedLeading.length) : rawContent;
19557
+ const punctMatch = textAfterLeading.match(trailingPunctuationPattern);
19558
+ const rawText = punctMatch ? rawAfterLeading.slice(0, -punctMatch[1].length) : rawAfterLeading;
19559
+ const trailingPunctuation = punctMatch ? punctMatch[1] : void 0;
19560
+ const innerText = punctMatch ? textAfterLeading.slice(0, -punctMatch[1].length) : textAfterLeading;
19561
+ const text = outerOpen + innerText + outerClose;
19562
+ state2.segments.push({
19563
+ id: `${state2.globalIndex}`,
19564
+ text,
19565
+ rawText,
19566
+ leadingPunctuation,
19567
+ trailingPunctuation,
19568
+ isContentful: true
19569
+ });
19570
+ state2.globalIndex++;
19571
+ };
19389
19572
  const parseSentences = (rawText) => {
19390
19573
  const paragraphs = splitParagraphs(rawText);
19391
19574
  const segments = [];
19392
19575
  let posIndex = 0;
19393
19576
  for (let pIdx = 0; pIdx < paragraphs.length; pIdx++) {
19394
- const para = paragraphs[pIdx];
19395
- const decoded = para.replace(/&lt;eat-contentful&gt;/g, "<eat-contentful>").replace(/&lt;\/eat-contentful&gt;/g, "</eat-contentful>").replace(/&lt;eat-sentence&gt;/g, "<eat-sentence>");
19577
+ const decoded = decodeAuthored(paragraphs[pIdx]).replace(/&lt;eat-sentence&gt;/g, "<eat-sentence>");
19396
19578
  const chunks = decoded.split("<eat-sentence>");
19397
19579
  for (const chunk of chunks) {
19398
19580
  const contentfulMatch = chunk.match(/((?:<(?!\/?eat-)[^>]+>)*)<eat-contentful>(.*?)<\/eat-contentful>([\s\S]*)/);
@@ -19402,10 +19584,8 @@ const parseSentences = (rawText) => {
19402
19584
  const displayText = decodeNbsp(rawChunk);
19403
19585
  if (displayText) {
19404
19586
  const text = contentfulMatch ? outerOpen + displayText + outerClose : displayText;
19405
- const id = String(posIndex);
19406
19587
  const rawText2 = contentfulMatch ? rawChunk : void 0;
19407
- const isContentful = !!contentfulMatch;
19408
- segments.push({ id, text, rawText: rawText2, isContentful: isContentful || void 0 });
19588
+ segments.push({ id: String(posIndex), text, rawText: rawText2, isContentful: contentfulMatch ? true : void 0 });
19409
19589
  posIndex++;
19410
19590
  }
19411
19591
  }
@@ -19417,120 +19597,50 @@ const parseSentences = (rawText) => {
19417
19597
  };
19418
19598
  const parseWords = (rawText) => {
19419
19599
  const paragraphs = splitParagraphs(rawText);
19420
- const segments = [];
19421
- let globalIndex = 0;
19422
- const tokenRegex = /((?:<(?!\/?eat-)[^>]+>)*)<eat-contentful>(.*?)<\/eat-contentful>((?:<\/[^>]+>)*)|((?:<(?!\/?eat-)[^>]*>|[^<>])+)/g;
19423
- const trailingPunctuationPattern = /([.,!?;:)\]}"'\u201D\u2019»…\u2014\u2013]+)$/;
19424
- const leadingPunctuationPattern = /^([([{'""\u201C\u2018]+)/;
19425
- const openingCharsAtWordEndPattern = /([(\[{\u201C\u2018]+)$/;
19426
- const wordContainsOnlyPunctuationPattern = /^[^\w\u00C0-\u024F]+$/;
19600
+ const state2 = {
19601
+ segments: [],
19602
+ globalIndex: 0,
19603
+ pendingLeadingPunct: "",
19604
+ openDoubleQuoteDepth: 0,
19605
+ openSingleQuoteDepth: 0
19606
+ };
19427
19607
  for (let pIdx = 0; pIdx < paragraphs.length; pIdx++) {
19428
- const para = paragraphs[pIdx];
19429
- const decoded = para.replace(/&lt;eat-contentful&gt;/g, "<eat-contentful>").replace(/&lt;\/eat-contentful&gt;/g, "</eat-contentful>");
19430
- tokenRegex.lastIndex = 0;
19608
+ const decoded = decodeAuthored(paragraphs[pIdx]);
19609
+ const tokenRegex = new RegExp(TOKEN_PATTERN, "g");
19610
+ state2.pendingLeadingPunct = "";
19611
+ state2.openDoubleQuoteDepth = 0;
19612
+ state2.openSingleQuoteDepth = 0;
19431
19613
  let match;
19432
- let pendingLeadingPunct = "";
19433
- const flushLeadingPunct = (text) => {
19434
- const m = text.match(leadingPunctuationPattern);
19435
- const extractedLeading = m ? m[1] : "";
19436
- const lp = pendingLeadingPunct + extractedLeading;
19437
- const leadingPunctuation = lp.length ? lp : void 0;
19438
- pendingLeadingPunct = "";
19439
- return { leadingPunctuation, extractedLeading };
19440
- };
19441
19614
  while ((match = tokenRegex.exec(decoded)) !== null) {
19442
19615
  if (match[2] !== void 0) {
19443
- const outerOpen = match[1] ?? "";
19444
- const outerClose = match[3] ?? "";
19445
- const rawContent = match[2].trim();
19446
- const displayText = decodeNbsp(rawContent);
19447
- if (displayText) {
19448
- const { leadingPunctuation, extractedLeading } = flushLeadingPunct(displayText);
19449
- const textAfterLeading = extractedLeading ? displayText.slice(extractedLeading.length) : displayText;
19450
- const rawAfterLeading = extractedLeading ? rawContent.slice(extractedLeading.length) : rawContent;
19451
- const punctMatch = textAfterLeading.match(trailingPunctuationPattern);
19452
- const rawText2 = punctMatch ? rawAfterLeading.slice(0, -punctMatch[1].length) : rawAfterLeading;
19453
- const trailingPunctuation = punctMatch ? punctMatch[1] : void 0;
19454
- const innerText = punctMatch ? textAfterLeading.slice(0, -punctMatch[1].length) : textAfterLeading;
19455
- const text = outerOpen + innerText + outerClose;
19456
- const id = `${globalIndex}`;
19457
- segments.push({ id, text, rawText: rawText2, leadingPunctuation, trailingPunctuation, isContentful: true });
19458
- globalIndex++;
19459
- }
19616
+ processContentfulToken(match, state2);
19460
19617
  } else if (match[4] !== void 0) {
19461
19618
  const rawChunk = match[4];
19462
19619
  const words = hasHtmlTags(rawChunk) ? extractHtmlWords(rawChunk) : rawChunk.split(/\s+/).filter(Boolean);
19463
19620
  for (const word of words) {
19464
- const visibleWord = hasHtmlTags(word) ? stripTags(word) : decodeHtmlEntities(word);
19621
+ const visibleWord = hasHtmlTags(word) ? decodeHtmlEntities(stripTags(word)) : decodeHtmlEntities(word);
19465
19622
  if (wordContainsOnlyPunctuationPattern.test(visibleWord)) {
19466
- if (leadingPunctuationPattern.test(visibleWord)) {
19467
- pendingLeadingPunct += visibleWord;
19468
- } else {
19469
- const prev = segments[segments.length - 1];
19470
- if (prev && !prev.isPunctuation && !prev.isLineBreak) {
19471
- prev.trailingPunctuation = (prev.trailingPunctuation ?? "") + visibleWord;
19472
- } else {
19473
- segments.push({ id: `${globalIndex}`, text: visibleWord, isPunctuation: true });
19474
- globalIndex++;
19475
- }
19476
- }
19623
+ processPurePunctWord(visibleWord, state2);
19624
+ } else if (hasHtmlTags(word)) {
19625
+ processHtmlWord(word, state2);
19477
19626
  } else {
19478
- if (hasHtmlTags(word)) {
19479
- const innerVisible = stripTags(word);
19480
- const { leadingPunctuation, extractedLeading } = flushLeadingPunct(innerVisible);
19481
- let wordForTrailing = word;
19482
- if (extractedLeading) {
19483
- wordForTrailing = word.replace(new RegExp("^((?:<[^>]+>)*)" + escapeRegExp(extractedLeading)), "$1");
19484
- }
19485
- const visibleAfterLeading = extractedLeading ? innerVisible.slice(extractedLeading.length) : innerVisible;
19486
- const punctMatch = visibleAfterLeading.match(trailingPunctuationPattern);
19487
- if (punctMatch) {
19488
- const punc = punctMatch[1];
19489
- const rebuilt = wordForTrailing.replace(new RegExp(escapeRegExp(punc) + "(</)"), "$1");
19490
- segments.push({
19491
- id: `${globalIndex}`,
19492
- text: decodeNbsp(rebuilt),
19493
- leadingPunctuation,
19494
- trailingPunctuation: punc
19495
- });
19496
- } else {
19497
- segments.push({ id: `${globalIndex}`, text: decodeNbsp(wordForTrailing), leadingPunctuation });
19498
- }
19499
- } else {
19500
- const { leadingPunctuation, extractedLeading } = flushLeadingPunct(visibleWord);
19501
- let wordAfterLeading = extractedLeading ? visibleWord.slice(extractedLeading.length) : visibleWord;
19502
- const openingCharsAtEnd = wordAfterLeading.match(openingCharsAtWordEndPattern);
19503
- if (openingCharsAtEnd) {
19504
- pendingLeadingPunct += openingCharsAtEnd[1];
19505
- wordAfterLeading = wordAfterLeading.slice(0, -openingCharsAtEnd[1].length);
19506
- }
19507
- if (!wordAfterLeading.length) continue;
19508
- const punctMatch = wordAfterLeading.match(trailingPunctuationPattern);
19509
- const text = decodeNbsp(punctMatch ? wordAfterLeading.slice(0, -punctMatch[1].length) : wordAfterLeading);
19510
- const trailingPunctuation = punctMatch ? punctMatch[1] : void 0;
19511
- segments.push({ id: `${globalIndex}`, text, leadingPunctuation, trailingPunctuation });
19512
- }
19513
- globalIndex++;
19627
+ processPlainWord(visibleWord, state2);
19514
19628
  }
19515
19629
  }
19516
19630
  }
19517
19631
  }
19518
- if (pendingLeadingPunct) {
19519
- segments.push({ id: `${globalIndex}`, text: pendingLeadingPunct, isPunctuation: true });
19520
- globalIndex++;
19632
+ if (state2.pendingLeadingPunct) {
19633
+ state2.segments.push({ id: `${state2.globalIndex}`, text: state2.pendingLeadingPunct, isPunctuation: true });
19634
+ state2.globalIndex++;
19635
+ state2.pendingLeadingPunct = "";
19521
19636
  }
19522
19637
  if (pIdx < paragraphs.length - 1) {
19523
- segments.push({ id: `br-${pIdx}`, text: "", isLineBreak: true });
19638
+ state2.segments.push({ id: `br-${pIdx}`, text: "", isLineBreak: true });
19524
19639
  }
19525
19640
  }
19526
- return segments;
19527
- };
19528
- const parseSelectableText = (text, selectableType) => {
19529
- if (selectableType === "Sentence") {
19530
- return parseSentences(text);
19531
- }
19532
- return parseWords(text);
19641
+ return state2.segments;
19533
19642
  };
19643
+ const parseSelectableText = (text, selectableType) => selectableType === "Sentence" ? parseSentences(text) : parseWords(text);
19534
19644
  function getSegmentState(segmentId, selectedIds, correctAnswerIds, isPreviewMode2, isValidating) {
19535
19645
  const isSegmentSelected = selectedIds.includes(segmentId);
19536
19646
  const isInCorrectAnswers = correctAnswerIds.includes(segmentId);
@@ -19715,14 +19825,14 @@ init_fn = function() {
19715
19825
  let SvelteSet = _SvelteSet;
19716
19826
  var root_3$1 = /* @__PURE__ */ from_html(`<br/>`);
19717
19827
  var root_5 = /* @__PURE__ */ from_html(`<span class="segment-punctuation" aria-hidden="true"><!></span>`);
19718
- var root_8 = /* @__PURE__ */ from_html(`<span class="segment-leading-punct" aria-hidden="true"> </span>`);
19828
+ var root_8 = /* @__PURE__ */ from_html(`<span class="segment-leading-punct" aria-hidden="true"><!></span>`);
19719
19829
  var root_9 = /* @__PURE__ */ from_html(`<span class="selectable-segment-missing-badge" aria-hidden="true" data-testid="select-mis-ans-tt">Missing answer</span>`);
19720
19830
  var root_10 = /* @__PURE__ */ from_html(`<span aria-hidden="true" class="selectable-segment-deselect-icon" data-testid="select-close-icon"><!></span>`);
19721
19831
  var root_12 = /* @__PURE__ */ from_html(`<span aria-hidden="true" class="selectable-segment-status-icon"><!></span>`);
19722
19832
  var root_13 = /* @__PURE__ */ from_html(`<span class="sr-only">Correct answer</span>`);
19723
19833
  var root_14 = /* @__PURE__ */ from_html(`<span class="sr-only">Incorrect answer</span>`);
19724
19834
  var root_15 = /* @__PURE__ */ from_html(`<span class="sr-only">Missing answer</span>`);
19725
- var root_16 = /* @__PURE__ */ from_html(`<span class="segment-trailing-punct" aria-hidden="true"> </span>`);
19835
+ var root_16 = /* @__PURE__ */ from_html(`<span class="segment-trailing-punct" aria-hidden="true"><!></span>`);
19726
19836
  var root_7 = /* @__PURE__ */ from_html(`<span class="segment-word-group"><!><span role="button"><!><span class="selectable-segment-text"><!><!></span><!><!><!></span><!></span>`);
19727
19837
  var root_18 = /* @__PURE__ */ from_html(`<span class="selectable-segment-missing-badge" aria-hidden="true" data-testid="select-mis-ans-tt">Missing answer</span>`);
19728
19838
  var root_19 = /* @__PURE__ */ from_html(`<span aria-hidden="true" class="selectable-segment-deselect-icon" data-testid="select-close-icon"><!></span>`);
@@ -19743,7 +19853,7 @@ var root_37 = /* @__PURE__ */ from_html(`<!><!>`, 1);
19743
19853
  var root_41 = /* @__PURE__ */ from_html(`<span class="sr-only">Correct answer</span>`);
19744
19854
  var root_42 = /* @__PURE__ */ from_html(`<span class="sr-only">Incorrect answer</span>`);
19745
19855
  var root_43 = /* @__PURE__ */ from_html(`<span class="sr-only">Missing answer</span>`);
19746
- var root_44 = /* @__PURE__ */ from_html(`<span class="segment-trailing-punct" aria-hidden="true"> </span>`);
19856
+ var root_44 = /* @__PURE__ */ from_html(`<span class="segment-trailing-punct" aria-hidden="true"><!></span>`);
19747
19857
  var root_31 = /* @__PURE__ */ from_html(`<span role="button"><!><span class="selectable-segment-text"><!></span><!><!><!></span><!>`, 1);
19748
19858
  var root_28 = /* @__PURE__ */ from_html(`<span></span>`);
19749
19859
  var root = /* @__PURE__ */ from_html(`<main class="selectable-text-passage" aria-describedby="passage-reader" data-testid="select-passage-ctr"><span id="passage-reader" class="sr-only"> </span> <div><!></div></main>`);
@@ -19762,7 +19872,7 @@ function SelectableTextInteractionContent($$anchor, $$props) {
19762
19872
  const { stripTags: stripTags2, decodeHtmlEntities: decodeHtmlEntities2 } = htmlUtils;
19763
19873
  let passagePlainText = /* @__PURE__ */ user_derived(() => segments.map((s) => {
19764
19874
  if (s.isLineBreak) return " ";
19765
- return (s.leadingPunctuation ?? "") + decodeHtmlEntities2(stripTags2(s.text)) + (s.trailingPunctuation ?? "");
19875
+ return stripTags2(s.leadingPunctuation ?? "") + decodeHtmlEntities2(stripTags2(s.text)) + stripTags2(s.trailingPunctuation ?? "");
19766
19876
  }).join(" ").replace(/\s+/g, " ").trim());
19767
19877
  const getSegmentAriaLabel = (segment, seg, segmentId) => {
19768
19878
  const text = stripTags2(segment.text);
@@ -20039,9 +20149,9 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20039
20149
  {
20040
20150
  var consequent_2 = ($$anchor7) => {
20041
20151
  var span_3 = root_8();
20042
- var text_2 = child(span_3, true);
20152
+ var node_7 = child(span_3);
20153
+ html(node_7, () => get$1(segment).leadingPunctuation);
20043
20154
  reset(span_3);
20044
- template_effect(() => set_text(text_2, get$1(segment).leadingPunctuation));
20045
20155
  append($$anchor7, span_3);
20046
20156
  };
20047
20157
  if_block(node_6, ($$render) => {
@@ -20051,39 +20161,39 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20051
20161
  var span_4 = sibling(node_6);
20052
20162
  span_4.__click = () => handleSegmentClick(get$1(segment).id);
20053
20163
  span_4.__keydown = (e2) => handleSegmentKeydown(e2, get$1(segment).id);
20054
- var node_7 = child(span_4);
20164
+ var node_8 = child(span_4);
20055
20165
  {
20056
20166
  var consequent_3 = ($$anchor7) => {
20057
20167
  var span_5 = root_9();
20058
20168
  append($$anchor7, span_5);
20059
20169
  };
20060
- if_block(node_7, ($$render) => {
20170
+ if_block(node_8, ($$render) => {
20061
20171
  if (get$1(computed_const).seg.isMissing) $$render(consequent_3);
20062
20172
  });
20063
20173
  }
20064
- var span_6 = sibling(node_7);
20065
- var node_8 = child(span_6);
20066
- html(node_8, () => get$1(segment).text);
20067
- var node_9 = sibling(node_8);
20174
+ var span_6 = sibling(node_8);
20175
+ var node_9 = child(span_6);
20176
+ html(node_9, () => get$1(segment).text);
20177
+ var node_10 = sibling(node_9);
20068
20178
  {
20069
20179
  var consequent_4 = ($$anchor7) => {
20070
20180
  var span_7 = root_10();
20071
- var node_10 = child(span_7);
20072
- SvgLoader(node_10, { svgName: "crossIcon", className: "deselect-icon" });
20181
+ var node_11 = child(span_7);
20182
+ SvgLoader(node_11, { svgName: "crossIcon", className: "deselect-icon" });
20073
20183
  reset(span_7);
20074
20184
  append($$anchor7, span_7);
20075
20185
  };
20076
20186
  var alternate = ($$anchor7) => {
20077
20187
  var fragment_4 = comment();
20078
- var node_11 = first_child(fragment_4);
20188
+ var node_12 = first_child(fragment_4);
20079
20189
  {
20080
20190
  var consequent_5 = ($$anchor8) => {
20081
20191
  var span_8 = root_12();
20082
- var node_12 = child(span_8);
20192
+ var node_13 = child(span_8);
20083
20193
  {
20084
20194
  let $0 = /* @__PURE__ */ user_derived(() => get$1(computed_const).seg.isCorrect ? "successSolid" : "errorSolid");
20085
20195
  let $1 = /* @__PURE__ */ user_derived(() => get$1(computed_const).seg.isCorrect ? "correct-icon" : "incorrect-icon");
20086
- SvgLoader(node_12, {
20196
+ SvgLoader(node_13, {
20087
20197
  get svgName() {
20088
20198
  return get$1($0);
20089
20199
  },
@@ -20097,7 +20207,7 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20097
20207
  append($$anchor8, span_8);
20098
20208
  };
20099
20209
  if_block(
20100
- node_11,
20210
+ node_12,
20101
20211
  ($$render) => {
20102
20212
  if (get$1(computed_const).seg.isCorrect || get$1(computed_const).seg.isIncorrect) $$render(consequent_5);
20103
20213
  },
@@ -20106,53 +20216,53 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20106
20216
  }
20107
20217
  append($$anchor7, fragment_4);
20108
20218
  };
20109
- if_block(node_9, ($$render) => {
20219
+ if_block(node_10, ($$render) => {
20110
20220
  if (get$1(computed_const).seg.isSegmentSelected && !get$1(sharedState).isValidating && !get$1(sharedState).isPreviewMode) $$render(consequent_4);
20111
20221
  else $$render(alternate, false);
20112
20222
  });
20113
20223
  }
20114
20224
  reset(span_6);
20115
- var node_13 = sibling(span_6);
20225
+ var node_14 = sibling(span_6);
20116
20226
  {
20117
20227
  var consequent_6 = ($$anchor7) => {
20118
20228
  var span_9 = root_13();
20119
20229
  append($$anchor7, span_9);
20120
20230
  };
20121
- if_block(node_13, ($$render) => {
20231
+ if_block(node_14, ($$render) => {
20122
20232
  if (get$1(computed_const).seg.isCorrect) $$render(consequent_6);
20123
20233
  });
20124
20234
  }
20125
- var node_14 = sibling(node_13);
20235
+ var node_15 = sibling(node_14);
20126
20236
  {
20127
20237
  var consequent_7 = ($$anchor7) => {
20128
20238
  var span_10 = root_14();
20129
20239
  append($$anchor7, span_10);
20130
20240
  };
20131
- if_block(node_14, ($$render) => {
20241
+ if_block(node_15, ($$render) => {
20132
20242
  if (get$1(computed_const).seg.isIncorrect) $$render(consequent_7);
20133
20243
  });
20134
20244
  }
20135
- var node_15 = sibling(node_14);
20245
+ var node_16 = sibling(node_15);
20136
20246
  {
20137
20247
  var consequent_8 = ($$anchor7) => {
20138
20248
  var span_11 = root_15();
20139
20249
  append($$anchor7, span_11);
20140
20250
  };
20141
- if_block(node_15, ($$render) => {
20251
+ if_block(node_16, ($$render) => {
20142
20252
  if (get$1(computed_const).seg.isMissing) $$render(consequent_8);
20143
20253
  });
20144
20254
  }
20145
20255
  reset(span_4);
20146
- var node_16 = sibling(span_4);
20256
+ var node_17 = sibling(span_4);
20147
20257
  {
20148
20258
  var consequent_9 = ($$anchor7) => {
20149
20259
  var span_12 = root_16();
20150
- var text_3 = child(span_12, true);
20260
+ var node_18 = child(span_12);
20261
+ html(node_18, () => get$1(segment).trailingPunctuation);
20151
20262
  reset(span_12);
20152
- template_effect(() => set_text(text_3, get$1(segment).trailingPunctuation));
20153
20263
  append($$anchor7, span_12);
20154
20264
  };
20155
- if_block(node_16, ($$render) => {
20265
+ if_block(node_17, ($$render) => {
20156
20266
  if (get$1(segment).trailingPunctuation) $$render(consequent_9);
20157
20267
  });
20158
20268
  }
@@ -20181,39 +20291,39 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20181
20291
  var span_13 = root_17();
20182
20292
  span_13.__click = () => handleSegmentClick(get$1(segment).id);
20183
20293
  span_13.__keydown = (e2) => handleSegmentKeydown(e2, get$1(segment).id);
20184
- var node_17 = child(span_13);
20294
+ var node_19 = child(span_13);
20185
20295
  {
20186
20296
  var consequent_11 = ($$anchor7) => {
20187
20297
  var span_14 = root_18();
20188
20298
  append($$anchor7, span_14);
20189
20299
  };
20190
- if_block(node_17, ($$render) => {
20300
+ if_block(node_19, ($$render) => {
20191
20301
  if (get$1(computed_const).seg.isMissing) $$render(consequent_11);
20192
20302
  });
20193
20303
  }
20194
- var span_15 = sibling(node_17);
20195
- var node_18 = child(span_15);
20196
- html(node_18, () => get$1(segment).text);
20197
- var node_19 = sibling(node_18);
20304
+ var span_15 = sibling(node_19);
20305
+ var node_20 = child(span_15);
20306
+ html(node_20, () => get$1(segment).text);
20307
+ var node_21 = sibling(node_20);
20198
20308
  {
20199
20309
  var consequent_12 = ($$anchor7) => {
20200
20310
  var span_16 = root_19();
20201
- var node_20 = child(span_16);
20202
- SvgLoader(node_20, { svgName: "crossIcon", className: "deselect-icon" });
20311
+ var node_22 = child(span_16);
20312
+ SvgLoader(node_22, { svgName: "crossIcon", className: "deselect-icon" });
20203
20313
  reset(span_16);
20204
20314
  append($$anchor7, span_16);
20205
20315
  };
20206
20316
  var alternate_1 = ($$anchor7) => {
20207
20317
  var fragment_5 = comment();
20208
- var node_21 = first_child(fragment_5);
20318
+ var node_23 = first_child(fragment_5);
20209
20319
  {
20210
20320
  var consequent_13 = ($$anchor8) => {
20211
20321
  var span_17 = root_21();
20212
- var node_22 = child(span_17);
20322
+ var node_24 = child(span_17);
20213
20323
  {
20214
20324
  let $0 = /* @__PURE__ */ user_derived(() => get$1(computed_const).seg.isCorrect ? "successSolid" : "errorSolid");
20215
20325
  let $1 = /* @__PURE__ */ user_derived(() => get$1(computed_const).seg.isCorrect ? "correct-icon" : "incorrect-icon");
20216
- SvgLoader(node_22, {
20326
+ SvgLoader(node_24, {
20217
20327
  get svgName() {
20218
20328
  return get$1($0);
20219
20329
  },
@@ -20227,7 +20337,7 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20227
20337
  append($$anchor8, span_17);
20228
20338
  };
20229
20339
  if_block(
20230
- node_21,
20340
+ node_23,
20231
20341
  ($$render) => {
20232
20342
  if (get$1(computed_const).seg.isCorrect || get$1(computed_const).seg.isIncorrect) $$render(consequent_13);
20233
20343
  },
@@ -20236,39 +20346,39 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20236
20346
  }
20237
20347
  append($$anchor7, fragment_5);
20238
20348
  };
20239
- if_block(node_19, ($$render) => {
20349
+ if_block(node_21, ($$render) => {
20240
20350
  if (get$1(computed_const).seg.isSegmentSelected && !get$1(sharedState).isValidating && !get$1(sharedState).isPreviewMode) $$render(consequent_12);
20241
20351
  else $$render(alternate_1, false);
20242
20352
  });
20243
20353
  }
20244
20354
  reset(span_15);
20245
- var node_23 = sibling(span_15);
20355
+ var node_25 = sibling(span_15);
20246
20356
  {
20247
20357
  var consequent_14 = ($$anchor7) => {
20248
20358
  var span_18 = root_22();
20249
20359
  append($$anchor7, span_18);
20250
20360
  };
20251
- if_block(node_23, ($$render) => {
20361
+ if_block(node_25, ($$render) => {
20252
20362
  if (get$1(computed_const).seg.isCorrect) $$render(consequent_14);
20253
20363
  });
20254
20364
  }
20255
- var node_24 = sibling(node_23);
20365
+ var node_26 = sibling(node_25);
20256
20366
  {
20257
20367
  var consequent_15 = ($$anchor7) => {
20258
20368
  var span_19 = root_23();
20259
20369
  append($$anchor7, span_19);
20260
20370
  };
20261
- if_block(node_24, ($$render) => {
20371
+ if_block(node_26, ($$render) => {
20262
20372
  if (get$1(computed_const).seg.isIncorrect) $$render(consequent_15);
20263
20373
  });
20264
20374
  }
20265
- var node_25 = sibling(node_24);
20375
+ var node_27 = sibling(node_26);
20266
20376
  {
20267
20377
  var consequent_16 = ($$anchor7) => {
20268
20378
  var span_20 = root_24();
20269
20379
  append($$anchor7, span_20);
20270
20380
  };
20271
- if_block(node_25, ($$render) => {
20381
+ if_block(node_27, ($$render) => {
20272
20382
  if (get$1(computed_const).seg.isMissing) $$render(consequent_16);
20273
20383
  });
20274
20384
  }
@@ -20322,10 +20432,10 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20322
20432
  };
20323
20433
  var alternate_10 = ($$anchor2) => {
20324
20434
  var fragment_6 = comment();
20325
- var node_26 = first_child(fragment_6);
20326
- each(node_26, 19, () => sentenceDisplayRows, (row, rowIdx) => Array.isArray(row) ? segments[row[0]].id : `break-${rowIdx}`, ($$anchor3, row) => {
20435
+ var node_28 = first_child(fragment_6);
20436
+ each(node_28, 19, () => sentenceDisplayRows, (row, rowIdx) => Array.isArray(row) ? segments[row[0]].id : `break-${rowIdx}`, ($$anchor3, row) => {
20327
20437
  var fragment_7 = comment();
20328
- var node_27 = first_child(fragment_7);
20438
+ var node_29 = first_child(fragment_7);
20329
20439
  {
20330
20440
  var consequent_18 = ($$anchor4) => {
20331
20441
  var br_1 = root_27();
@@ -20341,12 +20451,12 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20341
20451
  });
20342
20452
  const isSessionLocked = /* @__PURE__ */ user_derived(() => get$1(sharedState).isSessionMode && get$1(sharedState).isValidating && !get$1(computed_const_1).seg.isMissing);
20343
20453
  var fragment_8 = comment();
20344
- var node_28 = first_child(fragment_8);
20454
+ var node_30 = first_child(fragment_8);
20345
20455
  {
20346
20456
  var consequent_19 = ($$anchor6) => {
20347
20457
  var span_22 = root_30();
20348
- var node_29 = child(span_22);
20349
- html(node_29, () => get$1(segment).text);
20458
+ var node_31 = child(span_22);
20459
+ html(node_31, () => get$1(segment).text);
20350
20460
  reset(span_22);
20351
20461
  append($$anchor6, span_22);
20352
20462
  };
@@ -20355,18 +20465,18 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20355
20465
  var span_23 = first_child(fragment_9);
20356
20466
  span_23.__click = () => handleSegmentClick(get$1(segment).id);
20357
20467
  span_23.__keydown = (e2) => handleSegmentKeydown(e2, get$1(segment).id);
20358
- var node_30 = child(span_23);
20468
+ var node_32 = child(span_23);
20359
20469
  {
20360
20470
  var consequent_20 = ($$anchor7) => {
20361
20471
  var span_24 = root_32();
20362
20472
  append($$anchor7, span_24);
20363
20473
  };
20364
- if_block(node_30, ($$render) => {
20474
+ if_block(node_32, ($$render) => {
20365
20475
  if (get$1(computed_const_1).seg.isMissing) $$render(consequent_20);
20366
20476
  });
20367
20477
  }
20368
- var span_25 = sibling(node_30);
20369
- var node_31 = child(span_25);
20478
+ var span_25 = sibling(node_32);
20479
+ var node_33 = child(span_25);
20370
20480
  {
20371
20481
  var consequent_23 = ($$anchor7) => {
20372
20482
  const computed_const_2 = /* @__PURE__ */ user_derived(() => {
@@ -20374,31 +20484,31 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20374
20484
  return { bodyText, lastWord };
20375
20485
  });
20376
20486
  var fragment_10 = root_33();
20377
- var node_32 = first_child(fragment_10);
20378
- html(node_32, () => get$1(computed_const_2).bodyText);
20379
- var span_26 = sibling(node_32);
20380
- var node_33 = child(span_26);
20381
- html(node_33, () => get$1(computed_const_2).lastWord);
20382
- var node_34 = sibling(node_33);
20487
+ var node_34 = first_child(fragment_10);
20488
+ html(node_34, () => get$1(computed_const_2).bodyText);
20489
+ var span_26 = sibling(node_34);
20490
+ var node_35 = child(span_26);
20491
+ html(node_35, () => get$1(computed_const_2).lastWord);
20492
+ var node_36 = sibling(node_35);
20383
20493
  {
20384
20494
  var consequent_21 = ($$anchor8) => {
20385
20495
  var span_27 = root_34();
20386
- var node_35 = child(span_27);
20387
- SvgLoader(node_35, { svgName: "crossIcon", className: "deselect-icon" });
20496
+ var node_37 = child(span_27);
20497
+ SvgLoader(node_37, { svgName: "crossIcon", className: "deselect-icon" });
20388
20498
  reset(span_27);
20389
20499
  append($$anchor8, span_27);
20390
20500
  };
20391
20501
  var alternate_5 = ($$anchor8) => {
20392
20502
  var fragment_11 = comment();
20393
- var node_36 = first_child(fragment_11);
20503
+ var node_38 = first_child(fragment_11);
20394
20504
  {
20395
20505
  var consequent_22 = ($$anchor9) => {
20396
20506
  var span_28 = root_36();
20397
- var node_37 = child(span_28);
20507
+ var node_39 = child(span_28);
20398
20508
  {
20399
20509
  let $0 = /* @__PURE__ */ user_derived(() => get$1(computed_const_1).seg.isCorrect ? "successSolid" : "errorSolid");
20400
20510
  let $1 = /* @__PURE__ */ user_derived(() => get$1(computed_const_1).seg.isCorrect ? "correct-icon" : "incorrect-icon");
20401
- SvgLoader(node_37, {
20511
+ SvgLoader(node_39, {
20402
20512
  get svgName() {
20403
20513
  return get$1($0);
20404
20514
  },
@@ -20412,7 +20522,7 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20412
20522
  append($$anchor9, span_28);
20413
20523
  };
20414
20524
  if_block(
20415
- node_36,
20525
+ node_38,
20416
20526
  ($$render) => {
20417
20527
  if (get$1(computed_const_1).seg.isCorrect || get$1(computed_const_1).seg.isIncorrect) $$render(consequent_22);
20418
20528
  },
@@ -20421,7 +20531,7 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20421
20531
  }
20422
20532
  append($$anchor8, fragment_11);
20423
20533
  };
20424
- if_block(node_34, ($$render) => {
20534
+ if_block(node_36, ($$render) => {
20425
20535
  if (get$1(computed_const_1).seg.isSegmentSelected && !get$1(sharedState).isValidating && !get$1(sharedState).isPreviewMode) $$render(consequent_21);
20426
20536
  else $$render(alternate_5, false);
20427
20537
  });
@@ -20431,28 +20541,28 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20431
20541
  };
20432
20542
  var alternate_7 = ($$anchor7) => {
20433
20543
  var fragment_12 = root_37();
20434
- var node_38 = first_child(fragment_12);
20435
- html(node_38, () => get$1(segment).text);
20436
- var node_39 = sibling(node_38);
20544
+ var node_40 = first_child(fragment_12);
20545
+ html(node_40, () => get$1(segment).text);
20546
+ var node_41 = sibling(node_40);
20437
20547
  {
20438
20548
  var consequent_24 = ($$anchor8) => {
20439
20549
  var span_29 = root_38();
20440
- var node_40 = child(span_29);
20441
- SvgLoader(node_40, { svgName: "crossIcon", className: "deselect-icon" });
20550
+ var node_42 = child(span_29);
20551
+ SvgLoader(node_42, { svgName: "crossIcon", className: "deselect-icon" });
20442
20552
  reset(span_29);
20443
20553
  append($$anchor8, span_29);
20444
20554
  };
20445
20555
  var alternate_6 = ($$anchor8) => {
20446
20556
  var fragment_13 = comment();
20447
- var node_41 = first_child(fragment_13);
20557
+ var node_43 = first_child(fragment_13);
20448
20558
  {
20449
20559
  var consequent_25 = ($$anchor9) => {
20450
20560
  var span_30 = root_40();
20451
- var node_42 = child(span_30);
20561
+ var node_44 = child(span_30);
20452
20562
  {
20453
20563
  let $0 = /* @__PURE__ */ user_derived(() => get$1(computed_const_1).seg.isCorrect ? "successSolid" : "errorSolid");
20454
20564
  let $1 = /* @__PURE__ */ user_derived(() => get$1(computed_const_1).seg.isCorrect ? "correct-icon" : "incorrect-icon");
20455
- SvgLoader(node_42, {
20565
+ SvgLoader(node_44, {
20456
20566
  get svgName() {
20457
20567
  return get$1($0);
20458
20568
  },
@@ -20466,7 +20576,7 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20466
20576
  append($$anchor9, span_30);
20467
20577
  };
20468
20578
  if_block(
20469
- node_41,
20579
+ node_43,
20470
20580
  ($$render) => {
20471
20581
  if (get$1(computed_const_1).seg.isCorrect || get$1(computed_const_1).seg.isIncorrect) $$render(consequent_25);
20472
20582
  },
@@ -20475,60 +20585,60 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20475
20585
  }
20476
20586
  append($$anchor8, fragment_13);
20477
20587
  };
20478
- if_block(node_39, ($$render) => {
20588
+ if_block(node_41, ($$render) => {
20479
20589
  if (get$1(computed_const_1).seg.isSegmentSelected && !get$1(sharedState).isValidating && !get$1(sharedState).isPreviewMode) $$render(consequent_24);
20480
20590
  else $$render(alternate_6, false);
20481
20591
  });
20482
20592
  }
20483
20593
  append($$anchor7, fragment_12);
20484
20594
  };
20485
- if_block(node_31, ($$render) => {
20595
+ if_block(node_33, ($$render) => {
20486
20596
  if (!isWord) $$render(consequent_23);
20487
20597
  else $$render(alternate_7, false);
20488
20598
  });
20489
20599
  }
20490
20600
  reset(span_25);
20491
- var node_43 = sibling(span_25);
20601
+ var node_45 = sibling(span_25);
20492
20602
  {
20493
20603
  var consequent_26 = ($$anchor7) => {
20494
20604
  var span_31 = root_41();
20495
20605
  append($$anchor7, span_31);
20496
20606
  };
20497
- if_block(node_43, ($$render) => {
20607
+ if_block(node_45, ($$render) => {
20498
20608
  if (get$1(computed_const_1).seg.isCorrect) $$render(consequent_26);
20499
20609
  });
20500
20610
  }
20501
- var node_44 = sibling(node_43);
20611
+ var node_46 = sibling(node_45);
20502
20612
  {
20503
20613
  var consequent_27 = ($$anchor7) => {
20504
20614
  var span_32 = root_42();
20505
20615
  append($$anchor7, span_32);
20506
20616
  };
20507
- if_block(node_44, ($$render) => {
20617
+ if_block(node_46, ($$render) => {
20508
20618
  if (get$1(computed_const_1).seg.isIncorrect) $$render(consequent_27);
20509
20619
  });
20510
20620
  }
20511
- var node_45 = sibling(node_44);
20621
+ var node_47 = sibling(node_46);
20512
20622
  {
20513
20623
  var consequent_28 = ($$anchor7) => {
20514
20624
  var span_33 = root_43();
20515
20625
  append($$anchor7, span_33);
20516
20626
  };
20517
- if_block(node_45, ($$render) => {
20627
+ if_block(node_47, ($$render) => {
20518
20628
  if (get$1(computed_const_1).seg.isMissing) $$render(consequent_28);
20519
20629
  });
20520
20630
  }
20521
20631
  reset(span_23);
20522
- var node_46 = sibling(span_23);
20632
+ var node_48 = sibling(span_23);
20523
20633
  {
20524
20634
  var consequent_29 = ($$anchor7) => {
20525
20635
  var span_34 = root_44();
20526
- var text_4 = child(span_34, true);
20636
+ var node_49 = child(span_34);
20637
+ html(node_49, () => get$1(segment).trailingPunctuation);
20527
20638
  reset(span_34);
20528
- template_effect(() => set_text(text_4, get$1(segment).trailingPunctuation));
20529
20639
  append($$anchor7, span_34);
20530
20640
  };
20531
- if_block(node_46, ($$render) => {
20641
+ if_block(node_48, ($$render) => {
20532
20642
  if (get$1(segment).trailingPunctuation) $$render(consequent_29);
20533
20643
  });
20534
20644
  }
@@ -20552,7 +20662,7 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20552
20662
  event("focus", span_23, () => handleSegmentFocus(get$1(segment).id));
20553
20663
  append($$anchor6, fragment_9);
20554
20664
  };
20555
- if_block(node_28, ($$render) => {
20665
+ if_block(node_30, ($$render) => {
20556
20666
  if (get$1(segment).isPunctuation) $$render(consequent_19);
20557
20667
  else $$render(alternate_8, false);
20558
20668
  });
@@ -20562,7 +20672,7 @@ function SelectableTextInteractionContent($$anchor, $$props) {
20562
20672
  reset(span_21);
20563
20673
  append($$anchor4, span_21);
20564
20674
  };
20565
- if_block(node_27, ($$render) => {
20675
+ if_block(node_29, ($$render) => {
20566
20676
  if (get$1(row) === "break") $$render(consequent_18);
20567
20677
  else $$render(alternate_9, false);
20568
20678
  });