@pie-element/extended-text-entry 15.2.0 → 15.2.2-beta.10

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.
@@ -1,76 +0,0 @@
1
- import PrintElement from './print.js';
2
-
3
- var generate = {};
4
-
5
- generate.model = (id, element) => ({
6
- id,
7
- element,
8
- customKeys: ['\\square'],
9
- feedback: { type: 'default', default: 'this is default feedback' },
10
- prompt: 'This is the question prompt',
11
- promptEnabled: true,
12
- mathInput: true,
13
- playersToolbarPosition: 'bottom',
14
- toolbarEditorPosition: 'bottom',
15
- spellCheckEnabled: true,
16
- rubricEnabled: false,
17
- annotationsEnabled: false,
18
- });
19
-
20
- const { model } = generate;
21
- var config = {
22
- elements: {
23
- 'extended-text-entry': '../..',
24
- },
25
- models: [model('1', 'extended-text-entry')],
26
- };
27
-
28
- // new init - just shows off print!
29
-
30
- const init = async () => {
31
- console.log('define the element...');
32
- await Promise.all(
33
- config.models.map(async (m) => {
34
- try {
35
- const printTag = `${m.element}-print`;
36
- if (customElements.get(printTag)) {
37
- return true;
38
- } else {
39
- customElements.define(printTag, PrintElement);
40
- await customElements.whenDefined(printTag);
41
- return true;
42
- }
43
- } catch (e) {
44
- return false;
45
- }
46
- })
47
- );
48
-
49
- console.log('now apply the model...');
50
- config.models.forEach((m) => {
51
- const printTag = `${m.element}-print`;
52
- const h3s = document.createElement('h3');
53
- h3s.textContent = 'student mode';
54
- document.body.appendChild(h3s);
55
- const de = document.createElement(printTag);
56
- document.body.appendChild(de);
57
- de.options = {};
58
- de.model = m;
59
-
60
- const h3 = document.createElement('h3');
61
- h3.textContent = 'instructor mode';
62
- document.body.appendChild(h3);
63
- const instr = document.createElement(printTag);
64
- document.body.appendChild(instr);
65
- instr.options = { mode: 'instructor' };
66
- instr.model = JSON.parse(JSON.stringify(m));
67
- });
68
- };
69
-
70
- init()
71
- .then(() => {
72
- console.log('ready');
73
- })
74
- .catch((e) => {
75
- console.error(e);
76
- });
package/module/print.html DELETED
@@ -1,18 +0,0 @@
1
-
2
- <!doctype html>
3
- <html>
4
- <head>
5
- <title>@pie-element/extended-text-entry@15.1.11</title>
6
- <link
7
- href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
- rel="stylesheet"
9
- />
10
- <style>
11
- html, body {
12
- font-family: 'Roboto', sans-serif;
13
- }
14
- </style>
15
- <script type="module" src="./print-demo.js"></script>
16
- </head>
17
- <body></body>
18
- </html>
package/module/print.js DELETED
@@ -1 +0,0 @@
1
- import{_dll_react as t,_dll_prop_types as e,_dll_mui__material as n,_dll_mui__material_styles as o,_dll_pie_lib__render_ui as r,_dll_debug as i,_dll_react_dom_client as a}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";import{_dll_pie_lib__math_rendering as s}from"../../../@pie-lib/math-rendering-module@6.0.0/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as l}from"../../../@pie-lib/editable-html-module@8.0.0/module/index.js";import{_dll_pie_lib__config_ui as c}from"../../../@pie-lib/config-module@5.0.0/module/index.js";var d="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,u=d||p||Function("return this")(),h=u.Symbol,f=Object.prototype,b=f.hasOwnProperty,y=f.toString,g=h?h.toStringTag:void 0;var m=Object.prototype.toString;var v=h?h.toStringTag:void 0;function _(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":v&&v in Object(t)?function(t){var e=b.call(t,g),n=t[g];try{t[g]=void 0;var o=!0}catch(t){}var r=y.call(t);return o&&(e?t[g]=n:delete t[g]),r}(t):function(t){return m.call(t)}(t)}function x(t){return null!=t&&"object"==typeof t}var C=Array.isArray,j=/\s/;var w=/^\s+/;function E(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&j.test(t.charAt(e)););return e}(t)+1).replace(w,""):t}function A(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var S=/^[-+]0x[0-9a-f]+$/i,k=/^0b[01]+$/i,O=/^0o[0-7]+$/i,T=parseInt;function R(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||x(t)&&"[object Symbol]"==_(t)}(t))return NaN;if(A(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=A(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=E(t);var n=k.test(t);return n||O.test(t)?T(t.slice(2),n?2:8):S.test(t)?NaN:+t}function P(t){if(!A(t))return!1;var e=_(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var I,M=u["__core-js_shared__"],D=(I=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"";var z=Function.prototype.toString;function L(t){if(null!=t){try{return z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var N=/^\[object .+?Constructor\]$/,$=Function.prototype,W=Object.prototype,U=$.toString,F=W.hasOwnProperty,B=RegExp("^"+U.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function H(t){return!(!A(t)||(e=t,D&&D in e))&&(P(t)?B:N).test(L(t));var e}function q(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return H(n)?n:void 0}var V=q(u,"WeakMap"),K=Object.create,G=function(){function t(){}return function(e){if(!A(e))return{};if(K)return K(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();var X=function(){try{var t=q(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Y=/^(?:0|[1-9]\d*)$/;function Q(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Y.test(t))&&t>-1&&t%1==0&&t<e}function J(t,e,n){"__proto__"==e&&X?X(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Z(t,e){return t===e||t!=t&&e!=e}var tt=Object.prototype.hasOwnProperty;function et(t,e,n){var o=t[e];tt.call(t,e)&&Z(o,n)&&(void 0!==n||e in t)||J(t,e,n)}function nt(t,e,n,o){var r=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],l=o?o(n[s],t[s],s,n,t):void 0;void 0===l&&(l=t[s]),r?J(n,s,l):et(n,s,l)}return n}function ot(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function rt(t){return null!=t&&ot(t.length)&&!P(t)}var it=Object.prototype;function at(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||it)}function st(t){return x(t)&&"[object Arguments]"==_(t)}var lt=Object.prototype,ct=lt.hasOwnProperty,dt=lt.propertyIsEnumerable,pt=st(function(){return arguments}())?st:function(t){return x(t)&&ct.call(t,"callee")&&!dt.call(t,"callee")};var ut="object"==typeof exports&&exports&&!exports.nodeType&&exports,ht=ut&&"object"==typeof module&&module&&!module.nodeType&&module,ft=ht&&ht.exports===ut?u.Buffer:void 0,bt=(ft?ft.isBuffer:void 0)||function(){return!1},yt={};function gt(t){return function(e){return t(e)}}yt["[object Float32Array]"]=yt["[object Float64Array]"]=yt["[object Int8Array]"]=yt["[object Int16Array]"]=yt["[object Int32Array]"]=yt["[object Uint8Array]"]=yt["[object Uint8ClampedArray]"]=yt["[object Uint16Array]"]=yt["[object Uint32Array]"]=!0,yt["[object Arguments]"]=yt["[object Array]"]=yt["[object ArrayBuffer]"]=yt["[object Boolean]"]=yt["[object DataView]"]=yt["[object Date]"]=yt["[object Error]"]=yt["[object Function]"]=yt["[object Map]"]=yt["[object Number]"]=yt["[object Object]"]=yt["[object RegExp]"]=yt["[object Set]"]=yt["[object String]"]=yt["[object WeakMap]"]=!1;var mt="object"==typeof exports&&exports&&!exports.nodeType&&exports,vt=mt&&"object"==typeof module&&module&&!module.nodeType&&module,_t=vt&&vt.exports===mt&&d.process,xt=function(){try{var t=vt&&vt.require&&vt.require("util").types;return t||_t&&_t.binding&&_t.binding("util")}catch(t){}}(),Ct=xt&&xt.isTypedArray,jt=Ct?gt(Ct):function(t){return x(t)&&ot(t.length)&&!!yt[_(t)]},wt=Object.prototype.hasOwnProperty;function Et(t,e){var n=C(t),o=!n&&pt(t),r=!n&&!o&&bt(t),i=!n&&!o&&!r&&jt(t),a=n||o||r||i,s=a?function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}(t.length,String):[],l=s.length;for(var c in t)!e&&!wt.call(t,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Q(c,l))||s.push(c);return s}function At(t,e){return function(n){return t(e(n))}}var St=At(Object.keys,Object),kt=Object.prototype.hasOwnProperty;function Ot(t){return rt(t)?Et(t):function(t){if(!at(t))return St(t);var e=[];for(var n in Object(t))kt.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}var Tt=Object.prototype.hasOwnProperty;function Rt(t){if(!A(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=at(t),n=[];for(var o in t)("constructor"!=o||!e&&Tt.call(t,o))&&n.push(o);return n}function Pt(t){return rt(t)?Et(t,!0):Rt(t)}var It=q(Object,"create");var Mt=Object.prototype.hasOwnProperty;var Dt=Object.prototype.hasOwnProperty;function zt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function Lt(t,e){for(var n=t.length;n--;)if(Z(t[n][0],e))return n;return-1}zt.prototype.clear=function(){this.__data__=It?It(null):{},this.size=0},zt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},zt.prototype.get=function(t){var e=this.__data__;if(It){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Mt.call(e,t)?e[t]:void 0},zt.prototype.has=function(t){var e=this.__data__;return It?void 0!==e[t]:Dt.call(e,t)},zt.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=It&&void 0===e?"__lodash_hash_undefined__":e,this};var Nt=Array.prototype.splice;function $t(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}$t.prototype.clear=function(){this.__data__=[],this.size=0},$t.prototype.delete=function(t){var e=this.__data__,n=Lt(e,t);return!(n<0)&&(n==e.length-1?e.pop():Nt.call(e,n,1),--this.size,!0)},$t.prototype.get=function(t){var e=this.__data__,n=Lt(e,t);return n<0?void 0:e[n][1]},$t.prototype.has=function(t){return Lt(this.__data__,t)>-1},$t.prototype.set=function(t,e){var n=this.__data__,o=Lt(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};var Wt=q(u,"Map");function Ut(t,e){var n,o,r=t.__data__;return("string"==(o=typeof(n=e))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof e?"string":"hash"]:r.map}function Ft(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function Bt(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t}Ft.prototype.clear=function(){this.size=0,this.__data__={hash:new zt,map:new(Wt||$t),string:new zt}},Ft.prototype.delete=function(t){var e=Ut(this,t).delete(t);return this.size-=e?1:0,e},Ft.prototype.get=function(t){return Ut(this,t).get(t)},Ft.prototype.has=function(t){return Ut(this,t).has(t)},Ft.prototype.set=function(t,e){var n=Ut(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};var Ht=At(Object.getPrototypeOf,Object);function qt(t){var e=this.__data__=new $t(t);this.size=e.size}qt.prototype.clear=function(){this.__data__=new $t,this.size=0},qt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},qt.prototype.get=function(t){return this.__data__.get(t)},qt.prototype.has=function(t){return this.__data__.has(t)},qt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof $t){var o=n.__data__;if(!Wt||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ft(o)}return n.set(t,e),this.size=n.size,this};var Vt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Kt=Vt&&"object"==typeof module&&module&&!module.nodeType&&module,Gt=Kt&&Kt.exports===Vt?u.Buffer:void 0,Xt=Gt?Gt.allocUnsafe:void 0;function Yt(){return[]}var Qt=Object.prototype.propertyIsEnumerable,Jt=Object.getOwnPropertySymbols,Zt=Jt?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,o=null==t?0:t.length,r=0,i=[];++n<o;){var a=t[n];e(a,n,t)&&(i[r++]=a)}return i}(Jt(t),function(e){return Qt.call(t,e)}))}:Yt;var te=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Bt(e,Zt(t)),t=Ht(t);return e}:Yt;function ee(t,e,n){var o=e(t);return C(t)?o:Bt(o,n(t))}function ne(t){return ee(t,Ot,Zt)}function oe(t){return ee(t,Pt,te)}var re=q(u,"DataView"),ie=q(u,"Promise"),ae=q(u,"Set"),se="[object Map]",le="[object Promise]",ce="[object Set]",de="[object WeakMap]",pe="[object DataView]",ue=L(re),he=L(Wt),fe=L(ie),be=L(ae),ye=L(V),ge=_;(re&&ge(new re(new ArrayBuffer(1)))!=pe||Wt&&ge(new Wt)!=se||ie&&ge(ie.resolve())!=le||ae&&ge(new ae)!=ce||V&&ge(new V)!=de)&&(ge=function(t){var e=_(t),n="[object Object]"==e?t.constructor:void 0,o=n?L(n):"";if(o)switch(o){case ue:return pe;case he:return se;case fe:return le;case be:return ce;case ye:return de}return e});var me=ge,ve=Object.prototype.hasOwnProperty;var _e=u.Uint8Array;function xe(t){var e=new t.constructor(t.byteLength);return new _e(e).set(new _e(t)),e}var Ce=/\w*$/;var je=h?h.prototype:void 0,we=je?je.valueOf:void 0;function Ee(t,e,n){var o,r,i,a=t.constructor;switch(e){case"[object ArrayBuffer]":return xe(t);case"[object Boolean]":case"[object Date]":return new a(+t);case"[object DataView]":return function(t,e){var n=e?xe(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t,e){var n=e?xe(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}(t,n);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(t);case"[object RegExp]":return(i=new(r=t).constructor(r.source,Ce.exec(r))).lastIndex=r.lastIndex,i;case"[object Symbol]":return o=t,we?Object(we.call(o)):{}}}var Ae=xt&&xt.isMap,Se=Ae?gt(Ae):function(t){return x(t)&&"[object Map]"==me(t)};var ke=xt&&xt.isSet,Oe=ke?gt(ke):function(t){return x(t)&&"[object Set]"==me(t)},Te="[object Arguments]",Re="[object Function]",Pe="[object Object]",Ie={};function Me(t,e,n,o,r,i){var a,s=1&e,l=2&e,c=4&e;if(n&&(a=r?n(t,o,r,i):n(t)),void 0!==a)return a;if(!A(t))return t;var d=C(t);if(d){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ve.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}(t,a)}else{var p=me(t),u=p==Re||"[object GeneratorFunction]"==p;if(bt(t))return function(t,e){if(e)return t.slice();var n=t.length,o=Xt?Xt(n):new t.constructor(n);return t.copy(o),o}(t,s);if(p==Pe||p==Te||u&&!r){if(a=l||u?{}:function(t){return"function"!=typeof t.constructor||at(t)?{}:G(Ht(t))}(t),!s)return l?function(t,e){return nt(t,te(t),e)}(t,function(t,e){return t&&nt(e,Pt(e),t)}(a,t)):function(t,e){return nt(t,Zt(t),e)}(t,function(t,e){return t&&nt(e,Ot(e),t)}(a,t))}else{if(!Ie[p])return r?t:{};a=Ee(t,p,s)}}i||(i=new qt);var h=i.get(t);if(h)return h;i.set(t,a),Oe(t)?t.forEach(function(o){a.add(Me(o,e,n,o,t,i))}):Se(t)&&t.forEach(function(o,r){a.set(r,Me(o,e,n,r,t,i))});var f=d?void 0:(c?l?oe:ne:l?Pt:Ot)(t);return function(t,e){for(var n=-1,o=null==t?0:t.length;++n<o&&!1!==e(t[n],n,t););}(f||t,function(o,r){f&&(o=t[r=o]),et(a,r,Me(o,e,n,r,t,i))}),a}Ie[Te]=Ie["[object Array]"]=Ie["[object ArrayBuffer]"]=Ie["[object DataView]"]=Ie["[object Boolean]"]=Ie["[object Date]"]=Ie["[object Float32Array]"]=Ie["[object Float64Array]"]=Ie["[object Int8Array]"]=Ie["[object Int16Array]"]=Ie["[object Int32Array]"]=Ie["[object Map]"]=Ie["[object Number]"]=Ie[Pe]=Ie["[object RegExp]"]=Ie["[object Set]"]=Ie["[object String]"]=Ie["[object Symbol]"]=Ie["[object Uint8Array]"]=Ie["[object Uint8ClampedArray]"]=Ie["[object Uint16Array]"]=Ie["[object Uint32Array]"]=!0,Ie["[object Error]"]=Ie[Re]=Ie["[object WeakMap]"]=!1;var De=function(){return u.Date.now()},ze=Math.max,Le=Math.min;function Ne(t,e,n){var o,r,i,a,s,l,c=0,d=!1,p=!1,u=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function h(e){var n=o,i=r;return o=r=void 0,c=e,a=t.apply(i,n)}function f(t){var n=t-l;return void 0===l||n>=e||n<0||p&&t-c>=i}function b(){var t=De();if(f(t))return y(t);s=setTimeout(b,function(t){var n=e-(t-l);return p?Le(n,i-(t-c)):n}(t))}function y(t){return s=void 0,u&&o?h(t):(o=r=void 0,a)}function g(){var t=De(),n=f(t);if(o=arguments,r=this,l=t,n){if(void 0===s)return function(t){return c=t,s=setTimeout(b,e),d?h(t):a}(l);if(p)return clearTimeout(s),s=setTimeout(b,e),h(l)}return void 0===s&&(s=setTimeout(b,e)),a}return e=R(e)||0,A(n)&&(d=!!n.leading,i=(p="maxWait"in n)?ze(R(n.maxWait)||0,e):i,u="trailing"in n?!!n.trailing:u),g.cancel=function(){void 0!==s&&clearTimeout(s),c=0,o=l=r=s=void 0},g.flush=function(){return void 0===s?a:y(De())},g}const $e=(t,e,n)=>{const o=n||[],r=o.reduce((t,e)=>t+e.textContent.length,0);let i=!0;if(r>e)return!1;for(t&&(3===t.nodeType&&t.parentNode&&!t.parentNode.hasAttribute("data-ann-id")&&o.push(t),t=t.firstChild);t&&i;)i=$e(t,e,o),t=t.nextSibling;return o},We=t=>{const{commonAncestorContainer:e,startContainer:n,endContainer:o,startOffset:r,endOffset:i}=t,a=[];let s=!1,l=!1,c="";const d=t=>{const{nodeValue:e,childNodes:p}=t;t===n&&t===o?(e&&(c+=e.substring(r,i)),s=l=!0):t===n?(e&&(c+=e.substring(r)),s=!0):t===o?(e&&(c+=e.substring(0,i)),l=!0):t&&3===t.nodeType&&t.parentNode&&!t.parentNode.hasAttribute("data-ann-id")&&e&&s&&!l&&(c+=e,a.push(t)),p.forEach(t=>{l||d(t)})};return d(e),[a,c]},Ue=t=>{const e=document.createElement("SPAN");return t.surroundContents(e),e},Fe=t=>{if(t.startContainer===t.endContainer)return[Ue(t)];const[e]=We(t),n=document.createRange();n.selectNodeContents(t.startContainer),n.setStart(t.startContainer,t.startOffset);const o=Ue(n),r=document.createRange();r.selectNode(t.endContainer),r.setEnd(t.endContainer,t.endOffset);const i=Ue(r);return[o,...e.map(t=>{const e=document.createElement("SPAN");return t.parentNode.insertBefore(e,t),e.appendChild(t),e}),i]},Be=(t,e)=>{(t||[]).forEach(t=>{const e=t.parentNode,n=t.childNodes,o=n.length;if(o>0)for(let r=0;r<o;r++)e.insertBefore(n[0],t);else e.insertBefore(document.createTextNode(t.textContent),t);e.removeChild(t)}),e.normalize()},He=()=>{document.getSelection?(document.getSelection().removeAllRanges(),document.getSelection().addRange(document.createRange())):window.getSelection?window.getSelection().removeAllRanges?(window.getSelection().removeAllRanges(),window.getSelection().addRange(document.createRange())):window.getSelection().empty&&window.getSelection().empty():document.selection&&document.selection.empty()},qe=t=>t.length>=20||-1!==t.search(/\n|\r|\r\n/),Ve=t=>Array.from(document.querySelectorAll(`[data-id='${t}']`)),Ke=t=>document.querySelector(`[data-ann-id='${t}']`),Ge=t,Xe=e,{Popover:Ye}=n,{TextField:Qe}=n,{styled:Je}=o,{color:Ze}=r,tn=Je(Ye)(({annotationType:t})=>({"& .MuiPaper-root":{overflowX:"unset",overflowY:"unset",marginLeft:"16px","&::before":{position:"absolute",right:"100%",top:"13px",border:"solid transparent",content:'""',height:0,width:0,pointerEvents:"none",borderWidth:"7px",borderRightColor:Ze.border()},..."negative"===t&&{"&::before":{borderRightColor:"rgb(255, 204, 238) !important"}},..."positive"===t&&{"&::before":{borderRightColor:"rgb(153, 255, 153) !important"}}}})),en=Je("div")(({annotationType:t})=>({width:"200px",overflow:"hidden",borderRadius:"4px",backgroundColor:Ze.white(),border:`4px solid ${Ze.border()}`,..."negative"===t&&{borderColor:"rgb(255, 204, 238) !important"},..."positive"===t&&{borderColor:"rgb(153, 255, 153) !important"}})),nn=Je("div")(()=>({display:"flex",flexWrap:"wrap",borderTop:`2px solid ${Ze.border()}`})),on=Je("div")(({variant:t,annotationType:e})=>({flexGrow:1,width:"28%",textAlign:"center",padding:"4px",cursor:"pointer","&:not(:nth-child(3n))":{borderRight:`1px solid ${Ze.border()}`},"&:hover":{backgroundColor:Ze.backgroundDark()},..."positive"===t&&{backgroundColor:"rgb(153, 255, 153) !important","&:hover":{filter:"brightness(85%)"}},..."negative"===t&&{backgroundColor:"rgb(255, 204, 238) !important","&:hover":{filter:"brightness(85%)"}},..."typeChange"===t&&"negative"===e&&{"&:hover":{backgroundColor:"rgb(153, 255, 153) !important"}},..."typeChange"===t&&"positive"===e&&{"&:hover":{backgroundColor:"rgb(255, 204, 238) !important"}}}));class rn extends Ge.Component{static __initStatic(){this.propTypes={anchorEl:Xe.object,open:Xe.bool,offset:Xe.number,value:Xe.string,type:Xe.string,onClose:Xe.func,onDelete:Xe.func,onSave:Xe.func,onTypeChange:Xe.func}}constructor(t){super(t),rn.prototype.__init.call(this),rn.prototype.__init2.call(this),rn.prototype.__init3.call(this),this.state={value:t.value}}UNSAFE_componentWillReceiveProps(t){const{value:e}=t,{value:n}=this.props;e!==n&&this.setState({value:e})}__init(){this.onValueChange=t=>this.setState({value:t.target.value})}__init2(){this.handleSave=()=>{const{value:t,onSave:e,onClose:n,onDelete:o}=this.props,{value:r}=this.state;""===r&&o(),t!==r&&e(t,r),this.setState({value:""}),n()}}__init3(){this.handleTypeChange=()=>{const{onTypeChange:t,onDelete:e}=this.props,{value:n}=this.state;""===n?e():t(n),this.setState({value:""})}}render(){const{anchorEl:t,offset:e,onDelete:n,open:o,type:r}=this.props,{value:i}=this.state;return Ge.createElement(tn,{anchorEl:t,elevation:2,open:o,onClose:this.handleSave,annotationType:r,style:{marginTop:`${e}px`,transition:"margin-top 2s ease-out"},transitionDuration:{enter:225,exit:195},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}},Ge.createElement(en,{annotationType:r},Ge.createElement(Qe,{id:"annotation-editor",style:{padding:"2px 5px",width:"95%"},autoFocus:!0,multiline:!0,rows:1,maxRows:4,value:i,onChange:this.onValueChange,InputProps:{disableUnderline:!0}}),Ge.createElement(nn,null,Ge.createElement(on,{onClick:n},"Delete"),Ge.createElement(on,{variant:"typeChange",annotationType:r,onClick:this.handleTypeChange},"negative"===r?"Green":"Pink"),Ge.createElement(on,{onClick:this.handleSave},"Save"))))}}rn.__initStatic();const an=t,sn=e,{styled:ln}=o,{Popover:cn}=n,{color:dn}=r,pn=ln(cn)({"& .MuiPaper-root":{overflowX:"unset",overflowY:"unset",marginTop:"-16px","&::after":{position:"absolute",left:"calc(50% - 7px)",border:"solid transparent",content:'""',height:0,width:0,pointerEvents:"none",borderWidth:"7px",borderTopColor:dn.border()}}}),un=ln("div")(()=>({width:"300px",overflow:"hidden",borderRadius:"4px",backgroundColor:dn.white(),border:`2px solid ${dn.border()}`})),hn=ln("div")({display:"flex",flexWrap:"wrap"}),fn=ln("div")(()=>({display:"flex",flexWrap:"wrap",borderTop:`2px solid ${dn.border()}`})),bn=ln("div")(({variant:t})=>({width:"22%",textAlign:"center",padding:"4px",cursor:"pointer",borderBottom:`1px solid ${dn.border()}`,"&:not(:nth-child(4n))":{borderRight:`1px solid ${dn.border()}`},"&:nth-child(4n)":{flexGrow:1},"&:hover":{backgroundColor:dn.backgroundDark()},..."positive"===t&&{backgroundColor:"rgb(153, 255, 153) !important","&:hover":{filter:"brightness(85%)"}},..."negative"===t&&{backgroundColor:"rgb(255, 204, 238) !important","&:hover":{filter:"brightness(85%)"}}}));class yn extends an.Component{static __initStatic(){this.propTypes={anchorEl:sn.object,open:sn.bool,annotations:sn.array,isNewAnnotation:sn.bool,onClose:sn.func,onDelete:sn.func,onEdit:sn.func,onWrite:sn.func,onAnnotate:sn.func}}render(){const{anchorEl:t,annotations:e,isNewAnnotation:n,onAnnotate:o,onClose:r,onEdit:i,onDelete:a,onWrite:s,open:l}=this.props;return an.createElement(pn,{anchorEl:t,open:l,onClose:r,elevation:5,transitionDuration:{enter:225,exit:195},anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}},an.createElement(un,null,an.createElement(hn,null,e.map((t,e)=>an.createElement(bn,{key:`annotation-${e}`,variant:t.type,onClick:()=>o(t)},t.label))),an.createElement(fn,null,an.createElement(bn,{onClick:r},"Cancel"),an.createElement(bn,{style:{pointerEvents:"none"}}),n?an.createElement(an.Fragment,null,an.createElement(bn,{variant:"positive",onClick:()=>s("positive")},"Write"),an.createElement(bn,{variant:"negative",onClick:()=>s("negative")},"Write")):an.createElement(an.Fragment,null,an.createElement(bn,{onClick:a},"Delete"),an.createElement(bn,{onClick:i},"Edit")))))}}yn.__initStatic();const gn=t,{styled:mn}=o,vn=e,_n=l,{InputContainer:xn}=c,Cn=mn("div")({padding:"10px 120px 10px 16px",backgroundColor:"rgba(0, 0, 0, 0.06)",border:"1px solid #ccc",borderRadius:"4px",overflowY:"scroll",lineHeight:"36px",whiteSpace:"pre-wrap",overflowWrap:"break-word","& p":{margin:0},"& span[data-latex]":{userSelect:"none","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none"}}),jn=mn("div")({width:"230px"}),wn=mn("div")({position:"relative",overflowX:"hidden",display:"flex"}),En=mn(xn)(({theme:t})=>({paddingTop:t.spacing(2),marginBottom:t.spacing(2),marginTop:t.spacing(2),width:"100%"}));if(!document.getElementById("annotation-editor-styles")){const t=document.createElement("style");t.id="annotation-editor-styles",t.textContent='\n .sideAnnotation:before {\n position: absolute;\n right: var(--before-right, 100%);\n top: var(--before-top, 5px);\n border: solid transparent;\n content: "";\n height: 0;\n width: 0;\n pointer-events: none;\n border-width: var(--before-border-width, 7px);\n border-right-color: var(--before-border-color, rgb(153, 255, 153));\n }\n',document.head.appendChild(t)}class An extends gn.Component{static __initStatic(){this.propTypes={text:vn.string,comment:vn.string,annotations:vn.array,predefinedAnnotations:vn.array,onChange:vn.func.isRequired,onCommentChange:vn.func.isRequired,width:vn.number,height:vn.number,maxHeight:vn.string,disabled:vn.bool,disabledMath:vn.bool,customKeys:vn.array,keypadMode:vn.string}}constructor(t){super(t),An.prototype.__init.call(this),An.prototype.__init2.call(this),An.prototype.__init3.call(this),An.prototype.__init4.call(this),An.prototype.__init5.call(this),An.prototype.__init6.call(this),An.prototype.__init7.call(this),An.prototype.__init8.call(this),An.prototype.__init9.call(this),An.prototype.__init10.call(this),An.prototype.__init11.call(this),An.prototype.__init12.call(this),An.prototype.__init13.call(this),An.prototype.__init14.call(this),An.prototype.__init15.call(this),this.state={anchorEl:null,openedMenu:!1,openedEditor:!1,selectedElems:[],labelElem:null,selectionDetails:null,annotation:null,annotationIndex:null}}componentDidMount(){const{annotations:t,text:e}=this.props;e&&t.forEach(t=>{const[e,n]=((t,e,n)=>{const o=$e(n,e),r=[];let i=0;return o.forEach(n=>{const o=i+n.textContent.length;[t,e].forEach(t=>{i<=t&&t<o&&r.push({node:n,offset:t-i})}),i=o}),r})(t.start,t.end,this.textRef);if(e&&n){const o=document.createRange();o.setStart(e.node,e.offset),o.setEnd(n.node,n.offset);const r=Fe(o);this.createDOMAnnotation(r,t)}}),this.textRef&&(this.adjustAnnotationsPosition(),this.textRef.addEventListener("scroll",this.adjustAnnotationsPosition))}__init(){this.adjustAnnotationsPosition=()=>{if(this.textRef&&this.labelsRef){const t=this.textRef.offsetLeft+this.textRef.offsetWidth+8;Array.from(this.labelsRef.children).forEach(e=>{const n=Ve(e.dataset.annId),o=(n[0].offsetTop?n[0].offsetTop:n[0].offsetParent.offsetTop)-this.textRef.scrollTop-6;e.style.top=`${o}px`,e.style.left=`${t}px`})}}}__init2(){this.handleClick=t=>{const{annotations:e}=this.props,{selectionDetails:n}=this.state;if(n)return;const{id:o,annId:r}=t.target.dataset,i=o||r,a=Ve(i),s=Ke(i),l=e.findIndex(t=>t.id===i),c=s.hasAttribute("data-freeform");c&&(s.style.zIndex="10"),this.setState({anchorEl:a[0],openedMenu:!!o||!!r&&!c,openedEditor:!!r&&c,selectedElems:a,labelElem:s,annotationIndex:l,annotation:e[l],selectionDetails:null})}}__init3(){this.handleHover=t=>{const{id:e,annId:n}=t.target.dataset,o=e||n,r=Ve(o),i=Ke(o),a=i.hasAttribute("data-freeform");r.forEach(t=>{t.style.zIndex="20",t.classList.contains("positive")?t.style.backgroundColor="rgb(51, 255, 51, 0.7)":t.classList.contains("negative")&&(t.style.backgroundColor="rgba(255, 102, 204, 0.55)")}),a?(i.style.zIndex="20",i.classList.contains("positive")?(i.style.backgroundColor="rgb(128, 255, 128)",i.style.setProperty("--before-border-color","rgb(153, 255, 153)")):i.classList.contains("negative")&&(i.style.backgroundColor="rgb(255, 179, 230)",i.style.setProperty("--before-border-color","rgb(255, 179, 230)"))):(i.style.zIndex="20",i.classList.contains("positive")?i.style.color="rgb(0, 77, 0)":i.classList.contains("negative")&&(i.style.color="rgb(153, 0, 102)"))}}__init4(){this.handleCancelHover=t=>{const{id:e,annId:n}=t.target.dataset,o=e||n,r=Ve(o),i=Ke(o),a=i.hasAttribute("data-freeform");r.forEach(t=>{t.style.zIndex="",t.classList.contains("positive")?t.style.backgroundColor="rgb(51, 255, 51, 0.5)":t.classList.contains("negative")&&(t.style.backgroundColor="rgba(255, 102, 204, 0.4)")}),a?(i.style.zIndex="",i.classList.contains("positive")?(i.style.backgroundColor="rgb(153, 255, 153)",i.style.removeProperty("--before-border-color")):i.classList.contains("negative")&&(i.style.backgroundColor="rgb(255, 204, 238)",i.style.removeProperty("--before-border-color"))):(i.style.zIndex="",i.classList.contains("positive")?i.style.color="rgb(0, 128, 0)":i.classList.contains("negative")&&(i.style.color="rgb(204, 0, 136)"))}}__init5(){this.handleClose=t=>{const{selectedElems:e,labelElem:n}=this.state;e.length&&!e[0].hasAttribute("data-id")&&Be(e,this.textRef),n&&(n.style.zIndex=""),this.setState({anchorEl:null,openedMenu:!1,openedEditor:!1,selectedElems:[],labelElem:null,selectionDetails:null,annotationIndex:null,annotation:null}),He()}}__init6(){this.handleSelection=t=>{const e=window.getSelection();if(t.detail>2)He();else if(e&&e.rangeCount>0){const t=e.getRangeAt(0),n=t.toString(),o=this.textRef.contains(t.commonAncestorContainer);if(!e.isCollapsed&&""!==n&&o){const e=((t,e)=>{const n=document.createRange();n.setStart(e,0),n.setEnd(t.startContainer,t.startOffset);const[,o]=We(n),[,r]=We(t),i=o.length;return{quote:r,start:i,end:i+r.length}})(t,this.textRef),n=Fe(t);this.setState({anchorEl:n[0],openedMenu:!0,selectedElems:n,selectionDetails:e})}}}}__init7(){this.deleteAnnotation=()=>{const{annotations:t,onChange:e}=this.props,{selectedElems:n,labelElem:o,annotationIndex:r,annotation:i}=this.state;(qe(i.label)?this.labelsRef:n[0]).removeChild(o),Be(n,this.textRef),t.splice(r,1),e(t),this.handleClose()}}__init8(){this.createDOMAnnotation=(t,e)=>{const{disabled:n}=this.props,{id:o,label:r,type:i}=e;(t||[]).forEach(t=>{t.dataset.id=o,t.className=`annotation ${i}`,t.style.position="relative",t.style.cursor="pointer","positive"===i?t.style.backgroundColor="rgb(51, 255, 51, 0.5)":"negative"===i&&(t.style.backgroundColor="rgba(255, 102, 204, 0.4)"),t.onclick=!n&&this.handleClick,t.onmouseover=this.handleHover,t.onmouseout=this.handleCancelHover});const a=t&&t[0]||{},s=document.createElement("SPAN");if(s.dataset.annId=o,s.innerHTML=r,s.onclick=!n&&this.handleClick,s.onmouseover=this.handleHover,s.onmouseout=this.handleCancelHover,qe(r)){const t=(a.offsetTop?a.offsetTop:a.offsetParent.offsetTop)-this.textRef.scrollTop,e=this.textRef.offsetLeft+this.textRef.offsetWidth+8;s.dataset.freeform=!0,s.className=`sideAnnotation ${i}`,s.style.position="absolute",s.style.padding="4px",s.style.borderRadius="4px",s.style.marginLeft="8px",s.style.width="180px",s.style.whiteSpace="pre-wrap",s.style.wordBreak="break-word",s.style.border="2px solid #ffffff",s.style.fontSize="14px",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.top=`${t}px`,s.style.left=`${e}px`,"negative"===i?s.style.backgroundColor="rgb(255, 204, 238)":"positive"===i&&(s.style.backgroundColor="rgb(153, 255, 153)"),s.style.setProperty("--before-border-width","7px"),s.style.setProperty("--before-top","5px"),s.style.setProperty("--before-right","100%"),"negative"===i?s.style.setProperty("--before-border-color","rgb(255, 204, 238)"):"positive"===i&&s.style.setProperty("--before-border-color","rgb(153, 255, 153)"),this.labelsRef.appendChild(s)}else s.className=`annotationLabel ${i}`,s.style.backgroundColor="rgb(242, 242, 242)",s.style.padding="2px",s.style.position="absolute",s.style.userSelect="none",s.style.whiteSpace="nowrap",s.style.top="-10px",s.style.left="-2px",s.style.fontSize="12px",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.lineHeight="6px",s.style.webkitUserSelect="none",s.style.mozUserSelect="none",s.style.msUserSelect="none","positive"===i?s.style.color="rgb(0, 128, 0)":"negative"===i&&(s.style.color="rgb(204, 0, 136)"),a.appendChild(s)}}__init9(){this.createNewAnnotation=(t,e)=>{const{selectedElems:n,selectionDetails:o}=this.state,r={id:[o.start,o.end,(new Date).getTime()].join("-"),label:t,type:e,...o};return this.createDOMAnnotation(n,r),r}}__init10(){this.handleMenuClick=t=>{const{annotations:e,onChange:n}=this.props,{annotation:o,annotationIndex:r}=this.state,{type:i,text:a}=t;if(o){const t={...o,label:a,type:i},{type:n,label:s}=o;this.updateLabel(s,t,i!==n&&n),e.splice(r,1,t)}else{const t=this.createNewAnnotation(a,i);e.push(t)}n(e),this.handleClose()}}__init11(){this.editAnnotation=()=>{this.setState({openedMenu:!1,openedEditor:!0})}}__init12(){this.addAnnotation=t=>{const{annotations:e,onChange:n}=this.props,o=this.createNewAnnotation("",t),r=Ke(o.id);e.push(o),this.setState({openedMenu:!1,openedEditor:!0,annotationIndex:e.length-1,annotation:o,labelElem:r}),n(e)}}__init13(){this.updateLabel=(t,e,n)=>{const{selectedElems:o,labelElem:r}=this.state,{label:i,type:a}=e;qe(i)&&qe(t)||!qe(i)&&!qe(t)?(r.innerHTML=i,n&&(r.classList.remove(n),r.classList.add(a),o.forEach(t=>{t.classList.remove(n),t.classList.add(a)}))):qe(i)&&!qe(t)?(o[0].removeChild(r),this.createDOMAnnotation(o,e)):!qe(i)&&qe(t)&&(this.labelsRef.removeChild(r),this.createDOMAnnotation(o,e))}}__init14(){this.changeAnnotationType=t=>{const{annotations:e,onChange:n}=this.props,{annotationIndex:o,selectedElems:r}=this.state,{type:i,label:a}=e[o],s="positive"===i?"negative":"positive",l={...e[o],type:s,label:t};r.forEach(t=>{t.classList.remove(i),t.classList.add(s)}),this.updateLabel(a,l,i),e.splice(o,1,l),n(e),this.handleClose()}}__init15(){this.updateAnnotation=(t,e)=>{const{annotations:n,onChange:o}=this.props,{annotationIndex:r}=this.state,i={...n[r],label:e};this.updateLabel(t,i),n.splice(r,1,i),o(n)}}componentWillUnmount(){this.textRef.removeEventListener("scroll",this.adjustAnnotationsPosition)}render(){const{comment:t,customKeys:e,disabled:n,disabledMath:o,keypadMode:r,height:i,width:a,maxHeight:s,onCommentChange:l,predefinedAnnotations:c,text:d}=this.props,{anchorEl:p,annotation:u,openedMenu:h,openedEditor:f,selectionDetails:b}=this.state,y=p&&(p.offsetTop?p.offsetTop:p.offsetParent.offsetTop),g=this.textRef&&y?y-this.textRef.scrollTop-8:0;return gn.createElement("div",null,gn.createElement(wn,null,gn.createElement(Cn,{style:{width:a-34,minHeight:i,maxHeight:s},ref:t=>this.textRef=t,onMouseDown:n?()=>{}:He,onMouseUp:n?()=>{}:this.handleSelection,dangerouslySetInnerHTML:{__html:d}}),gn.createElement(jn,{ref:t=>this.labelsRef=t})),gn.createElement(En,{label:"Comment"},gn.createElement(_n,{className:"prompt",markup:t||"",onChange:l,width:a&&(a+104).toString(),disabled:n,pluginProps:{math:{disabled:o,customKeys:e,keypadMode:r,controlledKeypadMode:!1},video:{disabled:!0},audio:{disabled:!0},textAlign:{disabled:!0},h3:{disabled:!0}}})),gn.createElement(yn,{anchorEl:p,open:h&&!n,annotations:c,isNewAnnotation:!!b,onClose:this.handleClose,onDelete:this.deleteAnnotation,onEdit:this.editAnnotation,onWrite:this.addAnnotation,onAnnotate:this.handleMenuClick}),gn.createElement(rn,{anchorEl:this.textRef,open:f&&!n,offset:g,value:u&&u.label||"",type:u&&u.type,onClose:this.handleClose,onDelete:this.deleteAnnotation,onSave:this.updateAnnotation,onTypeChange:this.changeAnnotationType}))}}An.__initStatic();const Sn=t,kn=e,On=i,{Typography:Tn}=n,{styled:Rn}=o,{color:Pn}=r,{Feedback:In}=r,{Collapsible:Mn}=r,{PreviewPrompt:Dn}=r,{UiLayout:zn}=r,Ln=l,Nn=On("@pie-ui:extended-text-entry"),$n=Rn(zn)({backgroundColor:Pn.background(),color:Pn.text()}),Wn=Rn(Tn)(({theme:t})=>({width:"100%",color:Pn.text(),marginBottom:t.spacing(2),fontSize:"inherit",display:"block"})),Un=Rn("div")(({theme:t})=>({marginBottom:t.spacing(2)})),Fn=Rn(Ln)(({theme:t})=>({marginBottom:t.spacing(2),borderRadius:"4px"})),Bn=Rn("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"});class Hn extends Sn.Component{constructor(...t){super(...t),Hn.prototype.__init.call(this),Hn.prototype.__init2.call(this)}static __initStatic(){this.propTypes={onValueChange:kn.func.isRequired,onAnnotationsChange:kn.func.isRequired,onCommentChange:kn.func.isRequired,model:kn.object,session:kn.shape({value:kn.string,annotations:kn.array,comment:kn.string}).isRequired}}__init(){this.changeSessionValue=Ne(this.props.onValueChange,1500)}__init2(){this.changeSessionComment=Ne(this.props.onCommentChange,1500)}render(){const{model:t,session:e,onAnnotationsChange:n}=this.props,{animationsDisabled:o,annotatorMode:r,customKeys:i,dimensions:a,disabled:s,disabledAnnotator:l,equationEditor:c,extraCSSRules:d,feedback:p,mathInput:u,playersToolbarPosition:h,predefinedAnnotations:f,prompt:b,spanishInput:y,specialInput:g,spellCheckEnabled:m,teacherInstructions:v}=t,{annotations:_,comment:x,value:C}=e,{width:j,height:w}=a||{},E="40vh",A={position:"top"===h?"top":"bottom"};Nn("[render] disabled? ",s);const S=Sn.createElement(Dn,{defaultClassName:"teacher-instructions",prompt:v}),k=[];return y&&k.push({language:"spanish"}),g&&k.push({language:"special"}),Sn.createElement($n,{extraCSSRules:d,ref:t=>{this.containerRef=t}},Sn.createElement(Bn,null,"Constructed Response Question"),v&&Sn.createElement(Un,null,o?S:Sn.createElement(Mn,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},S)),b&&Sn.createElement(Wn,{component:"span"},Sn.createElement(Dn,{defaultClassName:"prompt",prompt:t.prompt})),r?Sn.createElement(An,{text:C||"",annotations:_||[],comment:x||"",predefinedAnnotations:f||[],onChange:n,onCommentChange:this.changeSessionComment,width:j,height:w,maxHeight:E,disabled:l,disabledMath:!u,customKeys:i,keypadMode:c}):Sn.createElement(Fn,{className:"response-area-editor",onChange:this.changeSessionValue,markup:C||"",maxWidth:j&&j.toString(),minWidth:"100px",minHeight:w&&w.toString(),maxHeight:E,disabled:s,highlightShape:!0,toolbarOpts:A,spellCheck:m,charactersLimit:5e4,autoWidthToolbar:!0,pluginProps:{math:{disabled:!u,customKeys:this.props.model.customKeys,keypadMode:this.props.model.equationEditor,controlledKeypadMode:!1},video:{disabled:!0},audio:{disabled:!0},table:{disabled:!0},textAlign:{disabled:!0},h3:{disabled:!0},separateParagraphs:{disabled:!1},ul_list:{disabled:!0},ol_list:{disabled:!0}},languageCharactersProps:k}),p&&Sn.createElement(In,{correctness:"correct",feedback:p}))}}Hn.__initStatic();const qn=t,{createRoot:Vn}=a,Kn=i,{renderMath:Gn}=s,Xn=Kn("pie-element:extended-text-entry:print"),Yn=(t,e)=>{const n="instructor"===e.role,o=Me(t,5);o.prompt=!1!==o.promptEnabled?o.prompt:void 0,o.teacherInstructions=n&&!1!==o.teacherInstructionsEnabled?o.teacherInstructions:void 0,o.showTeacherInstructions=n,o.mode=n?"evaluate":o.mode;return o.dimensions={height:100,width:500,...o.dimensions},o.disabled=!0,o.feedback=void 0,o.animationsDisabled=!0,o};class Qn extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=Ne(()=>{if(this._model&&this._session&&this._options){const t=Yn(this._model,this._options),e=qn.createElement(Hn,{model:t,session:{},onChange:()=>{},onValueChange:()=>{},onAnnotationsChange:()=>{},onCommentChange:()=>{}});this._root||(this._root=Vn(this)),this._root.render(e),queueMicrotask(()=>{Xn("render complete - render math"),Gn(this)})}else Xn("skip")},50,{leading:!1,trailing:!0})}set options(t){this._options=t,this._rerender()}set model(t){this._model=t,this._rerender()}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Qn as default};