@pie-api/pie-element-extensions
Advanced tools
Comparing version 1.8.0 to 1.9.0
@@ -42,3 +42,3 @@ /** | ||
*/ | ||
class _{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this.__parts)void 0!==s&&s.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const t=e?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),s=[],i=this.template.parts,n=document.createTreeWalker(t,133,null,!1);let r,o=0,l=0,h=n.nextNode();for(;o<i.length;)if(r=i[o],a(r)){for(;l<r.index;)l++,"TEMPLATE"===h.nodeName&&(s.push(h),n.currentNode=h.content),null===(h=n.nextNode())&&(n.currentNode=s.pop(),h=n.nextNode());if("node"===r.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(h.previousSibling),this.__parts.push(e)}else this.__parts.push(...this.processor.handleAttributeExpressions(h,r.name,r.strings,this.options));o++}else this.__parts.push(void 0),o++;return e&&(document.adoptNode(t),customElements.upgrade(t)),t}} | ||
class g{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this.__parts)void 0!==s&&s.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const t=e?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),s=[],i=this.template.parts,n=document.createTreeWalker(t,133,null,!1);let r,o=0,l=0,h=n.nextNode();for(;o<i.length;)if(r=i[o],a(r)){for(;l<r.index;)l++,"TEMPLATE"===h.nodeName&&(s.push(h),n.currentNode=h.content),null===(h=n.nextNode())&&(n.currentNode=s.pop(),h=n.nextNode());if("node"===r.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(h.previousSibling),this.__parts.push(e)}else this.__parts.push(...this.processor.handleAttributeExpressions(h,r.name,r.strings,this.options));o++}else this.__parts.push(void 0),o++;return e&&(document.adoptNode(t),customElements.upgrade(t)),t}} | ||
/** | ||
@@ -56,3 +56,3 @@ * @license | ||
* http://polymer.github.io/PATENTS.txt | ||
*/const g=` ${s} `;class y{constructor(e,t,s,i){this.strings=e,this.values=t,this.type=s,this.processor=i}getHTML(){const e=this.strings.length-1;let t="",n=!1;for(let r=0;r<e;r++){const e=this.strings[r],o=e.lastIndexOf("\x3c!--");n=(o>-1||n)&&-1===e.indexOf("--\x3e",o+1);const a=h.exec(e);t+=null===a?e+(n?g:i):e.substr(0,a.index)+a[1]+a[2]+"$lit$"+a[3]+s}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");return e.innerHTML=this.getHTML(),e}} | ||
*/const _=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:e=>e}),y=` ${s} `;class S{constructor(e,t,s,i){this.strings=e,this.values=t,this.type=s,this.processor=i}getHTML(){const e=this.strings.length-1;let t="",n=!1;for(let r=0;r<e;r++){const e=this.strings[r],o=e.lastIndexOf("\x3c!--");n=(o>-1||n)&&-1===e.indexOf("--\x3e",o+1);const a=h.exec(e);t+=null===a?e+(n?y:i):e.substr(0,a.index)+a[1]+a[2]+"$lit$"+a[3]+s}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return void 0!==_&&(t=_.createHTML(t)),e.innerHTML=t,e}} | ||
/** | ||
@@ -70,3 +70,3 @@ * @license | ||
* http://polymer.github.io/PATENTS.txt | ||
*/const S=e=>null===e||!("object"==typeof e||"function"==typeof e),b=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class x{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let e=0;e<s.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new w(this)}_getValue(){const e=this.strings,t=e.length-1;let s="";for(let i=0;i<t;i++){s+=e[i];const t=this.parts[i];if(void 0!==t){const e=t.value;if(S(e)||!b(e))s+="string"==typeof e?e:String(e);else for(const t of e)s+="string"==typeof t?t:String(t)}}return s+=e[t],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class w{constructor(e){this.value=void 0,this.committer=e}setValue(e){e===f||S(e)&&e===this.value||(this.value=e,m(e)||(this.committer.dirty=!0))}commit(){for(;m(this.value);){const e=this.value;this.value=f,e(this)}this.value!==f&&this.committer.commit()}}class C{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(l()),this.endNode=e.appendChild(l())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=l()),e.__insert(this.endNode=l())}insertAfterPart(e){e.__insert(this.startNode=l()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(null===this.startNode.parentNode)return;for(;m(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=f,e(this)}const e=this.__pendingValue;e!==f&&(S(e)?e!==this.value&&this.__commitText(e):e instanceof y?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):b(e)?this.__commitIterable(e):e===v?(this.value=v,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){const t=this.startNode.nextSibling,s="string"==typeof(e=null==e?"":e)?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=s:this.__commitNode(document.createTextNode(s)),this.value=e}__commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof _&&this.value.template===t)this.value.update(e.values);else{const s=new _(t,e.processor,this.options),i=s._clone();s.update(e.values),this.__commitNode(i),this.value=s}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let s,i=0;for(const n of e)s=t[i],void 0===s&&(s=new C(this.options),t.push(s),0===i?s.appendIntoPart(this):s.insertAfterPart(t[i-1])),s.setValue(n),s.commit(),i++;i<t.length&&(t.length=i,this.clear(s&&s.endNode))}clear(e=this.startNode){t(this.startNode.parentNode,e.nextSibling,this.endNode)}}class P{constructor(e,t,s){if(this.value=void 0,this.__pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this.__pendingValue=e}commit(){for(;m(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=f,e(this)}if(this.__pendingValue===f)return;const e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=f}}class N extends x{constructor(e,t,s){super(e,t,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new T(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class T extends w{}let A=!1;(()=>{try{const e={get capture(){return A=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class E{constructor(e,t,s){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;m(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=f,e(this)}if(this.__pendingValue===f)return;const e=this.__pendingValue,t=this.value,s=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=null!=e&&(null==t||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=$(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=f}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const $=e=>e&&(A?{capture:e.capture,passive:e.passive,once:e.once}:e.capture) | ||
*/const w=e=>null===e||!("object"==typeof e||"function"==typeof e),b=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class x{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let e=0;e<s.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new C(this)}_getValue(){const e=this.strings,t=e.length-1,s=this.parts;if(1===t&&""===e[0]&&""===e[1]){const e=s[0].value;if("symbol"==typeof e)return String(e);if("string"==typeof e||!b(e))return e}let i="";for(let n=0;n<t;n++){i+=e[n];const t=s[n];if(void 0!==t){const e=t.value;if(w(e)||!b(e))i+="string"==typeof e?e:String(e);else for(const t of e)i+="string"==typeof t?t:String(t)}}return i+=e[t],i}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class C{constructor(e){this.value=void 0,this.committer=e}setValue(e){e===f||w(e)&&e===this.value||(this.value=e,m(e)||(this.committer.dirty=!0))}commit(){for(;m(this.value);){const e=this.value;this.value=f,e(this)}this.value!==f&&this.committer.commit()}}class P{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(l()),this.endNode=e.appendChild(l())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=l()),e.__insert(this.endNode=l())}insertAfterPart(e){e.__insert(this.startNode=l()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(null===this.startNode.parentNode)return;for(;m(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=f,e(this)}const e=this.__pendingValue;e!==f&&(w(e)?e!==this.value&&this.__commitText(e):e instanceof S?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):b(e)?this.__commitIterable(e):e===v?(this.value=v,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){const t=this.startNode.nextSibling,s="string"==typeof(e=null==e?"":e)?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=s:this.__commitNode(document.createTextNode(s)),this.value=e}__commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof g&&this.value.template===t)this.value.update(e.values);else{const s=new g(t,e.processor,this.options),i=s._clone();s.update(e.values),this.__commitNode(i),this.value=s}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let s,i=0;for(const n of e)s=t[i],void 0===s&&(s=new P(this.options),t.push(s),0===i?s.appendIntoPart(this):s.insertAfterPart(t[i-1])),s.setValue(n),s.commit(),i++;i<t.length&&(t.length=i,this.clear(s&&s.endNode))}clear(e=this.startNode){t(this.startNode.parentNode,e.nextSibling,this.endNode)}}class N{constructor(e,t,s){if(this.value=void 0,this.__pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this.__pendingValue=e}commit(){for(;m(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=f,e(this)}if(this.__pendingValue===f)return;const e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=f}}class T extends x{constructor(e,t,s){super(e,t,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new A(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class A extends C{}let E=!1;(()=>{try{const e={get capture(){return E=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class ${constructor(e,t,s){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;m(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=f,e(this)}if(this.__pendingValue===f)return;const e=this.__pendingValue,t=this.value,s=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=null!=e&&(null==t||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=V(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=f}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const V=e=>e&&(E?{capture:e.capture,passive:e.passive,once:e.once}:e.capture) | ||
/** | ||
@@ -84,3 +84,3 @@ * @license | ||
* http://polymer.github.io/PATENTS.txt | ||
*/;function V(e){let t=k.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},k.set(e.type,t));let i=t.stringsArray.get(e.strings);if(void 0!==i)return i;const n=e.strings.join(s);return i=t.keyString.get(n),void 0===i&&(i=new r(e,e.getTemplateElement()),t.keyString.set(n,i)),t.stringsArray.set(e.strings,i),i}const k=new Map,U=new WeakMap; | ||
*/;function k(e){let t=U.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},U.set(e.type,t));let i=t.stringsArray.get(e.strings);if(void 0!==i)return i;const n=e.strings.join(s);return i=t.keyString.get(n),void 0===i&&(i=new r(e,e.getTemplateElement()),t.keyString.set(n,i)),t.stringsArray.set(e.strings,i),i}const U=new Map,O=new WeakMap; | ||
/** | ||
@@ -98,3 +98,3 @@ * @license | ||
* http://polymer.github.io/PATENTS.txt | ||
*/const O=new | ||
*/const R=new | ||
/** | ||
@@ -113,3 +113,3 @@ * @license | ||
*/ | ||
class{handleAttributeExpressions(e,t,s,i){const n=t[0];if("."===n){return new N(e,t.slice(1),s).parts}if("@"===n)return[new E(e,t.slice(1),i.eventContext)];if("?"===n)return[new P(e,t.slice(1),s)];return new x(e,t,s).parts}handleTextExpression(e){return new C(e)}}; | ||
class{handleAttributeExpressions(e,t,s,i){const n=t[0];if("."===n){return new T(e,t.slice(1),s).parts}if("@"===n)return[new $(e,t.slice(1),i.eventContext)];if("?"===n)return[new N(e,t.slice(1),s)];return new x(e,t,s).parts}handleTextExpression(e){return new P(e)}}; | ||
/** | ||
@@ -127,3 +127,3 @@ * @license | ||
* http://polymer.github.io/PATENTS.txt | ||
*/"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.2.1");const M=(e,...t)=>new y(e,t,"html",O) | ||
*/"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const M=(e,...t)=>new S(e,t,"html",R) | ||
/** | ||
@@ -141,3 +141,3 @@ * @license | ||
* http://polymer.github.io/PATENTS.txt | ||
*/,R=(e,t)=>`${e}--${t}`;let j=!0;void 0===window.ShadyCSS?j=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),j=!1);const z=e=>t=>{const i=R(t.type,e);let n=k.get(i);void 0===n&&(n={stringsArray:new WeakMap,keyString:new Map},k.set(i,n));let o=n.stringsArray.get(t.strings);if(void 0!==o)return o;const a=t.strings.join(s);if(o=n.keyString.get(a),void 0===o){const s=t.getTemplateElement();j&&window.ShadyCSS.prepareTemplateDom(s,e),o=new r(t,s),n.keyString.set(a,o)}return n.stringsArray.set(t.strings,o),o},q=["html","svg"],B=new Set,L=(e,t,s)=>{B.add(e);const i=s?s.element:document.createElement("template"),n=t.querySelectorAll("style"),{length:r}=n;if(0===r)return void window.ShadyCSS.prepareTemplateStyles(i,e);const o=document.createElement("style");for(let e=0;e<r;e++){const t=n[e];t.parentNode.removeChild(t),o.textContent+=t.textContent}(e=>{q.forEach(t=>{const s=k.get(R(t,e));void 0!==s&&s.keyString.forEach(e=>{const{element:{content:t}}=e,s=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{s.add(e)}),c(e,s)})})})(e);const a=i.content;s?function(e,t,s=null){const{element:{content:i},parts:n}=e;if(null==s)return void i.appendChild(t);const r=document.createTreeWalker(i,133,null,!1);let o=p(n),a=0,l=-1;for(;r.nextNode();){l++;for(r.currentNode===s&&(a=d(t),s.parentNode.insertBefore(t,s));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=p(n,o);return}o=p(n,o)}}}(s,o,a.firstChild):a.insertBefore(o,a.firstChild),window.ShadyCSS.prepareTemplateStyles(i,e);const l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)t.insertBefore(l.cloneNode(!0),t.firstChild);else if(s){a.insertBefore(o,a.firstChild);const e=new Set;e.add(o),c(s,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const H={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},F=(e,t)=>t!==e&&(t==t||e==e),I={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:F};class W extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((t,s)=>{const i=this._attributeNameForProperty(s,t);void 0!==i&&(this._attributeToPropertyMap.set(i,s),e.push(i))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t=I){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const s="symbol"==typeof e?Symbol():"__"+e,i=this.getPropertyDescriptor(e,s,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}static getPropertyDescriptor(e,t,s){return{get(){return this[t]},set(s){const i=this[e];this[t]=s,this._requestUpdate(e,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||I}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const s of t)this.createProperty(s,e[s])}}static _attributeNameForProperty(e,t){const s=t.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,s=F){return s(e,t)}static _propertyValueFromAttribute(e,t){const s=t.type,i=t.converter||H,n="function"==typeof i?i:i.fromAttribute;return n?n(e,s):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const s=t.type,i=t.converter;return(i&&i.toAttribute||H.toAttribute)(e,s)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,s){t!==s&&this._attributeToProperty(e,s)}_propertyToAttribute(e,t,s=I){const i=this.constructor,n=i._attributeNameForProperty(e,s);if(void 0!==n){const e=i._propertyValueToAttribute(t,s);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(n):this.setAttribute(n,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const s=this.constructor,i=s._attributeToPropertyMap.get(e);if(void 0!==i){const e=s.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=s._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}_requestUpdate(e,t){let s=!0;if(void 0!==e){const i=this.constructor,n=i.getPropertyOptions(e);i._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==n.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):s=!1}!this._hasRequestedUpdate&&s&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this._requestUpdate(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}W.finalized=!0; | ||
*/,j=(e,t)=>`${e}--${t}`;let z=!0;void 0===window.ShadyCSS?z=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),z=!1);const q=e=>t=>{const i=j(t.type,e);let n=U.get(i);void 0===n&&(n={stringsArray:new WeakMap,keyString:new Map},U.set(i,n));let o=n.stringsArray.get(t.strings);if(void 0!==o)return o;const a=t.strings.join(s);if(o=n.keyString.get(a),void 0===o){const s=t.getTemplateElement();z&&window.ShadyCSS.prepareTemplateDom(s,e),o=new r(t,s),n.keyString.set(a,o)}return n.stringsArray.set(t.strings,o),o},L=["html","svg"],H=new Set,I=(e,t,s)=>{H.add(e);const i=s?s.element:document.createElement("template"),n=t.querySelectorAll("style"),{length:r}=n;if(0===r)return void window.ShadyCSS.prepareTemplateStyles(i,e);const o=document.createElement("style");for(let e=0;e<r;e++){const t=n[e];t.parentNode.removeChild(t),o.textContent+=t.textContent}(e=>{L.forEach(t=>{const s=U.get(j(t,e));void 0!==s&&s.keyString.forEach(e=>{const{element:{content:t}}=e,s=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{s.add(e)}),c(e,s)})})})(e);const a=i.content;s?function(e,t,s=null){const{element:{content:i},parts:n}=e;if(null==s)return void i.appendChild(t);const r=document.createTreeWalker(i,133,null,!1);let o=p(n),a=0,l=-1;for(;r.nextNode();){l++;for(r.currentNode===s&&(a=d(t),s.parentNode.insertBefore(t,s));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=p(n,o);return}o=p(n,o)}}}(s,o,a.firstChild):a.insertBefore(o,a.firstChild),window.ShadyCSS.prepareTemplateStyles(i,e);const l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)t.insertBefore(l.cloneNode(!0),t.firstChild);else if(s){a.insertBefore(o,a.firstChild);const e=new Set;e.add(o),c(s,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const B={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},F=(e,t)=>t!==e&&(t==t||e==e),W={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:F};class D extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((t,s)=>{const i=this._attributeNameForProperty(s,t);void 0!==i&&(this._attributeToPropertyMap.set(i,s),e.push(i))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t=W){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const s="symbol"==typeof e?Symbol():"__"+e,i=this.getPropertyDescriptor(e,s,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}static getPropertyDescriptor(e,t,s){return{get(){return this[t]},set(i){const n=this[e];this[t]=i,this.requestUpdateInternal(e,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||W}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const s of t)this.createProperty(s,e[s])}}static _attributeNameForProperty(e,t){const s=t.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,s=F){return s(e,t)}static _propertyValueFromAttribute(e,t){const s=t.type,i=t.converter||B,n="function"==typeof i?i:i.fromAttribute;return n?n(e,s):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const s=t.type,i=t.converter;return(i&&i.toAttribute||B.toAttribute)(e,s)}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,s){t!==s&&this._attributeToProperty(e,s)}_propertyToAttribute(e,t,s=W){const i=this.constructor,n=i._attributeNameForProperty(e,s);if(void 0!==n){const e=i._propertyValueToAttribute(t,s);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(n):this.setAttribute(n,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const s=this.constructor,i=s._attributeToPropertyMap.get(e);if(void 0!==i){const e=s.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=s._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,t,s){let i=!0;if(void 0!==e){const n=this.constructor;s=s||n.getPropertyOptions(e),n._valueHasChanged(this[e],t,s.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==s.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,s))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}D.finalized=!0; | ||
/** | ||
@@ -153,3 +153,3 @@ @license | ||
*/ | ||
const D="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,J=Symbol();class G{constructor(e,t){if(t!==J)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(D?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const K=(e,...t)=>{const s=t.reduce((t,s,i)=>t+(e=>{if(e instanceof G)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(s)+e[i+1],e[0]);return new G(s,J)}; | ||
const J=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,G=Symbol();class K{constructor(e,t){if(t!==G)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(J?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const Q=(e,...t)=>{const s=t.reduce((t,s,i)=>t+(e=>{if(e instanceof K)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(s)+e[i+1],e[0]);return new K(s,G)}; | ||
/** | ||
@@ -168,5 +168,5 @@ * @license | ||
*/ | ||
(window.litElementVersions||(window.litElementVersions=[])).push("2.3.1");const Q={};class X extends W{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(void 0===e)this._styles=[];else if(Array.isArray(e)){const t=(e,s)=>e.reduceRight((e,s)=>Array.isArray(s)?t(s,e):(e.add(s),e),s),s=t(e,new Set),i=[];s.forEach(e=>i.unshift(e)),this._styles=i}else this._styles=[e]}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?D?this.renderRoot.adoptedStyleSheets=e.map(e=>e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==Q&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return Q}}X.finalized=!0,X.render=(e,s,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const n=i.scopeName,r=U.has(s),o=j&&11===s.nodeType&&!!s.host,a=o&&!B.has(n),l=a?document.createDocumentFragment():s;if(((e,s,i)=>{let n=U.get(s);void 0===n&&(t(s,s.firstChild),U.set(s,n=new C(Object.assign({templateFactory:V},i))),n.appendInto(s)),n.setValue(e),n.commit()})(e,l,Object.assign({templateFactory:z(n)},i)),a){const e=U.get(l);U.delete(l);const i=e.value instanceof _?e.value.template:void 0;L(n,l,i),t(s,s.firstChild),s.appendChild(l),U.set(s,e)}!r&&o&&window.ShadyCSS.styleElement(s.host)};const Y=K`#fafafa`,Z=K`sans-serif`,ee=K`black`,te=K`grey`,se=K` | ||
font-family: var(--pie-live-session-font-family, ${Z}); | ||
`,ie=K` | ||
(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const X={};class Y extends D{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,s)=>e.reduceRight((e,s)=>Array.isArray(s)?t(s,e):(e.add(s),e),s),s=t(e,new Set),i=[];s.forEach(e=>i.unshift(e)),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!J){const t=Array.prototype.slice.call(e.cssRules).reduce((e,t)=>e+t.cssText,"");return new K(String(t),G)}return e})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?J?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==X&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return X}}Y.finalized=!0,Y.render=(e,s,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const n=i.scopeName,r=O.has(s),o=z&&11===s.nodeType&&!!s.host,a=o&&!H.has(n),l=a?document.createDocumentFragment():s;if(((e,s,i)=>{let n=O.get(s);void 0===n&&(t(s,s.firstChild),O.set(s,n=new P(Object.assign({templateFactory:k},i))),n.appendInto(s)),n.setValue(e),n.commit()})(e,l,Object.assign({templateFactory:q(n)},i)),a){const e=O.get(l);O.delete(l);const i=e.value instanceof g?e.value.template:void 0;I(n,l,i),t(s,s.firstChild),s.appendChild(l),O.set(s,e)}!r&&o&&window.ShadyCSS.styleElement(s.host)};const Z=Q`#fafafa`,ee=Q`sans-serif`,te=Q`black`,se=Q`grey`,ie=Q` | ||
font-family: var(--pie-live-session-font-family, ${ee}); | ||
`,ne=Q` | ||
.bubble { | ||
@@ -185,5 +185,5 @@ background-color: white; | ||
z-index: 1; | ||
${se} | ||
${ie} | ||
} | ||
`,ne=K` | ||
`,re=Q` | ||
.choice-value { | ||
@@ -193,3 +193,3 @@ cursor: pointer; | ||
} | ||
`,re=K` | ||
`,oe=Q` | ||
.response { | ||
@@ -199,6 +199,6 @@ align-items: start; | ||
--pie-live-session-background-color, | ||
${Y} | ||
${Z} | ||
); | ||
box-sizing: border-box; | ||
color: var(--pie-live-session-text-color, ${ee}); | ||
color: var(--pie-live-session-text-color, ${te}); | ||
display: flex; | ||
@@ -218,10 +218,10 @@ flex-direction: column; | ||
width: var(--pie-live-session-response-width, ${120}px); | ||
${se} | ||
${ie} | ||
position: relative; | ||
} | ||
`,oe=K` | ||
`,ae=Q` | ||
.cell { | ||
background-color: var( | ||
--pie-live-session-background-color, | ||
${Y} | ||
${Z} | ||
); | ||
@@ -235,6 +235,6 @@ height: var(--pie-live-session-cell-height, ${32}px); | ||
width: var(--pie-live-session-cell-width, ${96}px); | ||
${se} | ||
${ie} | ||
position: relative; | ||
} | ||
`,ae=(K` | ||
`,le=(Q` | ||
.response { | ||
@@ -244,5 +244,5 @@ align-items: center; | ||
--pie-live-session-background-color, | ||
${Y} | ||
${Z} | ||
); | ||
color: var(--pie-live-session-text-color, ${te}); | ||
color: var(--pie-live-session-text-color, ${se}); | ||
display: flex; | ||
@@ -261,3 +261,3 @@ font-size: ${12}px; | ||
width: var(--pie-live-session-response-width, ${120}px); | ||
${se} | ||
${ie} | ||
} | ||
@@ -273,3 +273,3 @@ .magnifier { | ||
} | ||
`,K` | ||
`,Q` | ||
.correctness-indicator { | ||
@@ -279,3 +279,3 @@ font-size: var(--pie-live-session-font-size-small, ${12}px) | ||
} | ||
`),le=new WeakMap,he=(ce=e=>t=>{if(!(t instanceof C))throw new Error("unsafeHTML can only be used in text bindings");const s=le.get(t);if(void 0!==s&&S(e)&&e===s.value&&t.value===s.fragment)return;const i=document.createElement("template");i.innerHTML=e;const n=document.importNode(i.content,!0);t.setValue(n),le.set(t,{value:e,fragment:n})},(...e)=>{const t=ce(...e);return u.set(t,!0),t});var ce;const de=(e,t,s)=>{const{choices:i,choicePrefix:n}=e||{},{value:r}=t||{},{mouseover:o,mouseout:a}=s||{};if(!i||!r)return"";const l="numbers"===n?49:65;return i.reduce((e,t,s)=>(r.indexOf(t.value)>=0&&e.push(s),e),[]).map(e=>{const{correct:t,label:s}=i[e];return M`<div | ||
`),he=new WeakMap,ce=(de=e=>t=>{if(!(t instanceof P))throw new Error("unsafeHTML can only be used in text bindings");const s=he.get(t);if(void 0!==s&&w(e)&&e===s.value&&t.value===s.fragment)return;const i=document.createElement("template");i.innerHTML=e;const n=document.importNode(i.content,!0);t.setValue(n),he.set(t,{value:e,fragment:n})},(...e)=>{const t=de(...e);return u.set(t,!0),t});var de;const pe=(e,t,s)=>{const{choices:i,choicePrefix:n}=e||{},{value:r}=t||{},{mouseover:o,mouseout:a}=s||{};if(!i||!r)return"";const l="numbers"===n?49:65;return i.reduce((e,t,s)=>(r.indexOf(t.value)>=0&&e.push(s),e),[]).map(e=>{const{correct:t,label:s}=i[e];return M`<div | ||
class="choice-value" | ||
@@ -287,8 +287,8 @@ @mouseover=${e=>o(e,s)} | ||
<span class="correctness-indicator">${((e,t)=>t?e?"✔":"✖":e?M`✔`:M`✖`)(t)}</span> | ||
</div>`})},pe=e=>e&&e.value?M` <div | ||
</div>`})},ue=e=>e&&e.value?M` <div | ||
class="bubble" | ||
style="top: ${e.top}px; left: ${e.left}px;" | ||
> | ||
${he((e=>{const t=document.createElement("textarea");return t.innerHTML=e,t.innerText})(e.value))} | ||
</div>`:M``;class ue extends X{}class me extends ue{static get styles(){return[ie,oe,ne,ae,K` | ||
${ce((e=>{const t=document.createElement("textarea");return t.innerHTML=e,t.innerText})(e.value))} | ||
</div>`:M``;class me extends Y{}class fe extends me{static get styles(){return[ne,ae,re,le,Q` | ||
:host { | ||
@@ -299,3 +299,3 @@ color: var(--pie-live-session-text-color, black); | ||
align-items: center; | ||
color: var(--pie-live-session-text-color, ${ee}); | ||
color: var(--pie-live-session-text-color, ${te}); | ||
display: flex; | ||
@@ -312,8 +312,8 @@ justify-content: center; | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}render(){const e=de(this.model,this.session,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)});return M` | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}render(){const e=pe(this.model,this.session,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)});return M` | ||
<div class="cell"> | ||
<span>${e}</span> | ||
${pe(this.hoveredChoice)} | ||
${ue(this.hoveredChoice)} | ||
</div> | ||
`}}class fe extends ue{static get styles(){return[ie,ne,ae,re,K` | ||
`}}class ve extends me{static get styles(){return[ne,re,le,oe,Q` | ||
.response { | ||
@@ -333,5 +333,5 @@ align-items: center; | ||
<span> | ||
${de(this.model,this.session,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)})} | ||
${pe(this.model,this.session,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)})} | ||
</span> | ||
${pe(this.hoveredChoice)} | ||
</div>`}}export{me as MultipleChoiceCell,fe as MultipleChoiceResponse}; | ||
${ue(this.hoveredChoice)} | ||
</div>`}}export{fe as MultipleChoiceCell,ve as MultipleChoiceResponse}; |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as CategorizeCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as CategorizeCell}; | ||
//# sourceMappingURL=CategorizeCell.js.map |
@@ -1,2 +0,2 @@ | ||
import{e,h as t}from"./cssUtils-4e44882e.js";import{C as s}from"./CustomLitElement-a356b5f6.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response"> | ||
import{h as e}from"./lit-element-236efe74.js";import{e as t}from"./cssUtils-e3142d13.js";import{C as s}from"./CustomLitElement-584c0ff9.js";class r extends s{static get styles(){return[t]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return e`<div class="response"> | ||
Expand to see student response | ||
@@ -3,0 +3,0 @@ <div class="magnifier">⚲</div> |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as ChartingCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as ChartingCell}; | ||
//# sourceMappingURL=ChartingCell.js.map |
@@ -1,2 +0,2 @@ | ||
import{e,h as t}from"./cssUtils-4e44882e.js";import{C as s}from"./CustomLitElement-a356b5f6.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response"> | ||
import{h as e}from"./lit-element-236efe74.js";import{e as t}from"./cssUtils-e3142d13.js";import{C as s}from"./CustomLitElement-584c0ff9.js";class r extends s{static get styles(){return[t]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return e`<div class="response"> | ||
Expand to see student response | ||
@@ -3,0 +3,0 @@ <div class="magnifier">⚲</div> |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as ConstructedCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as ConstructedCell}; | ||
//# sourceMappingURL=ConstructedCell.js.map |
@@ -1,6 +0,6 @@ | ||
import{a as s,r as e,b as t,d as r,h as n}from"./cssUtils-4e44882e.js";import{C as a}from"./CustomLitElement-a356b5f6.js";import{u as i}from"./unsafe-html-2525f04a.js";import{p as o,g as p}from"./utils-15fcf4f1.js";class l extends a{static get styles(){return[s,e,t` | ||
import{c as e,h as s}from"./lit-element-236efe74.js";import{a as t,r,d as n}from"./cssUtils-e3142d13.js";import{C as a}from"./CustomLitElement-584c0ff9.js";import{u as i}from"./unsafe-html-ee02b8b6.js";import{p as o,g as p}from"./utils-779c324b.js";class l extends a{static get styles(){return[t,r,e` | ||
.response { | ||
font-size: var( | ||
--pie-live-session-font-size-small, | ||
${r}px | ||
${n}px | ||
); | ||
@@ -16,5 +16,5 @@ } | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}_renderResponse(){const{choices:s,markup:e}=this.model||{},{value:t}=this.session||{};if(!t||!e)return"";return o(e).replace(/\{\{(.)\}\}/g,(e,r)=>{const n=s[r].find(s=>s.label===t[r]);return`\n <span class="answer">\n ${t[r]||""}\n <span class="correctness-indicator">${p(n,!0)}</span>\n </span>`})}render(){return n`<div class="response"> | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}_renderResponse(){const{choices:e,markup:s}=this.model||{},{value:t}=this.session||{};if(!t||!s)return"";return o(s).replace(/\{\{(.)\}\}/g,(s,r)=>{const n=e[r].find(e=>e.label===t[r]);return`\n <span class="answer">\n ${t[r]||""}\n <span class="correctness-indicator">${p(n,!0)}</span>\n </span>`})}render(){return s`<div class="response"> | ||
${i(this._renderResponse())} | ||
</div>`}}export default l;export{l as ConstructedResponse}; | ||
//# sourceMappingURL=ConstructedResponse.js.map |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as DragInTheBlankCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as DragInTheBlankCell}; | ||
//# sourceMappingURL=DragInTheBlankCell.js.map |
@@ -1,6 +0,6 @@ | ||
import{g as e,j as t,r as s,b as o,h as r}from"./cssUtils-4e44882e.js";import{C as i}from"./CustomLitElement-a356b5f6.js";import"./unsafe-html-2525f04a.js";import{g as h,r as c}from"./utils-15fcf4f1.js";class n extends i{static get styles(){return[e,t,s,o` | ||
import{c as e,h as t}from"./lit-element-236efe74.js";import{b as s,f as o,r}from"./cssUtils-e3142d13.js";import{C as i}from"./CustomLitElement-584c0ff9.js";import"./unsafe-html-ee02b8b6.js";import{g as h,r as c}from"./utils-779c324b.js";class n extends i{static get styles(){return[s,o,r,e` | ||
span { | ||
margin: 2px; | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height/2,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{correctResponse:e,choices:t}=this.model||{},{value:s}=this.session||{};if(!s||!e)return r``;return(Object.keys(e)||[]).map(o=>{const i=t.find(e=>e.id===s[o]);return r`<div | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height/2,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{correctResponse:e,choices:s}=this.model||{},{value:o}=this.session||{};if(!o||!e)return t``;return(Object.keys(e)||[]).map(r=>{const i=s.find(e=>e.id===o[r]);return t`<div | ||
class="choice-value" | ||
@@ -11,5 +11,5 @@ @mouseover=${e=>this.mouseover(e,i&&i.value)} | ||
<span> | ||
${o}. ${s[o]?h(e[o]===s[o]):""} | ||
${r}. ${o[r]?h(e[r]===o[r]):""} | ||
</span> | ||
</div>`})}render(){return r` | ||
</div>`})}render(){return t` | ||
<div class="response"> | ||
@@ -16,0 +16,0 @@ ${this._renderResponse()} ${c(this.hoveredChoice)} |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as DrawingCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as DrawingCell}; | ||
//# sourceMappingURL=DrawingCell.js.map |
@@ -1,2 +0,2 @@ | ||
import{r as e,b as t,k as s,l as i,h as a}from"./cssUtils-4e44882e.js";import{C as r}from"./CustomLitElement-a356b5f6.js";class n extends r{static get styles(){return[e,t` | ||
import{c as e,h as t}from"./lit-element-236efe74.js";import{r as s,g as i,h as a}from"./cssUtils-e3142d13.js";import{C as r}from"./CustomLitElement-584c0ff9.js";class n extends r{static get styles(){return[s,e` | ||
.response { | ||
@@ -15,21 +15,21 @@ position: relative; | ||
.drawableText { | ||
${s} | ||
font-size: var(--pie-live-session-font-size-small, ${i}px); | ||
${i} | ||
font-size: var(--pie-live-session-font-size-small, ${a}px); | ||
position: absolute; | ||
transform-origin: left; | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},containerDimensions:{type:Object}}}set containerDimensions(e){const t=this._containerDimensions;(!t&&e||t&&e&&(t.width!==e.width||t.height!==e.height))&&(this._containerDimensions=e,this.requestUpdate("containerDimensions",t))}get containerDimensions(){return this._containerDimensions}updated(e){super.updated(e);const{height:t,width:s}=this._containerDimensions||{};this.updateComplete.then(()=>{setTimeout(()=>{const{clientHeight:e,clientWidth:i}=this.shadowRoot.querySelector(".response");e&&i&&(t!==e||s!==i)&&(this.containerDimensions={width:i,height:e})},500)})}_getMinWidthAndHeight(){const{imageDimensions:e}=this.model||{},{drawables:t=[],texts:s=[]}=this.session||{};let{height:i,width:a}=e||{};return s.forEach(({x:e,y:t,width:s,fontSize:r})=>{e+s>a&&(a=e+s),t+r>i&&(i=t+r)}),t.reduce((e,t)=>{const{type:s,startx:i,starty:a,x:r,y:n,height:o,points:h,radius:l,width:c}=t||{};let d,m;switch(s){case"FreePathDrawable":case"EraserDrawable":d=Math.max(...h.filter((e,t)=>t%2==0)),m=Math.max(...h.filter((e,t)=>t%2==1));break;case"LineDrawable":d=Math.max(i,r),m=Math.max(a,n);break;case"RectangleDrawable":d=Math.max(i,i+c),m=Math.max(a,a+o);break;case"CircleDrawable":d=Math.max(i,i+l),m=Math.max(a,a+l)}return d>e.width&&(e.width=d),m>e.height&&(e.height=m),e},{width:a,height:i})}static _renderDrawing(e,t,s){const i=document.createElement("canvas"),r=i.getContext("2d");i.width=t,i.height=s,i.style.position="absolute",i.style.top="0",i.style.left="0";const{type:n,fillColor:o,outlineColor:h}=e;switch(r.fillStyle=o,r.strokeStyle=h,r.lineWidth=2,r.beginPath(),n){case"FreePathDrawable":case"EraserDrawable":{const{points:t}=e;"EraserDrawable"===n&&(r.strokeStyle="#fff",r.lineWidth=5);for(let e=0;e<t.length;e+=1)e%2!=0&&r.lineTo(t[e+1],t[e]);break}case"LineDrawable":{const{startx:t,starty:s,x:i,y:a}=e;r.moveTo(t,s),r.lineTo(i,a);break}case"RectangleDrawable":{const{startx:t,starty:s,width:i,height:a}=e;r.fillRect(t,s,i,a),r.strokeRect(t,s,i,a);break}case"CircleDrawable":{const{radius:t,startx:s,starty:i}=e;r.arc(s,i,t,0,2*Math.PI),r.fill();break}}return r.stroke(),a`${i}`}static _renderText({text:e,x:t,y:s,rotation:i,scaleX:r,scaleY:n}){return a`<span class="drawableText" style="${`top: ${s-3}px; left: ${t}px; transform: rotate(${i}deg) scaleX(${r}) scaleY(${n});`}">${e}</span>`}_renderImage(){const{imageUrl:e,imageDimensions:t}=this.model||{},{height:s,width:i}=t||{};return e?a`<img | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},containerDimensions:{type:Object}}}set containerDimensions(e){const t=this._containerDimensions;(!t&&e||t&&e&&(t.width!==e.width||t.height!==e.height))&&(this._containerDimensions=e,this.requestUpdate("containerDimensions",t))}get containerDimensions(){return this._containerDimensions}updated(e){super.updated(e);const{height:t,width:s}=this._containerDimensions||{};this.updateComplete.then(()=>{setTimeout(()=>{const{clientHeight:e,clientWidth:i}=this.shadowRoot.querySelector(".response");e&&i&&(t!==e||s!==i)&&(this.containerDimensions={width:i,height:e})},500)})}_getMinWidthAndHeight(){const{imageDimensions:e}=this.model||{},{drawables:t=[],texts:s=[]}=this.session||{};let{height:i,width:a}=e||{};return s.forEach(({x:e,y:t,width:s,fontSize:r})=>{e+s>a&&(a=e+s),t+r>i&&(i=t+r)}),t.reduce((e,t)=>{const{type:s,startx:i,starty:a,x:r,y:n,height:o,points:h,radius:l,width:c}=t||{};let d,m;switch(s){case"FreePathDrawable":case"EraserDrawable":d=Math.max(...h.filter((e,t)=>t%2==0)),m=Math.max(...h.filter((e,t)=>t%2==1));break;case"LineDrawable":d=Math.max(i,r),m=Math.max(a,n);break;case"RectangleDrawable":d=Math.max(i,i+c),m=Math.max(a,a+o);break;case"CircleDrawable":d=Math.max(i,i+l),m=Math.max(a,a+l)}return d>e.width&&(e.width=d),m>e.height&&(e.height=m),e},{width:a,height:i})}static _renderDrawing(e,s,i){const a=document.createElement("canvas"),r=a.getContext("2d");a.width=s,a.height=i,a.style.position="absolute",a.style.top="0",a.style.left="0";const{type:n,fillColor:o,outlineColor:h}=e;switch(r.fillStyle=o,r.strokeStyle=h,r.lineWidth=2,r.beginPath(),n){case"FreePathDrawable":case"EraserDrawable":{const{points:t}=e;"EraserDrawable"===n&&(r.strokeStyle="#fff",r.lineWidth=5);for(let e=0;e<t.length;e+=1)e%2!=0&&r.lineTo(t[e+1],t[e]);break}case"LineDrawable":{const{startx:t,starty:s,x:i,y:a}=e;r.moveTo(t,s),r.lineTo(i,a);break}case"RectangleDrawable":{const{startx:t,starty:s,width:i,height:a}=e;r.fillRect(t,s,i,a),r.strokeRect(t,s,i,a);break}case"CircleDrawable":{const{radius:t,startx:s,starty:i}=e;r.arc(s,i,t,0,2*Math.PI),r.fill();break}}return r.stroke(),t`${a}`}static _renderText({text:e,x:s,y:i,rotation:a,scaleX:r,scaleY:n}){return t`<span class="drawableText" style="${`top: ${i-3}px; left: ${s}px; transform: rotate(${a}deg) scaleX(${r}) scaleY(${n});`}">${e}</span>`}_renderImage(){const{imageUrl:e,imageDimensions:s}=this.model||{},{height:i,width:a}=s||{};return e?t`<img | ||
alt="Image" | ||
src="${e}" | ||
height="${s}px" | ||
width="${i}px" | ||
/>`:a``}_renderContent({height:e,width:t}){const{drawables:s,texts:i}=this.session||{},r=`width: ${t}px; height: ${e}px;`,o=s&&s.map(s=>n._renderDrawing(s,t,e));return a` <div class="scalable"> | ||
height="${i}px" | ||
width="${a}px" | ||
/>`:t``}_renderContent({height:e,width:s}){const{drawables:i,texts:a}=this.session||{},r=`width: ${s}px; height: ${e}px;`,o=i&&i.map(t=>n._renderDrawing(t,s,e));return t` <div class="scalable"> | ||
${this._renderImage()} | ||
<div class="drawables" style=${r}> | ||
${o} ${i&&i.map(n._renderText)} | ||
${o} ${a&&a.map(n._renderText)} | ||
</div> | ||
</div>`}render(){const{height:e,width:t}=this._getMinWidthAndHeight(),{height:s,width:i}=this._containerDimensions||{};return a` <style> | ||
</div>`}render(){const{height:e,width:s}=this._getMinWidthAndHeight(),{height:i,width:a}=this._containerDimensions||{};return t` <style> | ||
.scalable { | ||
transform: scale(min(${s/e}, ${i/t}, 1)); | ||
transform: scale(min(${i/e}, ${a/s}, 1)); | ||
} | ||
@@ -39,4 +39,4 @@ </style> | ||
<div class="response"> | ||
${this._containerDimensions&&this._renderContent({height:e,width:t})} | ||
${this._containerDimensions&&this._renderContent({height:e,width:s})} | ||
</div>`}}export default n;export{n as DrawingResponse}; | ||
//# sourceMappingURL=DrawingResponse.js.map |
@@ -1,2 +0,2 @@ | ||
import{g as e,c as t,j as s,a as o,b as i,m as r,h}from"./cssUtils-4e44882e.js";import{C as n}from"./CustomLitElement-a356b5f6.js";import"./unsafe-html-2525f04a.js";import{a,r as c}from"./utils-15fcf4f1.js";class l extends n{static get styles(){return[e,t,s,o,i` | ||
import{c as e,h as t}from"./lit-element-236efe74.js";import{b as s,c as o,f as i,a as r,i as h}from"./cssUtils-e3142d13.js";import{C as n}from"./CustomLitElement-584c0ff9.js";import"./unsafe-html-ee02b8b6.js";import{a as c,r as l}from"./utils-779c324b.js";class a extends n{static get styles(){return[s,o,i,r,e` | ||
:host { | ||
@@ -7,3 +7,3 @@ color: var(--pie-live-session-text-color, black); | ||
align-items: center; | ||
color: var(--pie-live-session-text-color, ${r}); | ||
color: var(--pie-live-session-text-color, ${h}); | ||
display: flex; | ||
@@ -21,7 +21,7 @@ justify-content: center; | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{partA:e,partB:t}=this.model||{},{value:s}=this.session||{};if(!s)return"";const o=a(e,s.partA,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)}),i=a(t,s.partB,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)});return h`<span>${o}, ${i}</span>`}render(){const e=this._renderResponse();return h` | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{partA:e,partB:s}=this.model||{},{value:o}=this.session||{};if(!o)return"";const i=c(e,o.partA,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)}),r=c(s,o.partB,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)});return t`<span>${i}, ${r}</span>`}render(){const e=this._renderResponse();return t` | ||
<div class="cell"> | ||
${e} ${c(this.hoveredChoice)} | ||
${e} ${l(this.hoveredChoice)} | ||
</div> | ||
`}}export default l;export{l as EBSRCell}; | ||
`}}export default a;export{a as EBSRCell}; | ||
//# sourceMappingURL=EBSRCell.js.map |
@@ -1,2 +0,2 @@ | ||
import{g as e,j as t,a as s,r as o,b as i,h as r}from"./cssUtils-4e44882e.js";import{C as h}from"./CustomLitElement-a356b5f6.js";import"./unsafe-html-2525f04a.js";import{a as n,r as a}from"./utils-15fcf4f1.js";class u extends h{static get styles(){return[e,t,s,o,i` | ||
import{c as e,h as t}from"./lit-element-236efe74.js";import{b as s,f as o,a as i,r}from"./cssUtils-e3142d13.js";import{C as h}from"./CustomLitElement-584c0ff9.js";import"./unsafe-html-ee02b8b6.js";import{a as n,r as u}from"./utils-779c324b.js";class c extends h{static get styles(){return[s,o,i,r,e` | ||
.response { | ||
@@ -14,7 +14,7 @@ align-items: center; | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{partA:e,partB:t}=this.model||{},{value:s}=this.session||{};if(!s)return"";const o=n(e,s.partA,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)}),i=n(t,s.partB,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)});return r`<span>${o}, ${i}</span>`}render(){return r` | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{partA:e,partB:s}=this.model||{},{value:o}=this.session||{};if(!o)return"";const i=n(e,o.partA,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)}),r=n(s,o.partB,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)});return t`<span>${i}, ${r}</span>`}render(){return t` | ||
<div class="response"> | ||
${this._renderResponse()} ${a(this.hoveredChoice)} | ||
${this._renderResponse()} ${u(this.hoveredChoice)} | ||
</div> | ||
`}}export default u;export{u as EBSRResponse}; | ||
`}}export default c;export{c as EBSRResponse}; | ||
//# sourceMappingURL=EBSRResponse.js.map |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as ExtendedTextEntryCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as ExtendedTextEntryCell}; | ||
//# sourceMappingURL=ExtendedTextEntryCell.js.map |
@@ -1,6 +0,6 @@ | ||
import{a as s,r as e,b as t,d as r,h as a}from"./cssUtils-4e44882e.js";import{C as i}from"./CustomLitElement-a356b5f6.js";import{u as o}from"./unsafe-html-2525f04a.js";import{p as n}from"./utils-15fcf4f1.js";class p extends i{static get styles(){return[s,e,t` | ||
import{c as e,h as s}from"./lit-element-236efe74.js";import{a as t,r,d as i}from"./cssUtils-e3142d13.js";import{C as o}from"./CustomLitElement-584c0ff9.js";import{u as a}from"./unsafe-html-ee02b8b6.js";import{p as n}from"./utils-779c324b.js";class p extends o{static get styles(){return[t,r,e` | ||
.response { | ||
font-size: var( | ||
--pie-live-session-font-size-small, | ||
${r}px | ||
${i}px | ||
); | ||
@@ -16,5 +16,5 @@ } | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){const{value:s}=this.session||{},e=n(s||"");return a`<div class="response"> | ||
${o(e)} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){const{value:e}=this.session||{},t=n(e||"");return s`<div class="response"> | ||
${a(t)} | ||
</div>`}}export default p;export{p as ExtendedTextEntryResponse}; | ||
//# sourceMappingURL=ExtendedTextEntryResponse.js.map |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as GraphingCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as GraphingCell}; | ||
//# sourceMappingURL=GraphingCell.js.map |
@@ -1,2 +0,2 @@ | ||
import{e,h as t}from"./cssUtils-4e44882e.js";import{C as s}from"./CustomLitElement-a356b5f6.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response"> | ||
import{h as e}from"./lit-element-236efe74.js";import{e as t}from"./cssUtils-e3142d13.js";import{C as s}from"./CustomLitElement-584c0ff9.js";class r extends s{static get styles(){return[t]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return e`<div class="response"> | ||
Expand to see student response | ||
@@ -3,0 +3,0 @@ <div class="magnifier">⚲</div> |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as HotspotCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as HotspotCell}; | ||
//# sourceMappingURL=HotspotCell.js.map |
@@ -1,2 +0,2 @@ | ||
import{e,h as t}from"./cssUtils-4e44882e.js";import{C as s}from"./CustomLitElement-a356b5f6.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response"> | ||
import{h as e}from"./lit-element-236efe74.js";import{e as t}from"./cssUtils-e3142d13.js";import{C as s}from"./CustomLitElement-584c0ff9.js";class r extends s{static get styles(){return[t]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return e`<div class="response"> | ||
Expand to see student response | ||
@@ -3,0 +3,0 @@ <div class="magnifier">⚲</div> |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as InlineDropdownCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as InlineDropdownCell}; | ||
//# sourceMappingURL=InlineDropdownCell.js.map |
@@ -1,6 +0,6 @@ | ||
import{g as e,j as t,r as s,b as o,h as r}from"./cssUtils-4e44882e.js";import{C as i}from"./CustomLitElement-a356b5f6.js";import"./unsafe-html-2525f04a.js";import{g as h,r as c}from"./utils-15fcf4f1.js";class u extends i{static get styles(){return[e,t,s,o` | ||
import{c as e,h as t}from"./lit-element-236efe74.js";import{b as s,f as o,r}from"./cssUtils-e3142d13.js";import{C as i}from"./CustomLitElement-584c0ff9.js";import"./unsafe-html-ee02b8b6.js";import{g as h,r as c}from"./utils-779c324b.js";class u extends i{static get styles(){return[s,o,r,e` | ||
p { | ||
margin: 2px; | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{choices:e}=this.model||{},{value:t}=this.session||{};return t&&e?Object.keys(e).map(s=>{const{label:o,correct:i}=e[s].find(e=>e.value===t[s])||{},c=t[s]&&o||"";return r`<div | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{choices:e}=this.model||{},{value:s}=this.session||{};return s&&e?Object.keys(e).map(o=>{const{label:r,correct:i}=e[o].find(e=>e.value===s[o])||{},c=s[o]&&r||"";return t`<div | ||
class="choice-value" | ||
@@ -10,4 +10,4 @@ @mouseover=${e=>this.mouseover(e,c)} | ||
> | ||
<p>${s}. ${c?h(i):""}</p> | ||
</div>`}):r``}render(){return r` | ||
<p>${o}. ${c?h(i):""}</p> | ||
</div>`}):t``}render(){return t` | ||
<div class="response"> | ||
@@ -14,0 +14,0 @@ ${this._renderResponse()} ${c(this.hoveredChoice)} |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as MatchCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as MatchCell}; | ||
//# sourceMappingURL=MatchCell.js.map |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as MatchListCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as MatchListCell}; | ||
//# sourceMappingURL=MatchListCell.js.map |
@@ -1,2 +0,2 @@ | ||
import{e,h as t}from"./cssUtils-4e44882e.js";import{C as s}from"./CustomLitElement-a356b5f6.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response"> | ||
import{h as e}from"./lit-element-236efe74.js";import{e as t}from"./cssUtils-e3142d13.js";import{C as s}from"./CustomLitElement-584c0ff9.js";class r extends s{static get styles(){return[t]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return e`<div class="response"> | ||
Expand to see student response | ||
@@ -3,0 +3,0 @@ <div class="magnifier">⚲</div> |
@@ -1,6 +0,6 @@ | ||
import{g as e,r as t,b as s,d as o,m as i,h as r}from"./cssUtils-4e44882e.js";import{C as c}from"./CustomLitElement-a356b5f6.js";import"./unsafe-html-2525f04a.js";import{g as n,r as h}from"./utils-15fcf4f1.js";class a extends c{static get styles(){return[e,t,s` | ||
import{c as e,h as t}from"./lit-element-236efe74.js";import{b as s,r as o,d as i,i as r}from"./cssUtils-e3142d13.js";import{C as c}from"./CustomLitElement-584c0ff9.js";import"./unsafe-html-ee02b8b6.js";import{g as n,r as h}from"./utils-779c324b.js";class l extends c{static get styles(){return[s,o,e` | ||
.response { | ||
font-size: var( | ||
--pie-live-session-font-size-small, | ||
${o}px | ||
${i}px | ||
); | ||
@@ -18,3 +18,3 @@ padding: 4px 8px; | ||
border: 1px solid | ||
var(--pie-live-session-text-color, ${i}); | ||
var(--pie-live-session-text-color, ${r}); | ||
height: 12px; | ||
@@ -24,3 +24,3 @@ width: 12px; | ||
--pie-live-session-font-size-small, | ||
${o}px | ||
${i}px | ||
); | ||
@@ -38,3 +38,3 @@ text-align: center; | ||
--pie-live-session-text-color, | ||
${i} | ||
${r} | ||
); | ||
@@ -45,10 +45,10 @@ } | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height/2,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{headers:e,rows:t,choiceMode:s}=this.model||{},{answers:o}=this.session||{};return e&&t?r`<table> | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height/2,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{headers:e,rows:s,choiceMode:o}=this.model||{},{answers:i}=this.session||{};return e&&s?t`<table> | ||
<tr> | ||
${e.map((e,t)=>r`<td>${t?"C"+t:"Q-id"}</td>`)} | ||
${e.map((e,s)=>t`<td>${s?"C"+s:"Q-id"}</td>`)} | ||
</tr> | ||
${t.map(e=>{const{values:t,title:i}=e,c=o?o[e.id]:[];return r` <tr | ||
${s.map(e=>{const{values:s,title:r}=e,c=i?i[e.id]:[];return t` <tr | ||
class="choice-value" | ||
@mouseover=${e=>this.mouseover(e,i)} | ||
@mouseover=${e=>this.mouseover(e,r)} | ||
@mouseout=${this.mouseout} | ||
@@ -58,6 +58,6 @@ > | ||
${(t||c).map((e,o)=>{let i="";const h=c&&c[o];return h&&(i=n(t[o])),r` | ||
${(s||c).map((e,i)=>{let r="";const h=c&&c[i];return h&&(r=n(s[i])),t` | ||
<td> | ||
<div class="choice ${s} is-${h}"> | ||
${i} | ||
<div class="choice ${o} is-${h}"> | ||
${r} | ||
</div> | ||
@@ -67,3 +67,3 @@ </td> | ||
</tr>`})} | ||
</table>`:r``}render(){return r` | ||
</table>`:t``}render(){return t` | ||
<div class="response"> | ||
@@ -75,3 +75,3 @@ <div class="response-content"> | ||
</div> | ||
`}}export default a;export{a as MatchResponse}; | ||
`}}export default l;export{l as MatchResponse}; | ||
//# sourceMappingURL=MatchResponse.js.map |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as MathInlineCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as MathInlineCell}; | ||
//# sourceMappingURL=MathInlineCell.js.map |
@@ -1,11 +0,11 @@ | ||
import{L as t,r as e,b as s,d as o,h as a}from"./cssUtils-4e44882e.js";import{u as n}from"./unsafe-html-2525f04a.js";const r={ROUND_BRACKETS:"round_brackets",SQUARE_BRACKETS:"square_brackets",DOLLAR:"dollar",DOUBLE_DOLLAR:"double_dollar"},i={[r.ROUND_BRACKETS]:["\\(","\\)"],[r.SQUARE_BRACKETS]:["\\[","\\]"],[r.DOLLAR]:["$","$"],[r.DOUBLE_DOLLAR]:["$$","$$"]};class c extends t{static get styles(){return[e,s` | ||
import{L as e,c as t,h as s}from"./lit-element-236efe74.js";import{r as o,d as n}from"./cssUtils-e3142d13.js";import{u as a}from"./unsafe-html-ee02b8b6.js";const r={ROUND_BRACKETS:"round_brackets",SQUARE_BRACKETS:"square_brackets",DOLLAR:"dollar",DOUBLE_DOLLAR:"double_dollar"},i={[r.ROUND_BRACKETS]:["\\(","\\)"],[r.SQUARE_BRACKETS]:["\\[","\\]"],[r.DOLLAR]:["$","$"],[r.DOUBLE_DOLLAR]:["$$","$$"]};class c extends e{static get styles(){return[o,t` | ||
.response { | ||
font-size: var( | ||
--pie-live-session-font-size-small, | ||
${o}px | ||
${n}px | ||
); | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},imgSrc:{type:String,attribute:!1},svgSrc:{type:String,attribute:!1},mathLoaded:{type:Boolean,attribute:!1}}}constructor(){super(),(t=>{const e=t.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js",t.getElementsByTagName("head")[0].appendChild(e)})(document),this.createSvg()}setSvg(t){const e=this;c.mathToSvg(((t,e)=>{let s=e;s===r.SQUARE_BRACKETS&&(console.warn("\\[...\\] is not supported yet"),s=r.ROUND_BRACKETS),s===r.DOUBLE_DOLLAR&&(console.warn("$$...$$ is not supported yet"),s=r.DOLLAR);const[o,a]=i[s]||i[r.ROUND_BRACKETS];return`${o}${t}${a}`})(t)).then(t=>{e.svgSrc=t}).catch(t=>console.error(t))}createSvg(){const t=this;if(window.MathJax){const{completeAnswer:e}=t.session||{};e&&t.setSvg(e)}else window.MathJax={jax:["input/TeX","output/SVG"],extensions:["tex2jax.js","MathMenu.js","MathZoom.js"],showMathMenu:!1,showProcessingMessages:!1,messageStyle:"none",SVG:{useGlobalCache:!1},TeX:{extensions:["AMSmath.js","AMSsymbols.js","autoload-all.js"],inlineMath:[["$","$"],["\\(","\\)"]]},AuthorInit(){window.MathJax.Hub.Register.StartupHook("End",(function(){const{completeAnswer:e}=t.session||{};e&&t.setSvg(e)}))}}}updated(t){const e=t.get("session"),{completeAnswer:s}=e||{};this.session&&s!==this.session.completeAnswer&&this.session.completeAnswer&&(!s&&this.svgSrc||this.setSvg(this.session.completeAnswer))}static mathToSvg(t){return new Promise(e=>{setTimeout(()=>{const s=t,o=document.createElement("div");o.innerHTML=s,window.MathJax&&window.MathJax.Hub&&(window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,o]),window.MathJax.Hub.Queue(()=>{const t=o.getElementsByTagName("svg")[0];t.setAttribute("xmlns","http://www.w3.org/2000/svg"),e(t.outerHTML)}))},200)})}render(){return a`<div class="response"> | ||
${this.svgSrc?n(this.svgSrc):""} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},imgSrc:{type:String,attribute:!1},svgSrc:{type:String,attribute:!1},mathLoaded:{type:Boolean,attribute:!1}}}constructor(){super(),(e=>{const t=e.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js",e.getElementsByTagName("head")[0].appendChild(t)})(document),this.createSvg()}setSvg(e){const t=this;c.mathToSvg(((e,t)=>{let s=t;s===r.SQUARE_BRACKETS&&(console.warn("\\[...\\] is not supported yet"),s=r.ROUND_BRACKETS),s===r.DOUBLE_DOLLAR&&(console.warn("$$...$$ is not supported yet"),s=r.DOLLAR);const[o,n]=i[s]||i[r.ROUND_BRACKETS];return`${o}${e}${n}`})(e)).then(e=>{t.svgSrc=e}).catch(e=>console.error(e))}createSvg(){const e=this;if(window.MathJax){const{completeAnswer:t}=e.session||{};t&&e.setSvg(t)}else window.MathJax={jax:["input/TeX","output/SVG"],extensions:["tex2jax.js","MathMenu.js","MathZoom.js"],showMathMenu:!1,showProcessingMessages:!1,messageStyle:"none",SVG:{useGlobalCache:!1},TeX:{extensions:["AMSmath.js","AMSsymbols.js","autoload-all.js"],inlineMath:[["$","$"],["\\(","\\)"]]},AuthorInit(){window.MathJax.Hub.Register.StartupHook("End",(function(){const{completeAnswer:t}=e.session||{};t&&e.setSvg(t)}))}}}updated(e){const t=e.get("session"),{completeAnswer:s}=t||{};this.session&&s!==this.session.completeAnswer&&this.session.completeAnswer&&(!s&&this.svgSrc||this.setSvg(this.session.completeAnswer))}static mathToSvg(e){return new Promise(t=>{setTimeout(()=>{const s=e,o=document.createElement("div");o.innerHTML=s,window.MathJax&&window.MathJax.Hub&&(window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,o]),window.MathJax.Hub.Queue(()=>{const e=o.getElementsByTagName("svg")[0];e.setAttribute("xmlns","http://www.w3.org/2000/svg"),t(e.outerHTML)}))},200)})}render(){return s`<div class="response"> | ||
${this.svgSrc?a(this.svgSrc):""} | ||
</div>`}}export default c;export{c as MathInlineResponse}; | ||
//# sourceMappingURL=MathInlineResponse.js.map |
@@ -1,2 +0,2 @@ | ||
import{g as e,c as t,j as s,a as o,b as i,m as r,h}from"./cssUtils-4e44882e.js";import{C as c}from"./CustomLitElement-a356b5f6.js";import"./unsafe-html-2525f04a.js";import{a as l,r as a}from"./utils-15fcf4f1.js";class n extends c{static get styles(){return[e,t,s,o,i` | ||
import{c as e,h as t}from"./lit-element-236efe74.js";import{b as s,c as o,f as i,a as r,i as h}from"./cssUtils-e3142d13.js";import{C as c}from"./CustomLitElement-584c0ff9.js";import"./unsafe-html-ee02b8b6.js";import{a as l,r as n}from"./utils-779c324b.js";class a extends c{static get styles(){return[s,o,i,r,e` | ||
:host { | ||
@@ -7,3 +7,3 @@ color: var(--pie-live-session-text-color, black); | ||
align-items: center; | ||
color: var(--pie-live-session-text-color, ${r}); | ||
color: var(--pie-live-session-text-color, ${h}); | ||
display: flex; | ||
@@ -20,8 +20,8 @@ justify-content: center; | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}render(){const e=l(this.model,this.session,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)});return h` | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}render(){const e=l(this.model,this.session,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)});return t` | ||
<div class="cell"> | ||
<span>${e}</span> | ||
${a(this.hoveredChoice)} | ||
${n(this.hoveredChoice)} | ||
</div> | ||
`}}export default n;export{n as MultipleChoiceCell}; | ||
`}}export default a;export{a as MultipleChoiceCell}; | ||
//# sourceMappingURL=MultipleChoiceCell.js.map |
@@ -1,2 +0,2 @@ | ||
import{g as e,j as t,a as s,r as o,b as i,h as r}from"./cssUtils-4e44882e.js";import{C as h}from"./CustomLitElement-a356b5f6.js";import"./unsafe-html-2525f04a.js";import{a as n,r as a}from"./utils-15fcf4f1.js";class c extends h{static get styles(){return[e,t,s,o,i` | ||
import{c as e,h as t}from"./lit-element-236efe74.js";import{b as s,f as o,a as i,r}from"./cssUtils-e3142d13.js";import{C as h}from"./CustomLitElement-584c0ff9.js";import"./unsafe-html-ee02b8b6.js";import{a as n,r as c}from"./utils-779c324b.js";class a extends h{static get styles(){return[s,o,i,r,e` | ||
.response { | ||
@@ -14,8 +14,8 @@ align-items: center; | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}render(){return r`<div class="response"> | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}render(){return t`<div class="response"> | ||
<span> | ||
${n(this.model,this.session,{mouseover:this.mouseover.bind(this),mouseout:this.mouseout.bind(this)})} | ||
</span> | ||
${a(this.hoveredChoice)} | ||
</div>`}}export default c;export{c as MultipleChoiceResponse}; | ||
${c(this.hoveredChoice)} | ||
</div>`}}export default a;export{a as MultipleChoiceResponse}; | ||
//# sourceMappingURL=MultipleChoiceResponse.js.map |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as NumberLineCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as NumberLineCell}; | ||
//# sourceMappingURL=NumberLineCell.js.map |
@@ -1,2 +0,2 @@ | ||
import{e,h as t}from"./cssUtils-4e44882e.js";import{C as s}from"./CustomLitElement-a356b5f6.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response"> | ||
import{h as e}from"./lit-element-236efe74.js";import{e as t}from"./cssUtils-e3142d13.js";import{C as s}from"./CustomLitElement-584c0ff9.js";class r extends s{static get styles(){return[t]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return e`<div class="response"> | ||
Expand to see student response | ||
@@ -3,0 +3,0 @@ <div class="magnifier">⚲</div> |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as OrderingCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as OrderingCell}; | ||
//# sourceMappingURL=OrderingCell.js.map |
@@ -1,2 +0,2 @@ | ||
import{e,h as t}from"./cssUtils-4e44882e.js";import{C as s}from"./CustomLitElement-a356b5f6.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response"> | ||
import{h as e}from"./lit-element-236efe74.js";import{e as t}from"./cssUtils-e3142d13.js";import{C as s}from"./CustomLitElement-584c0ff9.js";class r extends s{static get styles(){return[t]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return e`<div class="response"> | ||
Expand to see student response | ||
@@ -3,0 +3,0 @@ <div class="magnifier">⚲</div> |
@@ -1,2 +0,2 @@ | ||
import{L as t,c as e,h as s}from"./cssUtils-4e44882e.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as SelectTextCell}; | ||
import{L as e,h as t}from"./lit-element-236efe74.js";import{c as s}from"./cssUtils-e3142d13.js";class r extends e{static get styles(){return[s]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="cell"></div>`}}export default r;export{r as SelectTextCell}; | ||
//# sourceMappingURL=SelectTextCell.js.map |
@@ -1,6 +0,6 @@ | ||
import{g as e,j as t,r as s,b as o,d as r,h as i}from"./cssUtils-4e44882e.js";import{C as n}from"./CustomLitElement-a356b5f6.js";import"./unsafe-html-2525f04a.js";import{g as h,r as c}from"./utils-15fcf4f1.js";class a extends n{static get styles(){return[e,t,s,o` | ||
import{c as e,h as t}from"./lit-element-236efe74.js";import{b as s,f as o,r,d as i}from"./cssUtils-e3142d13.js";import{C as n}from"./CustomLitElement-584c0ff9.js";import"./unsafe-html-ee02b8b6.js";import{g as h,r as c}from"./utils-779c324b.js";class l extends n{static get styles(){return[s,o,r,e` | ||
.response { | ||
font-size: var( | ||
--pie-live-session-font-size-small, | ||
${r}px | ||
${i}px | ||
); | ||
@@ -11,16 +11,16 @@ } | ||
} | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{tokens:e}=this.model||{},{selectedTokens:t}=this.session||{};return e&&e.length&&t&&t.length?t.map(t=>{const s=e.find(e=>e.start===t.start&&e.end===t.end);if(!s)return i``;const{text:o,correct:r}=s;return i` <div | ||
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value");if(s&&s.getBoundingClientRect){const e=s.getBoundingClientRect();this.hoveredChoice={value:t,top:e.top+e.height,left:e.left+e.width}}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{tokens:e}=this.model||{},{selectedTokens:s}=this.session||{};return e&&e.length&&s&&s.length?s.map(s=>{const o=e.find(e=>e.start===s.start&&e.end===s.end);if(!o)return t``;const{text:r,correct:i}=o;return t` <div | ||
class="choice-value" | ||
@mouseover=${e=>this.mouseover(e,o)} | ||
@mouseover=${e=>this.mouseover(e,r)} | ||
@mouseout=${this.mouseout} | ||
> | ||
<p> | ||
${h(r)} | ||
${o.length>12?o.slice(0,12)+"...":o} | ||
${h(i)} | ||
${r.length>12?r.slice(0,12)+"...":r} | ||
</p> | ||
</div>`}):i``}render(){return i` | ||
</div>`}):t``}render(){return t` | ||
<div class="response"> | ||
${this._renderResponse()} ${c(this.hoveredChoice)} | ||
</div> | ||
`}}export default a;export{a as SelectTextResponse}; | ||
`}}export default l;export{l as SelectTextResponse}; | ||
//# sourceMappingURL=SelectTextResponse.js.map |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"description": "Extended capabilites for pie-elements", | ||
@@ -9,0 +9,0 @@ "author": "PIE Api Authors", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
365852
86
1251
1