@pie-element/math-templated 6.2.0-next.5 → 6.2.0-next.7

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.
@@ -0,0 +1 @@
1
+ import{_dll_react_dom as e,_dll_react as t,_dll_prop_types as n,_dll_mui__material_styles as r,_dll_debug as o,_dll_mui__material as i,_dll_pie_lib__render_ui as a,_dll_classnames as s,_dll_mui__icons_material as l,_dll_pie_lib__correct_answer_toggle as c}from"../../../@pie-lib/shared-module@^4.1.0/module/index.js";import{_dll_pie_lib__math_rendering as d}from"../../../@pie-lib/math-rendering-module@^4.1.0/module/index.js";import{_dll_pie_framework__mathquill as u}from"../../../@pie-lib/math-edit-module@^3.2.0/module/index.js";import{_dll_pie_lib__drag as p}from"../../../@pie-lib/drag-module@^3.2.0/module/index.js";import{grey as h}from"@mui/material/colors";var m,f=e;m=f.createRoot,f.hydrateRoot;var g="object"==typeof global&&global&&global.Object===Object&&global,v="object"==typeof self&&self&&self.Object===Object&&self,b=g||v||Function("return this")(),y=b.Symbol,x=Object.prototype,w=x.hasOwnProperty,_=x.toString,k=y?y.toStringTag:void 0;var C=Object.prototype.toString;var E=y?y.toStringTag:void 0;function S(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":E&&E in Object(e)?function(e){var t=w.call(e,k),n=e[k];try{e[k]=void 0;var r=!0}catch(e){}var o=_.call(e);return r&&(t?e[k]=n:delete e[k]),o}(e):function(e){return C.call(e)}(e)}function A(e){return null!=e&&"object"==typeof e}function R(e){return"symbol"==typeof e||A(e)&&"[object Symbol]"==S(e)}function O(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var D=Array.isArray,j=y?y.prototype:void 0,T=j?j.toString:void 0;function M(e){if("string"==typeof e)return e;if(D(e))return O(e,M)+"";if(R(e))return T?T.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var L=/\s/;var q=/^\s+/;function N(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&L.test(e.charAt(t)););return t}(e)+1).replace(q,""):e}function I(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var F=/^[-+]0x[0-9a-f]+$/i,P=/^0b[01]+$/i,B=/^0o[0-7]+$/i,$=parseInt;function z(e){if("number"==typeof e)return e;if(R(e))return NaN;if(I(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=I(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=N(e);var n=P.test(e);return n||B.test(e)?$(e.slice(2),n?2:8):F.test(e)?NaN:+e}var W=1/0;function K(e){var t=function(e){return e?(e=z(e))===W||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),n=t%1;return t==t?n?t-n:t:0}function H(e){return e}function U(e){if(!I(e))return!1;var t=S(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var X,V=b["__core-js_shared__"],Y=(X=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+X:"";var J=Function.prototype.toString;function Q(e){if(null!=e){try{return J.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Z=/^\[object .+?Constructor\]$/,G=Function.prototype,ee=Object.prototype,te=G.toString,ne=ee.hasOwnProperty,re=RegExp("^"+te.call(ne).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oe(e){return!(!I(e)||(t=e,Y&&Y in t))&&(U(e)?re:Z).test(Q(e));var t}function ie(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return oe(n)?n:void 0}var ae=ie(b,"WeakMap");var se=Date.now;var le,ce,de,ue=function(){try{var e=ie(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),pe=ue,he=pe?function(e,t){return pe(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:H,me=(le=he,ce=0,de=0,function(){var e=se(),t=16-(e-de);if(de=e,t>0){if(++ce>=800)return arguments[0]}else ce=0;return le.apply(void 0,arguments)}),fe=/^(?:0|[1-9]\d*)$/;function ge(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&fe.test(e))&&e>-1&&e%1==0&&e<t}function ve(e,t){return e===t||e!=e&&t!=t}var be=Math.max;function ye(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function xe(e){return null!=e&&ye(e.length)&&!U(e)}var we=Object.prototype;function _e(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||we)}function ke(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ce(e){return A(e)&&"[object Arguments]"==S(e)}var Ee=Object.prototype,Se=Ee.hasOwnProperty,Ae=Ee.propertyIsEnumerable,Re=Ce(function(){return arguments}())?Ce:function(e){return A(e)&&Se.call(e,"callee")&&!Ae.call(e,"callee")};var Oe="object"==typeof exports&&exports&&!exports.nodeType&&exports,De=Oe&&"object"==typeof module&&module&&!module.nodeType&&module,je=De&&De.exports===Oe?b.Buffer:void 0,Te=(je?je.isBuffer:void 0)||function(){return!1},Me={};Me["[object Float32Array]"]=Me["[object Float64Array]"]=Me["[object Int8Array]"]=Me["[object Int16Array]"]=Me["[object Int32Array]"]=Me["[object Uint8Array]"]=Me["[object Uint8ClampedArray]"]=Me["[object Uint16Array]"]=Me["[object Uint32Array]"]=!0,Me["[object Arguments]"]=Me["[object Array]"]=Me["[object ArrayBuffer]"]=Me["[object Boolean]"]=Me["[object DataView]"]=Me["[object Date]"]=Me["[object Error]"]=Me["[object Function]"]=Me["[object Map]"]=Me["[object Number]"]=Me["[object Object]"]=Me["[object RegExp]"]=Me["[object Set]"]=Me["[object String]"]=Me["[object WeakMap]"]=!1;var Le="object"==typeof exports&&exports&&!exports.nodeType&&exports,qe=Le&&"object"==typeof module&&module&&!module.nodeType&&module,Ne=qe&&qe.exports===Le&&g.process,Ie=function(){try{var e=qe&&qe.require&&qe.require("util").types;return e||Ne&&Ne.binding&&Ne.binding("util")}catch(e){}}(),Fe=Ie&&Ie.isTypedArray,Pe=Fe?function(e){return function(t){return e(t)}}(Fe):function(e){return A(e)&&ye(e.length)&&!!Me[S(e)]},Be=Pe,$e=Object.prototype.hasOwnProperty;var ze=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),We=ze,Ke=Object.prototype.hasOwnProperty;function He(e){if(!_e(e))return We(e);var t=[];for(var n in Object(e))Ke.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Ue(e){return xe(e)?function(e,t){var n=D(e),r=!n&&Re(e),o=!n&&!r&&Te(e),i=!n&&!r&&!o&&Be(e),a=n||r||o||i,s=a?ke(e.length,String):[],l=s.length;for(var c in e)!t&&!$e.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ge(c,l))||s.push(c);return s}(e):He(e)}var Xe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ve=/^\w*$/;function Ye(e,t){if(D(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!R(e))||(Ve.test(e)||!Xe.test(e)||null!=t&&e in Object(t))}var Je=ie(Object,"create");var Qe=Object.prototype.hasOwnProperty;var Ze=Object.prototype.hasOwnProperty;function Ge(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function et(e,t){for(var n=e.length;n--;)if(ve(e[n][0],t))return n;return-1}Ge.prototype.clear=function(){this.__data__=Je?Je(null):{},this.size=0},Ge.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ge.prototype.get=function(e){var t=this.__data__;if(Je){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Qe.call(t,e)?t[e]:void 0},Ge.prototype.has=function(e){var t=this.__data__;return Je?void 0!==t[e]:Ze.call(t,e)},Ge.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Je&&void 0===t?"__lodash_hash_undefined__":t,this};var tt=Array.prototype.splice;function nt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nt.prototype.clear=function(){this.__data__=[],this.size=0},nt.prototype.delete=function(e){var t=this.__data__,n=et(t,e);return!(n<0)&&(n==t.length-1?t.pop():tt.call(t,n,1),--this.size,!0)},nt.prototype.get=function(e){var t=this.__data__,n=et(t,e);return n<0?void 0:t[n][1]},nt.prototype.has=function(e){return et(this.__data__,e)>-1},nt.prototype.set=function(e,t){var n=this.__data__,r=et(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var rt=ie(b,"Map");function ot(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function it(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}it.prototype.clear=function(){this.size=0,this.__data__={hash:new Ge,map:new(rt||nt),string:new Ge}},it.prototype.delete=function(e){var t=ot(this,e).delete(e);return this.size-=t?1:0,t},it.prototype.get=function(e){return ot(this,e).get(e)},it.prototype.has=function(e){return ot(this,e).has(e)},it.prototype.set=function(e,t){var n=ot(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function at(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(at.Cache||it),n}at.Cache=it;var st=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,lt=/\\(\\)?/g,ct=function(e){var t=at(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(st,function(e,n,r,o){t.push(r?o.replace(lt,"$1"):n||e)}),t}),dt=ct;function ut(e,t){return D(e)?e:Ye(e,t)?[e]:dt(function(e){return null==e?"":M(e)}(e))}function pt(e){if("string"==typeof e||R(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ht(e,t){for(var n=0,r=(t=ut(t,e)).length;null!=e&&n<r;)e=e[pt(t[n++])];return n&&n==r?e:void 0}function mt(e,t,n){var r=null==e?void 0:ht(e,t);return void 0===r?n:r}function ft(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var gt=y?y.isConcatSpreadable:void 0;function vt(e){return D(e)||Re(e)||!!(gt&&e&&e[gt])}function bt(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=vt),o||(o=[]);++i<a;){var s=e[i];t>0&&n(s)?t>1?bt(s,t-1,n,r,o):ft(o,s):r||(o[o.length]=s)}return o}function yt(e){return(null==e?0:e.length)?bt(e,1):[]}function xt(e){var t=this.__data__=new nt(e);this.size=t.size}function wt(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}xt.prototype.clear=function(){this.__data__=new nt,this.size=0},xt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},xt.prototype.get=function(e){return this.__data__.get(e)},xt.prototype.has=function(e){return this.__data__.has(e)},xt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof nt){var r=n.__data__;if(!rt||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new it(r)}return n.set(e,t),this.size=n.size,this};var _t=Object.prototype.propertyIsEnumerable,kt=Object.getOwnPropertySymbols,Ct=kt?function(e){return null==e?[]:(e=Object(e),wt(kt(e),function(t){return _t.call(e,t)}))}:function(){return[]};function Et(e){return function(e,t,n){var r=t(e);return D(e)?r:ft(r,n(e))}(e,Ue,Ct)}var St=ie(b,"DataView"),At=ie(b,"Promise"),Rt=ie(b,"Set"),Ot="[object Map]",Dt="[object Promise]",jt="[object Set]",Tt="[object WeakMap]",Mt="[object DataView]",Lt=Q(St),qt=Q(rt),Nt=Q(At),It=Q(Rt),Ft=Q(ae),Pt=S;(St&&Pt(new St(new ArrayBuffer(1)))!=Mt||rt&&Pt(new rt)!=Ot||At&&Pt(At.resolve())!=Dt||Rt&&Pt(new Rt)!=jt||ae&&Pt(new ae)!=Tt)&&(Pt=function(e){var t=S(e),n="[object Object]"==t?e.constructor:void 0,r=n?Q(n):"";if(r)switch(r){case Lt:return Mt;case qt:return Ot;case Nt:return Dt;case It:return jt;case Ft:return Tt}return t});var Bt=Pt,$t=b.Uint8Array;function zt(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new it;++t<n;)this.add(e[t])}function Wt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Kt(e,t){return e.has(t)}zt.prototype.add=zt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},zt.prototype.has=function(e){return this.__data__.has(e)};function Ht(e,t,n,r,o,i){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=i.get(e),d=i.get(t);if(c&&d)return c==t&&d==e;var u=-1,p=!0,h=2&n?new zt:void 0;for(i.set(e,t),i.set(t,e);++u<s;){var m=e[u],f=t[u];if(r)var g=a?r(f,m,u,t,e,i):r(m,f,u,e,t,i);if(void 0!==g){if(g)continue;p=!1;break}if(h){if(!Wt(t,function(e,t){if(!Kt(h,t)&&(m===e||o(m,e,n,r,i)))return h.push(t)})){p=!1;break}}else if(m!==f&&!o(m,f,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function Ut(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Xt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Vt=y?y.prototype:void 0,Yt=Vt?Vt.valueOf:void 0;var Jt=Object.prototype.hasOwnProperty;var Qt="[object Arguments]",Zt="[object Array]",Gt="[object Object]",en=Object.prototype.hasOwnProperty;function tn(e,t,n,r,o,i){var a=D(e),s=D(t),l=a?Zt:Bt(e),c=s?Zt:Bt(t),d=(l=l==Qt?Gt:l)==Gt,u=(c=c==Qt?Gt:c)==Gt,p=l==c;if(p&&Te(e)){if(!Te(t))return!1;a=!0,d=!1}if(p&&!d)return i||(i=new xt),a||Be(e)?Ht(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){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 $t(e),new $t(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ve(+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 s=Ut;case"[object Set]":var l=1&r;if(s||(s=Xt),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var d=Ht(s(e),s(t),r,o,i,a);return a.delete(e),d;case"[object Symbol]":if(Yt)return Yt.call(e)==Yt.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var h=d&&en.call(e,"__wrapped__"),m=u&&en.call(t,"__wrapped__");if(h||m){var f=h?e.value():e,g=m?t.value():t;return i||(i=new xt),o(f,g,n,r,i)}}return!!p&&(i||(i=new xt),function(e,t,n,r,o,i){var a=1&n,s=Et(e),l=s.length;if(l!=Et(t).length&&!a)return!1;for(var c=l;c--;){var d=s[c];if(!(a?d in t:Jt.call(t,d)))return!1}var u=i.get(e),p=i.get(t);if(u&&p)return u==t&&p==e;var h=!0;i.set(e,t),i.set(t,e);for(var m=a;++c<l;){var f=e[d=s[c]],g=t[d];if(r)var v=a?r(g,f,d,t,e,i):r(f,g,d,e,t,i);if(!(void 0===v?f===g||o(f,g,n,r,i):v)){h=!1;break}m||(m="constructor"==d)}if(h&&!m){var b=e.constructor,y=t.constructor;b==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(h=!1)}return i.delete(e),i.delete(t),h}(e,t,n,r,o,i))}function nn(e,t,n,r,o){return e===t||(null==e||null==t||!A(e)&&!A(t)?e!=e&&t!=t:tn(e,t,n,r,nn,o))}function rn(e){return e==e&&!I(e)}function on(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function an(e){var t=function(e){for(var t=Ue(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,rn(o)]}return t}(e);return 1==t.length&&t[0][2]?on(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var s=n[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var l=(s=n[o])[0],c=e[l],d=s[1];if(a&&s[2]){if(void 0===c&&!(l in e))return!1}else{var u=new xt;if(r)var p=r(c,d,l,e,t,u);if(!(void 0===p?nn(d,c,3,r,u):p))return!1}}return!0}(n,e,t)}}function sn(e,t){return null!=e&&t in Object(e)}function ln(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=ut(t,e)).length,i=!1;++r<o;){var a=pt(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&ye(o)&&ge(a,o)&&(D(e)||Re(e))}(e,t,sn)}function cn(e){return function(t){return null==t?void 0:t[e]}}function dn(e){return Ye(e)?cn(pt(e)):function(e){return function(t){return ht(t,e)}}(e)}function un(e){return"function"==typeof e?e:null==e?H:"object"==typeof e?D(e)?(t=e[0],n=e[1],Ye(t)&&rn(n)?on(pt(t),n):function(e){var r=mt(e,t);return void 0===r&&r===n?ln(e,t):nn(n,r,3)}):an(e):dn(e);var t,n}var pn,hn=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[pn?a:++r];if(!1===t(o[s],s,o))break}return e},mn=hn;function fn(e,t){return e&&mn(e,t,Ue)}var gn=function(){return b.Date.now()},vn=Math.max,bn=Math.min;function yn(e,t,n){var r,o,i,a,s,l,c=0,d=!1,u=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function m(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=i}function f(){var e=gn();if(m(e))return g(e);s=setTimeout(f,function(e){var n=t-(e-l);return u?bn(n,i-(e-c)):n}(e))}function g(e){return s=void 0,p&&r?h(e):(r=o=void 0,a)}function v(){var e=gn(),n=m(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(f,t),d?h(e):a}(l);if(u)return clearTimeout(s),s=setTimeout(f,t),h(l)}return void 0===s&&(s=setTimeout(f,t)),a}return t=z(t)||0,I(n)&&(d=!!n.leading,i=(u="maxWait"in n)?vn(z(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),v.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},v.flush=function(){return void 0===s?a:g(gn())},v}var xn=Object.prototype.hasOwnProperty;function wn(e){if(null==e)return!0;if(xe(e)&&(D(e)||"string"==typeof e||"function"==typeof e.splice||Te(e)||Be(e)||Re(e)))return!e.length;var t=Bt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(_e(e))return!He(e).length;for(var n in e)if(xn.call(e,n))return!1;return!0}function _n(e,t){return nn(e,t)}var kn=4294967295,Cn=Math.min;function En(e,t){if((e=K(e))<1||e>9007199254740991)return[];var n,r=kn,o=Cn(e,kn);e-=kn;for(var i=ke(o,t="function"==typeof(n=t)?n:H);++r<e;)t(r);return i}var Sn=Math.max;var An=function(e,t){return me(function(e,t,n){return t=be(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=be(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,s)}}(e,t,H),e+"")}(function(e){if(!e||!e.length)return[];var t=0;return e=wt(e,function(e){if(A(n=e)&&xe(n))return t=Sn(e.length,t),!0;var n}),ke(t,function(t){return O(e,cn(t))})}),Rn=An;const On=e=>({...e,category:"comparison"}),Dn=On({name:"Less than",latex:"<",command:"\\lt"}),jn=On({name:"Greater than",latex:">",command:"\\gt"}),Tn=On({name:"Less than or equal",latex:"\\le",symbol:"<=",command:"\\le",ariaLabel:"less than or equal to"}),Mn=On({name:"Greater than or equal",symbol:">=",command:"\\ge",latex:"\\ge"});var Ln=Object.freeze({__proto__:null,lessThan:Dn,greaterThan:jn,lessThanEqual:Tn,greaterThanEqual:Mn});const qn=e=>t=>({...t,category:e}),Nn=(e=[],t=[])=>{t=t.filter((e=>t=>{const n=yt(e),r=n.some(e=>e.latex===t.latex),o=n.some(e=>e.name===t.name);return!r&&!o})(e));const n=[];En(5-e.length,()=>e.push([])),En(5,()=>n.push([]));const r=((e=[])=>{const t=[];En(5,()=>t.push([]));let n=e.length,r=0,o=0;for(;o<n;)t[r++].push(e[o++]),5===r&&(r=0);return t})(t);for(let t=0;t<5;t++)n[t]=[...e[t],...r[t]];return n},In=qn("vars"),Fn=In({name:"X",latex:"x",write:"x"}),Pn=In({name:"Y",latex:"y",write:"y"}),Bn=In({name:"Theta",latex:"\\theta",write:"\\theta"});var $n=Object.freeze({__proto__:null,x:Fn,y:Pn,theta:Bn});const zn=qn("fractions"),Wn=zn({name:"blank/blank",latex:"\\frac{}{}",command:"\\frac",ariaLabel:"fraction"}),Kn=zn({latex:"\\frac{x}{ }",name:"X/blank",label:"x/[]",command:"/",ariaLabel:"x over blank fraction"}),Hn=zn({name:"X (blank/blank)",latex:"x\\frac{}{}",label:"x([]/[])",command:"\\frac",ariaLabel:"mixed number"});var Un=Object.freeze({__proto__:null,blankOverBlank:Wn,xOverBlank:Kn,xBlankBlank:Hn});const Xn=qn("exponent"),Vn=Xn({name:"Squared",latex:"x^2",write:"^2"}),Yn=Xn({name:"X to the power of n",latex:"x^{}",command:"^",ariaLabel:"exponent"}),Jn=Xn({name:"Square root",latex:"\\sqrt{}",command:"\\sqrt"}),Qn=Xn({name:"Nth root",latex:"\\sqrt[{}]{}",command:"\\nthroot"});var Zn=Object.freeze({__proto__:null,squared:Vn,xToPowerOfN:Yn,squareRoot:Jn,nthRoot:Qn});const Gn=qn("misc"),er=Gn({name:"Plus or Minus",latex:"\\pm",write:"\\pm"}),tr=Gn({name:"Absolute Value",latex:"\\abs{}",symbol:"| |",command:"|"}),nr=Gn({name:"Parenthesis",latex:"\\left(\\right)",symbol:"( )",command:"("}),rr=Gn({name:"Brackets",latex:"\\left[\\right]",symbol:"[ ]",command:"["}),or=Gn({name:"Percent",latex:"%",command:"%"}),ir=Gn({latex:"\\approx",command:"\\approx",ariaLabel:"Approximately equal to"}),ar=Gn({latex:"\\napprox",command:"\\napprox",ariaLabel:"Not pproximately equal to"}),sr=Gn({latex:"\\neq",command:"\\neq",ariaLabel:"Not equals"}),lr=Gn({latex:"\\sim",command:"\\sim",ariaLabel:"Similar"}),cr=Gn({latex:"\\nsim",command:"\\nsim",ariaLabel:"Not similar"});var dr=Object.freeze({__proto__:null,plusMinus:er,absValue:tr,parenthesis:nr,brackets:rr,percentage:or,approx:ir,nApprox:ar,notEqual:sr,similar:lr,notSimilar:cr});const ur=qn("constants"),pr=ur({name:"Pi",label:"π",latex:"\\pi",command:"\\pi",category:"constants"}),hr=ur({name:"Eulers",label:"e",latex:"e",command:"e",category:"constants"}),mr=ur({name:"Infinity",label:"\\infty",latex:"\\infty",command:"\\infty",category:"constants"}),fr=ur({name:"Half Infinity",label:"\\propto",latex:"\\propto",command:"\\propto",category:"constants"});var gr=Object.freeze({__proto__:null,pi:pr,eulers:hr,infinity:mr,halfInfinity:fr});const vr=qn("trigonometry"),br=vr({name:"sine",label:"sin",command:"\\sin",latex:"\\sin"}),yr=vr({name:"cosine",label:"cos",command:"\\cos",latex:"\\cos"}),xr=vr({name:"tanget",label:"tan",command:"\\tan",latex:"\\tan"}),wr=vr({name:"secant",label:"sec",command:"\\sec",latex:"\\sec"}),_r=vr({name:"cosecant",label:"csc",command:"\\csc",latex:"\\csc"}),kr=vr({name:"cotangent",label:"cot",command:"\\cot",latex:"\\cot"});var Cr=Object.freeze({__proto__:null,sin:br,cos:yr,tan:xr,sec:wr,csc:_r,cot:kr});const Er=e=>({...e,category:"geometry"}),Sr=Er({name:"Line",latex:"\\overline{}",command:"\\overline"}),Ar=Er({name:"Ray",latex:"\\overrightarrow{}",command:"\\overrightarrow"}),Rr=Er({name:"Segment",latex:"\\overleftrightarrow{\\overline{}}",symbol:"AB",command:"\\overleftrightarrow"}),Or=Er({name:"Segment",latex:"\\overleftrightarrow{AB}",write:"\\overleftrightarrow{AB}",label:"AB"}),Dr=Er({name:"Parallel",latex:"\\parallel",command:"\\parallel"}),jr=Er({name:"Not Parallel",latex:"\\nparallel",command:"\\nparallel"}),Tr=Er({name:"Perpendicular",latex:"\\perp",command:"\\perpendicular"}),Mr=Er({name:"Angle",latex:"\\angle",command:"\\angle"}),Lr=Er({name:"Over arc",latex:"\\overarc{\\overline{}}",command:"\\overarc"}),qr=Er({name:"Measured Angle",latex:"\\measuredangle",command:["m","\\angle"]}),Nr=Er({name:"Triangle",latex:"\\triangle",command:"\\triangle"}),Ir=Er({name:"Square",latex:"\\square",command:"\\square"}),Fr=Er({name:"Parallelogram",latex:"\\parallelogram",command:"\\parallelogram"}),Pr=Er({name:"Circled Dot",latex:"\\odot",command:"\\odot"}),Br=Er({name:"Degree",latex:"\\degree",command:"\\degree"}),$r=Er({name:"Similar",command:"\\sim",latex:"\\sim"}),zr=Er({name:"Congruent To",command:"\\cong",latex:"\\cong"}),Wr=Er({name:"Not Congruent To",command:"\\ncong",latex:"\\ncong"}),Kr=Er({name:"Prime",label:"pam",latex:"'",write:"'"}),Hr=Er({name:"Double Prime",latex:"''",write:"''"}),Ur=Er({name:"Left Arrow",latex:"\\leftarrow",command:"\\leftarrow"}),Xr=Er({name:"Right Arrow",latex:"\\rightarrow",command:"\\rightarrow"}),Vr=Er({name:"Left and Right Arrow",latex:"\\leftrightarrow",command:"\\leftrightarrow"});var Yr=Object.freeze({__proto__:null,overline:Sr,overRightArrow:Ar,overLeftRightArrow:Rr,segment:Or,parallel:Dr,notParallel:jr,perpindicular:Tr,angle:Mr,overArc:Lr,measureOfAngle:qr,triangle:Nr,square:Ir,parallelogram:Fr,circledDot:Pr,degree:Br,similarTo:$r,congruentTo:zr,notCongruentTo:Wr,primeArcminute:Kr,doublePrimeArcSecond:Hr,leftArrow:Ur,rightArrow:Xr,leftrightArrow:Vr});const Jr=qn("operators")({name:"CircleDot",label:"⋅",write:"\\cdot",ariaLabel:"Dot multiplier"});var Qr=Object.freeze({__proto__:null,circleDot:Jr});const Zr=qn("log"),Gr=Zr({name:"Log",label:"log",command:"\\log",latex:"\\log"}),eo=Zr({name:"log base n",label:"log s",latex:"\\log_{}",command:["\\log","_"]}),to=Zr({name:"natural log",label:"ln",command:"\\ln",latex:"\\ln"});var no=Object.freeze({__proto__:null,log:Gr,logSubscript:eo,ln:to});const ro=qn("sub-sup"),oo=ro({name:"Superscript",latex:"x^{}",command:"^"}),io=ro({name:"Subscript",latex:"x_{}",command:"_"});var ao=Object.freeze({__proto__:null,superscript:oo,subscript:io});const so=qn("statistics"),lo=so({name:"X Bar",label:"x̄",latex:"\\overline{x}",write:"\\overline{x}"}),co=so({name:"Y Bar",latex:"\\overline{y}",write:"\\overline{y}"}),uo=so({name:"mu",label:"mu",latex:"\\mu",write:"\\mu"}),po=so({name:"Sigma",ariaLabel:"Uppercase Sigma",label:"\\Sigma",latex:"\\Sigma",write:"\\Sigma"}),ho=so({name:"sigma",ariaLabel:"Lowercase Sigma",label:"\\sigma",latex:"\\sigma",write:"\\sigma"});var mo=Object.freeze({__proto__:null,xBar:lo,yBar:co,mu:uo,sigma:po,smallSigma:ho});const fo=qn("operators"),go=fo({write:"=",label:"="}),vo=fo({write:"+",label:"+"}),bo=fo({write:"−",label:"−"}),yo=fo({name:"divide",label:"÷",command:"\\divide",otherNotation:"\\div"}),xo=fo({name:"multiply",label:"×",command:"\\times"});var wo=Object.freeze({__proto__:null,equals:go,plus:vo,minus:bo,divide:yo,multiply:xo});const _o=qn("matrices"),ko=_o({name:"Single Cell Matrix",label:"[ ]",write:"\\begin{pmatrix}\\end{pmatrix}"}),Co=_o({name:"Double Cell Matrix",label:"[ ] [ ] \\\\newline [ ] [ ]",write:"\\begin{bmatrix}&\\\\&\\end{bmatrix}"});var Eo=Object.freeze({__proto__:null,singleCellMatrix:ko,doubleCellMatrix:Co});const So={0:"zero",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine"};var Ao=En(10,String).map(e=>({name:So[e],write:e,label:e,category:"digit"})).reduce((e,t)=>(e[t.name]=t,e),{comma:{name:"comma",label:",",write:",",category:"digit"},decimalPoint:{name:"decimal-point",label:".",write:".",category:"digit"}});const Ro=qn("logic"),Oo=Ro({name:"Therefore",label:"∴",write:"∴"}),Do=Ro({name:"Long division",latex:"\\longdiv{}",command:"\\longdiv"}),jo=qn("navigation"),To=jo({label:"◀",keystroke:"Left",ariaLabel:"Move cursor left"}),Mo=jo({label:"▶",keystroke:"Right",ariaLabel:"Move cursor right"}),Lo={label:"⌫",category:"edit",keystroke:"Backspace",ariaLabel:"Delete"},qo=[[Wn,or,Fn,Vn,Jn],[Jr,Pn,io,Yn,Qn],[er,Dn,jn,Tn,Mn],[pr,Bn,nr,rr,tr],[sr,br,yr,xr,Br]],No=(()=>{const e=[...qo.map(e=>[...e])];return e[0].push({name:"i",latex:"i",write:"i"}),e[1].push(Gr),e[2].push(eo),e[3].push(to),e[4].push(hr),e})(),Io=(()=>{const e=[...qo.map(e=>[...e])];return e[0].push(uo),e[1].push(lo),e[2].push(co),e[3].push(po),e[4].push(ho),e})(),Fo=[{predicate:e=>e>=3&&e<=5,set:[[Dn,jn],[Kn,Hn],[Fn,Do],[Vn,Yn]]},{predicate:e=>e>=6&&e<=7,set:[[Br,Dn,jn],[Jr,Tn,Mn],[Fn,Pn,Vn,Yn],[er,Kn,Hn,Jn],[pr,nr,tr,Qn]]},{predicate:e=>e>=8||"HS"===e,set:qo},{predicate:"non-negative-integers",set:[[Ao.seven,Ao.eight,Ao.nine],[Ao.four,Ao.five,Ao.six],[Ao.one,Ao.two,Ao.three],[Ao.zero,{name:"",latex:"",write:""},{name:"",latex:"",write:""}],[To,Mo,Lo]]},{predicate:"integers",set:[[Ao.seven,Ao.eight,Ao.nine],[Ao.four,Ao.five,Ao.six],[Ao.one,Ao.two,Ao.three],[Ao.zero,{name:"",latex:"",write:""},bo],[To,Mo,Lo]]},{predicate:"decimals",set:[[Ao.seven,Ao.eight,Ao.nine],[Ao.four,Ao.five,Ao.six],[Ao.one,Ao.two,Ao.three],[Ao.zero,Ao.decimalPoint,bo],[To,Mo,Lo]]},{predicate:"fractions",set:[[Ao.seven,Ao.eight,Ao.nine],[Ao.four,Ao.five,Ao.six],[Ao.one,Ao.two,Ao.three],[Ao.zero,Wn,bo],[To,Mo,Lo]]},{predicate:"geometry",set:[[Wn,Br,Kr,Hr,zr,$r],[Jr,Mr,qr,Nr,Wr,cr],[br,yr,xr,pr,Jn,Qn],[_r,wr,kr,Bn,io,Yn],[Sr,Ar,Rr,Lr,Tr,Dr]]},{predicate:"advanced-algebra",set:No},{predicate:"statistics",set:Io},{predicate:"item-authoring",set:[[yo,Wn,Do,fr,Vn,Jn,Sr,Ar,Rr,Gr],[xo,Jr,{name:"",latex:"",write:""},io,Yn,Qn,Tr,Dr,Lr,eo],[er,pr,Bn,Br,Mr,Ur,Xr,Nr,Ir,to],[sr,tr,ho,uo,Oo,po,Vr,br,yr,xr],[Tn,Mn,{name:"",latex:"",write:""},{name:"",latex:"",write:""},mr,{name:"",latex:"",write:""},{name:"",latex:"",write:""},_r,wr,kr]]},{predicate:e=>e>=1&&e<=2,set:[]}],Po=e=>{const t=parseInt(e,10);if(!(e=isNaN(t)?e:t))return[];const n=Fo.find(t=>"string"==typeof t.predicate?t.predicate===e:t.predicate(e));return n?n.set||[]:"language"!==e?Fo[2].set:void 0},Bo=[...Object.values(wo),...Object.values(Ln),...Object.values(gr),...Object.values(Ao),...Object.values(Zn),...Object.values(Un),...Object.values(Yr),...Object.values(no),...Object.values(Eo),...Object.values(dr),...Object.values(Qr),...Object.values(mo),...Object.values(ao),...Object.values(Cr),...Object.values($n)],$o=()=>{(Array.from(document.querySelectorAll("span[mathquill-command-id]"))||[]).forEach(e=>{e&&"∥"===e.innerText&&"mq-editable-field"!==e.className&&(e.style.fontSize="32px"),"′"!==e.innerText&&"′′"!==e.innerText||e.hasAttribute("data-prime")||e.setAttribute("data-prime","true")})},{one:zo,two:Wo,three:Ko,four:Ho,five:Uo,six:Xo,seven:Vo,eight:Yo,nine:Jo,zero:Qo,comma:Zo,decimalPoint:Go}=Ao,ei=[[Vo,Yo,Jo,yo],[Ho,Uo,Xo,xo],[zo,Wo,Ko,bo],[Qo,Go,Zo,vo],[To,Mo,Lo,go]];let ti;"undefined"!=typeof window&&(ti=u.getInterface(3),ti&&ti.registerEmbed&&function(e){e.registerEmbed("newLine",()=>({htmlString:'<div class="newLine"></div>',text:()=>"testText",latex:()=>"\\embed{newLine}[]"}))}(ti));const ni=t,ri=n,{styled:oi}=r,ii=o("math-input:mq:input"),ai=oi("span")({});class si extends ni.Component{constructor(...e){super(...e),si.prototype.__init.call(this),si.prototype.__init2.call(this),si.prototype.__init3.call(this),si.prototype.__init4.call(this)}static __initStatic(){this.propTypes={className:ri.string,onClick:ri.func,onChange:ri.func,latex:ri.string,onFocus:ri.func,onBlur:ri.func}}componentDidMount(){if(!ti)throw new Error("MQ is not defined - but component has mounted?");this.mathField=ti.MathField(this.input,{handlers:{edit:this.onInputEdit.bind(this)}}),this.updateLatex()}componentDidUpdate(){this.updateLatex()}updateLatex(){if(!this.mathField)return;const{latex:e}=this.props;null!=e&&this.mathField.latex(e)}clear(){return this.mathField.latex(""),""}blur(){ii("blur mathfield"),this.mathField.blur()}focus(){ii("focus mathfield..."),this.mathField.focus()}command(e){return ii("command: ",e),Array.isArray(e)?e.forEach(e=>{this.mathField.cmd(e)}):this.mathField.cmd(e),this.mathField.focus(),this.mathField.latex()}keystroke(e){return this.mathField.keystroke(e),this.mathField.focus(),this.mathField.latex()}write(e){return ii("write: ",e),this.mathField.write(e),this.mathField.focus(),this.mathField.latex()}__init(){this.onInputEdit=()=>{ii("[onInputEdit] ...");const{onChange:e}=this.props;this.mathField&&e&&e(this.mathField.latex())}}__init2(){this.refresh=()=>{this.blur(),this.focus()}}__init3(){this.onKeyPress=e=>{Object.keys(this.mathField.__controller.options).indexOf("ignoreNextMousedown")<0&&this.refresh(),13!==e.charCode||e.preventDefault()}}__init4(){this.onClick=e=>{const{onClick:t}=this.props;this.refresh(),t&&t(e)}}shouldComponentUpdate(e){return ii("next: ",e.latex),ii("current: ",this.mathField.latex()),e.latex!==this.mathField.latex()}render(){const{onFocus:e,onBlur:t,className:n}=this.props;return ni.createElement(ai,{className:n,onKeyDown:this.onKeyPress,onClick:this.onClick,onFocus:e,onBlur:t,ref:e=>this.input=e})}}si.__initStatic();const li=n,ci=t;function di(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const ui=o("pie-lib:math-input:mq:static"),pi=/\\MathQuillMathField\[r\d*\]\{(.*?)\}/g,hi=/ /g;function mi(e=""){return e.replace(hi,"")}function fi(e){let t=0;for(let n=0;n<(e||"").length;n++)"{"===e[n]&&t++;return t}class gi extends ci.Component{static __initStatic(){this.propTypes={latex:li.string.isRequired,onFocus:li.func,onBlur:li.func,className:li.string,getFieldName:li.func,onSubFieldChange:li.func,onSubFieldFocus:li.func,setInput:li.func}}static __initStatic2(){this.defaultProps={getFieldName:()=>{}}}constructor(e){super(e),gi.prototype.__init.call(this),gi.prototype.__init2.call(this),gi.prototype.__init3.call(this),gi.prototype.__init4.call(this),gi.prototype.__init5.call(this),gi.prototype.__init6.call(this),gi.prototype.__init7.call(this),gi.prototype.__init8.call(this),gi.prototype.__init9.call(this),gi.prototype.__init10.call(this),gi.prototype.__init11.call(this),gi.prototype.__init12.call(this),gi.prototype.__init13.call(this),this.state={announcement:"",previousLatex:"",inputSource:null,isDeleteKeyPressed:!1},this.inputRef=ci.createRef()}componentDidMount(){this.update(),$o(),this.createLiveRegion(),this.addEventListeners()}componentDidUpdate(){this.update(),$o()}componentWillUnmount(){this.removeLiveRegion(),this.removeEventListeners()}__init(){this.createLiveRegion=()=>{this.liveRegion=document.createElement("div"),this.liveRegion.style.position="absolute",this.liveRegion.style.width="1px",this.liveRegion.style.height="1px",this.liveRegion.style.marginTop="-1px",this.liveRegion.style.clip="rect(1px, 1px, 1px, 1px)",this.liveRegion.style.overflow="hidden",this.liveRegion.setAttribute("aria-live","polite"),this.liveRegion.setAttribute("aria-atomic","true"),document.body.appendChild(this.liveRegion)}}__init2(){this.addEventListeners=()=>{const e=this.inputRef.current;e&&(e.addEventListener("keydown",this.handleKeyDown),e.addEventListener("click",this.handleMathKeyboardClick))}}__init3(){this.removeEventListeners=()=>{const e=this.inputRef.current;e&&(e.removeEventListener("keydown",this.handleKeyDown),e.removeEventListener("click",this.handleMathKeyboardClick))}}__init4(){this.removeLiveRegion=()=>{this.liveRegion&&(document.body.removeChild(this.liveRegion),this.liveRegion=null)}}__init5(){this.handleKeyDown=e=>{"Backspace"!==di([e,"optionalAccess",e=>e.key])&&"Delete"!==di([e,"optionalAccess",e=>e.key])||this.setState({isDeleteKeyPressed:!0}),this.setState({inputSource:"keyboard"})}}__init6(){this.handleMathKeyboardClick=()=>{this.setState({inputSource:"mathKeyboard"})}}__init7(){this.onInputEdit=e=>{if(!this.mathField||this._isProgrammaticUpdate)return;const t=this.props.getFieldName(e,this.mathField.innerFields);if(this.props.onSubFieldChange){const n=e.latex().match(/[0-9]\\ \\frac\{[^\{]*\}\{ \}/);if(di([this,"access",e=>e.inputRef,"optionalAccess",e=>e.current])&&n&&di([n,"optionalAccess",e=>e.length]))try{e.__controller.cursor.insLeftOf(e.__controller.cursor.parent[-1].parent),e.el().dispatchEvent(new KeyboardEvent("keydown",{keyCode:8}))}catch(e){console.error(e.toString())}else this.props.onSubFieldChange(t,e.latex())}this.announceLatexConversion(e.latex())}}__init8(){this.announceLatexConversion=e=>{if(!this.state)return void console.error("State is not initialized");const{previousLatex:t,inputSource:n,isDeleteKeyPressed:r}=this.state,o="Converted to math symbol";if("keyboard"===n&&!r){if(fi(e)>fi(t))this.announceMessage(o);else try{this.mathField.parseLatex(t),this.mathField.parseLatex(e),e==t&&this.announceMessage(o)}catch(e){console.warn("Error parsing latex:",e.message),console.warn(e)}}(this.state.previousLatex!==e||this.state.isDeleteKeyPressed)&&this.setState({previousLatex:e,isDeleteKeyPressed:!1})}}__init9(){this.announceMessage=e=>{this.setState({previousLatex:""}),this.liveRegion&&(this.liveRegion.textContent=e,setTimeout(()=>{this.liveRegion.textContent=""},500))}}__init10(){this.update=()=>{if(!ti)throw new Error("MQ is not defined - but component has mounted?");this.mathField||(this.mathField=ti.StaticMath(di([this,"access",e=>e.inputRef,"optionalAccess",e=>e.current]),{handlers:{edit:this.onInputEdit.bind(this)}}));try{this._isProgrammaticUpdate=!0,this.mathField.parseLatex(this.props.latex),this.mathField.latex(this.props.latex)}catch(e){this.mathField.latex("\\MathQuillMathField[r1]{}")}finally{this._isProgrammaticUpdate=!1}}}__init11(){this.blur=()=>{ui("blur mathfield"),this.mathField.blur()}}__init12(){this.focus=()=>{ui("focus mathfield..."),this.mathField.focus()}}shouldComponentUpdate(e){try{const t=mi(this.mathField.parseLatex(e.latex)),n=(e.latex.match(pi)||[]).length,r=t!==mi(this.mathField.latex().trim())||n!==Object.keys(this.mathField.innerFields).length/2;return ui("[shouldComponentUpdate] ",r),r}catch(e){return console.warn("Error parsing latex:",e.message,"skip update"),console.warn(e),!1}}__init13(){this.onFocus=e=>{try{let t=e.target.parentElement.nextSibling,n=parseInt(t.getAttribute("mathquill-block-id"),10);n||(t=t.parentElement,n=parseInt(t.getAttribute("mathquill-block-id"),10));const r=this.mathField.innerFields.find(e=>e.id===n);if(r){const e=this.props.getFieldName(r,this.mathField.innerFields);this.props.setInput&&this.props.setInput(r),this.props.onSubFieldFocus(e,r)}}catch(e){console.error("error finding root block",e.message)}}}render(){const{onBlur:e,className:t}=this.props;return ci.createElement("span",{className:t,onFocus:this.onFocus,onBlur:e,ref:this.inputRef})}}gi.__initStatic(),gi.__initStatic2();const vi={"& *":{fontFamily:"MJXZERO, MJXTEX !important","-webkit-font-smoothing":"antialiased !important","& .mq-math-mode > span > var":{fontFamily:"MJXZERO, MJXTEX-I !important"},"& .mq-math-mode span var":{fontFamily:"MJXZERO, MJXTEX-I !important"},"& .mq-math-mode .mq-nonSymbola":{fontFamily:"MJXZERO, MJXTEX-I !important"},"& .mq-math-mode > span > var.mq-operator-name":{fontFamily:"MJXZERO, MJXTEX !important"},"& .mq-longdiv-inner":{marginTop:"-1px",marginLeft:"5px !important;","& > .mq-empty":{padding:"0 !important",marginLeft:"0px !important",marginTop:"2px"}},"& .mq-math-mode .mq-longdiv":{display:"inline-flex !important"},"& .mq-math-mode .mq-sqrt-prefix":{top:"0 !important"},"& .mq-math-mode .mq-empty":{padding:"9px 1px !important"},"& .mq-math-mode .mq-longdiv-inner .mq-empty":{padding:"0 !important"},"& .mq-math-mode .mq-supsub":{fontSize:"70.7% !important"},"& .mq-math-mode .mq-sqrt-stem":{marginTop:"-5px",paddingTop:"4px"},"& .mq-math-mode .mq-paren":{verticalAlign:"middle !important"},"& .mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-empty":{padding:"0 !important"},"& .mq-math-mode .mq-overline .mq-overline-inner .mq-empty ":{padding:"0 !important"}}},bi=e=>{En(5-e.length,()=>e.push([]));return Rn.apply(null,e)},yi=t,xi=n,{Button:wi}=i,{IconButton:_i}=i,{styled:ki}=r,Ci=o,{color:Ei}=a;function Si(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const Ai=Ci("pie-lib:math-inline:keypad"),Ri=ki(gi)(({latex:e})=>{const t={pointerEvents:"none",textTransform:"none !important",color:Ei.text(),"& .mq-scaled.mq-sqrt-prefix":{transform:"scale(1, 0.9) !important"},"& .mq-sup-only .mq-sup":{marginBottom:"0.9px !important"},"& .mq-empty":{backgroundColor:`${Ei.keypadEmptyPlaceholder()} !important`},"& .mq-overline .mq-overline-inner":{borderTop:"2px solid black"},"& .mq-non-leaf.mq-overline":{borderTop:"none !important"},"& .mq-overarrow":{width:"30px",marginTop:"0 !important",borderTop:"2px solid black",fontFamily:"Roboto, Helvetica, Arial, sans-serif !important","&.mq-arrow-both":{top:"0px !important","& *":{lineHeight:"1 !important",borderTop:"none !important"},"&:before":{fontSize:"80%",left:"calc(-13%) !important",top:"-0.31em !important"},"&:after":{fontSize:"80% !important",right:"calc(-13%) !important",top:"-1.5em"},"&.mq-empty:before":{fontSize:"80%",left:"calc(-13%)",top:"-0.26em"},"&.mq-empty:after":{fontSize:"80%",right:"calc(-13%)",top:"-0.26em"},"&.mq-empty":{minHeight:"1.4em"}},"&.mq-arrow-right:before":{fontSize:"80%",right:"calc(-13%) !important",top:"-0.26em !important"},"& .mq-overarrow-inner":{border:"none !important"},"& .mq-overarrow-inner .mq-overarrow-inner-right":{display:"none !important"}},"& .mq-root-block":{padding:"5px !important"},"& .mq-overarrow.mq-arrow-both.mq-empty:after":{right:"-6px",fontSize:"80% !important",top:"-3px"},"& .mq-overarrow.mq-arrow-right.mq-empty:before":{right:"-5px",fontSize:"80% !important",top:"-3px"},"& .mq-overarrow.mq-arrow-both.mq-empty:before":{left:"-6px",fontSize:"80% !important",top:"-3px"},"& .mq-longdiv-inner":{borderTop:"1px solid !important",paddingTop:"1.5px !important"},"& .mq-parallelogram":{lineHeight:.85},"& .mq-overarc":{borderTop:"2px solid black !important","& .mq-overline":{borderTop:"none !important"},"& .mq-overline-inner":{borderTop:"none !important",paddingTop:"0 !important"}}};return"\\parallel"===e?{...t,fontStyle:"italic !important"}:"\\overleftrightarrow{\\overline{}}"===e?{...t,"& .mq-overarrow.mq-arrow-both":{"& .mq-overline-inner":{borderTop:"none !important",paddingTop:"0 !important"},"&:after":{position:"absolute !important",top:"0px !important"}}}:t});Ri.propTypes={latex:xi.string.isRequired};const Oi=ki("div")(()=>({...vi,width:"100%",display:"grid",gridTemplateRows:"repeat(5, minmax(40px, 60px))",gridRowGap:"0px",gridColumnGap:"0px",gridAutoFlow:"column","&.character":{textTransform:"initial !important",gridTemplateRows:"repeat(5, minmax(40px, 50px)) !important"},"&.language":{gridTemplateRows:"repeat(4, minmax(40px, 50px)) !important","& *":{fontFamily:"Roboto, Helvetica, Arial, sans-serif !important"}}})),Di=ki(wi)(({category:e,isDelete:t,isComma:n,isDot:r})=>({minWidth:"auto",textTransform:"none",fontSize:n||r?"200% !important":"140% !important",lineHeight:n||r?"100%":"normal",color:Ei.text(),backgroundColor:"operators"===e?Ei.keypadButtonOperator():Ei.keypadButton(),"&:hover":{backgroundColor:"operators"===e?Ei.keypadButtonOperatorHover():Ei.keypadButtonHover()},borderRadius:0,...t&&{fontFamily:"Roboto, Helvetica, Arial, sans-serif !important"}})),ji=ki(wi)(({category:e})=>({textTransform:"none",padding:0,margin:0,fontSize:"110% !important",minWidth:"auto",borderRadius:0,backgroundColor:"operators"===e?Ei.keypadButtonOperator():Ei.keypadButton(),"&:hover":{backgroundColor:"operators"===e?Ei.keypadButtonOperatorHover():Ei.keypadButtonHover()}})),Ti=ki(_i)(({category:e})=>({minWidth:"auto",backgroundColor:"operators"===e?Ei.keypadButtonOperator():Ei.keypadButton(),"&:hover":{backgroundColor:"operators"===e?Ei.keypadButtonOperatorHover():Ei.keypadButtonHover()},borderRadius:0,"& .icon":{height:"30px"}}));class Mi extends yi.Component{static __initStatic(){this.propTypes={className:xi.string,controlledKeypadMode:xi.bool,baseSet:xi.array,additionalKeys:xi.array,layoutForKeyPad:xi.object,onPress:xi.func.isRequired,onFocus:xi.func,noDecimal:xi.bool,setKeypadInteraction:xi.func,mode:xi.oneOfType([xi.string,xi.number])}}static __initStatic2(){this.defaultProps={baseSet:ei,noDecimal:!1}}constructor(e){super(e),Mi.prototype.__init.call(this),Mi.prototype.__init2.call(this),Mi.prototype.__init3.call(this),Mi.prototype.__init4.call(this),this.keypadRef=yi.createRef()}componentDidMount(){const e=Si([this,"access",e=>e.keypadRef,"optionalAccess",e=>e.current]),t=Si([e,"optionalAccess",e=>e.closest,"call",e=>e(".main-container")]),n=Si([e,"optionalAccess",e=>e.closest,"call",e=>e(".pie-toolbar")]);if(this.props.controlledKeypadMode&&t&&n){const e=t.getBoundingClientRect(),r=n.getBoundingClientRect(),o=e.top+e.height-(r.top+r.height);if(o<0){const n=e.height+e.top-o;t&&(t.style.height=`${n}px`)}}e&&(e.addEventListener("touchstart",this.handleKeypadInteraction,!0),e.addEventListener("mousedown",this.handleKeypadInteraction,!0))}componentWillUnmount(){const e=Si([this,"access",e=>e.keypadRef,"optionalAccess",e=>e.current]);if(this.props.controlledKeypadMode&&e){const t=e.closest(".main-container");t&&(t.style.height="unset")}e&&(e.removeEventListener("touchstart",this.handleKeypadInteraction,!0),e.removeEventListener("mousedown",this.handleKeypadInteraction,!0))}__init(){this.handleKeypadInteraction=()=>{this.props.setKeypadInteraction&&this.props.setKeypadInteraction(!0)}}__init2(){this.buttonClick=e=>{Ai("[buttonClick]",e);const{onPress:t}=this.props;t(e)}}__init3(){this.flowKeys=(e,t)=>yt([...bi(e),...bi(t)])}__init4(){this.keyIsNotAllowed=e=>{const{noDecimal:t}=this.props;return!(!("."===e.write&&"."===e.label||","===e.write&&","===e.label)||!t)}}render(){const{className:e,baseSet:t,additionalKeys:n,layoutForKeyPad:r,onFocus:o,mode:i}=this.props,a=["non-negative-integers","integers","decimals","fractions","item-authoring","language"].includes(i),s=a?this.flowKeys([],n||[]):this.flowKeys(t,n||[]),l=s.length%5?1:0,c={gridTemplateColumns:`repeat(${Math.floor(s.length/5)+l}, minmax(min-content, 150px))`,...(d=r,d?{gridTemplateColumns:`repeat(${d.columns}, minmax(min-content, 150px))`,gridTemplateRows:`repeat(${d.rows}, minmax(40px, 60px))`,gridAutoFlow:"initial"}:{})};var d;return yi.createElement(Oi,{ref:this.keypadRef,className:[e,i].filter(Boolean).join(" "),style:c,onFocus:o},s.map((e,t)=>{const n=this.buttonClick.bind(this,e);if(!e)return yi.createElement("span",{key:`empty-${t}`});const r={onClick:n,disabled:this.keyIsNotAllowed(e),key:`${e.label||e.latex||e.command}-${t}`,...e.actions||{},...e.extraProps||{}};if(e.latex)return yi.createElement(ji,{key:r.key,onClick:r.onClick,disabled:r.disabled,category:a?void 0:e.category,"aria-label":e.ariaLabel?e.ariaLabel:e.name||e.label,...e.actions||{},...e.extraProps||{}},yi.createElement(Ri,{latex:e.latex}));if(e.label)return yi.createElement(Di,{key:r.key,onClick:r.onClick,disabled:r.disabled,category:a?void 0:e.category,isDelete:"⌫"===e.label,isComma:","===e.label,isDot:"."===e.label,"aria-label":e.ariaLabel?e.ariaLabel:e.name||e.label,...e.actions||{},...e.extraProps||{}},e.label);{const t=e.icon?e.icon:"div";return yi.createElement(Ti,{key:r.key,tabIndex:"-1",onClick:r.onClick,disabled:r.disabled,category:a?void 0:e.category,size:"large",...e.actions||{},...e.extraProps||{}},yi.createElement(t,{className:"icon"}))}}))}}Mi.__initStatic(),Mi.__initStatic2();const Li=t,qi=n;class Ni extends Li.Component{constructor(...e){super(...e),Ni.prototype.__init.call(this)}static __initStatic(){this.propTypes={className:qi.string,controlledKeypadMode:qi.bool,mode:qi.oneOfType([qi.string,qi.number]),layoutForKeyPad:qi.object,onClick:qi.func.isRequired,onFocus:qi.func,noDecimal:qi.bool,additionalKeys:qi.array,setKeypadInteraction:qi.func}}static __initStatic2(){this.defaultProps={mode:"scientific",noDecimal:!1,additionalKeys:[]}}__init(){this.keypadPress=e=>{const{onClick:t}=this.props;var n;t((n=e).command?{value:n.command,type:"command"}:n.write?{value:n.write}:n.keystroke?{type:"cursor",value:n.keystroke}:void 0)}}render(){const{mode:e,onFocus:t,controlledKeypadMode:n,noDecimal:r,className:o,additionalKeys:i,layoutForKeyPad:a,setKeypadInteraction:s}=this.props,l=(e=>(e||[]).map(e=>{const{latex:t}=e,n=(Bo||[]).find(e=>t===e.latex||t===e.write||t===e.command||t===e.otherNotation);return t&&n||e}))(i);return Li.createElement(Mi,{className:o,controlledKeypadMode:n,onFocus:t,noDecimal:r,layoutForKeyPad:a,additionalKeys:Nn(Po(e),l),onPress:this.keypadPress,mode:e,setKeypadInteraction:s})}}Ni.__initStatic(),Ni.__initStatic2();var Ii,Fi,Pi,Bi={"border-radius":1,"border-top-left-radius":1,"border-top-right-radius":1,"border-bottom-left-radius":1,"border-bottom-right-radius":1,"box-shadow":1,order:1,flex:function(e,t){return[t+"box-flex"]},"box-flex":1,"box-align":1,animation:1,"animation-duration":1,"animation-name":1,transition:1,"transition-duration":1,transform:1,"transform-style":1,"transform-origin":1,"backface-visibility":1,perspective:1,"box-pack":1},$i={animation:1,"column-count":1,columns:1,"font-weight":1,opacity:1,"order ":1,"z-index":1,zoom:1,flex:1,"box-flex":1,transform:1,perspective:1,"box-pack":1,"box-align":1,colspan:1,rowspan:1},zi=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},Wi=zi,Ki=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,Hi="undefined"==typeof document?{}:document.documentElement.style,Ui=(Ii=function(){for(var e in Hi)if(Ki.test(e))return e.match(Ki)[0];return"WebkitOpacity"in Hi?"Webkit":"KhtmlOpacity"in Hi?"Khtml":""}(),Fi=Ii.toLowerCase(),{style:Ii,css:"-"+Fi+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[Ii]||Wi(Ii)}),Xi=function(e,t){return t?t.toUpperCase():""},Vi=/[-\s]+(.)?/g,Yi=function(e){return e?e.replace(Vi,Xi):""},Ji=/::/g,Qi=/([A-Z]+)([A-Z][a-z])/g,Zi=/([a-z\d])([A-Z])/g,Gi=/_/g,ea=function(e,t){return e?e.replace(Ji,"/").replace(Qi,"$1_$2").replace(Zi,"$1_$2").replace(Gi,t||"-"):""},ta=function(e){return ea(e).toLowerCase()},na=Yi,ra=ta,oa=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},ia=zi,aa=Ui,sa=Bi,la="undefined"==typeof document?{}:document.documentElement.style,ca=function(e,t){t=t||{};var n=oa(na(e)),r=ra(e),o=Pi?n:r,i=aa.style?Pi?aa.style:aa.css:"";if(n in la)return t.asString?o:[o];var a=o,s=sa[r],l=[];if(Pi&&(a=ia(o)),"function"==typeof s){var c=s(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return Pi?oa(na(e)):ra(e)})),l=l.concat(c)}return i&&l.push(i+a),l.push(o),t.asString||1==l.length?l[0]:l},da=Object.prototype.hasOwnProperty,ua=function(e,t){return da.call(e,t)},pa=Object.prototype.toString,ha=Object.prototype.toString,ma=ca,fa=ta,ga=Yi,va=ua,ba=function(e){return!!e&&"[object Object]"===pa.call(e)},ya=function(e){return"[object Function]"===ha.apply(e)},xa=function(e,t,n,r){ma(t).forEach(function(t){e[r?r(t):t]=n})},wa={cssUnitless:$i},_a=function(e,t,n,r){"string"==typeof e&&(e=function(e){e=(e||"").split(";");var t={};return e.forEach(function(e){var n=e.split(":");2==n.length&&(t[n[0].trim()]=n[1].trim())}),t}(e)),(t=t||wa).cssUnitless=t.cssUnitless||wa.cssUnitless,r=r||{};var o,i,a,s,l,c,d,u,p=t.scope||{},h=null!=t.addUnits?t.addUnits:!p||null==p.addUnits||p.addUnits,m=(null!=t.cssUnitless?t.cssUnitless:p?p.cssUnitless:null)||{},f=(t.cssUnit||p?p.cssUnit:null)||"px",g=t.prefixProperties||(p?p.prefixProperties:null)||{},v=t.camelize?ga:fa;for(a in e)if(va(e,a)){if(s=e[a],i=fa(n?n+a:a),o=!1,u=!1,ya(s)&&(d=s.call(p||e,s,a,i,e),ba(d)&&null!=d.value?(s=d.value,u=d.prefix,i=d.name?fa(d.name):i):s=d),c="number"==(l=typeof s)||"string"==l&&""!=s&&1*s==s,null==s||null==i||""===i)continue;if((c||"string"==l)&&(o=!0),!o&&null!=s.value&&s.prefix&&(o=!0,u=s.prefix,s=s.value),o){if(u=u||!!g[i],c&&(s=h&&!(i in m)?s+f:s+""),"border"!=i&&(i.indexOf("border")||~i.indexOf("radius")||~i.indexOf("width"))||!c||(i+="-width"),!i.indexOf("border-radius-")&&(i.replace(/border(-radius)(-(.*))/,function(e,t,n){var r={"-top":["-top-left","-top-right"],"-left":["-top-left","-bottom-left"],"-right":["-top-right","-bottom-right"],"-bottom":["-bottom-left","-bottom-right"]};n in r?(i=[],r[n].forEach(function(e){i.push("border"+e+t)})):i="border"+n+t}),Array.isArray(i))){i.forEach(function(e){u?xa(r,e,s,v):r[v(e)]=s});continue}u?xa(r,i,s,v):r[v(i)]=s}else _a(s,t,i+"-",r)}return r},ka=_a,Ca=ua,Ea={prefixProperties:Bi,cssUnitless:$i,object:_a,string:function(e,t){e=ka(e,t);var n,r=[];for(n in e)Ca(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const Sa=o("@pie-lib:mask-markup:serialization"),Aa=["span"],Ra=["em","strong","u"],Oa=(e,t)=>{const n=e.getAttribute(t);return r=(e=>{const t=/([\w-]*)\s*:\s*([^;]*)/g;let n;const r={};for(;n=t.exec(e);)r[n[1]]=n[2].trim();return r})(n),Ea.object(r,{camelize:!0,addUnits:!1});var r},Da=["border","class","style"],ja={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},Ta=(e,t=[])=>{if(8===e.nodeType)return null;if(3===e.nodeType){const n={text:e.textContent};return t.length>0&&(n.marks=t.map(e=>({type:e,data:void 0}))),{object:"text",leaves:[n]}}if(1===e.nodeType){const r=e.tagName.toLowerCase(),o=ja[r];if(o){Sa("[deserialize] mark: ",o);return{_flatten:!0,nodes:Ma(e.childNodes,[...t,o])}}if("math"===r)return{isMath:!0,nodes:[e]};const i=(e=>{if(!e.attributes||e.attributes.length<=0)return;const t={};let n;for(n=0;n<e.attributes.length;n++){const r=e.attributes[n];t[r.name]=r.value}return t})(e)||{};"audio"===r&&""===i.controls&&(i.controls=!0);const a=Da.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=Oa(n,t);break;case"class":e.className=((e,t,n)=>{const r=e.getAttribute(n);return delete t.class,r})(n,e,t);break;default:e[t]=n.getAttribute(t)}return e}),{...i}),s=(e=>Aa.includes(e)?"inline":Ra.includes(e)?"mark":"block")(r),l=Ma(e.childNodes,t);return{object:s,type:r,data:{dataset:{...e.dataset},attributes:{...a}},nodes:l}}var n;return null},Ma=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=Ta(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},La=t,qa=n,{styled:Na}=r,{renderMath:Ia}=d;function Fa(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const Pa=Na("div")(({theme:e})=>({paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5)})),Ba=Na("span")(()=>({display:"inline-block",width:".75em"})),$a=["tbody","tr"],za=(e,t,n,r,o,i)=>{if(!t)return null;const a=[];return(e.nodes||[]).forEach((e,s)=>{const l=e.type?`${e.type}-${s}`:`${s}`;if(e.isMath)return a.push(La.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),a;if(r){const l=r(e,t,n);if(l)return a.push(l),void("td"!==Fa([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&a.push(La.createElement(Ba,{key:`spacer-${s}`})))}if("text"===e.object){const t=e.leaves.reduce((e,t)=>{const n=t.text,r=((e,t)=>{const n=""===t.trim(),r=e&&e.type;return n&&$a.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>mt(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in ja)if(ja[e]===n.type){const n=e;a.push(La.createElement(n,{key:l},t));break}}else t.length>0&&(a.push(t),"td"!==Fa([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&a.push(La.createElement(Ba,{key:`spacer-${s}`})))}else{const o=za(e,t,n,r,e,i);if("p"===e.type||"paragraph"===e.type)a.push(La.createElement(Pa,{key:l},o));else{const t=e.type;e.nodes&&e.nodes.length>0?a.push(La.createElement(t,{key:l,...e.data.attributes},o)):a.push(La.createElement(t,{key:l,...e.data.attributes}))}}}),a},Wa=Na("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class Ka extends La.Component{constructor(e){super(e),Ka.prototype.__init.call(this),this.internalContainerRef=La.createRef()}static __initStatic(){this.propTypes={renderChildren:qa.func,layout:qa.object,value:qa.object,onChange:qa.func,elementType:qa.string,containerRef:qa.oneOfType([qa.func,qa.shape({current:qa.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof Ia&&Ia(e.current)}__init(){this.handleChange=(e,t)=>{const n={...this.props.value,[e]:t};this.props.onChange(n)}}render(){const{value:e,layout:t,elementType:n,containerRef:r}=this.props,o=za(t,e,this.handleChange,this.props.renderChildren,null,n),i=r||this.internalContainerRef;return La.createElement(Wa,{ref:i},o)}}Ka.__initStatic();const Ha=/\{\{(\d+)\}\}/g;const Ua=t,Xa=n;var Va;const Ya=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(Ha,(e,t)=>`<span data-component="${o}" data-id="${t}"></span>`)}:{markup:""});var r,o;return(e=>{if(!e||!e.trim())return{object:"value",document:{object:"document",data:{},nodes:[{object:"block",type:"span",data:{},isVoid:!1,nodes:[]}]}};const t=(new DOMParser).parseFromString(e,"text/html");let n=Ma(t.body.childNodes);return!n.some(e=>"block"===e.object||"inline"===e.object)&&n.length>0&&(n=[{object:"block",type:"span",data:{},isVoid:!1,nodes:n}]),0===n.length&&(n=[{object:"block",type:"span",data:{},isVoid:!1,nodes:[]}]),{object:"value",document:{object:"document",data:{},nodes:n}}})(n).document},Ja=(e,t)=>((Va=class extends Ua.Component{static __initStatic(){this.propTypes={markup:Xa.string,layout:Xa.object,value:Xa.object,onChange:Xa.func,customMarkMarkupComponent:Xa.func,elementType:Xa.string}}constructor(e){super(e),this.containerRef=Ua.createRef()}componentDidUpdate(e){if(this.props.markup!==e.markup){const e=this.containerRef.current;(e&&e.querySelectorAll('[data-latex][data-math-handled="true"]')||[]).forEach(e=>{const t=e.querySelector("mjx-container");t&&e.removeChild(t);const n=e.getAttribute("data-raw");e.innerHTML=n,e.removeAttribute("data-math-handled")})}}render(){const{markup:n,layout:r,value:o,onChange:i,elementType:a}=this.props,s=r||Ya(n,e);return Ua.createElement(Ka,{containerRef:this.containerRef,elementType:a,layout:s,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),Va),{useMemo:Qa}=t,{useLayoutEffect:Za}=t,{useEffect:Ga}=t,{useRef:es}=t,{useCallback:ts}=t,ns="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function rs(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function os(e){return"nodeType"in e}function is(e){var t,n;return e?rs(e)?e:os(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function as(e){const{Document:t}=is(e);return e instanceof t}function ss(e){return!rs(e)&&e instanceof is(e).HTMLElement}function ls(e){return e instanceof is(e).SVGElement}function cs(e){return e?rs(e)?e.document:os(e)?as(e)?e:ss(e)||ls(e)?e.ownerDocument:document:document:document}const ds=ns?Za:Ga;function us(e){const t=es(e);return ds(()=>{t.current=e}),ts(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function ps(e,t){void 0===t&&(t=[e]);const n=es(e);return ds(()=>{n.current!==e&&(n.current=e)},t),n}function hs(e,t){const n=es();return Qa(()=>{const t=e(n.current);return n.current=t,t},[...t])}function ms(e){const t=us(e),n=es(null),r=ts(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function fs(e){const t=es();return Ga(()=>{t.current=e},[e]),t.current}let gs={};function vs(e,t){return Qa(()=>{if(t)return t;const n=null==gs[e]?0:gs[e]+1;return gs[e]=n,e+"-"+n},[e,t])}function bs(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const ys=bs(1),xs=bs(-1);function ws(e){if(!e)return!1;const{KeyboardEvent:t}=is(e.target);return t&&e instanceof t}function _s(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=is(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const ks=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[ks.Translate.toString(e),ks.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Cs="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Es(e){return e.matches(Cs)?e:e.querySelector(Cs)}const Ss=t,{useState:As}=t,{useCallback:Rs}=t,Os={display:"none"};function Ds(e){let{id:t,value:n}=e;return Ss.createElement("div",{id:t,style:Os},n)}function js(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return Ss.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const Ts=t,{createContext:Ms}=t,{useContext:Ls}=t,{useEffect:qs}=t,{useState:Ns}=t,{useCallback:Is}=t,{useMemo:Fs}=t,{useRef:Ps}=t,{memo:Bs}=t,{useReducer:$s}=t,{cloneElement:zs}=t,{forwardRef:Ws}=t,{createPortal:Ks}=e,{unstable_batchedUpdates:Hs}=e,Us=Ms(null);const Xs={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Vs={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Ys(e){let{announcements:t=Vs,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Xs}=e;const{announce:i,announcement:a}=function(){const[e,t]=As("");return{announce:Rs(e=>{null!=e&&t(e)},[]),announcement:e}}(),s=vs("DndLiveRegion"),[l,c]=Ns(!1);if(qs(()=>{c(!0)},[]),function(e){const t=Ls(Us);qs(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(Fs(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!l)return null;const d=Ts.createElement(Ts.Fragment,null,Ts.createElement(Ds,{id:r,value:o.draggable}),Ts.createElement(js,{id:s,announcement:a}));return n?Ks(d,n):d}var Js;function Qs(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Js||(Js={}));const Zs=Object.freeze({x:0,y:0});function Gs(e,t){const n=_s(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function el(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function tl(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,s=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*s;return Number((o/(n+r-o)).toFixed(4))}return 0}const nl=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=tl(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(el)};function rl(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Zs}const ol=(il=1,function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((e,t)=>({...e,top:e.top+il*t.y,bottom:e.bottom+il*t.y,left:e.left+il*t.x,right:e.right+il*t.x}),{...e})});var il;function al(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const sl={ignoreTransform:!1};function ll(e,t){void 0===t&&(t=sl);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=is(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=al(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:s}=r,l=e.left-a-(1-o)*parseFloat(n),c=e.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:s,right:l}=n;return{top:r,left:o,width:i,height:a,bottom:s,right:l}}function cl(e){return ll(e,{ignoreTransform:!0})}function dl(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(as(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ss(o)||ls(o))return n;if(n.includes(o))return n;const i=is(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=is(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=is(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function ul(e){const[t]=dl(e,1);return null!=t?t:null}function pl(e){return ns&&e?rs(e)?e:os(e)?as(e)||e===cs(e).scrollingElement?window:ss(e)?e:null:null:null}function hl(e){return rs(e)?e.scrollX:e.scrollLeft}function ml(e){return rs(e)?e.scrollY:e.scrollTop}function fl(e){return{x:hl(e),y:ml(e)}}var gl;function vl(e){return!(!ns||!e)&&e===document.scrollingElement}function bl(e){const t={x:0,y:0},n=vl(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(gl||(gl={}));const yl={x:.2,y:.2};function xl(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=yl);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=bl(e),h={x:0,y:0},m={x:0,y:0},f=t.height*o.y,g=t.width*o.x;return!c&&i<=t.top+f?(h.y=gl.Backward,m.y=r*Math.abs((t.top+f-i)/f)):!d&&l>=t.bottom-f&&(h.y=gl.Forward,m.y=r*Math.abs((t.bottom-f-l)/f)),!p&&s>=t.right-g?(h.x=gl.Forward,m.x=r*Math.abs((t.right-g-s)/g)):!u&&a<=t.left+g&&(h.x=gl.Backward,m.x=r*Math.abs((t.left+g-a)/g)),{direction:h,speed:m}}function wl(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function _l(e){return e.reduce((e,t)=>ys(e,fl(t)),Zs)}function kl(e,t){if(void 0===t&&(t=ll),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);ul(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Cl=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+hl(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+ml(t),0)}]];class El{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=dl(t),r=_l(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Cl)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Sl{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Al(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Rl,Ol;function Dl(e){e.preventDefault()}function jl(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Rl||(Rl={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Ol||(Ol={}));const Tl={start:[Ol.Space,Ol.Enter],cancel:[Ol.Esc],end:[Ol.Space,Ol.Enter,Ol.Tab]},Ml=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ol.Right:return{...n,x:n.x+25};case Ol.Left:return{...n,x:n.x-25};case Ol.Down:return{...n,y:n.y+25};case Ol.Up:return{...n,y:n.y-25}}};class Ll{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Sl(cs(t)),this.windowListeners=new Sl(is(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Rl.Resize,this.handleCancel),this.windowListeners.add(Rl.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Rl.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&kl(n),t(Zs)}handleKeyDown(e){if(ws(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Tl,coordinateGetter:i=Ml,scrollBehavior:a="smooth"}=r,{code:s}=e;if(o.end.includes(s))return void this.handleEnd(e);if(o.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:Zs;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=xs(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:s,isLeft:l,isBottom:c,maxScroll:u,minScroll:p}=bl(n),h=wl(n),m={x:Math.min(o===Ol.Right?h.right-h.width/2:h.right,Math.max(o===Ol.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===Ol.Down?h.bottom-h.height/2:h.bottom,Math.max(o===Ol.Down?h.top:h.top+h.height/2,d.y))},f=o===Ol.Right&&!s||o===Ol.Left&&!l,g=o===Ol.Down&&!c||o===Ol.Up&&!i;if(f&&m.x!==d.x){const e=n.scrollLeft+t.x,i=o===Ol.Right&&e<=u.x||o===Ol.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Ol.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&m.y!==d.y){const e=n.scrollTop+t.y,i=o===Ol.Down&&e<=u.y||o===Ol.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Ol.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,ys(xs(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function ql(e){return Boolean(e&&"distance"in e)}function Nl(e){return Boolean(e&&"delay"in e)}Ll.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Tl,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class Il{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=is(e);return e instanceof t?e:cs(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=cs(i),this.documentListeners=new Sl(this.document),this.listeners=new Sl(n),this.windowListeners=new Sl(is(i)),this.initialCoordinates=null!=(r=_s(o))?r:Zs,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Rl.Resize,this.handleCancel),this.windowListeners.add(Rl.DragStart,Dl),this.windowListeners.add(Rl.VisibilityChange,this.handleCancel),this.windowListeners.add(Rl.ContextMenu,Dl),this.documentListeners.add(Rl.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Nl(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ql(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Rl.Click,jl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Rl.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const s=null!=(t=_s(e))?t:Zs,l=xs(r,s);if(!n&&a){if(ql(a)){if(null!=a.tolerance&&Al(l,a.tolerance))return this.handleCancel();if(Al(l,a.distance))return this.handleStart()}return Nl(a)&&Al(l,a.tolerance)?this.handleCancel():void this.handlePending(a,l)}e.cancelable&&e.preventDefault(),i(s)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Ol.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Fl={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Pl extends Il{constructor(e){const{event:t}=e,n=cs(t.target);super(e,Fl,n)}}Pl.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const Bl={move:{name:"mousemove"},end:{name:"mouseup"}};var $l;!function(e){e[e.RightClick=2]="RightClick"}($l||($l={}));(class extends Il{constructor(e){super(e,Bl,cs(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==$l.RightClick&&(null==r||r({event:n}),!0)}}];const zl={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var Wl,Kl;function Hl(e){let{acceleration:t,activator:n=Wl.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=Kl.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=fs(t);return hs(e=>{if(n||!r||!e)return Ul;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[gl.Backward]:e.x[gl.Backward]||-1===o.x,[gl.Forward]:e.x[gl.Forward]||1===o.x},y:{[gl.Backward]:e.y[gl.Backward]||-1===o.y,[gl.Forward]:e.y[gl.Forward]||1===o.y}}},[n,t,r])}({delta:u,disabled:!i}),[m,f]=function(){const e=es(null);return[ts((t,n)=>{e.current=setInterval(t,n)},[]),ts(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),g=Ps({x:0,y:0}),v=Ps({x:0,y:0}),b=Fs(()=>{switch(n){case Wl.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Wl.DraggableRect:return o}},[n,o,l]),y=Ps(null),x=Is(()=>{const e=y.current;if(!e)return;const t=g.current.x*v.current.x,n=g.current.y*v.current.y;e.scrollBy(t,n)},[]),w=Fs(()=>s===Kl.TreeOrder?[...c].reverse():c,[s,c]);qs(()=>{if(i&&c.length&&b){for(const e of w){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=d[n];if(!o)continue;const{direction:i,speed:s}=xl(e,o,b,t,p);for(const e of["x","y"])h[e][i[e]]||(s[e]=0,i[e]=0);if(s.x>0||s.y>0)return f(),y.current=e,m(x,a),g.current=s,void(v.current=i)}g.current={x:0,y:0},v.current={x:0,y:0},f()}else f()},[t,x,r,f,i,a,JSON.stringify(b),JSON.stringify(h),m,c,w,d,JSON.stringify(p)])}(class extends Il{constructor(e){super(e,zl)}static setup(){return window.addEventListener(zl.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(zl.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Wl||(Wl={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Kl||(Kl={}));const Ul={x:{[gl.Backward]:!1,[gl.Forward]:!1},y:{[gl.Backward]:!1,[gl.Forward]:!1}};var Xl,Vl;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Xl||(Xl={})),function(e){e.Optimized="optimized"}(Vl||(Vl={}));const Yl=new Map;function Jl(e,t){return hs(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Ql(e){let{callback:t,disabled:n}=e;const r=us(t),o=Fs(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return qs(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Zl(e){return new El(ll(e),e)}function Gl(e,t,n){void 0===t&&(t=Zl);const[r,o]=Ns(null);function i(){o(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const a=function(e){let{callback:t,disabled:n}=e;const r=us(t),o=Fs(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return qs(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),s=Ql({callback:i});return ds(()=>{i(),e?(null==s||s.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==a||a.disconnect())},[e]),r}const ec=[];function tc(e,t){void 0===t&&(t=[]);const n=Ps(null);return qs(()=>{n.current=null},t),qs(()=>{const t=e!==Zs;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?xs(e,n.current):Zs}function nc(e){return Fs(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const rc=[];function oc(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ss(t)?t:e}const ic=[{sensor:Pl,options:{}},{sensor:Ll,options:{}}],ac={current:{}},sc={draggable:{measure:cl},droppable:{measure:cl,strategy:Xl.WhileDragging,frequency:Vl.Optimized},dragOverlay:{measure:ll}};class lc extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const cc={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new lc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Qs},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:sc,measureDroppableContainers:Qs,windowRect:null,measuringScheduled:!1},dc={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Qs,draggableNodes:new Map,over:null,measureDroppableContainers:Qs},uc=Ms(dc),pc=Ms(cc);function hc(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new lc}}}function mc(e,t){switch(t.type){case Js.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Js.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Js.DragEnd:case Js.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Js.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new lc(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Js.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new lc(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Js.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new lc(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function fc(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=Ls(uc),i=fs(r),a=fs(null==n?void 0:n.id);return qs(()=>{if(!t&&!r&&i&&null!=a){if(!ws(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Es(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function gc(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const vc=Ms({...Zs,scaleX:1,scaleY:1});var bc;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(bc||(bc={})),Bs(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:s=!0,children:l,sensors:c=ic,collisionDetection:d=nl,measuring:u,modifiers:p,...h}=e;const m=$s(mc,void 0,hc),[f,g]=m,[v,b]=function(){const[e]=Ns(()=>new Set),t=Is(t=>(e.add(t),()=>e.delete(t)),[e]);return[Is(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[y,x]=Ns(bc.Uninitialized),w=y===bc.Initialized,{draggable:{active:_,nodes:k,translate:C},droppable:{containers:E}}=f,S=null!=_?k.get(_):null,A=Ps({initial:null,translated:null}),R=Fs(()=>{var e;return null!=_?{id:_,data:null!=(e=null==S?void 0:S.data)?e:ac,rect:A}:null},[_,S]),O=Ps(null),[D,j]=Ns(null),[T,M]=Ns(null),L=ps(h,Object.values(h)),q=vs("DndDescribedBy",i),N=Fs(()=>E.getEnabled(),[E]),I=Fs(()=>({draggable:{...sc.draggable,...null==F?void 0:F.draggable},droppable:{...sc.droppable,...null==F?void 0:F.droppable},dragOverlay:{...sc.dragOverlay,...null==F?void 0:F.dragOverlay}}),[null==(F=u)?void 0:F.draggable,null==F?void 0:F.droppable,null==F?void 0:F.dragOverlay]);var F;const{droppableRects:P,measureDroppableContainers:B,measuringScheduled:$}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=Ns(null),{frequency:s,measure:l,strategy:c}=o,d=Ps(e),u=function(){switch(c){case Xl.Always:return!1;case Xl.BeforeDragging:return n;default:return!n}}(),p=ps(u),h=Is(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),m=Ps(null),f=hs(t=>{if(u&&!n)return Yl;if(!t||t===Yl||d.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new El(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,u,l]);return qs(()=>{d.current=e},[e]),qs(()=>{u||h()},[n,u]),qs(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),qs(()=>{u||"number"!=typeof s||null!==m.current||(m.current=setTimeout(()=>{h(),m.current=null},s))},[s,u,h,...r]),{droppableRects:f,measureDroppableContainers:h,measuringScheduled:null!=i}}(N,{dragging:w,dependencies:[C.x,C.y],config:I.droppable}),z=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return hs(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(k,_),W=Fs(()=>T?_s(T):null,[T]),K=function(){const e=!1===(null==D?void 0:D.autoScrollEnabled),t="object"==typeof s?!1===s.enabled:!1===s,n=w&&!e&&!t;if("object"==typeof s)return{...s,enabled:n};return{enabled:n}}(),H=function(e,t){return Jl(e,t)}(z,I.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=Ps(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;ds(()=>{if(!a&&!s||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=rl(n(e),r);if(a||(o.x=0),s||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=ul(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,s,r,n])}({activeNode:null!=_?k.get(_):null,config:K.layoutShiftCompensation,initialRect:H,measure:I.draggable.measure});const U=Gl(z,I.draggable.measure,H),X=Gl(z?z.parentElement:null),V=Ps({activatorEvent:null,active:null,activeNode:z,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Y=E.getNodeFor(null==(t=V.current.over)?void 0:t.id),J=function(e){let{measure:t}=e;const[n,r]=Ns(null),o=Ql({callback:Is(e=>{for(const{target:n}of e)if(ss(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=Is(e=>{const n=oc(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[a,s]=ms(i);return Fs(()=>({nodeRef:a,rect:n,setRef:s}),[n,a,s])}({measure:I.dragOverlay.measure}),Q=null!=(n=J.nodeRef.current)?n:z,Z=w?null!=(r=J.rect)?r:U:null,G=Boolean(J.nodeRef.current&&J.rect),ee=rl(te=G?null:U,Jl(te));var te;const ne=nc(Q?is(Q):null),re=function(e){const t=Ps(e),n=hs(n=>e?n&&n!==ec&&e&&t.current&&e.parentNode===t.current.parentNode?n:dl(e):ec,[e]);return qs(()=>{t.current=e},[e]),n}(w?null!=Y?Y:z:null),oe=function(e,t){void 0===t&&(t=ll);const[n]=e,r=nc(n?is(n):null),[o,i]=Ns(rc);function a(){i(()=>e.length?e.map(e=>vl(e)?r:new El(t(e),e)):rc)}const s=Ql({callback:a});return ds(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(re),ie=gc(p,{transform:{x:C.x-ee.x,y:C.y-ee.y,scaleX:1,scaleY:1},activatorEvent:T,active:R,activeNodeRect:U,containerNodeRect:X,draggingNodeRect:Z,over:V.current.over,overlayNodeRect:J.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),ae=W?ys(W,C):null,se=function(e){const[t,n]=Ns(null),r=Ps(e),o=Is(e=>{const t=pl(e.target);t&&n(e=>e?(e.set(t,fl(t)),new Map(e)):null)},[]);return qs(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=pl(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,fl(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=pl(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),Fs(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>ys(e,t),Zs):_l(e):Zs,[e,t])}(re),le=tc(se),ce=tc(se,[U]),de=ys(ie,le),ue=Z?ol(Z,ie):null,pe=R&&ue?d({active:R,collisionRect:ue,droppableRects:P,droppableContainers:N,pointerCoordinates:ae}):null,he=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(pe,"id"),[me,fe]=Ns(null),ge=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(G?ie:ys(ie,ce),null!=(o=null==me?void 0:me.rect)?o:null,U),ve=Ps(null),be=Is((e,t)=>{let{sensor:n,options:r}=t;if(null==O.current)return;const o=k.get(O.current);if(!o)return;const i=e.nativeEvent,a=new n({active:O.current,activeNode:o,event:i,options:r,context:V,onAbort(e){if(!k.get(e))return;const{onDragAbort:t}=L.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!k.get(e))return;const{onDragPending:o}=L.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),v({type:"onDragPending",event:i})},onStart(e){const t=O.current;if(null==t)return;const n=k.get(t);if(!n)return;const{onDragStart:r}=L.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:A}};Hs(()=>{null==r||r(o),x(bc.Initializing),g({type:Js.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),j(ve.current),M(i)})},onMove(e){g({type:Js.DragMove,coordinates:e})},onEnd:s(Js.DragEnd),onCancel:s(Js.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=V.current;let a=null;if(t&&o){const{cancelDrop:s}=L.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Js.DragEnd&&"function"==typeof s){await Promise.resolve(s(a))&&(e=Js.DragCancel)}}O.current=null,Hs(()=>{g({type:e}),x(bc.Uninitialized),fe(null),j(null),M(null),ve.current=null;const t=e===Js.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=L.current[t];null==e||e(a),v({type:t,event:a})}})}}ve.current=a},[k]),ye=Is((e,t)=>(n,r)=>{const o=n.nativeEvent,i=k.get(r);if(null!==O.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},O.current=r,be(n,t))},[k,be]),xe=function(e,t){return Fs(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(c,ye);!function(e){qs(()=>{if(!ns)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(c),ds(()=>{U&&y===bc.Initializing&&x(bc.Initialized)},[U,y]),qs(()=>{const{onDragMove:e}=L.current,{active:t,activatorEvent:n,collisions:r,over:o}=V.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:de.x,y:de.y},over:o};Hs(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[de.x,de.y]),qs(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=V.current;if(!e||null==O.current||!t||!o)return;const{onDragOver:i}=L.current,a=r.get(he),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:s};Hs(()=>{fe(s),null==i||i(l),v({type:"onDragOver",event:l})})},[he]),ds(()=>{V.current={activatorEvent:T,active:R,activeNode:z,collisionRect:ue,collisions:pe,droppableRects:P,draggableNodes:k,draggingNode:Q,draggingNodeRect:Z,droppableContainers:E,over:me,scrollableAncestors:re,scrollAdjustedTranslate:de},A.current={initial:Z,translated:ue}},[R,z,pe,ue,k,Q,Z,P,E,me,re,de]),Hl({...K,delta:C,draggingRect:ue,pointerCoordinates:ae,scrollableAncestors:re,scrollableAncestorRects:oe});const we=Fs(()=>({active:R,activeNode:z,activeNodeRect:U,activatorEvent:T,collisions:pe,containerNodeRect:X,dragOverlay:J,draggableNodes:k,droppableContainers:E,droppableRects:P,over:me,measureDroppableContainers:B,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:I,measuringScheduled:$,windowRect:ne}),[R,z,U,T,pe,X,J,k,E,P,me,B,re,oe,I,$,ne]),_e=Fs(()=>({activatorEvent:T,activators:xe,active:R,activeNodeRect:U,ariaDescribedById:{draggable:q},dispatch:g,draggableNodes:k,over:me,measureDroppableContainers:B}),[T,xe,R,U,g,q,k,me,B]);return Ts.createElement(Us.Provider,{value:b},Ts.createElement(uc.Provider,{value:_e},Ts.createElement(pc.Provider,{value:we},Ts.createElement(vc.Provider,{value:ge},l)),Ts.createElement(fc,{disabled:!1===(null==a?void 0:a.restoreFocus)})),Ts.createElement(Ys,{...a,hiddenTextDescribedById:q}))});const yc=Ms(null),xc="button";function wc(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=vs("Draggable"),{activators:a,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:p}=Ls(uc),{role:h=xc,roleDescription:m="draggable",tabIndex:f=0}=null!=o?o:{},g=(null==l?void 0:l.id)===t,v=Ls(g?vc:yc),[b,y]=ms(),[x,w]=ms(),_=function(e,t){return Fs(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),k=ps(n);ds(()=>(u.set(t,{id:t,key:i,node:b,activatorNode:x,data:k}),()=>{const e=u.get(t);e&&e.key===i&&u.delete(t)}),[u,t]);return{active:l,activatorEvent:s,activeNodeRect:c,attributes:Fs(()=>({role:h,tabIndex:f,"aria-disabled":r,"aria-pressed":!(!g||h!==xc)||void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[r,h,f,g,m,d.draggable]),isDragging:g,listeners:r?void 0:_,node:b,over:p,setNodeRef:y,setActivatorNodeRef:w,transform:v}}const _c={timeout:25};function kc(e){let{animation:t,children:n}=e;const[r,o]=Ns(null),[i,a]=Ns(null),s=fs(n);return n||r||!s||o(s),ds(()=>{if(!i)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{o(null)}):o(null)},[t,r,i]),Ts.createElement(Ts.Fragment,null,n,r?zs(r,{ref:a}):null)}const Cc={x:0,y:0,scaleX:1,scaleY:1};function Ec(e){let{children:t}=e;return Ts.createElement(uc.Provider,{value:dc},Ts.createElement(vc.Provider,{value:Cc},t))}const Sc={position:"fixed",touchAction:"none"},Ac=e=>ws(e)?"transform 250ms ease":void 0,Rc=Ws((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:s,style:l,transform:c,transition:d=Ac}=e;if(!s)return null;const u=o?c:{...c,scaleX:1,scaleY:1},p={...Sc,width:s.width,height:s.height,top:s.top,left:s.left,transform:ks.Transform.toString(u),transformOrigin:o&&r?Gs(r,s):void 0,transition:"function"==typeof d?d(r):d,...l};return Ts.createElement(n,{className:a,style:p,ref:t},i)}),Oc={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:ks.Transform.toString(t)},{transform:ks.Transform.toString(n)}]},sideEffects:(Dc={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=Dc;if(null!=o&&o.active)for(const[e,n]of Object.entries(o.active))void 0!==n&&(r[e]=t.node.style.getPropertyValue(e),t.node.style.setProperty(e,n));if(null!=o&&o.dragOverlay)for(const[e,t]of Object.entries(o.dragOverlay))void 0!==t&&n.node.style.setProperty(e,t);return null!=i&&i.active&&t.node.classList.add(i.active),null!=i&&i.dragOverlay&&n.node.classList.add(i.dragOverlay),function(){for(const[e,n]of Object.entries(r))t.node.style.setProperty(e,n);null!=i&&i.active&&t.node.classList.remove(i.active)}})};var Dc;function jc(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return us((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=oc(i);if(!l)return;const{transform:c}=is(i).getComputedStyle(i),d=al(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Oc,...e};return e=>{let{active:i,dragOverlay:a,transform:s,...l}=e;if(!t)return;const c={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},d={scaleX:1!==s.scaleX?i.rect.width*s.scaleX/a.rect.width:1,scaleY:1!==s.scaleY?i.rect.height*s.scaleY/a.rect.height:1},u={x:s.x-c.x,y:s.y-c.y,...d},p=o({...l,active:i,dragOverlay:a,transform:{initial:s,final:u}}),[h]=p,m=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(m))return;const f=null==r?void 0:r({active:i,dragOverlay:a,...l}),g=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{g.onfinish=()=>{null==f||f(),e()}})}}(t);return kl(s,o.draggable.measure),u({active:{id:e,data:a.data,node:s,rect:o.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:d})})}let Tc=0;function Mc(e){return Fs(()=>{if(null!=e)return Tc++,Tc},[e])}const Lc=Ts.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:a,wrapperElement:s="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:u,activeNodeRect:p,containerNodeRect:h,draggableNodes:m,droppableContainers:f,dragOverlay:g,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:x,windowRect:w}=Ls(pc),_=Ls(vc),k=Mc(null==u?void 0:u.id),C=gc(a,{activatorEvent:d,active:u,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:g.rect,over:v,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:x,transform:_,windowRect:w}),E=Jl(p),S=jc({config:r,draggableNodes:m,droppableContainers:f,measuringConfiguration:b}),A=E?g.setRef:void 0;return Ts.createElement(Ec,null,Ts.createElement(kc,{animation:S},u&&k?Ts.createElement(Rc,{key:k,id:u.id,ref:A,as:s,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:E,style:{zIndex:c,...o},transform:C},n):null))}),qc=t,{useEffect:Nc}=t,{useRef:Ic}=t,Fc=n,{styled:Pc}=r,{Chip:Bc}=i,{color:$c}=a,{renderMath:zc}=d;function Wc(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const Kc=Pc("span")(({theme:e,disabled:t})=>({border:`solid 0px ${e.palette.primary.main}`,borderRadius:e.spacing(2),margin:e.spacing(.5),transform:"translate(0, 0)",display:"inline-flex",...t&&{}})),Hc=Pc(Bc)(()=>({backgroundColor:$c.white(),border:`1px solid ${$c.text()}`,color:$c.text(),alignItems:"center",display:"inline-flex",height:"initial",minHeight:"32px",fontSize:"inherit",whiteSpace:"pre-wrap",maxWidth:"374px",pointerEvents:"none",borderRadius:"3px",paddingTop:"12px",paddingBottom:"12px","&.Mui-disabled":{opacity:1}})),Uc=Pc("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function Xc({choice:e,disabled:t,instanceId:n}){const r=Ic(null),{attributes:o,listeners:i,setNodeRef:a,isDragging:s}=wc({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return Nc(()=>{zc(r.current)},[e.value]),qc.createElement(Kc,{ref:a,style:s?{width:Wc([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:Wc([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...o},qc.createElement(Hc,{clickable:!1,disabled:t,ref:r,label:qc.createElement(Uc,{dangerouslySetInnerHTML:{__html:e.value}})}))}Xc.propTypes={choice:Fc.object.isRequired,disabled:Fc.bool,instanceId:Fc.oneOfType([Fc.string,Fc.number])};const Vc=t,Yc=n,{DragDroppablePlaceholder:Jc}=p;class Qc extends Vc.Component{constructor(...e){super(...e),Qc.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:Yc.bool,duplicates:Yc.bool,choices:Yc.arrayOf(Yc.shape({label:Yc.string,value:Yc.string})),value:Yc.object,choicePosition:Yc.string.isRequired,instanceId:Yc.string}}__init(){this.getStyleForWrapper=()=>{const{choicePosition:e}=this.props;switch(e){case"above":return{margin:"0 0 40px 0"};case"below":return{margin:"40px 0 0 0"};case"right":return{margin:"0 0 0 40px"};default:return{margin:"0 40px 0 0"}}}}render(){const{disabled:e,duplicates:t,choices:n,value:r,instanceId:o}=this.props,i=n.filter(e=>{if(!0===t)return!0;const n=function(e,t){var n;return fn(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}(r,un(t=>t===e.id));return void 0===n}),a={...this.getStyleForWrapper(),minWidth:"100px"};return Vc.createElement("div",{style:a},Vc.createElement(Jc,{disabled:e,instanceId:o},i.map((t,n)=>Vc.createElement(Xc,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}Qc.__initStatic();const Zc=t,{useEffect:Gc}=t,{useRef:ed}=t,{useState:td}=t,nd=n,rd=o,{styled:od}=r,{Chip:id}=i,ad=s,{color:sd}=a,{renderMath:ld}=d;function cd(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}rd("pie-lib:mask-markup:blank");const dd=od("span")(({dragged:e,over:t})=>({border:`solid 0px ${sd.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),ud=od(id)(()=>({backgroundColor:sd.background(),border:`2px dashed ${sd.text()}`,touchAction:"none",color:sd.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${h[500]}`,backgroundColor:`${h[300]}`},"&.correct":{border:`solid 1px ${sd.correct()}`},"&.incorrect":{border:`solid 1px ${sd.incorrect()}`},"&.Mui-disabled":{opacity:1}})),pd=od("span")(()=>({whiteSpace:"normal",pointerEvents:"none","& img":{display:"block",padding:"2px 0"},"& p":{marginTop:"0",marginBottom:"0"},"& mjx-frac":{fontSize:"120% !important"},"&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.hidden":{color:"transparent",opacity:0},"&.dragged":{position:"absolute",left:16,maxWidth:"60px",top:"50%",transform:"translateY(-50%)"}}));function hd({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s}){const l=ed(null),c=ed(null),d=ed(null),[u,p]=td({height:0,width:0}),h=()=>{f()},m=()=>{const e=cd([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=h:setTimeout(()=>{f()},300)},f=()=>{if(c.current&&l.current){l.current.style.width="auto",l.current.style.height="auto",l.current.offsetHeight;const e=(()=>{if(!c.current)return null;if(c.current.querySelector("mjx-container")&&c.current.parentElement)return c.current.parentElement;return c.current.querySelector("img")||c.current})()||c.current,t=e.getBoundingClientRect(),n=(t.width||e.offsetWidth||0)+24,r=Math.max(t.height||0,e.offsetHeight||0,e.scrollHeight||0,c.current.scrollHeight||0)+24,o=parseFloat(a)||0,i=parseFloat(s)||0,d=n<=o?o:n,u=r<=i?i:r;p(e=>({width:d>o?d:e.width,height:u>i?u:e.height})),l.current.style.width=`${d}px`,l.current.style.height=`${u}px`}};Gc(()=>{m()},[]),Gc(()=>{l.current&&ld(l.current)},[n,cd([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),Gc(()=>{t?m():p({height:0,width:0})},[t]),Gc(()=>{n||r||(d.current={width:l.current.offsetWidth,height:l.current.offsetHeight})},[t,n,r]);const g=o&&n&&o.choice&&o.choice.value,v=t&&t.value,b=n||r?{width:cd([d,"access",e=>e.current,"optionalAccess",e=>e.width]),height:cd([d,"access",e=>e.current,"optionalAccess",e=>e.height])}:(()=>{const e=isNaN(parseFloat(a))?0:parseFloat(a),t=isNaN(parseFloat(s))?0:parseFloat(s);return{...{height:u.height||t,width:u.width||e},...e?{}:{minWidth:90},...t?{}:{minHeight:32}}})();return Zc.createElement(ud,{clickable:!1,disabled:e,ref:l,component:"span",label:Zc.createElement(Zc.Fragment,null,Zc.createElement(pd,{ref:c,draggable:!0,className:ad({over:n,hidden:g}),dangerouslySetInnerHTML:{__html:v||""}}),g&&Zc.createElement(pd,{draggable:!0,className:ad({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:g||""}})),className:ad({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:b})}function md({id:e,disabled:t,duplicates:n,choice:r,correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}){const{attributes:c,listeners:d,setNodeRef:u,transform:p,isDragging:h}=wc({id:`mask-blank-drag-${e}`,disabled:t||!r,data:{id:e,choice:r,instanceId:l,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:m,isOver:f,active:g}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=vs("Droppable"),{active:a,dispatch:s,over:l,measureDroppableContainers:c}=Ls(uc),d=Ps({disabled:n}),u=Ps(!1),p=Ps(null),h=Ps(null),{disabled:m,updateMeasurementsFor:f,timeout:g}={..._c,...o},v=ps(null!=f?f:r),b=Ql({callback:Is(()=>{u.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),h.current=null},g)):u.current=!0},[g]),disabled:m||!a}),y=Is((e,t)=>{b&&(t&&(b.unobserve(t),u.current=!1),e&&b.observe(e))},[b]),[x,w]=ms(y),_=ps(t);return qs(()=>{b&&x.current&&(b.disconnect(),u.current=!1,b.observe(x.current))},[x,b]),qs(()=>(s({type:Js.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:p,data:_}}),()=>s({type:Js.UnregisterDroppable,key:i,id:r})),[r]),qs(()=>{n!==d.current.disabled&&(s({type:Js.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,s]),{active:a,rect:p,isOver:(null==l?void 0:l.id)===r,node:x,over:l,setNodeRef:w}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),v={transform:ks.Translate.toString(p)};return Zc.createElement(dd,{ref:e=>{u(e),m(e)},style:v,dragged:h,over:f,...c,...d},Zc.createElement(hd,{id:e,disabled:t,duplicates:n,choice:r,isOver:f,dragItem:cd([g,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}))}hd.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},hd.propTypes={id:nd.oneOfType([nd.string,nd.number]),disabled:nd.bool,duplicates:nd.bool,choice:nd.object,isOver:nd.bool,dragItem:nd.object,correct:nd.bool,onChange:nd.func,emptyResponseAreaWidth:nd.oneOfType([nd.string,nd.number]),emptyResponseAreaHeight:nd.oneOfType([nd.string,nd.number]),instanceId:nd.string},md.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},md.propTypes={id:nd.oneOfType([nd.string,nd.number]),disabled:nd.bool,duplicates:nd.bool,choice:nd.object,correct:nd.bool,onChange:nd.func,emptyResponseAreaWidth:nd.oneOfType([nd.string,nd.number]),emptyResponseAreaHeight:nd.oneOfType([nd.string,nd.number]),instanceId:nd.string};const fd=t,gd=n,{DragProvider:vd}=p;function bd(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const yd=Ja("blank",e=>(t,n,r)=>{const o=bd([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("blank"===o.component){const{disabled:i,duplicates:a,correctResponse:s,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,instanceId:p,isDragging:h}=e,m=c?s[o.id]:n[o.id],f=m&&e.choices.find(e=>e.id===m);return fd.createElement(md,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:a,choice:f,id:o.id,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,onChange:(e,t)=>{const o={...n};void 0===t?delete o[e]:o[e]=t,r(o)},instanceId:p,isDragging:h})}});class xd extends fd.Component{constructor(e){super(e),xd.prototype.__init.call(this),xd.prototype.__init2.call(this),xd.prototype.__init3.call(this),xd.prototype.__init4.call(this),this.state={activeDragItem:null,dropAnimation:void 0}}static __initStatic(){this.propTypes={markup:gd.string,layout:gd.object,choicesPosition:gd.string,choices:gd.array,value:gd.object,onChange:gd.func,duplicates:gd.bool,disabled:gd.bool,feedback:gd.object,correctResponse:gd.object,showCorrectAnswer:gd.bool,emptyResponseAreaWidth:gd.oneOfType([gd.string,gd.number]),emptyResponseAreaHeight:gd.oneOfType([gd.string,gd.number]),instanceId:gd.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;bd([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current])&&this.setState({activeDragItem:t.data.current,dropAnimation:void 0})}}__init2(){this.renderDragOverlay=()=>{const{activeDragItem:e}=this.state;return e&&"MaskBlank"===e.type?fd.createElement(Xc,{disabled:e.disabled,choice:e.choice,instanceId:e.instanceId}):null}}__init3(){this.handleDragEnd=e=>{const{active:t,over:n}=e,{onChange:r,value:o}=this.props,i=bd([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),a=bd([n,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),s=!!t&&!!n&&"MaskBlank"===bd([i,"optionalAccess",e=>e.type])&&bd([a,"optionalAccess",e=>e.accepts,"optionalAccess",e=>e.includes,"call",e=>e("MaskBlank")]);if(this.setState({activeDragItem:null,dropAnimation:s?null:void 0}),!s||!r)return;const l=i,c=a.id;if(!0===a.toChoiceBoard){if(!l.fromChoice&&l.id){const e={...o};delete e[l.id],r(e)}}else if(!0===l.fromChoice){if(c&&"drag-in-the-blank-droppable"!==c){const e={...o};e[c]=l.choice.id,r(e)}}else if(l.id&&l.id!==c){const e={...o};e[c]=l.choice.id,delete e[l.id],r(e)}}}__init4(){this.getPositionDirection=e=>{let t,n,r;switch(e){case"left":t="row",r="center";break;case"right":t="row-reverse",n="flex-end",r="center";break;case"below":t="column-reverse";break;default:t="column"}return{flexDirection:t,justifyContent:n,alignItems:r}}}render(){const{markup:e,duplicates:t,value:n,onChange:r,choicesPosition:o,choices:i,correctResponse:a,disabled:s,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,layout:p,instanceId:h}=this.props,m=o||"below",f={display:"flex",minWidth:"100px",...this.getPositionDirection(m)};return fd.createElement(vd,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:nl},fd.createElement("div",{ref:e=>this.rootRef=e,style:f},fd.createElement(Qc,{choicePosition:m,choices:i,value:n,duplicates:t,disabled:s,instanceId:h}),fd.createElement(yd,{elementType:"drag-in-the-blank",markup:e,layout:p,value:n,choices:i,onChange:r,disabled:s,duplicates:t,feedback:l,correctResponse:a,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,instanceId:h,isDragging:!!this.state.activeDragItem}),fd.createElement(Lc,{style:{pointerEvents:"none"},dropAnimation:this.state.dropAnimation},this.renderDragOverlay())))}}xd.__initStatic(),xd.__initStatic2();const wd=t,{styled:_d}=r,kd=s,{color:Cd}=a;function Ed(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}let Sd,Ad;"undefined"!=typeof window&&(Sd=require("@pie-lib/editable-html-tip-tap").default,Ad=_d(Sd)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${Cd.black()}`,"&.correct":{border:`1px solid ${Cd.correct()}`},"&.incorrect":{border:`1px solid ${Cd.incorrect()}`}})));Ja("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:a,maxLength:s,spellCheck:l,pluginProps:c,onChange:d}=e,u=Ed([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("input"===u.component){const p=(e.choices&&u&&e.choices[u.id]||[])[0],h=a?p&&p.label:n[u.id]||"",m=s&&s[u.id],f=i&&i[u.id],g=a||"correct"===f,v=!a&&"incorrect"===f,b=e=>{const t={...n,[u.id]:e};d(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return wd.createElement(Ad,{id:u.id,key:`${t.type}-input-${u.id}`,disabled:a||o,disableUnderline:!0,onChange:b,markup:h||"",charactersLimit:r?m:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,adjustWidthForLimit:!0,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!Ed([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:kd({correct:g,incorrect:v})})}});var Rd=Ja("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const Od=t,Dd=n,{Button:jd}=i,{InputLabel:Td}=i,{Menu:Md}=i,{MenuItem:Ld}=i,{ArrowDropDown:qd}=l,{ArrowDropUp:Nd}=l,{Close:Id}=l,{Check:Fd}=l,{styled:Pd}=r,{color:Bd}=a,{renderMath:$d}=d,zd=Pd(jd)(()=>({color:Bd.text(),border:`1px solid ${Bd.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:Bd.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"5px"},"& svg":{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:Bd.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${Bd.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:Bd.correct(),color:`${Bd.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:Bd.incorrectWithIcon(),color:`${Bd.text()} !important`}})),Wd=Pd(Md)(()=>({backgroundColor:Bd.background(),border:`1px solid ${Bd.correct()} !important`,"&:hover":{border:`1px solid ${Bd.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${Bd.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),Kd=Pd(Ld)(()=>({height:24,overflow:"hidden",fontSize:"1rem",fontWeight:400,fontFamily:"inherit",lineHeight:"1.5em",whiteSpace:"nowrap",color:Bd.text(),backgroundColor:Bd.background(),"&.Mui-focusVisible":{outline:`3px solid ${Bd.tertiary()}`,outlineOffset:"-1px",color:Bd.text(),backgroundColor:Bd.background()},"&:hover":{color:Bd.text(),backgroundColor:Bd.dropdownBackground()},boxSizing:"border-box",padding:"25px",borderRadius:"4px","&.selected":{color:`${Bd.text()} !important`,backgroundColor:`${Bd.background()} !important`,"&:hover":{color:Bd.text(),backgroundColor:`${Bd.dropdownBackground()} !important`}}})),Hd=Pd("span")(()=>({fontSize:"max(1rem, 14px)"})),Ud=Pd("span")(()=>({fontSize:"max(1rem, 14px)",position:"absolute",right:"10px"})),Xd=Pd(Td)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),Vd=Pd(Fd)(()=>({color:`${Bd.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:Bd.correct()},"&.incorrect":{backgroundColor:Bd.incorrectWithIcon()}})),Yd=Pd(Id)(()=>({color:`${Bd.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:Bd.correct()},"&.incorrect":{backgroundColor:Bd.incorrectWithIcon()}}));class Jd extends Od.Component{static __initStatic(){this.propTypes={id:Dd.string,value:Dd.string,disabled:Dd.bool,onChange:Dd.func,correct:Dd.bool,choices:Dd.arrayOf(Dd.shape({value:Dd.string,label:Dd.string})),showCorrectAnswer:Dd.bool,singleQuery:Dd.bool,correctValue:Dd.string}}constructor(e){super(e),Jd.prototype.__init.call(this),Jd.prototype.__init2.call(this),Jd.prototype.__init3.call(this),Jd.prototype.__init4.call(this),Jd.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=Od.createRef(),this.buttonRef=Od.createRef(),this.previewRef=Od.createRef(),this.elementRefs=[]}componentDidMount(){this.hiddenRef.current&&null===this.state.menuWidth&&this.setState({menuWidth:this.hiddenRef.current.clientWidth})}componentDidUpdate(e,t){const n=this.hiddenRef.current;if(!t.anchorEl&&this.state.anchorEl&&this.elementRefs.forEach(e=>{if(!e)return;const t=e.querySelector("[data-latex], [data-raw]"),n=e.querySelector("mjx-container"),r=e.querySelector('[data-math-handled="true"]');!t||r&&n||$d(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&$d(e)}),$d(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>this.setState({anchorEl:e.currentTarget})}__init2(){this.handleClose=()=>{const{value:e}=this.props;this.setState({anchorEl:null,previewValue:null,highlightedOptionId:null}),!e&&this.previewRef.current&&(this.previewRef.current.innerHTML="")}}__init3(){this.handleHighlight=e=>{const t={highlightedOptionId:`dropdown-option-${this.props.id}-${e}`};this.props.value||(t.previewValue=this.props.choices[e].value),this.setState(t)}}__init4(){this.handleSelect=(e,t)=>{this.props.onChange(this.props.id,e),this.handleHighlight(t),this.handleClose()}}__init5(){this.handleHover=e=>{if(this.props.value)return;const t=`dropdown-option-${this.props.id}-${e}`,n=this.state.previewValue;this.setState({highlightedOptionId:t,previewValue:n},()=>{const t=this.elementRefs[e],n=this.previewRef.current;t&&n&&(n.innerHTML=t.innerHTML)})}}getLabel(e,t){const n=(e||[]).find(e=>e.value===t);return n?n.label.trim():void 0}render(){const{id:e,correct:t,disabled:n,value:r,choices:o,showCorrectAnswer:i,singleQuery:a,correctValue:s}=this.props,{anchorEl:l}=this.state,c=Boolean(l),d=`dropdown-button-${e}`,u=`dropdown-menu-${e}`,p=`dropdown-value-${e}`;let h;this.elementRefs=[],n&&void 0!==t&&(h=t||i?"disabledCorrect":"disabledIncorrect");const m=parseInt(e,10)+1,f=a?"Query-label":`Query-label-${m}`,g=a?"Query":`Query ${m}`;let v=null;return n&&void 0!==t&&(v=t||i?Od.createElement(Vd,{className:"correct"}):Od.createElement(Yd,{className:"incorrect"})),Od.createElement(Od.Fragment,null,Od.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>Od.createElement(Kd,{key:t,tabIndex:-1,"aria-hidden":"true"},Od.createElement(Hd,{dangerouslySetInnerHTML:{__html:e.label}})))),Od.createElement(Xd,{id:f,tabIndex:-1,"aria-hidden":"true"},g),Od.createElement(zd,{ref:this.buttonRef,style:{...this.state.menuWidth&&{minWidth:`calc(${this.state.menuWidth}px + 8px)`},borderWidth:c?"2px":"1px",transition:"border-width 0.2s ease-in-out"},"aria-controls":c?u:void 0,"aria-haspopup":"listbox","aria-expanded":c?"true":void 0,"aria-activedescendant":this.state.highlightedOptionId,onClick:this.handleClick,className:h,disabled:n,id:d,role:"combobox","aria-label":`Select an option for ${g}`,"aria-labelledby":p},v,Od.createElement(Hd,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:s||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?Od.createElement(Nd,null):Od.createElement(qd,null)),Od.createElement(Wd,{id:u,anchorEl:l,keepMounted:!0,open:c,onClose:this.handleClose,getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},transitionDuration:{enter:225,exit:195},slotProps:{paper:this.state.menuWidth?{style:{minWidth:this.state.menuWidth,padding:"4px"}}:void 0,list:{"aria-labelledby":d,role:"listbox",disablePadding:!0}}},(o||[]).map((t,n)=>{const o=`dropdown-option-${e}-${n}`;return Od.createElement(Kd,{id:o,className:t.value===r?"selected":"",key:`${t.label}-${n}`,value:t.value,onClick:()=>this.handleSelect(t.value,n),role:"option","aria-selected":this.state.highlightedOptionId===o?"true":void 0,onMouseOver:()=>this.handleHover(n)},Od.createElement(Hd,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),Od.createElement(Ud,{dangerouslySetInnerHTML:{__html:t.value===r?" &check;":""}}))})))}}Jd.__initStatic();const Qd=t;Ja("dropdown",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("dropdown"===o.component){const{choices:i,disabled:a,feedback:s,showCorrectAnswer:l}=e,c=i&&i[o.id]&&i[o.id].find(e=>e.correct),d=l?c&&c.value:n[o.id];return Qd.createElement(Jd,{key:`${t.type}-dropdown-${o.id}`,correct:s&&s[o.id]&&"correct"===s[o.id],disabled:a||l,value:d,correctValue:l?c&&c.label:void 0,id:o.id,onChange:r,choices:i[o.id],showCorrectAnswer:l,singleQuery:1==Object.keys(i).length})}});const Zd=t,Gd=n,{styled:eu}=r,{Tooltip:tu}=i,{color:nu}=a,{Collapsible:ru}=a,{Readable:ou}=a,{hasText:iu}=a,{hasMedia:au}=a,{PreviewPrompt:su}=a,{UiLayout:lu}=a,cu=c,du=e,{renderMath:uu}=d,pu=u;function hu(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const mu=eu(lu)({color:nu.text(),backgroundColor:nu.background(),display:"inline-block"}),fu=eu("div")({width:"100%",position:"relative",backgroundColor:nu.background(),color:nu.text()}),gu=eu("div")(({theme:e})=>({marginBottom:e.spacing(2)})),vu=eu("div")(({theme:e})=>({marginBottom:e.spacing(2)})),bu=eu("div")({position:"relative","& > div > div":{display:"flex",alignItems:"baseline",flexWrap:"wrap"},"& .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}}),yu=eu("div")(({theme:e,$incorrect:t,$correct:n,$showCorrectness:r,$correctAnswerShown:o})=>({maxWidth:"fit-content",...t&&{borderColor:`${nu.incorrect()} !important`},...n&&{borderColor:`${nu.correct()} !important`},...r&&{border:"2px solid"},...o&&{padding:e.spacing(1),letterSpacing:"0.5px"},"& > .mq-math-mode":{"& > .mq-root-block":{"& > .mq-editable-field":{minWidth:"10px",padding:e.spacing(.25)}},"& sup":{top:0}}})),xu=eu(gi)({"& > .mq-root-block":{"& > .mq-editable-field":{borderColor:nu.text()}}}),wu=eu("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),_u=eu("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),ku=eu("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),Cu=eu("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Eu=eu(cu)(({theme:e})=>({color:nu.text(),marginBottom:e.spacing(2)}));if("undefined"!=typeof document){const e="math-templated-main-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 flex: 2;\n color: grey;\n background: rgba(0, 0, 0, 0.04);\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 }\n .block-math {\n color: ${nu.text()};\n background-color: ${nu.background()};\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 8;\n }\n .block-math > .mq-math-mode > .mq-hasCursor > .mq-cursor {\n display: none;\n }\n .correct {\n border-color: ${nu.correct()} !important;\n }\n .incorrect {\n border-color: ${nu.incorrect()} !important;\n }\n `,document.head.appendChild(t)}}let Su=!1;const Au=/(\{\{\d+\}\})/gm,Ru=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function Ou(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function Du(e,t){const{responses:n,disabled:r,markup:o,printMode:i,alwaysShowCorrect:a}=e||{};if(o){if(t.showCorrect)return Object.keys(n||{}).reduce((e,t)=>(e[t]=hu([n,"optionalAccess",e=>e[t],"optionalAccess",e=>e.answer]),e),{});return o.split(Au).filter(e=>e).reduce((e,n)=>{if(n.match(Au)){const o=ju.getResponseKey(n),s=t.session.answers[`r${o}`];if(i&&!a){const t="\\ \\ ".repeat(30)+"\\embed{newLine}[] ";return{...e,[o]:`\\MathQuillMathField[r${o}]{${t.repeat(3)}}`}}return r?{...e,[o]:`\\embed{answerBlock}[r${o}]`}:{...e,[o]:`\\MathQuillMathField[r${o}]{${s&&s.value||""}}`}}return e},{})}}class ju extends Zd.Component{static __initStatic(){this.getResponseKey=e=>(e||"").replaceAll("{{","").replaceAll("}}","")}static __initStatic2(){this.propTypes={session:Gd.object.isRequired,onSessionChange:Gd.func,model:Gd.object.isRequired}}constructor(e){super(e),ju.prototype.__init.call(this),ju.prototype.__init2.call(this),ju.prototype.__init3.call(this),ju.prototype.__init4.call(this),ju.prototype.__init5.call(this),ju.prototype.__init6.call(this),ju.prototype.__init7.call(this),ju.prototype.__init8.call(this),ju.prototype.__init9.call(this),ju.prototype.__init10.call(this),ju.prototype.__init11.call(this),ju.prototype.__init12.call(this),ju.prototype.__init13.call(this);const t={},{model:n,session:r}=e||{},{markup:o,alwaysShowCorrect:i}=n||{},{answers:a}=r||{};o&&(o||"").replace(Au,e=>{const n=ju.getResponseKey(e),r=a&&a[`r${n}`];t[`r${n}`]={value:hu([r,"optionalAccess",e=>e.value])||""}}),this.state={session:{...e.session,answers:t},activeAnswerBlock:"",showCorrect:i||!1,tooltipContainerRef:Zd.createRef()}}UNSAFE_componentWillMount(){if("undefined"!=typeof window){let e=pu.getInterface(3);Su||(e.registerEmbed("answerBlock",e=>({htmlString:`<div class="block-container">\n <div class="block-response" id="${e}Index">R</div>\n <div class="block-math">\n <span id="${e}"></span>\n </div>\n </div>`,text:()=>"text",latex:()=>`\\embed{answerBlock}[${e}]`})),Su=!0)}}__init(){this.handleAnswerBlockDomUpdate=()=>{const{model:e}=this.props,{session:t,showCorrect:n}=this.state,r=t.answers;this.root&&e.disabled&&!n&&Object.keys(r).forEach(t=>{const n=this.root.querySelector(`#${t}`),o=this.root.querySelector(`#${t}Index`);if(n){let i=pu.getInterface(3);const a=r[t];n.textContent=a&&a.value||"",e.view&&(n.parentElement.parentElement.classList.remove("correct"),n.parentElement.parentElement.classList.remove("incorrect")),i.StaticMath(n),o.textContent="R"}}),uu(this.root)}}UNSAFE_componentWillReceiveProps(e){const{model:t}=this.props,{model:n={}}=e||{},{markup:r="",env:o={}}=t||{},{markup:i="",env:a={},alwaysShowCorrect:s=!1}=n,l=e=>e&&"evaluate"===e.mode;l(o)&&l(a)||this.setState(e=>({...e.session,showCorrect:!1})),s&&this.setState({showCorrect:!0});const c=r.match(Au),d=i.match(Au);if(!_n(c,d)){const e={},t=this.state.session.answers;(d||[]).forEach(n=>{const r=ju.getResponseKey(n),o=t&&t[`r${r}`];e[`r${r}`]={value:hu([o,"optionalAccess",e=>e.value])||""}}),this.setState(t=>({session:{...t.session,answers:e}}),()=>{this.props.onSessionChange(this.state.session),this.handleAnswerBlockDomUpdate()})}}shouldComponentUpdate(e,t){const n=_n(this.props.model,e.model),r=_n(this.state,t);return!n||!r}componentDidMount(){this.handleAnswerBlockDomUpdate(),setTimeout(()=>uu(this.root),100)}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init2(){this.onSubFieldFocus=e=>{this.setState({activeAnswerBlock:e})}}__init3(){this.toNodeData=e=>{if(!e)return;const{type:t,value:n}=e;return"command"===t||"cursor"===t?e:"answer"===t?{type:"answer",...e}:"clear"===n?{type:"clear"}:{type:"write",value:n}}}__init4(){this.setInput=e=>{this.input=e}}__init5(){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()}}__init6(){this.callOnSessionChange=()=>{const{onSessionChange:e}=this.props;e&&e(this.state.session)}}__init7(){this.toggleShowCorrect=e=>{this.setState({showCorrect:e},this.handleAnswerBlockDomUpdate)}}__init8(){this.subFieldChanged=(e,t)=>{$o(),e&&this.setState(n=>({session:{...n.session,answers:{...n.session.answers,[e]:{value:t}}}}),this.callOnSessionChange)}}__init9(){this.getFieldName=(e,t)=>{const{answers:n}=this.state.session;if(Object.keys(n||{}).length){return Object.keys(n).find(n=>{const r=t[n];return r&&r.id==e.id})}}}__init10(){this.onBlur=e=>{const{relatedTarget:t,currentTarget:n}=e||{};const r=function e(t,n=0){if(!t||n>=16)return null;const r=t.offsetParent;return r?"tooltip"===r.getAttribute("role")?r:e(r,n+1):null}(t),o=r?function e(t,n=0){if(!t||n>=4)return null;const r=hu([t,"optionalAccess",e=>e.children,"optionalAccess",e=>e[0]]);return r?r.attributes&&r.attributes["data-keypad"]?r:e(r,n+1):null}(r):null;t&&n&&hu([o,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&Ru){const e=document.querySelector("[role='tooltip']");if(e){e.firstChild.setAttribute("tabindex","-1")}}},1)}__init11(){this.renderTeacherInstructions=()=>{const{model:e}=this.props,{teacherInstructions:t,animationsDisabled:n}=e||{},r=t&&(iu(t)||au(t)),o=Zd.createElement(su,{defaultClassName:"teacher-instructions",prompt:t});return r&&Zd.createElement(vu,null,n?o:Zd.createElement(ru,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},o))}}__init12(){this.renderRationale=()=>{const{model:e}=this.props,{rationale:t,animationsDisabled:n}=e||{},r=Zd.createElement(su,{prompt:t});return t&&(iu(t)||au(t))&&Zd.createElement(vu,null,n?r:Zd.createElement(ru,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},r))}}__init13(){this.renderPlayerContent=()=>{const{model:e}=this.props,{activeAnswerBlock:t,showCorrect:n,session:r,tooltipContainerRef:o}=this.state,{correctness:i,disabled:a,view:s,responses:l,equationEditor:c,customKeys:d,feedback:u,env:{mode:p}={},printMode:h,alwaysShowCorrect:m}=e||{},f=wn(l),g=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(d),v=Du(e,this.state)||"",b=h&&!m;return Zd.createElement(bu,null,Zd.createElement(Rd,{disabled:a,markup:e.markup,value:{},customMarkMarkupComponent:e=>{const l="evaluate"===p&&u&&u[e],d=Zd.createElement(xu,{ref:e=>{this.mqStatic=e||this.mqStatic},latex:v[e],onSubFieldChange:this.subFieldChanged,getFieldName:this.getFieldName,setInput:this.setInput,onSubFieldFocus:this.onSubFieldFocus,onBlur:this.onBlur});return Zd.createElement(yu,{ref:o,$incorrect:!f&&!l&&!n,$correct:!f&&(l||n),$showCorrectness:!f&&a&&i&&!s,$correctAnswerShown:n},Zd.createElement(tu,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:t===`r${e}`,slotProps:{popper:{container:hu([o,"optionalAccess",e=>e.current])||void 0,placement:"bottom-end",sx:{backgroundColor:"transparent",width:"650px",opacity:1,"& .MuiTooltip-arrow":{display:"none"}},modifiers:{preventOverflow:{enabled:!0,boundariesElement:"body"},flip:{enabled:!1}}},tooltip:{sx:{fontSize:"initial",backgroundColor:"transparent",width:"600px",marginTop:0,paddingTop:0,boxShadow:"none"}}},title:Object.keys(r.answers).map(e=>e===t&&!(n||a)&&Zd.createElement(wu,{"data-keypad":!0,key:e,style:{width:Ou(g,c)}},Zd.createElement(Ni,{additionalKeys:g,mode:c||6,onClick:this.onClick}))||null)},b?Zd.createElement(_u,null,d):Zd.createElement("div",null,d)))}}))}}render(){const{model:e}=this.props,{showCorrect:t}=this.state,{prompt:n,env:{mode:r,role:o}={},extraCSSRules:i,correctness:a,responses:s,language:l,showNote:c,note:d}=e||{},u=!wn(s)&&a&&"correct"!==a.correctness,p=(t||"view"===r&&"instructor"===o)&&c&&d;return Zd.createElement(mu,{extraCSSRules:i,ref:e=>{const t=du.findDOMNode(e);this.root=t||this.root}},Zd.createElement(fu,null,"gather"===r&&Zd.createElement(ku,null,"Math Equation Response Question"),Zd.createElement(fu,null,u&&Zd.createElement(Eu,{language:l,show:!0,toggled:t,onToggle:this.toggleShowCorrect})),this.renderTeacherInstructions(),n&&Zd.createElement(gu,null,Zd.createElement(su,{prompt:n})),Zd.createElement(ou,{false:!0},this.renderPlayerContent()),p&&Zd.createElement(Cu,{className:"note",dangerouslySetInnerHTML:{__html:d}}),this.renderRationale()))}}ju.__initStatic(),ju.__initStatic2();const Tu=t,Mu=o,{renderMath:Lu}=d,qu=Mu("pie-element:math-templated:print");class Nu extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=yn(()=>{if(this._model&&this._session){const e=((e,t)=>{const n="instructor"===t.role;return e.prompt=!1!==e.promptEnabled?e.prompt:void 0,e.teacherInstructions=n&&!1!==e.teacherInstructionsEnabled?e.teacherInstructions:void 0,e.rationale=n&&!1!==e.rationaleEnabled?e.rationale:void 0,e.showTeacherInstructions=n,e.alwaysShowCorrect=n,e.printMode=!0,e.feedback=void 0,e.markup=e.markup||"{{0}}",{...e,disabled:!0,env:{mode:n?"evaluate":e.mode,role:t.role}}})(this._model,this._options),t=this._options&&Tu.createElement(ju,{model:e,session:{}});this._root||(this._root=m(this)),this._root.render(t),queueMicrotask(()=>{qu("render complete - render math"),Lu(this)})}else qu("skip")},50,{leading:!1,trailing:!0})}set options(e){this._options=e}set model(e){this._model=e,this._rerender()}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Nu as default};
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "6.2.0-next.5",
7
+ "version": "6.2.0-next.7",
8
8
  "description": "",
9
9
  "dependencies": {
10
10
  "@emotion/react": "^11.14.0",
@@ -13,8 +13,8 @@
13
13
  "@mui/material": "^7.3.4",
14
14
  "@pie-framework/pie-player-events": "^0.1.0",
15
15
  "@pie-lib/correct-answer-toggle": "3.2.0-next.7",
16
- "@pie-lib/mask-markup": "2.2.0-next.26",
17
- "@pie-lib/math-input": "7.2.0-next.11",
16
+ "@pie-lib/mask-markup": "2.2.0-next.29",
17
+ "@pie-lib/math-input": "7.2.0-next.12",
18
18
  "@pie-lib/math-rendering": "4.2.0-next.3",
19
19
  "@pie-lib/render-ui": "5.2.0-next.7",
20
20
  "prop-types": "^15.8.1",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "author": "",
25
25
  "license": "ISC",
26
- "gitHead": "8ea0e7941f890d257b94cf3c39ba643e755c900c",
26
+ "gitHead": "e9c9eb021e31f961170c60e147b17fc6a9f56957",
27
27
  "scripts": {
28
28
  "postpublish": "../../scripts/postpublish"
29
29
  },