@citolab/qti-components 6.5.3 → 6.5.5

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.cjs CHANGED
@@ -1,11 +1,11 @@
1
- var Me=Object.defineProperty,As=Object.defineProperties,Er=Object.getOwnPropertyDescriptor,qs=Object.getOwnPropertyDescriptors,$s=Object.getOwnPropertyNames,yr=Object.getOwnPropertySymbols;var _r=Object.prototype.hasOwnProperty,ws=Object.prototype.propertyIsEnumerable;var xr=(i,t,e)=>t in i?Me(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,x=(i,t)=>{for(var e in t||(t={}))_r.call(t,e)&&xr(i,e,t[e]);if(yr)for(var e of yr(t))ws.call(t,e)&&xr(i,e,t[e]);return i},R=(i,t)=>As(i,qs(t));var Ss=(i,t)=>{for(var e in t)Me(i,e,{get:t[e],enumerable:!0})},Rs=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $s(t))!_r.call(i,s)&&s!==e&&Me(i,s,{get:()=>t[s],enumerable:!(r=Er(t,s))||r.enumerable});return i};var ks=i=>Rs(Me({},"__esModule",{value:!0}),i),c=(i,t,e,r)=>{for(var s=r>1?void 0:r?Er(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&&Me(t,e,s),s};var li={};Ss(li,{Interaction:()=>$,QtPrintedVariable:()=>Se,QtiAnd:()=>et,QtiAssessmentItem:()=>M,QtiAssociableHotspot:()=>ht,QtiAssociateInteraction:()=>Re,QtiBaseValue:()=>tt,QtiChoice:()=>k,QtiChoiceInteraction:()=>he,QtiCompanionMaterialsInfo:()=>je,QtiConditionExpression:()=>V,QtiContains:()=>Ot,QtiCorrect:()=>Ut,QtiEndAttemptInteraction:()=>ge,QtiEqual:()=>st,QtiEqualRounded:()=>rt,QtiExpression:()=>v,QtiExtendedTextInteraction:()=>F,QtiFeedbackBlock:()=>Ke,QtiFeedbackInline:()=>We,QtiGap:()=>mt,QtiGapImg:()=>ft,QtiGapMatchInteraction:()=>nt,QtiGapText:()=>bt,QtiGraphicAssociateInteraction:()=>z,QtiGraphicGapMatchInteraction:()=>at,QtiGraphicOrderInteraction:()=>lt,QtiGt:()=>It,QtiGte:()=>Ft,QtiHotspotChoice:()=>Te,QtiHotspotInteraction:()=>ct,QtiHottext:()=>gt,QtiHottextInteraction:()=>Vt,QtiInlineChoice:()=>or,QtiInlineChoiceInteraction:()=>se,QtiIsNull:()=>Bt,QtiLookupOutcomeValue:()=>Qe,QtiLt:()=>Xt,QtiLte:()=>jt,QtiMapResponse:()=>it,QtiMapping:()=>me,QtiMatch:()=>zt,QtiMatchInteraction:()=>fe,QtiMediaInteraction:()=>pt,QtiMember:()=>Yt,QtiModalFeedback:()=>Je,QtiMultiple:()=>Kt,QtiNot:()=>Wt,QtiOr:()=>Jt,QtiOrderInteraction:()=>be,QtiOrdered:()=>Gt,QtiOutcomeDeclaration:()=>J,QtiPortableCustomInteraction:()=>tr,QtiPositionObjectStage:()=>ut,QtiProduct:()=>Zt,QtiPrompt:()=>Rt,QtiResponseCondition:()=>Ht,QtiResponseDeclaration:()=>G,QtiResponseElse:()=>$e,QtiResponseElseIf:()=>Dt,QtiResponseIf:()=>we,QtiResponseProcessing:()=>ie,QtiRule:()=>B,QtiSPositionObjectInteraction:()=>dt,QtiSelectPointInteraction:()=>oe,QtiSetOutcomeValue:()=>Nt,QtiSimpleAssociableChoice:()=>ir,QtiSimpleChoice:()=>Le,QtiSliderInteraction:()=>L,QtiStringMatch:()=>ot,QtiStylesheet:()=>kt,QtiSum:()=>Qt,QtiTextEntryInteraction:()=>N,QtiVariable:()=>er,itemContext:()=>W,qtiAndMixin:()=>fs,qtiContentBody:()=>ze,qtiRubricBlock:()=>U,qtiTransformItem:()=>ri,qtiTransformTest:()=>si});module.exports=ks(li);var ee=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 ye=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 ee(this.context,this.t,this.subscribe))}};var yt=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 nr=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}},xe=class extends yt{constructor(t,e,r){super(e.context!==void 0?e.initialValue:r),this.onContextRequest=s=>{let o=s.composedPath()[0];s.context===this.context&&o!==this.host&&(s.stopPropagation(),this.addCallback(s.callback,o,s.subscribe))},this.onProviderRequest=s=>{let o=s.composedPath()[0];if(s.context!==this.context||o===this.host)return;let n=new Set;for(let[a,{consumerHost:l}]of this.subscriptions)n.has(a)||(n.add(a),l.dispatchEvent(new ee(this.context,a,!0)));s.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new nr(this.context))}};function ar({context:i}){return(t,e)=>{let r=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){r.set(this,new xe(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 xe(n,{context:i}))});let s=Object.getOwnPropertyDescriptor(t,e),o;if(s===void 0){let n=new WeakMap;o={get:function(){return n.get(this)},set:function(a){r.get(this).setValue(a),n.set(this,a)}}}else{let n=s==null?void 0:s.set;o=R(x({},s),{set:function(a){var l;(l=r.get(this))==null||l.setValue(a),n==null||n.call(this,a)}})}return void Object.defineProperty(t,e,o)}}}function ne({context:i,subscribe:t}){return(e,r)=>{typeof r=="object"?r.addInitializer(function(){new ye(this,{context:i,callback:s=>{this[r.name]=s},subscribe:t})}):e.constructor.addInitializer(s=>{new ye(s,{context:i,callback:o=>{s[r]=o},subscribe:t})})}}var Cr=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 Ar=new WeakMap,Pe=i=>{let t=Ar.get(i);return t===void 0&&Ar.set(i,t=new Map),t},Ls=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(Pe(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}setAttribute(t,e){Pe(this).set(t,String(e))}removeAttribute(t){Pe(this).delete(t)}hasAttribute(t){return Pe(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 Cr(this);return this.__internals=t,t}getAttribute(t){let e=Pe(this).get(t);return e!=null?e:null}};var Ms=class extends Ls{},qr=Ms;var Ps=class{constructor(){this.__definitions=new Map}define(t,e){var r;if(this.__definitions.has(t))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${t}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
2
- Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${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}},Vs=Ps;var $r=new Vs;var Ve=globalThis,xt=Ve.ShadowRoot&&(Ve.ShadyCSS===void 0||Ve.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,lr=Symbol(),wr=new WeakMap,He=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==lr)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(xt&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=wr.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&wr.set(e,t))}return t}toString(){return this.cssText}},Sr=i=>new He(typeof i=="string"?i:i+"",void 0,lr),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 He(e,i,lr)},cr=(i,t)=>{if(xt)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),s=Ve.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=e.cssText,i.appendChild(r)}},Et=xt||Ve.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return Sr(e)})(i):i;var{is:Hs,defineProperty:Ns,getOwnPropertyDescriptor:Ds,getOwnPropertyNames:Os,getOwnPropertySymbols:Us,getPrototypeOf:Is}=Object,O=globalThis,Tr;(Tr=O.customElements)!=null||(O.customElements=$r);var Rr=O.trustedTypes,Fs=Rr?Rr.emptyScript:"",pr=O.reactiveElementPolyfillSupport,Ne=(i,t)=>i,De={toAttribute(i,t){switch(t){case Boolean:i=i?Fs: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}},_t=(i,t)=>!Hs(i,t),kr={attribute:!0,type:String,converter:De,reflect:!1,hasChanged:_t},Lr,Mr;(Lr=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(Mr=O.litPropertyMetadata)!=null||(O.litPropertyMetadata=new WeakMap);var Pr,Y=class extends((Pr=globalThis.HTMLElement)!=null?Pr:qr){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=kr){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&&Ns(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){var n;let{get:s,set:o}=(n=Ds(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 l=s==null?void 0:s.call(this);o.call(this,a),this.requestUpdate(t,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:kr}static _$Ei(){if(this.hasOwnProperty(Ne("elementProperties")))return;let t=Is(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ne("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ne("properties"))){let e=this.properties,r=[...Os(e),...Us(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(Et(s))}else t!==void 0&&e.push(Et(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._$Eg=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._$ES)!=null?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var e;(e=this._$ES)==null||e.splice(this._$ES.indexOf(t)>>>0,1)}_$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 cr(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)==null||e.forEach(r=>{var s;return(s=r.hostConnected)==null?void 0:s.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)==null||t.forEach(e=>{var r;return(r=e.hostDisconnected)==null?void 0:r.call(e)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EO(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:De).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:De;this._$Em=s,this[s]=a.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,r,s=!1,o){var n;if(t!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(t)),!((n=r.hasChanged)!=null?n:_t)(s?o:this[t],e))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(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 _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(let[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[o,n]of s)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.C(o,this[o],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(r=this._$ES)==null||r.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(e)):this._$ET()}catch(s){throw t=!1,this._$ET(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)==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)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EO(e,this[e]))),this._$ET()}updated(t){}firstUpdated(t){}},Vr;Y.elementStyles=[],Y.shadowRootOptions={mode:"open"},Y[Ne("elementProperties")]=new Map,Y[Ne("finalized")]=new Map,pr==null||pr({ReactiveElement:Y}),((Vr=O.reactiveElementVersions)!=null?Vr:O.reactiveElementVersions=[]).push("2.0.0");var Ee=globalThis,Ct=Ee.trustedTypes,Hr=Ct?Ct.createPolicy("lit-html",{createHTML:i=>i}):void 0,hr="$lit$",K=`lit$${(Math.random()+"").slice(9)}$`,mr="?"+K,Bs=`<${mr}>`,ce=Ee.document===void 0?{createTreeWalker:()=>({})}:document,Ue=()=>ce.createComment(""),Ie=i=>i===null||typeof i!="object"&&typeof i!="function",Br=Array.isArray,Xr=i=>Br(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",dr=`[
1
+ var Me=Object.defineProperty,As=Object.defineProperties,Er=Object.getOwnPropertyDescriptor,qs=Object.getOwnPropertyDescriptors,$s=Object.getOwnPropertyNames,yr=Object.getOwnPropertySymbols;var _r=Object.prototype.hasOwnProperty,ws=Object.prototype.propertyIsEnumerable;var xr=(i,t,e)=>t in i?Me(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,x=(i,t)=>{for(var e in t||(t={}))_r.call(t,e)&&xr(i,e,t[e]);if(yr)for(var e of yr(t))ws.call(t,e)&&xr(i,e,t[e]);return i},k=(i,t)=>As(i,qs(t));var Ss=(i,t)=>{for(var e in t)Me(i,e,{get:t[e],enumerable:!0})},ks=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $s(t))!_r.call(i,s)&&s!==e&&Me(i,s,{get:()=>t[s],enumerable:!(r=Er(t,s))||r.enumerable});return i};var Rs=i=>ks(Me({},"__esModule",{value:!0}),i),c=(i,t,e,r)=>{for(var s=r>1?void 0:r?Er(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&&Me(t,e,s),s};var li={};Ss(li,{Interaction:()=>$,QtPrintedVariable:()=>Se,QtiAnd:()=>et,QtiAssessmentItem:()=>M,QtiAssociableHotspot:()=>ht,QtiAssociateInteraction:()=>ke,QtiBaseValue:()=>tt,QtiChoice:()=>R,QtiChoiceInteraction:()=>he,QtiCompanionMaterialsInfo:()=>je,QtiConditionExpression:()=>V,QtiContains:()=>Ot,QtiCorrect:()=>Ut,QtiEndAttemptInteraction:()=>ge,QtiEqual:()=>st,QtiEqualRounded:()=>rt,QtiExpression:()=>v,QtiExtendedTextInteraction:()=>F,QtiFeedbackBlock:()=>Ke,QtiFeedbackInline:()=>We,QtiGap:()=>mt,QtiGapImg:()=>ft,QtiGapMatchInteraction:()=>nt,QtiGapText:()=>bt,QtiGraphicAssociateInteraction:()=>z,QtiGraphicGapMatchInteraction:()=>at,QtiGraphicOrderInteraction:()=>lt,QtiGt:()=>It,QtiGte:()=>Ft,QtiHotspotChoice:()=>Te,QtiHotspotInteraction:()=>ct,QtiHottext:()=>gt,QtiHottextInteraction:()=>Vt,QtiInlineChoice:()=>or,QtiInlineChoiceInteraction:()=>se,QtiIsNull:()=>Bt,QtiLookupOutcomeValue:()=>Qe,QtiLt:()=>Xt,QtiLte:()=>jt,QtiMapResponse:()=>it,QtiMapping:()=>me,QtiMatch:()=>zt,QtiMatchInteraction:()=>fe,QtiMediaInteraction:()=>pt,QtiMember:()=>Yt,QtiModalFeedback:()=>Je,QtiMultiple:()=>Kt,QtiNot:()=>Wt,QtiOr:()=>Jt,QtiOrderInteraction:()=>be,QtiOrdered:()=>Gt,QtiOutcomeDeclaration:()=>J,QtiPortableCustomInteraction:()=>tr,QtiPositionObjectStage:()=>ut,QtiProduct:()=>Zt,QtiPrompt:()=>kt,QtiResponseCondition:()=>Ht,QtiResponseDeclaration:()=>G,QtiResponseElse:()=>$e,QtiResponseElseIf:()=>Dt,QtiResponseIf:()=>we,QtiResponseProcessing:()=>ie,QtiRule:()=>B,QtiSPositionObjectInteraction:()=>dt,QtiSelectPointInteraction:()=>oe,QtiSetOutcomeValue:()=>Nt,QtiSimpleAssociableChoice:()=>ir,QtiSimpleChoice:()=>Le,QtiSliderInteraction:()=>L,QtiStringMatch:()=>ot,QtiStylesheet:()=>Rt,QtiSum:()=>Qt,QtiTextEntryInteraction:()=>N,QtiVariable:()=>er,itemContext:()=>W,qtiAndMixin:()=>fs,qtiContentBody:()=>ze,qtiRubricBlock:()=>U,qtiTransformItem:()=>ri,qtiTransformTest:()=>si});module.exports=Rs(li);var ee=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 ye=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 ee(this.context,this.t,this.subscribe))}};var yt=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 nr=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}},xe=class extends yt{constructor(t,e,r){super(e.context!==void 0?e.initialValue:r),this.onContextRequest=s=>{let o=s.composedPath()[0];s.context===this.context&&o!==this.host&&(s.stopPropagation(),this.addCallback(s.callback,o,s.subscribe))},this.onProviderRequest=s=>{let o=s.composedPath()[0];if(s.context!==this.context||o===this.host)return;let n=new Set;for(let[a,{consumerHost:l}]of this.subscriptions)n.has(a)||(n.add(a),l.dispatchEvent(new ee(this.context,a,!0)));s.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new nr(this.context))}};function ar({context:i}){return(t,e)=>{let r=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){r.set(this,new xe(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 xe(n,{context:i}))});let s=Object.getOwnPropertyDescriptor(t,e),o;if(s===void 0){let n=new WeakMap;o={get:function(){return n.get(this)},set:function(a){r.get(this).setValue(a),n.set(this,a)}}}else{let n=s==null?void 0:s.set;o=k(x({},s),{set:function(a){var l;(l=r.get(this))==null||l.setValue(a),n==null||n.call(this,a)}})}return void Object.defineProperty(t,e,o)}}}function ne({context:i,subscribe:t}){return(e,r)=>{typeof r=="object"?r.addInitializer(function(){new ye(this,{context:i,callback:s=>{this[r.name]=s},subscribe:t})}):e.constructor.addInitializer(s=>{new ye(s,{context:i,callback:o=>{s[r]=o},subscribe:t})})}}var Cr=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 Ar=new WeakMap,Pe=i=>{let t=Ar.get(i);return t===void 0&&Ar.set(i,t=new Map),t},Ls=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(Pe(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}setAttribute(t,e){Pe(this).set(t,String(e))}removeAttribute(t){Pe(this).delete(t)}hasAttribute(t){return Pe(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 Cr(this);return this.__internals=t,t}getAttribute(t){let e=Pe(this).get(t);return e!=null?e:null}};var Ms=class extends Ls{},qr=Ms;var Ps=class{constructor(){this.__definitions=new Map}define(t,e){var r;if(this.__definitions.has(t))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${t}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
2
+ Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${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}},Vs=Ps;var $r=new Vs;var Ve=globalThis,xt=Ve.ShadowRoot&&(Ve.ShadyCSS===void 0||Ve.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,lr=Symbol(),wr=new WeakMap,He=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==lr)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(xt&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=wr.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&wr.set(e,t))}return t}toString(){return this.cssText}},Sr=i=>new He(typeof i=="string"?i:i+"",void 0,lr),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 He(e,i,lr)},cr=(i,t)=>{if(xt)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),s=Ve.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=e.cssText,i.appendChild(r)}},Et=xt||Ve.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return Sr(e)})(i):i;var{is:Hs,defineProperty:Ns,getOwnPropertyDescriptor:Ds,getOwnPropertyNames:Os,getOwnPropertySymbols:Us,getPrototypeOf:Is}=Object,O=globalThis,Tr;(Tr=O.customElements)!=null||(O.customElements=$r);var kr=O.trustedTypes,Fs=kr?kr.emptyScript:"",pr=O.reactiveElementPolyfillSupport,Ne=(i,t)=>i,De={toAttribute(i,t){switch(t){case Boolean:i=i?Fs: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}},_t=(i,t)=>!Hs(i,t),Rr={attribute:!0,type:String,converter:De,reflect:!1,hasChanged:_t},Lr,Mr;(Lr=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(Mr=O.litPropertyMetadata)!=null||(O.litPropertyMetadata=new WeakMap);var Pr,Y=class extends((Pr=globalThis.HTMLElement)!=null?Pr:qr){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=Rr){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&&Ns(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){var n;let{get:s,set:o}=(n=Ds(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 l=s==null?void 0:s.call(this);o.call(this,a),this.requestUpdate(t,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:Rr}static _$Ei(){if(this.hasOwnProperty(Ne("elementProperties")))return;let t=Is(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ne("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ne("properties"))){let e=this.properties,r=[...Os(e),...Us(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(Et(s))}else t!==void 0&&e.push(Et(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._$Eg=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._$ES)!=null?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var e;(e=this._$ES)==null||e.splice(this._$ES.indexOf(t)>>>0,1)}_$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 cr(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)==null||e.forEach(r=>{var s;return(s=r.hostConnected)==null?void 0:s.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)==null||t.forEach(e=>{var r;return(r=e.hostDisconnected)==null?void 0:r.call(e)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EO(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:De).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:De;this._$Em=s,this[s]=a.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,r,s=!1,o){var n;if(t!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(t)),!((n=r.hasChanged)!=null?n:_t)(s?o:this[t],e))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(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 _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(let[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[o,n]of s)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.C(o,this[o],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(r=this._$ES)==null||r.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(e)):this._$ET()}catch(s){throw t=!1,this._$ET(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)==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)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EO(e,this[e]))),this._$ET()}updated(t){}firstUpdated(t){}},Vr;Y.elementStyles=[],Y.shadowRootOptions={mode:"open"},Y[Ne("elementProperties")]=new Map,Y[Ne("finalized")]=new Map,pr==null||pr({ReactiveElement:Y}),((Vr=O.reactiveElementVersions)!=null?Vr:O.reactiveElementVersions=[]).push("2.0.0");var Ee=globalThis,Ct=Ee.trustedTypes,Hr=Ct?Ct.createPolicy("lit-html",{createHTML:i=>i}):void 0,hr="$lit$",K=`lit$${(Math.random()+"").slice(9)}$`,mr="?"+K,Bs=`<${mr}>`,ce=Ee.document===void 0?{createTreeWalker:()=>({})}:document,Ue=()=>ce.createComment(""),Ie=i=>i===null||typeof i!="object"&&typeof i!="function",Br=Array.isArray,Xr=i=>Br(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",dr=`[
3
3
  \f\r]`,Oe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Nr=/-->/g,Dr=/>/g,ae=RegExp(`>|${dr}(?:([^\\s"'>=/]+)(${dr}*=${dr}*(?:[^
4
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Or=/'/g,Ur=/"/g,jr=/^(?:script|style|textarea|title)$/i,zr=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),d=zr(1),Be=zr(2),P=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),Ir=new WeakMap,le=ce.createTreeWalker(ce,129);function Yr(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Hr!==void 0?Hr.createHTML(t):t}var Kr=(i,t)=>{let e=i.length-1,r=[],s,o=t===2?"<svg>":"",n=Oe;for(let a=0;a<e;a++){let l=i[a],u,h,m=-1,y=0;for(;y<l.length&&(n.lastIndex=y,h=n.exec(l),h!==null);)y=n.lastIndex,n===Oe?h[1]==="!--"?n=Nr:h[1]!==void 0?n=Dr:h[2]!==void 0?(jr.test(h[2])&&(s=RegExp("</"+h[2],"g")),n=ae):h[3]!==void 0&&(n=ae):n===ae?h[0]===">"?(n=s!=null?s:Oe,m=-1):h[1]===void 0?m=-2:(m=n.lastIndex-h[2].length,u=h[1],n=h[3]===void 0?ae:h[3]==='"'?Ur:Or):n===Ur||n===Or?n=ae:n===Nr||n===Dr?n=Oe:(n=ae,s=void 0);let g=n===ae&&i[a+1].startsWith("/>")?" ":"";o+=n===Oe?l+Bs:m>=0?(r.push(u),l.slice(0,m)+hr+l.slice(m)+K+g):l+K+(m===-2?a:g)}return[Yr(i,o+(i[e]||"<?>")+(t===2?"</svg>":"")),r]},Fe=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let o=0,n=0,a=t.length-1,l=this.parts,[u,h]=Kr(t,e);if(this.el=i.createElement(u,r),le.currentNode=this.el.content,e===2){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(s=le.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let m of s.getAttributeNames())if(m.endsWith(hr)){let y=h[n++],g=s.getAttribute(m).split(K),q=/([.?@])?(.*)/.exec(y);l.push({type:1,index:o,name:q[2],strings:g,ctor:q[1]==="."?qt:q[1]==="?"?$t:q[1]==="@"?wt:de}),s.removeAttribute(m)}else m.startsWith(K)&&(l.push({type:6,index:o}),s.removeAttribute(m));if(jr.test(s.tagName)){let m=s.textContent.split(K),y=m.length-1;if(y>0){s.textContent=Ct?Ct.emptyScript:"";for(let g=0;g<y;g++)s.append(m[g],Ue()),le.nextNode(),l.push({type:2,index:++o});s.append(m[y],Ue())}}}else if(s.nodeType===8)if(s.data===mr)l.push({type:2,index:o});else{let m=-1;for(;(m=s.data.indexOf(K,m+1))!==-1;)l.push({type:7,index:o}),m+=K.length-1}o++}}static createElement(t,e){let r=ce.createElement("template");return r.innerHTML=t,r}};function pe(i,t,e=i,r){var n,a,l;if(t===P)return t;let s=r!==void 0?(n=e._$Co)==null?void 0:n[r]:e._$Cl,o=Ie(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?((l=e._$Co)!=null?l:e._$Co=[])[r]=s:e._$Cl=s),s!==void 0&&(t=pe(i,s._$AS(i,t.values),s,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 u;let{el:{content:e},parts:r}=this._$AD,s=((u=t==null?void 0:t.creationScope)!=null?u:ce).importNode(e,!0);le.currentNode=s;let o=le.nextNode(),n=0,a=0,l=r[0];for(;l!==void 0;){if(n===l.index){let h;l.type===2?h=new _e(o,o.nextSibling,this,t):l.type===1?h=new l.ctor(o,l.name,l.strings,this,t):l.type===6&&(h=new St(o,this,t)),this._$AV.push(h),l=r[++a]}n!==(l==null?void 0:l.index)&&(o=le.nextNode(),n++)}return le.currentNode=ce,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++}},_e=class i{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this._$Cv}constructor(t,e,r,s){var o;this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=(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=pe(this,t,e),Ie(t)?t===E||t==null||t===""?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Xr(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==E&&Ie(this._$AH)?this._$AA.nextSibling.data=t:this.$(ce.createTextNode(t)),this._$AH=t}g(t){var o;let{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Fe.createElement(Yr(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 At(s,this),a=n.u(this.options);n.p(e),this.$(a),this._$AH=n}}_$AC(t){let e=Ir.get(t.strings);return e===void 0&&Ir.set(t.strings,e=new Fe(t)),e}T(t){Br(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.k(Ue()),this.k(Ue()),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._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},de=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,o){this.type=1,this._$AH=E,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=E}_$AI(t,e=this,r,s){let o=this.strings,n=!1;if(o===void 0)t=pe(this,t,e,0),n=!Ie(t)||t!==this._$AH&&t!==P,n&&(this._$AH=t);else{let a=t,l,u;for(t=o[0],l=0;l<o.length-1;l++)u=pe(this,a[r+l],e,l),u===P&&(u=this._$AH[l]),n||(n=!Ie(u)||u!==this._$AH[l]),u===E?t=E:t!==E&&(t+=(u!=null?u:"")+o[l+1]),this._$AH[l]=u}n&&!s&&this.j(t)}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},qt=class extends de{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E?void 0:t}},$t=class extends de{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}},wt=class extends de{constructor(t,e,r,s,o){super(t,e,r,s,o),this.type=5}_$AI(t,e=this){var n;if((t=(n=pe(this,t,e,0))!=null?n:E)===P)return;let r=this._$AH,s=t===E&&r!==E||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==E&&(r===E||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)}},St=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){pe(this,t)}},Wr={S:hr,A:K,P:mr,C:1,M:Kr,L:At,R:Xr,V:pe,D:_e,I:de,H:$t,N:wt,U:qt,B:St},ur=Ee.litHtmlPolyfillSupport,Fr;ur==null||ur(Fe,_e),((Fr=Ee.litHtmlVersions)!=null?Fr:Ee.litHtmlVersions=[]).push("3.0.0");var Jr=(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 _e(t.insertBefore(Ue(),a),a,void 0,e!=null?e:{})}return s._$AI(i),s};var f=class extends Y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=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._$Do=Jr(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return P}},Gr;f._$litElement$=!0,f["finalized"]=!0,(Gr=globalThis.litElementHydrateSupport)==null||Gr.call(globalThis,{LitElement:f});var fr=globalThis.litElementPolyfillSupport;fr==null||fr({LitElement:f});var Zr;((Zr=globalThis.litElementVersions)!=null?Zr:globalThis.litElementVersions=[]).push("4.0.0");var C=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};var Xs={attribute:!0,type:String,converter:De,reflect:!1,hasChanged:_t},js=(i=Xs,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 l=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,l,i)},init(a){return a!==void 0&&this.C(n,void 0,i),a}}}if(r==="setter"){let{name:n}=e;return function(a){let l=this[n];t.call(this,a),this.requestUpdate(n,l,i)}}throw Error("Unsupported decorator location: "+r)};function p(i){return(t,e)=>typeof e=="object"?js(i,t,e):((r,s,o)=>{let n=s.hasOwnProperty(o);return s.constructor.createProperty(o,n?R(x({},r),{wrapped:!0}):r),n?Object.getOwnPropertyDescriptor(s,o):void 0})(i,t,e)}function A(i){return p(R(x({},i),{state:!0,attribute:!1}))}var te=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(i,t,e),e);function Xe(i,t){return(e,r,s)=>{let o=n=>{var a,l;return(l=(a=n.renderRoot)==null?void 0:a.querySelector(i))!=null?l:null};if(t){let{get:n,set:a}=typeof r=="object"?e:s!=null?s:(()=>{let l=Symbol();return{get(){return this[l]},set(u){this[l]=u}}})();return te(e,r,{get(){if(t){let l=n.call(this);return l===void 0&&(l=o(this),a.call(this,l)),l}return o(this)}})}return te(e,r,{get(){return o(this)}})}}function Qr(i){return(t,e)=>{let{slot:r,selector:s}=i!=null?i:{},o="slot"+(r?`[name=${r}]`:":not([name])");return te(t,e,{get(){var l,u;let n=(l=this.renderRoot)==null?void 0:l.querySelector(o),a=(u=n==null?void 0:n.assignedElements(i))!=null?u:[];return s===void 0?a:a.filter(h=>h.matches(s))}})}}function w(i,t){let e=x({waitUntilFirstUpdate:!1},t);return(r,s)=>{let{update:o}=r,n=Array.isArray(i)?i:[i];r.update=function(a){n.forEach(l=>{let u=l;if(a.has(u)){let h=a.get(u),m=this[u];h!==m&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[s](h,m)}}),o.call(this,a)}}}var W="item";var M=class extends f{constructor(){super();this.identifier="";this.adaptive="false";this.timeDependent="false";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:[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}]};this._initialContext=R(x({},this._context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];this.addEventListener("qti-register-variable",({detail:e})=>{this._context=R(x({},this._context),{variables:[...this._context.variables,e.variable]}),this._initialContext=this._context}),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)}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}get variables(){return this._context.variables.map(e=>({identifier:e.identifier,value:e.value,type:e.type}))}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=R(x({},this._context),{variables:this._context.variables.map(r=>{let s=e.find(o=>o.identifier===r.identifier);return s?x(x({},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))})}firstUpdated(e){super.firstUpdated(e),this._emit("qti-item-first-updated",this)}disconnectedCallback(){super.disconnectedCallback(),this._emit("qti-item-disconnected")}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 d`<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?(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):(console.info("Client side response webcomponents not available"),!1):(console.info("Client side response processing template not available"),!1)}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=R(x({},this._context),{variables:this._context.variables.map(s=>s.identifier!==e?s:R(x({},s),{value:r}))}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:e,response:r})}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=R(x({},this._context),{variables:this._context.variables.map(n=>n.identifier!==e?n:R(x({},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}))}};c([p({type:String})],M.prototype,"title",2),c([p({type:String})],M.prototype,"identifier",2),c([p({type:String})],M.prototype,"adaptive",2),c([p({type:String})],M.prototype,"timeDependent",2),c([p({type:Boolean})],M.prototype,"disabled",2),c([w("disabled",{waitUntilFirstUpdate:!0})],M.prototype,"_handleDisabledChange",2),c([p({type:Boolean})],M.prototype,"readonly",2),c([w("readonly",{waitUntilFirstUpdate:!0})],M.prototype,"_handleReadonlyChange",2),c([ar({context:W}),p({attribute:!1})],M.prototype,"_context",2),M=c([C("qti-assessment-item")],M);var zs=Symbol.for(""),Ys=i=>{if((i==null?void 0:i.r)===zs)return i==null?void 0:i._$litStatic$};var es=new Map,ts=i=>(t,...e)=>{let r=e.length,s,o,n=[],a=[],l,u=0,h=!1;for(;u<r;){for(l=t[u];u<r&&(o=e[u],(s=Ys(o))!==void 0);)l+=s+t[++u],h=!0;u!==r&&a.push(o),n.push(l),u++}if(u===r&&n.push(t[r]),h){let m=n.join("$$lit$$");(t=es.get(m))===void 0&&(n.raw=n,es.set(m,t=n)),e=a}return i(t,...e)},rs=ts(d),an=ts(Be);var Ks={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 Ks.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}})))}validateAllProps(){return!!this.getAttribute("identifier")}render(){return this.validateAllProps()||console.warn(`Invalid props for ${this.outerHTML}`,"missing identifier"),rs` <slot></slot> `}};c([p({type:String})],k.prototype,"identifier",2),c([p({type:Number,reflect:!0})],k.prototype,"tabindex",2),c([p({reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:i=>i}})],k.prototype,"disabled",2),c([p({reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:i=>i}})],k.prototype,"readonly",2),c([p({reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:i=>i}})],k.prototype,"checked",2),c([w("disabled",{waitUntilFirstUpdate:!0})],k.prototype,"handleDisabledChange",1);var ss=b`
4
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Or=/'/g,Ur=/"/g,jr=/^(?:script|style|textarea|title)$/i,zr=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),d=zr(1),Be=zr(2),P=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),Ir=new WeakMap,le=ce.createTreeWalker(ce,129);function Yr(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Hr!==void 0?Hr.createHTML(t):t}var Kr=(i,t)=>{let e=i.length-1,r=[],s,o=t===2?"<svg>":"",n=Oe;for(let a=0;a<e;a++){let l=i[a],u,h,m=-1,y=0;for(;y<l.length&&(n.lastIndex=y,h=n.exec(l),h!==null);)y=n.lastIndex,n===Oe?h[1]==="!--"?n=Nr:h[1]!==void 0?n=Dr:h[2]!==void 0?(jr.test(h[2])&&(s=RegExp("</"+h[2],"g")),n=ae):h[3]!==void 0&&(n=ae):n===ae?h[0]===">"?(n=s!=null?s:Oe,m=-1):h[1]===void 0?m=-2:(m=n.lastIndex-h[2].length,u=h[1],n=h[3]===void 0?ae:h[3]==='"'?Ur:Or):n===Ur||n===Or?n=ae:n===Nr||n===Dr?n=Oe:(n=ae,s=void 0);let g=n===ae&&i[a+1].startsWith("/>")?" ":"";o+=n===Oe?l+Bs:m>=0?(r.push(u),l.slice(0,m)+hr+l.slice(m)+K+g):l+K+(m===-2?a:g)}return[Yr(i,o+(i[e]||"<?>")+(t===2?"</svg>":"")),r]},Fe=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let o=0,n=0,a=t.length-1,l=this.parts,[u,h]=Kr(t,e);if(this.el=i.createElement(u,r),le.currentNode=this.el.content,e===2){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(s=le.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let m of s.getAttributeNames())if(m.endsWith(hr)){let y=h[n++],g=s.getAttribute(m).split(K),q=/([.?@])?(.*)/.exec(y);l.push({type:1,index:o,name:q[2],strings:g,ctor:q[1]==="."?qt:q[1]==="?"?$t:q[1]==="@"?wt:de}),s.removeAttribute(m)}else m.startsWith(K)&&(l.push({type:6,index:o}),s.removeAttribute(m));if(jr.test(s.tagName)){let m=s.textContent.split(K),y=m.length-1;if(y>0){s.textContent=Ct?Ct.emptyScript:"";for(let g=0;g<y;g++)s.append(m[g],Ue()),le.nextNode(),l.push({type:2,index:++o});s.append(m[y],Ue())}}}else if(s.nodeType===8)if(s.data===mr)l.push({type:2,index:o});else{let m=-1;for(;(m=s.data.indexOf(K,m+1))!==-1;)l.push({type:7,index:o}),m+=K.length-1}o++}}static createElement(t,e){let r=ce.createElement("template");return r.innerHTML=t,r}};function pe(i,t,e=i,r){var n,a,l;if(t===P)return t;let s=r!==void 0?(n=e._$Co)==null?void 0:n[r]:e._$Cl,o=Ie(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?((l=e._$Co)!=null?l:e._$Co=[])[r]=s:e._$Cl=s),s!==void 0&&(t=pe(i,s._$AS(i,t.values),s,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 u;let{el:{content:e},parts:r}=this._$AD,s=((u=t==null?void 0:t.creationScope)!=null?u:ce).importNode(e,!0);le.currentNode=s;let o=le.nextNode(),n=0,a=0,l=r[0];for(;l!==void 0;){if(n===l.index){let h;l.type===2?h=new _e(o,o.nextSibling,this,t):l.type===1?h=new l.ctor(o,l.name,l.strings,this,t):l.type===6&&(h=new St(o,this,t)),this._$AV.push(h),l=r[++a]}n!==(l==null?void 0:l.index)&&(o=le.nextNode(),n++)}return le.currentNode=ce,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++}},_e=class i{get _$AU(){var t,e;return(e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this._$Cv}constructor(t,e,r,s){var o;this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=(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=pe(this,t,e),Ie(t)?t===E||t==null||t===""?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Xr(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==E&&Ie(this._$AH)?this._$AA.nextSibling.data=t:this.$(ce.createTextNode(t)),this._$AH=t}g(t){var o;let{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Fe.createElement(Yr(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 At(s,this),a=n.u(this.options);n.p(e),this.$(a),this._$AH=n}}_$AC(t){let e=Ir.get(t.strings);return e===void 0&&Ir.set(t.strings,e=new Fe(t)),e}T(t){Br(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.k(Ue()),this.k(Ue()),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._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},de=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,o){this.type=1,this._$AH=E,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=E}_$AI(t,e=this,r,s){let o=this.strings,n=!1;if(o===void 0)t=pe(this,t,e,0),n=!Ie(t)||t!==this._$AH&&t!==P,n&&(this._$AH=t);else{let a=t,l,u;for(t=o[0],l=0;l<o.length-1;l++)u=pe(this,a[r+l],e,l),u===P&&(u=this._$AH[l]),n||(n=!Ie(u)||u!==this._$AH[l]),u===E?t=E:t!==E&&(t+=(u!=null?u:"")+o[l+1]),this._$AH[l]=u}n&&!s&&this.j(t)}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},qt=class extends de{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E?void 0:t}},$t=class extends de{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}},wt=class extends de{constructor(t,e,r,s,o){super(t,e,r,s,o),this.type=5}_$AI(t,e=this){var n;if((t=(n=pe(this,t,e,0))!=null?n:E)===P)return;let r=this._$AH,s=t===E&&r!==E||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==E&&(r===E||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)}},St=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){pe(this,t)}},Wr={S:hr,A:K,P:mr,C:1,M:Kr,L:At,R:Xr,V:pe,D:_e,I:de,H:$t,N:wt,U:qt,B:St},ur=Ee.litHtmlPolyfillSupport,Fr;ur==null||ur(Fe,_e),((Fr=Ee.litHtmlVersions)!=null?Fr:Ee.litHtmlVersions=[]).push("3.0.0");var Jr=(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 _e(t.insertBefore(Ue(),a),a,void 0,e!=null?e:{})}return s._$AI(i),s};var f=class extends Y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=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._$Do=Jr(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return P}},Gr;f._$litElement$=!0,f["finalized"]=!0,(Gr=globalThis.litElementHydrateSupport)==null||Gr.call(globalThis,{LitElement:f});var fr=globalThis.litElementPolyfillSupport;fr==null||fr({LitElement:f});var Zr;((Zr=globalThis.litElementVersions)!=null?Zr:globalThis.litElementVersions=[]).push("4.0.0");var C=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};var Xs={attribute:!0,type:String,converter:De,reflect:!1,hasChanged:_t},js=(i=Xs,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 l=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,l,i)},init(a){return a!==void 0&&this.C(n,void 0,i),a}}}if(r==="setter"){let{name:n}=e;return function(a){let l=this[n];t.call(this,a),this.requestUpdate(n,l,i)}}throw Error("Unsupported decorator location: "+r)};function p(i){return(t,e)=>typeof e=="object"?js(i,t,e):((r,s,o)=>{let n=s.hasOwnProperty(o);return s.constructor.createProperty(o,n?k(x({},r),{wrapped:!0}):r),n?Object.getOwnPropertyDescriptor(s,o):void 0})(i,t,e)}function A(i){return p(k(x({},i),{state:!0,attribute:!1}))}var te=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(i,t,e),e);function Xe(i,t){return(e,r,s)=>{let o=n=>{var a,l;return(l=(a=n.renderRoot)==null?void 0:a.querySelector(i))!=null?l:null};if(t){let{get:n,set:a}=typeof r=="object"?e:s!=null?s:(()=>{let l=Symbol();return{get(){return this[l]},set(u){this[l]=u}}})();return te(e,r,{get(){if(t){let l=n.call(this);return l===void 0&&(l=o(this),a.call(this,l)),l}return o(this)}})}return te(e,r,{get(){return o(this)}})}}function Qr(i){return(t,e)=>{let{slot:r,selector:s}=i!=null?i:{},o="slot"+(r?`[name=${r}]`:":not([name])");return te(t,e,{get(){var l,u;let n=(l=this.renderRoot)==null?void 0:l.querySelector(o),a=(u=n==null?void 0:n.assignedElements(i))!=null?u:[];return s===void 0?a:a.filter(h=>h.matches(s))}})}}function w(i,t){let e=x({waitUntilFirstUpdate:!1},t);return(r,s)=>{let{update:o}=r,n=Array.isArray(i)?i:[i];r.update=function(a){n.forEach(l=>{let u=l;if(a.has(u)){let h=a.get(u),m=this[u];h!==m&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[s](h,m)}}),o.call(this,a)}}}var W="item";var M=class extends f{constructor(){super();this.identifier="";this.adaptive="false";this.timeDependent="false";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:[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}]};this._initialContext=k(x({},this._context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];this.addEventListener("qti-register-variable",({detail:e})=>{this._context=k(x({},this._context),{variables:[...this._context.variables,e.variable]}),this._initialContext=this._context}),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)}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}get variables(){return this._context.variables.map(e=>({identifier:e.identifier,value:e.value,type:e.type}))}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=k(x({},this._context),{variables:this._context.variables.map(r=>{let s=e.find(o=>o.identifier===r.identifier);return s?x(x({},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))})}firstUpdated(e){super.firstUpdated(e),this._emit("qti-item-first-updated",this)}disconnectedCallback(){super.disconnectedCallback(),this._emit("qti-item-disconnected")}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 d`<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?(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):(console.info("Client side response webcomponents not available"),!1):(console.info("Client side response processing template not available"),!1)}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=k(x({},this._context),{variables:this._context.variables.map(s=>s.identifier!==e?s:k(x({},s),{value:r}))}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:e,response:r})}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=k(x({},this._context),{variables:this._context.variables.map(n=>n.identifier!==e?n:k(x({},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}))}};c([p({type:String})],M.prototype,"title",2),c([p({type:String})],M.prototype,"identifier",2),c([p({type:String})],M.prototype,"adaptive",2),c([p({type:String})],M.prototype,"timeDependent",2),c([p({type:Boolean})],M.prototype,"disabled",2),c([w("disabled",{waitUntilFirstUpdate:!0})],M.prototype,"_handleDisabledChange",2),c([p({type:Boolean})],M.prototype,"readonly",2),c([w("readonly",{waitUntilFirstUpdate:!0})],M.prototype,"_handleReadonlyChange",2),c([ar({context:W}),p({attribute:!1})],M.prototype,"_context",2),M=c([C("qti-assessment-item")],M);var zs=Symbol.for(""),Ys=i=>{if((i==null?void 0:i.r)===zs)return i==null?void 0:i._$litStatic$};var es=new Map,ts=i=>(t,...e)=>{let r=e.length,s,o,n=[],a=[],l,u=0,h=!1;for(;u<r;){for(l=t[u];u<r&&(o=e[u],(s=Ys(o))!==void 0);)l+=s+t[++u],h=!0;u!==r&&a.push(o),n.push(l),u++}if(u===r&&n.push(t[r]),h){let m=n.join("$$lit$$");(t=es.get(m))===void 0&&(n.raw=n,es.set(m,t=n)),e=a}return i(t,...e)},rs=ts(d),an=ts(Be);var Ks={SPACE:32},R=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 Ks.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}})))}validateAllProps(){return!!this.getAttribute("identifier")}render(){return this.validateAllProps()||console.warn(`Invalid props for ${this.outerHTML}`,"missing identifier"),rs` <slot></slot> `}};c([p({type:String})],R.prototype,"identifier",2),c([p({type:Number,reflect:!0})],R.prototype,"tabindex",2),c([p({reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:i=>i}})],R.prototype,"disabled",2),c([p({reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:i=>i}})],R.prototype,"readonly",2),c([p({reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:i=>i}})],R.prototype,"checked",2),c([w("disabled",{waitUntilFirstUpdate:!0})],R.prototype,"handleDisabledChange",1);var ss=b`
5
5
  :host {
6
6
  display: block;
7
7
  }
8
- `;var Ce=class extends f{render(){return d`<slot name="qti-rubric-block"></slot><slot></slot>`}};Ce.styles=ss,Ce=c([C("qti-item-body")],Ce);var Rt=class extends f{render(){return d`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};customElements.define("qti-prompt",Rt);var kt=class extends f{constructor(){super()}firstUpdated(e){super.firstUpdated(e);let r=this.closest("qti-assessment-item"),s=this.getAttribute("href");if(s!==null){let o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.media="screen",o.href=s,r.appendChild(o),this.styleLink=o}if(this.textContent!==null){let o=document.createElement("style");o.media="screen",o.textContent=this.textContent,r.appendChild(o),this.styleLink=o}}disconnectedCallback(){let e=this.closest("qti-assessment-item");if(this.styleLink&&this.styleLink.parentElement===this)try{e.removeChild(this.styleLink)}catch(r){console.log("could not remove stylesheet")}}};customElements.define("qti-stylesheet",kt);var ue=class extends f{render(){return d`<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]}};customElements.define("qti-variabledeclaration",ue);var J=class extends ue{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 d`${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};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}};J.styles=[b`
8
+ `;var Ce=class extends f{render(){return d`<slot name="qti-rubric-block"></slot><slot></slot>`}};Ce.styles=ss,Ce=c([C("qti-item-body")],Ce);var kt=class extends f{render(){return d`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};customElements.define("qti-prompt",kt);var Rt=class extends f{constructor(){super()}firstUpdated(e){super.firstUpdated(e);let r=this.closest("qti-assessment-item"),s=this.getAttribute("href");if(s!==null){let o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.media="screen",o.href=s,r.appendChild(o),this.styleLink=o}if(this.textContent!==null){let o=document.createElement("style");o.media="screen",o.textContent=this.textContent,r.appendChild(o),this.styleLink=o}}disconnectedCallback(){let e=this.closest("qti-assessment-item");if(this.styleLink&&this.styleLink.parentElement===this)try{e.removeChild(this.styleLink)}catch(r){console.log("could not remove stylesheet")}}};customElements.define("qti-stylesheet",Rt);var ue=class extends f{render(){return d`<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]}};customElements.define("qti-variabledeclaration",ue);var J=class extends ue{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 d`${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};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}};J.styles=[b`
9
9
  :host {
10
10
  display: none;
11
11
  }
@@ -98,7 +98,7 @@ Make sure to test your application with a production build as repeat registratio
98
98
  </select>
99
99
 
100
100
  ${qe(this.correctOption)}
101
- `}firstUpdated(e){super.firstUpdated(e),this.addEventListener("on-dropdown-selected",this.choiceSelected);let r=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1},...r.map(s=>({textContent:s.innerHTML,value:s.getAttribute("identifier"),selected:!1}))]}validate(){let e=this.options.find(r=>r.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,r)=>R(x({},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}console.log("correctResponse",e),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=>R(x({},s),{selected:s.value===r})),this.saveResponse(r)}};se.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"],c([A()],se.prototype,"options",2),c([A()],se.prototype,"correctOption",2),c([p({attribute:"data-prompt",type:String})],se.prototype,"dataPrompt",2);customElements.define("qti-inline-choice-interaction",se);var ds=b`
101
+ `}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)=>k(x({},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}console.log("correctResponse",e),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=>k(x({},s),{selected:s.value===r})),this.saveResponse(r)}};se.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"],c([A()],se.prototype,"options",2),c([A()],se.prototype,"correctOption",2),c([p({attribute:"data-prompt",type:String})],se.prototype,"dataPrompt",2);customElements.define("qti-inline-choice-interaction",se);var ds=b`
102
102
  :host {
103
103
  display: flex;
104
104
  flex-direction: column;
@@ -153,11 +153,11 @@ Make sure to test your application with a production build as repeat registratio
153
153
  </qti-set-outcome-value>
154
154
  </qti-response-else>
155
155
  </qti-response-condition>
156
- </qti-response-processing>`;var ie=class extends f{render(){return d`<slot></slot>`}static get observedAttributes(){return["identifier"]}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(hs).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(ms).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(us).firstElementChild.firstElementChild);break}}}fragmentFromString(t){return document.createRange().createContextualFragment(t)}};ie.styles=[b`
156
+ </qti-response-processing>`;var ie=class extends f{render(){return d`<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(hs).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString(ms).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(us).firstElementChild.firstElementChild);break}}}fragmentFromString(t){return document.createRange().createContextualFragment(t)}};ie.styles=[b`
157
157
  :host {
158
158
  display: none;
159
159
  }
160
- `],ie=c([C("qti-response-processing")],ie);var B=class extends f{render(){return d`<slot></slot>`}process(){throw new Error("Not implemented")}};B=c([C("qti-rule")],B);var Qe=class extends B{get childExpression(){return this.firstElementChild}process(){let e=this.getAttribute("identifier"),r=this.closest("qti-assessment-item").getVariable(e),s;return r.interpolationTable&&(s=r.interpolationTable.get(parseInt(this.childExpression.calculate()))),s?(this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:this.identifier,value:Ye(s)}})),s):(console.warn("lookupOutcomeValue: value is null or undefined"),0)}};c([p({type:String})],Qe.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",Qe);var Ht=class extends B{render(){return d`<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",Ht);var Nt=class extends B{process(){let t=this.getAttribute("identifier"),e=this.firstElementChild,r=e?e.calculate():null;if(r==null){console.warn("setOutcomeValue: value is null or undefined");return}this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:Array.isArray(r)?r.map(s=>Ye(s)):Ye(r)}}))}};customElements.define("qti-set-outcome-value",Nt);var $e=class extends f{render(){return d`<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",$e);var we=class extends $e{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",we);var Dt=class extends we{render(){return d`${super.render()}`}};customElements.define("qti-response-else-if",Dt);var v=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 d`<pre>${JSON.stringify(this.result,null,2)}</pre>
160
+ `],ie=c([C("qti-response-processing")],ie);var B=class extends f{render(){return d`<slot></slot>`}process(){throw new Error("Not implemented")}};B=c([C("qti-rule")],B);var Qe=class extends B{get childExpression(){return this.firstElementChild}process(){let e=this.getAttribute("identifier"),r=this.closest("qti-assessment-item").getVariable(e),s;return r.interpolationTable&&(s=r.interpolationTable.get(parseInt(this.childExpression.calculate()))),s==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(s)}})),s)}};c([p({type:String})],Qe.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",Qe);var Ht=class extends B{render(){return d`<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",Ht);var Nt=class extends B{process(){let t=this.getAttribute("identifier"),e=this.firstElementChild,r=e?e.calculate():null;if(r==null){console.warn("setOutcomeValue: value is null or undefined");return}this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:t,value:Array.isArray(r)?r.map(s=>Ye(s)):Ye(r)}}))}};customElements.define("qti-set-outcome-value",Nt);var $e=class extends f{render(){return d`<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",$e);var we=class extends $e{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",we);var Dt=class extends we{render(){return d`${super.render()}`}};customElements.define("qti-response-else-if",Dt);var v=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 d`<pre>${JSON.stringify(this.result,null,2)}</pre>
161
161
  <slot></slot>`}calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}get assessmentItem(){return this.closest("qti-assessment-item")}};v.styles=b`
162
162
  slot {
163
163
  display: none;
@@ -165,12 +165,12 @@ Make sure to test your application with a production build as repeat registratio
165
165
  `,c([A()],v.prototype,"result",2);var V=class extends v{calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};var et=class extends fs(V){calculate(){return this.calculateChildren(Array.from(this.children))}};function fs(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",et);var tt=class extends v{constructor(){super(...arguments);this.baseType="string"}getResult(){return this.textContent}};c([p({type:String,attribute:"base-type"})],tt.prototype,"baseType",2);customElements.define("qti-base-value",tt);var Ot=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 s=e.value,o=r.value;return s.filter(l=>o.includes(l)).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",Ot);var Ut=class extends v{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",Ut);var rt=class extends v{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}};c([p({type:String})],rt.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",rt);var D=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 st=class extends v{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):D.compareSingleValues(r.value,s.value,r.baseType)}return console.error("unexpected number of children in qti-equal"),null}};c([p({type:String})],st.prototype,"toleranceMode",2);customElements.define("qti-equal",st);var It=class extends v{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",It);var Ft=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",Ft);var Bt=class extends v{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",Bt);var Xt=class extends v{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",Xt);var jt=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",jt);var it=class extends v{getResult(){let e=this.assessmentItem.getResponse(this.identifier);if(!e)return console.warn(`Response ${this.identifier} can not be found`),null;let r=e.mapping,s=Array.isArray(e.value)?e.value:[e.value],o=0;for(let n of s){let a=r.mapEntries.find(l=>D.compareSingleValues(l.mapKey,n,e.baseType));a==null||a.mappedValue==null?o+=r.defaultValue:o+=a.mappedValue}return r.lowerBound!=null&&(o=Math.max(r.lowerBound,o)),r.upperBound!=null&&(o=Math.min(r.upperBound,o)),o}};c([p({type:String})],it.prototype,"identifier",2);customElements.define("qti-map-response",it);var me=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")}))}};c([p({attribute:"default-value",type:Number})],me.prototype,"defaultValue",2),c([p({attribute:"lower-bound",type:Number})],me.prototype,"lowerBound",2),c([p({attribute:"upper-bound",type:Number})],me.prototype,"upperBound",2);customElements.define("qti-mapping",me);var zt=class i extends v{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;if(e.cardinality==="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);{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){if(e.cardinality==="ordered"){let n=t[s];if(!D.compareSingleValues(o,n,e.baseType))return!1}else{let n=null;for(let a of t.value)if(D.compareSingleValues(o,a,e.baseType)){n=a;break}if(n!==null)t.value.splice(t.value.indexOf(n),1);else return!1}s++}return!0}}};customElements.define("qti-match",zt);var Yt=class extends v{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",Yt);var Kt=class extends v{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",Kt);var Wt=class extends v{render(){return d`${super.render()}`}getResult(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",Wt);var Jt=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 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",Jt);var Gt=class extends v{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",Gt);var Se=class extends f{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 d`${JSON.stringify(e,null,2)}`}calculate(){let e=this.closest("qti-assessment-item"),r=this.identifier;return e.getVariable(r).value}};c([p({type:String})],Se.prototype,"identifier",2),c([ne({context:W,subscribe:!0}),A()],Se.prototype,"itemContext",2);customElements.define("qti-printed-variable",Se);var Zt=class extends v{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",Zt);var ot=class extends v{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 D.compareSingleValues(o,n,r.baseType)}return console.error("unexpected number of children in qti-string-match"),null}};c([p({type:String,attribute:"case-sensitive"})],ot.prototype,"caseSensitive",2);customElements.define("qti-string-match",ot);var Qt=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 s=r.calculate();return Number.isNaN(s)?(console.error("unexpected value in qti-sum, expected number"),null):Number(s)}).reduce((e,r)=>e+r,0)}};customElements.define("qti-sum",Qt);var er=class extends v{getResult(){let t=this.getAttribute("identifier");return this.closest("qti-assessment-item").getVariable(t).value}};customElements.define("qti-variable",er);var tr=class extends f{constructor(){super(...arguments);this._errorMessage=null}static get properties(){return{responseIdentifier:{type:String,attribute:"response-identifier"},module:{type:String,attribute:"module"},customInteractionTypeIdentifier:{type:String,attribute:"custom-interaction-type-identifier"},baseUrl:{type:String,attribute:"base-url"},_errorMessage:{type:String,state:!0}}}getTAOConfig(e){let r=e.querySelectorAll("properties"),s={},o=a=>{let l={},u=a.getAttribute("key");if(u){let h=Array.from(a.children),m=h.map(g=>g.getAttribute("key"));m.length>0&&!m.find(g=>!Number.isInteger(+g))?l[u]=h.map(g=>n(g)):l[u]=a.textContent}return l},n=a=>{if(a){let l={};for(let u of a.children)l=x(x({},l),o(u));return l}};for(let a of r)return a.getAttribute("key")||(s=x(x({},s),n(a))),s;console.log("Can not find qti-custom-interaction config")}register(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}: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 l=document.createElement("link");l.rel="stylesheet",l.type="text/css",l.media="screen",l.href=a,s.appendChild(l)})}connectedCallback(){super.connectedCallback();let e={context:this.customInteractionTypeIdentifier,baseUrl:this.baseUrl,catchError:!0};if(window.requirePaths&&window.requireShim&&(e.paths=window.requirePaths,e.shim=window.requireShim),!globalThis.require){this._errorMessage="requirejs not found, load with cdn: https://cdnjs.com/libraries/require.js";return}requirejs.config(e)(["require"],s=>{!s.defined("qtiCustomInteractionContext")&&define("qtiCustomInteractionContext",()=>({register:n=>{this.register(n)},notifyReady:()=>{}}));let o=s.defined(this.module);s([this.module],n=>{o&&this.register(n)},n=>{this._errorMessage=n})},s=>{this._errorMessage=s})}render(){return d`<slot></slot>${this._errorMessage&&d`<div style="color:red">
166
166
  <h1>Error</h1>
167
167
  ${this._errorMessage}
168
- </div>`}`}};customElements.define("qti-portable-custom-interaction",tr);var rr=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);return this.elementFromPoint(e.x,e.y)}elementFromPoint(t,e){let r=document.elementFromPoint(t,e);if(r){for(;r.shadowRoot;){let s=r.shadowRoot.elementFromPoint(t,e);if(s===null||s===r)break;r=s}return r}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 bs=(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(l=>{l.setAttribute("dropzone","move"),l.addEventListener("dragleave",this.dragleaveHandler),this.attachHandler(l)});for(let l of a)this.observer=new MutationObserver(u=>{u.forEach(h=>{if(h.type==="attributes")switch(h.attributeName){case"disabled":{l.hasAttribute("disabled")?this.removeHandler(l):this.attachHandler(l);break}}})}),this.observer.observe(l,{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,l=this.querySelector(`[identifier=${n.dataTransfer.getData("text")}`),u=l||this.shadowRoot.querySelector(`[identifier=${n.dataTransfer.getData("text")}`);return a?u.parentElement.getAttribute("identifier")!==a.getAttribute("identifier")&&a.appendChild(u):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 c([p({type:Boolean,reflect:!0})],r.prototype,"disabled",2),r};var gs=(i,t,e)=>{class r extends i{}return r};var j=(i,t,e,r)=>{class s extends gs(bs(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}reInitDragAndDrop(a,l){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",m=>{m.dataTransfer.setData("text",m.currentTarget.getAttribute("identifier")),h.setAttribute("dragging","")}),h.addEventListener("dragend",m=>{if(m.preventDefault(),h.removeAttribute("over"),h.removeAttribute("dragging"),(m.dataTransfer.dropEffect==="none"||m.dataTransfer.dropEffect===void 0)&&this.configuration.dragCanBePlacedBack){let y=m.currentTarget,g=this.draggables.get(y),q=g.index<g.parent.children.length?g.index:g.parent.children.length-1,_=g.parent,S=g.parent.children[q];_.insertBefore(y,S),this.saveResponse(),this.checkMaxMatchAssociations()}m.dataTransfer.dropEffect==="move"&&(this.saveResponse(),this.checkMaxMatchAssociations())})}))}handleDragOptionsChanged(a,l){this.dragDropApi.copyStylesDragClone=l.copyStylesDragClone,this.dragDropApi.dragOnClick=l.dragOnClick}handleDisabledChange(a,l){this.draggables.forEach((u,h)=>{l?h.setAttribute("disabled",""):h.removeAttribute("disabled"),l?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}handleReadonlyChange(a,l){this.draggables.forEach((u,h)=>{l?h.setAttribute("readonly",""):h.removeAttribute("readonly"),l?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 rr,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}reset(a=!0){this.draggables.forEach((l,u)=>{let h=l.parent.children,m=l.index<h.length?l.index:h.length;l.parent.insertBefore(u,h[m])}),a&&this.saveResponse()}checkMaxMatchAssociations(){this.droppables.forEach(a=>{let u=+(a.getAttribute("match-max")||1)<=(a.children.length||0);u?a.setAttribute("disabled",""):a.removeAttribute("disabled"),u?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(l=>{let[u,...h]=l.split(" ").reverse();if(u){let m=this.droppables.find(y=>y.getAttribute("identifier")===u);h.forEach(y=>{let g=this.querySelector(`[identifier=${y}]`);m?g?(m.appendChild(g),this.checkMaxMatchAssociations()):console.error(`cannot find draggable with identifier: ${y}`):console.error(`cannot find droppable with identifier: ${u}`)})}}))}validate(){let l=(e?Array.from(this.shadowRoot.querySelectorAll(r)):Array.from(this.querySelectorAll(r))).filter(u=>u.childElementCount>0).length;return this.minAssociations<=0||this.minAssociations<=l}saveResponse(){let a=this.droppables.map(l=>{var h;let u="";return((h=l.children)==null?void 0:h.length)>0&&(u+=Array.from(l.children).map(m=>m.getAttribute("identifier")).join(" ")+" "),u+=l.getAttribute("identifier"),u});this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:a}}))}}return c([ps(t)],s.prototype,"reInitDragAndDrop",1),c([p({type:String,attribute:"response-identifier"})],s.prototype,"responseIdentifier",2),c([p({attribute:!1,type:Object})],s.prototype,"configuration",2),c([w("configuration")],s.prototype,"handleDragOptionsChanged",1),c([p({type:Boolean,reflect:!0})],s.prototype,"disabled",2),c([w("disabled",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),c([p({type:Boolean,reflect:!0})],s.prototype,"readonly",2),c([w("readonly",{waitUntilFirstUpdate:!0})],s.prototype,"handleReadonlyChange",1),c([p({type:Number,reflect:!0,attribute:"min-associations"})],s.prototype,"minAssociations",2),c([p({type:Number,reflect:!0,attribute:"max-associations"})],s.prototype,"maxAssociations",2),s};var Re=class extends j(f,"qti-simple-associable-choice",!0,".dl"){render(){return d` <slot name="prompt"></slot>
168
+ </div>`}`}};customElements.define("qti-portable-custom-interaction",tr);var rr=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);return this.elementFromPoint(e.x,e.y)}elementFromPoint(t,e){let r=document.elementFromPoint(t,e);if(r){for(;r.shadowRoot;){let s=r.shadowRoot.elementFromPoint(t,e);if(s===null||s===r)break;r=s}return r}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 bs=(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(l=>{l.setAttribute("dropzone","move"),l.addEventListener("dragleave",this.dragleaveHandler),this.attachHandler(l)});for(let l of a)this.observer=new MutationObserver(u=>{u.forEach(h=>{if(h.type==="attributes")switch(h.attributeName){case"disabled":{l.hasAttribute("disabled")?this.removeHandler(l):this.attachHandler(l);break}}})}),this.observer.observe(l,{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,l=this.querySelector(`[identifier=${n.dataTransfer.getData("text")}`),u=l||this.shadowRoot.querySelector(`[identifier=${n.dataTransfer.getData("text")}`);return a?u.parentElement.getAttribute("identifier")!==a.getAttribute("identifier")&&a.appendChild(u):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 c([p({type:Boolean,reflect:!0})],r.prototype,"disabled",2),r};var gs=(i,t,e)=>{class r extends i{}return r};var j=(i,t,e,r)=>{class s extends gs(bs(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}reInitDragAndDrop(a,l){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",m=>{m.dataTransfer.setData("text",m.currentTarget.getAttribute("identifier")),h.setAttribute("dragging","")}),h.addEventListener("dragend",m=>{if(m.preventDefault(),h.removeAttribute("over"),h.removeAttribute("dragging"),(m.dataTransfer.dropEffect==="none"||m.dataTransfer.dropEffect===void 0)&&this.configuration.dragCanBePlacedBack){let y=m.currentTarget,g=this.draggables.get(y),q=g.index<g.parent.children.length?g.index:g.parent.children.length-1,_=g.parent,S=g.parent.children[q];_.insertBefore(y,S),this.saveResponse(),this.checkMaxMatchAssociations()}m.dataTransfer.dropEffect==="move"&&(this.saveResponse(),this.checkMaxMatchAssociations())})}))}handleDragOptionsChanged(a,l){this.dragDropApi.copyStylesDragClone=l.copyStylesDragClone,this.dragDropApi.dragOnClick=l.dragOnClick}handleDisabledChange(a,l){this.draggables.forEach((u,h)=>{l?h.setAttribute("disabled",""):h.removeAttribute("disabled"),l?h.removeAttribute("qti-draggable"):h.setAttribute("qti-draggable","true")})}handleReadonlyChange(a,l){this.draggables.forEach((u,h)=>{l?h.setAttribute("readonly",""):h.removeAttribute("readonly"),l?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 rr,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}reset(a=!0){this.draggables.forEach((l,u)=>{let h=l.parent.children,m=l.index<h.length?l.index:h.length;l.parent.insertBefore(u,h[m])}),a&&this.saveResponse()}checkMaxMatchAssociations(){this.droppables.forEach(a=>{let u=+(a.getAttribute("match-max")||1)<=(a.children.length||0);u?a.setAttribute("disabled",""):a.removeAttribute("disabled"),u?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(l=>{let[u,...h]=l.split(" ").reverse();if(u){let m=this.droppables.find(y=>y.getAttribute("identifier")===u);h.forEach(y=>{let g=this.querySelector(`[identifier=${y}]`);m?g?(m.appendChild(g),this.checkMaxMatchAssociations()):console.error(`cannot find draggable with identifier: ${y}`):console.error(`cannot find droppable with identifier: ${u}`)})}}))}validate(){let l=(e?Array.from(this.shadowRoot.querySelectorAll(r)):Array.from(this.querySelectorAll(r))).filter(u=>u.childElementCount>0).length;return this.minAssociations<=0||this.minAssociations<=l}saveResponse(){let a=this.droppables.map(l=>{var h;let u="";return((h=l.children)==null?void 0:h.length)>0&&(u+=Array.from(l.children).map(m=>m.getAttribute("identifier")).join(" ")+" "),u+=l.getAttribute("identifier"),u});this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:a}}))}}return c([ps(t)],s.prototype,"reInitDragAndDrop",1),c([p({type:String,attribute:"response-identifier"})],s.prototype,"responseIdentifier",2),c([p({attribute:!1,type:Object})],s.prototype,"configuration",2),c([w("configuration")],s.prototype,"handleDragOptionsChanged",1),c([p({type:Boolean,reflect:!0})],s.prototype,"disabled",2),c([w("disabled",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),c([p({type:Boolean,reflect:!0})],s.prototype,"readonly",2),c([w("readonly",{waitUntilFirstUpdate:!0})],s.prototype,"handleReadonlyChange",1),c([p({type:Number,reflect:!0,attribute:"min-associations"})],s.prototype,"minAssociations",2),c([p({type:Number,reflect:!0,attribute:"max-associations"})],s.prototype,"maxAssociations",2),s};var ke=class extends j(f,"qti-simple-associable-choice",!0,".dl"){render(){return d` <slot name="prompt"></slot>
169
169
  <slot name="qti-simple-associable-choice"></slot>
170
170
  ${this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map((e,r)=>d`<div part="associables-container">
171
171
  <div name="left${r}" part="drop-list" class="dl" identifier="droplist${r}_left"></div>
172
172
  <div name="right${r}" part="drop-list" class="dl" identifier="droplist${r}_right"></div>
173
- </div>`)}`}connectedCallback(){super.connectedCallback(),this._childrenMap=Array.from(this.querySelectorAll("qti-simple-associable-choice"))}};Re.styles=b`
173
+ </div>`)}`}connectedCallback(){super.connectedCallback(),this._childrenMap=Array.from(this.querySelectorAll("qti-simple-associable-choice"))}};ke.styles=b`
174
174
  :host {
175
175
  display: block; /* necessary to calculate scaling position */
176
176
  }
@@ -179,7 +179,7 @@ Make sure to test your application with a production build as repeat registratio
179
179
  flex-wrap: wrap;
180
180
  gap: 0.5rem;
181
181
  }
182
- `,c([A()],Re.prototype,"_childrenMap",2);customElements.define("qti-associate-interaction",Re);var nt=class extends j(f,"qti-gap-text",!1,"qti-gap"){render(){return d` <slot part="drags" name="qti-gap-text"></slot>
182
+ `,c([A()],ke.prototype,"_childrenMap",2);customElements.define("qti-associate-interaction",ke);var nt=class extends j(f,"qti-gap-text",!1,"qti-gap"){render(){return d` <slot part="drags" name="qti-gap-text"></slot>
183
183
  <slot part="drops"></slot>`}};nt.styles=[b`
184
184
  :host {
185
185
  display: flex;
@@ -203,7 +203,7 @@ Make sure to test your application with a production build as repeat registratio
203
203
  align-items: flex-start;
204
204
  flex: 1;
205
205
  }
206
- `];customElements.define("qti-gap-match-interaction",nt);function ke(i,t,e,r){switch(i){case"circle":{let[s,o,n]=t,a=s/e.width*100,l=o/e.height*100,u=n/e.width*100;r.style.left=a-u+"%",r.style.top=l-u+"%",r.style.width=r.style.height=4*u+"px",r.style.borderRadius="9999px"}break;case"rect":{let[s,o,n,a]=t,l=s/e.width*100,u=o/e.height*100,h=n/e.width*100,m=a/e.height*100;r.style.left=l+"%",r.style.top=u+"%",r.style.width=h-l+"%",r.style.height=m-u+"%"}break;case"poly":{let s=t.reduce((_,S,ve,vt)=>{if(ve%2===1){let Cs=_.pop();_[_.length]={x:Cs,y:vt[ve]}}else _.push(S);return _},[]),o=Math.min(...s.map(_=>_.x)),n=Math.max(...s.map(_=>_.x)),a=Math.min(...s.map(_=>_.y)),l=Math.max(...s.map(_=>_.y)),u=o/e.width*100,h=a/e.height*100,m=n/e.width*100,y=l/e.height*100;r.style.left=o/e.width*100+"%",r.style.top=a/e.height*100+"%",r.style.width=m-u+"%",r.style.height=y-h+"%";let q=s.map(_=>({x:(_.x-o)/(n-o)*100,y:(_.y-a)/(l-a)*100})).map(_=>Math.round(_.x)+"% "+Math.round(_.y)+"%").join(",");r.style.clipPath=`polygon(${q})`}break;default:break}}var vs=(i,t,e)=>{let r=new Map;for(let s=t;s<=e;s++)r.set(i[s],s);return r},sr=Q(class extends I{constructor(i){if(super(i),i.type!==Z.CHILD)throw Error("repeat() can only be used in text expressions")}ht(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.ht(i,t,e).values}update(i,[t,e,r]){var _;let s=as(i),{values:o,keys:n}=this.ht(t,e,r);if(!Array.isArray(s))return this.dt=n,o;let a=(_=this.dt)!=null?_:this.dt=[],l=[],u,h,m=0,y=s.length-1,g=0,q=o.length-1;for(;m<=y&&g<=q;)if(s[m]===null)m++;else if(s[y]===null)y--;else if(a[m]===n[g])l[g]=re(s[m],o[g]),m++,g++;else if(a[y]===n[q])l[q]=re(s[y],o[q]),y--,q--;else if(a[m]===n[q])l[q]=re(s[m],o[q]),Ae(i,l[q+1],s[m]),m++,q--;else if(a[y]===n[g])l[g]=re(s[y],o[g]),Ae(i,s[m],s[y]),y--,g++;else if(u===void 0&&(u=vs(n,g,q),h=vs(a,m,y)),u.has(a[m]))if(u.has(a[y])){let S=h.get(n[g]),ve=S!==void 0?s[S]:null;if(ve===null){let vt=Ae(i,s[m]);re(vt,o[g]),l[g]=vt}else l[g]=re(ve,o[g]),Ae(i,s[m],ve),s[S]=null;g++}else Tt(s[y]),y--;else Tt(s[m]),m++;for(;g<=q;){let S=Ae(i,l[q+1]);re(S,o[g]),l[g++]=S}for(;m<=y;){let S=s[m++];S!==null&&Tt(S)}return this.dt=n,ns(i,l),P}});var z=class extends ${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 d`<slot name="prompt"></slot>
206
+ `];customElements.define("qti-gap-match-interaction",nt);function Re(i,t,e,r){switch(i){case"circle":{let[s,o,n]=t,a=s/e.width*100,l=o/e.height*100,u=n/e.width*100;r.style.left=a-u+"%",r.style.top=l-u+"%",r.style.width=r.style.height=4*u+"px",r.style.borderRadius="9999px"}break;case"rect":{let[s,o,n,a]=t,l=s/e.width*100,u=o/e.height*100,h=n/e.width*100,m=a/e.height*100;r.style.left=l+"%",r.style.top=u+"%",r.style.width=h-l+"%",r.style.height=m-u+"%"}break;case"poly":{let s=t.reduce((_,S,ve,vt)=>{if(ve%2===1){let Cs=_.pop();_[_.length]={x:Cs,y:vt[ve]}}else _.push(S);return _},[]),o=Math.min(...s.map(_=>_.x)),n=Math.max(...s.map(_=>_.x)),a=Math.min(...s.map(_=>_.y)),l=Math.max(...s.map(_=>_.y)),u=o/e.width*100,h=a/e.height*100,m=n/e.width*100,y=l/e.height*100;r.style.left=o/e.width*100+"%",r.style.top=a/e.height*100+"%",r.style.width=m-u+"%",r.style.height=y-h+"%";let q=s.map(_=>({x:(_.x-o)/(n-o)*100,y:(_.y-a)/(l-a)*100})).map(_=>Math.round(_.x)+"% "+Math.round(_.y)+"%").join(",");r.style.clipPath=`polygon(${q})`}break;default:break}}var vs=(i,t,e)=>{let r=new Map;for(let s=t;s<=e;s++)r.set(i[s],s);return r},sr=Q(class extends I{constructor(i){if(super(i),i.type!==Z.CHILD)throw Error("repeat() can only be used in text expressions")}ht(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.ht(i,t,e).values}update(i,[t,e,r]){var _;let s=as(i),{values:o,keys:n}=this.ht(t,e,r);if(!Array.isArray(s))return this.dt=n,o;let a=(_=this.dt)!=null?_:this.dt=[],l=[],u,h,m=0,y=s.length-1,g=0,q=o.length-1;for(;m<=y&&g<=q;)if(s[m]===null)m++;else if(s[y]===null)y--;else if(a[m]===n[g])l[g]=re(s[m],o[g]),m++,g++;else if(a[y]===n[q])l[q]=re(s[y],o[q]),y--,q--;else if(a[m]===n[q])l[q]=re(s[m],o[q]),Ae(i,l[q+1],s[m]),m++,q--;else if(a[y]===n[g])l[g]=re(s[y],o[g]),Ae(i,s[m],s[y]),y--,g++;else if(u===void 0&&(u=vs(n,g,q),h=vs(a,m,y)),u.has(a[m]))if(u.has(a[y])){let S=h.get(n[g]),ve=S!==void 0?s[S]:null;if(ve===null){let vt=Ae(i,s[m]);re(vt,o[g]),l[g]=vt}else l[g]=re(ve,o[g]),Ae(i,s[m],ve),s[S]=null;g++}else Tt(s[y]),y--;else Tt(s[m]),m++;for(;g<=q;){let S=Ae(i,l[q+1]);re(S,o[g]),l[g++]=S}for(;m<=y;){let S=s[m++];S!==null&&Tt(S)}return this.dt=n,ns(i,l),P}});var z=class extends ${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 d`<slot name="prompt"></slot>
207
207
  <line-container>
208
208
  <svg
209
209
  width=${X((e=this.grImage[0])==null?void 0:e.width)}
@@ -233,7 +233,7 @@ Make sure to test your application with a production build as repeat registratio
233
233
  />`}
234
234
  </svg>
235
235
  <slot></slot>
236
- </line-container>`}positionHotspotOnRegister(e){let r=this.querySelector("img"),s=e.target,o=s.getAttribute("coords"),n=s.getAttribute("shape"),a=o.split(",").map(l=>parseInt(l));ke(n,a,r,s)}firstUpdated(e){super.firstUpdated(e),this.hotspots=document.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)}};z.styles=[b`
236
+ </line-container>`}positionHotspotOnRegister(e){let r=this.querySelector("img"),s=e.target,o=s.getAttribute("coords"),n=s.getAttribute("shape"),a=o.split(",").map(l=>parseInt(l));Re(n,a,r,s)}firstUpdated(e){super.firstUpdated(e),this.hotspots=document.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)}};z.styles=[b`
237
237
  slot:not([name='prompt']) {
238
238
  // position: relative; /* qti-hotspot-choice relative to the slot */
239
239
  display: block;
@@ -271,7 +271,7 @@ Make sure to test your application with a production build as repeat registratio
271
271
  <!-- slot for the prompt -->
272
272
  <slot></slot>
273
273
  <!-- slot for the image and hotspots -->
274
- `}setHotspotOrder(e){let{identifier:r}=e.detail,s=this._choiceElements.find(n=>n.getAttribute("identifier")===r),o=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,s.order==null){if(this._choiceElements.filter(n=>n.order>0).length>=o){this.choiceOrdering=!1;return}s.order=this._choiceElements.filter(n=>!!n.order).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(n=>(n.order>n.order&&n.order--,n)),s.order=null;this.choiceOrdering=!1}}positionHotspotOnRegister(e){let r=this.querySelector("img"),s=e.target,o=s.getAttribute("coords"),n=s.getAttribute("shape"),a=o.split(",").map(l=>parseInt(l));ke(n,a,r,s)}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)}};lt.styles=[b`
274
+ `}setHotspotOrder(e){let{identifier:r}=e.detail,s=this._choiceElements.find(n=>n.getAttribute("identifier")===r),o=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,s.order==null){if(this._choiceElements.filter(n=>n.order>0).length>=o){this.choiceOrdering=!1;return}s.order=this._choiceElements.filter(n=>!!n.order).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(n=>(n.order>n.order&&n.order--,n)),s.order=null;this.choiceOrdering=!1}}positionHotspotOnRegister(e){let r=this.querySelector("img"),s=e.target,o=s.getAttribute("coords"),n=s.getAttribute("shape"),a=o.split(",").map(l=>parseInt(l));Re(n,a,r,s)}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)}};lt.styles=[b`
275
275
  slot:not([name='prompt']) {
276
276
  position: relative; /* qti-hotspot-choice relative to the slot */
277
277
  display: block;
@@ -287,7 +287,7 @@ Make sure to test your application with a production build as repeat registratio
287
287
  <!-- slot for the prompt -->
288
288
  <slot></slot>
289
289
  <!-- slot for the image and hotspots -->
290
- `}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)}};ct.styles=[b`
290
+ `}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));Re(o,n,e,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};ct.styles=[b`
291
291
  slot:not([name='prompt']) {
292
292
  position: relative; /* qti-hotspot-choice relative to the slot */
293
293
  display: block;
@@ -321,7 +321,7 @@ Make sure to test your application with a production build as repeat registratio
321
321
  </td>`})}
322
322
  </tr>`)}
323
323
  </table>
324
- `:d`<slot name="prompt"></slot> <slot></slot>`}};fe.styles=[],c([A()],fe.prototype,"response",2),c([p({type:String,attribute:"response-identifier"})],fe.prototype,"responseIdentifier",2);customElements.define("qti-match-interaction",fe);var pt=class extends ${constructor(){super();this.value=0}reset(){}validate(){return!0}set response(e){}static get properties(){return R(x({},$.properties),{step:{type:Number,attribute:"step",default:10}})}render(){return d` <slot name="prompt"></slot>
324
+ `:d`<slot name="prompt"></slot> <slot></slot>`}};fe.styles=[],c([A()],fe.prototype,"response",2),c([p({type:String,attribute:"response-identifier"})],fe.prototype,"responseIdentifier",2);customElements.define("qti-match-interaction",fe);var pt=class extends ${constructor(){super();this.value=0}reset(){}validate(){return!0}set response(e){}static get properties(){return k(x({},$.properties),{step:{type:Number,attribute:"step",default:10}})}render(){return d` <slot name="prompt"></slot>
325
325
  <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())})}};pt.styles=[b``];customElements.define("qti-media-interaction",pt);var be=class extends j(f,"qti-simple-choice",!0,"drop-list"){render(){return d` <slot name="prompt"> </slot>
326
326
  <div part="container">
327
327
  <slot part="drags"> </slot>
@@ -427,12 +427,12 @@ Make sure to test your application with a production build as repeat registratio
427
427
  :host {
428
428
  position: absolute;
429
429
  }
430
- `;customElements.define("qti-associable-hotspot",ht);var mt=class extends f{constructor(){super(...arguments);this.tabindex=0}render(){return d` <slot name="qti-gap-text"></slot>`}};c([p({type:Number,reflect:!0})],mt.prototype,"tabindex",2);customElements.define("qti-gap",mt);var ft=class extends f{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){this.setAttribute("slot","qti-gap-img")}};c([p({type:Number,reflect:!0})],ft.prototype,"tabindex",2);customElements.define("qti-gap-img",ft);var bt=class extends f{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-gap-text")}render(){return d`<slot></slot>`}};c([p({type:Number,reflect:!0})],bt.prototype,"tabindex",2);customElements.define("qti-gap-text",bt);var Te=class extends k{};Te.styles=b`
430
+ `;customElements.define("qti-associable-hotspot",ht);var mt=class extends f{constructor(){super(...arguments);this.tabindex=0}render(){return d` <slot name="qti-gap-text"></slot>`}};c([p({type:Number,reflect:!0})],mt.prototype,"tabindex",2);customElements.define("qti-gap",mt);var ft=class extends f{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){this.setAttribute("slot","qti-gap-img")}};c([p({type:Number,reflect:!0})],ft.prototype,"tabindex",2);customElements.define("qti-gap-img",ft);var bt=class extends f{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-gap-text")}render(){return d`<slot></slot>`}};c([p({type:Number,reflect:!0})],bt.prototype,"tabindex",2);customElements.define("qti-gap-text",bt);var Te=class extends R{};Te.styles=b`
431
431
  :host {
432
432
  position: absolute;
433
433
  }
434
- `,c([p({attribute:"aria-ordervalue",type:Number,reflect:!0})],Te.prototype,"order",2);customElements.define("qti-hotspot-choice",Te);var gt=class extends k{render(){return d`<div part="ch"><div part="cha"></div></div>
435
- <slot></slot> `}};gt=c([C("qti-hottext")],gt);var or=class extends f{};customElements.define("qti-inline-choice",or);var Le=class extends k{render(){return d`<div part="ch"><div part="cha"></div></div>
434
+ `,c([p({attribute:"aria-ordervalue",type:Number,reflect:!0})],Te.prototype,"order",2);customElements.define("qti-hotspot-choice",Te);var gt=class extends R{render(){return d`<div part="ch"><div part="cha"></div></div>
435
+ <slot></slot> `}};gt=c([C("qti-hottext")],gt);var or=class extends f{};customElements.define("qti-inline-choice",or);var Le=class extends R{render(){return d`<div part="ch"><div part="cha"></div></div>
436
436
  <slot part="slot"></slot> `}};Le.styles=b`
437
437
  :host {
438
438
  display: flex;
package/dist/index.d.cts CHANGED
@@ -98,8 +98,8 @@ interface VariableValue<T> {
98
98
  type: 'outcome' | 'response';
99
99
  }
100
100
  interface VariableDeclaration<T> extends VariableValue<T> {
101
- cardinality: Cardinality;
102
- baseType: BaseType;
101
+ cardinality?: Cardinality;
102
+ baseType?: BaseType;
103
103
  }
104
104
  interface OutcomeVariable extends VariableDeclaration<string | string[] | null> {
105
105
  interpolationTable?: Map<number, number>;
@@ -431,7 +431,8 @@ declare class QtiInlineChoiceInteraction extends Interaction {
431
431
  dataPrompt: string;
432
432
  static get styles(): lit.CSSResult[];
433
433
  render(): lit_html.TemplateResult<1>;
434
- firstUpdated(val: any): void;
434
+ connectedCallback(): void;
435
+ disconnectedCallback(): void;
435
436
  validate(): boolean;
436
437
  reset(): void;
437
438
  set response(value: string);
@@ -466,7 +467,6 @@ declare global {
466
467
  declare class QtiResponseProcessing extends LitElement {
467
468
  static styles: lit.CSSResult[];
468
469
  render(): lit_html.TemplateResult<1>;
469
- static get observedAttributes(): string[];
470
470
  process(): void;
471
471
  firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
472
472
  private fragmentFromString;
package/dist/index.d.ts CHANGED
@@ -98,8 +98,8 @@ interface VariableValue<T> {
98
98
  type: 'outcome' | 'response';
99
99
  }
100
100
  interface VariableDeclaration<T> extends VariableValue<T> {
101
- cardinality: Cardinality;
102
- baseType: BaseType;
101
+ cardinality?: Cardinality;
102
+ baseType?: BaseType;
103
103
  }
104
104
  interface OutcomeVariable extends VariableDeclaration<string | string[] | null> {
105
105
  interpolationTable?: Map<number, number>;
@@ -431,7 +431,8 @@ declare class QtiInlineChoiceInteraction extends Interaction {
431
431
  dataPrompt: string;
432
432
  static get styles(): lit.CSSResult[];
433
433
  render(): lit_html.TemplateResult<1>;
434
- firstUpdated(val: any): void;
434
+ connectedCallback(): void;
435
+ disconnectedCallback(): void;
435
436
  validate(): boolean;
436
437
  reset(): void;
437
438
  set response(value: string);
@@ -466,7 +467,6 @@ declare global {
466
467
  declare class QtiResponseProcessing extends LitElement {
467
468
  static styles: lit.CSSResult[];
468
469
  render(): lit_html.TemplateResult<1>;
469
- static get observedAttributes(): string[];
470
470
  process(): void;
471
471
  firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
472
472
  private fragmentFromString;