@citolab/qti-components 6.9.1-beta.6 → 6.9.1-beta.8

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.js CHANGED
@@ -1,6 +1,6 @@
1
- var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnPropertyDescriptor,Hs=Object.getOwnPropertyDescriptors;var Lr=Object.getOwnPropertySymbols;var Ns=Object.prototype.hasOwnProperty,Ps=Object.prototype.propertyIsEnumerable;var Hr=(i,t,e)=>t in i?Nr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,q=(i,t)=>{for(var e in t||(t={}))Ns.call(t,e)&&Hr(i,e,t[e]);if(Lr)for(var e of Lr(t))Ps.call(t,e)&&Hr(i,e,t[e]);return i},T=(i,t)=>Ms(i,Hs(t));var l=(i,t,e,r)=>{for(var s=r>1?void 0:r?Ls(t,e):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(r?n(t,e,s):n(s))||s);return r&&s&&Nr(t,e,s),s};var te=class extends Event{constructor(t,e,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=e,this.subscribe=r!=null?r:!1}};var xe=class{constructor(t,e,r,s){var o;if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(n,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=n,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(n,a)),this.unsubscribe=a},this.host=t,e.context!==void 0){let n=e;this.context=n.context,this.callback=n.callback,this.subscribe=(o=n.subscribe)!=null?o:!1}else this.context=e,this.callback=r,this.subscribe=s!=null?s:!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new te(this.context,this.t,this.subscribe))}};var ft=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){let r=e||!Object.is(t,this.o);this.o=t,r&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:r}]of this.subscriptions)e(this.o,r)},t!==void 0&&(this.value=t)}addCallback(t,e,r){if(!r)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});let{disposer:s}=this.subscriptions.get(t);t(this.value,s)}clearCallbacks(){this.subscriptions.clear()}};var zt=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}},Ee=class extends ft{constructor(t,e,r){var s,o;super(e.context!==void 0?e.initialValue:r),this.onContextRequest=n=>{let a=n.composedPath()[0];n.context===this.context&&a!==this.host&&(n.stopPropagation(),this.addCallback(n.callback,a,n.subscribe))},this.onProviderRequest=n=>{let a=n.composedPath()[0];if(n.context!==this.context||a===this.host)return;let c=new Set;for(let[d,{consumerHost:h}]of this.subscriptions)c.has(d)||(c.add(d),h.dispatchEvent(new te(this.context,d,!0)));n.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(o=(s=this.host).addController)==null||o.call(s,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new zt(this.context))}};function Yt({context:i}){return(t,e)=>{let r=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){r.set(this,new Ee(this,{context:i}))}),{get(){return t.get.call(this)},set(s){var o;return(o=r.get(this))==null||o.setValue(s),t.set.call(this,s)},init(s){var o;return(o=r.get(this))==null||o.setValue(s),s}};{t.constructor.addInitializer(n=>{r.set(n,new Ee(n,{context:i}))});let s=Object.getOwnPropertyDescriptor(t,e),o;if(s===void 0){let n=new WeakMap;o={get(){return n.get(this)},set(a){r.get(this).setValue(a),n.set(this,a)},configurable:!0,enumerable:!0}}else{let n=s.set;o=T(q({},s),{set(a){r.get(this).setValue(a),n==null||n.call(this,a)}})}return void Object.defineProperty(t,e,o)}}}function K({context:i,subscribe:t}){return(e,r)=>{typeof r=="object"?r.addInitializer(function(){new xe(this,{context:i,callback:s=>{e.set.call(this,s)},subscribe:t})}):e.constructor.addInitializer(s=>{new xe(s,{context:i,callback:o=>{s[r]=o},subscribe:t})})}}var Pr=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(t){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBraileLabel="",this.ariaBraileRoleDescription="",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=t}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var Vr=new WeakMap,Ve=i=>{let t=Vr.get(i);return t===void 0&&Vr.set(i,t=new Map),t},Ds=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(Ve(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}setAttribute(t,e){Ve(this).set(t,String(e))}removeAttribute(t){Ve(this).delete(t)}toggleAttribute(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}hasAttribute(t){return Ve(this).has(t)}attachShadow(t){let e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let t=new Pr(this);return this.__internals=t,t}getAttribute(t){let e=Ve(this).get(t);return e!=null?e:null}};var Os=class extends Ds{},Dr=Os;var Is=class{constructor(){this.__definitions=new Map}define(t,e){var r;if(this.__definitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);this.__definitions.set(t,{ctor:e,observedAttributes:(r=e.observedAttributes)!=null?r:[]})}get(t){let e=this.__definitions.get(t);return e==null?void 0:e.ctor}},Us=Is;var Or=new Us;var De=globalThis,gt=De.ShadowRoot&&(De.ShadyCSS===void 0||De.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Wt=Symbol(),Ir=new WeakMap,Oe=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==Wt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(gt&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=Ir.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&Ir.set(e,t))}return t}toString(){return this.cssText}},Ur=i=>new Oe(typeof i=="string"?i:i+"",void 0,Wt),b=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((r,s,o)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[o+1],i[0]);return new Oe(e,i,Wt)},Kt=(i,t)=>{if(gt)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),s=De.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=e.cssText,i.appendChild(r)}},bt=gt||De.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return Ur(e)})(i):i;var{is:Fs,defineProperty:Bs,getOwnPropertyDescriptor:js,getOwnPropertyNames:Xs,getOwnPropertySymbols:zs,getPrototypeOf:Ys}=Object,D=globalThis,jr;(jr=D.customElements)!=null||(D.customElements=Or);var Fr=D.trustedTypes,Ws=Fr?Fr.emptyScript:"",Jt=D.reactiveElementPolyfillSupport,Ie=(i,t)=>i,Ue={toAttribute(i,t){switch(t){case Boolean:i=i?Ws:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch(r){e=null}}return e}},vt=(i,t)=>!Fs(i,t),Br={attribute:!0,type:String,converter:Ue,reflect:!1,hasChanged:vt},Xr,zr;(Xr=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(zr=D.litPropertyMetadata)!=null||(D.litPropertyMetadata=new WeakMap);var Yr,J=class extends((Yr=globalThis.HTMLElement)!=null?Yr:Dr){static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Br){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),s=this.getPropertyDescriptor(t,r,e);s!==void 0&&Bs(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){var n;let{get:s,set:o}=(n=js(this.prototype,t))!=null?n:{get(){return this[e]},set(a){this[e]=a}};return{get(){return s==null?void 0:s.call(this)},set(a){let c=s==null?void 0:s.call(this);o.call(this,a),this.requestUpdate(t,c,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:Br}static _$Ei(){if(this.hasOwnProperty(Ie("elementProperties")))return;let t=Ys(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ie("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ie("properties"))){let e=this.properties,r=[...Xs(e),...zs(e)];for(let s of r)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,s]of e)this.elementProperties.set(r,s)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let s=this._$Eu(e,r);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let s of r)e.unshift(bt(s))}else t!==void 0&&e.push(bt(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,r;((e=this._$EO)!=null?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return Kt(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostConnected)==null?void 0:s.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var r;return(r=e.hostDisconnected)==null?void 0:r.call(e)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EC(t,e){var o;let r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){let n=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:Ue).toAttribute(e,r.type);this._$Em=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(t,e){var o;let r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let n=r.getPropertyOptions(s),a=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:Ue;this._$Em=s,this[s]=a.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,r){var s;if(t!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(t)),!((s=r.hasChanged)!=null?s:vt)(this[t],e))return;this.P(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,r){var s;this._$AL.has(t)||this._$AL.set(t,e),r.reflect===!0&&this._$Em!==t&&((s=this._$Ej)!=null?s:this._$Ej=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,a]of o)a.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],a)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(e)):this._$EU()}catch(o){throw t=!1,this._$EU(),o}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostUpdated)==null?void 0:s.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}},Wr;J.elementStyles=[],J.shadowRootOptions={mode:"open"},J[Ie("elementProperties")]=new Map,J[Ie("finalized")]=new Map,Jt==null||Jt({ReactiveElement:J}),((Wr=D.reactiveElementVersions)!=null?Wr:D.reactiveElementVersions=[]).push("2.0.4");var _e=globalThis,yt=_e.trustedTypes,Kr=yt?yt.createPolicy("lit-html",{createHTML:i=>i}):void 0,Qt="$lit$",Z=`lit$${Math.random().toFixed(9).slice(2)}$`,er="?"+Z,Ks=`<${er}>`,fe=_e.document===void 0?{createTreeWalker:()=>({})}:document,Be=()=>fe.createComment(""),je=i=>i===null||typeof i!="object"&&typeof i!="function",tr=Array.isArray,rs=i=>tr(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Zt=`[
2
- \f\r]`,Fe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Jr=/-->/g,Zr=/>/g,he=RegExp(`>|${Zt}(?:([^\\s"'>=/]+)(${Zt}*=${Zt}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Gr=/'/g,Qr=/"/g,ss=/^(?:script|style|textarea|title)$/i,rr=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),u=rr(1),sr=rr(2),po=rr(3),M=Symbol.for("lit-noChange"),_=Symbol.for("lit-nothing"),es=new WeakMap,me=fe.createTreeWalker(fe,129);function is(i,t){if(!tr(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Kr!==void 0?Kr.createHTML(t):t}var os=(i,t)=>{let e=i.length-1,r=[],s,o=t===2?"<svg>":t===3?"<math>":"",n=Fe;for(let a=0;a<e;a++){let c=i[a],d,h,g=-1,y=0;for(;y<c.length&&(n.lastIndex=y,h=n.exec(c),h!==null);)y=n.lastIndex,n===Fe?h[1]==="!--"?n=Jr:h[1]!==void 0?n=Zr:h[2]!==void 0?(ss.test(h[2])&&(s=RegExp("</"+h[2],"g")),n=he):h[3]!==void 0&&(n=he):n===he?h[0]===">"?(n=s!=null?s:Fe,g=-1):h[1]===void 0?g=-2:(g=n.lastIndex-h[2].length,d=h[1],n=h[3]===void 0?he:h[3]==='"'?Qr:Gr):n===Qr||n===Gr?n=he:n===Jr||n===Zr?n=Fe:(n=he,s=void 0);let v=n===he&&i[a+1].startsWith("/>")?" ":"";o+=n===Fe?c+Ks:g>=0?(r.push(d),c.slice(0,g)+Qt+c.slice(g)+Z+v):c+Z+(g===-2?a:v)}return[is(i,o+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},Xe=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let o=0,n=0,a=t.length-1,c=this.parts,[d,h]=os(t,e);if(this.el=i.createElement(d,r),me.currentNode=this.el.content,e===2||e===3){let g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(s=me.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let g of s.getAttributeNames())if(g.endsWith(Qt)){let y=h[n++],v=s.getAttribute(g).split(Z),C=/([.?@])?(.*)/.exec(y);c.push({type:1,index:o,name:C[2],strings:v,ctor:C[1]==="."?Et:C[1]==="?"?_t:C[1]==="@"?Ct:be}),s.removeAttribute(g)}else g.startsWith(Z)&&(c.push({type:6,index:o}),s.removeAttribute(g));if(ss.test(s.tagName)){let g=s.textContent.split(Z),y=g.length-1;if(y>0){s.textContent=yt?yt.emptyScript:"";for(let v=0;v<y;v++)s.append(g[v],Be()),me.nextNode(),c.push({type:2,index:++o});s.append(g[y],Be())}}}else if(s.nodeType===8)if(s.data===er)c.push({type:2,index:o});else{let g=-1;for(;(g=s.data.indexOf(Z,g+1))!==-1;)c.push({type:7,index:o}),g+=Z.length-1}o++}}static createElement(t,e){let r=fe.createElement("template");return r.innerHTML=t,r}};function ge(i,t,e=i,r){var n,a,c;if(t===M)return t;let s=r!==void 0?(n=e.o)==null?void 0:n[r]:e.l,o=je(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==o&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),o===void 0?s=void 0:(s=new o(i),s._$AT(i,e,r)),r!==void 0?((c=e.o)!=null?c:e.o=[])[r]=s:e.l=s),s!==void 0&&(t=ge(i,s._$AS(i,t.values),s,r)),t}var xt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var d;let{el:{content:e},parts:r}=this._$AD,s=((d=t==null?void 0:t.creationScope)!=null?d:fe).importNode(e,!0);me.currentNode=s;let o=me.nextNode(),n=0,a=0,c=r[0];for(;c!==void 0;){if(n===c.index){let h;c.type===2?h=new Ce(o,o.nextSibling,this,t):c.type===1?h=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(h=new qt(o,this,t)),this._$AV.push(h),c=r[++a]}n!==(c==null?void 0:c.index)&&(o=me.nextNode(),n++)}return me.currentNode=fe,s}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},Ce=class i{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this.v}constructor(t,e,r,s){var o;this.type=2,this._$AH=_,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this.v=(o=s==null?void 0:s.isConnected)!=null?o:!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ge(this,t,e),je(t)?t===_||t==null||t===""?(this._$AH!==_&&this._$AR(),this._$AH=_):t!==this._$AH&&t!==M&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):rs(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==_&&je(this._$AH)?this._$AA.nextSibling.data=t:this.T(fe.createTextNode(t)),this._$AH=t}$(t){var o;let{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Xe.createElement(is(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===s)this._$AH.p(e);else{let n=new xt(s,this),a=n.u(this.options);n.p(e),this.T(a),this._$AH=n}}_$AC(t){let e=es.get(t.strings);return e===void 0&&es.set(t.strings,e=new Xe(t)),e}k(t){tr(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,s=0;for(let o of t)s===e.length?e.push(r=new i(this.O(Be()),this.O(Be()),this,this.options)):r=e[s],r._$AI(o),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this.v=t,(e=this._$AP)==null||e.call(this,t))}},be=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,o){this.type=1,this._$AH=_,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=_}_$AI(t,e=this,r,s){let o=this.strings,n=!1;if(o===void 0)t=ge(this,t,e,0),n=!je(t)||t!==this._$AH&&t!==M,n&&(this._$AH=t);else{let a=t,c,d;for(t=o[0],c=0;c<o.length-1;c++)d=ge(this,a[r+c],e,c),d===M&&(d=this._$AH[c]),n||(n=!je(d)||d!==this._$AH[c]),d===_?t=_:t!==_&&(t+=(d!=null?d:"")+o[c+1]),this._$AH[c]=d}n&&!s&&this.j(t)}j(t){t===_?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},Et=class extends be{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===_?void 0:t}},_t=class extends be{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==_)}},Ct=class extends be{constructor(t,e,r,s,o){super(t,e,r,s,o),this.type=5}_$AI(t,e=this){var n;if((t=(n=ge(this,t,e,0))!=null?n:_)===M)return;let r=this._$AH,s=t===_&&r!==_||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==_&&(r===_||s);s&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,r;typeof this._$AH=="function"?this._$AH.call((r=(e=this.options)==null?void 0:e.host)!=null?r:this.element,t):this._$AH.handleEvent(t)}},qt=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){ge(this,t)}},ns={M:Qt,P:Z,A:er,C:1,L:os,R:xt,D:rs,V:ge,I:Ce,H:be,N:_t,U:Ct,B:Et,F:qt},Gt=_e.litHtmlPolyfillSupport,ts;Gt==null||Gt(Xe,Ce),((ts=_e.litHtmlVersions)!=null?ts:_e.litHtmlVersions=[]).push("3.2.0");var as=(i,t,e)=>{var o,n;let r=(o=e==null?void 0:e.renderBefore)!=null?o:t,s=r._$litPart$;if(s===void 0){let a=(n=e==null?void 0:e.renderBefore)!=null?n:null;r._$litPart$=s=new Ce(t.insertBefore(Be(),a),a,void 0,e!=null?e:{})}return s._$AI(i),s};var f=class extends J{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var e,r;let t=super.createRenderRoot();return(r=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=as(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.o)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.o)==null||t.setConnected(!1)}render(){return M}},ls;f._$litElement$=!0,f.finalized=!0,(ls=globalThis.litElementHydrateSupport)==null||ls.call(globalThis,{LitElement:f});var ir=globalThis.litElementPolyfillSupport;ir==null||ir({LitElement:f});var cs;((cs=globalThis.litElementVersions)!=null?cs:globalThis.litElementVersions=[]).push("4.1.0");var m=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};var Js={attribute:!0,type:String,converter:Ue,reflect:!1,hasChanged:vt},Zs=(i=Js,t,e)=>{let{kind:r,metadata:s}=e,o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),o.set(e.name,i),r==="accessor"){let{name:n}=e;return{set(a){let c=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,c,i)},init(a){return a!==void 0&&this.P(n,void 0,i),a}}}if(r==="setter"){let{name:n}=e;return function(a){let c=this[n];t.call(this,a),this.requestUpdate(n,c,i)}}throw Error("Unsupported decorator location: "+r)};function p(i){return(t,e)=>typeof e=="object"?Zs(i,t,e):((r,s,o)=>{let n=s.hasOwnProperty(o);return s.constructor.createProperty(o,n?T(q({},r),{wrapped:!0}):r),n?Object.getOwnPropertyDescriptor(s,o):void 0})(i,t,e)}function E(i){return p(T(q({},i),{state:!0,attribute:!1}))}var re=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(i,t,e),e);function ze(i,t){return(e,r,s)=>{let o=n=>{var a,c;return(c=(a=n.renderRoot)==null?void 0:a.querySelector(i))!=null?c:null};if(t){let{get:n,set:a}=typeof r=="object"?e:s!=null?s:(()=>{let c=Symbol();return{get(){return this[c]},set(d){this[c]=d}}})();return re(e,r,{get(){let c=n.call(this);return c===void 0&&(c=o(this),(c!==null||this.hasUpdated)&&a.call(this,c)),c}})}return re(e,r,{get(){return o(this)}})}}function ps(i){return(t,e)=>{let{slot:r,selector:s}=i!=null?i:{},o="slot"+(r?`[name=${r}]`:":not([name])");return re(t,e,{get(){var c,d;let n=(c=this.renderRoot)==null?void 0:c.querySelector(o),a=(d=n==null?void 0:n.assignedElements(i))!=null?d:[];return s===void 0?a:a.filter(h=>h.matches(s))}})}}function S(i,t){let e=q({waitUntilFirstUpdate:!1},t);return(r,s)=>{let{update:o}=r,n=Array.isArray(i)?i:[i];r.update=function(a){n.forEach(c=>{let d=c;if(a.has(d)){let h=a.get(d),g=this[d];h!==g&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[s](h,g)}}),o.call(this,a)}}}var ds=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],O="item";var L=class extends f{constructor(){super();this.identifier="";this.adaptive="false";this.timeDependent=null;this._handleDisabledChange=(e,r)=>{this._interactionElements.forEach(s=>s.disabled=r)};this._handleReadonlyChange=(e,r)=>this._interactionElements.forEach(s=>s.readonly=r);this._context={identifier:this.getAttribute("identifier"),variables:ds};this._initialContext=T(q({},this._context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];this.addEventListener("qti-register-variable",e=>{this._context=T(q({},this._context),{variables:[...this._context.variables,e.detail.variable]}),this._initialContext=this._context,e.stopPropagation()}),this.addEventListener("qti-register-feedback",e=>{e.stopPropagation();let r=e.detail;this._feedbackElements.push(r),r.checkShowFeedback(r.outcomeIdentifier)}),this.addEventListener("qti-register-interaction",e=>{e.stopPropagation(),this._interactionElements.push(e.target)}),this.addEventListener("end-attempt",e=>{let{responseIdentifier:r,countAttempt:s}=e.detail;this.updateResponseVariable(r,"true"),this.processResponse(s)}),this.addEventListener("qti-set-outcome-value",e=>{let{outcomeIdentifier:r,value:s}=e.detail;this.updateOutcomeVariable(r,s),e.stopPropagation()}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}get variables(){return this._context.variables.map(e=>q({identifier:e.identifier,value:e.value,type:e.type},e.type==="outcome"&&e.identifier==="SCORE"?{externalScored:e.externalScored}:{}))}set variables(e){if(!Array.isArray(e)||e.some(r=>!("identifier"in r))){console.warn("variables property should be an array of VariableDeclaration");return}this._context=T(q({},this._context),{variables:this._context.variables.map(r=>{let s=e.find(o=>o.identifier===r.identifier);return s?q(q({},r),s):r})}),this._context.variables.forEach(r=>{if(r.type==="response"){let s=this._interactionElements.find(o=>o.responseIdentifier===r.identifier);s&&(s.response=r.value)}r.type==="outcome"&&this._feedbackElements.forEach(s=>s.checkShowFeedback(r.identifier))})}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this._emit("qti-assessment-item-connected",this)}set responses(e){if(e)for(let r of e){this.getResponse(r.responseIdentifier)&&this.updateResponseVariable(r.responseIdentifier,r.response);let o=this._interactionElements.find(n=>n.getAttribute("response-identifier")===r.responseIdentifier);o&&(o.response=r.response)}}render(){return u`<slot></slot>`}showCorrectResponse(e){let s=this._context.variables.filter(o=>"correctResponse"in o&&o.correctResponse).map(o=>({responseIdentifier:o.identifier,response:o.correctResponse}));for(let o of s){let n=this._interactionElements.find(a=>a.getAttribute("response-identifier")===o.responseIdentifier);n&&(n.correctResponse=e?o.response:"")}}processResponse(e=!0){var s;let r=this.querySelector("qti-response-processing");return!r||!r.process?!1:(r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),e&&this.updateOutcomeVariable("numAttempts",(+((s=this._context.variables.find(o=>o.identifier==="numAttempts"))==null?void 0:s.value)+1).toString()),this._emit("qti-response-processed"),!0)}resetResponses(){this._context=this._initialContext}getResponse(e){return this.getVariable(e)}getOutcome(e){return this.getVariable(e)}getVariable(e){return this._context.variables.find(r=>r.identifier===e)||null}handleUpdateResponseVariable(e){let{responseIdentifier:r,response:s}=e.detail;this.updateResponseVariable(r,s)}updateResponseVariable(e,r){this._context=T(q({},this._context),{variables:this._context.variables.map(s=>s.identifier!==e?s:T(q({},s),{value:r}))}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:e,response:Array.isArray(r)?[...r]:r}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}updateOutcomeVariable(e,r){var o;let s=this.getOutcome(e);if(!s){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}this._context=T(q({},this._context),{variables:this._context.variables.map(n=>n.identifier!==e?n:T(q({},n),{value:s.cardinality==="single"?r:[...n.value,r]}))}),this._feedbackElements.forEach(n=>n.checkShowFeedback(e)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:e,value:(o=this._context.variables.find(n=>n.identifier===e))==null?void 0:o.value})}_getCompletionStatus(){return this._interactionElements.every(e=>e.validate())?"completed":this._interactionElements.some(e=>e.validate())?"incomplete":"not_attempted"}_emit(e,r=null){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:r}))}};l([p({type:String})],L.prototype,"title",2),l([p({type:String})],L.prototype,"identifier",2),l([p({type:String})],L.prototype,"adaptive",2),l([p({type:String})],L.prototype,"timeDependent",2),l([p({type:Boolean})],L.prototype,"disabled",2),l([S("disabled",{waitUntilFirstUpdate:!0})],L.prototype,"_handleDisabledChange",2),l([p({type:Boolean})],L.prototype,"readonly",2),l([S("readonly",{waitUntilFirstUpdate:!0})],L.prototype,"_handleReadonlyChange",2),l([Yt({context:O})],L.prototype,"_context",2),L=l([m("qti-assessment-item")],L);var Gs=String.raw,us=()=>{let i,t={async load(e,r=!1){return new Promise((s,o)=>{nr(e,r).then(n=>(i=n,s(t)))})},parse(e){return i=ar(e),t},path:e=>(ti(i,e),t),fn(e){return e(i),t},pciHooks(e){let r=["hook","module"],s=e.substring(0,e.lastIndexOf("/"));for(let o of r)i.querySelectorAll("["+o+"]").forEach(a=>{let c=a.getAttribute(o);!c.startsWith("data:")&&!c.startsWith("http")&&(a.setAttribute("base-url",e),a.setAttribute("module",s+"/"+encodeURIComponent(c+(c.endsWith(".js")?"":".js"))))});return t},customInteraction(e,r){let s=i.querySelector("qti-custom-interaction"),o=s.querySelector("object");return s.setAttribute("data-base-ref",e),s.setAttribute("data-base-item",e+r),s.setAttribute("data",o.getAttribute("data")),s.setAttribute("width",o.getAttribute("width")),s.setAttribute("height",o.getAttribute("height")),s.removeChild(o),t},convertCDATAtoComment(){return ri(i),t},stripStyleSheets(){return si(i),t},html(){return new XMLSerializer().serializeToString(At(i))},xml(){return new XMLSerializer().serializeToString(i)},htmldoc(){return At(i)},xmldoc(){return i}};return t},un=()=>{let i,t={async load(e){return new Promise((r,s)=>{nr(e).then(o=>(i=o,r(t)))})},parse(e){i=ar(e)},assessmentTest(){let e=i.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:e.getAttribute("href"),identifier:e.getAttribute("identifier")}}};return t},hn=()=>{let i,t={async load(e){return new Promise((r,s)=>{nr(e).then(o=>(i=o,r(t)))})},parse(e){return i=ar(e),t},fn(e){return e(i),t},items(){return ei(i)},html(){return new XMLSerializer().serializeToString(At(i))},xml(){return new XMLSerializer().serializeToString(i)},htmldoc(){return At(i)},xmldoc(){return i}};return t},Qs=Gs`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
1
+ var jr=Object.defineProperty,Xi=Object.defineProperties,Yi=Object.getOwnPropertyDescriptor,Wi=Object.getOwnPropertyDescriptors;var Fr=Object.getOwnPropertySymbols;var Ki=Object.prototype.hasOwnProperty,Ji=Object.prototype.propertyIsEnumerable;var Xr=s=>{throw TypeError(s)};var Br=(s,t,e)=>t in s?jr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,C=(s,t)=>{for(var e in t||(t={}))Ki.call(t,e)&&Br(s,e,t[e]);if(Fr)for(var e of Fr(t))Ji.call(t,e)&&Br(s,e,t[e]);return s},S=(s,t)=>Xi(s,Wi(t));var l=(s,t,e,r)=>{for(var i=r>1?void 0:r?Yi(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(i=(r?n(t,e,i):n(i))||i);return r&&i&&jr(t,e,i),i};var Yr=(s,t,e)=>t.has(s)||Xr("Cannot "+e);var R=(s,t,e)=>(Yr(s,t,"read from private field"),e?e.call(s):t.get(s)),qt=(s,t,e)=>t.has(s)?Xr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),Wr=(s,t,e,r)=>(Yr(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e);var ie=class extends Event{constructor(t,e,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=e,this.subscribe=r!=null?r:!1}};var we=class{constructor(t,e,r,i){var o;if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(n,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=n,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(n,a)),this.unsubscribe=a},this.host=t,e.context!==void 0){let n=e;this.context=n.context,this.callback=n.callback,this.subscribe=(o=n.subscribe)!=null?o:!1}else this.context=e,this.callback=r,this.subscribe=i!=null?i:!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new ie(this.context,this.t,this.subscribe))}};var Et=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){let r=e||!Object.is(t,this.o);this.o=t,r&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:r}]of this.subscriptions)e(this.o,r)},t!==void 0&&(this.value=t)}addCallback(t,e,r){if(!r)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});let{disposer:i}=this.subscriptions.get(t);t(this.value,i)}clearCallbacks(){this.subscriptions.clear()}};var er=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}},Ce=class extends Et{constructor(t,e,r){var i,o;super(e.context!==void 0?e.initialValue:r),this.onContextRequest=n=>{let a=n.composedPath()[0];n.context===this.context&&a!==this.host&&(n.stopPropagation(),this.addCallback(n.callback,a,n.subscribe))},this.onProviderRequest=n=>{let a=n.composedPath()[0];if(n.context!==this.context||a===this.host)return;let c=new Set;for(let[p,{consumerHost:h}]of this.subscriptions)c.has(p)||(c.add(p),h.dispatchEvent(new ie(this.context,p,!0)));n.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(o=(i=this.host).addController)==null||o.call(i,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new er(this.context))}};function tr({context:s}){return(t,e)=>{let r=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){r.set(this,new Ce(this,{context:s}))}),{get(){return t.get.call(this)},set(i){var o;return(o=r.get(this))==null||o.setValue(i),t.set.call(this,i)},init(i){var o;return(o=r.get(this))==null||o.setValue(i),i}};{t.constructor.addInitializer(n=>{r.set(n,new Ce(n,{context:s}))});let i=Object.getOwnPropertyDescriptor(t,e),o;if(i===void 0){let n=new WeakMap;o={get(){return n.get(this)},set(a){r.get(this).setValue(a),n.set(this,a)},configurable:!0,enumerable:!0}}else{let n=i.set;o=S(C({},i),{set(a){r.get(this).setValue(a),n==null||n.call(this,a)}})}return void Object.defineProperty(t,e,o)}}}function Z({context:s,subscribe:t}){return(e,r)=>{typeof r=="object"?r.addInitializer(function(){new we(this,{context:s,callback:i=>{e.set.call(this,i)},subscribe:t})}):e.constructor.addInitializer(i=>{new we(i,{context:s,callback:o=>{i[r]=o},subscribe:t})})}}var Kr=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(t){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBraileLabel="",this.ariaBraileRoleDescription="",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=t}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var Jr=new WeakMap,Ie=s=>{let t=Jr.get(s);return t===void 0&&Jr.set(s,t=new Map),t},Gi=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(Ie(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}setAttribute(t,e){Ie(this).set(t,String(e))}removeAttribute(t){Ie(this).delete(t)}toggleAttribute(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}hasAttribute(t){return Ie(this).has(t)}attachShadow(t){let e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let t=new Kr(this);return this.__internals=t,t}getAttribute(t){let e=Ie(this).get(t);return e!=null?e:null}};var Qi=class extends Gi{},Zr=Qi;var es=class{constructor(){this.__definitions=new Map}define(t,e){var r;if(this.__definitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);this.__definitions.set(t,{ctor:e,observedAttributes:(r=e.observedAttributes)!=null?r:[]})}get(t){let e=this.__definitions.get(t);return e==null?void 0:e.ctor}},ts=es;var Gr=new ts;var Ue=globalThis,wt=Ue.ShadowRoot&&(Ue.ShadyCSS===void 0||Ue.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rr=Symbol(),Qr=new WeakMap,ze=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==rr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(wt&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=Qr.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&Qr.set(e,t))}return t}toString(){return this.cssText}},ei=s=>new ze(typeof s=="string"?s:s+"",void 0,rr),b=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((r,i,o)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[o+1],s[0]);return new ze(e,s,rr)},ir=(s,t)=>{if(wt)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),i=Ue.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=e.cssText,s.appendChild(r)}},Ct=wt||Ue.CSSStyleSheet===void 0?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return ei(e)})(s):s;var{is:rs,defineProperty:is,getOwnPropertyDescriptor:ss,getOwnPropertyNames:os,getOwnPropertySymbols:ns,getPrototypeOf:as}=Object,I=globalThis,ii;(ii=I.customElements)!=null||(I.customElements=Gr);var ti=I.trustedTypes,ls=ti?ti.emptyScript:"",sr=I.reactiveElementPolyfillSupport,Fe=(s,t)=>s,Be={toAttribute(s,t){switch(t){case Boolean:s=s?ls:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch(r){e=null}}return e}},kt=(s,t)=>!rs(s,t),ri={attribute:!0,type:String,converter:Be,reflect:!1,hasChanged:kt},si,oi;(si=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(oi=I.litPropertyMetadata)!=null||(I.litPropertyMetadata=new WeakMap);var ni,G=class extends((ni=globalThis.HTMLElement)!=null?ni:Zr){static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=ri){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(t,r,e);i!==void 0&&is(this.prototype,t,i)}}static getPropertyDescriptor(t,e,r){var n;let{get:i,set:o}=(n=ss(this.prototype,t))!=null?n:{get(){return this[e]},set(a){this[e]=a}};return{get(){return i==null?void 0:i.call(this)},set(a){let c=i==null?void 0:i.call(this);o.call(this,a),this.requestUpdate(t,c,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:ri}static _$Ei(){if(this.hasOwnProperty(Fe("elementProperties")))return;let t=as(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Fe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Fe("properties"))){let e=this.properties,r=[...os(e),...ns(e)];for(let i of r)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,i]of e)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let i=this._$Eu(e,r);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let i of r)e.unshift(Ct(i))}else t!==void 0&&e.push(Ct(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,r;((e=this._$EO)!=null?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return ir(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var r;return(r=e.hostDisconnected)==null?void 0:r.call(e)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EC(t,e){var o;let r=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,r);if(i!==void 0&&r.reflect===!0){let n=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:Be).toAttribute(e,r.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){var o;let r=this.constructor,i=r._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=r.getPropertyOptions(i),a=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:Be;this._$Em=i,this[i]=a.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,r){var i;if(t!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(t)),!((i=r.hasChanged)!=null?i:kt)(this[t],e))return;this.P(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,r){var i;this._$AL.has(t)||this._$AL.set(t,e),r.reflect===!0&&this._$Em!==t&&((i=this._$Ej)!=null?i:this._$Ej=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,a]of o)a.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],a)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(e)):this._$EU()}catch(o){throw t=!1,this._$EU(),o}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}},ai;G.elementStyles=[],G.shadowRootOptions={mode:"open"},G[Fe("elementProperties")]=new Map,G[Fe("finalized")]=new Map,sr==null||sr({ReactiveElement:G}),((ai=I.reactiveElementVersions)!=null?ai:I.reactiveElementVersions=[]).push("2.0.4");var ke=globalThis,_t=ke.trustedTypes,li=_t?_t.createPolicy("lit-html",{createHTML:s=>s}):void 0,ar="$lit$",Q=`lit$${Math.random().toFixed(9).slice(2)}$`,lr="?"+Q,cs=`<${lr}>`,be=ke.document===void 0?{createTreeWalker:()=>({})}:document,Xe=()=>be.createComment(""),Ye=s=>s===null||typeof s!="object"&&typeof s!="function",cr=Array.isArray,fi=s=>cr(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",or=`[
2
+ \f\r]`,je=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ci=/-->/g,di=/>/g,fe=RegExp(`>|${or}(?:([^\\s"'>=/]+)(${or}*=${or}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),pi=/'/g,ui=/"/g,gi=/^(?:script|style|textarea|title)$/i,dr=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),u=dr(1),pr=dr(2),_o=dr(3),L=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),hi=new WeakMap,ge=be.createTreeWalker(be,129);function bi(s,t){if(!cr(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return li!==void 0?li.createHTML(t):t}var vi=(s,t)=>{let e=s.length-1,r=[],i,o=t===2?"<svg>":t===3?"<math>":"",n=je;for(let a=0;a<e;a++){let c=s[a],p,h,g=-1,y=0;for(;y<c.length&&(n.lastIndex=y,h=n.exec(c),h!==null);)y=n.lastIndex,n===je?h[1]==="!--"?n=ci:h[1]!==void 0?n=di:h[2]!==void 0?(gi.test(h[2])&&(i=RegExp("</"+h[2],"g")),n=fe):h[3]!==void 0&&(n=fe):n===fe?h[0]===">"?(n=i!=null?i:je,g=-1):h[1]===void 0?g=-2:(g=n.lastIndex-h[2].length,p=h[1],n=h[3]===void 0?fe:h[3]==='"'?ui:pi):n===ui||n===pi?n=fe:n===ci||n===di?n=je:(n=fe,i=void 0);let v=n===fe&&s[a+1].startsWith("/>")?" ":"";o+=n===je?c+cs:g>=0?(r.push(p),c.slice(0,g)+ar+c.slice(g)+Q+v):c+Q+(g===-2?a:v)}return[bi(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},We=class s{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let o=0,n=0,a=t.length-1,c=this.parts,[p,h]=vi(t,e);if(this.el=s.createElement(p,r),ge.currentNode=this.el.content,e===2||e===3){let g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(i=ge.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let g of i.getAttributeNames())if(g.endsWith(ar)){let y=h[n++],v=i.getAttribute(g).split(Q),w=/([.?@])?(.*)/.exec(y);c.push({type:1,index:o,name:w[2],strings:v,ctor:w[1]==="."?St:w[1]==="?"?Tt:w[1]==="@"?Rt:ye}),i.removeAttribute(g)}else g.startsWith(Q)&&(c.push({type:6,index:o}),i.removeAttribute(g));if(gi.test(i.tagName)){let g=i.textContent.split(Q),y=g.length-1;if(y>0){i.textContent=_t?_t.emptyScript:"";for(let v=0;v<y;v++)i.append(g[v],Xe()),ge.nextNode(),c.push({type:2,index:++o});i.append(g[y],Xe())}}}else if(i.nodeType===8)if(i.data===lr)c.push({type:2,index:o});else{let g=-1;for(;(g=i.data.indexOf(Q,g+1))!==-1;)c.push({type:7,index:o}),g+=Q.length-1}o++}}static createElement(t,e){let r=be.createElement("template");return r.innerHTML=t,r}};function ve(s,t,e=s,r){var n,a,c;if(t===L)return t;let i=r!==void 0?(n=e.o)==null?void 0:n[r]:e.l,o=Ye(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),o===void 0?i=void 0:(i=new o(s),i._$AT(s,e,r)),r!==void 0?((c=e.o)!=null?c:e.o=[])[r]=i:e.l=i),i!==void 0&&(t=ve(s,i._$AS(s,t.values),i,r)),t}var At=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var p;let{el:{content:e},parts:r}=this._$AD,i=((p=t==null?void 0:t.creationScope)!=null?p:be).importNode(e,!0);ge.currentNode=i;let o=ge.nextNode(),n=0,a=0,c=r[0];for(;c!==void 0;){if(n===c.index){let h;c.type===2?h=new _e(o,o.nextSibling,this,t):c.type===1?h=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(h=new $t(o,this,t)),this._$AV.push(h),c=r[++a]}n!==(c==null?void 0:c.index)&&(o=ge.nextNode(),n++)}return ge.currentNode=be,i}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},_e=class s{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this.v}constructor(t,e,r,i){var o;this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this.v=(o=i==null?void 0:i.isConnected)!=null?o:!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ve(this,t,e),Ye(t)?t===E||t==null||t===""?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==L&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):fi(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==E&&Ye(this._$AH)?this._$AA.nextSibling.data=t:this.T(be.createTextNode(t)),this._$AH=t}$(t){var o;let{values:e,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=We.createElement(bi(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{let n=new At(i,this),a=n.u(this.options);n.p(e),this.T(a),this._$AH=n}}_$AC(t){let e=hi.get(t.strings);return e===void 0&&hi.set(t.strings,e=new We(t)),e}k(t){cr(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,i=0;for(let o of t)i===e.length?e.push(r=new s(this.O(Xe()),this.O(Xe()),this,this.options)):r=e[i],r._$AI(o),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t&&t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this.v=t,(e=this._$AP)==null||e.call(this,t))}},ye=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,i,o){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=e,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=E}_$AI(t,e=this,r,i){let o=this.strings,n=!1;if(o===void 0)t=ve(this,t,e,0),n=!Ye(t)||t!==this._$AH&&t!==L,n&&(this._$AH=t);else{let a=t,c,p;for(t=o[0],c=0;c<o.length-1;c++)p=ve(this,a[r+c],e,c),p===L&&(p=this._$AH[c]),n||(n=!Ye(p)||p!==this._$AH[c]),p===E?t=E:t!==E&&(t+=(p!=null?p:"")+o[c+1]),this._$AH[c]=p}n&&!i&&this.j(t)}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},St=class extends ye{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E?void 0:t}},Tt=class extends ye{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}},Rt=class extends ye{constructor(t,e,r,i,o){super(t,e,r,i,o),this.type=5}_$AI(t,e=this){var n;if((t=(n=ve(this,t,e,0))!=null?n:E)===L)return;let r=this._$AH,i=t===E&&r!==E||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==E&&(r===E||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,r;typeof this._$AH=="function"?this._$AH.call((r=(e=this.options)==null?void 0:e.host)!=null?r:this.element,t):this._$AH.handleEvent(t)}},$t=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){ve(this,t)}},yi={M:ar,P:Q,A:lr,C:1,L:vi,R:At,D:fi,V:ve,I:_e,H:ye,N:Tt,U:Rt,B:St,F:$t},nr=ke.litHtmlPolyfillSupport,mi;nr==null||nr(We,_e),((mi=ke.litHtmlVersions)!=null?mi:ke.litHtmlVersions=[]).push("3.2.0");var xi=(s,t,e)=>{var o,n;let r=(o=e==null?void 0:e.renderBefore)!=null?o:t,i=r._$litPart$;if(i===void 0){let a=(n=e==null?void 0:e.renderBefore)!=null?n:null;r._$litPart$=i=new _e(t.insertBefore(Xe(),a),a,void 0,e!=null?e:{})}return i._$AI(s),i};var f=class extends G{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var e,r;let t=super.createRenderRoot();return(r=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=xi(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.o)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.o)==null||t.setConnected(!1)}render(){return L}},qi;f._$litElement$=!0,f.finalized=!0,(qi=globalThis.litElementHydrateSupport)==null||qi.call(globalThis,{LitElement:f});var ur=globalThis.litElementPolyfillSupport;ur==null||ur({LitElement:f});var Ei;((Ei=globalThis.litElementVersions)!=null?Ei:globalThis.litElementVersions=[]).push("4.1.0");var m=s=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(s,t)}):customElements.define(s,t)};var ds={attribute:!0,type:String,converter:Be,reflect:!1,hasChanged:kt},ps=(s=ds,t,e)=>{let{kind:r,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,s),r==="accessor"){let{name:n}=e;return{set(a){let c=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,c,s)},init(a){return a!==void 0&&this.P(n,void 0,s),a}}}if(r==="setter"){let{name:n}=e;return function(a){let c=this[n];t.call(this,a),this.requestUpdate(n,c,s)}}throw Error("Unsupported decorator location: "+r)};function d(s){return(t,e)=>typeof e=="object"?ps(s,t,e):((r,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?S(C({},r),{wrapped:!0}):r),n?Object.getOwnPropertyDescriptor(i,o):void 0})(s,t,e)}function q(s){return d(S(C({},s),{state:!0,attribute:!1}))}var se=(s,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(s,t,e),e);function Ke(s,t){return(e,r,i)=>{let o=n=>{var a,c;return(c=(a=n.renderRoot)==null?void 0:a.querySelector(s))!=null?c:null};if(t){let{get:n,set:a}=typeof r=="object"?e:i!=null?i:(()=>{let c=Symbol();return{get(){return this[c]},set(p){this[c]=p}}})();return se(e,r,{get(){let c=n.call(this);return c===void 0&&(c=o(this),(c!==null||this.hasUpdated)&&a.call(this,c)),c}})}return se(e,r,{get(){return o(this)}})}}function wi(s){return(t,e)=>{let{slot:r,selector:i}=s!=null?s:{},o="slot"+(r?`[name=${r}]`:":not([name])");return se(t,e,{get(){var c,p;let n=(c=this.renderRoot)==null?void 0:c.querySelector(o),a=(p=n==null?void 0:n.assignedElements(s))!=null?p:[];return i===void 0?a:a.filter(h=>h.matches(i))}})}}function A(s,t){let e=C({waitUntilFirstUpdate:!1},t);return(r,i)=>{let{update:o}=r,n=Array.isArray(s)?s:[s];r.update=function(a){n.forEach(c=>{let p=c;if(a.has(p)){let h=a.get(p),g=this[p];h!==g&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[i](h,g)}}),o.call(this,a)}}}var Ci=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],U="item";var H=class extends f{constructor(){super();this.identifier="";this.adaptive="false";this.timeDependent=null;this._handleDisabledChange=(e,r)=>{this._interactionElements.forEach(i=>i.disabled=r)};this._handleReadonlyChange=(e,r)=>this._interactionElements.forEach(i=>i.readonly=r);this._context={identifier:this.getAttribute("identifier"),variables:Ci};this._initialContext=S(C({},this._context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];this.addEventListener("qti-register-variable",e=>{this._context=S(C({},this._context),{variables:[...this._context.variables,e.detail.variable]}),this._initialContext=this._context,e.stopPropagation()}),this.addEventListener("qti-register-feedback",e=>{e.stopPropagation();let r=e.detail;this._feedbackElements.push(r),r.checkShowFeedback(r.outcomeIdentifier)}),this.addEventListener("qti-register-interaction",e=>{e.stopPropagation(),this._interactionElements.push(e.target)}),this.addEventListener("end-attempt",e=>{let{responseIdentifier:r,countAttempt:i}=e.detail;this.updateResponseVariable(r,"true"),this.processResponse(i)}),this.addEventListener("qti-set-outcome-value",e=>{let{outcomeIdentifier:r,value:i}=e.detail;this.updateOutcomeVariable(r,i),e.stopPropagation()}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}get variables(){return this._context.variables.map(e=>C({identifier:e.identifier,value:e.value,type:e.type},e.type==="outcome"&&e.identifier==="SCORE"?{externalScored:e.externalScored}:{}))}set variables(e){if(!Array.isArray(e)||e.some(r=>!("identifier"in r))){console.warn("variables property should be an array of VariableDeclaration");return}this._context=S(C({},this._context),{variables:this._context.variables.map(r=>{let i=e.find(o=>o.identifier===r.identifier);return i?C(C({},r),i):r})}),this._context.variables.forEach(r=>{if(r.type==="response"){let i=this._interactionElements.find(o=>o.responseIdentifier===r.identifier);i&&(i.response=r.value)}r.type==="outcome"&&this._feedbackElements.forEach(i=>i.checkShowFeedback(r.identifier))})}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this._emit("qti-assessment-item-connected",this)}set responses(e){if(e)for(let r of e){this.getResponse(r.responseIdentifier)&&this.updateResponseVariable(r.responseIdentifier,r.response);let o=this._interactionElements.find(n=>n.getAttribute("response-identifier")===r.responseIdentifier);o&&(o.response=r.response)}}render(){return u`<slot></slot>`}showCorrectResponse(e){let i=this._context.variables.filter(o=>"correctResponse"in o&&o.correctResponse).map(o=>({responseIdentifier:o.identifier,response:o.correctResponse}));for(let o of i){let n=this._interactionElements.find(a=>a.getAttribute("response-identifier")===o.responseIdentifier);n&&(n.correctResponse=e?o.response:"")}}processResponse(e=!0){var i;let r=this.querySelector("qti-response-processing");return!r||!r.process?!1:(r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),e&&this.updateOutcomeVariable("numAttempts",(+((i=this._context.variables.find(o=>o.identifier==="numAttempts"))==null?void 0:i.value)+1).toString()),this._emit("qti-response-processed"),!0)}resetResponses(){this._context=this._initialContext}getResponse(e){return this.getVariable(e)}getOutcome(e){return this.getVariable(e)}getVariable(e){return this._context.variables.find(r=>r.identifier===e)||null}handleUpdateResponseVariable(e){let{responseIdentifier:r,response:i}=e.detail;this.updateResponseVariable(r,i)}updateResponseVariable(e,r){this._context=S(C({},this._context),{variables:this._context.variables.map(i=>i.identifier!==e?i:S(C({},i),{value:r}))}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:e,response:Array.isArray(r)?[...r]:r}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}updateOutcomeVariable(e,r){var o;let i=this.getOutcome(e);if(!i){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}this._context=S(C({},this._context),{variables:this._context.variables.map(n=>n.identifier!==e?n:S(C({},n),{value:i.cardinality==="single"?r:[...n.value,r]}))}),this._feedbackElements.forEach(n=>n.checkShowFeedback(e)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:e,value:(o=this._context.variables.find(n=>n.identifier===e))==null?void 0:o.value})}_getCompletionStatus(){return this._interactionElements.every(e=>e.validate())?"completed":this._interactionElements.some(e=>e.validate())?"incomplete":"not_attempted"}_emit(e,r=null){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:r}))}};l([d({type:String})],H.prototype,"title",2),l([d({type:String})],H.prototype,"identifier",2),l([d({type:String})],H.prototype,"adaptive",2),l([d({type:String})],H.prototype,"timeDependent",2),l([d({type:Boolean})],H.prototype,"disabled",2),l([A("disabled",{waitUntilFirstUpdate:!0})],H.prototype,"_handleDisabledChange",2),l([d({type:Boolean})],H.prototype,"readonly",2),l([A("readonly",{waitUntilFirstUpdate:!0})],H.prototype,"_handleReadonlyChange",2),l([tr({context:U})],H.prototype,"_context",2),H=l([m("qti-assessment-item")],H);var us=String.raw,Je=()=>{let s,t={async load(e,r=!1){return new Promise((i,o)=>{fr(e,r).then(n=>(s=n,i(t)))})},parse(e){return s=gr(e),t},path:e=>(fs(s,e),t),fn(e){return e(s),t},pciHooks(e){let r=["hook","module"],i=e.substring(0,e.lastIndexOf("/"));for(let o of r)s.querySelectorAll("["+o+"]").forEach(a=>{let c=a.getAttribute(o);!c.startsWith("data:")&&!c.startsWith("http")&&(a.setAttribute("base-url",e),a.setAttribute("module",i+"/"+encodeURIComponent(c+(c.endsWith(".js")?"":".js"))))});return t},customInteraction(e,r){let i=s.querySelector("qti-custom-interaction"),o=i.querySelector("object");return i.setAttribute("data-base-ref",e),i.setAttribute("data-base-item",e+r),i.setAttribute("data",o.getAttribute("data")),i.setAttribute("width",o.getAttribute("width")),i.setAttribute("height",o.getAttribute("height")),i.removeChild(o),t},convertCDATAtoComment(){return gs(s),t},stripStyleSheets(){return bs(s),t},html(){return new XMLSerializer().serializeToString(Mt(s))},xml(){return new XMLSerializer().serializeToString(s)},htmldoc(){return Mt(s)},xmldoc(){return s}};return t},mr=()=>{let s,t={async load(e){return new Promise((r,i)=>{fr(e).then(o=>(s=o,r(t)))})},parse(e){s=gr(e)},assessmentTest(){let e=s.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:e.getAttribute("href"),identifier:e.getAttribute("identifier")}}};return t},Lt=()=>{let s,t={async load(e){return new Promise((r,i)=>{fr(e).then(o=>(s=o,r(t)))})},parse(e){return s=gr(e),t},fn(e){return e(s),t},items(){return ms(s)},html(){return new XMLSerializer().serializeToString(Mt(s))},xml(){return new XMLSerializer().serializeToString(s)},htmldoc(){return Mt(s)},xmldoc(){return s}};return t},hs=us`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
4
  <xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
5
5
  <xsl:template match="@*|node()">
6
6
  <xsl:copy>
@@ -22,23 +22,23 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
22
22
  <xsl:apply-templates/>
23
23
  </xsl:element>
24
24
  </xsl:template>
25
- </xsl:stylesheet>`;function ei(i){let t=[];return i.querySelectorAll("qti-assessment-item-ref").forEach(e=>{let r=e.getAttribute("identifier"),s=e.getAttribute("href"),o=e.getAttribute("category");t.push({identifier:r,href:s,category:o})}),t}var or=null;function nr(i,t=!0){return t&&or!==null&&or.abort(),new Promise((e,r)=>{let s=new XMLHttpRequest;or=s,s.open("GET",i,!0),s.responseType="document",s.onload=()=>{s.status>=200&&s.status<300?e(s.responseXML):r(s.statusText)},s.onerror=()=>{r(s.statusText)},s.send()})}function ar(i){return new DOMParser().parseFromString(i,"text/xml")}function At(i){let t=new XSLTProcessor,e=new DOMParser().parseFromString(Qs,"text/xml");return t.importStylesheet(e),t.transformToFragment(i,document)}function ti(i,t){t.endsWith("/")||(t+="/"),i.querySelectorAll("[src],[href],[primary-path]").forEach(e=>{var o;let r="";e.getAttribute("src")&&(r="src"),e.getAttribute("href")&&(r="href"),e.getAttribute("primary-path")&&(r="primary-path");let s=(o=e.getAttribute(r))==null?void 0:o.trim();if(!s.startsWith("data:")&&!s.startsWith("http")){let n=t+encodeURI(s);e.setAttribute(r,n)}})}function ri(i){i.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(e=>{let r=document.createComment(e.textContent);e.replaceChild(r,e.firstChild)})}function si(i){i.querySelectorAll("qti-stylesheet").forEach(t=>t.remove())}var qe=class extends f{constructor(){super(...arguments);this.identifier="";this.href=""}async connectedCallback(){super.connectedCallback();let e=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0});if(this.dispatchEvent(e)){let o=this.closest("qti-assessment-item").querySelector(`[data-stimulus-idref=${this.identifier}]`);o?await this.loadAndAppendStimulus(o):console.warn(`Stimulus with data-stimulus-idref ${this.identifier} not found`)}}async loadAndAppendStimulus(e){var o;let r=this.href.substring(0,this.href.lastIndexOf("/")),s=await us().load(this.href).then(n=>n.path(r).htmldoc());if(s){let n=s.querySelectorAll("qti-stimulus-body, qti-stylesheet");e.append(...n),((o=s.querySelector("qti-assessment-stimulus"))==null?void 0:o.title).includes("(lijst)")&&e.classList.add("qti-stimulus-list")}}};l([p({type:String})],qe.prototype,"identifier",2),l([p({type:String})],qe.prototype,"href",2),qe=l([m("qti-assessment-stimulus-ref")],qe);var ii={SPACE:32},k=class extends f{constructor(){super(...arguments);this.tabindex=0;this.disabled=!1;this.readonly=!1;this.checked=!1}handleDisabledChange(e,r){r?(this.tabindex=void 0,this.blur()):this.tabIndex=0}connectedCallback(){super.connectedCallback(),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-register-choice",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-loose-choice",{bubbles:!0,cancelable:!1,composed:!0}))}reset(){this.checked=!1,this.disabled=!1}_onKeyUp(e){if(!e.altKey)switch(e.keyCode){case ii.SPACE:e.preventDefault(),this._toggleChecked();break;default:}}_onClick(){this._toggleChecked()}_toggleChecked(){this.disabled||this.readonly||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("qti-choice-element-selected",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier,checked:this.checked}})))}render(){return u` <slot></slot> `}};l([p({type:String})],k.prototype,"identifier",2),l([p({type:Number,reflect:!0})],k.prototype,"tabindex",2),l([p({reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:e=>e}})],k.prototype,"disabled",2),l([p({reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:e=>e}})],k.prototype,"readonly",2),l([p({reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:e=>e}})],k.prototype,"checked",2),l([S("disabled",{waitUntilFirstUpdate:!0})],k.prototype,"handleDisabledChange",1);var hs=b`
25
+ </xsl:stylesheet>`;function ms(s){let t=[];return s.querySelectorAll("qti-assessment-item-ref").forEach(e=>{let r=e.getAttribute("identifier"),i=e.getAttribute("href"),o=e.getAttribute("category");t.push({identifier:r,href:i,category:o})}),t}var hr=null;function fr(s,t=!0){return t&&hr!==null&&hr.abort(),new Promise((e,r)=>{let i=new XMLHttpRequest;hr=i,i.open("GET",s,!0),i.responseType="document",i.onload=()=>{i.status>=200&&i.status<300?e(i.responseXML):r(i.statusText)},i.onerror=()=>{r(i.statusText)},i.send()})}function gr(s){return new DOMParser().parseFromString(s,"text/xml")}function Mt(s){let t=new XSLTProcessor,e=new DOMParser().parseFromString(hs,"text/xml");return t.importStylesheet(e),t.transformToFragment(s,document)}function fs(s,t){t.endsWith("/")||(t+="/"),s.querySelectorAll("[src],[href],[primary-path]").forEach(e=>{var o;let r="";e.getAttribute("src")&&(r="src"),e.getAttribute("href")&&(r="href"),e.getAttribute("primary-path")&&(r="primary-path");let i=(o=e.getAttribute(r))==null?void 0:o.trim();if(!i.startsWith("data:")&&!i.startsWith("http")){let n=t+encodeURI(i);e.setAttribute(r,n)}})}function gs(s){s.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(e=>{let r=document.createComment(e.textContent);e.replaceChild(r,e.firstChild)})}function bs(s){s.querySelectorAll("qti-stylesheet").forEach(t=>t.remove())}var Ae=class extends f{constructor(){super(...arguments);this.identifier="";this.href=""}async connectedCallback(){super.connectedCallback();let e=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0});if(this.dispatchEvent(e)){let o=this.closest("qti-assessment-item").querySelector(`[data-stimulus-idref=${this.identifier}]`);o?await this.loadAndAppendStimulus(o):console.warn(`Stimulus with data-stimulus-idref ${this.identifier} not found`)}}async loadAndAppendStimulus(e){var o;let r=this.href.substring(0,this.href.lastIndexOf("/")),i=await Je().load(this.href).then(n=>n.path(r).htmldoc());if(i){let n=i.querySelectorAll("qti-stimulus-body, qti-stylesheet");e.append(...n),((o=i.querySelector("qti-assessment-stimulus"))==null?void 0:o.title).includes("(lijst)")&&e.classList.add("qti-stimulus-list")}}};l([d({type:String})],Ae.prototype,"identifier",2),l([d({type:String})],Ae.prototype,"href",2),Ae=l([m("qti-assessment-stimulus-ref")],Ae);var vs={SPACE:32},M=class extends f{constructor(){super(...arguments);this.tabindex=0;this.disabled=!1;this.readonly=!1;this.checked=!1}handleDisabledChange(e,r){r?(this.tabindex=void 0,this.blur()):this.tabIndex=0}connectedCallback(){super.connectedCallback(),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-register-choice",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-loose-choice",{bubbles:!0,cancelable:!1,composed:!0}))}reset(){this.checked=!1,this.disabled=!1}_onKeyUp(e){if(!e.altKey)switch(e.keyCode){case vs.SPACE:e.preventDefault(),this._toggleChecked();break;default:}}_onClick(){this._toggleChecked()}_toggleChecked(){this.disabled||this.readonly||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("qti-choice-element-selected",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier,checked:this.checked}})))}render(){return u` <slot></slot> `}};l([d({type:String})],M.prototype,"identifier",2),l([d({type:Number,reflect:!0})],M.prototype,"tabindex",2),l([d({reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:e=>e}})],M.prototype,"disabled",2),l([d({reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:e=>e}})],M.prototype,"readonly",2),l([d({reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:e=>e}})],M.prototype,"checked",2),l([A("disabled",{waitUntilFirstUpdate:!0})],M.prototype,"handleDisabledChange",1);var ki=b`
26
26
  :host {
27
27
  display: block;
28
28
  }
29
- `;var Ae=class extends f{render(){return u`<slot name="qti-rubric-block"></slot><slot></slot>`}};Ae.styles=hs,Ae=l([m("qti-item-body")],Ae);var wt=class extends f{render(){return u`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};wt=l([m("qti-prompt")],wt);var St=class extends f{firstUpdated(t){super.firstUpdated(t);let e=this,r=this.getAttribute("href");if(r!==null){let s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.media="screen",s.href=r,e.appendChild(s),this.styleLink=s}if(this.textContent!==null){let s=document.createElement("style");s.media="screen",s.textContent=this.textContent,e.appendChild(s),this.styleLink=s}}disconnectedCallback(){if(this.styleLink)try{this.styleLink.remove()}catch(t){console.log("could not remove stylesheet")}}};St=l([m("qti-stylesheet")],St);var se=class extends f{render(){return u`<slot></slot>`}defaultValues(t){let e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;let r=e.map(s=>s.innerHTML);return r.length>1||t.cardinality==="multiple"||t.cardinality==="ordered"?r:r[0]}};se=l([m("qti-variabledeclaration")],se);var I=class extends se{constructor(){super(...arguments);this.externalScored=null}render(){var r,s;let e=(s=(r=this.itemContext)==null?void 0:r.variables.find(o=>o.identifier===this.identifier))==null?void 0:s.value;return u`${JSON.stringify(e,null,2)}`}get interpolationTable(){let e=this.querySelector("qti-interpolation-table");if(e){let r=new Map;for(let s of e.querySelectorAll("qti-interpolation-table-entry")){!s.getAttribute("source-value")&&s.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");let o=parseInt(s.getAttribute("source-value")),n=parseInt(s.getAttribute("target-value"));(isNaN(o)||isNaN(n))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),r.set(o,n)}return r}return null}connectedCallback(){super.connectedCallback();let e={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}};I.styles=[b`
29
+ `;var Se=class extends f{render(){return u`<slot name="qti-rubric-block"></slot><slot></slot>`}};Se.styles=ki,Se=l([m("qti-item-body")],Se);var Ht=class extends f{render(){return u`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};Ht=l([m("qti-prompt")],Ht);var Pt=class extends f{firstUpdated(t){super.firstUpdated(t);let e=this,r=this.getAttribute("href");if(r!==null){let i=document.createElement("link");i.rel="stylesheet",i.type="text/css",i.media="screen",i.href=r,e.appendChild(i),this.styleLink=i}if(this.textContent!==null){let i=document.createElement("style");i.media="screen",i.textContent=this.textContent,e.appendChild(i),this.styleLink=i}}disconnectedCallback(){if(this.styleLink)try{this.styleLink.remove()}catch(t){console.log("could not remove stylesheet")}}};Pt=l([m("qti-stylesheet")],Pt);var oe=class extends f{render(){return u`<slot></slot>`}defaultValues(t){let e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;let r=e.map(i=>i.innerHTML);return r.length>1||t.cardinality==="multiple"||t.cardinality==="ordered"?r:r[0]}};oe=l([m("qti-variabledeclaration")],oe);var z=class extends oe{constructor(){super(...arguments);this.externalScored=null}render(){var r,i;let e=(i=(r=this.itemContext)==null?void 0:r.variables.find(o=>o.identifier===this.identifier))==null?void 0:i.value;return u`${JSON.stringify(e,null,2)}`}get interpolationTable(){let e=this.querySelector("qti-interpolation-table");if(e){let r=new Map;for(let i of e.querySelectorAll("qti-interpolation-table-entry")){!i.getAttribute("source-value")&&i.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");let o=parseInt(i.getAttribute("source-value")),n=parseInt(i.getAttribute("target-value"));(isNaN(o)||isNaN(n))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),r.set(o,n)}return r}return null}connectedCallback(){super.connectedCallback();let e={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}};z.styles=[b`
30
30
  :host {
31
31
  display: none;
32
32
  }
33
- `],l([p({type:String,attribute:"base-type"})],I.prototype,"baseType",2),l([p({type:String,attribute:"external-scored"})],I.prototype,"externalScored",2),l([p({type:String})],I.prototype,"identifier",2),l([p({type:String})],I.prototype,"cardinality",2),l([K({context:O,subscribe:!0}),E()],I.prototype,"itemContext",2),I=l([m("qti-outcome-declaration")],I);var G=class extends se{render(){var e,r;let t=(r=(e=this.itemContext)==null?void 0:e.variables.find(s=>s.identifier===this.identifier))==null?void 0:r.value;return u`${JSON.stringify(t,null,2)}`}connectedCallback(){super.connectedCallback();let 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}}))}get correctResponse(){let t,e=this.querySelector("qti-correct-response");if(e){let r=e.querySelectorAll("qti-value");if(this.cardinality==="single"&&r.length>0)t=r[0].textContent,r[0].remove();else if(this.cardinality!=="single"){t=[];for(let s=0;s<r.length;s++)t.push(r[s].textContent),r[s].remove()}}return t}get mapping(){return this.querySelector("qti-mapping")}};G.styles=[b`
33
+ `],l([d({type:String,attribute:"base-type"})],z.prototype,"baseType",2),l([d({type:String,attribute:"external-scored"})],z.prototype,"externalScored",2),l([d({type:String})],z.prototype,"identifier",2),l([d({type:String})],z.prototype,"cardinality",2),l([Z({context:U,subscribe:!0}),q()],z.prototype,"itemContext",2),z=l([m("qti-outcome-declaration")],z);var ee=class extends oe{render(){var e,r;let t=(r=(e=this.itemContext)==null?void 0:e.variables.find(i=>i.identifier===this.identifier))==null?void 0:r.value;return u`${JSON.stringify(t,null,2)}`}connectedCallback(){super.connectedCallback();let 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}}))}get correctResponse(){let t,e=this.querySelector("qti-correct-response");if(e){let r=e.querySelectorAll("qti-value");if(this.cardinality==="single"&&r.length>0)t=r[0].textContent,r[0].remove();else if(this.cardinality!=="single"){t=[];for(let i=0;i<r.length;i++)t.push(r[i].textContent),r[i].remove()}}return t}get mapping(){return this.querySelector("qti-mapping")}};ee.styles=[b`
34
34
  :host {
35
35
  display: none;
36
36
  }
37
- `],l([p({type:String,attribute:"base-type"})],G.prototype,"baseType",2),l([p({type:String})],G.prototype,"identifier",2),l([p({type:String})],G.prototype,"cardinality",2),l([K({context:O,subscribe:!0}),E()],G.prototype,"itemContext",2),G=l([m("qti-response-declaration")],G);var Tt=class extends f{};Tt=l([m("qti-companion-materials-info")],Tt);var Rt=class extends f{render(){return u`<slot></slot>`}};Rt=l([m("qti-content-body")],Rt);var U=class extends f{handleclassNamesChange(t,e){this.classNames.split(" ").forEach(s=>{switch(s){case"qti-rubric-discretionary-placement":this.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":this.setAttribute("slot","");break;default:break}})}render(){return u`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-rubric-block")}};U.styles=b`
37
+ `],l([d({type:String,attribute:"base-type"})],ee.prototype,"baseType",2),l([d({type:String})],ee.prototype,"identifier",2),l([d({type:String})],ee.prototype,"cardinality",2),l([Z({context:U,subscribe:!0}),q()],ee.prototype,"itemContext",2),ee=l([m("qti-response-declaration")],ee);var Nt=class extends f{};Nt=l([m("qti-companion-materials-info")],Nt);var Vt=class extends f{render(){return u`<slot></slot>`}};Vt=l([m("qti-content-body")],Vt);var F=class extends f{handleclassNamesChange(t,e){this.classNames.split(" ").forEach(i=>{switch(i){case"qti-rubric-discretionary-placement":this.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":this.setAttribute("slot","");break;default:break}})}render(){return u`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-rubric-block")}};F.styles=b`
38
38
  :host {
39
39
  display: block;
40
40
  }
41
- `,l([p({type:String})],U.prototype,"id",2),l([p({type:String})],U.prototype,"use",2),l([p({type:String})],U.prototype,"view",2),l([p({type:String,attribute:"class"})],U.prototype,"classNames",2),l([S("classNames",{waitUntilFirstUpdate:!0})],U.prototype,"handleclassNamesChange",1),U=l([m("qti-rubric-block")],U);var oi=()=>new Intl.NumberFormat().format(.1).replace(/\d/g,""),Ye=i=>{if(typeof i=="string")return i;let t=oi();return t==="."?i.toLocaleString():i.toString().replace(".","").replace(t,".")};function lr(i){return i==null}function We(i){return i.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}var H=class extends f{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}checkShowFeedback(t){let e=this.closest("qti-assessment-item").getOutcome(t);if(this.outcomeIdentifier!==t||!e)return;let r=!1;Array.isArray(e.value)?r=e.value.includes(this.identifier):r=!lr(this.identifier)&&!lr(e==null?void 0:e.value)&&this.identifier===e.value||!1,this.showFeedback(r)}showFeedback(t){this.showStatus=t&&this.showHide==="show"||!t&&this.showHide==="hide"?"on":"off"}};l([p({type:String,attribute:"show-hide"})],H.prototype,"showHide",2),l([p({type:String,attribute:"outcome-identifier"})],H.prototype,"outcomeIdentifier",2),l([p({type:String})],H.prototype,"identifier",2),l([p({type:String,attribute:!1})],H.prototype,"showStatus",2);var Ke=class extends H{render(){return u` <slot part="feedback" class="feedback ${this.showStatus}"></slot> `}firstUpdated(t){this.checkShowFeedback(this.outcomeIdentifier)}};Ke.styles=b`
41
+ `,l([d({type:String})],F.prototype,"id",2),l([d({type:String})],F.prototype,"use",2),l([d({type:String})],F.prototype,"view",2),l([d({type:String,attribute:"class"})],F.prototype,"classNames",2),l([A("classNames",{waitUntilFirstUpdate:!0})],F.prototype,"handleclassNamesChange",1),F=l([m("qti-rubric-block")],F);var ys=()=>new Intl.NumberFormat().format(.1).replace(/\d/g,""),Ze=s=>{if(typeof s=="string")return s;let t=ys();return t==="."?s.toLocaleString():s.toString().replace(".","").replace(t,".")};function br(s){return s==null}function Ge(s){return s.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}var P=class extends f{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}checkShowFeedback(t){let e=this.closest("qti-assessment-item").getOutcome(t);if(this.outcomeIdentifier!==t||!e)return;let r=!1;Array.isArray(e.value)?r=e.value.includes(this.identifier):r=!br(this.identifier)&&!br(e==null?void 0:e.value)&&this.identifier===e.value||!1,this.showFeedback(r)}showFeedback(t){this.showStatus=t&&this.showHide==="show"||!t&&this.showHide==="hide"?"on":"off"}};l([d({type:String,attribute:"show-hide"})],P.prototype,"showHide",2),l([d({type:String,attribute:"outcome-identifier"})],P.prototype,"outcomeIdentifier",2),l([d({type:String})],P.prototype,"identifier",2),l([d({type:String,attribute:!1})],P.prototype,"showStatus",2);var Qe=class extends P{render(){return u` <slot part="feedback" class="feedback ${this.showStatus}"></slot> `}firstUpdated(t){this.checkShowFeedback(this.outcomeIdentifier)}};Qe.styles=b`
42
42
  :host {
43
43
  display: block;
44
44
  }
@@ -48,21 +48,21 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
48
48
  .off {
49
49
  display: none;
50
50
  }
51
- `,Ke=l([m("qti-feedback-block")],Ke);var Je=class extends H{constructor(){super(...arguments);this.render=()=>u` <slot part="feedback" class="${this.showStatus}"></slot> `}};Je.styles=b`
51
+ `,Qe=l([m("qti-feedback-block")],Qe);var et=class extends P{constructor(){super(...arguments);this.render=()=>u` <slot part="feedback" class="${this.showStatus}"></slot> `}};et.styles=b`
52
52
  .on {
53
53
  display: inline-block;
54
54
  }
55
55
  .off {
56
56
  display: none;
57
57
  }
58
- `,Je=l([m("qti-feedback-inline")],Je);var Ze=class extends H{constructor(){super(...arguments);this.render=()=>u` <slot part="feedback" class="${this.showStatus}"></slot> `}};Ze.styles=b`
58
+ `,et=l([m("qti-feedback-inline")],et);var tt=class extends P{constructor(){super(...arguments);this.render=()=>u` <slot part="feedback" class="${this.showStatus}"></slot> `}};tt.styles=b`
59
59
  .on {
60
60
  display: inline-block;
61
61
  }
62
62
  .off {
63
63
  display: none;
64
64
  }
65
- `,Ze=l([m("qti-modal-feedback")],Ze);var F=i=>i!=null?i:_;var A=class extends f{constructor(){super(...arguments);this.responseIdentifier="";this.disabled=!1;this.readonly=!1}set correctResponse(e){console.warn("correctResponse is not implemented")}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}saveResponse(e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,cancelable:!1,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(e)?[...e]:e}}))}};l([p({attribute:"response-identifier"})],A.prototype,"responseIdentifier",2),l([p({reflect:!0,type:Boolean})],A.prototype,"disabled",2),l([p({reflect:!0,type:Boolean})],A.prototype,"readonly",2);var{I:ni}=ns;var fs=i=>i.strings===void 0,ms=()=>document.createComment(""),we=(i,t,e)=>{var o;let r=i._$AA.parentNode,s=t===void 0?i._$AB:t._$AA;if(e===void 0){let n=r.insertBefore(ms(),s),a=r.insertBefore(ms(),s);e=new ni(n,a,i,i.options)}else{let n=e._$AB.nextSibling,a=e._$AM,c=a!==i;if(c){let d;(o=e._$AQ)==null||o.call(e,i),e._$AM=i,e._$AP!==void 0&&(d=i._$AU)!==a._$AU&&e._$AP(d)}if(n!==s||c){let d=e._$AA;for(;d!==n;){let h=d.nextSibling;r.insertBefore(d,s),d=h}}}return e},ie=(i,t,e=i)=>(i._$AI(t,e),i),ai={},gs=(i,t=ai)=>i._$AH=t,bs=i=>i._$AH,$t=i=>{var r;(r=i._$AP)==null||r.call(i,!1,!0);let t=i._$AA,e=i._$AB.nextSibling;for(;t!==e;){let s=t.nextSibling;t.remove(),t=s}};var oe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Q=i=>(...t)=>({_$litDirective$:i,values:t}),B=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this.t=t,this._$AM=e,this.i=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var Ge=(i,t)=>{var r;let e=i._$AN;if(e===void 0)return!1;for(let s of e)(r=s._$AO)==null||r.call(s,t,!1),Ge(s,t);return!0},kt=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while((e==null?void 0:e.size)===0)},vs=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),pi(t)}};function li(i){this._$AN!==void 0?(kt(this),this._$AM=i,vs(this)):this._$AM=i}function ci(i,t=!1,e=0){let r=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(r))for(let o=e;o<r.length;o++)Ge(r[o],!1),kt(r[o]);else r!=null&&(Ge(r,!1),kt(r));else Ge(this,i)}var pi=i=>{var t,e;i.type==oe.CHILD&&((t=i._$AP)!=null||(i._$AP=ci),(e=i._$AQ)!=null||(i._$AQ=li))},Mt=class extends B{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),vs(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,s;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(s=this.disconnected)==null||s.call(this)),e&&(Ge(this,t),kt(this))}setValue(t){if(fs(this.t))this.t._$AI(t,this);else{let e=[...this.t._$AH];e[this.i]=t,this.t._$AI(e,this,0)}}disconnected(){}reconnected(){}};var Lt=()=>new pr,pr=class{},cr=new WeakMap,ys=Q(class extends Mt{render(i){return _}update(i,[t]){var r;let e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(r=i.options)==null?void 0:r.host,this.rt(this.ct=i.element)),_}rt(i){var t;if(this.isConnected||(i=void 0),typeof this.Y=="function"){let e=(t=this.ht)!=null?t:globalThis,r=cr.get(e);r===void 0&&(r=new WeakMap,cr.set(e,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,i),i!==void 0&&this.Y.call(this.ht,i)}else this.Y.value=i}get lt(){var i,t,e;return typeof this.Y=="function"?(t=cr.get((i=this.ht)!=null?i:globalThis))==null?void 0:t.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var j=class extends A{constructor(){super(...arguments);this.textareaRef=Lt();this._value=""}handleclassNamesChange(e,r){this.classNames.split(" ").forEach(o=>{if(o.startsWith("qti-height-lines")){let n=o.replace("qti-height-lines-","");this.textareaRef&&(this.textareaRef.value.rows=parseInt(n))}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
65
+ `,tt=l([m("qti-modal-feedback")],tt);var B=s=>s!=null?s:E;var k=class extends f{constructor(){super(...arguments);this.responseIdentifier="";this.disabled=!1;this.readonly=!1}set correctResponse(e){console.warn("correctResponse is not implemented")}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}saveResponse(e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,cancelable:!1,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(e)?[...e]:e}}))}};l([d({attribute:"response-identifier"})],k.prototype,"responseIdentifier",2),l([d({reflect:!0,type:Boolean})],k.prototype,"disabled",2),l([d({reflect:!0,type:Boolean})],k.prototype,"readonly",2);var{I:xs}=yi;var Ai=s=>s.strings===void 0,_i=()=>document.createComment(""),Te=(s,t,e)=>{var o;let r=s._$AA.parentNode,i=t===void 0?s._$AB:t._$AA;if(e===void 0){let n=r.insertBefore(_i(),i),a=r.insertBefore(_i(),i);e=new xs(n,a,s,s.options)}else{let n=e._$AB.nextSibling,a=e._$AM,c=a!==s;if(c){let p;(o=e._$AQ)==null||o.call(e,s),e._$AM=s,e._$AP!==void 0&&(p=s._$AU)!==a._$AU&&e._$AP(p)}if(n!==i||c){let p=e._$AA;for(;p!==n;){let h=p.nextSibling;r.insertBefore(p,i),p=h}}}return e},ne=(s,t,e=s)=>(s._$AI(t,e),s),qs={},Si=(s,t=qs)=>s._$AH=t,Ti=s=>s._$AH,Dt=s=>{var r;(r=s._$AP)==null||r.call(s,!1,!0);let t=s._$AA,e=s._$AB.nextSibling;for(;t!==e;){let i=t.nextSibling;t.remove(),t=i}};var ae={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},te=s=>(...t)=>({_$litDirective$:s,values:t}),j=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this.t=t,this._$AM=e,this.i=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var rt=(s,t)=>{var r;let e=s._$AN;if(e===void 0)return!1;for(let i of e)(r=i._$AO)==null||r.call(i,t,!1),rt(i,t);return!0},Ot=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while((e==null?void 0:e.size)===0)},Ri=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),Cs(t)}};function Es(s){this._$AN!==void 0?(Ot(this),this._$AM=s,Ri(this)):this._$AM=s}function ws(s,t=!1,e=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let o=e;o<r.length;o++)rt(r[o],!1),Ot(r[o]);else r!=null&&(rt(r,!1),Ot(r));else rt(this,s)}var Cs=s=>{var t,e;s.type==ae.CHILD&&((t=s._$AP)!=null||(s._$AP=ws),(e=s._$AQ)!=null||(s._$AQ=Es))},It=class extends j{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),Ri(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,i;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),e&&(rt(this,t),Ot(this))}setValue(t){if(Ai(this.t))this.t._$AI(t,this);else{let e=[...this.t._$AH];e[this.i]=t,this.t._$AI(e,this,0)}}disconnected(){}reconnected(){}};var Ut=()=>new yr,yr=class{},vr=new WeakMap,$i=te(class extends It{render(s){return E}update(s,[t]){var r;let e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(r=s.options)==null?void 0:r.host,this.rt(this.ct=s.element)),E}rt(s){var t;if(this.isConnected||(s=void 0),typeof this.Y=="function"){let e=(t=this.ht)!=null?t:globalThis,r=vr.get(e);r===void 0&&(r=new WeakMap,vr.set(e,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,t,e;return typeof this.Y=="function"?(t=vr.get((s=this.ht)!=null?s:globalThis))==null?void 0:t.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var X=class extends k{constructor(){super(...arguments);this.textareaRef=Ut();this._value=""}handleclassNamesChange(e,r){this.classNames.split(" ").forEach(o=>{if(o.startsWith("qti-height-lines")){let n=o.replace("qti-height-lines-","");this.textareaRef&&(this.textareaRef.value.rows=parseInt(n))}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
66
66
  /* PK: display host as block, else design will be collapsed */
67
67
  :host {
68
68
  display: block;
@@ -76,20 +76,20 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
76
76
  `]}render(){return u`<slot name="prompt"></slot
77
77
  ><textarea
78
78
  part="textarea"
79
- ${ys(this.textareaRef)}
79
+ ${$i(this.textareaRef)}
80
80
  spellcheck="false"
81
81
  autocomplete="off"
82
82
  @keydown="${e=>e.stopImmediatePropagation()}"
83
83
  @keyup="${this.textChanged}"
84
84
  @change="${this.textChanged}"
85
85
  @blur="${e=>{let r=e.target;r.checkValidity()?r.setCustomValidity(""):(r.setCustomValidity(this.dataset.patternmaskMessage||"Invalid input"),r.reportValidity())}}"
86
- placeholder="${F(this.placeholderText?this.placeholderText:void 0)}"
87
- maxlength="${F(this.expectedLength?this.expectedLength:void 0)}"
88
- pattern="${F(this.patternMask?this.patternMask:void 0)}"
86
+ placeholder="${B(this.placeholderText?this.placeholderText:void 0)}"
87
+ maxlength="${B(this.expectedLength?this.expectedLength:void 0)}"
88
+ pattern="${B(this.patternMask?this.patternMask:void 0)}"
89
89
  ?disabled="${this.disabled}"
90
90
  ?readonly="${this.readonly}"
91
91
  .value=${this._value}
92
- ></textarea>`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};l([p({type:Number,attribute:"expected-length"})],j.prototype,"expectedLength",2),l([p({type:String,attribute:"pattern-mask"})],j.prototype,"patternMask",2),l([p({type:String,attribute:"placeholder-text"})],j.prototype,"placeholderText",2),l([E()],j.prototype,"_value",2),l([p({type:String,attribute:"class"})],j.prototype,"classNames",2),l([S("classNames",{waitUntilFirstUpdate:!0})],j.prototype,"handleclassNamesChange",1),j=l([m("qti-extended-text-interaction")],j);function xs(i,t){let e,r=q({},t);return(s,o)=>{let{connectedCallback:n,disconnectedCallback:a}=s;s.connectedCallback=function(){var h;n.call(this);let c=g=>{let y=Array.from(this.querySelectorAll(i));for(let v of g){let C=Array.from(v.addedNodes).map(R=>R),w=Array.from(v.addedNodes).map(R=>R);v.type==="childList"&&C.find(R=>y.includes(R))&&this[o](C,w)}};e=new MutationObserver(c),e.observe(this,{childList:!0,subtree:!0});let d=(h=this.querySelectorAll(i))!=null?h:[];this[o](Array.from(d),[])},s.disconnectedCallback=function(){a.call(this),e.disconnect()}}}var N=class extends A{constructor(){super(...arguments);this._value="";this._correctValue="";this._size=5;this.inputRef=Lt()}handleclassNamesChange(e,r){r.split(" ").forEach(o=>{if(o.startsWith("qti-input-width")){let n=o.replace("qti-input-width-","");this._size=parseInt(n)}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
92
+ ></textarea>`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};l([d({type:Number,attribute:"expected-length"})],X.prototype,"expectedLength",2),l([d({type:String,attribute:"pattern-mask"})],X.prototype,"patternMask",2),l([d({type:String,attribute:"placeholder-text"})],X.prototype,"placeholderText",2),l([q()],X.prototype,"_value",2),l([d({type:String,attribute:"class"})],X.prototype,"classNames",2),l([A("classNames",{waitUntilFirstUpdate:!0})],X.prototype,"handleclassNamesChange",1),X=l([m("qti-extended-text-interaction")],X);function Mi(s,t){let e,r=C({},t);return(i,o)=>{let{connectedCallback:n,disconnectedCallback:a}=i;i.connectedCallback=function(){var h;n.call(this);let c=g=>{let y=Array.from(this.querySelectorAll(s));for(let v of g){let w=Array.from(v.addedNodes).map(T=>T),_=Array.from(v.addedNodes).map(T=>T);v.type==="childList"&&w.find(T=>y.includes(T))&&this[o](w,_)}};e=new MutationObserver(c),e.observe(this,{childList:!0,subtree:!0});let p=(h=this.querySelectorAll(s))!=null?h:[];this[o](Array.from(p),[])},i.disconnectedCallback=function(){a.call(this),e.disconnect()}}}var N=class extends k{constructor(){super(...arguments);this._value="";this._correctValue="";this._size=5;this.inputRef=Ut()}handleclassNamesChange(e,r){r.split(" ").forEach(o=>{if(o.startsWith("qti-input-width")){let n=o.replace("qti-input-width-","");this._size=parseInt(n)}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
93
93
  [part='correct'] {
94
94
  position: absolute;
95
95
  width: 100%;
@@ -104,15 +104,15 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
104
104
  @keyup="${this.textChanged}"
105
105
  @change="${this.textChanged}"
106
106
  type="${this.patternMask=="[0-9]*"?"number":"text"}"
107
- placeholder="${F(this.placeholderText?this.placeholderText:void 0)}"
107
+ placeholder="${B(this.placeholderText?this.placeholderText:void 0)}"
108
108
  .value="${this._value}"
109
109
  size="${this._size}"
110
- pattern="${F(this.patternMask?this.patternMask:void 0)}"
110
+ pattern="${B(this.patternMask?this.patternMask:void 0)}"
111
111
  ?disabled="${this.disabled}"
112
112
  ?readonly="${this.readonly}"
113
113
  />
114
114
  <div part="correct">${this._correctValue}</div>
115
- `}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};l([p({type:Number,attribute:"expected-length"})],N.prototype,"expectedLength",2),l([p({type:String,attribute:"pattern-mask"})],N.prototype,"patternMask",2),l([p({type:String,attribute:"placeholder-text"})],N.prototype,"placeholderText",2),l([E()],N.prototype,"_value",2),l([E()],N.prototype,"_correctValue",2),l([E()],N.prototype,"_size",2),l([p({type:String,attribute:"class"})],N.prototype,"classNames",2),l([S("classNames")],N.prototype,"handleclassNamesChange",1),N=l([m("qti-text-entry-interaction")],N);var ne=(i,t)=>{class e extends i{constructor(...o){super(...o);this._choiceElements=[];this.responseIdentifier="";this.minChoices=0;this.maxChoices=1;this._handleDisabledChange=(o,n)=>this._choiceElements.forEach(a=>a.disabled=n);this._handleReadonlyChange=(o,n)=>this._choiceElements.forEach(a=>a.readonly=n);this._handleMaxChoicesChange=()=>this._determineInputType();this.addEventListener("qti-register-choice",this._registerChoiceElement),this.addEventListener("qti-loose-choice",this._looseChoiceElement)}validate(){return this._choiceElements.reduce((n,a)=>n+(a.checked?1:0),0)>=this.minChoices}set response(o){let n=Array.isArray(o)?o:[o];this._choiceElements.forEach(a=>{a.checked=!!n.find(c=>c===a.identifier)})}set correctResponse(o){let n=Array.isArray(o)?o:[o];if(o==""){this._choiceElements.forEach(a=>{a.removeAttribute("data-correct-response")});return}this._choiceElements.forEach(a=>{a.setAttribute("data-correct-response",n.find(c=>c===a.identifier)?"true":"false")})}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-choice",this._registerChoiceElement),this.addEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler),this.removeEventListener("qti-register-choice",this._registerChoiceElement)}_registerChoiceElement(o){o.stopPropagation();let n=o.target;this._choiceElements.push(n),this._setInputType(n)}_looseChoiceElement(o){o.stopPropagation();let n=o.target;this._choiceElements.push(n),this._choiceElements=this._choiceElements.filter(a=>a!==n)}_determineInputType(){this._choiceElements.forEach(o=>{this._setInputType(o)})}_setInputType(o){this.maxChoices===1?o.setAttribute("role","radio"):o.setAttribute("role","checkbox")}_choiceElementSelectedHandler(o){this.maxChoices===1&&this._choiceElements.filter(n=>n.identifier!==o.detail.identifier).forEach(n=>{n.checked=!1}),this._choiceElementSelected()}_choiceElementSelected(){let o=this._choiceElements.filter(a=>a.checked).map(a=>a.identifier);this.maxChoices>1&&(this.maxChoices===o.length?this._choiceElements.forEach(a=>a.disabled=!a.checked):this._choiceElements.forEach(a=>a.disabled=!1));let n;this.maxChoices===1?n=o.length>0?o[0]:void 0:n=o,this.saveResponse(n)}saveResponse(o){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:o}}))}}return l([p({attribute:"response-identifier"})],e.prototype,"responseIdentifier",2),l([p({type:Number,attribute:"min-choices"})],e.prototype,"minChoices",2),l([p({type:Number,attribute:"max-choices"})],e.prototype,"maxChoices",2),l([S("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"_handleDisabledChange",2),l([S("readonly",{waitUntilFirstUpdate:!0})],e.prototype,"_handleReadonlyChange",2),l([S("maxChoices",{waitUntilFirstUpdate:!0})],e.prototype,"_handleMaxChoicesChange",2),e};var Ht=class extends ne(f,"qti-hottext"){constructor(){super(...arguments);this.render=()=>u`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("qti-hottext-interaction","")}};Ht=l([m("qti-hottext-interaction")],Ht);var Qe=class extends B{constructor(t){if(super(t),this.it=_,t.type!==oe.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===_||t==null)return this._t=void 0,this.it=t;if(t===M)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;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};Qe.directiveName="unsafeHTML",Qe.resultType=1;var ae=Q(Qe);var le=class extends A{constructor(){super(...arguments);this.options=[];this.correctOption="";this.dataPrompt="select"}static get styles(){return[b`
115
+ `}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};l([d({type:Number,attribute:"expected-length"})],N.prototype,"expectedLength",2),l([d({type:String,attribute:"pattern-mask"})],N.prototype,"patternMask",2),l([d({type:String,attribute:"placeholder-text"})],N.prototype,"placeholderText",2),l([q()],N.prototype,"_value",2),l([q()],N.prototype,"_correctValue",2),l([q()],N.prototype,"_size",2),l([d({type:String,attribute:"class"})],N.prototype,"classNames",2),l([A("classNames")],N.prototype,"handleclassNamesChange",1),N=l([m("qti-text-entry-interaction")],N);var le=(s,t)=>{class e extends s{constructor(...o){super(...o);this._choiceElements=[];this.responseIdentifier="";this.minChoices=0;this.maxChoices=1;this._handleDisabledChange=(o,n)=>this._choiceElements.forEach(a=>a.disabled=n);this._handleReadonlyChange=(o,n)=>this._choiceElements.forEach(a=>a.readonly=n);this._handleMaxChoicesChange=()=>this._determineInputType();this.addEventListener("qti-register-choice",this._registerChoiceElement),this.addEventListener("qti-loose-choice",this._looseChoiceElement)}validate(){return this._choiceElements.reduce((n,a)=>n+(a.checked?1:0),0)>=this.minChoices}set response(o){let n=Array.isArray(o)?o:[o];this._choiceElements.forEach(a=>{a.checked=!!n.find(c=>c===a.identifier)})}set correctResponse(o){let n=Array.isArray(o)?o:[o];if(o==""){this._choiceElements.forEach(a=>{a.removeAttribute("data-correct-response")});return}this._choiceElements.forEach(a=>{a.setAttribute("data-correct-response",n.find(c=>c===a.identifier)?"true":"false")})}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-choice",this._registerChoiceElement),this.addEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler),this.removeEventListener("qti-register-choice",this._registerChoiceElement)}_registerChoiceElement(o){o.stopPropagation();let n=o.target;this._choiceElements.push(n),this._setInputType(n)}_looseChoiceElement(o){o.stopPropagation();let n=o.target;this._choiceElements.push(n),this._choiceElements=this._choiceElements.filter(a=>a!==n)}_determineInputType(){this._choiceElements.forEach(o=>{this._setInputType(o)})}_setInputType(o){this.maxChoices===1?o.setAttribute("role","radio"):o.setAttribute("role","checkbox")}_choiceElementSelectedHandler(o){this.maxChoices===1&&this._choiceElements.filter(n=>n.identifier!==o.detail.identifier).forEach(n=>{n.checked=!1}),this._choiceElementSelected()}_choiceElementSelected(){let o=this._choiceElements.filter(a=>a.checked).map(a=>a.identifier);this.maxChoices>1&&(this.maxChoices===o.length?this._choiceElements.forEach(a=>a.disabled=!a.checked):this._choiceElements.forEach(a=>a.disabled=!1));let n;this.maxChoices===1?n=o.length>0?o[0]:void 0:n=o,this.saveResponse(n)}saveResponse(o){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:o}}))}}return l([d({attribute:"response-identifier"})],e.prototype,"responseIdentifier",2),l([d({type:Number,attribute:"min-choices"})],e.prototype,"minChoices",2),l([d({type:Number,attribute:"max-choices"})],e.prototype,"maxChoices",2),l([A("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"_handleDisabledChange",2),l([A("readonly",{waitUntilFirstUpdate:!0})],e.prototype,"_handleReadonlyChange",2),l([A("maxChoices",{waitUntilFirstUpdate:!0})],e.prototype,"_handleMaxChoicesChange",2),e};var zt=class extends le(f,"qti-hottext"){constructor(){super(...arguments);this.render=()=>u`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("qti-hottext-interaction","")}};zt=l([m("qti-hottext-interaction")],zt);var it=class extends j{constructor(t){if(super(t),this.it=E,t.type!==ae.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===E||t==null)return this._t=void 0,this.it=t;if(t===L)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;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};it.directiveName="unsafeHTML",it.resultType=1;var ce=te(it);var de=class extends k{constructor(){super(...arguments);this.options=[];this.correctOption="";this.dataPrompt="select"}static get styles(){return[b`
116
116
  :host {
117
117
  display: inline-block;
118
118
  }
@@ -137,22 +137,23 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
137
137
  `]}render(){return u`
138
138
  <select part="select" @change="${this.choiceSelected}" ?disabled="${this.disabled}" ?readonly="${this.readonly}">
139
139
  ${this.options.map(e=>u`
140
- <option value="${e.value}" ?selected="${e.selected}">${ae(e.textContent)}</option>
140
+ <option value="${e.value}" ?selected="${e.selected}">${ce(e.textContent)}</option>
141
141
  `)}
142
142
  </select>
143
143
 
144
- ${ae(this.correctOption)}
145
- `}connectedCallback(){super.connectedCallback(),this.addEventListener("on-dropdown-selected",this.choiceSelected);let e=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1},...e.map(r=>({textContent:r.innerHTML,value:r.getAttribute("identifier"),selected:!1}))]}disconnectedCallback(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}validate(){let e=this.options.find(r=>r.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,r)=>T(q({},e),{selected:r===0}))}set response(e){this.options=this.options.map(r=>(e===r.value&&(r.selected=!0),r))}set correctResponse(e){if(e===""){this.correctOption="";return}this.correctOption=`<span part="correct-option">${this.options.find(r=>e===r.value).textContent}</span>`}choiceSelected(e){let r=e.target.value;this.options=this.options.map(s=>T(q({},s),{selected:s.value===r})),this.saveResponse(r)}};le.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"],l([E()],le.prototype,"options",2),l([E()],le.prototype,"correctOption",2),l([p({attribute:"data-prompt",type:String})],le.prototype,"dataPrompt",2),le=l([m("qti-inline-choice-interaction")],le);var Nt=(i,t)=>{class e extends i{constructor(){super(...arguments);this._shuffle=!1}set shuffle(o){let n=this._shuffle;this._shuffle=o,o?this._shuffleChoices():this._resetShuffleChoices(),this.requestUpdate("shuffle",n)}get shuffle(){return this._shuffle}connectedCallback(){super.connectedCallback(),this.shuffle?this._shuffleChoices():this._resetShuffleChoices()}_shuffleChoices(){let o=Array.from(this.querySelectorAll(t)),n=[],a=[];if(o.forEach((y,v)=>{y.hasAttribute("fixed")?n.push({element:y,index:v}):a.push(y)}),a.length<=1)throw new Error("Shuffling is not possible with fewer than 2 non-fixed elements.");let c=!1,d=10,h=0;for(;!c&&h<d;){h++;for(let y=a.length-1;y>0;y--){let v=Math.floor(Math.random()*(y+1));[a[y],a[v]]=[a[v],a[y]]}if(c=a.some((y,v)=>o.indexOf(y)!==v),c)break}if(!c)throw new Error("Failed to shuffle the choices after multiple attempts.");let g=1;o.forEach((y,v)=>{y.hasAttribute("fixed")?y.style.setProperty("order",String(g++)):a.shift().style.setProperty("order",String(g++))})}_resetShuffleChoices(){Array.from(this.querySelectorAll("qti-simple-choice")).forEach((n,a)=>{n.style.setProperty("order","initial")})}}return l([p({type:String,reflect:!0,converter:di})],e.prototype,"shuffle",1),e},di={fromAttribute(i){return i==="true"},toAttribute(i){return i?"true":"false"}};var Es=(i,t)=>{class e extends i{constructor(){super(...arguments);this._classes=[];this._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];this._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"]}set class(o){o&&(this._classes=o.split(" "),this._addLabels())}get class(){var o;return((o=this._classes)==null?void 0:o.join(" "))||""}updated(o){super.updated(o),o.has("shuffle")&&this._addLabels()}_addLabels(){let o=this._classes.some(a=>this._allLabels.includes(a)||this._allLabelSuffixes.includes(a)),n=a=>!isNaN(+a);if(o){let c=Array.from(this.querySelectorAll("qti-simple-choice")).map(d=>d).map((d,h)=>({el:d,order:n(d.style.order)?+d.style.order:h+1})).sort((d,h)=>d.order-h.order).map(d=>d.el);for(let d=0;d<c.length;d++)c[d].marker=this._getLabel(d+1)}}_getLabel(o){let n=this._classes.filter(d=>this._allLabels.includes(d)).pop(),a=this._classes.filter(d=>this._allLabelSuffixes.includes(d)).pop();!n&&a&&(n="qti-labels-upper-alpha");let c="";switch(n){case"qti-labels-decimal":c=`${o}`;break;case"qti-labels-lower-alpha":c=`${String.fromCharCode(97+o-1)}`;break;case"qti-labels-upper-alpha":c=`${String.fromCharCode(65+o-1)}`;break}return a==="qti-labels-suffix-period"?c+=".":a==="qti-labels-suffix-parenthesis"&&(c+=")"),c}}return l([p({type:String,reflect:!0})],e.prototype,"class",1),e};var _s=b`
144
+ ${ce(this.correctOption)}
145
+ `}connectedCallback(){super.connectedCallback(),this.addEventListener("on-dropdown-selected",this.choiceSelected);let e=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1},...e.map(r=>({textContent:r.innerHTML,value:r.getAttribute("identifier"),selected:!1}))]}disconnectedCallback(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}validate(){let e=this.options.find(r=>r.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,r)=>S(C({},e),{selected:r===0}))}set response(e){this.options=this.options.map(r=>(e===r.value&&(r.selected=!0),r))}set correctResponse(e){if(e===""){this.correctOption="";return}this.correctOption=`<span part="correct-option">${this.options.find(r=>e===r.value).textContent}</span>`}choiceSelected(e){let r=e.target.value;this.options=this.options.map(i=>S(C({},i),{selected:i.value===r})),this.saveResponse(r)}};de.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"],l([q()],de.prototype,"options",2),l([q()],de.prototype,"correctOption",2),l([d({attribute:"data-prompt",type:String})],de.prototype,"dataPrompt",2),de=l([m("qti-inline-choice-interaction")],de);var Ft=(s,t)=>{class e extends s{constructor(){super(...arguments);this._shuffle=!1}set shuffle(o){let n=this._shuffle;this._shuffle=o,o?this._shuffleChoices():this._resetShuffleChoices(),this.requestUpdate("shuffle",n)}get shuffle(){return this._shuffle}connectedCallback(){super.connectedCallback(),this.shuffle?this._shuffleChoices():this._resetShuffleChoices()}_shuffleChoices(){let o=Array.from(this.querySelectorAll(t)),n=[],a=[];o.forEach((y,v)=>{y.hasAttribute("fixed")?n.push({element:y,index:v}):a.push(y)}),a.length<=1&&console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");let c=!1,p=10,h=0;for(;!c&&h<p;){h++;for(let y=a.length-1;y>0;y--){let v=Math.floor(Math.random()*(y+1));[a[y],a[v]]=[a[v],a[y]]}if(c=a.some((y,v)=>o.indexOf(y)!==v),c)break}c||console.warn("Failed to shuffle the choices after multiple attempts.");let g=1;o.forEach((y,v)=>{y.hasAttribute("fixed")?y.style.setProperty("order",String(g++)):a.shift().style.setProperty("order",String(g++))})}_resetShuffleChoices(){Array.from(this.querySelectorAll("qti-simple-choice")).forEach((n,a)=>{n.style.setProperty("order","initial")})}}return l([d({type:String,reflect:!0,converter:ks})],e.prototype,"shuffle",1),e},ks={fromAttribute(s){return s==="true"},toAttribute(s){return s?"true":"false"}};var Li=(s,t)=>{class e extends s{constructor(){super(...arguments);this._classes=[];this._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];this._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"]}set class(o){o&&(this._classes=o.split(" "),this._addLabels())}get class(){var o;return((o=this._classes)==null?void 0:o.join(" "))||""}updated(o){super.updated(o),o.has("shuffle")&&this._addLabels()}_addLabels(){let o=this._classes.some(a=>this._allLabels.includes(a)||this._allLabelSuffixes.includes(a)),n=a=>!isNaN(+a);if(o){let c=Array.from(this.querySelectorAll("qti-simple-choice")).map(p=>p).map((p,h)=>({el:p,order:n(p.style.order)?+p.style.order:h+1})).sort((p,h)=>p.order-h.order).map(p=>p.el);for(let p=0;p<c.length;p++)c[p].marker=this._getLabel(p+1)}}_getLabel(o){let n=this._classes.filter(p=>this._allLabels.includes(p)).pop(),a=this._classes.filter(p=>this._allLabelSuffixes.includes(p)).pop();!n&&a&&(n="qti-labels-upper-alpha");let c="";switch(n){case"qti-labels-decimal":c=`${o}`;break;case"qti-labels-lower-alpha":c=`${String.fromCharCode(97+o-1)}`;break;case"qti-labels-upper-alpha":c=`${String.fromCharCode(65+o-1)}`;break}return a==="qti-labels-suffix-period"?c+=".":a==="qti-labels-suffix-parenthesis"&&(c+=")"),c}}return l([d({type:String,reflect:!0})],e.prototype,"class",1),e};var Hi=b`
146
146
  :host {
147
147
  display: flex;
148
148
  flex-direction: column;
149
+ gap: var(--qti-gap-size);
149
150
  // align-items: flex-start;
150
151
  }
151
- `;var Se=class extends Es(Nt(ne(f,"qti-simple-choice"),"qti-simple-choice"),"qti-simple-choice"){render(){return u` <slot name="prompt"></slot><slot part="slot"></slot>`}};Se.styles=_s,l([p({type:String})],Se.prototype,"orientation",2),Se=l([m("qti-choice-interaction")],Se);var et=class extends f{render(){return u`<slot></slot>`}process(){let t=new dr,e=[...this.children];t.process(e)}};et.styles=[b`
152
+ `;var Re=class extends Li(Ft(le(f,"qti-simple-choice"),"qti-simple-choice"),"qti-simple-choice"){render(){return u` <slot name="prompt"></slot><slot part="slot"></slot>`}};Re.styles=Hi,l([d({type:String})],Re.prototype,"orientation",2),Re=l([m("qti-choice-interaction")],Re);var st=class extends f{render(){return u`<slot></slot>`}process(){let t=new xr,e=[...this.children];t.process(e)}};st.styles=[b`
152
153
  :host {
153
154
  display: none;
154
155
  }
155
- `],et=l([m("qti-outcome-processing")],et);var dr=class{process(t){for(let e of t)e.process()}};var Cs=`<qti-response-processing>
156
+ `],st=l([m("qti-outcome-processing")],st);var xr=class{process(t){for(let e of t)e.process()}};var Pi=`<qti-response-processing>
156
157
  <qti-response-condition>
157
158
  <qti-response-if>
158
159
  <qti-match>
@@ -169,7 +170,7 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
169
170
  </qti-set-outcome-value>
170
171
  </qti-response-else>
171
172
  </qti-response-condition>
172
- </qti-response-processing>`,qs=`<qti-response-processing>
173
+ </qti-response-processing>`,Ni=`<qti-response-processing>
173
174
  <qti-response-condition>
174
175
  <qti-response-if>
175
176
  <qti-is-null>
@@ -185,7 +186,7 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
185
186
  </qti-set-outcome-value>
186
187
  </qti-response-else>
187
188
  </qti-response-condition>
188
- </qti-response-processing>`,As=`<qti-response-processing>
189
+ </qti-response-processing>`,Vi=`<qti-response-processing>
189
190
  <qti-response-condition>
190
191
  <qti-response-if>
191
192
  <qti-is-null>
@@ -201,24 +202,26 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
201
202
  </qti-set-outcome-value>
202
203
  </qti-response-else>
203
204
  </qti-response-condition>
204
- </qti-response-processing>`;var ve=class extends f{render(){return u`<slot></slot>`}process(){let t=[...this.children];for(let e of t)e.process()}firstUpdated(t){if(this.getAttribute("template")){let e=this.getAttribute("template").split("/"),r=e[e.length-1].replace(".xml","");switch(this.innerHTML="",r){case"map_response":{this.appendChild(this.fragmentFromString(qs).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(As).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(Cs).firstElementChild.firstElementChild);break}}}fragmentFromString(t){return document.createRange().createContextualFragment(t)}};ve.styles=[b`
205
+ </qti-response-processing>`;var xe=class extends f{render(){return u`<slot></slot>`}process(){let t=[...this.children];for(let e of t)e.process()}firstUpdated(t){if(this.getAttribute("template")){let e=this.getAttribute("template").split("/"),r=e[e.length-1].replace(".xml","");switch(this.innerHTML="",r){case"map_response":{this.appendChild(this.fragmentFromString(Ni).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(Vi).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(Pi).firstElementChild.firstElementChild);break}}}fragmentFromString(t){return document.createRange().createContextualFragment(t)}};xe.styles=[b`
205
206
  :host {
206
207
  display: none;
207
208
  }
208
- `],ve=l([m("qti-response-processing")],ve);var X=class extends f{render(){return u`<slot></slot>`}process(){throw new Error("Not implemented")}};X=l([m("qti-rule")],X);var Pt=class extends X{get childExpression(){return this.firstElementChild}process(){let t=this.getAttribute("identifier"),e=this.closest("qti-assessment-item").getVariable(t),r;return e.interpolationTable&&(r=e.interpolationTable.get(parseInt(this.childExpression.calculate()))),r==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:Ye(r)}})),r)}};l([p({type:String})],Pt.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",Pt);var ur=class extends X{render(){return u`<slot></slot>`}process(){let t=[...this.children];for(let e=0;e<t.length;e++){let r=t[e];if(r.calculate()){r.process();return}}}};customElements.define("qti-response-condition",ur);var hr=class extends X{process(){let t=this.getAttribute("identifier"),e=this.firstElementChild,s=new mr(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:Array.isArray(s)?s.map(o=>Ye(o)):Ye(s)}}))}},mr=class{constructor(t){this.expression=t}process(){let t=this.expression?this.expression.calculate():null;if(t==null){console.warn("setOutcomeValue: value is null or undefined");return}return t}};customElements.define("qti-set-outcome-value",hr);var tt=class extends f{render(){return u`<slot></slot>`}calculate(){return!0}getSubRules(){return[...this.children]}process(){let t=this.getSubRules();for(let e=0;e<t.length;e++)t[e].process()}};customElements.define("qti-response-else",tt);var rt=class extends tt{calculate(){return this.firstElementChild.calculate()}getSubRules(){let t=[];for(let e=1;e<this.children.length;e++)t.push(this.children[e]);return t}};customElements.define("qti-response-if",rt);var fr=class extends rt{render(){return u`${super.render()}`}};customElements.define("qti-response-else-if",fr);var x=class extends f{constructor(){super(...arguments);this.getVariables=()=>Array.from(this.children).map(e=>{switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent,cardinality:"single"};case"qti-variable":{let r=e.getAttribute("identifier")||"";return this.assessmentItem.getVariable(r)}case"qti-multiple":{let s=e.getResult();return s.length>0?{identifier:"",baseType:s[0].baseType,value:s.map(o=>o.value),cardinality:"multiple",type:"response"}:null}case"qti-correct":{let r=e.getAttribute("identifier")||"",s=this.assessmentItem.getResponse(r);return{baseType:s.baseType,value:s.correctResponse,cardinality:s.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(r){console.warn("default not sufficient")}return null}}}).filter(e=>e!==null)}render(){return u`<pre>${JSON.stringify(this.result,null,2)}</pre>
209
+ `],xe=l([m("qti-response-processing")],xe);var Y=class extends f{render(){return u`<slot></slot>`}process(){throw new Error("Not implemented")}};Y=l([m("qti-rule")],Y);var Bt=class extends Y{get childExpression(){return this.firstElementChild}process(){let t=this.getAttribute("identifier"),e=this.closest("qti-assessment-item").getVariable(t),r;return e.interpolationTable&&(r=e.interpolationTable.get(parseInt(this.childExpression.calculate()))),r==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:Ze(r)}})),r)}};l([d({type:String})],Bt.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",Bt);var qr=class extends Y{render(){return u`<slot></slot>`}process(){let t=[...this.children];for(let e=0;e<t.length;e++){let r=t[e];if(r.calculate()){r.process();return}}}};customElements.define("qti-response-condition",qr);var Er=class extends Y{process(){let t=this.getAttribute("identifier"),e=this.firstElementChild,i=new wr(e).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:Array.isArray(i)?i.map(o=>Ze(o)):Ze(i)}}))}},wr=class{constructor(t){this.expression=t}process(){let t=this.expression?this.expression.calculate():null;if(t==null){console.warn("setOutcomeValue: value is null or undefined");return}return t}};customElements.define("qti-set-outcome-value",Er);var ot=class extends f{render(){return u`<slot></slot>`}calculate(){return!0}getSubRules(){return[...this.children]}process(){let t=this.getSubRules();for(let e=0;e<t.length;e++)t[e].process()}};customElements.define("qti-response-else",ot);var nt=class extends ot{calculate(){return this.firstElementChild.calculate()}getSubRules(){let t=[];for(let e=1;e<this.children.length;e++)t.push(this.children[e]);return t}};customElements.define("qti-response-if",nt);var Cr=class extends nt{render(){return u`${super.render()}`}};customElements.define("qti-response-else-if",Cr);var x=class extends f{constructor(){super(...arguments);this.getVariables=()=>Array.from(this.children).map(e=>{switch(e.tagName.toLowerCase()){case"qti-base-value":return{baseType:e.getAttribute("base-type"),value:e.textContent,cardinality:"single"};case"qti-variable":{let r=e.getAttribute("identifier")||"";return this.assessmentItem.getVariable(r)}case"qti-multiple":{let i=e.getResult();return i.length>0?{identifier:"",baseType:i[0].baseType,value:i.map(o=>o.value),cardinality:"multiple",type:"response"}:null}case"qti-correct":{let r=e.getAttribute("identifier")||"",i=this.assessmentItem.getResponse(r);return{baseType:i.baseType,value:i.correctResponse,cardinality:i.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(r){console.warn("default not sufficient")}return null}}}).filter(e=>e!==null)}render(){return u`<pre>${JSON.stringify(this.result,null,2)}</pre>
209
210
  <slot></slot>`}calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}get assessmentItem(){return this.closest("qti-assessment-item")}};x.styles=b`
210
211
  slot {
211
212
  display: none;
212
213
  }
213
- `,l([E()],x.prototype,"result",2);var P=class extends x{calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};var Vt=class extends ui(P){calculate(){return this.calculateChildren(Array.from(this.children))}};function ui(i){return class extends i{calculateChildren(e){return e.map(s=>{let o=s;if(!o.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let n=o.calculate();if(typeof n=="string")if(n==="true")n=!0;else if(n==="false")n=!1;else return console.error("unexpected value in qti-and, expected boolean"),null;return n}).every(s=>typeof s=="boolean"&&s)}}}customElements.define("qti-and",Vt);var Dt=class extends x{constructor(){super(...arguments);this.baseType="string"}getResult(){return this.textContent}};l([p({type:String,attribute:"base-type"})],Dt.prototype,"baseType",2);customElements.define("qti-base-value",Dt);var gr=class extends P{getResult(){let t=this.getVariables();if(this.children.length===2){let e=t[0],r=t[1];if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="multiple"){let s=e.value,o=r.value;return s.filter(c=>o.includes(c)).length>0}else if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="single"){let s=e.value;return r.value.includes(s)}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}};customElements.define("qti-contains",gr);var br=class extends x{get interpretation(){return this.getAttribute("interpretation")||""}getResult(){let t=this.getAttribute("identifier")||"",e=this.closest("qti-assessment-item").getResponse(t);return e.correctResponse,e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}};customElements.define("qti-correct",br);var Ot=class extends x{constructor(){super(...arguments);this.roundingMode="significantFigures"}get figures(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;let r=parseInt(this.getAttribute("figures")||"0");return isNaN(r)?(console.error("figures attribute is not a number"),null):r<0?(console.error("figures attribute is negative"),null):r<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):r}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];if(this.roundingMode===null)return null;if(r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value))return console.error("unexpected cardinality in qti equal"),!1;switch(e[0].baseType){case"integer":case"float":{let o=parseFloat(r.value),n=parseFloat(s.value);if(!isNaN(o)&&!isNaN(n))return this.roundingMode==="significantFigures"?o.toPrecision(this.figures)===n.toPrecision(this.figures):Math.round(o*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(n*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error(`value cannot be casted to numeric value in equalRounded operator: ${o}, ${n}`);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}};l([p({type:String})],Ot.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",Ot);var V=class{static compareSingleValues(t,e,r){switch(r){case"identifier":case"string":return t===e;case"integer":{let s=parseInt(t,10),o=parseInt(e,10);if(!isNaN(s)&&!isNaN(o))return s===o;console.error(`Cannot convert ${t} and/or ${e} to int.`);break}case"float":{let s=parseFloat(t),o=parseFloat(e);if(!isNaN(s)&&!isNaN(o))return s===o;console.error(`couldn't convert ${t} and/or ${e} to float.`);break}case"pair":case"directedPair":{let s=t.split(" ").sort(),o=e.split(" ").sort();if(s.length===2&&o.length===2)return r==="pair"&&(s.sort(),o.sort()),s.join(" ")===o.join(" ");console.error(`compared two pair but one of the values does not have 2 values: 1: ${t} 2: ${e}`);break}}return!1}};var It=class extends x{constructor(){super(...arguments);this.toleranceMode="exact"}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value)?(console.error("unexpected cardinality in qti equal"),!1):V.compareSingleValues(r.value,s.value,r.baseType)}return console.error("unexpected number of children in qti-equal"),null}};l([p({type:String})],It.prototype,"toleranceMode",2);customElements.define("qti-equal",It);var vr=class extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value>+r.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}};customElements.define("qti-gt",vr);var yr=class extends P{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value>=+r.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}};customElements.define("qti-gte",yr);var xr=class extends x{getResult(){if(this.children.length===1){let t=this.getVariables();if(!t)return!0;let e=t[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}};customElements.define("qti-is-null",xr);var Er=class extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value<+r.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}};customElements.define("qti-lt",Er);var _r=class extends P{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value<=+r.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}};customElements.define("qti-lte",_r);var Ut=class extends x{getResult(){let t=this.assessmentItem.getResponse(this.identifier);if(!t)return console.warn(`Response ${this.identifier} can not be found`),null;let e=t.mapping,r=Array.isArray(t.value)?t.value:[t.value],s=0;for(let o of r){let n=e.mapEntries.find(a=>V.compareSingleValues(a.mapKey,o,t.baseType));n==null||n.mappedValue==null?s+=e.defaultValue:s+=n.mappedValue}return e.lowerBound!=null&&(s=Math.max(e.lowerBound,s)),e.upperBound!=null&&(s=Math.min(e.upperBound,s)),s}};l([p({type:String})],Ut.prototype,"identifier",2);customElements.define("qti-map-response",Ut);var Te=class extends f{constructor(){super(...arguments);this.defaultValue=0}get mapEntries(){return Array.from(this.querySelectorAll("qti-map-entry")).map(e=>({mapKey:e.getAttribute("map-key"),mappedValue:+e.getAttribute("mapped-value")}))}};l([p({attribute:"default-value",type:Number})],Te.prototype,"defaultValue",2),l([p({attribute:"lower-bound",type:Number})],Te.prototype,"lowerBound",2),l([p({attribute:"upper-bound",type:Number})],Te.prototype,"upperBound",2);customElements.define("qti-mapping",Te);var Cr=class i extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return i.match(e,r)}return console.error("unexpected number of children in match"),null}static match(t,e){var r;switch(e.cardinality){case"single":return t.value===null?!1:Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):V.compareSingleValues((r=t.value)==null?void 0:r.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(let s=0;s<t.value.length;s++)if(!V.compareSingleValues(e.value[s],t.value[s],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;let s=0;for(let o of e.value){let n=null,a=[...t.value];for(let c of a)if(V.compareSingleValues(o,c,e.baseType)){n=c;break}if(n!==null)a.splice(a.indexOf(n),1);else return!1;s++}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}};customElements.define("qti-match",Cr);var qr=class extends x{getResult(){let t=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");let[e,r]=t;if(e.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"),(e.baseType==="float"||r.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(e.baseType==="duration"||r.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),e.value===null||r.value===null)return null;let s=e.value;return r.value.includes(s)}};customElements.define("qti-member",qr);var Ar=class extends x{getResult(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="multiple"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[];return t}};customElements.define("qti-multiple",Ar);var wr=class extends x{render(){return u`${super.render()}`}getResult(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",wr);var Sr=class extends P{getResult(){return Array.from(this.children).map(e=>{let r=e;if(!r.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let s=r.calculate();if(typeof s=="string")if(s==="true")s=!0;else if(s==="false")s=!1;else return console.error("unexpected value in qti-or, expected boolean"),null;return s}).some(e=>typeof e=="boolean"&&e)}};customElements.define("qti-or",Sr);var Tr=class extends x{getResult(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="ordered"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[];return t}};customElements.define("qti-ordered",Tr);var st=class extends f{render(){var e,r;let t=(r=(e=this.itemContext)==null?void 0:e.variables.find(s=>s.identifier===this.identifier))==null?void 0:r.value;return u`${JSON.stringify(t,null,2)}`}calculate(){let t=this.closest("qti-assessment-item"),e=this.identifier;return t.getVariable(e).value}};l([p({type:String})],st.prototype,"identifier",2),l([K({context:O,subscribe:!0}),E()],st.prototype,"itemContext",2);customElements.define("qti-printed-variable",st);var Rr=class extends x{getResult(){return this.getVariables().reduce((r,s)=>{if(s.baseType=="float"||s.baseType=="integer")try{return r*parseInt(s.value.toString())}catch(o){console.warn("can not convert to number")}else console.warn(`has another baseType ${s.baseType}`);return r},1)}};customElements.define("qti-product",Rr);var Ft=class extends x{constructor(){super(...arguments);this.caseSensitive="true"}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],s=e[1];if(r.cardinality!=="single"||s.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(s.value))return console.error("unexpected cardinality in qti string-match"),!1;let o=this.caseSensitive==="true"?r.value:r.value.toLowerCase(),n=this.caseSensitive==="true"?s.value:s.value.toLowerCase();return V.compareSingleValues(o,n,r.baseType)}return console.error("unexpected number of children in qti-string-match"),null}};l([p({type:String,attribute:"case-sensitive"})],Ft.prototype,"caseSensitive",2);customElements.define("qti-string-match",Ft);var $r=class extends x{constructor(){super(),this._expression=new kr(Array.from(this.children))}getResult(){return this._expression.calculate()}},kr=class{constructor(t){this.expressions=t}calculate(){return this.expressions.map(e=>{if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let r=e.calculate();return Number.isNaN(r)?(console.error("unexpected value in qti-sum, expected number"),null):Number(r)}).reduce((e,r)=>e+r,0)}};customElements.define("qti-sum",$r);var Mr=class extends x{getResult(){let t=this.getAttribute("identifier");return this.closest("qti-assessment-item").getVariable(t).value}};customElements.define("qti-variable",Mr);var ce=class extends A{constructor(){super(...arguments);this._errorMessage=null;this.loadConfig=async(e,r)=>{e=this.removeDoubleSlashes(e);try{let s=await fetch(e);if(s.ok){let n=await s.json();for(let a in n.paths)r&&(n.paths[a]=this.getResolvablePath(n.paths[a],r));return n}}catch(s){}return null};this.getResolvablePathString=(e,r)=>(e=e.replace(/\.js$/,""),e!=null&&e.toLocaleLowerCase().startsWith("http")||!r?e:this.removeDoubleSlashes(`${r}/${e}`));this.getResolvablePath=(e,r)=>Array.isArray(e)?e.map(s=>this.getResolvablePathString(s,r)):this.getResolvablePathString(e,r)}convertQtiVariableJSON(e){for(let r in e)if(e.hasOwnProperty(r)){let s=e[r];if(s){for(let o in s)if(s.hasOwnProperty(o)){let n=s[o];if(Array.isArray(n))return n.map(String);if(n!=null)return String(n)}}}return null}startChecking(){this.intervalId=setInterval(()=>{let e=this.pci.getResponse(),r=this.pci.getResponse(),s=JSON.stringify(e);if(s!==this.rawResponse){this.rawResponse=s;let o=this.convertQtiVariableJSON(r);this.response=o,this.saveResponse(o)}},200)}stopChecking(){this.intervalId!==void 0&&clearInterval(this.intervalId)}validate(){return!0}set response(e){}getTAOConfig(e){let r=e.querySelectorAll("properties"),s={},o=a=>{let c={},d=a.getAttribute("key");if(d){let h=Array.from(a.children),g=h.map(v=>v.getAttribute("key"));g.length>0&&!g.find(v=>!Number.isInteger(+v))?c[d]=h.map(v=>n(v)):c[d]=a.textContent}return c},n=a=>{if(a){let c={};for(let d of a.children)c=q(q({},c),o(d));return c}};for(let a of r)return a.getAttribute("key")||(s=q(q({},s),n(a))),s;return console.log("Can not find qti-custom-interaction config"),null}register(e){this.pci=e;let r=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",s=r=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");s.classList.add("qti-customInteraction"),r=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");let o=r=="IMS"?{properties:this.dataset,onready:()=>{console.log("onready")}}:this.getTAOConfig(this);r=="IMS"?e.getInstance(s,o,void 0):e.initialize(this.customInteractionTypeIdentifier,s.firstElementChild,o),r=="TAO"&&Array.from(this.querySelectorAll("link")).map(a=>a.getAttribute("href")).forEach(a=>{let c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.media="screen",c.href=a,s.appendChild(c)}),this.startChecking()}connectedCallback(){super.connectedCallback(),define("qtiCustomInteractionContext",()=>({register:s=>{this.register(s)},notifyReady:()=>{}}));let e=this.buildRequireConfig();requirejs.config(e)(["require"],s=>{s([this.module])})}disconnectedCallback(){super.disconnectedCallback(),requirejs.undef(this.customInteractionTypeIdentifier);let e=requirejs.s.contexts;delete e[this.customInteractionTypeIdentifier],this.stopChecking()}buildRequireConfig(){let e={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;let r=this.getAttribute("data-base-url"),s=this.querySelector("qti-interaction-modules");if(s){let o=s.querySelectorAll("qti-interaction-module");for(let n of o){let a=n.getAttribute("id"),c=n.getAttribute("primary-path"),d=n.getAttribute("fallback-path");if(a&&c){let h=d?this.combineRequireResolvePaths(this.getResolvablePath(c,r),this.getResolvablePath(d,r)):this.getResolvablePath(c,r),g=e.paths[a]||[];e.paths[a]=this.combineRequireResolvePaths(g,h)}}}return e}combineRequireResolvePaths(e,r){let s=Array.isArray(e)?e:[e],o=Array.isArray(r)?r:[r];return s.concat(o)}removeDoubleSlashes(e){return e.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}render(){return u`<slot></slot>${this._errorMessage&&u`<div style="color:red">
214
+ `,l([q()],x.prototype,"result",2);var V=class extends x{calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};var jt=class extends _s(V){calculate(){return this.calculateChildren(Array.from(this.children))}};function _s(s){return class extends s{calculateChildren(e){return e.map(i=>{let o=i;if(!o.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let n=o.calculate();if(typeof n=="string")if(n==="true")n=!0;else if(n==="false")n=!1;else return console.error("unexpected value in qti-and, expected boolean"),null;return n}).every(i=>typeof i=="boolean"&&i)}}}customElements.define("qti-and",jt);var Xt=class extends x{constructor(){super(...arguments);this.baseType="string"}getResult(){return this.textContent}};l([d({type:String,attribute:"base-type"})],Xt.prototype,"baseType",2);customElements.define("qti-base-value",Xt);var kr=class extends V{getResult(){let t=this.getVariables();if(this.children.length===2){let e=t[0],r=t[1];if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="multiple"){let i=e.value,o=r.value;return i.filter(c=>o.includes(c)).length>0}else if(e.baseType==="directedPair"&&r.baseType==="directedPair"&&e.cardinality==="single"){let i=e.value;return r.value.includes(i)}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}};customElements.define("qti-contains",kr);var _r=class extends x{get interpretation(){return this.getAttribute("interpretation")||""}getResult(){let t=this.getAttribute("identifier")||"",e=this.closest("qti-assessment-item").getResponse(t);return e.correctResponse,e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}};customElements.define("qti-correct",_r);var Yt=class extends x{constructor(){super(...arguments);this.roundingMode="significantFigures"}get figures(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;let r=parseInt(this.getAttribute("figures")||"0");return isNaN(r)?(console.error("figures attribute is not a number"),null):r<0?(console.error("figures attribute is negative"),null):r<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):r}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],i=e[1];if(this.roundingMode===null)return null;if(r.cardinality!=="single"||i.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(i.value))return console.error("unexpected cardinality in qti equal"),!1;switch(e[0].baseType){case"integer":case"float":{let o=parseFloat(r.value),n=parseFloat(i.value);if(!isNaN(o)&&!isNaN(n))return this.roundingMode==="significantFigures"?o.toPrecision(this.figures)===n.toPrecision(this.figures):Math.round(o*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(n*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error(`value cannot be casted to numeric value in equalRounded operator: ${o}, ${n}`);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}};l([d({type:String})],Yt.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",Yt);var D=class{static compareSingleValues(t,e,r){switch(r){case"identifier":case"string":return t===e;case"integer":{let i=parseInt(t,10),o=parseInt(e,10);if(!isNaN(i)&&!isNaN(o))return i===o;console.error(`Cannot convert ${t} and/or ${e} to int.`);break}case"float":{let i=parseFloat(t),o=parseFloat(e);if(!isNaN(i)&&!isNaN(o))return i===o;console.error(`couldn't convert ${t} and/or ${e} to float.`);break}case"pair":case"directedPair":{let i=t.split(" ").sort(),o=e.split(" ").sort();if(i.length===2&&o.length===2)return r==="pair"&&(i.sort(),o.sort()),i.join(" ")===o.join(" ");console.error(`compared two pair but one of the values does not have 2 values: 1: ${t} 2: ${e}`);break}}return!1}};var Wt=class extends x{constructor(){super(...arguments);this.toleranceMode="exact"}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],i=e[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):r.cardinality!=="single"||i.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(i.value)?(console.error("unexpected cardinality in qti equal"),!1):D.compareSingleValues(r.value,i.value,r.baseType)}return console.error("unexpected number of children in qti-equal"),null}};l([d({type:String})],Wt.prototype,"toleranceMode",2);customElements.define("qti-equal",Wt);var Ar=class extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value>+r.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}};customElements.define("qti-gt",Ar);var Sr=class extends V{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value>=+r.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}};customElements.define("qti-gte",Sr);var Tr=class extends x{getResult(){if(this.children.length===1){let t=this.getVariables();if(!t)return!0;let e=t[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}};customElements.define("qti-is-null",Tr);var Rr=class extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];if(e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value<+r.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}};customElements.define("qti-lt",Rr);var $r=class extends V{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return e.baseType===r.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value<=+r.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}};customElements.define("qti-lte",$r);var Kt=class extends x{getResult(){let t=this.assessmentItem.getResponse(this.identifier);if(!t)return console.warn(`Response ${this.identifier} can not be found`),null;let e=t.mapping,r=Array.isArray(t.value)?t.value:[t.value],i=0;for(let o of r){let n=e.mapEntries.find(a=>D.compareSingleValues(a.mapKey,o,t.baseType));n==null||n.mappedValue==null?i+=e.defaultValue:i+=n.mappedValue}return e.lowerBound!=null&&(i=Math.max(e.lowerBound,i)),e.upperBound!=null&&(i=Math.min(e.upperBound,i)),i}};l([d({type:String})],Kt.prototype,"identifier",2);customElements.define("qti-map-response",Kt);var $e=class extends f{constructor(){super(...arguments);this.defaultValue=0}get mapEntries(){return Array.from(this.querySelectorAll("qti-map-entry")).map(e=>({mapKey:e.getAttribute("map-key"),mappedValue:+e.getAttribute("mapped-value")}))}};l([d({attribute:"default-value",type:Number})],$e.prototype,"defaultValue",2),l([d({attribute:"lower-bound",type:Number})],$e.prototype,"lowerBound",2),l([d({attribute:"upper-bound",type:Number})],$e.prototype,"upperBound",2);customElements.define("qti-mapping",$e);var Mr=class s extends x{getResult(){if(this.children.length===2){let t=this.getVariables(),e=t[0],r=t[1];return s.match(e,r)}return console.error("unexpected number of children in match"),null}static match(t,e){var r;switch(e.cardinality){case"single":return t.value===null?!1:Array.isArray(t.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):D.compareSingleValues((r=t.value)==null?void 0:r.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(let i=0;i<t.value.length;i++)if(!D.compareSingleValues(e.value[i],t.value[i],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;let i=0;for(let o of e.value){let n=null,a=[...t.value];for(let c of a)if(D.compareSingleValues(o,c,e.baseType)){n=c;break}if(n!==null)a.splice(a.indexOf(n),1);else return!1;i++}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}};customElements.define("qti-match",Mr);var Lr=class extends x{getResult(){let t=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");let[e,r]=t;if(e.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"),(e.baseType==="float"||r.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(e.baseType==="duration"||r.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),e.value===null||r.value===null)return null;let i=e.value;return r.value.includes(i)}};customElements.define("qti-member",Lr);var Hr=class extends x{getResult(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="multiple"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[];return t}};customElements.define("qti-multiple",Hr);var Pr=class extends x{render(){return u`${super.render()}`}getResult(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",Pr);var Nr=class extends V{getResult(){return Array.from(this.children).map(e=>{let r=e;if(!r.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let i=r.calculate();if(typeof i=="string")if(i==="true")i=!0;else if(i==="false")i=!1;else return console.error("unexpected value in qti-or, expected boolean"),null;return i}).some(e=>typeof e=="boolean"&&e)}};customElements.define("qti-or",Nr);var Vr=class extends x{getResult(){let t=this.getVariables();if(t.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of t)if(e.cardinality!=="ordered"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[];return t}};customElements.define("qti-ordered",Vr);var at=class extends f{render(){var e,r;let t=(r=(e=this.itemContext)==null?void 0:e.variables.find(i=>i.identifier===this.identifier))==null?void 0:r.value;return u`${JSON.stringify(t,null,2)}`}calculate(){let t=this.closest("qti-assessment-item"),e=this.identifier;return t.getVariable(e).value}};l([d({type:String})],at.prototype,"identifier",2),l([Z({context:U,subscribe:!0}),q()],at.prototype,"itemContext",2);customElements.define("qti-printed-variable",at);var Dr=class extends x{getResult(){return this.getVariables().reduce((r,i)=>{if(i.baseType=="float"||i.baseType=="integer")try{return r*parseInt(i.value.toString())}catch(o){console.warn("can not convert to number")}else console.warn(`has another baseType ${i.baseType}`);return r},1)}};customElements.define("qti-product",Dr);var Jt=class extends x{constructor(){super(...arguments);this.caseSensitive="true"}getResult(){if(this.children.length===2){let e=this.getVariables(),r=e[0],i=e[1];if(r.cardinality!=="single"||i.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(i.value))return console.error("unexpected cardinality in qti string-match"),!1;let o=this.caseSensitive==="true"?r.value:r.value.toLowerCase(),n=this.caseSensitive==="true"?i.value:i.value.toLowerCase();return D.compareSingleValues(o,n,r.baseType)}return console.error("unexpected number of children in qti-string-match"),null}};l([d({type:String,attribute:"case-sensitive"})],Jt.prototype,"caseSensitive",2);customElements.define("qti-string-match",Jt);var Or=class extends x{constructor(){super(),this._expression=new Ir(Array.from(this.children))}getResult(){return this._expression.calculate()}},Ir=class{constructor(t){this.expressions=t}calculate(){return this.expressions.map(e=>{if(!e.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let r=e.calculate();return Number.isNaN(r)?(console.error("unexpected value in qti-sum, expected number"),null):Number(r)}).reduce((e,r)=>e+r,0)}};customElements.define("qti-sum",Or);var Ur=class extends x{getResult(){let t=this.getAttribute("identifier");return this.closest("qti-assessment-item").getVariable(t).value}};customElements.define("qti-variable",Ur);var pe=class extends k{constructor(){super(...arguments);this._errorMessage=null;this.loadConfig=async(e,r)=>{e=this.removeDoubleSlashes(e);try{let i=await fetch(e);if(i.ok){let n=await i.json();for(let a in n.paths)r&&(n.paths[a]=this.getResolvablePath(n.paths[a],r));return n}}catch(i){}return null};this.getResolvablePathString=(e,r)=>(e=e.replace(/\.js$/,""),e!=null&&e.toLocaleLowerCase().startsWith("http")||!r?e:this.removeDoubleSlashes(`${r}/${e}`));this.getResolvablePath=(e,r)=>Array.isArray(e)?e.map(i=>this.getResolvablePathString(i,r)):this.getResolvablePathString(e,r)}convertQtiVariableJSON(e){for(let r in e)if(e.hasOwnProperty(r)){let i=e[r];if(i){for(let o in i)if(i.hasOwnProperty(o)){let n=i[o];if(Array.isArray(n))return n.map(String);if(n!=null)return String(n)}}}return null}startChecking(){this.intervalId=setInterval(()=>{let e=this.pci.getResponse(),r=this.pci.getResponse(),i=JSON.stringify(e);if(i!==this.rawResponse){this.rawResponse=i;let o=this.convertQtiVariableJSON(r);this.response=o,this.saveResponse(o)}},200)}stopChecking(){this.intervalId!==void 0&&clearInterval(this.intervalId)}validate(){return!0}set response(e){}getTAOConfig(e){let r=e.querySelectorAll("properties"),i={},o=a=>{let c={},p=a.getAttribute("key");if(p){let h=Array.from(a.children),g=h.map(v=>v.getAttribute("key"));g.length>0&&!g.find(v=>!Number.isInteger(+v))?c[p]=h.map(v=>n(v)):c[p]=a.textContent}return c},n=a=>{if(a){let c={};for(let p of a.children)c=C(C({},c),o(p));return c}};for(let a of r)return a.getAttribute("key")||(i=C(C({},i),n(a))),i;return console.log("Can not find qti-custom-interaction config"),null}register(e){this.pci=e;let r=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",i=r=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");i.classList.add("qti-customInteraction"),r=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");let o=r=="IMS"?{properties:this.dataset,onready:()=>{console.log("onready")}}:this.getTAOConfig(this);r=="IMS"?e.getInstance(i,o,void 0):e.initialize(this.customInteractionTypeIdentifier,i.firstElementChild,o),r=="TAO"&&Array.from(this.querySelectorAll("link")).map(a=>a.getAttribute("href")).forEach(a=>{let c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.media="screen",c.href=a,i.appendChild(c)}),this.startChecking()}connectedCallback(){super.connectedCallback(),define("qtiCustomInteractionContext",()=>({register:i=>{this.register(i)},notifyReady:()=>{}}));let e=this.buildRequireConfig();requirejs.config(e)(["require"],i=>{i([this.module])})}disconnectedCallback(){super.disconnectedCallback(),requirejs.undef(this.customInteractionTypeIdentifier);let e=requirejs.s.contexts;delete e[this.customInteractionTypeIdentifier],this.stopChecking()}buildRequireConfig(){let e={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;let r=this.getAttribute("data-base-url"),i=this.querySelector("qti-interaction-modules");if(i){let o=i.querySelectorAll("qti-interaction-module");for(let n of o){let a=n.getAttribute("id"),c=n.getAttribute("primary-path"),p=n.getAttribute("fallback-path");if(a&&c){let h=p?this.combineRequireResolvePaths(this.getResolvablePath(c,r),this.getResolvablePath(p,r)):this.getResolvablePath(c,r),g=e.paths[a]||[];e.paths[a]=this.combineRequireResolvePaths(g,h)}}}return e}combineRequireResolvePaths(e,r){let i=Array.isArray(e)?e:[e],o=Array.isArray(r)?r:[r];return i.concat(o)}removeDoubleSlashes(e){return e.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}render(){return u`<slot></slot>${this._errorMessage&&u`<div style="color:red">
214
215
  <h1>Error</h1>
215
216
  ${this._errorMessage}
216
- </div>`}`}};l([p({type:String,attribute:"response-identifier"})],ce.prototype,"responseIdentifier",2),l([p({type:String,attribute:"module"})],ce.prototype,"module",2),l([p({type:String,attribute:"custom-interaction-type-identifier"})],ce.prototype,"customInteractionTypeIdentifier",2),l([E()],ce.prototype,"_errorMessage",2),ce=l([m("qti-portable-custom-interaction")],ce);var Bt=class i{constructor(){this._touchBegin=0;this._touchDown=null;this._lastClick=0;this._canDrag=!1;this._dragSrc=null;this._dragCopy=null;this._touchEndCalled=!1;this._dragRunning=!1;this._dataTransfer={data:{},setData:function(t,e){this.data[t]=e},getData:function(t){return this.data[t]},effectAllowed:"move"};this._copyOffset={x:0,y:0};this._lastTarget=null;this._currentDropContainer=null;this._handleClick=!0;this._DBLCLICKDELAY=500;this._CONTEXTMENUDELAY=1e3;this._DRAGDELTA=5;this._COPYOPACITY=.7;this.copyStylesDragClone=!0;this.dragOnClick=!1;this._createDragCopy=(t,e)=>{if(this._dragCopy===null&&this._dragRunning){this._dragSrc.style.opacity=this._COPYOPACITY,this._dragCopy=this._dragSrc.cloneNode(!0);let r=window.getComputedStyle(this._dragSrc);if(this._dragCopy.style="",this._dragCopy.setAttribute("dragclone",""),this.copyStylesDragClone)for(let s of r)this._dragCopy.style[s]=r.getPropertyValue(s);this._calculateDragCopyPosition(e),this._dragCopy.style.top=e.clientY-this._copyOffset.y+"px",this._dragCopy.style.left=e.clientX-this._copyOffset.x+"px",this._dragCopy.style.position="fixed",this._dragCopy.style.pointerEvents="none",this._dragCopy.style.zIndex="999999",this._dragCopy=document.body.appendChild(this._dragCopy),this._dispatchEvent(this._dragSrc,"dragstart")}if(this._dragRunning){let r=this;requestAnimationFrame(function(){r._touchEndCalled||r._dragCopy===null||(r._dragCopy.style.top=e.clientY-r._copyOffset.y+"px",r._dragCopy.style.left=e.clientX-r._copyOffset.x+"px")});let s=this._findDroppable(t);s!=this._lastTarget&&(this._dispatchEvent(s,"dragenter"),this._dispatchEvent(this._lastTarget,"dragleave"),this._lastTarget=s),this._currentDropContainer=s,this._currentDropContainer&&this._dispatchEvent(s,"dragover")}};return i._instance?i._instance:(i._instance=this,document.addEventListener("touchmove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("mousemove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchend",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("mouseup",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchcancel",this._touchCancel.bind(this),{passive:!1,capture:!1}),this)}addDraggables(t){t.forEach(e=>{e.addEventListener("touchstart",this._touchStart.bind(this),{passive:!1,capture:!1}),e.addEventListener("mousedown",this._touchStart.bind(this),{passive:!1,capture:!1})})}_touchStart(t){this._touchBegin=Date.now();let{x:e,y:r}=this._getPoint(t);if(this._touchDown={x:e,y:r},this._dragSrc=t.currentTarget,this._canDrag=!0,this.dragOnClick){let s={clientX:e,clientY:r};this._dragRunning=!0,this._createDragCopy(t,s)}t.preventDefault()}_touchMove(t){if(this._canDrag&&this._dragSrc){let{x:e,y:r}=this._getPoint(t),s={clientX:e,clientY:r};this._getDelta(s)>=this._DRAGDELTA&&(this._dragRunning=!0),this._createDragCopy(t,s),t.preventDefault()}}_touchEnd(t){var e;if(this._touchEndCalled=!0,this._canDrag=!1,this._currentDropContainer)this._dispatchEvent(this._currentDropContainer,"drop"),this._dispatchEvent(this._dragSrc,"dragend");else if(this._dragRunning){let r=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});r.dataTransfer={dropEffect:"none"},(e=this._dragSrc)==null||e.dispatchEvent(r)}this._reset()}_touchCancel(t){this._reset()}_findDroppable(t){let e=this._getPoint(t),r=new Set;return this.getElementWithDropzone(document,e.x,e.y,r)}getElementWithDropzone(t,e,r,s){let o=t.elementFromPoint(e,r);if(o){if(s.has(o))return null;if(s.add(o),o.hasAttribute("dropzone"))return o;if(o.shadowRoot){let n=this.getElementWithDropzone(o.shadowRoot,e,r,s);if(n)return n}return o}return null}_getPoint(t,e){return t&&t.touches&&(t=t.touches[0]),{x:e?t.pageX:t.clientX,y:e?t.pageY:t.clientY}}_calculateDragCopyPosition(t){let e=this._dragSrc.getBoundingClientRect();this._copyOffset.x=t.clientX-e.left,this._copyOffset.y=t.clientY-e.top}_getDelta(t){let e=Math.abs(t.clientX-this._touchDown.x),r=Math.abs(t.clientY-this._touchDown.y);return e+r}_dispatchEvent(t,e,r=!0){if(!t)return!1;let s=new CustomEvent(e,{bubbles:r,cancelable:!0});return s.dataTransfer=this._dataTransfer,t.dispatchEvent(s),s.defaultPrevented}_reset(){this._dragRunning&&(this._dragSrc.style.opacity="1.0",this._dragCopy.parentElement.removeChild(this._dragCopy)),this._dragRunning=!1,this._dragSrc=null,this._dragCopy=null,this._canDrag=!1,this._touchBegin=0,this._touchDown=null,this._lastClick=0,this._touchEndCalled=!1,this._dataTransfer={data:{},setData:function(t,e){this.data[t]=e},getData:function(t){return this.data[t]},effectAllowed:"move"},this._copyOffset={x:0,y:0},this._lastTarget=null,this._currentDropContainer=null,this._handleClick=!0}};var ws=(i,t,e)=>{class r extends i{constructor(){super(...arguments);this.disabled=!1}firstUpdated(n){if(this.classList.contains("qti-match-tabular"))return;super.firstUpdated(n);let a=Array.from(t?this.shadowRoot.querySelectorAll(e):this.querySelectorAll(e));this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this),a.forEach(c=>{c.setAttribute("dropzone","move"),c.addEventListener("dragleave",this.dragleaveHandler),this.attachHandler(c)});for(let c of a)this.observer=new MutationObserver(d=>{d.forEach(h=>{if(h.type==="attributes")switch(h.attributeName){case"disabled":{c.hasAttribute("disabled")?this.removeHandler(c):this.attachHandler(c);break}}})}),this.observer.observe(c,{attributes:!0})}attachHandler(n){n.addEventListener("dragover",this.dragoverHandler),n.addEventListener("dragenter",this.dragenterHandler),n.addEventListener("drop",this.dropHandler)}removeHandler(n){n.removeEventListener("dragover",this.dragoverHandler),n.removeEventListener("dragenter",this.dragenterHandler),n.removeEventListener("drop",this.dropHandler)}disconnectedCallback(){var n;this.classList.contains("qti-match-tabular")||(super.disconnectedCallback(),(n=this.observer)==null||n.disconnect())}dragenterHandler(n){n.preventDefault()}dragoverHandler(n){return n.preventDefault(),n.currentTarget.setAttribute("active",""),n.dataTransfer.dropEffect="move",!1}dropHandler(n){n.preventDefault();let a=n.currentTarget,c=this.querySelector(`[identifier=${n.dataTransfer.getData("text")}`),d=c||this.shadowRoot.querySelector(`[identifier=${n.dataTransfer.getData("text")}`);return a?d.parentElement.getAttribute("identifier")!==a.getAttribute("identifier")&&a.appendChild(d):console.error(`cannot find droppable, target: ${n.target?JSON.stringify(n.target):"null"}`),a.removeAttribute("active"),!1}dragleaveHandler(n){return n.preventDefault(),n.currentTarget.removeAttribute("active"),n.dataTransfer.dropEffect="none",!1}}return l([p({type:Boolean,reflect:!0})],r.prototype,"disabled",2),r};var Ss=(i,t,e)=>{class r extends i{}return r};var z=(i,t,e,r)=>{class s extends Ss(ws(i,e,r),r,t){constructor(){super(...arguments);this.draggables=new Map;this.responseIdentifier="";this.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};this.disabled=!1;this.readonly=!1;this.minAssociations=1;this.maxAssociations=1;this.handleDragStart=a=>{a.dataTransfer.setData("text",a.currentTarget.getAttribute("identifier")),a.currentTarget.setAttribute("dragging",""),this.droppables.forEach(c=>c.setAttribute("enabled",""))};this.handleDragEnd=a=>{a.preventDefault(),this.droppables.forEach(d=>d.removeAttribute("enabled"));let c=a.currentTarget;c.removeAttribute("over"),c.removeAttribute("dragging"),(a.dataTransfer.dropEffect==="none"||a.dataTransfer.dropEffect===void 0)&&this.configuration.dragCanBePlacedBack&&this.placeDraggableBack(c),a.dataTransfer.dropEffect==="move"&&(this.saveResponse(),this.checkMaxMatchAssociations())}}reInitDragAndDrop(a,c){if(this.classList.contains("qti-match-tabular"))return;a.filter(h=>!this.draggables||!this.draggables.get(h)).length>0&&(this.dragDropApi.addDraggables(a),a.forEach(h=>{this.draggables.set(h,{parent:h.parentElement,index:Array.from(h.parentNode.children).indexOf(h)}),h.setAttribute("qti-draggable","true"),h.addEventListener("dragstart",this.handleDragStart),h.addEventListener("dragend",this.handleDragEnd)}))}handleDragOptionsChanged(a,c){this.dragDropApi.copyStylesDragClone=c.copyStylesDragClone,this.dragDropApi.dragOnClick=c.dragOnClick}handleDisabledChange(a,c){this.draggables.forEach((d,h)=>{c?h.setAttribute("disabled",""):h.removeAttribute("disabled"),c?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}handleReadonlyChange(a,c){this.draggables.forEach((d,h)=>{c?h.setAttribute("readonly",""):h.removeAttribute("readonly"),c?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}firstUpdated(a){super.firstUpdated(a),this.droppables=Array.from(e?this.shadowRoot.querySelectorAll(r):this.querySelectorAll(r))}connectedCallback(){super.connectedCallback(),this.dragDropApi=new Bt,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}placeDraggableBack(a){let c=this.draggables.get(a),d=c.index<=c.parent.children.length?c.index:c.parent.children.length-1,h=c.parent,g=c.parent.children[d];h.insertBefore(a,g),this.saveResponse(),this.checkMaxMatchAssociations()}reset(a=!0){this.draggables.forEach((c,d)=>{let h=c.parent.children,g=c.index<h.length?c.index:h.length;c.parent.insertBefore(d,h[g])}),a&&this.saveResponse()}checkMaxMatchAssociations(){this.droppables.forEach(a=>{let d=+(a.getAttribute("match-max")||1)<=(a.querySelectorAll('[qti-draggable="true"]').length||0);d?a.setAttribute("disabled",""):a.removeAttribute("disabled"),d?a.removeAttribute("dropzone"):a.setAttribute("dropzone","move")})}set response(a){this.classList.contains("qti-match-tabular")||(this.reset(!1),a!==null&&Array.isArray(a)&&a.forEach(c=>{let[d,...h]=c.split(" ").reverse();if(d){let g=this.droppables.find(y=>y.getAttribute("identifier")===d);h.forEach(y=>{let v=this.querySelector(`[identifier=${y}]`);g?v?(g.appendChild(v),this.checkMaxMatchAssociations()):console.error(`cannot find draggable with identifier: ${y}`):console.error(`cannot find droppable with identifier: ${d}`)})}}))}validate(){let c=(e?Array.from(this.shadowRoot.querySelectorAll(r)):Array.from(this.querySelectorAll(r))).filter(d=>d.childElementCount>0).length;return this.minAssociations<=0||this.minAssociations<=c}saveResponse(){let a;typeof this.getResponse=="function"?a=this.getResponse():a=this.droppables.map(c=>{let d=c.querySelectorAll('[qti-draggable="true"]'),h=Array.from(d).map(y=>y.getAttribute("identifier")),g=c.getAttribute("identifier");return[...h,g].join(" ")}),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:a}}))}}return l([xs(t)],s.prototype,"reInitDragAndDrop",1),l([p({type:String,attribute:"response-identifier"})],s.prototype,"responseIdentifier",2),l([p({attribute:!1,type:Object})],s.prototype,"configuration",2),l([S("configuration")],s.prototype,"handleDragOptionsChanged",1),l([p({type:Boolean,reflect:!0})],s.prototype,"disabled",2),l([S("disabled",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),l([p({type:Boolean,reflect:!0})],s.prototype,"readonly",2),l([S("readonly",{waitUntilFirstUpdate:!0})],s.prototype,"handleReadonlyChange",1),l([p({type:Number,reflect:!0,attribute:"min-associations"})],s.prototype,"minAssociations",2),l([p({type:Number,reflect:!0,attribute:"max-associations"})],s.prototype,"maxAssociations",2),s};var Re=class extends z(f,"qti-simple-associable-choice",!0,".dl"){render(){return u` <slot name="prompt"></slot>
217
+ </div>`}`}};l([d({type:String,attribute:"response-identifier"})],pe.prototype,"responseIdentifier",2),l([d({type:String,attribute:"module"})],pe.prototype,"module",2),l([d({type:String,attribute:"custom-interaction-type-identifier"})],pe.prototype,"customInteractionTypeIdentifier",2),l([q()],pe.prototype,"_errorMessage",2),pe=l([m("qti-portable-custom-interaction")],pe);var Zt=class s{constructor(){this._touchBegin=0;this._touchDown=null;this._lastClick=0;this._canDrag=!1;this._dragSrc=null;this._dragCopy=null;this._touchEndCalled=!1;this._dragRunning=!1;this._dataTransfer={data:{},setData:function(t,e){this.data[t]=e},getData:function(t){return this.data[t]},effectAllowed:"move"};this._copyOffset={x:0,y:0};this._lastTarget=null;this._currentDropContainer=null;this._handleClick=!0;this._DBLCLICKDELAY=500;this._CONTEXTMENUDELAY=1e3;this._DRAGDELTA=5;this._COPYOPACITY=1;this._ORGOPACITY=.7;this.copyStylesDragClone=!0;this.dragOnClick=!1;this._createDragCopy=(t,e)=>{if(this._dragCopy===null&&this._dragRunning){this._dragSrc.style.opacity=this._COPYOPACITY,this._dragCopy=this._dragSrc.cloneNode(!0);let r=window.getComputedStyle(this._dragSrc);if(this._dragCopy.style="",this._dragCopy.setAttribute("dragclone",""),this.copyStylesDragClone)for(let i of r)this._dragCopy.style[i]=r.getPropertyValue(i);this._calculateDragCopyPosition(e),this._dragCopy.style.top=e.clientY-this._copyOffset.y+"px",this._dragCopy.style.left=e.clientX-this._copyOffset.x+"px",this._dragCopy.style.position="fixed",this._dragCopy.style.pointerEvents="none",this._dragCopy.style.zIndex="999999",this._dragCopy=document.body.appendChild(this._dragCopy),this._dispatchEvent(this._dragSrc,"dragstart")}if(this._dragRunning){let r=this;requestAnimationFrame(function(){r._touchEndCalled||r._dragCopy===null||(r._dragCopy.style.top=e.clientY-r._copyOffset.y+"px",r._dragCopy.style.left=e.clientX-r._copyOffset.x+"px")});let i=this._findDroppable(t);i!=this._lastTarget&&(this._dispatchEvent(i,"dragenter"),this._dispatchEvent(this._lastTarget,"dragleave"),this._lastTarget=i),this._currentDropContainer=i,this._currentDropContainer&&this._dispatchEvent(i,"dragover")}};return s._instance?s._instance:(s._instance=this,document.addEventListener("touchmove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("mousemove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchend",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("mouseup",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchcancel",this._touchCancel.bind(this),{passive:!1,capture:!1}),this)}addDraggables(t){t.forEach(e=>{e.addEventListener("touchstart",this._touchStart.bind(this),{passive:!1,capture:!1}),e.addEventListener("mousedown",this._touchStart.bind(this),{passive:!1,capture:!1})})}_touchStart(t){this._touchBegin=Date.now();let{x:e,y:r}=this._getPoint(t);if(this._touchDown={x:e,y:r},this._dragSrc=t.currentTarget,this._canDrag=!0,this.dragOnClick){let i={clientX:e,clientY:r};this._dragRunning=!0,this._createDragCopy(t,i)}t.preventDefault()}_touchMove(t){if(this._canDrag&&this._dragSrc){let{x:e,y:r}=this._getPoint(t),i={clientX:e,clientY:r};this._getDelta(i)>=this._DRAGDELTA&&(this._dragRunning=!0),this._createDragCopy(t,i),t.preventDefault()}}_touchEnd(t){var e;if(this._touchEndCalled=!0,this._canDrag=!1,this._currentDropContainer)this._dispatchEvent(this._currentDropContainer,"drop"),this._dispatchEvent(this._dragSrc,"dragend");else if(this._dragRunning){let r=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});r.dataTransfer={dropEffect:"none"},(e=this._dragSrc)==null||e.dispatchEvent(r)}this._reset()}_touchCancel(t){this._reset()}_findDroppable(t){let e=this._getPoint(t),r=new Set;return this.getElementWithDropzone(document,e.x,e.y,r)}getElementWithDropzone(t,e,r,i){let o=t.elementFromPoint(e,r);if(o){if(i.has(o))return null;if(i.add(o),o.hasAttribute("dropzone"))return o;if(o.shadowRoot){let n=this.getElementWithDropzone(o.shadowRoot,e,r,i);if(n)return n}return o}return null}_getPoint(t,e){return t&&t.touches&&(t=t.touches[0]),{x:e?t.pageX:t.clientX,y:e?t.pageY:t.clientY}}_calculateDragCopyPosition(t){let e=this._dragSrc.getBoundingClientRect();this._copyOffset.x=t.clientX-e.left,this._copyOffset.y=t.clientY-e.top}_getDelta(t){let e=Math.abs(t.clientX-this._touchDown.x),r=Math.abs(t.clientY-this._touchDown.y);return e+r}_dispatchEvent(t,e,r=!0){if(!t)return!1;let i=new CustomEvent(e,{bubbles:r,cancelable:!0});return i.dataTransfer=this._dataTransfer,t.dispatchEvent(i),i.defaultPrevented}_reset(){this._dragRunning&&(this._dragSrc.style.opacity="1.0",this._dragCopy.parentElement.removeChild(this._dragCopy)),this._dragRunning=!1,this._dragSrc=null,this._dragCopy=null,this._canDrag=!1,this._touchBegin=0,this._touchDown=null,this._lastClick=0,this._touchEndCalled=!1,this._dataTransfer={data:{},setData:function(t,e){this.data[t]=e},getData:function(t){return this.data[t]},effectAllowed:"move"},this._copyOffset={x:0,y:0},this._lastTarget=null,this._currentDropContainer=null,this._handleClick=!0}};var Di=(s,t,e)=>{class r extends s{constructor(){super(...arguments);this.disabled=!1}firstUpdated(n){if(this.classList.contains("qti-match-tabular"))return;super.firstUpdated(n);let a=Array.from(t?this.shadowRoot.querySelectorAll(e):this.querySelectorAll(e));this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this),a.forEach(c=>{c.setAttribute("dropzone","move"),c.addEventListener("dragleave",this.dragleaveHandler),this.attachHandler(c)});for(let c of a)this.observer=new MutationObserver(p=>{p.forEach(h=>{if(h.type==="attributes")switch(h.attributeName){case"disabled":{c.hasAttribute("disabled")?this.removeHandler(c):this.attachHandler(c);break}}})}),this.observer.observe(c,{attributes:!0})}attachHandler(n){n.addEventListener("dragover",this.dragoverHandler),n.addEventListener("dragenter",this.dragenterHandler),n.addEventListener("drop",this.dropHandler)}removeHandler(n){n.removeEventListener("dragover",this.dragoverHandler),n.removeEventListener("dragenter",this.dragenterHandler),n.removeEventListener("drop",this.dropHandler)}disconnectedCallback(){var n;this.classList.contains("qti-match-tabular")||(super.disconnectedCallback(),(n=this.observer)==null||n.disconnect())}dragenterHandler(n){n.preventDefault()}dragoverHandler(n){return n.preventDefault(),n.currentTarget.setAttribute("active",""),n.dataTransfer.dropEffect="move",!1}dropHandler(n){n.preventDefault();let a=n.currentTarget,c=this.querySelector(`[identifier=${n.dataTransfer.getData("text")}`),p=c||this.shadowRoot.querySelector(`[identifier=${n.dataTransfer.getData("text")}`);return a?p.parentElement.getAttribute("identifier")!==a.getAttribute("identifier")&&a.appendChild(p):console.error(`cannot find droppable, target: ${n.target?JSON.stringify(n.target):"null"}`),a.removeAttribute("active"),!1}dragleaveHandler(n){return n.preventDefault(),n.currentTarget.removeAttribute("active"),n.dataTransfer.dropEffect="none",!1}}return l([d({type:Boolean,reflect:!0})],r.prototype,"disabled",2),r};var Oi=(s,t,e)=>{class r extends s{}return r};var W=(s,t,e,r)=>{class i extends Oi(Di(s,e,r),r,t){constructor(){super(...arguments);this.draggables=new Map;this.responseIdentifier="";this.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};this.disabled=!1;this.readonly=!1;this.minAssociations=1;this.maxAssociations=1;this.handleDragStart=a=>{a.dataTransfer.setData("text",a.currentTarget.getAttribute("identifier")),a.currentTarget.setAttribute("dragging",""),this.droppables.forEach(c=>c.setAttribute("enabled",""))};this.handleDragEnd=a=>{a.preventDefault(),this.droppables.forEach(p=>p.removeAttribute("enabled"));let c=a.currentTarget;c.removeAttribute("over"),c.removeAttribute("dragging"),(a.dataTransfer.dropEffect==="none"||a.dataTransfer.dropEffect===void 0)&&this.configuration.dragCanBePlacedBack&&this.placeDraggableBack(c),a.dataTransfer.dropEffect==="move"&&(this.saveResponse(),this.checkMaxMatchAssociations())}}reInitDragAndDrop(a,c){if(this.classList.contains("qti-match-tabular"))return;a.filter(h=>!this.draggables||!this.draggables.get(h)).length>0&&(this.dragDropApi.addDraggables(a),a.forEach(h=>{this.draggables.set(h,{parent:h.parentElement,index:Array.from(h.parentNode.children).indexOf(h)}),h.setAttribute("qti-draggable","true"),h.addEventListener("dragstart",this.handleDragStart),h.addEventListener("dragend",this.handleDragEnd)}))}handleDragOptionsChanged(a,c){this.dragDropApi.copyStylesDragClone=c.copyStylesDragClone,this.dragDropApi.dragOnClick=c.dragOnClick}handleDisabledChange(a,c){this.draggables.forEach((p,h)=>{c?h.setAttribute("disabled",""):h.removeAttribute("disabled"),c?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}handleReadonlyChange(a,c){this.draggables.forEach((p,h)=>{c?h.setAttribute("readonly",""):h.removeAttribute("readonly"),c?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}firstUpdated(a){super.firstUpdated(a),this.droppables=Array.from(e?this.shadowRoot.querySelectorAll(r):this.querySelectorAll(r))}connectedCallback(){super.connectedCallback(),this.dragDropApi=new Zt,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}placeDraggableBack(a){let c=this.draggables.get(a),p=c.index<=c.parent.children.length?c.index:c.parent.children.length-1,h=c.parent,g=c.parent.children[p];h.insertBefore(a,g),this.saveResponse(),this.checkMaxMatchAssociations()}reset(a=!0){this.draggables.forEach((c,p)=>{let h=c.parent.children,g=c.index<h.length?c.index:h.length;c.parent.insertBefore(p,h[g])}),a&&this.saveResponse()}checkMaxMatchAssociations(){this.droppables.forEach(a=>{let p=+(a.getAttribute("match-max")||1)<=(a.querySelectorAll('[qti-draggable="true"]').length||0);p?a.setAttribute("disabled",""):a.removeAttribute("disabled"),p?a.removeAttribute("dropzone"):a.setAttribute("dropzone","move")})}set response(a){this.classList.contains("qti-match-tabular")||(this.reset(!1),a!==null&&Array.isArray(a)&&a.forEach(c=>{let[p,...h]=c.split(" ").reverse();if(p){let g=this.droppables.find(y=>y.getAttribute("identifier")===p);h.forEach(y=>{let v=this.querySelector(`[identifier=${y}]`);g?v?(g.appendChild(v),this.checkMaxMatchAssociations()):console.error(`cannot find draggable with identifier: ${y}`):console.error(`cannot find droppable with identifier: ${p}`)})}}))}validate(){let c=(e?Array.from(this.shadowRoot.querySelectorAll(r)):Array.from(this.querySelectorAll(r))).filter(p=>p.childElementCount>0).length;return this.minAssociations<=0||this.minAssociations<=c}saveResponse(){let a;typeof this.getResponse=="function"?a=this.getResponse():a=this.droppables.map(c=>{let p=c.querySelectorAll('[qti-draggable="true"]'),h=Array.from(p).map(y=>y.getAttribute("identifier")),g=c.getAttribute("identifier");return[...h,g].join(" ")}),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:a}}))}}return l([Mi(t)],i.prototype,"reInitDragAndDrop",1),l([d({type:String,attribute:"response-identifier"})],i.prototype,"responseIdentifier",2),l([d({attribute:!1,type:Object})],i.prototype,"configuration",2),l([A("configuration")],i.prototype,"handleDragOptionsChanged",1),l([d({type:Boolean,reflect:!0})],i.prototype,"disabled",2),l([A("disabled",{waitUntilFirstUpdate:!0})],i.prototype,"handleDisabledChange",1),l([d({type:Boolean,reflect:!0})],i.prototype,"readonly",2),l([A("readonly",{waitUntilFirstUpdate:!0})],i.prototype,"handleReadonlyChange",1),l([d({type:Number,reflect:!0,attribute:"min-associations"})],i.prototype,"minAssociations",2),l([d({type:Number,reflect:!0,attribute:"max-associations"})],i.prototype,"maxAssociations",2),i};var Me=class extends W(f,"qti-simple-associable-choice",!0,".dl"){render(){return u` <slot name="prompt"></slot>
217
218
  <slot name="qti-simple-associable-choice"></slot>
218
- ${this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map((t,e)=>u`<div part="associables-container">
219
- <div name="left${e}" part="drop-list" class="dl" identifier="droplist${e}_left"></div>
220
- <div name="right${e}" part="drop-list" class="dl" identifier="droplist${e}_right"></div>
221
- </div>`)}`}connectedCallback(){super.connectedCallback(),this._childrenMap=Array.from(this.querySelectorAll("qti-simple-associable-choice"))}};Re.styles=b`
219
+ <div part="drop-container">
220
+ ${this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map((t,e)=>u`<div part="associables-container">
221
+ <div name="left${e}" part="drop-list" class="dl" identifier="droplist${e}_left"></div>
222
+ <div name="right${e}" part="drop-list" class="dl" identifier="droplist${e}_right"></div>
223
+ </div>`)}
224
+ </div>`}connectedCallback(){super.connectedCallback(),this._childrenMap=Array.from(this.querySelectorAll("qti-simple-associable-choice"))}};Me.styles=b`
222
225
  :host {
223
226
  display: block; /* necessary to calculate scaling position */
224
227
  }
@@ -227,15 +230,15 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
227
230
  flex-wrap: wrap;
228
231
  gap: 0.5rem;
229
232
  }
230
- `,l([E()],Re.prototype,"_childrenMap",2),Re=l([m("qti-associate-interaction")],Re);var Y=class extends A{constructor(){super();this._errorMessage=null;this.handlePostMessage=this.handlePostMessage.bind(this)}connectedCallback(){super.connectedCallback();let e=this.data.startsWith("http")?this.data:We(this.baseItemUrl+"/"+this.data);fetch(e).then(r=>r.json()).then(r=>{this.manifest=r,this.setupCES()}).catch(r=>{this._errorMessage=r})}setupCES(){let e=this.shadowRoot.querySelector("#pciContainer"),r=e.contentWindow||e,s=e.contentDocument;window.addEventListener("message",this.handlePostMessage),s.open(),s.write(`
233
+ `,l([q()],Me.prototype,"_childrenMap",2),Me=l([m("qti-associate-interaction")],Me);var K=class extends k{constructor(){super();this._errorMessage=null;this.handlePostMessage=this.handlePostMessage.bind(this)}connectedCallback(){super.connectedCallback();let e=this.data.startsWith("http")?this.data:Ge(this.baseItemUrl+"/"+this.data);fetch(e).then(r=>r.json()).then(r=>{this.manifest=r,this.setupCES()}).catch(r=>{this._errorMessage=r})}setupCES(){let e=this.shadowRoot.querySelector("#pciContainer"),r=e.contentWindow||e,i=e.contentDocument;window.addEventListener("message",this.handlePostMessage),i.open(),i.write(`
231
234
  <html>
232
235
  <head>
233
- <link href='${We(`${this.baseRefUrl}/${this.manifest.style[0]}`)}' rel="stylesheet" />
234
- <script src='${We(`${this.baseRefUrl}/${this.manifest.script[0]}`)}'></script>
236
+ <link href='${Ge(`${this.baseRefUrl}/${this.manifest.style[0]}`)}' rel="stylesheet" />
237
+ <script src='${Ge(`${this.baseRefUrl}/${this.manifest.script[0]}`)}'></script>
235
238
  </head>
236
239
  <body></body>
237
240
  </html>
238
- `),s.close()}getIFrames(){let e=this.shadowRoot.querySelectorAll("iframe"),r=this.querySelectorAll("iframe"),s=[...e,...r];for(let o of s){let n=o.src;if(new URL(n,window.location.href).origin===window.location.origin)try{let c=o.contentDocument||o.contentWindow.document;c&&this.getInnerIFrames(c,s)}catch(c){console.error("Error accessing nested iframe:",c)}}return s.forEach((o,n)=>{s.indexOf(o)!==n&&s.splice(n,1)}),s}getInnerIFrames(e,r=[]){return e.querySelectorAll("iframe").forEach(o=>{r.push(o);let n=o.src;if(new URL(n,window.location.href).origin===window.location.origin)try{let c=o.contentDocument||o.contentWindow.document;this.getInnerIFrames(c,r)}catch(c){console.error("Error accessing nested iframe:",c)}else console.warn("Skipped cross-origin iframe:",n)}),r}postToWindowAndIframes(e,r){window.postMessage({type:e,data:r},"*");let s=this.getIFrames();for(let o of s)o.contentWindow&&o.contentWindow.postMessage({type:e,data:r},"*")}handlePostMessage(e){let{type:r,data:s}=e.data;switch(r){case"setResponse":this.rawResponse=s,this.saveResponse(s);break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{let o=this.manifest.media.map(n=>n.startsWith("http")?n:We(this.baseRefUrl+"/"+n));this.postToWindowAndIframes("mediaData",o);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}validate(){return this.rawResponse!==""}set response(e){this.rawResponse=e}disconnectedCallback(){window.removeEventListener("message",this.handlePostMessage),super.disconnectedCallback()}render(){return u`<iframe
241
+ `),i.close()}getIFrames(){let e=this.shadowRoot.querySelectorAll("iframe"),r=this.querySelectorAll("iframe"),i=[...e,...r];for(let o of i){let n=o.src;if(new URL(n,window.location.href).origin===window.location.origin)try{let c=o.contentDocument||o.contentWindow.document;c&&this.getInnerIFrames(c,i)}catch(c){console.error("Error accessing nested iframe:",c)}}return i.forEach((o,n)=>{i.indexOf(o)!==n&&i.splice(n,1)}),i}getInnerIFrames(e,r=[]){return e.querySelectorAll("iframe").forEach(o=>{r.push(o);let n=o.src;if(new URL(n,window.location.href).origin===window.location.origin)try{let c=o.contentDocument||o.contentWindow.document;this.getInnerIFrames(c,r)}catch(c){console.error("Error accessing nested iframe:",c)}else console.warn("Skipped cross-origin iframe:",n)}),r}postToWindowAndIframes(e,r){window.postMessage({type:e,data:r},"*");let i=this.getIFrames();for(let o of i)o.contentWindow&&o.contentWindow.postMessage({type:e,data:r},"*")}handlePostMessage(e){let{type:r,data:i}=e.data;switch(r){case"setResponse":this.rawResponse=i,this.saveResponse(i);break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{let o=this.manifest.media.map(n=>n.startsWith("http")?n:Ge(this.baseRefUrl+"/"+n));this.postToWindowAndIframes("mediaData",o);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}validate(){return this.rawResponse!==""}set response(e){this.rawResponse=e}disconnectedCallback(){window.removeEventListener("message",this.handlePostMessage),super.disconnectedCallback()}render(){return u`<iframe
239
242
  width=${this.getAttribute("width")}
240
243
  height=${this.getAttribute("height")}
241
244
  frameborder="0"
@@ -246,8 +249,8 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
246
249
  ${this._errorMessage&&u`<div style="color:red">
247
250
  <h1>Error</h1>
248
251
  ${this._errorMessage}
249
- </div>`}`}};l([p({type:String,attribute:"response-identifier"})],Y.prototype,"responseIdentifier",2),l([p({type:String,attribute:"data"})],Y.prototype,"data",2),l([p({type:String,attribute:"data-base-item"})],Y.prototype,"baseItemUrl",2),l([p({type:String,attribute:"data-base-ref"})],Y.prototype,"baseRefUrl",2),l([p({type:String,attribute:"id"})],Y.prototype,"id",2),l([E()],Y.prototype,"_errorMessage",2),Y=l([m("qti-custom-interaction")],Y);var $e=class extends A{constructor(){super(...arguments);this.countAttempt="true"}validate(){return!0}set response(e){}render(){return u`<button ?disabled=${this.disabled} part="button" @click=${this.endAttempt}>${this.title}</button>`}endAttempt(e){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}};l([p({type:String,attribute:"count-attempt"})],$e.prototype,"countAttempt",2),l([p({type:String})],$e.prototype,"title",2),$e=l([m("qti-end-attempt-interaction")],$e);var it=class extends z(f,"qti-gap-text",!1,"qti-gap"){render(){return u` <slot part="drags" name="qti-gap-text"></slot>
250
- <slot part="drops"></slot>`}set correctResponse(t){let e=[],r=Array.isArray(t)?t:[t];r&&(e=r.map(o=>{let n=o.split(" ");return{text:n[0],gap:n[1]}})),this.querySelectorAll("qti-gap").forEach((o,n)=>{var h,g,y,v;let a=o.getAttribute("identifier"),c=(h=e.find(C=>C.gap===a))==null?void 0:h.text,d=(g=this.querySelector(`qti-gap-text[identifier="${c}"]`))==null?void 0:g.textContent.trim();if(c&&d){if(!((y=o.nextElementSibling)!=null&&y.classList.contains("correct-option"))){let C=document.createElement("span");C.classList.add("correct-option"),C.textContent=d,o.insertAdjacentElement("afterend",C)}}else(v=o.nextElementSibling)!=null&&v.classList.contains("correct-option")&&o.nextElementSibling.remove()})}};it.styles=[b`
252
+ </div>`}`}};l([d({type:String,attribute:"response-identifier"})],K.prototype,"responseIdentifier",2),l([d({type:String,attribute:"data"})],K.prototype,"data",2),l([d({type:String,attribute:"data-base-item"})],K.prototype,"baseItemUrl",2),l([d({type:String,attribute:"data-base-ref"})],K.prototype,"baseRefUrl",2),l([d({type:String,attribute:"id"})],K.prototype,"id",2),l([q()],K.prototype,"_errorMessage",2),K=l([m("qti-custom-interaction")],K);var Le=class extends k{constructor(){super(...arguments);this.countAttempt="true"}validate(){return!0}set response(e){}render(){return u`<button ?disabled=${this.disabled} part="button" @click=${this.endAttempt}>${this.title}</button>`}endAttempt(e){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}};l([d({type:String,attribute:"count-attempt"})],Le.prototype,"countAttempt",2),l([d({type:String})],Le.prototype,"title",2),Le=l([m("qti-end-attempt-interaction")],Le);var lt=class extends W(f,"qti-gap-text",!1,"qti-gap"){render(){return u` <slot part="drags" name="qti-gap-text"></slot>
253
+ <slot part="drops"></slot>`}set correctResponse(t){let e=[],r=Array.isArray(t)?t:[t];r&&(e=r.map(o=>{let n=o.split(" ");return{text:n[0],gap:n[1]}})),this.querySelectorAll("qti-gap").forEach((o,n)=>{var h,g,y,v;let a=o.getAttribute("identifier"),c=(h=e.find(w=>w.gap===a))==null?void 0:h.text,p=(g=this.querySelector(`qti-gap-text[identifier="${c}"]`))==null?void 0:g.textContent.trim();if(c&&p){if(!((y=o.nextElementSibling)!=null&&y.classList.contains("correct-option"))){let w=document.createElement("span");w.classList.add("correct-option"),w.textContent=p,o.insertAdjacentElement("afterend",w)}}else(v=o.nextElementSibling)!=null&&v.classList.contains("correct-option")&&o.nextElementSibling.remove()})}};lt.styles=[b`
251
254
  :host {
252
255
  display: flex;
253
256
  align-items: flex-start;
@@ -274,14 +277,14 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
274
277
  flex: 1;
275
278
  gap: 0.5rem;
276
279
  }
277
- `],it=l([m("qti-gap-match-interaction")],it);var Ts=(i,t,e)=>{let r=new Map;for(let s=t;s<=e;s++)r.set(i[s],s);return r},jt=Q(class extends B{constructor(i){if(super(i),i.type!==oe.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,t,e){let r;e===void 0?e=t:t!==void 0&&(r=t);let s=[],o=[],n=0;for(let a of i)s[n]=r?r(a,n):n,o[n]=e(a,n),n++;return{values:o,keys:s}}render(i,t,e){return this.dt(i,t,e).values}update(i,[t,e,r]){var w;let s=bs(i),{values:o,keys:n}=this.dt(t,e,r);if(!Array.isArray(s))return this.ut=n,o;let a=(w=this.ut)!=null?w:this.ut=[],c=[],d,h,g=0,y=s.length-1,v=0,C=o.length-1;for(;g<=y&&v<=C;)if(s[g]===null)g++;else if(s[y]===null)y--;else if(a[g]===n[v])c[v]=ie(s[g],o[v]),g++,v++;else if(a[y]===n[C])c[C]=ie(s[y],o[C]),y--,C--;else if(a[g]===n[C])c[C]=ie(s[g],o[C]),we(i,c[C+1],s[g]),g++,C--;else if(a[y]===n[v])c[v]=ie(s[y],o[v]),we(i,s[g],s[y]),y--,v++;else if(d===void 0&&(d=Ts(n,v,C),h=Ts(a,g,y)),d.has(a[g]))if(d.has(a[y])){let R=h.get(n[v]),ye=R!==void 0?s[R]:null;if(ye===null){let mt=we(i,s[g]);ie(mt,o[v]),c[v]=mt}else c[v]=ie(ye,o[v]),we(i,s[g],ye),s[R]=null;v++}else $t(s[y]),y--;else $t(s[g]),g++;for(;v<=C;){let R=we(i,c[C+1]);ie(R,o[v]),c[v++]=R}for(;g<=y;){let R=s[g++];R!==null&&$t(R)}return this.ut=n,gs(i,c),M}});function ke(i,t,e,r){switch(i){case"circle":{let[s,o,n]=t,a=s/e.width*100,c=o/e.height*100,d=n/e.width*100;r.style.left=a-d+"%",r.style.top=c-d+"%",r.style.width=r.style.height=4*d+"px",r.style.borderRadius="9999px"}break;case"rect":{let[s,o,n,a]=t,c=s/e.width*100,d=o/e.height*100,h=n/e.width*100,g=a/e.height*100;r.style.left=c+"%",r.style.top=d+"%",r.style.width=h-c+"%",r.style.height=g-d+"%"}break;case"poly":{let s=t.reduce((w,R,ye,mt)=>{if(ye%2===1){let ks=w.pop();w[w.length]={x:ks,y:mt[ye]}}else w.push(R);return w},[]),o=Math.min(...s.map(w=>w.x)),n=Math.max(...s.map(w=>w.x)),a=Math.min(...s.map(w=>w.y)),c=Math.max(...s.map(w=>w.y)),d=o/e.width*100,h=a/e.height*100,g=n/e.width*100,y=c/e.height*100;r.style.left=o/e.width*100+"%",r.style.top=a/e.height*100+"%",r.style.width=g-d+"%",r.style.height=y-h+"%";let C=s.map(w=>({x:(w.x-o)/(n-o)*100,y:(w.y-a)/(c-a)*100})).map(w=>Math.round(w.x)+"% "+Math.round(w.y)+"%").join(",");r.style.clipPath=`polygon(${C})`}break;default:break}}var W=class extends A{constructor(){super();this.startPoint=null;this.endPoint=null;this._lines=[];this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}reset(){this._lines=[]}validate(){return this._lines.length>0}set response(e){Array.isArray(e)&&(this._lines=e)}render(){var e,r,s,o;return u`<slot name="prompt"></slot>
280
+ `],lt=l([m("qti-gap-match-interaction")],lt);var Ii=(s,t,e)=>{let r=new Map;for(let i=t;i<=e;i++)r.set(s[i],i);return r},Gt=te(class extends j{constructor(s){if(super(s),s.type!==ae.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let r;e===void 0?e=t:t!==void 0&&(r=t);let i=[],o=[],n=0;for(let a of s)i[n]=r?r(a,n):n,o[n]=e(a,n),n++;return{values:o,keys:i}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,r]){var _;let i=Ti(s),{values:o,keys:n}=this.dt(t,e,r);if(!Array.isArray(i))return this.ut=n,o;let a=(_=this.ut)!=null?_:this.ut=[],c=[],p,h,g=0,y=i.length-1,v=0,w=o.length-1;for(;g<=y&&v<=w;)if(i[g]===null)g++;else if(i[y]===null)y--;else if(a[g]===n[v])c[v]=ne(i[g],o[v]),g++,v++;else if(a[y]===n[w])c[w]=ne(i[y],o[w]),y--,w--;else if(a[g]===n[w])c[w]=ne(i[g],o[w]),Te(s,c[w+1],i[g]),g++,w--;else if(a[y]===n[v])c[v]=ne(i[y],o[v]),Te(s,i[g],i[y]),y--,v++;else if(p===void 0&&(p=Ii(n,v,w),h=Ii(a,g,y)),p.has(a[g]))if(p.has(a[y])){let T=h.get(n[v]),Ee=T!==void 0?i[T]:null;if(Ee===null){let xt=Te(s,i[g]);ne(xt,o[v]),c[v]=xt}else c[v]=ne(Ee,o[v]),Te(s,i[g],Ee),i[T]=null;v++}else Dt(i[y]),y--;else Dt(i[g]),g++;for(;v<=w;){let T=Te(s,c[w+1]);ne(T,o[v]),c[v++]=T}for(;g<=y;){let T=i[g++];T!==null&&Dt(T)}return this.ut=n,Si(s,c),L}});function He(s,t,e,r){switch(s){case"circle":{let[i,o,n]=t,a=i/e.width*100,c=o/e.height*100,p=n/e.width*100;r.style.left=a-p+"%",r.style.top=c-p+"%",r.style.width=r.style.height=4*p+"px",r.style.borderRadius="9999px"}break;case"rect":{let[i,o,n,a]=t,c=i/e.width*100,p=o/e.height*100,h=n/e.width*100,g=a/e.height*100;r.style.left=c+"%",r.style.top=p+"%",r.style.width=h-c+"%",r.style.height=g-p+"%"}break;case"poly":{let i=t.reduce((_,T,Ee,xt)=>{if(Ee%2===1){let ji=_.pop();_[_.length]={x:ji,y:xt[Ee]}}else _.push(T);return _},[]),o=Math.min(...i.map(_=>_.x)),n=Math.max(...i.map(_=>_.x)),a=Math.min(...i.map(_=>_.y)),c=Math.max(...i.map(_=>_.y)),p=o/e.width*100,h=a/e.height*100,g=n/e.width*100,y=c/e.height*100;r.style.left=o/e.width*100+"%",r.style.top=a/e.height*100+"%",r.style.width=g-p+"%",r.style.height=y-h+"%";let w=i.map(_=>({x:(_.x-o)/(n-o)*100,y:(_.y-a)/(c-a)*100})).map(_=>Math.round(_.x)+"% "+Math.round(_.y)+"%").join(",");r.style.clipPath=`polygon(${w})`}break;default:break}}var J=class extends k{constructor(){super();this.startPoint=null;this.endPoint=null;this._lines=[];this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}reset(){this._lines=[]}validate(){return this._lines.length>0}set response(e){Array.isArray(e)&&(this._lines=e)}render(){var e,r,i,o;return u`<slot name="prompt"></slot>
278
281
  <line-container>
279
282
  <svg
280
- width=${F((e=this.grImage[0])==null?void 0:e.width)}
281
- height=${F((r=this.grImage[0])==null?void 0:r.height)}
282
- viewbox="0 0 ${(s=this.grImage[0])==null?void 0:s.width} ${(o=this.grImage[0])==null?void 0:o.height}"
283
+ width=${B((e=this.grImage[0])==null?void 0:e.width)}
284
+ height=${B((r=this.grImage[0])==null?void 0:r.height)}
285
+ viewbox="0 0 ${(i=this.grImage[0])==null?void 0:i.width} ${(o=this.grImage[0])==null?void 0:o.height}"
283
286
  >
284
- ${jt(this._lines,n=>n,(n,a)=>sr`
287
+ ${Gt(this._lines,n=>n,(n,a)=>pr`
285
288
  <line
286
289
  part="line"
287
290
  x1=${parseInt(this.querySelector("[identifier="+n.split(" ")[0]+"]").style.left)}
@@ -290,10 +293,10 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
290
293
  y2=${parseInt(this.querySelector("[identifier="+n.split(" ")[1]+"]").style.top)}
291
294
  stroke="red"
292
295
  stroke-width="3"
293
- @click=${c=>{c.stopPropagation(),this._lines=this._lines.filter((d,h)=>h!==a),this.saveResponse(this._lines)}}
296
+ @click=${c=>{c.stopPropagation(),this._lines=this._lines.filter((p,h)=>h!==a),this.saveResponse(this._lines)}}
294
297
  />
295
298
  `)}
296
- ${this.startPoint&&sr`<line
299
+ ${this.startPoint&&pr`<line
297
300
  part="point"
298
301
  x1=${this.startCoord.x}
299
302
  y1=${this.startCoord.y}
@@ -304,7 +307,7 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
304
307
  />`}
305
308
  </svg>
306
309
  <slot></slot>
307
- </line-container>`}positionHotspotOnRegister(e){let r=this.querySelector("img"),s=e.target,o=s.getAttribute("coords"),n=s.getAttribute("shape"),a=o.split(",").map(c=>parseInt(c));ke(n,a,r,s)}firstUpdated(e){super.firstUpdated(e),this.hotspots=this.querySelectorAll("qti-associable-hotspot"),document.addEventListener("mousemove",r=>{this.mouseCoord={x:r.clientX-this.grImage[0].getBoundingClientRect().left,y:r.clientY-this.grImage[0].getBoundingClientRect().top}}),this.hotspots.forEach(r=>{r.style.left=r.getAttribute("coords").split(",")[0]+"px",r.style.top=r.getAttribute("coords").split(",")[1]+"px",r.addEventListener("click",s=>{this.startPoint?this.endPoint||(this.endPoint=s.target,this._lines=[...this._lines,this.startPoint.getAttribute("identifier")+" "+this.endPoint.getAttribute("identifier")],this.saveResponse(this._lines),this.startPoint=null,this.endPoint=null):(this.startPoint=s.target,this.startCoord={x:this.startPoint.getAttribute("coords").split(",")[0],y:this.startPoint.getAttribute("coords").split(",")[1]})})})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};W.styles=[b`
310
+ </line-container>`}positionHotspotOnRegister(e){let r=this.querySelector("img"),i=e.target,o=i.getAttribute("coords"),n=i.getAttribute("shape"),a=o.split(",").map(c=>parseInt(c));He(n,a,r,i)}firstUpdated(e){super.firstUpdated(e),this.hotspots=this.querySelectorAll("qti-associable-hotspot"),document.addEventListener("mousemove",r=>{this.mouseCoord={x:r.clientX-this.grImage[0].getBoundingClientRect().left,y:r.clientY-this.grImage[0].getBoundingClientRect().top}}),this.hotspots.forEach(r=>{r.style.left=r.getAttribute("coords").split(",")[0]+"px",r.style.top=r.getAttribute("coords").split(",")[1]+"px",r.addEventListener("click",i=>{this.startPoint?this.endPoint||(this.endPoint=i.target,this._lines=[...this._lines,this.startPoint.getAttribute("identifier")+" "+this.endPoint.getAttribute("identifier")],this.saveResponse(this._lines),this.startPoint=null,this.endPoint=null):(this.startPoint=i.target,this.startCoord={x:this.startPoint.getAttribute("coords").split(",")[0],y:this.startPoint.getAttribute("coords").split(",")[1]})})})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};J.styles=[b`
308
311
  slot:not([name='prompt']) {
309
312
  // position: relative; /* qti-hotspot-choice relative to the slot */
310
313
  display: block;
@@ -327,8 +330,8 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
327
330
  top: 0px;
328
331
  left: 0px;
329
332
  }
330
- `],l([E()],W.prototype,"_lines",2),l([E()],W.prototype,"startCoord",2),l([E()],W.prototype,"mouseCoord",2),l([ze("svg")],W.prototype,"svgContainer",2),l([ps({selector:"img"})],W.prototype,"grImage",2),W=l([m("qti-graphic-associate-interaction")],W);var ot=class extends z(f,"qti-gap-img",!1,"qti-associable-hotspot"){render(){return u` <slot></slot>
331
- <slot name="qti-gap-img"></slot>`}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,s=r.getAttribute("coords"),o=r.getAttribute("shape"),n=s.split(",").map(a=>parseInt(a));switch(o){case"circle":{let[a,c,d]=n;r.style.left=a-d+"px",r.style.top=c-d+"px",r.style.width=r.style.height=2*d+"px"}break;case"rect":{let[a,c,d,h]=n;r.style.left=a+"px",r.style.top=c+"px",r.style.width=d-a+"px",r.style.height=h-c+"px"}break;default:break}}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};ot.styles=b`
333
+ `],l([q()],J.prototype,"_lines",2),l([q()],J.prototype,"startCoord",2),l([q()],J.prototype,"mouseCoord",2),l([Ke("svg")],J.prototype,"svgContainer",2),l([wi({selector:"img"})],J.prototype,"grImage",2),J=l([m("qti-graphic-associate-interaction")],J);var ct=class extends W(f,"qti-gap-img",!1,"qti-associable-hotspot"){render(){return u` <slot></slot>
334
+ <slot name="qti-gap-img"></slot>`}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,i=r.getAttribute("coords"),o=r.getAttribute("shape"),n=i.split(",").map(a=>parseInt(a));switch(o){case"circle":{let[a,c,p]=n;r.style.left=a-p+"px",r.style.top=c-p+"px",r.style.width=r.style.height=2*p+"px"}break;case"rect":{let[a,c,p,h]=n;r.style.left=a+"px",r.style.top=c+"px",r.style.width=p-a+"px",r.style.height=h-c+"px"}break;default:break}}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};ct.styles=b`
332
335
  :host {
333
336
  display: inline-block;
334
337
  position: relative;
@@ -337,12 +340,12 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
337
340
  display: flex;
338
341
  gap: 1rem;
339
342
  }
340
- `,ot=l([m("qti-graphic-gap-match-interaction")],ot);var nt=class extends ne(f,"qti-hotspot-choice"){render(){return u`
343
+ `,ct=l([m("qti-graphic-gap-match-interaction")],ct);var dt=class extends le(f,"qti-hotspot-choice"){render(){return u`
341
344
  <slot name="prompt"></slot>
342
345
  <!-- slot for the prompt -->
343
346
  <slot></slot>
344
347
  <!-- slot for the image and hotspots -->
345
- `}setHotspotOrder(t){let{identifier:e}=t.detail,r=this._choiceElements.find(o=>o.getAttribute("identifier")===e),s=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){if(this._choiceElements.filter(o=>o.order>0).length>=s){this.choiceOrdering=!1;return}r.order=this._choiceElements.filter(o=>!!o.order).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(o=>(o.order>o.order&&o.order--,o)),r.order=null;this.choiceOrdering=!1}}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,s=r.getAttribute("coords"),o=r.getAttribute("shape"),n=s.split(",").map(a=>parseInt(a));ke(o,n,e,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-choice-element-selected",this.setHotspotOrder),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this.setHotspotOrder),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};nt.styles=[b`
348
+ `}setHotspotOrder(t){let{identifier:e}=t.detail,r=this._choiceElements.find(o=>o.getAttribute("identifier")===e),i=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){if(this._choiceElements.filter(o=>o.order>0).length>=i){this.choiceOrdering=!1;return}r.order=this._choiceElements.filter(o=>!!o.order).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(o=>(o.order>o.order&&o.order--,o)),r.order=null;this.choiceOrdering=!1}}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,i=r.getAttribute("coords"),o=r.getAttribute("shape"),n=i.split(",").map(a=>parseInt(a));He(o,n,e,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-choice-element-selected",this.setHotspotOrder),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this.setHotspotOrder),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};dt.styles=[b`
346
349
  slot:not([name='prompt']) {
347
350
  position: relative; /* qti-hotspot-choice relative to the slot */
348
351
  display: block;
@@ -353,12 +356,12 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
353
356
  pointer-events: none;
354
357
  user-select: none;
355
358
  }
356
- `],nt=l([m("qti-graphic-order-interaction")],nt);var at=class extends ne(f,"qti-hotspot-choice"){render(){return u`
359
+ `],dt=l([m("qti-graphic-order-interaction")],dt);var pt=class extends le(f,"qti-hotspot-choice"){render(){return u`
357
360
  <slot name="prompt"></slot>
358
361
  <!-- slot for the prompt -->
359
362
  <slot></slot>
360
363
  <!-- slot for the image and hotspots -->
361
- `}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,s=r.getAttribute("coords"),o=r.getAttribute("shape"),n=s.split(",").map(a=>parseInt(a));ke(o,n,e,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};at.styles=[b`
364
+ `}positionHotspotOnRegister(t){let e=this.querySelector("img"),r=t.target,i=r.getAttribute("coords"),o=r.getAttribute("shape"),n=i.split(",").map(a=>parseInt(a));He(o,n,e,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};pt.styles=[b`
362
365
  slot:not([name='prompt']) {
363
366
  position: relative; /* qti-hotspot-choice relative to the slot */
364
367
  display: block;
@@ -370,10 +373,10 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
370
373
  user-select: none;
371
374
  /* width:100%; */
372
375
  }
373
- `],at=l([m("qti-hotspot-interaction")],at);var pe=class extends f{constructor(){super(...arguments);this.matchMin=0;this.matchMax=1;this.fixed=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}render(){return u`
374
- <slot></slot>
375
- <slot name="qti-simple-associable-choice"></slot>
376
- `}};pe.styles=b`
376
+ `],pt=l([m("qti-hotspot-interaction")],pt);var ue=class extends f{constructor(){super(...arguments);this.matchMin=0;this.matchMax=1;this.fixed=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}render(){return u`
377
+ <slot part="slot"></slot>
378
+ <slot part="dropslot" name="qti-simple-associable-choice"></slot>
379
+ `}};ue.styles=b`
377
380
  :host {
378
381
  display: flex;
379
382
  user-select: none;
@@ -385,17 +388,17 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
385
388
  slot[name='qti-simple-associable-choice'] {
386
389
  width: 100%;
387
390
  }
388
- `,l([p({type:Number,attribute:"match-min"})],pe.prototype,"matchMin",2),l([p({type:Number,attribute:"match-max"})],pe.prototype,"matchMax",2),l([p({type:Boolean,attribute:"fixed"})],pe.prototype,"fixed",2),pe=l([m("qti-simple-associable-choice")],pe);var de=class extends z(f,"qti-simple-match-set:first-of-type qti-simple-associable-choice",!1,"qti-simple-match-set:last-of-type qti-simple-associable-choice"){constructor(){super(...arguments);this.lastCheckedRadio=null;this.response=[];this.correctOptions=[];this.responseIdentifier="";this.handleRadioClick=e=>{let r=e.target;this.lastCheckedRadio===r?(r.checked=!1,this.lastCheckedRadio=null,this.handleRadioChange(e)):this.lastCheckedRadio=r};this.handleRadioChange=e=>{let r=e.target,s=r.value,o=r.name,n=r.type;r.checked?(this.response?this.response.indexOf(s)===-1&&(n==="radio"&&(this.response=this.response.filter(a=>a.indexOf(o)===-1)),this.response=[...this.response,s]):this.response=[s],this.lastCheckedRadio=r):(this.response=this.response.filter(a=>a!==s),this.lastCheckedRadio=null),this.requestUpdate(),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(this.response)?[...this.response]:this.response}}))}}connectedCallback(){super.connectedCallback(),this.rows=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.cols=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.response=[]}set correctResponse(e){if(e===""){this.correctOptions=[];return}else Array.isArray(e)&&(this.correctOptions=e)}render(){return this.classList.contains("qti-match-tabular")?u`
391
+ `,l([d({type:Number,attribute:"match-min"})],ue.prototype,"matchMin",2),l([d({type:Number,attribute:"match-max"})],ue.prototype,"matchMax",2),l([d({type:Boolean,attribute:"fixed"})],ue.prototype,"fixed",2),ue=l([m("qti-simple-associable-choice")],ue);var he=class extends W(f,"qti-simple-match-set:first-of-type qti-simple-associable-choice",!1,"qti-simple-match-set:last-of-type qti-simple-associable-choice"){constructor(){super(...arguments);this.lastCheckedRadio=null;this.response=[];this.correctOptions=[];this.responseIdentifier="";this.handleRadioClick=e=>{let r=e.target;this.lastCheckedRadio===r?(r.checked=!1,this.lastCheckedRadio=null,this.handleRadioChange(e)):this.lastCheckedRadio=r};this.handleRadioChange=e=>{let r=e.target,i=r.value,o=r.name,n=r.type;r.checked?(this.response?this.response.indexOf(i)===-1&&(n==="radio"&&(this.response=this.response.filter(a=>a.indexOf(o)===-1)),this.response=[...this.response,i]):this.response=[i],this.lastCheckedRadio=r):(this.response=this.response.filter(a=>a!==i),this.lastCheckedRadio=null),this.requestUpdate(),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(this.response)?[...this.response]:this.response}}))}}connectedCallback(){super.connectedCallback(),this.rows=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.cols=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.response=[]}set correctResponse(e){if(e===""){this.correctOptions=[];return}else Array.isArray(e)&&(this.correctOptions=e)}render(){return this.classList.contains("qti-match-tabular")?u`
389
392
  <slot name="prompt"></slot>
390
393
  <table>
391
394
  <tr>
392
395
  <td></td>
393
- ${this.cols.map((e,r)=>u`<th part="r-header">${ae(e.innerHTML)}</th>`)}
396
+ ${this.cols.map((e,r)=>u`<th part="r-header">${ce(e.innerHTML)}</th>`)}
394
397
  </tr>
395
398
 
396
399
  ${this.rows.map((e,r)=>u`<tr>
397
- <td part="c-header">${ae(e.innerHTML)}</td>
398
- ${this.cols.map((s,o)=>{let n=e.getAttribute("identifier"),a=s.getAttribute("identifier"),c=`${n} ${a}`,d=this.response.filter(v=>v.split(" ")[0]===n).length||0,h=this.response.includes(c),g=`rb ${h?"rb-checked":""} ${this.correctOptions.includes(c)?"rb-correct":""}`,y=this.correctOptions.length>0?!0:e.matchMax===1?!1:d>=e.matchMax&&!h;return u`<td>
400
+ <td part="c-header">${ce(e.innerHTML)}</td>
401
+ ${this.cols.map((i,o)=>{let n=e.getAttribute("identifier"),a=i.getAttribute("identifier"),c=`${n} ${a}`,p=this.response.filter(v=>v.split(" ")[0]===n).length||0,h=this.response.includes(c),g=`rb ${h?"rb-checked":""} ${this.correctOptions.includes(c)?"rb-correct":""}`,y=this.correctOptions.length>0?!0:e.matchMax===1?!1:p>=e.matchMax&&!h;return u`<td>
399
402
  <input
400
403
  type=${e.matchMax===1?"radio":"checkbox"}
401
404
  part=${g}
@@ -408,7 +411,7 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
408
411
  </td>`})}
409
412
  </tr>`)}
410
413
  </table>
411
- `:u`<slot name="prompt"></slot> <slot></slot>`}};de.styles=[b`
414
+ `:u`<slot name="prompt"></slot> <slot></slot>`}};he.styles=[b`
412
415
  :host {
413
416
  display: flex;
414
417
  flex-direction: column;
@@ -427,14 +430,14 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
427
430
  :host(.qti-choices-right) {
428
431
  flex-direction: row-reverse;
429
432
  }
430
- `],l([E()],de.prototype,"response",2),l([E()],de.prototype,"correctOptions",2),l([p({type:String,attribute:"response-identifier"})],de.prototype,"responseIdentifier",2),de=l([m("qti-match-interaction")],de);var lt=class extends A{constructor(){super();this.value=0}reset(){}validate(){return!0}set response(e){}static get properties(){return T(q({},A.properties),{step:{type:Number,attribute:"step",default:10}})}render(){return u` <slot name="prompt"></slot>
431
- <slot></slot>`}connectedCallback(){super.connectedCallback();let e=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");e&&e.addEventListener("ended",()=>{this.value++,this.saveResponse(this.value.toString())})}};lt.styles=[b``],lt=l([m("qti-media-interaction")],lt);var ee=class extends Nt(z(f,"qti-simple-choice",!0,"drop-list"),"qti-simple-choice"){constructor(){super(...arguments);this.nrChoices=0;this.correctResponses=[];this.showCorrectResponses=!1}render(){let e=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<e.length&&(this.nrChoices=e.length),u` <slot name="prompt"> </slot>
433
+ `],l([q()],he.prototype,"response",2),l([q()],he.prototype,"correctOptions",2),l([d({type:String,attribute:"response-identifier"})],he.prototype,"responseIdentifier",2),he=l([m("qti-match-interaction")],he);var ut=class extends k{constructor(){super();this.value=0}reset(){}validate(){return!0}set response(e){}static get properties(){return S(C({},k.properties),{step:{type:Number,attribute:"step",default:10}})}render(){return u` <slot name="prompt"></slot>
434
+ <slot></slot>`}connectedCallback(){super.connectedCallback();let e=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");e&&e.addEventListener("ended",()=>{this.value++,this.saveResponse(this.value.toString())})}};ut.styles=[b``],ut=l([m("qti-media-interaction")],ut);var re=class extends Ft(W(f,"qti-simple-choice",!0,"drop-list"),"qti-simple-choice"){constructor(){super(...arguments);this.nrChoices=0;this.correctResponses=[];this.showCorrectResponses=!1}render(){let e=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<e.length&&(this.nrChoices=e.length),u` <slot name="prompt"> </slot>
432
435
  <div part="container">
433
436
  <slot part="drags"> </slot>
434
437
  <div part="drops">
435
- ${Array.from(Array(this.nrChoices)).map((r,s)=>u`<drop-list part="drop-list" identifier="droplist${s}"></drop-list>${this.showCorrectResponses&&this.correctResponses.length>s?ae(`<span part='correct-response'>${this.correctResponses[s]}</span>`):""}`)}
438
+ ${Array.from(Array(this.nrChoices)).map((r,i)=>u`<drop-list part="drop-list" identifier="droplist${i}"></drop-list>${this.showCorrectResponses&&this.correctResponses.length>i?ce(`<span part='correct-response'>${this.correctResponses[i]}</span>`):""}`)}
436
439
  </div>
437
- </div>`}set correctResponse(e){if(e===""){this.showCorrectResponses=!1;return}this.correctResponses.length===0&&(Array.isArray(e)?e:[e]).forEach((s,o)=>{let n=this.querySelector(`qti-simple-choice[identifier="${s}"]`);n||(n=this.shadowRoot.querySelector(`qti-simple-choice[identifier="${s}"]`));let a=n==null?void 0:n.textContent.trim();this.correctResponses=[...this.correctResponses,a]}),this.showCorrectResponses=!0}getResponse(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(s=>{let o=s.querySelectorAll('[qti-draggable="true"]');return[...Array.from(o).map(a=>a.getAttribute("identifier"))].join(" ")})}async firstUpdated(e){super.firstUpdated(e),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(r=>r.setAttribute("part","qti-simple-choice"))}};ee.styles=[b`
440
+ </div>`}set correctResponse(e){if(e===""){this.showCorrectResponses=!1;return}this.correctResponses.length===0&&(Array.isArray(e)?e:[e]).forEach((i,o)=>{let n=this.querySelector(`qti-simple-choice[identifier="${i}"]`);n||(n=this.shadowRoot.querySelector(`qti-simple-choice[identifier="${i}"]`));let a=n==null?void 0:n.textContent.trim();this.correctResponses=[...this.correctResponses,a]}),this.showCorrectResponses=!0}getResponse(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(i=>{let o=i.querySelectorAll('[qti-draggable="true"]');return[...Array.from(o).map(a=>a.getAttribute("identifier"))].join(" ")})}async firstUpdated(e){super.firstUpdated(e),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(r=>r.setAttribute("part","qti-simple-choice"))}};re.styles=[b`
438
441
  [part='drags'] {
439
442
  display: flex;
440
443
  align-items: flex-start;
@@ -482,7 +485,7 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
482
485
  :host(.qti-choices-right) [part='container'] {
483
486
  flex-direction: row-reverse;
484
487
  }
485
- `],l([E()],ee.prototype,"nrChoices",2),l([E()],ee.prototype,"correctResponses",2),l([E()],ee.prototype,"showCorrectResponses",2),l([p({type:String})],ee.prototype,"orientation",2),ee=l([m("qti-order-interaction")],ee);var Xt=class extends f{render(){return u`<slot></slot>`}};Xt.styles=[b`
488
+ `],l([q()],re.prototype,"nrChoices",2),l([q()],re.prototype,"correctResponses",2),l([q()],re.prototype,"showCorrectResponses",2),l([d({type:String})],re.prototype,"orientation",2),re=l([m("qti-order-interaction")],re);var Qt=class extends f{render(){return u`<slot></slot>`}};Qt.styles=[b`
486
489
  :host {
487
490
  display: block;
488
491
  }
@@ -493,23 +496,23 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
493
496
  left: 50%;
494
497
  transform: translateX(-50%);
495
498
  }
496
- `];customElements.define("qti-position-object-interaction",Xt);var ct=class extends f{render(){return u`<slot></slot>`}constructor(){super(),this.removeMoveListener=this.removeMoveListener.bind(this),this.dragElementHandler=this.dragElementHandler.bind(this)}dragElementHandler(t){t.preventDefault();let e=t.clientX-this.startX,r=t.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+e+"px",this.dragElement.style.top=this.dragElement.offsetTop+r+"px",this.startX=t.clientX,this.startY=t.clientY}firstUpdated(t){super.firstUpdated(t),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",e=>{this.startX=e.clientX,this.startY=e.clientY,document.addEventListener("mousemove",this.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}removeMoveListener(t){document.removeEventListener("mousemove",this.dragElementHandler,!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}};ct.styles=[b`
499
+ `];customElements.define("qti-position-object-interaction",Qt);var ht=class extends f{render(){return u`<slot></slot>`}constructor(){super(),this.removeMoveListener=this.removeMoveListener.bind(this),this.dragElementHandler=this.dragElementHandler.bind(this)}dragElementHandler(t){t.preventDefault();let e=t.clientX-this.startX,r=t.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+e+"px",this.dragElement.style.top=this.dragElement.offsetTop+r+"px",this.startX=t.clientX,this.startY=t.clientY}firstUpdated(t){super.firstUpdated(t),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",e=>{this.startX=e.clientX,this.startY=e.clientY,document.addEventListener("mousemove",this.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}removeMoveListener(t){document.removeEventListener("mousemove",this.dragElementHandler,!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}};ht.styles=[b`
497
500
  :host {
498
501
  display: inline-block;
499
502
  position: relative;
500
503
  }
501
- `],ct=l([m("qti-position-object-stage")],ct);var Rs="important",hi=" !"+Rs,$s=Q(class extends B{constructor(i){var t;if(super(i),i.type!==oe.ATTRIBUTE||i.name!=="style"||((t=i.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((t,e)=>{let r=i[e];return r==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(i,[t]){let{style:e}=i.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let r of this.ft)t[r]==null&&(this.ft.delete(r),r.includes("-")?e.removeProperty(r):e[r]=null);for(let r in t){let s=t[r];if(s!=null){this.ft.add(r);let o=typeof s=="string"&&s.endsWith(hi);r.includes("-")||o?e.setProperty(r,o?s.slice(0,-11):s,o?Rs:""):e[r]=s}}return M}});var ue=class extends A{constructor(){super(...arguments);this.maxChoices=1/0;this.minChoices=0;this._points=[];this._imgElement=null;this._onImageClick=e=>{if(this._points.length<this.maxChoices){let r=e.offsetX,s=e.offsetY;this._points=[...this._points,`${r} ${s}`],this.saveResponse(this._points)}}}render(){return u` <slot name="prompt"></slot>
504
+ `],ht=l([m("qti-position-object-stage")],ht);var Ui="important",As=" !"+Ui,zi=te(class extends j{constructor(s){var t;if(super(s),s.type!==ae.ATTRIBUTE||s.name!=="style"||((t=s.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((t,e)=>{let r=s[e];return r==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(s,[t]){let{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let r of this.ft)t[r]==null&&(this.ft.delete(r),r.includes("-")?e.removeProperty(r):e[r]=null);for(let r in t){let i=t[r];if(i!=null){this.ft.add(r);let o=typeof i=="string"&&i.endsWith(As);r.includes("-")||o?e.setProperty(r,o?i.slice(0,-11):i,o?Ui:""):e[r]=i}}return L}});var me=class extends k{constructor(){super(...arguments);this.maxChoices=1/0;this.minChoices=0;this._points=[];this._imgElement=null;this._onImageClick=e=>{if(this._points.length<this.maxChoices){let r=e.offsetX,i=e.offsetY;this._points=[...this._points,`${r} ${i}`],this.saveResponse(this._points)}}}render(){return u` <slot name="prompt"></slot>
502
505
  <point-container>
503
- ${jt(this._points,e=>e,(e,r)=>u`
506
+ ${Gt(this._points,e=>e,(e,r)=>u`
504
507
  <button
505
508
  part="point"
506
- style=${$s({position:"absolute",transform:"translate(-50%, -50%)",left:`${e.split(" ")[0]}px`,top:`${e.split(" ")[1]}px`})}
509
+ style=${zi({position:"absolute",transform:"translate(-50%, -50%)",left:`${e.split(" ")[0]}px`,top:`${e.split(" ")[1]}px`})}
507
510
  aria-label="Remove point at ${e}"
508
- @click=${s=>{s.stopPropagation(),this._points=this._points.filter((o,n)=>n!==r),this.saveResponse(this._points)}}
511
+ @click=${i=>{i.stopPropagation(),this._points=this._points.filter((o,n)=>n!==r),this.saveResponse(this._points)}}
509
512
  ></button>
510
513
  `)}
511
514
  <slot></slot>
512
- </point-container>`}reset(){this._points=[]}validate(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}set response(e){this._points=Array.isArray(e)?e:[e]}firstUpdated(){this._imgElement=this.querySelector("img"),this._imgElement?this._imgElement.addEventListener("click",this._onImageClick):console.warn("No <img> element found in <qti-select-point-interaction>")}disconnectedCallback(){super.disconnectedCallback(),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}};ue.styles=[b`
515
+ </point-container>`}reset(){this._points=[]}validate(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}set response(e){this._points=Array.isArray(e)?e:[e]}firstUpdated(){this._imgElement=this.querySelector("img"),this._imgElement?this._imgElement.addEventListener("click",this._onImageClick):console.warn("No <img> element found in <qti-select-point-interaction>")}disconnectedCallback(){super.disconnectedCallback(),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}};me.styles=[b`
513
516
  :host {
514
517
  display: block;
515
518
  }
@@ -517,68 +520,69 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
517
520
  display: block;
518
521
  position: relative;
519
522
  }
520
- `],l([p({type:Number,attribute:"max-choices"})],ue.prototype,"maxChoices",2),l([p({type:Number,attribute:"min-choices"})],ue.prototype,"minChoices",2),l([E()],ue.prototype,"_points",2),ue=l([m("qti-select-point-interaction")],ue);var $=class extends A{constructor(){super();this.stepLabel=!1;this.reverse=!1;this._handleDisabledChange=(e,r)=>{};this._handleReadonlyChange=(e,r)=>{};this.csLive=getComputedStyle(this)}set min(e){this._min=e,this.value=e,this.style.setProperty("--min",`${this._min}`)}get min(){return this._min}set max(e){this._max=e,this.style.setProperty("--max",`${this._max}`)}get max(){return this._max}set step(e){this._step=e,this.style.setProperty("--step",`${this._step}`)}get step(){return this._step}reset(){}validate(){return!0}set response(e){if(Array.isArray(e)){console.error("QtiSliderInteraction: response is an array, but should be a single value");return}let r=parseInt(e);if(Number.isNaN(r)){console.error("QtiSliderInteraction: response is not a number");return}this.value=r}render(){this.value<this.min&&(this.value=this.min),this.value>this.max&&(this.value=this.max);let e=(this.value-this.min)/(this.max-this.min)*100;return this.style.setProperty("--value-percentage",`${e}%`),this.setAttribute("aria-valuenow",this.value.toString()),u`<slot name="prompt"></slot>
523
+ `],l([d({type:Number,attribute:"max-choices"})],me.prototype,"maxChoices",2),l([d({type:Number,attribute:"min-choices"})],me.prototype,"minChoices",2),l([q()],me.prototype,"_points",2),me=l([m("qti-select-point-interaction")],me);var $=class extends k{constructor(){super();this.stepLabel=!1;this.reverse=!1;this._handleDisabledChange=(e,r)=>{};this._handleReadonlyChange=(e,r)=>{};this.csLive=getComputedStyle(this)}set min(e){this._min=e,this.value=e,this.style.setProperty("--min",`${this._min}`)}get min(){return this._min}set max(e){this._max=e,this.style.setProperty("--max",`${this._max}`)}get max(){return this._max}set step(e){this._step=e,this.style.setProperty("--step",`${this._step}`)}get step(){return this._step}reset(){}validate(){return!0}set response(e){if(Array.isArray(e)){console.error("QtiSliderInteraction: response is an array, but should be a single value");return}let r=parseInt(e);if(Number.isNaN(r)){console.error("QtiSliderInteraction: response is not a number");return}this.value=r}render(){this.value<this.min&&(this.value=this.min),this.value>this.max&&(this.value=this.max);let e=(this.value-this.min)/(this.max-this.min)*100;return this.style.setProperty("--value-percentage",`${e}%`),this.setAttribute("aria-valuenow",this.value.toString()),u`<slot name="prompt"></slot>
521
524
  <div id="slider" part="slider">
522
525
  ${this.csLive.getPropertyValue("--show-bounds")=="true"?u`<div id="bounds" part="bounds">
523
526
  <div>${this._min}</div>
524
527
  <div>${this._max}</div>
525
- </div>`:_}
526
- ${this.csLive.getPropertyValue("--show-ticks")=="true"?u`<div id="ticks" part="ticks"></div>`:_}
528
+ </div>`:E}
529
+ ${this.csLive.getPropertyValue("--show-ticks")=="true"?u`<div id="ticks" part="ticks"></div>`:E}
527
530
  <div id="rail" part="rail" @mousedown=${this._onMouseDown} @touchstart=${this._onTouchMove}>
528
531
  <div id="knob" part="knob">
529
- ${this.csLive.getPropertyValue("--show-value")=="true"?u`<div id="value" part="value">${this.value}</div>`:_}
532
+ ${this.csLive.getPropertyValue("--show-value")=="true"?u`<div id="value" part="value">${this.value}</div>`:E}
530
533
  </div>
531
534
  </div>
532
- </div>`}connectedCallback(){super.connectedCallback(),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}_onTouchMove(e){let r=a=>{let{x:c}=this.getPositionFromEvent(a),d=c-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(d),a.stopPropagation()},s=()=>{document.removeEventListener("touchmove",r),document.removeEventListener("touchend",s),this.saveResponse(this.value.toString())};document.addEventListener("touchmove",r),document.addEventListener("touchend",s);let{x:o}=this.getPositionFromEvent(e),n=o-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(n),e.stopPropagation()}_onMouseDown(e){let r=n=>{let a=n.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(a),n.preventDefault(),n.stopPropagation()},s=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s),this.saveResponse(this.value.toString())};document.addEventListener("mousemove",r),document.addEventListener("mouseup",s);let o=e.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(o),e.preventDefault(),e.stopPropagation()}calculateValue(e){let r=this.min+(this.max-this.min)*e/this._rail.getBoundingClientRect().width,s=this.min+Math.round((r-this.min)/this._step)*this._step;this.value=s}getPositionFromEvent(e){let r;if(e.type=="touchstart"||e.type=="touchmove"||e.type=="touchend"||e.type=="touchcancel"){let s=typeof e.originalEvent=="undefined"?e:e.originalEvent,o=s.touches[0]||s.changedTouches[0];r={x:o.pageX,y:o.pageY}}else(e.type=="mousedown"||e.type=="mouseup"||e.type=="mousemove"||e.type=="mouseover"||e.type=="mouseout"||e.type=="mouseenter"||e.type=="mouseleave")&&(r={x:e.clientX,y:e.clientY});return r}};$.styles=[b``],l([ze("#knob")],$.prototype,"_knob",2),l([ze("#rail")],$.prototype,"_rail",2),l([p({type:Number})],$.prototype,"value",2),l([p({type:Boolean,attribute:"step-label"})],$.prototype,"stepLabel",2),l([p({type:Boolean})],$.prototype,"reverse",2),l([p({type:Number,attribute:"lower-bound"})],$.prototype,"min",1),l([p({type:Number,attribute:"upper-bound"})],$.prototype,"max",1),l([p({type:Number,attribute:"step"})],$.prototype,"step",1),l([S("disabled",{waitUntilFirstUpdate:!0})],$.prototype,"_handleDisabledChange",2),l([S("readonly",{waitUntilFirstUpdate:!0})],$.prototype,"_handleReadonlyChange",2),$=l([m("qti-slider-interaction")],$);var pt=class extends f{render(){return u`<slot @slotchange=${this.handleSlotChange}></slot>`}handleSlotChange(t){var r,s,o;let e=Array.from((s=(r=this.firstElementChild)==null?void 0:r.childNodes)!=null?s:[]).find(n=>n.nodeType===Node.COMMENT_NODE);try{this.operatorFunction=new Function("context","fn","item",(o=e.textContent)!=null?o:"")}catch(n){console.error("custom-operator contains invalid javascript code",n)}}calculate(){let t={variable:r=>{var s,o,n;return(n=(o=(s=this._context)==null?void 0:s.variables.find(a=>a.identifier===r))==null?void 0:o.value)!=null?n:""},correct:r=>{var s,o,n;return(n=(o=(s=this._context)==null?void 0:s.variables.find(a=>a.identifier===r))==null?void 0:o.correctResponse)!=null?n:""}},e={getVariable:r=>{var s;return(s=this._context)==null?void 0:s.variables.find(o=>o.identifier===r)},updateOutcomeVariable:(r,s)=>{this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:r,value:s}}))},updateResponseVariable:(r,s)=>{this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:r,response:s}}))}};return this.operatorFunction(this._context,t,e)}};l([K({context:O,subscribe:!0}),E()],pt.prototype,"_context",2),pt=l([m("qti-custom-operator")],pt);var dt=class extends f{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,cancelable:!1,composed:!0}))}render(){return u` <slot name="qti-gap-img"></slot> `}};dt.styles=b`
535
+ </div>`}connectedCallback(){super.connectedCallback(),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}_onTouchMove(e){let r=a=>{let{x:c}=this.getPositionFromEvent(a),p=c-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(p),a.stopPropagation()},i=()=>{document.removeEventListener("touchmove",r),document.removeEventListener("touchend",i),this.saveResponse(this.value.toString())};document.addEventListener("touchmove",r),document.addEventListener("touchend",i);let{x:o}=this.getPositionFromEvent(e),n=o-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(n),e.stopPropagation()}_onMouseDown(e){let r=n=>{let a=n.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(a),n.preventDefault(),n.stopPropagation()},i=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i),this.saveResponse(this.value.toString())};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i);let o=e.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(o),e.preventDefault(),e.stopPropagation()}calculateValue(e){let r=this.min+(this.max-this.min)*e/this._rail.getBoundingClientRect().width,i=this.min+Math.round((r-this.min)/this._step)*this._step;this.value=i}getPositionFromEvent(e){let r;if(e.type=="touchstart"||e.type=="touchmove"||e.type=="touchend"||e.type=="touchcancel"){let i=typeof e.originalEvent=="undefined"?e:e.originalEvent,o=i.touches[0]||i.changedTouches[0];r={x:o.pageX,y:o.pageY}}else(e.type=="mousedown"||e.type=="mouseup"||e.type=="mousemove"||e.type=="mouseover"||e.type=="mouseout"||e.type=="mouseenter"||e.type=="mouseleave")&&(r={x:e.clientX,y:e.clientY});return r}};$.styles=[b``],l([Ke("#knob")],$.prototype,"_knob",2),l([Ke("#rail")],$.prototype,"_rail",2),l([d({type:Number})],$.prototype,"value",2),l([d({type:Boolean,attribute:"step-label"})],$.prototype,"stepLabel",2),l([d({type:Boolean})],$.prototype,"reverse",2),l([d({type:Number,attribute:"lower-bound"})],$.prototype,"min",1),l([d({type:Number,attribute:"upper-bound"})],$.prototype,"max",1),l([d({type:Number,attribute:"step"})],$.prototype,"step",1),l([A("disabled",{waitUntilFirstUpdate:!0})],$.prototype,"_handleDisabledChange",2),l([A("readonly",{waitUntilFirstUpdate:!0})],$.prototype,"_handleReadonlyChange",2),$=l([m("qti-slider-interaction")],$);var mt=class extends f{render(){return u`<slot @slotchange=${this.handleSlotChange}></slot>`}handleSlotChange(t){var r,i,o;let e=Array.from((i=(r=this.firstElementChild)==null?void 0:r.childNodes)!=null?i:[]).find(n=>n.nodeType===Node.COMMENT_NODE);try{this.operatorFunction=new Function("context","fn","item",(o=e.textContent)!=null?o:"")}catch(n){console.error("custom-operator contains invalid javascript code",n)}}calculate(){let t={variable:r=>{var i,o,n;return(n=(o=(i=this._context)==null?void 0:i.variables.find(a=>a.identifier===r))==null?void 0:o.value)!=null?n:""},correct:r=>{var i,o,n;return(n=(o=(i=this._context)==null?void 0:i.variables.find(a=>a.identifier===r))==null?void 0:o.correctResponse)!=null?n:""}},e={getVariable:r=>{var i;return(i=this._context)==null?void 0:i.variables.find(o=>o.identifier===r)},updateOutcomeVariable:(r,i)=>{this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:r,value:i}}))},updateResponseVariable:(r,i)=>{this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:r,response:i}}))}};return this.operatorFunction(this._context,t,e)}};l([Z({context:U,subscribe:!0}),q()],mt.prototype,"_context",2),mt=l([m("qti-custom-operator")],mt);var ft=class extends f{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,cancelable:!1,composed:!0}))}render(){return u` <slot name="qti-gap-img"></slot> `}};ft.styles=b`
533
536
  :host {
534
537
  display: flex;
535
538
  user-select: none;
536
539
  position: absolute;
537
540
  }
538
- `,dt=l([m("qti-associable-hotspot")],dt);var Me=class extends f{constructor(){super(...arguments);this.tabindex=0}render(){return u` <slot name="qti-gap-text"></slot>`}};Me.styles=b`
541
+ `,ft=l([m("qti-associable-hotspot")],ft);var Pe=class extends f{constructor(){super(...arguments);this.tabindex=0}render(){return u` <slot name="qti-gap-text"></slot>`}};Pe.styles=b`
539
542
  :host {
540
543
  display: flex;
541
544
  user-select: none;
542
545
  }
543
- `,l([p({type:Number,reflect:!0})],Me.prototype,"tabindex",2),Me=l([m("qti-gap")],Me);var Le=class extends f{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){this.setAttribute("slot","qti-gap-img")}};Le.styles=b`
546
+ `,l([d({type:Number,reflect:!0})],Pe.prototype,"tabindex",2),Pe=l([m("qti-gap")],Pe);var Ne=class extends f{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){this.setAttribute("slot","qti-gap-img")}};Ne.styles=b`
544
547
  :host {
545
548
  display: flex;
546
549
  user-select: none;
547
550
  }
548
- `,l([p({type:Number,reflect:!0})],Le.prototype,"tabindex",2),Le=l([m("qti-gap-img")],Le);var He=class extends f{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-gap-text")}render(){return u`<slot></slot>`}};He.styles=b`
551
+ `,l([d({type:Number,reflect:!0})],Ne.prototype,"tabindex",2),Ne=l([m("qti-gap-img")],Ne);var Ve=class extends f{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-gap-text")}render(){return u`<slot></slot>`}};Ve.styles=b`
549
552
  :host {
550
553
  display: inline-flex;
551
554
  user-select: none;
552
555
  }
553
- `,l([p({type:Number,reflect:!0})],He.prototype,"tabindex",2),He=l([m("qti-gap-text")],He);var Ne=class extends k{};Ne.styles=b`
556
+ `,l([d({type:Number,reflect:!0})],Ve.prototype,"tabindex",2),Ve=l([m("qti-gap-text")],Ve);var De=class extends M{};De.styles=b`
554
557
  :host {
555
558
  display: flex;
556
559
  user-select: none;
557
560
  position: absolute;
558
561
  }
559
- `,l([p({attribute:"aria-ordervalue",type:Number,reflect:!0})],Ne.prototype,"order",2),Ne=l([m("qti-hotspot-choice")],Ne);var ut=class extends k{render(){return u`<div part="ch"><div part="cha"></div></div>
560
- <slot></slot> `}};ut.styles=b`
562
+ `,l([d({attribute:"aria-ordervalue",type:Number,reflect:!0})],De.prototype,"order",2),De=l([m("qti-hotspot-choice")],De);var gt=class extends M{render(){return u`<div part="ch"><div part="cha"></div></div>
563
+ <slot></slot> `}};gt.styles=b`
561
564
  :host {
562
565
  display: flex;
563
566
  user-select: none;
564
567
  }
565
- `,ut=l([m("qti-hottext")],ut);var ht=class extends f{static get styles(){return[b`
568
+ `,gt=l([m("qti-hottext")],gt);var bt=class extends f{static get styles(){return[b`
566
569
  :host {
567
570
  display: block;
568
571
  cursor: pointer;
569
572
  }
570
- `]}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){this.removeEventListener("click",this._onSelectInlineChoice)}render(){return u` <slot></slot> `}_onSelectInlineChoice(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}};l([p({type:String})],ht.prototype,"identifier",2),ht=l([m("qti-inline-choice")],ht);var Pe=class extends k{render(){return u`<div part="ch">
573
+ `]}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){this.removeEventListener("click",this._onSelectInlineChoice)}render(){return u` <slot></slot> `}_onSelectInlineChoice(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}};l([d({type:String})],bt.prototype,"identifier",2),bt=l([m("qti-inline-choice")],bt);var Oe=class extends M{render(){return u`<div part="ch">
571
574
  <div part="cha"></div>
572
575
  </div>
573
- ${this.marker?u`<div id="label">${this.marker}</div>`:_}
574
- <slot part="slot"></slot> `}};Pe.styles=b`
576
+ ${this.marker?u`<div id="label">${this.marker}</div>`:E}
577
+ <slot part="slot"></slot> `}};Oe.styles=b`
575
578
  :host {
576
579
  display: flex;
577
580
  user-select: none;
578
581
  }
579
582
  slot {
580
583
  width: 100%;
581
- display: block;
584
+ display: flex;
585
+ align-items: center;
582
586
  }
583
587
  [part='ch'] {
584
588
  display: flex;
@@ -586,7 +590,1511 @@ var Nr=Object.defineProperty,Ms=Object.defineProperties,Ls=Object.getOwnProperty
586
590
  align-items: center;
587
591
  justify-content: center;
588
592
  }
589
- `,l([p({type:String,attribute:!1})],Pe.prototype,"marker",2),Pe=l([m("qti-simple-choice")],Pe);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");export{A as Interaction,st as QtPrintedVariable,Vt as QtiAnd,L as QtiAssessmentItem,qe as QtiAssessmentStimulusRef,dt as QtiAssociableHotspot,Re as QtiAssociateInteraction,Dt as QtiBaseValue,k as QtiChoice,Se as QtiChoiceInteraction,Tt as QtiCompanionMaterialsInfo,P as QtiConditionExpression,gr as QtiContains,Rt as QtiContentBody,br as QtiCorrect,Y as QtiCustomInteraction,pt as QtiCustomOperator,$e as QtiEndAttemptInteraction,It as QtiEqual,Ot as QtiEqualRounded,x as QtiExpression,j as QtiExtendedTextInteraction,Ke as QtiFeedbackBlock,Je as QtiFeedbackInline,Me as QtiGap,Le as QtiGapImg,it as QtiGapMatchInteraction,He as QtiGapText,W as QtiGraphicAssociateInteraction,ot as QtiGraphicGapMatchInteraction,nt as QtiGraphicOrderInteraction,vr as QtiGt,yr as QtiGte,Ne as QtiHotspotChoice,at as QtiHotspotInteraction,ut as QtiHottext,Ht as QtiHottextInteraction,ht as QtiInlineChoice,le as QtiInlineChoiceInteraction,xr as QtiIsNull,Pt as QtiLookupOutcomeValue,Er as QtiLt,_r as QtiLte,Ut as QtiMapResponse,Te as QtiMapping,Cr as QtiMatch,de as QtiMatchInteraction,lt as QtiMediaInteraction,qr as QtiMember,Ze as QtiModalFeedback,Ar as QtiMultiple,wr as QtiNot,Sr as QtiOr,ee as QtiOrderInteraction,Tr as QtiOrdered,I as QtiOutcomeDeclaration,et as QtiOutcomeProcessing,dr as QtiOutcomeProcessingProcessor,ce as QtiPortableCustomInteraction,ct as QtiPositionObjectStage,Rr as QtiProduct,wt as QtiPrompt,ur as QtiResponseCondition,G as QtiResponseDeclaration,tt as QtiResponseElse,fr as QtiResponseElseIf,rt as QtiResponseIf,ve as QtiResponseProcessing,U as QtiRubricBlock,X as QtiRule,Xt as QtiSPositionObjectInteraction,ue as QtiSelectPointInteraction,hr as QtiSetOutcomeValue,mr as QtiSetOutcomeValueRule,pe as QtiSimpleAssociableChoice,Pe as QtiSimpleChoice,$ as QtiSliderInteraction,Ft as QtiStringMatch,St as QtiStylesheet,$r as QtiSum,kr as QtiSumExpression,N as QtiTextEntryInteraction,Mr as QtiVariable,O as itemContext,ds as itemContextVariables,ui as qtiAndMixin,us as qtiTransformItem,un as qtiTransformManifest,hn as qtiTransformTest};
593
+ `,l([d({type:String,attribute:!1})],Oe.prototype,"marker",2),Oe=l([m("qti-simple-choice")],Oe);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 Fi=`@layer qti-base, qti-components, qti-utilities, qti-variants, qti-extended;
594
+
595
+ :root,
596
+ :host {
597
+ --qti-primary-light: #ffbebe;
598
+ --qti-primary: #f86d70;
599
+ --qti-primary-dark: #a1616a;
600
+
601
+ --qti-secondary-light: #bed4ff;
602
+ --qti-secondary: #6daef8;
603
+ --qti-secondary-dark: #3a449d;
604
+
605
+ --qti-border-thickness: 1.5px;
606
+ --qti-border-style: solid;
607
+ --qti-border-color-gray: #c6cad0; /* Corresponding to border-gray-400 */
608
+ --qti-border-radius-md: 0.375rem;
609
+ --qti-border-radius-lg: 0.5rem;
610
+ --qti-border-radius-full: 9999px;
611
+
612
+ --qti-bg-gray-50: #f9fafb;
613
+ --qti-bg-primary: var(--qti-primary);
614
+ --qti-bg-gray-100: #f3f4f6;
615
+
616
+ --qti-text-gray-500: #6b7280;
617
+ --qti-text-white: white;
618
+
619
+ --qti-padding-sm: 0.125rem; /* py-0.5 */
620
+ --qti-padding-md: 0.5rem; /* py-2 */
621
+ --qti-padding-lg: 0.75rem; /* p-3 */
622
+ --qti-padding-xl: 1rem; /* pl-4 */
623
+
624
+ --qti-font-weight-semibold: 600;
625
+
626
+ --qti-active: blue;
627
+ --qti-focus-color: #bddcff7e;
628
+ --qti-focus-border-width: 5px;
629
+
630
+ --qti-correct: rgb(74 222 128);
631
+ --qti-correct-light: rgb(220 252 231);
632
+ --qti-incorrect: rgb(248 113 113);
633
+ --qti-incorrect-light: rgb(254 226 226);
634
+
635
+ --qti-form-size: 1rem;
636
+ --qti-gap-size: 0.5rem;
637
+ }
638
+
639
+ .chevron {
640
+ background: url("data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E")
641
+ no-repeat center right 6px;
642
+ }
643
+
644
+ .handle {
645
+ background-image: radial-gradient(
646
+ circle at center,
647
+ rgba(0, 0, 0, 0.1) 0,
648
+ rgb(0, 0, 0, 0.1) 2px,
649
+ white 2px,
650
+ white 100%
651
+ );
652
+ background-repeat: repeat-y;
653
+ background-position: left 2px;
654
+ background-size: 14px 8px;
655
+ }
656
+
657
+ .check-mask {
658
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
659
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
660
+ }
661
+
662
+ .bordered {
663
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
664
+ outline: none;
665
+ }
666
+
667
+ .borderinvisible {
668
+ border-color: transparent;
669
+ }
670
+
671
+ .form {
672
+ width: var(--qti-form-size);
673
+ height: var(--qti-form-size);
674
+ align-self: 1;
675
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
676
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
677
+ outline: none;
678
+ }
679
+
680
+ .p-lg {
681
+ padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl); /* Padding shorthand */
682
+ }
683
+
684
+ .button {
685
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
686
+ outline: none;
687
+ border-radius: var(--qti-border-radius-md);
688
+ padding: var(--qti-padding-sm) var(--qti-padding-md); /* Padding shorthand */
689
+ font-weight: var(--qti-font-weight-semibold);
690
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
691
+ outline: none;
692
+ }
693
+
694
+ .select {
695
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
696
+ outline: none;
697
+ border-radius: var(--qti-border-radius-md);
698
+ position: relative;
699
+ -webkit-appearance: none;
700
+ -moz-appearance: none;
701
+ appearance: none;
702
+ padding: var(--qti-padding-md) 1.75rem var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray); outline: none; background: url("data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E")
703
+ no-repeat center right 6px;
704
+ }
705
+
706
+ .text {
707
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
708
+ outline: none;
709
+ border-radius: 0;
710
+ cursor: text;
711
+ padding: var(--qti-padding-lg); /* Equal padding on all sides */
712
+ background: unset;
713
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
714
+ outline: none;
715
+ }
716
+
717
+ .spot {
718
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
719
+ outline: none;
720
+ width: 100%;
721
+ height: 100%;
722
+ background-color: transparent;
723
+ padding: 0;
724
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
725
+ outline: none;
726
+ }
727
+
728
+ /* qti-select-point-interaction */
729
+
730
+ .point {
731
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
732
+ border-radius: var(--qti-border-radius-full);
733
+ outline: none;
734
+ width: 1.5rem; /* w-6 */
735
+ height: 1.5rem;
736
+ background-color: transparent;
737
+ padding: 0;
738
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
739
+ outline: none;
740
+ }
741
+
742
+ .drag {
743
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
744
+ outline: none;
745
+ padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl); /* Padding shorthand */
746
+ border-radius: var(--qti-border-radius-md);
747
+
748
+ cursor: grab;
749
+ background-color: white;
750
+ font-weight: var(--qti-font-weight-semibold);
751
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
752
+ outline: none;
753
+ background-image: radial-gradient(
754
+ circle at center,
755
+ rgba(0, 0, 0, 0.1) 0,
756
+ rgb(0, 0, 0, 0.1) 2px,
757
+ white 2px,
758
+ white 100%
759
+ );
760
+ background-repeat: repeat-y;
761
+ background-position: left 2px;
762
+ background-size: 14px 8px;
763
+ }
764
+
765
+ .drop {
766
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
767
+ outline: none;
768
+ border-radius: var(--qti-border-radius-lg);
769
+ position: relative;
770
+ background-color: var(--qti-bg-gray-50);
771
+ margin: 1px; /* m-px */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray); outline: none;
772
+ }
773
+
774
+ .order {
775
+ background-color: var(--qti-bg-primary);
776
+ border-radius: var(--qti-border-radius-full);
777
+ width: 1.5rem; /* w-6 */
778
+ height: 1.5rem;
779
+ color: var(--qti-text-white);
780
+ }
781
+
782
+ .check-size {
783
+ width: calc(var(--qti-form-size) - 4px);
784
+ height: calc(var(--qti-form-size) - 4px);
785
+ }
786
+
787
+ .check {
788
+ /* display: flex; */
789
+ /* align-items: center; */
790
+ gap: 0.5rem;
791
+ padding: var(--qti-padding-md) var(--qti-padding-md); /* Padding shorthand */
792
+ outline: none;
793
+ border-radius: var(--qti-border-radius-md);
794
+ cursor: pointer;
795
+ }
796
+
797
+ .check-radio {
798
+ border-radius: var(--qti-border-radius-full);
799
+ width: var(--qti-form-size);
800
+ height: var(--qti-form-size);
801
+ align-self: 1;
802
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
803
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
804
+ outline: none;
805
+ }
806
+
807
+ .check-radio-checked {
808
+ background-color: var(--qti-bg-primary);
809
+ border-radius: var(--qti-border-radius-full);
810
+ }
811
+
812
+ .check-checkbox {
813
+ border-radius: var(--qti-border-radius-md);
814
+ width: var(--qti-form-size);
815
+ height: var(--qti-form-size);
816
+ align-self: 1;
817
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
818
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
819
+ outline: none;
820
+ }
821
+
822
+ .check-checkbox-checked {
823
+ background-color: var(--qti-bg-primary);
824
+ -webkit-mask-image: var(--check-mask);
825
+ mask-image: var(--check-mask); /* check-mask */ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E"); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
826
+ }
827
+
828
+ .hov {
829
+ background-color: var(--qti-bg-gray-50);
830
+ }
831
+
832
+ .foc {
833
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
834
+ }
835
+
836
+ .act {
837
+ border-color: var(--qti-bg-primary); /* border-primary */
838
+ }
839
+
840
+ .rdo {
841
+ cursor: pointer;
842
+ background-color: white;
843
+ outline: 0;
844
+ border: none;
845
+ }
846
+
847
+ .dis {
848
+ cursor: not-allowed;
849
+ background-color: var(--qti-bg-gray-100);
850
+ color: var(--qti-text-gray-500);
851
+ border-color: var(--qti-border-color-gray);
852
+ }
853
+
854
+ /* base */
855
+
856
+ @layer qti-base {
857
+ .qti-layout-row {
858
+ display: flex;
859
+ flex-wrap: wrap;
860
+ width: 100%;
861
+ gap: 2.1276595745%;
862
+ }
863
+
864
+ .qti-layout-row [class*='qti-layout-col'] {
865
+ box-sizing: border-box;
866
+ }
867
+
868
+ .qti-layout-col1 {
869
+ width: 6.3829787234%;
870
+ }
871
+ .qti-layout-col2 {
872
+ width: 14.8936170213%;
873
+ }
874
+ .qti-layout-col3 {
875
+ width: 23.4042553191%;
876
+ }
877
+ .qti-layout-col4 {
878
+ width: 31.914893617%;
879
+ }
880
+ .qti-layout-col5 {
881
+ width: 40.4255319149%;
882
+ }
883
+ .qti-layout-col6 {
884
+ width: 48.9361702128%;
885
+ }
886
+ .qti-layout-col7 {
887
+ width: 57.4468085106%;
888
+ }
889
+ .qti-layout-col8 {
890
+ width: 65.9574468085%;
891
+ }
892
+ .qti-layout-col9 {
893
+ width: 74.4680851064%;
894
+ }
895
+ .qti-layout-col10 {
896
+ width: 82.9787234043%;
897
+ }
898
+ .qti-layout-col11 {
899
+ width: 91.4893617021%;
900
+ }
901
+ .qti-layout-col12 {
902
+ width: 100%;
903
+ }
904
+
905
+ .qti-layout-offset1 {
906
+ margin-left: 8.5106382979%;
907
+ }
908
+ .qti-layout-offset2 {
909
+ margin-left: 17.0212765957%;
910
+ }
911
+ .qti-layout-offset3 {
912
+ margin-left: 25.5319148936%;
913
+ }
914
+ .qti-layout-offset4 {
915
+ margin-left: 34.0425531915%;
916
+ }
917
+ .qti-layout-offset5 {
918
+ margin-left: 42.5531914894%;
919
+ }
920
+ .qti-layout-offset6 {
921
+ margin-left: 51.0638297872%;
922
+ }
923
+ .qti-layout-offset7 {
924
+ margin-left: 59.5744680851%;
925
+ }
926
+ .qti-layout-offset8 {
927
+ margin-left: 68.085106383%;
928
+ }
929
+ .qti-layout-offset9 {
930
+ margin-left: 76.5957446809%;
931
+ }
932
+ .qti-layout-offset10 {
933
+ margin-left: 85.1063829787%;
934
+ }
935
+ .qti-layout-offset11 {
936
+ margin-left: 93.6170212766%;
937
+ }
938
+ .qti-layout-offset12 {
939
+ margin-left: 102.1276595745%;
940
+ }
941
+
942
+ @media (max-width: 767px) {
943
+ [class*='qti-layout-col'] {
944
+ width: 100%;
945
+ }
946
+ }
947
+ }
948
+
949
+ [view],
950
+ qti-outcome-declaration,
951
+ qti-response-declaration {
952
+ display: none;
953
+ }
954
+
955
+ [view].show {
956
+ display: block;
957
+ }
958
+
959
+ :host {
960
+ box-sizing: border-box;
961
+ }
962
+
963
+ *,
964
+ *:before,
965
+ *:after {
966
+ box-sizing: inherit;
967
+ }
968
+
969
+ [popover] {
970
+ position: fixed;
971
+ inset: 0;
972
+ margin: auto;
973
+ border: solid;
974
+ padding: 0.25em;
975
+ overflow: auto;
976
+ color: CanvasText;
977
+ background-color: Canvas;
978
+ }
979
+
980
+ [popovertarget] {
981
+ all: unset;
982
+ cursor: pointer;
983
+ }
984
+
985
+ /* components */
986
+
987
+ @layer qti-components {
988
+ qti-choice-interaction {
989
+ &.qti-input-control-hidden {
990
+ & qti-simple-choice {
991
+ &:hover {
992
+ background-color: var(--qti-bg-gray-50);
993
+ }
994
+ &:focus {
995
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
996
+ }
997
+ &::part(ch) {
998
+ display: none;
999
+ }
1000
+ &[aria-checked='true'] {
1001
+ border-color: var(--qti-bg-primary);
1002
+ }
1003
+ &[aria-readonly='true'] {
1004
+ cursor: pointer;
1005
+ background-color: white;
1006
+ outline: 0;
1007
+ border: none;
1008
+ }
1009
+ &[aria-disabled='true'] {
1010
+ cursor: not-allowed;
1011
+ background-color: var(--qti-bg-gray-100);
1012
+ color: var(--qti-text-gray-500);
1013
+ border-color: var(--qti-border-color-gray);
1014
+ }
1015
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1016
+ outline: none;
1017
+ border-radius: var(--qti-border-radius-md);
1018
+ padding: var(--qti-padding-sm) var(--qti-padding-md);
1019
+ font-weight: var(--qti-font-weight-semibold);
1020
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1021
+ outline: none
1022
+ }
1023
+ }
1024
+ &:not(.qti-input-control-hidden) {
1025
+ & qti-simple-choice {
1026
+ &:hover {
1027
+ background-color: var(--qti-bg-gray-50);
1028
+ }
1029
+ &:focus {
1030
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1031
+ }
1032
+ &[aria-checked='true'] {
1033
+ border-color: var(--qti-bg-primary);
1034
+ }
1035
+ &[aria-readonly='true'] {
1036
+ cursor: pointer;
1037
+ background-color: white;
1038
+ outline: 0;
1039
+ border: none;
1040
+ }
1041
+ &[aria-disabled='true'] {
1042
+ cursor: not-allowed;
1043
+ background-color: var(--qti-bg-gray-100);
1044
+ color: var(--qti-text-gray-500);
1045
+ border-color: var(--qti-border-color-gray);
1046
+ }
1047
+
1048
+ &::part(cha) {
1049
+ width: calc(var(--qti-form-size) - 4px);
1050
+ height: calc(var(--qti-form-size) - 4px);
1051
+ }
1052
+ &[role='radio']::part(ch) {
1053
+ border-radius: var(--qti-border-radius-full);
1054
+ width: var(--qti-form-size);
1055
+ height: var(--qti-form-size);
1056
+ align-self: 1;
1057
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1058
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1059
+ outline: none;
1060
+ }
1061
+ &[role='radio'][aria-checked='true']::part(cha) {
1062
+ background-color: var(--qti-bg-primary);
1063
+ border-radius: var(--qti-border-radius-full);
1064
+ }
1065
+ &[role='checkbox']::part(ch) {
1066
+ border-radius: var(--qti-border-radius-md);
1067
+ width: var(--qti-form-size);
1068
+ height: var(--qti-form-size);
1069
+ align-self: 1;
1070
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1071
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1072
+ outline: none;
1073
+ }
1074
+ &[role='checkbox'][aria-checked='true']::part(cha) {
1075
+ background-color: var(--qti-bg-primary);
1076
+ -webkit-mask-image: var(--check-mask);
1077
+ mask-image: var(--check-mask);
1078
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
1079
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
1080
+ }
1081
+ gap: 0.5rem;
1082
+ padding: var(--qti-padding-md) var(--qti-padding-md);
1083
+ outline: none;
1084
+ border-radius: var(--qti-border-radius-md);
1085
+ cursor: pointer
1086
+ }
1087
+ }
1088
+ & qti-simple-choice {
1089
+ &[data-correct-response='true'] {
1090
+ &::after {
1091
+ content: '\\02714';
1092
+ color: #16a34a; /* text-green-600 */
1093
+ }
1094
+ }
1095
+ }
1096
+
1097
+ & qti-simple-choice > p {
1098
+ margin: 0;
1099
+ padding: 0;
1100
+ }
1101
+ }
1102
+
1103
+ qti-text-entry-interaction {
1104
+ &:hover {
1105
+ background-color: var(--qti-bg-gray-50);
1106
+ }
1107
+ &:focus-within {
1108
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1109
+ }
1110
+ &::part(input) {
1111
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1112
+ outline: none;
1113
+ border-radius: 0;
1114
+ cursor: text;
1115
+ padding: var(--qti-padding-lg);
1116
+ background: unset;
1117
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1118
+ outline: none;
1119
+ }
1120
+ }
1121
+
1122
+ qti-extended-text-interaction {
1123
+ &::part(textarea) {
1124
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1125
+ outline: none;
1126
+ border-radius: 0;
1127
+ cursor: text;
1128
+ padding: var(--qti-padding-lg);
1129
+ background: unset;
1130
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1131
+ outline: none;
1132
+ }
1133
+ &:hover {
1134
+ background-color: var(--qti-bg-gray-50);
1135
+ }
1136
+ &:focus-within {
1137
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1138
+ }
1139
+ }
1140
+
1141
+ qti-gap-match-interaction {
1142
+ & qti-gap-text {
1143
+
1144
+ &:hover {
1145
+ background-color: var(--qti-bg-gray-50);
1146
+ }
1147
+ &:focus {
1148
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1149
+ }
1150
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1151
+ outline: none;
1152
+ padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl);
1153
+ border-radius: var(--qti-border-radius-md);
1154
+ cursor: grab;
1155
+ background-color: white;
1156
+ font-weight: var(--qti-font-weight-semibold);
1157
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1158
+ outline: none;
1159
+ background-image: radial-gradient(
1160
+ circle at center,
1161
+ rgba(0, 0, 0, 0.1) 0,
1162
+ rgb(0, 0, 0, 0.1) 2px,
1163
+ white 2px,
1164
+ white 100%
1165
+ );
1166
+ background-repeat: repeat-y;
1167
+ background-position: left 2px;
1168
+ background-size: 14px 8px
1169
+ }
1170
+ & qti-gap {
1171
+ display: inline-flex;
1172
+ width: 8rem; /* w-32 */
1173
+ &:empty:after {
1174
+ padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */
1175
+ content: '\\0000a0'; /* when empty, put a space in it */
1176
+ }
1177
+ &:not(:empty) {
1178
+ display: inline-flex;
1179
+ padding: 0;
1180
+ width: auto;
1181
+ }
1182
+ &:not(:empty) > * {
1183
+ flex: 1;
1184
+ transform: rotate(0); /* rotate-0 */
1185
+ box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */
1186
+ }
1187
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1188
+ outline: none;
1189
+ border-radius: var(--qti-border-radius-lg);
1190
+ position: relative;
1191
+ background-color: var(--qti-bg-gray-50);
1192
+ margin: 1px;
1193
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1194
+ outline: none
1195
+ }
1196
+ }
1197
+
1198
+ qti-hotspot-interaction {
1199
+ & qti-hotspot-choice {
1200
+ &[shape='circle'] {
1201
+ &:hover {
1202
+ background-color: var(--qti-bg-gray-50);
1203
+ }
1204
+ &:focus {
1205
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1206
+ }
1207
+ &[aria-checked='true'] {
1208
+ border-color: var(--qti-bg-primary);
1209
+ }
1210
+ &[aria-readonly='true'] {
1211
+ cursor: pointer;
1212
+ background-color: white;
1213
+ outline: 0;
1214
+ border: none;
1215
+ }
1216
+ &[aria-disabled='true'] {
1217
+ cursor: not-allowed;
1218
+ background-color: var(--qti-bg-gray-100);
1219
+ color: var(--qti-text-gray-500);
1220
+ border-color: var(--qti-border-color-gray);
1221
+ }
1222
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1223
+ outline: none;
1224
+ width: 100%;
1225
+ height: 100%;
1226
+ background-color: transparent;
1227
+ padding: 0;
1228
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1229
+ outline: none
1230
+ }
1231
+ &[shape='rect'] {
1232
+ &:hover {
1233
+ background-color: var(--qti-bg-gray-50);
1234
+ }
1235
+ &:focus {
1236
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1237
+ }
1238
+ &[aria-checked='true'] {
1239
+ border-color: var(--qti-bg-primary);
1240
+ }
1241
+ &[aria-readonly='true'] {
1242
+ cursor: pointer;
1243
+ background-color: white;
1244
+ outline: 0;
1245
+ border: none;
1246
+ }
1247
+ &[aria-disabled='true'] {
1248
+ cursor: not-allowed;
1249
+ background-color: var(--qti-bg-gray-100);
1250
+ color: var(--qti-text-gray-500);
1251
+ border-color: var(--qti-border-color-gray);
1252
+ }
1253
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1254
+ outline: none;
1255
+ width: 100%;
1256
+ height: 100%;
1257
+ background-color: transparent;
1258
+ padding: 0;
1259
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1260
+ outline: none
1261
+ }
1262
+ &[shape='poly'] {
1263
+ &:hover::after {
1264
+ content: '';
1265
+ width: 100%;
1266
+ height: 100%;
1267
+ background: repeating-linear-gradient(
1268
+ 45deg,
1269
+ var(--qti-primary),
1270
+ var(--qti-primary) 5px,
1271
+ transparent 5px,
1272
+ transparent 10px
1273
+ );
1274
+ display: block;
1275
+ border-color: var(--qti-bg-primary);
1276
+ }
1277
+
1278
+ &[aria-checked='true']:after {
1279
+ content: '';
1280
+ width: 100%;
1281
+ height: 100%;
1282
+ background: repeating-linear-gradient(
1283
+ 45deg,
1284
+ transparent,
1285
+ transparent 5px,
1286
+ var(--qti-primary) 5px,
1287
+ var(--qti-primary) 10px
1288
+ );
1289
+ display: block;
1290
+ border-color: var(--qti-bg-primary);
1291
+ }
1292
+
1293
+ &[aria-checked='true'] {
1294
+ border-color: var(--qti-bg-primary);
1295
+ }
1296
+ &[aria-readonly='true'] {
1297
+ cursor: pointer;
1298
+ background-color: white;
1299
+ outline: 0;
1300
+ border: none;
1301
+ }
1302
+ &[aria-disabled='true'] {
1303
+ cursor: not-allowed;
1304
+ background-color: var(--qti-bg-gray-100);
1305
+ color: var(--qti-text-gray-500);
1306
+ border-color: var(--qti-border-color-gray);
1307
+ }
1308
+ }
1309
+ }
1310
+ }
1311
+
1312
+ qti-hottext-interaction {
1313
+ qti-hottext {
1314
+ display: inline-flex;
1315
+ align-items: center;
1316
+ }
1317
+ /* &:not(.qti-input-control-hidden),
1318
+ &:not(.qti-unselected-hidden) { */
1319
+ qti-hottext {
1320
+ &:hover {
1321
+ background-color: var(--qti-bg-gray-50);
1322
+ }
1323
+ &:focus {
1324
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1325
+ }
1326
+ &::part(cha) {
1327
+ width: calc(var(--qti-form-size) - 4px);
1328
+ height: calc(var(--qti-form-size) - 4px);
1329
+ }
1330
+ &[role='radio']::part(ch) {
1331
+ border-radius: var(--qti-border-radius-full);
1332
+ width: var(--qti-form-size);
1333
+ height: var(--qti-form-size);
1334
+ align-self: 1;
1335
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1336
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1337
+ outline: none;
1338
+ }
1339
+ &[role='radio'][aria-checked='true']::part(cha) {
1340
+ background-color: var(--qti-bg-primary);
1341
+ border-radius: var(--qti-border-radius-full);
1342
+ }
1343
+ &[role='checkbox']::part(ch) {
1344
+ border-radius: var(--qti-border-radius-md);
1345
+ width: var(--qti-form-size);
1346
+ height: var(--qti-form-size);
1347
+ align-self: 1;
1348
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1349
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1350
+ outline: none;
1351
+ }
1352
+ &[role='checkbox'][aria-checked='true']::part(cha) {
1353
+ background-color: var(--qti-bg-primary);
1354
+ -webkit-mask-image: var(--check-mask);
1355
+ mask-image: var(--check-mask);
1356
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
1357
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
1358
+ }
1359
+ gap: 0.5rem;
1360
+ padding: var(--qti-padding-md) var(--qti-padding-md);
1361
+ outline: none;
1362
+ border-radius: var(--qti-border-radius-md);
1363
+ cursor: pointer
1364
+ }
1365
+ /* } */
1366
+
1367
+ &.qti-input-control-hidden {
1368
+ qti-hottext {
1369
+ /* --qti-padding-md: 0.1rem;
1370
+ --qti-padding-lg: 0.2rem;
1371
+ --qti-border-radius-md: 0.3rem;
1372
+ --qti-border-thickness: 1px;
1373
+ --qti-font-weight-semibold: 400; */
1374
+ &:hover {
1375
+ background-color: var(--qti-bg-gray-50);
1376
+ }
1377
+ &:focus {
1378
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1379
+ }
1380
+ /* @layer qti-variants { */
1381
+ &::part(ch) {
1382
+ display: none;
1383
+ }
1384
+ &[aria-checked='true'] {
1385
+ border-color: var(--qti-bg-primary);
1386
+ }
1387
+ &[aria-readonly='true'] {
1388
+ cursor: pointer;
1389
+ background-color: white;
1390
+ outline: 0;
1391
+ border: none;
1392
+ }
1393
+ &[aria-disabled='true'] {
1394
+ cursor: not-allowed;
1395
+ background-color: var(--qti-bg-gray-100);
1396
+ color: var(--qti-text-gray-500);
1397
+ border-color: var(--qti-border-color-gray);
1398
+ }
1399
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1400
+ outline: none;
1401
+ border-radius: var(--qti-border-radius-md);
1402
+ padding: var(--qti-padding-sm) var(--qti-padding-md);
1403
+ font-weight: var(--qti-font-weight-semibold);
1404
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1405
+ outline: none
1406
+ }
1407
+ /* } */
1408
+ }
1409
+
1410
+ &.qti-unselected-hidden {
1411
+ qti-hottext {
1412
+ &:hover {
1413
+ background-color: var(--qti-bg-gray-50);
1414
+ }
1415
+ &:focus {
1416
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1417
+ }
1418
+ cursor: pointer;
1419
+ &::part(ch) {
1420
+ display: none;
1421
+ }
1422
+ &[aria-checked='true'] {
1423
+ background-color: var(--qti-primary-light); /* bg-blue-200 */
1424
+ }
1425
+ &[aria-readonly='true'] {
1426
+ cursor: pointer;
1427
+ background-color: white;
1428
+ outline: 0;
1429
+ border: none;
1430
+ }
1431
+ &[aria-disabled='true'] {
1432
+ cursor: not-allowed;
1433
+ background-color: var(--qti-bg-gray-100);
1434
+ color: var(--qti-text-gray-500);
1435
+ border-color: var(--qti-border-color-gray);
1436
+ }
1437
+ }
1438
+ }
1439
+ }
1440
+
1441
+ qti-inline-choice-interaction {
1442
+ &::part(select) {
1443
+ &:hover {
1444
+ background-color: var(--qti-bg-gray-50);
1445
+ }
1446
+ &:focus {
1447
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1448
+ }
1449
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1450
+ outline: none;
1451
+ border-radius: var(--qti-border-radius-md);
1452
+ position: relative;
1453
+ -webkit-appearance: none;
1454
+ -moz-appearance: none;
1455
+ appearance: none;
1456
+ padding: var(--qti-padding-md) 1.75rem var(--qti-padding-md) var(--qti-padding-lg);
1457
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1458
+ outline: none;
1459
+ background: url("data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E")
1460
+ no-repeat center right 6px
1461
+ }
1462
+ }
1463
+
1464
+ qti-match-interaction:not(.qti-match-tabular) {
1465
+ & qti-simple-match-set:first-of-type {
1466
+ display: flex;
1467
+ flex-wrap: wrap;
1468
+ gap: var(--qti-gap-size); /* gap-2 */
1469
+ padding-bottom: 1rem; /* pb-4 */
1470
+
1471
+ & qti-simple-associable-choice {
1472
+ &:hover {
1473
+ background-color: var(--qti-bg-gray-50);
1474
+ }
1475
+ &:focus {
1476
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1477
+ }
1478
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1479
+ outline: none;
1480
+ padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl);
1481
+ border-radius: var(--qti-border-radius-md);
1482
+ cursor: grab;
1483
+ background-color: white;
1484
+ font-weight: var(--qti-font-weight-semibold);
1485
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1486
+ outline: none;
1487
+ background-image: radial-gradient(
1488
+ circle at center,
1489
+ rgba(0, 0, 0, 0.1) 0,
1490
+ rgb(0, 0, 0, 0.1) 2px,
1491
+ white 2px,
1492
+ white 100%
1493
+ );
1494
+ background-repeat: repeat-y;
1495
+ background-position: left 2px;
1496
+ background-size: 14px 8px
1497
+ }
1498
+ }
1499
+
1500
+ & qti-simple-match-set:last-of-type {
1501
+ display: grid;
1502
+ grid-auto-columns: 1fr; /* auto-cols-fr */
1503
+ grid-auto-flow: column; /* grid-flow-col */
1504
+ gap: var(--qti-gap-size); /* gap-2 */
1505
+ width: 100%; /* w-full */
1506
+
1507
+ & qti-simple-associable-choice {
1508
+ display: flex;
1509
+ flex-direction: column;
1510
+ }
1511
+
1512
+ & qti-simple-associable-choice[enabled] {
1513
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1514
+ }
1515
+
1516
+ & qti-simple-associable-choice[active] {
1517
+ border-color: var(--qti-bg-primary);
1518
+ }
1519
+
1520
+ & qti-simple-associable-choice::part(dropslot) {
1521
+ &:hover {
1522
+ background-color: var(--qti-bg-gray-50);
1523
+ }
1524
+ &:focus {
1525
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1526
+ }
1527
+ display: flex;
1528
+ flex-direction: column;
1529
+ min-height: 6rem;
1530
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1531
+ outline: none;
1532
+ border-radius: var(--qti-border-radius-lg);
1533
+ position: relative;
1534
+ background-color: var(--qti-bg-gray-50);
1535
+ margin: 1px;
1536
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1537
+ outline: none;
1538
+ }
1539
+
1540
+ & qti-simple-associable-choice > qti-simple-associable-choice::part(dropslot) {
1541
+ display: none;
1542
+ }
1543
+
1544
+ & qti-simple-associable-choice > *:not(qti-simple-associable-choice) {
1545
+ pointer-events: none;
1546
+ }
1547
+
1548
+ & qti-simple-associable-choice > qti-simple-associable-choice {
1549
+ &:hover {
1550
+ background-color: var(--qti-bg-gray-50);
1551
+ }
1552
+ &:focus {
1553
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1554
+ }
1555
+ flex-basis: fit-content;
1556
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1557
+ outline: none;
1558
+ padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl);
1559
+ border-radius: var(--qti-border-radius-md);
1560
+ cursor: grab;
1561
+ background-color: white;
1562
+ font-weight: var(--qti-font-weight-semibold);
1563
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1564
+ outline: none;
1565
+ background-image: radial-gradient(
1566
+ circle at center,
1567
+ rgba(0, 0, 0, 0.1) 0,
1568
+ rgb(0, 0, 0, 0.1) 2px,
1569
+ white 2px,
1570
+ white 100%
1571
+ );
1572
+ background-repeat: repeat-y;
1573
+ background-position: left 2px;
1574
+ background-size: 14px 8px;
1575
+ }
1576
+ }
1577
+ }
1578
+
1579
+ qti-order-interaction {
1580
+ &::part(qti-simple-choice),
1581
+ & qti-simple-choice {
1582
+ &:hover {
1583
+ background-color: var(--qti-bg-gray-50);
1584
+ }
1585
+ &:focus {
1586
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1587
+ }
1588
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1589
+ outline: none;
1590
+ padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl);
1591
+ border-radius: var(--qti-border-radius-md);
1592
+ cursor: grab;
1593
+ background-color: white;
1594
+ font-weight: var(--qti-font-weight-semibold);
1595
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1596
+ outline: none;
1597
+ background-image: radial-gradient(
1598
+ circle at center,
1599
+ rgba(0, 0, 0, 0.1) 0,
1600
+ rgb(0, 0, 0, 0.1) 2px,
1601
+ white 2px,
1602
+ white 100%
1603
+ );
1604
+ background-repeat: repeat-y;
1605
+ background-position: left 2px;
1606
+ background-size: 14px 8px
1607
+ }
1608
+ &::part(qti-simple-choice) {
1609
+ display: flex;
1610
+ overflow: hidden;
1611
+ align-items: center;
1612
+ width: 100%;
1613
+ text-overflow: ellipsis;
1614
+ }
1615
+ &::part(drops) {
1616
+ gap: 0.5rem; /* gap-2 */
1617
+ }
1618
+ &::part(drags) {
1619
+ gap: 0.5rem; /* gap-2 */
1620
+ }
1621
+ &::part(drop-list) {
1622
+ &:hover {
1623
+ background-color: var(--qti-bg-gray-50);
1624
+ }
1625
+ &:focus {
1626
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1627
+ }
1628
+ display: flex;
1629
+ min-height: 4rem;
1630
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1631
+ outline: none;
1632
+ border-radius: var(--qti-border-radius-lg);
1633
+ position: relative;
1634
+ background-color: var(--qti-bg-gray-50);
1635
+ margin: 1px;
1636
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1637
+ outline: none;
1638
+ }
1639
+ &::part(active) {
1640
+ border-color: var(--qti-bg-primary);
1641
+ }
1642
+ }
1643
+
1644
+ qti-associate-interaction {
1645
+ &::part(qti-simple-associable-choice),
1646
+ & qti-simple-associable-choice {
1647
+ /* drags in drops */
1648
+ display: flex;
1649
+ overflow: hidden;
1650
+ align-items: center;
1651
+ text-overflow: ellipsis;
1652
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1653
+ outline: none;
1654
+ padding: var(--qti-padding-md) var(--qti-padding-lg) var(--qti-padding-md) var(--qti-padding-xl);
1655
+ border-radius: var(--qti-border-radius-md);
1656
+ cursor: grab;
1657
+ background-color: white;
1658
+ font-weight: var(--qti-font-weight-semibold);
1659
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1660
+ outline: none;
1661
+ background-image: radial-gradient(
1662
+ circle at center,
1663
+ rgba(0, 0, 0, 0.1) 0,
1664
+ rgb(0, 0, 0, 0.1) 2px,
1665
+ white 2px,
1666
+ white 100%
1667
+ );
1668
+ background-repeat: repeat-y;
1669
+ background-position: left 2px;
1670
+ background-size: 14px 8px;
1671
+ }
1672
+ &::part(associables-container) {
1673
+ display: flex;
1674
+ justify-content: space-between;
1675
+ background: linear-gradient(
1676
+ 180deg,
1677
+ rgb(0 0 0 / 0%) calc(50% - 1px),
1678
+ var(--qti-border-color-gray) calc(50%),
1679
+ rgb(0 0 0 / 0%) calc(50% + 1px)
1680
+ );
1681
+ }
1682
+ &::part(active) {
1683
+ border-color: var(--qti-bg-primary);
1684
+ }
1685
+ &::part(drop-container) {
1686
+ display: flex;
1687
+ flex-direction: column;
1688
+ gap: var(--qti-gap-size);
1689
+ }
1690
+ &::part(drop-list) {
1691
+ &:focus {
1692
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1693
+ }
1694
+ display: grid;
1695
+ height: 3rem;
1696
+ min-width: 10rem;
1697
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1698
+ outline: none;
1699
+ border-radius: var(--qti-border-radius-lg);
1700
+ position: relative;
1701
+ background-color: var(--qti-bg-gray-50);
1702
+ margin: 1px;
1703
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1704
+ outline: none;
1705
+ }
1706
+ }
1707
+
1708
+ qti-graphic-order-interaction {
1709
+ & qti-hotspot-choice {
1710
+ &:hover {
1711
+ background-color: var(--qti-bg-gray-50);
1712
+ }
1713
+ &:focus {
1714
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1715
+ }
1716
+ &[aria-checked='true'] {
1717
+ border-color: var(--qti-bg-primary);
1718
+ }
1719
+ &[aria-readonly='true'] {
1720
+ cursor: pointer;
1721
+ background-color: white;
1722
+ outline: 0;
1723
+ border: none;
1724
+ }
1725
+ &[aria-disabled='true'] {
1726
+ cursor: not-allowed;
1727
+ background-color: var(--qti-bg-gray-100);
1728
+ color: var(--qti-text-gray-500);
1729
+ border-color: var(--qti-border-color-gray);
1730
+ }
1731
+ &[aria-ordervalue] {
1732
+ display: flex;
1733
+ justify-content: center;
1734
+ align-items: center;
1735
+ background-color: var(--qti-bg-primary);
1736
+ border-radius: var(--qti-border-radius-full);
1737
+ width: 1.5rem;
1738
+ height: 1.5rem;
1739
+ color: var(--qti-text-white);
1740
+ }
1741
+ &[aria-ordervalue]::after {
1742
+ content: attr(aria-ordervalue) !important;
1743
+ }
1744
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1745
+ outline: none;
1746
+ width: 100%;
1747
+ height: 100%;
1748
+ background-color: transparent;
1749
+ padding: 0;
1750
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1751
+ outline: none
1752
+ }
1753
+ }
1754
+
1755
+ qti-graphic-associate-interaction {
1756
+ position: relative;
1757
+ display: block;
1758
+
1759
+ & qti-associable-hotspot {
1760
+ &[shape='circle'] {
1761
+ &:hover {
1762
+ background-color: var(--qti-bg-gray-50);
1763
+ }
1764
+ &:focus {
1765
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1766
+ }
1767
+ &[aria-checked='true'] {
1768
+ border-color: var(--qti-bg-primary);
1769
+ }
1770
+ &[aria-readonly='true'] {
1771
+ cursor: pointer;
1772
+ background-color: white;
1773
+ outline: 0;
1774
+ border: none;
1775
+ }
1776
+ &[aria-disabled='true'] {
1777
+ cursor: not-allowed;
1778
+ background-color: var(--qti-bg-gray-100);
1779
+ color: var(--qti-text-gray-500);
1780
+ border-color: var(--qti-border-color-gray);
1781
+ }
1782
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1783
+ outline: none;
1784
+ width: 100%;
1785
+ height: 100%;
1786
+ background-color: transparent;
1787
+ padding: 0;
1788
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1789
+ outline: none
1790
+ }
1791
+
1792
+ &[shape='square'] {
1793
+ &:hover {
1794
+ background-color: var(--qti-bg-gray-50);
1795
+ }
1796
+ &:focus {
1797
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1798
+ }
1799
+ &[aria-checked='true'] {
1800
+ border-color: var(--qti-bg-primary);
1801
+ }
1802
+ &[aria-readonly='true'] {
1803
+ cursor: pointer;
1804
+ background-color: white;
1805
+ outline: 0;
1806
+ border: none;
1807
+ }
1808
+ &[aria-disabled='true'] {
1809
+ cursor: not-allowed;
1810
+ background-color: var(--qti-bg-gray-100);
1811
+ color: var(--qti-text-gray-500);
1812
+ border-color: var(--qti-border-color-gray);
1813
+ }
1814
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1815
+ outline: none;
1816
+ width: 100%;
1817
+ height: 100%;
1818
+ background-color: transparent;
1819
+ padding: 0;
1820
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1821
+ outline: none
1822
+ }
1823
+ }
1824
+ }
1825
+
1826
+ qti-graphic-gap-match-interaction {
1827
+ position: relative;
1828
+ & img {
1829
+ margin: 0;
1830
+ padding: 0;
1831
+ }
1832
+ }
1833
+
1834
+ qti-slider-interaction {
1835
+ display: block;
1836
+
1837
+ --qti-tick-color: rgb(229 231 235 / 1);
1838
+ --qti-tick-width: 1px;
1839
+
1840
+ &::part(slider) {
1841
+ margin-left: 2rem; /* mx-8 */
1842
+ margin-right: 2rem;
1843
+ padding-bottom: 1rem; /* pb-4 */
1844
+ padding-top: 1.25rem; /* pt-5 */
1845
+ }
1846
+
1847
+ --show-bounds: true;
1848
+ &::part(bounds) {
1849
+ display: flex;
1850
+ width: 100%;
1851
+ justify-content: space-between;
1852
+ margin-bottom: 0.5rem; /* mb-2 */
1853
+ }
1854
+
1855
+ --show-ticks: true;
1856
+ &::part(ticks) {
1857
+ margin-left: 0.125rem; /* mx-0.5 */
1858
+ margin-right: 0.125rem;
1859
+ margin-bottom: 0.25rem; /* mb-1 */
1860
+ height: 0.5rem; /* h-2 */
1861
+ background-position: 0 center;
1862
+ background: linear-gradient(to right, var(--qti-tick-color) var(--qti-tick-width), transparent 1px) repeat-x;
1863
+ background-size: calc(calc(100% - var(--qti-tick-width)) / ((var(--max) - var(--min)) / var(--step))) 100%;
1864
+ }
1865
+
1866
+ &::part(rail) {
1867
+ display: flex;
1868
+ align-items: center;
1869
+ box-sizing: border-box;
1870
+ height: 0.375rem; /* h-1.5 */
1871
+ width: 100%;
1872
+ cursor: pointer;
1873
+ border-radius: 9999px; /* rounded-full */
1874
+ border: 1px solid #d1d5db; /* border-gray-300 */
1875
+ background-color: #e5e7eb; /* bg-gray-200 */
1876
+ }
1877
+
1878
+ &::part(knob) {
1879
+ background-color: var(--qti-primary);
1880
+ position: relative;
1881
+ height: 1rem; /* h-4 */
1882
+ width: 1rem; /* w-4 */
1883
+ transform-origin: center;
1884
+ transform: translateX(-50%);
1885
+ cursor: pointer;
1886
+ border-radius: 9999px; /* rounded-full */
1887
+ left: var(--value-percentage);
1888
+ }
1889
+
1890
+ --show-value: true;
1891
+ &::part(value) {
1892
+ position: absolute;
1893
+ bottom: 2rem; /* bottom-8 */
1894
+ left: 0.5rem; /* left-2 */
1895
+ transform: translateX(-50%);
1896
+ cursor: pointer;
1897
+ border-radius: 0.25rem; /* rounded */
1898
+ background-color: #f3f4f6; /* bg-gray-100 */
1899
+ padding: 0.25rem 0.5rem; /* px-2 py-1 */
1900
+ text-align: center;
1901
+ color: #6b7280; /* text-gray-500 */
1902
+ }
1903
+ }
1904
+
1905
+ qti-select-point-interaction {
1906
+ &::part(point) {
1907
+ &:hover {
1908
+ background-color: var(--qti-bg-gray-50);
1909
+ }
1910
+ &:focus {
1911
+ outline: var(--qti-focus-border-width) solid var(--qti-focus-color);
1912
+ }
1913
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1914
+ border-radius: var(--qti-border-radius-full);
1915
+ outline: none;
1916
+ width: 1.5rem;
1917
+ height: 1.5rem;
1918
+ background-color: transparent;
1919
+ padding: 0;
1920
+ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color-gray);
1921
+ outline: none;
1922
+ }
1923
+ }
1924
+
1925
+ qti-position-object-stage {
1926
+ & qti-position-object-interaction {
1927
+ /* no styles necessary, only layout styles, defined in the component */
1928
+ }
1929
+ }
1930
+
1931
+ qti-prompt {
1932
+ margin: 0.5rem 0; /* my-2 */
1933
+ display: block;
1934
+ width: 100%;
1935
+ }
1936
+ }
1937
+
1938
+ /* utilities */
1939
+
1940
+ @layer qti-utilities {
1941
+ .qti-underline {
1942
+ text-decoration: underline;
1943
+ }
1944
+
1945
+ .qti-align-left {
1946
+ text-align: left;
1947
+ }
1948
+
1949
+ .qti-align-center {
1950
+ text-align: center;
1951
+ }
1952
+
1953
+ .qti-align-right {
1954
+ text-align: right;
1955
+ }
1956
+
1957
+ .qti-valign-top {
1958
+ vertical-align: top;
1959
+ }
1960
+
1961
+ .qti-valign-middle {
1962
+ vertical-align: middle;
1963
+ }
1964
+
1965
+ .qti-valign-baseline {
1966
+ vertical-align: baseline;
1967
+ }
1968
+
1969
+ .qti-valign-bottom {
1970
+ vertical-align: bottom;
1971
+ }
1972
+
1973
+ .qti-fullwidth {
1974
+ width: 100%;
1975
+ }
1976
+
1977
+ .qti-hidden {
1978
+ display: none;
1979
+ }
1980
+
1981
+ .qti-visually-hidden {
1982
+ position: fixed !important;
1983
+ overflow: hidden;
1984
+ width: 1px;
1985
+ height: 1px;
1986
+ border: 0;
1987
+ margin: -1px;
1988
+ clip: rect(1px 1px 1px 1px);
1989
+ }
1990
+
1991
+ .qti-bordered {
1992
+ padding: 2px;
1993
+ border: 1px solid #888;
1994
+ }
1995
+
1996
+ .qti-well {
1997
+ display: inline-block;
1998
+ padding-top: 0.5rem;
1999
+ padding-bottom: 0.5rem;
2000
+ padding-left: 0.75rem;
2001
+ padding-right: 0.75rem;
2002
+ border-radius: 0.25rem;
2003
+ border-width: 1px;
2004
+ border-color: #d1d5db;
2005
+ color: #4b5563;
2006
+ background-color: #f3f4f6;
2007
+ }
2008
+ }
2009
+
2010
+ /* variants */
2011
+
2012
+ @layer qti-variants {
2013
+ .qti-input-width-1 {
2014
+ width: 1ch;
2015
+ min-width: 1ch;
2016
+ }
2017
+ .qti-input-width-2 {
2018
+ width: 2ch;
2019
+ min-width: 2ch;
2020
+ }
2021
+ .qti-input-width-3 {
2022
+ width: 3ch;
2023
+ min-width: 3ch;
2024
+ }
2025
+ .qti-input-width-4 {
2026
+ width: 4ch;
2027
+ min-width: 4ch;
2028
+ }
2029
+ .qti-input-width-6 {
2030
+ width: 6ch;
2031
+ min-width: 6ch;
2032
+ }
2033
+ .qti-input-width-10 {
2034
+ width: 10ch;
2035
+ min-width: 10ch;
2036
+ }
2037
+ .qti-input-width-15 {
2038
+ width: 15ch;
2039
+ min-width: 15ch;
2040
+ }
2041
+ .qti-input-width-20 {
2042
+ width: 20ch;
2043
+ min-width: 20ch;
2044
+ }
2045
+ .qti-input-width-72 {
2046
+ width: 72ch;
2047
+ min-width: 72ch;
2048
+ }
2049
+ }
2050
+
2051
+ @layer qti-variants {
2052
+ qti-choice-interaction {
2053
+ &.qti-choices-stacking-2 {
2054
+ .grid {
2055
+ display: grid; /* grid */
2056
+ }
2057
+ grid-template-columns: repeat(2, minmax(0, 1fr)); /* grid-cols-2 */
2058
+ qti-prompt {
2059
+ grid-column: span 2 / span 2; /* col-span-2 */
2060
+ }
2061
+ }
2062
+ &.qti-choices-stacking-3 {
2063
+ .grid {
2064
+ display: grid;
2065
+ }
2066
+ grid-template-columns: repeat(3, minmax(0, 1fr));
2067
+ qti-prompt {
2068
+ grid-column: span 3 / span 3;
2069
+ }
2070
+ }
2071
+ &.qti-choices-stacking-4 {
2072
+ .grid {
2073
+ display: grid;
2074
+ }
2075
+ grid-template-columns: repeat(4, minmax(0, 1fr));
2076
+ qti-prompt {
2077
+ grid-column: span 4 / span 4;
2078
+ }
2079
+ }
2080
+ &.qti-choices-stacking-5 {
2081
+ .grid {
2082
+ display: grid;
2083
+ }
2084
+ grid-template-columns: repeat(5, minmax(0, 1fr));
2085
+ qti-prompt {
2086
+ grid-column: span 5 / span 5;
2087
+ }
2088
+ }
2089
+ &.qti-orientation-horizontal {
2090
+ /* is the default layout */
2091
+ }
2092
+ &[orientation='horizontal'] {
2093
+ flex-direction: row;
2094
+ }
2095
+ }
2096
+ }
2097
+ `;var O,qe,vt,yt,zr=class extends HTMLElement{constructor(){super(...arguments);qt(this,qe);qt(this,O,null);qt(this,yt,e=>{e.stopImmediatePropagation(),e.stopPropagation(),this.dispatchEvent(new CustomEvent("qti-item-variables-changed",{bubbles:!1,detail:{variables:R(this,qe,vt).variables}}))})}set xmlDoc(e){if(!R(this,O)){Wr(this,O,this.attachShadow({mode:"open"}));let r=new CSSStyleSheet;r.replaceSync(Fi),R(this,O).adoptedStyleSheets=[r],R(this,O).innerHTML="",R(this,O).addEventListener("qti-interaction-changed",R(this,yt)),R(this,O).addEventListener("qti-outcome-changed",R(this,yt))}R(this,O).innerHTML="",R(this,O).appendChild(e.cloneNode(!0))}processResponse(){var e,r;(r=(e=R(this,qe,vt))==null?void 0:e.variables)!=null&&r.processResponse()||console.warn("No qti-assessment-item found")}get variables(){var e;return((e=R(this,qe,vt))==null?void 0:e.variables)||console.warn("No qti-assessment-item found")}set variables(e){R(this,qe,vt).variables=e}attributeChangedCallback(e,r,i){switch(e){case"view":break;default:r!==i&&(this[e]=i);break}}};O=new WeakMap,qe=new WeakSet,vt=function(){return R(this,O).querySelector("qti-assessment-item")||console.warn("No qti-assessment-item found")},yt=new WeakMap;customElements.define("qti-item",zr);var Bi=s=>s.endsWith("/")?s:`${s}/`,Mg=async(s,t,e=!0)=>{let r=Bi(s),i=await mr().load(`${r}imsmanifest.xml`).then(c=>c.assessmentTest()),o=await Lt().load(`${r}${i.href}`).then(c=>c.items()),n=`${r}${i.href.substring(0,i.href.lastIndexOf("/"))}/${o[t].href}`,a=await Je().load(n,e).then(c=>c.path(n.substring(0,n.lastIndexOf("/"))).stripStyleSheets());return{itemHTMLDoc:a.htmldoc(),itemHTML:a.html(),items:o}},Lg=async s=>{let t=Bi(s),e=await mr().load(`${t}imsmanifest.xml`).then(c=>c.assessmentTest()),r=await Lt().load(`${t}${e.href}`).then(c=>c.htmldoc()),i=await Lt().load(`${t}${e.href}`).then(c=>c.items()),n=`${t.substring(0,t.lastIndexOf("/"))}/${e.href.substring(0,e.href.lastIndexOf("/"))}`,a=`${n}/${i[0].href.substring(0,i[0].href.lastIndexOf("/"))}`;return{assessmentXML:r,itemLocation:a,assessmentLocation:n,items:i,testIdentifier:e.identifier}},Hg=async(s,t=!0)=>Je().load(s,t).then(e=>e.path(s.substring(0,s.lastIndexOf("/"))).stripStyleSheets().html());export{k as Interaction,at as QtPrintedVariable,jt as QtiAnd,H as QtiAssessmentItem,Ae as QtiAssessmentStimulusRef,ft as QtiAssociableHotspot,Me as QtiAssociateInteraction,Xt as QtiBaseValue,M as QtiChoice,Re as QtiChoiceInteraction,Nt as QtiCompanionMaterialsInfo,V as QtiConditionExpression,kr as QtiContains,Vt as QtiContentBody,_r as QtiCorrect,K as QtiCustomInteraction,mt as QtiCustomOperator,Le as QtiEndAttemptInteraction,Wt as QtiEqual,Yt as QtiEqualRounded,x as QtiExpression,X as QtiExtendedTextInteraction,Qe as QtiFeedbackBlock,et as QtiFeedbackInline,Pe as QtiGap,Ne as QtiGapImg,lt as QtiGapMatchInteraction,Ve as QtiGapText,J as QtiGraphicAssociateInteraction,ct as QtiGraphicGapMatchInteraction,dt as QtiGraphicOrderInteraction,Ar as QtiGt,Sr as QtiGte,De as QtiHotspotChoice,pt as QtiHotspotInteraction,gt as QtiHottext,zt as QtiHottextInteraction,bt as QtiInlineChoice,de as QtiInlineChoiceInteraction,Tr as QtiIsNull,Bt as QtiLookupOutcomeValue,Rr as QtiLt,$r as QtiLte,Kt as QtiMapResponse,$e as QtiMapping,Mr as QtiMatch,he as QtiMatchInteraction,ut as QtiMediaInteraction,Lr as QtiMember,tt as QtiModalFeedback,Hr as QtiMultiple,Pr as QtiNot,Nr as QtiOr,re as QtiOrderInteraction,Vr as QtiOrdered,z as QtiOutcomeDeclaration,st as QtiOutcomeProcessing,xr as QtiOutcomeProcessingProcessor,pe as QtiPortableCustomInteraction,ht as QtiPositionObjectStage,Dr as QtiProduct,Ht as QtiPrompt,qr as QtiResponseCondition,ee as QtiResponseDeclaration,ot as QtiResponseElse,Cr as QtiResponseElseIf,nt as QtiResponseIf,xe as QtiResponseProcessing,F as QtiRubricBlock,Y as QtiRule,Qt as QtiSPositionObjectInteraction,me as QtiSelectPointInteraction,Er as QtiSetOutcomeValue,wr as QtiSetOutcomeValueRule,ue as QtiSimpleAssociableChoice,Oe as QtiSimpleChoice,$ as QtiSliderInteraction,Jt as QtiStringMatch,Pt as QtiStylesheet,Or as QtiSum,Ir as QtiSumExpression,N as QtiTextEntryInteraction,Ur as QtiVariable,Lg as getAssessmentData,Mg as getItemByIndex,Hg as getItemByUri,U as itemContext,Ci as itemContextVariables,_s as qtiAndMixin,Je as qtiTransformItem,mr as qtiTransformManifest,Lt as qtiTransformTest};
590
2098
  /*! Bundled license information:
591
2099
 
592
2100
  @lit/context/lib/context-request-event.js: