@pie-element/rubric 8.2.1 → 8.2.2-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -34
- package/configure/CHANGELOG.md +54 -31
- package/configure/package.json +5 -5
- package/controller/CHANGELOG.md +75 -3
- package/controller/package.json +1 -1
- package/package.json +3 -3
- package/module/configure.js +0 -1
- package/module/controller.js +0 -73
- package/module/demo.js +0 -33
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -14
- package/module/print-demo.js +0 -71
- package/module/print.html +0 -18
- package/module/print.js +0 -1
package/module/print-demo.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import PrintElement from './print.js';
|
|
2
|
-
|
|
3
|
-
var generate = {};
|
|
4
|
-
|
|
5
|
-
generate.model = (id, element) => ({
|
|
6
|
-
id,
|
|
7
|
-
element,
|
|
8
|
-
points: ['nothing right', 'a teeny bit right', 'mostly right', 'bingo'],
|
|
9
|
-
sampleAnswers: [null, 'just right', 'not left', null],
|
|
10
|
-
maxPoints: 3,
|
|
11
|
-
excludeZero: false,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const { model } = generate;
|
|
15
|
-
|
|
16
|
-
var config = {
|
|
17
|
-
elements: {
|
|
18
|
-
'pie-rubric': '../..',
|
|
19
|
-
},
|
|
20
|
-
models: [model('1', 'pie-rubric')],
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// new init - just shows off print!
|
|
24
|
-
|
|
25
|
-
const init = async () => {
|
|
26
|
-
console.log('define the element...');
|
|
27
|
-
await Promise.all(
|
|
28
|
-
config.models.map(async (m) => {
|
|
29
|
-
try {
|
|
30
|
-
const printTag = `${m.element}-print`;
|
|
31
|
-
if (customElements.get(printTag)) {
|
|
32
|
-
return true;
|
|
33
|
-
} else {
|
|
34
|
-
customElements.define(printTag, PrintElement);
|
|
35
|
-
await customElements.whenDefined(printTag);
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
} catch (e) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
console.log('now apply the model...');
|
|
45
|
-
config.models.forEach((m) => {
|
|
46
|
-
const printTag = `${m.element}-print`;
|
|
47
|
-
const h3s = document.createElement('h3');
|
|
48
|
-
h3s.textContent = 'student mode';
|
|
49
|
-
document.body.appendChild(h3s);
|
|
50
|
-
const de = document.createElement(printTag);
|
|
51
|
-
document.body.appendChild(de);
|
|
52
|
-
de.options = {};
|
|
53
|
-
de.model = m;
|
|
54
|
-
|
|
55
|
-
const h3 = document.createElement('h3');
|
|
56
|
-
h3.textContent = 'instructor mode';
|
|
57
|
-
document.body.appendChild(h3);
|
|
58
|
-
const instr = document.createElement(printTag);
|
|
59
|
-
document.body.appendChild(instr);
|
|
60
|
-
instr.options = { mode: 'instructor' };
|
|
61
|
-
instr.model = JSON.parse(JSON.stringify(m));
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
init()
|
|
66
|
-
.then(() => {
|
|
67
|
-
console.log('ready');
|
|
68
|
-
})
|
|
69
|
-
.catch((e) => {
|
|
70
|
-
console.error(e);
|
|
71
|
-
});
|
package/module/print.html
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/rubric@8.2.0</title>
|
|
6
|
-
<link
|
|
7
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
8
|
-
rel="stylesheet"
|
|
9
|
-
/>
|
|
10
|
-
<style>
|
|
11
|
-
html, body {
|
|
12
|
-
font-family: 'Roboto', sans-serif;
|
|
13
|
-
}
|
|
14
|
-
</style>
|
|
15
|
-
<script type="module" src="./print-demo.js"></script>
|
|
16
|
-
</head>
|
|
17
|
-
<body></body>
|
|
18
|
-
</html>
|
package/module/print.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_dll_prop_types as e,_dll_react as t,_dll_mui__material_styles as n,_dll_react_dom as r,_dll_mui__material_colors as i,_dll_mui__material as o,_dll_debug as s,_dll_mui__material_collapse as l,_dll_react_dom_client as a}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";import{_dll_pie_lib__math_rendering as c}from"../../../@pie-lib/math-rendering-module@6.0.0/module/index.js";var p="object"==typeof global&&global&&global.Object===Object&&global,d="object"==typeof self&&self&&self.Object===Object&&self,u=p||d||Function("return this")(),h=u.Symbol,m=Object.prototype,f=m.hasOwnProperty,g=m.toString,E=h?h.toStringTag:void 0;var y=Object.prototype.toString;var b=h?h.toStringTag:void 0;function x(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":b&&b in Object(e)?function(e){var t=f.call(e,E),n=e[E];try{e[E]=void 0;var r=!0}catch(e){}var i=g.call(e);return r&&(t?e[E]=n:delete e[E]),i}(e):function(e){return y.call(e)}(e)}var v=/\s/;var C=/^\s+/;function _(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&v.test(e.charAt(t)););return t}(e)+1).replace(C,""):e}function k(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var R=/^[-+]0x[0-9a-f]+$/i,S=/^0b[01]+$/i,O=/^0o[0-7]+$/i,T=parseInt;function A(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==x(e)}(e))return NaN;if(k(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=k(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=_(e);var n=S.test(e);return n||O.test(e)?T(e.slice(2),n?2:8):R.test(e)?NaN:+e}var N=function(){return u.Date.now()},D=Math.max,M=Math.min;function B(e,t,n){var r,i,o,s,l,a,c=0,p=!1,d=!1,u=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,o=i;return r=i=void 0,c=t,s=e.apply(o,n)}function m(e){var n=e-a;return void 0===a||n>=t||n<0||d&&e-c>=o}function f(){var e=N();if(m(e))return g(e);l=setTimeout(f,function(e){var n=t-(e-a);return d?M(n,o-(e-c)):n}(e))}function g(e){return l=void 0,u&&r?h(e):(r=i=void 0,s)}function E(){var e=N(),n=m(e);if(r=arguments,i=this,a=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(f,t),p?h(e):s}(a);if(d)return clearTimeout(l),l=setTimeout(f,t),h(a)}return void 0===l&&(l=setTimeout(f,t)),s}return t=A(t)||0,k(n)&&(p=!!n.leading,o=(d="maxWait"in n)?D(A(n.maxWait)||0,t):o,u="trailing"in n?!!n.trailing:u),E.cancel=function(){void 0!==l&&clearTimeout(l),c=0,r=a=i=l=void 0},E.flush=function(){return void 0===l?s:g(N())},E}const F=t,L=e,I=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",w=({size:e,children:t})=>{const n={height:e=I(e),width:e,display:"inline-block",position:"relative"};return F.createElement("div",{style:n},t)};w.propTypes={size:L.number,children:L.oneOfType([L.arrayOf(L.node),L.node]).isRequired};const z=t,P=e,j=({size:e,children:t,sx:n})=>z.createElement(w,{size:e},z.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));j.propTypes={size:P.oneOfType([P.string,P.number]),children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,sx:P.object},P.string.isRequired;const q=({fill:e})=>z.createElement("polygon",{transform:"translate(2, 0)",points:"34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3",fill:e});q.propTypes={fill:P.string.isRequired};const U=({fill:e})=>z.createElement("path",{transform:"translate(1, 0)",d:"M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z",fill:e});U.propTypes={fill:P.string.isRequired};const Y=({fill:e})=>z.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});Y.propTypes={fill:P.string.isRequired};const H=({fill:e})=>z.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});H.propTypes={fill:P.string.isRequired};const $=e,W=t;var G=(e,t)=>{class n extends W.Component{static __initStatic(){this.propTypes={iconSet:$.oneOf(["emoji","check"]),shape:$.oneOf(["round","square"]),category:$.oneOf(["feedback",void 0]),open:$.bool,size:$.oneOfType([$.number,$.string]),fg:$.string,bg:$.string}}static __initStatic2(){this.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,size:30,fg:"#4aaf46",bg:"#f8ffe2"}}render(){const{iconSet:n,shape:r,category:i,open:o,size:s,fg:l,bg:a}=this.props,c="check"===n?W.createElement(e,{fill:l}):W.createElement(t,{fill:l}),p="check"===n?W.createElement(e,{fill:a}):W.createElement(t,{fill:a});return o?W.createElement(j,{size:s},p):W.createElement(j,{size:s},"feedback"===i?"round"===r?W.createElement(U,{fill:a}):W.createElement(q,{fill:a}):"round"===r?W.createElement(Y,{fill:a}):W.createElement(H,{fill:a}),c)}}return n.__initStatic(),n.__initStatic2(),n};const K=e,J=t,V=({fill:e})=>J.createElement("g",{transform:"translate(1, 0)"},J.createElement("path",{d:"M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2 c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z",fill:e}),J.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),J.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));V.propTypes={fill:K.string.isRequired};const X=({fill:e,x:t=0,y:n=0})=>J.createElement("polygon",{transform:`translate(${t}, ${n})`,points:"19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4",fill:e});X.propTypes={fill:K.string.isRequired,x:K.number,y:K.number};const Z=G(X,V);Z.propTypes={iconSet:K.oneOf(["emoji","check"]),shape:K.oneOf(["round","square"]),category:K.oneOf(["feedback",void 0]),open:K.bool,fg:K.string,bg:K.string,size:K.oneOfType([K.string,K.number])},Z.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const Q=e,{styled:ee}=n;Q.string.isRequired,Q.string.isRequired,Q.string.isRequired,Q.string.isRequired,Q.string.isRequired,ee("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),Q.bool,Q.string;const te=e,ne=t,re=({fill:e})=>ne.createElement("g",{transform:"translate(0.5, 0.5)"},ne.createElement("rect",{x:"11",y:"17.3",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",width:"16.6",height:"3.7",fill:e}),ne.createElement("rect",{x:"17.4",y:"10.7",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",width:"3.7",height:"16.6",fill:e}));re.propTypes={fill:te.string.isRequired};const ie=({fill:e})=>ne.createElement("g",{transform:"translate(1,0)"},ne.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),ne.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),ne.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));ie.propTypes={fill:te.string.isRequired};const oe=G(re,ie);oe.propTypes={iconSet:te.oneOf(["emoji","check"]),shape:te.oneOf(["round","square"]),category:te.oneOf(["feedback",void 0]),open:te.bool,fg:te.string,bg:te.string,size:te.oneOfType([te.string,te.number])},oe.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const se=e,le=t,ae=()=>{const e={fill:"none",stroke:"#BCE2FF",strokeWidth:2,strokeMiterlimit:10};return le.createElement("g",null,le.createElement("line",{style:e,x1:"-98",y1:"142",x2:"-114.6",y2:"142"}),le.createElement("line",{style:e,x1:"-98",y1:"146.3",x2:"-114.6",y2:"146.3"}),le.createElement("line",{style:e,x1:"-104",y1:"150.7",x2:"-114.6",y2:"150.7"}))},ce=({children:e,size:t})=>le.createElement(w,{size:t},le.createElement("svg",{version:"1.1",viewBox:"-128 129 31 31",style:{enableBackground:"new -128 129 31 31"}},e));ce.propTypes={children:se.oneOfType([se.arrayOf(se.node),se.node]).isRequired,size:se.number};const pe=()=>le.createElement("g",null,le.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),le.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),le.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),le.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),le.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#7FABC6"},width:"4.1",height:"4.1"}),le.createElement("polygon",{style:{fill:"#7FABC6"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "})),de=()=>le.createElement("g",null,le.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),le.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),le.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),le.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),le.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#1A9CFF"},width:"4.1",height:"4.1"}),le.createElement("polygon",{style:{fill:"#1A9CFF"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "}));class ue extends le.Component{constructor(e){super(e)}render(){return!0===this.props.open?le.createElement(ce,null,le.createElement(pe,null),le.createElement(ae,null)):le.createElement(ce,null,le.createElement(de,null),le.createElement(ae,null))}}ue.propTypes={open:se.bool},ue.defaultProps={open:!1};const he=e,me=t,fe=({fill:e})=>me.createElement("path",{fill:e,d:"M-130.4,142.1c0-2.1,1.7-3.9,3.9-3.9c0.3,0,0.5,0,0.8,0.1c-0.6-0.8-1.5-1.3-2.6-1.3c-1.8,0-3.3,1.5-3.3,3.3c0,1.1,0.5,2,1.3,2.6C-130.4,142.6-130.4,142.4-130.4,142.1z"});fe.propTypes={fill:he.string};class ge extends me.Component{static __initStatic(){this.propTypes={classes:he.object.isRequired,size:he.number}}render(){const{size:e}=this.props;return!0===this.props.open?me.createElement(w,{size:e},me.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 32"},me.createElement("path",{fill:"#BCE2FF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),me.createElement("path",{fill:"#BCE2FF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),me.createElement(fe,{fill:"#1A9CFF"}))):me.createElement(w,{size:e},me.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 31"},me.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-120.7,142.4c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-121.6,146-120.7,144.3-120.7,142.4z"}),me.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-124.4,154.3h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-123.6,153.9-123.9,154.3-124.4,154.3z"}),me.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-121.3,141.8c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.2,145.3-121.3,143.7-121.3,141.8z"}),",",me.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-125,153.7h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.2,153.3-124.6,153.7-125,153.7z"}),me.createElement("path",{fill:"#1A9CFF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),me.createElement("path",{fill:"#1A9CFF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),me.createElement(fe,{fill:"1A9CFF"})))}}ge.__initStatic(),ge.propTypes={open:he.bool},ge.defaultProps={open:!1};const Ee=e,ye=t,be=({fill:e})=>ye.createElement("g",null,ye.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),ye.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));be.propTypes={fill:Ee.string.isRequired};const xe=({fill:e})=>ye.createElement("polygon",{points:"14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5",fill:e});xe.propTypes={fill:Ee.string.isRequired};const ve=({fill:e})=>ye.createElement("g",null,ye.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),ye.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),ye.createElement("path",{d:"M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0 C25.7,26.4,25,27.1,24.2,27.1z",fill:e}));ve.propTypes={fill:Ee.string.isRequired};class Ce extends ye.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:ye.createElement(j,null,ye.createElement(xe,{fill:n}),ye.createElement(be,{fill:t})),emoji:ye.createElement(j,null,ye.createElement(xe,{fill:n}),ye.createElement(ve,{fill:t})),feedback:{check:ye.createElement(j,null,ye.createElement(xe,{fill:n}),ye.createElement(ve,{fill:t})),emoji:ye.createElement(j,null,ye.createElement(xe,{fill:n}),ye.createElement(ve,{fill:t})),square:{check:ye.createElement(j,null,ye.createElement(xe,{fill:n}),ye.createElement(be,{fill:t})),emoji:ye.createElement(j,null,ye.createElement(xe,{fill:n}),ye.createElement(ve,{fill:t})),open:{check:ye.createElement(j,null,ye.createElement(be,{fill:n})),emoji:ye.createElement(j,null,ye.createElement(ve,{fill:n}))}}}}}render(){const{iconSet:e,category:t,shape:n,open:r}=this.props;return void 0===t?this.icons[e]:void 0===n?this.icons.feedback[e]:!0===r?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}}Ce.propTypes={iconSet:Ee.oneOf(["emoji","check",void 0]),shape:Ee.oneOf(["square",void 0]),category:Ee.oneOf(["feedback",void 0]),open:Ee.bool,fg:Ee.string,bg:Ee.string},Ce.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const _e=e,ke=t,Re=({fill:e})=>ke.createElement("g",{transform:"translate(0, 0)"},ke.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),ke.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));Re.propTypes={fill:_e.string.isRequired};const Se=({fill:e})=>ke.createElement("g",{transform:"translate(2, 0)"},ke.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),ke.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),ke.createElement("rect",{x:"10.9",y:"22.9",transform:"matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)",width:"14.3",height:"3.7",fill:e}));Se.propTypes={fill:_e.string.isRequired};const Oe=G(Re,Se);Oe.propTypes={iconSet:_e.oneOf(["emoji","check"]),shape:_e.oneOf(["round","square"]),category:_e.oneOf(["feedback",void 0]),open:_e.bool,fg:_e.string,bg:_e.string,size:_e.oneOfType([_e.string,_e.number])},Oe.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const Te=e,Ae=t,Ne=({fill:e})=>Ae.createElement("g",null,Ae.createElement("rect",{x:"-115",y:"136.7",width:"3",height:"3",fill:e}),Ae.createElement("polygon",{points:"-112,147.7 -112,141.7 -115.8,141.7 -115.8,143.7 -114,143.7 -114,147.7 -116.2,147.7 -116.2,149.7 -109.8,149.7 -109.8,147.7",fill:e}));Ne.propTypes={fill:Te.string.isRequired};const De=({fill:e})=>Ae.createElement("path",{d:"M-113,158.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105,158.5-113,158.5z M-113,130.5c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-105.6,130.5-113,130.5z",fill:e});De.propTypes={fill:Te.string.isRequired};const Me=({fill:e="#FFFFFF"})=>Ae.createElement("g",null,Ae.createElement("path",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeMiterlimit:10},d:"M-111.7,160.9c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5C-96.2,154-103.1,160.9-111.7,160.9z"}),Ae.createElement("path",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeMiterlimit:10},d:"M-112,159.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-104,159.5-112,159.5z"}),Ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:e}));Me.propTypes={fill:Te.string};const Be=({children:e,size:t})=>{const n=I(t),r={height:n,width:n,display:"inline-block",position:"relative"};return Ae.createElement("div",{style:r},Ae.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-129 128 34 34"},e))};Be.propTypes={children:Te.oneOfType([Te.arrayOf(Te.node),Te.node]).isRequired,size:Te.oneOfType([Te.string,Te.number])};class Fe extends Ae.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:r="#bce2ff",border:i="#bbe3fd"}=this.props,o=Ae.createElement(Ne,{fill:n}),s={check:Ae.createElement(Be,{size:this.props.size},Ae.createElement(Me,null),o,Ae.createElement(De,{fill:i})),emoji:Ae.createElement(Be,{size:this.props.size},Ae.createElement(Me,null),o,Ae.createElement(De,{fill:i})),open:{check:Ae.createElement(Be,{size:this.props.size},Ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),Ae.createElement(Ne,{fill:r}),Ae.createElement(De,{fill:"#FFFFFF"})),emoji:Ae.createElement(Be,{size:this.props.size},Ae.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),Ae.createElement(Ne,{fill:r}),Ae.createElement(De,{fill:i}))}};return!0===t?s.open[e]:s[e]}}function Le(){return Le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Le.apply(null,arguments)}function Ie(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function we(e,t){return we=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},we(e,t)}function ze(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,we(e,t)}function Pe(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}Fe.propTypes={iconSet:Te.oneOf(["emoji","check"]),open:Te.bool,fg:Te.string,bg:Te.string,border:Te.string,size:Te.oneOfType([Te.string,Te.number])},Fe.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var je=!1;var qe=t.createContext(null),Ue=function(e){return e.scrollTop};const Ye=t,He=r;var $e="unmounted",We="exited",Ge="entering",Ke="entered",Je="exiting",Ve=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=We,r.appearStatus=Ge):i=Ke:i=t.unmountOnExit||t.mountOnEnter?$e:We,r.state={status:i},r.nextCallback=null,r}ze(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===$e?{status:We}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Ge&&n!==Ke&&(t=Ge):n!==Ge&&n!==Ke||(t=Je)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Ge){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:He.findDOMNode(this);n&&Ue(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===We&&this.setState({status:$e})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[He.findDOMNode(this),r],o=i[0],s=i[1],l=this.getTimeouts(),a=r?l.appear:l.enter;!e&&!n||je?this.safeSetState({status:Ke},function(){t.props.onEntered(o)}):(this.props.onEnter(o,s),this.safeSetState({status:Ge},function(){t.props.onEntering(o,s),t.onTransitionEnd(a,function(){t.safeSetState({status:Ke},function(){t.props.onEntered(o,s)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:He.findDOMNode(this);t&&!je?(this.props.onExit(r),this.safeSetState({status:Je},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:We},function(){e.props.onExited(r)})})})):this.safeSetState({status:We},function(){e.props.onExited(r)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:He.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],s=i[1];this.props.addEndListener(o,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===$e)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=Ie(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ye.createElement(qe.Provider,{value:null},"function"==typeof n?n(e,r):Ye.cloneElement(Ye.Children.only(n),r))},t}(Ye.Component);function Xe(){}Ve.contextType=qe,Ve.propTypes={},Ve.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Xe,onEntering:Xe,onEntered:Xe,onExit:Xe,onExiting:Xe,onExited:Xe},Ve.UNMOUNTED=$e,Ve.EXITED=We,Ve.ENTERING=Ge,Ve.ENTERED=Ke,Ve.EXITING=Je;var Ze=Ve;const Qe=t;var et=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r})},tt=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Pe(n.className,r):n.setAttribute("class",Pe(n.className&&n.className.baseVal||"",r)));var n,r})},nt=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1];t.removeClasses(i,"exit"),t.addClass(i,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.addClass(i,o,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.removeClasses(i,o),t.addClass(i,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,i=r?""+(r&&n?n+"-":"")+e:n[e];return{baseClassName:i,activeClassName:r?i+"-active":n[e+"Active"],doneClassName:r?i+"-done":n[e+"Done"]}},t}ze(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&i&&(r+=" "+i),"active"===n&&e&&Ue(e),r&&(this.appliedClasses[t][n]=r,et(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,i=n.active,o=n.done;this.appliedClasses[t]={},r&&tt(e,r),i&&tt(e,i),o&&tt(e,o)},n.render=function(){var e=this.props;e.classNames;var t=Ie(e,["classNames"]);return Qe.createElement(Ze,Le({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(Qe.Component);nt.defaultProps={classNames:""},nt.propTypes={};var rt=nt;const{Children:it}=t,{cloneElement:ot}=t,{isValidElement:st}=t;function lt(e,t){var n=Object.create(null);return e&&it.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&st(e)?t(e):e}(e)}),n}function at(e,t,n){return null!=n[t]?n[t]:e.props[t]}function ct(e,t,n){var r=lt(e.children),i=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),o=[];for(var s in e)s in t?o.length&&(i[s]=o,o=[]):o.push(s);var l={};for(var a in t){if(i[a])for(r=0;r<i[a].length;r++){var c=i[a][r];l[i[a][r]]=n(c)}l[a]=n(a)}for(r=0;r<o.length;r++)l[o[r]]=n(o[r]);return l}(t,r);return Object.keys(i).forEach(function(o){var s=i[o];if(st(s)){var l=o in t,a=o in r,c=t[o],p=st(c)&&!c.props.in;!a||l&&!p?a||!l||p?a&&l&&st(c)&&(i[o]=ot(s,{onExited:n.bind(null,s),in:c.props.in,exit:at(s,"exit",e),enter:at(s,"enter",e)})):i[o]=ot(s,{in:!1}):i[o]=ot(s,{onExited:n.bind(null,s),in:!0,exit:at(s,"exit",e),enter:at(s,"enter",e)})}}),i}const pt=t;var dt=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},ut=function(e){function t(t,n){var r,i=(r=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));return r.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},r}ze(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,i=t.children,o=t.handleExited;return{children:t.firstRender?(n=e,r=o,lt(n.children,function(e){return ot(e,{onExited:r.bind(null,e),in:!0,appear:at(e,"appear",n),enter:at(e,"enter",n),exit:at(e,"exit",n)})})):ct(e,i,o),firstRender:!1}},n.handleExited=function(e,t){var n=lt(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=Le({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=Ie(e,["component","childFactory"]),i=this.state.contextValue,o=dt(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?pt.createElement(qe.Provider,{value:i},o):pt.createElement(qe.Provider,{value:i},pt.createElement(t,r,o))},t}(pt.Component);ut.propTypes={},ut.defaultProps={component:"div",childFactory:function(e){return e}};var ht=ut;const{green:mt}=i,{indigo:ft}=i,{orange:gt}=i,{pink:Et}=i,{red:yt}=i,bt={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:mt[500],CORRECT_SECONDARY:mt[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:gt[500],INCORRECT_SECONDARY:yt[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:yt[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:ft[500],PRIMARY_LIGHT:ft[200],PRIMARY_DARK:ft[800],SECONDARY:Et.A400,SECONDARY_LIGHT:Et[200],SECONDARY_DARK:Et[900],TERTIARY:"#146EB3",TERTIARY_LIGHT:"#D0E2F0",BACKGROUND:"rgba(255,255,255,0)",BACKGROUND_DARK:"#ECEDF1",DROPDOWN_BACKGROUND:"#E0E1E6",SECONDARY_BACKGROUND:"rgba(241,241,241,1)",BORDER:"#9A9A9A",BORDER_LIGHT:"#D1D1D1",BORDER_DARK:"#646464",BORDER_GRAY:"#7E8494",TABLE_GRID:"black",TABLE_GRID_LIGHT:"#dfe2e5",TABLE_STRIPE:"#f6f8fa",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BUTTON_FOCUS_OUTLINE:"#3B82F6",BLUE_GREY100:"#F3F5F7",BLUE_GREY300:"#C0C3CF",BLUE_GREY600:"#7E8494",BLUE_GREY900:"#152452",FADED_PRIMARY:"#DCDAFB",KEYPAD_BUTTON:"rgb(188, 194, 229)",KEYPAD_BUTTON_OPERATOR:"rgb(255, 159, 192)",KEYPAD_EMPTY_PLACEHOLDER:"rgba(245, 0, 87, 0.4)",KEYPAD_BUTTON_HOVER:"rgb(214, 218, 239)",KEYPAD_BUTTON_OPERATOR_HOVER:"rgb(255, 197, 217)",KEY_BOARD_FOCUS_INDICATOR:"#2B87FF",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(bt);const xt=(vt="pie",(...e)=>{const t=e.pop();return e.reduceRight((e,t)=>`var(--${vt}-${t}, ${e})`,t)});var vt;const Ct=()=>xt("text",bt.TEXT),_t=()=>xt("table-stripe","background-dark",bt.TABLE_STRIPE),kt=t,Rt=e,{styled:St}=n,Ot=St("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),Tt=St("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${xt("disabled",bt.DISABLED)})`,borderRadius:"4px",lineHeight:"25px",margin:"0px",padding:"10px",verticalAlign:"middle",color:"var(--feedback-color, white)","&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${xt("correct",bt.CORRECT)})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${xt("incorrect",bt.INCORRECT)})`}}),At=St("div")({"&.feedback-enter":{height:"1px"},"&.feedback-enter-active":{height:"45px",transition:"height 500ms"},"&.feedback-exit":{height:"45px"},"&.feedback-exit-active":{height:"1px",transition:"height 200ms"}});class Nt extends kt.Component{constructor(...e){super(...e),Nt.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:Rt.string,feedback:Rt.string}}__init(){this.nodeRef=kt.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?kt.createElement(rt,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},kt.createElement(At,{ref:this.nodeRef},kt.createElement(Ot,null,kt.createElement(Tt,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return kt.createElement("div",null,kt.createElement(ht,null,this.renderFeedback()))}}Nt.__initStatic();const Dt=t,Mt=e,{Popover:Bt}=o,{styled:Ft}=n,Lt=s("pie-libs:render-ui:response-indicators"),It=Ft("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),wt=Ft(Bt)({cursor:"pointer"}),zt=Ft("div")({padding:"0",borderRadius:"4px"}),Pt=(e,t)=>{class n extends Dt.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{Lt("[handlePopoverOpen]",e.target),this.setState({anchorEl:e.target})}}__init2(){this.handlePopoverClose=()=>{this.setState({anchorEl:null})}}render(){const{feedback:n}=this.props,{anchorEl:r}=this.state;return Dt.createElement(It,{hasFeedback:!!n},Dt.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},Dt.createElement(e,null)),n&&Dt.createElement(wt,{PaperComponent:zt,open:!!r,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},Dt.createElement(Nt,{feedback:n,correctness:t})))}}return n.propTypes={feedback:Mt.string},n};Pt(Z,"correct"),Pt(oe,"incorrect"),Pt(Oe,"partially-correct"),Pt(Ce,"nothing-submitted");const jt=t,{styled:qt}=n,Ut=l,Yt=e,{renderMath:Ht}=c,$t=qt("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),Wt=qt(Ut)(({theme:e})=>({paddingTop:e.spacing(2)}));class Gt extends jt.Component{constructor(...e){super(...e),Gt.prototype.__init.call(this),Gt.prototype.__init2.call(this)}static __initStatic(){this.propTypes={className:Yt.string,children:Yt.object,labels:Yt.shape({visible:Yt.string,hidden:Yt.string})}}static __initStatic2(){this.defaultProps={labels:{}}}__init(){this.state={expanded:!1}}__init2(){this.toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))}}componentDidMount(){Ht(this.root)}componentDidUpdate(){Ht(this.root)}render(){const{labels:e,children:t,className:n}=this.props,r=this.state.expanded?e.visible||"Hide":e.hidden||"Show";return jt.createElement("div",{className:n,ref:e=>this.root=e},jt.createElement("div",{onClick:this.toggleExpanded},jt.createElement($t,null,r)),jt.createElement(Wt,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}Gt.__initStatic(),Gt.__initStatic2();const{Button:Kt}=o,{styled:Jt}=n;Jt("div")({display:"flex",flexDirection:"column"}),Jt("div")({display:"flex",alignItems:"center",justifyContent:"center"}),Jt("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),Jt(Kt)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Vt=t,{createTheme:Xt}=n,{styled:Zt}=n,{StyledEngineProvider:Qt}=n,{ThemeProvider:en}=n,tn=e;const nn=Xt({typography:{fontFamily:"inherit"},palette:{action:{disabled:"rgba(0, 0, 0, 0.54);"}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:"inherit"}}},MuiButton:{styleOverrides:{contained:{backgroundColor:"#e0e0e0",color:"#000000","&:hover":{backgroundColor:"#bdbdbd"}}}}}}),rn=Zt("div")({"& table, th, td":{fontSize:"inherit"}});class on extends Vt.Component{static __initStatic(){this.propTypes={className:tn.string,children:tn.array,extraCSSRules:tn.shape({names:tn.arrayOf(tn.string),rules:tn.string}),fontSizeFactor:tn.number}}static __initStatic2(){this.defaultProps={extraCSSRules:{},fontSizeFactor:1}}constructor(e){super(e),this.classesSheet=document.createElement("style")}computeStyle(e){const t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),r=t(document.body),i=Math.max(n,r),o=null!=e&&"number"==typeof e?e:1;return 1!==o?{fontSize:i*o+"px"}:null}render(){const{children:e,className:t,fontSizeFactor:n,...r}=this.props,{extraCSSRules:i,...o}=r,s=this.computeStyle(n);return Vt.createElement(Qt,{injectFirst:!0},Vt.createElement(en,{theme:nn},function(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}([i,"optionalAccess",e=>e.rules])?Vt.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${i.rules} }`}}):null,Vt.createElement(rn,{className:`${t} extraCSSRules`,...o,...s&&{style:s}},e)))}}on.__initStatic(),on.__initStatic2();const sn=t,{styled:ln}=n,an=e,cn=ln(on)({display:"flex",flexDirection:"column",position:"relative"});class pn extends sn.Component{static __initStatic(){this.propTypes={ariaLabel:an.string,children:an.oneOfType([an.arrayOf(an.node),an.node]).isRequired,role:an.string,extraCSSRules:an.shape({names:an.arrayOf(an.string),rules:an.string}),fontSizeFactor:an.number}}render(){const{children:e,ariaLabel:t,role:n,extraCSSRules:r,fontSizeFactor:i,classes:o}=this.props,s=t?{"aria-label":t,role:n}:{};return sn.createElement(cn,{...s,extraCSSRules:r,fontSizeFactor:i,classes:o},e)}}pn.__initStatic();const dn=t,un=e;class hn extends dn.Component{static __initStatic(){this.propTypes={tag:un.string,className:un.string,html:un.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,r=e||"div";return dn.createElement(r,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}hn.__initStatic(),hn.__initStatic2();const{InputLabel:mn}=o,{FormControl:fn}=o,gn=e,{styled:En}=n;En(fn)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),En(mn)(()=>({fontSize:"inherit",whiteSpace:"nowrap",margin:0,padding:0,alignSelf:"flex-start",position:"absolute",top:0,left:0,transformOrigin:"top left",pointerEvents:"none","&.MuiInputLabel-shrink":{transform:"scale(0.75) translate(0, -0.75em)"},"&:not(.MuiInputLabel-shrink)":{transform:"translate(0, 0)"}})),gn.oneOfType([gn.string,gn.object]).isRequired,gn.string,gn.oneOfType([gn.arrayOf(gn.node),gn.node]).isRequired;const yn=t,{Component:bn}=t,{styled:xn}=n,vn=e,{renderMath:Cn}=c,_n=xn("div")(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:"collapse"},'&:not(.MathJax) table[border]:not([role="presentation"]), &:not(.MathJax) table[border]:not([role="presentation"]) td, &:not(.MathJax) table[border]:not([role="presentation"]) th':{borderStyle:"solid",borderColor:xt("table-grid","text",bt.TABLE_GRID)},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':{backgroundColor:_t()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:_t()},'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) th':{padding:".6em 1em",textAlign:"left"},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:"initial"},"&.prompt":{verticalAlign:"middle",color:Ct()},"&.legend":{width:"100%",fontSize:"inherit !important"},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${Ct()} !important`,display:"flex",flexDirection:"column",verticalAlign:"middle",cursor:"pointer","& > p":{margin:"0 0 0 0 !important"}}})),kn=/\\embed\{newLine\}\[\]/g;class Rn extends bn{constructor(...e){super(...e),Rn.prototype.__init.call(this),Rn.prototype.__init2.call(this)}static __initStatic(){this.propTypes={prompt:vn.string,tagName:vn.string,className:vn.string,onClick:vn.func,defaultClassName:vn.string,autoplayAudioEnabled:vn.bool,customAudioButton:{playImage:vn.string,pauseImage:vn.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.promptRef=yn.createRef()}__init2(){this.parsedText=e=>{const{customAudioButton:t}=this.props,n=document.createElement("div");n.innerHTML=e;const r=n.querySelector("audio");if(r){const e=document.createElement("source");if(e.setAttribute("type","audio/mp3"),e.setAttribute("src",r.getAttribute("src")),r.removeAttribute("src"),r.setAttribute("id","pie-prompt-audio-player"),r.appendChild(e),t){r.style.display="none";const e=document.createElement("div");e.id="play-audio-button",Object.assign(e.style,{cursor:"pointer",display:"block",width:"128px",height:"128px",backgroundImage:`url(${t.pauseImage})`,backgroundSize:"cover",borderRadius:"50%",border:"1px solid #326295"}),r.parentNode.insertBefore(e,r)}}return n.innerHTML}}addCustomAudioButtonControls(){const{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById("play-audio-button"),r=document.getElementById("pie-prompt-audio-player");if(e&&r&&r.play().then(()=>{n&&t&&r.addEventListener("ended",o)}).catch(e=>{console.error("Error playing audio",e)}),!n||!r||!t)return;const i=()=>{r.paused&&(n.style.backgroundImage.includes(t.pauseImage)||r.play())},o=()=>{n.style.backgroundImage=`url(${t.playImage})`},s=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},l=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",i),r.addEventListener("play",s),r.addEventListener("pause",l),r.addEventListener("ended",o),this._handlePlayClick=i,this._handleAudioPlay=s,this._handleAudioPause=l,this._handleAudioEnded=o}removeCustomAudioButtonListeners(){const e=document.getElementById("play-audio-button"),t=document.querySelector("audio");e&&t&&(e.removeEventListener("click",this._handlePlayClick),t.removeEventListener("play",this._handleAudioPlay),t.removeEventListener("pause",this._handleAudioPause),t.removeEventListener("ended",this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){const e=this.promptRef.current;e&&"function"==typeof Cn&&Cn(e)}alignImages(){const e=this.promptRef.current;if(!e)return;const t=e.getElementsByTagName("img");if(t&&t.length)for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){const t=e.attributes.alignment.value,n="center"===t?"center":"right"===t?"flex-end":"flex-start",r=e.parentElement;if("DIV"===r.tagName&&"flex"===r.style.display&&"100%"===r.style.width)r.style.justifyContent=n;else{const t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent=n;const i=e.cloneNode(!0);t.appendChild(i),r.replaceChild(t,e)}}}render(){const{prompt:e,tagName:t,className:n,onClick:r,defaultClassName:i}=this.props,o=`${n||""} ${i||""} ${"legend"===t?"legend":""} preview-prompt`.trim();return yn.createElement(_n,{as:t||"div",ref:this.promptRef,onClick:r,className:o,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(kn,"\\newline ")}})}}Rn.__initStatic(),Rn.__initStatic2();const Sn=e;Sn.node,Sn.bool;const On=e;On.node,On.string,"undefined"!=typeof window&&new DOMParser,"undefined"!=typeof window&&new DOMParser;const Tn=t,{styled:An}=n,{ListItem:Nn}=o,{List:Dn}=o,Mn=l,Bn=e,Fn=An(on)({color:Ct(),backgroundColor:xt("background",bt.BACKGROUND),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"},"& ul p, & ol p":{marginBottom:0,marginTop:0,lineHeight:"normal"}}),Ln=An(Nn)({display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"12px 0px"}),In=An("div")({color:Ct()}),wn=An("h3")({color:Ct(),fontSize:"16px",fontWeight:"700",margin:0,paddingBottom:"6px"}),zn=An("h4")({color:Ct(),fontSize:"16px",fontWeight:"normal",margin:0,paddingBottom:"6px"}),Pn=An("h2")(({theme:e})=>({display:"flex",alignItems:"center",cursor:"pointer",userSelect:"none",fontSize:e.typography.fontSize,fontWeight:"500",color:xt("tertiary",bt.TERTIARY),margin:0})),jn=An("span")({display:"inline-flex",transition:"transform 0.2s",marginLeft:2,alignSelf:"center"}),qn=An("h2")({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",border:0,whiteSpace:"nowrap"}),Un=Bn.shape({excludeZero:Bn.bool,points:Bn.arrayOf(Bn.string),sampleAnswers:Bn.arrayOf(Bn.string),animationsDisabled:Bn.bool});class Yn extends Tn.Component{__init(){this.dudUrl="javascript:;"}constructor(e){super(e),Yn.prototype.__init.call(this),Yn.prototype.__init2.call(this),this.state={rubricOpen:!1,linkPrefix:"Show"},this.toggleRubric=this.toggleRubric.bind(this)}static __initStatic(){this.propTypes={model:Bn.object.isRequired,animationsDisabled:Bn.bool,value:Un}}toggleRubric(){this.setState({rubricOpen:!this.state.rubricOpen}),this.setState({linkPrefix:this.state.rubricOpen?"Show":"Hide"})}__init2(){this.shouldRenderPoint=(e,t)=>!t.excludeZero||0!==e}render(){const{model:e,value:t}=this.props;let{animationsDisabled:n}=this.props;if(n=n||t.animationsDisabled,t&&t.points){const{extraCSSRules:r}=e||{},{points:i,sampleAnswers:o}=t,s=Tn.createElement(Dn,{component:"nav"},i.slice(0).reverse().map((e,n)=>{n=i.length-n-1;const r=t.excludeZero?n+1:n;return Tn.createElement(Tn.Fragment,{key:n},Tn.createElement(Ln,{key:`P${n}`},Tn.createElement(wn,null,1===r?`${r} PT`:`${r} PTS`),Tn.createElement(In,{dangerouslySetInnerHTML:{__html:e}})),o&&o[n]&&Tn.createElement(Ln,{key:`S${n}`},Tn.createElement(zn,null,"Sample Answer"),Tn.createElement(In,{dangerouslySetInnerHTML:{__html:o[n]}})))}));return Tn.createElement(Fn,{extraCSSRules:r},Tn.createElement(qn,null,"Rubric"),n?s:Tn.createElement(Tn.Fragment,null,Tn.createElement(Pn,{id:"rubric-toggle",tabIndex:0,role:"button","aria-expanded":this.state.rubricOpen,onClick:this.toggleRubric,onKeyPress:e=>{"Enter"!==e.key&&" "!==e.key||this.toggleRubric()}},this.state.linkPrefix," Rubric",Tn.createElement(jn,{"aria-hidden":"true"},this.state.rubricOpen?Tn.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},Tn.createElement("polyline",{points:"18 15 12 9 6 15"})):Tn.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},Tn.createElement("polyline",{points:"6 9 12 15 18 9"})))),Tn.createElement(Mn,{in:this.state.rubricOpen,timeout:{enter:225,exit:195}},s)))}return null}}Yn.__initStatic();const Hn=t,{createRoot:$n}=a,Wn=s,{renderMath:Gn}=c,Kn=Wn("pie-element:rubric:print");class Jn extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=B(()=>{if(this._model&&this._session){const t=(e=this._model,"instructor"===this._options.role?(e.value={...e},e.mode="evaluate",e.animationsDisabled=!0,e):{}),n=this._options&&Hn.createElement(Yn,{...t});this._root||(this._root=$n(this)),this._root.render(n),queueMicrotask(()=>{Kn("render complete - render math"),Gn(this)})}else Kn("skip");var e},50,{leading:!1,trailing:!0})}set options(e){this._options=e}set model(e){this._model=e,this._rerender()}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Jn as default};
|