@pie-element/math-inline 11.1.0-next.0 → 11.1.2-next.1
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 +1182 -2779
- package/configure/CHANGELOG.md +972 -2401
- package/configure/lib/response.js +1 -1
- package/configure/lib/response.js.map +1 -1
- package/configure/package.json +7 -7
- package/controller/CHANGELOG.md +705 -1772
- package/controller/package.json +3 -3
- package/package.json +9 -12
- package/module/configure.js +0 -1
- package/module/controller.js +0 -3709
- package/module/demo.js +0 -66
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -18
- package/module/print-demo.js +0 -104
- package/module/print.html +0 -18
- package/module/print.js +0 -1
package/module/demo.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import Configure from './configure.js';
|
|
2
|
-
import Element from './element.js';
|
|
3
|
-
import * as controller from './controller.js';
|
|
4
|
-
|
|
5
|
-
var generate = {};
|
|
6
|
-
|
|
7
|
-
/* const initialModel = {
|
|
8
|
-
customKeys: [],
|
|
9
|
-
equationEditor: 'geometry',
|
|
10
|
-
responseType: 'Advanced Multi',
|
|
11
|
-
expression: '{{response}}',
|
|
12
|
-
responses: [
|
|
13
|
-
{
|
|
14
|
-
answer: 'r=\\sqrt{\\frac{V}{7\\pi}}',
|
|
15
|
-
id: '1',
|
|
16
|
-
alternates: {},
|
|
17
|
-
validation: 'literal',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
note: 'The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct.',
|
|
21
|
-
rationale:
|
|
22
|
-
'<p>The correct answer is:</p><ul><li><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><msqrt><mfrac><mi>V</mi><mrow><mn>7</mn><mi>π</mi></mrow></mfrac></msqrt></math></li></ul>',
|
|
23
|
-
}; */
|
|
24
|
-
|
|
25
|
-
const E262456 = {
|
|
26
|
-
equationEditor: 3,
|
|
27
|
-
toolbarEditorPosition: 'bottom',
|
|
28
|
-
prompt:
|
|
29
|
-
'<p><strong>B.</strong> Find the value of the expression that you wrote in part A to find how much money the band members made.</p>\n\n<p>Use the on-screen keyboard to type your answer in the box below.</p>\n',
|
|
30
|
-
expression: '${{response}}',
|
|
31
|
-
responses: [
|
|
32
|
-
{
|
|
33
|
-
allowSpaces: true,
|
|
34
|
-
// 'validation': 'symbolic',
|
|
35
|
-
answer: '$410',
|
|
36
|
-
id: '1',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
responseType: 'Advanced Multi',
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
generate.model = (id, element) => ({
|
|
43
|
-
id,
|
|
44
|
-
element,
|
|
45
|
-
...E262456,
|
|
46
|
-
rubricEnabled: false,
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const { model } = generate;
|
|
50
|
-
|
|
51
|
-
var config = {
|
|
52
|
-
elements: {
|
|
53
|
-
'math-inline': '../..',
|
|
54
|
-
},
|
|
55
|
-
models: [model('1', 'math-inline')],
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
//Note: demo-el is a custom element loaded in the markup.
|
|
59
|
-
customElements.whenDefined("demo-el").then(() => {
|
|
60
|
-
config.models.forEach((m) => {
|
|
61
|
-
const de = document.createElement("demo-el");
|
|
62
|
-
document.body.appendChild(de);
|
|
63
|
-
de.def = { tagName: m.element, Element, Configure, controller };
|
|
64
|
-
de.model = m;
|
|
65
|
-
});
|
|
66
|
-
});
|
package/module/element.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_dll_react_dom as e,_dll_react as t,_dll_mui__material_styles as o,_dll_prop_types as s,_dll_pie_lib__render_ui as n,_dll_pie_lib__correct_answer_toggle as i,_dll_mui__material as r,_dll_debug as a}from"../../../@pie-lib/shared-module@^4.0.1/module/index.js";import{_dll_pie_lib__math_toolbar as l,_dll_pie_lib__math_input as c,_dll_pie_framework__mathquill as p}from"../../../@pie-lib/math-edit-module@^3.1.2/module/index.js";import{_dll_pie_lib__math_rendering as u}from"../../../@pie-lib/math-rendering-module@^4.0.7/module/index.js";var h,d=e;h=d.createRoot,d.hydrateRoot;var g="object"==typeof global&&global&&global.Object===Object&&global,f="object"==typeof self&&self&&self.Object===Object&&self,m=g||f||Function("return this")(),y=m.Symbol,b=Object.prototype,v=b.hasOwnProperty,x=b.toString,w=y?y.toStringTag:void 0;var S=Object.prototype.toString;var _=y?y.toStringTag:void 0;function k(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_&&_ in Object(e)?function(e){var t=v.call(e,w),o=e[w];try{e[w]=void 0;var s=!0}catch(e){}var n=x.call(e);return s&&(t?e[w]=o:delete e[w]),n}(e):function(e){return S.call(e)}(e)}function C(e){return null!=e&&"object"==typeof e}var A=Array.isArray,O=/\s/;var L=/^\s+/;function j(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(L,""):e}function E(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var R=/^[-+]0x[0-9a-f]+$/i,$=/^0b[01]+$/i,P=/^0o[0-7]+$/i,N=parseInt;function T(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||C(e)&&"[object Symbol]"==k(e)}(e))return NaN;if(E(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=E(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=j(e);var o=$.test(e);return o||P.test(e)?N(e.slice(2),o?2:8):R.test(e)?NaN:+e}function F(e){if(!E(e))return!1;var t=k(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var I,D=m["__core-js_shared__"],M=(I=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"";var q=Function.prototype.toString;function B(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var z=/^\[object .+?Constructor\]$/,V=Function.prototype,U=Object.prototype,K=V.toString,H=U.hasOwnProperty,W=RegExp("^"+K.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function J(e){return!(!E(e)||(t=e,M&&M in t))&&(F(e)?W:z).test(B(e));var t}function Y(e,t){var o=function(e,t){return null==e?void 0:e[t]}(e,t);return J(o)?o:void 0}var Q=Y(m,"WeakMap"),G=/^(?:0|[1-9]\d*)$/;function X(e,t){var o=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==o||"symbol"!=o&&G.test(e))&&e>-1&&e%1==0&&e<t}function Z(e,t){return e===t||e!=e&&t!=t}function ee(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function te(e){return null!=e&&ee(e.length)&&!F(e)}var oe=Object.prototype;function se(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||oe)}function ne(e){return C(e)&&"[object Arguments]"==k(e)}var ie=Object.prototype,re=ie.hasOwnProperty,ae=ie.propertyIsEnumerable,le=ne(function(){return arguments}())?ne:function(e){return C(e)&&re.call(e,"callee")&&!ae.call(e,"callee")};var ce="object"==typeof exports&&exports&&!exports.nodeType&&exports,pe=ce&&"object"==typeof module&&module&&!module.nodeType&&module,ue=pe&&pe.exports===ce?m.Buffer:void 0,he=(ue?ue.isBuffer:void 0)||function(){return!1},de={};de["[object Float32Array]"]=de["[object Float64Array]"]=de["[object Int8Array]"]=de["[object Int16Array]"]=de["[object Int32Array]"]=de["[object Uint8Array]"]=de["[object Uint8ClampedArray]"]=de["[object Uint16Array]"]=de["[object Uint32Array]"]=!0,de["[object Arguments]"]=de["[object Array]"]=de["[object ArrayBuffer]"]=de["[object Boolean]"]=de["[object DataView]"]=de["[object Date]"]=de["[object Error]"]=de["[object Function]"]=de["[object Map]"]=de["[object Number]"]=de["[object Object]"]=de["[object RegExp]"]=de["[object Set]"]=de["[object String]"]=de["[object WeakMap]"]=!1;var ge,fe="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=fe&&"object"==typeof module&&module&&!module.nodeType&&module,ye=me&&me.exports===fe&&g.process,be=function(){try{var e=me&&me.require&&me.require("util").types;return e||ye&&ye.binding&&ye.binding("util")}catch(e){}}(),ve=be&&be.isTypedArray,xe=ve?(ge=ve,function(e){return ge(e)}):function(e){return C(e)&&ee(e.length)&&!!de[k(e)]},we=Object.prototype.hasOwnProperty;function Se(e,t){var o=A(e),s=!o&&le(e),n=!o&&!s&&he(e),i=!o&&!s&&!n&&xe(e),r=o||s||n||i,a=r?function(e,t){for(var o=-1,s=Array(e);++o<e;)s[o]=t(o);return s}(e.length,String):[],l=a.length;for(var c in e)!t&&!we.call(e,c)||r&&("length"==c||n&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||X(c,l))||a.push(c);return a}var _e=function(e,t){return function(o){return e(t(o))}}(Object.keys,Object),ke=_e,Ce=Object.prototype.hasOwnProperty;function Ae(e){if(!se(e))return ke(e);var t=[];for(var o in Object(e))Ce.call(e,o)&&"constructor"!=o&&t.push(o);return t}function Oe(e){return te(e)?Se(e):Ae(e)}var Le=Y(Object,"create");var je=Object.prototype.hasOwnProperty;var Ee=Object.prototype.hasOwnProperty;function Re(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var s=e[t];this.set(s[0],s[1])}}function $e(e,t){for(var o=e.length;o--;)if(Z(e[o][0],t))return o;return-1}Re.prototype.clear=function(){this.__data__=Le?Le(null):{},this.size=0},Re.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Re.prototype.get=function(e){var t=this.__data__;if(Le){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return je.call(t,e)?t[e]:void 0},Re.prototype.has=function(e){var t=this.__data__;return Le?void 0!==t[e]:Ee.call(t,e)},Re.prototype.set=function(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Le&&void 0===t?"__lodash_hash_undefined__":t,this};var Pe=Array.prototype.splice;function Ne(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var s=e[t];this.set(s[0],s[1])}}Ne.prototype.clear=function(){this.__data__=[],this.size=0},Ne.prototype.delete=function(e){var t=this.__data__,o=$e(t,e);return!(o<0)&&(o==t.length-1?t.pop():Pe.call(t,o,1),--this.size,!0)},Ne.prototype.get=function(e){var t=this.__data__,o=$e(t,e);return o<0?void 0:t[o][1]},Ne.prototype.has=function(e){return $e(this.__data__,e)>-1},Ne.prototype.set=function(e,t){var o=this.__data__,s=$e(o,e);return s<0?(++this.size,o.push([e,t])):o[s][1]=t,this};var Te=Y(m,"Map");function Fe(e,t){var o,s,n=e.__data__;return("string"==(s=typeof(o=t))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==o:null===o)?n["string"==typeof t?"string":"hash"]:n.map}function Ie(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var s=e[t];this.set(s[0],s[1])}}Ie.prototype.clear=function(){this.size=0,this.__data__={hash:new Re,map:new(Te||Ne),string:new Re}},Ie.prototype.delete=function(e){var t=Fe(this,e).delete(e);return this.size-=t?1:0,t},Ie.prototype.get=function(e){return Fe(this,e).get(e)},Ie.prototype.has=function(e){return Fe(this,e).has(e)},Ie.prototype.set=function(e,t){var o=Fe(this,e),s=o.size;return o.set(e,t),this.size+=o.size==s?0:1,this};function De(e){var t=this.__data__=new Ne(e);this.size=t.size}De.prototype.clear=function(){this.__data__=new Ne,this.size=0},De.prototype.delete=function(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o},De.prototype.get=function(e){return this.__data__.get(e)},De.prototype.has=function(e){return this.__data__.has(e)},De.prototype.set=function(e,t){var o=this.__data__;if(o instanceof Ne){var s=o.__data__;if(!Te||s.length<199)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new Ie(s)}return o.set(e,t),this.size=o.size,this};var Me=Object.prototype.propertyIsEnumerable,qe=Object.getOwnPropertySymbols,Be=qe?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var o=-1,s=null==e?0:e.length,n=0,i=[];++o<s;){var r=e[o];t(r,o,e)&&(i[n++]=r)}return i}(qe(e),function(t){return Me.call(e,t)}))}:function(){return[]};function ze(e){return function(e,t,o){var s=t(e);return A(e)?s:function(e,t){for(var o=-1,s=t.length,n=e.length;++o<s;)e[n+o]=t[o];return e}(s,o(e))}(e,Oe,Be)}var Ve=Y(m,"DataView"),Ue=Y(m,"Promise"),Ke=Y(m,"Set"),He="[object Map]",We="[object Promise]",Je="[object Set]",Ye="[object WeakMap]",Qe="[object DataView]",Ge=B(Ve),Xe=B(Te),Ze=B(Ue),et=B(Ke),tt=B(Q),ot=k;(Ve&&ot(new Ve(new ArrayBuffer(1)))!=Qe||Te&&ot(new Te)!=He||Ue&&ot(Ue.resolve())!=We||Ke&&ot(new Ke)!=Je||Q&&ot(new Q)!=Ye)&&(ot=function(e){var t=k(e),o="[object Object]"==t?e.constructor:void 0,s=o?B(o):"";if(s)switch(s){case Ge:return Qe;case Xe:return He;case Ze:return We;case et:return Je;case tt:return Ye}return t});var st=ot,nt=m.Uint8Array;function it(e){var t=-1,o=null==e?0:e.length;for(this.__data__=new Ie;++t<o;)this.add(e[t])}function rt(e,t){for(var o=-1,s=null==e?0:e.length;++o<s;)if(t(e[o],o,e))return!0;return!1}it.prototype.add=it.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},it.prototype.has=function(e){return this.__data__.has(e)};function at(e,t,o,s,n,i){var r=1&o,a=e.length,l=t.length;if(a!=l&&!(r&&l>a))return!1;var c=i.get(e),p=i.get(t);if(c&&p)return c==t&&p==e;var u=-1,h=!0,d=2&o?new it:void 0;for(i.set(e,t),i.set(t,e);++u<a;){var g=e[u],f=t[u];if(s)var m=r?s(f,g,u,t,e,i):s(g,f,u,e,t,i);if(void 0!==m){if(m)continue;h=!1;break}if(d){if(!rt(t,function(e,t){if(r=t,!d.has(r)&&(g===e||n(g,e,o,s,i)))return d.push(t);var r})){h=!1;break}}else if(g!==f&&!n(g,f,o,s,i)){h=!1;break}}return i.delete(e),i.delete(t),h}function lt(e){var t=-1,o=Array(e.size);return e.forEach(function(e,s){o[++t]=[s,e]}),o}function ct(e){var t=-1,o=Array(e.size);return e.forEach(function(e){o[++t]=e}),o}var pt=y?y.prototype:void 0,ut=pt?pt.valueOf:void 0;var ht=Object.prototype.hasOwnProperty;var dt="[object Arguments]",gt="[object Array]",ft="[object Object]",mt=Object.prototype.hasOwnProperty;function yt(e,t,o,s,n,i){var r=A(e),a=A(t),l=r?gt:st(e),c=a?gt:st(t),p=(l=l==dt?ft:l)==ft,u=(c=c==dt?ft:c)==ft,h=l==c;if(h&&he(e)){if(!he(t))return!1;r=!0,p=!1}if(h&&!p)return i||(i=new De),r||xe(e)?at(e,t,o,s,n,i):function(e,t,o,s,n,i,r){switch(o){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new nt(e),new nt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Z(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=lt;case"[object Set]":var l=1&s;if(a||(a=ct),e.size!=t.size&&!l)return!1;var c=r.get(e);if(c)return c==t;s|=2,r.set(e,t);var p=at(a(e),a(t),s,n,i,r);return r.delete(e),p;case"[object Symbol]":if(ut)return ut.call(e)==ut.call(t)}return!1}(e,t,l,o,s,n,i);if(!(1&o)){var d=p&&mt.call(e,"__wrapped__"),g=u&&mt.call(t,"__wrapped__");if(d||g){var f=d?e.value():e,m=g?t.value():t;return i||(i=new De),n(f,m,o,s,i)}}return!!h&&(i||(i=new De),function(e,t,o,s,n,i){var r=1&o,a=ze(e),l=a.length;if(l!=ze(t).length&&!r)return!1;for(var c=l;c--;){var p=a[c];if(!(r?p in t:ht.call(t,p)))return!1}var u=i.get(e),h=i.get(t);if(u&&h)return u==t&&h==e;var d=!0;i.set(e,t),i.set(t,e);for(var g=r;++c<l;){var f=e[p=a[c]],m=t[p];if(s)var y=r?s(m,f,p,t,e,i):s(f,m,p,e,t,i);if(!(void 0===y?f===m||n(f,m,o,s,i):y)){d=!1;break}g||(g="constructor"==p)}if(d&&!g){var b=e.constructor,v=t.constructor;b==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v||(d=!1)}return i.delete(e),i.delete(t),d}(e,t,o,s,n,i))}function bt(e,t,o,s,n){return e===t||(null==e||null==t||!C(e)&&!C(t)?e!=e&&t!=t:yt(e,t,o,s,bt,n))}var vt=function(){return m.Date.now()},xt=Math.max,wt=Math.min;function St(e,t,o){var s,n,i,r,a,l,c=0,p=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){var o=s,i=n;return s=n=void 0,c=t,r=e.apply(i,o)}function g(e){var o=e-l;return void 0===l||o>=t||o<0||u&&e-c>=i}function f(){var e=vt();if(g(e))return m(e);a=setTimeout(f,function(e){var o=t-(e-l);return u?wt(o,i-(e-c)):o}(e))}function m(e){return a=void 0,h&&s?d(e):(s=n=void 0,r)}function y(){var e=vt(),o=g(e);if(s=arguments,n=this,l=e,o){if(void 0===a)return function(e){return c=e,a=setTimeout(f,t),p?d(e):r}(l);if(u)return clearTimeout(a),a=setTimeout(f,t),d(l)}return void 0===a&&(a=setTimeout(f,t)),r}return t=T(t)||0,E(o)&&(p=!!o.leading,i=(u="maxWait"in o)?xt(T(o.maxWait)||0,t):i,h="trailing"in o?!!o.trailing:h),y.cancel=function(){void 0!==a&&clearTimeout(a),c=0,s=l=n=a=void 0},y.flush=function(){return void 0===a?r:m(vt())},y}var _t=Object.prototype.hasOwnProperty;function kt(e,t){return bt(e,t)}var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});class At extends CustomEvent{constructor(e,t,o){super(At.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:o}}),this.component=e,this.complete=t}}At.TYPE="model-set";var Ot=Ct.ModelSetEvent=At;class Lt extends CustomEvent{constructor(e,t){super(Lt.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}Lt.TYPE="session-changed";var jt=Ct.SessionChangedEvent=Lt,Et={},Rt={};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.getPluginProps=Rt.generateValidationMessage=Rt.ResponseTypes=void 0,Rt.ResponseTypes={advanced:"Advanced Multi",simple:"Simple"};Rt.generateValidationMessage=(e={},t={})=>{const{maxResponseAreas:o}=t,{responseType:s}=e;let n="";return"Advanced Multi"===s&&(n="\nThere should be at least 1 "+(o?`and at most ${o} `:"")+"response area"+(o?"s":"")+" defined."),"Validation requirements:\nAll correct answers (the primary and any alternates) should not be empty and should be unique."+n};Rt.getPluginProps=(e={},t={})=>({...t,...e}),Object.defineProperty(Et,"__esModule",{value:!0});var $t=Et.default=void 0,Pt=Rt;$t=Et.default={model:{allowTrailingZerosDefault:!1,customKeys:[],equationEditor:"8",expression:"",feedback:{correct:{default:"Correct",type:"none"},incorrect:{default:"Incorrect",type:"none"},partial:{default:"Nearly",type:"none"}},feedbackEnabled:!1,ignoreOrderDefault:!1,partialScoring:!0,prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,responseType:Pt.ResponseTypes.advanced,responses:[],scoringType:"auto",studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,toolbarEditorPosition:"bottom",validationDefault:"literal"},configuration:{baseInputConfiguration:{h3:{disabled:!0},audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},prompt:{settings:!0,label:"Prompt",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},feedback:{settings:!0,label:"Feedback"},responseType:{settings:!0,label:"Response type"},rationale:{settings:!0,label:"Rationale",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},settingsPanelDisabled:!1,spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},scoringType:{settings:!1,label:"Scoring Type"},studentInstructions:{settings:!1,label:"Student Instructions"},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},partialScoring:{settings:!1,label:"Allow Partial Scoring"},ignoreOrder:{settings:!1,label:"Ignore Order",enabled:!0},allowTrailingZeros:{settings:!1,label:"Allow Trailing Zeros",enabled:!0},maxImageWidth:{teacherInstructions:300,prompt:300,rationale:300},maxImageHeight:{teacherInstructions:300,prompt:300,rationale:300},withRubric:{settings:!1,label:"Add Rubric"},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]}}};const Nt="Advanced Multi",Tt="Simple",Ft=t,{styled:It}=o,Dt=s,{color:Mt}=n,{MathToolbar:qt}=l,{mq:Bt}=c,zt=It("div")(({theme:e})=>({marginTop:e.spacing(2),marginBottom:e.spacing(2),padding:e.spacing(1)})),Vt=It("div",{shouldForwardProp:e=>!["isCorrect","isIncorrect"].includes(e)})(({theme:e,isCorrect:t,isIncorrect:o})=>({color:Mt.text(),background:Mt.background(),border:t?`2px solid ${Mt.correct()} !important`:o?`2px solid ${Mt.incorrect()} !important`:`1px solid ${Mt.primaryLight()}`,width:"fit-content",fontSize:"1rem",padding:t||o?e.spacing(1):e.spacing(.5),letterSpacing:t||o?"0.5px":"normal","& > .mq-math-mode":{"& > .mq-hasCursor":{"& > .mq-cursor":{display:"none"}}}}));if("undefined"!=typeof document){const e="math-inline-simple-question-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=`\n .response-editor {\n display: flex;\n justify-content: center;\n width: auto;\n max-width: fit-content;\n height: auto;\n text-align: left;\n padding: 8px;\n }\n .response-editor.mq-math-mode {\n border: 1px solid ${Mt.primaryLight()};\n }\n `,document.head.appendChild(t)}}class Ut extends Ft.Component{static __initStatic(){this.propTypes={onSimpleResponseChange:Dt.func,model:Dt.object.isRequired,emptyResponse:Dt.bool,session:Dt.object.isRequired,showCorrect:Dt.bool,onSubFieldFocus:Dt.func.isRequired,showKeypad:Dt.bool.isRequired}}constructor(e){super(e),Ut.prototype.__init.call(this),Ut.prototype.__init2.call(this),Ut.prototype.__init3.call(this),this.mathToolBarId=`math-toolbar-${(new Date).getTime()}`}__init(){this.mathToolBarContainsTarget=e=>document.getElementById(this.mathToolBarId).contains(e.target)}__init2(){this.handleClick=e=>{try{this.mathToolBarContainsTarget(e)||this.setState({showKeypad:!1})}catch(e){}}}__init3(){this.onFocus=()=>{const{onSubFieldFocus:e}=this.props;e(this.mathToolBarId)}}render(){const{model:e,showCorrect:t,session:o,emptyResponse:s,onSimpleResponseChange:n,showKeypad:i}=this.props,{config:r,disabled:a,correctness:l}=e||{};if(!r)return;const c=l&&l.correct,{responses:p,equationEditor:u}=r;return Ft.createElement(zt,{"data-keypad":!0},t||a?Ft.createElement(Vt,{isIncorrect:!s&&!c&&!t,isCorrect:!s&&(c||t)},Ft.createElement(Bt.Static,{latex:t?p&&p.length&&p[0].answer:o.response||""})):Ft.createElement("div",{id:this.mathToolBarId},Ft.createElement(qt,{classNames:{editor:"response-editor"},latex:o.response,keypadMode:u,onChange:n,onDone:()=>{},onFocus:this.onFocus,controlledKeypad:!0,showKeypad:i,hideDoneButton:!0})))}}function Kt(e,t){return null!=e?e:t()}function Ht(e){let t,o=e[0],s=1;for(;s<e.length;){const n=e[s],i=e[s+1];if(s+=2,("optionalAccess"===n||"optionalCall"===n)&&null==o)return;"access"===n||"optionalAccess"===n?(t=o,o=i(o)):"call"!==n&&"optionalCall"!==n||(o=i((...e)=>o.call(t,...e)),t=void 0)}return o}Ut.__initStatic();const Wt=e=>"string"==typeof e,Jt=()=>{let e,t;const o=new Promise((o,s)=>{e=o,t=s});return o.resolve=e,o.reject=t,o},Yt=e=>null==e?"":""+e,Qt=/###/g,Gt=e=>e&&e.indexOf("###")>-1?e.replace(Qt,"."):e,Xt=e=>!e||Wt(e),Zt=(e,t,o)=>{const s=Wt(t)?t.split("."):t;let n=0;for(;n<s.length-1;){if(Xt(e))return{};const t=Gt(s[n]);!e[t]&&o&&(e[t]=new o),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++n}return Xt(e)?{}:{obj:e,k:Gt(s[n])}},eo=(e,t,o)=>{const{obj:s,k:n}=Zt(e,t,Object);if(void 0!==s||1===t.length)return void(s[n]=o);let i=t[t.length-1],r=t.slice(0,t.length-1),a=Zt(e,r,Object);for(;void 0===a.obj&&r.length;)i=`${r[r.length-1]}.${i}`,r=r.slice(0,r.length-1),a=Zt(e,r,Object),Ht([a,"optionalAccess",e=>e.obj])&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=o},to=(e,t)=>{const{obj:o,k:s}=Zt(e,t);if(o&&Object.prototype.hasOwnProperty.call(o,s))return o[s]},oo=(e,t,o)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?Wt(e[s])||e[s]instanceof String||Wt(t[s])||t[s]instanceof String?o&&(e[s]=t[s]):oo(e[s],t[s],o):e[s]=t[s]);return e},so=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var no={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const io=e=>Wt(e)?e.replace(/[&<>"'\/]/g,e=>no[e]):e;const ro=[" ",",","?","!",";"],ao=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const o=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,o),this.regExpQueue.push(e),o}}(20),lo=(e,t,o=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const s=t.split(o);let n=e;for(let e=0;e<s.length;){if(!n||"object"!=typeof n)return;let t,i="";for(let r=e;r<s.length;++r)if(r!==e&&(i+=o),i+=s[r],t=n[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&r<s.length-1)continue;e+=r-e+1;break}n=t}return n},co=e=>Ht([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),po={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){Ht([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class uo{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||po,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,o,s){return s&&!this.debug?null:(Wt(e[0])&&(e[0]=`${o}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new uo(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new uo(this.logger,e)}}var ho=new uo;class go{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const o=this.observers[e].get(t)||0;this.observers[e].set(t,o+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,o])=>{for(let s=0;s<o;s++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([o,s])=>{for(let n=0;n<s;n++)o.apply(o,[e,...t])})}}}class fo extends go{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,o,s={}){const n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,i=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let r;e.indexOf(".")>-1?r=e.split("."):(r=[e,t],o&&(Array.isArray(o)?r.push(...o):Wt(o)&&n?r.push(...o.split(n)):r.push(o)));const a=to(this.data,r);return!a&&!t&&!o&&e.indexOf(".")>-1&&(e=r[0],t=r[1],o=r.slice(2).join(".")),!a&&i&&Wt(o)?lo(Ht([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),o,n):a}addResource(e,t,o,s,n={silent:!1}){const i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let r=[e,t];o&&(r=r.concat(i?o.split(i):o)),e.indexOf(".")>-1&&(r=e.split("."),s=t,t=r[1]),this.addNamespaces(t),eo(this.data,r,s),n.silent||this.emit("added",e,t,o,s)}addResources(e,t,o,s={silent:!1}){for(const s in o)(Wt(o[s])||Array.isArray(o[s]))&&this.addResource(e,t,s,o[s],{silent:!0});s.silent||this.emit("added",e,t,o)}addResourceBundle(e,t,o,s,n,i={silent:!1,skipCopy:!1}){let r=[e,t];e.indexOf(".")>-1&&(r=e.split("."),s=o,o=t,t=r[1]),this.addNamespaces(t);let a=to(this.data,r)||{};i.skipCopy||(o=JSON.parse(JSON.stringify(o))),s?oo(a,o,n):a={...a,...o},eo(this.data,r,a),i.silent||this.emit("added",e,t,o)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var mo={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,o,s,n){return e.forEach(e=>{t=Kt(Ht([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,o,s,n)]),()=>t)}),t}};const yo=Symbol("i18next/PATH_KEY");function bo(e,t){const{[yo]:o}=e(function(){const e=[],t=Object.create(null);let o;return t.get=(s,n)=>(Ht([o,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),n===yo?e:(e.push(n),o=Proxy.revocable(s,t),o.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return o.join(Kt(Ht([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const vo={},xo=e=>!Wt(e)&&"boolean"!=typeof e&&"number"!=typeof e;class wo extends go{constructor(e,t={}){var o,s;super(),o=e,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{o[e]&&(s[e]=o[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=ho.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const o={...t};if(null==e)return!1;const s=this.resolve(e,o);if(void 0===Ht([s,"optionalAccess",e=>e.res]))return!1;const n=xo(s.res);return!1!==o.returnObjects||!n}extractFromKey(e,t){let o=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===o&&(o=":");const s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let n=t.ns||this.options.defaultNS||[];const i=o&&e.indexOf(o)>-1,r=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,o)=>{t=t||"",o=o||"";const s=ro.filter(e=>t.indexOf(e)<0&&o.indexOf(e)<0);if(0===s.length)return!0;const n=ao.getRegExp(`(${s.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!n.test(e);if(!i){const t=e.indexOf(o);t>0&&!n.test(e.substring(0,t))&&(i=!0)}return i})(e,o,s));if(i&&!r){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Wt(n)?[n]:n};const i=e.split(o);(o!==s||o===s&&this.options.ns.indexOf(i[0])>-1)&&(n=i.shift()),e=i.join(s)}return{key:e,namespaces:Wt(n)?[n]:n}}translate(e,t,o){let s="object"==typeof t?{...t}:t;if("object"!=typeof s&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof s&&(s={...s}),s||(s={}),null==e)return"";"function"==typeof e&&(e=bo(e,{...this.options,...s})),Array.isArray(e)||(e=[String(e)]);const n=void 0!==s.returnDetails?s.returnDetails:this.options.returnDetails,i=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,{key:r,namespaces:a}=this.extractFromKey(e[e.length-1],s),l=a[a.length-1];let c=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const p=s.lng||this.language,u=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===Ht([p,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return u?n?{res:`${l}${c}${r}`,usedKey:r,exactUsedKey:r,usedLng:p,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${c}${r}`:n?{res:r,usedKey:r,exactUsedKey:r,usedLng:p,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:r;const h=this.resolve(e,s);let d=Ht([h,"optionalAccess",e=>e.res]);const g=Ht([h,"optionalAccess",e=>e.usedKey])||r,f=Ht([h,"optionalAccess",e=>e.exactUsedKey])||r,m=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==s.count&&!Wt(s.count),v=wo.hasDefaultValue(s),x=b?this.pluralResolver.getSuffix(p,s.count,s):"",w=s.ordinal&&b?this.pluralResolver.getSuffix(p,s.count,{ordinal:!1}):"",S=b&&!s.ordinal&&0===s.count,_=S&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${x}`]||s[`defaultValue${w}`]||s.defaultValue;let k=d;y&&!d&&v&&(k=_);const C=xo(k),A=Object.prototype.toString.apply(k);if(!(y&&k&&C&&["[object Number]","[object Function]","[object RegExp]"].indexOf(A)<0)||Wt(m)&&Array.isArray(k))if(y&&Wt(m)&&Array.isArray(d))d=d.join(m),d&&(d=this.extendTranslation(d,e,s,o));else{let t=!1,n=!1;!this.isValidLookup(d)&&v&&(t=!0,d=_),this.isValidLookup(d)||(n=!0,d=r);const a=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:d,u=v&&_!==d&&this.options.updateMissing;if(n||t||u){if(this.logger.log(u?"updateKey":"missingKey",p,l,r,u?_:d),i){const e=this.resolve(r,{...s,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let o=0;o<t.length;o++)e.push(t[o]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(s.lng||this.language):e.push(s.lng||this.language);const o=(e,t,o)=>{const n=v&&o!==d?o:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,n,u,s):Ht([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,l,t,n,u,s),this.emit("missingKey",e,l,t,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,s);S&&s[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{o([e],r+t,s[`defaultValue${t}`]||_)})}):o(e,r,_))}d=this.extendTranslation(d,e,s,h,o),n&&d===r&&this.options.appendNamespaceToMissingKey&&(d=`${l}${c}${r}`),(n||t)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${r}`:r,t?d:void 0,s))}else{if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,k,{...s,ns:a}):`key '${r} (${this.language})' returned an object instead of string.`;return n?(h.res=e,h.usedParams=this.getUsedParamsDetails(s),h):e}if(i){const e=Array.isArray(k),t=e?[]:{},o=e?f:g;for(const e in k)if(Object.prototype.hasOwnProperty.call(k,e)){const n=`${o}${i}${e}`;t[e]=v&&!d?this.translate(n,{...s,defaultValue:xo(_)?_[e]:void 0,joinArrays:!1,ns:a}):this.translate(n,{...s,joinArrays:!1,ns:a}),t[e]===n&&(t[e]=k[e])}d=t}}return n?(h.res=d,h.usedParams=this.getUsedParamsDetails(s),h):d}extendTranslation(e,t,o,s,n){if(Ht([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const i=Wt(e)&&(void 0!==Ht([o,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(i){const t=e.match(this.interpolator.nestingRegexp);r=t&&t.length}let a=o.replace&&!Wt(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,o.lng||this.language||s.usedLng,o),i){const t=e.match(this.interpolator.nestingRegexp);r<(t&&t.length)&&(o.nest=!1)}!o.lng&&s&&s.res&&(o.lng=this.language||s.usedLng),!1!==o.nest&&(e=this.interpolator.nest(e,(...e)=>Ht([n,"optionalAccess",e=>e[0]])!==e[0]||o.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),o)),o.interpolation&&this.interpolator.reset()}const i=o.postProcess||this.options.postProcess,r=Wt(i)?[i]:i;return null!=e&&Ht([r,"optionalAccess",e=>e.length])&&!1!==o.applyPostProcessor&&(e=mo.handle(r,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),e}resolve(e,t={}){let o,s,n,i,r;return Wt(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(o))return;const a=this.extractFromKey(e,t),l=a.key;s=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const p=void 0!==t.count&&!Wt(t.count),u=p&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(Wt(t.context)||"number"==typeof t.context)&&""!==t.context,d=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(o)||(r=e,vo[`${d[0]}-${e}`]||!Ht([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Ht([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(r)])||(vo[`${d[0]}-${e}`]=!0,this.logger.warn(`key "${s}" for languages "${d.join(", ")}" won't get resolved as namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach(s=>{if(this.isValidLookup(o))return;i=s;const r=[l];if(Ht([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(r,l,s,e,t);else{let e;p&&(e=this.pluralResolver.getSuffix(s,t.count,t));const o=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(t.ordinal&&0===e.indexOf(n)&&r.push(l+e.replace(n,this.options.pluralSeparator)),r.push(l+e),u&&r.push(l+o)),h){const s=`${l}${this.options.contextSeparator||"_"}${t.context}`;r.push(s),p&&(t.ordinal&&0===e.indexOf(n)&&r.push(s+e.replace(n,this.options.pluralSeparator)),r.push(s+e),u&&r.push(s+o))}}let a;for(;a=r.pop();)this.isValidLookup(o)||(n=a,o=this.getResource(s,e,a,t))}))})}),{res:o,usedKey:s,exactUsedKey:n,usedLng:i,usedNS:r}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,o,s={}){return Ht([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,o,s):this.resourceStore.getResource(e,t,o,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=e.replace&&!Wt(e.replace);let s=o?e.replace:e;if(o&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!o){s={...s};for(const e of t)delete s[e]}return s}static hasDefaultValue(e){const t="defaultValue";for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t===o.substring(0,12)&&void 0!==e[o])return!0;return!1}}class So{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ho.create("languageUtils")}getScriptPartFromCode(e){if(!(e=co(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=co(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Wt(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const o=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(o)||(t=o)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const o=this.getScriptPartFromCode(e);if(this.isSupportedCode(o))return t=o;const s=this.getLanguagePartFromCode(e);if(this.isSupportedCode(s))return t=s;t=this.options.supportedLngs.find(e=>e===s?e:e.indexOf("-")<0&&s.indexOf("-")<0?void 0:e.indexOf("-")>0&&s.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===s||0===e.indexOf(s)&&s.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Wt(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let o=e[t];return o||(o=e[this.getScriptPartFromCode(t)]),o||(o=e[this.formatLanguageCode(t)]),o||(o=e[this.getLanguagePartFromCode(t)]),o||(o=e.default),o||[]}toResolveHierarchy(e,t){const o=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),s=[],n=e=>{e&&(this.isSupportedCode(e)?s.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Wt(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&n(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&n(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&n(this.getLanguagePartFromCode(e))):Wt(e)&&n(this.formatLanguageCode(e)),o.forEach(e=>{s.indexOf(e)<0&&n(this.formatLanguageCode(e))}),s}}const _o={zero:0,one:1,two:2,few:3,many:4,other:5},ko={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Co{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=ho.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const o=co("dev"===e?"en":e),s=t.ordinal?"ordinal":"cardinal",n=JSON.stringify({cleanedCode:o,type:s});if(n in this.pluralRulesCache)return this.pluralRulesCache[n];let i;try{i=new Intl.PluralRules(o,{type:s})}catch(o){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),ko;if(!e.match(/-|_/))return ko;const s=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(s,t)}return this.pluralRulesCache[n]=i,i}needsPlural(e,t={}){let o=this.getRule(e,t);return o||(o=this.getRule("dev",t)),Ht([o,"optionalAccess",e=>e.resolvedOptions,"call",e=>e(),"access",e=>e.pluralCategories,"access",e=>e.length])>1}getPluralFormsOfKey(e,t,o={}){return this.getSuffixes(e,o).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let o=this.getRule(e,t);return o||(o=this.getRule("dev",t)),o?o.resolvedOptions().pluralCategories.sort((e,t)=>_o[e]-_o[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,o={}){const s=this.getRule(e,o);return s?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,o))}}const Ao=(e,t,o,s=".",n=!0)=>{let i=((e,t,o)=>{const s=to(e,o);return void 0!==s?s:to(t,o)})(e,t,o);return!i&&n&&Wt(o)&&(i=lo(e,o,s),void 0===i&&(i=lo(t,o,s))),i},Oo=e=>e.replace(/\$/g,"$$$$");class Lo{constructor(e={}){this.logger=ho.create("interpolator"),this.options=e,this.format=Ht([e,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.format])||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:o,useRawValueToEscape:s,prefix:n,prefixEscaped:i,suffix:r,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:p,nestingPrefix:u,nestingPrefixEscaped:h,nestingSuffix:d,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:io,this.escapeValue=void 0===o||o,this.useRawValueToEscape=void 0!==s&&s,this.prefix=n?so(n):i||"{{",this.suffix=r?so(r):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=u?so(u):h||so("$t("),this.nestingSuffix=d?so(d):g||so(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>Ht([e,"optionalAccess",e=>e.source])===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,o,s){let n,i,r;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const n=Ao(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(n,void 0,o,{...s,...t,interpolationkey:e}):n}const n=e.split(this.formatSeparator),i=n.shift().trim(),r=n.join(this.formatSeparator).trim();return this.format(Ao(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),r,o,{...s,...t,interpolationkey:i})};this.resetRegExp();const c=Ht([s,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,p=void 0!==Ht([s,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Oo(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Oo(this.escape(e)):Oo(e)}].forEach(t=>{for(r=0;n=t.regex.exec(e);){const o=n[1].trim();if(i=l(o),void 0===i)if("function"==typeof c){const t=c(e,n,s);i=Wt(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,o))i="";else{if(p){i=n[0];continue}this.logger.warn(`missed to pass in variable ${o} for interpolating ${e}`),i=""}else Wt(i)||this.useRawValueToEscape||(i=Yt(i));const a=t.safeValue(i);if(e=e.replace(n[0],a),p?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=n[0].length):t.regex.lastIndex=0,r++,r>=this.maxReplaces)break}}),e}nest(e,t,o={}){let s,n,i;const r=(e,t)=>{const o=this.nestingOptionsSeparator;if(e.indexOf(o)<0)return e;const s=e.split(new RegExp(`${o}[ ]*{`));let n=`{${s[1]}`;e=s[0],n=this.interpolate(n,i);const r=n.match(/'/g),a=n.match(/"/g);(Kt(Ht([r,"optionalAccess",e=>e.length]),()=>0)%2==0&&!a||a.length%2!=0)&&(n=n.replace(/'/g,'"'));try{i=JSON.parse(n),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${o}${n}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;s=this.nestingRegexp.exec(e);){let a=[];i={...o},i=i.replace&&!Wt(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const l=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(-1!==l&&(a=s[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),s[1]=s[1].slice(0,l)),n=t(r.call(this,s[1].trim(),i),i),n&&s[0]===e&&!Wt(n))return n;Wt(n)||(n=Yt(n)),n||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),n=""),a.length&&(n=a.reduce((e,t)=>this.format(e,t,o.lng,{...o,interpolationkey:s[1].trim()}),n.trim())),e=e.replace(s[0],n),this.regexp.lastIndex=0}return e}}const jo=e=>{const t={};return(o,s,n)=>{let i=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(i={...i,[n.interpolationkey]:void 0});const r=s+JSON.stringify(i);let a=t[r];return a||(a=e(co(s),n),t[r]=a),a(o)}},Eo=e=>(t,o,s)=>e(co(o),s)(t);class Ro{constructor(e={}){this.logger=ho.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const o=t.cacheInBuiltFormats?jo:Eo;this.formats={number:o((e,t)=>{const o=new Intl.NumberFormat(e,{...t});return e=>o.format(e)}),currency:o((e,t)=>{const o=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>o.format(e)}),datetime:o((e,t)=>{const o=new Intl.DateTimeFormat(e,{...t});return e=>o.format(e)}),relativetime:o((e,t)=>{const o=new Intl.RelativeTimeFormat(e,{...t});return e=>o.format(e,t.range||"day")}),list:o((e,t)=>{const o=new Intl.ListFormat(e,{...t});return e=>o.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=jo(t)}format(e,t,o,s={}){const n=t.split(this.formatSeparator);if(n.length>1&&n[0].indexOf("(")>1&&n[0].indexOf(")")<0&&n.find(e=>e.indexOf(")")>-1)){const e=n.findIndex(e=>e.indexOf(")")>-1);n[0]=[n[0],...n.splice(1,e)].join(this.formatSeparator)}return n.reduce((e,t)=>{const{formatName:n,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const o={};if(e.indexOf("(")>-1){const s=e.split("(");t=s[0].toLowerCase().trim();const n=s[1].substring(0,s[1].length-1);"currency"===t&&n.indexOf(":")<0?o.currency||(o.currency=n.trim()):"relativetime"===t&&n.indexOf(":")<0?o.range||(o.range=n.trim()):n.split(";").forEach(e=>{if(e){const[t,...s]=e.split(":"),n=s.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();o[i]||(o[i]=n),"false"===n&&(o[i]=!1),"true"===n&&(o[i]=!0),isNaN(n)||(o[i]=parseInt(n,10))}})}return{formatName:t,formatOptions:o}})(t);if(this.formats[n]){let t=e;try{const r=Ht([s,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[s.interpolationkey]])||{},a=r.locale||r.lng||s.locale||s.lng||o;t=this.formats[n](e,a,{...i,...s,...r})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${n}`),e},e)}}class $o extends go{constructor(e,t,o,s={}){super(),this.backend=e,this.store=t,this.services=o,this.languageUtils=o.languageUtils,this.options=s,this.logger=ho.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],Ht([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(o,s.backend,s)])}queueLoad(e,t,o,s){const n={},i={},r={},a={};return e.forEach(e=>{let s=!0;t.forEach(t=>{const r=`${e}|${t}`;!o.reload&&this.store.hasResourceBundle(e,t)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===i[r]&&(i[r]=!0):(this.state[r]=1,s=!1,void 0===i[r]&&(i[r]=!0),void 0===n[r]&&(n[r]=!0),void 0===a[t]&&(a[t]=!0)))}),s||(r[e]=!0)}),(Object.keys(n).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(n),pending:Object.keys(i),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(e,t,o){const s=e.split("|"),n=s[0],i=s[1];t&&this.emit("failedLoading",n,i,t),!t&&o&&this.store.addResourceBundle(n,i,o,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&o&&(this.state[e]=0);const r={};this.queue.forEach(o=>{((e,t,o)=>{const{obj:s,k:n}=Zt(e,t,Object);s[n]=s[n]||[],s[n].push(o)})(o.loaded,[n],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(o,e),t&&o.errors.push(t),0!==o.pendingCount||o.done||(Object.keys(o.loaded).forEach(e=>{r[e]||(r[e]={});const t=o.loaded[e];t.length&&t.forEach(t=>{void 0===r[e][t]&&(r[e][t]=!0)})}),o.done=!0,o.errors.length?o.callback(o.errors):o.callback())}),this.emit("loaded",r),this.queue=this.queue.filter(e=>!e.done)}read(e,t,o,s=0,n=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:o,tried:s,wait:n,callback:i});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}r&&a&&s<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,o,s+1,2*n,i)},n):i(r,a)},a=this.backend[o].bind(this.backend);if(2!==a.length)return a(e,t,r);try{const o=a(e,t);o&&"function"==typeof o.then?o.then(e=>r(null,e)).catch(r):r(null,o)}catch(e){r(e)}}prepareLoading(e,t,o={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Wt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Wt(t)&&(t=[t]);const n=this.queueLoad(e,t,o,s);if(!n.toLoad.length)return n.pending.length||s(),null;n.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,o){this.prepareLoading(e,t,{},o)}reload(e,t,o){this.prepareLoading(e,t,{reload:!0},o)}loadOne(e,t=""){const o=e.split("|"),s=o[0],n=o[1];this.read(s,n,"read",void 0,void 0,(o,i)=>{o&&this.logger.warn(`${t}loading namespace ${n} for language ${s} failed`,o),!o&&i&&this.logger.log(`${t}loaded namespace ${n} for language ${s}`,i),this.loaded(e,o,i)})}saveMissing(e,t,o,s,n,i={},r=()=>{}){if(!Ht([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Ht([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=o&&""!==o){if(Ht([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const a={...i,isUpdate:n},l=this.backend.create.bind(this.backend);if(l.length<6)try{let n;n=5===l.length?l(e,t,o,s,a):l(e,t,o,s),n&&"function"==typeof n.then?n.then(e=>r(null,e)).catch(r):r(null,n)}catch(e){r(e)}else l(e,t,o,s,r,a)}e&&e[0]&&this.store.addResource(e[0],t,o,s)}}else this.logger.warn(`did not save key "${o}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Po=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Wt(e[1])&&(t.defaultValue=e[1]),Wt(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const o=e[3]||e[2];Object.keys(o).forEach(e=>{t[e]=o[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),No=e=>(Wt(e.ns)&&(e.ns=[e.ns]),Wt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Wt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),Ht([e,"access",e=>e.supportedLngs,"optionalAccess",e=>e.indexOf,"optionalCall",e=>e("cimode")])<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),To=()=>{};class Fo extends go{constructor(e={},t){var o;if(super(),this.options=No(e),this.services={},this.logger=ho,this.modules={external:[]},o=this,Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach(e=>{"function"==typeof o[e]&&(o[e]=o[e].bind(o))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Wt(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const o=Po();var s;this.options={...o,...this.options,...No(e)},this.options.interpolation={...o.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=o.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(Ht([s=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Ht([s,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Ht([s,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&s.options.backend.backends.some(e=>Ht([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||Ht([e,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0))||"undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const n=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?ho.init(n(this.modules.logger),this.options):ho.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Ro;const t=new So(this.options);this.store=new fo(this.options.resources,this.options);const s=this.services;s.logger=ho,s.resourceStore=this.store,s.languageUtils=t,s.pluralResolver=new Co(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format||(s.formatter=n(e),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new Lo(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new $o(n(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(s.languageDetector=n(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=n(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new wo(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=To),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const i=Jt(),r=()=>{const e=(e,o)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(o),t(e,o)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?r():setTimeout(r,0),i}loadResources(e,t=To){let o=t;const s=Wt(e)?e:this.language;if("function"==typeof e&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===Ht([s,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])&&(!this.options.preload||0===this.options.preload.length))return o();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(s)t(s);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}Ht([this,"access",e=>e.options,"access",e=>e.preload,"optionalAccess",e=>e.forEach,"optionalCall",e=>e(e=>t(e))]),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),o(e)})}else o(null)}reloadResources(e,t,o){const s=Jt();return"function"==typeof e&&(o=e,e=void 0),"function"==typeof t&&(o=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),o||(o=To),this.services.backendConnector.reload(e,t,e=>{s.resolve(),o(e)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&mo.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const o=Jt();this.emit("languageChanging",e);const s=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},n=(n,i)=>{i?this.isLanguageChangingTo===e&&(s(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,o.resolve((...e)=>this.t(...e)),t&&t(n,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const o=Wt(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(o)?o:this.services.languageUtils.getBestMatchFromCodes(Wt(t)?[t]:t);i&&(this.language||s(i),this.translator.language||this.translator.changeLanguage(i),Ht([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(i)])),this.loadResources(i,e=>{n(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),o}getFixedT(e,t,o){const s=(e,t,...n)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(n)):{...t},i.lng=i.lng||s.lng,i.lngs=i.lngs||s.lngs,i.ns=i.ns||s.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||o||s.keyPrefix);const r=this.options.keySeparator||".";let a;return i.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=bo(e,{...this.options,...t})),`${i.keyPrefix}${r}${e}`)):("function"==typeof e&&(e=bo(e,{...this.options,...t})),a=i.keyPrefix?`${i.keyPrefix}${r}${e}`:e),this.t(a,i)};return Wt(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=o,s}t(...e){return Ht([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return Ht([this,"access",e=>e.translator,"optionalAccess",e=>e.exists,"call",t=>t(...e)])}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const o=t.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,n=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;const i=(e,t)=>{const o=this.services.backendConnector.state[`${e}|${t}`];return-1===o||0===o||2===o};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(o,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(o,e)||s&&!i(n,e)))}loadNamespaces(e,t){const o=Jt();return this.options.ns?(Wt(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{o.resolve(),t&&t(e)}),o):(t&&t(),Promise.resolve())}loadLanguages(e,t){const o=Jt();Wt(e)&&(e=[e]);const s=this.options.preload||[],n=e.filter(e=>s.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return n.length?(this.options.preload=s.concat(n),this.loadResources(e=>{o.resolve(),t&&t(e)}),o):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(Ht([this,"access",e=>e.languages,"optionalAccess",e=>e.length])>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=Ht([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new So(Po());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const o=new Fo(e,t);return o.createInstance=Fo.createInstance,o}cloneInstance(e={},t=To){const o=e.forkResourceStore;o&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},n=new Fo(s);void 0===e.debug&&void 0===e.prefix||(n.logger=n.logger.clone(e));if(["store","services","language"].forEach(e=>{n[e]=this[e]}),n.services={...this.services},n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},o){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((o,s)=>(o[s]={...e[t][s]},o),e[t]),e),{});n.store=new fo(e,s),n.services.resourceStore=n.store}if(e.interpolation){const t={...Po().interpolation,...this.options.interpolation,...e.interpolation},o={...s,interpolation:t};n.services.interpolator=new Lo(o)}return n.translator=new wo(n.services,s),n.translator.on("*",(e,...t)=>{n.emit(e,...t)}),n.init(s,t),n.translator.options=s,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Io=Fo.createInstance();Io.createInstance,Io.dir,Io.init,Io.loadResources,Io.reloadResources,Io.use,Io.changeLanguage,Io.getFixedT,Io.t,Io.exists,Io.setDefaultNamespace,Io.hasLoadedNamespace,Io.loadNamespaces,Io.loadLanguages;Io.init({fallbackLng:"en",lng:"en",debug:!0,resources:{en:{translation:{categorize:{limitMaxChoicesPerCategory:"You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",maxChoicesPerCategoryRestriction:"To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."},ebsr:{part:"Part {{index}}"},numberLine:{addElementLimit_one:"You can only add {{count}} element",addElementLimit_other:"You can only add {{count}} elements",clearAll:"Clear all"},imageClozeAssociation:{reachedLimit_one:"You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",reachedLimit_other:"Full"},drawingResponse:{fillColor:"Fill color",outlineColor:"Outline color",noFill:"No fill",lightblue:"Light blue",lightyellow:"Light yellow",red:"Red",orange:"Orange",yellow:"Yellow",violet:"Violet",blue:"Blue",green:"Green",white:"White",black:"Black",onDoubleClick:"Double click to edit this text. Press Enter to submit."},charting:{addCategory:"Add category",actions:"Actions",add:"Add",delete:"Delete",newLabel:"New label",reachedLimit_other:"There can't be more than {{count}} categories.",keyLegend:{incorrectAnswer:"Student incorrect answer",correctAnswer:"Student correct answer",correctKeyAnswer:"Answer key correct"}},graphing:{point:"Point",circle:"Circle",line:"Line",parabola:"Parabola",absolute:"Absolute Value",exponential:"Exponential",polygon:"Polygon",ray:"Ray",segment:"Segment",sine:"Sine",vector:"Vector",label:"Label",redo:"Redo",reset:"Reset"},mathInline:{primaryCorrectWithAlternates:"Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct."},multipleChoice:{minSelections:"Select at least {{minSelections}}.",maxSelections_one:"Only {{maxSelections}} answer is allowed.",maxSelections_other:"Only {{maxSelections}} answers are allowed.",minmaxSelections_equal:"Select {{minSelections}}.",minmaxSelections_range:"Select between {{minSelections}} and {{maxSelections}}."},selectText:{correctAnswerSelected:"Correct",correctAnswerNotSelected:"Correct Answer Not Selected",incorrectSelection:"Incorrect Selection",key:"Key"}},common:{undo:"Undo",clearAll:"Clear all",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Show correct answer",hideCorrectAnswer:"Hide correct answer",commonCorrectAnswerWithAlternates:"Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",warning:"Warning",showNote:"Show Note",hideNote:"Hide Note",cancel:"Cancel"}},es:{translation:{categorize:{limitMaxChoicesPerCategory:"Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",maxChoicesPerCategoryRestriction:"Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"},ebsr:{part:"Parte {{index}}"},numberLine:{addElementLimit_one:"Solo puedes agregar {{count}} elemento",addElementLimit_other:"Solo puedes agregar {{count}} elementos",clearAll:"Borrar todo"},imageClozeAssociation:{reachedLimit_one:"Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",reachedLimit_other:"Lleno"},drawingResponse:{fillColor:"Color de relleno",outlineColor:"Color del contorno",noFill:"Sin relleno",lightblue:"Azul claro",lightyellow:"Amarillo claro",red:"Rojo",orange:"Naranja",yellow:"Amarillo",violet:"Violeta",blue:"Azul",green:"Verde",white:"Blanco",black:"Negro",onDoubleClick:"Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"},charting:{addCategory:"Añadir categoría",actions:"Acciones",add:"Añadir",delete:"Eliminar",newLabel:"Nueva etiqueta",reachedLimit_other:"No puede haber más de {{count}} categorías.",keyLegend:{incorrectAnswer:"Respuesta incorrecta del estudiante",correctAnswer:"Respuesta correcta del estudiante",correctKeyAnswer:"Clave de respuesta correcta"}},graphing:{point:"Punto",circle:"Circulo",line:"Línea",parabola:"Parábola",absolute:"Valor absoluto",exponential:"Exponencial",polygon:"Polígono",ray:"Semirrecta",segment:"Segmento ",sine:"Seno",vector:"Vector",label:"Etiqueta",redo:"Rehacer",reset:"Reiniciar"},mathInline:{primaryCorrectWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas."},multipleChoice:{minSelections:"Seleccione al menos {{minSelections}}.",maxSelections_one:"Sólo se permite {{maxSelections}} respuesta.",maxSelections_other:"Sólo se permiten {{maxSelections}} respuestas.",minmaxSelections_equal:"Seleccione {{minSelections}}.",minmaxSelections_range:"Seleccione entre {{minSelections}} y {{maxSelections}}."},selectText:{correctAnswerSelected:"Respuesta Correcta",correctAnswerNotSelected:"Respuesta Correcta No Seleccionada",incorrectSelection:"Selección Incorrecta",key:"Clave"}},common:{undo:"Deshacer",clearAll:"Borrar todo",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Mostrar respuesta correcta",hideCorrectAnswer:"Ocultar respuesta correcta",commonCorrectAnswerWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",warning:"Advertencia",showNote:"Mostrar Nota",hideNote:"Ocultar Nota",cancel:"Cancelar"}}}});var Do={translator:{...Io,t:(e,t)=>{const{lng:o}=t;switch(o){case"en_US":case"en-US":t.lng="en";break;case"es_ES":case"es-ES":case"es_MX":case"es-MX":t.lng="es"}return Io.t(e,{lng:o,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const Mo=t,qo=s,Bo=i,{Feedback:zo}=n,{Collapsible:Vo}=n,{Readable:Uo}=n,{hasText:Ko}=n,{hasMedia:Ho}=n,{PreviewPrompt:Wo}=n,{UiLayout:Jo}=n,{color:Yo}=n,{styled:Qo}=o,{Tooltip:Go}=r,Xo=e,{mq:Zo}=c,{HorizontalKeypad:es}=c,{updateSpans:ts}=c,os=p,{renderMath:ss}=u;function ns(e){let t,o=e[0],s=1;for(;s<e.length;){const n=e[s],i=e[s+1];if(s+=2,("optionalAccess"===n||"optionalCall"===n)&&null==o)return;"access"===n||"optionalAccess"===n?(t=o,o=i(o)):"call"!==n&&"optionalCall"!==n||(o=i((...e)=>o.call(t,...e)),t=void 0)}return o}const{translator:is}=Do;let rs=!1;const as=/\\newline/g,ls=/{{response}}/gm,cs=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function ps(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function us(e,t){const o={};if(t.config&&t.config.expression){let s=1;(t.config.expression||"").replace(ls,()=>{o[`r${s}`]={value:e&&e.answers&&e.answers[`r${s}`]&&e.answers[`r${s}`].value||""},s+=1})}return o}class hs extends Mo.Component{static __initStatic(){this.propTypes={session:qo.object.isRequired,onSessionChange:qo.func,model:qo.object.isRequired}}constructor(e){super(e),hs.prototype.__init.call(this),hs.prototype.__init2.call(this),hs.prototype.__init3.call(this),hs.prototype.__init4.call(this),hs.prototype.__init5.call(this),hs.prototype.__init6.call(this),hs.prototype.__init7.call(this),hs.prototype.__init8.call(this),hs.prototype.__init9.call(this),hs.prototype.__init10.call(this),hs.prototype.__init11.call(this),hs.prototype.__init12.call(this),hs.prototype.__init13.call(this),hs.prototype.__init14.call(this),hs.prototype.__init15.call(this),hs.prototype.__init16.call(this);const{model:t,session:o}=e,s=us(o,t);this.state={session:{...e.session,answers:s},activeAnswerBlock:"",showCorrect:this.props.model.config.alwaysShowCorrect||!1,tooltipContainerRef:Mo.createRef()}}UNSAFE_componentWillMount(){if("undefined"!=typeof window){let e=os.getInterface(2);rs||(e.registerEmbed("answerBlock",e=>{const t=ds();return{htmlString:`<div class="${t.blockContainer}">\n <div class="${t.blockResponse}" id="${e}Index">R</div>\n <div class="${t.blockMath}">\n <span id="${e}"></span>\n </div>\n </div>`,text:()=>"text",latex:()=>`\\embed{answerBlock}[${e}]`}}),rs=!0)}}__init(){this.handleAnswerBlockDomUpdate=()=>{const{model:e}=this.props,{session:t,showCorrect:o}=this.state,s=t.answers;this.root&&e.disabled&&!o&&Object.keys(s).forEach(t=>{const o=this.root.querySelector(`#${t}`),n=this.root.querySelector(`#${t}Index`);if(o){let i=os.getInterface(2);const r=s[t];o.textContent=r&&r.value||"",e.view&&(o.parentElement.parentElement.classList.remove("correct"),o.parentElement.parentElement.classList.remove("incorrect")),i.StaticMath(o),n.textContent="R"}}),ss(this.root)}}countResponseOccurrences(e){const t=/\{\{response\}\}/g,o=ns([e,"optionalAccess",e=>e.match,"call",e=>e(t)]);return o?o.length:0}UNSAFE_componentWillReceiveProps(e){const{config:t}=this.props.model,{config:o={}}=e.model||{},{session:s}=this.props,{session:n={}}=e||{};if(s&&n&&!kt(s.answers,n.answers)&&this.setState({session:{...n,answers:us(n,this.props.model)}}),t.note&&t.language&&t.language!==o.language&&t.note===is.t("mathInline.primaryCorrectWithAlternates",{lng:t.language})&&(t.note=is.t("mathInline.primaryCorrectWithAlternates",{lng:o.language})),(t.env&&"evaluate"!==t.env.mode||o.env&&"evaluate"!==o.env.mode)&&this.setState({...this.state.session,showCorrect:!1}),o.alwaysShowCorrect&&this.setState({showCorrect:!0}),this.countResponseOccurrences(t.expression)<this.countResponseOccurrences(o.expression)&&setTimeout(()=>this.updateAria(),100),t&&t.responses&&t.responses.length!==o.responses.length||!t&&o&&o.responses||t&&o&&t.expression!==o.expression){const e={},t=this.state.session.answers;let s=1;(o.expression||"").replace(ls,()=>{e[`r${s}`]={value:t&&t[`r${s}`]&&t[`r${s}`].value||""},s++}),this.setState(t=>({session:{...t.session,completeAnswer:this.mqStatic&&this.mqStatic.mathField.latex(),answers:e}}),this.handleAnswerBlockDomUpdate)}}shouldComponentUpdate(e,t){const o=kt(this.props.model,e.model),s=kt(this.state,t);return!o||!s}componentDidMount(){this.handleAnswerBlockDomUpdate(),this.updateAria(),setTimeout(()=>ss(this.root),100)}componentDidUpdate(e,t){this.handleAnswerBlockDomUpdate();ns([e,"access",e=>e.model,"optionalAccess",e=>e.config,"optionalAccess",e=>e.responseType])!==ns([this,"access",e=>e.props,"access",e=>e.model,"optionalAccess",e=>e.config,"optionalAccess",e=>e.responseType])&&this.updateAria()}__init2(){this.updateAria=()=>{if(this.root){this.root.querySelectorAll(".mq-selectable").forEach(e=>e.setAttribute("aria-hidden","true"));this.root.querySelectorAll("textarea").forEach((e,t)=>{e.setAttribute("aria-label","Enter answer.");const o=`instructions-${t}`,s=e.closest(".mq-textarea");if(s){let t=s.querySelector(`#${o}`);t||(t=document.createElement("span"),t.id=o,t.className="sr-only",t.textContent="This field supports both keypad and keyboard input. Use the keyboard to access and interact with the on-screen math keypad, which accepts LaTeX markup. Use the down arrow key to open the keypad and navigate its buttons. Use the escape key to close the keypad and return to the input field.",s.insertBefore(t,e)),e.setAttribute("aria-describedby",o)}})}}}__init3(){this.focusFirstKeypadElement=()=>{setTimeout(()=>{const e=document.querySelector("[data-keypad]");if(e){const t=e.querySelector("button, [role='button']");t&&t.focus()}},0)}}__init4(){this.handleKeyDown=(e,t)=>{const o=function(e,t){let o=e;for(;null!==o;){if(t&&o===t)return!0;o=o.parentNode}return!1}(e.target,this.root),s=this.mqStatic&&ns([this,"access",e=>e.mqStatic,"access",e=>e.inputRef,"optionalAccess",e=>e.current])?ns([this,"access",e=>e.mqStatic,"access",e=>e.inputRef,"optionalAccess",e=>e.current,"access",e=>e.contains,"call",e=>e(document.activeElement)]):"Enter answer."===ns([document,"access",e=>e.activeElement,"optionalAccess",e=>e.getAttribute,"call",e=>e("aria-label")]),{key:n,type:i}=e;s&&("ArrowDown"===n||("click"===i||"touchstart"===i))?this.state.activeAnswerBlock!==t&&o&&(this.cleanupKeyDownListener(),this.setState({activeAnswerBlock:t},()=>{this.onSubFieldFocus(t),"ArrowDown"===n&&this.focusFirstKeypadElement()})):"Escape"===e.key&&this.setState({activeAnswerBlock:""})}}__init5(){this.onSubFieldFocus=e=>{this.handleEvent||(this.handleEvent=t=>{this.handleKeyDown(t,e)},document.addEventListener("keydown",this.handleEvent),document.addEventListener("click",this.handleEvent),document.addEventListener("touchstart",this.handleEvent))}}__init6(){this.cleanupKeyDownListener=()=>{this.handleEvent&&(document.removeEventListener("keydown",this.handleEvent),document.removeEventListener("click",this.handleEvent),document.removeEventListener("touchstart",this.handleEvent),this.handleEvent=null)}}componentWillUnmount(){this.cleanupKeyDownListener&&this.cleanupKeyDownListener()}__init7(){this.onDone=()=>{}}__init8(){this.onSimpleResponseChange=e=>{this.setState(t=>({session:{...t.session,response:e}}),this.callOnSessionChange)}}__init9(){this.toNodeData=e=>{if(!e)return;const{type:t,value:o}=e;return"command"===t||"cursor"===t?e:"answer"===t?{type:"answer",...e}:"clear"===o?{type:"clear"}:{type:"write",value:o}}}__init10(){this.setInput=e=>{this.input=e}}__init11(){this.onClick=e=>{const t=this.toNodeData(e);"clear"===t.type?this.input.clear():"command"===t.type?Array.isArray(t.value)?t.value.forEach(e=>{this.input.cmd(e)}):this.input.cmd(t.value):"cursor"===t.type?this.input.keystroke(t.value):this.input.write(t.value),this.input.focus()}}__init12(){this.callOnSessionChange=()=>{const{onSessionChange:e}=this.props;e&&e(this.state.session)}}__init13(){this.toggleShowCorrect=e=>{this.setState({showCorrect:e},this.handleAnswerBlockDomUpdate)}}__init14(){this.subFieldChanged=(e,t)=>{ts(),e&&this.setState(o=>({session:{...o.session,completeAnswer:this.mqStatic&&this.mqStatic.mathField.latex(),answers:{...o.session.answers,[e]:{value:t}}}}),this.callOnSessionChange)}}__init15(){this.getFieldName=(e,t)=>{const{answers:o}=this.state.session;if(Object.keys(o||{}).length){return Object.keys(o).find(o=>{const s=t[o];return s&&s.id==e.id})}}}__init16(){this.onBlur=e=>{const{relatedTarget:t,currentTarget:o}=e||{},s=o&&o.closest("[role=tooltip]");const n=function e(t,o=0){if(!t||o>=16)return null;const s=t.offsetParent;return s?"tooltip"===s.getAttribute("role")?s:e(s,o+1):null}(t),i=n?function e(t,o=0){if(!t||o>=4)return null;const s=ns([t,"optionalAccess",e=>e.children,"optionalAccess",e=>e[0]]);return s?s.attributes&&s.attributes["data-keypad"]?s:e(s,o+1):null}(n):null;t&&o&&ns([i,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||s||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&cs){const e=document.querySelector("[role='tooltip']");if(e){e.firstChild.setAttribute("tabindex","-1")}}},1)}render(){const{model:e}=this.props,{activeAnswerBlock:t,showCorrect:o,session:s,tooltipContainerRef:n}=this.state,{config:i,correctness:r,disabled:a,extraCSSRules:l,view:c,teacherInstructions:p,rationale:u,feedback:h,animationsDisabled:d,printMode:g,alwaysShowCorrect:f,language:m}=e||{};if(!i)return null;const{showNote:y,note:b,prompt:v,responses:x,responseType:w,equationEditor:S,customKeys:_,id:k,env:{mode:C,role:O}={}}=i||{},L=(o||"view"===C&&"instructor"===O)&&y&&b,j=function(e){if(null==e)return!0;if(te(e)&&(A(e)||"string"==typeof e||"function"==typeof e.splice||he(e)||xe(e)||le(e)))return!e.length;var t=st(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(se(e))return!Ae(e).length;for(var o in e)if(_t.call(e,o))return!1;return!0}(x),E=!j&&r&&"correct"!==r.correctness,R=a&&r,$=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(_),P=r&&r.correct,N=function(e,t){const{config:o,disabled:s}=e||{},{expression:n,responses:i,printMode:r,alwaysShowCorrect:a}=o||{};if(o&&n){const e=n;if(t.showCorrect)return i&&i.length&&i[0].answer;let o=1;return(e||"").replace(ls,function(){const e=t.session.answers[`r${o}`];if(r&&!a){const e="\\ \\ ".repeat(30)+"\\newline ";return`\\MathQuillMathField[r${o++}]{${e.repeat(3)}}`}return s?`\\embed{answerBlock}[r${o++}]`:`\\MathQuillMathField[r${o++}]{${e&&e.value||""}}`}).replace(as,"\\embed{newLine}[]")}}(e,this.state)||"",T=a&&!r,F=g&&!f,I=u&&(Ko(u)||Ho(u)),D=p&&(Ko(p)||Ho(p)),M=Mo.createElement(_s,null,Mo.createElement(Zo.Static,{className:"static-math",ref:e=>{e&&(this.mqStatic=e)},latex:N,onSubFieldChange:this.subFieldChanged,getFieldName:this.getFieldName,setInput:this.setInput,onSubFieldFocus:this.onSubFieldFocus,onBlur:this.onBlur})),q=Mo.createElement(ys,null,"gather"===C&&Mo.createElement(ks,null,"Math Equation Response Question"),T&&D&&(d?Mo.createElement("div",{dangerouslySetInnerHTML:{__html:p}}):Mo.createElement(vs,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},Mo.createElement("div",{dangerouslySetInnerHTML:{__html:p}}))),v&&Mo.createElement(ms,null,Mo.createElement(Wo,{prompt:v})),F?M:Mo.createElement(Uo,{false:!0},Mo.createElement(Ss,{tabIndex:0},w===Tt&&Mo.createElement(Ut,{onSimpleResponseChange:this.onSimpleResponseChange,showCorrect:o,emptyResponse:j,model:e,session:s,onSubFieldFocus:this.onSubFieldFocus,showKeypad:!!t}),w===Nt&&Mo.createElement(ws,{ref:n,isIncorrect:!j&&!P&&!o,isCorrect:!j&&(P||o),showCorrectness:!j&&a&&r&&!c,correctAnswerShown:o,printCorrect:g&&f},Mo.createElement(Go,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:!!t,slotProps:{popper:{container:ns([n,"optionalAccess",e=>e.current])||void 0,placement:"bottom-start",sx:{backgroundColor:"transparent",width:"650px",opacity:1,"& .MuiTooltip-arrow":{display:"none"}},modifiers:[{name:"offset",options:{offset:[0,8]}},{name:"preventOverflow",enabled:!0,options:{boundary:"viewport",padding:8}},{name:"computeStyles",options:{adaptive:!0,gpuAcceleration:!0}},{name:"flip",enabled:!1}]},tooltip:{sx:{fontSize:"initial",backgroundColor:"transparent",width:"600px",marginTop:0,paddingTop:0,boxShadow:"none"}}},title:Object.keys(s.answers).map(e=>e===t&&!(o||a)&&Mo.createElement(xs,{"data-keypad":!0,key:e,style:{width:ps($,S)}},Mo.createElement(es,{additionalKeys:$,mode:S||6,onClick:this.onClick}))||null)},Mo.createElement("div",null,Mo.createElement(Zo.Static,{className:"static-math",ref:e=>{e&&(this.mqStatic=e)},latex:N,onSubFieldChange:this.subFieldChanged,getFieldName:this.getFieldName,setInput:this.setInput,onSubFieldFocus:this.onSubFieldFocus,onBlur:this.onBlur})))))),T&&L&&Mo.createElement(bs,{dangerouslySetInnerHTML:{__html:`<strong>Note:</strong> ${b}`}}),T&&I&&(d?Mo.createElement("div",{dangerouslySetInnerHTML:{__html:u}}):Mo.createElement(Vo,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},Mo.createElement("div",{dangerouslySetInnerHTML:{__html:u}}))));return R&&(E||D||I||h)?Mo.createElement(gs,{extraCSSRules:l,ref:e=>{const t=Xo.findDOMNode(e);this.root=t||this.root}},Mo.createElement(fs,{interactive:!0,enterTouchDelay:0,placement:"bottom-start",slotProps:{tooltip:{sx:e=>({background:`${Yo.primaryLight()} !important`,color:Yo.text(),padding:e.spacing(2),border:`1px solid ${Yo.secondary()}`,fontSize:"16px","& :not(.MathJax) > table tr":{"&:nth-child(2n)":{backgroundColor:"unset !important"}}})},popper:{sx:{opacity:1},modifiers:[{name:"offset",options:{offset:[0,2]}}]}},title:Mo.createElement("div",null,Mo.createElement(ys,null,E&&Mo.createElement(Cs,{language:m,show:!0,toggled:o,onToggle:this.toggleShowCorrect})),D&&Mo.createElement(vs,{key:"collapsible-teacher-instructions",labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},Mo.createElement(Wo,{prompt:p})),L&&Ko(b)&&Mo.createElement(vs,{key:"collapsible-note",labels:{hidden:is.t("common:showNote",{lng:m}),visible:is.t("common:hideNote",{lng:m})}},Mo.createElement(Wo,{prompt:b})),I&&Mo.createElement(vs,{key:"collapsible-rationale",labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},Mo.createElement(Wo,{prompt:u})),h&&Mo.createElement(zo,{correctness:r.correctness,feedback:h}))},q)):Mo.createElement(gs,{id:k,extraCSSRules:l,ref:e=>{const t=Xo.findDOMNode(e);this.root=t||this.root}},q)}}hs.__initStatic();const ds=()=>({blockContainer:"block-container",blockResponse:"block-response",blockMath:"block-math"});if("undefined"!=typeof document){const e="math-inline-block-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=`\n .block-container {\n margin: 8px !important;\n display: inline-flex;\n border: 2px solid grey !important;\n }\n .block-response {\n color: grey;\n background: #f5f5f5;\n font-size: 0.8rem !important;\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n border-right: 2px solid #bdbdbd !important;\n flex-shrink: 0;\n flex-grow: 0;\n flex-basis: auto;\n }\n .block-math {\n color: ${Yo.text()};\n background-color: ${Yo.background()};\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-grow: 1;\n }\n .block-math > .mq-math-mode > .mq-hasCursor > .mq-cursor {\n display: none;\n }\n .sr-only {\n position: absolute;\n left: -10000px;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n }\n .static-math > .mq-root-block > .mq-editable-field {\n border-color: ${Yo.text()};\n }\n `,document.head.appendChild(t)}}const gs=Qo(Jo)(()=>({color:Yo.text(),backgroundColor:Yo.background(),display:"inline-block"})),fs=Qo(Go)({}),ms=Qo("div")(({theme:e})=>({marginBottom:e.spacing(2)})),ys=Qo("div")({width:"100%",position:"relative",backgroundColor:Yo.background(),color:Yo.text()}),bs=Qo("div")(({theme:e})=>({paddingBottom:e.spacing(2)})),vs=Qo(Vo)(({theme:e})=>({marginBottom:e.spacing(2)})),xs=Qo("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),ws=Qo("div",{shouldForwardProp:e=>!["isIncorrect","isCorrect","showCorrectness","correctAnswerShown","printCorrect"].includes(e)})(({theme:e,isIncorrect:t,isCorrect:o,showCorrectness:s,correctAnswerShown:n,printCorrect:i})=>{const r=t?Yo.incorrect():o?Yo.correct():void 0;return{maxWidth:"fit-content",padding:e.spacing(.25),...s&&{border:r?`2px solid ${r} !important`:"2px solid"},...!s&&r&&{borderColor:`${r} !important`},...n&&{padding:e.spacing(1),letterSpacing:"0.5px"},...i&&{border:`2px solid ${Yo.correct()} !important`},"& > .mq-math-mode":{"& > .mq-root-block":{paddingRight:"0 !important",paddingLeft:"0 !important","& > .mq-editable-field":{minWidth:"10px",padding:e.spacing(.25)}},"& sup":{top:0}}}}),Ss=Qo("div")({position:"relative","& .mq-overarrow-inner":{border:"none !important",padding:"0 !important"},"& .mq-overarrow-inner-right":{display:"none !important"},"& .mq-overarrow-inner-left":{display:"none !important"},"& .mq-overarrow.mq-arrow-both":{minWidth:"1.23em","& *":{lineHeight:"1 !important"},"&:before":{top:"-0.4em",left:"-1px"},"&:after":{top:"-2.4em",right:"-1px"},"&.mq-empty:after":{top:"-0.45em"}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:"-0.4em",right:"-1px"}},"& .mq-longdiv-inner":{borderTop:"1px solid !important",paddingTop:"1.5px !important"},"& .mq-parallelogram":{lineHeight:.85}}),_s=Qo("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),ks=Qo("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),Cs=Qo(Bo)(({theme:e})=>({color:Yo.text(),marginBottom:e.spacing(2)})),As=t,Os=a("pie-ui:math-inline");class Ls extends HTMLElement{constructor(){super(),this._root=null,this._configuration=$t.configuration,this.sessionChangedEventCaller=St(()=>{this.dispatchEvent(new jt(this.tagName.toLowerCase(),!0))},1e3)}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t);const o=this.closest(".player-container");o&&o.setAttribute("lang",t)}set model(e){this._model=e,this.dispatchEvent(new Ot(this._model,!0,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e,this._render()}get session(){return this._session}set configuration(e){this._configuration=e,this._render()}sessionChanged(e){Object.keys(e).map(t=>{this._session[t]=e[t]}),this.sessionChangedEventCaller(),Os("session: ",this._session)}connectedCallback(){this.setAttribute("aria-label","Math Response Question"),this.setAttribute("role","region"),this._render()}_render(){if(!this._model||!this._session)return;const e=As.createElement(hs,{model:this._model,session:this._session,configuration:this._configuration,onSessionChange:this.sessionChanged.bind(this)});this._root||(this._root=h(this)),this._root.render(e)}disconnectedCallback(){this._root&&this._root.unmount()}}export{hs as Component,Ls as default};
|
package/module/index.html
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/math-inline@11.1.0-next.0</title>
|
|
6
|
-
<script
|
|
7
|
-
type="module"
|
|
8
|
-
src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
|
|
9
|
-
|
|
10
|
-
<link
|
|
11
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
12
|
-
rel="stylesheet"
|
|
13
|
-
/>
|
|
14
|
-
<style>
|
|
15
|
-
html, body {
|
|
16
|
-
font-family: 'Roboto', sans-serif;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
19
|
-
<script type="module" src="./demo.js"></script>
|
|
20
|
-
</head>
|
|
21
|
-
</html>
|
package/module/manifest.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pie-element/math-inline",
|
|
3
|
-
"version": "11.1.0-next.0",
|
|
4
|
-
"modules": [
|
|
5
|
-
{
|
|
6
|
-
"name": "@pie-lib/shared-module",
|
|
7
|
-
"version": "^4.0.1"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"name": "@pie-lib/math-rendering-module",
|
|
11
|
-
"version": "^4.0.7"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name": "@pie-lib/math-edit-module",
|
|
15
|
-
"version": "^3.1.2"
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
}
|
package/module/print-demo.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import PrintElement from './print.js';
|
|
2
|
-
|
|
3
|
-
var generate = {};
|
|
4
|
-
|
|
5
|
-
/* const initialModel = {
|
|
6
|
-
customKeys: [],
|
|
7
|
-
equationEditor: 'geometry',
|
|
8
|
-
responseType: 'Advanced Multi',
|
|
9
|
-
expression: '{{response}}',
|
|
10
|
-
responses: [
|
|
11
|
-
{
|
|
12
|
-
answer: 'r=\\sqrt{\\frac{V}{7\\pi}}',
|
|
13
|
-
id: '1',
|
|
14
|
-
alternates: {},
|
|
15
|
-
validation: 'literal',
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
note: 'The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct.',
|
|
19
|
-
rationale:
|
|
20
|
-
'<p>The correct answer is:</p><ul><li><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><msqrt><mfrac><mi>V</mi><mrow><mn>7</mn><mi>π</mi></mrow></mfrac></msqrt></math></li></ul>',
|
|
21
|
-
}; */
|
|
22
|
-
|
|
23
|
-
const E262456 = {
|
|
24
|
-
equationEditor: 3,
|
|
25
|
-
toolbarEditorPosition: 'bottom',
|
|
26
|
-
prompt:
|
|
27
|
-
'<p><strong>B.</strong> Find the value of the expression that you wrote in part A to find how much money the band members made.</p>\n\n<p>Use the on-screen keyboard to type your answer in the box below.</p>\n',
|
|
28
|
-
expression: '${{response}}',
|
|
29
|
-
responses: [
|
|
30
|
-
{
|
|
31
|
-
allowSpaces: true,
|
|
32
|
-
// 'validation': 'symbolic',
|
|
33
|
-
answer: '$410',
|
|
34
|
-
id: '1',
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
responseType: 'Advanced Multi',
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
generate.model = (id, element) => ({
|
|
41
|
-
id,
|
|
42
|
-
element,
|
|
43
|
-
...E262456,
|
|
44
|
-
rubricEnabled: false,
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
const { model } = generate;
|
|
48
|
-
|
|
49
|
-
var config = {
|
|
50
|
-
elements: {
|
|
51
|
-
'math-inline': '../..',
|
|
52
|
-
},
|
|
53
|
-
models: [model('1', 'math-inline')],
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// new init - just shows off print!
|
|
57
|
-
|
|
58
|
-
const init = async () => {
|
|
59
|
-
console.log('define the element...');
|
|
60
|
-
await Promise.all(
|
|
61
|
-
config.models.map(async (m) => {
|
|
62
|
-
try {
|
|
63
|
-
const printTag = `${m.element}-print`;
|
|
64
|
-
if (customElements.get(printTag)) {
|
|
65
|
-
return true;
|
|
66
|
-
} else {
|
|
67
|
-
customElements.define(printTag, PrintElement);
|
|
68
|
-
await customElements.whenDefined(printTag);
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
} catch (e) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
console.log('now apply the model...');
|
|
78
|
-
config.models.forEach((m) => {
|
|
79
|
-
const printTag = `${m.element}-print`;
|
|
80
|
-
const h3s = document.createElement('h3');
|
|
81
|
-
h3s.textContent = 'student mode';
|
|
82
|
-
document.body.appendChild(h3s);
|
|
83
|
-
const de = document.createElement(printTag);
|
|
84
|
-
document.body.appendChild(de);
|
|
85
|
-
de.options = {};
|
|
86
|
-
de.model = m;
|
|
87
|
-
|
|
88
|
-
const h3 = document.createElement('h3');
|
|
89
|
-
h3.textContent = 'instructor mode';
|
|
90
|
-
document.body.appendChild(h3);
|
|
91
|
-
const instr = document.createElement(printTag);
|
|
92
|
-
document.body.appendChild(instr);
|
|
93
|
-
instr.options = { mode: 'instructor' };
|
|
94
|
-
instr.model = JSON.parse(JSON.stringify(m));
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
init()
|
|
99
|
-
.then(() => {
|
|
100
|
-
console.log('ready');
|
|
101
|
-
})
|
|
102
|
-
.catch((e) => {
|
|
103
|
-
console.error(e);
|
|
104
|
-
});
|
package/module/print.html
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/math-inline@11.1.0-next.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>
|