@citolab/qti-components 6.6.1-22 → 6.6.1-27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -8
- package/dist/qti-components/index.js +16 -16
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var Er=Object.defineProperty,Cs=Object.defineProperties,As=Object.getOwnPropertyDescriptor,qs=Object.getOwnPropertyDescriptors;var yr=Object.getOwnPropertySymbols;var $s=Object.prototype.hasOwnProperty,ws=Object.prototype.propertyIsEnumerable;var xr=(i,t,e)=>t in i?Er(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,x=(i,t)=>{for(var e in t||(t={}))$s.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)=>Cs(i,qs(t));var l=(i,t,e,r)=>{for(var s=r>1?void 0:r?As(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=(r?o(t,e,s):o(s))||s);return r&&s&&Er(t,e,s),s};var Q=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 me=class{constructor(t,e,r,s){var n;if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(o,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=o,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(o,a)),this.unsubscribe=a},this.host=t,e.context!==void 0){let o=e;this.context=o.context,this.callback=o.callback,this.subscribe=(n=o.subscribe)!=null?n:!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 Q(this.context,this.t,this.subscribe))}};var We=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 Ht=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}},fe=class extends We{constructor(t,e,r){var s,n;super(e.context!==void 0?e.initialValue:r),this.onContextRequest=o=>{let a=o.composedPath()[0];o.context===this.context&&a!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,a,o.subscribe))},this.onProviderRequest=o=>{let a=o.composedPath()[0];if(o.context!==this.context||a===this.host)return;let c=new Set;for(let[u,{consumerHost:h}]of this.subscriptions)c.has(u)||(c.add(u),h.dispatchEvent(new Q(this.context,u,!0)));o.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(n=(s=this.host).addController)==null||n.call(s,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Ht(this.context))}};function Nt({context:i}){return(t,e)=>{let r=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){r.set(this,new fe(this,{context:i}))}),{get(){return t.get.call(this)},set(s){var n;return(n=r.get(this))==null||n.setValue(s),t.set.call(this,s)},init(s){var n;return(n=r.get(this))==null||n.setValue(s),s}};{t.constructor.addInitializer(o=>{r.set(o,new fe(o,{context:i}))});let s=Object.getOwnPropertyDescriptor(t,e),n;if(s===void 0){let o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){r.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{let o=s.set;n=R(x({},s),{set:function(a){r.get(this).setValue(a),o==null||o.call(this,a)}})}return void Object.defineProperty(t,e,n)}}}function Y({context:i,subscribe:t}){return(e,r)=>{typeof r=="object"?r.addInitializer(function(){new me(this,{context:i,callback:s=>{this[r.name]=s},subscribe:t})}):e.constructor.addInitializer(s=>{new me(s,{context:i,callback:n=>{s[r]=n},subscribe:t})})}}var _r=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 Cr=new WeakMap,we=i=>{let t=Cr.get(i);return t===void 0&&Cr.set(i,t=new Map),t},Rs=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(we(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}setAttribute(t,e){we(this).set(t,String(e))}removeAttribute(t){we(this).delete(t)}hasAttribute(t){return we(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 _r(this);return this.__internals=t,t}getAttribute(t){let e=we(this).get(t);return e!=null?e:null}};var ks=class extends Rs{},Ar=ks;var Ts=class{constructor(){this.__definitions=new Map}define(t,e){var r;if(this.__definitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);this.__definitions.set(t,{ctor:e,observedAttributes:(r=e.observedAttributes)!=null?r:[]})}get(t){let e=this.__definitions.get(t);return e==null?void 0:e.ctor}},Ls=Ts;var qr=new Ls;var Se=globalThis,Ge=Se.ShadowRoot&&(Se.ShadyCSS===void 0||Se.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Dt=Symbol(),$r=new WeakMap,Re=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==Dt)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(Ge&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=$r.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&$r.set(e,t))}return t}toString(){return this.cssText}},wr=i=>new Re(typeof i=="string"?i:i+"",void 0,Dt),b=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((r,s,n)=>r+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[n+1],i[0]);return new Re(e,i,Dt)},Ot=(i,t)=>{if(Ge)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),s=Se.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=e.cssText,i.appendChild(r)}},Je=Ge||Se.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return wr(e)})(i):i;var{is:Ms,defineProperty:Ps,getOwnPropertyDescriptor:Vs,getOwnPropertyNames:Hs,getOwnPropertySymbols:Ns,getPrototypeOf:Ds}=Object,O=globalThis,kr;(kr=O.customElements)!=null||(O.customElements=qr);var Sr=O.trustedTypes,Os=Sr?Sr.emptyScript:"",Ut=O.reactiveElementPolyfillSupport,ke=(i,t)=>i,Te={toAttribute(i,t){switch(t){case Boolean:i=i?Os: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}},Ze=(i,t)=>!Ms(i,t),Rr={attribute:!0,type:String,converter:Te,reflect:!1,hasChanged:Ze},Tr,Lr;(Tr=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(Lr=O.litPropertyMetadata)!=null||(O.litPropertyMetadata=new WeakMap);var Mr,K=class extends((Mr=globalThis.HTMLElement)!=null?Mr:Ar){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&&Ps(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){var o;let{get:s,set:n}=(o=Vs(this.prototype,t))!=null?o:{get(){return this[e]},set(a){this[e]=a}};return{get(){return s==null?void 0:s.call(this)},set(a){let c=s==null?void 0:s.call(this);n.call(this,a),this.requestUpdate(t,c,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:Rr}static _$Ei(){if(this.hasOwnProperty(ke("elementProperties")))return;let t=Ds(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ke("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ke("properties"))){let e=this.properties,r=[...Hs(e),...Ns(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(Je(s))}else t!==void 0&&e.push(Je(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._$ES(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,r;((e=this._$E_)!=null?e:this._$E_=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var e;(e=this._$E_)==null||e.delete(t)}_$ES(){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 Ot(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$E_)==null||e.forEach(r=>{var s;return(s=r.hostConnected)==null?void 0:s.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$E_)==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 n;let r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){let o=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:Te).toAttribute(e,r.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var n;let r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let o=r.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:Te;this._$Em=s,this[s]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,r,s=!1,n){var o;if(t!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(t)),!((o=r.hasChanged)!=null?o:Ze)(s?n: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,s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[o,a]of n)a.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.C(o,this[o],a)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$E_)==null||s.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(e)):this._$ET()}catch(n){throw t=!1,this._$ET(),n}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$E_)==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){}},Pr;K.elementStyles=[],K.shadowRootOptions={mode:"open"},K[ke("elementProperties")]=new Map,K[ke("finalized")]=new Map,Ut==null||Ut({ReactiveElement:K}),((Pr=O.reactiveElementVersions)!=null?Pr:O.reactiveElementVersions=[]).push("2.0.2");var be=globalThis,Qe=be.trustedTypes,Vr=Qe?Qe.createPolicy("lit-html",{createHTML:i=>i}):void 0,Bt="$lit$",W=`lit$${(Math.random()+"").slice(9)}$`,Xt="?"+W,Us=`<${Xt}>`,ne=be.document===void 0?{createTreeWalker:()=>({})}:document,Me=()=>ne.createComment(""),Pe=i=>i===null||typeof i!="object"&&typeof i!="function",Fr=Array.isArray,Br=i=>Fr(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",It=`[
|
|
1
|
+
var Er=Object.defineProperty,Cs=Object.defineProperties,As=Object.getOwnPropertyDescriptor,qs=Object.getOwnPropertyDescriptors;var yr=Object.getOwnPropertySymbols;var $s=Object.prototype.hasOwnProperty,ws=Object.prototype.propertyIsEnumerable;var xr=(i,t,e)=>t in i?Er(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,x=(i,t)=>{for(var e in t||(t={}))$s.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)=>Cs(i,qs(t));var l=(i,t,e,r)=>{for(var s=r>1?void 0:r?As(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=(r?o(t,e,s):o(s))||s);return r&&s&&Er(t,e,s),s};var Q=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 me=class{constructor(t,e,r,s){var n;if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(o,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=o,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(o,a)),this.unsubscribe=a},this.host=t,e.context!==void 0){let o=e;this.context=o.context,this.callback=o.callback,this.subscribe=(n=o.subscribe)!=null?n:!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 Q(this.context,this.t,this.subscribe))}};var We=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 Ht=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}},fe=class extends We{constructor(t,e,r){var s,n;super(e.context!==void 0?e.initialValue:r),this.onContextRequest=o=>{let a=o.composedPath()[0];o.context===this.context&&a!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,a,o.subscribe))},this.onProviderRequest=o=>{let a=o.composedPath()[0];if(o.context!==this.context||a===this.host)return;let c=new Set;for(let[u,{consumerHost:h}]of this.subscriptions)c.has(u)||(c.add(u),h.dispatchEvent(new Q(this.context,u,!0)));o.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(n=(s=this.host).addController)==null||n.call(s,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Ht(this.context))}};function Nt({context:i}){return(t,e)=>{let r=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){r.set(this,new fe(this,{context:i}))}),{get(){return t.get.call(this)},set(s){var n;return(n=r.get(this))==null||n.setValue(s),t.set.call(this,s)},init(s){var n;return(n=r.get(this))==null||n.setValue(s),s}};{t.constructor.addInitializer(o=>{r.set(o,new fe(o,{context:i}))});let s=Object.getOwnPropertyDescriptor(t,e),n;if(s===void 0){let o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){r.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{let o=s.set;n=R(x({},s),{set:function(a){r.get(this).setValue(a),o==null||o.call(this,a)}})}return void Object.defineProperty(t,e,n)}}}function Y({context:i,subscribe:t}){return(e,r)=>{typeof r=="object"?r.addInitializer(function(){new me(this,{context:i,callback:s=>{this[r.name]=s},subscribe:t})}):e.constructor.addInitializer(s=>{new me(s,{context:i,callback:n=>{s[r]=n},subscribe:t})})}}var _r=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 Cr=new WeakMap,we=i=>{let t=Cr.get(i);return t===void 0&&Cr.set(i,t=new Map),t},Rs=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(we(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}setAttribute(t,e){we(this).set(t,String(e))}removeAttribute(t){we(this).delete(t)}hasAttribute(t){return we(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 _r(this);return this.__internals=t,t}getAttribute(t){let e=we(this).get(t);return e!=null?e:null}};var ks=class extends Rs{},Ar=ks;var Ts=class{constructor(){this.__definitions=new Map}define(t,e){var r;if(this.__definitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);this.__definitions.set(t,{ctor:e,observedAttributes:(r=e.observedAttributes)!=null?r:[]})}get(t){let e=this.__definitions.get(t);return e==null?void 0:e.ctor}},Ls=Ts;var qr=new Ls;var Se=globalThis,Je=Se.ShadowRoot&&(Se.ShadyCSS===void 0||Se.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Dt=Symbol(),$r=new WeakMap,Re=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==Dt)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(Je&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=$r.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&$r.set(e,t))}return t}toString(){return this.cssText}},wr=i=>new Re(typeof i=="string"?i:i+"",void 0,Dt),b=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((r,s,n)=>r+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[n+1],i[0]);return new Re(e,i,Dt)},Ot=(i,t)=>{if(Je)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),s=Se.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=e.cssText,i.appendChild(r)}},Ge=Je||Se.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return wr(e)})(i):i;var{is:Ms,defineProperty:Ps,getOwnPropertyDescriptor:Vs,getOwnPropertyNames:Hs,getOwnPropertySymbols:Ns,getPrototypeOf:Ds}=Object,O=globalThis,kr;(kr=O.customElements)!=null||(O.customElements=qr);var Sr=O.trustedTypes,Os=Sr?Sr.emptyScript:"",Ut=O.reactiveElementPolyfillSupport,ke=(i,t)=>i,Te={toAttribute(i,t){switch(t){case Boolean:i=i?Os: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}},Ze=(i,t)=>!Ms(i,t),Rr={attribute:!0,type:String,converter:Te,reflect:!1,hasChanged:Ze},Tr,Lr;(Tr=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(Lr=O.litPropertyMetadata)!=null||(O.litPropertyMetadata=new WeakMap);var Mr,K=class extends((Mr=globalThis.HTMLElement)!=null?Mr:Ar){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&&Ps(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){var o;let{get:s,set:n}=(o=Vs(this.prototype,t))!=null?o:{get(){return this[e]},set(a){this[e]=a}};return{get(){return s==null?void 0:s.call(this)},set(a){let c=s==null?void 0:s.call(this);n.call(this,a),this.requestUpdate(t,c,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:Rr}static _$Ei(){if(this.hasOwnProperty(ke("elementProperties")))return;let t=Ds(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ke("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ke("properties"))){let e=this.properties,r=[...Hs(e),...Ns(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(Ge(s))}else t!==void 0&&e.push(Ge(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._$ES(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,r;((e=this._$E_)!=null?e:this._$E_=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var e;(e=this._$E_)==null||e.delete(t)}_$ES(){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 Ot(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$E_)==null||e.forEach(r=>{var s;return(s=r.hostConnected)==null?void 0:s.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$E_)==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 n;let r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){let o=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:Te).toAttribute(e,r.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var n;let r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let o=r.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:Te;this._$Em=s,this[s]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,r,s=!1,n){var o;if(t!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(t)),!((o=r.hasChanged)!=null?o:Ze)(s?n: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,s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[o,a]of n)a.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.C(o,this[o],a)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$E_)==null||s.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(e)):this._$ET()}catch(n){throw t=!1,this._$ET(),n}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$E_)==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){}},Pr;K.elementStyles=[],K.shadowRootOptions={mode:"open"},K[ke("elementProperties")]=new Map,K[ke("finalized")]=new Map,Ut==null||Ut({ReactiveElement:K}),((Pr=O.reactiveElementVersions)!=null?Pr:O.reactiveElementVersions=[]).push("2.0.2");var be=globalThis,Qe=be.trustedTypes,Vr=Qe?Qe.createPolicy("lit-html",{createHTML:i=>i}):void 0,Bt="$lit$",W=`lit$${(Math.random()+"").slice(9)}$`,Xt="?"+W,Us=`<${Xt}>`,ne=be.document===void 0?{createTreeWalker:()=>({})}:document,Me=()=>ne.createComment(""),Pe=i=>i===null||typeof i!="object"&&typeof i!="function",Fr=Array.isArray,Br=i=>Fr(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",It=`[
|
|
2
2
|
\f\r]`,Le=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Hr=/-->/g,Nr=/>/g,ie=RegExp(`>|${It}(?:([^\\s"'>=/]+)(${It}*=${It}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Dr=/'/g,Or=/"/g,Xr=/^(?:script|style|textarea|title)$/i,zr=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),d=zr(1),He=zr(2),P=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),Ur=new WeakMap,oe=ne.createTreeWalker(ne,129);function jr(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vr!==void 0?Vr.createHTML(t):t}var Yr=(i,t)=>{let e=i.length-1,r=[],s,n=t===2?"<svg>":"",o=Le;for(let a=0;a<e;a++){let c=i[a],u,h,m=-1,y=0;for(;y<c.length&&(o.lastIndex=y,h=o.exec(c),h!==null);)y=o.lastIndex,o===Le?h[1]==="!--"?o=Hr:h[1]!==void 0?o=Nr:h[2]!==void 0?(Xr.test(h[2])&&(s=RegExp("</"+h[2],"g")),o=ie):h[3]!==void 0&&(o=ie):o===ie?h[0]===">"?(o=s!=null?s:Le,m=-1):h[1]===void 0?m=-2:(m=o.lastIndex-h[2].length,u=h[1],o=h[3]===void 0?ie:h[3]==='"'?Or:Dr):o===Or||o===Dr?o=ie:o===Hr||o===Nr?o=Le:(o=ie,s=void 0);let g=o===ie&&i[a+1].startsWith("/>")?" ":"";n+=o===Le?c+Us:m>=0?(r.push(u),c.slice(0,m)+Bt+c.slice(m)+W+g):c+W+(m===-2?a:g)}return[jr(i,n+(i[e]||"<?>")+(t===2?"</svg>":"")),r]},Ve=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let n=0,o=0,a=t.length-1,c=this.parts,[u,h]=Yr(t,e);if(this.el=i.createElement(u,r),oe.currentNode=this.el.content,e===2){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(s=oe.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let m of s.getAttributeNames())if(m.endsWith(Bt)){let y=h[o++],g=s.getAttribute(m).split(W),q=/([.?@])?(.*)/.exec(y);c.push({type:1,index:n,name:q[2],strings:g,ctor:q[1]==="."?tt:q[1]==="?"?rt:q[1]==="@"?st:le}),s.removeAttribute(m)}else m.startsWith(W)&&(c.push({type:6,index:n}),s.removeAttribute(m));if(Xr.test(s.tagName)){let m=s.textContent.split(W),y=m.length-1;if(y>0){s.textContent=Qe?Qe.emptyScript:"";for(let g=0;g<y;g++)s.append(m[g],Me()),oe.nextNode(),c.push({type:2,index:++n});s.append(m[y],Me())}}}else if(s.nodeType===8)if(s.data===Xt)c.push({type:2,index:n});else{let m=-1;for(;(m=s.data.indexOf(W,m+1))!==-1;)c.push({type:7,index:n}),m+=W.length-1}n++}}static createElement(t,e){let r=ne.createElement("template");return r.innerHTML=t,r}};function ae(i,t,e=i,r){var o,a,c;if(t===P)return t;let s=r!==void 0?(o=e._$Co)==null?void 0:o[r]:e._$Cl,n=Pe(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==n&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),n===void 0?s=void 0:(s=new n(i),s._$AT(i,e,r)),r!==void 0?((c=e._$Co)!=null?c:e._$Co=[])[r]=s:e._$Cl=s),s!==void 0&&(t=ae(i,s._$AS(i,t.values),s,r)),t}var et=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:ne).importNode(e,!0);oe.currentNode=s;let n=oe.nextNode(),o=0,a=0,c=r[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new ge(n,n.nextSibling,this,t):c.type===1?h=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(h=new it(n,this,t)),this._$AV.push(h),c=r[++a]}o!==(c==null?void 0:c.index)&&(n=oe.nextNode(),o++)}return oe.currentNode=ne,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++}},ge=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 n;this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=(n=s==null?void 0:s.isConnected)!=null?n:!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=ae(this,t,e),Pe(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):Br(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&&Pe(this._$AH)?this._$AA.nextSibling.data=t:this.$(ne.createTextNode(t)),this._$AH=t}g(t){var n;let{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Ve.createElement(jr(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===s)this._$AH.p(e);else{let o=new et(s,this),a=o.u(this.options);o.p(e),this.$(a),this._$AH=o}}_$AC(t){let e=Ur.get(t.strings);return e===void 0&&Ur.set(t.strings,e=new Ve(t)),e}T(t){Fr(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,s=0;for(let n of t)s===e.length?e.push(r=new i(this.k(Me()),this.k(Me()),this,this.options)):r=e[s],r._$AI(n),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))}},le=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,n){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,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 n=this.strings,o=!1;if(n===void 0)t=ae(this,t,e,0),o=!Pe(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{let a=t,c,u;for(t=n[0],c=0;c<n.length-1;c++)u=ae(this,a[r+c],e,c),u===P&&(u=this._$AH[c]),o||(o=!Pe(u)||u!==this._$AH[c]),u===E?t=E:t!==E&&(t+=(u!=null?u:"")+n[c+1]),this._$AH[c]=u}o&&!s&&this.O(t)}O(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},tt=class extends le{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===E?void 0:t}},rt=class extends le{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}},st=class extends le{constructor(t,e,r,s,n){super(t,e,r,s,n),this.type=5}_$AI(t,e=this){var o;if((t=(o=ae(this,t,e,0))!=null?o:E)===P)return;let r=this._$AH,s=t===E&&r!==E||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,n=t!==E&&(r===E||s);s&&this.element.removeEventListener(this.name,this,r),n&&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)}},it=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){ae(this,t)}},Kr={j:Bt,P:W,A:Xt,C:1,M:Yr,L:et,R:Br,V:ae,D:ge,I:le,H:rt,N:st,U:tt,B:it},Ft=be.litHtmlPolyfillSupport,Ir;Ft==null||Ft(Ve,ge),((Ir=be.litHtmlVersions)!=null?Ir:be.litHtmlVersions=[]).push("3.1.0");var Wr=(i,t,e)=>{var n,o;let r=(n=e==null?void 0:e.renderBefore)!=null?n:t,s=r._$litPart$;if(s===void 0){let a=(o=e==null?void 0:e.renderBefore)!=null?o:null;r._$litPart$=s=new ge(t.insertBefore(Me(),a),a,void 0,e!=null?e:{})}return s._$AI(i),s};var f=class extends K{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=Wr(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 zt=globalThis.litElementPolyfillSupport;zt==null||zt({LitElement:f});var Jr;((Jr=globalThis.litElementVersions)!=null?Jr:globalThis.litElementVersions=[]).push("4.0.2");var _=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};var Is={attribute:!0,type:String,converter:Te,reflect:!1,hasChanged:Ze},Fs=(i=Is,t,e)=>{let{kind:r,metadata:s}=e,n=globalThis.litPropertyMetadata.get(s);if(n===void 0&&globalThis.litPropertyMetadata.set(s,n=new Map),n.set(e.name,i),r==="accessor"){let{name:o}=e;return{set(a){let c=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,c,i)},init(a){return a!==void 0&&this.C(o,void 0,i),a}}}if(r==="setter"){let{name:o}=e;return function(a){let c=this[o];t.call(this,a),this.requestUpdate(o,c,i)}}throw Error("Unsupported decorator location: "+r)};function p(i){return(t,e)=>typeof e=="object"?Fs(i,t,e):((r,s,n)=>{let o=s.hasOwnProperty(n);return s.constructor.createProperty(n,o?R(x({},r),{wrapped:!0}):r),o?Object.getOwnPropertyDescriptor(s,n):void 0})(i,t,e)}function C(i){return p(R(x({},i),{state:!0,attribute:!1}))}var ee=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(i,t,e),e);function Ne(i,t){return(e,r,s)=>{let n=o=>{var a,c;return(c=(a=o.renderRoot)==null?void 0:a.querySelector(i))!=null?c:null};if(t){let{get:o,set:a}=typeof r=="object"?e:s!=null?s:(()=>{let c=Symbol();return{get(){return this[c]},set(u){this[c]=u}}})();return ee(e,r,{get(){let c=o.call(this);return c===void 0&&(c=n(this),(c!==null||this.hasUpdated)&&a.call(this,c)),c}})}return ee(e,r,{get(){return n(this)}})}}function Zr(i){return(t,e)=>{let{slot:r,selector:s}=i!=null?i:{},n="slot"+(r?`[name=${r}]`:":not([name])");return ee(t,e,{get(){var c,u;let o=(c=this.renderRoot)==null?void 0:c.querySelector(n),a=(u=o==null?void 0:o.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:n}=r,o=Array.isArray(i)?i:[i];r.update=function(a){o.forEach(c=>{let u=c;if(a.has(u)){let h=a.get(u),m=this[u];h!==m&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[s](h,m)}}),n.call(this,a)}}}var Qr=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],I="item";var T=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:Qr};this._state="item-created";this._initialContext=R(x({},this._context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];DEBUG&&console.group("qti-assessment-item"),this.state="item-created",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)}set state(e){this._state=e,DEBUG&&console.info(`item: %c${this._state}`,"background: #222; color: #bada55")}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(n=>n.identifier===r.identifier);return s?x(x({},r),s):r})}),this._context.variables.forEach(r=>{if(r.type==="response"){let s=this._interactionElements.find(n=>n.responseIdentifier===r.identifier);s&&(s.response=r.value)}r.type==="outcome"&&this._feedbackElements.forEach(s=>s.checkShowFeedback(r.identifier))})}firstUpdated(e){this.state="first-updated",DEBUG&&console.groupEnd(),this._emit("qti-assessment-item-first-updated",this)}connectedCallback(){super.connectedCallback(),this.state="item-connected"}set responses(e){if(e)for(let r of e){this.getResponse(r.responseIdentifier)&&this.updateResponseVariable(r.responseIdentifier,r.response);let n=this._interactionElements.find(o=>o.getAttribute("response-identifier")===r.responseIdentifier);n&&(n.response=r.response)}}render(){return d`<slot></slot>`}showCorrectResponse(e){let s=this._context.variables.filter(n=>"correctResponse"in n&&n.correctResponse).map(n=>({responseIdentifier:n.identifier,response:n.correctResponse}));for(let n of s){let o=this._interactionElements.find(a=>a.getAttribute("response-identifier")===n.responseIdentifier);o&&(o.correctResponse=e?n.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(n=>n.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 n;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(o=>o.identifier!==e?o:R(x({},o),{value:s.cardinality==="single"?r:[...o.value,r]}))}),this._feedbackElements.forEach(o=>o.checkShowFeedback(e)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:e,value:(n=this._context.variables.find(o=>o.identifier===e))==null?void 0:n.value})}_getCompletionStatus(){return this._interactionElements.every(e=>e.validate())?"completed":this._interactionElements.some(e=>e.validate())?"incomplete":"not_attempted"}_emit(e,r=null){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:r}))}};l([p({type:String})],T.prototype,"title",2),l([p({type:String})],T.prototype,"identifier",2),l([p({type:String})],T.prototype,"adaptive",2),l([p({type:String})],T.prototype,"timeDependent",2),l([p({type:Boolean})],T.prototype,"disabled",2),l([w("disabled",{waitUntilFirstUpdate:!0})],T.prototype,"_handleDisabledChange",2),l([p({type:Boolean})],T.prototype,"readonly",2),l([w("readonly",{waitUntilFirstUpdate:!0})],T.prototype,"_handleReadonlyChange",2),l([Nt({context:I}),p({attribute:!1})],T.prototype,"_context",2),l([p({type:String,reflect:!0,attribute:"state"})],T.prototype,"_state",2),T=l([_("qti-assessment-item")],T);var Bs=Symbol.for(""),Xs=i=>{if((i==null?void 0:i.r)===Bs)return i==null?void 0:i._$litStatic$};var es=new Map,ts=i=>(t,...e)=>{let r=e.length,s,n,o=[],a=[],c,u=0,h=!1;for(;u<r;){for(c=t[u];u<r&&(n=e[u],(s=Xs(n))!==void 0);)c+=s+t[++u],h=!0;u!==r&&a.push(n),o.push(c),u++}if(u===r&&o.push(t[r]),h){let m=o.join("$$lit$$");(t=es.get(m))===void 0&&(o.raw=o,es.set(m,t=o)),e=a}return i(t,...e)},rs=ts(d),tn=ts(He);var zs={SPACE:32},L=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 zs.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> `}};l([p({type:String})],L.prototype,"identifier",2),l([p({type:Number,reflect:!0})],L.prototype,"tabindex",2),l([p({reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:e=>e}})],L.prototype,"disabled",2),l([p({reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:e=>e}})],L.prototype,"readonly",2),l([p({reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:e=>e}})],L.prototype,"checked",2),l([w("disabled",{waitUntilFirstUpdate:!0})],L.prototype,"handleDisabledChange",1);var ss=b`
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Dr=/'/g,Or=/"/g,Xr=/^(?:script|style|textarea|title)$/i,zr=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),d=zr(1),He=zr(2),P=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),Ur=new WeakMap,oe=ne.createTreeWalker(ne,129);function jr(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vr!==void 0?Vr.createHTML(t):t}var Yr=(i,t)=>{let e=i.length-1,r=[],s,n=t===2?"<svg>":"",o=Le;for(let a=0;a<e;a++){let c=i[a],u,h,m=-1,y=0;for(;y<c.length&&(o.lastIndex=y,h=o.exec(c),h!==null);)y=o.lastIndex,o===Le?h[1]==="!--"?o=Hr:h[1]!==void 0?o=Nr:h[2]!==void 0?(Xr.test(h[2])&&(s=RegExp("</"+h[2],"g")),o=ie):h[3]!==void 0&&(o=ie):o===ie?h[0]===">"?(o=s!=null?s:Le,m=-1):h[1]===void 0?m=-2:(m=o.lastIndex-h[2].length,u=h[1],o=h[3]===void 0?ie:h[3]==='"'?Or:Dr):o===Or||o===Dr?o=ie:o===Hr||o===Nr?o=Le:(o=ie,s=void 0);let g=o===ie&&i[a+1].startsWith("/>")?" ":"";n+=o===Le?c+Us:m>=0?(r.push(u),c.slice(0,m)+Bt+c.slice(m)+W+g):c+W+(m===-2?a:g)}return[jr(i,n+(i[e]||"<?>")+(t===2?"</svg>":"")),r]},Ve=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let n=0,o=0,a=t.length-1,c=this.parts,[u,h]=Yr(t,e);if(this.el=i.createElement(u,r),oe.currentNode=this.el.content,e===2){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(s=oe.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let m of s.getAttributeNames())if(m.endsWith(Bt)){let y=h[o++],g=s.getAttribute(m).split(W),q=/([.?@])?(.*)/.exec(y);c.push({type:1,index:n,name:q[2],strings:g,ctor:q[1]==="."?tt:q[1]==="?"?rt:q[1]==="@"?st:le}),s.removeAttribute(m)}else m.startsWith(W)&&(c.push({type:6,index:n}),s.removeAttribute(m));if(Xr.test(s.tagName)){let m=s.textContent.split(W),y=m.length-1;if(y>0){s.textContent=Qe?Qe.emptyScript:"";for(let g=0;g<y;g++)s.append(m[g],Me()),oe.nextNode(),c.push({type:2,index:++n});s.append(m[y],Me())}}}else if(s.nodeType===8)if(s.data===Xt)c.push({type:2,index:n});else{let m=-1;for(;(m=s.data.indexOf(W,m+1))!==-1;)c.push({type:7,index:n}),m+=W.length-1}n++}}static createElement(t,e){let r=ne.createElement("template");return r.innerHTML=t,r}};function ae(i,t,e=i,r){var o,a,c;if(t===P)return t;let s=r!==void 0?(o=e._$Co)==null?void 0:o[r]:e._$Cl,n=Pe(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==n&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),n===void 0?s=void 0:(s=new n(i),s._$AT(i,e,r)),r!==void 0?((c=e._$Co)!=null?c:e._$Co=[])[r]=s:e._$Cl=s),s!==void 0&&(t=ae(i,s._$AS(i,t.values),s,r)),t}var et=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:ne).importNode(e,!0);oe.currentNode=s;let n=oe.nextNode(),o=0,a=0,c=r[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new ge(n,n.nextSibling,this,t):c.type===1?h=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(h=new it(n,this,t)),this._$AV.push(h),c=r[++a]}o!==(c==null?void 0:c.index)&&(n=oe.nextNode(),o++)}return oe.currentNode=ne,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++}},ge=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 n;this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=(n=s==null?void 0:s.isConnected)!=null?n:!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=ae(this,t,e),Pe(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):Br(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&&Pe(this._$AH)?this._$AA.nextSibling.data=t:this.$(ne.createTextNode(t)),this._$AH=t}g(t){var n;let{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Ve.createElement(jr(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===s)this._$AH.p(e);else{let o=new et(s,this),a=o.u(this.options);o.p(e),this.$(a),this._$AH=o}}_$AC(t){let e=Ur.get(t.strings);return e===void 0&&Ur.set(t.strings,e=new Ve(t)),e}T(t){Fr(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,s=0;for(let n of t)s===e.length?e.push(r=new i(this.k(Me()),this.k(Me()),this,this.options)):r=e[s],r._$AI(n),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))}},le=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,n){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,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 n=this.strings,o=!1;if(n===void 0)t=ae(this,t,e,0),o=!Pe(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{let a=t,c,u;for(t=n[0],c=0;c<n.length-1;c++)u=ae(this,a[r+c],e,c),u===P&&(u=this._$AH[c]),o||(o=!Pe(u)||u!==this._$AH[c]),u===E?t=E:t!==E&&(t+=(u!=null?u:"")+n[c+1]),this._$AH[c]=u}o&&!s&&this.O(t)}O(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},tt=class extends le{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===E?void 0:t}},rt=class extends le{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}},st=class extends le{constructor(t,e,r,s,n){super(t,e,r,s,n),this.type=5}_$AI(t,e=this){var o;if((t=(o=ae(this,t,e,0))!=null?o:E)===P)return;let r=this._$AH,s=t===E&&r!==E||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,n=t!==E&&(r===E||s);s&&this.element.removeEventListener(this.name,this,r),n&&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)}},it=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){ae(this,t)}},Kr={j:Bt,P:W,A:Xt,C:1,M:Yr,L:et,R:Br,V:ae,D:ge,I:le,H:rt,N:st,U:tt,B:it},Ft=be.litHtmlPolyfillSupport,Ir;Ft==null||Ft(Ve,ge),((Ir=be.litHtmlVersions)!=null?Ir:be.litHtmlVersions=[]).push("3.1.0");var Wr=(i,t,e)=>{var n,o;let r=(n=e==null?void 0:e.renderBefore)!=null?n:t,s=r._$litPart$;if(s===void 0){let a=(o=e==null?void 0:e.renderBefore)!=null?o:null;r._$litPart$=s=new ge(t.insertBefore(Me(),a),a,void 0,e!=null?e:{})}return s._$AI(i),s};var f=class extends K{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=Wr(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}},Jr;f._$litElement$=!0,f.finalized=!0,(Jr=globalThis.litElementHydrateSupport)==null||Jr.call(globalThis,{LitElement:f});var zt=globalThis.litElementPolyfillSupport;zt==null||zt({LitElement:f});var Gr;((Gr=globalThis.litElementVersions)!=null?Gr:globalThis.litElementVersions=[]).push("4.0.2");var _=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};var Is={attribute:!0,type:String,converter:Te,reflect:!1,hasChanged:Ze},Fs=(i=Is,t,e)=>{let{kind:r,metadata:s}=e,n=globalThis.litPropertyMetadata.get(s);if(n===void 0&&globalThis.litPropertyMetadata.set(s,n=new Map),n.set(e.name,i),r==="accessor"){let{name:o}=e;return{set(a){let c=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,c,i)},init(a){return a!==void 0&&this.C(o,void 0,i),a}}}if(r==="setter"){let{name:o}=e;return function(a){let c=this[o];t.call(this,a),this.requestUpdate(o,c,i)}}throw Error("Unsupported decorator location: "+r)};function p(i){return(t,e)=>typeof e=="object"?Fs(i,t,e):((r,s,n)=>{let o=s.hasOwnProperty(n);return s.constructor.createProperty(n,o?R(x({},r),{wrapped:!0}):r),o?Object.getOwnPropertyDescriptor(s,n):void 0})(i,t,e)}function C(i){return p(R(x({},i),{state:!0,attribute:!1}))}var ee=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(i,t,e),e);function Ne(i,t){return(e,r,s)=>{let n=o=>{var a,c;return(c=(a=o.renderRoot)==null?void 0:a.querySelector(i))!=null?c:null};if(t){let{get:o,set:a}=typeof r=="object"?e:s!=null?s:(()=>{let c=Symbol();return{get(){return this[c]},set(u){this[c]=u}}})();return ee(e,r,{get(){let c=o.call(this);return c===void 0&&(c=n(this),(c!==null||this.hasUpdated)&&a.call(this,c)),c}})}return ee(e,r,{get(){return n(this)}})}}function Zr(i){return(t,e)=>{let{slot:r,selector:s}=i!=null?i:{},n="slot"+(r?`[name=${r}]`:":not([name])");return ee(t,e,{get(){var c,u;let o=(c=this.renderRoot)==null?void 0:c.querySelector(n),a=(u=o==null?void 0:o.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:n}=r,o=Array.isArray(i)?i:[i];r.update=function(a){o.forEach(c=>{let u=c;if(a.has(u)){let h=a.get(u),m=this[u];h!==m&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[s](h,m)}}),n.call(this,a)}}}var Qr=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],I="item";var T=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:Qr};this._state="item-created";this._initialContext=R(x({},this._context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];console.info("qti-assessment-item"),this.state="item-created",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)}set state(e){this._state=e,console.info(`item: %c${this._state}`,"background: #222; color: #bada55")}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(n=>n.identifier===r.identifier);return s?x(x({},r),s):r})}),this._context.variables.forEach(r=>{if(r.type==="response"){let s=this._interactionElements.find(n=>n.responseIdentifier===r.identifier);s&&(s.response=r.value)}r.type==="outcome"&&this._feedbackElements.forEach(s=>s.checkShowFeedback(r.identifier))})}firstUpdated(e){this.state="first-updated",this._emit("qti-assessment-item-first-updated",this)}connectedCallback(){super.connectedCallback(),this.state="item-connected"}set responses(e){if(e)for(let r of e){this.getResponse(r.responseIdentifier)&&this.updateResponseVariable(r.responseIdentifier,r.response);let n=this._interactionElements.find(o=>o.getAttribute("response-identifier")===r.responseIdentifier);n&&(n.response=r.response)}}render(){return d`<slot></slot>`}showCorrectResponse(e){let s=this._context.variables.filter(n=>"correctResponse"in n&&n.correctResponse).map(n=>({responseIdentifier:n.identifier,response:n.correctResponse}));for(let n of s){let o=this._interactionElements.find(a=>a.getAttribute("response-identifier")===n.responseIdentifier);o&&(o.correctResponse=e?n.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(n=>n.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}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}updateOutcomeVariable(e,r){var n;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(o=>o.identifier!==e?o:R(x({},o),{value:s.cardinality==="single"?r:[...o.value,r]}))}),this._feedbackElements.forEach(o=>o.checkShowFeedback(e)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:e,value:(n=this._context.variables.find(o=>o.identifier===e))==null?void 0:n.value})}_getCompletionStatus(){return this._interactionElements.every(e=>e.validate())?"completed":this._interactionElements.some(e=>e.validate())?"incomplete":"not_attempted"}_emit(e,r=null){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:r}))}};l([p({type:String})],T.prototype,"title",2),l([p({type:String})],T.prototype,"identifier",2),l([p({type:String})],T.prototype,"adaptive",2),l([p({type:String})],T.prototype,"timeDependent",2),l([p({type:Boolean})],T.prototype,"disabled",2),l([w("disabled",{waitUntilFirstUpdate:!0})],T.prototype,"_handleDisabledChange",2),l([p({type:Boolean})],T.prototype,"readonly",2),l([w("readonly",{waitUntilFirstUpdate:!0})],T.prototype,"_handleReadonlyChange",2),l([Nt({context:I}),p({attribute:!1})],T.prototype,"_context",2),l([p({type:String,reflect:!0,attribute:"state"})],T.prototype,"_state",2),T=l([_("qti-assessment-item")],T);var Bs=Symbol.for(""),Xs=i=>{if((i==null?void 0:i.r)===Bs)return i==null?void 0:i._$litStatic$};var es=new Map,ts=i=>(t,...e)=>{let r=e.length,s,n,o=[],a=[],c,u=0,h=!1;for(;u<r;){for(c=t[u];u<r&&(n=e[u],(s=Xs(n))!==void 0);)c+=s+t[++u],h=!0;u!==r&&a.push(n),o.push(c),u++}if(u===r&&o.push(t[r]),h){let m=o.join("$$lit$$");(t=es.get(m))===void 0&&(o.raw=o,es.set(m,t=o)),e=a}return i(t,...e)},rs=ts(d),tn=ts(He);var zs={SPACE:32},L=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 zs.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> `}};l([p({type:String})],L.prototype,"identifier",2),l([p({type:Number,reflect:!0})],L.prototype,"tabindex",2),l([p({reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:e=>e}})],L.prototype,"disabled",2),l([p({reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:e=>e}})],L.prototype,"readonly",2),l([p({reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:e=>e}})],L.prototype,"checked",2),l([w("disabled",{waitUntilFirstUpdate:!0})],L.prototype,"handleDisabledChange",1);var ss=b`
|
|
4
4
|
:host {
|
|
5
5
|
display: block;
|
|
6
6
|
}
|
|
@@ -40,7 +40,7 @@ var Er=Object.defineProperty,Cs=Object.defineProperties,As=Object.getOwnProperty
|
|
|
40
40
|
.off {
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
|
-
`;customElements.define("qti-modal-feedback",pt);var B=i=>i!=null?i:E;var $=class extends f{constructor(){super(...arguments);this.responseIdentifier="";this.disabled=!1;this.readonly=!1}set correctResponse(e){console.warn("correctResponse is not implemented")}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}saveResponse(e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,cancelable:!1,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:e}}))}};l([p({attribute:"response-identifier"})],$.prototype,"responseIdentifier",2),l([p({reflect:!0,type:Boolean})],$.prototype,"disabled",2),l([p({reflect:!0,type:Boolean})],$.prototype,"readonly",2);var{D:Ys}=Kr;var os=i=>i.strings===void 0,is=()=>document.createComment(""),ye=(i,t,e)=>{var n;let r=i._$AA.parentNode,s=t===void 0?i._$AB:t._$AA;if(e===void 0){let o=r.insertBefore(is(),s),a=r.insertBefore(is(),s);e=new Ys(o,a,i,i.options)}else{let o=e._$AB.nextSibling,a=e._$AM,c=a!==i;if(c){let u;(n=e._$AQ)==null||n.call(e,i),e._$AM=i,e._$AP!==void 0&&(u=i._$AU)!==a._$AU&&e._$AP(u)}if(o!==s||c){let u=e._$AA;for(;u!==o;){let h=u.nextSibling;r.insertBefore(u,s),u=h}}}return e},se=(i,t,e=i)=>(i._$AI(t,e),i),Ks={},ns=(i,t=Ks)=>i._$AH=t,as=i=>i._$AH,dt=i=>{var r;(r=i._$AP)==null||r.call(i,!1,!0);let t=i._$AA,e=i._$AB.nextSibling;for(;t!==e;){let s=t.nextSibling;t.remove(),t=s}};var
|
|
43
|
+
`;customElements.define("qti-modal-feedback",pt);var B=i=>i!=null?i:E;var $=class extends f{constructor(){super(...arguments);this.responseIdentifier="";this.disabled=!1;this.readonly=!1}set correctResponse(e){console.warn("correctResponse is not implemented")}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}saveResponse(e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,cancelable:!1,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:e}}))}};l([p({attribute:"response-identifier"})],$.prototype,"responseIdentifier",2),l([p({reflect:!0,type:Boolean})],$.prototype,"disabled",2),l([p({reflect:!0,type:Boolean})],$.prototype,"readonly",2);var{D:Ys}=Kr;var os=i=>i.strings===void 0,is=()=>document.createComment(""),ye=(i,t,e)=>{var n;let r=i._$AA.parentNode,s=t===void 0?i._$AB:t._$AA;if(e===void 0){let o=r.insertBefore(is(),s),a=r.insertBefore(is(),s);e=new Ys(o,a,i,i.options)}else{let o=e._$AB.nextSibling,a=e._$AM,c=a!==i;if(c){let u;(n=e._$AQ)==null||n.call(e,i),e._$AM=i,e._$AP!==void 0&&(u=i._$AU)!==a._$AU&&e._$AP(u)}if(o!==s||c){let u=e._$AA;for(;u!==o;){let h=u.nextSibling;r.insertBefore(u,s),u=h}}}return e},se=(i,t,e=i)=>(i._$AI(t,e),i),Ks={},ns=(i,t=Ks)=>i._$AH=t,as=i=>i._$AH,dt=i=>{var r;(r=i._$AP)==null||r.call(i,!1,!0);let t=i._$AA,e=i._$AB.nextSibling;for(;t!==e;){let s=t.nextSibling;t.remove(),t=s}};var J={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},G=i=>(...t)=>({_$litDirective$:i,values:t}),U=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var Oe=(i,t)=>{var r;let e=i._$AN;if(e===void 0)return!1;for(let s of e)(r=s._$AO)==null||r.call(s,t,!1),Oe(s,t);return!0},ut=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while((e==null?void 0:e.size)===0)},ls=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),Gs(t)}};function Ws(i){this._$AN!==void 0?(ut(this),this._$AM=i,ls(this)):this._$AM=i}function Js(i,t=!1,e=0){let r=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(r))for(let n=e;n<r.length;n++)Oe(r[n],!1),ut(r[n]);else r!=null&&(Oe(r,!1),ut(r));else Oe(this,i)}var Gs=i=>{var t,e;i.type==J.CHILD&&((t=i._$AP)!=null||(i._$AP=Js),(e=i._$AQ)!=null||(i._$AQ=Ws))},ht=class extends U{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),ls(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,s;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(s=this.disconnected)==null||s.call(this)),e&&(Oe(this,t),ut(this))}setValue(t){if(os(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var mt=()=>new Wt,Wt=class{},Kt=new WeakMap,cs=G(class extends ht{render(i){return E}update(i,[t]){var r;let e=t!==this.G;return e&&this.G!==void 0&&this.ot(void 0),(e||this.rt!==this.lt)&&(this.G=t,this.ct=(r=i.options)==null?void 0:r.host,this.ot(this.lt=i.element)),E}ot(i){var t;if(typeof this.G=="function"){let e=(t=this.ct)!=null?t:globalThis,r=Kt.get(e);r===void 0&&(r=new WeakMap,Kt.set(e,r)),r.get(this.G)!==void 0&&this.G.call(this.ct,void 0),r.set(this.G,i),i!==void 0&&this.G.call(this.ct,i)}else this.G.value=i}get rt(){var i,t,e;return typeof this.G=="function"?(t=Kt.get((i=this.ct)!=null?i:globalThis))==null?void 0:t.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});var X=class extends ${constructor(){super(...arguments);this.textareaRef=mt();this._value=""}handleclassNamesChange(e,r){this.classNames.split(" ").forEach(n=>{if(n.startsWith("qti-height-lines")){let o=n.replace("qti-height-lines-","");this.textareaRef&&(this.textareaRef.value.rows=parseInt(o))}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
|
|
44
44
|
/* PK: display host as block, else design will be collapsed */
|
|
45
45
|
:host {
|
|
46
46
|
display: block;
|
|
@@ -94,7 +94,7 @@ var Er=Object.defineProperty,Cs=Object.defineProperties,As=Object.getOwnProperty
|
|
|
94
94
|
?disabled="${this.disabled}"
|
|
95
95
|
?readonly="${this.readonly}"
|
|
96
96
|
/>
|
|
97
|
-
`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};l([p({type:Number,attribute:"expected-length"})],H.prototype,"expectedLength",2),l([p({type:String,attribute:"pattern-mask"})],H.prototype,"patternMask",2),l([p({type:String,attribute:"placeholder-text"})],H.prototype,"placeholderText",2),l([C()],H.prototype,"_value",2),l([C()],H.prototype,"_correctValue",2),l([C()],H.prototype,"_size",2),l([p({type:String,attribute:"class"})],H.prototype,"classNames",2),l([w("classNames")],H.prototype,"handleclassNamesChange",1),H=l([_("qti-text-entry-interaction")],H);var k=class extends ${constructor(){super();this._choiceElements=[];this.minChoices=0;this.maxChoices=1;this._handleDisabledChange=(e,r)=>this._choiceElements.forEach(s=>s.disabled=r);this._handleReadonlyChange=(e,r)=>this._choiceElements.forEach(s=>s.readonly=r);this._handleMaxChoicesChange=()=>this._determineInputType();this.addEventListener("qti-register-choice",this._registerChoiceElement),this.addEventListener("qti-loose-choice",this._looseChoiceElement)}validate(){return this._choiceElements.reduce((r,s)=>r+(s.checked?1:0),0)>=this.minChoices}set response(e){let r=Array.isArray(e)?e:[e];this._choiceElements.forEach(s=>{s.checked=!!r.find(n=>n===s.identifier)})}set correctResponse(e){let r=Array.isArray(e)?e:[e];if(e==""){this._choiceElements.forEach(s=>{s.removeAttribute("data-correct-response")});return}this._choiceElements.forEach(s=>{s.setAttribute("data-correct-response",r.find(n=>n===s.identifier)?"true":"false")})}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler),this.removeEventListener("qti-register-choice",this._registerChoiceElement)}_registerChoiceElement(e){e.stopPropagation();let r=e.target;this._choiceElements.push(r),this._setInputType(r)}_looseChoiceElement(e){e.stopPropagation();let r=e.target;this._choiceElements.push(r),this._choiceElements=this._choiceElements.filter(s=>s!==r)}_determineInputType(){this._choiceElements.forEach(e=>{this._setInputType(e)})}_setInputType(e){this.maxChoices===1?e.setAttribute("role","radio"):e.setAttribute("role","checkbox")}_choiceElementSelectedHandler(e){this.maxChoices===1&&this._choiceElements.filter(r=>r.identifier!==e.detail.identifier).forEach(r=>{r.checked=!1}),this._choiceElementSelected()}_choiceElementSelected(){let e=this._choiceElements.filter(s=>s.checked).map(s=>s.identifier);this.maxChoices>1&&(this.maxChoices===e.length?this._choiceElements.forEach(s=>s.disabled=!s.checked):this._choiceElements.forEach(s=>s.disabled=!1));let r;this.maxChoices===1?r=e.length>0?e[0]:void 0:r=e,this.saveResponse(r)}};l([p({type:Number,attribute:"min-choices"})],k.prototype,"minChoices",2),l([p({type:Number,attribute:"max-choices"})],k.prototype,"maxChoices",2),l([w("disabled",{waitUntilFirstUpdate:!0})],k.prototype,"_handleDisabledChange",2),l([w("readonly",{waitUntilFirstUpdate:!0})],k.prototype,"_handleReadonlyChange",2),l([w("maxChoices",{waitUntilFirstUpdate:!0})],k.prototype,"_handleMaxChoicesChange",2);var
|
|
97
|
+
`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};l([p({type:Number,attribute:"expected-length"})],H.prototype,"expectedLength",2),l([p({type:String,attribute:"pattern-mask"})],H.prototype,"patternMask",2),l([p({type:String,attribute:"placeholder-text"})],H.prototype,"placeholderText",2),l([C()],H.prototype,"_value",2),l([C()],H.prototype,"_correctValue",2),l([C()],H.prototype,"_size",2),l([p({type:String,attribute:"class"})],H.prototype,"classNames",2),l([w("classNames")],H.prototype,"handleclassNamesChange",1),H=l([_("qti-text-entry-interaction")],H);var k=class extends ${constructor(){super();this._choiceElements=[];this.minChoices=0;this.maxChoices=1;this._handleDisabledChange=(e,r)=>this._choiceElements.forEach(s=>s.disabled=r);this._handleReadonlyChange=(e,r)=>this._choiceElements.forEach(s=>s.readonly=r);this._handleMaxChoicesChange=()=>this._determineInputType();this.addEventListener("qti-register-choice",this._registerChoiceElement),this.addEventListener("qti-loose-choice",this._looseChoiceElement)}validate(){return this._choiceElements.reduce((r,s)=>r+(s.checked?1:0),0)>=this.minChoices}set response(e){let r=Array.isArray(e)?e:[e];this._choiceElements.forEach(s=>{s.checked=!!r.find(n=>n===s.identifier)})}set correctResponse(e){let r=Array.isArray(e)?e:[e];if(e==""){this._choiceElements.forEach(s=>{s.removeAttribute("data-correct-response")});return}this._choiceElements.forEach(s=>{s.setAttribute("data-correct-response",r.find(n=>n===s.identifier)?"true":"false")})}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler),this.removeEventListener("qti-register-choice",this._registerChoiceElement)}_registerChoiceElement(e){e.stopPropagation();let r=e.target;this._choiceElements.push(r),this._setInputType(r)}_looseChoiceElement(e){e.stopPropagation();let r=e.target;this._choiceElements.push(r),this._choiceElements=this._choiceElements.filter(s=>s!==r)}_determineInputType(){this._choiceElements.forEach(e=>{this._setInputType(e)})}_setInputType(e){this.maxChoices===1?e.setAttribute("role","radio"):e.setAttribute("role","checkbox")}_choiceElementSelectedHandler(e){this.maxChoices===1&&this._choiceElements.filter(r=>r.identifier!==e.detail.identifier).forEach(r=>{r.checked=!1}),this._choiceElementSelected()}_choiceElementSelected(){let e=this._choiceElements.filter(s=>s.checked).map(s=>s.identifier);this.maxChoices>1&&(this.maxChoices===e.length?this._choiceElements.forEach(s=>s.disabled=!s.checked):this._choiceElements.forEach(s=>s.disabled=!1));let r;this.maxChoices===1?r=e.length>0?e[0]:void 0:r=e,this.saveResponse(r)}};l([p({type:Number,attribute:"min-choices"})],k.prototype,"minChoices",2),l([p({type:Number,attribute:"max-choices"})],k.prototype,"maxChoices",2),l([w("disabled",{waitUntilFirstUpdate:!0})],k.prototype,"_handleDisabledChange",2),l([w("readonly",{waitUntilFirstUpdate:!0})],k.prototype,"_handleReadonlyChange",2),l([w("maxChoices",{waitUntilFirstUpdate:!0})],k.prototype,"_handleMaxChoicesChange",2);var Jt=class extends k{constructor(){super(...arguments);this.render=()=>d`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("qti-hottext-interaction","")}};customElements.define("qti-hottext-interaction",Jt);var Ue=class extends U{constructor(t){if(super(t),this.et=E,t.type!==J.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===E||t==null)return this.vt=void 0,this.et=t;if(t===P)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.vt;this.et=t;let e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}};Ue.directiveName="unsafeHTML",Ue.resultType=1;var xe=G(Ue);var pe=class extends ${constructor(){super(...arguments);this.options=[];this.correctOption="";this.dataPrompt="select"}static get styles(){return[b`
|
|
98
98
|
:host {
|
|
99
99
|
display: inline-block;
|
|
100
100
|
}
|
|
@@ -165,7 +165,7 @@ var Er=Object.defineProperty,Cs=Object.defineProperties,As=Object.getOwnProperty
|
|
|
165
165
|
:host {
|
|
166
166
|
display: none;
|
|
167
167
|
}
|
|
168
|
-
`],de=l([_("qti-response-processing")],de);var z=class extends f{render(){return d`<slot></slot>`}process(){throw new Error("Not implemented")}};z=l([_("qti-rule")],z);var ft=class extends z{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:De(s)}})),s)}};l([p({type:String})],ft.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",ft);var
|
|
168
|
+
`],de=l([_("qti-response-processing")],de);var z=class extends f{render(){return d`<slot></slot>`}process(){throw new Error("Not implemented")}};z=l([_("qti-rule")],z);var ft=class extends z{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:De(s)}})),s)}};l([p({type:String})],ft.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",ft);var Gt=class extends z{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",Gt);var Zt=class extends z{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=>De(s)):De(r)}}))}};customElements.define("qti-set-outcome-value",Zt);var Ie=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",Ie);var Fe=class extends Ie{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",Fe);var Qt=class extends Fe{render(){return d`${super.render()}`}};customElements.define("qti-response-else-if",Qt);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(n=>n.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>
|
|
169
169
|
<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`
|
|
170
170
|
slot {
|
|
171
171
|
display: none;
|
|
@@ -211,7 +211,7 @@ var Er=Object.defineProperty,Cs=Object.defineProperties,As=Object.getOwnProperty
|
|
|
211
211
|
align-items: flex-start;
|
|
212
212
|
flex: 1;
|
|
213
213
|
}
|
|
214
|
-
`];customElements.define("qti-gap-match-interaction",Ct);function Ce(i,t,e,r){switch(i){case"circle":{let[s,n,o]=t,a=s/e.width*100,c=n/e.height*100,u=o/e.width*100;r.style.left=a-u+"%",r.style.top=c-u+"%",r.style.width=r.style.height=4*u+"px",r.style.borderRadius="9999px"}break;case"rect":{let[s,n,o,a]=t,c=s/e.width*100,u=n/e.height*100,h=o/e.width*100,m=a/e.height*100;r.style.left=c+"%",r.style.top=u+"%",r.style.width=h-c+"%",r.style.height=m-u+"%"}break;case"poly":{let s=t.reduce((A,S,he,Ke)=>{if(he%2===1){let _s=A.pop();A[A.length]={x:_s,y:Ke[he]}}else A.push(S);return A},[]),n=Math.min(...s.map(A=>A.x)),o=Math.max(...s.map(A=>A.x)),a=Math.min(...s.map(A=>A.y)),c=Math.max(...s.map(A=>A.y)),u=n/e.width*100,h=a/e.height*100,m=o/e.width*100,y=c/e.height*100;r.style.left=n/e.width*100+"%",r.style.top=a/e.height*100+"%",r.style.width=m-u+"%",r.style.height=y-h+"%";let q=s.map(A=>({x:(A.x-n)/(o-n)*100,y:(A.y-a)/(c-a)*100})).map(A=>Math.round(A.x)+"% "+Math.round(A.y)+"%").join(",");r.style.clipPath=`polygon(${q})`}break;default:break}}var gs=(i,t,e)=>{let r=new Map;for(let s=t;s<=e;s++)r.set(i[s],s);return r},At=
|
|
214
|
+
`];customElements.define("qti-gap-match-interaction",Ct);function Ce(i,t,e,r){switch(i){case"circle":{let[s,n,o]=t,a=s/e.width*100,c=n/e.height*100,u=o/e.width*100;r.style.left=a-u+"%",r.style.top=c-u+"%",r.style.width=r.style.height=4*u+"px",r.style.borderRadius="9999px"}break;case"rect":{let[s,n,o,a]=t,c=s/e.width*100,u=n/e.height*100,h=o/e.width*100,m=a/e.height*100;r.style.left=c+"%",r.style.top=u+"%",r.style.width=h-c+"%",r.style.height=m-u+"%"}break;case"poly":{let s=t.reduce((A,S,he,Ke)=>{if(he%2===1){let _s=A.pop();A[A.length]={x:_s,y:Ke[he]}}else A.push(S);return A},[]),n=Math.min(...s.map(A=>A.x)),o=Math.max(...s.map(A=>A.x)),a=Math.min(...s.map(A=>A.y)),c=Math.max(...s.map(A=>A.y)),u=n/e.width*100,h=a/e.height*100,m=o/e.width*100,y=c/e.height*100;r.style.left=n/e.width*100+"%",r.style.top=a/e.height*100+"%",r.style.width=m-u+"%",r.style.height=y-h+"%";let q=s.map(A=>({x:(A.x-n)/(o-n)*100,y:(A.y-a)/(c-a)*100})).map(A=>Math.round(A.x)+"% "+Math.round(A.y)+"%").join(",");r.style.clipPath=`polygon(${q})`}break;default:break}}var gs=(i,t,e)=>{let r=new Map;for(let s=t;s<=e;s++)r.set(i[s],s);return r},At=G(class extends U{constructor(i){if(super(i),i.type!==J.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=[],n=[],o=0;for(let a of i)s[o]=r?r(a,o):o,n[o]=e(a,o),o++;return{values:n,keys:s}}render(i,t,e){return this.ht(i,t,e).values}update(i,[t,e,r]){var A;let s=as(i),{values:n,keys:o}=this.ht(t,e,r);if(!Array.isArray(s))return this.dt=o,n;let a=(A=this.dt)!=null?A:this.dt=[],c=[],u,h,m=0,y=s.length-1,g=0,q=n.length-1;for(;m<=y&&g<=q;)if(s[m]===null)m++;else if(s[y]===null)y--;else if(a[m]===o[g])c[g]=se(s[m],n[g]),m++,g++;else if(a[y]===o[q])c[q]=se(s[y],n[q]),y--,q--;else if(a[m]===o[q])c[q]=se(s[m],n[q]),ye(i,c[q+1],s[m]),m++,q--;else if(a[y]===o[g])c[g]=se(s[y],n[g]),ye(i,s[m],s[y]),y--,g++;else if(u===void 0&&(u=gs(o,g,q),h=gs(a,m,y)),u.has(a[m]))if(u.has(a[y])){let S=h.get(o[g]),he=S!==void 0?s[S]:null;if(he===null){let Ke=ye(i,s[m]);se(Ke,n[g]),c[g]=Ke}else c[g]=se(he,n[g]),ye(i,s[m],he),s[S]=null;g++}else dt(s[y]),y--;else dt(s[m]),m++;for(;g<=q;){let S=ye(i,c[q+1]);se(S,n[g]),c[g++]=S}for(;m<=y;){let S=s[m++];S!==null&&dt(S)}return this.dt=o,ns(i,c),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,n;return d`<slot name="prompt"></slot>
|
|
215
215
|
<line-container>
|
|
216
216
|
<svg
|
|
217
217
|
width=${B((e=this.grImage[0])==null?void 0:e.width)}
|
|
@@ -400,7 +400,7 @@ var Er=Object.defineProperty,Cs=Object.defineProperties,As=Object.getOwnProperty
|
|
|
400
400
|
display: inline-block;
|
|
401
401
|
position: relative;
|
|
402
402
|
}
|
|
403
|
-
`];customElements.define("qti-position-object-stage",kt);var vs="important",Qs=" !"+vs,ys=
|
|
403
|
+
`];customElements.define("qti-position-object-stage",kt);var vs="important",Qs=" !"+vs,ys=G(class extends U{constructor(i){var t;if(super(i),i.type!==J.ATTRIBUTE||i.name!=="style"||((t=i.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((t,e)=>{let r=i[e];return r==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(i,[t]){let{style:e}=i.element;if(this.ut===void 0)return this.ut=new Set(Object.keys(t)),this.render(t);for(let r of this.ut)t[r]==null&&(this.ut.delete(r),r.includes("-")?e.removeProperty(r):e[r]=null);for(let r in t){let s=t[r];if(s!=null){this.ut.add(r);let n=typeof s=="string"&&s.endsWith(Qs);r.includes("-")||n?e.setProperty(r,n?s.slice(0,-11):s,n?vs:""):e[r]=s}}return P}});var ue=class extends ${constructor(){super(...arguments);this.maxChoices=0;this.minChoices=0;this._points=[]}render(){return d` <slot name="prompt"></slot>
|
|
404
404
|
<point-container>
|
|
405
405
|
${At(this._points,e=>e,(e,r)=>d`
|
|
406
406
|
<button
|
|
@@ -484,7 +484,7 @@ var Er=Object.defineProperty,Cs=Object.defineProperties,As=Object.getOwnProperty
|
|
|
484
484
|
<xsl:apply-templates/>
|
|
485
485
|
</xsl:element>
|
|
486
486
|
</xsl:template>
|
|
487
|
-
</xsl:stylesheet>`;function ti(i){let t=[];return i.querySelectorAll("qti-assessment-item-ref").forEach(e=>{let r=e.getAttribute("identifier"),s=e.getAttribute("href"),n=e.getAttribute("category");t.push({identifier:r,href:s,category:n})}),t}function xs(i){return new Promise((t,e)=>{let r=new XMLHttpRequest;r.open("GET",i,!0),r.responseType="document",r.onload=()=>r.status>=200&&r.status<300?t(r.responseXML):(e(r.statusText),null),r.onerror=function(){e(r.statusText)},r.send()})}function ri(i){return new DOMParser().parseFromString(i,"text/xml")}function Es(i){let t=new XSLTProcessor,e=new DOMParser().parseFromString(ei,"text/xml");t.importStylesheet(e);let r=t.transformToFragment(i,document);return new XMLSerializer().serializeToString(r)}function si(i,t){i.querySelectorAll("[src],[href]").forEach(e=>{var n;let r="";e.getAttribute("src")&&(r="src"),e.getAttribute("href")&&(r="href");let s=(n=e.getAttribute(r))==null?void 0:n.trim();if(!s.startsWith("data:")&&!s.startsWith("http")){let o=t+encodeURI(s);e.setAttribute(r,o)}})}export{$ as Interaction,Be as QtPrintedVariable,bt as QtiAnd,T as QtiAssessmentItem,Tt as QtiAssociableHotspot,Xe as QtiAssociateInteraction,gt as QtiBaseValue,L as QtiChoice,Ee as QtiChoiceInteraction,nt as QtiCompanionMaterialsInfo,N as QtiConditionExpression,er as QtiContains,at as QtiContentBody,tr as QtiCorrect,Ye as QtiCustomOperator,$e as QtiEndAttemptInteraction,yt as QtiEqual,vt as QtiEqualRounded,v as QtiExpression,X as QtiExtendedTextInteraction,lt as QtiFeedbackBlock,ct as QtiFeedbackInline,Lt as QtiGap,Mt as QtiGapImg,Ct as QtiGapMatchInteraction,Pt as QtiGapText,Z as QtiGraphicAssociateInteraction,qt as QtiGraphicGapMatchInteraction,$t as QtiGraphicOrderInteraction,rr as QtiGt,sr as QtiGte,ze as QtiHotspotChoice,wt as QtiHotspotInteraction,Vt as QtiHottext,
|
|
487
|
+
</xsl:stylesheet>`;function ti(i){let t=[];return i.querySelectorAll("qti-assessment-item-ref").forEach(e=>{let r=e.getAttribute("identifier"),s=e.getAttribute("href"),n=e.getAttribute("category");t.push({identifier:r,href:s,category:n})}),t}function xs(i){return new Promise((t,e)=>{let r=new XMLHttpRequest;r.open("GET",i,!0),r.responseType="document",r.onload=()=>r.status>=200&&r.status<300?t(r.responseXML):(e(r.statusText),null),r.onerror=function(){e(r.statusText)},r.send()})}function ri(i){return new DOMParser().parseFromString(i,"text/xml")}function Es(i){let t=new XSLTProcessor,e=new DOMParser().parseFromString(ei,"text/xml");t.importStylesheet(e);let r=t.transformToFragment(i,document);return new XMLSerializer().serializeToString(r)}function si(i,t){i.querySelectorAll("[src],[href]").forEach(e=>{var n;let r="";e.getAttribute("src")&&(r="src"),e.getAttribute("href")&&(r="href");let s=(n=e.getAttribute(r))==null?void 0:n.trim();if(!s.startsWith("data:")&&!s.startsWith("http")){let o=t+encodeURI(s);e.setAttribute(r,o)}})}export{$ as Interaction,Be as QtPrintedVariable,bt as QtiAnd,T as QtiAssessmentItem,Tt as QtiAssociableHotspot,Xe as QtiAssociateInteraction,gt as QtiBaseValue,L as QtiChoice,Ee as QtiChoiceInteraction,nt as QtiCompanionMaterialsInfo,N as QtiConditionExpression,er as QtiContains,at as QtiContentBody,tr as QtiCorrect,Ye as QtiCustomOperator,$e as QtiEndAttemptInteraction,yt as QtiEqual,vt as QtiEqualRounded,v as QtiExpression,X as QtiExtendedTextInteraction,lt as QtiFeedbackBlock,ct as QtiFeedbackInline,Lt as QtiGap,Mt as QtiGapImg,Ct as QtiGapMatchInteraction,Pt as QtiGapText,Z as QtiGraphicAssociateInteraction,qt as QtiGraphicGapMatchInteraction,$t as QtiGraphicOrderInteraction,rr as QtiGt,sr as QtiGte,ze as QtiHotspotChoice,wt as QtiHotspotInteraction,Vt as QtiHottext,Jt as QtiHottextInteraction,vr as QtiInlineChoice,pe as QtiInlineChoiceInteraction,ir as QtiIsNull,ft as QtiLookupOutcomeValue,or as QtiLt,nr as QtiLte,xt as QtiMapResponse,_e as QtiMapping,ar as QtiMatch,Ae as QtiMatchInteraction,St as QtiMediaInteraction,lr as QtiMember,pt as QtiModalFeedback,cr as QtiMultiple,pr as QtiNot,dr as QtiOr,qe as QtiOrderInteraction,ur as QtiOrdered,te as QtiOutcomeDeclaration,br as QtiPortableCustomInteraction,kt as QtiPositionObjectStage,hr as QtiProduct,ot as QtiPrompt,Gt as QtiResponseCondition,re as QtiResponseDeclaration,Ie as QtiResponseElse,Qt as QtiResponseElseIf,Fe as QtiResponseIf,de as QtiResponseProcessing,F as QtiRubricBlock,z as QtiRule,Rt as QtiSPositionObjectInteraction,ue as QtiSelectPointInteraction,Zt as QtiSetOutcomeValue,gr as QtiSimpleAssociableChoice,je as QtiSimpleChoice,M as QtiSliderInteraction,Et as QtiStringMatch,jt as QtiStylesheet,mr as QtiSum,H as QtiTextEntryInteraction,fr as QtiVariable,I as itemContext,Qr as itemContextVariables,Zs as qtiAndMixin,nf as qtiTransformItem,af as qtiTransformTest};
|
|
488
488
|
/*! Bundled license information:
|
|
489
489
|
|
|
490
490
|
@lit/context/lib/context-request-event.js:
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{a as f,b as A,c as n}from"../chunk-BKTGSVMP.js";import{provide as Tr}from"@lit/context";import{LitElement as Rr,html as Sr}from"lit";import{customElement as Lr,property as P}from"lit/decorators.js";function y(a,i){let e=f({waitUntilFirstUpdate:!1},i);return(t,r)=>{let{update:s}=t,o=Array.isArray(a)?a:[a];t.update=function(c){o.forEach(l=>{let p=l;if(c.has(p)){let d=c.get(p),u=this[p];d!==u&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[r](d,u)}}),s.call(this,c)}}}import{createContext as $r}from"@lit/context";var Ft=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],S=$r("item");var _=class extends Rr{constructor(){super();this.identifier="";this.adaptive="false";this.timeDependent="false";this._handleDisabledChange=(e,t)=>{this._interactionElements.forEach(r=>r.disabled=t)};this._handleReadonlyChange=(e,t)=>this._interactionElements.forEach(r=>r.readonly=t);this._context={identifier:this.getAttribute("identifier"),variables:Ft};this._state="item-created";this._initialContext=A(f({},this._context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];this.state="item-created",this.addEventListener("qti-register-variable",({detail:e})=>{this._context=A(f({},this._context),{variables:[...this._context.variables,e.variable]}),this._initialContext=this._context}),this.addEventListener("qti-register-feedback",e=>{e.stopPropagation();let t=e.detail;this._feedbackElements.push(t),t.checkShowFeedback(t.outcomeIdentifier)}),this.addEventListener("qti-register-interaction",e=>{e.stopPropagation(),this._interactionElements.push(e.target)}),this.addEventListener("end-attempt",e=>{let{responseIdentifier:t,countAttempt:r}=e.detail;this.updateResponseVariable(t,"true"),this.processResponse(r)}),this.addEventListener("qti-set-outcome-value",e=>{let{outcomeIdentifier:t,value:r}=e.detail;this.updateOutcomeVariable(t,r)}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}set state(e){this._state=e}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(t=>!("identifier"in t))){console.warn("variables property should be an array of VariableDeclaration");return}this._context=A(f({},this._context),{variables:this._context.variables.map(t=>{let r=e.find(s=>s.identifier===t.identifier);return r?f(f({},t),r):t})}),this._context.variables.forEach(t=>{if(t.type==="response"){let r=this._interactionElements.find(s=>s.responseIdentifier===t.identifier);r&&(r.response=t.value)}t.type==="outcome"&&this._feedbackElements.forEach(r=>r.checkShowFeedback(t.identifier))})}firstUpdated(e){this.state="first-updated",this._emit("qti-assessment-item-first-updated",this)}connectedCallback(){super.connectedCallback(),this.state="item-connected"}set responses(e){if(e)for(let t of e){this.getResponse(t.responseIdentifier)&&this.updateResponseVariable(t.responseIdentifier,t.response);let s=this._interactionElements.find(o=>o.getAttribute("response-identifier")===t.responseIdentifier);s&&(s.response=t.response)}}render(){return Sr`<slot></slot>`}showCorrectResponse(e){let r=this._context.variables.filter(s=>"correctResponse"in s&&s.correctResponse).map(s=>({responseIdentifier:s.identifier,response:s.correctResponse}));for(let s of r){let o=this._interactionElements.find(c=>c.getAttribute("response-identifier")===s.responseIdentifier);o&&(o.correctResponse=e?s.response:"")}}processResponse(e=!0){var r;let t=this.querySelector("qti-response-processing");return t?t.process?(t.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),e&&this.updateOutcomeVariable("numAttempts",(+((r=this._context.variables.find(s=>s.identifier==="numAttempts"))==null?void 0:r.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(t=>t.identifier===e)||null}handleUpdateResponseVariable(e){let{responseIdentifier:t,response:r}=e.detail;this.updateResponseVariable(t,r)}updateResponseVariable(e,t){this._context=A(f({},this._context),{variables:this._context.variables.map(r=>r.identifier!==e?r:A(f({},r),{value:t}))}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:e,response:t})}updateOutcomeVariable(e,t){var s;let r=this.getOutcome(e);if(!r){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}this._context=A(f({},this._context),{variables:this._context.variables.map(o=>o.identifier!==e?o:A(f({},o),{value:r.cardinality==="single"?t:[...o.value,t]}))}),this._feedbackElements.forEach(o=>o.checkShowFeedback(e)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:e,value:(s=this._context.variables.find(o=>o.identifier===e))==null?void 0:s.value})}_getCompletionStatus(){return this._interactionElements.every(e=>e.validate())?"completed":this._interactionElements.some(e=>e.validate())?"incomplete":"not_attempted"}_emit(e,t=null){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}};n([P({type:String})],_.prototype,"title",2),n([P({type:String})],_.prototype,"identifier",2),n([P({type:String})],_.prototype,"adaptive",2),n([P({type:String})],_.prototype,"timeDependent",2),n([P({type:Boolean})],_.prototype,"disabled",2),n([y("disabled",{waitUntilFirstUpdate:!0})],_.prototype,"_handleDisabledChange",2),n([P({type:Boolean})],_.prototype,"readonly",2),n([y("readonly",{waitUntilFirstUpdate:!0})],_.prototype,"_handleReadonlyChange",2),n([Tr({context:S}),P({attribute:!1})],_.prototype,"_context",2),n([P({type:String,reflect:!0,attribute:"state"})],_.prototype,"_state",2),_=n([Lr("qti-assessment-item")],_);import{html as Mr}from"lit/static-html.js";import{property as ae}from"lit/decorators.js";import{LitElement as Vr}from"lit";var Nr={SPACE:32},C=class extends Vr{constructor(){super(...arguments);this.tabindex=0;this.disabled=!1;this.readonly=!1;this.checked=!1}handleDisabledChange(e,t){t?(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 Nr.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"),Mr` <slot></slot> `}};n([ae({type:String})],C.prototype,"identifier",2),n([ae({type:Number,reflect:!0})],C.prototype,"tabindex",2),n([ae({reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:e=>e}})],C.prototype,"disabled",2),n([ae({reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:e=>e}})],C.prototype,"readonly",2),n([ae({reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:e=>e}})],C.prototype,"checked",2),n([y("disabled",{waitUntilFirstUpdate:!0})],C.prototype,"handleDisabledChange",1);import{customElement as Dr}from"lit/decorators.js";import{html as Pr,LitElement as Or}from"lit";import{css as Hr}from"lit";var
|
|
1
|
+
import{a as f,b as A,c as n}from"../chunk-BKTGSVMP.js";import{provide as Tr}from"@lit/context";import{LitElement as Rr,html as Sr}from"lit";import{customElement as Lr,property as P}from"lit/decorators.js";function y(a,i){let e=f({waitUntilFirstUpdate:!1},i);return(t,r)=>{let{update:s}=t,o=Array.isArray(a)?a:[a];t.update=function(c){o.forEach(l=>{let p=l;if(c.has(p)){let d=c.get(p),u=this[p];d!==u&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[r](d,u)}}),s.call(this,c)}}}import{createContext as $r}from"@lit/context";var Ft=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],S=$r("item");var _=class extends Rr{constructor(){super();this.identifier="";this.adaptive="false";this.timeDependent="false";this._handleDisabledChange=(e,t)=>{this._interactionElements.forEach(r=>r.disabled=t)};this._handleReadonlyChange=(e,t)=>this._interactionElements.forEach(r=>r.readonly=t);this._context={identifier:this.getAttribute("identifier"),variables:Ft};this._state="item-created";this._initialContext=A(f({},this._context),{variables:this._context.variables});this._feedbackElements=[];this._interactionElements=[];console.info("qti-assessment-item"),this.state="item-created",this.addEventListener("qti-register-variable",({detail:e})=>{this._context=A(f({},this._context),{variables:[...this._context.variables,e.variable]}),this._initialContext=this._context}),this.addEventListener("qti-register-feedback",e=>{e.stopPropagation();let t=e.detail;this._feedbackElements.push(t),t.checkShowFeedback(t.outcomeIdentifier)}),this.addEventListener("qti-register-interaction",e=>{e.stopPropagation(),this._interactionElements.push(e.target)}),this.addEventListener("end-attempt",e=>{let{responseIdentifier:t,countAttempt:r}=e.detail;this.updateResponseVariable(t,"true"),this.processResponse(r)}),this.addEventListener("qti-set-outcome-value",e=>{let{outcomeIdentifier:t,value:r}=e.detail;this.updateOutcomeVariable(t,r)}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}set state(e){this._state=e,console.info(`item: %c${this._state}`,"background: #222; color: #bada55")}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(t=>!("identifier"in t))){console.warn("variables property should be an array of VariableDeclaration");return}this._context=A(f({},this._context),{variables:this._context.variables.map(t=>{let r=e.find(s=>s.identifier===t.identifier);return r?f(f({},t),r):t})}),this._context.variables.forEach(t=>{if(t.type==="response"){let r=this._interactionElements.find(s=>s.responseIdentifier===t.identifier);r&&(r.response=t.value)}t.type==="outcome"&&this._feedbackElements.forEach(r=>r.checkShowFeedback(t.identifier))})}firstUpdated(e){this.state="first-updated",this._emit("qti-assessment-item-first-updated",this)}connectedCallback(){super.connectedCallback(),this.state="item-connected"}set responses(e){if(e)for(let t of e){this.getResponse(t.responseIdentifier)&&this.updateResponseVariable(t.responseIdentifier,t.response);let s=this._interactionElements.find(o=>o.getAttribute("response-identifier")===t.responseIdentifier);s&&(s.response=t.response)}}render(){return Sr`<slot></slot>`}showCorrectResponse(e){let r=this._context.variables.filter(s=>"correctResponse"in s&&s.correctResponse).map(s=>({responseIdentifier:s.identifier,response:s.correctResponse}));for(let s of r){let o=this._interactionElements.find(c=>c.getAttribute("response-identifier")===s.responseIdentifier);o&&(o.correctResponse=e?s.response:"")}}processResponse(e=!0){var r;let t=this.querySelector("qti-response-processing");return t?t.process?(t.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),e&&this.updateOutcomeVariable("numAttempts",(+((r=this._context.variables.find(s=>s.identifier==="numAttempts"))==null?void 0:r.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(t=>t.identifier===e)||null}handleUpdateResponseVariable(e){let{responseIdentifier:t,response:r}=e.detail;this.updateResponseVariable(t,r)}updateResponseVariable(e,t){this._context=A(f({},this._context),{variables:this._context.variables.map(r=>r.identifier!==e?r:A(f({},r),{value:t}))}),this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:e,response:t}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}updateOutcomeVariable(e,t){var s;let r=this.getOutcome(e);if(!r){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}this._context=A(f({},this._context),{variables:this._context.variables.map(o=>o.identifier!==e?o:A(f({},o),{value:r.cardinality==="single"?t:[...o.value,t]}))}),this._feedbackElements.forEach(o=>o.checkShowFeedback(e)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:e,value:(s=this._context.variables.find(o=>o.identifier===e))==null?void 0:s.value})}_getCompletionStatus(){return this._interactionElements.every(e=>e.validate())?"completed":this._interactionElements.some(e=>e.validate())?"incomplete":"not_attempted"}_emit(e,t=null){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}};n([P({type:String})],_.prototype,"title",2),n([P({type:String})],_.prototype,"identifier",2),n([P({type:String})],_.prototype,"adaptive",2),n([P({type:String})],_.prototype,"timeDependent",2),n([P({type:Boolean})],_.prototype,"disabled",2),n([y("disabled",{waitUntilFirstUpdate:!0})],_.prototype,"_handleDisabledChange",2),n([P({type:Boolean})],_.prototype,"readonly",2),n([y("readonly",{waitUntilFirstUpdate:!0})],_.prototype,"_handleReadonlyChange",2),n([Tr({context:S}),P({attribute:!1})],_.prototype,"_context",2),n([P({type:String,reflect:!0,attribute:"state"})],_.prototype,"_state",2),_=n([Lr("qti-assessment-item")],_);import{html as Mr}from"lit/static-html.js";import{property as ae}from"lit/decorators.js";import{LitElement as Vr}from"lit";var Nr={SPACE:32},C=class extends Vr{constructor(){super(...arguments);this.tabindex=0;this.disabled=!1;this.readonly=!1;this.checked=!1}handleDisabledChange(e,t){t?(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 Nr.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"),Mr` <slot></slot> `}};n([ae({type:String})],C.prototype,"identifier",2),n([ae({type:Number,reflect:!0})],C.prototype,"tabindex",2),n([ae({reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:e=>e}})],C.prototype,"disabled",2),n([ae({reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:e=>e}})],C.prototype,"readonly",2),n([ae({reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:e=>e}})],C.prototype,"checked",2),n([y("disabled",{waitUntilFirstUpdate:!0})],C.prototype,"handleDisabledChange",1);import{customElement as Dr}from"lit/decorators.js";import{html as Pr,LitElement as Or}from"lit";import{css as Hr}from"lit";var Xt=Hr`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
}
|
|
5
|
-
`;var W=class extends Or{render(){return Pr`<slot name="qti-rubric-block"></slot><slot></slot>`}};W.styles=
|
|
5
|
+
`;var W=class extends Or{render(){return Pr`<slot name="qti-rubric-block"></slot><slot></slot>`}};W.styles=Xt,W=n([Dr("qti-item-body")],W);import{html as Ur,LitElement as Ir}from"lit";import{customElement as Fr}from"lit/decorators.js";var Ee=class extends Ir{render(){return Ur`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};Ee=n([Fr("qti-prompt")],Ee);import{LitElement as Xr}from"lit";var tt=class extends Xr{constructor(){super()}firstUpdated(e){super.firstUpdated(e);let t=this.closest("qti-assessment-item"),r=this.getAttribute("href");if(r!==null){let s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.media="screen",s.href=r,t.appendChild(s),this.styleLink=s}if(this.textContent!==null){let s=document.createElement("style");s.media="screen",s.textContent=this.textContent,t.appendChild(s),this.styleLink=s}}disconnectedCallback(){let e=this.closest("qti-assessment-item");if(this.styleLink&&this.styleLink.parentElement===this)try{e.removeChild(this.styleLink)}catch(t){}}};customElements.define("qti-stylesheet",tt);import{consume as jr}from"@lit/context";import{css as Kr,html as zr}from"lit";import{property as rt,state as Wr}from"lit/decorators.js";import{html as Yr,LitElement as Br}from"lit";var F=class extends Br{render(){return Yr`<slot></slot>`}defaultValues(i){let e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;let t=e.map(r=>r.innerHTML);return t.length>1||i.cardinality==="multiple"||i.cardinality==="ordered"?t:t[0]}};customElements.define("qti-variabledeclaration",F);var O=class extends F{render(){var t,r;let e=(r=(t=this.itemContext)==null?void 0:t.variables.find(s=>s.identifier===this.identifier))==null?void 0:r.value;return zr`${JSON.stringify(e,null,2)}`}get interpolationTable(){let e=this.querySelector("qti-interpolation-table");if(e){let t=new Map;for(let r of e.querySelectorAll("qti-interpolation-table-entry")){!r.getAttribute("source-value")&&r.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");let s=parseInt(r.getAttribute("source-value")),o=parseInt(r.getAttribute("target-value"));(isNaN(s)||isNaN(o))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),t.set(s,o)}return t}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}}))}};O.styles=[Kr`
|
|
6
6
|
:host {
|
|
7
7
|
display: none;
|
|
8
8
|
}
|
|
9
|
-
`],n([rt({type:String,attribute:"base-type"})],O.prototype,"baseType",2),n([rt({type:String})],O.prototype,"identifier",2),n([rt({type:String})],O.prototype,"cardinality",2),n([jr({context:S,subscribe:!0}),Wr()],O.prototype,"itemContext",2);customElements.define("qti-outcome-declaration",O);import{consume as Qr}from"@lit/context";import{css as ei}from"lit";var J=globalThis,_e=J.trustedTypes,
|
|
10
|
-
\f\r]`,le=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
11
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Kt=/'/g,zt=/"/g,er=/^(?:script|style|textarea|title)$/i,tr=a=>(i,...e)=>({_$litType$:a,strings:i,values:e}),rr=tr(1),qn=tr(2),pe=Symbol.for("lit-noChange"),x=Symbol.for("lit-nothing"),Wt=new WeakMap,
|
|
9
|
+
`],n([rt({type:String,attribute:"base-type"})],O.prototype,"baseType",2),n([rt({type:String})],O.prototype,"identifier",2),n([rt({type:String})],O.prototype,"cardinality",2),n([jr({context:S,subscribe:!0}),Wr()],O.prototype,"itemContext",2);customElements.define("qti-outcome-declaration",O);import{consume as Qr}from"@lit/context";import{css as ei}from"lit";var J=globalThis,_e=J.trustedTypes,Yt=_e?_e.createPolicy("lit-html",{createHTML:a=>a}):void 0,Zt="$lit$",U=`lit$${(Math.random()+"").slice(9)}$`,Gt="?"+U,Jr=`<${Gt}>`,B=J.document===void 0?{createTreeWalker:()=>({})}:document,Ce=()=>B.createComment(""),ce=a=>a===null||typeof a!="object"&&typeof a!="function",Qt=Array.isArray,Zr=a=>Qt(a)||typeof(a==null?void 0:a[Symbol.iterator])=="function",it=`[
|
|
10
|
+
\f\r]`,le=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Bt=/-->/g,jt=/>/g,X=RegExp(`>|${it}(?:([^\\s"'>=/]+)(${it}*=${it}*(?:[^
|
|
11
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Kt=/'/g,zt=/"/g,er=/^(?:script|style|textarea|title)$/i,tr=a=>(i,...e)=>({_$litType$:a,strings:i,values:e}),rr=tr(1),qn=tr(2),pe=Symbol.for("lit-noChange"),x=Symbol.for("lit-nothing"),Wt=new WeakMap,Y=B.createTreeWalker(B,129);function ir(a,i){if(!Array.isArray(a)||!a.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yt!==void 0?Yt.createHTML(i):i}var Gr=(a,i)=>{let e=a.length-1,t=[],r,s=i===2?"<svg>":"",o=le;for(let c=0;c<e;c++){let l=a[c],p,d,u=-1,g=0;for(;g<l.length&&(o.lastIndex=g,d=o.exec(l),d!==null);)g=o.lastIndex,o===le?d[1]==="!--"?o=Bt:d[1]!==void 0?o=jt:d[2]!==void 0?(er.test(d[2])&&(r=RegExp("</"+d[2],"g")),o=X):d[3]!==void 0&&(o=X):o===X?d[0]===">"?(o=r!=null?r:le,u=-1):d[1]===void 0?u=-2:(u=o.lastIndex-d[2].length,p=d[1],o=d[3]===void 0?X:d[3]==='"'?zt:Kt):o===zt||o===Kt?o=X:o===Bt||o===jt?o=le:(o=X,r=void 0);let h=o===X&&a[c+1].startsWith("/>")?" ":"";s+=o===le?l+Jr:u>=0?(t.push(p),l.slice(0,u)+Zt+l.slice(u)+U+h):l+U+(u===-2?c:h)}return[ir(a,s+(a[e]||"<?>")+(i===2?"</svg>":"")),t]},de=class a{constructor({strings:i,_$litType$:e},t){let r;this.parts=[];let s=0,o=0,c=i.length-1,l=this.parts,[p,d]=Gr(i,e);if(this.el=a.createElement(p,t),Y.currentNode=this.el.content,e===2){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(r=Y.nextNode())!==null&&l.length<c;){if(r.nodeType===1){if(r.hasAttributes())for(let u of r.getAttributeNames())if(u.endsWith(Zt)){let g=d[o++],h=r.getAttribute(u).split(U),R=/([.?@])?(.*)/.exec(g);l.push({type:1,index:s,name:R[2],strings:h,ctor:R[1]==="."?nt:R[1]==="?"?at:R[1]==="@"?lt:G}),r.removeAttribute(u)}else u.startsWith(U)&&(l.push({type:6,index:s}),r.removeAttribute(u));if(er.test(r.tagName)){let u=r.textContent.split(U),g=u.length-1;if(g>0){r.textContent=_e?_e.emptyScript:"";for(let h=0;h<g;h++)r.append(u[h],Ce()),Y.nextNode(),l.push({type:2,index:++s});r.append(u[g],Ce())}}}else if(r.nodeType===8)if(r.data===Gt)l.push({type:2,index:s});else{let u=-1;for(;(u=r.data.indexOf(U,u+1))!==-1;)l.push({type:7,index:s}),u+=U.length-1}s++}}static createElement(i,e){let t=B.createElement("template");return t.innerHTML=i,t}};function Z(a,i,e=a,t){var o,c,l;if(i===pe)return i;let r=t!==void 0?(o=e._$Co)==null?void 0:o[t]:e._$Cl,s=ce(i)?void 0:i._$litDirective$;return(r==null?void 0:r.constructor)!==s&&((c=r==null?void 0:r._$AO)==null||c.call(r,!1),s===void 0?r=void 0:(r=new s(a),r._$AT(a,e,t)),t!==void 0?((l=e._$Co)!=null?l:e._$Co=[])[t]=r:e._$Cl=r),r!==void 0&&(i=Z(a,r._$AS(a,i.values),r,t)),i}var ot=class{constructor(i,e){this._$AV=[],this._$AN=void 0,this._$AD=i,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(i){var p;let{el:{content:e},parts:t}=this._$AD,r=((p=i==null?void 0:i.creationScope)!=null?p:B).importNode(e,!0);Y.currentNode=r;let s=Y.nextNode(),o=0,c=0,l=t[0];for(;l!==void 0;){if(o===l.index){let d;l.type===2?d=new qe(s,s.nextSibling,this,i):l.type===1?d=new l.ctor(s,l.name,l.strings,this,i):l.type===6&&(d=new ct(s,this,i)),this._$AV.push(d),l=t[++c]}o!==(l==null?void 0:l.index)&&(s=Y.nextNode(),o++)}return Y.currentNode=B,r}p(i){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(i,t,e),e+=t.strings.length-2):t._$AI(i[e])),e++}},qe=class a{get _$AU(){var i,e;return(e=(i=this._$AM)==null?void 0:i._$AU)!=null?e:this._$Cv}constructor(i,e,t,r){var s;this.type=2,this._$AH=x,this._$AN=void 0,this._$AA=i,this._$AB=e,this._$AM=t,this.options=r,this._$Cv=(s=r==null?void 0:r.isConnected)!=null?s:!0}get parentNode(){let i=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(i==null?void 0:i.nodeType)===11&&(i=e.parentNode),i}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(i,e=this){i=Z(this,i,e),ce(i)?i===x||i==null||i===""?(this._$AH!==x&&this._$AR(),this._$AH=x):i!==this._$AH&&i!==pe&&this._(i):i._$litType$!==void 0?this.g(i):i.nodeType!==void 0?this.$(i):Zr(i)?this.T(i):this._(i)}k(i){return this._$AA.parentNode.insertBefore(i,this._$AB)}$(i){this._$AH!==i&&(this._$AR(),this._$AH=this.k(i))}_(i){this._$AH!==x&&ce(this._$AH)?this._$AA.nextSibling.data=i:this.$(B.createTextNode(i)),this._$AH=i}g(i){var s;let{values:e,_$litType$:t}=i,r=typeof t=="number"?this._$AC(i):(t.el===void 0&&(t.el=de.createElement(ir(t.h,t.h[0]),this.options)),t);if(((s=this._$AH)==null?void 0:s._$AD)===r)this._$AH.p(e);else{let o=new ot(r,this),c=o.u(this.options);o.p(e),this.$(c),this._$AH=o}}_$AC(i){let e=Wt.get(i.strings);return e===void 0&&Wt.set(i.strings,e=new de(i)),e}T(i){Qt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,r=0;for(let s of i)r===e.length?e.push(t=new a(this.k(Ce()),this.k(Ce()),this,this.options)):t=e[r],t._$AI(s),r++;r<e.length&&(this._$AR(t&&t._$AB.nextSibling,r),e.length=r)}_$AR(i=this._$AA.nextSibling,e){var t;for((t=this._$AP)==null?void 0:t.call(this,!1,!0,e);i&&i!==this._$AB;){let r=i.nextSibling;i.remove(),i=r}}setConnected(i){var e;this._$AM===void 0&&(this._$Cv=i,(e=this._$AP)==null||e.call(this,i))}},G=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(i,e,t,r,s){this.type=1,this._$AH=x,this._$AN=void 0,this.element=i,this.name=e,this._$AM=r,this.options=s,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=x}_$AI(i,e=this,t,r){let s=this.strings,o=!1;if(s===void 0)i=Z(this,i,e,0),o=!ce(i)||i!==this._$AH&&i!==pe,o&&(this._$AH=i);else{let c=i,l,p;for(i=s[0],l=0;l<s.length-1;l++)p=Z(this,c[t+l],e,l),p===pe&&(p=this._$AH[l]),o||(o=!ce(p)||p!==this._$AH[l]),p===x?i=x:i!==x&&(i+=(p!=null?p:"")+s[l+1]),this._$AH[l]=p}o&&!r&&this.O(i)}O(i){i===x?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,i!=null?i:"")}},nt=class extends G{constructor(){super(...arguments),this.type=3}O(i){this.element[this.name]=i===x?void 0:i}},at=class extends G{constructor(){super(...arguments),this.type=4}O(i){this.element.toggleAttribute(this.name,!!i&&i!==x)}},lt=class extends G{constructor(i,e,t,r,s){super(i,e,t,r,s),this.type=5}_$AI(i,e=this){var o;if((i=(o=Z(this,i,e,0))!=null?o:x)===pe)return;let t=this._$AH,r=i===x&&t!==x||i.capture!==t.capture||i.once!==t.once||i.passive!==t.passive,s=i!==x&&(t===x||r);r&&this.element.removeEventListener(this.name,this,t),s&&this.element.addEventListener(this.name,this,i),this._$AH=i}handleEvent(i){var e,t;typeof this._$AH=="function"?this._$AH.call((t=(e=this.options)==null?void 0:e.host)!=null?t:this.element,i):this._$AH.handleEvent(i)}},ct=class{constructor(i,e,t){this.element=i,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(i){Z(this,i)}};var st=J.litHtmlPolyfillSupport,Jt;st==null||st(de,qe),((Jt=J.litHtmlVersions)!=null?Jt:J.litHtmlVersions=[]).push("3.1.0");import{property as pt,state as ti}from"lit/decorators.js";var I=class extends F{render(){var t,r;let e=(r=(t=this.itemContext)==null?void 0:t.variables.find(s=>s.identifier===this.identifier))==null?void 0:r.value;return rr`${JSON.stringify(e,null,2)}`}connectedCallback(){super.connectedCallback();let e={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,value:null,type:"response",candidateResponse:null};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}get correctResponse(){let e,t=this.querySelector("qti-correct-response");if(t){let r=t.querySelectorAll("qti-value");if(this.cardinality==="single"&&r.length>0)e=r[0].textContent,r[0].remove();else if(this.cardinality!=="single"){e=[];for(let s=0;s<r.length;s++)e.push(r[s].textContent),r[s].remove()}}return e}get mapping(){return this.querySelector("qti-mapping")}};I.styles=[ei`
|
|
12
12
|
:host {
|
|
13
13
|
display: none;
|
|
14
14
|
}
|
|
@@ -165,7 +165,7 @@ import{a as f,b as A,c as n}from"../chunk-BKTGSVMP.js";import{provide as Tr}from
|
|
|
165
165
|
:host {
|
|
166
166
|
display: none;
|
|
167
167
|
}
|
|
168
|
-
`],K=n([Ui("qti-response-processing")],K);import{property as
|
|
168
|
+
`],K=n([Ui("qti-response-processing")],K);import{property as Yi}from"lit/decorators.js";import{customElement as Ii}from"lit/decorators.js";import{html as Fi,LitElement as Xi}from"lit";var V=class extends Xi{render(){return Fi`<slot></slot>`}process(){throw new Error("Not implemented")}};V=n([Ii("qti-rule")],V);var Ve=class extends V{get childExpression(){return this.firstElementChild}process(){let e=this.getAttribute("identifier"),t=this.closest("qti-assessment-item").getVariable(e),r;return t.interpolationTable&&(r=t.interpolationTable.get(parseInt(this.childExpression.calculate()))),r==null?(console.warn("lookupOutcomeValue: value is null or undefined"),0):(this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:this.identifier,value:ue(r)}})),r)}};n([Yi({type:String})],Ve.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",Ve);import{html as Bi}from"lit";var bt=class extends V{render(){return Bi`<slot></slot>`}process(){let i=[...this.children];for(let e=0;e<i.length;e++){let t=i[e];if(t.calculate()){t.process();return}}}};customElements.define("qti-response-condition",bt);var gt=class extends V{process(){let i=this.getAttribute("identifier"),e=this.firstElementChild,t=e?e.calculate():null;if(t==null){console.warn("setOutcomeValue: value is null or undefined");return}this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:i,value:Array.isArray(t)?t.map(r=>ue(r)):ue(t)}}))}};customElements.define("qti-set-outcome-value",gt);import{LitElement as ji,html as Ki}from"lit";var me=class extends ji{render(){return Ki`<slot></slot>`}calculate(){return!0}getSubRules(){return[...this.children]}process(){let i=this.getSubRules();for(let e=0;e<i.length;e++)i[e].process()}};customElements.define("qti-response-else",me);import{html as zi}from"lit";var he=class extends me{calculate(){return this.firstElementChild.calculate()}getSubRules(){let i=[];for(let e=1;e<this.children.length;e++)i.push(this.children[e]);return i}};customElements.define("qti-response-if",he);var vt=class extends he{render(){return zi`${super.render()}`}};customElements.define("qti-response-else-if",vt);import{LitElement as Wi,css as Ji,html as Zi}from"lit";import{state as Gi}from"lit/decorators.js";var m=class extends Wi{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 t=e.getAttribute("identifier")||"";return this.assessmentItem.getVariable(t)}case"qti-multiple":{let r=e.getResult();return r.length>0?{identifier:"",baseType:r[0].baseType,value:r.map(s=>s.value),cardinality:"multiple",type:"response"}:null}case"qti-correct":{let t=e.getAttribute("identifier")||"",r=this.assessmentItem.getResponse(t);return{baseType:r.baseType,value:r.correctResponse,cardinality:r.cardinality}}default:{try{return{baseType:"integer",value:e.getResult().toString(),cardinality:"single"}}catch(t){console.warn("default not sufficient")}return null}}}).filter(e=>e!==null)}render(){return Zi`<pre>${JSON.stringify(this.result,null,2)}</pre>
|
|
169
169
|
<slot></slot>`}calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}get assessmentItem(){return this.closest("qti-assessment-item")}};m.styles=Ji`
|
|
170
170
|
slot {
|
|
171
171
|
display: none;
|
|
@@ -264,8 +264,8 @@ import{a as f,b as A,c as n}from"../chunk-BKTGSVMP.js";import{provide as Tr}from
|
|
|
264
264
|
top: 0px;
|
|
265
265
|
left: 0px;
|
|
266
266
|
}
|
|
267
|
-
`],n([Dt()],D.prototype,"_lines",2),n([Dt()],D.prototype,"startCoord",2),n([Dt()],D.prototype,"mouseCoord",2),n([_s("svg")],D.prototype,"svgContainer",2),n([Cs({selector:"img"})],D.prototype,"grImage",2);customElements.define("qti-graphic-associate-interaction",D);import{css as As,html as ks,LitElement as ws}from"lit";var
|
|
268
|
-
<slot name="qti-gap-img"></slot>`}positionHotspotOnRegister(i){let e=this.querySelector("img"),t=i.target,r=t.getAttribute("coords"),s=t.getAttribute("shape"),o=r.split(",").map(c=>parseInt(c));switch(s){case"circle":{let[c,l,p]=o;t.style.left=c-p+"px",t.style.top=l-p+"px",t.style.width=t.style.height=2*p+"px"}break;case"rect":{let[c,l,p,d]=o;t.style.left=c+"px",t.style.top=l+"px",t.style.width=p-c+"px",t.style.height=d-l+"px"}break;default:break}}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};
|
|
267
|
+
`],n([Dt()],D.prototype,"_lines",2),n([Dt()],D.prototype,"startCoord",2),n([Dt()],D.prototype,"mouseCoord",2),n([_s("svg")],D.prototype,"svgContainer",2),n([Cs({selector:"img"})],D.prototype,"grImage",2);customElements.define("qti-graphic-associate-interaction",D);import{css as As,html as ks,LitElement as ws}from"lit";var Xe=class extends N(ws,"qti-gap-img",!1,"qti-associable-hotspot"){render(){return ks` <slot></slot>
|
|
268
|
+
<slot name="qti-gap-img"></slot>`}positionHotspotOnRegister(i){let e=this.querySelector("img"),t=i.target,r=t.getAttribute("coords"),s=t.getAttribute("shape"),o=r.split(",").map(c=>parseInt(c));switch(s){case"circle":{let[c,l,p]=o;t.style.left=c-p+"px",t.style.top=l-p+"px",t.style.width=t.style.height=2*p+"px"}break;case"rect":{let[c,l,p,d]=o;t.style.left=c+"px",t.style.top=l+"px",t.style.width=p-c+"px",t.style.height=d-l+"px"}break;default:break}}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};Xe.styles=As`
|
|
269
269
|
:host {
|
|
270
270
|
display: inline-block;
|
|
271
271
|
position: relative;
|
|
@@ -274,12 +274,12 @@ import{a as f,b as A,c as n}from"../chunk-BKTGSVMP.js";import{provide as Tr}from
|
|
|
274
274
|
display: flex;
|
|
275
275
|
gap: 1rem;
|
|
276
276
|
}
|
|
277
|
-
`;customElements.define("qti-graphic-gap-match-interaction",
|
|
277
|
+
`;customElements.define("qti-graphic-gap-match-interaction",Xe);import{css as $s,html as Ts}from"lit";var Ye=class extends E{render(){return Ts`
|
|
278
278
|
<slot name="prompt"></slot>
|
|
279
279
|
<!-- slot for the prompt -->
|
|
280
280
|
<slot></slot>
|
|
281
281
|
<!-- slot for the image and hotspots -->
|
|
282
|
-
`}setHotspotOrder(e){let{identifier:t}=e.detail,r=this._choiceElements.find(o=>o.getAttribute("identifier")===t),s=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){if(this._choiceElements.filter(o=>o.order>0).length>=s){this.choiceOrdering=!1;return}r.order=this._choiceElements.filter(o=>!!o.order).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(o=>(o.order>o.order&&o.order--,o)),r.order=null;this.choiceOrdering=!1}}positionHotspotOnRegister(e){let t=this.querySelector("img"),r=e.target,s=r.getAttribute("coords"),o=r.getAttribute("shape"),c=s.split(",").map(l=>parseInt(l));re(o,c,t,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-choice-element-selected",this.setHotspotOrder),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this.setHotspotOrder),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};
|
|
282
|
+
`}setHotspotOrder(e){let{identifier:t}=e.detail,r=this._choiceElements.find(o=>o.getAttribute("identifier")===t),s=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,r.order==null){if(this._choiceElements.filter(o=>o.order>0).length>=s){this.choiceOrdering=!1;return}r.order=this._choiceElements.filter(o=>!!o.order).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(o=>(o.order>o.order&&o.order--,o)),r.order=null;this.choiceOrdering=!1}}positionHotspotOnRegister(e){let t=this.querySelector("img"),r=e.target,s=r.getAttribute("coords"),o=r.getAttribute("shape"),c=s.split(",").map(l=>parseInt(l));re(o,c,t,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-choice-element-selected",this.setHotspotOrder),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this.setHotspotOrder),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};Ye.styles=[$s`
|
|
283
283
|
slot:not([name='prompt']) {
|
|
284
284
|
position: relative; /* qti-hotspot-choice relative to the slot */
|
|
285
285
|
display: block;
|
|
@@ -290,12 +290,12 @@ import{a as f,b as A,c as n}from"../chunk-BKTGSVMP.js";import{provide as Tr}from
|
|
|
290
290
|
pointer-events: none;
|
|
291
291
|
user-select: none;
|
|
292
292
|
}
|
|
293
|
-
`];customElements.define("qti-graphic-order-interaction",
|
|
293
|
+
`];customElements.define("qti-graphic-order-interaction",Ye);import{css as Rs,html as Ss}from"lit";var Be=class extends E{render(){return Ss`
|
|
294
294
|
<slot name="prompt"></slot>
|
|
295
295
|
<!-- slot for the prompt -->
|
|
296
296
|
<slot></slot>
|
|
297
297
|
<!-- slot for the image and hotspots -->
|
|
298
|
-
`}positionHotspotOnRegister(i){let e=this.querySelector("img"),t=i.target,r=t.getAttribute("coords"),s=t.getAttribute("shape"),o=r.split(",").map(c=>parseInt(c));re(s,o,e,t)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};
|
|
298
|
+
`}positionHotspotOnRegister(i){let e=this.querySelector("img"),t=i.target,r=t.getAttribute("coords"),s=t.getAttribute("shape"),o=r.split(",").map(c=>parseInt(c));re(s,o,e,t)}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-choice",this.positionHotspotOnRegister)}};Be.styles=[Rs`
|
|
299
299
|
slot:not([name='prompt']) {
|
|
300
300
|
position: relative; /* qti-hotspot-choice relative to the slot */
|
|
301
301
|
display: block;
|
|
@@ -307,7 +307,7 @@ import{a as f,b as A,c as n}from"../chunk-BKTGSVMP.js";import{provide as Tr}from
|
|
|
307
307
|
user-select: none;
|
|
308
308
|
/* width:100%; */
|
|
309
309
|
}
|
|
310
|
-
`];customElements.define("qti-hotspot-interaction",
|
|
310
|
+
`];customElements.define("qti-hotspot-interaction",Be);import{html as ge,LitElement as Vs}from"lit";import{html as Ls,LitElement as Ms}from"lit";var Pt=class extends Ms{connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}render(){return Ls`
|
|
311
311
|
<slot></slot>
|
|
312
312
|
<slot name="qti-simple-associable-choice"></slot>
|
|
313
313
|
`}};customElements.define("qti-simple-associable-choice",Pt);import{property as Ns,state as Hs}from"lit/decorators.js";import{unsafeHTML as xr}from"lit/directives/unsafe-html.js";var ie=class extends N(Vs,"qti-simple-match-set:first-of-type qti-simple-associable-choice",!1,"qti-simple-match-set:last-of-type qti-simple-associable-choice"){constructor(){super(...arguments);this.response=[];this.responseIdentifier=""}connectedCallback(){super.connectedCallback(),this.rows=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.cols=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.response=[]}render(){return this.classList.contains("qti-match-tabular")?ge`
|
|
@@ -384,7 +384,7 @@ import{a as f,b as A,c as n}from"../chunk-BKTGSVMP.js";import{provide as Tr}from
|
|
|
384
384
|
:host(.qti-choices-right) [part='container'] {
|
|
385
385
|
flex-direction: row-reverse;
|
|
386
386
|
}
|
|
387
|
-
`],n([Is({type:String})],se.prototype,"orientation",2);customElements.define("qti-order-interaction",se);import{LitElement as Fs,css as
|
|
387
|
+
`],n([Is({type:String})],se.prototype,"orientation",2);customElements.define("qti-order-interaction",se);import{LitElement as Fs,css as Xs,html as Ys}from"lit";var Ke=class extends Fs{render(){return Ys`<slot></slot>`}};Ke.styles=[Xs`
|
|
388
388
|
:host {
|
|
389
389
|
display: block;
|
|
390
390
|
}
|
|
@@ -395,7 +395,7 @@ import{a as f,b as A,c as n}from"../chunk-BKTGSVMP.js";import{provide as Tr}from
|
|
|
395
395
|
left: 50%;
|
|
396
396
|
transform: translateX(-50%);
|
|
397
397
|
}
|
|
398
|
-
`];customElements.define("qti-position-object-interaction",Ke);import{LitElement as
|
|
398
|
+
`];customElements.define("qti-position-object-interaction",Ke);import{LitElement as Bs,css as js,html as Ks}from"lit";var ze=class extends Bs{constructor(){super();this.removeMoveListener=this.removeMoveListener.bind(this),this.dragElementHandler=this.dragElementHandler.bind(this)}render(){return Ks`<slot></slot>`}dragElementHandler(e){e.preventDefault();let t=e.clientX-this.startX,r=e.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+t+"px",this.dragElement.style.top=this.dragElement.offsetTop+r+"px",this.startX=e.clientX,this.startY=e.clientY}firstUpdated(e){super.firstUpdated(e),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",t=>{this.startX=t.clientX,this.startY=t.clientY,document.addEventListener("mousemove",this.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}removeMoveListener(e){document.removeEventListener("mousemove",this.dragElementHandler,!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}};ze.styles=[js`
|
|
399
399
|
:host {
|
|
400
400
|
display: inline-block;
|
|
401
401
|
position: relative;
|
|
@@ -449,7 +449,7 @@ import{a as f,b as A,c as n}from"../chunk-BKTGSVMP.js";import{provide as Tr}from
|
|
|
449
449
|
width: 100%;
|
|
450
450
|
display: block;
|
|
451
451
|
}
|
|
452
|
-
`,ye=n([vo("qti-simple-choice")],ye);import{consume as Eo}from"@lit/context";import{html as _o,LitElement as Co}from"lit";import{customElement as qo,state as Ao}from"lit/decorators.js";var xe=class extends Co{render(){return _o`<slot @slotchange=${this.handleSlotChange}></slot>`}handleSlotChange(e){var r,s,o;let t=Array.from((s=(r=this.firstElementChild)==null?void 0:r.childNodes)!=null?s:[]).find(c=>c.nodeType===Node.COMMENT_NODE);try{this.operatorFunction=new Function("context","fn","item",(o=t.textContent)!=null?o:"")}catch(c){console.error("custom-operator contains invalid javascript code",c)}}calculate(){let e={variable:r=>{var s,o,c;return(c=(o=(s=this._context)==null?void 0:s.variables.find(l=>l.identifier===r))==null?void 0:o.value)!=null?c:""},correct:r=>{var s,o,c;return(c=(o=(s=this._context)==null?void 0:s.variables.find(l=>l.identifier===r))==null?void 0:o.correctResponse)!=null?c:""}},t={getVariable:r=>{var s;return(s=this._context)==null?void 0:s.variables.find(o=>o.identifier===r)},updateOutcomeVariable:(r,s)=>{this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:r,value:s}}))}};return this.operatorFunction(this._context,e,t)}};n([Eo({context:S,subscribe:!0}),Ao()],xe.prototype,"_context",2),xe=n([qo("qti-custom-operator")],xe);export{b as Interaction,fe as QtPrintedVariable,Ne as QtiAnd,_ as QtiAssessmentItem,Je as QtiAssociableHotspot,be as QtiAssociateInteraction,He as QtiBaseValue,C as QtiChoice,Q as QtiChoiceInteraction,Ae as QtiCompanionMaterialsInfo,$ as QtiConditionExpression,yt as QtiContains,ke as QtiContentBody,xt as QtiCorrect,xe as QtiCustomOperator,ne as QtiEndAttemptInteraction,Pe as QtiEqual,De as QtiEqualRounded,m as QtiExpression,M as QtiExtendedTextInteraction,Te as QtiFeedbackBlock,Re as QtiFeedbackInline,Ze as QtiGap,Ge as QtiGapImg,Fe as QtiGapMatchInteraction,Qe as QtiGapText,D as QtiGraphicAssociateInteraction,
|
|
452
|
+
`,ye=n([vo("qti-simple-choice")],ye);import{consume as Eo}from"@lit/context";import{html as _o,LitElement as Co}from"lit";import{customElement as qo,state as Ao}from"lit/decorators.js";var xe=class extends Co{render(){return _o`<slot @slotchange=${this.handleSlotChange}></slot>`}handleSlotChange(e){var r,s,o;let t=Array.from((s=(r=this.firstElementChild)==null?void 0:r.childNodes)!=null?s:[]).find(c=>c.nodeType===Node.COMMENT_NODE);try{this.operatorFunction=new Function("context","fn","item",(o=t.textContent)!=null?o:"")}catch(c){console.error("custom-operator contains invalid javascript code",c)}}calculate(){let e={variable:r=>{var s,o,c;return(c=(o=(s=this._context)==null?void 0:s.variables.find(l=>l.identifier===r))==null?void 0:o.value)!=null?c:""},correct:r=>{var s,o,c;return(c=(o=(s=this._context)==null?void 0:s.variables.find(l=>l.identifier===r))==null?void 0:o.correctResponse)!=null?c:""}},t={getVariable:r=>{var s;return(s=this._context)==null?void 0:s.variables.find(o=>o.identifier===r)},updateOutcomeVariable:(r,s)=>{this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:r,value:s}}))}};return this.operatorFunction(this._context,e,t)}};n([Eo({context:S,subscribe:!0}),Ao()],xe.prototype,"_context",2),xe=n([qo("qti-custom-operator")],xe);export{b as Interaction,fe as QtPrintedVariable,Ne as QtiAnd,_ as QtiAssessmentItem,Je as QtiAssociableHotspot,be as QtiAssociateInteraction,He as QtiBaseValue,C as QtiChoice,Q as QtiChoiceInteraction,Ae as QtiCompanionMaterialsInfo,$ as QtiConditionExpression,yt as QtiContains,ke as QtiContentBody,xt as QtiCorrect,xe as QtiCustomOperator,ne as QtiEndAttemptInteraction,Pe as QtiEqual,De as QtiEqualRounded,m as QtiExpression,M as QtiExtendedTextInteraction,Te as QtiFeedbackBlock,Re as QtiFeedbackInline,Ze as QtiGap,Ge as QtiGapImg,Fe as QtiGapMatchInteraction,Qe as QtiGapText,D as QtiGraphicAssociateInteraction,Xe as QtiGraphicGapMatchInteraction,Ye as QtiGraphicOrderInteraction,Et as QtiGt,_t as QtiGte,ve as QtiHotspotChoice,Be as QtiHotspotInteraction,et as QtiHottext,ft as QtiHottextInteraction,Ut as QtiInlineChoice,j as QtiInlineChoiceInteraction,Ct as QtiIsNull,Ve as QtiLookupOutcomeValue,qt as QtiLt,At as QtiLte,Oe as QtiMapResponse,ee as QtiMapping,wt as QtiMatch,ie as QtiMatchInteraction,je as QtiMediaInteraction,$t as QtiMember,Se as QtiModalFeedback,Tt as QtiMultiple,Rt as QtiNot,St as QtiOr,se as QtiOrderInteraction,Lt as QtiOrdered,O as QtiOutcomeDeclaration,Ht as QtiPortableCustomInteraction,ze as QtiPositionObjectStage,Mt as QtiProduct,Ee as QtiPrompt,bt as QtiResponseCondition,I as QtiResponseDeclaration,me as QtiResponseElse,vt as QtiResponseElseIf,he as QtiResponseIf,K as QtiResponseProcessing,L as QtiRubricBlock,V as QtiRule,Ke as QtiSPositionObjectInteraction,z as QtiSelectPointInteraction,gt as QtiSetOutcomeValue,Pt as QtiSimpleAssociableChoice,ye as QtiSimpleChoice,q as QtiSliderInteraction,Ue as QtiStringMatch,tt as QtiStylesheet,Vt as QtiSum,w as QtiTextEntryInteraction,Nt as QtiVariable,S as itemContext,Ft as itemContextVariables,Qi as qtiAndMixin};
|
|
453
453
|
/*! Bundled license information:
|
|
454
454
|
|
|
455
455
|
lit-html/node/lit-html.js:
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"engines": {
|
|
13
13
|
"node": ">=16.0.0"
|
|
14
14
|
},
|
|
15
|
-
"version": "6.6.1-
|
|
15
|
+
"version": "6.6.1-27",
|
|
16
16
|
"type": "module",
|
|
17
17
|
"main": "dist/index.js",
|
|
18
18
|
"exports": {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"test:watch-output": "jest --watch --json --outputFile=.jest-test-results.json || true",
|
|
45
45
|
"dev": "vite",
|
|
46
46
|
"build-app": "tsc && vite build",
|
|
47
|
-
"build-lib": "
|
|
48
|
-
"watch-lib": "nodemon --watch \"src/**\" --ext \"ts,json,css\" --ignore \"src/**/*.spec.ts\" --exec \"
|
|
47
|
+
"build-lib": "npx --yes tsx scripts/build.ts",
|
|
48
|
+
"watch-lib": "nodemon --watch \"src/**\" --ext \"ts,json,css\" --ignore \"src/**/*.spec.ts\" --exec \"npx --yes tsx scripts/build.ts\" watch",
|
|
49
49
|
"deploy": "firebase deploy --only hosting:qti-components",
|
|
50
50
|
"storybook": "storybook dev -p 6006",
|
|
51
51
|
"storybook:build": "storybook build",
|