@citolab/qti-components 6.9.1-beta.71 → 6.9.1-beta.72
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/index.global.js +1 -1
- package/dist/index.js +3 -3
- package/dist/index.min.js +1 -1
- package/dist/item.css +12 -5
- package/dist/qti-components/index.cjs +3 -3
- package/dist/qti-components/index.js +3 -3
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function t(t,e){if(e==null||e>t.length)e=t.length;for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function e(t){if(Array.isArray(t))return t}function n(e){if(Array.isArray(e))return t(e)}function r(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function i(t,e,n,r,i,o,a){try{var s=t[o](a);var u=s.value}catch(t){n(t);return}if(s.done){e(u)}else{Promise.resolve(u).then(r,i)}}function o(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function s(t){i(a,r,o,s,u,"next",t)}function u(t){i(a,r,o,s,u,"throw",t)}s(undefined)})}}function a(t,e,n){e=f(e);return x(t,I()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function s(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function u(t,e,n){if(I()){u=Reflect.construct}else{u=function t(t,e,n){var r=[null];r.push.apply(r,e);var i=Function.bind.apply(t,r);var o=new i;if(n)S(o,n.prototype);return o}}return u.apply(null,arguments)}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(t,r.key,r)}}function c(t,e,n){if(e)l(t.prototype,e);if(n)l(t,n);return t}function h(t,e,n){if(e in t){Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true})}else{t[e]=n}return t}function d(t,e,n){if(typeof Reflect!=="undefined"&&Reflect.get){d=Reflect.get}else{d=function t(t,e,n){var r=R(t,e);if(!r)return;var i=Object.getOwnPropertyDescriptor(r,e);if(i.get){return i.get.call(n||t)}return i.value}}return d(t,e,n||t)}function f(t){f=Object.setPrototypeOf?Object.getPrototypeOf:function t(t){return t.__proto__||Object.getPrototypeOf(t)};return f(t)}function p(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:true,configurable:true}});if(e)S(t,e)}function v(t,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](t)}else{return t instanceof e}}function y(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function m(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function g(t,e){var n=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n==null)return;var r=[];var i=true;var o=false;var a,s;try{for(n=n.call(t);!(i=(a=n.next()).done);i=true){r.push(a.value);if(e&&r.length===e)break}}catch(t){o=true;s=t}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(o)throw s}}return r}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))}r.forEach(function(e){h(t,e,n[e])})}return t}function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);if(e){r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})}n.push.apply(n,r)}return n}function w(t,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))}else{E(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function x(t,e){if(e&&(D(e)==="object"||typeof e==="function")){return e}return r(t)}function C(t,e,n,r){if(typeof Reflect!=="undefined"&&Reflect.set){C=Reflect.set}else{C=function t(t,e,n,r){var i=R(t,e);var o;if(i){o=Object.getOwnPropertyDescriptor(i,e);if(o.set){o.set.call(r,n);return true}else if(!o.writable){return false}}o=Object.getOwnPropertyDescriptor(r,e);if(o){if(!o.writable){return false}o.value=n;Object.defineProperty(r,e,o)}else{h(r,e,n)}return true}}return C(t,e,n,r)}function A(t,e,n,r,i){var o=C(t,e,n,r||t);if(!o&&i){throw new Error("failed to set property")}return n}function S(t,e){S=Object.setPrototypeOf||function t(t,e){t.__proto__=e;return t};return S(t,e)}function q(t,n){return e(t)||g(t,n)||U(t,n)||b()}function R(t,e){while(!Object.prototype.hasOwnProperty.call(t,e)){t=f(t);if(t===null)break}return t}function P(t,e){if(!e){e=t.slice(0)}return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function T(t){return e(t)||m(t)||U(t)||b()}function $(t){return n(t)||m(t)||U(t)||_()}function D(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function U(e,n){if(!e)return;if(typeof e==="string")return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}function M(t){var e=typeof Map==="function"?new Map:undefined;M=function t(t){if(t===null||!y(t))return t;if(typeof t!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof e!=="undefined"){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return u(t,arguments,f(this).constructor)}n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:false,writable:true,configurable:true}});return S(n,t)};return M(t)}function I(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(I=function(){return!!t})()}function O(t,e){var n,r,i,o,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return u([t,e])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,r&&(i=o[0]&2?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;if(r=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;r=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(o[0]===6&&a.label<i[1]){a.label=i[1];i=o;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(o);break}if(i[2])a.ops.pop();a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t];r=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}function L(){var t=P(["<slot></slot>"]);L=function e(){return t};return t}function N(){var t=P(["",""]);N=function e(){return t};return t}function V(){var t=P(["<slot></slot>"]);V=function e(){return t};return t}function H(){var t=P(['<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n<xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />\n <xsl:template match="@*|node()">\n <xsl:copy>\n <xsl:apply-templates select="@*|node()"/>\n </xsl:copy>\n </xsl:template>\n\n \x3c!-- remove existing namespaces --\x3e\n <xsl:template match="*">\n \x3c!-- remove element prefix --\x3e\n <xsl:element name="{local-name()}">\n \x3c!-- process attributes --\x3e\n <xsl:for-each select="@*">\n \x3c!-- remove attribute prefix --\x3e\n <xsl:attribute name="{local-name()}">\n <xsl:value-of select="."/>\n </xsl:attribute>\n </xsl:for-each>\n <xsl:apply-templates/>\n </xsl:element>\n</xsl:template>\n</xsl:stylesheet>']);H=function e(){return t};return t}function j(){var t=P(["\n :host {\n display: block;\n }\n"]);j=function e(){return t};return t}function Q(){var t=P(['<slot name="qti-rubric-block"></slot><slot></slot>']);Q=function e(){return t};return t}function B(){var t=P(["<slot></slot>"]);B=function e(){return t};return t}function F(){var t=P(["<slot></slot>"]);F=function e(){return t};return t}function z(){var t=P(["",""]);z=function e(){return t};return t}function W(){var t=P(["\n :host {\n display: none;\n }\n "]);W=function e(){return t};return t}function Y(){var t=P(["",""]);Y=function e(){return t};return t}function X(){var t=P(["\n :host {\n display: none;\n }\n "]);X=function e(){return t};return t}function Z(){var t=P(["<slot></slot>"]);Z=function e(){return t};return t}function G(){var t=P(["<slot></slot>"]);G=function e(){return t};return t}function K(){var t=P(["\n :host {\n display: block;\n }\n "]);K=function e(){return t};return t}function J(){var t=P([' <slot part="feedback" class="feedback ','"></slot> ']);J=function e(){return t};return t}function tt(){var t=P(["\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n "]);tt=function e(){return t};return t}function te(){var t=P([' <slot part="feedback" class="','"></slot> ']);te=function e(){return t};return t}function tn(){var t=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);tn=function e(){return t};return t}function tr(){var t=P([' <slot part="feedback" class="','"></slot> ']);tr=function e(){return t};return t}function ti(){var t=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);ti=function e(){return t};return t}function to(){var t=P(["\n /* PK: display host as block, else design will be collapsed */\n :host {\n display: block;\n }\n textarea {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border: 0;\n }\n "]);to=function e(){return t};return t}function ta(){var t=P(['<slot name="prompt"></slot\n ><textarea\n part="textarea"\n name="','"\n spellcheck="false"\n autocomplete="off"\n maxlength="','"\n @keydown="','"\n @keyup="','"\n @change="','"\n @blur="','"\n placeholder="','"\n rows="','"\n ?disabled="','"\n ?readonly="','"\n .value=',"\n ></textarea>"]);ta=function e(){return t};return t}function ts(){var t=P(["\n :host {\n display: inline-block;\n }\n [part='correct'] {\n position: absolute;\n width: 100%;\n }\n :host(.qti-input-width-1) [part='input'] {\n width: 1.1rem;\n min-width: 1.1rem;\n }\n\n :host(.qti-input-width-2) [part='input'] {\n width: 2.3rem;\n min-width: 2.3rem;\n }\n\n :host(.qti-input-width-3) [part='input'] {\n width: 3.3rem;\n min-width: 3.3rem;\n }\n\n :host(.qti-input-width-4) [part='input'] {\n width: 4.2rem;\n min-width: 4.2rem;\n }\n\n :host(.qti-input-width-6) [part='input'] {\n width: 6.6rem;\n min-width: 6.6rem;\n }\n\n :host(.qti-input-width-10) [part='input'] {\n width: 8rem;\n min-width: 8rem;\n }\n\n :host(.qti-input-width-15) [part='input'] {\n width: 12rem;\n min-width: 12rem;\n }\n\n :host(.qti-input-width-20) [part='input'] {\n width: 17rem;\n min-width: 17rem;\n }\n\n :host(.qti-input-width-25) [part='input'] {\n width: 20rem;\n min-width: 20rem;\n }\n\n :host(.qti-input-width-30) [part='input'] {\n width: 24rem;\n min-width: 24rem;\n }\n\n :host(.qti-input-width-35) [part='input'] {\n width: 28rem;\n min-width: 28rem;\n }\n\n :host(.qti-input-width-40) [part='input'] {\n width: 32rem;\n min-width: 32rem;\n }\n\n :host(.qti-input-width-45) [part='input'] {\n width: 36rem;\n min-width: 36rem;\n }\n\n :host(.qti-input-width-50) [part='input'] {\n width: 40rem;\n min-width: 40rem;\n }\n\n :host(.qti-input-width-72) [part='input'] {\n width: 57rem;\n min-width: 57rem;\n }\n"]);ts=function e(){return t};return t}function tu(){var t=P(['\n <input\n part="input"\n name="','"\n spellcheck="false"\n autocomplete="off"\n @blur="','"\n @keydown="','"\n @keyup="','"\n @change="','"\n type="','"\n placeholder="','"\n .value="','"\n pattern="','"\n maxlength=','\n ?disabled="','"\n ?readonly="','"\n />\n <div part="correct">',"</div>\n "]);tu=function e(){return t};return t}function tl(){var t=P(["<slot></slot>"]);tl=function e(){return t};return t}function tc(){var t=P(["\n :host {\n display: inline-block;\n }\n slot {\n display: flex;\n flex-direction: column;\n }\n [role='menu'] {\n position: absolute;\n z-index: 1000;\n }\n .anchor {\n /* anchor-name: --infobox; */\n width: fit-content;\n }\n\n .positionedElement {\n position: absolute;\n /* position-anchor: --infobox; */\n /* top: anchor(bottom); */\n }\n "]);tc=function e(){return t};return t}function th(){var t=P(['\n <option value="','" ?selected="','">',"</option>\n "]);th=function e(){return t};return t}function td(){var t=P(['\n <select part="select" @change="','" ?disabled="','" ?readonly="','">\n ',"\n </select>\n\n ","\n "]);td=function e(){return t};return t}function tf(){var t=P(["\n [part='slot'] {\n display: flex;\n flex-direction: column;\n gap: var(--qti-gap-size);\n flex-wrap: wrap;\n }\n\n ::slotted(qti-simple-choice) {\n flex: 0 0\n calc((100% - (var(--qti-gap-size) * var(--choice-interactions-stacking))) / var(--choice-interactions-stacking)) !important;\n box-sizing: border-box !important;\n }\n\n :host(.qti-choices-stacking-1) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 1;\n }\n\n :host(.qti-choices-stacking-2) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 2;\n }\n :host(.qti-choices-stacking-3) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 3;\n }\n :host(.qti-choices-stacking-4) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 4;\n }\n :host(.qti-choices-stacking-5) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 5;\n }\n :host([orientation='horizontal']) [part='slot'] {\n flex-direction: row;\n }\n"]);tf=function e(){return t};return t}function tp(){var t=P(['\n <slot name="prompt"></slot><slot part="slot"></slot>\n <div role="alert" id="validationMessage"></div>\n ']);tp=function e(){return t};return t}function tv(){var t=P(["<slot></slot>"]);tv=function e(){return t};return t}function ty(){var t=P(["\n :host {\n display: none;\n }\n "]);ty=function e(){return t};return t}function tm(){var t=P(["<slot></slot>"]);tm=function e(){return t};return t}function tg(){var t=P(["\n :host {\n display: none;\n }\n "]);tg=function e(){return t};return t}function tb(){var t=P(["<slot></slot>"]);tb=function e(){return t};return t}function t_(){var t=P(["<slot></slot>"]);t_=function e(){return t};return t}function tk(){var t=P(["<slot></slot>"]);tk=function e(){return t};return t}function tE(){var t=P(["",""]);tE=function e(){return t};return t}function tw(){var t=P(["<pre>","</pre>\n <slot></slot>"]);tw=function e(){return t};return t}function tx(){var t=P(["\n slot {\n display: none;\n }\n "]);tx=function e(){return t};return t}function tC(){var t=P(["",""]);tC=function e(){return t};return t}function tA(){var t=P(["",""]);tA=function e(){return t};return t}function tS(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);tS=function e(){return t};return t}function tq(){var t=P(["<slot></slot>",""]);tq=function e(){return t};return t}function tR(){var t=P(["\n :host {\n display: block; /* necessary to calculate scaling position */\n }\n slot[name='qti-simple-associable-choice'] {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n :host::part(associables-container) {\n display: flex;\n justify-content: space-between;\n background: linear-gradient(\n 180deg,\n rgb(0 0 0 / 0%) calc(50% - 1px),\n var(--qti-border-color-gray) calc(50%),\n rgb(0 0 0 / 0%) calc(50% + 1px)\n );\n }\n"]);tR=function e(){return t};return t}function tP(){var t=P(['<div part="associables-container">\n <div name="left','" part="drop-list" class="dl" identifier="droplist','_left"></div>\n <div name="right','" part="drop-list" class="dl" identifier="droplist','_right"></div>\n </div>']);tP=function e(){return t};return t}function tT(){var t=P([' <slot name="prompt"></slot>\n <slot name="qti-simple-associable-choice"></slot>\n <div part="drop-container">\n ',"\n </div>"]);tT=function e(){return t};return t}function t$(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);t$=function e(){return t};return t}function tD(){var t=P(["<iframe\n width=","\n height=",'\n frameborder="0"\n title="pciContainer"\n id="pciContainer"\n >\n </iframe>\n ',""]);tD=function e(){return t};return t}function tU(){var t=P(["<button ?disabled=",' part="button" @click=',">","</button>"]);tU=function e(){return t};return t}function tM(){var t=P(['<slot name="prompt"> </slot><slot part="drags" name="qti-gap-text"></slot> <slot part="drops"></slot>']);tM=function e(){return t};return t}function tI(){var t=P(["\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n gap: 0.5rem;\n }\n\n :host(.qti-choices-top) {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) {\n flex-direction: row;\n }\n :host(.qti-choices-right) {\n flex-direction: row-reverse;\n }\n /* [part='drops'] , */\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n gap: 0.5rem;\n }\n "]);tI=function e(){return t};return t}function tO(){var t=P(['\n <line\n part="line"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="red"\n stroke-width="3"\n @click=',"\n />\n "]);tO=function e(){return t};return t}function tL(){var t=P(['<line\n part="point"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="red"\n stroke-width="3"\n />']);tL=function e(){return t};return t}function tN(){var t=P(['<slot name="prompt"></slot>\n <line-container>\n <svg\n width=',"\n height=",'\n viewbox="0 0 '," ",'"\n >\n ',"\n ","\n </svg>\n <slot></slot>\n </line-container>"]);tN=function e(){return t};return t}function tV(){var t=P(["\n slot:not([name='prompt']) {\n // position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n ::slotted(qti-associable-hotspot) {\n transform: translate(-50%, -50%);\n }\n line-container {\n display: block;\n position: relative;\n }\n svg {\n position: absolute;\n top: 0px;\n left: 0px;\n }\n "]);tV=function e(){return t};return t}function tH(){var t=P([' <slot name="prompt"></slot>\n <slot></slot>\n <slot name="qti-gap-img"></slot>']);tH=function e(){return t};return t}function tj(){var t=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n slot[name='qti-gap-img'] {\n display: flex;\n gap: 1rem;\n }\n "]);tj=function e(){return t};return t}function tQ(){var t=P(['\n <slot name="prompt"></slot>\n \x3c!-- slot for the prompt --\x3e\n <slot></slot>\n \x3c!-- slot for the image and hotspots --\x3e\n ']);tQ=function e(){return t};return t}function tB(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n "]);tB=function e(){return t};return t}function tF(){var t=P(['\n <slot name="prompt"></slot>\n \x3c!-- slot for the prompt --\x3e\n <slot></slot>\n \x3c!-- slot for the image and hotspots --\x3e\n ']);tF=function e(){return t};return t}function tz(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n /* width:100%; */\n }\n "]);tz=function e(){return t};return t}function tW(){var t=P(['\n <slot part="slot"></slot>\n <slot part="dropslot" name="qti-simple-associable-choice"></slot>\n ']);tW=function e(){return t};return t}function tY(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n slot {\n width: 100%;\n display: block;\n }\n slot[name='qti-simple-associable-choice'] {\n width: 100%;\n }\n "]);tY=function e(){return t};return t}function tX(){var t=P(["\n slot {\n /* slot where the */\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n align-items: flex-start; /* prevents the drag and drop container slots having the same height */\n }\n :host(.qti-choices-top) slot {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) slot {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) slot {\n flex-direction: row;\n }\n :host(.qti-choices-right) slot {\n flex-direction: row-reverse;\n }\n slot[name='prompt'] {\n display: block;\n }\n ::slotted(qti-simple-match-set) {\n /* Make sure the drag and drop container slots have the same width */\n flex: 1;\n }\n"]);tX=function e(){return t};return t}function tZ(){var t=P(['<th part="r-header">',"</th>"]);tZ=function e(){return t};return t}function tG(){var t=P(["<td>\n <input\n type=","\n part=","\n name=","\n value=","\n .disabled=","\n @change=","\n @click=","\n />\n </td>"]);tG=function e(){return t};return t}function tK(){var t=P(['<tr>\n <td part="c-header">',"</td>\n ","\n </tr>"]);tK=function e(){return t};return t}function tJ(){var t=P(['\n <slot name="prompt"></slot>\n <table>\n <tr>\n <td></td>\n ',"\n </tr>\n\n ","\n </table>\n "]);tJ=function e(){return t};return t}function t0(){var t=P(['<slot name="prompt"></slot> <slot></slot>']);t0=function e(){return t};return t}function t1(){var t=P([' <slot name="prompt"></slot>\n <slot></slot>']);t1=function e(){return t};return t}function t2(){var t=P([""]);t2=function e(){return t};return t}function t3(){var t=P(['<drop-list part="drop-list" identifier="droplist','"></drop-list>',""]);t3=function e(){return t};return t}function t4(){var t=P([' <slot name="prompt"> </slot>\n <div part="container">\n <slot part="drags"> </slot>\n <div part="drops">\n ',"\n </div>\n </div>"]);t4=function e(){return t};return t}function t5(){var t=P(["\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n }\n\n [part='drops'] {\n flex: 1;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr;\n }\n\n :host([orientation='horizontal']) [part='drags'] {\n flex-direction: row;\n }\n :host([orientation='horizontal']) [part='drops'] {\n grid-auto-flow: column;\n }\n :host([orientation='vertical']) [part='drags'] {\n flex-direction: column;\n }\n :host([orientation='vertical']) [part='drops'] {\n grid-auto-flow: row;\n }\n\n [part='drop-list'] {\n display: block;\n flex: 1;\n }\n\n [part='container'] {\n display: flex;\n gap: 0.5rem;\n }\n :host(.qti-choices-top) [part='container'] {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) [part='container'] {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) [part='container'] {\n flex-direction: row;\n }\n :host(.qti-choices-right) [part='container'] {\n flex-direction: row-reverse;\n }\n "]);t5=function e(){return t};return t}function t6(){var t=P(["<slot></slot>"]);t6=function e(){return t};return t}function t9(){var t=P(["\n :host {\n display: block;\n }\n ::slotted(img) {\n position: absolute;\n cursor: move;\n user-select: none;\n left: 50%;\n transform: translateX(-50%);\n }\n "]);t9=function e(){return t};return t}function t7(){var t=P(["<slot></slot>"]);t7=function e(){return t};return t}function t8(){var t=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n "]);t8=function e(){return t};return t}function et(){var t=P(['\n <button\n part="point"\n style=','\n aria-label="Remove point at ','"\n @click=',"\n ></button>\n "]);et=function e(){return t};return t}function ee(){var t=P([' <slot name="prompt"></slot>\n <point-container>\n ',"\n <slot></slot>\n </point-container>"]);ee=function e(){return t};return t}function en(){var t=P(["\n :host {\n display: block;\n }\n point-container {\n display: block;\n position: relative;\n }\n "]);en=function e(){return t};return t}function er(){var t=P(['<div id="bounds" part="bounds">\n <div>',"</div>\n <div>","</div>\n </div>"]);er=function e(){return t};return t}function ei(){var t=P(['<div id="ticks" part="ticks"></div>']);ei=function e(){return t};return t}function eo(){var t=P(['<div id="value" part="value">',"</div>"]);eo=function e(){return t};return t}function ea(){var t=P(['<slot name="prompt"></slot>\n <div id="slider" part="slider">\n ',"\n ",'\n <div id="rail" part="rail" @mousedown='," @touchstart=",'>\n <div id="knob" part="knob">\n ',"\n </div>\n </div>\n </div>"]);ea=function e(){return t};return t}function es(){var t=P([""]);es=function e(){return t};return t}function eu(){var t=P(["<slot @slotchange=","></slot>"]);eu=function e(){return t};return t}function el(){var t=P([' <slot name="qti-gap-img"></slot> ']);el=function e(){return t};return t}function ec(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);ec=function e(){return t};return t}function eh(){var t=P([' <slot name="qti-gap-text"></slot>']);eh=function e(){return t};return t}function ed(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);ed=function e(){return t};return t}function ef(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);ef=function e(){return t};return t}function ep(){var t=P(["<slot></slot>"]);ep=function e(){return t};return t}function ev(){var t=P(["\n :host {\n display: inline-flex;\n user-select: none;\n }\n "]);ev=function e(){return t};return t}function ey(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);ey=function e(){return t};return t}function em(){var t=P(['<div part="ch"><div part="cha"></div></div>\n <slot></slot> ']);em=function e(){return t};return t}function eg(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);eg=function e(){return t};return t}function eb(){var t=P(["\n :host {\n display: block;\n cursor: pointer;\n }\n "]);eb=function e(){return t};return t}function e_(){var t=P([" <slot></slot> "]);e_=function e(){return t};return t}function ek(){var t=P(['<div id="label">',"</div>"]);ek=function e(){return t};return t}function eE(){var t=P(['<div part="ch">\n <div part="cha"></div>\n </div>\n ','\n <slot part="slot"></slot> ']);eE=function e(){return t};return t}function ew(){var t=P(["\n :host {\n display: flex;\n align-items: center;\n user-select: none;\n }\n slot {\n width: 100%;\n display: flex;\n align-items: center;\n }\n [part='ch'] {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n "]);ew=function e(){return t};return t}var QtiComponents=function(){var t=function t(t){var e=t.context;return function(t,n){var r=new WeakMap;if((typeof n==="undefined"?"undefined":D(n))=="object")return n.addInitializer(function(){r.set(this,new eF(this,{context:e}))}),{get:function e(){return t.get.call(this)},set:function e(e){var n;return(n=r.get(this))===null||n===void 0?void 0:n.setValue(e),t.set.call(this,e)},init:function t(t){var e;return(e=r.get(this))===null||e===void 0?void 0:e.setValue(t),t}};{t.constructor.addInitializer(function(t){r.set(t,new eF(t,{context:e}))});var i=Object.getOwnPropertyDescriptor(t,n),o;if(i===void 0){var a=new WeakMap;o={get:function t(){return a.get(this)},set:function t(t){r.get(this).setValue(t),a.set(this,t)},configurable:!0,enumerable:!0}}else{var s=i.set;o=w(k({},i),{set:function t(t){r.get(this).setValue(t),s===null||s===void 0?void 0:s.call(this,t)}})}return void Object.defineProperty(t,n,o)}}};var e=function t(t){var e=t.context,n=t.subscribe;return function(t,r){(typeof r==="undefined"?"undefined":D(r))=="object"?r.addInitializer(function(){var r=this;new ej(this,{context:e,callback:function(e){t.set.call(r,e)},subscribe:n})}):t.constructor.addInitializer(function(t){new ej(t,{context:e,callback:function(e){t[r]=e},subscribe:n})})}};var n=function t(t,e){if(!nP(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return nE!==void 0?nE.createHTML(e):e};var r=function t(t){return function(e,n){return(typeof n==="undefined"?"undefined":D(n))=="object"?rr(t,e,n):function(t,e,n){var r=e.hasOwnProperty(n);return e.constructor.createProperty(n,r?w(k({},t),{wrapped:!0}):t),r?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}};var i=function t(t){return r(w(k({},t),{state:!0,attribute:!1}))};var u=function t(t,e){return function(n,r,i){var o=function(e){var n;var r;return(r=(n=e.renderRoot)===null||n===void 0?void 0:n.querySelector(t))!==null&&r!==void 0?r:null};if(e){var a=(typeof r==="undefined"?"undefined":D(r))=="object"?n:i!==null&&i!==void 0?i:function(){var t=Symbol();return{get:function e(){return this[t]},set:function e(e){this[t]=e}}}(),s=a.get,u=a.set;return ri(n,r,{get:function t(){var t=s.call(this);return t===void 0&&(t=o(this),(t!==null||this.hasUpdated)&&u.call(this,t)),t}})}return ri(n,r,{get:function t(){return o(this)}})}};var l=function t(t){return function(e,n){var r=t!==null&&t!==void 0?t:{},i=r.slot,o=r.selector,a="slot"+(i?"[name=".concat(i,"]"):":not([name])");return ri(e,n,{get:function e(){var e;var n;var r=(e=this.renderRoot)===null||e===void 0?void 0:e.querySelector(a),i=(n=r===null||r===void 0?void 0:r.assignedElements(t))!==null&&n!==void 0?n:[];return o===void 0?i:i.filter(function(t){return t.matches(o)})}})}};var h=function t(t,e){var n=k({waitUntilFirstUpdate:!1},e);return function(e,r){var i=e.update,o=Array.isArray(t)?t:[t];e.update=function(t){var e=this;o.forEach(function(i){var o=i;if(t.has(o)){var a=t.get(o),s=e[o];a!==s&&(!n.waitUntilFirstUpdate||e.hasUpdated)&&e[r](a,s)}}),i.call(this,t)}}};var y=function t(t,e,n){t.querySelectorAll(e).forEach(function(t){var r="".concat(e,"-").concat(n),i=g(t,r);t.replaceWith(i)})};var m=function t(t,e){t.querySelectorAll("*").forEach(function(t){var n=t.classList;n&&n.forEach(function(n){if(n.startsWith("".concat(e,":"))){var r=n.slice("".concat(e,":").length),i="".concat(t.nodeName,"-").concat(r),o=g(t,i);t.replaceWith(o)}})})};var g=function t(t,e){var n=document.createElement(e);var r=true,i=false,o=undefined;try{for(var a=t.attributes[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;n.setAttribute(u.name,u.value)}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}for(;t.firstChild;)n.appendChild(t.firstChild);return n};var b=function t(t){var e=[];return t.querySelectorAll("qti-assessment-item-ref").forEach(function(t){var n=t.getAttribute("identifier"),r=t.getAttribute("href"),i=t.getAttribute("category");e.push({identifier:n,href:r,category:i})}),e};var _=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return e&&rc!==null&&rc.abort(),new Promise(function(e,n){var r=new XMLHttpRequest;rc=r,r.open("GET",t,!0),r.responseType="document",r.onload=function(){r.status>=200&&r.status<300?e(r.responseXML):n(r.statusText)},r.onerror=function(){n(r.statusText)},r.send()})};var E=function t(t){return new DOMParser().parseFromString(t,"text/xml")};var x=function t(t){var e=new XSLTProcessor,n=new DOMParser().parseFromString(rl,"text/xml");return e.importStylesheet(n),e.transformToFragment(t,document)};var C=function t(t,e){e.endsWith("/")||(e+="/"),t.querySelectorAll("[src],[href],[primary-path]").forEach(function(t){var n;var r="";t.getAttribute("src")&&(r="src"),t.getAttribute("href")&&(r="href"),t.getAttribute("primary-path")&&(r="primary-path");var i=(n=t.getAttribute(r))===null||n===void 0?void 0:n.trim();if(!i.startsWith("data:")&&!i.startsWith("http")){var o=e+encodeURI(i);t.setAttribute(r,o)}})};var S=function t(t){t.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(function(t){var e=document.createComment(t.textContent);t.replaceChild(e,t.firstChild)})};var R=function t(t){t.querySelectorAll("qti-stylesheet").forEach(function(t){return t.remove()})};var P=function t(t,e){var n=/*#__PURE__*/function(t){"use strict";p(n,t);function n(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}s(this,n);var i;i=a(this,n,$(e));i.identifier="";i.tabIndex=0;i.disabled=!1;i.readonly=!1;i.internals=i.attachInternals();return i}c(n,[{key:"handleDisabledChange",value:function t(t,e){this.tabIndex=e?-1:0,e&&this.blur()}},{key:"connectedCallback",value:function t(){d(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("register-".concat(e),{bubbles:!0,composed:!0}))}},{key:"disconnectedCallback",value:function t(){d(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("unregister-".concat(e),{bubbles:!0,composed:!0}))}},{key:"_onKeyUp",value:function t(t){t.altKey||t.code==="Space"&&(t.preventDefault(),this._activate())}},{key:"_onClick",value:function t(){this.disabled||this.readonly||(this.focus(),this._activate())}},{key:"_activate",value:function t(){this.disabled||this.readonly||this.dispatchEvent(new CustomEvent("activate-".concat(e),{bubbles:!0,composed:!0,detail:{identifier:this.identifier}}))}},{key:"render",value:function t(){return nH(L())}}]);return n}(t);return eN([r({type:String})],n.prototype,"identifier",2),eN([r({type:Number,reflect:!0,attribute:"tabindex"})],n.prototype,"tabIndex",2),eN([r({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:rv})],n.prototype,"disabled",2),eN([r({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:rv})],n.prototype,"readonly",2),eN([h("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"handleDisabledChange",1),n};var U=function t(t){return t==null};var I=function t(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")};var ex=function t(t){this._$AN!==void 0?(rY(this),this._$AM=t,rX(this)):this._$AM=t};var eC=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;var r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(var o=n;o<r.length;o++)rW(r[o],!1),rY(r[o]);else r!=null&&(rW(r,!1),rY(r));else rW(this,t)};var eA=function t(t){return /*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculateChildren",value:function t(t){return t.map(function(t){var e=t;if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var n=e.calculate(),r=!1;if(typeof n=="string")if(n==="true")r=!0;else if(n==="false")r=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(r=n);return r}).every(function(t){return typeof t=="boolean"&&t})}}]);return e}(t)};var eS=function t(t,e){var n,r=k({},e);return function(e,r){var i=e.connectedCallback,o=e.disconnectedCallback;e.connectedCallback=function(){var e=this;i.call(this);var o=function(n){var i=Array.from(e.querySelectorAll(t));var o=true,a=false,s=undefined;try{for(var u=n[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true){var c=l.value;var h=Array.from(c.addedNodes).map(function(t){return t}),d=Array.from(c.addedNodes).map(function(t){return t});c.type==="childList"&&h.find(function(t){return i.includes(t)})&&e[r](h,d)}}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}};n=new MutationObserver(o),n.observe(this,{childList:!0,subtree:!0});var a;var s=(a=this.querySelectorAll(t))!==null&&a!==void 0?a:[];this[r](Array.from(s),[])},e.disconnectedCallback=function(){o.call(this),n.disconnect()}}};var eq=function t(t,e,n,r){switch(t){case"circle":{var i=q(e,3),o=i[0],a=i[1],s=i[2],u=o/n.width*100,l=a/n.height*100,c=s/n.width*100;r.style.left=u-c+"%",r.style.top=l-c+"%",r.style.width=r.style.height=4*c+"px",r.style.borderRadius="9999px"}break;case"rect":{var h=q(e,4),d=h[0],f=h[1],p=h[2],v=h[3],y=d/n.width*100,m=f/n.height*100,g=p/n.width*100,b=v/n.height*100;r.style.left=y+"%",r.style.top=m+"%",r.style.width=g-y+"%",r.style.height=b-m+"%"}break;case"poly":{var _,k,E,w;var x=e.reduce(function(t,e,n,r){if(n%2===1){var i=t.pop();t[t.length]={x:i,y:r[n]}}else t.push(e);return t},[]),C=(_=Math).min.apply(_,$(x.map(function(t){return t.x}))),A=(k=Math).max.apply(k,$(x.map(function(t){return t.x}))),S=(E=Math).min.apply(E,$(x.map(function(t){return t.y}))),R=(w=Math).max.apply(w,$(x.map(function(t){return t.y}))),P=C/n.width*100,T=S/n.height*100,D=A/n.width*100,U=R/n.height*100;r.style.left=C/n.width*100+"%",r.style.top=S/n.height*100+"%",r.style.width=D-P+"%",r.style.height=U-T+"%";var M=x.map(function(t){return{x:(t.x-C)/(A-C)*100,y:(t.y-S)/(R-S)*100}}).map(function(t){return Math.round(t.x)+"% "+Math.round(t.y)+"%"}).join(",");r.style.clipPath="polygon(".concat(M,")")}break;default:break}};var eR=function t(t){var e=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"assessmentItem",get:function t(){var t;return(t=this.renderRoot)===null||t===void 0?void 0:t.querySelector("qti-assessment-item")}},{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return d(f(e.prototype),"connectedCallback",t)};return o(function(){return O(this,function(t){switch(t.label){case 0:r().call(n);return[4,n.updateComplete];case 1:t.sent(),n.dispatchEvent(new CustomEvent("qti-item-connected",{bubbles:!0,composed:!0,detail:{identifier:n.identifier,href:n.href}}));return[2]}})})()}},{key:"render",value:function t(){return nH(N(),this.xmlDoc)}}]);return e}(t);return eN([r({type:String,reflect:!0})],e.prototype,"identifier",2),eN([r({type:String})],e.prototype,"href",2),eN([r({type:Object,attribute:!1})],e.prototype,"xmlDoc",2),e};var eP,eT;var e$=Object.defineProperty;var eD=Object.getOwnPropertyDescriptor;var eU=Object.getOwnPropertyNames;var eM=Object.prototype.hasOwnProperty;var eI=function(t,e){for(var n in e)e$(t,n,{get:e[n],enumerable:!0})},eO=function(t,e,n,r){var i=true,o=false,a=undefined;if(e&&(typeof e==="undefined"?"undefined":D(e))=="object"||typeof e=="function")try{var s=function(){var i=l.value;!eM.call(t,i)&&i!==n&&e$(t,i,{get:function(){return e[i]},enumerable:!(r=eD(e,i))||r.enumerable})};for(var u=eU(e)[Symbol.iterator](),l;!(i=(l=u.next()).done);i=true)s()}catch(t){o=true;a=t}finally{try{if(!i&&u.return!=null){u.return()}}finally{if(o){throw a}}}return t};var eL=function(t){return eO(e$({},"__esModule",{value:!0}),t)},eN=function(t,e,n,r){for(var i=r>1?void 0:r?eD(e,n):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(i=(r?a(e,n,i):a(i))||i);return r&&i&&e$(e,n,i),i};var eV={};eI(eV,{ActiveElementMixin:function(){return P},Interaction:function(){return rD},QtiAnd:function(){return iE},QtiAssessmentItem:function(){return rs},QtiAssessmentStimulusRef:function(){return rp},QtiAssociableHotspot:function(){return of},QtiAssociateInteraction:function(){return i0},QtiBaseValue:function(){return iw},QtiChoiceInteraction:function(){return ii},QtiCompanionMaterialsInfo:function(){return rw},QtiConditionExpression:function(){return ik},QtiContains:function(){return ix},QtiContentBody:function(){return rx},QtiCorrect:function(){return iC},QtiCustomInteraction:function(){return i1},QtiCustomOperator:function(){return od},QtiEndAttemptInteraction:function(){return i2},QtiEqual:function(){return iq},QtiEqualRounded:function(){return iA},QtiExpression:function(){return i_},QtiExtendedTextInteraction:function(){return rU},QtiFeedbackBlock:function(){return rR},QtiFeedbackInline:function(){return rP},QtiGap:function(){return op},QtiGapImg:function(){return ov},QtiGapMatchInteraction:function(){return i3},QtiGapText:function(){return oy},QtiGraphicAssociateInteraction:function(){return i6},QtiGraphicGapMatchInteraction:function(){return i9},QtiGraphicOrderInteraction:function(){return i7},QtiGt:function(){return iR},QtiGte:function(){return iP},QtiHotspotChoice:function(){return om},QtiHotspotInteraction:function(){return i8},QtiHottext:function(){return og},QtiHottextInteraction:function(){return r5},QtiInlineChoice:function(){return ob},QtiInlineChoiceInteraction:function(){return r7},QtiIsNull:function(){return iT},QtiItem:function(){return ok},QtiItemBody:function(){return rm},QtiItemMixin:function(){return eR},QtiLookupOutcomeValue:function(){return id},QtiLt:function(){return i$},QtiLte:function(){return iD},QtiMapResponse:function(){return iU},QtiMapping:function(){return iM},QtiMatch:function(){return iI},QtiMatchInteraction:function(){return on},QtiMediaInteraction:function(){return or},QtiMember:function(){return iO},QtiModalFeedback:function(){return rT},QtiMultiple:function(){return iL},QtiNot:function(){return iN},QtiOr:function(){return iV},QtiOrderInteraction:function(){return oi},QtiOrdered:function(){return iH},QtiOutcomeDeclaration:function(){return rk},QtiOutcomeProcessing:function(){return io},QtiOutcomeProcessingProcessor:function(){return ia},QtiPortableCustomInteraction:function(){return iY},QtiPositionObjectStage:function(){return oa},QtiPrintedVariable:function(){return ij},QtiProduct:function(){return iQ},QtiPrompt:function(){return rg},QtiResponseCondition:function(){return ip},QtiResponseDeclaration:function(){return rE},QtiResponseElse:function(){return im},QtiResponseElseIf:function(){return ib},QtiResponseIf:function(){return ig},QtiResponseProcessing:function(){return ic},QtiRubricBlock:function(){return rC},QtiRule:function(){return ih},QtiSPositionObjectInteraction:function(){return oo},QtiSelectPointInteraction:function(){return oc},QtiSetOutcomeValue:function(){return iv},QtiSetOutcomeValueRule:function(){return iy},QtiSimpleAssociableChoice:function(){return ot},QtiSimpleChoice:function(){return o_},QtiSliderInteraction:function(){return oh},QtiStringMatch:function(){return iB},QtiStylesheet:function(){return rb},QtiSum:function(){return iF},QtiSumExpression:function(){return iz},QtiTextEntryInteraction:function(){return r3},QtiVariable:function(){return iW},getItemByUri:function(){return ow},getManifestInfo:function(){return oE},itemContext:function(){return ra},itemContextVariables:function(){return ro},qtiAndMixin:function(){return eA},qtiTransformItem:function(){return rh},qtiTransformManifest:function(){return rd},qtiTransformTest:function(){return rf}});var eH=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t,n,r){s(this,e);var i;i=a(this,e,["context-request",{bubbles:!0,composed:!0}]),i.context=t,i.callback=n,i.subscribe=r!==null&&r!==void 0?r:!1;return i}return e}(M(Event));var ej=/*#__PURE__*/function(){"use strict";function t(e,n,r,i){var o=this;s(this,t);if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=function(t,e){o.unsubscribe&&(o.unsubscribe!==e&&(o.provided=!1,o.unsubscribe()),o.subscribe||o.unsubscribe()),o.value=t,o.host.requestUpdate(),o.provided&&!o.subscribe||(o.provided=!0,o.callback&&o.callback(t,e)),o.unsubscribe=e},this.host=e,n.context!==void 0){var a=n;var u;this.context=a.context,this.callback=a.callback,this.subscribe=(u=a.subscribe)!==null&&u!==void 0?u:!1}else this.context=n,this.callback=r,this.subscribe=i!==null&&i!==void 0?i:!1;this.host.addController(this)}c(t,[{key:"hostConnected",value:function t(){this.dispatchRequest()}},{key:"hostDisconnected",value:function t(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}},{key:"dispatchRequest",value:function t(){this.host.dispatchEvent(new eH(this.context,this.t,this.subscribe))}}]);return t}();var eQ=/*#__PURE__*/function(){"use strict";function t(e){var n=this;s(this,t);this.subscriptions=new Map,this.updateObservers=function(){var t=true,e=false,r=undefined;try{for(var i=n.subscriptions[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=q(o.value,2),s=a[0],u=a[1],l=u.disposer;s(n.o,l)}}catch(t){e=true;r=t}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(e){throw r}}}},e!==void 0&&(this.value=e)}c(t,[{key:"value",get:function t(){return this.o},set:function t(t){this.setValue(t)}},{key:"setValue",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=e||!Object.is(t,this.o);this.o=t,n&&this.updateObservers()}},{key:"addCallback",value:function t(t,e,n){var r=this;if(!n)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:function(){r.subscriptions.delete(t)},consumerHost:e});var i=this.subscriptions.get(t),o=i.disposer;t(this.value,o)}},{key:"clearCallbacks",value:function t(){this.subscriptions.clear()}}]);return t}();var eB=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t){s(this,e);var n;n=a(this,e,["context-provider",{bubbles:!0,composed:!0}]),n.context=t;return n}return e}(M(Event)),eF=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t,n,r){s(this,e);var i;var o,u;i=a(this,e,[n.context!==void 0?n.initialValue:r]),i.onContextRequest=function(t){var e=t.composedPath()[0];t.context===i.context&&e!==i.host&&(t.stopPropagation(),i.addCallback(t.callback,e,t.subscribe))},i.onProviderRequest=function(t){var e=t.composedPath()[0];if(t.context!==i.context||e===i.host)return;var n=new Set;var r=true,o=false,a=undefined;try{for(var s=i.subscriptions[Symbol.iterator](),u;!(r=(u=s.next()).done);r=true){var l=q(u.value,2),c=l[0],h=l[1],d=h.consumerHost;n.has(c)||(n.add(c),d.dispatchEvent(new eH(i.context,c,!0)))}}catch(t){o=true;a=t}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}t.stopPropagation()},i.host=t,n.context!==void 0?i.context=n.context:i.context=n,i.attachListeners(),(o=(u=i.host).addController)===null||o===void 0?void 0:o.call(u,i);return i}c(e,[{key:"attachListeners",value:function t(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}},{key:"hostConnected",value:function t(){this.host.dispatchEvent(new eB(this.context))}}]);return e}(eQ);var ez=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}c(t,[{key:"shadowRoot",get:function t(){return this.__host.__shadowRoot}},{key:"checkValidity",value:function t(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}},{key:"reportValidity",value:function t(){return!0}},{key:"setFormValue",value:function t(){}},{key:"setValidity",value:function t(){}}]);return t}();var eW=new WeakMap,eY=function(t){var e=eW.get(t);return e===void 0&&eW.set(t,e=new Map),e},eX=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}c(t,[{key:"attributes",get:function t(){return Array.from(eY(this)).map(function(t){var e=q(t,2),n=e[0],r=e[1];return{name:n,value:r}})}},{key:"shadowRoot",get:function t(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}},{key:"localName",get:function t(){return this.constructor.__localName}},{key:"tagName",get:function t(){var t;return(t=this.localName)===null||t===void 0?void 0:t.toUpperCase()}},{key:"setAttribute",value:function t(t,e){eY(this).set(t,String(e))}},{key:"removeAttribute",value:function t(t){eY(this).delete(t)}},{key:"toggleAttribute",value:function t(t,e){if(this.hasAttribute(t)){if(e===void 0||!e)return this.removeAttribute(t),!1}else return e===void 0||e?(this.setAttribute(t,""),!0):!1;return!0}},{key:"hasAttribute",value:function t(t){return eY(this).has(t)}},{key:"attachShadow",value:function t(t){var e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}},{key:"attachInternals",value:function t(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");var t=new ez(this);return this.__internals=t,t}},{key:"getAttribute",value:function t(t){var e;return(e=eY(this).get(t))!==null&&e!==void 0?e:null}}]);return t}();var eZ=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(eX),eG=eZ;var eK=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.__definitions=new Map}c(t,[{key:"define",value:function t(t,e){if(this.__definitions.has(t))if(process.env.NODE_ENV==="development")console.warn("'CustomElementRegistry' already has \"".concat(t,'" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.\nMake sure to test your application with a production build as repeat registrations will throw in production.'));else throw new Error("Failed to execute 'define' on 'CustomElementRegistry': the name \"".concat(t,'" has already been used with this registry'));var n;e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:(n=e.observedAttributes)!==null&&n!==void 0?n:[]})}},{key:"get",value:function t(t){var e;return(e=this.__definitions.get(t))===null||e===void 0?void 0:e.ctor}}]);return t}(),eJ=eK;var e0=new eJ;var e1=globalThis,e2=e1.ShadowRoot&&(e1.ShadyCSS===void 0||e1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e3=Symbol(),e4=new WeakMap,e5=/*#__PURE__*/function(){"use strict";function t(e,n,r){s(this,t);if(this._$cssResult$=!0,r!==e3)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}c(t,[{key:"styleSheet",get:function t(){var t=this.o,e=this.t;if(e2&&t===void 0){var n=e!==void 0&&e.length===1;n&&(t=e4.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&e4.set(e,t))}return t}},{key:"toString",value:function t(){return this.cssText}}]);return t}(),e6=function(t){return new e5(typeof t=="string"?t:t+"",void 0,e3)},e9=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++){n[r-1]=arguments[r]}var i=t.length===1?t[0]:n.reduce(function(e,n,r){return e+function(t){if(t._$cssResult$===!0)return t.cssText;if(typeof t=="number")return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")}(n)+t[r+1]},t[0]);return new e5(i,t,e3)},e7=function(t,e){var n=true,r=false,i=undefined;if(e2)t.adoptedStyleSheets=e.map(function(t){return v(t,CSSStyleSheet)?t:t.styleSheet});else try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;var u=document.createElement("style"),l=e1.litNonce;l!==void 0&&u.setAttribute("nonce",l),u.textContent=s.cssText,t.appendChild(u)}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}},e8=e2||e1.CSSStyleSheet===void 0?function(t){return t}:function(t){return v(t,CSSStyleSheet)?function(t){var e="";var n=true,r=false,i=undefined;try{for(var o=t.cssRules[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;e+=s.cssText}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return e6(e)}(t):t};var nt=Object.is,ne=Object.defineProperty,nn=Object.getOwnPropertyDescriptor,nr=Object.getOwnPropertyNames,ni=Object.getOwnPropertySymbols,no=Object.getPrototypeOf,na=globalThis;var ns;(ns=na.customElements)!==null&&ns!==void 0?ns:na.customElements=e0;var nu=na.trustedTypes,nl=nu?nu.emptyScript:"",nc=na.reactiveElementPolyfillSupport,nh=function(t,e){return t},nd={toAttribute:function t(t,e){switch(e){case Boolean:t=t?nl:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute:function t(t,e){var n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},nf=function(t,e){return!nt(t,e)},np={attribute:!0,type:String,converter:nd,reflect:!1,hasChanged:nf};var nv,ny;(nv=Symbol.metadata)!==null&&nv!==void 0?nv:Symbol.metadata=Symbol("metadata"),(ny=na.litPropertyMetadata)!==null&&ny!==void 0?ny:na.litPropertyMetadata=new WeakMap;var nm;var ng=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e),t._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev();return t}c(e,[{key:"_$Ev",value:function t(){var t=this;var e;this._$ES=new Promise(function(e){return t.enableUpdating=e}),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)===null||e===void 0?void 0:e.forEach(function(e){return e(t)})}},{key:"addController",value:function t(t){var e;var n;((n=this._$EO)!==null&&n!==void 0?n:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)===null||e===void 0?void 0:e.call(t))}},{key:"removeController",value:function t(t){var e;(e=this._$EO)===null||e===void 0?void 0:e.delete(t)}},{key:"_$E_",value:function t(){var t=new Map,e=this.constructor.elementProperties;var n=true,r=false,i=undefined;try{for(var o=e.keys()[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s])}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function t(){var t;var e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return e7(e,this.constructor.elementStyles),e}},{key:"connectedCallback",value:function t(){var t;var e;(e=this.renderRoot)!==null&&e!==void 0?e:this.renderRoot=this.createRenderRoot(),this.enableUpdating(!0),(t=this._$EO)===null||t===void 0?void 0:t.forEach(function(t){var e;return(e=t.hostConnected)===null||e===void 0?void 0:e.call(t)})}},{key:"enableUpdating",value:function t(t){}},{key:"disconnectedCallback",value:function t(){var t;(t=this._$EO)===null||t===void 0?void 0:t.forEach(function(t){var e;return(e=t.hostDisconnected)===null||e===void 0?void 0:e.call(t)})}},{key:"attributeChangedCallback",value:function t(t,e,n){this._$AK(t,n)}},{key:"_$EC",value:function t(t,e){var n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(r!==void 0&&n.reflect===!0){var i;var o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:nd).toAttribute(e,n.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}},{key:"_$AK",value:function t(t,e){var n=this.constructor,r=n._$Eh.get(t);if(r!==void 0&&this._$Em!==r){var i;var o=n.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:nd;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}},{key:"requestUpdate",value:function t(t,e,n){if(t!==void 0){var r;if(n!==null&&n!==void 0?n:n=this.constructor.getPropertyOptions(t),!((r=n.hasChanged)!==null&&r!==void 0?r:nf)(this[t],e))return;this.P(t,e,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}},{key:"P",value:function t(t,e,n){var r;this._$AL.has(t)||this._$AL.set(t,e),n.reflect===!0&&this._$Em!==t&&((r=this._$Ej)!==null&&r!==void 0?r:this._$Ej=new Set).add(t)}},{key:"_$ET",value:function t(){var t=this;return o(function(){var e,n,r;return O(this,function(i){switch(i.label){case 0:t.isUpdatePending=!0;i.label=1;case 1:i.trys.push([1,3,,4]);return[4,t._$ES];case 2:i.sent();return[3,4];case 3:e=i.sent();Promise.reject(e);return[3,4];case 4:n=t.scheduleUpdate();r=n!=null;if(!r)return[3,6];return[4,n];case 5:r=i.sent();i.label=6;case 6:return[2,(r,!t.isUpdatePending)]}})})()}},{key:"scheduleUpdate",value:function t(){return this.performUpdate()}},{key:"performUpdate",value:function t(){if(!this.isUpdatePending)return;if(!this.hasUpdated){var t;if((t=this.renderRoot)!==null&&t!==void 0?t:this.renderRoot=this.createRenderRoot(),this._$Ep){var e=true,n=false,r=undefined;try{for(var i=this._$Ep[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=q(o.value,2),s=a[0],u=a[1];this[s]=u}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}this._$Ep=void 0}var l=this.constructor.elementProperties;var c=true,h=false,d=undefined;if(l.size>0)try{for(var f=l[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=q(p.value,2),y=v[0],m=v[1];m.wrapped!==!0||this._$AL.has(y)||this[y]===void 0||this.P(y,this[y],m)}}catch(t){h=true;d=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(h){throw d}}}}var g=!1,b=this._$AL;try{var _;g=this.shouldUpdate(b),g?(this.willUpdate(b),(_=this._$EO)===null||_===void 0?void 0:_.forEach(function(t){var e;return(e=t.hostUpdate)===null||e===void 0?void 0:e.call(t)}),this.update(b)):this._$EU()}catch(t){throw g=!1,this._$EU(),t}g&&this._$AE(b)}},{key:"willUpdate",value:function t(t){}},{key:"_$AE",value:function t(t){var e;(e=this._$EO)===null||e===void 0?void 0:e.forEach(function(t){var e;return(e=t.hostUpdated)===null||e===void 0?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}},{key:"_$EU",value:function t(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function t(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function t(){return this._$ES}},{key:"shouldUpdate",value:function t(t){return!0}},{key:"update",value:function t(t){var e=this;this._$Ej&&(this._$Ej=this._$Ej.forEach(function(t){return e._$EC(t,e[t])})),this._$EU()}},{key:"updated",value:function t(t){}},{key:"firstUpdated",value:function t(t){}}],[{key:"addInitializer",value:function t(t){var e;this._$Ei(),((e=this.l)!==null&&e!==void 0?e:this.l=[]).push(t)}},{key:"observedAttributes",get:function t(){return this.finalize(),this._$Eh&&$(this._$Eh.keys())}},{key:"createProperty",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:np;if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){var n=Symbol(),r=this.getPropertyDescriptor(t,n,e);r!==void 0&&ne(this.prototype,t,r)}}},{key:"getPropertyDescriptor",value:function t(t,e,n){var r;var i=(r=nn(this.prototype,t))!==null&&r!==void 0?r:{get:function t(){return this[e]},set:function t(t){this[e]=t}},o=i.get,a=i.set;return{get:function t(){return o===null||o===void 0?void 0:o.call(this)},set:function e(e){var r=o===null||o===void 0?void 0:o.call(this);a.call(this,e),this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function t(t){var e;return(e=this.elementProperties.get(t))!==null&&e!==void 0?e:np}},{key:"_$Ei",value:function t(){if(this.hasOwnProperty(nh("elementProperties")))return;var t=no(this);t.finalize(),t.l!==void 0&&(this.l=$(t.l)),this.elementProperties=new Map(t.elementProperties)}},{key:"finalize",value:function t(){if(this.hasOwnProperty(nh("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(nh("properties"))){var t=this.properties,e=$(nr(t)).concat($(ni(t)));var n=true,r=false,i=undefined;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.createProperty(s,t[s])}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}var u=this[Symbol.metadata];if(u!==null){var l=litPropertyMetadata.get(u);var c=true,h=false,d=undefined;if(l!==void 0)try{for(var f=l[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=q(p.value,2),y=v[0],m=v[1];this.elementProperties.set(y,m)}}catch(t){h=true;d=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(h){throw d}}}}this._$Eh=new Map;var g=true,b=false,_=undefined;try{for(var k=this.elementProperties[Symbol.iterator](),E;!(g=(E=k.next()).done);g=true){var w=q(E.value,2),x=w[0],C=w[1];var A=this._$Eu(x,C);A!==void 0&&this._$Eh.set(A,x)}}catch(t){b=true;_=t}finally{try{if(!g&&k.return!=null){k.return()}}finally{if(b){throw _}}}this.elementStyles=this.finalizeStyles(this.styles)}},{key:"finalizeStyles",value:function t(t){var e=[];if(Array.isArray(t)){var n=new Set(t.flat(1/0).reverse());var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;e.unshift(e8(u))}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}else t!==void 0&&e.push(e8(t));return e}},{key:"_$Eu",value:function t(t,e){var n=e.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}}]);return e}((nm=globalThis.HTMLElement)!==null&&nm!==void 0?nm:eG);var nb;ng.elementStyles=[],ng.shadowRootOptions={mode:"open"},ng[nh("elementProperties")]=new Map,ng[nh("finalized")]=new Map,nc===null||nc===void 0?void 0:nc({ReactiveElement:ng}),((nb=na.reactiveElementVersions)!==null&&nb!==void 0?nb:na.reactiveElementVersions=[]).push("2.0.4");var n_=globalThis,nk=n_.trustedTypes,nE=nk?nk.createPolicy("lit-html",{createHTML:function(t){return t}}):void 0,nw="$lit$",nx="lit$".concat(Math.random().toFixed(9).slice(2),"$"),nC="?"+nx,nA="<".concat(nC,">"),nS=n_.document===void 0?{createTreeWalker:function(){return{}}}:document,nq=function(){return nS.createComment("")},nR=function(t){return t===null||(typeof t==="undefined"?"undefined":D(t))!="object"&&typeof t!="function"},nP=Array.isArray,nT=function(t){return nP(t)||typeof(t===null||t===void 0?void 0:t[Symbol.iterator])=="function"},n$="[ \n\f\r]",nD=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nU=/-->/g,nM=/>/g,nI=RegExp(">|".concat(n$,"(?:([^\\s\"'>=/]+)(").concat(n$,"*=").concat(n$,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),nO=/'/g,nL=/"/g,nN=/^(?:script|style|textarea|title)$/i,nV=function(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++){r[i-1]=arguments[i]}return{_$litType$:t,strings:e,values:r}}},nH=nV(1),nj=nV(2),nQ=nV(3),nB=Symbol.for("lit-noChange"),nF=Symbol.for("lit-nothing"),nz=new WeakMap,nW=nS.createTreeWalker(nS,129);var nY=function(t,e){var r=t.length-1,i=[],o,a=e===2?"<svg>":e===3?"<math>":"",s=nD;for(var u=0;u<r;u++){var l=t[u],c=void 0,h=void 0,d=-1,f=0;for(;f<l.length&&(s.lastIndex=f,h=s.exec(l),h!==null);)f=s.lastIndex,s===nD?h[1]==="!--"?s=nU:h[1]!==void 0?s=nM:h[2]!==void 0?(nN.test(h[2])&&(o=RegExp("</"+h[2],"g")),s=nI):h[3]!==void 0&&(s=nI):s===nI?h[0]===">"?(s=o!==null&&o!==void 0?o:nD,d=-1):h[1]===void 0?d=-2:(d=s.lastIndex-h[2].length,c=h[1],s=h[3]===void 0?nI:h[3]==='"'?nL:nO):s===nL||s===nO?s=nI:s===nU||s===nM?s=nD:(s=nI,o=void 0);var p=s===nI&&t[u+1].startsWith("/>")?" ":"";a+=s===nD?l+nA:d>=0?(i.push(c),l.slice(0,d)+nw+l.slice(d)+nx+p):l+nx+(d===-2?u:p)}return[n(t,a+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},nX=/*#__PURE__*/function(){"use strict";function t(e,n){var r=e.strings,i=e._$litType$;s(this,t);var o;this.parts=[];var a=0,u=0,l=r.length-1,c=this.parts,h=q(nY(r,i),2),d=h[0],f=h[1];if(this.el=t.createElement(d,n),nW.currentNode=this.el.content,i===2||i===3){var p;var v=this.el.content.firstChild;(p=v).replaceWith.apply(p,$(v.childNodes))}for(;(o=nW.nextNode())!==null&&c.length<l;){if(o.nodeType===1){var y=true,m=false,g=undefined;if(o.hasAttributes())try{for(var b=o.getAttributeNames()[Symbol.iterator](),_;!(y=(_=b.next()).done);y=true){var k=_.value;if(k.endsWith(nw)){var E=f[u++],w=o.getAttribute(k).split(nx),x=/([.?@])?(.*)/.exec(E);c.push({type:1,index:a,name:x[2],strings:w,ctor:x[1]==="."?n0:x[1]==="?"?n1:x[1]==="@"?n2:nJ}),o.removeAttribute(k)}else k.startsWith(nx)&&(c.push({type:6,index:a}),o.removeAttribute(k))}}catch(t){m=true;g=t}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw g}}}if(nN.test(o.tagName)){var C=o.textContent.split(nx),A=C.length-1;if(A>0){o.textContent=nk?nk.emptyScript:"";for(var S=0;S<A;S++)o.append(C[S],nq()),nW.nextNode(),c.push({type:2,index:++a});o.append(C[A],nq())}}}else if(o.nodeType===8)if(o.data===nC)c.push({type:2,index:a});else{var R=-1;for(;(R=o.data.indexOf(nx,R+1))!==-1;)c.push({type:7,index:a}),R+=nx.length-1}a++}}c(t,null,[{key:"createElement",value:function t(t,e){var n=nS.createElement("template");return n.innerHTML=t,n}}]);return t}();function nZ(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,r=arguments.length>3?arguments[3]:void 0;var i,o;if(e===nB)return e;var a=r!==void 0?(i=n._$Co)===null||i===void 0?void 0:i[r]:n._$Cl,s=nR(e)?void 0:e._$litDirective$;var u;return(a===null||a===void 0?void 0:a.constructor)!==s&&(a===null||a===void 0?void 0:(o=a._$AO)===null||o===void 0?void 0:o.call(a,!1),s===void 0?a=void 0:(a=new s(t),a._$AT(t,n,r)),r!==void 0?((u=n._$Co)!==null&&u!==void 0?u:n._$Co=[])[r]=a:n._$Cl=a),a!==void 0&&(e=nZ(t,a._$AS(t,e.values),a,r)),e}var nG=/*#__PURE__*/function(){"use strict";function t(e,n){s(this,t);this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}c(t,[{key:"parentNode",get:function t(){return this._$AM.parentNode}},{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"u",value:function t(t){var e;var n=this._$AD,r=n.el,i=r.content,o=n.parts,a=((e=t===null||t===void 0?void 0:t.creationScope)!==null&&e!==void 0?e:nS).importNode(i,!0);nW.currentNode=a;var s=nW.nextNode(),u=0,l=0,c=o[0];for(;c!==void 0;){if(u===c.index){var h=void 0;c.type===2?h=new nK(s,s.nextSibling,this,t):c.type===1?h=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(h=new n3(s,this,t)),this._$AV.push(h),c=o[++l]}u!==(c===null||c===void 0?void 0:c.index)&&(s=nW.nextNode(),u++)}return nW.currentNode=nS,a}},{key:"p",value:function t(t){var e=0;var n=true,r=false,i=undefined;try{for(var o=this._$AV[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}}]);return t}(),nK=/*#__PURE__*/function(){"use strict";function t(e,n,r,i){s(this,t);var o;this.type=2,this._$AH=nF,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=(o=i===null||i===void 0?void 0:i.isConnected)!==null&&o!==void 0?o:!0}c(t,[{key:"_$AU",get:function t(){var t;var e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cv}},{key:"parentNode",get:function t(){var t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t===null||t===void 0?void 0:t.nodeType)===11&&(t=e.parentNode),t}},{key:"startNode",get:function t(){return this._$AA}},{key:"endNode",get:function t(){return this._$AB}},{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;t=nZ(this,t,e),nR(t)?t===nF||t==null||t===""?(this._$AH!==nF&&this._$AR(),this._$AH=nF):t!==this._$AH&&t!==nB&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):nT(t)?this.k(t):this._(t)}},{key:"O",value:function t(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}},{key:"T",value:function t(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}},{key:"_",value:function t(t){this._$AH!==nF&&nR(this._$AH)?this._$AA.nextSibling.data=t:this.T(nS.createTextNode(t)),this._$AH=t}},{key:"$",value:function t(t){var e;var r=t.values,i=t._$litType$,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=nX.createElement(n(i.h,i.h[0]),this.options)),i);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===o)this._$AH.p(r);else{var a=new nG(o,this),s=a.u(this.options);a.p(r),this.T(s),this._$AH=a}}},{key:"_$AC",value:function t(t){var e=nz.get(t.strings);return e===void 0&&nz.set(t.strings,e=new nX(t)),e}},{key:"k",value:function e(e){nP(this._$AH)||(this._$AH=[],this._$AR());var n=this._$AH,r,i=0;var o=true,a=false,s=undefined;try{for(var u=e[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true){var c=l.value;i===n.length?n.push(r=new t(this.O(nq()),this.O(nq()),this,this.options)):r=n[i],r._$AI(c),i++}}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}},{key:"_$AR",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;var n,r;for((n=(r=this)._$AP)===null||n===void 0?void 0:n.call(r,!1,!0,e);t&&t!==this._$AB;){var i=t.nextSibling;t.remove(),t=i}}},{key:"setConnected",value:function t(t){var e,n;this._$AM===void 0&&(this._$Cv=t,(e=(n=this)._$AP)===null||e===void 0?void 0:e.call(n,t))}}]);return t}(),nJ=/*#__PURE__*/function(){"use strict";function t(e,n,r,i,o){s(this,t);this.type=1,this._$AH=nF,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=nF}c(t,[{key:"tagName",get:function t(){return this.element.tagName}},{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;var i=this.strings,o=!1;if(i===void 0)t=nZ(this,t,e,0),o=!nR(t)||t!==this._$AH&&t!==nB,o&&(this._$AH=t);else{var a=t,s,u;for(t=i[0],s=0;s<i.length-1;s++)u=nZ(this,a[n+s],e,s),u===nB&&(u=this._$AH[s]),o||(o=!nR(u)||u!==this._$AH[s]),u===nF?t=nF:t!==nF&&(t+=(u!==null&&u!==void 0?u:"")+i[s+1]),this._$AH[s]=u}o&&!r&&this.j(t)}},{key:"j",value:function t(t){t===nF?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!==null&&t!==void 0?t:"")}}]);return t}(),n0=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.type=3;return t}c(e,[{key:"j",value:function t(t){this.element[this.name]=t===nF?void 0:t}}]);return e}(nJ),n1=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.type=4;return t}c(e,[{key:"j",value:function t(t){this.element.toggleAttribute(this.name,!!t&&t!==nF)}}]);return e}(nJ),n2=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t,n,r,i,o){s(this,e);var u;u=a(this,e,[t,n,r,i,o]),u.type=5;return u}c(e,[{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;var n;if((t=(n=nZ(this,t,e,0))!==null&&n!==void 0?n:nF)===nB)return;var r=this._$AH,i=t===nF&&r!==nF||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==nF&&(r===nF||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}},{key:"handleEvent",value:function t(t){var e;var n;typeof this._$AH=="function"?this._$AH.call((n=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&n!==void 0?n:this.element,t):this._$AH.handleEvent(t)}}]);return e}(nJ),n3=/*#__PURE__*/function(){"use strict";function t(e,n,r){s(this,t);this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}c(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){nZ(this,t)}}]);return t}(),n4={M:nw,P:nx,A:nC,C:1,L:nY,R:nG,D:nT,V:nZ,I:nK,H:nJ,N:n1,U:n2,B:n0,F:n3},n5=n_.litHtmlPolyfillSupport;var n6;n5===null||n5===void 0?void 0:n5(nX,nK),((n6=n_.litHtmlVersions)!==null&&n6!==void 0?n6:n_.litHtmlVersions=[]).push("3.2.1");var n9=function(t,e,n){var r;var i=(r=n===null||n===void 0?void 0:n.renderBefore)!==null&&r!==void 0?r:e,o=i._$litPart$;if(o===void 0){var a;var s=(a=n===null||n===void 0?void 0:n.renderBefore)!==null&&a!==void 0?a:null;i._$litPart$=o=new nK(e.insertBefore(nq(),s),s,void 0,n!==null&&n!==void 0?n:{})}return o._$AI(t),o};var n7=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.renderOptions={host:t},t._$Do=void 0;return t}c(e,[{key:"createRenderRoot",value:function t(){var t;var n=d(f(e.prototype),"createRenderRoot",this).call(this);var r;return(r=(t=this.renderOptions).renderBefore)!==null&&r!==void 0?r:t.renderBefore=n.firstChild,n}},{key:"update",value:function t(t){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),d(f(e.prototype),"update",this).call(this,t),this._$Do=n9(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function t(){var t;d(f(e.prototype),"connectedCallback",this).call(this),(t=this._$Do)===null||t===void 0?void 0:t.setConnected(!0)}},{key:"disconnectedCallback",value:function t(){var t;d(f(e.prototype),"disconnectedCallback",this).call(this),(t=this._$Do)===null||t===void 0?void 0:t.setConnected(!1)}},{key:"render",value:function t(){return nB}}]);return e}(ng);n7._$litElement$=!0,n7.finalized=!0,(eP=(eT=globalThis).litElementHydrateSupport)===null||eP===void 0?void 0:eP.call(eT,{LitElement:n7});var n8=globalThis.litElementPolyfillSupport;n8===null||n8===void 0?void 0:n8({LitElement:n7});var rt;((rt=globalThis.litElementVersions)!==null&&rt!==void 0?rt:globalThis.litElementVersions=[]).push("4.1.1");var re=function(t){return function(e,n){n!==void 0?n.addInitializer(function(){customElements.define(t,e)}):customElements.define(t,e)}};var rn={attribute:!0,type:String,converter:nd,reflect:!1,hasChanged:nf},rr=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rn,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;var r=n.kind,i=n.metadata,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(n.name,t),r==="accessor"){var a=n.name;return{set:function n(n){var r=e.get.call(this);e.set.call(this,n),this.requestUpdate(a,r,t)},init:function e(e){return e!==void 0&&this.P(a,void 0,t),e}}}if(r==="setter"){var s=n.name;return function n(n){var r=this[s];e.call(this,n),this.requestUpdate(s,r,t)}}throw Error("Unsupported decorator location: "+r)};var ri=function(t,e,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&(typeof e==="undefined"?"undefined":D(e))!="object"&&Object.defineProperty(t,e,n),n};var ro=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],ra=Symbol("item");var rs=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t.identifier="";t.adaptive="false";t.timeDependent=null;t._handleDisabledChange=function(e,n){t._interactionElements.forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){return t._interactionElements.forEach(function(t){return t.readonly=n})};t._context={identifier:t.getAttribute("identifier"),variables:ro};t._initialContext=w(k({},t._context),{variables:t._context.variables});t._feedbackElements=[];t._interactionElements=[];t.addEventListener("qti-register-variable",function(e){t._context=w(k({},t._context),{variables:$(t._context.variables).concat([e.detail.variable])}),t._initialContext=t._context,e.stopPropagation()}),t.addEventListener("qti-register-feedback",function(e){e.stopPropagation();var n=e.detail;t._feedbackElements.push(n),n.checkShowFeedback(n.outcomeIdentifier)}),t.addEventListener("qti-register-interaction",function(e){e.stopPropagation(),t._interactionElements.push(e.target)}),t.addEventListener("end-attempt",function(e){var n=e.detail,r=n.responseIdentifier,i=n.countAttempt;t.updateResponseVariable(r,"true"),t.processResponse(i)}),t.addEventListener("qti-set-outcome-value",function(e){var n=e.detail,r=n.outcomeIdentifier,i=n.value;t.updateOutcomeVariable(r,i),e.stopPropagation()}),t.addEventListener("qti-interaction-response",t.handleUpdateResponseVariable);return t}c(e,[{key:"variables",get:function t(){return this._context.variables.map(function(t){return k({identifier:t.identifier,value:t.value,type:t.type},t.type==="outcome"&&t.identifier==="SCORE"?{externalScored:t.externalScored}:{})})},set:function t(t){var e=this;if(!Array.isArray(t)||t.some(function(t){return!("identifier"in t)})){console.warn("variables property should be an array of VariableDeclaration");return}this._context=w(k({},this._context),{variables:this._context.variables.map(function(e){var n=t.find(function(t){return t.identifier===e.identifier});return n?k({},e,n):e})}),this._context.variables.forEach(function(t){if(t.type==="response"){var n=e._interactionElements.find(function(e){return e.responseIdentifier===t.identifier});n&&(n.value=t.value)}t.type==="outcome"&&e._feedbackElements.forEach(function(e){return e.checkShowFeedback(t.identifier)})})}},{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return d(f(e.prototype),"connectedCallback",t)};return o(function(){return O(this,function(t){switch(t.label){case 0:r().call(n);return[4,n.updateComplete];case 1:t.sent(),n._emit("qti-assessment-item-connected",n);return[2]}})})()}},{key:"responses",set:function t(t){var e=true,n=false,r=undefined;if(t)try{var i,o=function(){var t=s.value;i.getResponse(t.responseIdentifier)&&i.updateResponseVariable(t.responseIdentifier,t.response);var e=i._interactionElements.find(function(e){return e.getAttribute("response-identifier")===t.responseIdentifier});e&&(e.value=t.response)};for(var a=t[Symbol.iterator](),s;!(e=(s=a.next()).done);e=true)i=this,o()}catch(t){n=true;r=t}finally{try{if(!e&&a.return!=null){a.return()}}finally{if(n){throw r}}}}},{key:"render",value:function t(){return nH(V())}},{key:"showCorrectResponse",value:function t(t){var e=this._context.variables.filter(function(t){return"correctResponse"in t&&t.correctResponse}).map(function(t){return{responseIdentifier:t.identifier,response:t.correctResponse}});var n=true,r=false,i=undefined;try{var o,a=function(){var e=u.value;var n=o._interactionElements.find(function(t){return t.getAttribute("response-identifier")===e.responseIdentifier});n&&(n.correctResponse=t?e.response:"")};for(var s=e[Symbol.iterator](),u;!(n=(u=s.next()).done);n=true)o=this,a()}catch(t){r=true;i=t}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(r){throw i}}}}},{key:"processResponse",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;var e;var n=this.querySelector("qti-response-processing");return!n||!n.process?!1:(n.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),t&&this.updateOutcomeVariable("numAttempts",(+((e=this._context.variables.find(function(t){return t.identifier==="numAttempts"}))===null||e===void 0?void 0:e.value)+1).toString()),this._emit("qti-response-processed"),!0)}},{key:"resetResponses",value:function t(){this._context=this._initialContext}},{key:"getResponse",value:function t(t){return this.getVariable(t)}},{key:"getOutcome",value:function t(t){return this.getVariable(t)}},{key:"getVariable",value:function t(t){return this._context.variables.find(function(e){return e.identifier===t})||null}},{key:"handleUpdateResponseVariable",value:function t(t){var e=t.detail,n=e.responseIdentifier,r=e.response;this.updateResponseVariable(n,r)}},{key:"updateResponseVariable",value:function t(t,e){this._context=w(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:w(k({},n),{value:e})})}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:t,response:Array.isArray(e)?$(e):e}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}},{key:"updateOutcomeVariable",value:function t(t,e){var n;var r=this.getOutcome(t);if(!r){console.warn("Can not set qti-outcome-identifier: ".concat(t,", it is not available"));return}this._context=w(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:w(k({},n),{value:r.cardinality==="single"?e:$(n.value).concat([e])})})}),this._feedbackElements.forEach(function(e){return e.checkShowFeedback(t)}),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:t,value:(n=this._context.variables.find(function(e){return e.identifier===t}))===null||n===void 0?void 0:n.value})}},{key:"_getCompletionStatus",value:function t(){return this._interactionElements.every(function(t){return t.validate()})?"completed":this._interactionElements.some(function(t){return t.validate()})?"incomplete":"not_attempted"}},{key:"_emit",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}}]);return e}(n7);eN([r({type:String})],rs.prototype,"title",2),eN([r({type:String})],rs.prototype,"identifier",2),eN([r({type:String})],rs.prototype,"adaptive",2),eN([r({type:String})],rs.prototype,"timeDependent",2),eN([r({type:Boolean})],rs.prototype,"disabled",2),eN([h("disabled",{waitUntilFirstUpdate:!0})],rs.prototype,"_handleDisabledChange",2),eN([r({type:Boolean})],rs.prototype,"readonly",2),eN([h("readonly",{waitUntilFirstUpdate:!0})],rs.prototype,"_handleReadonlyChange",2),eN([t({context:ra})],rs.prototype,"_context",2),rs=eN([re("qti-assessment-item")],rs);var ru=String.raw,rl=ru(H());var rc=null;var rh=function(){var t,e={load:function n(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return o(function(){return O(this,function(i){return[2,new Promise(function(i,o){_(n,r).then(function(r){return t=r,e.path(n.substring(0,n.lastIndexOf("/"))),i(e)})})]})})()},parse:function n(n){return t=E(n),e},path:function(n){return C(t,n),e},fn:function n(n){return n(t),e},pciHooks:function n(n){var r=["hook","module"],i=n.substring(0,n.lastIndexOf("/"));var o=true,a=false,s=undefined;try{var u=function(){var e=c.value;t.querySelectorAll("["+e+"]").forEach(function(t){var r=t.getAttribute(e);!r.startsWith("data:")&&!r.startsWith("http")&&(t.setAttribute("base-url",n),t.setAttribute("module",i+"/"+encodeURI(r+(r.endsWith(".js")?"":".js"))))})};for(var l=r[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true)u()}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return e},extendElementName:function(n,r){return y(t,n,r),e},extendElementsWithClass:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"extend";return m(t,n),e},customInteraction:function n(n,r){var i=t.querySelector("qti-custom-interaction"),o=i.querySelector("object");return i.setAttribute("data-base-ref",n),i.setAttribute("data-base-item",n+r),i.setAttribute("data",o.getAttribute("data")),i.setAttribute("width",o.getAttribute("width")),i.setAttribute("height",o.getAttribute("height")),i.removeChild(o),e},convertCDATAtoComment:function n(){return S(t),e},stripStyleSheets:function n(){return R(t),e},html:function e(){return new XMLSerializer().serializeToString(x(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return x(t)},xmlDoc:function e(){return t}};return e};var rd=function(){var t,e={load:function n(n){return o(function(){return O(this,function(r){return[2,new Promise(function(r,i){_(n).then(function(n){return t=n,r(e)})})]})})()},parse:function e(e){t=E(e)},assessmentTest:function e(){var e=t.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:e.getAttribute("href"),identifier:e.getAttribute("identifier")}}};return e};var rf=function(){var t,e={load:function n(n){return o(function(){return O(this,function(r){return[2,new Promise(function(r,i){_(n).then(function(n){return t=n,r(e)})})]})})()},parse:function n(n){return t=E(n),e},fn:function n(n){return n(t),e},items:function e(){return b(t)},html:function e(){return new XMLSerializer().serializeToString(x(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return x(t)},xmlDoc:function e(){return t}};return e};var rp=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.identifier="";t.href="";return t}c(e,[{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return d(f(e.prototype),"connectedCallback",t)};return o(function(){var t,e,i;return O(this,function(o){switch(o.label){case 0:r().call(n);t=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0});if(!n.dispatchEvent(t))return[3,4];e=n.closest("qti-assessment-item").querySelector("[data-stimulus-idref=".concat(n.identifier,"]"));if(!e)return[3,2];return[4,n.updateStimulusRef(e)];case 1:i=o.sent();return[3,3];case 2:i=console.warn("Stimulus with data-stimulus-idref ".concat(n.identifier," not found"));o.label=3;case 3:i;o.label=4;case 4:return[2]}})})()}},{key:"updateStimulusRef",value:function t(t){var e=this;return o(function(){var n,r,i,o;return O(this,function(a){switch(a.label){case 0:n=e.href.substring(0,e.href.lastIndexOf("/"));return[4,rh().load(e.href).then(function(t){return t.path(n).htmlDoc()})];case 1:r=a.sent();if(r){;o=r.querySelectorAll("qti-stimulus-body, qti-stylesheet");t.innerHTML="",(i=t).append.apply(i,$(o))}return[2]}})})()}}]);return e}(n7);eN([r({type:String})],rp.prototype,"identifier",2),eN([r({type:String})],rp.prototype,"href",2),rp=eN([re("qti-assessment-stimulus-ref")],rp);var rv={toAttribute:function(t){return t?"true":"false"},fromAttribute:function(t){return t==="true"}};var ry=e9(j());var rm=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(Q())}}]);return e}(n7);rm.styles=ry,rm=eN([re("qti-item-body")],rm);var rg=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(B())}},{key:"connectedCallback",value:function t(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}}]);return e}(n7);rg=eN([re("qti-prompt")],rg);var rb=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.styleElement=null;return t}c(e,[{key:"firstUpdated",value:function t(t){var n=this;d(f(e.prototype),"firstUpdated",this).call(this,t);var r=this.getAttribute("href");if(r!==null&&fetch(r).then(function(t){return t.text()}).then(function(t){var e=n.minifyCss(t);n.styleElement=document.createElement("style"),n.styleElement.media="screen",n.styleElement.textContent="@scope {".concat(e,"}"),n.parentElement?n.parentElement.appendChild(n.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}).catch(function(t){console.error("Failed to load stylesheet:",t)}),this.textContent!==null&&this.textContent.trim()!==""){var i=this.minifyCss(this.textContent);this.styleElement=document.createElement("style"),this.styleElement.media="screen",this.styleElement.textContent="@scope {".concat(i,"}"),this.parentElement?this.parentElement.appendChild(this.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}}},{key:"minifyCss",value:function t(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()}},{key:"disconnectedCallback",value:function t(){if(this.styleElement)try{this.styleElement.remove()}catch(t){console.error("Could not remove stylesheet:",t)}d(f(e.prototype),"disconnectedCallback",this).call(this)}}]);return e}(n7);rb=eN([re("qti-stylesheet")],rb);var r_=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(F())}},{key:"defaultValues",value:function t(t){var e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;var n=e.map(function(t){return t.innerHTML.trim()});return n.length>1||t.cardinality==="multiple"||t.cardinality==="ordered"?n:n[0]}}]);return e}(n7);r_=eN([re("qti-variabledeclaration")],r_);var rk=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.externalScored=null;return t}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nH(z(),JSON.stringify(r,null,2))}},{key:"interpolationTable",get:function t(){var t=this.querySelector("qti-interpolation-table");if(t){var e=new Map;var n=true,r=false,i=undefined;try{for(var o=t.querySelectorAll("qti-interpolation-table-entry")[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;!s.getAttribute("source-value")&&s.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");var u=parseInt(s.getAttribute("source-value")),l=parseInt(s.getAttribute("target-value"));(isNaN(u)||isNaN(l))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),e.set(u,l)}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return e}return null}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this);var t={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};t.value=this.defaultValues(t),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}}]);return e}(r_);rk.styles=[e9(W())],eN([r({type:String,attribute:"base-type"})],rk.prototype,"baseType",2),eN([r({type:String,attribute:"external-scored"})],rk.prototype,"externalScored",2),eN([r({type:String})],rk.prototype,"identifier",2),eN([r({type:String})],rk.prototype,"cardinality",2),eN([e({context:ra,subscribe:!0}),i()],rk.prototype,"itemContext",2),rk=eN([re("qti-outcome-declaration")],rk);var rE=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nH(Y(),JSON.stringify(r,null,2))}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this);var t={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,value:null,type:"response",candidateResponse:null};t.value=this.defaultValues(t),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}},{key:"correctResponse",get:function t(){var t,e=this.querySelector("qti-correct-response");if(e){var n=e.querySelectorAll("qti-value");if(this.cardinality==="single"&&n.length>0)t=n[0].textContent,n[0].remove();else if(this.cardinality!=="single"){t=[];for(var r=0;r<n.length;r++)t.push(n[r].textContent),n[r].remove()}}return t}},{key:"mapping",get:function t(){return this.querySelector("qti-mapping")}}]);return e}(r_);rE.styles=[e9(X())],eN([r({type:String,attribute:"base-type"})],rE.prototype,"baseType",2),eN([r({type:String})],rE.prototype,"identifier",2),eN([r({type:String})],rE.prototype,"cardinality",2),eN([e({context:ra,subscribe:!0}),i()],rE.prototype,"itemContext",2),rE=eN([re("qti-response-declaration")],rE);var rw=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(n7);rw=eN([re("qti-companion-materials-info")],rw);var rx=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(Z())}}]);return e}(n7);rx=eN([re("qti-content-body")],rx);var rC=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"handleclassNamesChange",value:function t(t,e){var n=this;this.classNames.split(" ").forEach(function(t){switch(t){case"qti-rubric-discretionary-placement":n.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":n.setAttribute("slot","");break;default:break}})}},{key:"render",value:function t(){return nH(G())}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-rubric-block")}}]);return e}(n7);rC.styles=e9(K()),eN([r({type:String})],rC.prototype,"id",2),eN([r({type:String})],rC.prototype,"use",2),eN([r({type:String})],rC.prototype,"view",2),eN([r({type:String,attribute:"class"})],rC.prototype,"classNames",2),eN([h("classNames",{waitUntilFirstUpdate:!0})],rC.prototype,"handleclassNamesChange",1),rC=eN([re("qti-rubric-block")],rC);var rA=function(){return new Intl.NumberFormat().format(.1).replace(/\d/g,"")},rS=function(t){if(typeof t=="string")return t;var e=rA();return e==="."?t.toLocaleString():t.toString().replace(".","").replace(e,".")};var rq=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}},{key:"checkShowFeedback",value:function t(t){var e=this._context.variables.find(function(e){return e.identifier===t})||null;if(this.outcomeIdentifier!==t||!e)return;var n=!1;Array.isArray(e.value)?n=e.value.includes(this.identifier):n=!U(this.identifier)&&!U(e===null||e===void 0?void 0:e.value)&&this.identifier===e.value||!1,this.showFeedback(n)}},{key:"showFeedback",value:function t(t){this.showStatus=t&&this.showHide==="show"||!t&&this.showHide==="hide"?"on":"off"}}]);return e}(n7);eN([r({type:String,attribute:"show-hide"})],rq.prototype,"showHide",2),eN([r({type:String,attribute:"outcome-identifier"})],rq.prototype,"outcomeIdentifier",2),eN([r({type:String})],rq.prototype,"identifier",2),eN([r({type:String,attribute:!1})],rq.prototype,"showStatus",2),eN([e({context:ra,subscribe:!0}),i()],rq.prototype,"_context",2);var rR=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(J(),this.showStatus)}},{key:"firstUpdated",value:function t(t){this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(rq);rR.styles=e9(tt()),rR=eN([re("qti-feedback-block")],rR);var rP=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nH(te(),t.showStatus)};return t}return e}(rq);rP.styles=e9(tn()),rP=eN([re("qti-feedback-inline")],rP);var rT=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nH(tr(),t.showStatus)};return t}return e}(rq);rT.styles=e9(ti()),rT=eN([re("qti-modal-feedback")],rT);var r$=function(t){return t!==null&&t!==void 0?t:nF};var rD=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t.responseIdentifier="";t.disabled=!1;t.readonly=!1;t._correctResponse="";t._internals=t.attachInternals();return t}c(e,[{key:"reportValidity",value:function t(){return this._internals.reportValidity()}},{key:"reset",value:function t(){this.value=""}},{key:"correctResponse",get:function t(){return this._correctResponse},set:function t(t){this._correctResponse=t}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"saveResponse",value:function t(t){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(t)?$(t):t}}))}}]);return e}(n7);rD.formAssociated=!0,eN([r({type:String,attribute:"response-identifier"})],rD.prototype,"responseIdentifier",2),eN([r({reflect:!0,type:Boolean})],rD.prototype,"disabled",2),eN([r({reflect:!0,type:Boolean})],rD.prototype,"readonly",2),eN([i()],rD.prototype,"_correctResponse",2);var rU=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._rows=5;t._value="";return t}c(e,[{key:"handleclassNamesChange",value:function t(t,e){var n=this;var r=e.split(" "),i=!1;if(r.forEach(function(t){if(t.startsWith("qti-height-lines-")){var e=t.replace("qti-height-lines-","");n._rows=parseInt(e),i=!0}}),!i&&this.expectedLength){var o=Math.ceil(this.expectedLength/50);this._rows=o}}},{key:"value",get:function t(){return this._value},set:function t(t){if(typeof t=="string"){this._value=t;var e=new FormData;e.append(this.responseIdentifier,t),this._internals.setFormValue(e),this.validate()}else throw new Error("Value must be a string")}},{key:"validate",value:function t(){var t=this.shadowRoot.querySelector("textarea");if(!t)return!1;if(this.patternMask&&this.dataPatternmaskMessage){this._internals.setValidity({}),t.setCustomValidity("");var e=this.patternMask.startsWith("^")&&this.patternMask.endsWith("$")?this.patternMask:"^".concat(this.patternMask,"$"),n=new RegExp(e);t.checkValidity()&&n.test(t.value)||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),t.setCustomValidity(this.dataPatternmaskMessage))}else{var r=t.checkValidity();this._internals.setValidity(r?{}:{customError:!1})}return this._value!==""&&t.checkValidity()}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("textarea");if(!t)return!1;var e=this.validate();return e||t.reportValidity(),e}},{key:"render",value:function t(){var t=this;return nH(ta(),this.responseIdentifier,5e3,function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,function(e){t.reportValidity()},r$(this.placeholderText?this.placeholderText:void 0),this._rows,this.disabled,this.readonly,this._value)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;if(this.setEmptyAttribute(e.value),this._value!==e.value){this.value=e.value;var n=this.validate();this.saveResponse(e.value)}}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}],[{key:"styles",get:function t(){return[e9(to())]}}]);return e}(rD);eN([i()],rU.prototype,"_rows",2),eN([r({type:Number,attribute:"expected-length"})],rU.prototype,"expectedLength",2),eN([r({type:String,attribute:"pattern-mask"})],rU.prototype,"patternMask",2),eN([r({type:String,attribute:"placeholder-text"})],rU.prototype,"placeholderText",2),eN([r({type:String,attribute:"data-patternmask-message"})],rU.prototype,"dataPatternmaskMessage",2),eN([i()],rU.prototype,"_value",2),eN([r({type:String,attribute:"class"})],rU.prototype,"classNames",2),eN([h("classNames")],rU.prototype,"handleclassNamesChange",1),rU=eN([re("qti-extended-text-interaction")],rU);var rM=n4.I;var rI=function(t){return t.strings===void 0},rO=function(){return document.createComment("")},rL=function(t,e,n){var r=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){var o=r.insertBefore(rO(),i),a=r.insertBefore(rO(),i);n=new rM(o,a,t,t.options)}else{var s=n._$AB.nextSibling,u=n._$AM,l=u!==t;if(l){var c;var h;(c=n._$AQ)===null||c===void 0?void 0:c.call(n,t),n._$AM=t,n._$AP!==void 0&&(h=t._$AU)!==u._$AU&&n._$AP(h)}if(s!==i||l){var d=n._$AA;for(;d!==s;){var f=d.nextSibling;r.insertBefore(d,i),d=f}}}return n},rN=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;return t._$AI(e,n),t},rV={},rH=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rV;return t._$AH=e},rj=function(t){return t._$AH},rQ=function(t){var e;(e=t._$AP)===null||e===void 0?void 0:e.call(t,!1,!0);var n=t._$AA,r=t._$AB.nextSibling;for(;n!==r;){var i=n.nextSibling;n.remove(),n=i}};var rB={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},rF=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++){n[r]=arguments[r]}return{_$litDirective$:t,values:n}}},rz=/*#__PURE__*/function(){"use strict";function t(e){s(this,t)}c(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AT",value:function t(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}},{key:"_$AS",value:function t(t,e){return this.update(t,e)}},{key:"update",value:function t(t,e){return this.render.apply(this,$(e))}}]);return t}();var rW=function(t,e){var n;var r=t._$AN;if(r===void 0)return!1;var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),u;!(i=(u=s.next()).done);i=true){var l=u.value;(n=l._$AO)===null||n===void 0?void 0:n.call(l,e,!1),rW(l,e)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return!0},rY=function(t){var e,n;do{if((e=t._$AM)===void 0)break;n=e._$AN,n.delete(t),t=e}while((n===null||n===void 0?void 0:n.size)===0)},rX=function(t){for(var e;e=t._$AM;t=e){var n=e._$AN;if(n===void 0)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),rZ(e)}};var rZ=function(t){var e,n;t.type==rB.CHILD&&((e=t._$AP)!==null&&e!==void 0?e:t._$AP=eC,(n=t._$AQ)!==null&&n!==void 0?n:t._$AQ=ex)},rG=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t._$AN=void 0;return t}c(e,[{key:"_$AT",value:function t(t,n,r){d(f(e.prototype),"_$AT",this).call(this,t,n,r),rX(this),this.isConnected=t._$AU}},{key:"_$AO",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;var n,r,i,o;t!==this.isConnected&&(this.isConnected=t,t?(n=(r=this).reconnected)===null||n===void 0?void 0:n.call(r):(i=(o=this).disconnected)===null||i===void 0?void 0:i.call(o)),e&&(rW(this,t),rY(this))}},{key:"setValue",value:function t(t){if(rI(this._$Ct))this._$Ct._$AI(t,this);else{var e=$(this._$Ct._$AH);e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}},{key:"disconnected",value:function t(){}},{key:"reconnected",value:function t(){}}]);return e}(rz);var rK=function(){return new rJ},rJ=function t(){"use strict";s(this,t)},r0=new WeakMap,r1=rF(/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(t){return nF}},{key:"update",value:function t(t,e){var n=q(e,1),r=n[0];var i;var o=r!==this.Y;return o&&this.Y!==void 0&&this.rt(void 0),(o||this.lt!==this.ct)&&(this.Y=r,this.ht=(i=t.options)===null||i===void 0?void 0:i.host,this.rt(this.ct=t.element)),nF}},{key:"rt",value:function t(t){if(this.isConnected||(t=void 0),typeof this.Y=="function"){var e;var n=(e=this.ht)!==null&&e!==void 0?e:globalThis,r=r0.get(n);r===void 0&&(r=new WeakMap,r0.set(n,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}},{key:"lt",get:function t(){var t,e;var n;return typeof this.Y=="function"?(t=r0.get((n=this.ht)!==null&&n!==void 0?n:globalThis))===null||t===void 0?void 0:t.get(this.Y):(e=this.Y)===null||e===void 0?void 0:e.value}},{key:"disconnected",value:function t(){this.lt===this.ct&&this.rt(void 0)}},{key:"reconnected",value:function t(){this.rt(this.ct)}}]);return e}(rG));var r2=e9(ts());var r3=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._value="";t.inputRef=rK();return t}c(e,[{key:"value",get:function t(){return this._value},set:function t(t){if(typeof t=="string"){this._value=t;var e=new FormData;e.append(this.responseIdentifier,t),this._internals.setFormValue(e),this.validate()}else throw new Error("Value must be a string")}},{key:"validate",value:function t(){var t=this.shadowRoot.querySelector("input");if(!t)return!1;if(this.patternMask&&this.dataPatternmaskMessage)this._internals.setValidity({}),t.setCustomValidity(""),t.checkValidity()||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),t.setCustomValidity(this.dataPatternmaskMessage));else{var e=t.checkValidity();this._internals.setValidity(e?{}:{customError:!1})}return this._value!==""&&t.checkValidity()}},{key:"render",value:function t(){var t=this;return nH(tu(),this.responseIdentifier,function(e){t.reportValidity()},function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,this.patternMask=="[0-9]*"?"number":"text",r$(this.placeholderText?this.placeholderText:void 0),this._value,r$(this.patternMask?this.patternMask:void 0),1e3,this.disabled,this.readonly,this._correctResponse)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;if(this.setEmptyAttribute(e.value),this._value!==e.value){this.value=e.value;var n=this.validate();this.saveResponse(e.value)}}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("input");if(!t)return!1;var e=this.validate();return e||t.reportValidity(),e}},{key:"reset",value:function t(){this._value=""}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}]);return e}(rD);r3.styles=r2,eN([r({type:Number,attribute:"expected-length"})],r3.prototype,"expectedLength",2),eN([r({type:String,attribute:"pattern-mask"})],r3.prototype,"patternMask",2),eN([r({type:String,attribute:"placeholder-text"})],r3.prototype,"placeholderText",2),eN([r({type:String,attribute:"data-patternmask-message"})],r3.prototype,"dataPatternmaskMessage",2),eN([i()],r3.prototype,"_value",2),r3=eN([re("qti-text-entry-interaction")],r3);var r4=function(t,e){var n=/*#__PURE__*/function(t){"use strict";p(n,t);function n(){s(this,n);var t;t=a(this,n,arguments);t._choiceElements=[];t.minChoices=0;t.maxChoices=1;t._handleDisabledChange=function(e,n){t._choiceElements.forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){t._choiceElements.forEach(function(t){return t.readonly=n})};t._value="";return t}c(n,[{key:"_handleMaxChoicesChange",value:function t(t,e){this._determineInputType()}},{key:"value",get:function t(){return Array.isArray(this._value)?this._value.join(","):this._value},set:function t(t){var e=this;if(this.maxChoices>1&&typeof t=="string"?this._value=t.split(","):this._value=t,Array.isArray(this._value)){var n=new FormData;this._value.forEach(function(t){n.append(e.responseIdentifier,t)}),this._internals.setFormValue(n)}else this._internals.setFormValue(this._value);this._updateChoiceSelection()}},{key:"correctResponse",get:function t(){return this._correctResponse},set:function t(t){this._correctResponse=t;var e=Array.isArray(t)?t:[t];this._choiceElements.forEach(function(t){t.internals.states.delete("correct-response"),t.internals.states.delete("incorrect-response"),e.length>0&&(e.includes(t.identifier)?t.internals.states.add("correct-response"):t.internals.states.add("incorrect-response"))})}},{key:"connectedCallback",value:function t(){d(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("register-".concat(e),this._registerChoiceElement),this.addEventListener("unregister-".concat(e),this._unregisterChoiceElement),this.addEventListener("activate-".concat(e),this._choiceElementSelectedHandler)}},{key:"disconnectedCallback",value:function t(){d(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-".concat(e),this._registerChoiceElement),this.removeEventListener("unregister-".concat(e),this._unregisterChoiceElement),this.removeEventListener("activate-".concat(e),this._choiceElementSelectedHandler)}},{key:"validate",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}),n=e.length,r=!0,i="";return this.maxChoices!==0&&n>this.maxChoices?(r=!1,i=this.dataset.maxSelectionsMessage||"You can select at most ".concat(this.maxChoices," choices.")):n<this.minChoices&&(r=!1,i=this.dataset.minSelectionsMessage||"You must select at least ".concat(this.minChoices," choices.")),e.length>0&&this._internals.setValidity(r?{}:{customError:!0},i,e[n-1]||this._choiceElements[0]||this),this.reportValidity(),r}},{key:"reportValidity",value:function t(){return this._validationMessageElement&&(this._internals.validity.valid?(this._validationMessageElement.textContent="",this._validationMessageElement.style.display="none"):(this._validationMessageElement.textContent=this._internals.validationMessage,this._validationMessageElement.style.display="block")),this._internals.validity.valid}},{key:"_registerChoiceElement",value:function t(t){t.stopPropagation();var e=t.target;e.disabled=this.disabled,this._choiceElements.push(e),this._setInputType(e)}},{key:"_unregisterChoiceElement",value:function t(t){t.stopPropagation();var e=t.target;this._choiceElements=this._choiceElements.filter(function(t){return t!==e})}},{key:"_determineInputType",value:function t(){var t=this;this._choiceElements.forEach(function(e){t._setInputType(e)})}},{key:"_setInputType",value:function t(t){t.internals.role=this.maxChoices===1?"radio":"checkbox",t.internals.states.add(t.internals.role)}},{key:"_choiceElementSelectedHandler",value:function t(t){var e=this;this._toggleChoiceChecked(t.target),this.maxChoices===1&&this._choiceElements.forEach(function(n){n.identifier!==t.detail.identifier&&e._setChoiceChecked(n,!1)}),this._handleChoiceSelection()}},{key:"_setChoiceChecked",value:function t(t,e){var n;((n=t.internals)===null||n===void 0?void 0:n.states)&&(e?(t.internals.states.add("--checked"),t.internals.ariaChecked="true"):(t.internals.states.delete("--checked"),t.internals.ariaChecked="false"))}},{key:"_getChoiceChecked",value:function t(t){return t.internals.states.has("--checked")}},{key:"_toggleChoiceChecked",value:function t(t){var e=this._getChoiceChecked(t);this._setChoiceChecked(t,!e)}},{key:"_handleChoiceSelection",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}).map(function(t){return t.identifier});this.value=this.maxChoices===1?e[0]||"":e,this.validate(),this.saveResponse(this._value)}},{key:"_updateChoiceSelection",value:function t(){var t=this;var e=Array.isArray(this._value)?this._value:[this._value];this._choiceElements.forEach(function(n){var r=e.includes(n.identifier);t._setChoiceChecked(n,r)})}}]);return n}(t);return eN([u("#validationMessage")],n.prototype,"_validationMessageElement",2),eN([r({type:Number,attribute:"min-choices"})],n.prototype,"minChoices",2),eN([r({type:Number,attribute:"max-choices"})],n.prototype,"maxChoices",2),eN([h("maxChoices",{waitUntilFirstUpdate:!0})],n.prototype,"_handleMaxChoicesChange",1),eN([h("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"_handleDisabledChange",2),eN([h("readonly",{waitUntilFirstUpdate:!0})],n.prototype,"_handleReadonlyChange",2),n};var r5=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nH(tl())};return t}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("qti-hottext-interaction","")}}]);return e}(r4(rD,"qti-hottext"));r5=eN([re("qti-hottext-interaction")],r5);var r6=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t){s(this,e);var n;if(n=a(this,e,[t]),n.it=nF,t.type!==rB.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}c(e,[{key:"render",value:function t(t){if(t===nF||t==null)return this._t=void 0,this.it=t;if(t===nB)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;var e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}]);return e}(rz);r6.directiveName="unsafeHTML",r6.resultType=1;var r9=rF(r6);var r7=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.options=[];t.correctOption="";t.dataPrompt="select";return t}c(e,[{key:"render",value:function t(){return nH(td(),this.choiceSelected,this.disabled,this.readonly,this.options.map(function(t){return nH(th(),t.value,t.selected,r9(t.textContent))}),r9(this.correctOption))}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("on-dropdown-selected",this.choiceSelected);var t=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1}].concat($(t.map(function(t){return{textContent:t.innerHTML,value:t.getAttribute("identifier"),selected:!1}})))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}},{key:"validate",value:function t(){var t=this.options.find(function(t){return t.selected});return t?t.value!=="":!1}},{key:"reset",value:function t(){this.options=this.options.map(function(t,e){return w(k({},t),{selected:e===0})})}},{key:"value",get:function t(){return this.options.find(function(t){return t.selected}).value},set:function t(t){this.options=this.options.map(function(e){return t===e.value&&(e.selected=!0),e})}},{key:"correctResponse",set:function t(t){if(t===""){this.correctOption="";return}this.correctOption='<span part="correct-option">'.concat(this.options.find(function(e){return t===e.value}).textContent,"</span>")}},{key:"choiceSelected",value:function t(t){var e=t.target.value;this.options=this.options.map(function(t){return w(k({},t),{selected:t.value===e})}),this.saveResponse(e)}}],[{key:"styles",get:function t(){return[e9(tc())]}}]);return e}(rD);r7.inputWidthClass=["","qti-input-width-2","qti-input-width-1","qti-input-width-3","qti-input-width-4","qti-input-width-6","qti-input-width-10","qti-input-width-15","qti-input-width-20","qti-input-width-72"],eN([i()],r7.prototype,"options",2),eN([i()],r7.prototype,"correctOption",2),eN([r({attribute:"data-prompt",type:String})],r7.prototype,"dataPrompt",2),r7=eN([re("qti-inline-choice-interaction")],r7);var r8=function(t,e){var n=/*#__PURE__*/function(t){"use strict";p(n,t);function n(){s(this,n);var t;t=a(this,n,arguments);t._shuffle=!1;return t}c(n,[{key:"shuffle",get:function t(){return this._shuffle},set:function t(t){var e=this._shuffle;this._shuffle=t,t?this._shuffleChoices():this._resetShuffleChoices(),this.requestUpdate("shuffle",e)}},{key:"connectedCallback",value:function t(){d(f(n.prototype),"connectedCallback",this).call(this),this.shuffle?this._shuffleChoices():this._resetShuffleChoices()}},{key:"_shuffleChoices",value:function t(){var t=Array.from(this.querySelectorAll(e)),n=[],r=[];if(t.forEach(function(t,e){t.hasAttribute("fixed")?n.push({element:t,index:e}):r.push(t)}),r.length<=1){console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");return}var i=!1,o=10,a=0,s=$(r);for(;!i&&a<o;){a++;for(var u=r.length-1;u>0;u--){var l=Math.floor(Math.random()*(u+1));var c;c=[r[l],r[u]],r[u]=c[0],r[l]=c[1],c}if(i=!r.every(function(t,e){return t===s[e]}),i)break}i||console.warn("Failed to shuffle the choices after multiple attempts.");var h=1;t.forEach(function(t,e){t.hasAttribute("fixed")?t.style.setProperty("order",String(h++)):r.shift().style.setProperty("order",String(h++))})}},{key:"_resetShuffleChoices",value:function t(){Array.from(this.querySelectorAll("qti-simple-choice")).forEach(function(t,e){t.style.setProperty("order","initial")})}}]);return n}(t);return eN([r({type:String,reflect:!0,converter:it})],n.prototype,"shuffle",1),n},it={fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return t?"true":"false"}};var ie=function(t,e){var n=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._classes=[];t._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];t._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"];return t}c(e,[{key:"class",get:function t(){var t;return((t=this._classes)===null||t===void 0?void 0:t.join(" "))||""},set:function t(t){t&&(this._classes=t.split(" "),this._addLabels())}},{key:"updated",value:function t(t){d(f(e.prototype),"updated",this).call(this,t),t.has("shuffle")&&this._addLabels()}},{key:"_addLabels",value:function t(){var t=this;var e=this._classes.some(function(e){return t._allLabels.includes(e)||t._allLabelSuffixes.includes(e)}),n=function(t){return!isNaN(+t)};if(e){var r=Array.from(this.querySelectorAll("qti-simple-choice")).map(function(t){return t}).map(function(t,e){return{el:t,order:n(t.style.order)?+t.style.order:e+1}}).sort(function(t,e){return t.order-e.order}).map(function(t){return t.el});for(var i=0;i<r.length;i++)r[i].marker=this._getLabel(i+1)}}},{key:"_getLabel",value:function t(t){var e=this;var n=this._classes.filter(function(t){return e._allLabels.includes(t)}).pop(),r=this._classes.filter(function(t){return e._allLabelSuffixes.includes(t)}).pop();!n&&r&&(n="qti-labels-upper-alpha");var i="";switch(n){case"qti-labels-decimal":i="".concat(t);break;case"qti-labels-lower-alpha":i="".concat(String.fromCharCode(97+t-1));break;case"qti-labels-upper-alpha":i="".concat(String.fromCharCode(65+t-1));break}return r==="qti-labels-suffix-period"?i+=".":r==="qti-labels-suffix-parenthesis"&&(i+=")"),i}}]);return e}(t);return eN([r({type:String,reflect:!0})],n.prototype,"class",1),n};var ir=e9(tf());var ii=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tp())}}]);return e}(ie(r8(r4(rD,"qti-simple-choice"),"qti-simple-choice"),"qti-simple-choice"));ii.styles=ir,eN([r({type:String})],ii.prototype,"orientation",2),ii=eN([re("qti-choice-interaction")],ii);var io=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tv())}},{key:"process",value:function t(){var t=new ia,e=$(this.children);t.process(e)}}]);return e}(n7);io.styles=[e9(ty())],io=eN([re("qti-outcome-processing")],io);var ia=/*#__PURE__*/function(){"use strict";function t(){s(this,t)}c(t,[{key:"process",value:function t(t){var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;a.process()}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}}}]);return t}();var is='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-match>\n <qti-variable identifier="RESPONSE"></qti-variable>\n <qti-correct identifier="RESPONSE"></qti-correct>\n </qti-match>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">1</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>',iu='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier="RESPONSE"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0.0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-map-response identifier="RESPONSE"> </qti-map-response>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>',il='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier="RESPONSE"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-map-response-point identifier="RESPONSE"></qti-map-response-point>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>';var ic=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tm())}},{key:"process",value:function t(){var t=$(this.children);var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;a.process()}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}}},{key:"firstUpdated",value:function t(t){if(this.getAttribute("template")){var e=this.getAttribute("template").split("/"),n=e[e.length-1].replace(".xml","");switch(this.innerHTML="",n){case"map_response":{this.appendChild(this.fragmentFromString(iu).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(il).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(is).firstElementChild.firstElementChild);break}}}},{key:"fragmentFromString",value:function t(t){return document.createRange().createContextualFragment(t)}}]);return e}(n7);ic.styles=[e9(tg())],ic=eN([re("qti-response-processing")],ic);var ih=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tb())}},{key:"process",value:function t(){throw new Error("Not implemented")}}]);return e}(n7);ih=eN([re("qti-rule")],ih);var id=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"childExpression",get:function t(){return this.firstElementChild}},{key:"process",value:function t(){var t=this.getAttribute("identifier"),e=this.closest("qti-assessment-item").getVariable(t),n;return e.interpolationTable&&(n=e.interpolationTable.get(parseInt(this.childExpression.calculate()))),n==null?(console.warn("lookupOutcomeValue: value is null or undefined"),0):(this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:this.identifier,value:rS(n)}})),n)}}]);return e}(ih);eN([r({type:String})],id.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",id);var ip=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(t_())}},{key:"process",value:function t(){var t=$(this.children);for(var e=0;e<t.length;e++){var n=t[e];if(n.calculate()){n.process();return}}}}]);return e}(ih);customElements.define("qti-response-condition",ip);var iv=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"process",value:function t(){var t=this.getAttribute("identifier"),e=this.firstElementChild,n=new iy(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:Array.isArray(n)?n.map(function(t){return rS(t)}):rS(n)}}))}}]);return e}(ih),iy=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.expression=e}c(t,[{key:"process",value:function t(){var t=this.expression?this.expression.calculate():null;if(t==null){console.warn("setOutcomeValue: value is null or undefined");return}return t}}]);return t}();customElements.define("qti-set-outcome-value",iv);var im=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tk())}},{key:"calculate",value:function t(){return!0}},{key:"getSubRules",value:function t(){return $(this.children)}},{key:"process",value:function t(){var t=this.getSubRules();for(var e=0;e<t.length;e++)t[e].process()}}]);return e}(n7);customElements.define("qti-response-else",im);var ig=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.firstElementChild.calculate()}},{key:"getSubRules",value:function t(){var t=[];for(var e=1;e<this.children.length;e++)t.push(this.children[e]);return t}}]);return e}(im);customElements.define("qti-response-if",ig);var ib=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tE(),d(f(e.prototype),"render",this).call(this))}}]);return e}(ig);customElements.define("qti-response-else-if",ib);var i_=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.getVariables=function(){return Array.from(t.children).map(function(e){switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent.trim(),cardinality:"single"};case"qti-variable":{var n=e.getAttribute("identifier")||"";return t.context.variables.find(function(t){return t.identifier===n})||null}case"qti-multiple":{var r=e.getResult();return r.length>0?{identifier:"",baseType:r[0].baseType,value:r.map(function(t){return t.value}),cardinality:"multiple",type:"response"}:null}case"qti-correct":{var i=e.getAttribute("identifier")||"",o=t.context.variables.find(function(t){return t.identifier===i})||null;return{baseType:o.baseType,value:o.correctResponse,cardinality:o.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(t){console.warn("default not sufficient")}return null}}}).filter(function(t){return t!==null})};return t}c(e,[{key:"render",value:function t(){return nH(tw(),JSON.stringify(this.result,null,2))}},{key:"calculate",value:function t(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function t(){throw new Error("Not implemented")}}]);return e}(n7);i_.styles=e9(tx()),eN([i()],i_.prototype,"result",2),eN([e({context:ra,subscribe:!0}),i()],i_.prototype,"context",2);var ik=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function t(){throw new Error("Not implemented")}}]);return e}(i_);var iE=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(eA(ik));customElements.define("qti-and",iE);var iw=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.baseType="string";return t}c(e,[{key:"getResult",value:function t(){return this.textContent.trim()}}]);return e}(i_);eN([r({type:String,attribute:"base-type"})],iw.prototype,"baseType",2);customElements.define("qti-base-value",iw);var ix=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(this.children.length===2){var e=t[0],n=t[1];if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="multiple"){var r=e.value,i=n.value;return r.filter(function(t){return i.includes(t)}).length>0}else if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="single"){var o=e.value;return n.value.includes(o)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}}]);return e}(ik);customElements.define("qti-contains",ix);var iC=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"interpretation",get:function t(){return this.getAttribute("interpretation")||""}},{key:"getResult",value:function t(){var t=this.getAttribute("identifier")||"",e=this.context.variables.find(function(e){return e.identifier===t})||null;return e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}}]);return e}(i_);customElements.define("qti-correct",iC);var iA=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.roundingMode="significantFigures";return t}c(e,[{key:"figures",get:function t(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;var t=parseInt(this.getAttribute("figures")||"0");return isNaN(t)?(console.error("figures attribute is not a number"),null):t<0?(console.error("figures attribute is negative"),null):t<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):t}},{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(this.roundingMode===null)return null;if(e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value))return console.error("unexpected cardinality in qti equal"),!1;switch(t[0].baseType){case"integer":case"float":{var r=parseFloat(e.value),i=parseFloat(n.value);if(!isNaN(r)&&!isNaN(i))return this.roundingMode==="significantFigures"?r.toPrecision(this.figures)===i.toPrecision(this.figures):Math.round(r*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(i*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error("value cannot be casted to numeric value in equalRounded operator: ".concat(r,", ").concat(i));break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}}]);return e}(i_);eN([r({type:String})],iA.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",iA);var iS=/*#__PURE__*/function(){"use strict";function t(){s(this,t)}c(t,null,[{key:"compareSingleValues",value:function t(t,e,n){switch(n){case"identifier":case"string":return t===e;case"integer":{var r=parseInt(t,10),i=parseInt(e,10);if(!isNaN(r)&&!isNaN(i))return r===i;console.error("Cannot convert ".concat(t," and/or ").concat(e," to int."));break}case"float":{var o=parseFloat(t),a=parseFloat(e);if(!isNaN(o)&&!isNaN(a))return o===a;console.error("couldn't convert ".concat(t," and/or ").concat(e," to float."));break}case"pair":case"directedPair":{var s=t.split(" ").sort(),u=e.split(" ").sort();if(s.length===2&&u.length===2)return n==="pair"&&(s.sort(),u.sort()),s.join(" ")===u.join(" ");console.error("compared two pair but one of the values does not have 2 values: 1: ".concat(t," 2: ").concat(e));break}}return!1}}]);return t}();var iq=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.toleranceMode="exact";return t}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value)?(console.error("unexpected cardinality in qti equal"),!1):iS.compareSingleValues(e.value,n.value,e.baseType)}return console.error("unexpected number of children in qti-equal"),null}}]);return e}(i_);eN([r({type:String})],iq.prototype,"toleranceMode",2);customElements.define("qti-equal",iq);var iR=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(e.baseType===n.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value>+n.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}}]);return e}(i_);customElements.define("qti-gt",iR);var iP=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return e.baseType===n.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value>=+n.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}}]);return e}(ik);customElements.define("qti-gte",iP);var iT=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===1){var t=this.getVariables();if(!t)return!0;var e=t[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}}]);return e}(i_);customElements.define("qti-is-null",iT);var i$=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(e.baseType===n.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value<+n.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}}]);return e}(i_);customElements.define("qti-lt",i$);var iD=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return e.baseType===n.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value<=+n.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}}]);return e}(ik);customElements.define("qti-lte",iD);var iU=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this;var e=this.context.variables.find(function(e){return e.identifier===t.identifier});if(!e)return console.warn("Response ".concat(this.identifier," can not be found")),null;var n=e.mapping,r=Array.isArray(e.value)?e.value:[e.value],i=0;var o=true,a=false,s=undefined;try{var u=function(){var t=c.value;var r=n.mapEntries.find(function(n){return iS.compareSingleValues(n.mapKey,t,e.baseType)});r==null||r.mappedValue==null?i+=n.defaultValue:i+=r.mappedValue};for(var l=r[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true)u()}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return n.lowerBound!=null&&(i=Math.max(n.lowerBound,i)),n.upperBound!=null&&(i=Math.min(n.upperBound,i)),i}}]);return e}(i_);eN([r({type:String})],iU.prototype,"identifier",2);customElements.define("qti-map-response",iU);var iM=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.defaultValue=0;return t}c(e,[{key:"mapEntries",get:function t(){return Array.from(this.querySelectorAll("qti-map-entry")).map(function(t){return{mapKey:t.getAttribute("map-key"),mappedValue:+t.getAttribute("mapped-value")}})}}]);return e}(n7);eN([r({attribute:"default-value",type:Number})],iM.prototype,"defaultValue",2),eN([r({attribute:"lower-bound",type:Number})],iM.prototype,"lowerBound",2),eN([r({attribute:"upper-bound",type:Number})],iM.prototype,"upperBound",2);customElements.define("qti-mapping",iM);var iI=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),n=t[0],r=t[1];return e.match(n,r)}return console.error("unexpected number of children in match"),null}}],[{key:"match",value:function t(t,e){switch(e.cardinality){case"single":var n;return t.value===null?!1:Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):iS.compareSingleValues((n=t.value)===null||n===void 0?void 0:n.toString(),e.value.toString(),e.baseType);case"ordered":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;for(var r=0;r<t.value.length;r++)if(!iS.compareSingleValues(e.value[r],t.value[r],e.baseType))return!1;return!0}case"multiple":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;var i=0;var o=true,a=false,s=undefined;try{for(var u=e.value[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true){var c=l.value;var h=null,d=$(t.value);var f=true,p=false,v=undefined;try{for(var y=d[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var g=m.value;if(iS.compareSingleValues(c,g,e.baseType)){h=g;break}}}catch(t){p=true;v=t}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(p){throw v}}}if(h!==null)d.splice(d.indexOf(h),1);else return!1;i++}}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}}]);return e}(i_);customElements.define("qti-match",iI);var iO=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");var e=q(t,2),n=e[0],r=e[1];if(n.baseType!==r.baseType&&console.warn("Which must both have the same base-type"),r.cardinality==="multiple"||r.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(n.baseType==="float"||r.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(n.baseType==="duration"||r.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),n.value===null||r.value===null)return null;var i=n.value;return r.value.includes(i)}}]);return e}(i_);customElements.define("qti-member",iO);var iL=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;if(a.cardinality!=="multiple"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[]}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}return t}}]);return e}(i_);customElements.define("qti-multiple",iL);var iN=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tC(),d(f(e.prototype),"render",this).call(this))}},{key:"getResult",value:function t(){return!this.firstElementChild.calculate()}}]);return e}(i_);customElements.define("qti-not",iN);var iV=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){return Array.from(this.children).map(function(t){var e=t;if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var n=e.calculate(),r=!1;if(typeof n=="string")if(n==="true")r=!0;else if(n==="false")r=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(r=n);return r}).some(function(t){return typeof t=="boolean"&&t})}}]);return e}(ik);customElements.define("qti-or",iV);var iH=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;if(a.cardinality!=="ordered"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[]}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}return t}}]);return e}(i_);customElements.define("qti-ordered",iH);var ij=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.context)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nH(tA(),JSON.stringify(r,null,2))}},{key:"calculate",value:function t(){var t=this;return this.context.variables.find(function(e){return e.identifier===t.identifier})||null}}]);return e}(n7);eN([r({type:String})],ij.prototype,"identifier",2),eN([e({context:ra,subscribe:!0}),i()],ij.prototype,"context",2);customElements.define("qti-printed-variable",ij);var iQ=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){return this.getVariables().reduce(function(t,e){if(e.baseType=="float"||e.baseType=="integer")try{return t*parseInt(e.value.toString())}catch(t){console.warn("can not convert to number")}else console.warn("has another baseType ".concat(e.baseType));return t},1)}}]);return e}(i_);customElements.define("qti-product",iQ);var iB=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.caseSensitive="true";return t}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value))return console.error("unexpected cardinality in qti string-match"),!1;var r=this.caseSensitive==="true"?e.value:e.value.toLowerCase(),i=this.caseSensitive==="true"?n.value:n.value.toLowerCase();return iS.compareSingleValues(r,i,e.baseType)}return console.error("unexpected number of children in qti-string-match"),null}}]);return e}(i_);eN([r({type:String,attribute:"case-sensitive"})],iB.prototype,"caseSensitive",2);customElements.define("qti-string-match",iB);var iF=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e),t._expression=new iz(Array.from(t.children));return t}c(e,[{key:"getResult",value:function t(){return this._expression.calculate()}}]);return e}(i_),iz=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.expressions=e}c(t,[{key:"calculate",value:function t(){return this.expressions.map(function(t){if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var e=t.calculate();return Number.isNaN(e)?(console.error("unexpected value in qti-sum, expected number"),null):Number(e)}).reduce(function(t,e){return t+e},0)}}]);return t}();customElements.define("qti-sum",iF);var iW=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getAttribute("identifier");return this.context.variables.find(function(e){return e.identifier===t}).value}}]);return e}(i_);customElements.define("qti-variable",iW);var iY=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;var n;t=a(this,e,arguments),n=t;t._errorMessage=null;t.loadConfig=/*#__PURE__*/function(){var t=o(function(t,e){var r,i,o,a;return O(this,function(o){switch(o.label){case 0:t=n.removeDoubleSlashes(t);o.label=1;case 1:o.trys.push([1,5,,6]);return[4,fetch(t)];case 2:r=o.sent();if(!r.ok)return[3,4];return[4,r.json()];case 3:i=o.sent();for(var s in i.paths)e&&(i.paths[s]=n.getResolvablePath(i.paths[s],e));return[2,i];case 4:return[3,6];case 5:a=o.sent();return[3,6];case 6:return[2,null]}})});return function(e,n){return t.apply(this,arguments)}}();t.getResolvablePathString=function(e,n){return e=e.replace(/\.js$/,""),(e===null||e===void 0?void 0:e.toLocaleLowerCase().startsWith("http"))||!n?e:t.removeDoubleSlashes("".concat(n,"/").concat(e))};t.getResolvablePath=function(e,n){return Array.isArray(e)?e.map(function(e){return t.getResolvablePathString(e,n)}):t.getResolvablePathString(e,n)};return t}c(e,[{key:"convertQtiVariableJSON",value:function t(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n){for(var r in n)if(n.hasOwnProperty(r)){var i=n[r];if(Array.isArray(i))return i.map(String);if(i!=null)return String(i)}}}return null}},{key:"startChecking",value:function t(){var t=this;this.intervalId=setInterval(function(){var e=t.pci.getResponse(),n=t.pci.getResponse(),r=JSON.stringify(e);if(r!==t.rawResponse){t.rawResponse=r;var i=t.convertQtiVariableJSON(n);t.value=i,t.saveResponse(i)}},200)}},{key:"stopChecking",value:function t(){this.intervalId!==void 0&&clearInterval(this.intervalId)}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return this.rawResponse},set:function t(t){}},{key:"getTAOConfig",value:function t(t){var e=t.querySelectorAll("properties"),n={},r=function(t){var e={},n=t.getAttribute("key");if(n){var r=Array.from(t.children),o=r.map(function(t){return t.getAttribute("key")});o.length>0&&!o.find(function(t){return!Number.isInteger(+t)})?e[n]=r.map(function(t){return i(t)}):e[n]=t.textContent}return e},i=function(t){if(t){var e={};var n=true,i=false,o=undefined;try{for(var a=t.children[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var u=s.value;e=k({},e,r(u))}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e}};var o=true,a=false,s=undefined;try{for(var u=e[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true){var c=l.value;return c.getAttribute("key")||(n=k({},n,i(c))),n}}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return console.log("Can not find qti-custom-interaction config"),null}},{key:"register",value:function t(t){this.pci=t;var e=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",n=e=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");n.classList.add("qti-customInteraction"),e=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");var r=e=="IMS"?{properties:this.dataset,onready:function(){console.log("onready")}}:this.getTAOConfig(this);e=="IMS"?t.getInstance(n,r,void 0):t.initialize(this.customInteractionTypeIdentifier,n.firstElementChild,r),e=="TAO"&&Array.from(this.querySelectorAll("link")).map(function(t){return t.getAttribute("href")}).forEach(function(t){var e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.media="screen",e.href=t,n.appendChild(e)}),this.startChecking()}},{key:"connectedCallback",value:function t(){var t=this;d(f(e.prototype),"connectedCallback",this).call(this),define("qtiCustomInteractionContext",function(){return{register:function(e){t.register(e)},notifyReady:function(){}}});var n=this.buildRequireConfig();requirejs.config(n)(["require"],function(e){e([t.module])})}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),requirejs.undef(this.customInteractionTypeIdentifier);var t=requirejs.s.contexts;delete t[this.customInteractionTypeIdentifier],this.stopChecking()}},{key:"buildRequireConfig",value:function t(){var t={context:this.customInteractionTypeIdentifier,catchError:!0,paths:window.requirePaths||{},shim:window.requireShim||{}};if(!globalThis.require)return this._errorMessage="RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js",null;var e=this.getAttribute("data-base-url"),n=this.querySelector("qti-interaction-modules");if(n){var r=n.querySelectorAll("qti-interaction-module");var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),u;!(i=(u=s.next()).done);i=true){var l=u.value;var c=l.getAttribute("id"),h=l.getAttribute("primary-path"),d=l.getAttribute("fallback-path");if(c&&h){var f=d?this.combineRequireResolvePaths(this.getResolvablePath(h,e),this.getResolvablePath(d,e)):this.getResolvablePath(h,e),p=t.paths[c]||[];t.paths[c]=this.combineRequireResolvePaths(p,f)}}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}return t}},{key:"combineRequireResolvePaths",value:function t(t,e){var n=Array.isArray(t)?t:[t],r=Array.isArray(e)?e:[e];return n.concat(r)}},{key:"removeDoubleSlashes",value:function t(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}},{key:"render",value:function t(){return nH(tq(),this._errorMessage&&nH(tS(),this._errorMessage))}}]);return e}(rD);eN([r({type:String,attribute:"module"})],iY.prototype,"module",2),eN([r({type:String,attribute:"custom-interaction-type-identifier"})],iY.prototype,"customInteractionTypeIdentifier",2),eN([i()],iY.prototype,"_errorMessage",2),iY=eN([re("qti-portable-custom-interaction")],iY);var iX=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.touchStartTime=0;this.touchStartPoint=null;this.lastClickTime=0;this.isDraggable=!1;this.dragSource=null;this.dragClone=null;this.touchEndTriggered=!1;this.isDragging=!1;this.initialTransform="";this.hasDispatchedDragStart=!1;this.rootNode=null;this.focusedElement=null;this.focusableDropZones=[];this.currentDropZoneIndex=-1;this.dataTransfer={data:{},setData:function t(t,e){this.data[t]=e},getData:function t(t){return this.data[t]},effectAllowed:"move"};this.cloneOffset={x:0,y:0};this.lastTarget=null;this.currentDropTarget=null;this.allowClick=!0;this.copyStylesForDragClone=!0;this.dragOnClickEnabled=!1;this.useDragClone=!1;this.MIN_DRAG_DISTANCE=5;this.DRAG_CLONE_OPACITY=1;if(t.instance)return t.instance;t.instance=this,document.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("mousemove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("touchend",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("mouseup",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("touchcancel",this.handleTouchCancel.bind(this),{passive:!1}),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("keyup",this.handleKeyUp.bind(this))}c(t,[{key:"addDraggableElements",value:function t(t){var e=this;t.forEach(function(t){t.setAttribute("tabindex","0"),t.addEventListener("focus",function(){return e.focusedElement=t}),t.addEventListener("blur",function(){return e.focusedElement=null}),t.addEventListener("touchstart",e.handleTouchStart.bind(e),{passive:!1}),t.addEventListener("mousedown",e.handleTouchStart.bind(e),{passive:!1})})}},{key:"handleTouchStart",value:function t(t){this.touchStartTime=Date.now();var e=this.getEventCoordinates(t),n=e.x,r=e.y;if(this.touchStartPoint={x:n,y:r},this.dragSource=t.currentTarget,this.isDraggable=!0,this.rootNode=this.dragSource.getRootNode(),this.dragOnClickEnabled&&(this.isDragging=!0,this.createDragClone(t,{clientX:n,clientY:r})),!this.useDragClone){var i=window.getComputedStyle(this.dragSource);this.initialTransform=i.transform==="none"?"":i.transform,this.initialTransition=i.transition||"",this.dragSource.style.transition="none";var o=this.dragSource.getBoundingClientRect();this.cloneOffset.x=n-o.left,this.cloneOffset.y=r-o.top,this.dragSource.style.zIndex="9999",this.dragSource.focus()}t.preventDefault()}},{key:"handleTouchMove",value:function t(t){if(this.isDraggable&&this.dragSource){var e=this.getEventCoordinates(t),n=e.x,r=e.y,i={clientX:n,clientY:r};this.calculateDragDistance(i)>=this.MIN_DRAG_DISTANCE&&(this.dragSource.style.pointerEvents="none",this.isDragging=!0),this.createDragClone(t,i),t.preventDefault()}}},{key:"createDragClone",value:function t(t,e){if(!this.isDragging)return;if(this.useDragClone){if(!this.dragClone){if(this.dragSource.style.opacity=this.DRAG_CLONE_OPACITY.toString(),this.dragClone=this.dragSource.cloneNode(!0),this.copyStylesForDragClone){var n=window.getComputedStyle(this.dragSource);var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;this.dragClone.style[u]=n.getPropertyValue(u)}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}v(this.rootNode,ShadowRoot)?this.rootNode.host.appendChild(this.dragClone):v(this.rootNode,Document)&&document.body.appendChild(this.dragClone),this.calculateClonePosition(e),this.setDragCloneStyles(e),this.dispatchCustomEvent(this.dragSource,"dragstart")}this.updateDragClonePosition(e)}else if(this.touchStartPoint){var l=e.clientX-this.touchStartPoint.x,c=e.clientY-this.touchStartPoint.y;this.dragSource.style.transform="".concat(this.initialTransform," translate(").concat(l,"px, ").concat(c,"px)"),this.hasDispatchedDragStart||(this.dispatchCustomEvent(this.dragSource,"dragstart"),this.hasDispatchedDragStart=!0)}var h=this.findDropTarget(t);h!==this.lastTarget&&(this.dispatchCustomEvent(h,"dragenter"),this.dispatchCustomEvent(this.lastTarget,"dragleave"),this.lastTarget=h),this.currentDropTarget=h,this.currentDropTarget&&this.dispatchCustomEvent(h,"dragover")}},{key:"handleTouchEnd",value:function t(t){this.touchEndTriggered=!0,this.isDraggable=!1;var e=!1;if(this.currentDropTarget)this.dispatchCustomEvent(this.currentDropTarget,"drop"),this.dispatchCustomEvent(this.dragSource,"dragend"),e=!0;else if(this.isDragging){var n;var r=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});r.dataTransfer={dropEffect:"none"},(n=this.dragSource)===null||n===void 0?void 0:n.dispatchEvent(r)}this.resetDragState(e)}},{key:"handleTouchCancel",value:function t(t){this.resetDragState()}},{key:"findDropTarget",value:function t(t){var e=this.getEventCoordinates(t),n=e.x,r=e.y;return this.getDropTargetAtPoint(document,n,r)}},{key:"getDropTargetAtPoint",value:function t(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r>2)return null;var i=t.elementFromPoint(e,n);if(!i)return null;if(i.hasAttribute("dropzone"))return i;var o=i.parentElement;for(;o;){if(o.hasAttribute("dropzone"))return o;o=o.parentElement}if(i.shadowRoot&&r<2){var a=this.getDropTargetAtPoint(i.shadowRoot,e,n,r+1);if(a)return a}return null}},{key:"handleKeyDown",value:function t(t){this.focusedElement&&(t.key===" "&&!this.isDragging?(t.preventDefault(),this.isDraggable=!0,this.dragSource=this.focusedElement,this.isDragging=!0,this.collectDropZones(),this.dispatchCustomEvent(this.dragSource,"dragstart")):t.key==="Tab"&&this.isDragging&&(t.preventDefault(),this.moveToNextDropZone()))}},{key:"handleKeyUp",value:function t(t){t.key===" "&&this.isDragging&&this.currentDropTarget&&(t.preventDefault(),this.dispatchCustomEvent(this.currentDropTarget,"drop"),this.dispatchCustomEvent(this.dragSource,"dragend"),this.resetDragState(!0))}},{key:"collectDropZones",value:function t(){this.focusableDropZones=Array.from(document.querySelectorAll("[dropzone]")),this.currentDropZoneIndex=-1}},{key:"moveToNextDropZone",value:function t(){if(this.focusableDropZones.length===0)return;this.currentDropZoneIndex=(this.currentDropZoneIndex+1)%this.focusableDropZones.length;var t=this.focusableDropZones[this.currentDropZoneIndex];t.focus(),this.currentDropTarget=t,this.dispatchCustomEvent(t,"dragenter")}},{key:"getEventCoordinates",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=t.touches?t.touches[0]:t;return{x:e?n.pageX:n.clientX,y:e?n.pageY:n.clientY}}},{key:"calculateClonePosition",value:function t(t){var e=this.dragSource.getBoundingClientRect();this.cloneOffset.x=t.clientX-e.left,this.cloneOffset.y=t.clientY-e.top}},{key:"setDragCloneStyles",value:function t(t){this.dragClone.style.position="fixed",this.dragClone.style.top="".concat(t.clientY-this.cloneOffset.y,"px"),this.dragClone.style.left="".concat(t.clientX-this.cloneOffset.x,"px"),this.dragClone.style.pointerEvents="none",this.dragClone.style.zIndex="999999"}},{key:"updateDragClonePosition",value:function t(t){var e=this;requestAnimationFrame(function(){if(e.touchEndTriggered||!e.dragClone)return;var n=t.clientX-e.cloneOffset.x,r=t.clientY-e.cloneOffset.y,i=e.applyBoundaries(n,r,e.dragClone),o=i.newLeft,a=i.newTop;e.dragClone.style.left="".concat(o,"px"),e.dragClone.style.top="".concat(a,"px")})}},{key:"applyTransformBoundaries",value:function t(t,e){var n;v(this.rootNode,ShadowRoot)?n=this.rootNode.host.getBoundingClientRect():v(this.rootNode,Document)?n=document.documentElement.getBoundingClientRect():n=new DOMRect(0,0,window.innerWidth,window.innerHeight);var r=this.dragSource.getBoundingClientRect(),i=r.width,o=r.height,a=r.left+t,s=r.top+e,u=Math.max(n.left,Math.min(a,n.right-i)),l=Math.max(n.top,Math.min(s,n.bottom-o)),c=u-r.left,h=l-r.top;return{boundedDeltaX:c,boundedDeltaY:h}}},{key:"applyBoundaries",value:function t(t,e,n){var r;v(this.rootNode,ShadowRoot)?r=this.rootNode.host.getBoundingClientRect():v(this.rootNode,Document)?r=document.documentElement.getBoundingClientRect():r=new DOMRect(0,0,window.innerWidth,window.innerHeight);var i=n.getBoundingClientRect(),o=i.width,a=i.height,s=Math.max(r.left,Math.min(t,r.right-o)),u=Math.max(r.top,Math.min(e,r.bottom-a));return{newLeft:s,newTop:u}}},{key:"calculateDragDistance",value:function t(t){var e=Math.abs(t.clientX-this.touchStartPoint.x),n=Math.abs(t.clientY-this.touchStartPoint.y);return e+n}},{key:"dispatchCustomEvent",value:function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t)return;var r=new CustomEvent(e,{bubbles:n,cancelable:!0});r.dataTransfer=this.dataTransfer,t.dispatchEvent(r)}},{key:"resetDragState",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var e;this.isDragging&&(this.useDragClone?(this.dragSource.style.opacity="1.0",(e=this.dragClone)===null||e===void 0?void 0:e.parentElement.removeChild(this.dragClone)):(t||(this.dragSource.style.transform="translate(0, 0)"),this.dragSource.style.zIndex="",this.dragSource.style.pointerEvents="",this.dragSource.style.transition=this.initialTransition,this.initialTransition="")),this.isDragging=!1,this.dragSource=null,this.dragClone=null,this.isDraggable=!1,this.touchStartTime=0,this.touchStartPoint=null,this.touchEndTriggered=!1,this.dataTransfer={data:{},setData:function t(t,e){this.data[t]=e},getData:function t(t){return this.data[t]},effectAllowed:"move"},this.cloneOffset={x:0,y:0},this.lastTarget=null,this.currentDropTarget=null,this.allowClick=!0,this.initialTransform="",this.hasDispatchedDragStart=!1,this.rootNode=null}}]);return t}();var iZ=function(t,e,n){var i=/*#__PURE__*/function(t){"use strict";p(r,t);function r(){s(this,r);var t;t=a(this,r,arguments);t.disabled=!1;return t}c(r,[{key:"firstUpdated",value:function t(t){var e=this;if(this.isMatchTabular())return;d(f(r.prototype),"firstUpdated",this).call(this,t);var n=this.getDroppableElements();this.initializeEventHandlers(),n.forEach(function(t){e.prepareDroppable(t),e.observeDroppableAttributes(t)})}},{key:"isMatchTabular",value:function t(){return this.classList.contains("qti-match-tabular")}},{key:"getDroppableElements",value:function t(){return Array.from(e?this.shadowRoot.querySelectorAll(n):this.querySelectorAll(n))}},{key:"initializeEventHandlers",value:function t(){this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this)}},{key:"prepareDroppable",value:function t(t){t.setAttribute("dropzone","move"),t.addEventListener("dragleave",this.dragleaveHandler),this.attachEventListeners(t)}},{key:"observeDroppableAttributes",value:function t(t){var e=this;this.observer=new MutationObserver(function(n){n.forEach(function(n){var r=n.attributeName;r==="disabled"&&e.toggleDroppableHandlers(t)})}),this.observer.observe(t,{attributes:!0})}},{key:"toggleDroppableHandlers",value:function t(t){t.hasAttribute("disabled")?this.removeEventListeners(t):this.attachEventListeners(t)}},{key:"attachEventListeners",value:function t(t){t.addEventListener("dragover",this.dragoverHandler),t.addEventListener("dragenter",this.dragenterHandler),t.addEventListener("drop",this.dropHandler)}},{key:"removeEventListeners",value:function t(t){t.removeEventListener("dragover",this.dragoverHandler),t.removeEventListener("dragenter",this.dragenterHandler),t.removeEventListener("drop",this.dropHandler)}},{key:"disconnectedCallback",value:function t(){var t;this.isMatchTabular()||(d(f(r.prototype),"disconnectedCallback",this).call(this),(t=this.observer)===null||t===void 0?void 0:t.disconnect())}},{key:"dragenterHandler",value:function t(t){t.preventDefault()}},{key:"dragoverHandler",value:function t(t){return t.preventDefault(),this.activateDroppable(t.currentTarget),t.dataTransfer.dropEffect="move",!1}},{key:"activateDroppable",value:function t(t){t.setAttribute("active","")}},{key:"dropHandler",value:function t(t){var e=this;return o(function(){var n,r,i,o,a;return O(this,function(s){switch(s.label){case 0:t.preventDefault();n=t.currentTarget,r=t.dataTransfer.getData("text"),i=e.findDraggable(r);if(!i)return[3,4];if(!(i&&!e.isValidDrop(n,i)))return[3,1];a=(i.style.transform="translate(0, 0)",!1);return[3,3];case 1:return[4,e.moveDraggableToDroppable(i,n)];case 2:a=(s.sent(),e.deactivateDroppable(n),!1);s.label=3;case 3:o=a;return[3,5];case 4:o=!1;s.label=5;case 5:return[2,o]}})})()}},{key:"findDraggable",value:function t(t){return t?this.querySelector("[identifier=".concat(t,"]"))||this.shadowRoot.querySelector("[identifier=".concat(t,"]")):null}},{key:"isValidDrop",value:function t(t,e){return e.parentElement.getAttribute("identifier")!==t.getAttribute("identifier")}},{key:"moveDraggableToDroppable",value:function t(t,e){var n=this;return o(function(){var r;return O(this,function(i){switch(i.label){case 0:r=function(){t.style.transform="translate(0, 0)",e.appendChild(t),n.checkMaxAssociations(),n.saveResponse(null)};if(!document.startViewTransition){r();return[2]}return[4,document.startViewTransition(r).finished];case 1:i.sent();return[2]}})})()}},{key:"deactivateDroppable",value:function t(t){t.removeAttribute("active")}},{key:"dragleaveHandler",value:function t(t){return t.preventDefault(),this.deactivateDroppable(t.currentTarget),t.dataTransfer.dropEffect="none",!1}}]);return r}(t);return eN([r({type:Boolean,reflect:!0})],i.prototype,"disabled",2),i};var iG=function(t,e,n){var r=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(t);return r};var iK=function(t,e,n,i){var u=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;var n;t=a(this,e,arguments),n=t;t.draggables=new Map;t.droppables=[];t.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};t.minAssociations=1;t.maxAssociations=1;t.handleDragStart=function(e){var n=e.currentTarget;e.dataTransfer.setData("text",n.getAttribute("identifier")),n.setAttribute("dragging",""),t.activateDroppables()};t.handleDragEnd=/*#__PURE__*/function(){var t=o(function(t){var e;return O(this,function(r){switch(r.label){case 0:t.preventDefault(),n.deactivateDroppables();e=t.currentTarget;e.removeAttribute("dragging");return[4,n.wasDropped(t)];case 1:r.sent()||n.configuration.dragCanBePlacedBack&&n.restoreInitialDraggablePosition(e);return[2]}})});return function(e){return t.apply(this,arguments)}}();t.checkForMoveTestItem=function(t){return t.dataTransfer.items?new Promise(function(e){var n=!1,r=Array.from(t.dataTransfer.items),i=r.length;if(i===0){e(!1);return}r.forEach(function(t){t.kind==="string"&&t.type==="text"?t.getAsString(function(t){t==="move-test"&&(n=!0),i===0&&e(n)}):i===0&&e(n)})}):Promise.resolve(!1)};return t}c(e,[{key:"handleDraggablesChange",value:function t(t,e){if(this.isMatchTabular())return;var n=this.filterExistingDraggables(t);n.length>0&&this.addNewDraggables(n)}},{key:"firstUpdated",value:function t(t){d(f(e.prototype),"firstUpdated",this).call(this,t),this.initializeDroppables()}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.initializeDragDropApi()}},{key:"initializeDragDropApi",value:function t(){this.dragDropApi=new iX,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}},{key:"isMatchTabular",value:function t(){return this.classList.contains("qti-match-tabular")}},{key:"filterExistingDraggables",value:function t(t){var e=this;return t.filter(function(t){return!e.draggables.has(t)})}},{key:"addNewDraggables",value:function t(t){var e=this;this.dragDropApi.addDraggableElements(t),t.forEach(function(t){return e.storeDraggable(t)})}},{key:"storeDraggable",value:function t(t){var e=Array.from(t.parentNode.children).indexOf(t);this.draggables.set(t,{parent:t.parentElement,index:e}),t.style.viewTransitionName="drag-".concat(e,"-").concat(this.getAttribute("identifier")||crypto.randomUUID()),t.setAttribute("qti-draggable","true"),t.addEventListener("dragstart",this.handleDragStart),t.addEventListener("dragend",this.handleDragEnd)}},{key:"initializeDroppables",value:function t(){this.droppables=Array.from(n?this.shadowRoot.querySelectorAll(i):this.querySelectorAll(i))}},{key:"activateDroppables",value:function t(){this.droppables.forEach(function(t){return t.setAttribute("enabled","")})}},{key:"deactivateDroppables",value:function t(){this.droppables.forEach(function(t){return t.removeAttribute("enabled")})}},{key:"wasDropped",value:function t(t){var e=this;return o(function(){var n;return O(this,function(r){switch(r.label){case 0:return[4,e.checkForMoveTestItem(t)];case 1:n=r.sent();return[2,t.dataTransfer.dropEffect!=="none"||n]}})})()}},{key:"wasMoved",value:function t(t){return t.dataTransfer.dropEffect==="move"}},{key:"restoreInitialDraggablePosition",value:function t(t){var e=this;return o(function(){var n,r,i,o,a,s;return O(this,function(u){n=e.draggables.get(t),r=n.parent,i=n.index,o=Math.min(i,r.children.length),a=function(t,n,r){var i=Math.min(r,n.children.length);n.insertBefore(t,n.children[i]),t.style.transform="translate(0, 0)",e.checkMaxAssociations()};if(!document.startViewTransition){a(t,r,i);return[2]}s=document.startViewTransition(function(){t.style.transform="",a(t,r,i)});return[2]})})()}},{key:"checkMaxAssociations",value:function t(){var t=this;this.droppables.forEach(function(e,n){var r=+(e.getAttribute("match-max")||1);e.querySelectorAll('[qti-draggable="true"]').length>=r?t.disableDroppable(e):t.enableDroppable(e)})}},{key:"disableDroppable",value:function t(t){t.setAttribute("disabled",""),t.removeAttribute("dropzone")}},{key:"enableDroppable",value:function t(t){t.removeAttribute("disabled"),t.setAttribute("dropzone","move")}},{key:"value",get:function t(){return this.collectResponseData()},set:function t(t){var e=this;this.isMatchTabular()||(this.resetDroppables(),t===null||t===void 0?void 0:t.forEach(function(t){return e.placeResponse(t)}))}},{key:"placeResponse",value:function t(t){var e=this;var n=T(t.split(" ").reverse()),r=n[0],i=n.slice(1),o=this.findDroppableById(r);i.forEach(function(t){return e.placeDraggableInDroppable(t,o)})}},{key:"findDroppableById",value:function t(t){return this.droppables.find(function(e){return e.getAttribute("identifier")===t})}},{key:"placeDraggableInDroppable",value:function t(t,e){var n=this;return o(function(){var r,i,o;return O(this,function(a){switch(a.label){case 0:r=n.querySelector("[identifier=".concat(t,"]"));if(!e||!r){console.error("Cannot find draggable or droppable with the given identifier: ".concat(t));return[2]}i=function(){r.style.transform="translate(0, 0)",e.appendChild(r),n.checkMaxAssociations()};if(!document.startViewTransition)return[3,2];return[4,document.startViewTransition(i).finished];case 1:o=a.sent();return[3,3];case 2:o=i();a.label=3;case 3:o;return[2]}})})()}},{key:"validate",value:function t(){var t=this.getValidAssociations();return this.minAssociations<=0||this.minAssociations<=t}},{key:"getValidAssociations",value:function t(){return this.droppables.filter(function(t){return t.childElementCount>0}).length}},{key:"saveResponse",value:function t(){var t=this.collectResponseData();this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:t}}))}},{key:"collectResponseData",value:function t(){return this.droppables.map(function(t){var e=t.querySelectorAll('[qti-draggable="true"]'),n=Array.from(e).map(function(t){return t.getAttribute("identifier")}),r=t.getAttribute("identifier");return n.map(function(t){return"".concat(t," ").concat(r)})}).flat()}},{key:"reset",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.resetDroppables(),t&&this.saveResponse()}},{key:"resetDroppables",value:function t(){var t=this;return o(function(){var e;return O(this,function(n){switch(n.label){case 0:e=function(t,e,n){t.style.transform="translate(0, 0)";var r=Math.min(n,e.children.length);e.insertBefore(t,e.children[r])};if(!document.startViewTransition){t.draggables.forEach(function(t,n){var r=t.parent,i=t.index;e(n,r,i)});return[2]}return[4,document.startViewTransition(function(){t.draggables.forEach(function(t,n){var r=t.parent,i=t.index;e(n,r,i)})}).finished];case 1:n.sent();return[2]}})})()}}]);return e}(iG(iZ(t,n,i),i,e));return eN([r({attribute:!1,type:Object})],u.prototype,"configuration",2),eN([r({type:Number,reflect:!0,attribute:"min-associations"})],u.prototype,"minAssociations",2),eN([r({type:Number,reflect:!0,attribute:"max-associations"})],u.prototype,"maxAssociations",2),eN([eS(e)],u.prototype,"handleDraggablesChange",1),u};var iJ=e9(tR());var i0=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t._childrenMap=[];t._registerChoiceHandler=t._registerChoice.bind(t),t.addEventListener("register-qti-simple-associable-choice",t._registerChoiceHandler);return t}c(e,[{key:"_registerChoice",value:function t(t){var e=t.target;this._childrenMap.push(e)}},{key:"render",value:function t(){return nH(tT(),this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map(function(t,e){return nH(tP(),e,e,e,e)}))}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}}]);return e}(iK(rD,"qti-simple-associable-choice",!0,".dl"));i0.styles=iJ,eN([i()],i0.prototype,"_childrenMap",2),i0=eN([re("qti-associate-interaction")],i0);var i1=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t._errorMessage=null;t.handlePostMessage=t.handlePostMessage.bind(t);return t}c(e,[{key:"connectedCallback",value:function t(){var t=this;d(f(e.prototype),"connectedCallback",this).call(this);var n=this.data.startsWith("http")?this.data:I(this.baseItemUrl+"/"+this.data);fetch(n).then(function(t){return t.json()}).then(function(e){t.manifest=e,t.setupCES()}).catch(function(e){t._errorMessage=e})}},{key:"setupCES",value:function t(){var t=this.shadowRoot.querySelector("#pciContainer"),e=t.contentWindow||t,n=t.contentDocument;window.addEventListener("message",this.handlePostMessage),n.open(),n.write("\n <html>\n <head>\n <link href='".concat(I("".concat(this.baseRefUrl,"/").concat(this.manifest.style[0])),"' rel=\"stylesheet\" />\n <script src='").concat(I("".concat(this.baseRefUrl,"/").concat(this.manifest.script[0])),"'><\/script>\n </head>\n <body></body>\n </html>\n ")),n.close()}},{key:"getIFrames",value:function t(){var t=this.shadowRoot.querySelectorAll("iframe"),e=this.querySelectorAll("iframe"),n=$(t).concat($(e));var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;var l=u.src;if(new URL(l,window.location.href).origin===window.location.origin)try{var c=u.contentDocument||u.contentWindow.document;c&&this.getInnerIFrames(c,n)}catch(t){console.error("Error accessing nested iframe:",t)}}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}return n.forEach(function(t,e){n.indexOf(t)!==e&&n.splice(e,1)}),n}},{key:"getInnerIFrames",value:function t(t){var e=this;var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.querySelectorAll("iframe").forEach(function(t){n.push(t);var r=t.src;if(new URL(r,window.location.href).origin===window.location.origin)try{var i=t.contentDocument||t.contentWindow.document;e.getInnerIFrames(i,n)}catch(t){console.error("Error accessing nested iframe:",t)}else console.warn("Skipped cross-origin iframe:",r)}),n}},{key:"postToWindowAndIframes",value:function t(t,e){window.postMessage({type:t,data:e},"*");var n=this.getIFrames();var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;u.contentWindow&&u.contentWindow.postMessage({type:t,data:e},"*")}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}},{key:"handlePostMessage",value:function t(t){var e=this;var n=t.data,r=n.type,i=n.data;switch(r){case"setResponse":this.rawResponse=i,this.saveResponse(i);break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{var o=this.manifest.media.map(function(t){return t.startsWith("http")?t:I(e.baseRefUrl+"/"+t)});this.postToWindowAndIframes("mediaData",o);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}},{key:"validate",value:function t(){return this.rawResponse!==""}},{key:"value",get:function t(){return this.rawResponse},set:function t(t){if(typeof t=="string")this.rawResponse=t,this.saveResponse(t);else throw new Error("Value must be a string")}},{key:"disconnectedCallback",value:function t(){window.removeEventListener("message",this.handlePostMessage),d(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function t(){return nH(tD(),this.getAttribute("width"),this.getAttribute("height"),this._errorMessage&&nH(t$(),this._errorMessage))}}]);return e}(rD);eN([r({type:String,attribute:"data"})],i1.prototype,"data",2),eN([r({type:String,attribute:"data-base-item"})],i1.prototype,"baseItemUrl",2),eN([r({type:String,attribute:"data-base-ref"})],i1.prototype,"baseRefUrl",2),eN([r({type:String,attribute:"id"})],i1.prototype,"id",2),eN([i()],i1.prototype,"_errorMessage",2),i1=eN([re("qti-custom-interaction")],i1);var i2=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.countAttempt="true";return t}c(e,[{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return""},set:function t(t){}},{key:"render",value:function t(){return nH(tU(),this.disabled,this.endAttempt,this.title)}},{key:"endAttempt",value:function t(t){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}}]);return e}(rD);eN([r({type:String,attribute:"count-attempt"})],i2.prototype,"countAttempt",2),eN([r({type:String})],i2.prototype,"title",2),i2=eN([re("qti-end-attempt-interaction")],i2);var i3=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tM())}},{key:"correctResponse",set:function t(t){var e=this;var n=[],r=Array.isArray(t)?t:[t];r&&(n=r.map(function(t){var e=t.split(" ");return{text:e[0],gap:e[1]}})),this.querySelectorAll("qti-gap").forEach(function(t,r){var i,o,a;var s=t.getAttribute("identifier"),u=(i=n.find(function(t){return t.gap===s}))===null||i===void 0?void 0:i.text,l=(o=e.querySelector('qti-gap-text[identifier="'.concat(u,'"]')))===null||o===void 0?void 0:o.textContent.trim();if(u&&l){var c;if(!((c=t.nextElementSibling)===null||c===void 0?void 0:c.classList.contains("correct-option"))){var h=document.createElement("span");h.classList.add("correct-option"),h.textContent=l,t.insertAdjacentElement("afterend",h)}}else((a=t.nextElementSibling)===null||a===void 0?void 0:a.classList.contains("correct-option"))&&t.nextElementSibling.remove()})}}]);return e}(iK(rD,"qti-gap-text",!1,"qti-gap"));i3.styles=[e9(tI())],i3=eN([re("qti-gap-match-interaction")],i3);var i4=function(t,e,n){var r=new Map;for(var i=e;i<=n;i++)r.set(t[i],i);return r},i5=rF(/*#__PURE__*/function(t){"use strict";p(e,t);function e(t){s(this,e);var n;if(n=a(this,e,[t]),t.type!==rB.CHILD)throw Error("repeat() can only be used in text expressions");return n}c(e,[{key:"dt",value:function t(t,e,n){var r;n===void 0?n=e:e!==void 0&&(r=e);var i=[],o=[],a=0;var s=true,u=false,l=undefined;try{for(var c=t[Symbol.iterator](),h;!(s=(h=c.next()).done);s=true){var d=h.value;i[a]=r?r(d,a):a,o[a]=n(d,a),a++}}catch(t){u=true;l=t}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(u){throw l}}}return{values:o,keys:i}}},{key:"render",value:function t(t,e,n){return this.dt(t,e,n).values}},{key:"update",value:function t(t,e){var n=q(e,3),r=n[0],i=n[1],o=n[2];var a=rj(t),s=this.dt(r,i,o),u=s.values,l=s.keys;if(!Array.isArray(a))return this.ut=l,u;var c;var h=(c=this.ut)!==null&&c!==void 0?c:this.ut=[],d=[],f,p,v=0,y=a.length-1,m=0,g=u.length-1;for(;v<=y&&m<=g;)if(a[v]===null)v++;else if(a[y]===null)y--;else if(h[v]===l[m])d[m]=rN(a[v],u[m]),v++,m++;else if(h[y]===l[g])d[g]=rN(a[y],u[g]),y--,g--;else if(h[v]===l[g])d[g]=rN(a[v],u[g]),rL(t,d[g+1],a[v]),v++,g--;else if(h[y]===l[m])d[m]=rN(a[y],u[m]),rL(t,a[v],a[y]),y--,m++;else if(f===void 0&&(f=i4(l,m,g),p=i4(h,v,y)),f.has(h[v]))if(f.has(h[y])){var b=p.get(l[m]),_=b!==void 0?a[b]:null;if(_===null){var k=rL(t,a[v]);rN(k,u[m]),d[m]=k}else d[m]=rN(_,u[m]),rL(t,a[v],_),a[b]=null;m++}else rQ(a[y]),y--;else rQ(a[v]),v++;for(;m<=g;){var E=rL(t,d[g+1]);rN(E,u[m]),d[m++]=E}for(;v<=y;){var w=a[v++];w!==null&&rQ(w)}return this.ut=l,rH(t,d),nB}}]);return e}(rz));var i6=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t.startPoint=null;t.endPoint=null;t._lines=[];t.addEventListener("qti-register-hotspot",t.positionHotspotOnRegister);return t}c(e,[{key:"reset",value:function t(){this._lines=[]}},{key:"validate",value:function t(){return this._lines.length>0}},{key:"value",get:function t(){return this._lines},set:function t(t){Array.isArray(t)&&(this._lines=t)}},{key:"render",value:function t(){var t=this;var e,n,r,i;return nH(tN(),r$((e=this.grImage[0])===null||e===void 0?void 0:e.width),r$((n=this.grImage[0])===null||n===void 0?void 0:n.height),(r=this.grImage[0])===null||r===void 0?void 0:r.width,(i=this.grImage[0])===null||i===void 0?void 0:i.height,i5(this._lines,function(t){return t},function(e,n){return nj(tO(),parseInt(t.querySelector("[identifier="+e.split(" ")[0]+"]").style.left),parseInt(t.querySelector("[identifier="+e.split(" ")[0]+"]").style.top),parseInt(t.querySelector("[identifier="+e.split(" ")[1]+"]").style.left),parseInt(t.querySelector("[identifier="+e.split(" ")[1]+"]").style.top),function(e){e.stopPropagation(),t._lines=t._lines.filter(function(t,e){return e!==n}),t.saveResponse(t._lines)})}),this.startPoint&&nj(tL(),this.startCoord.x,this.startCoord.y,this.mouseCoord.x,this.mouseCoord.y))}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});eq(i,o,e,n)}},{key:"firstUpdated",value:function t(t){var n=this;d(f(e.prototype),"firstUpdated",this).call(this,t),this.hotspots=this.querySelectorAll("qti-associable-hotspot"),document.addEventListener("mousemove",function(t){n.mouseCoord={x:t.clientX-n.grImage[0].getBoundingClientRect().left,y:t.clientY-n.grImage[0].getBoundingClientRect().top}}),this.hotspots.forEach(function(t){t.style.left=t.getAttribute("coords").split(",")[0]+"px",t.style.top=t.getAttribute("coords").split(",")[1]+"px",t.addEventListener("click",function(t){n.startPoint?n.endPoint||(n.endPoint=t.target,n._lines=$(n._lines).concat([n.startPoint.getAttribute("identifier")+" "+n.endPoint.getAttribute("identifier")]),n.saveResponse(n._lines),n.startPoint=null,n.endPoint=null):(n.startPoint=t.target,n.startCoord={x:n.startPoint.getAttribute("coords").split(",")[0],y:n.startPoint.getAttribute("coords").split(",")[1]})})})}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return e}(rD);i6.styles=[e9(tV())],eN([i()],i6.prototype,"_lines",2),eN([i()],i6.prototype,"startCoord",2),eN([i()],i6.prototype,"mouseCoord",2),eN([u("svg")],i6.prototype,"svgContainer",2),eN([l({selector:"img"})],i6.prototype,"grImage",2),i6=eN([re("qti-graphic-associate-interaction")],i6);var i9=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tH())}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});switch(i){case"circle":{var a=q(o,3),s=a[0],u=a[1],l=a[2];n.style.left=s-l+"px",n.style.top=u-l+"px",n.style.width=n.style.height=2*l+"px"}break;case"rect":{var c=q(o,4),h=c[0],d=c[1],f=c[2],p=c[3];n.style.left=h+"px",n.style.top=d+"px",n.style.width=f-h+"px",n.style.height=p-d+"px"}break;default:break}}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return e}(iK(rD,"qti-gap-img",!1,"qti-associable-hotspot"));i9.styles=e9(tj()),i9=eN([re("qti-graphic-gap-match-interaction")],i9);var i7=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tQ())}},{key:"setHotspotOrder",value:function t(t){var e=t.detail,n=e.identifier,r=this._choiceElements.find(function(t){return t.getAttribute("identifier")===n}),i=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){if(this._choiceElements.filter(function(t){return t.order>0}).length>=i){this.choiceOrdering=!1;return}r.order=this._choiceElements.filter(function(t){return!!t.order}).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(function(t){return t.order>t.order&&t.order--,t}),r.order=null;this.choiceOrdering=!1}}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});eq(i,o,e,n)}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.removeEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}}]);return e}(r4(rD,"qti-hotspot-choice"));i7.styles=[e9(tB())],i7=eN([re("qti-graphic-order-interaction")],i7);var i8=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tF())}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});eq(i,o,e,n)}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}}]);return e}(r4(rD,"qti-hotspot-choice"));i8.styles=[e9(tz())],i8=eN([re("qti-hotspot-interaction")],i8);var ot=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.matchMin=0;t.matchMax=1;t.fixed=!1;return t}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}},{key:"render",value:function t(){return nH(tW())}}]);return e}(P(n7,"qti-simple-associable-choice"));ot.styles=e9(tY()),eN([r({type:Number,attribute:"match-min"})],ot.prototype,"matchMin",2),eN([r({type:Number,attribute:"match-max"})],ot.prototype,"matchMax",2),eN([r({type:Boolean,attribute:"fixed"})],ot.prototype,"fixed",2),ot=eN([re("qti-simple-associable-choice")],ot);var oe=e9(tX());var on=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.lastCheckedRadio=null;t._response=[];t.correctOptions=[];t.responseIdentifier="";t.handleRadioClick=function(e){var n=e.target;t.lastCheckedRadio===n?(n.checked=!1,t.lastCheckedRadio=null,t.handleRadioChange(e)):t.lastCheckedRadio=n};t.handleRadioChange=function(e){var n=e.target,r=n.value,i=n.name,o=n.type;n.checked?(t.value?t.value.indexOf(r)===-1&&(o==="radio"&&(t.value=t.value.filter(function(t){return t.indexOf(i)===-1})),t.value=$(t.value).concat([r])):t.value=[r],t.lastCheckedRadio=n):(t.value=t.value.filter(function(t){return t!==r}),t.lastCheckedRadio=null),t.requestUpdate(),t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t.responseIdentifier,response:Array.isArray(t.value)?$(t.value):t.value}}))};return t}c(e,[{key:"value",get:function t(){return this.classList.contains("qti-match-tabular")?this._response:d(f(e.prototype),"value",this)},set:function t(t){this.classList.contains("qti-match-tabular")?this._response=t:A(f(e.prototype),"value",t,this,true)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return d(f(e.prototype),"connectedCallback",t)};return o(function(){return O(this,function(t){r().call(n),n.rows=Array.from(n.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),n.cols=Array.from(n.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),n.value=[];return[2]})})()}},{key:"correctResponse",set:function t(t){if(t===""){this.correctOptions=[];return}else Array.isArray(t)&&(this.correctOptions=t)}},{key:"render",value:function t(){var t=this;return this.classList.contains("qti-match-tabular")?nH(tJ(),this.cols.map(function(t,e){return nH(tZ(),r9(t.innerHTML))}),this.rows.map(function(e,n){return nH(tK(),r9(e.innerHTML),t.cols.map(function(n,r){var i=e.getAttribute("identifier"),o=n.getAttribute("identifier"),a="".concat(i," ").concat(o),s=t.value.filter(function(t){return t.split(" ")[0]===i}).length||0,u=t.value.includes(a),l="rb ".concat(u?"rb-checked":""," ").concat(t.correctOptions.includes(a)?"rb-correct":""),c=t.correctOptions.length>0?!0:e.matchMax===1?!1:s>=e.matchMax&&!u;return nH(tG(),e.matchMax===1?"radio":"checkbox",l,i,a,c,function(e){return t.handleRadioChange(e)},function(n){return e.matchMax===1?t.handleRadioClick(n):null})}))})):nH(t0())}}]);return e}(iK(rD,"qti-simple-match-set:first-of-type qti-simple-associable-choice",!1,"qti-simple-match-set:last-of-type qti-simple-associable-choice"));on.styles=oe,eN([i()],on.prototype,"_response",2),eN([i()],on.prototype,"correctOptions",2),eN([r({type:String,attribute:"response-identifier"})],on.prototype,"responseIdentifier",2),on=eN([re("qti-match-interaction")],on);var or=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t._value=0;return t}c(e,[{key:"reset",value:function t(){}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return this._value.toString()},set:function t(t){if(!isNaN(parseInt(t.toString())))this._value=parseInt(t.toString());else throw new Error("Value must be a number")}},{key:"render",value:function t(){return nH(t1())}},{key:"connectedCallback",value:function t(){var t=this;d(f(e.prototype),"connectedCallback",this).call(this);var n=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");n&&n.addEventListener("ended",function(){t._value++,t.saveResponse(t.value)})}}],[{key:"properties",get:function t(){return w(k({},rD.properties),{step:{type:Number,attribute:"step",default:10}})}}]);return e}(rD);or.styles=[e9(t2())],or=eN([re("qti-media-interaction")],or);var oi=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.nrChoices=0;t.correctResponses=[];t.showCorrectResponses=!1;return t}c(e,[{key:"render",value:function t(){var t=this;var e=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<e.length&&(this.nrChoices=e.length),nH(t4(),Array.from(Array(this.nrChoices)).map(function(e,n){return nH(t3(),n,t.showCorrectResponses&&t.correctResponses.length>n?r9("<span part='correct-response'>".concat(t.correctResponses[n],"</span>")):"")}))}},{key:"correctResponse",set:function t(t){var e=this;if(t===""){this.showCorrectResponses=!1;return}this.correctResponses.length===0&&(Array.isArray(t)?t:[t]).forEach(function(t,n){var r=e.querySelector('qti-simple-choice[identifier="'.concat(t,'"]'));r||(r=e.shadowRoot.querySelector('qti-simple-choice[identifier="'.concat(t,'"]')));var i=r===null||r===void 0?void 0:r.textContent.trim();e.correctResponses=$(e.correctResponses).concat([i])}),this.showCorrectResponses=!0}},{key:"getResponse",value:function t(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(function(t){var e=t.querySelectorAll('[qti-draggable="true"]');return $(Array.from(e).map(function(t){return t.getAttribute("identifier")})).join(" ")})}},{key:"firstUpdated",value:function t(t){var n=this;var r=this,i=function(){return d(f(e.prototype),"firstUpdated",n)};return o(function(){return O(this,function(e){i().call(r,t),r.childrenMap=Array.from(r.querySelectorAll("qti-simple-choice")),r.childrenMap.forEach(function(t){return t.setAttribute("part","qti-simple-choice")});return[2]})})()}}]);return e}(r8(iK(rD,"qti-simple-choice",!0,"drop-list"),"qti-simple-choice"));oi.styles=[e9(t5())],eN([i()],oi.prototype,"nrChoices",2),eN([i()],oi.prototype,"correctResponses",2),eN([i()],oi.prototype,"showCorrectResponses",2),eN([r({type:String})],oi.prototype,"orientation",2),oi=eN([re("qti-order-interaction")],oi);var oo=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(t6())}}]);return e}(n7);oo.styles=[e9(t9())];customElements.define("qti-position-object-interaction",oo);var oa=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e),t.removeMoveListener=t.removeMoveListener.bind(t),t.dragElementHandler=t.dragElementHandler.bind(t);return t}c(e,[{key:"render",value:function t(){return nH(t7())}},{key:"dragElementHandler",value:function t(t){t.preventDefault();var e=t.clientX-this.startX,n=t.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+e+"px",this.dragElement.style.top=this.dragElement.offsetTop+n+"px",this.startX=t.clientX,this.startY=t.clientY}},{key:"firstUpdated",value:function t(t){var n=this;d(f(e.prototype),"firstUpdated",this).call(this,t),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",function(t){n.startX=t.clientX,n.startY=t.clientY,document.addEventListener("mousemove",n.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}},{key:"removeMoveListener",value:function t(t){document.removeEventListener("mousemove",this.dragElementHandler,!0)}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}}]);return e}(n7);oa.styles=[e9(t8())],oa=eN([re("qti-position-object-stage")],oa);var os="important",ou=" !"+os,ol=rF(/*#__PURE__*/function(t){"use strict";p(e,t);function e(t){s(this,e);var n;var r;if(n=a(this,e,[t]),t.type!==rB.ATTRIBUTE||t.name!=="style"||((r=t.strings)===null||r===void 0?void 0:r.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");return n}c(e,[{key:"render",value:function t(t){return Object.keys(t).reduce(function(e,n){var r=t[n];return r==null?e:e+"".concat(n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(r,";")},"")}},{key:"update",value:function t(t,e){var n=q(e,1),r=n[0];var i=t.element,o=i.style;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);var a=true,s=false,u=undefined;try{for(var l=this.ft[Symbol.iterator](),c;!(a=(c=l.next()).done);a=true){var h=c.value;r[h]==null&&(this.ft.delete(h),h.includes("-")?o.removeProperty(h):o[h]=null)}}catch(t){s=true;u=t}finally{try{if(!a&&l.return!=null){l.return()}}finally{if(s){throw u}}}for(var d in r){var f=r[d];if(f!=null){this.ft.add(d);var p=typeof f=="string"&&f.endsWith(ou);d.includes("-")||p?o.setProperty(d,p?f.slice(0,-11):f,p?os:""):o[d]=f}}return nB}}]);return e}(rz));var oc=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.maxChoices=1/0;t.minChoices=0;t._points=[];t._imgElement=null;t._onImageClick=function(e){if(t._points.length<t.maxChoices){var n=e.offsetX,r=e.offsetY;t._points=$(t._points).concat(["".concat(n," ").concat(r)]),t.saveResponse(t._points)}};return t}c(e,[{key:"render",value:function t(){var t=this;return nH(ee(),i5(this._points,function(t){return t},function(e,n){return nH(et(),ol({position:"absolute",transform:"translate(-50%, -50%)",left:"".concat(e.split(" ")[0],"px"),top:"".concat(e.split(" ")[1],"px")}),e,function(e){e.stopPropagation(),t._points=t._points.filter(function(t,e){return e!==n}),t.saveResponse(t._points)})}))}},{key:"reset",value:function t(){this._points=[]}},{key:"validate",value:function t(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}},{key:"value",get:function t(){return this._points},set:function t(t){this._points=Array.isArray(t)?t:[t]}},{key:"firstUpdated",value:function t(){this._imgElement=this.querySelector("img"),this._imgElement?this._imgElement.addEventListener("click",this._onImageClick):console.warn("No <img> element found in <qti-select-point-interaction>")}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}}]);return e}(rD);oc.styles=[e9(en())],eN([r({type:Number,attribute:"max-choices"})],oc.prototype,"maxChoices",2),eN([r({type:Number,attribute:"min-choices"})],oc.prototype,"minChoices",2),eN([i()],oc.prototype,"_points",2),oc=eN([re("qti-select-point-interaction")],oc);var oh=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t._value=0;t.stepLabel=!1;t.reverse=!1;t._handleDisabledChange=function(t,e){};t._handleReadonlyChange=function(t,e){};t.csLive=getComputedStyle(t);return t}c(e,[{key:"min",get:function t(){return this._min},set:function t(t){this._min=t,this._value=t,this.style.setProperty("--min","".concat(this._min))}},{key:"max",get:function t(){return this._max},set:function t(t){this._max=t,this.style.setProperty("--max","".concat(this._max))}},{key:"step",get:function t(){return this._step},set:function t(t){this._step=t,this.style.setProperty("--step","".concat(this._step))}},{key:"reset",value:function t(){}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return this._value.toString()},set:function t(t){if(!isNaN(parseInt(t.toString())))this._value=parseInt(t.toString());else throw new Error("Value must be a number")}},{key:"response",set:function t(t){if(Array.isArray(t)){console.error("QtiSliderInteraction: response is an array, but should be a single value");return}var e=parseInt(t);if(Number.isNaN(e)){console.error("QtiSliderInteraction: response is not a number");return}this._value=e}},{key:"render",value:function t(){this._value<this.min&&(this._value=this.min),this._value>this.max&&(this._value=this.max);var t=(this._value-this.min)/(this.max-this.min)*100;return this.style.setProperty("--value-percentage","".concat(t,"%")),this.setAttribute("aria-valuenow",this.value.toString()),nH(ea(),this.csLive.getPropertyValue("--show-bounds")=="true"?nH(er(),this._min,this._max):nF,this.csLive.getPropertyValue("--show-ticks")=="true"?nH(ei()):nF,this._onMouseDown,this._onTouchMove,this.csLive.getPropertyValue("--show-value")=="true"?nH(eo(),this.value):nF)}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}},{key:"_onTouchMove",value:function t(t){var e=this;var n=function(t){var n=e.getPositionFromEvent(t),r=n.x,i=r-e._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;e.calculateValue(i),t.stopPropagation()},r=function(){document.removeEventListener("touchmove",n),document.removeEventListener("touchend",r),e.saveResponse(e.value.toString())};document.addEventListener("touchmove",n),document.addEventListener("touchend",r);var i=this.getPositionFromEvent(t),o=i.x,a=o-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(a),t.stopPropagation()}},{key:"_onMouseDown",value:function t(t){var e=this;var n=function(t){var n=t.pageX-e._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;e.calculateValue(n),t.preventDefault(),t.stopPropagation()},r=function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r),e.saveResponse(e.value.toString())};document.addEventListener("mousemove",n),document.addEventListener("mouseup",r);var i=t.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(i),t.preventDefault(),t.stopPropagation()}},{key:"calculateValue",value:function t(t){var e=this.min+(this.max-this.min)*t/this._rail.getBoundingClientRect().width,n=this.min+Math.round((e-this.min)/this._step)*this._step;this._value=n}},{key:"getPositionFromEvent",value:function t(t){var e;if(t.type=="touchstart"||t.type=="touchmove"||t.type=="touchend"||t.type=="touchcancel"){var n=D(t.originalEvent)>"u"?t:t.originalEvent,r=n.touches[0]||n.changedTouches[0];e={x:r.pageX,y:r.pageY}}else(t.type=="mousedown"||t.type=="mouseup"||t.type=="mousemove"||t.type=="mouseover"||t.type=="mouseout"||t.type=="mouseenter"||t.type=="mouseleave")&&(e={x:t.clientX,y:t.clientY});return e}}]);return e}(rD);oh.styles=[e9(es())],eN([u("#knob")],oh.prototype,"_knob",2),eN([u("#rail")],oh.prototype,"_rail",2),eN([r({type:Boolean,attribute:"step-label"})],oh.prototype,"stepLabel",2),eN([r({type:Boolean})],oh.prototype,"reverse",2),eN([r({type:Number,attribute:"lower-bound"})],oh.prototype,"min",1),eN([r({type:Number,attribute:"upper-bound"})],oh.prototype,"max",1),eN([r({type:Number,attribute:"step"})],oh.prototype,"step",1),eN([h("disabled",{waitUntilFirstUpdate:!0})],oh.prototype,"_handleDisabledChange",2),eN([h("readonly",{waitUntilFirstUpdate:!0})],oh.prototype,"_handleReadonlyChange",2),oh=eN([re("qti-slider-interaction")],oh);var od=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(eu(),this.handleSlotChange)}},{key:"handleSlotChange",value:function t(t){var e;var n;var r=Array.from((n=(e=this.firstElementChild)===null||e===void 0?void 0:e.childNodes)!==null&&n!==void 0?n:[]).find(function(t){return t.nodeType===Node.COMMENT_NODE});try{var i;this.operatorFunction=new Function("context","fn","item",(i=r.textContent)!==null&&i!==void 0?i:"")}catch(t){console.error("custom-operator contains invalid javascript code",t)}}},{key:"calculate",value:function t(){var t=this;var e={variable:function(e){var n,r;var i;return(i=(r=t._context)===null||r===void 0?void 0:(n=r.variables.find(function(t){return t.identifier===e}))===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:""},correct:function(e){var n,r;var i;return(i=(r=t._context)===null||r===void 0?void 0:(n=r.variables.find(function(t){return t.identifier===e}))===null||n===void 0?void 0:n.correctResponse)!==null&&i!==void 0?i:""}},n={getVariable:function(e){var n;return(n=t._context)===null||n===void 0?void 0:n.variables.find(function(t){return t.identifier===e})},updateOutcomeVariable:function(e,n){t.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:e,value:n}}))},updateResponseVariable:function(e,n){t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:e,response:n}}))}};return this.operatorFunction(this._context,e,n)}}]);return e}(n7);eN([e({context:ra,subscribe:!0}),i()],od.prototype,"_context",2),od=eN([re("qti-custom-operator")],od);var of=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"render",value:function t(){return nH(el())}}]);return e}(n7);of.styles=e9(ec()),of=eN([re("qti-associable-hotspot")],of);var op=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"render",value:function t(){return nH(eh())}}]);return e}(n7);op.styles=e9(ed()),eN([r({type:Number,reflect:!0})],op.prototype,"tabindex",2),op=eN([re("qti-gap")],op);var ov=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"connectedCallback",value:function t(){this.setAttribute("slot","qti-gap-img")}}]);return e}(n7);ov.styles=e9(ef()),eN([r({type:Number,reflect:!0})],ov.prototype,"tabindex",2),ov=eN([re("qti-gap-img")],ov);var oy=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-gap-text")}},{key:"render",value:function t(){return nH(ep())}}]);return e}(P(n7,"qti-gap-text"));oy.styles=e9(ev()),eN([r({type:Number,reflect:!0})],oy.prototype,"tabindex",2),oy=eN([re("qti-gap-text")],oy);var om=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(P(n7,"qti-hotspot-choice"));om.styles=e9(ey()),eN([r({attribute:"aria-ordervalue",type:Number,reflect:!0})],om.prototype,"order",2),om=eN([re("qti-hotspot-choice")],om);var og=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(em())}}]);return e}(P(n7,"qti-hottext"));og.styles=e9(eg()),og=eN([re("qti-hottext")],og);var ob=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("click",this._onSelectInlineChoice)}},{key:"render",value:function t(){return nH(e_())}},{key:"_onSelectInlineChoice",value:function t(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}}],[{key:"styles",get:function t(){return[e9(eb())]}}]);return e}(n7);eN([r({type:String})],ob.prototype,"identifier",2),ob=eN([re("qti-inline-choice")],ob);var o_=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"checked",get:function t(){return this.internals.states.has("--checked")}},{key:"render",value:function t(){return nH(eE(),this.marker?nH(ek(),this.marker):nF)}}]);return e}(P(n7,"qti-simple-choice"));o_.styles=e9(ew()),eN([r({type:String,attribute:!1})],o_.prototype,"marker",2),o_=eN([re("qti-simple-choice")],o_);console.log("%cC\xbfTO%cLab%c: qti-components loaded","font-weight:bold; color:green",'font-family: "PT Sans", font-weight:bold; color:green; font-size: smaller;vertical-align: sub',"font-weight:unset");var ok=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(eR(n7));ok=eN([re("qti-item")],ok);var oE=/*#__PURE__*/function(){var t=o(function(t){var e,n,r,i,o,a;return O(this,function(s){switch(s.label){case 0:e=t.substring(0,t.lastIndexOf("/"));return[4,rd().load("".concat(t)).then(function(t){return t.assessmentTest()})];case 1:n=s.sent();return[4,rf().load("".concat(e,"/").concat(n.href)).then(function(t){return t.htmlDoc()})];case 2:r=s.sent();return[4,rf().load("".concat(e,"/").concat(n.href)).then(function(t){return t.items()})];case 3:i=s.sent(),o="".concat(e,"/").concat(n.href),a="".concat(e,"/").concat(n.href.substring(0,n.href.lastIndexOf("/")));return[2,{testHTMLDoc:r,testURI:a,testURL:o,items:i,testIdentifier:n.identifier}]}})});return function e(e){return t.apply(this,arguments)}}(),ow=/*#__PURE__*/function(){var t=o(function(t){return O(this,function(e){return[2,rh().load(t).then(function(t){return t.htmlDoc().firstElementChild})]})});return function e(e){return t.apply(this,arguments)}}();return eL(eV)}();/*! Bundled license information:
|
|
1
|
+
function t(t,e){if(e==null||e>t.length)e=t.length;for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function e(t){if(Array.isArray(t))return t}function n(e){if(Array.isArray(e))return t(e)}function r(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function i(t,e,n,r,i,o,a){try{var s=t[o](a);var u=s.value}catch(t){n(t);return}if(s.done){e(u)}else{Promise.resolve(u).then(r,i)}}function o(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function s(t){i(a,r,o,s,u,"next",t)}function u(t){i(a,r,o,s,u,"throw",t)}s(undefined)})}}function a(t,e,n){e=f(e);return x(t,I()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function s(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function u(t,e,n){if(I()){u=Reflect.construct}else{u=function t(t,e,n){var r=[null];r.push.apply(r,e);var i=Function.bind.apply(t,r);var o=new i;if(n)S(o,n.prototype);return o}}return u.apply(null,arguments)}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(t,r.key,r)}}function c(t,e,n){if(e)l(t.prototype,e);if(n)l(t,n);return t}function h(t,e,n){if(e in t){Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true})}else{t[e]=n}return t}function d(t,e,n){if(typeof Reflect!=="undefined"&&Reflect.get){d=Reflect.get}else{d=function t(t,e,n){var r=R(t,e);if(!r)return;var i=Object.getOwnPropertyDescriptor(r,e);if(i.get){return i.get.call(n||t)}return i.value}}return d(t,e,n||t)}function f(t){f=Object.setPrototypeOf?Object.getPrototypeOf:function t(t){return t.__proto__||Object.getPrototypeOf(t)};return f(t)}function p(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:true,configurable:true}});if(e)S(t,e)}function v(t,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](t)}else{return t instanceof e}}function y(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function m(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function g(t,e){var n=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n==null)return;var r=[];var i=true;var o=false;var a,s;try{for(n=n.call(t);!(i=(a=n.next()).done);i=true){r.push(a.value);if(e&&r.length===e)break}}catch(t){o=true;s=t}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(o)throw s}}return r}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))}r.forEach(function(e){h(t,e,n[e])})}return t}function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);if(e){r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})}n.push.apply(n,r)}return n}function w(t,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))}else{E(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function x(t,e){if(e&&(D(e)==="object"||typeof e==="function")){return e}return r(t)}function C(t,e,n,r){if(typeof Reflect!=="undefined"&&Reflect.set){C=Reflect.set}else{C=function t(t,e,n,r){var i=R(t,e);var o;if(i){o=Object.getOwnPropertyDescriptor(i,e);if(o.set){o.set.call(r,n);return true}else if(!o.writable){return false}}o=Object.getOwnPropertyDescriptor(r,e);if(o){if(!o.writable){return false}o.value=n;Object.defineProperty(r,e,o)}else{h(r,e,n)}return true}}return C(t,e,n,r)}function A(t,e,n,r,i){var o=C(t,e,n,r||t);if(!o&&i){throw new Error("failed to set property")}return n}function S(t,e){S=Object.setPrototypeOf||function t(t,e){t.__proto__=e;return t};return S(t,e)}function q(t,n){return e(t)||g(t,n)||U(t,n)||b()}function R(t,e){while(!Object.prototype.hasOwnProperty.call(t,e)){t=f(t);if(t===null)break}return t}function P(t,e){if(!e){e=t.slice(0)}return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function T(t){return e(t)||m(t)||U(t)||b()}function $(t){return n(t)||m(t)||U(t)||_()}function D(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function U(e,n){if(!e)return;if(typeof e==="string")return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}function M(t){var e=typeof Map==="function"?new Map:undefined;M=function t(t){if(t===null||!y(t))return t;if(typeof t!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof e!=="undefined"){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return u(t,arguments,f(this).constructor)}n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:false,writable:true,configurable:true}});return S(n,t)};return M(t)}function I(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(I=function(){return!!t})()}function O(t,e){var n,r,i,o,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return u([t,e])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,r&&(i=o[0]&2?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;if(r=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;r=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(o[0]===6&&a.label<i[1]){a.label=i[1];i=o;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(o);break}if(i[2])a.ops.pop();a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t];r=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}function L(){var t=P(["<slot></slot>"]);L=function e(){return t};return t}function N(){var t=P(["",""]);N=function e(){return t};return t}function V(){var t=P(["<slot></slot>"]);V=function e(){return t};return t}function H(){var t=P(['<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n<xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />\n <xsl:template match="@*|node()">\n <xsl:copy>\n <xsl:apply-templates select="@*|node()"/>\n </xsl:copy>\n </xsl:template>\n\n \x3c!-- remove existing namespaces --\x3e\n <xsl:template match="*">\n \x3c!-- remove element prefix --\x3e\n <xsl:element name="{local-name()}">\n \x3c!-- process attributes --\x3e\n <xsl:for-each select="@*">\n \x3c!-- remove attribute prefix --\x3e\n <xsl:attribute name="{local-name()}">\n <xsl:value-of select="."/>\n </xsl:attribute>\n </xsl:for-each>\n <xsl:apply-templates/>\n </xsl:element>\n</xsl:template>\n</xsl:stylesheet>']);H=function e(){return t};return t}function j(){var t=P(["\n :host {\n display: block;\n }\n"]);j=function e(){return t};return t}function Q(){var t=P(['<slot name="qti-rubric-block"></slot><slot></slot>']);Q=function e(){return t};return t}function B(){var t=P(["<slot></slot>"]);B=function e(){return t};return t}function F(){var t=P(["<slot></slot>"]);F=function e(){return t};return t}function z(){var t=P(["",""]);z=function e(){return t};return t}function W(){var t=P(["\n :host {\n display: none;\n }\n "]);W=function e(){return t};return t}function Y(){var t=P(["",""]);Y=function e(){return t};return t}function X(){var t=P(["\n :host {\n display: none;\n }\n "]);X=function e(){return t};return t}function Z(){var t=P(["<slot></slot>"]);Z=function e(){return t};return t}function G(){var t=P(["<slot></slot>"]);G=function e(){return t};return t}function K(){var t=P(["\n :host {\n display: block;\n }\n "]);K=function e(){return t};return t}function J(){var t=P([' <slot part="feedback" class="feedback ','"></slot> ']);J=function e(){return t};return t}function tt(){var t=P(["\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n "]);tt=function e(){return t};return t}function te(){var t=P([' <slot part="feedback" class="','"></slot> ']);te=function e(){return t};return t}function tn(){var t=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);tn=function e(){return t};return t}function tr(){var t=P([' <slot part="feedback" class="','"></slot> ']);tr=function e(){return t};return t}function ti(){var t=P(["\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n "]);ti=function e(){return t};return t}function to(){var t=P(["\n /* PK: display host as block, else design will be collapsed */\n :host {\n display: block;\n }\n textarea {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border: 0;\n }\n "]);to=function e(){return t};return t}function ta(){var t=P(['<slot name="prompt"></slot\n ><textarea\n part="textarea"\n name="','"\n spellcheck="false"\n autocomplete="off"\n maxlength="','"\n @keydown="','"\n @keyup="','"\n @change="','"\n @blur="','"\n placeholder="','"\n rows="','"\n ?disabled="','"\n ?readonly="','"\n .value=',"\n ></textarea>"]);ta=function e(){return t};return t}function ts(){var t=P(["\n :host {\n display: inline-block;\n }\n [part='correct'] {\n position: absolute;\n width: 100%;\n }\n :host(.qti-input-width-1) [part='input'] {\n width: 1.1rem;\n min-width: 1.1rem;\n }\n\n :host(.qti-input-width-2) [part='input'] {\n width: 2.3rem;\n min-width: 2.3rem;\n }\n\n :host(.qti-input-width-3) [part='input'] {\n width: 3.3rem;\n min-width: 3.3rem;\n }\n\n :host(.qti-input-width-4) [part='input'] {\n width: 4.2rem;\n min-width: 4.2rem;\n }\n\n :host(.qti-input-width-6) [part='input'] {\n width: 6.6rem;\n min-width: 6.6rem;\n }\n\n :host(.qti-input-width-10) [part='input'] {\n width: 8rem;\n min-width: 8rem;\n }\n\n :host(.qti-input-width-15) [part='input'] {\n width: 12rem;\n min-width: 12rem;\n }\n\n :host(.qti-input-width-20) [part='input'] {\n width: 17rem;\n min-width: 17rem;\n }\n\n :host(.qti-input-width-25) [part='input'] {\n width: 20rem;\n min-width: 20rem;\n }\n\n :host(.qti-input-width-30) [part='input'] {\n width: 24rem;\n min-width: 24rem;\n }\n\n :host(.qti-input-width-35) [part='input'] {\n width: 28rem;\n min-width: 28rem;\n }\n\n :host(.qti-input-width-40) [part='input'] {\n width: 32rem;\n min-width: 32rem;\n }\n\n :host(.qti-input-width-45) [part='input'] {\n width: 36rem;\n min-width: 36rem;\n }\n\n :host(.qti-input-width-50) [part='input'] {\n width: 40rem;\n min-width: 40rem;\n }\n\n :host(.qti-input-width-72) [part='input'] {\n width: 57rem;\n min-width: 57rem;\n }\n"]);ts=function e(){return t};return t}function tu(){var t=P(['\n <input\n part="input"\n name="','"\n spellcheck="false"\n autocomplete="off"\n @blur="','"\n @keydown="','"\n @keyup="','"\n @change="','"\n type="','"\n placeholder="','"\n .value="','"\n pattern="','"\n maxlength=','\n ?disabled="','"\n ?readonly="','"\n />\n <div part="correct">',"</div>\n "]);tu=function e(){return t};return t}function tl(){var t=P(["<slot></slot>"]);tl=function e(){return t};return t}function tc(){var t=P(["\n :host {\n display: inline-block;\n }\n slot {\n display: flex;\n flex-direction: column;\n }\n [role='menu'] {\n position: absolute;\n z-index: 1000;\n }\n .anchor {\n /* anchor-name: --infobox; */\n width: fit-content;\n }\n\n .positionedElement {\n position: absolute;\n /* position-anchor: --infobox; */\n /* top: anchor(bottom); */\n }\n "]);tc=function e(){return t};return t}function th(){var t=P(['\n <option value="','" ?selected="','">',"</option>\n "]);th=function e(){return t};return t}function td(){var t=P(['\n <select part="select" @change="','" ?disabled="','" ?readonly="','">\n ',"\n </select>\n\n ","\n "]);td=function e(){return t};return t}function tf(){var t=P(["\n [part='slot'] {\n display: flex;\n flex-direction: column;\n gap: var(--qti-gap-size);\n flex-wrap: wrap;\n }\n\n ::slotted(qti-simple-choice) {\n flex: 0 0\n calc((100% - (var(--qti-gap-size) * var(--choice-interactions-stacking))) / var(--choice-interactions-stacking)) !important;\n box-sizing: border-box !important;\n }\n\n :host(.qti-choices-stacking-1) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 1;\n }\n\n :host(.qti-choices-stacking-2) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 2;\n }\n :host(.qti-choices-stacking-3) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 3;\n }\n :host(.qti-choices-stacking-4) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 4;\n }\n :host(.qti-choices-stacking-5) [part='slot'] {\n flex-direction: row;\n --choice-interactions-stacking: 5;\n }\n :host([orientation='horizontal']) [part='slot'] {\n flex-direction: row;\n }\n"]);tf=function e(){return t};return t}function tp(){var t=P(['\n <slot name="prompt"></slot><slot part="slot"></slot>\n <div role="alert" id="validationMessage"></div>\n ']);tp=function e(){return t};return t}function tv(){var t=P(["<slot></slot>"]);tv=function e(){return t};return t}function ty(){var t=P(["\n :host {\n display: none;\n }\n "]);ty=function e(){return t};return t}function tm(){var t=P(["<slot></slot>"]);tm=function e(){return t};return t}function tg(){var t=P(["\n :host {\n display: none;\n }\n "]);tg=function e(){return t};return t}function tb(){var t=P(["<slot></slot>"]);tb=function e(){return t};return t}function t_(){var t=P(["<slot></slot>"]);t_=function e(){return t};return t}function tk(){var t=P(["<slot></slot>"]);tk=function e(){return t};return t}function tE(){var t=P(["",""]);tE=function e(){return t};return t}function tw(){var t=P(["<pre>","</pre>\n <slot></slot>"]);tw=function e(){return t};return t}function tx(){var t=P(["\n slot {\n display: none;\n }\n "]);tx=function e(){return t};return t}function tC(){var t=P(["",""]);tC=function e(){return t};return t}function tA(){var t=P(["",""]);tA=function e(){return t};return t}function tS(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);tS=function e(){return t};return t}function tq(){var t=P(["<slot></slot>",""]);tq=function e(){return t};return t}function tR(){var t=P(["\n :host {\n display: block; /* necessary to calculate scaling position */\n }\n slot[name='qti-simple-associable-choice'] {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n :host::part(associables-container) {\n display: flex;\n justify-content: space-between;\n background: linear-gradient(\n 180deg,\n rgb(0 0 0 / 0%) calc(50% - 1px),\n var(--qti-border-color-gray) calc(50%),\n rgb(0 0 0 / 0%) calc(50% + 1px)\n );\n }\n"]);tR=function e(){return t};return t}function tP(){var t=P(['<div part="associables-container">\n <div name="left','" part="drop-list" class="dl" identifier="droplist','_left"></div>\n <div name="right','" part="drop-list" class="dl" identifier="droplist','_right"></div>\n </div>']);tP=function e(){return t};return t}function tT(){var t=P([' <slot name="prompt"></slot>\n <slot name="qti-simple-associable-choice"></slot>\n <div part="drop-container">\n ',"\n </div>"]);tT=function e(){return t};return t}function t$(){var t=P(['<div style="color:red">\n <h1>Error</h1>\n ',"\n </div>"]);t$=function e(){return t};return t}function tD(){var t=P(["<iframe\n width=","\n height=",'\n frameborder="0"\n title="pciContainer"\n id="pciContainer"\n >\n </iframe>\n ',""]);tD=function e(){return t};return t}function tU(){var t=P(["<button ?disabled=",' part="button" @click=',">","</button>"]);tU=function e(){return t};return t}function tM(){var t=P(['<slot name="prompt"> </slot><slot part="drags" name="qti-gap-text"></slot> <slot part="drops"></slot>']);tM=function e(){return t};return t}function tI(){var t=P(["\n :host {\n display: flex;\n align-items: flex-start;\n flex-direction: column;\n gap: 0.5rem;\n }\n\n :host(.qti-choices-top) {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) {\n flex-direction: row;\n }\n :host(.qti-choices-right) {\n flex-direction: row-reverse;\n }\n /* [part='drops'] , */\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n gap: 0.5rem;\n }\n "]);tI=function e(){return t};return t}function tO(){var t=P(['\n <line\n part="line"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="red"\n stroke-width="3"\n @click=',"\n />\n "]);tO=function e(){return t};return t}function tL(){var t=P(['<line\n part="point"\n x1=',"\n y1=","\n x2=","\n y2=",'\n stroke="red"\n stroke-width="3"\n />']);tL=function e(){return t};return t}function tN(){var t=P(['<slot name="prompt"></slot>\n <line-container>\n <svg\n width=',"\n height=",'\n viewbox="0 0 '," ",'"\n >\n ',"\n ","\n </svg>\n <slot></slot>\n </line-container>"]);tN=function e(){return t};return t}function tV(){var t=P(["\n slot:not([name='prompt']) {\n // position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n ::slotted(qti-associable-hotspot) {\n transform: translate(-50%, -50%);\n }\n line-container {\n display: block;\n position: relative;\n }\n svg {\n position: absolute;\n top: 0px;\n left: 0px;\n }\n "]);tV=function e(){return t};return t}function tH(){var t=P([' <slot name="prompt"></slot>\n <slot></slot>\n <slot name="qti-gap-img"></slot>']);tH=function e(){return t};return t}function tj(){var t=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n slot[name='qti-gap-img'] {\n display: flex;\n gap: 1rem;\n }\n "]);tj=function e(){return t};return t}function tQ(){var t=P(['\n <slot name="prompt"></slot>\n \x3c!-- slot for the prompt --\x3e\n <slot></slot>\n \x3c!-- slot for the image and hotspots --\x3e\n ']);tQ=function e(){return t};return t}function tB(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n }\n "]);tB=function e(){return t};return t}function tF(){var t=P(['\n <slot name="prompt"></slot>\n \x3c!-- slot for the prompt --\x3e\n <slot></slot>\n \x3c!-- slot for the image and hotspots --\x3e\n ']);tF=function e(){return t};return t}function tz(){var t=P(["\n slot:not([name='prompt']) {\n position: relative; /* qti-hotspot-choice relative to the slot */\n display: block;\n width: fit-content; /* hotspots not stretching further if image is at max size */\n }\n ::slotted(img) {\n /* image not selectable anymore */\n pointer-events: none;\n user-select: none;\n /* width:100%; */\n }\n "]);tz=function e(){return t};return t}function tW(){var t=P(['\n <slot part="slot"></slot>\n <slot part="dropslot" name="qti-simple-associable-choice"></slot>\n ']);tW=function e(){return t};return t}function tY(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n slot {\n width: 100%;\n display: block;\n }\n slot[name='qti-simple-associable-choice'] {\n width: 100%;\n }\n "]);tY=function e(){return t};return t}function tX(){var t=P(["\n slot {\n /* slot where the */\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n align-items: flex-start; /* prevents the drag and drop container slots having the same height */\n }\n :host(.qti-choices-top) slot {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) slot {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) slot {\n flex-direction: row;\n }\n :host(.qti-choices-right) slot {\n flex-direction: row-reverse;\n }\n slot[name='prompt'] {\n display: block;\n }\n ::slotted(qti-simple-match-set) {\n /* Make sure the drag and drop container slots have the same width */\n flex: 1;\n }\n"]);tX=function e(){return t};return t}function tZ(){var t=P(['<th part="r-header">',"</th>"]);tZ=function e(){return t};return t}function tG(){var t=P(["<td>\n <input\n type=","\n part=","\n name=","\n value=","\n .disabled=","\n @change=","\n @click=","\n />\n </td>"]);tG=function e(){return t};return t}function tK(){var t=P(['<tr>\n <td part="c-header">',"</td>\n ","\n </tr>"]);tK=function e(){return t};return t}function tJ(){var t=P(['\n <slot name="prompt"></slot>\n <table>\n <tr>\n <td></td>\n ',"\n </tr>\n\n ","\n </table>\n "]);tJ=function e(){return t};return t}function t0(){var t=P(['<slot name="prompt"></slot> <slot></slot>']);t0=function e(){return t};return t}function t1(){var t=P([' <slot name="prompt"></slot>\n <slot></slot>']);t1=function e(){return t};return t}function t2(){var t=P([""]);t2=function e(){return t};return t}function t3(){var t=P(['<drop-list part="drop-list" identifier="droplist','"></drop-list>',""]);t3=function e(){return t};return t}function t4(){var t=P([' <slot name="prompt"> </slot>\n <div part="container">\n <slot part="drags"> </slot>\n <div part="drops">\n ',"\n </div>\n </div>"]);t4=function e(){return t};return t}function t5(){var t=P(["\n [part='drags'] {\n display: flex;\n align-items: flex-start;\n flex: 1;\n }\n\n [part='drops'] {\n flex: 1;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 1fr;\n }\n\n :host([orientation='horizontal']) [part='drags'] {\n flex-direction: row;\n }\n :host([orientation='horizontal']) [part='drops'] {\n grid-auto-flow: column;\n }\n :host([orientation='vertical']) [part='drags'] {\n flex-direction: column;\n }\n :host([orientation='vertical']) [part='drops'] {\n grid-auto-flow: row;\n }\n\n [part='drop-list'] {\n display: block;\n flex: 1;\n }\n\n [part='container'] {\n display: flex;\n gap: 0.5rem;\n }\n :host(.qti-choices-top) [part='container'] {\n flex-direction: column;\n }\n :host(.qti-choices-bottom) [part='container'] {\n flex-direction: column-reverse;\n }\n :host(.qti-choices-left) [part='container'] {\n flex-direction: row;\n }\n :host(.qti-choices-right) [part='container'] {\n flex-direction: row-reverse;\n }\n "]);t5=function e(){return t};return t}function t6(){var t=P(["<slot></slot>"]);t6=function e(){return t};return t}function t9(){var t=P(["\n :host {\n display: block;\n }\n ::slotted(img) {\n position: absolute;\n cursor: move;\n user-select: none;\n left: 50%;\n transform: translateX(-50%);\n }\n "]);t9=function e(){return t};return t}function t7(){var t=P(["<slot></slot>"]);t7=function e(){return t};return t}function t8(){var t=P(["\n :host {\n display: inline-block;\n position: relative;\n }\n "]);t8=function e(){return t};return t}function et(){var t=P(['\n <button\n part="point"\n style=','\n aria-label="Remove point at ','"\n @click=',"\n ></button>\n "]);et=function e(){return t};return t}function ee(){var t=P([' <slot name="prompt"></slot>\n <point-container>\n ',"\n <slot></slot>\n </point-container>"]);ee=function e(){return t};return t}function en(){var t=P(["\n :host {\n display: block;\n }\n point-container {\n display: block;\n position: relative;\n }\n "]);en=function e(){return t};return t}function er(){var t=P(['<div id="bounds" part="bounds">\n <div>',"</div>\n <div>","</div>\n </div>"]);er=function e(){return t};return t}function ei(){var t=P(['<div id="ticks" part="ticks"></div>']);ei=function e(){return t};return t}function eo(){var t=P(['<div id="value" part="value">',"</div>"]);eo=function e(){return t};return t}function ea(){var t=P(['<slot name="prompt"></slot>\n <div id="slider" part="slider">\n ',"\n ",'\n <div id="rail" part="rail" @mousedown='," @touchstart=",'>\n <div id="knob" part="knob">\n ',"\n </div>\n </div>\n </div>"]);ea=function e(){return t};return t}function es(){var t=P([""]);es=function e(){return t};return t}function eu(){var t=P(["<slot @slotchange=","></slot>"]);eu=function e(){return t};return t}function el(){var t=P([' <slot name="qti-gap-img"></slot> ']);el=function e(){return t};return t}function ec(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);ec=function e(){return t};return t}function eh(){var t=P([' <slot name="qti-gap-text"></slot>']);eh=function e(){return t};return t}function ed(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);ed=function e(){return t};return t}function ef(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);ef=function e(){return t};return t}function ep(){var t=P(["<slot></slot>"]);ep=function e(){return t};return t}function ev(){var t=P(["\n :host {\n display: inline-flex;\n user-select: none;\n }\n "]);ev=function e(){return t};return t}function ey(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n position: absolute;\n }\n "]);ey=function e(){return t};return t}function em(){var t=P(['<div part="ch"><div part="cha"></div></div>\n <slot></slot> ']);em=function e(){return t};return t}function eg(){var t=P(["\n :host {\n display: flex;\n user-select: none;\n }\n "]);eg=function e(){return t};return t}function eb(){var t=P(["\n :host {\n display: block;\n cursor: pointer;\n }\n "]);eb=function e(){return t};return t}function e_(){var t=P([" <slot></slot> "]);e_=function e(){return t};return t}function ek(){var t=P(['<div id="label">',"</div>"]);ek=function e(){return t};return t}function eE(){var t=P(['<div part="ch">\n <div part="cha"></div>\n </div>\n ','\n <slot part="slot"></slot> ']);eE=function e(){return t};return t}function ew(){var t=P(["\n :host {\n display: flex;\n align-items: center;\n user-select: none;\n }\n slot {\n width: 100%;\n display: flex;\n align-items: center;\n }\n [part='ch'] {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n }\n "]);ew=function e(){return t};return t}var QtiComponents=function(){var t=function t(t){var e=t.context;return function(t,n){var r=new WeakMap;if((typeof n==="undefined"?"undefined":D(n))=="object")return n.addInitializer(function(){r.set(this,new eF(this,{context:e}))}),{get:function e(){return t.get.call(this)},set:function e(e){var n;return(n=r.get(this))===null||n===void 0?void 0:n.setValue(e),t.set.call(this,e)},init:function t(t){var e;return(e=r.get(this))===null||e===void 0?void 0:e.setValue(t),t}};{t.constructor.addInitializer(function(t){r.set(t,new eF(t,{context:e}))});var i=Object.getOwnPropertyDescriptor(t,n),o;if(i===void 0){var a=new WeakMap;o={get:function t(){return a.get(this)},set:function t(t){r.get(this).setValue(t),a.set(this,t)},configurable:!0,enumerable:!0}}else{var s=i.set;o=w(k({},i),{set:function t(t){r.get(this).setValue(t),s===null||s===void 0?void 0:s.call(this,t)}})}return void Object.defineProperty(t,n,o)}}};var e=function t(t){var e=t.context,n=t.subscribe;return function(t,r){(typeof r==="undefined"?"undefined":D(r))=="object"?r.addInitializer(function(){var r=this;new ej(this,{context:e,callback:function(e){t.set.call(r,e)},subscribe:n})}):t.constructor.addInitializer(function(t){new ej(t,{context:e,callback:function(e){t[r]=e},subscribe:n})})}};var n=function t(t,e){if(!nP(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return nE!==void 0?nE.createHTML(e):e};var r=function t(t){return function(e,n){return(typeof n==="undefined"?"undefined":D(n))=="object"?rr(t,e,n):function(t,e,n){var r=e.hasOwnProperty(n);return e.constructor.createProperty(n,r?w(k({},t),{wrapped:!0}):t),r?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}};var i=function t(t){return r(w(k({},t),{state:!0,attribute:!1}))};var u=function t(t,e){return function(n,r,i){var o=function(e){var n;var r;return(r=(n=e.renderRoot)===null||n===void 0?void 0:n.querySelector(t))!==null&&r!==void 0?r:null};if(e){var a=(typeof r==="undefined"?"undefined":D(r))=="object"?n:i!==null&&i!==void 0?i:function(){var t=Symbol();return{get:function e(){return this[t]},set:function e(e){this[t]=e}}}(),s=a.get,u=a.set;return ri(n,r,{get:function t(){var t=s.call(this);return t===void 0&&(t=o(this),(t!==null||this.hasUpdated)&&u.call(this,t)),t}})}return ri(n,r,{get:function t(){return o(this)}})}};var l=function t(t){return function(e,n){var r=t!==null&&t!==void 0?t:{},i=r.slot,o=r.selector,a="slot"+(i?"[name=".concat(i,"]"):":not([name])");return ri(e,n,{get:function e(){var e;var n;var r=(e=this.renderRoot)===null||e===void 0?void 0:e.querySelector(a),i=(n=r===null||r===void 0?void 0:r.assignedElements(t))!==null&&n!==void 0?n:[];return o===void 0?i:i.filter(function(t){return t.matches(o)})}})}};var h=function t(t,e){var n=k({waitUntilFirstUpdate:!1},e);return function(e,r){var i=e.update,o=Array.isArray(t)?t:[t];e.update=function(t){var e=this;o.forEach(function(i){var o=i;if(t.has(o)){var a=t.get(o),s=e[o];a!==s&&(!n.waitUntilFirstUpdate||e.hasUpdated)&&e[r](a,s)}}),i.call(this,t)}}};var y=function t(t,e,n){t.querySelectorAll(e).forEach(function(t){var r="".concat(e,"-").concat(n),i=g(t,r);t.replaceWith(i)})};var m=function t(t,e){t.querySelectorAll("*").forEach(function(t){var n=t.classList;n&&n.forEach(function(n){if(n.startsWith("".concat(e,":"))){var r=n.slice("".concat(e,":").length),i="".concat(t.nodeName,"-").concat(r),o=g(t,i);t.replaceWith(o)}})})};var g=function t(t,e){var n=document.createElement(e);var r=true,i=false,o=undefined;try{for(var a=t.attributes[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;n.setAttribute(u.name,u.value)}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}for(;t.firstChild;)n.appendChild(t.firstChild);return n};var b=function t(t){var e=[];return t.querySelectorAll("qti-assessment-item-ref").forEach(function(t){var n=t.getAttribute("identifier"),r=t.getAttribute("href"),i=t.getAttribute("category");e.push({identifier:n,href:r,category:i})}),e};var _=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return e&&rc!==null&&rc.abort(),new Promise(function(e,n){var r=new XMLHttpRequest;rc=r,r.open("GET",t,!0),r.responseType="document",r.onload=function(){r.status>=200&&r.status<300?e(r.responseXML):n(r.statusText)},r.onerror=function(){n(r.statusText)},r.send()})};var E=function t(t){return new DOMParser().parseFromString(t,"text/xml")};var x=function t(t){var e=new XSLTProcessor,n=new DOMParser().parseFromString(rl,"text/xml");return e.importStylesheet(n),e.transformToFragment(t,document)};var C=function t(t,e){e.endsWith("/")||(e+="/"),t.querySelectorAll("[src],[href],[primary-path]").forEach(function(t){var n;var r="";t.getAttribute("src")&&(r="src"),t.getAttribute("href")&&(r="href"),t.getAttribute("primary-path")&&(r="primary-path");var i=(n=t.getAttribute(r))===null||n===void 0?void 0:n.trim();if(!i.startsWith("data:")&&!i.startsWith("http")){var o=e+encodeURI(i);t.setAttribute(r,o)}})};var S=function t(t){t.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(function(t){var e=document.createComment(t.textContent);t.replaceChild(e,t.firstChild)})};var R=function t(t){t.querySelectorAll("qti-stylesheet").forEach(function(t){return t.remove()})};var P=function t(t,e){var n=/*#__PURE__*/function(t){"use strict";p(n,t);function n(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}s(this,n);var i;i=a(this,n,$(e));i.identifier="";i.tabIndex=0;i.disabled=!1;i.readonly=!1;i.internals=i.attachInternals();return i}c(n,[{key:"handleDisabledChange",value:function t(t,e){this.tabIndex=e?-1:0,e&&this.blur()}},{key:"connectedCallback",value:function t(){d(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("register-".concat(e),{bubbles:!0,composed:!0}))}},{key:"disconnectedCallback",value:function t(){d(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("unregister-".concat(e),{bubbles:!0,composed:!0}))}},{key:"_onKeyUp",value:function t(t){t.altKey||t.code==="Space"&&(t.preventDefault(),this._activate())}},{key:"_onClick",value:function t(){this.disabled||this.readonly||(this.focus(),this._activate())}},{key:"_activate",value:function t(){this.disabled||this.readonly||this.dispatchEvent(new CustomEvent("activate-".concat(e),{bubbles:!0,composed:!0,detail:{identifier:this.identifier}}))}},{key:"render",value:function t(){return nH(L())}}]);return n}(t);return eN([r({type:String})],n.prototype,"identifier",2),eN([r({type:Number,reflect:!0,attribute:"tabindex"})],n.prototype,"tabIndex",2),eN([r({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:rv})],n.prototype,"disabled",2),eN([r({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:rv})],n.prototype,"readonly",2),eN([h("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"handleDisabledChange",1),n};var U=function t(t){return t==null};var I=function t(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")};var ex=function t(t){this._$AN!==void 0?(rY(this),this._$AM=t,rX(this)):this._$AM=t};var eC=function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;var r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(var o=n;o<r.length;o++)rW(r[o],!1),rY(r[o]);else r!=null&&(rW(r,!1),rY(r));else rW(this,t)};var eA=function t(t){return /*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculateChildren",value:function t(t){return t.map(function(t){var e=t;if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var n=e.calculate(),r=!1;if(typeof n=="string")if(n==="true")r=!0;else if(n==="false")r=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(r=n);return r}).every(function(t){return typeof t=="boolean"&&t})}}]);return e}(t)};var eS=function t(t,e){var n,r=k({},e);return function(e,r){var i=e.connectedCallback,o=e.disconnectedCallback;e.connectedCallback=function(){var e=this;i.call(this);var o=function(n){var i=Array.from(e.querySelectorAll(t));var o=true,a=false,s=undefined;try{for(var u=n[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true){var c=l.value;var h=Array.from(c.addedNodes).map(function(t){return t}),d=Array.from(c.addedNodes).map(function(t){return t});c.type==="childList"&&h.find(function(t){return i.includes(t)})&&e[r](h,d)}}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}};n=new MutationObserver(o),n.observe(this,{childList:!0,subtree:!0});var a;var s=(a=this.querySelectorAll(t))!==null&&a!==void 0?a:[];this[r](Array.from(s),[])},e.disconnectedCallback=function(){o.call(this),n.disconnect()}}};var eq=function t(t,e,n,r){switch(t){case"circle":{var i=q(e,3),o=i[0],a=i[1],s=i[2],u=o/n.width*100,l=a/n.height*100,c=s/n.width*100;r.style.left=u-c+"%",r.style.top=l-c+"%",r.style.width=r.style.height=4*c+"px",r.style.borderRadius="9999px"}break;case"rect":{var h=q(e,4),d=h[0],f=h[1],p=h[2],v=h[3],y=d/n.width*100,m=f/n.height*100,g=p/n.width*100,b=v/n.height*100;r.style.left=y+"%",r.style.top=m+"%",r.style.width=g-y+"%",r.style.height=b-m+"%"}break;case"poly":{var _,k,E,w;var x=e.reduce(function(t,e,n,r){if(n%2===1){var i=t.pop();t[t.length]={x:i,y:r[n]}}else t.push(e);return t},[]),C=(_=Math).min.apply(_,$(x.map(function(t){return t.x}))),A=(k=Math).max.apply(k,$(x.map(function(t){return t.x}))),S=(E=Math).min.apply(E,$(x.map(function(t){return t.y}))),R=(w=Math).max.apply(w,$(x.map(function(t){return t.y}))),P=C/n.width*100,T=S/n.height*100,D=A/n.width*100,U=R/n.height*100;r.style.left=C/n.width*100+"%",r.style.top=S/n.height*100+"%",r.style.width=D-P+"%",r.style.height=U-T+"%";var M=x.map(function(t){return{x:(t.x-C)/(A-C)*100,y:(t.y-S)/(R-S)*100}}).map(function(t){return Math.round(t.x)+"% "+Math.round(t.y)+"%"}).join(",");r.style.clipPath="polygon(".concat(M,")")}break;default:break}};var eR=function t(t){var e=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"createRenderRoot",value:function t(){return this}},{key:"assessmentItem",get:function t(){var t;return(t=this.renderRoot)===null||t===void 0?void 0:t.querySelector("qti-assessment-item")}},{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return d(f(e.prototype),"connectedCallback",t)};return o(function(){return O(this,function(t){switch(t.label){case 0:r().call(n);return[4,n.updateComplete];case 1:t.sent(),n.dispatchEvent(new CustomEvent("qti-item-connected",{bubbles:!0,composed:!0,detail:{identifier:n.identifier,href:n.href}}));return[2]}})})()}},{key:"render",value:function t(){return nH(N(),this.xmlDoc)}}]);return e}(t);return eN([r({type:String,reflect:!0})],e.prototype,"identifier",2),eN([r({type:String})],e.prototype,"href",2),eN([r({type:Object,attribute:!1})],e.prototype,"xmlDoc",2),e};var eP,eT;var e$=Object.defineProperty;var eD=Object.getOwnPropertyDescriptor;var eU=Object.getOwnPropertyNames;var eM=Object.prototype.hasOwnProperty;var eI=function(t,e){for(var n in e)e$(t,n,{get:e[n],enumerable:!0})},eO=function(t,e,n,r){var i=true,o=false,a=undefined;if(e&&(typeof e==="undefined"?"undefined":D(e))=="object"||typeof e=="function")try{var s=function(){var i=l.value;!eM.call(t,i)&&i!==n&&e$(t,i,{get:function(){return e[i]},enumerable:!(r=eD(e,i))||r.enumerable})};for(var u=eU(e)[Symbol.iterator](),l;!(i=(l=u.next()).done);i=true)s()}catch(t){o=true;a=t}finally{try{if(!i&&u.return!=null){u.return()}}finally{if(o){throw a}}}return t};var eL=function(t){return eO(e$({},"__esModule",{value:!0}),t)},eN=function(t,e,n,r){for(var i=r>1?void 0:r?eD(e,n):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(i=(r?a(e,n,i):a(i))||i);return r&&i&&e$(e,n,i),i};var eV={};eI(eV,{ActiveElementMixin:function(){return P},Interaction:function(){return rD},QtiAnd:function(){return iE},QtiAssessmentItem:function(){return rs},QtiAssessmentStimulusRef:function(){return rp},QtiAssociableHotspot:function(){return of},QtiAssociateInteraction:function(){return i0},QtiBaseValue:function(){return iw},QtiChoiceInteraction:function(){return ii},QtiCompanionMaterialsInfo:function(){return rw},QtiConditionExpression:function(){return ik},QtiContains:function(){return ix},QtiContentBody:function(){return rx},QtiCorrect:function(){return iC},QtiCustomInteraction:function(){return i1},QtiCustomOperator:function(){return od},QtiEndAttemptInteraction:function(){return i2},QtiEqual:function(){return iq},QtiEqualRounded:function(){return iA},QtiExpression:function(){return i_},QtiExtendedTextInteraction:function(){return rU},QtiFeedbackBlock:function(){return rR},QtiFeedbackInline:function(){return rP},QtiGap:function(){return op},QtiGapImg:function(){return ov},QtiGapMatchInteraction:function(){return i3},QtiGapText:function(){return oy},QtiGraphicAssociateInteraction:function(){return i6},QtiGraphicGapMatchInteraction:function(){return i9},QtiGraphicOrderInteraction:function(){return i7},QtiGt:function(){return iR},QtiGte:function(){return iP},QtiHotspotChoice:function(){return om},QtiHotspotInteraction:function(){return i8},QtiHottext:function(){return og},QtiHottextInteraction:function(){return r5},QtiInlineChoice:function(){return ob},QtiInlineChoiceInteraction:function(){return r7},QtiIsNull:function(){return iT},QtiItem:function(){return ok},QtiItemBody:function(){return rm},QtiItemMixin:function(){return eR},QtiLookupOutcomeValue:function(){return id},QtiLt:function(){return i$},QtiLte:function(){return iD},QtiMapResponse:function(){return iU},QtiMapping:function(){return iM},QtiMatch:function(){return iI},QtiMatchInteraction:function(){return on},QtiMediaInteraction:function(){return or},QtiMember:function(){return iO},QtiModalFeedback:function(){return rT},QtiMultiple:function(){return iL},QtiNot:function(){return iN},QtiOr:function(){return iV},QtiOrderInteraction:function(){return oi},QtiOrdered:function(){return iH},QtiOutcomeDeclaration:function(){return rk},QtiOutcomeProcessing:function(){return io},QtiOutcomeProcessingProcessor:function(){return ia},QtiPortableCustomInteraction:function(){return iY},QtiPositionObjectStage:function(){return oa},QtiPrintedVariable:function(){return ij},QtiProduct:function(){return iQ},QtiPrompt:function(){return rg},QtiResponseCondition:function(){return ip},QtiResponseDeclaration:function(){return rE},QtiResponseElse:function(){return im},QtiResponseElseIf:function(){return ib},QtiResponseIf:function(){return ig},QtiResponseProcessing:function(){return ic},QtiRubricBlock:function(){return rC},QtiRule:function(){return ih},QtiSPositionObjectInteraction:function(){return oo},QtiSelectPointInteraction:function(){return oc},QtiSetOutcomeValue:function(){return iv},QtiSetOutcomeValueRule:function(){return iy},QtiSimpleAssociableChoice:function(){return ot},QtiSimpleChoice:function(){return o_},QtiSliderInteraction:function(){return oh},QtiStringMatch:function(){return iB},QtiStylesheet:function(){return rb},QtiSum:function(){return iF},QtiSumExpression:function(){return iz},QtiTextEntryInteraction:function(){return r3},QtiVariable:function(){return iW},getItemByUri:function(){return ow},getManifestInfo:function(){return oE},itemContext:function(){return ra},itemContextVariables:function(){return ro},qtiAndMixin:function(){return eA},qtiTransformItem:function(){return rh},qtiTransformManifest:function(){return rd},qtiTransformTest:function(){return rf}});var eH=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t,n,r){s(this,e);var i;i=a(this,e,["context-request",{bubbles:!0,composed:!0}]),i.context=t,i.callback=n,i.subscribe=r!==null&&r!==void 0?r:!1;return i}return e}(M(Event));var ej=/*#__PURE__*/function(){"use strict";function t(e,n,r,i){var o=this;s(this,t);if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=function(t,e){o.unsubscribe&&(o.unsubscribe!==e&&(o.provided=!1,o.unsubscribe()),o.subscribe||o.unsubscribe()),o.value=t,o.host.requestUpdate(),o.provided&&!o.subscribe||(o.provided=!0,o.callback&&o.callback(t,e)),o.unsubscribe=e},this.host=e,n.context!==void 0){var a=n;var u;this.context=a.context,this.callback=a.callback,this.subscribe=(u=a.subscribe)!==null&&u!==void 0?u:!1}else this.context=n,this.callback=r,this.subscribe=i!==null&&i!==void 0?i:!1;this.host.addController(this)}c(t,[{key:"hostConnected",value:function t(){this.dispatchRequest()}},{key:"hostDisconnected",value:function t(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}},{key:"dispatchRequest",value:function t(){this.host.dispatchEvent(new eH(this.context,this.t,this.subscribe))}}]);return t}();var eQ=/*#__PURE__*/function(){"use strict";function t(e){var n=this;s(this,t);this.subscriptions=new Map,this.updateObservers=function(){var t=true,e=false,r=undefined;try{for(var i=n.subscriptions[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=q(o.value,2),s=a[0],u=a[1],l=u.disposer;s(n.o,l)}}catch(t){e=true;r=t}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(e){throw r}}}},e!==void 0&&(this.value=e)}c(t,[{key:"value",get:function t(){return this.o},set:function t(t){this.setValue(t)}},{key:"setValue",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=e||!Object.is(t,this.o);this.o=t,n&&this.updateObservers()}},{key:"addCallback",value:function t(t,e,n){var r=this;if(!n)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:function(){r.subscriptions.delete(t)},consumerHost:e});var i=this.subscriptions.get(t),o=i.disposer;t(this.value,o)}},{key:"clearCallbacks",value:function t(){this.subscriptions.clear()}}]);return t}();var eB=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t){s(this,e);var n;n=a(this,e,["context-provider",{bubbles:!0,composed:!0}]),n.context=t;return n}return e}(M(Event)),eF=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t,n,r){s(this,e);var i;var o,u;i=a(this,e,[n.context!==void 0?n.initialValue:r]),i.onContextRequest=function(t){var e=t.composedPath()[0];t.context===i.context&&e!==i.host&&(t.stopPropagation(),i.addCallback(t.callback,e,t.subscribe))},i.onProviderRequest=function(t){var e=t.composedPath()[0];if(t.context!==i.context||e===i.host)return;var n=new Set;var r=true,o=false,a=undefined;try{for(var s=i.subscriptions[Symbol.iterator](),u;!(r=(u=s.next()).done);r=true){var l=q(u.value,2),c=l[0],h=l[1],d=h.consumerHost;n.has(c)||(n.add(c),d.dispatchEvent(new eH(i.context,c,!0)))}}catch(t){o=true;a=t}finally{try{if(!r&&s.return!=null){s.return()}}finally{if(o){throw a}}}t.stopPropagation()},i.host=t,n.context!==void 0?i.context=n.context:i.context=n,i.attachListeners(),(o=(u=i.host).addController)===null||o===void 0?void 0:o.call(u,i);return i}c(e,[{key:"attachListeners",value:function t(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}},{key:"hostConnected",value:function t(){this.host.dispatchEvent(new eB(this.context))}}]);return e}(eQ);var ez=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}c(t,[{key:"shadowRoot",get:function t(){return this.__host.__shadowRoot}},{key:"checkValidity",value:function t(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}},{key:"reportValidity",value:function t(){return!0}},{key:"setFormValue",value:function t(){}},{key:"setValidity",value:function t(){}}]);return t}();var eW=new WeakMap,eY=function(t){var e=eW.get(t);return e===void 0&&eW.set(t,e=new Map),e},eX=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}c(t,[{key:"attributes",get:function t(){return Array.from(eY(this)).map(function(t){var e=q(t,2),n=e[0],r=e[1];return{name:n,value:r}})}},{key:"shadowRoot",get:function t(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}},{key:"localName",get:function t(){return this.constructor.__localName}},{key:"tagName",get:function t(){var t;return(t=this.localName)===null||t===void 0?void 0:t.toUpperCase()}},{key:"setAttribute",value:function t(t,e){eY(this).set(t,String(e))}},{key:"removeAttribute",value:function t(t){eY(this).delete(t)}},{key:"toggleAttribute",value:function t(t,e){if(this.hasAttribute(t)){if(e===void 0||!e)return this.removeAttribute(t),!1}else return e===void 0||e?(this.setAttribute(t,""),!0):!1;return!0}},{key:"hasAttribute",value:function t(t){return eY(this).has(t)}},{key:"attachShadow",value:function t(t){var e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}},{key:"attachInternals",value:function t(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");var t=new ez(this);return this.__internals=t,t}},{key:"getAttribute",value:function t(t){var e;return(e=eY(this).get(t))!==null&&e!==void 0?e:null}}]);return t}();var eZ=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(eX),eG=eZ;var eK=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.__definitions=new Map}c(t,[{key:"define",value:function t(t,e){if(this.__definitions.has(t))if(process.env.NODE_ENV==="development")console.warn("'CustomElementRegistry' already has \"".concat(t,'" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.\nMake sure to test your application with a production build as repeat registrations will throw in production.'));else throw new Error("Failed to execute 'define' on 'CustomElementRegistry': the name \"".concat(t,'" has already been used with this registry'));var n;e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:(n=e.observedAttributes)!==null&&n!==void 0?n:[]})}},{key:"get",value:function t(t){var e;return(e=this.__definitions.get(t))===null||e===void 0?void 0:e.ctor}}]);return t}(),eJ=eK;var e0=new eJ;var e1=globalThis,e2=e1.ShadowRoot&&(e1.ShadyCSS===void 0||e1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e3=Symbol(),e4=new WeakMap,e5=/*#__PURE__*/function(){"use strict";function t(e,n,r){s(this,t);if(this._$cssResult$=!0,r!==e3)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}c(t,[{key:"styleSheet",get:function t(){var t=this.o,e=this.t;if(e2&&t===void 0){var n=e!==void 0&&e.length===1;n&&(t=e4.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&e4.set(e,t))}return t}},{key:"toString",value:function t(){return this.cssText}}]);return t}(),e6=function(t){return new e5(typeof t=="string"?t:t+"",void 0,e3)},e9=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++){n[r-1]=arguments[r]}var i=t.length===1?t[0]:n.reduce(function(e,n,r){return e+function(t){if(t._$cssResult$===!0)return t.cssText;if(typeof t=="number")return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")}(n)+t[r+1]},t[0]);return new e5(i,t,e3)},e7=function(t,e){var n=true,r=false,i=undefined;if(e2)t.adoptedStyleSheets=e.map(function(t){return v(t,CSSStyleSheet)?t:t.styleSheet});else try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;var u=document.createElement("style"),l=e1.litNonce;l!==void 0&&u.setAttribute("nonce",l),u.textContent=s.cssText,t.appendChild(u)}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}},e8=e2||e1.CSSStyleSheet===void 0?function(t){return t}:function(t){return v(t,CSSStyleSheet)?function(t){var e="";var n=true,r=false,i=undefined;try{for(var o=t.cssRules[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;e+=s.cssText}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return e6(e)}(t):t};var nt=Object.is,ne=Object.defineProperty,nn=Object.getOwnPropertyDescriptor,nr=Object.getOwnPropertyNames,ni=Object.getOwnPropertySymbols,no=Object.getPrototypeOf,na=globalThis;var ns;(ns=na.customElements)!==null&&ns!==void 0?ns:na.customElements=e0;var nu=na.trustedTypes,nl=nu?nu.emptyScript:"",nc=na.reactiveElementPolyfillSupport,nh=function(t,e){return t},nd={toAttribute:function t(t,e){switch(e){case Boolean:t=t?nl:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute:function t(t,e){var n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},nf=function(t,e){return!nt(t,e)},np={attribute:!0,type:String,converter:nd,reflect:!1,hasChanged:nf};var nv,ny;(nv=Symbol.metadata)!==null&&nv!==void 0?nv:Symbol.metadata=Symbol("metadata"),(ny=na.litPropertyMetadata)!==null&&ny!==void 0?ny:na.litPropertyMetadata=new WeakMap;var nm;var ng=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e),t._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev();return t}c(e,[{key:"_$Ev",value:function t(){var t=this;var e;this._$ES=new Promise(function(e){return t.enableUpdating=e}),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)===null||e===void 0?void 0:e.forEach(function(e){return e(t)})}},{key:"addController",value:function t(t){var e;var n;((n=this._$EO)!==null&&n!==void 0?n:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)===null||e===void 0?void 0:e.call(t))}},{key:"removeController",value:function t(t){var e;(e=this._$EO)===null||e===void 0?void 0:e.delete(t)}},{key:"_$E_",value:function t(){var t=new Map,e=this.constructor.elementProperties;var n=true,r=false,i=undefined;try{for(var o=e.keys()[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s])}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function t(){var t;var e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return e7(e,this.constructor.elementStyles),e}},{key:"connectedCallback",value:function t(){var t;var e;(e=this.renderRoot)!==null&&e!==void 0?e:this.renderRoot=this.createRenderRoot(),this.enableUpdating(!0),(t=this._$EO)===null||t===void 0?void 0:t.forEach(function(t){var e;return(e=t.hostConnected)===null||e===void 0?void 0:e.call(t)})}},{key:"enableUpdating",value:function t(t){}},{key:"disconnectedCallback",value:function t(){var t;(t=this._$EO)===null||t===void 0?void 0:t.forEach(function(t){var e;return(e=t.hostDisconnected)===null||e===void 0?void 0:e.call(t)})}},{key:"attributeChangedCallback",value:function t(t,e,n){this._$AK(t,n)}},{key:"_$EC",value:function t(t,e){var n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(r!==void 0&&n.reflect===!0){var i;var o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:nd).toAttribute(e,n.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}},{key:"_$AK",value:function t(t,e){var n=this.constructor,r=n._$Eh.get(t);if(r!==void 0&&this._$Em!==r){var i;var o=n.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:nd;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}},{key:"requestUpdate",value:function t(t,e,n){if(t!==void 0){var r;if(n!==null&&n!==void 0?n:n=this.constructor.getPropertyOptions(t),!((r=n.hasChanged)!==null&&r!==void 0?r:nf)(this[t],e))return;this.P(t,e,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}},{key:"P",value:function t(t,e,n){var r;this._$AL.has(t)||this._$AL.set(t,e),n.reflect===!0&&this._$Em!==t&&((r=this._$Ej)!==null&&r!==void 0?r:this._$Ej=new Set).add(t)}},{key:"_$ET",value:function t(){var t=this;return o(function(){var e,n,r;return O(this,function(i){switch(i.label){case 0:t.isUpdatePending=!0;i.label=1;case 1:i.trys.push([1,3,,4]);return[4,t._$ES];case 2:i.sent();return[3,4];case 3:e=i.sent();Promise.reject(e);return[3,4];case 4:n=t.scheduleUpdate();r=n!=null;if(!r)return[3,6];return[4,n];case 5:r=i.sent();i.label=6;case 6:return[2,(r,!t.isUpdatePending)]}})})()}},{key:"scheduleUpdate",value:function t(){return this.performUpdate()}},{key:"performUpdate",value:function t(){if(!this.isUpdatePending)return;if(!this.hasUpdated){var t;if((t=this.renderRoot)!==null&&t!==void 0?t:this.renderRoot=this.createRenderRoot(),this._$Ep){var e=true,n=false,r=undefined;try{for(var i=this._$Ep[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=q(o.value,2),s=a[0],u=a[1];this[s]=u}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}this._$Ep=void 0}var l=this.constructor.elementProperties;var c=true,h=false,d=undefined;if(l.size>0)try{for(var f=l[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=q(p.value,2),y=v[0],m=v[1];m.wrapped!==!0||this._$AL.has(y)||this[y]===void 0||this.P(y,this[y],m)}}catch(t){h=true;d=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(h){throw d}}}}var g=!1,b=this._$AL;try{var _;g=this.shouldUpdate(b),g?(this.willUpdate(b),(_=this._$EO)===null||_===void 0?void 0:_.forEach(function(t){var e;return(e=t.hostUpdate)===null||e===void 0?void 0:e.call(t)}),this.update(b)):this._$EU()}catch(t){throw g=!1,this._$EU(),t}g&&this._$AE(b)}},{key:"willUpdate",value:function t(t){}},{key:"_$AE",value:function t(t){var e;(e=this._$EO)===null||e===void 0?void 0:e.forEach(function(t){var e;return(e=t.hostUpdated)===null||e===void 0?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}},{key:"_$EU",value:function t(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function t(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function t(){return this._$ES}},{key:"shouldUpdate",value:function t(t){return!0}},{key:"update",value:function t(t){var e=this;this._$Ej&&(this._$Ej=this._$Ej.forEach(function(t){return e._$EC(t,e[t])})),this._$EU()}},{key:"updated",value:function t(t){}},{key:"firstUpdated",value:function t(t){}}],[{key:"addInitializer",value:function t(t){var e;this._$Ei(),((e=this.l)!==null&&e!==void 0?e:this.l=[]).push(t)}},{key:"observedAttributes",get:function t(){return this.finalize(),this._$Eh&&$(this._$Eh.keys())}},{key:"createProperty",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:np;if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){var n=Symbol(),r=this.getPropertyDescriptor(t,n,e);r!==void 0&&ne(this.prototype,t,r)}}},{key:"getPropertyDescriptor",value:function t(t,e,n){var r;var i=(r=nn(this.prototype,t))!==null&&r!==void 0?r:{get:function t(){return this[e]},set:function t(t){this[e]=t}},o=i.get,a=i.set;return{get:function t(){return o===null||o===void 0?void 0:o.call(this)},set:function e(e){var r=o===null||o===void 0?void 0:o.call(this);a.call(this,e),this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function t(t){var e;return(e=this.elementProperties.get(t))!==null&&e!==void 0?e:np}},{key:"_$Ei",value:function t(){if(this.hasOwnProperty(nh("elementProperties")))return;var t=no(this);t.finalize(),t.l!==void 0&&(this.l=$(t.l)),this.elementProperties=new Map(t.elementProperties)}},{key:"finalize",value:function t(){if(this.hasOwnProperty(nh("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(nh("properties"))){var t=this.properties,e=$(nr(t)).concat($(ni(t)));var n=true,r=false,i=undefined;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;this.createProperty(s,t[s])}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}var u=this[Symbol.metadata];if(u!==null){var l=litPropertyMetadata.get(u);var c=true,h=false,d=undefined;if(l!==void 0)try{for(var f=l[Symbol.iterator](),p;!(c=(p=f.next()).done);c=true){var v=q(p.value,2),y=v[0],m=v[1];this.elementProperties.set(y,m)}}catch(t){h=true;d=t}finally{try{if(!c&&f.return!=null){f.return()}}finally{if(h){throw d}}}}this._$Eh=new Map;var g=true,b=false,_=undefined;try{for(var k=this.elementProperties[Symbol.iterator](),E;!(g=(E=k.next()).done);g=true){var w=q(E.value,2),x=w[0],C=w[1];var A=this._$Eu(x,C);A!==void 0&&this._$Eh.set(A,x)}}catch(t){b=true;_=t}finally{try{if(!g&&k.return!=null){k.return()}}finally{if(b){throw _}}}this.elementStyles=this.finalizeStyles(this.styles)}},{key:"finalizeStyles",value:function t(t){var e=[];if(Array.isArray(t)){var n=new Set(t.flat(1/0).reverse());var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;e.unshift(e8(u))}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}else t!==void 0&&e.push(e8(t));return e}},{key:"_$Eu",value:function t(t,e){var n=e.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}}]);return e}((nm=globalThis.HTMLElement)!==null&&nm!==void 0?nm:eG);var nb;ng.elementStyles=[],ng.shadowRootOptions={mode:"open"},ng[nh("elementProperties")]=new Map,ng[nh("finalized")]=new Map,nc===null||nc===void 0?void 0:nc({ReactiveElement:ng}),((nb=na.reactiveElementVersions)!==null&&nb!==void 0?nb:na.reactiveElementVersions=[]).push("2.0.4");var n_=globalThis,nk=n_.trustedTypes,nE=nk?nk.createPolicy("lit-html",{createHTML:function(t){return t}}):void 0,nw="$lit$",nx="lit$".concat(Math.random().toFixed(9).slice(2),"$"),nC="?"+nx,nA="<".concat(nC,">"),nS=n_.document===void 0?{createTreeWalker:function(){return{}}}:document,nq=function(){return nS.createComment("")},nR=function(t){return t===null||(typeof t==="undefined"?"undefined":D(t))!="object"&&typeof t!="function"},nP=Array.isArray,nT=function(t){return nP(t)||typeof(t===null||t===void 0?void 0:t[Symbol.iterator])=="function"},n$="[ \n\f\r]",nD=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nU=/-->/g,nM=/>/g,nI=RegExp(">|".concat(n$,"(?:([^\\s\"'>=/]+)(").concat(n$,"*=").concat(n$,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),nO=/'/g,nL=/"/g,nN=/^(?:script|style|textarea|title)$/i,nV=function(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++){r[i-1]=arguments[i]}return{_$litType$:t,strings:e,values:r}}},nH=nV(1),nj=nV(2),nQ=nV(3),nB=Symbol.for("lit-noChange"),nF=Symbol.for("lit-nothing"),nz=new WeakMap,nW=nS.createTreeWalker(nS,129);var nY=function(t,e){var r=t.length-1,i=[],o,a=e===2?"<svg>":e===3?"<math>":"",s=nD;for(var u=0;u<r;u++){var l=t[u],c=void 0,h=void 0,d=-1,f=0;for(;f<l.length&&(s.lastIndex=f,h=s.exec(l),h!==null);)f=s.lastIndex,s===nD?h[1]==="!--"?s=nU:h[1]!==void 0?s=nM:h[2]!==void 0?(nN.test(h[2])&&(o=RegExp("</"+h[2],"g")),s=nI):h[3]!==void 0&&(s=nI):s===nI?h[0]===">"?(s=o!==null&&o!==void 0?o:nD,d=-1):h[1]===void 0?d=-2:(d=s.lastIndex-h[2].length,c=h[1],s=h[3]===void 0?nI:h[3]==='"'?nL:nO):s===nL||s===nO?s=nI:s===nU||s===nM?s=nD:(s=nI,o=void 0);var p=s===nI&&t[u+1].startsWith("/>")?" ":"";a+=s===nD?l+nA:d>=0?(i.push(c),l.slice(0,d)+nw+l.slice(d)+nx+p):l+nx+(d===-2?u:p)}return[n(t,a+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},nX=/*#__PURE__*/function(){"use strict";function t(e,n){var r=e.strings,i=e._$litType$;s(this,t);var o;this.parts=[];var a=0,u=0,l=r.length-1,c=this.parts,h=q(nY(r,i),2),d=h[0],f=h[1];if(this.el=t.createElement(d,n),nW.currentNode=this.el.content,i===2||i===3){var p;var v=this.el.content.firstChild;(p=v).replaceWith.apply(p,$(v.childNodes))}for(;(o=nW.nextNode())!==null&&c.length<l;){if(o.nodeType===1){var y=true,m=false,g=undefined;if(o.hasAttributes())try{for(var b=o.getAttributeNames()[Symbol.iterator](),_;!(y=(_=b.next()).done);y=true){var k=_.value;if(k.endsWith(nw)){var E=f[u++],w=o.getAttribute(k).split(nx),x=/([.?@])?(.*)/.exec(E);c.push({type:1,index:a,name:x[2],strings:w,ctor:x[1]==="."?n0:x[1]==="?"?n1:x[1]==="@"?n2:nJ}),o.removeAttribute(k)}else k.startsWith(nx)&&(c.push({type:6,index:a}),o.removeAttribute(k))}}catch(t){m=true;g=t}finally{try{if(!y&&b.return!=null){b.return()}}finally{if(m){throw g}}}if(nN.test(o.tagName)){var C=o.textContent.split(nx),A=C.length-1;if(A>0){o.textContent=nk?nk.emptyScript:"";for(var S=0;S<A;S++)o.append(C[S],nq()),nW.nextNode(),c.push({type:2,index:++a});o.append(C[A],nq())}}}else if(o.nodeType===8)if(o.data===nC)c.push({type:2,index:a});else{var R=-1;for(;(R=o.data.indexOf(nx,R+1))!==-1;)c.push({type:7,index:a}),R+=nx.length-1}a++}}c(t,null,[{key:"createElement",value:function t(t,e){var n=nS.createElement("template");return n.innerHTML=t,n}}]);return t}();function nZ(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,r=arguments.length>3?arguments[3]:void 0;var i,o;if(e===nB)return e;var a=r!==void 0?(i=n._$Co)===null||i===void 0?void 0:i[r]:n._$Cl,s=nR(e)?void 0:e._$litDirective$;var u;return(a===null||a===void 0?void 0:a.constructor)!==s&&(a===null||a===void 0?void 0:(o=a._$AO)===null||o===void 0?void 0:o.call(a,!1),s===void 0?a=void 0:(a=new s(t),a._$AT(t,n,r)),r!==void 0?((u=n._$Co)!==null&&u!==void 0?u:n._$Co=[])[r]=a:n._$Cl=a),a!==void 0&&(e=nZ(t,a._$AS(t,e.values),a,r)),e}var nG=/*#__PURE__*/function(){"use strict";function t(e,n){s(this,t);this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}c(t,[{key:"parentNode",get:function t(){return this._$AM.parentNode}},{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"u",value:function t(t){var e;var n=this._$AD,r=n.el,i=r.content,o=n.parts,a=((e=t===null||t===void 0?void 0:t.creationScope)!==null&&e!==void 0?e:nS).importNode(i,!0);nW.currentNode=a;var s=nW.nextNode(),u=0,l=0,c=o[0];for(;c!==void 0;){if(u===c.index){var h=void 0;c.type===2?h=new nK(s,s.nextSibling,this,t):c.type===1?h=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(h=new n3(s,this,t)),this._$AV.push(h),c=o[++l]}u!==(c===null||c===void 0?void 0:c.index)&&(s=nW.nextNode(),u++)}return nW.currentNode=nS,a}},{key:"p",value:function t(t){var e=0;var n=true,r=false,i=undefined;try{for(var o=this._$AV[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}}}]);return t}(),nK=/*#__PURE__*/function(){"use strict";function t(e,n,r,i){s(this,t);var o;this.type=2,this._$AH=nF,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=(o=i===null||i===void 0?void 0:i.isConnected)!==null&&o!==void 0?o:!0}c(t,[{key:"_$AU",get:function t(){var t;var e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cv}},{key:"parentNode",get:function t(){var t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t===null||t===void 0?void 0:t.nodeType)===11&&(t=e.parentNode),t}},{key:"startNode",get:function t(){return this._$AA}},{key:"endNode",get:function t(){return this._$AB}},{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;t=nZ(this,t,e),nR(t)?t===nF||t==null||t===""?(this._$AH!==nF&&this._$AR(),this._$AH=nF):t!==this._$AH&&t!==nB&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):nT(t)?this.k(t):this._(t)}},{key:"O",value:function t(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}},{key:"T",value:function t(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}},{key:"_",value:function t(t){this._$AH!==nF&&nR(this._$AH)?this._$AA.nextSibling.data=t:this.T(nS.createTextNode(t)),this._$AH=t}},{key:"$",value:function t(t){var e;var r=t.values,i=t._$litType$,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=nX.createElement(n(i.h,i.h[0]),this.options)),i);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===o)this._$AH.p(r);else{var a=new nG(o,this),s=a.u(this.options);a.p(r),this.T(s),this._$AH=a}}},{key:"_$AC",value:function t(t){var e=nz.get(t.strings);return e===void 0&&nz.set(t.strings,e=new nX(t)),e}},{key:"k",value:function e(e){nP(this._$AH)||(this._$AH=[],this._$AR());var n=this._$AH,r,i=0;var o=true,a=false,s=undefined;try{for(var u=e[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true){var c=l.value;i===n.length?n.push(r=new t(this.O(nq()),this.O(nq()),this,this.options)):r=n[i],r._$AI(c),i++}}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}},{key:"_$AR",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;var n,r;for((n=(r=this)._$AP)===null||n===void 0?void 0:n.call(r,!1,!0,e);t&&t!==this._$AB;){var i=t.nextSibling;t.remove(),t=i}}},{key:"setConnected",value:function t(t){var e,n;this._$AM===void 0&&(this._$Cv=t,(e=(n=this)._$AP)===null||e===void 0?void 0:e.call(n,t))}}]);return t}(),nJ=/*#__PURE__*/function(){"use strict";function t(e,n,r,i,o){s(this,t);this.type=1,this._$AH=nF,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=nF}c(t,[{key:"tagName",get:function t(){return this.element.tagName}},{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;var i=this.strings,o=!1;if(i===void 0)t=nZ(this,t,e,0),o=!nR(t)||t!==this._$AH&&t!==nB,o&&(this._$AH=t);else{var a=t,s,u;for(t=i[0],s=0;s<i.length-1;s++)u=nZ(this,a[n+s],e,s),u===nB&&(u=this._$AH[s]),o||(o=!nR(u)||u!==this._$AH[s]),u===nF?t=nF:t!==nF&&(t+=(u!==null&&u!==void 0?u:"")+i[s+1]),this._$AH[s]=u}o&&!r&&this.j(t)}},{key:"j",value:function t(t){t===nF?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!==null&&t!==void 0?t:"")}}]);return t}(),n0=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.type=3;return t}c(e,[{key:"j",value:function t(t){this.element[this.name]=t===nF?void 0:t}}]);return e}(nJ),n1=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.type=4;return t}c(e,[{key:"j",value:function t(t){this.element.toggleAttribute(this.name,!!t&&t!==nF)}}]);return e}(nJ),n2=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t,n,r,i,o){s(this,e);var u;u=a(this,e,[t,n,r,i,o]),u.type=5;return u}c(e,[{key:"_$AI",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;var n;if((t=(n=nZ(this,t,e,0))!==null&&n!==void 0?n:nF)===nB)return;var r=this._$AH,i=t===nF&&r!==nF||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==nF&&(r===nF||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}},{key:"handleEvent",value:function t(t){var e;var n;typeof this._$AH=="function"?this._$AH.call((n=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&n!==void 0?n:this.element,t):this._$AH.handleEvent(t)}}]);return e}(nJ),n3=/*#__PURE__*/function(){"use strict";function t(e,n,r){s(this,t);this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}c(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AI",value:function t(t){nZ(this,t)}}]);return t}(),n4={M:nw,P:nx,A:nC,C:1,L:nY,R:nG,D:nT,V:nZ,I:nK,H:nJ,N:n1,U:n2,B:n0,F:n3},n5=n_.litHtmlPolyfillSupport;var n6;n5===null||n5===void 0?void 0:n5(nX,nK),((n6=n_.litHtmlVersions)!==null&&n6!==void 0?n6:n_.litHtmlVersions=[]).push("3.2.1");var n9=function(t,e,n){var r;var i=(r=n===null||n===void 0?void 0:n.renderBefore)!==null&&r!==void 0?r:e,o=i._$litPart$;if(o===void 0){var a;var s=(a=n===null||n===void 0?void 0:n.renderBefore)!==null&&a!==void 0?a:null;i._$litPart$=o=new nK(e.insertBefore(nq(),s),s,void 0,n!==null&&n!==void 0?n:{})}return o._$AI(t),o};var n7=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t.renderOptions={host:t},t._$Do=void 0;return t}c(e,[{key:"createRenderRoot",value:function t(){var t;var n=d(f(e.prototype),"createRenderRoot",this).call(this);var r;return(r=(t=this.renderOptions).renderBefore)!==null&&r!==void 0?r:t.renderBefore=n.firstChild,n}},{key:"update",value:function t(t){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),d(f(e.prototype),"update",this).call(this,t),this._$Do=n9(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function t(){var t;d(f(e.prototype),"connectedCallback",this).call(this),(t=this._$Do)===null||t===void 0?void 0:t.setConnected(!0)}},{key:"disconnectedCallback",value:function t(){var t;d(f(e.prototype),"disconnectedCallback",this).call(this),(t=this._$Do)===null||t===void 0?void 0:t.setConnected(!1)}},{key:"render",value:function t(){return nB}}]);return e}(ng);n7._$litElement$=!0,n7.finalized=!0,(eP=(eT=globalThis).litElementHydrateSupport)===null||eP===void 0?void 0:eP.call(eT,{LitElement:n7});var n8=globalThis.litElementPolyfillSupport;n8===null||n8===void 0?void 0:n8({LitElement:n7});var rt;((rt=globalThis.litElementVersions)!==null&&rt!==void 0?rt:globalThis.litElementVersions=[]).push("4.1.1");var re=function(t){return function(e,n){n!==void 0?n.addInitializer(function(){customElements.define(t,e)}):customElements.define(t,e)}};var rn={attribute:!0,type:String,converter:nd,reflect:!1,hasChanged:nf},rr=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rn,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;var r=n.kind,i=n.metadata,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(n.name,t),r==="accessor"){var a=n.name;return{set:function n(n){var r=e.get.call(this);e.set.call(this,n),this.requestUpdate(a,r,t)},init:function e(e){return e!==void 0&&this.P(a,void 0,t),e}}}if(r==="setter"){var s=n.name;return function n(n){var r=this[s];e.call(this,n),this.requestUpdate(s,r,t)}}throw Error("Unsupported decorator location: "+r)};var ri=function(t,e,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&(typeof e==="undefined"?"undefined":D(e))!="object"&&Object.defineProperty(t,e,n),n};var ro=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],ra=Symbol("item");var rs=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t.identifier="";t.adaptive="false";t.timeDependent=null;t._handleDisabledChange=function(e,n){t._interactionElements.forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){return t._interactionElements.forEach(function(t){return t.readonly=n})};t._context={identifier:t.getAttribute("identifier"),variables:ro};t._initialContext=w(k({},t._context),{variables:t._context.variables});t._feedbackElements=[];t._interactionElements=[];t.addEventListener("qti-register-variable",function(e){t._context=w(k({},t._context),{variables:$(t._context.variables).concat([e.detail.variable])}),t._initialContext=t._context,e.stopPropagation()}),t.addEventListener("qti-register-feedback",function(e){e.stopPropagation();var n=e.detail;t._feedbackElements.push(n),n.checkShowFeedback(n.outcomeIdentifier)}),t.addEventListener("qti-register-interaction",function(e){e.stopPropagation(),t._interactionElements.push(e.target)}),t.addEventListener("end-attempt",function(e){var n=e.detail,r=n.responseIdentifier,i=n.countAttempt;t.updateResponseVariable(r,"true"),t.processResponse(i)}),t.addEventListener("qti-set-outcome-value",function(e){var n=e.detail,r=n.outcomeIdentifier,i=n.value;t.updateOutcomeVariable(r,i),e.stopPropagation()}),t.addEventListener("qti-interaction-response",t.handleUpdateResponseVariable);return t}c(e,[{key:"variables",get:function t(){return this._context.variables.map(function(t){return k({identifier:t.identifier,value:t.value,type:t.type},t.type==="outcome"&&t.identifier==="SCORE"?{externalScored:t.externalScored}:{})})},set:function t(t){var e=this;if(!Array.isArray(t)||t.some(function(t){return!("identifier"in t)})){console.warn("variables property should be an array of VariableDeclaration");return}this._context=w(k({},this._context),{variables:this._context.variables.map(function(e){var n=t.find(function(t){return t.identifier===e.identifier});return n?k({},e,n):e})}),this._context.variables.forEach(function(t){if(t.type==="response"){var n=e._interactionElements.find(function(e){return e.responseIdentifier===t.identifier});n&&(n.value=t.value)}t.type==="outcome"&&e._feedbackElements.forEach(function(e){return e.checkShowFeedback(t.identifier)})})}},{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return d(f(e.prototype),"connectedCallback",t)};return o(function(){return O(this,function(t){switch(t.label){case 0:r().call(n);return[4,n.updateComplete];case 1:t.sent(),n._emit("qti-assessment-item-connected",n);return[2]}})})()}},{key:"responses",set:function t(t){var e=true,n=false,r=undefined;if(t)try{var i,o=function(){var t=s.value;i.getResponse(t.responseIdentifier)&&i.updateResponseVariable(t.responseIdentifier,t.response);var e=i._interactionElements.find(function(e){return e.getAttribute("response-identifier")===t.responseIdentifier});e&&(e.value=t.response)};for(var a=t[Symbol.iterator](),s;!(e=(s=a.next()).done);e=true)i=this,o()}catch(t){n=true;r=t}finally{try{if(!e&&a.return!=null){a.return()}}finally{if(n){throw r}}}}},{key:"render",value:function t(){return nH(V())}},{key:"showCorrectResponse",value:function t(t){var e=this._context.variables.filter(function(t){return"correctResponse"in t&&t.correctResponse}).map(function(t){return{responseIdentifier:t.identifier,response:t.correctResponse}});var n=true,r=false,i=undefined;try{var o,a=function(){var e=u.value;var n=o._interactionElements.find(function(t){return t.getAttribute("response-identifier")===e.responseIdentifier});n&&(n.correctResponse=t?e.response:"")};for(var s=e[Symbol.iterator](),u;!(n=(u=s.next()).done);n=true)o=this,a()}catch(t){r=true;i=t}finally{try{if(!n&&s.return!=null){s.return()}}finally{if(r){throw i}}}}},{key:"processResponse",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;var e;var n=this.querySelector("qti-response-processing");return!n||!n.process?!1:(n.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),t&&this.updateOutcomeVariable("numAttempts",(+((e=this._context.variables.find(function(t){return t.identifier==="numAttempts"}))===null||e===void 0?void 0:e.value)+1).toString()),this._emit("qti-response-processed"),!0)}},{key:"resetResponses",value:function t(){this._context=this._initialContext}},{key:"getResponse",value:function t(t){return this.getVariable(t)}},{key:"getOutcome",value:function t(t){return this.getVariable(t)}},{key:"getVariable",value:function t(t){return this._context.variables.find(function(e){return e.identifier===t})||null}},{key:"handleUpdateResponseVariable",value:function t(t){var e=t.detail,n=e.responseIdentifier,r=e.response;this.updateResponseVariable(n,r)}},{key:"updateResponseVariable",value:function t(t,e){this._context=w(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:w(k({},n),{value:e})})}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:t,response:Array.isArray(e)?$(e):e}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}},{key:"updateOutcomeVariable",value:function t(t,e){var n;var r=this.getOutcome(t);if(!r){console.warn("Can not set qti-outcome-identifier: ".concat(t,", it is not available"));return}this._context=w(k({},this._context),{variables:this._context.variables.map(function(n){return n.identifier!==t?n:w(k({},n),{value:r.cardinality==="single"?e:$(n.value).concat([e])})})}),this._feedbackElements.forEach(function(e){return e.checkShowFeedback(t)}),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:t,value:(n=this._context.variables.find(function(e){return e.identifier===t}))===null||n===void 0?void 0:n.value})}},{key:"_getCompletionStatus",value:function t(){return this._interactionElements.every(function(t){return t.validate()})?"completed":this._interactionElements.some(function(t){return t.validate()})?"incomplete":"not_attempted"}},{key:"_emit",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}}]);return e}(n7);eN([r({type:String})],rs.prototype,"title",2),eN([r({type:String})],rs.prototype,"identifier",2),eN([r({type:String})],rs.prototype,"adaptive",2),eN([r({type:String})],rs.prototype,"timeDependent",2),eN([r({type:Boolean})],rs.prototype,"disabled",2),eN([h("disabled",{waitUntilFirstUpdate:!0})],rs.prototype,"_handleDisabledChange",2),eN([r({type:Boolean})],rs.prototype,"readonly",2),eN([h("readonly",{waitUntilFirstUpdate:!0})],rs.prototype,"_handleReadonlyChange",2),eN([t({context:ra})],rs.prototype,"_context",2),rs=eN([re("qti-assessment-item")],rs);var ru=String.raw,rl=ru(H());var rc=null;var rh=function(){var t,e={load:function n(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return o(function(){return O(this,function(i){return[2,new Promise(function(i,o){_(n,r).then(function(r){return t=r,e.path(n.substring(0,n.lastIndexOf("/"))),i(e)})})]})})()},parse:function n(n){return t=E(n),e},path:function(n){return C(t,n),e},fn:function n(n){return n(t),e},pciHooks:function n(n){var r=["hook","module"],i=n.substring(0,n.lastIndexOf("/"));var o=true,a=false,s=undefined;try{var u=function(){var e=c.value;t.querySelectorAll("["+e+"]").forEach(function(t){var r=t.getAttribute(e);!r.startsWith("data:")&&!r.startsWith("http")&&(t.setAttribute("base-url",n),t.setAttribute("module",i+"/"+encodeURI(r+(r.endsWith(".js")?"":".js"))))})};for(var l=r[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true)u()}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return e},extendElementName:function(n,r){return y(t,n,r),e},extendElementsWithClass:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"extend";return m(t,n),e},customInteraction:function n(n,r){var i=t.querySelector("qti-custom-interaction"),o=i.querySelector("object");return i.setAttribute("data-base-ref",n),i.setAttribute("data-base-item",n+r),i.setAttribute("data",o.getAttribute("data")),i.setAttribute("width",o.getAttribute("width")),i.setAttribute("height",o.getAttribute("height")),i.removeChild(o),e},convertCDATAtoComment:function n(){return S(t),e},stripStyleSheets:function n(){return R(t),e},html:function e(){return new XMLSerializer().serializeToString(x(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return x(t)},xmlDoc:function e(){return t}};return e};var rd=function(){var t,e={load:function n(n){return o(function(){return O(this,function(r){return[2,new Promise(function(r,i){_(n).then(function(n){return t=n,r(e)})})]})})()},parse:function e(e){t=E(e)},assessmentTest:function e(){var e=t.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:e.getAttribute("href"),identifier:e.getAttribute("identifier")}}};return e};var rf=function(){var t,e={load:function n(n){return o(function(){return O(this,function(r){return[2,new Promise(function(r,i){_(n).then(function(n){return t=n,r(e)})})]})})()},parse:function n(n){return t=E(n),e},fn:function n(n){return n(t),e},items:function e(){return b(t)},html:function e(){return new XMLSerializer().serializeToString(x(t))},xml:function e(){return new XMLSerializer().serializeToString(t)},htmlDoc:function e(){return x(t)},xmlDoc:function e(){return t}};return e};var rp=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.identifier="";t.href="";return t}c(e,[{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return d(f(e.prototype),"connectedCallback",t)};return o(function(){var t,e,i;return O(this,function(o){switch(o.label){case 0:r().call(n);t=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0});if(!n.dispatchEvent(t))return[3,4];e=n.closest("qti-assessment-item").querySelector("[data-stimulus-idref=".concat(n.identifier,"]"));if(!e)return[3,2];return[4,n.updateStimulusRef(e)];case 1:i=o.sent();return[3,3];case 2:i=console.warn("Stimulus with data-stimulus-idref ".concat(n.identifier," not found"));o.label=3;case 3:i;o.label=4;case 4:return[2]}})})()}},{key:"updateStimulusRef",value:function t(t){var e=this;return o(function(){var n,r,i,o;return O(this,function(a){switch(a.label){case 0:n=e.href.substring(0,e.href.lastIndexOf("/"));return[4,rh().load(e.href).then(function(t){return t.path(n).htmlDoc()})];case 1:r=a.sent();if(r){;o=r.querySelectorAll("qti-stimulus-body, qti-stylesheet");t.innerHTML="",(i=t).append.apply(i,$(o))}return[2]}})})()}}]);return e}(n7);eN([r({type:String})],rp.prototype,"identifier",2),eN([r({type:String})],rp.prototype,"href",2),rp=eN([re("qti-assessment-stimulus-ref")],rp);var rv={toAttribute:function(t){return t?"true":"false"},fromAttribute:function(t){return t==="true"}};var ry=e9(j());var rm=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(Q())}}]);return e}(n7);rm.styles=ry,rm=eN([re("qti-item-body")],rm);var rg=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(B())}},{key:"connectedCallback",value:function t(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}}]);return e}(n7);rg=eN([re("qti-prompt")],rg);var rb=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.styleElement=null;return t}c(e,[{key:"firstUpdated",value:function t(t){var n=this;d(f(e.prototype),"firstUpdated",this).call(this,t);var r=this.getAttribute("href");if(r!==null&&fetch(r).then(function(t){return t.text()}).then(function(t){var e=n.minifyCss(t);n.styleElement=document.createElement("style"),n.styleElement.media="screen",n.styleElement.textContent="@scope {".concat(e,"}"),n.parentElement?n.parentElement.appendChild(n.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}).catch(function(t){console.error("Failed to load stylesheet:",t)}),this.textContent!==null&&this.textContent.trim()!==""){var i=this.minifyCss(this.textContent);this.styleElement=document.createElement("style"),this.styleElement.media="screen",this.styleElement.textContent="@scope {".concat(i,"}"),this.parentElement?this.parentElement.appendChild(this.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}}},{key:"minifyCss",value:function t(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()}},{key:"disconnectedCallback",value:function t(){if(this.styleElement)try{this.styleElement.remove()}catch(t){console.error("Could not remove stylesheet:",t)}d(f(e.prototype),"disconnectedCallback",this).call(this)}}]);return e}(n7);rb=eN([re("qti-stylesheet")],rb);var r_=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(F())}},{key:"defaultValues",value:function t(t){var e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;var n=e.map(function(t){return t.innerHTML.trim()});return n.length>1||t.cardinality==="multiple"||t.cardinality==="ordered"?n:n[0]}}]);return e}(n7);r_=eN([re("qti-variabledeclaration")],r_);var rk=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.externalScored=null;return t}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nH(z(),JSON.stringify(r,null,2))}},{key:"interpolationTable",get:function t(){var t=this.querySelector("qti-interpolation-table");if(t){var e=new Map;var n=true,r=false,i=undefined;try{for(var o=t.querySelectorAll("qti-interpolation-table-entry")[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){var s=a.value;!s.getAttribute("source-value")&&s.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");var u=parseInt(s.getAttribute("source-value")),l=parseInt(s.getAttribute("target-value"));(isNaN(u)||isNaN(l))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),e.set(u,l)}}catch(t){r=true;i=t}finally{try{if(!n&&o.return!=null){o.return()}}finally{if(r){throw i}}}return e}return null}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this);var t={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};t.value=this.defaultValues(t),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}}]);return e}(r_);rk.styles=[e9(W())],eN([r({type:String,attribute:"base-type"})],rk.prototype,"baseType",2),eN([r({type:String,attribute:"external-scored"})],rk.prototype,"externalScored",2),eN([r({type:String})],rk.prototype,"identifier",2),eN([r({type:String})],rk.prototype,"cardinality",2),eN([e({context:ra,subscribe:!0}),i()],rk.prototype,"itemContext",2),rk=eN([re("qti-outcome-declaration")],rk);var rE=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.itemContext)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nH(Y(),JSON.stringify(r,null,2))}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this);var t={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,value:null,type:"response",candidateResponse:null};t.value=this.defaultValues(t),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}},{key:"correctResponse",get:function t(){var t,e=this.querySelector("qti-correct-response");if(e){var n=e.querySelectorAll("qti-value");if(this.cardinality==="single"&&n.length>0)t=n[0].textContent,n[0].remove();else if(this.cardinality!=="single"){t=[];for(var r=0;r<n.length;r++)t.push(n[r].textContent),n[r].remove()}}return t}},{key:"mapping",get:function t(){return this.querySelector("qti-mapping")}}]);return e}(r_);rE.styles=[e9(X())],eN([r({type:String,attribute:"base-type"})],rE.prototype,"baseType",2),eN([r({type:String})],rE.prototype,"identifier",2),eN([r({type:String})],rE.prototype,"cardinality",2),eN([e({context:ra,subscribe:!0}),i()],rE.prototype,"itemContext",2),rE=eN([re("qti-response-declaration")],rE);var rw=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(n7);rw=eN([re("qti-companion-materials-info")],rw);var rx=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(Z())}}]);return e}(n7);rx=eN([re("qti-content-body")],rx);var rC=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"handleclassNamesChange",value:function t(t,e){var n=this;this.classNames.split(" ").forEach(function(t){switch(t){case"qti-rubric-discretionary-placement":n.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":n.setAttribute("slot","");break;default:break}})}},{key:"render",value:function t(){return nH(G())}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-rubric-block")}}]);return e}(n7);rC.styles=e9(K()),eN([r({type:String})],rC.prototype,"id",2),eN([r({type:String})],rC.prototype,"use",2),eN([r({type:String})],rC.prototype,"view",2),eN([r({type:String,attribute:"class"})],rC.prototype,"classNames",2),eN([h("classNames",{waitUntilFirstUpdate:!0})],rC.prototype,"handleclassNamesChange",1),rC=eN([re("qti-rubric-block")],rC);var rA=function(){return new Intl.NumberFormat().format(.1).replace(/\d/g,"")},rS=function(t){if(typeof t=="string")return t;var e=rA();return e==="."?t.toLocaleString():t.toString().replace(".","").replace(e,".")};var rq=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}},{key:"checkShowFeedback",value:function t(t){var e=this._context.variables.find(function(e){return e.identifier===t})||null;if(this.outcomeIdentifier!==t||!e)return;var n=!1;Array.isArray(e.value)?n=e.value.includes(this.identifier):n=!U(this.identifier)&&!U(e===null||e===void 0?void 0:e.value)&&this.identifier===e.value||!1,this.showFeedback(n)}},{key:"showFeedback",value:function t(t){this.showStatus=t&&this.showHide==="show"||!t&&this.showHide==="hide"?"on":"off"}}]);return e}(n7);eN([r({type:String,attribute:"show-hide"})],rq.prototype,"showHide",2),eN([r({type:String,attribute:"outcome-identifier"})],rq.prototype,"outcomeIdentifier",2),eN([r({type:String})],rq.prototype,"identifier",2),eN([r({type:String,attribute:!1})],rq.prototype,"showStatus",2),eN([e({context:ra,subscribe:!0}),i()],rq.prototype,"_context",2);var rR=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(J(),this.showStatus)}},{key:"firstUpdated",value:function t(t){this.checkShowFeedback(this.outcomeIdentifier)}}]);return e}(rq);rR.styles=e9(tt()),rR=eN([re("qti-feedback-block")],rR);var rP=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nH(te(),t.showStatus)};return t}return e}(rq);rP.styles=e9(tn()),rP=eN([re("qti-feedback-inline")],rP);var rT=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nH(tr(),t.showStatus)};return t}return e}(rq);rT.styles=e9(ti()),rT=eN([re("qti-modal-feedback")],rT);var r$=function(t){return t!==null&&t!==void 0?t:nF};var rD=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t.responseIdentifier="";t.disabled=!1;t.readonly=!1;t._correctResponse="";t._internals=t.attachInternals();return t}c(e,[{key:"reportValidity",value:function t(){return this._internals.reportValidity()}},{key:"reset",value:function t(){this.value=""}},{key:"correctResponse",get:function t(){return this._correctResponse},set:function t(t){this._correctResponse=t}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"saveResponse",value:function t(t){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(t)?$(t):t}}))}}]);return e}(n7);rD.formAssociated=!0,eN([r({type:String,attribute:"response-identifier"})],rD.prototype,"responseIdentifier",2),eN([r({reflect:!0,type:Boolean})],rD.prototype,"disabled",2),eN([r({reflect:!0,type:Boolean})],rD.prototype,"readonly",2),eN([i()],rD.prototype,"_correctResponse",2);var rU=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._rows=5;t._value="";return t}c(e,[{key:"handleclassNamesChange",value:function t(t,e){var n=this;var r=e.split(" "),i=!1;if(r.forEach(function(t){if(t.startsWith("qti-height-lines-")){var e=t.replace("qti-height-lines-","");n._rows=parseInt(e),i=!0}}),!i&&this.expectedLength){var o=Math.ceil(this.expectedLength/50);this._rows=o}}},{key:"value",get:function t(){return this._value},set:function t(t){if(typeof t=="string"){this._value=t;var e=new FormData;e.append(this.responseIdentifier,t),this._internals.setFormValue(e),this.validate()}else throw new Error("Value must be a string")}},{key:"validate",value:function t(){var t=this.shadowRoot.querySelector("textarea");if(!t)return!1;if(this.patternMask&&this.dataPatternmaskMessage){this._internals.setValidity({}),t.setCustomValidity("");var e=this.patternMask.startsWith("^")&&this.patternMask.endsWith("$")?this.patternMask:"^".concat(this.patternMask,"$"),n=new RegExp(e);t.checkValidity()&&n.test(t.value)||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),t.setCustomValidity(this.dataPatternmaskMessage))}else{var r=t.checkValidity();this._internals.setValidity(r?{}:{customError:!1})}return this._value!==""&&t.checkValidity()}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("textarea");if(!t)return!1;var e=this.validate();return e||t.reportValidity(),e}},{key:"render",value:function t(){var t=this;return nH(ta(),this.responseIdentifier,5e3,function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,function(e){t.reportValidity()},r$(this.placeholderText?this.placeholderText:void 0),this._rows,this.disabled,this.readonly,this._value)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;if(this.setEmptyAttribute(e.value),this._value!==e.value){this.value=e.value;var n=this.validate();this.saveResponse(e.value)}}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}],[{key:"styles",get:function t(){return[e9(to())]}}]);return e}(rD);eN([i()],rU.prototype,"_rows",2),eN([r({type:Number,attribute:"expected-length"})],rU.prototype,"expectedLength",2),eN([r({type:String,attribute:"pattern-mask"})],rU.prototype,"patternMask",2),eN([r({type:String,attribute:"placeholder-text"})],rU.prototype,"placeholderText",2),eN([r({type:String,attribute:"data-patternmask-message"})],rU.prototype,"dataPatternmaskMessage",2),eN([i()],rU.prototype,"_value",2),eN([r({type:String,attribute:"class"})],rU.prototype,"classNames",2),eN([h("classNames")],rU.prototype,"handleclassNamesChange",1),rU=eN([re("qti-extended-text-interaction")],rU);var rM=n4.I;var rI=function(t){return t.strings===void 0},rO=function(){return document.createComment("")},rL=function(t,e,n){var r=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){var o=r.insertBefore(rO(),i),a=r.insertBefore(rO(),i);n=new rM(o,a,t,t.options)}else{var s=n._$AB.nextSibling,u=n._$AM,l=u!==t;if(l){var c;var h;(c=n._$AQ)===null||c===void 0?void 0:c.call(n,t),n._$AM=t,n._$AP!==void 0&&(h=t._$AU)!==u._$AU&&n._$AP(h)}if(s!==i||l){var d=n._$AA;for(;d!==s;){var f=d.nextSibling;r.insertBefore(d,i),d=f}}}return n},rN=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;return t._$AI(e,n),t},rV={},rH=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rV;return t._$AH=e},rj=function(t){return t._$AH},rQ=function(t){var e;(e=t._$AP)===null||e===void 0?void 0:e.call(t,!1,!0);var n=t._$AA,r=t._$AB.nextSibling;for(;n!==r;){var i=n.nextSibling;n.remove(),n=i}};var rB={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},rF=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++){n[r]=arguments[r]}return{_$litDirective$:t,values:n}}},rz=/*#__PURE__*/function(){"use strict";function t(e){s(this,t)}c(t,[{key:"_$AU",get:function t(){return this._$AM._$AU}},{key:"_$AT",value:function t(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}},{key:"_$AS",value:function t(t,e){return this.update(t,e)}},{key:"update",value:function t(t,e){return this.render.apply(this,$(e))}}]);return t}();var rW=function(t,e){var n;var r=t._$AN;if(r===void 0)return!1;var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),u;!(i=(u=s.next()).done);i=true){var l=u.value;(n=l._$AO)===null||n===void 0?void 0:n.call(l,e,!1),rW(l,e)}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return!0},rY=function(t){var e,n;do{if((e=t._$AM)===void 0)break;n=e._$AN,n.delete(t),t=e}while((n===null||n===void 0?void 0:n.size)===0)},rX=function(t){for(var e;e=t._$AM;t=e){var n=e._$AN;if(n===void 0)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),rZ(e)}};var rZ=function(t){var e,n;t.type==rB.CHILD&&((e=t._$AP)!==null&&e!==void 0?e:t._$AP=eC,(n=t._$AQ)!==null&&n!==void 0?n:t._$AQ=ex)},rG=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments),t._$AN=void 0;return t}c(e,[{key:"_$AT",value:function t(t,n,r){d(f(e.prototype),"_$AT",this).call(this,t,n,r),rX(this),this.isConnected=t._$AU}},{key:"_$AO",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;var n,r,i,o;t!==this.isConnected&&(this.isConnected=t,t?(n=(r=this).reconnected)===null||n===void 0?void 0:n.call(r):(i=(o=this).disconnected)===null||i===void 0?void 0:i.call(o)),e&&(rW(this,t),rY(this))}},{key:"setValue",value:function t(t){if(rI(this._$Ct))this._$Ct._$AI(t,this);else{var e=$(this._$Ct._$AH);e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}},{key:"disconnected",value:function t(){}},{key:"reconnected",value:function t(){}}]);return e}(rz);var rK=function(){return new rJ},rJ=function t(){"use strict";s(this,t)},r0=new WeakMap,r1=rF(/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(t){return nF}},{key:"update",value:function t(t,e){var n=q(e,1),r=n[0];var i;var o=r!==this.Y;return o&&this.Y!==void 0&&this.rt(void 0),(o||this.lt!==this.ct)&&(this.Y=r,this.ht=(i=t.options)===null||i===void 0?void 0:i.host,this.rt(this.ct=t.element)),nF}},{key:"rt",value:function t(t){if(this.isConnected||(t=void 0),typeof this.Y=="function"){var e;var n=(e=this.ht)!==null&&e!==void 0?e:globalThis,r=r0.get(n);r===void 0&&(r=new WeakMap,r0.set(n,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}},{key:"lt",get:function t(){var t,e;var n;return typeof this.Y=="function"?(t=r0.get((n=this.ht)!==null&&n!==void 0?n:globalThis))===null||t===void 0?void 0:t.get(this.Y):(e=this.Y)===null||e===void 0?void 0:e.value}},{key:"disconnected",value:function t(){this.lt===this.ct&&this.rt(void 0)}},{key:"reconnected",value:function t(){this.rt(this.ct)}}]);return e}(rG));var r2=e9(ts());var r3=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._value="";t.inputRef=rK();return t}c(e,[{key:"value",get:function t(){return this._value},set:function t(t){if(typeof t=="string"){this._value=t;var e=new FormData;e.append(this.responseIdentifier,t),this._internals.setFormValue(e),this.validate()}else throw new Error("Value must be a string")}},{key:"validate",value:function t(){var t=this.shadowRoot.querySelector("input");if(!t)return!1;if(this.patternMask&&this.dataPatternmaskMessage)this._internals.setValidity({}),t.setCustomValidity(""),t.checkValidity()||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),t.setCustomValidity(this.dataPatternmaskMessage));else{var e=t.checkValidity();this._internals.setValidity(e?{}:{customError:!1})}return this._value!==""&&t.checkValidity()}},{key:"render",value:function t(){var t=this;return nH(tu(),this.responseIdentifier,function(e){t.reportValidity()},function(t){return t.stopImmediatePropagation()},this.textChanged,this.textChanged,this.patternMask=="[0-9]*"?"number":"text",r$(this.placeholderText?this.placeholderText:void 0),this._value,r$(this.patternMask?this.patternMask:void 0),1e3,this.disabled,this.readonly,this._correctResponse)}},{key:"textChanged",value:function t(t){if(this.disabled||this.readonly)return;var e=t.target;if(this.setEmptyAttribute(e.value),this._value!==e.value){this.value=e.value;var n=this.validate();this.saveResponse(e.value)}}},{key:"reportValidity",value:function t(){var t=this.shadowRoot.querySelector("input");if(!t)return!1;var e=this.validate();return e||t.reportValidity(),e}},{key:"reset",value:function t(){this._value=""}},{key:"setEmptyAttribute",value:function t(t){this.setAttribute("empty",t===""?"true":"false")}}]);return e}(rD);r3.styles=r2,eN([r({type:Number,attribute:"expected-length"})],r3.prototype,"expectedLength",2),eN([r({type:String,attribute:"pattern-mask"})],r3.prototype,"patternMask",2),eN([r({type:String,attribute:"placeholder-text"})],r3.prototype,"placeholderText",2),eN([r({type:String,attribute:"data-patternmask-message"})],r3.prototype,"dataPatternmaskMessage",2),eN([i()],r3.prototype,"_value",2),r3=eN([re("qti-text-entry-interaction")],r3);var r4=function(t,e){var n=/*#__PURE__*/function(t){"use strict";p(n,t);function n(){s(this,n);var t;t=a(this,n,arguments);t._choiceElements=[];t.minChoices=0;t.maxChoices=1;t._handleDisabledChange=function(e,n){t._choiceElements.forEach(function(t){return t.disabled=n})};t._handleReadonlyChange=function(e,n){t._choiceElements.forEach(function(t){return t.readonly=n})};t._value="";return t}c(n,[{key:"_handleMaxChoicesChange",value:function t(t,e){this._determineInputType()}},{key:"value",get:function t(){return Array.isArray(this._value)?this._value.join(","):this._value},set:function t(t){var e=this;if(this.maxChoices>1&&typeof t=="string"?this._value=t.split(","):this._value=t,Array.isArray(this._value)){var n=new FormData;this._value.forEach(function(t){n.append(e.responseIdentifier,t)}),this._internals.setFormValue(n)}else this._internals.setFormValue(this._value);this._updateChoiceSelection()}},{key:"correctResponse",get:function t(){return this._correctResponse},set:function t(t){this._correctResponse=t;var e=Array.isArray(t)?t:[t];this._choiceElements.forEach(function(t){t.internals.states.delete("correct-response"),t.internals.states.delete("incorrect-response"),e.length>0&&(e.includes(t.identifier)?t.internals.states.add("correct-response"):t.internals.states.add("incorrect-response"))})}},{key:"connectedCallback",value:function t(){d(f(n.prototype),"connectedCallback",this).call(this),this.addEventListener("register-".concat(e),this._registerChoiceElement),this.addEventListener("unregister-".concat(e),this._unregisterChoiceElement),this.addEventListener("activate-".concat(e),this._choiceElementSelectedHandler)}},{key:"disconnectedCallback",value:function t(){d(f(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-".concat(e),this._registerChoiceElement),this.removeEventListener("unregister-".concat(e),this._unregisterChoiceElement),this.removeEventListener("activate-".concat(e),this._choiceElementSelectedHandler)}},{key:"validate",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}),n=e.length,r=!0,i="";return this.maxChoices!==0&&n>this.maxChoices?(r=!1,i=this.dataset.maxSelectionsMessage||"You can select at most ".concat(this.maxChoices," choices.")):n<this.minChoices&&(r=!1,i=this.dataset.minSelectionsMessage||"You must select at least ".concat(this.minChoices," choices.")),e.length>0&&this._internals.setValidity(r?{}:{customError:!0},i,e[n-1]||this._choiceElements[0]||this),this.reportValidity(),r}},{key:"reportValidity",value:function t(){return this._validationMessageElement&&(this._internals.validity.valid?(this._validationMessageElement.textContent="",this._validationMessageElement.style.display="none"):(this._validationMessageElement.textContent=this._internals.validationMessage,this._validationMessageElement.style.display="block")),this._internals.validity.valid}},{key:"_registerChoiceElement",value:function t(t){t.stopPropagation();var e=t.target;e.disabled=this.disabled,this._choiceElements.push(e),this._setInputType(e)}},{key:"_unregisterChoiceElement",value:function t(t){t.stopPropagation();var e=t.target;this._choiceElements=this._choiceElements.filter(function(t){return t!==e})}},{key:"_determineInputType",value:function t(){var t=this;this._choiceElements.forEach(function(e){t._setInputType(e)})}},{key:"_setInputType",value:function t(t){t.internals.role=this.maxChoices===1?"radio":"checkbox",t.internals.states.add(t.internals.role)}},{key:"_choiceElementSelectedHandler",value:function t(t){var e=this;this._toggleChoiceChecked(t.target),this.maxChoices===1&&this._choiceElements.forEach(function(n){n.identifier!==t.detail.identifier&&e._setChoiceChecked(n,!1)}),this._handleChoiceSelection()}},{key:"_setChoiceChecked",value:function t(t,e){var n;((n=t.internals)===null||n===void 0?void 0:n.states)&&(e?(t.internals.states.add("--checked"),t.internals.ariaChecked="true"):(t.internals.states.delete("--checked"),t.internals.ariaChecked="false"))}},{key:"_getChoiceChecked",value:function t(t){return t.internals.states.has("--checked")}},{key:"_toggleChoiceChecked",value:function t(t){var e=this._getChoiceChecked(t);this._setChoiceChecked(t,!e)}},{key:"_handleChoiceSelection",value:function t(){var t=this;var e=this._choiceElements.filter(function(e){return t._getChoiceChecked(e)}).map(function(t){return t.identifier});this.value=this.maxChoices===1?e[0]||"":e,this.validate(),this.saveResponse(this._value)}},{key:"_updateChoiceSelection",value:function t(){var t=this;var e=Array.isArray(this._value)?this._value:[this._value];this._choiceElements.forEach(function(n){var r=e.includes(n.identifier);t._setChoiceChecked(n,r)})}}]);return n}(t);return eN([u("#validationMessage")],n.prototype,"_validationMessageElement",2),eN([r({type:Number,attribute:"min-choices"})],n.prototype,"minChoices",2),eN([r({type:Number,attribute:"max-choices"})],n.prototype,"maxChoices",2),eN([h("maxChoices",{waitUntilFirstUpdate:!0})],n.prototype,"_handleMaxChoicesChange",1),eN([h("disabled",{waitUntilFirstUpdate:!0})],n.prototype,"_handleDisabledChange",2),eN([h("readonly",{waitUntilFirstUpdate:!0})],n.prototype,"_handleReadonlyChange",2),n};var r5=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.render=function(){return nH(tl())};return t}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("qti-hottext-interaction","")}}]);return e}(r4(rD,"qti-hottext"));r5=eN([re("qti-hottext-interaction")],r5);var r6=/*#__PURE__*/function(t){"use strict";p(e,t);function e(t){s(this,e);var n;if(n=a(this,e,[t]),n.it=nF,t.type!==rB.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}c(e,[{key:"render",value:function t(t){if(t===nF||t==null)return this._t=void 0,this.it=t;if(t===nB)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;var e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}]);return e}(rz);r6.directiveName="unsafeHTML",r6.resultType=1;var r9=rF(r6);var r7=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.options=[];t.correctOption="";t.dataPrompt="select";return t}c(e,[{key:"render",value:function t(){return nH(td(),this.choiceSelected,this.disabled,this.readonly,this.options.map(function(t){return nH(th(),t.value,t.selected,r9(t.textContent))}),r9(this.correctOption))}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("on-dropdown-selected",this.choiceSelected);var t=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1}].concat($(t.map(function(t){return{textContent:t.innerHTML,value:t.getAttribute("identifier"),selected:!1}})))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}},{key:"validate",value:function t(){var t=this.options.find(function(t){return t.selected});return t?t.value!=="":!1}},{key:"reset",value:function t(){this.options=this.options.map(function(t,e){return w(k({},t),{selected:e===0})})}},{key:"value",get:function t(){return this.options.find(function(t){return t.selected}).value},set:function t(t){this.options=this.options.map(function(e){return t===e.value&&(e.selected=!0),e})}},{key:"correctResponse",set:function t(t){if(t===""){this.correctOption="";return}this.correctOption='<span part="correct-option">'.concat(this.options.find(function(e){return t===e.value}).textContent,"</span>")}},{key:"choiceSelected",value:function t(t){var e=t.target.value;this.options=this.options.map(function(t){return w(k({},t),{selected:t.value===e})}),this.saveResponse(e)}}],[{key:"styles",get:function t(){return[e9(tc())]}}]);return e}(rD);r7.inputWidthClass=["","qti-input-width-2","qti-input-width-1","qti-input-width-3","qti-input-width-4","qti-input-width-6","qti-input-width-10","qti-input-width-15","qti-input-width-20","qti-input-width-72"],eN([i()],r7.prototype,"options",2),eN([i()],r7.prototype,"correctOption",2),eN([r({attribute:"data-prompt",type:String})],r7.prototype,"dataPrompt",2),r7=eN([re("qti-inline-choice-interaction")],r7);var r8=function(t,e){var n=/*#__PURE__*/function(t){"use strict";p(n,t);function n(){s(this,n);var t;t=a(this,n,arguments);t._shuffle=!1;return t}c(n,[{key:"shuffle",get:function t(){return this._shuffle},set:function t(t){var e=this._shuffle;this._shuffle=t,t?this._shuffleChoices():this._resetShuffleChoices(),this.requestUpdate("shuffle",e)}},{key:"connectedCallback",value:function t(){d(f(n.prototype),"connectedCallback",this).call(this),this.shuffle?this._shuffleChoices():this._resetShuffleChoices()}},{key:"_shuffleChoices",value:function t(){var t=Array.from(this.querySelectorAll(e)),n=[],r=[];if(t.forEach(function(t,e){t.hasAttribute("fixed")?n.push({element:t,index:e}):r.push(t)}),r.length<=1){console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");return}var i=!1,o=10,a=0,s=$(r);for(;!i&&a<o;){a++;for(var u=r.length-1;u>0;u--){var l=Math.floor(Math.random()*(u+1));var c;c=[r[l],r[u]],r[u]=c[0],r[l]=c[1],c}if(i=!r.every(function(t,e){return t===s[e]}),i)break}i||console.warn("Failed to shuffle the choices after multiple attempts.");var h=1;t.forEach(function(t,e){t.hasAttribute("fixed")?t.style.setProperty("order",String(h++)):r.shift().style.setProperty("order",String(h++))})}},{key:"_resetShuffleChoices",value:function t(){Array.from(this.querySelectorAll("qti-simple-choice")).forEach(function(t,e){t.style.setProperty("order","initial")})}}]);return n}(t);return eN([r({type:String,reflect:!0,converter:it})],n.prototype,"shuffle",1),n},it={fromAttribute:function t(t){return t==="true"},toAttribute:function t(t){return t?"true":"false"}};var ie=function(t,e){var n=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t._classes=[];t._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];t._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"];return t}c(e,[{key:"class",get:function t(){var t;return((t=this._classes)===null||t===void 0?void 0:t.join(" "))||""},set:function t(t){t&&(this._classes=t.split(" "),this._addLabels())}},{key:"updated",value:function t(t){d(f(e.prototype),"updated",this).call(this,t),t.has("shuffle")&&this._addLabels()}},{key:"_addLabels",value:function t(){var t=this;var e=this._classes.some(function(e){return t._allLabels.includes(e)||t._allLabelSuffixes.includes(e)}),n=function(t){return!isNaN(+t)};if(e){var r=Array.from(this.querySelectorAll("qti-simple-choice")).map(function(t){return t}).map(function(t,e){return{el:t,order:n(t.style.order)?+t.style.order:e+1}}).sort(function(t,e){return t.order-e.order}).map(function(t){return t.el});for(var i=0;i<r.length;i++)r[i].marker=this._getLabel(i+1)}}},{key:"_getLabel",value:function t(t){var e=this;var n=this._classes.filter(function(t){return e._allLabels.includes(t)}).pop(),r=this._classes.filter(function(t){return e._allLabelSuffixes.includes(t)}).pop();!n&&r&&(n="qti-labels-upper-alpha");var i="";switch(n){case"qti-labels-decimal":i="".concat(t);break;case"qti-labels-lower-alpha":i="".concat(String.fromCharCode(97+t-1));break;case"qti-labels-upper-alpha":i="".concat(String.fromCharCode(65+t-1));break}return r==="qti-labels-suffix-period"?i+=".":r==="qti-labels-suffix-parenthesis"&&(i+=")"),i}}]);return e}(t);return eN([r({type:String,reflect:!0})],n.prototype,"class",1),n};var ir=e9(tf());var ii=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tp())}}]);return e}(ie(r8(r4(rD,"qti-simple-choice"),"qti-simple-choice"),"qti-simple-choice"));ii.styles=ir,eN([r({type:String})],ii.prototype,"orientation",2),ii=eN([re("qti-choice-interaction")],ii);var io=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tv())}},{key:"process",value:function t(){var t=new ia,e=$(this.children);t.process(e)}}]);return e}(n7);io.styles=[e9(ty())],io=eN([re("qti-outcome-processing")],io);var ia=/*#__PURE__*/function(){"use strict";function t(){s(this,t)}c(t,[{key:"process",value:function t(t){var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;a.process()}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}}}]);return t}();var is='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-match>\n <qti-variable identifier="RESPONSE"></qti-variable>\n <qti-correct identifier="RESPONSE"></qti-correct>\n </qti-match>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">1</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>',iu='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier="RESPONSE"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0.0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-map-response identifier="RESPONSE"> </qti-map-response>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>',il='<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier="RESPONSE"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier="SCORE">\n <qti-base-value base-type="float">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier="SCORE">\n <qti-map-response-point identifier="RESPONSE"></qti-map-response-point>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>';var ic=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tm())}},{key:"process",value:function t(){var t=$(this.children);var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;a.process()}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}}},{key:"firstUpdated",value:function t(t){if(this.getAttribute("template")){var e=this.getAttribute("template").split("/"),n=e[e.length-1].replace(".xml","");switch(this.innerHTML="",n){case"map_response":{this.appendChild(this.fragmentFromString(iu).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(il).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(is).firstElementChild.firstElementChild);break}}}},{key:"fragmentFromString",value:function t(t){return document.createRange().createContextualFragment(t)}}]);return e}(n7);ic.styles=[e9(tg())],ic=eN([re("qti-response-processing")],ic);var ih=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tb())}},{key:"process",value:function t(){throw new Error("Not implemented")}}]);return e}(n7);ih=eN([re("qti-rule")],ih);var id=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"childExpression",get:function t(){return this.firstElementChild}},{key:"process",value:function t(){var t=this.getAttribute("identifier"),e=this.closest("qti-assessment-item").getVariable(t),n;return e.interpolationTable&&(n=e.interpolationTable.get(parseInt(this.childExpression.calculate()))),n==null?(console.warn("lookupOutcomeValue: value is null or undefined"),0):(this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:this.identifier,value:rS(n)}})),n)}}]);return e}(ih);eN([r({type:String})],id.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",id);var ip=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(t_())}},{key:"process",value:function t(){var t=$(this.children);for(var e=0;e<t.length;e++){var n=t[e];if(n.calculate()){n.process();return}}}}]);return e}(ih);customElements.define("qti-response-condition",ip);var iv=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"process",value:function t(){var t=this.getAttribute("identifier"),e=this.firstElementChild,n=new iy(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:Array.isArray(n)?n.map(function(t){return rS(t)}):rS(n)}}))}}]);return e}(ih),iy=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.expression=e}c(t,[{key:"process",value:function t(){var t=this.expression?this.expression.calculate():null;if(t==null){console.warn("setOutcomeValue: value is null or undefined");return}return t}}]);return t}();customElements.define("qti-set-outcome-value",iv);var im=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tk())}},{key:"calculate",value:function t(){return!0}},{key:"getSubRules",value:function t(){return $(this.children)}},{key:"process",value:function t(){var t=this.getSubRules();for(var e=0;e<t.length;e++)t[e].process()}}]);return e}(n7);customElements.define("qti-response-else",im);var ig=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.firstElementChild.calculate()}},{key:"getSubRules",value:function t(){var t=[];for(var e=1;e<this.children.length;e++)t.push(this.children[e]);return t}}]);return e}(im);customElements.define("qti-response-if",ig);var ib=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tE(),d(f(e.prototype),"render",this).call(this))}}]);return e}(ig);customElements.define("qti-response-else-if",ib);var i_=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.getVariables=function(){return Array.from(t.children).map(function(e){switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent.trim(),cardinality:"single"};case"qti-variable":{var n=e.getAttribute("identifier")||"";return t.context.variables.find(function(t){return t.identifier===n})||null}case"qti-multiple":{var r=e.getResult();return r.length>0?{identifier:"",baseType:r[0].baseType,value:r.map(function(t){return t.value}),cardinality:"multiple",type:"response"}:null}case"qti-correct":{var i=e.getAttribute("identifier")||"",o=t.context.variables.find(function(t){return t.identifier===i})||null;return{baseType:o.baseType,value:o.correctResponse,cardinality:o.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(t){console.warn("default not sufficient")}return null}}}).filter(function(t){return t!==null})};return t}c(e,[{key:"render",value:function t(){return nH(tw(),JSON.stringify(this.result,null,2))}},{key:"calculate",value:function t(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function t(){throw new Error("Not implemented")}}]);return e}(n7);i_.styles=e9(tx()),eN([i()],i_.prototype,"result",2),eN([e({context:ra,subscribe:!0}),i()],i_.prototype,"context",2);var ik=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.result=this.getResult(),this.result}},{key:"getResult",value:function t(){throw new Error("Not implemented")}}]);return e}(i_);var iE=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"calculate",value:function t(){return this.calculateChildren(Array.from(this.children))}}]);return e}(eA(ik));customElements.define("qti-and",iE);var iw=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.baseType="string";return t}c(e,[{key:"getResult",value:function t(){return this.textContent.trim()}}]);return e}(i_);eN([r({type:String,attribute:"base-type"})],iw.prototype,"baseType",2);customElements.define("qti-base-value",iw);var ix=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(this.children.length===2){var e=t[0],n=t[1];if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="multiple"){var r=e.value,i=n.value;return r.filter(function(t){return i.includes(t)}).length>0}else if(e.baseType==="directedPair"&&n.baseType==="directedPair"&&e.cardinality==="single"){var o=e.value;return n.value.includes(o)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}}]);return e}(ik);customElements.define("qti-contains",ix);var iC=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"interpretation",get:function t(){return this.getAttribute("interpretation")||""}},{key:"getResult",value:function t(){var t=this.getAttribute("identifier")||"",e=this.context.variables.find(function(e){return e.identifier===t})||null;return e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}}]);return e}(i_);customElements.define("qti-correct",iC);var iA=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.roundingMode="significantFigures";return t}c(e,[{key:"figures",get:function t(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;var t=parseInt(this.getAttribute("figures")||"0");return isNaN(t)?(console.error("figures attribute is not a number"),null):t<0?(console.error("figures attribute is negative"),null):t<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):t}},{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(this.roundingMode===null)return null;if(e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value))return console.error("unexpected cardinality in qti equal"),!1;switch(t[0].baseType){case"integer":case"float":{var r=parseFloat(e.value),i=parseFloat(n.value);if(!isNaN(r)&&!isNaN(i))return this.roundingMode==="significantFigures"?r.toPrecision(this.figures)===i.toPrecision(this.figures):Math.round(r*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(i*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error("value cannot be casted to numeric value in equalRounded operator: ".concat(r,", ").concat(i));break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}}]);return e}(i_);eN([r({type:String})],iA.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",iA);var iS=/*#__PURE__*/function(){"use strict";function t(){s(this,t)}c(t,null,[{key:"compareSingleValues",value:function t(t,e,n){switch(n){case"identifier":case"string":return t===e;case"integer":{var r=parseInt(t,10),i=parseInt(e,10);if(!isNaN(r)&&!isNaN(i))return r===i;console.error("Cannot convert ".concat(t," and/or ").concat(e," to int."));break}case"float":{var o=parseFloat(t),a=parseFloat(e);if(!isNaN(o)&&!isNaN(a))return o===a;console.error("couldn't convert ".concat(t," and/or ").concat(e," to float."));break}case"pair":case"directedPair":{var s=t.split(" ").sort(),u=e.split(" ").sort();if(s.length===2&&u.length===2)return n==="pair"&&(s.sort(),u.sort()),s.join(" ")===u.join(" ");console.error("compared two pair but one of the values does not have 2 values: 1: ".concat(t," 2: ").concat(e));break}}return!1}}]);return t}();var iq=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.toleranceMode="exact";return t}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value)?(console.error("unexpected cardinality in qti equal"),!1):iS.compareSingleValues(e.value,n.value,e.baseType)}return console.error("unexpected number of children in qti-equal"),null}}]);return e}(i_);eN([r({type:String})],iq.prototype,"toleranceMode",2);customElements.define("qti-equal",iq);var iR=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(e.baseType===n.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value>+n.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}}]);return e}(i_);customElements.define("qti-gt",iR);var iP=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return e.baseType===n.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value>=+n.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}}]);return e}(ik);customElements.define("qti-gte",iP);var iT=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===1){var t=this.getVariables();if(!t)return!0;var e=t[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}}]);return e}(i_);customElements.define("qti-is-null",iT);var i$=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(e.baseType===n.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value<+n.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}}]);return e}(i_);customElements.define("qti-lt",i$);var iD=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];return e.baseType===n.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value<=+n.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}}]);return e}(ik);customElements.define("qti-lte",iD);var iU=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this;var e=this.context.variables.find(function(e){return e.identifier===t.identifier});if(!e)return console.warn("Response ".concat(this.identifier," can not be found")),null;var n=e.mapping,r=Array.isArray(e.value)?e.value:[e.value],i=0;var o=true,a=false,s=undefined;try{var u=function(){var t=c.value;var r=n.mapEntries.find(function(n){return iS.compareSingleValues(n.mapKey,t,e.baseType)});r==null||r.mappedValue==null?i+=n.defaultValue:i+=r.mappedValue};for(var l=r[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true)u()}catch(t){a=true;s=t}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw s}}}return n.lowerBound!=null&&(i=Math.max(n.lowerBound,i)),n.upperBound!=null&&(i=Math.min(n.upperBound,i)),i}}]);return e}(i_);eN([r({type:String})],iU.prototype,"identifier",2);customElements.define("qti-map-response",iU);var iM=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.defaultValue=0;return t}c(e,[{key:"mapEntries",get:function t(){return Array.from(this.querySelectorAll("qti-map-entry")).map(function(t){return{mapKey:t.getAttribute("map-key"),mappedValue:+t.getAttribute("mapped-value")}})}}]);return e}(n7);eN([r({attribute:"default-value",type:Number})],iM.prototype,"defaultValue",2),eN([r({attribute:"lower-bound",type:Number})],iM.prototype,"lowerBound",2),eN([r({attribute:"upper-bound",type:Number})],iM.prototype,"upperBound",2);customElements.define("qti-mapping",iM);var iI=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),n=t[0],r=t[1];return e.match(n,r)}return console.error("unexpected number of children in match"),null}}],[{key:"match",value:function t(t,e){switch(e.cardinality){case"single":var n;return t.value===null?!1:Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):iS.compareSingleValues((n=t.value)===null||n===void 0?void 0:n.toString(),e.value.toString(),e.baseType);case"ordered":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;for(var r=0;r<t.value.length;r++)if(!iS.compareSingleValues(e.value[r],t.value[r],e.baseType))return!1;return!0}case"multiple":{if(!Array.isArray(t.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(t.value.length!==e.value.length)return!1;var i=0;var o=true,a=false,s=undefined;try{for(var u=e.value[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true){var c=l.value;var h=null,d=$(t.value);var f=true,p=false,v=undefined;try{for(var y=d[Symbol.iterator](),m;!(f=(m=y.next()).done);f=true){var g=m.value;if(iS.compareSingleValues(c,g,e.baseType)){h=g;break}}}catch(t){p=true;v=t}finally{try{if(!f&&y.return!=null){y.return()}}finally{if(p){throw v}}}if(h!==null)d.splice(d.indexOf(h),1);else return!1;i++}}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}}]);return e}(i_);customElements.define("qti-match",iI);var iO=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");var e=q(t,2),n=e[0],r=e[1];if(n.baseType!==r.baseType&&console.warn("Which must both have the same base-type"),r.cardinality==="multiple"||r.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(n.baseType==="float"||r.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(n.baseType==="duration"||r.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),n.value===null||r.value===null)return null;var i=n.value;return r.value.includes(i)}}]);return e}(i_);customElements.define("qti-member",iO);var iL=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;if(a.cardinality!=="multiple"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[]}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}return t}}]);return e}(i_);customElements.define("qti-multiple",iL);var iN=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tC(),d(f(e.prototype),"render",this).call(this))}},{key:"getResult",value:function t(){return!this.firstElementChild.calculate()}}]);return e}(i_);customElements.define("qti-not",iN);var iV=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){return Array.from(this.children).map(function(t){var e=t;if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var n=e.calculate(),r=!1;if(typeof n=="string")if(n==="true")r=!0;else if(n==="false")r=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(r=n);return r}).some(function(t){return typeof t=="boolean"&&t})}}]);return e}(ik);customElements.define("qti-or",iV);var iH=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;var e=true,n=false,r=undefined;try{for(var i=t[Symbol.iterator](),o;!(e=(o=i.next()).done);e=true){var a=o.value;if(a.cardinality!=="ordered"&&a.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[]}}catch(t){n=true;r=t}finally{try{if(!e&&i.return!=null){i.return()}}finally{if(n){throw r}}}return t}}]);return e}(i_);customElements.define("qti-ordered",iH);var ij=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){var t=this;var e,n;var r=(n=this.context)===null||n===void 0?void 0:(e=n.variables.find(function(e){return e.identifier===t.identifier}))===null||e===void 0?void 0:e.value;return nH(tA(),JSON.stringify(r,null,2))}},{key:"calculate",value:function t(){var t=this;return this.context.variables.find(function(e){return e.identifier===t.identifier})||null}}]);return e}(n7);eN([r({type:String})],ij.prototype,"identifier",2),eN([e({context:ra,subscribe:!0}),i()],ij.prototype,"context",2);customElements.define("qti-printed-variable",ij);var iQ=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){return this.getVariables().reduce(function(t,e){if(e.baseType=="float"||e.baseType=="integer")try{return t*parseInt(e.value.toString())}catch(t){console.warn("can not convert to number")}else console.warn("has another baseType ".concat(e.baseType));return t},1)}}]);return e}(i_);customElements.define("qti-product",iQ);var iB=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.caseSensitive="true";return t}c(e,[{key:"getResult",value:function t(){if(this.children.length===2){var t=this.getVariables(),e=t[0],n=t[1];if(e.cardinality!=="single"||n.cardinality!=="single"||Array.isArray(e.value)||Array.isArray(n.value))return console.error("unexpected cardinality in qti string-match"),!1;var r=this.caseSensitive==="true"?e.value:e.value.toLowerCase(),i=this.caseSensitive==="true"?n.value:n.value.toLowerCase();return iS.compareSingleValues(r,i,e.baseType)}return console.error("unexpected number of children in qti-string-match"),null}}]);return e}(i_);eN([r({type:String,attribute:"case-sensitive"})],iB.prototype,"caseSensitive",2);customElements.define("qti-string-match",iB);var iF=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e),t._expression=new iz(Array.from(t.children));return t}c(e,[{key:"getResult",value:function t(){return this._expression.calculate()}}]);return e}(i_),iz=/*#__PURE__*/function(){"use strict";function t(e){s(this,t);this.expressions=e}c(t,[{key:"calculate",value:function t(){return this.expressions.map(function(t){if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;var e=t.calculate();return Number.isNaN(e)?(console.error("unexpected value in qti-sum, expected number"),null):Number(e)}).reduce(function(t,e){return t+e},0)}}]);return t}();customElements.define("qti-sum",iF);var iW=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"getResult",value:function t(){var t=this.getAttribute("identifier");return this.context.variables.find(function(e){return e.identifier===t}).value}}]);return e}(i_);customElements.define("qti-variable",iW);var iY=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;var n;t=a(this,e,arguments),n=t;t._errorMessage=null;t.loadConfig=/*#__PURE__*/function(){var t=o(function(t,e){var r,i,o,a;return O(this,function(o){switch(o.label){case 0:t=n.removeDoubleSlashes(t);o.label=1;case 1:o.trys.push([1,5,,6]);return[4,fetch(t)];case 2:r=o.sent();if(!r.ok)return[3,4];return[4,r.json()];case 3:i=o.sent();for(var s in i.paths)e&&(i.paths[s]=n.getResolvablePath(i.paths[s],e));return[2,i];case 4:return[3,6];case 5:a=o.sent();return[3,6];case 6:return[2,null]}})});return function(e,n){return t.apply(this,arguments)}}();t.getResolvablePathString=function(e,n){return e=e.replace(/\.js$/,""),(e===null||e===void 0?void 0:e.toLocaleLowerCase().startsWith("http"))||!n?e:t.removeDoubleSlashes("".concat(n,"/").concat(e))};t.getResolvablePath=function(e,n){return Array.isArray(e)?e.map(function(e){return t.getResolvablePathString(e,n)}):t.getResolvablePathString(e,n)};return t}c(e,[{key:"convertQtiVariableJSON",value:function t(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n){for(var r in n)if(n.hasOwnProperty(r)){var i=n[r];if(Array.isArray(i))return i.map(String);if(i!=null)return String(i)}}}return null}},{key:"startChecking",value:function t(){var t=this;this.intervalId=setInterval(function(){var e=t.pci.getResponse(),n=t.pci.getResponse(),r=JSON.stringify(e);if(r!==t.rawResponse){t.rawResponse=r;var i=t.convertQtiVariableJSON(n);t.value=i,t.saveResponse(i)}},200)}},{key:"stopChecking",value:function t(){this.intervalId!==void 0&&clearInterval(this.intervalId)}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return this.rawResponse},set:function t(t){}},{key:"getTAOConfig",value:function t(t){var e=t.querySelectorAll("properties"),n={},r=function(t){var e={},n=t.getAttribute("key");if(n){var r=Array.from(t.children),o=r.map(function(t){return t.getAttribute("key")});o.length>0&&!o.find(function(t){return!Number.isInteger(+t)})?e[n]=r.map(function(t){return i(t)}):e[n]=t.textContent}return e},i=function(t){if(t){var e={};var n=true,i=false,o=undefined;try{for(var a=t.children[Symbol.iterator](),s;!(n=(s=a.next()).done);n=true){var u=s.value;e=k({},e,r(u))}}catch(t){i=true;o=t}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(i){throw o}}}return e}};var o=true,a=false,s=undefined;try{for(var u=e[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true){var c=l.value;return c.getAttribute("key")||(n=k({},n,i(c))),n}}catch(t){a=true;s=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return console.log("Can not find qti-custom-interaction config"),null}},{key:"register",value:function t(t){this.pci=t;var e=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",n=e=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");n.classList.add("qti-customInteraction"),e=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");var r=e=="IMS"?{properties:this.dataset,onready:function(){console.log("onready")}}:this.getTAOConfig(this);e=="IMS"?t.getInstance(n,r,void 0):t.initialize(this.customInteractionTypeIdentifier,n.firstElementChild,r),e=="TAO"&&Array.from(this.querySelectorAll("link")).map(function(t){return t.getAttribute("href")}).forEach(function(t){var e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.media="screen",e.href=t,n.appendChild(e)}),this.startChecking()}},{key:"connectedCallback",value:function t(){var t=this;d(f(e.prototype),"connectedCallback",this).call(this),define("qtiCustomInteractionContext",function(){return{register:function(e){t.register(e)},notifyReady:function(){}}});var n=this.buildRequireConfig();requirejs.config(n)(["require"],function(e){e([t.module])})}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),requirejs.undef(this.customInteractionTypeIdentifier);var t=requirejs.s.contexts;delete t[this.customInteractionTypeIdentifier],this.stopChecking()}},{key:"buildRequireConfig",value:function t(){var t={context:this.customInteractionTypeIdentifier,catchError:!0,paths:window.requirePaths||{},shim:window.requireShim||{}};if(!globalThis.require)return this._errorMessage="RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js",null;var e=this.getAttribute("data-base-url"),n=this.querySelector("qti-interaction-modules");if(n){var r=n.querySelectorAll("qti-interaction-module");var i=true,o=false,a=undefined;try{for(var s=r[Symbol.iterator](),u;!(i=(u=s.next()).done);i=true){var l=u.value;var c=l.getAttribute("id"),h=l.getAttribute("primary-path"),d=l.getAttribute("fallback-path");if(c&&h){var f=d?this.combineRequireResolvePaths(this.getResolvablePath(h,e),this.getResolvablePath(d,e)):this.getResolvablePath(h,e),p=t.paths[c]||[];t.paths[c]=this.combineRequireResolvePaths(p,f)}}}catch(t){o=true;a=t}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}}return t}},{key:"combineRequireResolvePaths",value:function t(t,e){var n=Array.isArray(t)?t:[t],r=Array.isArray(e)?e:[e];return n.concat(r)}},{key:"removeDoubleSlashes",value:function t(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}},{key:"render",value:function t(){return nH(tq(),this._errorMessage&&nH(tS(),this._errorMessage))}}]);return e}(rD);eN([r({type:String,attribute:"module"})],iY.prototype,"module",2),eN([r({type:String,attribute:"custom-interaction-type-identifier"})],iY.prototype,"customInteractionTypeIdentifier",2),eN([i()],iY.prototype,"_errorMessage",2),iY=eN([re("qti-portable-custom-interaction")],iY);var iX=/*#__PURE__*/function(){"use strict";function t(){s(this,t);this.touchStartTime=0;this.touchStartPoint=null;this.lastClickTime=0;this.isDraggable=!1;this.dragSource=null;this.dragClone=null;this.touchEndTriggered=!1;this.isDragging=!1;this.initialTransform="";this.hasDispatchedDragStart=!1;this.rootNode=null;this.focusedElement=null;this.focusableDropZones=[];this.currentDropZoneIndex=-1;this.dataTransfer={data:{},setData:function t(t,e){this.data[t]=e},getData:function t(t){return this.data[t]},effectAllowed:"move"};this.cloneOffset={x:0,y:0};this.lastTarget=null;this.currentDropTarget=null;this.allowClick=!0;this.copyStylesForDragClone=!0;this.dragOnClickEnabled=!1;this.useDragClone=!1;this.MIN_DRAG_DISTANCE=5;this.DRAG_CLONE_OPACITY=1;if(t.instance)return t.instance;t.instance=this,document.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("mousemove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("touchend",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("mouseup",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("touchcancel",this.handleTouchCancel.bind(this),{passive:!1}),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("keyup",this.handleKeyUp.bind(this))}c(t,[{key:"addDraggableElements",value:function t(t){var e=this;t.forEach(function(t){t.setAttribute("tabindex","0"),t.addEventListener("focus",function(){return e.focusedElement=t}),t.addEventListener("blur",function(){return e.focusedElement=null}),t.addEventListener("touchstart",e.handleTouchStart.bind(e),{passive:!1}),t.addEventListener("mousedown",e.handleTouchStart.bind(e),{passive:!1})})}},{key:"handleTouchStart",value:function t(t){this.touchStartTime=Date.now();var e=this.getEventCoordinates(t),n=e.x,r=e.y;if(this.touchStartPoint={x:n,y:r},this.dragSource=t.currentTarget,this.isDraggable=!0,this.rootNode=this.dragSource.getRootNode(),this.dragOnClickEnabled&&(this.isDragging=!0,this.createDragClone(t,{clientX:n,clientY:r})),!this.useDragClone){var i=window.getComputedStyle(this.dragSource);this.initialTransform=i.transform==="none"?"":i.transform,this.initialTransition=i.transition||"",this.dragSource.style.transition="none";var o=this.dragSource.getBoundingClientRect();this.cloneOffset.x=n-o.left,this.cloneOffset.y=r-o.top,this.dragSource.style.zIndex="9999",this.dragSource.focus()}t.preventDefault()}},{key:"handleTouchMove",value:function t(t){if(this.isDraggable&&this.dragSource){var e=this.getEventCoordinates(t),n=e.x,r=e.y,i={clientX:n,clientY:r};this.calculateDragDistance(i)>=this.MIN_DRAG_DISTANCE&&(this.dragSource.style.pointerEvents="none",this.isDragging=!0),this.createDragClone(t,i),t.preventDefault()}}},{key:"createDragClone",value:function t(t,e){if(!this.isDragging)return;if(this.useDragClone){if(!this.dragClone){if(this.dragSource.style.opacity=this.DRAG_CLONE_OPACITY.toString(),this.dragClone=this.dragSource.cloneNode(!0),this.copyStylesForDragClone){var n=window.getComputedStyle(this.dragSource);var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;this.dragClone.style[u]=n.getPropertyValue(u)}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}v(this.rootNode,ShadowRoot)?this.rootNode.host.appendChild(this.dragClone):v(this.rootNode,Document)&&document.body.appendChild(this.dragClone),this.calculateClonePosition(e),this.setDragCloneStyles(e),this.dispatchCustomEvent(this.dragSource,"dragstart")}this.updateDragClonePosition(e)}else if(this.touchStartPoint){var l=e.clientX-this.touchStartPoint.x,c=e.clientY-this.touchStartPoint.y;this.dragSource.style.transform="".concat(this.initialTransform," translate(").concat(l,"px, ").concat(c,"px)"),this.hasDispatchedDragStart||(this.dispatchCustomEvent(this.dragSource,"dragstart"),this.hasDispatchedDragStart=!0)}var h=this.findDropTarget(t);h!==this.lastTarget&&(this.dispatchCustomEvent(h,"dragenter"),this.dispatchCustomEvent(this.lastTarget,"dragleave"),this.lastTarget=h),this.currentDropTarget=h,this.currentDropTarget&&this.dispatchCustomEvent(h,"dragover")}},{key:"handleTouchEnd",value:function t(t){this.touchEndTriggered=!0,this.isDraggable=!1;var e=!1;if(this.currentDropTarget)this.dispatchCustomEvent(this.currentDropTarget,"drop"),this.dispatchCustomEvent(this.dragSource,"dragend"),e=!0;else if(this.isDragging){var n;var r=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});r.dataTransfer={dropEffect:"none"},(n=this.dragSource)===null||n===void 0?void 0:n.dispatchEvent(r)}this.resetDragState(e)}},{key:"handleTouchCancel",value:function t(t){this.resetDragState()}},{key:"findDropTarget",value:function t(t){var e=this.getEventCoordinates(t),n=e.x,r=e.y;return this.getDropTargetAtPoint(document,n,r)}},{key:"getDropTargetAtPoint",value:function t(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r>2)return null;var i=t.elementFromPoint(e,n);if(!i)return null;if(i.hasAttribute("dropzone"))return i;var o=i.parentElement;for(;o;){if(o.hasAttribute("dropzone"))return o;o=o.parentElement}if(i.shadowRoot&&r<2){var a=this.getDropTargetAtPoint(i.shadowRoot,e,n,r+1);if(a)return a}return null}},{key:"handleKeyDown",value:function t(t){this.focusedElement&&(t.key===" "&&!this.isDragging?(t.preventDefault(),this.isDraggable=!0,this.dragSource=this.focusedElement,this.isDragging=!0,this.collectDropZones(),this.dispatchCustomEvent(this.dragSource,"dragstart")):t.key==="Tab"&&this.isDragging&&(t.preventDefault(),this.moveToNextDropZone()))}},{key:"handleKeyUp",value:function t(t){t.key===" "&&this.isDragging&&this.currentDropTarget&&(t.preventDefault(),this.dispatchCustomEvent(this.currentDropTarget,"drop"),this.dispatchCustomEvent(this.dragSource,"dragend"),this.resetDragState(!0))}},{key:"collectDropZones",value:function t(){this.focusableDropZones=Array.from(document.querySelectorAll("[dropzone]")),this.currentDropZoneIndex=-1}},{key:"moveToNextDropZone",value:function t(){if(this.focusableDropZones.length===0)return;this.currentDropZoneIndex=(this.currentDropZoneIndex+1)%this.focusableDropZones.length;var t=this.focusableDropZones[this.currentDropZoneIndex];t.focus(),this.currentDropTarget=t,this.dispatchCustomEvent(t,"dragenter")}},{key:"getEventCoordinates",value:function t(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=t.touches?t.touches[0]:t;return{x:e?n.pageX:n.clientX,y:e?n.pageY:n.clientY}}},{key:"calculateClonePosition",value:function t(t){var e=this.dragSource.getBoundingClientRect();this.cloneOffset.x=t.clientX-e.left,this.cloneOffset.y=t.clientY-e.top}},{key:"setDragCloneStyles",value:function t(t){this.dragClone.style.position="fixed",this.dragClone.style.top="".concat(t.clientY-this.cloneOffset.y,"px"),this.dragClone.style.left="".concat(t.clientX-this.cloneOffset.x,"px"),this.dragClone.style.pointerEvents="none",this.dragClone.style.zIndex="999999"}},{key:"updateDragClonePosition",value:function t(t){var e=this;requestAnimationFrame(function(){if(e.touchEndTriggered||!e.dragClone)return;var n=t.clientX-e.cloneOffset.x,r=t.clientY-e.cloneOffset.y,i=e.applyBoundaries(n,r,e.dragClone),o=i.newLeft,a=i.newTop;e.dragClone.style.left="".concat(o,"px"),e.dragClone.style.top="".concat(a,"px")})}},{key:"applyTransformBoundaries",value:function t(t,e){var n;v(this.rootNode,ShadowRoot)?n=this.rootNode.host.getBoundingClientRect():v(this.rootNode,Document)?n=document.documentElement.getBoundingClientRect():n=new DOMRect(0,0,window.innerWidth,window.innerHeight);var r=this.dragSource.getBoundingClientRect(),i=r.width,o=r.height,a=r.left+t,s=r.top+e,u=Math.max(n.left,Math.min(a,n.right-i)),l=Math.max(n.top,Math.min(s,n.bottom-o)),c=u-r.left,h=l-r.top;return{boundedDeltaX:c,boundedDeltaY:h}}},{key:"applyBoundaries",value:function t(t,e,n){var r;v(this.rootNode,ShadowRoot)?r=this.rootNode.host.getBoundingClientRect():v(this.rootNode,Document)?r=document.documentElement.getBoundingClientRect():r=new DOMRect(0,0,window.innerWidth,window.innerHeight);var i=n.getBoundingClientRect(),o=i.width,a=i.height,s=Math.max(r.left,Math.min(t,r.right-o)),u=Math.max(r.top,Math.min(e,r.bottom-a));return{newLeft:s,newTop:u}}},{key:"calculateDragDistance",value:function t(t){var e=Math.abs(t.clientX-this.touchStartPoint.x),n=Math.abs(t.clientY-this.touchStartPoint.y);return e+n}},{key:"dispatchCustomEvent",value:function t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t)return;var r=new CustomEvent(e,{bubbles:n,cancelable:!0});r.dataTransfer=this.dataTransfer,t.dispatchEvent(r)}},{key:"resetDragState",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var e;this.isDragging&&(this.useDragClone?(this.dragSource.style.opacity="1.0",(e=this.dragClone)===null||e===void 0?void 0:e.parentElement.removeChild(this.dragClone)):(t||(this.dragSource.style.transform="translate(0, 0)"),this.dragSource.style.zIndex="",this.dragSource.style.pointerEvents="",this.dragSource.style.transition=this.initialTransition,this.initialTransition="")),this.isDragging=!1,this.dragSource=null,this.dragClone=null,this.isDraggable=!1,this.touchStartTime=0,this.touchStartPoint=null,this.touchEndTriggered=!1,this.dataTransfer={data:{},setData:function t(t,e){this.data[t]=e},getData:function t(t){return this.data[t]},effectAllowed:"move"},this.cloneOffset={x:0,y:0},this.lastTarget=null,this.currentDropTarget=null,this.allowClick=!0,this.initialTransform="",this.hasDispatchedDragStart=!1,this.rootNode=null}}]);return t}();var iZ=function(t,e,n){var i=/*#__PURE__*/function(t){"use strict";p(r,t);function r(){s(this,r);var t;t=a(this,r,arguments);t.disabled=!1;return t}c(r,[{key:"firstUpdated",value:function t(t){var e=this;if(this.isMatchTabular())return;d(f(r.prototype),"firstUpdated",this).call(this,t);var n=this.getDroppableElements();this.initializeEventHandlers(),n.forEach(function(t){e.prepareDroppable(t),e.observeDroppableAttributes(t)})}},{key:"isMatchTabular",value:function t(){return this.classList.contains("qti-match-tabular")}},{key:"getDroppableElements",value:function t(){return Array.from(e?this.shadowRoot.querySelectorAll(n):this.querySelectorAll(n))}},{key:"initializeEventHandlers",value:function t(){this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this)}},{key:"prepareDroppable",value:function t(t){t.setAttribute("dropzone","move"),t.addEventListener("dragleave",this.dragleaveHandler),this.attachEventListeners(t)}},{key:"observeDroppableAttributes",value:function t(t){var e=this;this.observer=new MutationObserver(function(n){n.forEach(function(n){var r=n.attributeName;r==="disabled"&&e.toggleDroppableHandlers(t)})}),this.observer.observe(t,{attributes:!0})}},{key:"toggleDroppableHandlers",value:function t(t){t.hasAttribute("disabled")?this.removeEventListeners(t):this.attachEventListeners(t)}},{key:"attachEventListeners",value:function t(t){t.addEventListener("dragover",this.dragoverHandler),t.addEventListener("dragenter",this.dragenterHandler),t.addEventListener("drop",this.dropHandler)}},{key:"removeEventListeners",value:function t(t){t.removeEventListener("dragover",this.dragoverHandler),t.removeEventListener("dragenter",this.dragenterHandler),t.removeEventListener("drop",this.dropHandler)}},{key:"disconnectedCallback",value:function t(){var t;this.isMatchTabular()||(d(f(r.prototype),"disconnectedCallback",this).call(this),(t=this.observer)===null||t===void 0?void 0:t.disconnect())}},{key:"dragenterHandler",value:function t(t){t.preventDefault()}},{key:"dragoverHandler",value:function t(t){return t.preventDefault(),this.activateDroppable(t.currentTarget),t.dataTransfer.dropEffect="move",!1}},{key:"activateDroppable",value:function t(t){t.setAttribute("active","")}},{key:"dropHandler",value:function t(t){var e=this;return o(function(){var n,r,i,o,a;return O(this,function(s){switch(s.label){case 0:t.preventDefault();n=t.currentTarget,r=t.dataTransfer.getData("text"),i=e.findDraggable(r);if(!i)return[3,4];if(!(i&&!e.isValidDrop(n,i)))return[3,1];a=(i.style.transform="translate(0, 0)",!1);return[3,3];case 1:return[4,e.moveDraggableToDroppable(i,n)];case 2:a=(s.sent(),e.deactivateDroppable(n),!1);s.label=3;case 3:o=a;return[3,5];case 4:o=!1;s.label=5;case 5:return[2,o]}})})()}},{key:"findDraggable",value:function t(t){return t?this.querySelector("[identifier=".concat(t,"]"))||this.shadowRoot.querySelector("[identifier=".concat(t,"]")):null}},{key:"isValidDrop",value:function t(t,e){return e.parentElement.getAttribute("identifier")!==t.getAttribute("identifier")}},{key:"moveDraggableToDroppable",value:function t(t,e){var n=this;return o(function(){var r;return O(this,function(i){switch(i.label){case 0:r=function(){t.style.transform="translate(0, 0)",e.appendChild(t),n.checkMaxAssociations(),n.saveResponse(null)};if(!document.startViewTransition){r();return[2]}return[4,document.startViewTransition(r).finished];case 1:i.sent();return[2]}})})()}},{key:"deactivateDroppable",value:function t(t){t.removeAttribute("active")}},{key:"dragleaveHandler",value:function t(t){return t.preventDefault(),this.deactivateDroppable(t.currentTarget),t.dataTransfer.dropEffect="none",!1}}]);return r}(t);return eN([r({type:Boolean,reflect:!0})],i.prototype,"disabled",2),i};var iG=function(t,e,n){var r=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(t);return r};var iK=function(t,e,n,i){var u=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;var n;t=a(this,e,arguments),n=t;t.draggables=new Map;t.droppables=[];t.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};t.minAssociations=1;t.maxAssociations=1;t.handleDragStart=function(e){var n=e.currentTarget;e.dataTransfer.setData("text",n.getAttribute("identifier")),n.setAttribute("dragging",""),t.activateDroppables()};t.handleDragEnd=/*#__PURE__*/function(){var t=o(function(t){var e;return O(this,function(r){switch(r.label){case 0:t.preventDefault(),n.deactivateDroppables();e=t.currentTarget;e.removeAttribute("dragging");return[4,n.wasDropped(t)];case 1:r.sent()||n.configuration.dragCanBePlacedBack&&n.restoreInitialDraggablePosition(e);return[2]}})});return function(e){return t.apply(this,arguments)}}();t.checkForMoveTestItem=function(t){return t.dataTransfer.items?new Promise(function(e){var n=!1,r=Array.from(t.dataTransfer.items),i=r.length;if(i===0){e(!1);return}r.forEach(function(t){t.kind==="string"&&t.type==="text"?t.getAsString(function(t){t==="move-test"&&(n=!0),i===0&&e(n)}):i===0&&e(n)})}):Promise.resolve(!1)};return t}c(e,[{key:"handleDraggablesChange",value:function t(t,e){if(this.isMatchTabular())return;var n=this.filterExistingDraggables(t);n.length>0&&this.addNewDraggables(n)}},{key:"firstUpdated",value:function t(t){d(f(e.prototype),"firstUpdated",this).call(this,t),this.initializeDroppables()}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.initializeDragDropApi()}},{key:"initializeDragDropApi",value:function t(){this.dragDropApi=new iX,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}},{key:"isMatchTabular",value:function t(){return this.classList.contains("qti-match-tabular")}},{key:"filterExistingDraggables",value:function t(t){var e=this;return t.filter(function(t){return!e.draggables.has(t)})}},{key:"addNewDraggables",value:function t(t){var e=this;this.dragDropApi.addDraggableElements(t),t.forEach(function(t){return e.storeDraggable(t)})}},{key:"storeDraggable",value:function t(t){var e=Array.from(t.parentNode.children).indexOf(t);this.draggables.set(t,{parent:t.parentElement,index:e}),t.style.viewTransitionName="drag-".concat(e,"-").concat(this.getAttribute("identifier")||crypto.randomUUID()),t.setAttribute("qti-draggable","true"),t.addEventListener("dragstart",this.handleDragStart),t.addEventListener("dragend",this.handleDragEnd)}},{key:"initializeDroppables",value:function t(){this.droppables=Array.from(n?this.shadowRoot.querySelectorAll(i):this.querySelectorAll(i))}},{key:"activateDroppables",value:function t(){this.droppables.forEach(function(t){return t.setAttribute("enabled","")})}},{key:"deactivateDroppables",value:function t(){this.droppables.forEach(function(t){return t.removeAttribute("enabled")})}},{key:"wasDropped",value:function t(t){var e=this;return o(function(){var n;return O(this,function(r){switch(r.label){case 0:return[4,e.checkForMoveTestItem(t)];case 1:n=r.sent();return[2,t.dataTransfer.dropEffect!=="none"||n]}})})()}},{key:"wasMoved",value:function t(t){return t.dataTransfer.dropEffect==="move"}},{key:"restoreInitialDraggablePosition",value:function t(t){var e=this;return o(function(){var n,r,i,o,a,s;return O(this,function(u){n=e.draggables.get(t),r=n.parent,i=n.index,o=Math.min(i,r.children.length),a=function(t,n,r){var i=Math.min(r,n.children.length);n.insertBefore(t,n.children[i]),t.style.transform="translate(0, 0)",e.checkMaxAssociations()};if(!document.startViewTransition){a(t,r,i);return[2]}s=document.startViewTransition(function(){t.style.transform="",a(t,r,i)});return[2]})})()}},{key:"checkMaxAssociations",value:function t(){var t=this;this.droppables.forEach(function(e,n){var r=+(e.getAttribute("match-max")||1);e.querySelectorAll('[qti-draggable="true"]').length>=r?t.disableDroppable(e):t.enableDroppable(e)})}},{key:"disableDroppable",value:function t(t){t.setAttribute("disabled",""),t.removeAttribute("dropzone")}},{key:"enableDroppable",value:function t(t){t.removeAttribute("disabled"),t.setAttribute("dropzone","move")}},{key:"value",get:function t(){return this.collectResponseData()},set:function t(t){var e=this;this.isMatchTabular()||(this.resetDroppables(),t===null||t===void 0?void 0:t.forEach(function(t){return e.placeResponse(t)}))}},{key:"placeResponse",value:function t(t){var e=this;var n=T(t.split(" ").reverse()),r=n[0],i=n.slice(1),o=this.findDroppableById(r);i.forEach(function(t){return e.placeDraggableInDroppable(t,o)})}},{key:"findDroppableById",value:function t(t){return this.droppables.find(function(e){return e.getAttribute("identifier")===t})}},{key:"placeDraggableInDroppable",value:function t(t,e){var n=this;return o(function(){var r,i,o;return O(this,function(a){switch(a.label){case 0:r=n.querySelector("[identifier=".concat(t,"]"));if(!e||!r){console.error("Cannot find draggable or droppable with the given identifier: ".concat(t));return[2]}i=function(){r.style.transform="translate(0, 0)",e.appendChild(r),n.checkMaxAssociations()};if(!document.startViewTransition)return[3,2];return[4,document.startViewTransition(i).finished];case 1:o=a.sent();return[3,3];case 2:o=i();a.label=3;case 3:o;return[2]}})})()}},{key:"validate",value:function t(){var t=this.getValidAssociations();return this.minAssociations<=0||this.minAssociations<=t}},{key:"getValidAssociations",value:function t(){return this.droppables.filter(function(t){return t.childElementCount>0}).length}},{key:"saveResponse",value:function t(){var t=this.collectResponseData();this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:t}}))}},{key:"collectResponseData",value:function t(){return this.droppables.map(function(t){var e=t.querySelectorAll('[qti-draggable="true"]'),n=Array.from(e).map(function(t){return t.getAttribute("identifier")}),r=t.getAttribute("identifier");return n.map(function(t){return"".concat(t," ").concat(r)})}).flat()}},{key:"reset",value:function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.resetDroppables(),t&&this.saveResponse()}},{key:"resetDroppables",value:function t(){var t=this;return o(function(){var e;return O(this,function(n){switch(n.label){case 0:e=function(t,e,n){t.style.transform="translate(0, 0)";var r=Math.min(n,e.children.length);e.insertBefore(t,e.children[r])};if(!document.startViewTransition){t.draggables.forEach(function(t,n){var r=t.parent,i=t.index;e(n,r,i)});return[2]}return[4,document.startViewTransition(function(){t.draggables.forEach(function(t,n){var r=t.parent,i=t.index;e(n,r,i)})}).finished];case 1:n.sent();return[2]}})})()}}]);return e}(iG(iZ(t,n,i),i,e));return eN([r({attribute:!1,type:Object})],u.prototype,"configuration",2),eN([r({type:Number,reflect:!0,attribute:"min-associations"})],u.prototype,"minAssociations",2),eN([r({type:Number,reflect:!0,attribute:"max-associations"})],u.prototype,"maxAssociations",2),eN([eS(e)],u.prototype,"handleDraggablesChange",1),u};var iJ=e9(tR());var i0=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t._childrenMap=[];t._registerChoiceHandler=t._registerChoice.bind(t),t.addEventListener("register-qti-simple-associable-choice",t._registerChoiceHandler);return t}c(e,[{key:"_registerChoice",value:function t(t){var e=t.target;this._childrenMap.push(e)}},{key:"render",value:function t(){return nH(tT(),this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map(function(t,e){return nH(tP(),e,e,e,e)}))}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}}]);return e}(iK(rD,"qti-simple-associable-choice",!0,".dl"));i0.styles=iJ,eN([i()],i0.prototype,"_childrenMap",2),i0=eN([re("qti-associate-interaction")],i0);var i1=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t._errorMessage=null;t.handlePostMessage=t.handlePostMessage.bind(t);return t}c(e,[{key:"connectedCallback",value:function t(){var t=this;d(f(e.prototype),"connectedCallback",this).call(this);var n=this.data.startsWith("http")?this.data:I(this.baseItemUrl+"/"+this.data);fetch(n).then(function(t){return t.json()}).then(function(e){t.manifest=e,t.setupCES()}).catch(function(e){t._errorMessage=e})}},{key:"setupCES",value:function t(){var t=this.shadowRoot.querySelector("#pciContainer"),e=t.contentWindow||t,n=t.contentDocument;window.addEventListener("message",this.handlePostMessage),n.open(),n.write("\n <html>\n <head>\n <link href='".concat(I("".concat(this.baseRefUrl,"/").concat(this.manifest.style[0])),"' rel=\"stylesheet\" />\n <script src='").concat(I("".concat(this.baseRefUrl,"/").concat(this.manifest.script[0])),"'><\/script>\n </head>\n <body></body>\n </html>\n ")),n.close()}},{key:"getIFrames",value:function t(){var t=this.shadowRoot.querySelectorAll("iframe"),e=this.querySelectorAll("iframe"),n=$(t).concat($(e));var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;var l=u.src;if(new URL(l,window.location.href).origin===window.location.origin)try{var c=u.contentDocument||u.contentWindow.document;c&&this.getInnerIFrames(c,n)}catch(t){console.error("Error accessing nested iframe:",t)}}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}return n.forEach(function(t,e){n.indexOf(t)!==e&&n.splice(e,1)}),n}},{key:"getInnerIFrames",value:function t(t){var e=this;var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.querySelectorAll("iframe").forEach(function(t){n.push(t);var r=t.src;if(new URL(r,window.location.href).origin===window.location.origin)try{var i=t.contentDocument||t.contentWindow.document;e.getInnerIFrames(i,n)}catch(t){console.error("Error accessing nested iframe:",t)}else console.warn("Skipped cross-origin iframe:",r)}),n}},{key:"postToWindowAndIframes",value:function t(t,e){window.postMessage({type:t,data:e},"*");var n=this.getIFrames();var r=true,i=false,o=undefined;try{for(var a=n[Symbol.iterator](),s;!(r=(s=a.next()).done);r=true){var u=s.value;u.contentWindow&&u.contentWindow.postMessage({type:t,data:e},"*")}}catch(t){i=true;o=t}finally{try{if(!r&&a.return!=null){a.return()}}finally{if(i){throw o}}}}},{key:"handlePostMessage",value:function t(t){var e=this;var n=t.data,r=n.type,i=n.data;switch(r){case"setResponse":this.rawResponse=i,this.saveResponse(i);break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{var o=this.manifest.media.map(function(t){return t.startsWith("http")?t:I(e.baseRefUrl+"/"+t)});this.postToWindowAndIframes("mediaData",o);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}},{key:"validate",value:function t(){return this.rawResponse!==""}},{key:"value",get:function t(){return this.rawResponse},set:function t(t){if(typeof t=="string")this.rawResponse=t,this.saveResponse(t);else throw new Error("Value must be a string")}},{key:"disconnectedCallback",value:function t(){window.removeEventListener("message",this.handlePostMessage),d(f(e.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function t(){return nH(tD(),this.getAttribute("width"),this.getAttribute("height"),this._errorMessage&&nH(t$(),this._errorMessage))}}]);return e}(rD);eN([r({type:String,attribute:"data"})],i1.prototype,"data",2),eN([r({type:String,attribute:"data-base-item"})],i1.prototype,"baseItemUrl",2),eN([r({type:String,attribute:"data-base-ref"})],i1.prototype,"baseRefUrl",2),eN([r({type:String,attribute:"id"})],i1.prototype,"id",2),eN([i()],i1.prototype,"_errorMessage",2),i1=eN([re("qti-custom-interaction")],i1);var i2=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.countAttempt="true";return t}c(e,[{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return""},set:function t(t){}},{key:"render",value:function t(){return nH(tU(),this.disabled,this.endAttempt,this.title)}},{key:"endAttempt",value:function t(t){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}}]);return e}(rD);eN([r({type:String,attribute:"count-attempt"})],i2.prototype,"countAttempt",2),eN([r({type:String})],i2.prototype,"title",2),i2=eN([re("qti-end-attempt-interaction")],i2);var i3=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tM())}},{key:"correctResponse",set:function t(t){var e=this;var n=[],r=Array.isArray(t)?t:[t];r&&(n=r.map(function(t){var e=t.split(" ");return{text:e[0],gap:e[1]}})),this.querySelectorAll("qti-gap").forEach(function(t,r){var i,o,a;var s=t.getAttribute("identifier"),u=(i=n.find(function(t){return t.gap===s}))===null||i===void 0?void 0:i.text,l=(o=e.querySelector('qti-gap-text[identifier="'.concat(u,'"]')))===null||o===void 0?void 0:o.textContent.trim();if(u&&l){var c;if(!((c=t.nextElementSibling)===null||c===void 0?void 0:c.classList.contains("correct-option"))){var h=document.createElement("span");h.classList.add("correct-option"),h.textContent=l,t.insertAdjacentElement("afterend",h)}}else((a=t.nextElementSibling)===null||a===void 0?void 0:a.classList.contains("correct-option"))&&t.nextElementSibling.remove()})}}]);return e}(iK(rD,"qti-gap-text",!1,"qti-gap"));i3.styles=[e9(tI())],i3=eN([re("qti-gap-match-interaction")],i3);var i4=function(t,e,n){var r=new Map;for(var i=e;i<=n;i++)r.set(t[i],i);return r},i5=rF(/*#__PURE__*/function(t){"use strict";p(e,t);function e(t){s(this,e);var n;if(n=a(this,e,[t]),t.type!==rB.CHILD)throw Error("repeat() can only be used in text expressions");return n}c(e,[{key:"dt",value:function t(t,e,n){var r;n===void 0?n=e:e!==void 0&&(r=e);var i=[],o=[],a=0;var s=true,u=false,l=undefined;try{for(var c=t[Symbol.iterator](),h;!(s=(h=c.next()).done);s=true){var d=h.value;i[a]=r?r(d,a):a,o[a]=n(d,a),a++}}catch(t){u=true;l=t}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(u){throw l}}}return{values:o,keys:i}}},{key:"render",value:function t(t,e,n){return this.dt(t,e,n).values}},{key:"update",value:function t(t,e){var n=q(e,3),r=n[0],i=n[1],o=n[2];var a=rj(t),s=this.dt(r,i,o),u=s.values,l=s.keys;if(!Array.isArray(a))return this.ut=l,u;var c;var h=(c=this.ut)!==null&&c!==void 0?c:this.ut=[],d=[],f,p,v=0,y=a.length-1,m=0,g=u.length-1;for(;v<=y&&m<=g;)if(a[v]===null)v++;else if(a[y]===null)y--;else if(h[v]===l[m])d[m]=rN(a[v],u[m]),v++,m++;else if(h[y]===l[g])d[g]=rN(a[y],u[g]),y--,g--;else if(h[v]===l[g])d[g]=rN(a[v],u[g]),rL(t,d[g+1],a[v]),v++,g--;else if(h[y]===l[m])d[m]=rN(a[y],u[m]),rL(t,a[v],a[y]),y--,m++;else if(f===void 0&&(f=i4(l,m,g),p=i4(h,v,y)),f.has(h[v]))if(f.has(h[y])){var b=p.get(l[m]),_=b!==void 0?a[b]:null;if(_===null){var k=rL(t,a[v]);rN(k,u[m]),d[m]=k}else d[m]=rN(_,u[m]),rL(t,a[v],_),a[b]=null;m++}else rQ(a[y]),y--;else rQ(a[v]),v++;for(;m<=g;){var E=rL(t,d[g+1]);rN(E,u[m]),d[m++]=E}for(;v<=y;){var w=a[v++];w!==null&&rQ(w)}return this.ut=l,rH(t,d),nB}}]);return e}(rz));var i6=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t.startPoint=null;t.endPoint=null;t._lines=[];t.addEventListener("qti-register-hotspot",t.positionHotspotOnRegister);return t}c(e,[{key:"reset",value:function t(){this._lines=[]}},{key:"validate",value:function t(){return this._lines.length>0}},{key:"value",get:function t(){return this._lines},set:function t(t){Array.isArray(t)&&(this._lines=t)}},{key:"render",value:function t(){var t=this;var e,n,r,i;return nH(tN(),r$((e=this.grImage[0])===null||e===void 0?void 0:e.width),r$((n=this.grImage[0])===null||n===void 0?void 0:n.height),(r=this.grImage[0])===null||r===void 0?void 0:r.width,(i=this.grImage[0])===null||i===void 0?void 0:i.height,i5(this._lines,function(t){return t},function(e,n){return nj(tO(),parseInt(t.querySelector("[identifier="+e.split(" ")[0]+"]").style.left),parseInt(t.querySelector("[identifier="+e.split(" ")[0]+"]").style.top),parseInt(t.querySelector("[identifier="+e.split(" ")[1]+"]").style.left),parseInt(t.querySelector("[identifier="+e.split(" ")[1]+"]").style.top),function(e){e.stopPropagation(),t._lines=t._lines.filter(function(t,e){return e!==n}),t.saveResponse(t._lines)})}),this.startPoint&&nj(tL(),this.startCoord.x,this.startCoord.y,this.mouseCoord.x,this.mouseCoord.y))}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});eq(i,o,e,n)}},{key:"firstUpdated",value:function t(t){var n=this;d(f(e.prototype),"firstUpdated",this).call(this,t),this.hotspots=this.querySelectorAll("qti-associable-hotspot"),document.addEventListener("mousemove",function(t){n.mouseCoord={x:t.clientX-n.grImage[0].getBoundingClientRect().left,y:t.clientY-n.grImage[0].getBoundingClientRect().top}}),this.hotspots.forEach(function(t){t.style.left=t.getAttribute("coords").split(",")[0]+"px",t.style.top=t.getAttribute("coords").split(",")[1]+"px",t.addEventListener("click",function(t){n.startPoint?n.endPoint||(n.endPoint=t.target,n._lines=$(n._lines).concat([n.startPoint.getAttribute("identifier")+" "+n.endPoint.getAttribute("identifier")]),n.saveResponse(n._lines),n.startPoint=null,n.endPoint=null):(n.startPoint=t.target,n.startCoord={x:n.startPoint.getAttribute("coords").split(",")[0],y:n.startPoint.getAttribute("coords").split(",")[1]})})})}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return e}(rD);i6.styles=[e9(tV())],eN([i()],i6.prototype,"_lines",2),eN([i()],i6.prototype,"startCoord",2),eN([i()],i6.prototype,"mouseCoord",2),eN([u("svg")],i6.prototype,"svgContainer",2),eN([l({selector:"img"})],i6.prototype,"grImage",2),i6=eN([re("qti-graphic-associate-interaction")],i6);var i9=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tH())}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});switch(i){case"circle":{var a=q(o,3),s=a[0],u=a[1],l=a[2];n.style.left=s-l+"px",n.style.top=u-l+"px",n.style.width=n.style.height=2*l+"px"}break;case"rect":{var c=q(o,4),h=c[0],d=c[1],f=c[2],p=c[3];n.style.left=h+"px",n.style.top=d+"px",n.style.width=f-h+"px",n.style.height=p-d+"px"}break;default:break}}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}}]);return e}(iK(rD,"qti-gap-img",!1,"qti-associable-hotspot"));i9.styles=e9(tj()),i9=eN([re("qti-graphic-gap-match-interaction")],i9);var i7=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tQ())}},{key:"setHotspotOrder",value:function t(t){var e=t.detail,n=e.identifier,r=this._choiceElements.find(function(t){return t.getAttribute("identifier")===n}),i=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){if(this._choiceElements.filter(function(t){return t.order>0}).length>=i){this.choiceOrdering=!1;return}r.order=this._choiceElements.filter(function(t){return!!t.order}).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(function(t){return t.order>t.order&&t.order--,t}),r.order=null;this.choiceOrdering=!1}}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});eq(i,o,e,n)}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.removeEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}}]);return e}(r4(rD,"qti-hotspot-choice"));i7.styles=[e9(tB())],i7=eN([re("qti-graphic-order-interaction")],i7);var i8=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(tF())}},{key:"positionHotspotOnRegister",value:function t(t){var e=this.querySelector("img"),n=t.target,r=n.getAttribute("coords"),i=n.getAttribute("shape"),o=r.split(",").map(function(t){return parseInt(t)});eq(i,o,e,n)}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("unregister-qti-hotspot-choice",this.positionHotspotOnRegister)}}]);return e}(r4(rD,"qti-hotspot-choice"));i8.styles=[e9(tz())],i8=eN([re("qti-hotspot-interaction")],i8);var ot=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.matchMin=0;t.matchMax=1;t.fixed=!1;return t}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}},{key:"render",value:function t(){return nH(tW())}}]);return e}(P(n7,"qti-simple-associable-choice"));ot.styles=e9(tY()),eN([r({type:Number,attribute:"match-min"})],ot.prototype,"matchMin",2),eN([r({type:Number,attribute:"match-max"})],ot.prototype,"matchMax",2),eN([r({type:Boolean,attribute:"fixed"})],ot.prototype,"fixed",2),ot=eN([re("qti-simple-associable-choice")],ot);var oe=e9(tX());var on=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.lastCheckedRadio=null;t._response=[];t.correctOptions=[];t.responseIdentifier="";t.handleRadioClick=function(e){var n=e.target;t.lastCheckedRadio===n?(n.checked=!1,t.lastCheckedRadio=null,t.handleRadioChange(e)):t.lastCheckedRadio=n};t.handleRadioChange=function(e){var n=e.target,r=n.value,i=n.name,o=n.type;n.checked?(t.value?t.value.indexOf(r)===-1&&(o==="radio"&&(t.value=t.value.filter(function(t){return t.indexOf(i)===-1})),t.value=$(t.value).concat([r])):t.value=[r],t.lastCheckedRadio=n):(t.value=t.value.filter(function(t){return t!==r}),t.lastCheckedRadio=null),t.requestUpdate(),t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:t.responseIdentifier,response:Array.isArray(t.value)?$(t.value):t.value}}))};return t}c(e,[{key:"value",get:function t(){return this.classList.contains("qti-match-tabular")?this._response:d(f(e.prototype),"value",this)},set:function t(t){this.classList.contains("qti-match-tabular")?this._response=t:A(f(e.prototype),"value",t,this,true)}},{key:"connectedCallback",value:function t(){var t=this;var n=this,r=function(){return d(f(e.prototype),"connectedCallback",t)};return o(function(){return O(this,function(t){r().call(n),n.rows=Array.from(n.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),n.cols=Array.from(n.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),n.value=[];return[2]})})()}},{key:"correctResponse",set:function t(t){if(t===""){this.correctOptions=[];return}else Array.isArray(t)&&(this.correctOptions=t)}},{key:"render",value:function t(){var t=this;return this.classList.contains("qti-match-tabular")?nH(tJ(),this.cols.map(function(t,e){return nH(tZ(),r9(t.innerHTML))}),this.rows.map(function(e,n){return nH(tK(),r9(e.innerHTML),t.cols.map(function(n,r){var i=e.getAttribute("identifier"),o=n.getAttribute("identifier"),a="".concat(i," ").concat(o),s=t.value.filter(function(t){return t.split(" ")[0]===i}).length||0,u=t.value.includes(a),l="rb ".concat(u?"rb-checked":""," ").concat(t.correctOptions.includes(a)?"rb-correct":""),c=t.correctOptions.length>0?!0:e.matchMax===1?!1:s>=e.matchMax&&!u;return nH(tG(),e.matchMax===1?"radio":"checkbox",l,i,a,c,function(e){return t.handleRadioChange(e)},function(n){return e.matchMax===1?t.handleRadioClick(n):null})}))})):nH(t0())}}]);return e}(iK(rD,"qti-simple-match-set:first-of-type qti-simple-associable-choice",!1,"qti-simple-match-set:last-of-type qti-simple-associable-choice"));on.styles=oe,eN([i()],on.prototype,"_response",2),eN([i()],on.prototype,"correctOptions",2),eN([r({type:String,attribute:"response-identifier"})],on.prototype,"responseIdentifier",2),on=eN([re("qti-match-interaction")],on);var or=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t._value=0;return t}c(e,[{key:"reset",value:function t(){}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return this._value.toString()},set:function t(t){if(!isNaN(parseInt(t.toString())))this._value=parseInt(t.toString());else throw new Error("Value must be a number")}},{key:"render",value:function t(){return nH(t1())}},{key:"connectedCallback",value:function t(){var t=this;d(f(e.prototype),"connectedCallback",this).call(this);var n=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");n&&n.addEventListener("ended",function(){t._value++,t.saveResponse(t.value)})}}],[{key:"properties",get:function t(){return w(k({},rD.properties),{step:{type:Number,attribute:"step",default:10}})}}]);return e}(rD);or.styles=[e9(t2())],or=eN([re("qti-media-interaction")],or);var oi=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.nrChoices=0;t.correctResponses=[];t.showCorrectResponses=!1;return t}c(e,[{key:"render",value:function t(){var t=this;var e=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<e.length&&(this.nrChoices=e.length),nH(t4(),Array.from(Array(this.nrChoices)).map(function(e,n){return nH(t3(),n,t.showCorrectResponses&&t.correctResponses.length>n?r9("<span part='correct-response'>".concat(t.correctResponses[n],"</span>")):"")}))}},{key:"correctResponse",set:function t(t){var e=this;if(t===""){this.showCorrectResponses=!1;return}this.correctResponses.length===0&&(Array.isArray(t)?t:[t]).forEach(function(t,n){var r=e.querySelector('qti-simple-choice[identifier="'.concat(t,'"]'));r||(r=e.shadowRoot.querySelector('qti-simple-choice[identifier="'.concat(t,'"]')));var i=r===null||r===void 0?void 0:r.textContent.trim();e.correctResponses=$(e.correctResponses).concat([i])}),this.showCorrectResponses=!0}},{key:"getResponse",value:function t(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(function(t){var e=t.querySelectorAll('[qti-draggable="true"]');return $(Array.from(e).map(function(t){return t.getAttribute("identifier")})).join(" ")})}},{key:"firstUpdated",value:function t(t){var n=this;var r=this,i=function(){return d(f(e.prototype),"firstUpdated",n)};return o(function(){return O(this,function(e){i().call(r,t),r.childrenMap=Array.from(r.querySelectorAll("qti-simple-choice")),r.childrenMap.forEach(function(t){return t.setAttribute("part","qti-simple-choice")});return[2]})})()}}]);return e}(r8(iK(rD,"qti-simple-choice",!0,"drop-list"),"qti-simple-choice"));oi.styles=[e9(t5())],eN([i()],oi.prototype,"nrChoices",2),eN([i()],oi.prototype,"correctResponses",2),eN([i()],oi.prototype,"showCorrectResponses",2),eN([r({type:String})],oi.prototype,"orientation",2),oi=eN([re("qti-order-interaction")],oi);var oo=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(t6())}}]);return e}(n7);oo.styles=[e9(t9())];customElements.define("qti-position-object-interaction",oo);var oa=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e),t.removeMoveListener=t.removeMoveListener.bind(t),t.dragElementHandler=t.dragElementHandler.bind(t);return t}c(e,[{key:"render",value:function t(){return nH(t7())}},{key:"dragElementHandler",value:function t(t){t.preventDefault();var e=t.clientX-this.startX,n=t.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+e+"px",this.dragElement.style.top=this.dragElement.offsetTop+n+"px",this.startX=t.clientX,this.startY=t.clientY}},{key:"firstUpdated",value:function t(t){var n=this;d(f(e.prototype),"firstUpdated",this).call(this,t),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",function(t){n.startX=t.clientX,n.startY=t.clientY,document.addEventListener("mousemove",n.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}},{key:"removeMoveListener",value:function t(t){document.removeEventListener("mousemove",this.dragElementHandler,!0)}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}}]);return e}(n7);oa.styles=[e9(t8())],oa=eN([re("qti-position-object-stage")],oa);var os="important",ou=" !"+os,ol=rF(/*#__PURE__*/function(t){"use strict";p(e,t);function e(t){s(this,e);var n;var r;if(n=a(this,e,[t]),t.type!==rB.ATTRIBUTE||t.name!=="style"||((r=t.strings)===null||r===void 0?void 0:r.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");return n}c(e,[{key:"render",value:function t(t){return Object.keys(t).reduce(function(e,n){var r=t[n];return r==null?e:e+"".concat(n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(r,";")},"")}},{key:"update",value:function t(t,e){var n=q(e,1),r=n[0];var i=t.element,o=i.style;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);var a=true,s=false,u=undefined;try{for(var l=this.ft[Symbol.iterator](),c;!(a=(c=l.next()).done);a=true){var h=c.value;r[h]==null&&(this.ft.delete(h),h.includes("-")?o.removeProperty(h):o[h]=null)}}catch(t){s=true;u=t}finally{try{if(!a&&l.return!=null){l.return()}}finally{if(s){throw u}}}for(var d in r){var f=r[d];if(f!=null){this.ft.add(d);var p=typeof f=="string"&&f.endsWith(ou);d.includes("-")||p?o.setProperty(d,p?f.slice(0,-11):f,p?os:""):o[d]=f}}return nB}}]);return e}(rz));var oc=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.maxChoices=1/0;t.minChoices=0;t._points=[];t._imgElement=null;t._onImageClick=function(e){if(t._points.length<t.maxChoices){var n=e.offsetX,r=e.offsetY;t._points=$(t._points).concat(["".concat(n," ").concat(r)]),t.saveResponse(t._points)}};return t}c(e,[{key:"render",value:function t(){var t=this;return nH(ee(),i5(this._points,function(t){return t},function(e,n){return nH(et(),ol({position:"absolute",transform:"translate(-50%, -50%)",left:"".concat(e.split(" ")[0],"px"),top:"".concat(e.split(" ")[1],"px")}),e,function(e){e.stopPropagation(),t._points=t._points.filter(function(t,e){return e!==n}),t.saveResponse(t._points)})}))}},{key:"reset",value:function t(){this._points=[]}},{key:"validate",value:function t(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}},{key:"value",get:function t(){return this._points},set:function t(t){this._points=Array.isArray(t)?t:[t]}},{key:"firstUpdated",value:function t(){this._imgElement=this.querySelector("img"),this._imgElement?this._imgElement.addEventListener("click",this._onImageClick):console.warn("No <img> element found in <qti-select-point-interaction>")}},{key:"disconnectedCallback",value:function t(){d(f(e.prototype),"disconnectedCallback",this).call(this),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}}]);return e}(rD);oc.styles=[e9(en())],eN([r({type:Number,attribute:"max-choices"})],oc.prototype,"maxChoices",2),eN([r({type:Number,attribute:"min-choices"})],oc.prototype,"minChoices",2),eN([i()],oc.prototype,"_points",2),oc=eN([re("qti-select-point-interaction")],oc);var oh=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e);t._value=0;t.stepLabel=!1;t.reverse=!1;t._handleDisabledChange=function(t,e){};t._handleReadonlyChange=function(t,e){};t.csLive=getComputedStyle(t);return t}c(e,[{key:"min",get:function t(){return this._min},set:function t(t){this._min=t,this._value=t,this.style.setProperty("--min","".concat(this._min))}},{key:"max",get:function t(){return this._max},set:function t(t){this._max=t,this.style.setProperty("--max","".concat(this._max))}},{key:"step",get:function t(){return this._step},set:function t(t){this._step=t,this.style.setProperty("--step","".concat(this._step))}},{key:"reset",value:function t(){}},{key:"validate",value:function t(){return!0}},{key:"value",get:function t(){return this._value.toString()},set:function t(t){if(!isNaN(parseInt(t.toString())))this._value=parseInt(t.toString());else throw new Error("Value must be a number")}},{key:"response",set:function t(t){if(Array.isArray(t)){console.error("QtiSliderInteraction: response is an array, but should be a single value");return}var e=parseInt(t);if(Number.isNaN(e)){console.error("QtiSliderInteraction: response is not a number");return}this._value=e}},{key:"render",value:function t(){this._value<this.min&&(this._value=this.min),this._value>this.max&&(this._value=this.max);var t=(this._value-this.min)/(this.max-this.min)*100;return this.style.setProperty("--value-percentage","".concat(t,"%")),this.setAttribute("aria-valuenow",this.value.toString()),nH(ea(),this.csLive.getPropertyValue("--show-bounds")=="true"?nH(er(),this._min,this._max):nF,this.csLive.getPropertyValue("--show-ticks")=="true"?nH(ei()):nF,this._onMouseDown,this._onTouchMove,this.csLive.getPropertyValue("--show-value")=="true"?nH(eo(),this.value):nF)}},{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}},{key:"_onTouchMove",value:function t(t){var e=this;var n=function(t){var n=e.getPositionFromEvent(t),r=n.x,i=r-e._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;e.calculateValue(i),t.stopPropagation()},r=function(){document.removeEventListener("touchmove",n),document.removeEventListener("touchend",r),e.saveResponse(e.value.toString())};document.addEventListener("touchmove",n),document.addEventListener("touchend",r);var i=this.getPositionFromEvent(t),o=i.x,a=o-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(a),t.stopPropagation()}},{key:"_onMouseDown",value:function t(t){var e=this;var n=function(t){var n=t.pageX-e._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;e.calculateValue(n),t.preventDefault(),t.stopPropagation()},r=function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r),e.saveResponse(e.value.toString())};document.addEventListener("mousemove",n),document.addEventListener("mouseup",r);var i=t.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(i),t.preventDefault(),t.stopPropagation()}},{key:"calculateValue",value:function t(t){var e=this.min+(this.max-this.min)*t/this._rail.getBoundingClientRect().width,n=this.min+Math.round((e-this.min)/this._step)*this._step;this._value=n}},{key:"getPositionFromEvent",value:function t(t){var e;if(t.type=="touchstart"||t.type=="touchmove"||t.type=="touchend"||t.type=="touchcancel"){var n=D(t.originalEvent)>"u"?t:t.originalEvent,r=n.touches[0]||n.changedTouches[0];e={x:r.pageX,y:r.pageY}}else(t.type=="mousedown"||t.type=="mouseup"||t.type=="mousemove"||t.type=="mouseover"||t.type=="mouseout"||t.type=="mouseenter"||t.type=="mouseleave")&&(e={x:t.clientX,y:t.clientY});return e}}]);return e}(rD);oh.styles=[e9(es())],eN([u("#knob")],oh.prototype,"_knob",2),eN([u("#rail")],oh.prototype,"_rail",2),eN([r({type:Boolean,attribute:"step-label"})],oh.prototype,"stepLabel",2),eN([r({type:Boolean})],oh.prototype,"reverse",2),eN([r({type:Number,attribute:"lower-bound"})],oh.prototype,"min",1),eN([r({type:Number,attribute:"upper-bound"})],oh.prototype,"max",1),eN([r({type:Number,attribute:"step"})],oh.prototype,"step",1),eN([h("disabled",{waitUntilFirstUpdate:!0})],oh.prototype,"_handleDisabledChange",2),eN([h("readonly",{waitUntilFirstUpdate:!0})],oh.prototype,"_handleReadonlyChange",2),oh=eN([re("qti-slider-interaction")],oh);var od=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(eu(),this.handleSlotChange)}},{key:"handleSlotChange",value:function t(t){var e;var n;var r=Array.from((n=(e=this.firstElementChild)===null||e===void 0?void 0:e.childNodes)!==null&&n!==void 0?n:[]).find(function(t){return t.nodeType===Node.COMMENT_NODE});try{var i;this.operatorFunction=new Function("context","fn","item",(i=r.textContent)!==null&&i!==void 0?i:"")}catch(t){console.error("custom-operator contains invalid javascript code",t)}}},{key:"calculate",value:function t(){var t=this;var e={variable:function(e){var n,r;var i;return(i=(r=t._context)===null||r===void 0?void 0:(n=r.variables.find(function(t){return t.identifier===e}))===null||n===void 0?void 0:n.value)!==null&&i!==void 0?i:""},correct:function(e){var n,r;var i;return(i=(r=t._context)===null||r===void 0?void 0:(n=r.variables.find(function(t){return t.identifier===e}))===null||n===void 0?void 0:n.correctResponse)!==null&&i!==void 0?i:""}},n={getVariable:function(e){var n;return(n=t._context)===null||n===void 0?void 0:n.variables.find(function(t){return t.identifier===e})},updateOutcomeVariable:function(e,n){t.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:e,value:n}}))},updateResponseVariable:function(e,n){t.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:e,response:n}}))}};return this.operatorFunction(this._context,e,n)}}]);return e}(n7);eN([e({context:ra,subscribe:!0}),i()],od.prototype,"_context",2),od=eN([re("qti-custom-operator")],od);var of=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"render",value:function t(){return nH(el())}}]);return e}(n7);of.styles=e9(ec()),of=eN([re("qti-associable-hotspot")],of);var op=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"render",value:function t(){return nH(eh())}}]);return e}(n7);op.styles=e9(ed()),eN([r({type:Number,reflect:!0})],op.prototype,"tabindex",2),op=eN([re("qti-gap")],op);var ov=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"connectedCallback",value:function t(){this.setAttribute("slot","qti-gap-img")}}]);return e}(n7);ov.styles=e9(ef()),eN([r({type:Number,reflect:!0})],ov.prototype,"tabindex",2),ov=eN([re("qti-gap-img")],ov);var oy=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);var t;t=a(this,e,arguments);t.tabindex=0;return t}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.setAttribute("slot","qti-gap-text")}},{key:"render",value:function t(){return nH(ep())}}]);return e}(P(n7,"qti-gap-text"));oy.styles=e9(ev()),eN([r({type:Number,reflect:!0})],oy.prototype,"tabindex",2),oy=eN([re("qti-gap-text")],oy);var om=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(P(n7,"qti-hotspot-choice"));om.styles=e9(ey()),eN([r({attribute:"aria-ordervalue",type:Number,reflect:!0})],om.prototype,"order",2),om=eN([re("qti-hotspot-choice")],om);var og=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"render",value:function t(){return nH(em())}}]);return e}(P(n7,"qti-hottext"));og.styles=e9(eg()),og=eN([re("qti-hottext")],og);var ob=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"connectedCallback",value:function t(){d(f(e.prototype),"connectedCallback",this).call(this),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,composed:!0,cancelable:!1}))}},{key:"disconnectedCallback",value:function t(){this.removeEventListener("click",this._onSelectInlineChoice)}},{key:"render",value:function t(){return nH(e_())}},{key:"_onSelectInlineChoice",value:function t(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}}],[{key:"styles",get:function t(){return[e9(eb())]}}]);return e}(n7);eN([r({type:String})],ob.prototype,"identifier",2),ob=eN([re("qti-inline-choice")],ob);var o_=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}c(e,[{key:"checked",get:function t(){return this.internals.states.has("--checked")}},{key:"render",value:function t(){return nH(eE(),this.marker?nH(ek(),this.marker):nF)}}]);return e}(P(n7,"qti-simple-choice"));o_.styles=e9(ew()),eN([r({type:String,attribute:!1})],o_.prototype,"marker",2),o_=eN([re("qti-simple-choice")],o_);console.log("%cC\xbfTO%cLab%c: qti-components loaded","font-weight:bold; color:green",'font-family: "PT Sans", font-weight:bold; color:green; font-size: smaller;vertical-align: sub',"font-weight:unset");var ok=/*#__PURE__*/function(t){"use strict";p(e,t);function e(){s(this,e);return a(this,e,arguments)}return e}(eR(n7));ok=eN([re("qti-item")],ok);var oE=/*#__PURE__*/function(){var t=o(function(t){var e,n,r,i,o,a;return O(this,function(s){switch(s.label){case 0:e=t.substring(0,t.lastIndexOf("/"));return[4,rd().load("".concat(t)).then(function(t){return t.assessmentTest()})];case 1:n=s.sent();return[4,rf().load("".concat(e,"/").concat(n.href)).then(function(t){return t.htmlDoc()})];case 2:r=s.sent();return[4,rf().load("".concat(e,"/").concat(n.href)).then(function(t){return t.items()})];case 3:i=s.sent(),o="".concat(e,"/").concat(n.href),a="".concat(e,"/").concat(n.href.substring(0,n.href.lastIndexOf("/")));return[2,{testHTMLDoc:r,testURI:a,testURL:o,items:i,testIdentifier:n.identifier}]}})});return function e(e){return t.apply(this,arguments)}}(),ow=/*#__PURE__*/function(){var t=o(function(t){return O(this,function(e){return[2,rh().load(t).then(function(t){return t.htmlDoc().firstElementChild})]})});return function e(e){return t.apply(this,arguments)}}();return eL(eV)}();/*! Bundled license information:
|
|
2
2
|
|
|
3
3
|
@lit/context/lib/context-request-event.js:
|
|
4
4
|
(**
|