eat-js-sdk 0.0.7 → 0.0.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.
- package/dist/eat-prompt-builder.mjs +1752 -192
- package/package.json +27 -24
|
@@ -44,6 +44,50 @@
|
|
|
44
44
|
subscribe(store, (_) => value = _)();
|
|
45
45
|
return value;
|
|
46
46
|
}
|
|
47
|
+
function create_slot(definition, ctx, $$scope, fn) {
|
|
48
|
+
if (definition) {
|
|
49
|
+
const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
|
|
50
|
+
return definition[0](slot_ctx);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function get_slot_context(definition, ctx, $$scope, fn) {
|
|
54
|
+
return definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;
|
|
55
|
+
}
|
|
56
|
+
function get_slot_changes(definition, $$scope, dirty, fn) {
|
|
57
|
+
if (definition[2] && fn) {
|
|
58
|
+
const lets = definition[2](fn(dirty));
|
|
59
|
+
if ($$scope.dirty === void 0) {
|
|
60
|
+
return lets;
|
|
61
|
+
}
|
|
62
|
+
if (typeof lets === "object") {
|
|
63
|
+
const merged = [];
|
|
64
|
+
const len = Math.max($$scope.dirty.length, lets.length);
|
|
65
|
+
for (let i = 0; i < len; i += 1) {
|
|
66
|
+
merged[i] = $$scope.dirty[i] | lets[i];
|
|
67
|
+
}
|
|
68
|
+
return merged;
|
|
69
|
+
}
|
|
70
|
+
return $$scope.dirty | lets;
|
|
71
|
+
}
|
|
72
|
+
return $$scope.dirty;
|
|
73
|
+
}
|
|
74
|
+
function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {
|
|
75
|
+
if (slot_changes) {
|
|
76
|
+
const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
|
|
77
|
+
slot.p(slot_context, slot_changes);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function get_all_dirty_from_scope($$scope) {
|
|
81
|
+
if ($$scope.ctx.length > 32) {
|
|
82
|
+
const dirty = [];
|
|
83
|
+
const length = $$scope.ctx.length / 32;
|
|
84
|
+
for (let i = 0; i < length; i++) {
|
|
85
|
+
dirty[i] = -1;
|
|
86
|
+
}
|
|
87
|
+
return dirty;
|
|
88
|
+
}
|
|
89
|
+
return -1;
|
|
90
|
+
}
|
|
47
91
|
function exclude_internal_props(props) {
|
|
48
92
|
const result = {};
|
|
49
93
|
for (const k in props)
|
|
@@ -51,6 +95,9 @@
|
|
|
51
95
|
result[k] = props[k];
|
|
52
96
|
return result;
|
|
53
97
|
}
|
|
98
|
+
function action_destroyer(action_result) {
|
|
99
|
+
return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
|
|
100
|
+
}
|
|
54
101
|
|
|
55
102
|
// node_modules/svelte/src/runtime/internal/globals.js
|
|
56
103
|
var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : (
|
|
@@ -187,6 +234,16 @@
|
|
|
187
234
|
function children(element2) {
|
|
188
235
|
return Array.from(element2.childNodes);
|
|
189
236
|
}
|
|
237
|
+
function set_data(text2, data) {
|
|
238
|
+
data = "" + data;
|
|
239
|
+
if (text2.data === data)
|
|
240
|
+
return;
|
|
241
|
+
text2.data = /** @type {string} */
|
|
242
|
+
data;
|
|
243
|
+
}
|
|
244
|
+
function set_input_value(input, value) {
|
|
245
|
+
input.value = value == null ? "" : value;
|
|
246
|
+
}
|
|
190
247
|
function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {
|
|
191
248
|
return new CustomEvent(type, { detail, bubbles, cancelable });
|
|
192
249
|
}
|
|
@@ -345,10 +402,10 @@
|
|
|
345
402
|
set_current_component(component);
|
|
346
403
|
update(component.$$);
|
|
347
404
|
}
|
|
348
|
-
} catch (
|
|
405
|
+
} catch (e2) {
|
|
349
406
|
dirty_components.length = 0;
|
|
350
407
|
flushidx = 0;
|
|
351
|
-
throw
|
|
408
|
+
throw e2;
|
|
352
409
|
}
|
|
353
410
|
set_current_component(null);
|
|
354
411
|
dirty_components.length = 0;
|
|
@@ -505,7 +562,7 @@
|
|
|
505
562
|
}
|
|
506
563
|
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
|
|
507
564
|
}
|
|
508
|
-
function init(component, options,
|
|
565
|
+
function init(component, options, instance7, create_fragment11, not_equal, props, append_styles2 = null, dirty = [-1]) {
|
|
509
566
|
const parent_component = current_component;
|
|
510
567
|
set_current_component(component);
|
|
511
568
|
const $$ = component.$$ = {
|
|
@@ -531,7 +588,7 @@
|
|
|
531
588
|
};
|
|
532
589
|
append_styles2 && append_styles2($$.root);
|
|
533
590
|
let ready = false;
|
|
534
|
-
$$.ctx =
|
|
591
|
+
$$.ctx = instance7 ? instance7(component, options.props || {}, (i, ret, ...rest) => {
|
|
535
592
|
const value = rest.length ? rest[0] : ret;
|
|
536
593
|
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
|
537
594
|
if (!$$.skip_bound && $$.bound[i])
|
|
@@ -544,7 +601,7 @@
|
|
|
544
601
|
$$.update();
|
|
545
602
|
ready = true;
|
|
546
603
|
run_all($$.before_update);
|
|
547
|
-
$$.fragment =
|
|
604
|
+
$$.fragment = create_fragment11 ? create_fragment11($$.ctx) : false;
|
|
548
605
|
if (options.target) {
|
|
549
606
|
if (options.hydrate) {
|
|
550
607
|
start_hydrating();
|
|
@@ -613,7 +670,7 @@
|
|
|
613
670
|
async connectedCallback() {
|
|
614
671
|
this.$$cn = true;
|
|
615
672
|
if (!this.$$c) {
|
|
616
|
-
let
|
|
673
|
+
let create_slot2 = function(name) {
|
|
617
674
|
return () => {
|
|
618
675
|
let node;
|
|
619
676
|
const obj = {
|
|
@@ -647,7 +704,7 @@
|
|
|
647
704
|
const existing_slots = get_custom_elements_slots(this);
|
|
648
705
|
for (const name of this.$$s) {
|
|
649
706
|
if (name in existing_slots) {
|
|
650
|
-
$$slots[name] = [
|
|
707
|
+
$$slots[name] = [create_slot2(name)];
|
|
651
708
|
}
|
|
652
709
|
}
|
|
653
710
|
for (const attribute of this.attributes) {
|
|
@@ -947,6 +1004,246 @@
|
|
|
947
1004
|
return await response.json();
|
|
948
1005
|
};
|
|
949
1006
|
|
|
1007
|
+
// src/lib/components/prompt/template/PromptBody.svelte
|
|
1008
|
+
function create_if_block_1(ctx) {
|
|
1009
|
+
let html_tag;
|
|
1010
|
+
let raw_value = `<${/*promptRubricHeaderElem*/
|
|
1011
|
+
ctx[2]} class="item-heading mb-2 md:mb-4">${/*rubric*/
|
|
1012
|
+
ctx[0]}</${/*promptRubricHeaderElem*/
|
|
1013
|
+
ctx[2]}>`;
|
|
1014
|
+
let html_anchor;
|
|
1015
|
+
return {
|
|
1016
|
+
c() {
|
|
1017
|
+
html_tag = new HtmlTag(false);
|
|
1018
|
+
html_anchor = empty();
|
|
1019
|
+
html_tag.a = html_anchor;
|
|
1020
|
+
},
|
|
1021
|
+
m(target, anchor) {
|
|
1022
|
+
html_tag.m(raw_value, target, anchor);
|
|
1023
|
+
insert(target, html_anchor, anchor);
|
|
1024
|
+
},
|
|
1025
|
+
p(ctx2, dirty) {
|
|
1026
|
+
if (dirty & /*rubric*/
|
|
1027
|
+
1 && raw_value !== (raw_value = `<${/*promptRubricHeaderElem*/
|
|
1028
|
+
ctx2[2]} class="item-heading mb-2 md:mb-4">${/*rubric*/
|
|
1029
|
+
ctx2[0]}</${/*promptRubricHeaderElem*/
|
|
1030
|
+
ctx2[2]}>`))
|
|
1031
|
+
html_tag.p(raw_value);
|
|
1032
|
+
},
|
|
1033
|
+
d(detaching) {
|
|
1034
|
+
if (detaching) {
|
|
1035
|
+
detach(html_anchor);
|
|
1036
|
+
html_tag.d();
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
function create_if_block(ctx) {
|
|
1042
|
+
let html_tag;
|
|
1043
|
+
let raw_value = `<${/*promptRubricHeaderElem*/
|
|
1044
|
+
ctx[2]} class="item-heading font-semibold">${/*prompt*/
|
|
1045
|
+
ctx[1]}</${/*promptRubricHeaderElem*/
|
|
1046
|
+
ctx[2]}>`;
|
|
1047
|
+
let html_anchor;
|
|
1048
|
+
return {
|
|
1049
|
+
c() {
|
|
1050
|
+
html_tag = new HtmlTag(false);
|
|
1051
|
+
html_anchor = empty();
|
|
1052
|
+
html_tag.a = html_anchor;
|
|
1053
|
+
},
|
|
1054
|
+
m(target, anchor) {
|
|
1055
|
+
html_tag.m(raw_value, target, anchor);
|
|
1056
|
+
insert(target, html_anchor, anchor);
|
|
1057
|
+
},
|
|
1058
|
+
p(ctx2, dirty) {
|
|
1059
|
+
if (dirty & /*prompt*/
|
|
1060
|
+
2 && raw_value !== (raw_value = `<${/*promptRubricHeaderElem*/
|
|
1061
|
+
ctx2[2]} class="item-heading font-semibold">${/*prompt*/
|
|
1062
|
+
ctx2[1]}</${/*promptRubricHeaderElem*/
|
|
1063
|
+
ctx2[2]}>`))
|
|
1064
|
+
html_tag.p(raw_value);
|
|
1065
|
+
},
|
|
1066
|
+
d(detaching) {
|
|
1067
|
+
if (detaching) {
|
|
1068
|
+
detach(html_anchor);
|
|
1069
|
+
html_tag.d();
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
};
|
|
1073
|
+
}
|
|
1074
|
+
function create_fragment(ctx) {
|
|
1075
|
+
let div1;
|
|
1076
|
+
let t0;
|
|
1077
|
+
let t1;
|
|
1078
|
+
let div0;
|
|
1079
|
+
let t2;
|
|
1080
|
+
let current;
|
|
1081
|
+
let if_block0 = (
|
|
1082
|
+
/*rubric*/
|
|
1083
|
+
ctx[0] && create_if_block_1(ctx)
|
|
1084
|
+
);
|
|
1085
|
+
let if_block1 = (
|
|
1086
|
+
/*prompt*/
|
|
1087
|
+
ctx[1] && create_if_block(ctx)
|
|
1088
|
+
);
|
|
1089
|
+
const default_slot_template = (
|
|
1090
|
+
/*#slots*/
|
|
1091
|
+
ctx[4].default
|
|
1092
|
+
);
|
|
1093
|
+
const default_slot = create_slot(
|
|
1094
|
+
default_slot_template,
|
|
1095
|
+
ctx,
|
|
1096
|
+
/*$$scope*/
|
|
1097
|
+
ctx[3],
|
|
1098
|
+
null
|
|
1099
|
+
);
|
|
1100
|
+
return {
|
|
1101
|
+
c() {
|
|
1102
|
+
div1 = element("div");
|
|
1103
|
+
if (if_block0)
|
|
1104
|
+
if_block0.c();
|
|
1105
|
+
t0 = space();
|
|
1106
|
+
if (if_block1)
|
|
1107
|
+
if_block1.c();
|
|
1108
|
+
t1 = space();
|
|
1109
|
+
div0 = element("div");
|
|
1110
|
+
t2 = space();
|
|
1111
|
+
if (default_slot)
|
|
1112
|
+
default_slot.c();
|
|
1113
|
+
attr(div0, "class", "divider my-6");
|
|
1114
|
+
attr(div1, "class", "bg-transparent");
|
|
1115
|
+
},
|
|
1116
|
+
m(target, anchor) {
|
|
1117
|
+
insert(target, div1, anchor);
|
|
1118
|
+
if (if_block0)
|
|
1119
|
+
if_block0.m(div1, null);
|
|
1120
|
+
append(div1, t0);
|
|
1121
|
+
if (if_block1)
|
|
1122
|
+
if_block1.m(div1, null);
|
|
1123
|
+
append(div1, t1);
|
|
1124
|
+
append(div1, div0);
|
|
1125
|
+
append(div1, t2);
|
|
1126
|
+
if (default_slot) {
|
|
1127
|
+
default_slot.m(div1, null);
|
|
1128
|
+
}
|
|
1129
|
+
current = true;
|
|
1130
|
+
},
|
|
1131
|
+
p(ctx2, [dirty]) {
|
|
1132
|
+
if (
|
|
1133
|
+
/*rubric*/
|
|
1134
|
+
ctx2[0]
|
|
1135
|
+
) {
|
|
1136
|
+
if (if_block0) {
|
|
1137
|
+
if_block0.p(ctx2, dirty);
|
|
1138
|
+
} else {
|
|
1139
|
+
if_block0 = create_if_block_1(ctx2);
|
|
1140
|
+
if_block0.c();
|
|
1141
|
+
if_block0.m(div1, t0);
|
|
1142
|
+
}
|
|
1143
|
+
} else if (if_block0) {
|
|
1144
|
+
if_block0.d(1);
|
|
1145
|
+
if_block0 = null;
|
|
1146
|
+
}
|
|
1147
|
+
if (
|
|
1148
|
+
/*prompt*/
|
|
1149
|
+
ctx2[1]
|
|
1150
|
+
) {
|
|
1151
|
+
if (if_block1) {
|
|
1152
|
+
if_block1.p(ctx2, dirty);
|
|
1153
|
+
} else {
|
|
1154
|
+
if_block1 = create_if_block(ctx2);
|
|
1155
|
+
if_block1.c();
|
|
1156
|
+
if_block1.m(div1, t1);
|
|
1157
|
+
}
|
|
1158
|
+
} else if (if_block1) {
|
|
1159
|
+
if_block1.d(1);
|
|
1160
|
+
if_block1 = null;
|
|
1161
|
+
}
|
|
1162
|
+
if (default_slot) {
|
|
1163
|
+
if (default_slot.p && (!current || dirty & /*$$scope*/
|
|
1164
|
+
8)) {
|
|
1165
|
+
update_slot_base(
|
|
1166
|
+
default_slot,
|
|
1167
|
+
default_slot_template,
|
|
1168
|
+
ctx2,
|
|
1169
|
+
/*$$scope*/
|
|
1170
|
+
ctx2[3],
|
|
1171
|
+
!current ? get_all_dirty_from_scope(
|
|
1172
|
+
/*$$scope*/
|
|
1173
|
+
ctx2[3]
|
|
1174
|
+
) : get_slot_changes(
|
|
1175
|
+
default_slot_template,
|
|
1176
|
+
/*$$scope*/
|
|
1177
|
+
ctx2[3],
|
|
1178
|
+
dirty,
|
|
1179
|
+
null
|
|
1180
|
+
),
|
|
1181
|
+
null
|
|
1182
|
+
);
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
},
|
|
1186
|
+
i(local) {
|
|
1187
|
+
if (current)
|
|
1188
|
+
return;
|
|
1189
|
+
transition_in(default_slot, local);
|
|
1190
|
+
current = true;
|
|
1191
|
+
},
|
|
1192
|
+
o(local) {
|
|
1193
|
+
transition_out(default_slot, local);
|
|
1194
|
+
current = false;
|
|
1195
|
+
},
|
|
1196
|
+
d(detaching) {
|
|
1197
|
+
if (detaching) {
|
|
1198
|
+
detach(div1);
|
|
1199
|
+
}
|
|
1200
|
+
if (if_block0)
|
|
1201
|
+
if_block0.d();
|
|
1202
|
+
if (if_block1)
|
|
1203
|
+
if_block1.d();
|
|
1204
|
+
if (default_slot)
|
|
1205
|
+
default_slot.d(detaching);
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
function instance($$self, $$props, $$invalidate) {
|
|
1210
|
+
let { $$slots: slots = {}, $$scope } = $$props;
|
|
1211
|
+
let { rubric } = $$props;
|
|
1212
|
+
let { prompt } = $$props;
|
|
1213
|
+
const promptRubricHeaderElem = get_store_value(promptRubricElem);
|
|
1214
|
+
$$self.$$set = ($$props2) => {
|
|
1215
|
+
if ("rubric" in $$props2)
|
|
1216
|
+
$$invalidate(0, rubric = $$props2.rubric);
|
|
1217
|
+
if ("prompt" in $$props2)
|
|
1218
|
+
$$invalidate(1, prompt = $$props2.prompt);
|
|
1219
|
+
if ("$$scope" in $$props2)
|
|
1220
|
+
$$invalidate(3, $$scope = $$props2.$$scope);
|
|
1221
|
+
};
|
|
1222
|
+
return [rubric, prompt, promptRubricHeaderElem, $$scope, slots];
|
|
1223
|
+
}
|
|
1224
|
+
var PromptBody = class extends SvelteComponent {
|
|
1225
|
+
constructor(options) {
|
|
1226
|
+
super();
|
|
1227
|
+
init(this, options, instance, create_fragment, safe_not_equal, { rubric: 0, prompt: 1 });
|
|
1228
|
+
}
|
|
1229
|
+
get rubric() {
|
|
1230
|
+
return this.$$.ctx[0];
|
|
1231
|
+
}
|
|
1232
|
+
set rubric(rubric) {
|
|
1233
|
+
this.$$set({ rubric });
|
|
1234
|
+
flush();
|
|
1235
|
+
}
|
|
1236
|
+
get prompt() {
|
|
1237
|
+
return this.$$.ctx[1];
|
|
1238
|
+
}
|
|
1239
|
+
set prompt(prompt) {
|
|
1240
|
+
this.$$set({ prompt });
|
|
1241
|
+
flush();
|
|
1242
|
+
}
|
|
1243
|
+
};
|
|
1244
|
+
customElements.define("prompt-body", create_custom_element(PromptBody, { "rubric": {}, "prompt": {} }, ["default"], [], true));
|
|
1245
|
+
var PromptBody_default = PromptBody;
|
|
1246
|
+
|
|
950
1247
|
// src/lib/composables/useMCQ.ts
|
|
951
1248
|
var useAlphabetEquivalent = (index) => {
|
|
952
1249
|
const alphabetArr = [
|
|
@@ -984,42 +1281,16 @@
|
|
|
984
1281
|
// src/lib/components/prompt/mcq/PromptMCQ.svelte
|
|
985
1282
|
function get_each_context(ctx, list, i) {
|
|
986
1283
|
const child_ctx = ctx.slice();
|
|
987
|
-
child_ctx[
|
|
988
|
-
child_ctx[
|
|
989
|
-
child_ctx[
|
|
1284
|
+
child_ctx[11] = list[i][0];
|
|
1285
|
+
child_ctx[12] = list[i][1];
|
|
1286
|
+
child_ctx[14] = i;
|
|
990
1287
|
return child_ctx;
|
|
991
1288
|
}
|
|
992
|
-
function
|
|
993
|
-
let html_tag;
|
|
994
|
-
let raw_value = `<${/*promptRubricHeaderElem*/
|
|
995
|
-
ctx[5]} class="item-heading mb-2 md:mb-4">${/*rubric*/
|
|
996
|
-
ctx[2].text}</${/*promptRubricHeaderElem*/
|
|
997
|
-
ctx[5]}>`;
|
|
998
|
-
let html_anchor;
|
|
999
|
-
return {
|
|
1000
|
-
c() {
|
|
1001
|
-
html_tag = new HtmlTag(false);
|
|
1002
|
-
html_anchor = empty();
|
|
1003
|
-
html_tag.a = html_anchor;
|
|
1004
|
-
},
|
|
1005
|
-
m(target, anchor) {
|
|
1006
|
-
html_tag.m(raw_value, target, anchor);
|
|
1007
|
-
insert(target, html_anchor, anchor);
|
|
1008
|
-
},
|
|
1009
|
-
p: noop,
|
|
1010
|
-
d(detaching) {
|
|
1011
|
-
if (detaching) {
|
|
1012
|
-
detach(html_anchor);
|
|
1013
|
-
html_tag.d();
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
};
|
|
1017
|
-
}
|
|
1018
|
-
function create_if_block(ctx) {
|
|
1289
|
+
function create_if_block2(ctx) {
|
|
1019
1290
|
let div1;
|
|
1020
1291
|
let div0;
|
|
1021
1292
|
let div0_class_value;
|
|
1022
|
-
let
|
|
1293
|
+
let t2;
|
|
1023
1294
|
let each_value = ensure_array_like(Object.entries(
|
|
1024
1295
|
/*options*/
|
|
1025
1296
|
ctx[4]
|
|
@@ -1032,7 +1303,7 @@
|
|
|
1032
1303
|
c() {
|
|
1033
1304
|
div1 = element("div");
|
|
1034
1305
|
div0 = element("div");
|
|
1035
|
-
|
|
1306
|
+
t2 = space();
|
|
1036
1307
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
1037
1308
|
each_blocks[i].c();
|
|
1038
1309
|
}
|
|
@@ -1043,7 +1314,7 @@
|
|
|
1043
1314
|
m(target, anchor) {
|
|
1044
1315
|
insert(target, div1, anchor);
|
|
1045
1316
|
append(div1, div0);
|
|
1046
|
-
append(div1,
|
|
1317
|
+
append(div1, t2);
|
|
1047
1318
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
1048
1319
|
if (each_blocks[i]) {
|
|
1049
1320
|
each_blocks[i].m(div1, null);
|
|
@@ -1057,7 +1328,7 @@
|
|
|
1057
1328
|
attr(div0, "class", div0_class_value);
|
|
1058
1329
|
}
|
|
1059
1330
|
if (dirty & /*selectedOption, Object, options, handleOptionClick*/
|
|
1060
|
-
|
|
1331
|
+
50) {
|
|
1061
1332
|
each_value = ensure_array_like(Object.entries(
|
|
1062
1333
|
/*options*/
|
|
1063
1334
|
ctx2[4]
|
|
@@ -1093,7 +1364,7 @@
|
|
|
1093
1364
|
let t1;
|
|
1094
1365
|
let t2_value = (
|
|
1095
1366
|
/*option*/
|
|
1096
|
-
ctx[
|
|
1367
|
+
ctx[12].answer + ""
|
|
1097
1368
|
);
|
|
1098
1369
|
let t2;
|
|
1099
1370
|
let t3;
|
|
@@ -1104,9 +1375,9 @@
|
|
|
1104
1375
|
function click_handler() {
|
|
1105
1376
|
return (
|
|
1106
1377
|
/*click_handler*/
|
|
1107
|
-
ctx[
|
|
1378
|
+
ctx[7](
|
|
1108
1379
|
/*option*/
|
|
1109
|
-
ctx[
|
|
1380
|
+
ctx[12]
|
|
1110
1381
|
)
|
|
1111
1382
|
);
|
|
1112
1383
|
}
|
|
@@ -1116,7 +1387,7 @@
|
|
|
1116
1387
|
span = element("span");
|
|
1117
1388
|
span.textContent = `${useMCQ_default(
|
|
1118
1389
|
/*index*/
|
|
1119
|
-
ctx[
|
|
1390
|
+
ctx[14]
|
|
1120
1391
|
)}`;
|
|
1121
1392
|
t1 = space();
|
|
1122
1393
|
t2 = text(t2_value);
|
|
@@ -1124,14 +1395,14 @@
|
|
|
1124
1395
|
attr(span, "class", "choice group-active:border-2 group-active:border-blue-1000 group-active:p-[7px]");
|
|
1125
1396
|
attr(button, "aria-label", button_aria_label_value = `${/*selectedOption*/
|
|
1126
1397
|
ctx[1] === /*option*/
|
|
1127
|
-
ctx[
|
|
1398
|
+
ctx[12].id ? "Selected option" : "Option"} ${useMCQ_default(
|
|
1128
1399
|
/*index*/
|
|
1129
|
-
ctx[
|
|
1400
|
+
ctx[14]
|
|
1130
1401
|
)}: ${/*option*/
|
|
1131
|
-
ctx[
|
|
1402
|
+
ctx[12].answer}`);
|
|
1132
1403
|
attr(button, "class", button_class_value = "btn-mcq-option group text-left " + /*selectedOption*/
|
|
1133
1404
|
(ctx[1] === /*option*/
|
|
1134
|
-
ctx[
|
|
1405
|
+
ctx[12].id ? "selected" : ""));
|
|
1135
1406
|
},
|
|
1136
1407
|
m(target, anchor) {
|
|
1137
1408
|
insert(target, button, anchor);
|
|
@@ -1149,17 +1420,17 @@
|
|
|
1149
1420
|
if (dirty & /*selectedOption*/
|
|
1150
1421
|
2 && button_aria_label_value !== (button_aria_label_value = `${/*selectedOption*/
|
|
1151
1422
|
ctx[1] === /*option*/
|
|
1152
|
-
ctx[
|
|
1423
|
+
ctx[12].id ? "Selected option" : "Option"} ${useMCQ_default(
|
|
1153
1424
|
/*index*/
|
|
1154
|
-
ctx[
|
|
1425
|
+
ctx[14]
|
|
1155
1426
|
)}: ${/*option*/
|
|
1156
|
-
ctx[
|
|
1427
|
+
ctx[12].answer}`)) {
|
|
1157
1428
|
attr(button, "aria-label", button_aria_label_value);
|
|
1158
1429
|
}
|
|
1159
1430
|
if (dirty & /*selectedOption*/
|
|
1160
1431
|
2 && button_class_value !== (button_class_value = "btn-mcq-option group text-left " + /*selectedOption*/
|
|
1161
1432
|
(ctx[1] === /*option*/
|
|
1162
|
-
ctx[
|
|
1433
|
+
ctx[12].id ? "selected" : ""))) {
|
|
1163
1434
|
attr(button, "class", button_class_value);
|
|
1164
1435
|
}
|
|
1165
1436
|
},
|
|
@@ -1172,127 +1443,1185 @@
|
|
|
1172
1443
|
}
|
|
1173
1444
|
};
|
|
1174
1445
|
}
|
|
1175
|
-
function
|
|
1176
|
-
let
|
|
1177
|
-
let
|
|
1178
|
-
let html_tag;
|
|
1179
|
-
let raw_value = `<${/*promptRubricHeaderElem*/
|
|
1180
|
-
ctx[5]} class="item-heading font-semibold">${/*prompt*/
|
|
1181
|
-
ctx[3]}</${/*promptRubricHeaderElem*/
|
|
1182
|
-
ctx[5]}>`;
|
|
1183
|
-
let t1;
|
|
1184
|
-
let div0;
|
|
1185
|
-
let t2;
|
|
1186
|
-
let if_block0 = (
|
|
1187
|
-
/*rubric*/
|
|
1188
|
-
ctx[2].text && create_if_block_1(ctx)
|
|
1189
|
-
);
|
|
1190
|
-
let if_block1 = (
|
|
1446
|
+
function create_default_slot(ctx) {
|
|
1447
|
+
let if_block_anchor;
|
|
1448
|
+
let if_block = (
|
|
1191
1449
|
/*options*/
|
|
1192
|
-
ctx[4] &&
|
|
1450
|
+
ctx[4] && create_if_block2(ctx)
|
|
1193
1451
|
);
|
|
1194
1452
|
return {
|
|
1195
1453
|
c() {
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
t0 = space();
|
|
1200
|
-
html_tag = new HtmlTag(false);
|
|
1201
|
-
t1 = space();
|
|
1202
|
-
div0 = element("div");
|
|
1203
|
-
t2 = space();
|
|
1204
|
-
if (if_block1)
|
|
1205
|
-
if_block1.c();
|
|
1206
|
-
html_tag.a = t1;
|
|
1207
|
-
attr(div0, "class", "divider my-6");
|
|
1208
|
-
attr(div1, "class", "bg-transparent");
|
|
1454
|
+
if (if_block)
|
|
1455
|
+
if_block.c();
|
|
1456
|
+
if_block_anchor = empty();
|
|
1209
1457
|
},
|
|
1210
1458
|
m(target, anchor) {
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
append(div1, t0);
|
|
1215
|
-
html_tag.m(raw_value, div1);
|
|
1216
|
-
append(div1, t1);
|
|
1217
|
-
append(div1, div0);
|
|
1218
|
-
append(div1, t2);
|
|
1219
|
-
if (if_block1)
|
|
1220
|
-
if_block1.m(div1, null);
|
|
1459
|
+
if (if_block)
|
|
1460
|
+
if_block.m(target, anchor);
|
|
1461
|
+
insert(target, if_block_anchor, anchor);
|
|
1221
1462
|
},
|
|
1222
|
-
p(ctx2,
|
|
1223
|
-
if (
|
|
1224
|
-
/*rubric*/
|
|
1225
|
-
ctx2[2].text
|
|
1226
|
-
)
|
|
1227
|
-
if_block0.p(ctx2, dirty);
|
|
1463
|
+
p(ctx2, dirty) {
|
|
1228
1464
|
if (
|
|
1229
1465
|
/*options*/
|
|
1230
1466
|
ctx2[4]
|
|
1231
1467
|
)
|
|
1232
|
-
|
|
1468
|
+
if_block.p(ctx2, dirty);
|
|
1233
1469
|
},
|
|
1234
|
-
i: noop,
|
|
1235
|
-
o: noop,
|
|
1236
1470
|
d(detaching) {
|
|
1237
1471
|
if (detaching) {
|
|
1238
|
-
detach(
|
|
1472
|
+
detach(if_block_anchor);
|
|
1239
1473
|
}
|
|
1240
|
-
if (
|
|
1241
|
-
|
|
1242
|
-
if (if_block1)
|
|
1243
|
-
if_block1.d();
|
|
1474
|
+
if (if_block)
|
|
1475
|
+
if_block.d(detaching);
|
|
1244
1476
|
}
|
|
1245
1477
|
};
|
|
1246
1478
|
}
|
|
1247
|
-
function
|
|
1248
|
-
let
|
|
1249
|
-
let
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1479
|
+
function create_fragment2(ctx) {
|
|
1480
|
+
let promptbody;
|
|
1481
|
+
let current;
|
|
1482
|
+
promptbody = new PromptBody_default({
|
|
1483
|
+
props: {
|
|
1484
|
+
rubric: (
|
|
1485
|
+
/*rubric*/
|
|
1486
|
+
ctx[2].text
|
|
1487
|
+
),
|
|
1488
|
+
prompt: (
|
|
1489
|
+
/*prompt*/
|
|
1490
|
+
ctx[3]
|
|
1491
|
+
),
|
|
1492
|
+
$$slots: { default: [create_default_slot] },
|
|
1493
|
+
$$scope: { ctx }
|
|
1494
|
+
}
|
|
1495
|
+
});
|
|
1496
|
+
return {
|
|
1497
|
+
c() {
|
|
1498
|
+
create_component(promptbody.$$.fragment);
|
|
1499
|
+
},
|
|
1500
|
+
m(target, anchor) {
|
|
1501
|
+
mount_component(promptbody, target, anchor);
|
|
1502
|
+
current = true;
|
|
1503
|
+
},
|
|
1504
|
+
p(ctx2, [dirty]) {
|
|
1505
|
+
const promptbody_changes = {};
|
|
1506
|
+
if (dirty & /*$$scope, selectedOption, isDataSaving*/
|
|
1507
|
+
32771) {
|
|
1508
|
+
promptbody_changes.$$scope = { dirty, ctx: ctx2 };
|
|
1509
|
+
}
|
|
1510
|
+
promptbody.$set(promptbody_changes);
|
|
1511
|
+
},
|
|
1512
|
+
i(local) {
|
|
1513
|
+
if (current)
|
|
1514
|
+
return;
|
|
1515
|
+
transition_in(promptbody.$$.fragment, local);
|
|
1516
|
+
current = true;
|
|
1517
|
+
},
|
|
1518
|
+
o(local) {
|
|
1519
|
+
transition_out(promptbody.$$.fragment, local);
|
|
1520
|
+
current = false;
|
|
1521
|
+
},
|
|
1522
|
+
d(detaching) {
|
|
1523
|
+
destroy_component(promptbody, detaching);
|
|
1524
|
+
}
|
|
1525
|
+
};
|
|
1526
|
+
}
|
|
1527
|
+
function instance2($$self, $$props, $$invalidate) {
|
|
1528
|
+
let { sessionData } = $$props;
|
|
1529
|
+
let { isDataSaving } = $$props;
|
|
1530
|
+
const { rubric, interaction, metadata } = sessionData;
|
|
1531
|
+
const { prompt, options } = interaction;
|
|
1532
|
+
let selectedOption;
|
|
1533
|
+
const dispatch = createEventDispatcher();
|
|
1534
|
+
if (metadata) {
|
|
1535
|
+
const { events } = metadata.interactions;
|
|
1536
|
+
const currentOption = events.pop();
|
|
1537
|
+
const { answer_id: answerChoiceId } = currentOption;
|
|
1538
|
+
selectedOption = answerChoiceId[0];
|
|
1539
|
+
}
|
|
1540
|
+
const handleOptionClick = (optionId, option) => {
|
|
1541
|
+
if (isDataSaving || optionId === selectedOption)
|
|
1542
|
+
return;
|
|
1543
|
+
$$invalidate(1, selectedOption = optionId);
|
|
1544
|
+
dispatch("saveOption", {
|
|
1545
|
+
answer_id: [optionId],
|
|
1546
|
+
answer_choice: [option]
|
|
1547
|
+
});
|
|
1548
|
+
};
|
|
1549
|
+
const click_handler = (option) => handleOptionClick(option.id, option.answer);
|
|
1550
|
+
$$self.$$set = ($$props2) => {
|
|
1551
|
+
if ("sessionData" in $$props2)
|
|
1552
|
+
$$invalidate(6, sessionData = $$props2.sessionData);
|
|
1553
|
+
if ("isDataSaving" in $$props2)
|
|
1554
|
+
$$invalidate(0, isDataSaving = $$props2.isDataSaving);
|
|
1555
|
+
};
|
|
1556
|
+
return [
|
|
1557
|
+
isDataSaving,
|
|
1558
|
+
selectedOption,
|
|
1559
|
+
rubric,
|
|
1560
|
+
prompt,
|
|
1561
|
+
options,
|
|
1562
|
+
handleOptionClick,
|
|
1563
|
+
sessionData,
|
|
1564
|
+
click_handler
|
|
1565
|
+
];
|
|
1566
|
+
}
|
|
1567
|
+
var PromptMCQ = class extends SvelteComponent {
|
|
1568
|
+
constructor(options) {
|
|
1569
|
+
super();
|
|
1570
|
+
init(this, options, instance2, create_fragment2, safe_not_equal, { sessionData: 6, isDataSaving: 0 });
|
|
1571
|
+
}
|
|
1572
|
+
get sessionData() {
|
|
1573
|
+
return this.$$.ctx[6];
|
|
1574
|
+
}
|
|
1575
|
+
set sessionData(sessionData) {
|
|
1576
|
+
this.$$set({ sessionData });
|
|
1577
|
+
flush();
|
|
1578
|
+
}
|
|
1579
|
+
get isDataSaving() {
|
|
1580
|
+
return this.$$.ctx[0];
|
|
1581
|
+
}
|
|
1582
|
+
set isDataSaving(isDataSaving) {
|
|
1583
|
+
this.$$set({ isDataSaving });
|
|
1584
|
+
flush();
|
|
1585
|
+
}
|
|
1586
|
+
};
|
|
1587
|
+
customElements.define("prompt-mcq", create_custom_element(PromptMCQ, { "sessionData": {}, "isDataSaving": {} }, [], [], true));
|
|
1588
|
+
var PromptMCQ_default = PromptMCQ;
|
|
1589
|
+
|
|
1590
|
+
// node_modules/autosize/dist/autosize.esm.js
|
|
1591
|
+
var e = /* @__PURE__ */ new Map();
|
|
1592
|
+
function t(t2) {
|
|
1593
|
+
var o2 = e.get(t2);
|
|
1594
|
+
o2 && o2.destroy();
|
|
1595
|
+
}
|
|
1596
|
+
function o(t2) {
|
|
1597
|
+
var o2 = e.get(t2);
|
|
1598
|
+
o2 && o2.update();
|
|
1599
|
+
}
|
|
1600
|
+
var r = null;
|
|
1601
|
+
"undefined" == typeof window ? ((r = function(e2) {
|
|
1602
|
+
return e2;
|
|
1603
|
+
}).destroy = function(e2) {
|
|
1604
|
+
return e2;
|
|
1605
|
+
}, r.update = function(e2) {
|
|
1606
|
+
return e2;
|
|
1607
|
+
}) : ((r = function(t2, o2) {
|
|
1608
|
+
return t2 && Array.prototype.forEach.call(t2.length ? t2 : [t2], function(t3) {
|
|
1609
|
+
return function(t4) {
|
|
1610
|
+
if (t4 && t4.nodeName && "TEXTAREA" === t4.nodeName && !e.has(t4)) {
|
|
1611
|
+
var o3, r2 = null, n2 = window.getComputedStyle(t4), i = (o3 = t4.value, function() {
|
|
1612
|
+
a({ testForHeightReduction: "" === o3 || !t4.value.startsWith(o3), restoreTextAlign: null }), o3 = t4.value;
|
|
1613
|
+
}), l = function(o4) {
|
|
1614
|
+
t4.removeEventListener("autosize:destroy", l), t4.removeEventListener("autosize:update", s), t4.removeEventListener("input", i), window.removeEventListener("resize", s), Object.keys(o4).forEach(function(e2) {
|
|
1615
|
+
return t4.style[e2] = o4[e2];
|
|
1616
|
+
}), e.delete(t4);
|
|
1617
|
+
}.bind(t4, { height: t4.style.height, resize: t4.style.resize, textAlign: t4.style.textAlign, overflowY: t4.style.overflowY, overflowX: t4.style.overflowX, wordWrap: t4.style.wordWrap });
|
|
1618
|
+
t4.addEventListener("autosize:destroy", l), t4.addEventListener("autosize:update", s), t4.addEventListener("input", i), window.addEventListener("resize", s), t4.style.overflowX = "hidden", t4.style.wordWrap = "break-word", e.set(t4, { destroy: l, update: s }), s();
|
|
1619
|
+
}
|
|
1620
|
+
function a(e2) {
|
|
1621
|
+
var o4, i2, l2 = e2.restoreTextAlign, s2 = void 0 === l2 ? null : l2, d = e2.testForHeightReduction, u = void 0 === d || d, c = n2.overflowY;
|
|
1622
|
+
if (0 !== t4.scrollHeight && ("vertical" === n2.resize ? t4.style.resize = "none" : "both" === n2.resize && (t4.style.resize = "horizontal"), u && (o4 = function(e3) {
|
|
1623
|
+
for (var t5 = []; e3 && e3.parentNode && e3.parentNode instanceof Element; )
|
|
1624
|
+
e3.parentNode.scrollTop && t5.push([e3.parentNode, e3.parentNode.scrollTop]), e3 = e3.parentNode;
|
|
1625
|
+
return function() {
|
|
1626
|
+
return t5.forEach(function(e4) {
|
|
1627
|
+
var t6 = e4[0], o5 = e4[1];
|
|
1628
|
+
t6.style.scrollBehavior = "auto", t6.scrollTop = o5, t6.style.scrollBehavior = null;
|
|
1629
|
+
});
|
|
1630
|
+
};
|
|
1631
|
+
}(t4), t4.style.height = ""), i2 = "content-box" === n2.boxSizing ? t4.scrollHeight - (parseFloat(n2.paddingTop) + parseFloat(n2.paddingBottom)) : t4.scrollHeight + parseFloat(n2.borderTopWidth) + parseFloat(n2.borderBottomWidth), "none" !== n2.maxHeight && i2 > parseFloat(n2.maxHeight) ? ("hidden" === n2.overflowY && (t4.style.overflow = "scroll"), i2 = parseFloat(n2.maxHeight)) : "hidden" !== n2.overflowY && (t4.style.overflow = "hidden"), t4.style.height = i2 + "px", s2 && (t4.style.textAlign = s2), o4 && o4(), r2 !== i2 && (t4.dispatchEvent(new Event("autosize:resized", { bubbles: true })), r2 = i2), c !== n2.overflow && !s2)) {
|
|
1632
|
+
var v = n2.textAlign;
|
|
1633
|
+
"hidden" === n2.overflow && (t4.style.textAlign = "start" === v ? "end" : "start"), a({ restoreTextAlign: v, testForHeightReduction: true });
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
function s() {
|
|
1637
|
+
a({ testForHeightReduction: true, restoreTextAlign: null });
|
|
1638
|
+
}
|
|
1639
|
+
}(t3);
|
|
1640
|
+
}), t2;
|
|
1641
|
+
}).destroy = function(e2) {
|
|
1642
|
+
return e2 && Array.prototype.forEach.call(e2.length ? e2 : [e2], t), e2;
|
|
1643
|
+
}, r.update = function(e2) {
|
|
1644
|
+
return e2 && Array.prototype.forEach.call(e2.length ? e2 : [e2], o), e2;
|
|
1645
|
+
});
|
|
1646
|
+
var n = r;
|
|
1647
|
+
var autosize_esm_default = n;
|
|
1648
|
+
|
|
1649
|
+
// node_modules/svelte-autosize/index.js
|
|
1650
|
+
var action = (node) => {
|
|
1651
|
+
autosize_esm_default(node);
|
|
1652
|
+
return {
|
|
1653
|
+
destroy() {
|
|
1654
|
+
autosize_esm_default.destroy(node);
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
};
|
|
1658
|
+
action.update = autosize_esm_default.update;
|
|
1659
|
+
action.destroy = autosize_esm_default.destroy;
|
|
1660
|
+
var svelte_autosize_default = action;
|
|
1661
|
+
|
|
1662
|
+
// src/lib/assets/img/messaging/SuccessSolid.svelte
|
|
1663
|
+
function create_fragment3(ctx) {
|
|
1664
|
+
let svg;
|
|
1665
|
+
let path;
|
|
1666
|
+
return {
|
|
1667
|
+
c() {
|
|
1668
|
+
svg = svg_element("svg");
|
|
1669
|
+
path = svg_element("path");
|
|
1670
|
+
attr(path, "fill-rule", "evenodd");
|
|
1671
|
+
attr(path, "clip-rule", "evenodd");
|
|
1672
|
+
attr(path, "d", "M10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0ZM14.7284 6.79289C14.3378 6.40237 13.7047 6.40237 13.3141 6.79289L8.02125 12.0858L6.20711 10.2716C5.81658 9.88112 5.18342 9.88112 4.79289 10.2716C4.40237 10.6622 4.40237 11.2953 4.79289 11.6859L7.31414 14.2071C7.70467 14.5976 8.33783 14.5976 8.72836 14.2071L14.7284 8.20711C15.1189 7.81658 15.1189 7.18342 14.7284 6.79289Z");
|
|
1673
|
+
attr(path, "fill", "currentColor");
|
|
1674
|
+
attr(svg, "width", "20");
|
|
1675
|
+
attr(svg, "height", "20");
|
|
1676
|
+
attr(svg, "viewBox", "0 0 20 20");
|
|
1677
|
+
attr(svg, "fill", "none");
|
|
1678
|
+
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
|
1679
|
+
},
|
|
1680
|
+
m(target, anchor) {
|
|
1681
|
+
insert(target, svg, anchor);
|
|
1682
|
+
append(svg, path);
|
|
1683
|
+
},
|
|
1684
|
+
p: noop,
|
|
1685
|
+
i: noop,
|
|
1686
|
+
o: noop,
|
|
1687
|
+
d(detaching) {
|
|
1688
|
+
if (detaching) {
|
|
1689
|
+
detach(svg);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
};
|
|
1693
|
+
}
|
|
1694
|
+
var SuccessSolid = class extends SvelteComponent {
|
|
1695
|
+
constructor(options) {
|
|
1696
|
+
super();
|
|
1697
|
+
init(this, options, null, create_fragment3, safe_not_equal, {});
|
|
1698
|
+
}
|
|
1699
|
+
};
|
|
1700
|
+
create_custom_element(SuccessSolid, {}, [], [], true);
|
|
1701
|
+
var SuccessSolid_default = SuccessSolid;
|
|
1702
|
+
|
|
1703
|
+
// src/lib/assets/img/messaging/ErrorSolid.svelte
|
|
1704
|
+
function create_fragment4(ctx) {
|
|
1705
|
+
let svg;
|
|
1706
|
+
let path;
|
|
1707
|
+
return {
|
|
1708
|
+
c() {
|
|
1709
|
+
svg = svg_element("svg");
|
|
1710
|
+
path = svg_element("path");
|
|
1711
|
+
attr(path, "fill-rule", "evenodd");
|
|
1712
|
+
attr(path, "clip-rule", "evenodd");
|
|
1713
|
+
attr(path, "d", "M10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0ZM7.70711 6.29289C7.31658 5.90237 6.68342 5.90237 6.29289 6.29289C5.90237 6.68342 5.90237 7.31658 6.29289 7.70711L8.585 10L6.29289 12.2929C5.93241 12.6534 5.90468 13.2206 6.2097 13.6129L6.29289 13.7071C6.68342 14.0976 7.31658 14.0976 7.70711 13.7071L10 11.415L12.2929 13.7071C12.6534 14.0676 13.2206 14.0953 13.6129 13.7903L13.7071 13.7071C14.0976 13.3166 14.0976 12.6834 13.7071 12.2929L11.415 10L13.7071 7.70711C14.0676 7.34662 14.0953 6.77939 13.7903 6.3871L13.7071 6.29289C13.3166 5.90237 12.6834 5.90237 12.2929 6.29289L10 8.585L7.70711 6.29289Z");
|
|
1714
|
+
attr(path, "fill", "currentColor");
|
|
1715
|
+
attr(svg, "width", "20");
|
|
1716
|
+
attr(svg, "height", "20");
|
|
1717
|
+
attr(svg, "viewBox", "0 0 20 20");
|
|
1718
|
+
attr(svg, "fill", "none");
|
|
1719
|
+
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
|
1720
|
+
},
|
|
1721
|
+
m(target, anchor) {
|
|
1722
|
+
insert(target, svg, anchor);
|
|
1723
|
+
append(svg, path);
|
|
1724
|
+
},
|
|
1725
|
+
p: noop,
|
|
1726
|
+
i: noop,
|
|
1727
|
+
o: noop,
|
|
1728
|
+
d(detaching) {
|
|
1729
|
+
if (detaching) {
|
|
1730
|
+
detach(svg);
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
};
|
|
1734
|
+
}
|
|
1735
|
+
var ErrorSolid = class extends SvelteComponent {
|
|
1736
|
+
constructor(options) {
|
|
1737
|
+
super();
|
|
1738
|
+
init(this, options, null, create_fragment4, safe_not_equal, {});
|
|
1739
|
+
}
|
|
1740
|
+
};
|
|
1741
|
+
create_custom_element(ErrorSolid, {}, [], [], true);
|
|
1742
|
+
var ErrorSolid_default = ErrorSolid;
|
|
1743
|
+
|
|
1744
|
+
// src/lib/assets/img/messaging/InfoSolid.svelte
|
|
1745
|
+
function create_fragment5(ctx) {
|
|
1746
|
+
let svg;
|
|
1747
|
+
let path;
|
|
1748
|
+
return {
|
|
1749
|
+
c() {
|
|
1750
|
+
svg = svg_element("svg");
|
|
1751
|
+
path = svg_element("path");
|
|
1752
|
+
attr(path, "fill-rule", "evenodd");
|
|
1753
|
+
attr(path, "clip-rule", "evenodd");
|
|
1754
|
+
attr(path, "d", "M10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0ZM10 9C9.44772 9 9 9.44772 9 10V14.5C9 15.0523 9.44772 15.5 10 15.5C10.5523 15.5 11 15.0523 11 14.5V10C11 9.44772 10.5523 9 10 9ZM10 5C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7C10.5523 7 11 6.55228 11 6C11 5.44772 10.5523 5 10 5Z");
|
|
1755
|
+
attr(path, "fill", "currentColor");
|
|
1756
|
+
attr(svg, "width", "20");
|
|
1757
|
+
attr(svg, "height", "20");
|
|
1758
|
+
attr(svg, "viewBox", "0 0 20 20");
|
|
1759
|
+
attr(svg, "fill", "none");
|
|
1760
|
+
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
|
1761
|
+
},
|
|
1762
|
+
m(target, anchor) {
|
|
1763
|
+
insert(target, svg, anchor);
|
|
1764
|
+
append(svg, path);
|
|
1765
|
+
},
|
|
1766
|
+
p: noop,
|
|
1767
|
+
i: noop,
|
|
1768
|
+
o: noop,
|
|
1769
|
+
d(detaching) {
|
|
1770
|
+
if (detaching) {
|
|
1771
|
+
detach(svg);
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
};
|
|
1775
|
+
}
|
|
1776
|
+
var InfoSolid = class extends SvelteComponent {
|
|
1777
|
+
constructor(options) {
|
|
1778
|
+
super();
|
|
1779
|
+
init(this, options, null, create_fragment5, safe_not_equal, {});
|
|
1780
|
+
}
|
|
1781
|
+
};
|
|
1782
|
+
create_custom_element(InfoSolid, {}, [], [], true);
|
|
1783
|
+
var InfoSolid_default = InfoSolid;
|
|
1784
|
+
|
|
1785
|
+
// src/lib/components/prompt/template/PromptResult.svelte
|
|
1786
|
+
function create_else_block_1(ctx) {
|
|
1787
|
+
let errorsolid;
|
|
1788
|
+
let current;
|
|
1789
|
+
errorsolid = new ErrorSolid_default({});
|
|
1790
|
+
return {
|
|
1791
|
+
c() {
|
|
1792
|
+
create_component(errorsolid.$$.fragment);
|
|
1793
|
+
},
|
|
1794
|
+
m(target, anchor) {
|
|
1795
|
+
mount_component(errorsolid, target, anchor);
|
|
1796
|
+
current = true;
|
|
1797
|
+
},
|
|
1798
|
+
i(local) {
|
|
1799
|
+
if (current)
|
|
1800
|
+
return;
|
|
1801
|
+
transition_in(errorsolid.$$.fragment, local);
|
|
1802
|
+
current = true;
|
|
1803
|
+
},
|
|
1804
|
+
o(local) {
|
|
1805
|
+
transition_out(errorsolid.$$.fragment, local);
|
|
1806
|
+
current = false;
|
|
1807
|
+
},
|
|
1808
|
+
d(detaching) {
|
|
1809
|
+
destroy_component(errorsolid, detaching);
|
|
1810
|
+
}
|
|
1811
|
+
};
|
|
1812
|
+
}
|
|
1813
|
+
function create_if_block_2(ctx) {
|
|
1814
|
+
let successsolid;
|
|
1815
|
+
let current;
|
|
1816
|
+
successsolid = new SuccessSolid_default({});
|
|
1817
|
+
return {
|
|
1818
|
+
c() {
|
|
1819
|
+
create_component(successsolid.$$.fragment);
|
|
1820
|
+
},
|
|
1821
|
+
m(target, anchor) {
|
|
1822
|
+
mount_component(successsolid, target, anchor);
|
|
1823
|
+
current = true;
|
|
1824
|
+
},
|
|
1825
|
+
i(local) {
|
|
1826
|
+
if (current)
|
|
1827
|
+
return;
|
|
1828
|
+
transition_in(successsolid.$$.fragment, local);
|
|
1829
|
+
current = true;
|
|
1830
|
+
},
|
|
1831
|
+
o(local) {
|
|
1832
|
+
transition_out(successsolid.$$.fragment, local);
|
|
1833
|
+
current = false;
|
|
1834
|
+
},
|
|
1835
|
+
d(detaching) {
|
|
1836
|
+
destroy_component(successsolid, detaching);
|
|
1837
|
+
}
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1840
|
+
function create_if_block3(ctx) {
|
|
1841
|
+
let div0;
|
|
1842
|
+
let span0;
|
|
1843
|
+
let current_block_type_index;
|
|
1844
|
+
let if_block;
|
|
1845
|
+
let span0_class_value;
|
|
1846
|
+
let t0;
|
|
1847
|
+
let span3;
|
|
1848
|
+
let span1;
|
|
1849
|
+
let t1;
|
|
1850
|
+
let t2;
|
|
1851
|
+
let span2;
|
|
1852
|
+
let t3;
|
|
1853
|
+
let div0_class_value;
|
|
1854
|
+
let t4;
|
|
1855
|
+
let div1;
|
|
1856
|
+
let current;
|
|
1857
|
+
const if_block_creators = [create_if_block_12, create_else_block];
|
|
1858
|
+
const if_blocks = [];
|
|
1859
|
+
function select_block_type_1(ctx2, dirty) {
|
|
1860
|
+
if (
|
|
1861
|
+
/*isResultCorrect*/
|
|
1862
|
+
ctx2[2]
|
|
1863
|
+
)
|
|
1864
|
+
return 0;
|
|
1865
|
+
return 1;
|
|
1866
|
+
}
|
|
1867
|
+
current_block_type_index = select_block_type_1(ctx, -1);
|
|
1868
|
+
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
|
1869
|
+
return {
|
|
1870
|
+
c() {
|
|
1871
|
+
div0 = element("div");
|
|
1872
|
+
span0 = element("span");
|
|
1873
|
+
if_block.c();
|
|
1874
|
+
t0 = space();
|
|
1875
|
+
span3 = element("span");
|
|
1876
|
+
span1 = element("span");
|
|
1877
|
+
t1 = text(
|
|
1878
|
+
/*feedbackTitle*/
|
|
1879
|
+
ctx[3]
|
|
1880
|
+
);
|
|
1881
|
+
t2 = space();
|
|
1882
|
+
span2 = element("span");
|
|
1883
|
+
t3 = text(
|
|
1884
|
+
/*resultFeedback*/
|
|
1885
|
+
ctx[1]
|
|
1886
|
+
);
|
|
1887
|
+
t4 = space();
|
|
1888
|
+
div1 = element("div");
|
|
1889
|
+
attr(span0, "class", span0_class_value = `${/*spanIconClass*/
|
|
1890
|
+
ctx[5]} mr-2 p-0.5`);
|
|
1891
|
+
attr(span1, "class", "block mb-1 font-semibold");
|
|
1892
|
+
attr(span3, "class", "text-base");
|
|
1893
|
+
attr(div0, "class", div0_class_value = `${/*mainDivClass*/
|
|
1894
|
+
ctx[4]} flex items-start my-6 p-4 border-l-[6px] text-charcoal`);
|
|
1895
|
+
attr(div1, "class", "divider my-6");
|
|
1896
|
+
},
|
|
1897
|
+
m(target, anchor) {
|
|
1898
|
+
insert(target, div0, anchor);
|
|
1899
|
+
append(div0, span0);
|
|
1900
|
+
if_blocks[current_block_type_index].m(span0, null);
|
|
1901
|
+
append(div0, t0);
|
|
1902
|
+
append(div0, span3);
|
|
1903
|
+
append(span3, span1);
|
|
1904
|
+
append(span1, t1);
|
|
1905
|
+
append(span3, t2);
|
|
1906
|
+
append(span3, span2);
|
|
1907
|
+
append(span2, t3);
|
|
1908
|
+
insert(target, t4, anchor);
|
|
1909
|
+
insert(target, div1, anchor);
|
|
1910
|
+
current = true;
|
|
1911
|
+
},
|
|
1912
|
+
p(ctx2, dirty) {
|
|
1913
|
+
let previous_block_index = current_block_type_index;
|
|
1914
|
+
current_block_type_index = select_block_type_1(ctx2, dirty);
|
|
1915
|
+
if (current_block_type_index !== previous_block_index) {
|
|
1916
|
+
group_outros();
|
|
1917
|
+
transition_out(if_blocks[previous_block_index], 1, 1, () => {
|
|
1918
|
+
if_blocks[previous_block_index] = null;
|
|
1919
|
+
});
|
|
1920
|
+
check_outros();
|
|
1921
|
+
if_block = if_blocks[current_block_type_index];
|
|
1922
|
+
if (!if_block) {
|
|
1923
|
+
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2);
|
|
1924
|
+
if_block.c();
|
|
1925
|
+
} else {
|
|
1926
|
+
}
|
|
1927
|
+
transition_in(if_block, 1);
|
|
1928
|
+
if_block.m(span0, null);
|
|
1929
|
+
}
|
|
1930
|
+
if (!current || dirty & /*spanIconClass*/
|
|
1931
|
+
32 && span0_class_value !== (span0_class_value = `${/*spanIconClass*/
|
|
1932
|
+
ctx2[5]} mr-2 p-0.5`)) {
|
|
1933
|
+
attr(span0, "class", span0_class_value);
|
|
1934
|
+
}
|
|
1935
|
+
if (!current || dirty & /*feedbackTitle*/
|
|
1936
|
+
8)
|
|
1937
|
+
set_data(
|
|
1938
|
+
t1,
|
|
1939
|
+
/*feedbackTitle*/
|
|
1940
|
+
ctx2[3]
|
|
1941
|
+
);
|
|
1942
|
+
if (!current || dirty & /*resultFeedback*/
|
|
1943
|
+
2)
|
|
1944
|
+
set_data(
|
|
1945
|
+
t3,
|
|
1946
|
+
/*resultFeedback*/
|
|
1947
|
+
ctx2[1]
|
|
1948
|
+
);
|
|
1949
|
+
if (!current || dirty & /*mainDivClass*/
|
|
1950
|
+
16 && div0_class_value !== (div0_class_value = `${/*mainDivClass*/
|
|
1951
|
+
ctx2[4]} flex items-start my-6 p-4 border-l-[6px] text-charcoal`)) {
|
|
1952
|
+
attr(div0, "class", div0_class_value);
|
|
1953
|
+
}
|
|
1954
|
+
},
|
|
1955
|
+
i(local) {
|
|
1956
|
+
if (current)
|
|
1957
|
+
return;
|
|
1958
|
+
transition_in(if_block);
|
|
1959
|
+
current = true;
|
|
1960
|
+
},
|
|
1961
|
+
o(local) {
|
|
1962
|
+
transition_out(if_block);
|
|
1963
|
+
current = false;
|
|
1964
|
+
},
|
|
1965
|
+
d(detaching) {
|
|
1966
|
+
if (detaching) {
|
|
1967
|
+
detach(div0);
|
|
1968
|
+
detach(t4);
|
|
1969
|
+
detach(div1);
|
|
1970
|
+
}
|
|
1971
|
+
if_blocks[current_block_type_index].d();
|
|
1972
|
+
}
|
|
1973
|
+
};
|
|
1974
|
+
}
|
|
1975
|
+
function create_else_block(ctx) {
|
|
1976
|
+
let infosolid;
|
|
1977
|
+
let current;
|
|
1978
|
+
infosolid = new InfoSolid_default({});
|
|
1979
|
+
return {
|
|
1980
|
+
c() {
|
|
1981
|
+
create_component(infosolid.$$.fragment);
|
|
1982
|
+
},
|
|
1983
|
+
m(target, anchor) {
|
|
1984
|
+
mount_component(infosolid, target, anchor);
|
|
1985
|
+
current = true;
|
|
1986
|
+
},
|
|
1987
|
+
i(local) {
|
|
1988
|
+
if (current)
|
|
1989
|
+
return;
|
|
1990
|
+
transition_in(infosolid.$$.fragment, local);
|
|
1991
|
+
current = true;
|
|
1992
|
+
},
|
|
1993
|
+
o(local) {
|
|
1994
|
+
transition_out(infosolid.$$.fragment, local);
|
|
1995
|
+
current = false;
|
|
1996
|
+
},
|
|
1997
|
+
d(detaching) {
|
|
1998
|
+
destroy_component(infosolid, detaching);
|
|
1999
|
+
}
|
|
2000
|
+
};
|
|
2001
|
+
}
|
|
2002
|
+
function create_if_block_12(ctx) {
|
|
2003
|
+
let successsolid;
|
|
2004
|
+
let current;
|
|
2005
|
+
successsolid = new SuccessSolid_default({});
|
|
2006
|
+
return {
|
|
2007
|
+
c() {
|
|
2008
|
+
create_component(successsolid.$$.fragment);
|
|
2009
|
+
},
|
|
2010
|
+
m(target, anchor) {
|
|
2011
|
+
mount_component(successsolid, target, anchor);
|
|
2012
|
+
current = true;
|
|
2013
|
+
},
|
|
2014
|
+
i(local) {
|
|
2015
|
+
if (current)
|
|
2016
|
+
return;
|
|
2017
|
+
transition_in(successsolid.$$.fragment, local);
|
|
2018
|
+
current = true;
|
|
2019
|
+
},
|
|
2020
|
+
o(local) {
|
|
2021
|
+
transition_out(successsolid.$$.fragment, local);
|
|
2022
|
+
current = false;
|
|
2023
|
+
},
|
|
2024
|
+
d(detaching) {
|
|
2025
|
+
destroy_component(successsolid, detaching);
|
|
2026
|
+
}
|
|
2027
|
+
};
|
|
2028
|
+
}
|
|
2029
|
+
function create_fragment6(ctx) {
|
|
2030
|
+
let div;
|
|
2031
|
+
let span0;
|
|
2032
|
+
let current_block_type_index;
|
|
2033
|
+
let if_block0;
|
|
2034
|
+
let span0_class_value;
|
|
2035
|
+
let t0;
|
|
2036
|
+
let span1;
|
|
2037
|
+
let t1;
|
|
2038
|
+
let t2;
|
|
2039
|
+
let if_block1_anchor;
|
|
2040
|
+
let current;
|
|
2041
|
+
const if_block_creators = [create_if_block_2, create_else_block_1];
|
|
2042
|
+
const if_blocks = [];
|
|
2043
|
+
function select_block_type(ctx2, dirty) {
|
|
2044
|
+
if (
|
|
2045
|
+
/*isResultCorrect*/
|
|
2046
|
+
ctx2[2]
|
|
2047
|
+
)
|
|
2048
|
+
return 0;
|
|
2049
|
+
return 1;
|
|
2050
|
+
}
|
|
2051
|
+
current_block_type_index = select_block_type(ctx, -1);
|
|
2052
|
+
if_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
|
2053
|
+
let if_block1 = (
|
|
2054
|
+
/*resultFeedback*/
|
|
2055
|
+
ctx[1] && create_if_block3(ctx)
|
|
2056
|
+
);
|
|
2057
|
+
return {
|
|
2058
|
+
c() {
|
|
2059
|
+
div = element("div");
|
|
2060
|
+
span0 = element("span");
|
|
2061
|
+
if_block0.c();
|
|
2062
|
+
t0 = space();
|
|
2063
|
+
span1 = element("span");
|
|
2064
|
+
t1 = text(
|
|
2065
|
+
/*resultMessage*/
|
|
2066
|
+
ctx[0]
|
|
2067
|
+
);
|
|
2068
|
+
t2 = space();
|
|
2069
|
+
if (if_block1)
|
|
2070
|
+
if_block1.c();
|
|
2071
|
+
if_block1_anchor = empty();
|
|
2072
|
+
attr(span0, "class", span0_class_value = `${/*spanIconClass*/
|
|
2073
|
+
ctx[5]} mr-2 p-0.5`);
|
|
2074
|
+
attr(span1, "class", "p2");
|
|
2075
|
+
attr(div, "class", "flex items-center mt-2 text-charcoal");
|
|
2076
|
+
},
|
|
2077
|
+
m(target, anchor) {
|
|
2078
|
+
insert(target, div, anchor);
|
|
2079
|
+
append(div, span0);
|
|
2080
|
+
if_blocks[current_block_type_index].m(span0, null);
|
|
2081
|
+
append(div, t0);
|
|
2082
|
+
append(div, span1);
|
|
2083
|
+
append(span1, t1);
|
|
2084
|
+
insert(target, t2, anchor);
|
|
2085
|
+
if (if_block1)
|
|
2086
|
+
if_block1.m(target, anchor);
|
|
2087
|
+
insert(target, if_block1_anchor, anchor);
|
|
2088
|
+
current = true;
|
|
2089
|
+
},
|
|
2090
|
+
p(ctx2, [dirty]) {
|
|
2091
|
+
let previous_block_index = current_block_type_index;
|
|
2092
|
+
current_block_type_index = select_block_type(ctx2, dirty);
|
|
2093
|
+
if (current_block_type_index !== previous_block_index) {
|
|
2094
|
+
group_outros();
|
|
2095
|
+
transition_out(if_blocks[previous_block_index], 1, 1, () => {
|
|
2096
|
+
if_blocks[previous_block_index] = null;
|
|
2097
|
+
});
|
|
2098
|
+
check_outros();
|
|
2099
|
+
if_block0 = if_blocks[current_block_type_index];
|
|
2100
|
+
if (!if_block0) {
|
|
2101
|
+
if_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2);
|
|
2102
|
+
if_block0.c();
|
|
2103
|
+
} else {
|
|
2104
|
+
}
|
|
2105
|
+
transition_in(if_block0, 1);
|
|
2106
|
+
if_block0.m(span0, null);
|
|
2107
|
+
}
|
|
2108
|
+
if (!current || dirty & /*spanIconClass*/
|
|
2109
|
+
32 && span0_class_value !== (span0_class_value = `${/*spanIconClass*/
|
|
2110
|
+
ctx2[5]} mr-2 p-0.5`)) {
|
|
2111
|
+
attr(span0, "class", span0_class_value);
|
|
2112
|
+
}
|
|
2113
|
+
if (!current || dirty & /*resultMessage*/
|
|
2114
|
+
1)
|
|
2115
|
+
set_data(
|
|
2116
|
+
t1,
|
|
2117
|
+
/*resultMessage*/
|
|
2118
|
+
ctx2[0]
|
|
2119
|
+
);
|
|
2120
|
+
if (
|
|
2121
|
+
/*resultFeedback*/
|
|
2122
|
+
ctx2[1]
|
|
2123
|
+
) {
|
|
2124
|
+
if (if_block1) {
|
|
2125
|
+
if_block1.p(ctx2, dirty);
|
|
2126
|
+
if (dirty & /*resultFeedback*/
|
|
2127
|
+
2) {
|
|
2128
|
+
transition_in(if_block1, 1);
|
|
2129
|
+
}
|
|
2130
|
+
} else {
|
|
2131
|
+
if_block1 = create_if_block3(ctx2);
|
|
2132
|
+
if_block1.c();
|
|
2133
|
+
transition_in(if_block1, 1);
|
|
2134
|
+
if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
|
|
2135
|
+
}
|
|
2136
|
+
} else if (if_block1) {
|
|
2137
|
+
group_outros();
|
|
2138
|
+
transition_out(if_block1, 1, 1, () => {
|
|
2139
|
+
if_block1 = null;
|
|
2140
|
+
});
|
|
2141
|
+
check_outros();
|
|
2142
|
+
}
|
|
2143
|
+
},
|
|
2144
|
+
i(local) {
|
|
2145
|
+
if (current)
|
|
2146
|
+
return;
|
|
2147
|
+
transition_in(if_block0);
|
|
2148
|
+
transition_in(if_block1);
|
|
2149
|
+
current = true;
|
|
2150
|
+
},
|
|
2151
|
+
o(local) {
|
|
2152
|
+
transition_out(if_block0);
|
|
2153
|
+
transition_out(if_block1);
|
|
2154
|
+
current = false;
|
|
2155
|
+
},
|
|
2156
|
+
d(detaching) {
|
|
2157
|
+
if (detaching) {
|
|
2158
|
+
detach(div);
|
|
2159
|
+
detach(t2);
|
|
2160
|
+
detach(if_block1_anchor);
|
|
2161
|
+
}
|
|
2162
|
+
if_blocks[current_block_type_index].d();
|
|
2163
|
+
if (if_block1)
|
|
2164
|
+
if_block1.d(detaching);
|
|
2165
|
+
}
|
|
2166
|
+
};
|
|
2167
|
+
}
|
|
2168
|
+
function instance3($$self, $$props, $$invalidate) {
|
|
2169
|
+
let { resultMessage = "" } = $$props;
|
|
2170
|
+
let { resultFeedback = null } = $$props;
|
|
2171
|
+
let { isResultCorrect: isResultCorrect2 = true } = $$props;
|
|
2172
|
+
let feedbackTitle = "Well done!";
|
|
2173
|
+
let mainDivClass = "border-green-800 bg-green-300";
|
|
2174
|
+
let spanIconClass = "text-green-800";
|
|
2175
|
+
if (!isResultCorrect2) {
|
|
2176
|
+
feedbackTitle = "Not quite, but you\u2019re close!";
|
|
2177
|
+
mainDivClass = "border-red-800 bg-red-300";
|
|
2178
|
+
spanIconClass = "text-red-800";
|
|
2179
|
+
}
|
|
2180
|
+
$$self.$$set = ($$props2) => {
|
|
2181
|
+
if ("resultMessage" in $$props2)
|
|
2182
|
+
$$invalidate(0, resultMessage = $$props2.resultMessage);
|
|
2183
|
+
if ("resultFeedback" in $$props2)
|
|
2184
|
+
$$invalidate(1, resultFeedback = $$props2.resultFeedback);
|
|
2185
|
+
if ("isResultCorrect" in $$props2)
|
|
2186
|
+
$$invalidate(2, isResultCorrect2 = $$props2.isResultCorrect);
|
|
2187
|
+
};
|
|
2188
|
+
return [
|
|
2189
|
+
resultMessage,
|
|
2190
|
+
resultFeedback,
|
|
2191
|
+
isResultCorrect2,
|
|
2192
|
+
feedbackTitle,
|
|
2193
|
+
mainDivClass,
|
|
2194
|
+
spanIconClass
|
|
2195
|
+
];
|
|
2196
|
+
}
|
|
2197
|
+
var PromptResult = class extends SvelteComponent {
|
|
2198
|
+
constructor(options) {
|
|
2199
|
+
super();
|
|
2200
|
+
init(this, options, instance3, create_fragment6, safe_not_equal, {
|
|
2201
|
+
resultMessage: 0,
|
|
2202
|
+
resultFeedback: 1,
|
|
2203
|
+
isResultCorrect: 2
|
|
2204
|
+
});
|
|
2205
|
+
}
|
|
2206
|
+
get resultMessage() {
|
|
2207
|
+
return this.$$.ctx[0];
|
|
2208
|
+
}
|
|
2209
|
+
set resultMessage(resultMessage) {
|
|
2210
|
+
this.$$set({ resultMessage });
|
|
2211
|
+
flush();
|
|
2212
|
+
}
|
|
2213
|
+
get resultFeedback() {
|
|
2214
|
+
return this.$$.ctx[1];
|
|
2215
|
+
}
|
|
2216
|
+
set resultFeedback(resultFeedback) {
|
|
2217
|
+
this.$$set({ resultFeedback });
|
|
2218
|
+
flush();
|
|
2219
|
+
}
|
|
2220
|
+
get isResultCorrect() {
|
|
2221
|
+
return this.$$.ctx[2];
|
|
2222
|
+
}
|
|
2223
|
+
set isResultCorrect(isResultCorrect2) {
|
|
2224
|
+
this.$$set({ isResultCorrect: isResultCorrect2 });
|
|
2225
|
+
flush();
|
|
2226
|
+
}
|
|
2227
|
+
};
|
|
2228
|
+
customElements.define("prompt-result", create_custom_element(PromptResult, { "resultMessage": {}, "resultFeedback": {}, "isResultCorrect": { "type": "Boolean" } }, [], [], true));
|
|
2229
|
+
var PromptResult_default = PromptResult;
|
|
2230
|
+
|
|
2231
|
+
// src/lib/components/prompt/typein/PromptTypeIn.svelte
|
|
2232
|
+
function create_else_block2(ctx) {
|
|
2233
|
+
let textarea;
|
|
2234
|
+
let textarea_class_value;
|
|
2235
|
+
let autosize_action;
|
|
2236
|
+
let mounted;
|
|
2237
|
+
let dispose;
|
|
2238
|
+
return {
|
|
2239
|
+
c() {
|
|
2240
|
+
textarea = element("textarea");
|
|
2241
|
+
attr(textarea, "id", idLabel);
|
|
2242
|
+
attr(textarea, "placeholder", placeholder);
|
|
2243
|
+
attr(textarea, "rows", "3");
|
|
2244
|
+
attr(textarea, "class", textarea_class_value = `${/*inputBorderClass*/
|
|
2245
|
+
ctx[2]} typein-textbox overflow-hidden`);
|
|
2246
|
+
textarea.disabled = /*isDataSaving*/
|
|
2247
|
+
ctx[0];
|
|
2248
|
+
attr(textarea, "autocomplete", "off");
|
|
2249
|
+
},
|
|
2250
|
+
m(target, anchor) {
|
|
2251
|
+
insert(target, textarea, anchor);
|
|
2252
|
+
set_input_value(
|
|
2253
|
+
textarea,
|
|
2254
|
+
/*typeinAnswer*/
|
|
2255
|
+
ctx[1]
|
|
2256
|
+
);
|
|
2257
|
+
if (!mounted) {
|
|
2258
|
+
dispose = [
|
|
2259
|
+
listen(
|
|
2260
|
+
textarea,
|
|
2261
|
+
"input",
|
|
2262
|
+
/*textarea_input_handler*/
|
|
2263
|
+
ctx[14]
|
|
2264
|
+
),
|
|
2265
|
+
listen(
|
|
2266
|
+
textarea,
|
|
2267
|
+
"mousedown",
|
|
2268
|
+
/*mousedown_handler*/
|
|
2269
|
+
ctx[15]
|
|
2270
|
+
),
|
|
2271
|
+
listen(
|
|
2272
|
+
textarea,
|
|
2273
|
+
"touchstart",
|
|
2274
|
+
/*touchstart_handler*/
|
|
2275
|
+
ctx[16],
|
|
2276
|
+
{ passive: true }
|
|
2277
|
+
),
|
|
2278
|
+
listen(
|
|
2279
|
+
textarea,
|
|
2280
|
+
"focus",
|
|
2281
|
+
/*focus_handler*/
|
|
2282
|
+
ctx[17]
|
|
2283
|
+
),
|
|
2284
|
+
listen(
|
|
2285
|
+
textarea,
|
|
2286
|
+
"focusout",
|
|
2287
|
+
/*focusout_handler_1*/
|
|
2288
|
+
ctx[18]
|
|
2289
|
+
),
|
|
2290
|
+
listen(
|
|
2291
|
+
textarea,
|
|
2292
|
+
"keydown",
|
|
2293
|
+
/*keydown_handler_1*/
|
|
2294
|
+
ctx[19]
|
|
2295
|
+
),
|
|
2296
|
+
action_destroyer(autosize_action = svelte_autosize_default.call(null, textarea))
|
|
2297
|
+
];
|
|
2298
|
+
mounted = true;
|
|
2299
|
+
}
|
|
2300
|
+
},
|
|
2301
|
+
p(ctx2, dirty) {
|
|
2302
|
+
if (dirty & /*isDataSaving*/
|
|
2303
|
+
1) {
|
|
2304
|
+
textarea.disabled = /*isDataSaving*/
|
|
2305
|
+
ctx2[0];
|
|
2306
|
+
}
|
|
2307
|
+
if (dirty & /*typeinAnswer*/
|
|
2308
|
+
2) {
|
|
2309
|
+
set_input_value(
|
|
2310
|
+
textarea,
|
|
2311
|
+
/*typeinAnswer*/
|
|
2312
|
+
ctx2[1]
|
|
2313
|
+
);
|
|
2314
|
+
}
|
|
2315
|
+
},
|
|
2316
|
+
d(detaching) {
|
|
2317
|
+
if (detaching) {
|
|
2318
|
+
detach(textarea);
|
|
2319
|
+
}
|
|
2320
|
+
mounted = false;
|
|
2321
|
+
run_all(dispose);
|
|
2322
|
+
}
|
|
2323
|
+
};
|
|
2324
|
+
}
|
|
2325
|
+
function create_if_block_13(ctx) {
|
|
2326
|
+
let input;
|
|
2327
|
+
let input_class_value;
|
|
2328
|
+
let mounted;
|
|
2329
|
+
let dispose;
|
|
2330
|
+
return {
|
|
2331
|
+
c() {
|
|
2332
|
+
input = element("input");
|
|
2333
|
+
attr(input, "type", "text");
|
|
2334
|
+
attr(input, "id", idLabel);
|
|
2335
|
+
attr(input, "placeholder", placeholder);
|
|
2336
|
+
attr(input, "class", input_class_value = `${/*inputBorderClass*/
|
|
2337
|
+
ctx[2]} typein-textbox`);
|
|
2338
|
+
input.disabled = /*isDataSaving*/
|
|
2339
|
+
ctx[0];
|
|
2340
|
+
attr(input, "autocomplete", "off");
|
|
2341
|
+
},
|
|
2342
|
+
m(target, anchor) {
|
|
2343
|
+
insert(target, input, anchor);
|
|
2344
|
+
set_input_value(
|
|
2345
|
+
input,
|
|
2346
|
+
/*typeinAnswer*/
|
|
2347
|
+
ctx[1]
|
|
2348
|
+
);
|
|
2349
|
+
if (!mounted) {
|
|
2350
|
+
dispose = [
|
|
2351
|
+
listen(
|
|
2352
|
+
input,
|
|
2353
|
+
"input",
|
|
2354
|
+
/*input_input_handler*/
|
|
2355
|
+
ctx[11]
|
|
2356
|
+
),
|
|
2357
|
+
listen(
|
|
2358
|
+
input,
|
|
2359
|
+
"focusout",
|
|
2360
|
+
/*focusout_handler*/
|
|
2361
|
+
ctx[12]
|
|
2362
|
+
),
|
|
2363
|
+
listen(
|
|
2364
|
+
input,
|
|
2365
|
+
"keydown",
|
|
2366
|
+
/*keydown_handler*/
|
|
2367
|
+
ctx[13]
|
|
2368
|
+
)
|
|
2369
|
+
];
|
|
2370
|
+
mounted = true;
|
|
2371
|
+
}
|
|
2372
|
+
},
|
|
2373
|
+
p(ctx2, dirty) {
|
|
2374
|
+
if (dirty & /*isDataSaving*/
|
|
2375
|
+
1) {
|
|
2376
|
+
input.disabled = /*isDataSaving*/
|
|
2377
|
+
ctx2[0];
|
|
2378
|
+
}
|
|
2379
|
+
if (dirty & /*typeinAnswer*/
|
|
2380
|
+
2 && input.value !== /*typeinAnswer*/
|
|
2381
|
+
ctx2[1]) {
|
|
2382
|
+
set_input_value(
|
|
2383
|
+
input,
|
|
2384
|
+
/*typeinAnswer*/
|
|
2385
|
+
ctx2[1]
|
|
2386
|
+
);
|
|
2387
|
+
}
|
|
2388
|
+
},
|
|
2389
|
+
d(detaching) {
|
|
2390
|
+
if (detaching) {
|
|
2391
|
+
detach(input);
|
|
2392
|
+
}
|
|
2393
|
+
mounted = false;
|
|
2394
|
+
run_all(dispose);
|
|
2395
|
+
}
|
|
2396
|
+
};
|
|
2397
|
+
}
|
|
2398
|
+
function create_default_slot2(ctx) {
|
|
2399
|
+
let if_block_anchor;
|
|
2400
|
+
function select_block_type(ctx2, dirty) {
|
|
2401
|
+
if (
|
|
2402
|
+
/*typeinType*/
|
|
2403
|
+
ctx2[5] === "Short-Text"
|
|
2404
|
+
)
|
|
2405
|
+
return create_if_block_13;
|
|
2406
|
+
return create_else_block2;
|
|
2407
|
+
}
|
|
2408
|
+
let current_block_type = select_block_type(ctx, -1);
|
|
2409
|
+
let if_block = current_block_type(ctx);
|
|
2410
|
+
return {
|
|
2411
|
+
c() {
|
|
2412
|
+
if_block.c();
|
|
2413
|
+
if_block_anchor = empty();
|
|
2414
|
+
},
|
|
2415
|
+
m(target, anchor) {
|
|
2416
|
+
if_block.m(target, anchor);
|
|
2417
|
+
insert(target, if_block_anchor, anchor);
|
|
2418
|
+
},
|
|
2419
|
+
p(ctx2, dirty) {
|
|
2420
|
+
if_block.p(ctx2, dirty);
|
|
2421
|
+
},
|
|
2422
|
+
d(detaching) {
|
|
2423
|
+
if (detaching) {
|
|
2424
|
+
detach(if_block_anchor);
|
|
2425
|
+
}
|
|
2426
|
+
if_block.d(detaching);
|
|
2427
|
+
}
|
|
2428
|
+
};
|
|
2429
|
+
}
|
|
2430
|
+
function create_if_block4(ctx) {
|
|
2431
|
+
let promptresult;
|
|
2432
|
+
let current;
|
|
2433
|
+
promptresult = new PromptResult_default({
|
|
2434
|
+
props: {
|
|
2435
|
+
isResultCorrect,
|
|
2436
|
+
resultMessage: "[Generic \u201Ccorrect\u201D message]",
|
|
2437
|
+
resultFeedback: "You applied the principles of [specific theory] perfectly in your response."
|
|
2438
|
+
}
|
|
2439
|
+
});
|
|
2440
|
+
return {
|
|
2441
|
+
c() {
|
|
2442
|
+
create_component(promptresult.$$.fragment);
|
|
2443
|
+
},
|
|
2444
|
+
m(target, anchor) {
|
|
2445
|
+
mount_component(promptresult, target, anchor);
|
|
2446
|
+
current = true;
|
|
2447
|
+
},
|
|
2448
|
+
p: noop,
|
|
2449
|
+
i(local) {
|
|
2450
|
+
if (current)
|
|
2451
|
+
return;
|
|
2452
|
+
transition_in(promptresult.$$.fragment, local);
|
|
2453
|
+
current = true;
|
|
2454
|
+
},
|
|
2455
|
+
o(local) {
|
|
2456
|
+
transition_out(promptresult.$$.fragment, local);
|
|
2457
|
+
current = false;
|
|
2458
|
+
},
|
|
2459
|
+
d(detaching) {
|
|
2460
|
+
destroy_component(promptresult, detaching);
|
|
2461
|
+
}
|
|
2462
|
+
};
|
|
2463
|
+
}
|
|
2464
|
+
function create_fragment7(ctx) {
|
|
2465
|
+
let promptbody;
|
|
2466
|
+
let t2;
|
|
2467
|
+
let if_block_anchor;
|
|
2468
|
+
let current;
|
|
2469
|
+
promptbody = new PromptBody_default({
|
|
2470
|
+
props: {
|
|
2471
|
+
rubric: (
|
|
2472
|
+
/*rubric*/
|
|
2473
|
+
ctx[3].text
|
|
2474
|
+
),
|
|
2475
|
+
prompt: (
|
|
2476
|
+
/*prompt*/
|
|
2477
|
+
ctx[4]
|
|
2478
|
+
),
|
|
2479
|
+
$$slots: { default: [create_default_slot2] },
|
|
2480
|
+
$$scope: { ctx }
|
|
2481
|
+
}
|
|
2482
|
+
});
|
|
2483
|
+
let if_block = isFinished && create_if_block4(ctx);
|
|
2484
|
+
return {
|
|
2485
|
+
c() {
|
|
2486
|
+
create_component(promptbody.$$.fragment);
|
|
2487
|
+
t2 = space();
|
|
2488
|
+
if (if_block)
|
|
2489
|
+
if_block.c();
|
|
2490
|
+
if_block_anchor = empty();
|
|
2491
|
+
},
|
|
2492
|
+
m(target, anchor) {
|
|
2493
|
+
mount_component(promptbody, target, anchor);
|
|
2494
|
+
insert(target, t2, anchor);
|
|
2495
|
+
if (if_block)
|
|
2496
|
+
if_block.m(target, anchor);
|
|
2497
|
+
insert(target, if_block_anchor, anchor);
|
|
2498
|
+
current = true;
|
|
2499
|
+
},
|
|
2500
|
+
p(ctx2, [dirty]) {
|
|
2501
|
+
const promptbody_changes = {};
|
|
2502
|
+
if (dirty & /*$$scope, isDataSaving, typeinAnswer*/
|
|
2503
|
+
33554435) {
|
|
2504
|
+
promptbody_changes.$$scope = { dirty, ctx: ctx2 };
|
|
2505
|
+
}
|
|
2506
|
+
promptbody.$set(promptbody_changes);
|
|
2507
|
+
if (isFinished)
|
|
2508
|
+
if_block.p(ctx2, dirty);
|
|
2509
|
+
},
|
|
2510
|
+
i(local) {
|
|
2511
|
+
if (current)
|
|
2512
|
+
return;
|
|
2513
|
+
transition_in(promptbody.$$.fragment, local);
|
|
2514
|
+
transition_in(if_block);
|
|
2515
|
+
current = true;
|
|
2516
|
+
},
|
|
2517
|
+
o(local) {
|
|
2518
|
+
transition_out(promptbody.$$.fragment, local);
|
|
2519
|
+
transition_out(if_block);
|
|
2520
|
+
current = false;
|
|
2521
|
+
},
|
|
2522
|
+
d(detaching) {
|
|
2523
|
+
if (detaching) {
|
|
2524
|
+
detach(t2);
|
|
2525
|
+
detach(if_block_anchor);
|
|
2526
|
+
}
|
|
2527
|
+
destroy_component(promptbody, detaching);
|
|
2528
|
+
if (if_block)
|
|
2529
|
+
if_block.d(detaching);
|
|
2530
|
+
}
|
|
2531
|
+
};
|
|
2532
|
+
}
|
|
2533
|
+
var idLabel = "answerText";
|
|
2534
|
+
var placeholder = "Type your answer here";
|
|
2535
|
+
var isFinished = false;
|
|
2536
|
+
var isResultCorrect = true;
|
|
2537
|
+
function instance4($$self, $$props, $$invalidate) {
|
|
2538
|
+
let { sessionData } = $$props;
|
|
2539
|
+
let { isDataSaving } = $$props;
|
|
2540
|
+
const dispatch = createEventDispatcher();
|
|
2541
|
+
let typeinAnswer;
|
|
2542
|
+
let latestAnswer = "";
|
|
2543
|
+
let focusOrigin = "tab";
|
|
2544
|
+
const inputBorderClass = !isFinished ? "" : isResultCorrect ? "border-2 border-green-800" : "border-2 border-red-800";
|
|
2545
|
+
const { rubric, interaction, metadata } = sessionData;
|
|
2546
|
+
const { prompt, typein_type: typeinType } = interaction;
|
|
2547
|
+
if (metadata) {
|
|
2548
|
+
const events = metadata.interactions.events.pop();
|
|
2549
|
+
latestAnswer = typeinAnswer = events.answer;
|
|
2550
|
+
}
|
|
2551
|
+
const saveAnswer = () => {
|
|
2552
|
+
focusOrigin = "tab";
|
|
2553
|
+
if (isDataSaving || typeinAnswer === latestAnswer || !typeinAnswer && !latestAnswer)
|
|
2554
|
+
return;
|
|
2555
|
+
latestAnswer = typeinAnswer;
|
|
2556
|
+
dispatch("saveAnswer", { answer: typeinAnswer || "" });
|
|
2557
|
+
};
|
|
2558
|
+
const saveOnEnter = (event) => {
|
|
2559
|
+
if (event.key === "Enter") {
|
|
2560
|
+
event.preventDefault();
|
|
2561
|
+
saveAnswer();
|
|
2562
|
+
}
|
|
2563
|
+
};
|
|
2564
|
+
const handleFocus = (event) => {
|
|
2565
|
+
if (focusOrigin !== "click") {
|
|
2566
|
+
const textarea = event.target;
|
|
2567
|
+
textarea.select();
|
|
2568
|
+
textarea.setSelectionRange(0, textarea.value.length);
|
|
2569
|
+
}
|
|
2570
|
+
};
|
|
2571
|
+
const handleClick = () => {
|
|
2572
|
+
focusOrigin = "click";
|
|
2573
|
+
};
|
|
2574
|
+
function input_input_handler() {
|
|
2575
|
+
typeinAnswer = this.value;
|
|
2576
|
+
$$invalidate(1, typeinAnswer);
|
|
2577
|
+
}
|
|
2578
|
+
const focusout_handler = () => saveAnswer();
|
|
2579
|
+
const keydown_handler = (event) => saveOnEnter(event);
|
|
2580
|
+
function textarea_input_handler() {
|
|
2581
|
+
typeinAnswer = this.value;
|
|
2582
|
+
$$invalidate(1, typeinAnswer);
|
|
2583
|
+
}
|
|
2584
|
+
const mousedown_handler = () => handleClick();
|
|
2585
|
+
const touchstart_handler = () => handleClick();
|
|
2586
|
+
const focus_handler = (event) => handleFocus(event);
|
|
2587
|
+
const focusout_handler_1 = () => saveAnswer();
|
|
2588
|
+
const keydown_handler_1 = (event) => saveOnEnter(event);
|
|
2589
|
+
$$self.$$set = ($$props2) => {
|
|
2590
|
+
if ("sessionData" in $$props2)
|
|
2591
|
+
$$invalidate(10, sessionData = $$props2.sessionData);
|
|
2592
|
+
if ("isDataSaving" in $$props2)
|
|
1275
2593
|
$$invalidate(0, isDataSaving = $$props2.isDataSaving);
|
|
1276
2594
|
};
|
|
1277
2595
|
return [
|
|
1278
2596
|
isDataSaving,
|
|
1279
|
-
|
|
2597
|
+
typeinAnswer,
|
|
2598
|
+
inputBorderClass,
|
|
1280
2599
|
rubric,
|
|
1281
2600
|
prompt,
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
2601
|
+
typeinType,
|
|
2602
|
+
saveAnswer,
|
|
2603
|
+
saveOnEnter,
|
|
2604
|
+
handleFocus,
|
|
2605
|
+
handleClick,
|
|
1285
2606
|
sessionData,
|
|
1286
|
-
|
|
2607
|
+
input_input_handler,
|
|
2608
|
+
focusout_handler,
|
|
2609
|
+
keydown_handler,
|
|
2610
|
+
textarea_input_handler,
|
|
2611
|
+
mousedown_handler,
|
|
2612
|
+
touchstart_handler,
|
|
2613
|
+
focus_handler,
|
|
2614
|
+
focusout_handler_1,
|
|
2615
|
+
keydown_handler_1
|
|
1287
2616
|
];
|
|
1288
2617
|
}
|
|
1289
|
-
var
|
|
2618
|
+
var PromptTypeIn = class extends SvelteComponent {
|
|
1290
2619
|
constructor(options) {
|
|
1291
2620
|
super();
|
|
1292
|
-
init(this, options,
|
|
2621
|
+
init(this, options, instance4, create_fragment7, safe_not_equal, { sessionData: 10, isDataSaving: 0 });
|
|
1293
2622
|
}
|
|
1294
2623
|
get sessionData() {
|
|
1295
|
-
return this.$$.ctx[
|
|
2624
|
+
return this.$$.ctx[10];
|
|
1296
2625
|
}
|
|
1297
2626
|
set sessionData(sessionData) {
|
|
1298
2627
|
this.$$set({ sessionData });
|
|
@@ -1306,11 +2635,11 @@
|
|
|
1306
2635
|
flush();
|
|
1307
2636
|
}
|
|
1308
2637
|
};
|
|
1309
|
-
customElements.define("prompt-
|
|
1310
|
-
var
|
|
2638
|
+
customElements.define("prompt-typein", create_custom_element(PromptTypeIn, { "sessionData": {}, "isDataSaving": {} }, [], [], true));
|
|
2639
|
+
var PromptTypeIn_default = PromptTypeIn;
|
|
1311
2640
|
|
|
1312
2641
|
// src/lib/components/prompt/skeleton/PromptSkeleton.svelte
|
|
1313
|
-
function
|
|
2642
|
+
function create_fragment8(ctx) {
|
|
1314
2643
|
let div3;
|
|
1315
2644
|
return {
|
|
1316
2645
|
c() {
|
|
@@ -1333,28 +2662,38 @@
|
|
|
1333
2662
|
var PromptSkeleton = class extends SvelteComponent {
|
|
1334
2663
|
constructor(options) {
|
|
1335
2664
|
super();
|
|
1336
|
-
init(this, options, null,
|
|
2665
|
+
init(this, options, null, create_fragment8, safe_not_equal, {});
|
|
1337
2666
|
}
|
|
1338
2667
|
};
|
|
1339
2668
|
customElements.define("prompt-skeleton", create_custom_element(PromptSkeleton, {}, [], [], true));
|
|
1340
2669
|
var PromptSkeleton_default = PromptSkeleton;
|
|
1341
2670
|
|
|
1342
|
-
// src/lib/components/
|
|
1343
|
-
function
|
|
1344
|
-
append_styles(target, "svelte-1i5tmfz", '*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:Mulish, sans-serif;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*{font-family:Mulish, sans-serif}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.item-heading{--tw-text-opacity:1;color:rgb(8 38 99/var(--tw-text-opacity));font-size:1.25rem;letter-spacing:-0.025em;line-height:1.5rem}.divider{--tw-border-opacity:1;border-bottom-width:1px;border-color:rgb(107 121 121/var(--tw-border-opacity))}@keyframes svelte-1i5tmfz-pulse{50%{opacity:0.5}}.animate-skeleton{--tw-bg-opacity:1;animation:svelte-1i5tmfz-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;background-color:rgb(226 232 240/var(--tw-bg-opacity))}.btn-mcq-option:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);--tw-ring-opacity:1;--tw-ring-color:rgb(84 101 251/var(--tw-ring-opacity));--tw-ring-offset-width:4px;box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 rgba(0, 0, 0, 0));outline:2px solid transparent;outline-offset:2px;transition-duration:50ms}.btn-mcq-option{--tw-text-opacity:1;--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(247 250 250/var(--tw-bg-opacity));border-color:rgb(113 115 119/var(--tw-border-opacity));border-radius:0.5rem;border-width:1px;color:rgb(33 37 41/var(--tw-text-opacity));display:flex;font-size:1rem;line-height:1.5rem;margin-bottom:1rem;min-height:48px;padding:0.5rem 0.75rem 0.5rem 0.5rem;width:100%}.btn-mcq-option:active{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(222 222 255/var(--tw-bg-opacity));border-color:rgb(8 38 99/var(--tw-border-opacity));border-width:2px}@media(hover: hover) and (pointer: fine){.btn-mcq-option:hover{--tw-bg-opacity:1;background-color:rgb(222 222 255/var(--tw-bg-opacity))}}.btn-mcq-option>.choice{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;align-items:center;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(113 115 119/var(--tw-border-opacity));border-radius:1rem;border-width:1px;color:rgb(93 99 107/var(--tw-text-opacity));display:flex;font-size:1rem;font-weight:700;height:2rem;justify-content:center;letter-spacing:0.05em;line-height:1rem;margin-right:1rem;padding:0.5rem;width:2rem}.btn-mcq-option.selected{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(222 222 255/var(--tw-bg-opacity))}.btn-mcq-option.selected,.btn-mcq-option.selected>.choice{border-color:rgb(8 38 99/var(--tw-border-opacity));border-width:2px}.btn-mcq-option.selected>.choice{--tw-border-opacity:1}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.z-50{z-index:50}.my-6{margin-bottom:1.5rem;margin-top:1.5rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:0.5rem}.h-52{height:13rem}.h-6{height:1.5rem}.w-full{width:100%}.rounded{border-radius:0.25rem}.border-2{border-width:2px}.border-red-600{--tw-border-opacity:1;border-color:rgb(220 38 38/var(--tw-border-opacity))}.bg-red-200{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.p-2{padding:0.5rem}.text-left{text-align:left}.font-semibold{font-weight:600}.group:active .group-active\\:border-2{border-width:2px}.group:active .group-active\\:border-blue-1000{--tw-border-opacity:1;border-color:rgb(8 38 99/var(--tw-border-opacity))}.group:active .group-active\\:p-\\[7px\\]{padding:7px}@media(min-width: 732px){.md\\:mb-4{margin-bottom:1rem}}');
|
|
1345
|
-
}
|
|
1346
|
-
function create_else_block(ctx) {
|
|
2671
|
+
// src/lib/components/common/InvalidBanner.svelte
|
|
2672
|
+
function create_fragment9(ctx) {
|
|
1347
2673
|
let p;
|
|
2674
|
+
let t2;
|
|
1348
2675
|
return {
|
|
1349
2676
|
c() {
|
|
1350
2677
|
p = element("p");
|
|
1351
|
-
|
|
2678
|
+
t2 = text(
|
|
2679
|
+
/*bannerLabel*/
|
|
2680
|
+
ctx[0]
|
|
2681
|
+
);
|
|
1352
2682
|
attr(p, "class", "p-2 border-2 border-red-600 bg-red-200 rounded");
|
|
1353
2683
|
},
|
|
1354
2684
|
m(target, anchor) {
|
|
1355
2685
|
insert(target, p, anchor);
|
|
2686
|
+
append(p, t2);
|
|
2687
|
+
},
|
|
2688
|
+
p(ctx2, [dirty]) {
|
|
2689
|
+
if (dirty & /*bannerLabel*/
|
|
2690
|
+
1)
|
|
2691
|
+
set_data(
|
|
2692
|
+
t2,
|
|
2693
|
+
/*bannerLabel*/
|
|
2694
|
+
ctx2[0]
|
|
2695
|
+
);
|
|
1356
2696
|
},
|
|
1357
|
-
p: noop,
|
|
1358
2697
|
i: noop,
|
|
1359
2698
|
o: noop,
|
|
1360
2699
|
d(detaching) {
|
|
@@ -1364,10 +2703,194 @@
|
|
|
1364
2703
|
}
|
|
1365
2704
|
};
|
|
1366
2705
|
}
|
|
1367
|
-
function
|
|
1368
|
-
let
|
|
2706
|
+
function instance5($$self, $$props, $$invalidate) {
|
|
2707
|
+
let { bannerLabel: bannerLabel2 = "Invalid." } = $$props;
|
|
2708
|
+
$$self.$$set = ($$props2) => {
|
|
2709
|
+
if ("bannerLabel" in $$props2)
|
|
2710
|
+
$$invalidate(0, bannerLabel2 = $$props2.bannerLabel);
|
|
2711
|
+
};
|
|
2712
|
+
return [bannerLabel2];
|
|
2713
|
+
}
|
|
2714
|
+
var InvalidBanner = class extends SvelteComponent {
|
|
2715
|
+
constructor(options) {
|
|
2716
|
+
super();
|
|
2717
|
+
init(this, options, instance5, create_fragment9, safe_not_equal, { bannerLabel: 0 });
|
|
2718
|
+
}
|
|
2719
|
+
get bannerLabel() {
|
|
2720
|
+
return this.$$.ctx[0];
|
|
2721
|
+
}
|
|
2722
|
+
set bannerLabel(bannerLabel2) {
|
|
2723
|
+
this.$$set({ bannerLabel: bannerLabel2 });
|
|
2724
|
+
flush();
|
|
2725
|
+
}
|
|
2726
|
+
};
|
|
2727
|
+
customElements.define("invalid-banner", create_custom_element(InvalidBanner, { "bannerLabel": {} }, [], [], true));
|
|
2728
|
+
var InvalidBanner_default = InvalidBanner;
|
|
2729
|
+
|
|
2730
|
+
// src/lib/components/prompt/PromptBuilder.svelte
|
|
2731
|
+
function add_css(target) {
|
|
2732
|
+
append_styles(target, "svelte-12rerkj", '*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:Mulish, sans-serif;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*{font-family:Mulish, sans-serif}input::-moz-selection,textarea::-moz-selection{background-color:hsla(0, 0%, 85%, 0.4)}input::selection,textarea::selection{background-color:hsla(0, 0%, 85%, 0.4)}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.p2{font-size:0.875rem;font-weight:600;line-height:1.25rem;line-height:1.5}.item-heading{--tw-text-opacity:1;color:rgb(8 38 99/var(--tw-text-opacity));font-size:1.25rem;letter-spacing:-0.025em;line-height:1.5rem}.divider{--tw-border-opacity:1;border-bottom-width:1px;border-color:rgb(107 121 121/var(--tw-border-opacity))}@keyframes svelte-12rerkj-pulse{{opacity:0.5}}.animate-skeleton{--tw-bg-opacity:1;animation:svelte-12rerkj-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;background-color:rgb(226 232 240/var(--tw-bg-opacity))}.btn-mcq-option:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);--tw-ring-opacity:1;--tw-ring-color:rgb(84 101 251/var(--tw-ring-opacity));--tw-ring-offset-width:4px;box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 rgba(0, 0, 0, 0));outline:2px solid transparent;outline-offset:2px;transition-duration:50ms}.btn-mcq-option{--tw-text-opacity:1;--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(247 250 250/var(--tw-bg-opacity));border-color:rgb(113 115 119/var(--tw-border-opacity));border-radius:0.5rem;border-width:1px;color:rgb(33 37 41/var(--tw-text-opacity));display:flex;font-size:1rem;line-height:1.5rem;margin-bottom:1rem;min-height:48px;padding:0.5rem 0.75rem 0.5rem 0.5rem;width:100%}.btn-mcq-option:active{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(222 222 255/var(--tw-bg-opacity));border-color:rgb(8 38 99/var(--tw-border-opacity));border-width:2px}@media(hover: hover) and (pointer: fine){.btn-mcq-option:hover{--tw-bg-opacity:1;background-color:rgb(222 222 255/var(--tw-bg-opacity))}}.btn-mcq-option>.choice{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;align-items:center;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(113 115 119/var(--tw-border-opacity));border-radius:1rem;border-width:1px;color:rgb(93 99 107/var(--tw-text-opacity));display:flex;font-size:1rem;font-weight:700;height:2rem;justify-content:center;letter-spacing:0.05em;line-height:1rem;margin-right:1rem;padding:0.5rem;width:2rem}.btn-mcq-option.selected{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(222 222 255/var(--tw-bg-opacity))}.btn-mcq-option.selected,.btn-mcq-option.selected>.choice{border-color:rgb(8 38 99/var(--tw-border-opacity));border-width:2px}.btn-mcq-option.selected>.choice{--tw-border-opacity:1}.typein-textbox:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);--tw-ring-opacity:1;--tw-ring-color:rgb(84 101 251/var(--tw-ring-opacity));--tw-ring-offset-width:4px;box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 rgba(0, 0, 0, 0));outline:2px solid transparent;outline-offset:2px;transition-duration:50ms}.typein-textbox{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(93 99 107/var(--tw-border-opacity));border-radius:0.5rem;border-width:1px;color:rgb(33 37 41/var(--tw-text-opacity));font-size:1rem;line-height:1.5rem;padding:0.75rem 1rem;width:100%}.typein-textbox::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(93 99 107/var(--tw-placeholder-opacity))}.typein-textbox::placeholder{--tw-placeholder-opacity:1;color:rgb(93 99 107/var(--tw-placeholder-opacity))}.typein-textbox:focus{--tw-border-opacity:1;border-color:rgb(84 101 251/var(--tw-border-opacity));border-width:2px}@media(hover: hover) and (pointer: fine){.typein-textbox:hover{--tw-border-opacity:1;border-color:rgb(84 101 251/var(--tw-border-opacity));border-width:2px;outline:2px solid transparent;outline-offset:2px}}.typein-textbox:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 rgba(0, 0, 0, 0)) !important}@media(hover: hover) and (pointer: fine){.typein-textbox:hover{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);--tw-ring-opacity:1;--tw-ring-color:rgb(84 101 251/var(--tw-ring-opacity));--tw-ring-offset-width:4px;box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 rgba(0, 0, 0, 0));transition-duration:50ms}}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.z-50{z-index:50}.my-6{margin-bottom:1.5rem;margin-top:1.5rem}.mb-1{margin-bottom:0.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:0.5rem}.mr-2{margin-right:0.5rem}.mt-2{margin-top:0.5rem}.block{display:block}.flex{display:flex}.h-52{height:13rem}.h-6{height:1.5rem}.w-full{width:100%}.items-start{align-items:flex-start}.items-center{align-items:center}.overflow-hidden{overflow:hidden}.rounded{border-radius:0.25rem}.border-2{border-width:2px}.border-l-\\[6px\\]{border-left-width:6px}.border-green-800{--tw-border-opacity:1;border-color:rgb(0 102 5/var(--tw-border-opacity))}.border-red-600{--tw-border-opacity:1;border-color:rgb(220 38 38/var(--tw-border-opacity))}.border-red-800{--tw-border-opacity:1;border-color:rgb(217 12 85/var(--tw-border-opacity))}.bg-green-300{--tw-bg-opacity:1;background-color:rgb(241 254 241/var(--tw-bg-opacity))}.bg-red-200{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity))}.bg-red-300{--tw-bg-opacity:1;background-color:rgb(253 243 247/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.p-0{padding:0}.p-0\\.5{padding:0.125rem}.p-2{padding:0.5rem}.p-4{padding:1rem}.text-left{text-align:left}.text-base{font-size:1rem;line-height:1.5rem}.font-semibold{font-weight:600}.text-charcoal{--tw-text-opacity:1;color:rgb(33 37 41/var(--tw-text-opacity))}.text-green-800{--tw-text-opacity:1;color:rgb(0 102 5/var(--tw-text-opacity))}.text-red-800{--tw-text-opacity:1;color:rgb(217 12 85/var(--tw-text-opacity))}.group:active .group-active\\:border-2{border-width:2px}.group:active .group-active\\:border-blue-1000{--tw-border-opacity:1;border-color:rgb(8 38 99/var(--tw-border-opacity))}.group:active .group-active\\:p-\\[7px\\]{padding:7px}@media(min-width: 732px){.md\\:mb-4{margin-bottom:1rem}}');
|
|
2733
|
+
}
|
|
2734
|
+
function create_else_block_12(ctx) {
|
|
2735
|
+
let invalidbanner;
|
|
1369
2736
|
let current;
|
|
1370
|
-
|
|
2737
|
+
invalidbanner = new InvalidBanner_default({ props: { bannerLabel } });
|
|
2738
|
+
return {
|
|
2739
|
+
c() {
|
|
2740
|
+
create_component(invalidbanner.$$.fragment);
|
|
2741
|
+
},
|
|
2742
|
+
m(target, anchor) {
|
|
2743
|
+
mount_component(invalidbanner, target, anchor);
|
|
2744
|
+
current = true;
|
|
2745
|
+
},
|
|
2746
|
+
p: noop,
|
|
2747
|
+
i(local) {
|
|
2748
|
+
if (current)
|
|
2749
|
+
return;
|
|
2750
|
+
transition_in(invalidbanner.$$.fragment, local);
|
|
2751
|
+
current = true;
|
|
2752
|
+
},
|
|
2753
|
+
o(local) {
|
|
2754
|
+
transition_out(invalidbanner.$$.fragment, local);
|
|
2755
|
+
current = false;
|
|
2756
|
+
},
|
|
2757
|
+
d(detaching) {
|
|
2758
|
+
destroy_component(invalidbanner, detaching);
|
|
2759
|
+
}
|
|
2760
|
+
};
|
|
2761
|
+
}
|
|
2762
|
+
function create_if_block_14(ctx) {
|
|
2763
|
+
let current_block_type_index;
|
|
2764
|
+
let if_block;
|
|
2765
|
+
let if_block_anchor;
|
|
2766
|
+
let current;
|
|
2767
|
+
const if_block_creators = [create_if_block_22, create_if_block_3, create_else_block3];
|
|
2768
|
+
const if_blocks = [];
|
|
2769
|
+
function select_block_type_1(ctx2, dirty) {
|
|
2770
|
+
if (
|
|
2771
|
+
/*interactionType*/
|
|
2772
|
+
ctx2[3] === "multipleChoiceInteraction"
|
|
2773
|
+
)
|
|
2774
|
+
return 0;
|
|
2775
|
+
if (
|
|
2776
|
+
/*interactionType*/
|
|
2777
|
+
ctx2[3] === "typeInInteraction"
|
|
2778
|
+
)
|
|
2779
|
+
return 1;
|
|
2780
|
+
return 2;
|
|
2781
|
+
}
|
|
2782
|
+
current_block_type_index = select_block_type_1(ctx, -1);
|
|
2783
|
+
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
|
2784
|
+
return {
|
|
2785
|
+
c() {
|
|
2786
|
+
if_block.c();
|
|
2787
|
+
if_block_anchor = empty();
|
|
2788
|
+
},
|
|
2789
|
+
m(target, anchor) {
|
|
2790
|
+
if_blocks[current_block_type_index].m(target, anchor);
|
|
2791
|
+
insert(target, if_block_anchor, anchor);
|
|
2792
|
+
current = true;
|
|
2793
|
+
},
|
|
2794
|
+
p(ctx2, dirty) {
|
|
2795
|
+
let previous_block_index = current_block_type_index;
|
|
2796
|
+
current_block_type_index = select_block_type_1(ctx2, dirty);
|
|
2797
|
+
if (current_block_type_index === previous_block_index) {
|
|
2798
|
+
if_blocks[current_block_type_index].p(ctx2, dirty);
|
|
2799
|
+
} else {
|
|
2800
|
+
group_outros();
|
|
2801
|
+
transition_out(if_blocks[previous_block_index], 1, 1, () => {
|
|
2802
|
+
if_blocks[previous_block_index] = null;
|
|
2803
|
+
});
|
|
2804
|
+
check_outros();
|
|
2805
|
+
if_block = if_blocks[current_block_type_index];
|
|
2806
|
+
if (!if_block) {
|
|
2807
|
+
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2);
|
|
2808
|
+
if_block.c();
|
|
2809
|
+
} else {
|
|
2810
|
+
if_block.p(ctx2, dirty);
|
|
2811
|
+
}
|
|
2812
|
+
transition_in(if_block, 1);
|
|
2813
|
+
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
2814
|
+
}
|
|
2815
|
+
},
|
|
2816
|
+
i(local) {
|
|
2817
|
+
if (current)
|
|
2818
|
+
return;
|
|
2819
|
+
transition_in(if_block);
|
|
2820
|
+
current = true;
|
|
2821
|
+
},
|
|
2822
|
+
o(local) {
|
|
2823
|
+
transition_out(if_block);
|
|
2824
|
+
current = false;
|
|
2825
|
+
},
|
|
2826
|
+
d(detaching) {
|
|
2827
|
+
if (detaching) {
|
|
2828
|
+
detach(if_block_anchor);
|
|
2829
|
+
}
|
|
2830
|
+
if_blocks[current_block_type_index].d(detaching);
|
|
2831
|
+
}
|
|
2832
|
+
};
|
|
2833
|
+
}
|
|
2834
|
+
function create_if_block5(ctx) {
|
|
2835
|
+
let promptskeleton;
|
|
2836
|
+
let current;
|
|
2837
|
+
promptskeleton = new PromptSkeleton_default({});
|
|
2838
|
+
return {
|
|
2839
|
+
c() {
|
|
2840
|
+
create_component(promptskeleton.$$.fragment);
|
|
2841
|
+
},
|
|
2842
|
+
m(target, anchor) {
|
|
2843
|
+
mount_component(promptskeleton, target, anchor);
|
|
2844
|
+
current = true;
|
|
2845
|
+
},
|
|
2846
|
+
p: noop,
|
|
2847
|
+
i(local) {
|
|
2848
|
+
if (current)
|
|
2849
|
+
return;
|
|
2850
|
+
transition_in(promptskeleton.$$.fragment, local);
|
|
2851
|
+
current = true;
|
|
2852
|
+
},
|
|
2853
|
+
o(local) {
|
|
2854
|
+
transition_out(promptskeleton.$$.fragment, local);
|
|
2855
|
+
current = false;
|
|
2856
|
+
},
|
|
2857
|
+
d(detaching) {
|
|
2858
|
+
destroy_component(promptskeleton, detaching);
|
|
2859
|
+
}
|
|
2860
|
+
};
|
|
2861
|
+
}
|
|
2862
|
+
function create_else_block3(ctx) {
|
|
2863
|
+
let invalidbanner;
|
|
2864
|
+
let current;
|
|
2865
|
+
invalidbanner = new InvalidBanner_default({ props: { bannerLabel } });
|
|
2866
|
+
return {
|
|
2867
|
+
c() {
|
|
2868
|
+
create_component(invalidbanner.$$.fragment);
|
|
2869
|
+
},
|
|
2870
|
+
m(target, anchor) {
|
|
2871
|
+
mount_component(invalidbanner, target, anchor);
|
|
2872
|
+
current = true;
|
|
2873
|
+
},
|
|
2874
|
+
p: noop,
|
|
2875
|
+
i(local) {
|
|
2876
|
+
if (current)
|
|
2877
|
+
return;
|
|
2878
|
+
transition_in(invalidbanner.$$.fragment, local);
|
|
2879
|
+
current = true;
|
|
2880
|
+
},
|
|
2881
|
+
o(local) {
|
|
2882
|
+
transition_out(invalidbanner.$$.fragment, local);
|
|
2883
|
+
current = false;
|
|
2884
|
+
},
|
|
2885
|
+
d(detaching) {
|
|
2886
|
+
destroy_component(invalidbanner, detaching);
|
|
2887
|
+
}
|
|
2888
|
+
};
|
|
2889
|
+
}
|
|
2890
|
+
function create_if_block_3(ctx) {
|
|
2891
|
+
let prompttypein;
|
|
2892
|
+
let current;
|
|
2893
|
+
prompttypein = new PromptTypeIn_default({
|
|
1371
2894
|
props: {
|
|
1372
2895
|
sessionData: (
|
|
1373
2896
|
/*sessionData*/
|
|
@@ -1379,80 +2902,107 @@
|
|
|
1379
2902
|
)
|
|
1380
2903
|
}
|
|
1381
2904
|
});
|
|
1382
|
-
|
|
1383
|
-
"
|
|
1384
|
-
/*
|
|
1385
|
-
ctx[
|
|
2905
|
+
prompttypein.$on(
|
|
2906
|
+
"saveAnswer",
|
|
2907
|
+
/*saveEvent*/
|
|
2908
|
+
ctx[4]
|
|
1386
2909
|
);
|
|
1387
2910
|
return {
|
|
1388
2911
|
c() {
|
|
1389
|
-
create_component(
|
|
2912
|
+
create_component(prompttypein.$$.fragment);
|
|
1390
2913
|
},
|
|
1391
2914
|
m(target, anchor) {
|
|
1392
|
-
mount_component(
|
|
2915
|
+
mount_component(prompttypein, target, anchor);
|
|
1393
2916
|
current = true;
|
|
1394
2917
|
},
|
|
1395
2918
|
p(ctx2, dirty) {
|
|
1396
|
-
const
|
|
2919
|
+
const prompttypein_changes = {};
|
|
1397
2920
|
if (dirty & /*sessionData*/
|
|
1398
2921
|
1)
|
|
1399
|
-
|
|
2922
|
+
prompttypein_changes.sessionData = /*sessionData*/
|
|
1400
2923
|
ctx2[0];
|
|
1401
2924
|
if (dirty & /*isDataSaving*/
|
|
1402
2925
|
4)
|
|
1403
|
-
|
|
2926
|
+
prompttypein_changes.isDataSaving = /*isDataSaving*/
|
|
1404
2927
|
ctx2[2];
|
|
1405
|
-
|
|
2928
|
+
prompttypein.$set(prompttypein_changes);
|
|
1406
2929
|
},
|
|
1407
2930
|
i(local) {
|
|
1408
2931
|
if (current)
|
|
1409
2932
|
return;
|
|
1410
|
-
transition_in(
|
|
2933
|
+
transition_in(prompttypein.$$.fragment, local);
|
|
1411
2934
|
current = true;
|
|
1412
2935
|
},
|
|
1413
2936
|
o(local) {
|
|
1414
|
-
transition_out(
|
|
2937
|
+
transition_out(prompttypein.$$.fragment, local);
|
|
1415
2938
|
current = false;
|
|
1416
2939
|
},
|
|
1417
2940
|
d(detaching) {
|
|
1418
|
-
destroy_component(
|
|
2941
|
+
destroy_component(prompttypein, detaching);
|
|
1419
2942
|
}
|
|
1420
2943
|
};
|
|
1421
2944
|
}
|
|
1422
|
-
function
|
|
1423
|
-
let
|
|
2945
|
+
function create_if_block_22(ctx) {
|
|
2946
|
+
let promptmcq;
|
|
1424
2947
|
let current;
|
|
1425
|
-
|
|
2948
|
+
promptmcq = new PromptMCQ_default({
|
|
2949
|
+
props: {
|
|
2950
|
+
sessionData: (
|
|
2951
|
+
/*sessionData*/
|
|
2952
|
+
ctx[0]
|
|
2953
|
+
),
|
|
2954
|
+
isDataSaving: (
|
|
2955
|
+
/*isDataSaving*/
|
|
2956
|
+
ctx[2]
|
|
2957
|
+
)
|
|
2958
|
+
}
|
|
2959
|
+
});
|
|
2960
|
+
promptmcq.$on(
|
|
2961
|
+
"saveOption",
|
|
2962
|
+
/*saveEvent*/
|
|
2963
|
+
ctx[4]
|
|
2964
|
+
);
|
|
1426
2965
|
return {
|
|
1427
2966
|
c() {
|
|
1428
|
-
create_component(
|
|
2967
|
+
create_component(promptmcq.$$.fragment);
|
|
1429
2968
|
},
|
|
1430
2969
|
m(target, anchor) {
|
|
1431
|
-
mount_component(
|
|
2970
|
+
mount_component(promptmcq, target, anchor);
|
|
1432
2971
|
current = true;
|
|
1433
2972
|
},
|
|
1434
|
-
p
|
|
2973
|
+
p(ctx2, dirty) {
|
|
2974
|
+
const promptmcq_changes = {};
|
|
2975
|
+
if (dirty & /*sessionData*/
|
|
2976
|
+
1)
|
|
2977
|
+
promptmcq_changes.sessionData = /*sessionData*/
|
|
2978
|
+
ctx2[0];
|
|
2979
|
+
if (dirty & /*isDataSaving*/
|
|
2980
|
+
4)
|
|
2981
|
+
promptmcq_changes.isDataSaving = /*isDataSaving*/
|
|
2982
|
+
ctx2[2];
|
|
2983
|
+
promptmcq.$set(promptmcq_changes);
|
|
2984
|
+
},
|
|
1435
2985
|
i(local) {
|
|
1436
2986
|
if (current)
|
|
1437
2987
|
return;
|
|
1438
|
-
transition_in(
|
|
2988
|
+
transition_in(promptmcq.$$.fragment, local);
|
|
1439
2989
|
current = true;
|
|
1440
2990
|
},
|
|
1441
2991
|
o(local) {
|
|
1442
|
-
transition_out(
|
|
2992
|
+
transition_out(promptmcq.$$.fragment, local);
|
|
1443
2993
|
current = false;
|
|
1444
2994
|
},
|
|
1445
2995
|
d(detaching) {
|
|
1446
|
-
destroy_component(
|
|
2996
|
+
destroy_component(promptmcq, detaching);
|
|
1447
2997
|
}
|
|
1448
2998
|
};
|
|
1449
2999
|
}
|
|
1450
|
-
function
|
|
3000
|
+
function create_fragment10(ctx) {
|
|
1451
3001
|
let current_block_type_index;
|
|
1452
3002
|
let if_block;
|
|
1453
3003
|
let if_block_anchor;
|
|
1454
3004
|
let current;
|
|
1455
|
-
const if_block_creators = [
|
|
3005
|
+
const if_block_creators = [create_if_block5, create_if_block_14, create_else_block_12];
|
|
1456
3006
|
const if_blocks = [];
|
|
1457
3007
|
function select_block_type(ctx2, dirty) {
|
|
1458
3008
|
if (
|
|
@@ -1519,12 +3069,14 @@
|
|
|
1519
3069
|
}
|
|
1520
3070
|
};
|
|
1521
3071
|
}
|
|
1522
|
-
|
|
3072
|
+
var bannerLabel = "Invalid session id.";
|
|
3073
|
+
function instance6($$self, $$props, $$invalidate) {
|
|
1523
3074
|
const { "session-id": sessionId } = $$props;
|
|
1524
3075
|
useSetupAPI();
|
|
1525
3076
|
let sessionData;
|
|
1526
3077
|
let isDataFetching = true;
|
|
1527
3078
|
let isDataSaving = false;
|
|
3079
|
+
let interactionType = null;
|
|
1528
3080
|
const skipUserValidationStr = get_store_value(skipUserValidation) ? "?skip_user_validation=true" : "";
|
|
1529
3081
|
const getSessionData = async (sessionId2) => {
|
|
1530
3082
|
try {
|
|
@@ -1540,20 +3092,28 @@
|
|
|
1540
3092
|
const getItemData = async (itemId, metadata) => {
|
|
1541
3093
|
try {
|
|
1542
3094
|
const { data } = await useGet(`items/${itemId}`);
|
|
3095
|
+
$$invalidate(3, interactionType = getInteractionType(data));
|
|
1543
3096
|
$$invalidate(0, sessionData = { ...data, metadata });
|
|
1544
3097
|
} catch (error) {
|
|
1545
3098
|
} finally {
|
|
1546
3099
|
$$invalidate(1, isDataFetching = false);
|
|
1547
3100
|
}
|
|
1548
3101
|
};
|
|
1549
|
-
const
|
|
1550
|
-
|
|
3102
|
+
const getInteractionType = (data) => {
|
|
3103
|
+
let interactionType2 = null;
|
|
3104
|
+
if (data) {
|
|
3105
|
+
const { interaction } = data;
|
|
3106
|
+
if (interaction) {
|
|
3107
|
+
const { type } = interaction;
|
|
3108
|
+
interactionType2 = type || null;
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
return interactionType2;
|
|
3112
|
+
};
|
|
3113
|
+
const saveEvent = async ({ detail }) => {
|
|
1551
3114
|
try {
|
|
1552
|
-
|
|
1553
|
-
await usePatch(`sessions/${sessionId}${skipUserValidationStr}`,
|
|
1554
|
-
answer_id: answerChoiceId,
|
|
1555
|
-
answer_choice: answerChoice
|
|
1556
|
-
});
|
|
3115
|
+
$$invalidate(2, isDataSaving = true);
|
|
3116
|
+
await usePatch(`sessions/${sessionId}${skipUserValidationStr}`, detail);
|
|
1557
3117
|
} catch (error) {
|
|
1558
3118
|
$$invalidate(2, isDataSaving = false);
|
|
1559
3119
|
} finally {
|
|
@@ -1564,15 +3124,15 @@
|
|
|
1564
3124
|
getSessionData(sessionId);
|
|
1565
3125
|
}
|
|
1566
3126
|
$$self.$$set = ($$new_props) => {
|
|
1567
|
-
$$invalidate(
|
|
3127
|
+
$$invalidate(10, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
|
|
1568
3128
|
};
|
|
1569
3129
|
$$props = exclude_internal_props($$props);
|
|
1570
|
-
return [sessionData, isDataFetching, isDataSaving,
|
|
3130
|
+
return [sessionData, isDataFetching, isDataSaving, interactionType, saveEvent];
|
|
1571
3131
|
}
|
|
1572
3132
|
var PromptBuilder = class extends SvelteComponent {
|
|
1573
3133
|
constructor(options) {
|
|
1574
3134
|
super();
|
|
1575
|
-
init(this, options,
|
|
3135
|
+
init(this, options, instance6, create_fragment10, safe_not_equal, {}, add_css);
|
|
1576
3136
|
}
|
|
1577
3137
|
};
|
|
1578
3138
|
customElements.define("prompt-builder", create_custom_element(PromptBuilder, {}, [], [], true));
|